DITA PDF2 transformation - image not found error

Having trouble installing Oxygen? Got a bug to report? Post it all here.
ageery
Posts: 6
Joined: Mon Nov 24, 2008 7:05 pm

DITA PDF2 transformation - image not found error

Post by ageery »

I have a simple project for which I'm using the PDF2 transformation in oXygen Author 10 to generate the PDF output. The generation completes successfully, but every image in the document produces an error of the following form:

[fop] 594 ERROR [ main ] org.apache.fop.fo.FONode - Image not found: p2p_exchange\image\data_correct.png

The structure of my project is:
p2p_exchange.ditamap
p2p_exchange/task1.xml
...
p2p_exchange/task4.xml
p2p_exchange/image/image1.png
...
p2p_exchange/image/image20.png

The image hrefs are all relative to the pages they're contained in: in the task1..4.xml files, the href attribute of the image tag is image/image1.png.

When I generate XHTML or the HTML Help documentation or even the regular PDF output, the images show up correctly (and they show up correctly also in Author). Is there some setting I'm missing for PDF2 for it to find the images?

Thanks
Andrew
Radu
Posts: 9439
Joined: Fri Jul 09, 2004 5:18 pm

Re: DITA PDF2 transformation - image not found error

Post by Radu »

Dear Andrew,

Thank you for contacting us.
Indeed I created a project with the structure identical to yours and the same problem also happened to me.

The strange part is that (in my case at least) the PNG image seems to be copied correctly to the output folder to something like out/p2p_exchange/image/image1.png. Is it present in the output folder in your case?

If in OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/demo/fo/build.xml file you comment from line 231 to line 234 so that the generated FO file is not deleted after the transformation, open that file in Oxygen and use the read-only "FO PDF" scenario the scenario will generate the PDF with all the PNG images embedded.

I will keep looking into this, possibly contact the DITA Open Toolkit users list and try to come out with a patch.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 9439
Joined: Fri Jul 09, 2004 5:18 pm

Re: DITA PDF2 transformation - image not found error

Post by Radu »

Hi Andrew,

I made a patch in OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/demo/fo/build.xml

Just open the file and replace lines 269 to 271 with:

Code: Select all


<dirname file="${outputFile}" property="outputDir"/>
<fop format="application/pdf" fofile="${inputFile}"
outfile="${outputFile}" messagelevel="info" force="true" userConfig="${dita.dir}/fop_relax_validation.xml" basedir="${outputDir}">
</fop>
The problem was that the built-in FO processor needed to have a correct base directory to solve the relative images to.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ageery
Posts: 6
Joined: Mon Nov 24, 2008 7:05 pm

Re: DITA PDF2 transformation - image not found error

Post by ageery »

Thank you! That worked perfectly!
Andrew
Post Reply