0

I have an application where CSS are in pixels. When i call window.print() method it shows the exact window in popup. In case of same application which is having CSS in percentage - when i call window.print() method the UI is breaking in popup.

Why? How we can print without breaking CSS that uses percentage?

Mahbub Moon
  • 491
  • 2
  • 8
  • It's not clear what you're asking. Can you put a small example in a [snippet](https://stackoverflow.blog/2014/09/16/introducing-runnable-javascript-css-and-html-code-snippets/)? Otherwise you can hide and or change parts of your document for printing with a [css media query](https://developer.mozilla.org/en-US/docs/Web/CSS/@media). For example if you want the UI not to print and you have a `
    ` that surrounds all the UI elements the `@media print { #ui { display: none } }` will hide the UI when printing.
    – gman Dec 03 '19 at 09:01
  • You have a CSS media type `@media print` that you can use to redefine the scale (https://stackoverflow.com/questions/28757370/scale-html-table-before-printing-using-css/28757716) – Seblor Dec 03 '19 at 09:03
  • 1
    That is because your html document doesn't have the same size as your printing paper size. In your html, the rendered CSS is actually trying to put that in print popup but fails due to size mismatch. – Mahbub Moon Dec 03 '19 at 09:10
  • Thank you, this comment useful.@MahbubMoon – Thajuddin Syed Dec 03 '19 at 11:03

0 Answers0