Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating PDF in .NET using XSL-FO

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?

like image 528
Eldila Avatar asked Jul 08 '09 17:07

Eldila


People also ask

How do I create an XSL PDF?

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.

What is XSL-FO used for?

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.

Is XSL-FO still used?

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.

What are the steps for converting XML to XSL-FO?

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.


2 Answers

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:

Apache.org Project's FOP

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:

  • Ibex PDF Creator
  • AntennaHouse
  • RenderX

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.

like image 111
Jay Stevens Avatar answered Sep 18 '22 09:09

Jay Stevens


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.

like image 31
Magnus Johansson Avatar answered Sep 19 '22 09:09

Magnus Johansson