Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

print stylesheet, one page prints and cuts off remaining text

Tags:

css

printing

I'm working on a printable list of events, the printer prints one page fine, but cuts off some of the text on the bottom, then it print a second blank page

I've tried everything I know but am at a loss.

like image 350
mjr Avatar asked Aug 21 '09 14:08

mjr


People also ask

Why is my printer printing cutting off words?

The Solution: The short fix is to choose File » Page Setup, click the Margins tab (see Figure 6-3), and adjust the bottom margin. But if you're frequently getting this problem, make sure that you're using the same paper size as the person who set up the document.

Why does my page get cut off when printing?

The most common cause of this problem is that the bottom margin, footer margin, or page border is outside the printable area of the page. All printers have an irreducible unprintable area necessitated by the mechanical requirements of paper handling.

How do you fix HTML elements being cut off when printing?

Use " overflow: auto " (or maybe " overflow: visible ") instead. Is the element itself, or a container, using " position: absolute " or " position: fixed ". You should use " position: static " (default positioning) for printing.

How do I print without cutting it off?

> Setup the right margins as paper size margins. > Use Scale to Fit to avoid cutting page head or bottom part off.


2 Answers

In print.css, set overflow: visible instead of overflow: auto on div#content. That fixed it for me in Firefox at least. The definition of overflow auto is: "If overflow is clipped, a scroll-bar should be added to see the rest of the content" -- but scroll bars don't exist on printed pages.

I'm guessing that since the content div should span across multiple pages, the browser thinks "you're flowing outside your container and must be clipped with a scroll bar". The container in that case is the first page the content div appears on.

like image 107
CalebD Avatar answered Sep 22 '22 19:09

CalebD


I know this is an old question but here's another, newer way this can happen.

Check if you're using display: flex; on the clipped element. It was the problem for me, setting it to block fixed it.

like image 26
red-X Avatar answered Sep 22 '22 19:09

red-X