Create PDF generates "Error: cannot access transcoder for image of type application/pdf"

0 votes
asked Sep 28, 2017 by anonymous

I've downloaded plantUML and the .jar-files specified in the pdf instructions (http://plantuml.com/pdf).

One part was a little confusing though; to get the files listed I never needed to download anything from Batik, only FOP.

I downloaded version FOP 1.1 as this most closely matched the versions listed. (The dropbox link is dead by the way)

$ ls -la ~/Downloads/plantuml
-rwxrwxrwx@  avalon-framework-4.2.0.jar
-rwxrwxrwx@  batik-all-1.7.jar
-rwxrwxrwx@  commons-io-1.3.1.jar
-rwxrwxrwx@  commons-logging-1.0.4.jar
-rwxrwxrwx@  fop.jar
-rwxrwxrwx@  plantuml.jar
-rwxrwxrwx@  xml-apis-1.3.04.jar
-rwxrwxrwx@  xmlgraphics-commons-1.5.jar
 
$java -jar ~/Downloads/plantuml/plantuml.jar -tpdf MyFile.wsd
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.sourceforge.plantuml.pdf.PdfConverter.convert(PdfConverter.java:69)
at net.sourceforge.plantuml.UmlDiagram.exportDiagramInternalPdf(UmlDiagram.java:371)
at net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:232)
at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:134)
at net.sourceforge.plantuml.PSystemUtils.exportDiagramsCuca(PSystemUtils.java:208)
at net.sourceforge.plantuml.PSystemUtils.exportDiagrams(PSystemUtils.java:67)
at net.sourceforge.plantuml.SourceFileReader.getGeneratedImages(SourceFileReader.java:212)
at net.sourceforge.plantuml.Run.manageFileInternal(Run.java:416)
at net.sourceforge.plantuml.Run.processArgs(Run.java:328)
at net.sourceforge.plantuml.Run.manageAllFiles(Run.java:298)
at net.sourceforge.plantuml.Run.main(Run.java:158)
Caused by: org.apache.batik.apps.rasterizer.SVGConverterException: Error: cannot access transcoder for image of type application/pdf
at org.apache.batik.apps.rasterizer.SVGConverter.execute(Unknown Source)
... 15 more
Exception in thread "main" java.lang.UnsupportedOperationException
at net.sourceforge.plantuml.pdf.PdfConverter.convert(PdfConverter.java:72)
at net.sourceforge.plantuml.UmlDiagram.exportDiagramInternalPdf(UmlDiagram.java:371)
at net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:232)
at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:134)
at net.sourceforge.plantuml.PSystemUtils.exportDiagramsCuca(PSystemUtils.java:208)
at net.sourceforge.plantuml.PSystemUtils.exportDiagrams(PSystemUtils.java:67)
at net.sourceforge.plantuml.SourceFileReader.getGeneratedImages(SourceFileReader.java:212)
at net.sourceforge.plantuml.Run.manageFileInternal(Run.java:416)
at net.sourceforge.plantuml.Run.processArgs(Run.java:328)
at net.sourceforge.plantuml.Run.manageAllFiles(Run.java:298)
at net.sourceforge.plantuml.Run.main(Run.java:158)

SVGs and PNGs are generated with no problem.

Any ideas?

 

Thanks,

1 Answer

0 votes
answered Sep 29, 2017 by plantuml (141,410 points)
Could you try with the version we have packaged here :

https://www.dropbox.com/s/p68jqt29x3asppv/batikAndFop.zip?dl=0

(We have to update http://plantuml.com/pdf with this new location)

And tell us the result! Thanks
commented Sep 29, 2017 by anonymous
Thanks for the reply.
Unfortunately, same error.
commented Oct 1, 2017 by plantuml (141,410 points)
Ok, the manifest file was also incomplete...
Could you try with this beta
https://www.dropbox.com/s/koo42q3d9gxw288/plantuml.jar?dl=0
Thanks!
commented Oct 2, 2017 by anonymous
edited Oct 2, 2017
Thanks, that worked!
It did spot out a whole lot of info the first time though (guessing it was from Batik or FOP).
What was the missing link here? If I were to deploy this in a less ad-hoc way, what would be the procedure? I think it would be great with a dedicated PDF release since PDF is the only vector format (I think) that plays well with Word, but I reckon the extra effort required for a minority of users.
...