Images disappear from PDF when using command line

Here should go questions about transforming XML with XSLT and FOP.
mharvey
Posts: 10
Joined: Thu Apr 25, 2013 4:09 pm

Images disappear from PDF when using command line

Post by mharvey »

I am trying to automate the PDF generation of my DITA-based manuals by calling the DITA OT from the command line, instead of using Oxygen.

Everything works fine under Oxygen, but when calling the DITA OT from the command prompt, images disappear from the resulting PDF.

The following error message appears in the output trace:

Code: Select all

1528 ERROR [ main ] org.apache.fop.apps.FOUserAgent - Invalid property value encountered in src="url(file:/E:/Documentation/Products/VisualTD/Current/Components/Manuals/Installation/en/img\vtd_softwarearchitecture.png)": org.apache.fop.fo.expr.PropertyException: Invalid URI specified (See position 273:-1)
Has anyone encountered this problem in the past ?

Thanks in advance for your help !

Mathieu
Radu
Posts: 9046
Joined: Fri Jul 09, 2004 5:18 pm

Re: Images disappear from PDF when using command line

Post by Radu »

Hi Mathieu,

What Oxygen version are you using?
Do you use the internal DITA OT for publishing or an external DITA OT? If so, what version of the DITA OT are you using?

The latest Apache FOP PDF generator (version 1.1) libraries which with Oxygen is used with the bundled DITA OT and it has some stricter checks related to how the URLs are composed, for example in your case the URI reference has a backslash in \vtd_softwarearchitecture.png. The DITA OT generates such content and in order to make this work Oxygen has a patch for the FOP processor which relaxes this draconian URI syntax checking.

You could probably use the JAR libraries from Apache FOP 1.0 in the command line instead of the FOP 1.1 libraries from the Oxygen "lib" directory.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
mharvey
Posts: 10
Joined: Thu Apr 25, 2013 4:09 pm

Re: Images disappear from PDF when using command line

Post by mharvey »

Hi Radu,

Thanks for the fast reply !

I use Oxygen XML Author version 14.2 build 201302115.
I use the internal DITA OT that comes with that version (1.6.1).

I tried to change the backslash to a slash in the href property of the image, but that did not work.

Is Apache FOP 1.0 pre-installed with Oxygen, or do I need it to download it like Saxon 9 ?

Thanks again !

Regards,

Mathieu
Radu
Posts: 9046
Joined: Fri Jul 09, 2004 5:18 pm

Re: Images disappear from PDF when using command line

Post by Radu »

Hi Mathieu,

You will need to download the older libraries either from the Apache FOP website or just download a DITA OT 1.7 full easy install kit and in it you can find both the FOP libraries and the Saxon 9 ones:

http://sourceforge.net/projects/dita-ot ... kit%201.7/

The libraries should be located in a DITA OT downloaded kit in:

DITA_OT\plugins\org.dita.pdf2\fop\lib

and the fop.jar in:

DITA_OT\plugins\org.dita.pdf2\fop\build

Probably the necessary libraries would be something like:

Code: Select all

fop.jar
avalon-framework-4.2.0.jar
batik-all-1.7.jar
commons-io-1.3.1.jar
commons-logging-1.0.4.jar
xmlgraphics-commons-1.4.jar
You can point to them instead (do not overwrite our libraries with them) and see if this works.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
mharvey
Posts: 10
Joined: Thu Apr 25, 2013 4:09 pm

Re: Images disappear from PDF when using command line

Post by mharvey »

It worked !

Thanks again !

Mathieu
Post Reply