diff --git a/library/pom.xml b/library/pom.xml index 2ab63d9f..52376253 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -79,12 +79,12 @@ org.apache.pdfbox preflight - 2.0.27 + 3.0.2 org.apache.pdfbox pdfbox - 2.0.27 + 3.0.2 org.dom4j diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/DXExporterFromA3.java b/library/src/main/java/org/mustangproject/ZUGFeRD/DXExporterFromA3.java index 1e22166c..b6ebdfe4 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/DXExporterFromA3.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/DXExporterFromA3.java @@ -22,6 +22,7 @@ import org.apache.pdfbox.cos.*; import org.apache.pdfbox.io.IOUtils; +import org.apache.pdfbox.io.RandomAccessReadBuffer; import org.apache.pdfbox.pdmodel.*; import org.apache.pdfbox.pdmodel.common.PDMetadata; import org.apache.pdfbox.pdmodel.common.filespecification.PDComplexFileSpecification; @@ -29,7 +30,6 @@ import org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure.PDMarkInfo; import org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure.PDStructureTreeRoot; import org.apache.pdfbox.pdmodel.graphics.color.PDOutputIntent; -import org.apache.pdfbox.preflight.utils.ByteArrayDataSource; import org.apache.xmpbox.XMPMetadata; import org.apache.xmpbox.schema.AdobePDFSchema; import org.apache.xmpbox.schema.DublinCoreSchema; @@ -162,7 +162,7 @@ public DXExporterFromA3 addAdditionalFile(String name, byte[] content) { * @param pdfBinary binary of a PDF/A1 compliant document */ public DXExporterFromA3 load(byte[] pdfBinary) throws IOException { - ensurePDFIsValid(new ByteArrayDataSource(new ByteArrayInputStream(pdfBinary))); + ensurePDFIsValid((DataSource) new RandomAccessReadBuffer(pdfBinary)); doc = PDDocument.load(pdfBinary); return this; } @@ -542,6 +542,7 @@ protected void writePDFAIdentificationSchema(XMPMetadata xmp) { } protected PDFAIdentificationSchema getPDFAIdentificationSchema(XMPMetadata xmp) { + PDFAIdentificationSchema pdfaid = xmp.getPDFIdentificationSchema(); if (pdfaid != null) if (overwrite)