I need to generate a pdf in .NET using XSL-FO. There are no shortage of libraries to do this. What library would you suggest that I use and why?
Typically, the steps required to generate a PDF document are: retrieve or compute the base XML document. transform XML file to XSL-FO markup, perhaps using XQuery typeswitch or XSL. transform the XSL-FO to PDF using the free Apache FOP or a commercial FOP rendering engine such as.
XSL-FO (XSL Formatting Objects) is a markup language for XML document formatting that is most often used to generate PDF files. XSL-FO is part of XSL (Extensible Stylesheet Language), a set of W3C technologies designed for the transformation and formatting of XML data.
XSL-FO isn't dead yet and is still more than up to the task of being the basis of an XML based publishing system today.
The following is general process to transform the XML document into XSL Formattiong Objects (XSL- FO) and print it. ・ Develop stylesheets that conforms to the DTD of source XML document to create the target output. ・ Input the XML document and the XSLT stylesheet to the XSLT processor to create XSL-FO.
This is an old question, I know, but none of the answers to date actually addressed the OP QUESTION. She asked for options for using XSL-FO, not "how to generate PDF using code?".
The primary non-commercial answer on the actual question is:
Formatting Objects Processor. It takes XSL-FO compliant xsl code and xml and generates PDF files according to the XSL-FO spec. There are several other commercial options:
If you're looking for an open-source option that WORKS, FOP is it. The FOP is a Java library natively, but it has been ported to .NET via J# (That has it's own issues there I know) in the nFOP project.
I have in the past used the Ibex PDF generator. I was thrown in in a project that already had a license for that, so I had really no other choice. At first I thought it was cumboersome, but eventually I got used to how it works.
I would recommend that you also use some good XML/XSL editor for testing XSL/XPath. XML Copy Editor is a good free open source one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With