From 4dffc2e5041d95746465ca5193eae9559977c788 Mon Sep 17 00:00:00 2001 From: Maxim Date: Mon, 3 Jun 2024 00:16:11 +0300 Subject: [PATCH] Add StaticCoreContainers to library --- .../src/main/java/org/verapdf/model/ModelParser.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pdfbox-validation-model/src/main/java/org/verapdf/model/ModelParser.java b/pdfbox-validation-model/src/main/java/org/verapdf/model/ModelParser.java index 9f6d560b..6870912b 100644 --- a/pdfbox-validation-model/src/main/java/org/verapdf/model/ModelParser.java +++ b/pdfbox-validation-model/src/main/java/org/verapdf/model/ModelParser.java @@ -21,6 +21,7 @@ package org.verapdf.model; import org.verapdf.xmp.XMPException; +import org.verapdf.containers.StaticCoreContainers; import org.verapdf.xmp.containers.StaticXmpCoreContainers; import org.verapdf.xmp.impl.VeraPDFMeta; import java.util.logging.Logger; @@ -73,11 +74,13 @@ public final class ModelParser implements PDFAParser { private ModelParser(final InputStream docStream, PDFAFlavour flavour, PDFAFlavour defaultFlavour) throws IOException { this.document = PDDocument.load(docStream, false, true); this.flavour = detectFlavour(this.document, flavour, defaultFlavour); + StaticCoreContainers.setFlavour(this.flavour); } private ModelParser(final File pdfFile, PDFAFlavour flavour, PDFAFlavour defaultFlavour) throws IOException { this.document = PDDocument.load(pdfFile, false, true); this.flavour = detectFlavour(this.document, flavour, defaultFlavour); + StaticCoreContainers.setFlavour(this.flavour); } public static ModelParser createModelWithFlavour(InputStream toLoad, PDFAFlavour flavour) @@ -158,6 +161,7 @@ private static PDFAFlavour obtainFlavour(PDDocument document, PDFAFlavour defaul private static void cleanUp() { StaticContainers.clearAllContainers(); + StaticCoreContainers.clearAllContainers(); StaticXmpCoreContainers.clearAllContainers(); }