Extras icon indicating copy to clipboard operation
Extras copied to clipboard

[Bug]: plantuml: PDF generation fails due to missing dependencies (ClassNotFoundException)

Open Foadsf opened this issue 2 weeks ago • 2 comments

Prerequisites

  • [x] I have written a descriptive issue title.
  • [x] I have searched all issues/PRs to ensure it has not already been reported or fixed.
  • [x] I have verified that I am using the latest version of Scoop and corresponding bucket.

Package Name

plantuml

Expected/Current Behaviour

Expected: Running plantuml -tpdf file.puml should generate a PDF file.

Current: The application crashes with a Java error because the standard PlantUML jar does not include the Apache Batik dependencies required for PDF generation.

Error trace: java.lang.ClassNotFoundException: org.apache.batik.apps.rasterizer.SVGConverter

Steps to Reproduce

# 1. Install plantuml
scoop install plantuml

# 2. Create a dummy file
Set-Content -Path "test.puml" -Value "@startuml`nA->B`n@enduml"

# 3. Attempt to generate PDF
plantuml -tpdf test.puml

Possible Solution

The current manifest installs the standard plantuml.jar. PDF generation requires either:

  1. Adding the Apache Batik libraries to the classpath.
  2. Or, if available, switching the source to a PlantUML distribution that bundles these dependencies.

Scoop and Buckets Version

Current Scoop version:
b588a06e (HEAD -> master, tag: v0.5.3, origin/master, origin/HEAD) chore(release): Bump to version 0.5.3 (resync) (#6436)

'main' bucket:
47de37cfc (HEAD -> master, origin/master, origin/HEAD) scala-cli: Update to version 1.10.1

'extras' bucket:
451cea5791 (HEAD -> master, origin/master, origin/HEAD) qq: Update to version 9.7.25.29417, disable checkver

Scoop Config

last_update                       scoop_repo                              scoop_branch
-----------                       ----------                              ------------
2025-12-08T20:41:04.6589404+01:00 https://github.com/ScoopInstaller/Scoop master

PowerShell Version

Name                           Value
----                           -----
PSVersion                      5.1.26100.7019
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.26100.7019
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Additional Softwares

Java Runtime: temurin-lts-jre (Eclipse Temurin JDK with Hotspot 17)
Graphviz: 2.44.1

Foadsf avatar Dec 08 '25 20:12 Foadsf

Or, if available, switching the source to a PlantUML distribution that bundles these dependencies.

I'm not sure whether such a distribution exists as I'm not a PlantUML user. Do you know if there is one that already bundles these dependencies?

z-Fng avatar Dec 09 '25 22:12 z-Fng

This appears to be intentional. See also: https://plantuml.com/pdf.

Some users have asked for the ability to generate diagrams directly in PDF format. Unfortunately, this is not an easy task, and would require the need of several external libraries (Batik and FOP). This goes against the wish to keep plantuml.jar file not too big and to facilitate its integration with other products.

So by default PDF generation is not enabled. This will probably fit a majority of users' needs. 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

You have to download those files from Batik and FOP web site. For testing purposes only, those files have been put together in a zip here. Those files have to be in the very same folder as plantuml.jar (this is important).

Since it's not feasible for us to include dependencies for every optional feature, you'll need to add those dependencies yourself.

z-Fng avatar Dec 09 '25 22:12 z-Fng

Added official Batik/FOP libraries for PDF support in https://github.com/ScoopInstaller/Extras/commit/fd15261f82fab6d546badd7eeae70f84985318ab.

z-Fng avatar Dec 15 '25 20:12 z-Fng