Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Inconsistent FOP behavior ?

Reply
Thread Tools

Inconsistent FOP behavior ?

 
 
Andrew Tyson
Guest
Posts: n/a
 
      01-06-2004
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"
xmlnslink="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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems running Apache FOP: org.apache.fop.fo.FOTreeBuilder fatalError Pablo Java 0 03-28-2007 02:31 PM
Absolutely strange inconsistent behavior occuring when a user clicks an ASP.NET button. Mossman ASP .Net 1 12-12-2005 04:44 AM
Inconsistent behavior of an asp.net button performing a postback when a button is clicked. Mossman ASP .Net 0 12-12-2005 02:55 AM
DataSet inconsistent in behavior in different session state manage =?Utf-8?B?Q3phciBFY2xhcmluYWw=?= ASP .Net 0 08-30-2005 03:56 AM
Inconsistent behavior of descriptors Denis S. Otkidach Python 2 10-01-2003 12:26 PM



Advertisments