Hello.
I needed to insert manual page breaks into PDF documents I was creating, and modified the HTML2pdf class as per instructions at stackoverflow.com:
http://stackoverflow.com/questions/2117788/page-break-in-html2pdf
For example we want to parse a tag DIV:
html2pdf.class.php line 2948:
protected function _tag_close_DIV($param, $other='div')
{
if ($this->parsingCss->value['page-break-after'] == "always")
$this->_setNewPage();
...
}
parsingCss.class.php Line 114:
//add a new style declaration
public function initStyle()
{
...
$this->value['page-break-after'] = null;
}
Line 1024 add a new handler to the switch case:
case 'page-break-after':
$this->value[$nom] = $val;
break;
And then for it to work, your html content should contain the break element
<div style="page-break-after:always; clear:both"></div>
-----------------
The code worked and I was able to generate the page break, however, the first line of the new page starts where the previous page ends. In other words, page 1 might end ¾ (three quarters) of the way down (vertical measurement) the page and then page 2 starts three quarters of the way down. It appears that the setNewPage() function somehow isn't resetting the the Y axis when the new page starts?
Anyone have any suggestions? I am using version 4.03.
Thanks
Jim