Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Even page-break for double-sided printing in HTML & CSS

I've got page breaks working for print media with a quick page-break-after: always. I use these to separate multiple reports in a single batched print job. Unfortunately, when the print job is double-sided, the page break can cause the printer to start a report on the back of the previous report.

Is there any way to force a page break to an even page? Or, alternatively, to detect which page number a certain element will appear on?

like image 850
Riley Lark Avatar asked Nov 22 '11 16:11

Riley Lark


1 Answers

There is CSS functionality in the standard. You are on the right track. Use:

<div style="page-break-after: right">
-- your content --
</div>

The problem is, currently, the only major browser that supports this is Opera. Opera has its own finicky issues with printing though, but it might work for your situation.

like image 171
spekary Avatar answered Sep 21 '22 20:09

spekary