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?
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.
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.
I researched options a couple of years back. Here's the shortlist: iTextSharp, SharpPDF, Report.NET, NFop and Siberix Report Writer. Ultimately I went with Siberix but I now think iTextSharp would have been the better choice. If it is helpful, you can find out a bit more here.
FO.NET is your library
Well i used iText(open source) a couple of times about 2 years ago, but i would not recommend this. The main reason is the lack of documentation and i really dislike the API it just feels outdated setting global variables before calling functions.
What is the reason you need to use XSL-FO? I also used ABC-pdf(commercial) which allows the user to turn HTML pages ( including stylesheets ) to pdf documents, or you can use a simple and documented API.
来源:https://stackoverflow.com/questions/1099485/generating-pdf-in-net-using-xsl-fo