Skip to content

Commit

Permalink
using randomAccessBuffer from https://pdfbox.apache.org/3.0/migration…
Browse files Browse the repository at this point in the history
  • Loading branch information
jstaerk committed Apr 25, 2024
1 parent 43d9794 commit b3a23d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions library/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>preflight</artifactId>
<version>2.0.27</version>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.27</version>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.dom4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@

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;
import org.apache.pdfbox.pdmodel.common.filespecification.PDEmbeddedFile;
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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -542,6 +542,7 @@ protected void writePDFAIdentificationSchema(XMPMetadata xmp) {
}

protected PDFAIdentificationSchema getPDFAIdentificationSchema(XMPMetadata xmp) {

PDFAIdentificationSchema pdfaid = xmp.getPDFIdentificationSchema();
if (pdfaid != null)
if (overwrite)
Expand Down

0 comments on commit b3a23d4

Please sign in to comment.