XML to PDF
The most straight-forward way to produce a PDF from XML is to write in a syntax known as XSL-FO. This is a set of formatting instructions in XML which, when rendered through a formatter, will produce a PDF. RenderX XEP and Apache FOP are both implementations of FO engines. Here is a sample XSL-FO file that will produce the centered message ‘Hello, World!’ on a typical American-style 8½’×11′ page: First, as you can see by the color-coding above, the Stylus Studio® Sense:X technology is available to help in making the XSL-FO text valid. Sense:X knows the XSL-FO vocabulary – which attributes and elements belong where – which makes you job easier. But it could be easier still… The XML Report module allows you to visually design your stylesheets, and then generate the XSLT or XQuery that writes XSL-FO. Combined with one of the included engines you can go from a visual environment to PDF in one step. For the above example, all you need to do is type ‘Hello, World!’ into the XML Report module and press the generate button. Choose XSLT 1.0, XSLT 2.0 or XQuery, and an output mode of XSL-FO, and off we go to generate the code for you. For serious production-quality XSL-FO work, RenderX makes an XSL-FO processor called XEP. Stylus Studio® bundles a copy of the personal edition, so that you may develop and test your documents and see how they would look in the field. The Apache project has produced an open-source FO processor called FOP. We bundle it with Stylus Studio®, and you can choose to use it for converting XSL-FO to PDFs. The DocBook.org website includes a set of schemas for formatting technical documents. An open-source project called, oddly enough, The DocBook Project’ has produced a set of stylesheets which will convert DocBook XML to PDF. (An archived copy of the XSLT code and documentation can be found here.) Microsoft has produced an storage format for Word that saves the documents in XML. RenderX has in turn produced a set of stylesheets that will transform WordprocessingML to XSL-FO suitable for processing with the XEP engine. Remember that Stylus Studio® includes the RenderX XEP engine, so that you may test this by downloading a copy of Stylus Studio® right now, and then getting the freely-available stylesheet from RenderX. Similar to the above, RenderX also has made freely available stylesheets to convert the Adobe Indesign INX documents into XSL-FO. After downloading a copy of Stylus Studio® from here, go to to download the INX to XSL-FO stylesheet. The Darwin Information Typing Architecture is another powerful XML publishing framework. It is comparable to DocBook in scope, but where DocBook is designed for narrative formats, such as books or articles, DITA has strengths in large interrelated documentation sets. The DITA Open Toolkit project includes transforms to convert DITA XML to XSL-FO, which again can be rendered to PDF. RenderX has also made available an XSL-FO DTD (archive copy) suitable for using as a target for the Stylus Studio® XML Mapper. As you can see, we have a plethora of XML to PDF transformation mechanisms — for generating and using XSL-FO to produce PDFs. Some, like the XML Report tool, completely hide the XSL-FO and PDF details from you, others, like the XML Editor, give you full control of every character. Whatever level you wish to work, downloading a copy of Stylus Studio® today will get your XML to PDF in no time at all. Simplify XML to PDF conversion using Stylus Studio®’s award-winning XML publishing tools — Download a free trial of our today! Say goodbye to 10-minute abs, and say Hello to ‘Learn XQuery in Ten Minutes!’, the world’s fastest and easiest XQuery primer, now available for free! Does your company use Stylus Studio? Do your competitors? Engineers from over 100,000 leading companies use Stylus Studio, and now you can ask someone from your own organization about their experiences using Stylus Studio. Source.