ImagePreloader Error when trying to use FOP external-document

Here should go questions about transforming XML with XSLT and FOP.
twilsonppl
Posts: 2
Joined: Mon Nov 30, 2015 4:41 pm

ImagePreloader Error when trying to use FOP external-document

Post by twilsonppl »

Sorry if this is a duplicate post, but I'm not sure if the other one went through. According to the documentation, I should have been able to use the FOP extension of "external-document" to include a PDF in an xsl file. I added the pdfbox, jempbox, and fontbox 1.8.9 jars to my Oxygen lib directory like you said in the guide. However I get the following error, like it doesn't want to include it. Image not available. URI: ../xml/FY14.pdf. Reason: org.apache.xmlgraphics.image.loader.ImageException: The file format is not supported. No ImagePreloader found for ../

Based on https://www.oxygenxml.com/doc/versions/ ... brary.html, this should work. Is there something I am missing. The code works if I switch it to a JPEG file. Please advise. Thanks!

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/XSL/Format">
<xsl:template match="text">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" font-family="Arial">
<fo:layout-master-set>
<fo:simple-page-master master-name="A4">
<fo:region-body/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="A4">
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates select="para"/>
</fo:flow>
</fo:page-sequence>
<fox:external-document content-type="jpeg" src="../CallenJune2015.jpeg"/>
</fo:root>
</xsl:template>

<xsl:template match="para">
<block>
<xsl:apply-templates select="text()"/>
</block>
</xsl:template>
</xsl:stylesheet>
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: ImagePreloader Error when trying to use FOP external-document

Post by Radu »

Hi,

The first time you post on our forum, the post needs to be manually approved. This is a protection against spammers. But all your other messages from now on will be directly posted.
About the user manual topic link you gave, it refers to rendering PDF images when editing XML documents in the Author visual editing mode.

You should look at this link instead:

https://www.oxygenxml.com/doc/versions/ ... aries.html

which states that you should create a folder called fop in the folder [OXYGEN_DIR]/lib and place the JAR libraries there.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
twilsonppl
Posts: 2
Joined: Mon Nov 30, 2015 4:41 pm

Re: ImagePreloader Error when trying to use FOP external-document

Post by twilsonppl »

Radu,

Thank you!!!!!!!!!!!!!!! This worked perfectly.

Just a note on your help page, the version of fop-pdf-images that you need is 2.1, and is not on the page that is linked from the user guide. I found it here: http://archive.apache.org/nonrelease/xm ... /binaries/

But again, thank you so much, I have it working now.

Cheers,
Trish
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: ImagePreloader Error when trying to use FOP external-document

Post by Radu »

Hi Trish,

Glad this works for you.
About this remark:
Just a note on your help page, the version of fop-pdf-images that you need is 2.1, and is not on the page that is linked from the user guide.
You are absolutely right, we'll fix the download page link in the next release.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply