Hi there,
I’m wondering if you can help with an issue we are having with the Aspose PDF library, utilising XSLT templates.
We are attempting to use the XML/XSLT based approach, overlaying elements onto an existing PDF produced by our design/creative team.
We are using the FloatingBox elements to absolutely position items within the page, which works great, but the boxes themselves have a maximum width/height where we can render content.
In some scenarios the routine will try and place text that will be longer than can be contained within the FloatingBox boundary. In this scenario the text will spill onto a new page which is not desired. Then any subsequent elements are then rendered on the second page, rather than first.
Is there anyway we can get any text/content that spills outside of the FloatingBox to be hidden and not be rendered on a new page?
I’ve attached some sample code and a stripped back template to explain what we are doing. I’ve also attached a sample output PDF that gets generated. In the output, we are looking to hide the text that didn’t fit (i.e. “that spills”), and retain the second “Something” to appear on the first page.
If you adjust the text in the sample XML payload to a shorter variant, you’ll observe everything appears on one page.
AsposePdfXsltSpillTest.zip (538.1 KB)
SampleOut.pdf (574.7 KB)
Many thanks!