From a835765b0d02e50c800ff7c2912735d4144513ae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 22 Aug 2026 09:55:20 +0000 Subject: [PATCH 1/3] build(deps): bump org.xhtmlrenderer:flying-saucer-pdf Bumps [org.xhtmlrenderer:flying-saucer-pdf](https://github.com/flyingsaucerproject/flyingsaucer) from 9.1.22 to 10.5.0. - [Release notes](https://github.com/flyingsaucerproject/flyingsaucer/releases) - [Changelog](https://github.com/flyingsaucerproject/flyingsaucer/blob/main/CHANGELOG.md) - [Commits](https://github.com/flyingsaucerproject/flyingsaucer/compare/v9.1.22...v10.5.0) --- updated-dependencies: - dependency-name: org.xhtmlrenderer:flying-saucer-pdf dependency-version: 10.5.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 353ec1b..258fbf1 100644 --- a/pom.xml +++ b/pom.xml @@ -46,7 +46,7 @@ 3.0.8 20260814 2.22.0 - 9.1.22 + 10.5.0 33.4.0-jre 2.22.2 5.5.1 From 78643a4862efd95412e5066fd5d2a501ff47dc93 Mon Sep 17 00:00:00 2001 From: Rahil Date: Sat, 22 Aug 2026 13:02:45 +0300 Subject: [PATCH 2/3] fix: add slf4j and xml-apis-ext deps for flying-saucer 10.x compatibility - Exclude xml-apis-ext transitive dep from flying-saucer (jitpack artifact is broken) - Add xml-apis:xml-apis-ext:1.3.04 directly from Maven Central fallback - Add slf4j-api (required by flying-saucer 10.x) and slf4j-simple for tests - Update HTMLToPDF to use ITextRenderer.fromUrl() static factory (10.x API) - Catch org.openpdf.text.DocumentException instead of removed com.lowagie variant --- pom.xml | 28 +++++++++++++++++-- .../java/com/rsh/jtoolkit/pdf/HTMLToPDF.java | 5 ++-- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 1d4c6c4..4bb105b 100644 --- a/pom.xml +++ b/pom.xml @@ -168,8 +168,17 @@ org.bouncycastle bcpkix-jdk15on + + xml-apis + xml-apis-ext + + + xml-apis + xml-apis-ext + 1.3.04 + @@ -231,9 +240,22 @@ true - - - org.junit.jupiter + + + org.slf4j + slf4j-api + 2.0.17 + + + org.slf4j + slf4j-simple + 2.0.17 + test + + + + + org.junit.jupiter junit-jupiter test diff --git a/src/main/java/com/rsh/jtoolkit/pdf/HTMLToPDF.java b/src/main/java/com/rsh/jtoolkit/pdf/HTMLToPDF.java index 5f2ca4a..3652d75 100644 --- a/src/main/java/com/rsh/jtoolkit/pdf/HTMLToPDF.java +++ b/src/main/java/com/rsh/jtoolkit/pdf/HTMLToPDF.java @@ -22,15 +22,14 @@ private HTMLToPDF() {} public static void generatePDF(String inputHtmlPath, String outputPdfPath) { try { String url = new File(inputHtmlPath).toURI().toURL().toString(); + ITextRenderer renderer = ITextRenderer.fromUrl(url); try (OutputStream out = Files.newOutputStream(Paths.get(outputPdfPath))) { - ITextRenderer renderer = new ITextRenderer(); - renderer.setDocument(url); renderer.layout(); renderer.createPDF(out); } } catch (IOException e) { throw new UncheckedIOException("Failed to generate PDF from " + inputHtmlPath, e); - } catch (com.lowagie.text.DocumentException e) { + } catch (org.openpdf.text.DocumentException e) { throw new IllegalStateException("Failed to render PDF from " + inputHtmlPath, e); } } From e271612d97723a9ac96102557230f2c7e6482a51 Mon Sep 17 00:00:00 2001 From: Rahil Date: Sat, 22 Aug 2026 13:06:55 +0300 Subject: [PATCH 3/3] fix: exclude xml-apis-ext entirely instead of replacing with broken artifact xml-apis:xml-apis-ext does not exist on Maven Central (both 1.3.04 and 2.2 are empty artifacts). Simply excluding it from the flying-saucer transitive dependency tree is sufficient since Batik SVG support is not used here. --- pom.xml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 4bb105b..f92cc5f 100644 --- a/pom.xml +++ b/pom.xml @@ -174,13 +174,7 @@ - - xml-apis - xml-apis-ext - 1.3.04 - - - + org.apache.poi poi