[jira] [Comment Edited] (FOP-2864) Update to FOP 2.3: SVG error: The file format is not supported. No ImagePreloader found for file ... svg

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Comment Edited] (FOP-2864) Update to FOP 2.3: SVG error: The file format is not supported. No ImagePreloader found for file ... svg

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/FOP-2864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16860623#comment-16860623 ]

M.H. edited comment on FOP-2864 at 6/11/19 7:50 AM:
----------------------------------------------------

I tried to reduce the example by removing JARs and using the JARs from FOP 2.3 but now I get a

 
{code:java}
java.lang.NoSuchMethodError: org.apache.fontbox.afm.AFMParser.parse()V
at org.apache.pdfbox.pdmodel.font.PDFont.addAdobeFontMetric(PDFont.java:166)
at org.apache.pdfbox.pdmodel.font.PDFont.addAdobeFontMetric(PDFont.java:152)
at org.apache.pdfbox.pdmodel.font.PDFont.getAdobeFontMetrics(PDFont.java:122)
at org.apache.pdfbox.pdmodel.font.PDFont.<clinit>(PDFont.java:114)
{code}
Even though I use the fontbox-2.0.7.jar from FOP 2.3 ... ?

 

The Problem is probably that FOP 2.3 now dpeneds on PDFBox 2.0.7 but we still use 1.8.13. We haven't upgraded PDFBox yet because it has many incompatibilities that need to be resolved.


was (Author: m.):
I tried to reduce the example by removing JARs and using the JARs from FOP 2.3 but now I get a

 
{code:java}
java.lang.NoSuchMethodError: org.apache.fontbox.afm.AFMParser.parse()V
at org.apache.pdfbox.pdmodel.font.PDFont.addAdobeFontMetric(PDFont.java:166)
at org.apache.pdfbox.pdmodel.font.PDFont.addAdobeFontMetric(PDFont.java:152)
at org.apache.pdfbox.pdmodel.font.PDFont.getAdobeFontMetrics(PDFont.java:122)
at org.apache.pdfbox.pdmodel.font.PDFont.<clinit>(PDFont.java:114)
{code}
Even though I use the fontbox-2.0.7.jar from FOP 2.3 ... ?

> Update to FOP 2.3: SVG error: The file format is not supported. No ImagePreloader found for file ... svg
> --------------------------------------------------------------------------------------------------------
>
>                 Key: FOP-2864
>                 URL: https://issues.apache.org/jira/browse/FOP-2864
>             Project: FOP
>          Issue Type: Bug
>          Components: renderer/pdf
>    Affects Versions: 2.3
>         Environment: Windows 10, OpenJDK 11.0.2
>            Reporter: M.H.
>            Priority: Major
>
> Hi, we try to update from FOP 2.0 to FOP 2.3. So we extracted the following JARs from FOP 2.3 and replaced the old ones:
> fop.jar, batik-all-1.10.jar, xmlgraphics-commons-2.3.jar, 
> Basically, everything runs fine except 1 bug in misc generated PDFs:
> {code:java}
> 13:49:33,522 [T51] ERROR area.AreaTreeModel - Error while rendering page 1
> java.lang.RuntimeException: SVG graphic could not be built. Reason: java.lang.RuntimeException: SVG error: The file format is not supported. No ImagePreloader found for file:/D:/temp/iComps/amc/rep/190529134259935A98-A2A1-4463-BFC3-7BEAF09D5A6B/1_4986/69_R_PropOverview_72/C_PropYield_S.svg
> at org.apache.fop.events.EventExceptionManager.throwException(EventExceptionManager.java:74)
> at org.apache.fop.events.DefaultEventBroadcaster$1.invoke(DefaultEventBroadcaster.java:173)
> at com.sun.proxy.$Proxy5.svgNotBuilt(Unknown Source)
> at org.apache.fop.render.pdf.PDFImageHandlerSVG.handleImage(PDFImageHandlerSVG.java:108)
> at org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:249)
> at org.apache.fop.render.intermediate.AbstractIFPainter.drawImage(AbstractIFPainter.java:205)
> at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingImageHandler(AbstractIFPainter.java:170)
> at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingDocument(AbstractIFPainter.java:319)
> at org.apache.fop.render.pdf.PDFPainter.drawImage(PDFPainter.java:289)
> at org.apache.fop.render.intermediate.IFRenderer.renderForeignObject(IFRenderer.java:1312)
> at org.apache.fop.render.AbstractRenderer.renderInlineViewport(AbstractRenderer.java:864)
> at org.apache.fop.render.AbstractPathOrientedRenderer.renderInlineViewport(AbstractPathOrientedRenderer.java:831)
> at org.apache.fop.render.intermediate.IFRenderer.renderInlineViewport(IFRenderer.java:862)
> at org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:717)
> at org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:926)
> at org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:692)
> at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:573)
> at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:615)
> at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)
> at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:558)
> at org.apache.fop.render.AbstractPathOrientedRenderer.renderReferenceArea(AbstractPathOrientedRenderer.java:756)
> at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:601)
> at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)
> at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:558)
> at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:615)
> at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)
> at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:558)
> at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:615)
> at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)
> at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:558)
> at org.apache.fop.render.AbstractPathOrientedRenderer.renderReferenceArea(AbstractPathOrientedRenderer.java:756)
> at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:601)
> at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)
> at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:558)
> at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:615)
> at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:998)
> at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:558)
> at org.apache.fop.render.AbstractRenderer.renderFlow(AbstractRenderer.java:459)
> at org.apache.fop.render.AbstractPathOrientedRenderer.renderFlow(AbstractPathOrientedRenderer.java:784)
> at org.apache.fop.render.AbstractRenderer.renderMainReference(AbstractRenderer.java:436)
> at org.apache.fop.render.AbstractRenderer.renderBodyRegion(AbstractRenderer.java:360)
> at org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:307)
> at org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRenderer.java:737)
> at org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:272)
> at org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:245)
> at org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java:587)
> at org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:123)
> at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:316)
> at org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:243)
> at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:147)
> at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:267)
> at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:130)
> at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:360)
> at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:190)
> at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1102)
> at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
> at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485){code}
> Switching back to FOP 2.0, this error disappeared. I can't find a hint for "{color:#f79232}*SVG error: The file format is not supported. No ImagePreloader found for file*{color}" in the bug database. What could be the problem?
>  Hint: we build our documents via XSL-FO to PDF rendering, so no drawing of PDFs directly with FOP API. SVGs are included via 
> {code:java}
> <fo:block>
> <fo:instream-foreign-object>
> <svg:svg xmlns:xlink="http://www.w3.org/2000/svg" height="56mm" width="70mm">
> <svg:image xmlns:xlink="http://www.w3.org/1999/xlink" height="56mm" width="70mm" xlink:href="C_PropYield_S.svg"/>
> </svg:svg>
> </fo:instream-foreign-object>
> </fo:block>
> <fo:block text-align="left">
> <fo:block padding-bottom="5mm">
> <fo:external-graphic height="15mm" src="images/StdLogo.svg"/>
> </fo:block>
> </fo:block>{code}
> Thanks!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)