Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 884
Kokesh Avatar asked Nov 21 '12 16:11

Kokesh


People also ask

Why is Firefox only printing the first page?

All Replies (16) Hi kaveh. nasr, Firefox has problems paginating large blocks of content styled with certain rules. They look fine on screen, but when printed, Firefox won't break them across page boundaries so you only get one page of them.


2 Answers

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.

like image 75
Kokesh Avatar answered Nov 07 '22 20:11

Kokesh


In addition to the Kokesh's answer, some times attribute

display: table

generates this problem too. So you need change it to 'block' or another that fits to your requeriments.

like image 34
kaleemsagard Avatar answered Nov 07 '22 21:11

kaleemsagard