From 0984b1082d978f0cd77ef3f414fe73e1a15cde80 Mon Sep 17 00:00:00 2001 From: Melloware Date: Tue, 15 Oct 2024 13:51:03 -0400 Subject: [PATCH] Switch to OpenPDF (#243) --- pom.xml | 4 +- quarkus-primefaces/deployment/pom.xml | 4 +- quarkus-primefaces/runtime/pom.xml | 6 +-- .../graal/SubstituteDataTablePdfExporter.java | 38 ------------------- .../graal/SubstituteTreeTablePdfExporter.java | 38 ------------------- 5 files changed, 7 insertions(+), 83 deletions(-) delete mode 100644 quarkus-primefaces/runtime/src/main/java/io/quarkus/primefaces/runtime/graal/SubstituteDataTablePdfExporter.java delete mode 100644 quarkus-primefaces/runtime/src/main/java/io/quarkus/primefaces/runtime/graal/SubstituteTreeTablePdfExporter.java diff --git a/pom.xml b/pom.xml index c321ae9..b562a8c 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ 3.8.5 2.0.6 - 3.0.7 + 3.1.0 14.0.5 14.0.5 4.0.2 @@ -138,4 +138,4 @@ - + \ No newline at end of file diff --git a/quarkus-primefaces/deployment/pom.xml b/quarkus-primefaces/deployment/pom.xml index 13a835e..c9aa7d2 100644 --- a/quarkus-primefaces/deployment/pom.xml +++ b/quarkus-primefaces/deployment/pom.xml @@ -28,8 +28,8 @@ ${quarkus-poi.version} - io.quarkiverse.itext - quarkus-itext-deployment + io.quarkiverse.openpdf + quarkus-openpdf-deployment ${quarkus-itext.version} diff --git a/quarkus-primefaces/runtime/pom.xml b/quarkus-primefaces/runtime/pom.xml index f3cdc0a..b00d04b 100644 --- a/quarkus-primefaces/runtime/pom.xml +++ b/quarkus-primefaces/runtime/pom.xml @@ -29,8 +29,8 @@ ${quarkus-poi.version} - io.quarkiverse.itext - quarkus-itext + io.quarkiverse.openpdf + quarkus-openpdf ${quarkus-itext.version} @@ -89,4 +89,4 @@ - + \ No newline at end of file diff --git a/quarkus-primefaces/runtime/src/main/java/io/quarkus/primefaces/runtime/graal/SubstituteDataTablePdfExporter.java b/quarkus-primefaces/runtime/src/main/java/io/quarkus/primefaces/runtime/graal/SubstituteDataTablePdfExporter.java deleted file mode 100644 index 41d8ba5..0000000 --- a/quarkus-primefaces/runtime/src/main/java/io/quarkus/primefaces/runtime/graal/SubstituteDataTablePdfExporter.java +++ /dev/null @@ -1,38 +0,0 @@ -package io.quarkus.primefaces.runtime.graal; - -import org.primefaces.component.datatable.export.DataTablePDFExporter; - -import com.lowagie.text.Paragraph; -import com.lowagie.text.pdf.PdfPCell; -import com.lowagie.text.pdf.PdfPTable; -import com.oracle.svm.core.annotate.Substitute; -import com.oracle.svm.core.annotate.TargetClass; - -/** - * See notes above each method - */ -@TargetClass(DataTablePDFExporter.class) -public final class SubstituteDataTablePdfExporter { - - /** - * iText Paragraph.add(object) is ambiguous and is confusing the native parser with the error: - * "Discovered unresolved method during parsing: com.lowagie.text.Paragraph.add(com.lowagie.text.Element)". - * This fix makes a more specific addParagraph(Paragraph) that does not confuse the native compiler. - */ - @Substitute - private void addEmptyLine(Paragraph paragraph, int number) { - for (int i = 0; i < number; i++) { - paragraph.addParagraph(new Paragraph(" ")); - } - } - - /** - * iText PdfPTable.addCell(object) is ambiguous and is confusing the native parser with the error: - * "Discovered unresolved method during parsing: com.lowagie.text.PdfPTable.addCell(com.lowagie.text.pdf.PdfPCell)". - * This fix makes a more specific addCellAsCell(Paragraph) that does not confuse the native compiler. - */ - @Substitute - protected void addCell(PdfPTable table, PdfPCell cell) { - table.addCellAsCell(cell); - } -} diff --git a/quarkus-primefaces/runtime/src/main/java/io/quarkus/primefaces/runtime/graal/SubstituteTreeTablePdfExporter.java b/quarkus-primefaces/runtime/src/main/java/io/quarkus/primefaces/runtime/graal/SubstituteTreeTablePdfExporter.java deleted file mode 100644 index d167cfe..0000000 --- a/quarkus-primefaces/runtime/src/main/java/io/quarkus/primefaces/runtime/graal/SubstituteTreeTablePdfExporter.java +++ /dev/null @@ -1,38 +0,0 @@ -package io.quarkus.primefaces.runtime.graal; - -import org.primefaces.component.treetable.export.TreeTablePDFExporter; - -import com.lowagie.text.Paragraph; -import com.lowagie.text.pdf.PdfPCell; -import com.lowagie.text.pdf.PdfPTable; -import com.oracle.svm.core.annotate.Substitute; -import com.oracle.svm.core.annotate.TargetClass; - -/** - * See notes above each method - */ -@TargetClass(TreeTablePDFExporter.class) -public final class SubstituteTreeTablePdfExporter { - - /** - * iText Paragraph.add(object) is ambiguous and is confusing the native parser with the error: - * "Discovered unresolved method during parsing: com.lowagie.text.Paragraph.add(com.lowagie.text.Element)". - * This fix makes a more specific addParagraph(Paragraph) that does not confuse the native compiler. - */ - @Substitute - private void addEmptyLine(Paragraph paragraph, int number) { - for (int i = 0; i < number; i++) { - paragraph.addParagraph(new Paragraph(" ")); - } - } - - /** - * iText PdfPTable.addCell(object) is ambiguous and is confusing the native parser with the error: - * "Discovered unresolved method during parsing: com.lowagie.text.PdfPTable.addCell(com.lowagie.text.pdf.PdfPCell)". - * This fix makes a more specific addCellAsCell(Paragraph) that does not confuse the native compiler. - */ - @Substitute - protected void addCell(PdfPTable table, PdfPCell cell) { - table.addCellAsCell(cell); - } -}