cssfirefoxprintingoverflow

Firefox prints only first page and cuts the page on the right


I had big trouble with printing from Firefox (any version, mine is 16.0.2, but even Aurora dev builds did the same). When printing the page, Shrink to fit in the Print preview doesn't work. Only way, how to fit the page onto the paper is selecting Zoom 70% in the same dialog. Other problem: it prints only first page. What to do?


Solution

  • I needed to adapt the CSS file for printing, so I've done one. It works flawlessly anywhere, but not in Firefox. What was the problem?

    First I've tried specifying Width and height for BODY and HTML in the print.css file. Than margins, etc.

    Later I figured out what was the problem: standard CSS file had the following in it:

    body {
     ...
     overflow-x: hidden;
     overflow-y: scroll;
    }
    

    So I've added the following into the print.css file:

    body {
     overflow-x: visible;
     overflow-y: visible;
    }
    

    I guess, if you had only overflow specified in the CSS, not -x & -y, you would need to specify only overflow:visible in the print.css file.

    Printing from Firefox works now as it should. I just thought, that this may help somebody, who has strange printing behavior happening in Firefox.