Generate PDF from XML and XSLT - Text Spill/Overflow Hide in FloatingBox

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!

For clarity, I’m looking for an output something like the attached, where the words “that spills” are omitted/hidden/trimmed.

SampleOutDesired.pdf (573.7 KB)

@ukpcbenlewis

We were able to reproduce the similar issue in our environment as you have mentioned. For the sake of further investigation, we have logged it as PDFNET-50811 in our issue management system. We will further look into its details and let you know as soon as the ticket is resolved. Please be patient and spare us some time.

We are sorry for the inconvenience.

Hi @asad.ali,

Just reaching out to see if there was any progress, or work arounds with the query we logged.

We are looking to go live with a solution for this in the not to distant future.

Many thanks.

@ukpcbenlewis

Please note that the ticket was logged under free support model where issues are resolved and investigated of a first come first serve basis. We are afraid that your ticket has not been yet investigated as it was logged recently. However, we will inform you as soon as we have some definite updates about its resolution. Please spare us some time.

We apologize for the inconvenience.

Thanks for the response @asad.ali and understood - we are a paid up customer of some expensive licences with our renewal soon approaching.

If we purchase the paid support, is this likely to expedite the investigation and resolution of this issue with either a fix or workaround available this year?

@ukpcbenlewis

We are investigating the ticket and will let you know how soon this can be resolved if you escalate it using paid support option. Please give us little time.

@ukpcbenlewis

We would like to share with you that we plan to investigate the earlier logged ticket in 21.12 version of the API. However, the things can certainly be escalated in case you subscribe to priority support and raise the ticket priority.