Question
1
Replies
798
Views
Posted: May 9, 2016
Last activity: May 12, 2016
How to insert page breaks in the PrintView harness?
Does anyone know of an easy way to insert page breaks in the PrintView harness?
I was thinking of using either JavaScript or adding a CSS style (e.g. page-break-before: always) on section headers. Would this work? Is there a better way?
Hi Marie,
Here's what I observed -
If I use the idea of using page-break-before:always or page-break-after:always with a simple markup like below...
<html>
<head></head>
<body>
<DIV>
<DIV>First page section content</DIV>
<DIV>
<DIV style="page-break-after:always"></DIV>
</DIV>
<DIV>Second page section content</DIV>
</DIV>
</body>
</html>
and do a print preview on the browser, I do see it work. (My tests are on Firefox)
But given that code generated by a pega section, or depending on what layout you use - you are dealing with a little more complex HTML markup like below...
<html>
<head></head>
<body>
<DIV>
<DIV>First page section content</DIV>
<DIV>
<table><tr><td>
<DIV style="page-break-after:always"></DIV>
</td></tr></table>
</DIV>
<DIV>Second page section content</DIV>
</DIV>
</body>
</html>
If I run the above and preview, I do not see the page break work.
On the basis of the above, I doubt whether this idea can apply and work given any markup.
Did you try a POC as well? Did this work out for you?
Thank you,
Sunny