Forum How do I...?

Integration With oXygen XML editor

mark_anderson_us
Hi All

I use oXygen XML editor on Windows for all my XSL development. It has the ability to define external tools and FO processors, so I'd like to try and find a way integrating Prince for testing. Right now I have to transfrom my XML to HTML and then manually run this through Prince XML.

Has anyone integrated Prince with oXygen?

Is there a way to call prince form the command line with an HTML file as the input and have it display the PDF result? (I tired searching the firumns but it said the search term "command line" was too common"

Regards

Mark
mikeday
You can call Prince from the command-line and generate the PDF, then call a PDF viewer like Acrobat or xpdf to view it. On Linux (or MacOS) this would be a two line script:
prince input.html -o output.pdf
acroread output.pdf

Perhaps you could do something similar on Windows with batch files?
mark_anderson_us
thanks mike. figured it out

for anyone else who's interested setup princexml.exe as an external fo processor and setup and fo transform with the path to the exe and a single argument of ${fo}.

Oxygen has no idea it's not fo, it just tkaes the output of the first transform (what it thinks is fo) and passes it to princexml.exe

Regards

mark
mikeday
Nice! :D
ra0543
for anyone else who's interested setup princexml.exe as an external fo processor and setup and fo transform with the path to the exe and a single argument of ${fo}.

Oxygen has no idea it's not fo, it just tkaes the output of the first transform (what it thinks is fo) and passes it to princexml.exe


This sounds very useful. Could you post more precise instructions? There are whole lot of places where that single argument might be put and I can't seem to find the right place. Have you managed to integrate this with carrying out an XSL transformation on your XML and then passing that result to Prince via this method? If so, I'd be really interested to see a proper set of instructions for doing this with oXygen.

Cheers!
mark_anderson_us
Hi Guys

I couldn't attach a PDF. What the heck can you attach to these forums - tried allsorts last week?

Put a copy on my web site

http://www.anderson-mark.com/utility/PrinceXML-oXygenXML%20Unbranded.pdf

Let me know if you have any questions

Regards

Mark
adrianbuza
Hi,

ra0543 asked for details on how it's done so I made a little guide on our forum:
http://www.oxygenxml.com/forum/topic5219.html

Another trick is to configure Prince as an XSLT Custom Engine and use it to Process an XML with a CSS to PDF in an Oxygen transformation. See details in the link above.

Please let me know if I've omitted something or if I made some mistake.

Regards,
Adrian

Later Edit:
From the PDF:
mark_anderson_us wrote:
Currently, I can’t find a way to automatically open the PDF. (It may be possible to call batch file/VBScript instead of the exe with the second line being to call your PDF reader, but haven’t had chance to experiment)

Add to the end of the command line of the FO Processor: -o ${out}
Then in the transformation scenario go to the Output tab and in the "Save As" field use a proper output name with the .pdf extension. e.g. ${cfdu}/${cfn}.pdf and enable the "Open in Browser"("Saved file") option.

Adrian Buza
oXygen XML Editor and Author support
http://www.oxygenxml.com