You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Toufic DIAB <t....@equa-tech.com> on 2008/10/24 10:13:20 UTC
Images problem using embedded FOP 0.95 to generate PDF
Hello,
I am using FOP 0.95 to generate PDF documents from XML and XSL;
I'm working under J2RE1.4.2_07
When I use FOP from the command prompt, everything works great,
but whenever I try to use FOP embedded in Java, the process is very slow and
I get the following error
javax.xml.transform.TransformerException: org.xml.sax.SAXException:
Mismatch: page-sequence (http://www.w3.org/1999/XSL/Format) vs. root
(http://www.w3.org/1999/XSL/Format)
at org.apache.xalan.templates.ElemLiteralResult.execute(Unknown Source)
This error appears after this text in the DEBUG output
2008-10-24 07:42:21,841 - [DEBUG ] (ImageLoaderRawJPEG.java:95) >> SOS
found. Stopping early.
2008-10-24 07:42:21,841 - [DEBUG ] (ImageProviderPipeline.java:156) >> Image
loading using
org.apache.xmlgraphics.image.loader.impl.ImageLoaderRawJPEG@1fcf790 took 16
ms.
2008-10-24 07:42:21,841 - [DEBUG ] (ImageProviderPipeline.java:223) >> Image
is made cacheable: file:///C:\testingImage.jpg (image/jpeg)
If I try to comment the image from the XSL
<!-- <fo:external-graphic src="file:///C:\testingImage.jpg"
content-height="scale-to-fit" scaling="non-uniform" height="8mm"/> -->
the PDF is successfully generated even from Java.
I saw this error on the FOP FAQ page
http://xmlgraphics.apache.org/fop/faq.html#saxexception-mismatch
and I tried the solution they're providing : The error is not showing
anymore but the PDF generated is "damaged" only 1Kb...
Here is the code I used to generate my PDF
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/e
mbedding/ExampleXML2PDF.java?view=markup
Can you please help me finding a solution to my problem?
Thanks in advance
Toufic DIAB