Hi,
I am new to PDFGenerator, but after looking for quite a while I did not seem to find a question, so I decided to post - and maybe help other people who have the same issue:
How do I a control page breaks when I transform an HTML document to PDF using PDFGenerator's htmlFileToPDF method.
I am trying to use page-break-after - but PDF Generator still creates a single page.
But It could be that this is actually a symptom of a wider problem: We have a nice HTML report, which uses media print in the CSS to create a printable version, which adds page breaks, and headers and footers on the printable page in the browser - How do I tell PDFGenerator, that I want it to render the HTML as media print ?
Here is the minimal HTML make I could come up with, which shows my approach for the page breaks:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<style type="text/css">
.pagebreak{
page-break-after:always;
}
</style>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>
2 page document
</title>
</head>
<body>
<p class="pagebreak">
This is the first page (with p class="pagebreak" )
</p>
<p>
This is the second page
</p>
</body>
</html>
Any suggestions are welcome
Thanks
Thomas