Inconsistent FOP behavior ?

A

Andrew Tyson

Hi,

I am pulling my hair out trying to figure out a problem that I am having
using FOP to generate PDFs that have embedded SVG graphics.

The base 64 encoded SVG is embedded as an attribute within a source XML
document

<?xml version="1.0" encoding="UTF-8"?>
<ReportCashAcctStmt portfolioCode="FIXED_1" portfolioRptName="Fixed Interest
testing#1" brandingImage="&lt;svg:image width=&quot;588&quot;
height=&quot;118&quot; xlink:href=&quot;data:image/jpeg;base64,/9j/4AAQSkZJ
...... &quot; transform=&quot;matrix(1 0 0 1 0 0)&quot;/&gt;">


An XSL-T is used to generate the XSL-FO, and the SVG is embedded thus;

<fo:instream-foreign-object width="3cm" height="1cm"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:svg="http://www.w3.org/2000/svg">
<svg:svg width="3cm" height="1cm" viewBox="0 0 118 558"
xml:space="preserve" >
<svg:g><xsl:value-of select="@brandingImage"
disable-output-escaping="yes"/></svg:g></svg:svg>
</fo:instream-foreign-object>

Now when I run this through Xalan command line I generate the correct XSL-FO
(including the embedded image) that can be fed to FOP directly and creates a
PDF, for example .

$ java org.apache.xalan.xslt.Process -IN Untitled8.xml -XSL
reportClientPackFO.xsl -OUT Untitled8.fo
$ java org.apache.fop.apps.Fop -fo Untitled8.fo -pdf ~/Untitled8.pdf

This works fine, however if I use FOP directly to generate the PDF using the
stylesheet and source XML the image is missing !

$ java org.apache.fop.apps.Fop -xsl reportClientPackFO.xsl -xml
Untitled8.xml -pdf ~/Untitled8.pdf

does not work (i.e. the image does not get embedded in the resulting PDF)
!!!

I have tried various different versions of FOP/Xerces/Xalan/Batik to no
avail, and I would really appreciate any advice anyone might have.

Thanks and regards,
Andrew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top