0

I want to generate 40 pages of some report from the database but first i want to generate a html file containing the 40 reports and then convert the html file to pdf.Each report is supposed to occupy one page of the resulting pdf document.

What should be the dimensions of each html report so that when i convert the entire html page containing the 40 reports,each report occupies exactly one page of the pdf document?.

Gandalf
  • 1
  • 29
  • 94
  • 165

1 Answers1

1

I would simply make the reports as concise as possible and then force a page break after each report

<p>This is raport 1</p>
<table>
    <tr><td>Line 1</td></tr>
    <tr><td>Line 2</td></tr>
    <tr><td>Line 3</td></tr>
</table>

<div class="EndOfRaport" style="page-break-before:always" />
<p>This is another raport</p>
<p>All is well in ponyville</p>

<div class="EndOfRaport" style="page-break-before:always" />
<p>This is a raport with a simple graph</p>
<img src="ponies.png" />

That way you don't really have to care about the contents and you can be assured that each raport is on it's own page or if it is too long it will spill into the next page. Then using headers and footers you can add the page independent elements if you need some.

Joel Peltonen
  • 13,025
  • 6
  • 64
  • 100