From 0925598f211f0fc5f8da3941b62fd1700570bcc3 Mon Sep 17 00:00:00 2001 From: Maxim Date: Fri, 20 Oct 2023 14:31:17 +0300 Subject: [PATCH] PDF/UA-2. Add new methods. Remove unnecessary methods --- .../verapdf/model/impl/pb/pd/PBoxPDAnnot.java | 28 ------------------- .../model/impl/pb/pd/PBoxPDStructElem.java | 5 ++++ .../impl/pb/pd/PBoxPDStructTreeRoot.java | 5 ++++ .../model/impl/pb/pd/font/PBoxPDCIDFont.java | 20 ------------- .../model/impl/pb/pd/pboxse/PBoxSEFENote.java | 5 ++++ .../model/impl/pb/pd/PBoxPDAnnotTest.java | 18 ------------ 6 files changed, 15 insertions(+), 66 deletions(-) diff --git a/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/PBoxPDAnnot.java b/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/PBoxPDAnnot.java index 176e3cb6..b577ccbf 100644 --- a/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/PBoxPDAnnot.java +++ b/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/PBoxPDAnnot.java @@ -37,10 +37,8 @@ import org.verapdf.model.baselayer.Object; import org.verapdf.model.coslayer.CosBM; import org.verapdf.model.coslayer.CosLang; -import org.verapdf.model.coslayer.CosNumber; import org.verapdf.model.impl.pb.cos.PBCosBM; import org.verapdf.model.impl.pb.cos.PBCosLang; -import org.verapdf.model.impl.pb.cos.PBCosNumber; import org.verapdf.model.impl.pb.pd.actions.PBoxPDAction; import org.verapdf.model.impl.pb.pd.actions.PBoxPDAnnotationAdditionalActions; import org.verapdf.model.impl.pb.pd.annotations.PBoxPD3DAnnot; @@ -364,10 +362,6 @@ public List getLinkedObjects(String link) { return this.getAdditionalActions(); case A: return this.getA(); - case IC: - return this.getIC(); - case C: - return this.getC(); case APPEARANCE: return this.getAppearance(); case LANG: @@ -427,28 +421,6 @@ private List getA() { return Collections.emptyList(); } - private List getIC() { - return this.getNumbersFromArray(COSName.IC); - } - - private List getC() { - return this.getNumbersFromArray(COSName.C); - } - - private List getNumbersFromArray(COSName arrayName) { - COSBase colorArray = ((PDAnnotation) this.simplePDObject).getCOSObject().getDictionaryObject(arrayName); - if (colorArray instanceof COSArray) { - List color = new ArrayList<>(((COSArray) colorArray).size()); - for (COSBase colorValue : (COSArray) colorArray) { - if (colorValue instanceof COSNumber) { - color.add(PBCosNumber.fromPDFBoxNumber(colorValue)); - } - } - return Collections.unmodifiableList(color); - } - return Collections.emptyList(); - } - /** * @return normal appearance stream (N key in the appearance dictionary) of * the annotation diff --git a/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/PBoxPDStructElem.java b/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/PBoxPDStructElem.java index cb363064..7dfdb267 100644 --- a/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/PBoxPDStructElem.java +++ b/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/PBoxPDStructElem.java @@ -252,6 +252,11 @@ public Boolean getcircularMappingExist() { return null; } + @Override + public String getroleMapToSameNamespaceTag() { + return null; + } + @Override public List getLinkedObjects(String link) { switch (link) { diff --git a/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/PBoxPDStructTreeRoot.java b/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/PBoxPDStructTreeRoot.java index 162b6bdc..eb3154c8 100644 --- a/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/PBoxPDStructTreeRoot.java +++ b/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/PBoxPDStructTreeRoot.java @@ -154,4 +154,9 @@ public String gettopLevelFirstElementStandardType() { } return null; } + + @Override + public String getfirstChildStandardTypeNamespaceURL() { + return null; + } } diff --git a/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/font/PBoxPDCIDFont.java b/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/font/PBoxPDCIDFont.java index ff7f8210..45cd6bcd 100644 --- a/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/font/PBoxPDCIDFont.java +++ b/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/font/PBoxPDCIDFont.java @@ -55,8 +55,6 @@ public class PBoxPDCIDFont extends PBoxPDFont implements PDCIDFont { public static final String CID_FONT_TYPE = "PDCIDFont"; - public static final String CID_SET = "CIDSet"; - public static final String IDENTITY = "Identity"; public static final String CUSTOM = "Custom"; @@ -121,24 +119,6 @@ public Boolean getcidSetListsAllGlyphs() { return Boolean.TRUE; } - @Override - public List getLinkedObjects(String link) { - if (CID_SET.equals(link)) { - return this.getCIDSet(); - } - return super.getLinkedObjects(link); - } - - private List getCIDSet() { - PDStream cidSet = getCIDSetStream(); - if (cidSet != null) { - List res = new ArrayList<>(MAX_NUMBER_OF_ELEMENTS); - res.add(new PBCosStream(cidSet.getStream(), this.pdDocument, this.flavour)); - return Collections.unmodifiableList(res); - } - return Collections.emptyList(); - } - private PDStream getCIDSetStream() { PDFontDescriptor fontDescriptor = this.pdFontLike.getFontDescriptor(); PDStream cidSet; diff --git a/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/pboxse/PBoxSEFENote.java b/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/pboxse/PBoxSEFENote.java index 10c8fe88..14614a63 100644 --- a/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/pboxse/PBoxSEFENote.java +++ b/pdfbox-validation-model/src/main/java/org/verapdf/model/impl/pb/pd/pboxse/PBoxSEFENote.java @@ -37,4 +37,9 @@ public PBoxSEFENote(COSDictionary structElemDictionary, TaggedPDFRoleMapHelper r public String getNoteType() { return null; } + + @Override + public String getorphanRefs() { + return null; + } } diff --git a/pdfbox-validation-model/src/test/java/org/verapdf/model/impl/pb/pd/PBoxPDAnnotTest.java b/pdfbox-validation-model/src/test/java/org/verapdf/model/impl/pb/pd/PBoxPDAnnotTest.java index a226a6fd..81245c7f 100644 --- a/pdfbox-validation-model/src/test/java/org/verapdf/model/impl/pb/pd/PBoxPDAnnotTest.java +++ b/pdfbox-validation-model/src/test/java/org/verapdf/model/impl/pb/pd/PBoxPDAnnotTest.java @@ -107,24 +107,6 @@ public void testActionLink() { } } - @Test - public void testICLink() { - List action = actual.getLinkedObjects(PBoxPDAnnot.IC); - Assert.assertEquals(0, action.size()); - for (Object object : action) { - Assert.assertEquals(PBCosReal.COS_REAL_TYPE, object.getObjectType()); - } - } - - @Test - public void testCLink() { - List action = actual.getLinkedObjects(PBoxPDAnnot.C); - Assert.assertEquals(0, action.size()); - for (Object object : action) { - Assert.assertEquals(PBCosReal.COS_REAL_TYPE, object.getObjectType()); - } - } - @Test public void testAppearanceLink() { List action = actual.getLinkedObjects(PBoxPDAnnot.APPEARANCE);