We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

XSL-FO and repeatable-page-master-alternatives does not work properly

Summary
I am using Aspose.PDF to generate a PDF-document using XSL-FO. I am currently struggeling with generating some content that should only appear on the bottom of the last page. As I have understood, the correct approach to do this is to use so called conditional page master references so that the footer on the last page also contains the content in addition to the normal footer content found on every other page.

Test one:
I have a page-sequence-master as follows:
<fo:conditional-page-master-reference page-position="last" master-reference="A4-last"/>

"A4-last" has a footer that says "After last" and "A4" says "After all other" in the footer

This results in the following on a four page PDF:
  • The first page displays nothing att the bottom of the page
  • The second and third page displays "After all other"
  • The last and fourth page displays both texts overlapping each other!

Test two:
I then tried to set page-position="rest" on the conditional-page-master-reference that uses "A4" and that resulted in both footers only displaying at the last page but not overlapping.

This really seems like a bug in Aspose.PDF since many sources says that this is the way of doing this in XSL-FO. Or is there another way to acomplish this?


Both test cases are in the attached ZIP-file.

Hi Par,

We are sorry for the inconvenience caused. While testing the scenario with the latest version of Aspose.Pdf for NET 8.8.0, We have managed to reproduce the reported issue and logged it in our bug tracking system as PDFNEWNET-36384 for further investigation and resolution. We will keep you updated about the issue resolution progress via this forum thread.

Please feel free to contact us for any further assistance.

Best Regards,

Hi Par,


We will appreciate if you please share your sample code snippet here, because we want to ensure that we are on same page to address your scenario exactly.

Thanks for your patience and cooperation.

Best Regards,

This is how I, in my code, implement Aspose.PDF for generating a PDF from XSL-FO:

public byte[] GenerateDocument(XmlDocument inputXml, WsopEnvelopeData envelopeData)
{
var templatePath = string.Format("{0}{1}.xsl", _configManager.GetTemplatesFolderPath(), _configManager.GetTemplateName(envelopeData.DocumentName,envelopeData.DocumentType));
var asposePdfGen = new Aspose.Pdf.Generator.Pdf();
var xslFoTemplate = new XmlDocument();
xslFoTemplate.Load(templatePath);

var mgr = new XmlNamespaceManager(xslFoTemplate.NameTable);
mgr.AddNamespace(“fo”, “http://www.w3.org/1999/XSL/Format”);
mgr.AddNamespace(“xsl”, “http://www.w3.org/1999/XSL/Transform”);
mgr.AddNamespace(“ns”, “Sodra.Skog.WSOP”);

var watermarkElement = xslFoTemplate.SelectSingleNode(@"//*[@id=‘watermarkTextContainer’]",mgr);
if (watermarkElement != null)
watermarkElement.InnerText = _configManager.GetEnviromentWatermarkText();
asposePdfGen.BindFO(inputXml, xslFoTemplate);
return asposePdfGen.GetBuffer();
}

Hi Par,


Thank you for providing your sample code. We will update you as soon as we made some significant progress towards issue solution.

Thanks for your patience and cooperation.

Best Regards,

The issues you have found earlier (filed as PDFNEWNET-36384) have been fixed in Aspose.Pdf for .NET 9.1.0.

For further details, you may check this blog post.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.