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

0 votes
asked Sep 28, 2017 in To be sorted 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 (164,580 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 (164,580 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.
commented Mar 11 by Alexander
Please do update the instructions on plantuml.com/pdf. I've spent way too much time trying to get things to work.
commented Mar 11 by plantuml (164,580 points)
Hello,
Not sure about what to do : http://plantuml.com/pdf seems up to date
Could you tell us more about what is missing ?
(Or even better, do the changes on http://wiki.plantuml.net/site/pdf )

Thanks!
commented Mar 23 by anonymous
When we download the ZIP from plantum/pdf, certain jar files cannot be extracted.
commented Mar 23 by Alexander
In particular, something seems wrong with the archive. Here's the output of macOS 10.13's /usr/bin/unzip:

Wintermute:Downloads userid$ unzip batikAndFop.zip
Archive:  batikAndFop.zip
   skipping: ant.jar                 `LZMA' method not supported
   skipping: avalon-framework-4.2.0.jar  `LZMA' method not supported
   skipping: batik-all-1.7.jar       `LZMA' method not supported
   skipping: commons-io-1.3.1.jar    `LZMA' method not supported
   skipping: commons-logging-1.0.4.jar  `LZMA' method not supported
   skipping: fop.jar                 `LZMA' method not supported
   skipping: xml-apis-ext-1.3.04.jar  `LZMA' method not supported
   skipping: xmlgraphics-commons-1.4.jar  `LZMA' method not supported
commented Mar 23 by Alexander
The problem that I had was that I tried to gather all dependent libraries from their official sites or maven's central repo. The remark "for testing purposes only" sounds a bit scary and, as said in the related comment, the archive doesn't work for me.

It took quite a while to find all the files (digging through the manifest for the correct version info) and then it still didn't work. Fortunately, I stumbled over this forum entry and found the link to the "beta" archive of dependencies in your dropbox.

It would have been a lot easier if the dependent libraries came bundled with PlantUML.

Anyway, it works now and we're very happy with the results! Thanks for the work!
...