ImagePreloader Error when trying to use FOP external-document
Posted: Mon Nov 30, 2015 4:59 pm
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!
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>