How to use BindFO with XslFoLoadOptions

How do I use the Aspose.Pdf.XslFoLoadOptions with the Aspose.Pdf.BindFO() method?

I have a complex XSL-FO style sheet that uses advanced features, and I want to tell Aspose not to use the old FO formatting engine. From reading other forum posts, I understand that I need to create the XslFoLoadOptions, and set .UseOldXslFoEngine to "false", but I don't see any example that use the .BindFO() method.

Is this possible?

Hi Patrick,

Thanks for your inquiry. I am afraid both objects are from different namespaces and cannot be used together. Please check the following snippet to use XslFoLoadOptions to load and convert XSL-FO to PDF. Moreover, please check BindFO example for reference. BindFO uses the old engine for conversion. However, it is recommended to use the following new DOM approach for XSL-FO to PDF conversion.

// Convert product XslFo to PDF with New XslFoEngine
Aspose.Pdf.XslFoLoadOptions foToPdfLoadOptions = new Aspose.Pdf.XslFoLoadOptions();

// It disables to use old XSL-FO engine
foToPdfLoadOptions.UseOldXslFoEngine = false;

// Load XSL-FO file
Document doc = new Document("input.fo", foToPdfLoadOptions);

// Save the output in PDF format
doc.Save("output.pdf");

Please feel free to contact us for any further assistance.

Best Regards,

O.K., So how to I generate a FO file from my XML and XSLT files? Does Aspose have a method for that?

Hi Patrick,

Thanks for you inquiry. I am afraid Aspose.Pdf does not provide a method to convert XML+XSLT to FO. However you may try convert XML+XSLT to PDF using Aspose.Pdf, but please note your XML files should be Aspose.PDF schema compliant.

We are sorry for the inconvenience caused.

Best Regards,