You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected the SVG code to use the logic in FSUriResolver implementation but it does not and I don't know how to provide an implementation to fix the path.
I believe we should be able to change the base path for resolving SVG's in the filesystem / remote.
Any hints as to where/how can this be done?
Thanks,
More details bellow:
We use relative urls for the sprites and we get:
2020-02-12 22:19:21.670 WARN 520661 --- [ault-executor-0] com.openhtmltopdf.exception : Couldn't draw SVG.
org.apache.batik.transcoder.TranscoderException: null
Enclosed Exception:
report-assets/sprites/solid.svg (No such file or directory)
at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:226) ~[batik-transcoder-1.12.jar:na]
at com.openhtmltopdf.svgsupport.PDFTranscoder.transcode(PDFTranscoder.java:216) ~[openhtmltopdf-svg-support-1.0.1.jar:na]
at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:142) ~[batik-transcoder-1.12.jar:na]
at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:156) ~[batik-transcoder-1.12.jar:na]
at com.openhtmltopdf.svgsupport.BatikSVGImage.drawSVG(BatikSVGImage.java:185) ~[openhtmltopdf-svg-support-1.0.1.jar:na]
at com.openhtmltopdf.pdfboxout.PdfBoxSVGReplacedElement.paint(PdfBoxSVGReplacedElement.java:70) [openhtmltopdf-pdfbox-1.0.1.jar:na]
at com.openhtmltopdf.pdfboxout.PdfBoxFastOutputDevice.paintReplacedElement(PdfBoxFastOutputDevice.java:275) [openhtmltopdf-pdfbox-1.0.1.jar:na]
at com.openhtmltopdf.render.displaylist.DisplayListPainter.paintReplacedElement(DisplayListPainter.java:167) [openhtmltopdf-core-1.0.1.jar:na]
at com.openhtmltopdf.render.displaylist.DisplayListPainter.paintReplacedElements(DisplayListPainter.java:149) [openhtmltopdf-core-1.0.1.jar:na]
at com.openhtmltopdf.render.displaylist.DisplayListPainter.paint(DisplayListPainter.java:266) [openhtmltopdf-core-1.0.1.jar:na]
at com.openhtmltopdf.render.displaylist.DisplayListPainter.paintInlineContent(DisplayListPainter.java:129) [openhtmltopdf-core-1.0.1.jar:na]
at com.openhtmltopdf.render.displaylist.DisplayListPainter.paint(DisplayListPainter.java:260) [openhtmltopdf-core-1.0.1.jar:na]
at com.openhtmltopdf.pdfboxout.PdfBoxRenderer.paintPageFast(PdfBoxRenderer.java:898) [openhtmltopdf-pdfbox-1.0.1.jar:na]
at com.openhtmltopdf.pdfboxout.PdfBoxRenderer.writePDFFast(PdfBoxRenderer.java:615) [openhtmltopdf-pdfbox-1.0.1.jar:na]
at com.openhtmltopdf.pdfboxout.PdfBoxRenderer.createPdfFast(PdfBoxRenderer.java:550) [openhtmltopdf-pdfbox-1.0.1.jar:na]
at com.openhtmltopdf.pdfboxout.PdfBoxRenderer.createPDF(PdfBoxRenderer.java:468) [openhtmltopdf-pdfbox-1.0.1.jar:na]
at com.openhtmltopdf.pdfboxout.PdfBoxRenderer.createPDF(PdfBoxRenderer.java:405) [openhtmltopdf-pdfbox-1.0.1.jar:na]
at com.openhtmltopdf.pdfboxout.PdfBoxRenderer.createPDF(PdfBoxRenderer.java:387) [openhtmltopdf-pdfbox-1.0.1.jar:na]
at com.openhtmltopdf.pdfboxout.PdfRendererBuilder.run(PdfRendererBuilder.java:41) [openhtmltopdf-pdfbox-1.0.1.jar:na]
at com.gr8pi.reportgen.openhtmltopdf.OpenHtmlToPdfRenderer.render(OpenHtmlToPdfRenderer.java:119) [reportgen-openhtmltopdf-5.1.0-SNAPSHOT.jar:na]
at gr8pi.reportgen.renderer.grpc.DefaultSurveyReports.renderReport(DefaultSurveyReports.java:107) [reportgen-renderer-5.1.0-SNAPSHOT.jar:na]
at gr8pi.reportgen.renderer.grpc.DefaultSurveyReports.generateComparativeReport(DefaultSurveyReports.java:50) [reportgen-renderer-5.1.0-SNAPSHOT.jar:na]
at gr8pi.reportgen.grpc.SurveyReportsGrpc$MethodHandlers.invoke(SurveyReportsGrpc.java:229) [reportgen-grpc-api-5.1.0-SNAPSHOT.jar:na]
at io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:171) [grpc-stub-1.20.0.jar:1.20.0]
at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:322) [grpc-core-1.21.0.jar:1.21.0]
at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:762) [grpc-core-1.21.0.jar:1.21.0]
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) [grpc-core-1.21.0.jar:1.21.0]
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123) [grpc-core-1.21.0.jar:1.21.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_242]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_242]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_242]
Caused by: org.apache.batik.bridge.BridgeException: report-assets/sprites/solid.svg (No such file or directory)
at org.apache.batik.bridge.BridgeContext.getReferencedNode(BridgeContext.java:788) ~[batik-bridge-1.12.jar:na]
at org.apache.batik.bridge.BridgeContext.getReferencedElement(BridgeContext.java:804) ~[batik-bridge-1.12.jar:na]
at org.apache.batik.bridge.SVGUseElementBridge.buildCompositeGraphicsNode(SVGUseElementBridge.java:124) ~[batik-bridge-1.12.jar:na]
at org.apache.batik.bridge.SVGUseElementBridge.createGraphicsNode(SVGUseElementBridge.java:98) ~[batik-bridge-1.12.jar:na]
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:213) ~[batik-bridge-1.12.jar:na]
at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171) ~[batik-bridge-1.12.jar:na]
at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:82) ~[batik-bridge-1.12.jar:na]
at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:208) ~[batik-transcoder-1.12.jar:na]
... 30 common frames omitted
and ...
Caused by: org.apache.batik.bridge.BridgeException: report-assets/sprites/solid.svg (No such file or directory)
The SVG iserting looks like (we use react, hence the attribute capitalization):
Hello,
I'm having some difficulties rendering PDF sprites. I followed the instructions in https://github.com/danfickle/openhtmltopdf/wiki/Plugins:-SVG-Images#svg-sprites .
I expected the SVG code to use the logic in
FSUriResolver
implementation but it does not and I don't know how to provide an implementation to fix the path.I believe we should be able to change the base path for resolving SVG's in the filesystem / remote.
Any hints as to where/how can this be done?
Thanks,
More details bellow:
We use relative urls for the sprites and we get:
The SVG iserting looks like (we use react, hence the attribute capitalization):
Our code to render the PDF:
The text was updated successfully, but these errors were encountered: