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

MH commented on FOP-2495:
-------------------------

Next bug found: some SVGs produce errors with FOP 2.0 that work with FOP 1.0 
(see exception below). The path in the fo (e.g. "images/TestLogo.dvg") somehow 
gets an invalid path ("images\images\TestLogo.svg"). We noticed this on SVGs 
generated with inkscape that has "url()" calls like this:

----------------------
...
<g id="Gruppe3"  clip-path="url(#Clip0)">
      <g  id="g3096"  clip-path="url(#Clip1)">
        <g  id="Gruppe1"  clip-path="url(#Clip2)">
          <path ...
...
------------------------

Result:

-----------------
Error while rendering page 1
    java.lang.RuntimeException: SVG graphic could not be built. Reason: 
org.apache.batik.bridge.BridgeException: images\images\TestLogo.svg (Das System 
kann den angegebenen Pfad nicht finden)
        at 
org.apache.fop.events.EventExceptionManager.throwException(EventExceptionManager.java:76)
        at 
org.apache.fop.events.DefaultEventBroadcaster$1.invoke(DefaultEventBroadcaster.java:175)
        at com.sun.proxy.$Proxy4.svgNotBuilt(Unknown Source)
        at 
org.apache.fop.render.pdf.PDFImageHandlerSVG.handleImage(PDFImageHandlerSVG.java:107)
        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.drawImageUsingURI(AbstractIFPainter.java:292)
        at org.apache.fop.render.pdf.PDFPainter.drawImage(PDFPainter.java:173)
        at 
org.apache.fop.render.intermediate.IFRenderer.drawImage(IFRenderer.java:1295)
        at 
org.apache.fop.render.intermediate.IFRenderer.renderImage(IFRenderer.java:1282)
        at 
org.apache.fop.render.AbstractRenderer.renderInlineViewport(AbstractRenderer.java:858)
        at 
org.apache.fop.render.AbstractPathOrientedRenderer.renderInlineViewport(AbstractPathOrientedRenderer.java:832)
        at 
org.apache.fop.render.intermediate.IFRenderer.renderInlineViewport(IFRenderer.java:863)
        at 
org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:715)
        at 
org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:927)
        at 
org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:690)
        at 
org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:572)
        at 
org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
        at 
org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:999)
        at 
org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
        at 
org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
        at 
org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:999)
        at 
org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
        at 
org.apache.fop.render.AbstractPathOrientedRenderer.renderReferenceArea(AbstractPathOrientedRenderer.java:757)
        at 
org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:600)
        at 
org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:999)
        at 
org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
        at 
org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:613)
        at 
org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:999)
        at 
org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:557)
        at 
org.apache.fop.render.AbstractRenderer.renderRegion(AbstractRenderer.java:343)
        at 
org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:307)
        at 
org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRenderer.java:738)
        at 
org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:262)
        at 
org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:243)
        at 
org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java:586)
        at 
org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:123)
        at 
org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:315)
        at 
org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:216)
        at 
org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:140)
        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)
        at de.icomps.xml.FOP.transformFO(FOP.java:1006)
        at de.icomps.xml.FOP.fo2PDF(FOP.java:762)
        at de.icomps.rep.Report.createWithFOP(Report.java:3750)
        at de.icomps.rep.Report.processReport(Report.java:2104)
        at 
de.icomps.rep.ReportProtocol.createProtocolReport(ReportProtocol.java:201)
        at de.icomps.rep.ReportProtocol.createReport(ReportProtocol.java:69)
        at de.icomps.rep.Report.startProcessing(Report.java:1650)
        at de.icomps.ijs.JobTask.startJob(Unknown Source)
        at de.icomps.ijs.JobTask.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:745)
    Caused by: org.apache.batik.bridge.BridgeException: 
images\images\B10250.svg (Das System kann den angegebenen Pfad nicht finden)
        at org.apache.batik.bridge.BridgeContext.getReferencedNode(Unknown 
Source)
        at org.apache.batik.bridge.BridgeContext.getReferencedElement(Unknown 
Source)
        at org.apache.batik.bridge.CSSUtilities.convertClipPath(Unknown Source)
        at 
org.apache.batik.bridge.AbstractGraphicsNodeBridge.buildGraphicsNode(Unknown 
Source)
        at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
        at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
        at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
        at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
        at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
        at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
        at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
        at 
org.apache.fop.render.pdf.PDFImageHandlerSVG.handleImage(PDFImageHandlerSVG.java:103)
        ... 61 more
--------------------------

I don't know if this is a Batik bug in FOP...

> Embedding: missing migration documentation from FOP 1.x
> -------------------------------------------------------
>
>                 Key: FOP-2495
>                 URL: https://issues.apache.org/jira/browse/FOP-2495
>             Project: FOP
>          Issue Type: Bug
>          Components: documentation
>    Affects Versions: 2.0
>         Environment: WIndows, Java 8, FOP 1.0
>            Reporter: MH
>            Priority: Blocker
>              Labels: documentation
>
> Because of bug FOP-2177 we couldn't upgrade form FOP 1.0 to FOP 1.1. FOP 2.0 
> has solved this bug (tested with standalone FOP scripts).
> Now we would like to upgrade our Java code from FOP 1.0 to FOP 2.0. The 
> Upgrading page (https://xmlgraphics.apache.org/fop/2.0/upgrading.html) says 
> "You should encounter very few issues in upgrading from FOP 1.0, except as 
> noted in the following: ...". The truth is completely different: starting by 
> replacing fop.jar, our code gets dozens of compiler errors! Many methods are 
> simply gone:
> FopFactory.newInstance()
> FoUserAgent.setBaseURL(String);
> FopFactory.getFontManager().setFontBaseURL(String)
> FopFactory.setURIResolver(URIResolver);
> etc.
> The javadocs from 1.1 to 2.0 simple changed - no deprecated methods, no hints 
> how to replace old methods.
> The FOP 2.0 embedding page 
> (https://xmlgraphics.apache.org/fop/2.0/embedding.html) just shows simple 
> examples to start from the ground. I can't find any migration help how to 
> replace old code. 
> E.g. how can I set the font base? 
> FopFactory.getFontManager().setFontBaseURL(String) is gone and I can't find 
> any equivalent code for FOP 2.0!
> This is a major bug in FOP 2.0 as API changes are not documented to upgrade 
> from FOP 1.x Java API to FOP 2.0!
> Now I just can search and try and experiment if I get our old code somehow 
> running with all those undocumented API changes. Can you please state a 
> migration documentation for all methods (method signatures) that don't exist 
> anymore? We can't start coding all over again from scratch. Thank you very 
> much!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to