Skip to content

Commit

Permalink
Switch to OpenPDF Extension
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Oct 15, 2024
1 parent 7f37b61 commit 7e5fdbc
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 109 deletions.
4 changes: 4 additions & 0 deletions deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
<groupId>io.quarkiverse.poi</groupId>
<artifactId>quarkus-poi-deployment</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.openpdf</groupId>
<artifactId>quarkus-openpdf-deployment</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-vertx-http-dev-ui-spi</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,15 @@ void registerForReflection(CombinedIndexBuildItem combinedIndex, BuildProducer<R
classNames.addAll(collectClassesInPackage(combinedIndex, net.sf.jasperreports.governors.GovernorExtensionsRegistryFactory.class.getPackageName()));
classNames.addAll(collectClassesInPackage(combinedIndex, net.sf.jasperreports.jackson.util.JacksonUtil.class.getPackageName()));
classNames.addAll(collectClassesInPackage(combinedIndex, net.sf.jasperreports.parts.PartComponentsExtensionsRegistryFactory.class.getPackageName()));
classNames.addAll(collectClassesInPackage(combinedIndex, net.sf.jasperreports.pdf.classic.ClassicPdfProducerFactory.class.getPackageName()));
classNames.addAll(collectClassesInPackage(combinedIndex, net.sf.jasperreports.pdf.type.PdfVersionEnum.class.getPackageName()));
classNames.addAll(collectClassesInPackage(combinedIndex, net.sf.jasperreports.renderers.AbstractSvgDataToGraphics2DRenderer.class.getPackageName()));
classNames.addAll(collectClassesInPackage(combinedIndex, net.sf.jasperreports.renderers.util.SvgFontProcessor.class.getPackageName()));
classNames.addAll(collectClassesInPackage(combinedIndex, net.sf.jasperreports.repo.DefaultRepositoryExtensionsRegistryFactory.class.getPackageName()));
classNames.addAll(collectClassesInPackage(combinedIndex, net.sf.jasperreports.util.JsonLoader.class.getPackageName()));

// PDF
classNames.addAll(collectClassesInPackage(combinedIndex, net.sf.jasperreports.pdf.classic.ClassicPdfProducerFactory.class.getPackageName()));
classNames.addAll(collectClassesInPackage(combinedIndex, net.sf.jasperreports.pdf.type.PdfVersionEnum.class.getPackageName()));

// basic Java classes found in reports for serialization
classNames.add("java.util.Collections$CheckedCollection");
classNames.add("java.util.Collections$CheckedList");
Expand Down

This file was deleted.

13 changes: 12 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<!-- Dependency Versions -->
<version.quarkus>3.15.1</version.quarkus>
<version.quarkus-poi>2.1.0</version.quarkus-poi>
<version.quarkus-openpdf>3.1.0</version.quarkus-openpdf>
<version.jasperreports>7.0.1</version.jasperreports>
</properties>
<dependencyManagement>
Expand All @@ -53,6 +54,16 @@
<artifactId>quarkus-poi-deployment</artifactId>
<version>${version.quarkus-poi}</version>
</dependency>
<dependency>
<groupId>io.quarkiverse.openpdf</groupId>
<artifactId>quarkus-openpdf</artifactId>
<version>${version.quarkus-openpdf}</version>
</dependency>
<dependency>
<groupId>io.quarkiverse.openpdf</groupId>
<artifactId>quarkus-openpdf-deployment</artifactId>
<version>${version.quarkus-openpdf}</version>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
Expand Down Expand Up @@ -132,4 +143,4 @@
</modules>
</profile>
</profiles>
</project>
</project>
8 changes: 8 additions & 0 deletions runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
<groupId>io.quarkiverse.poi</groupId>
<artifactId>quarkus-poi</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.openpdf</groupId>
<artifactId>quarkus-openpdf</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>commons-logging-jboss-logging</artifactId>
Expand Down Expand Up @@ -92,6 +96,10 @@
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
<exclusion>
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf</artifactId>
</exclusion>
</exclusions>
</dependency>

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package net.sf.jasperreports.pdf.classic;

import java.io.IOException;

import com.lowagie.text.DocumentException;
import com.lowagie.text.pdf.PdfFormField;
import com.lowagie.text.pdf.RadioCheckField;
import com.oracle.svm.core.annotate.Alias;
import com.oracle.svm.core.annotate.Substitute;
import com.oracle.svm.core.annotate.TargetClass;

import net.sf.jasperreports.engine.JRRuntimeException;

@TargetClass(className = "net.sf.jasperreports.pdf.classic.ClassicRadioCheck")
final class ClassicRadioCheckSubstitution {

@Alias
ClassicPdfProducer pdfProducer;
@Alias
RadioCheckField radioCheckField;

@Substitute
public void addToGroup() throws IOException {
PdfFormField radioGroup = this.pdfProducer.getRadioGroup(this.radioCheckField);

try {
radioGroup.addKid(this.radioCheckField.getKidField());
} catch (DocumentException var3) {
DocumentException e = var3;
throw new JRRuntimeException(e);
}
}

}

0 comments on commit 7e5fdbc

Please sign in to comment.