PDF export does not work anymore with VS Code (again)

+1 vote
asked Aug 31, 2022 in Question / help by Caro

Hi,

I'm using PlantUML in VS Code and usually I export my diagrams as pdf, which worked fine before.

Now I'm getting the error I've pasted below. All jar-files like described in https://plantuml.com/de/pdf are were they should be and exporting as svg and png works fine, too.

I've already tried using the latest release of plantuml.jar, which made also no difference.

Can somebody help me with this problem?

Thanks in advance!

org.apache.batik.transcoder.TranscoderException: Error while setting up PDFDocumentGraphics2D
Enclosed Exception:
Error while setting up fonts
    at org.apache.fop.svg.PDFTranscoder.transcode(PDFTranscoder.java:136)
    at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown Source)
    at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown Source)
    at org.apache.batik.apps.rasterizer.SVGConverter.transcode(Unknown Source)
    at org.apache.batik.apps.rasterizer.SVGConverter.execute(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.sourceforge.plantuml.pdf.PdfConverter.convert(PdfConverter.java:75)
    at net.sourceforge.plantuml.UmlDiagram.exportDiagramInternalPdf(UmlDiagram.java:277)
    at net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:132)
    at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:178)
    at net.sourceforge.plantuml.SourceStringReader.outputImage(SourceStringReader.java:172)
    at net.sourceforge.plantuml.Pipe.generateDiagram(Pipe.java:100)
    at net.sourceforge.plantuml.Pipe.managePipe(Pipe.java:92)
    at net.sourceforge.plantuml.Run.managePipe(Run.java:354)
    at net.sourceforge.plantuml.Run.main(Run.java:181)

commented Oct 18, 2022 by cas2905 (100 points)

Can somebody help with this problem? Unfortunately the pdf-export still does not work...

I guess this is a general problem with pdf generation, because when exporting as txt-file and converting it via command line

java -jar plantuml.jar -tpdf diagram.txt

(example command from https://plantuml.com/de/pdf) I get the same error.

commented Oct 18, 2022 by The-Lu (63,000 points)

Hello all,

If you want to use PDF, you have to download the following files:

  • avalon-framework-4.2.0.jar
  • batik-all-1.7.jar
  • commons-io-1.3.1.jar
  • commons-logging-1.0.4.jar
  • fop.jar
  • xml-apis-ext-1.3.04.jar
  • xmlgraphics-commons-1.4.jar
Are you OK with that?
See doc here:
commented Oct 18, 2022 by cas2905 (100 points)

Hi, 

thanks for answering. Yes, all instruction of https://plantuml.com/pdf were executed. 

One month ago it worked, but then from one day to another I got the above error. 

commented Oct 18, 2022 by The-Lu (63,000 points)

Perhaps the new versions of plantuml are not compatible with the old batik and all packages.
But I am not an expert about that.

@PlantUML team: If you have other ideas?

commented Oct 25, 2022 by cas2905 (100 points)
@PlantUML team: Do you have any update on this?

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...