XML to PDF
XSL-FO 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:
Converting XML to PDF using XSL:FO
But that looks messy, so we've made it easier in a variety of ways.
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...
Generate PDF from XSLT and XQuery
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.
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.
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.
PURCHASE STYLUS STUDIO ONLINE TODAY!!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Try Stylus XML and PDF Tools
Simplify XML to PDF conversion using Stylus Studio®'s award-winning XML publishing tools — Download a free trial of our today!
Learn Stylus Studio in 6 Minutes
Can six minutes change your life? A new action-packed online video demonstration covers how to use Stylus Studio in just six minutes! Watch this video and change the way you develop XML applications forever!