Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Css to emulate scaling in Chrome

There is a print setting (Scale) in Chrome that I would like to emulate.

enter image description here

In IE11, I have added in the css and that seems to fix it but not in Chrome.

@page {
  size: A4 portrait;
  margin: 1mm 1mm 0 5mm;
}

In Chrome, I have to manually change the scale to 50 to fix it. I have tried in css

zoom: 50%
transform: scale(0.5);

UPDATE Now I know why it is working in IE11. Nothing to do with setting the A4 size. Looks like IE has a 'Shrink to Fit' settings that's turned on by default. I don't think there is a way to do in CSS.

like image 506
ove Avatar asked Jul 18 '18 07:07

ove


1 Answers

Finally found the answer.

It is because of the bootstrap css.

I implemented the fix below and it seems to work for now.

https://github.com/twbs/bootstrap/issues/12078

like image 130
ove Avatar answered Nov 16 '22 03:11

ove