XML to PDF

Here should go questions about transforming XML with XSLT and FOP.
modes
Posts: 1
Joined: Tue Jun 25, 2013 8:01 pm

XML to PDF

Post by modes »

hello,
I wonder if there is any way of knowing how it would transform pdf generated from a xml.

thanks
Costin
Posts: 833
Joined: Mon Dec 05, 2011 6:04 pm

Re: XML to PDF

Post by Costin »

Hello,

In order to generate PDF output from an XML file, you need to first have a transformation scenario.
To create a transformation scenario you should either go into oXygen menu Document > Transformation > Configure Transformation Scenario(s) or use the appropriate shortcut button in the Transformation toolbar (the one with a wrench and a small red "Play" button icon).
Once in the transformation scenario configuration dialog, when clicking on the "New" button allows you to choose the appropriate scenario you need to create.
If you have an XSL stylesheet to customize your XML, you could choose the "XML transformation with XSLT" scenario in the list, then configure it according to your needs.

Here are some basic steps to create an XML transformation with XSLT:
- give the scenario an appropriate 'Name';
- leave the 'XML URL' field to its default(${currentFileURL});
- In the XSL URL browse for your stylesheet;
- From the transformer combo choose Saxon-EE or PE;
- Choose to perform FO processing, by setting the processor (Apache FOP is the default one), and processing method (PDF in your case);
- You can further tune the 'Output'. e.g in the 'Save as' field you can specify some predefined editor variables, like: ${cfd}/${cfn} which translates into <current-file-directory>/<current-filename>;
- OK in all dialogs.

After configuring your scenario, you could either just apply it from the configuration dialog (Apply associated), or apply it later using the Apply transformation scenario action from menu Document > Transformation menu or the transformation toolbar.

In case your document is of a common publishing format with out-of-the-box support in oXygen (DITA DocBook, TEI, XHTML), then you should already have some default transformation scenarios defined for these types you could try to just apply or adjust them as you wish first.

On our website, under the "Resources" tab, there are also some useful Video Demonstration which might help you get used with applying transformation on you XML files.
You should take a look over the Visual XML Editing section of the Video Demonstrations.

I hope this helps.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
Post Reply