Page Break in HTML2Pdf

Page break in Html2Pdf

i just figured this out after having the same problem. the parser that they use DOES support the page-break-after tag, but the html2pdf does not work.

i think i have it working by doing the following modifications to html2pdf.class:

around line 4174, the first thing inside:

protected function _tag_close_P($param){

should be:

   if($this->parsingCss->value['page-break-after'] == "always")
$this->_setNewPage();

around line 2961, the first thing inside:

protected function _tag_close_DIV($param, $other='div'){

should be:

 if($this->parsingCss->value['page-break-after'] == "always")
$this->_setNewPage();

JsPdf page break not working

JsPDF uses a special HTML tag...

<!--ADD_PAGE-->

...to force a page-break.

Please note that this only applies if using the addHTML method.

I had this exact problem and throwing in the tag worked perfectly.



Related Topics



Leave a reply



Submit