Simple PDF/A Conversion with Apache PDFBox
PdfaConverter.convert(String inputFilePath, String outputFilePath);
PdfaConverter.convert(String inputFilePath, String outputFilePath, float pdfVersion, String pdfPart, String pdfConformance);
byte[] result = PdfaConverter.convert(byte[] inputContent);
byte[] result = PdfaConverter.convert(byte[] inputContent, float pdfVersion, String pdfPart, String pdfConformance);
- Add below contents to
pom.xml
.
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>com.neptuneli</groupId>
<artifactId>pdfa-conversion</artifactId>
<version>1.1.0</version>
</dependency>
- Convert the PDF.
PdfaConverter.convert("D:\\input.pdf", "D:\\output.pdf");