I make a html like this with page counter:
<page backtop="100px" backbottom="50px">
<page_header>
TITLE
</page_header>
<page_footer>
<div align=right>Num.Pag.<b> [[page_cu]]/{nb}</div>
</page_footer>
<table>
<thead>
<tr><th>Col1</th><th>col2</th>
</thead>
<tbody>
<tr><td>Art1</td><td>10</td>
<tr><td>Art2</td><td>15</td>
<tr><td>Art3</td><td>12</td>
...
.. <!-- SUM 37 / page 1 -->
.
<tr><td>Art4</td><td>12</td>
<tr><td>Art5</td><td>12</td>
<tr><td>Art6</td><td>12</td>
...
.. <!-- SUM 73 / page 2 -->
.
<tr><td>Art4</td><td>10</td>
<tr><td>Art5</td><td>10</td>
<tr><td>Art6</td><td>10</td>
</tbody>
<tfoot>
<tr><td>SUM</td><td>103</td>
</tfoot>
</page>
The PDF create great but I need show on each page at the end of the table a sum of the numbers show on the page. Somthing like the pagination ¿any idea for automatic the process with the pagination?
I generate the HTML with PHP ;P
Thanks.
Spipu Le 22/02/2011 à 21:49Edité par Spipu le 23/02/2011 à 18:10 in the td, you put in a attribute the value to sum
in the tfoot, you use a tag like [MY_SUM]
in html2pdf, you modify the o_TD method, to sum this attribute (only when you are not in a subhtml)
in o_write, if [MY_SUM] is found, you replace and you init the sum
Spipu Le 23/02/2011 à 18:11 if possible, do a extends of HTML2PDF, it will be easier to update to a newest version of HTML2PDF