Longer answer: Sugar (7.x.x at least) uses TCPDF (http://www.tcpdf.org/) to generate its PDF's
I couldn't get some CSS and HTML working in Sugar's version of TCPDF, so I updated ours to version 5.9.209, you can just replace the folder in "vendor/tcpdf". FYI Sugar 7.2 ships with tcpd version 4.6 that was released in 2009, 5.9 was released is 2013, so this decade at least!
However, I then found that the WYSIWIG editor could remove some of the HTML, so I built up the HTML/CSS in an editor and copied and pasted that straight into the database, which seems to work great now. The database table is "pdfmanager"
In other words, you might struggle to get the template to look decent in Sugar's current tcpdf version and WYSIWIG editor, including possibly the pagebreak (not sure if it works on old tcpdf).
We ended up going down the same path - replaced the bundled version of TCPDF with the latest version from sourceforge. Our template HTML needed a few tweaks but other than that it worked quite smoothly.
We're on Sugar 7.5.1 and I think it was bundled with TCPDF 4.6 as well. The latest version on sourceforge is 6.2.8 so SugarCRM has a bit of catching up to do.
To do the page breaks we used the following tag:
<br pagebreak="true"/>
If tags are being removed in the WYSIWYG editor then TinyMCE will be the culprit. You can configure this to allow whatever tags/parameters you need using a config override.
Do you know what TCPD version 7.6 ships with? Is is possible to do a page break with out of the box 7.6 or would you still need to update the WYSIWIG editor?
I am using ondemand instance and I can't update the core files of SugarCRM. Can you provide any other solution? I have tried all possible methods but can't get it to work.
Note: Once you upgrade to a newer version of TCPDF from the stock one shipped in SugarPDF, you will no longer be able to use PNG images. JPEG will work. In version 5.9 it will give you an error, in 6+ it will print the PDF, but without the images.
Short answer:
Longer answer:
Sugar (7.x.x at least) uses TCPDF (http://www.tcpdf.org/) to generate its PDF's
I couldn't get some CSS and HTML working in Sugar's version of TCPDF, so I updated ours to version 5.9.209, you can just replace the folder in "vendor/tcpdf". FYI Sugar 7.2 ships with tcpd version 4.6 that was released in 2009, 5.9 was released is 2013, so this decade at least!
However, I then found that the WYSIWIG editor could remove some of the HTML, so I built up the HTML/CSS in an editor and copied and pasted that straight into the database, which seems to work great now. The database table is "pdfmanager"
In other words, you might struggle to get the template to look decent in Sugar's current tcpdf version and WYSIWIG editor, including possibly the pagebreak (not sure if it works on old tcpdf).
Hope this helps anyway,
Jon