/** * @return true if the page contains presentation steps * (/PresSteps in the page dictionary). */ @Override public Boolean getcontainsPresSteps() { return Boolean.valueOf(((org.verapdf.pd.PDPage) simplePDObject).getCOSPresSteps() != null); }
public double[] getBleedBox() { COSArray array = getCOSBBox(ASAtom.BLEED_BOX); if (array != null) { return clipToMediaBox(getDoubleArrayForBox(array)); } else { return getCropBox(); } }
private List<PDGroup> getGroup() { org.verapdf.pd.PDPage page = (org.verapdf.pd.PDPage) this.simplePDObject; org.verapdf.pd.PDGroup group = page.getGroup(); if (group != null) { List<PDGroup> res = new ArrayList<>(MAX_NUMBER_OF_ELEMENTS); PDResourcesHandler resourcesHandler = PDResourcesHandler.getInstance(page.getResources(), page.isInheritedResources().booleanValue()); res.add(new GFPDGroup(group, resourcesHandler.getPageResources())); return Collections.unmodifiableList(res); } return Collections.emptyList(); }
@Override public double[] getCropBox() { if (page != null && !page.empty()) { return page.getCropBox(); } return null; }
public double[] getCropBox() { COSArray array = getInheritedCOSBBox(ASAtom.CROP_BOX); if (array != null) { return clipToMediaBox(getDoubleArrayForBox(array)); } else { return getMediaBox(); } }
@Override public double[] getMediaBox() { if (page != null && !page.empty()) { return page.getMediaBox(); } return null; }
private static void processPage(PDPage page) { if (page != null) { registerDictionaryAFKeys(page.getObject()); for (PDAnnotation annotation : page.getAnnotations()) { if (annotation != null) { registerDictionaryAFKeys(annotation.getObject()); for (PDAppearanceStream stream : getAllAppearances(annotation)) { processXObject(stream); } } } parseResources(page.getResources()); } }
private List<PDAnnot> parseAnnotataions() { StaticContainers.getTransparencyVisitedContentStreams().clear(); List<PDAnnotation> annots = ((org.verapdf.pd.PDPage) simplePDObject).getAnnotations(); if (annots.size() > 0) { List<PDAnnot> res = new ArrayList<>(annots.size()); for (PDAnnotation annot : annots) { org.verapdf.pd.PDPage page = (org.verapdf.pd.PDPage) this.simplePDObject; PDResourcesHandler resourcesHandler = PDResourcesHandler.getInstance(page.getResources(), page.isInheritedResources().booleanValue()); GFPDAnnot annotation = new GFPDAnnot(annot, resourcesHandler); this.containsTransparency |= annotation.isContainsTransparency(); res.add(annotation); } return Collections.unmodifiableList(res); } return Collections.emptyList(); }
PDResources resources = page.getResources(); COSObject thumb = page.getKey(ASAtom.getASAtom("Thumb")); if (thumb != null) { thumbID = getId(thumb, FeatureObjectType.IMAGE_XOBJECT); ? parsePropertiesFromResources(resources) : null; int pageNumber = page.getPageNumber(); String label = pageLabels == null ? null : pageLabels.getLabel(pageNumber); reporter.report(GFFeaturesObjectCreator.createPageFeaturesObject(page, label, thumbID, annotsId, extGStateChild,
public Boolean isInheritedResources() { return !getObject().knownKey(ASAtom.RESOURCES); }
private List<PDContentStream> parseContentStream() { StaticContainers.getTransparencyVisitedContentStreams().clear(); List<PDContentStream> pdContentStreams = new ArrayList<>(MAX_NUMBER_OF_ELEMENTS); org.verapdf.pd.PDPage page = (org.verapdf.pd.PDPage) this.simplePDObject; if (page.getContent() != null) { PDResourcesHandler resourcesHandler = PDResourcesHandler.getInstance(page.getResources(), page.isInheritedResources().booleanValue()); GFPDContentStream pdContentStream = new GFPDContentStream(page.getContent(), resourcesHandler, null, new StructureElementAccessObject(this.simpleCOSObject)); this.containsTransparency |= pdContentStream.isContainsTransparency(); pdContentStreams.add(pdContentStream); } return pdContentStreams; }
private COSArray getCOSBBox(ASAtom type) { COSObject object = getKey(type); if (object != null && object.getType() == COSObjType.COS_ARRAY) { return (COSArray) object.getDirectBase(); } return null; }
private void reportPageActions(PDPage page) { if (config.isFeatureEnabled(FeatureObjectType.ACTION)) { PDPageAdditionalActions additionalActions = page.getAdditionalActions(); if (additionalActions != null) { reportAction(additionalActions.getC(), ActionFeaturesObjectAdapter.Location.PAGE); reportAction(additionalActions.getO(), ActionFeaturesObjectAdapter.Location.PAGE); } Set<COSKey> visitedKeys = new HashSet<>(); processNavigationNodeActions(page.getPresSteps(), visitedKeys); } }
public List<PDAnnotation> getAnnotations() { COSObject annots = getKey(ASAtom.ANNOTS); if (!annots.empty() && annots.getType() == COSObjType.COS_ARRAY) { List<PDAnnotation> res = new ArrayList<>(); if (annots.isIndirect()) { annots = annots.getDirect(); } for (COSObject annot : (COSArray) annots.getDirectBase()) { if (annot != null && annot.getType() == COSObjType.COS_DICT) { res.add(new PDAnnotation(annot)); } } return Collections.unmodifiableList(res); } else if (annots.empty()) { annots = COSArray.construct(); this.setKey(ASAtom.ANNOTS, annots); } return Collections.emptyList(); }
public PDColorSpace getGroupCS() { PDGroup group = getGroup(); if (group != null) { return group.getColorSpace(); } return null; }
private double[] clipToMediaBox(double[] box) { double[] res = new double[4]; double[] mediaBox = getMediaBox(); res[0] = Math.max(box[0], mediaBox[0]); res[1] = Math.max(box[1], mediaBox[1]); res[2] = Math.min(box[2], mediaBox[2]); res[3] = Math.min(box[3], mediaBox[3]); return res; }
private List<PDAction> getActions() { PDPageAdditionalActions additionalActions = ((org.verapdf.pd.PDPage) this.simplePDObject).getAdditionalActions(); if (additionalActions != null) { List<PDAction> actions = new ArrayList<>(MAX_NUMBER_OF_ACTIONS); org.verapdf.pd.actions.PDAction raw; raw = additionalActions.getC(); this.addAction(actions, raw); raw = additionalActions.getO(); this.addAction(actions, raw); return Collections.unmodifiableList(actions); } return Collections.emptyList(); }
private Set<String> addAnnotsDependencies(PDPage page) { Set<String> annotsId = new HashSet<>(); for (PDAnnotation annot : page.getAnnotations()) { reportAnnotationActions(annot); String id = getId(annot.getObject(), FeatureObjectType.ANNOTATION); annotsId.add(id); if (checkIDBeforeProcess(id)) { PDAnnotation popup = annot.getPopup(); String popupID = null; if (popup != null) { popupID = addPopup(popup); } Set<String> formsIDs = getAnnotationResourcesDependencies(annot); popupID = config.isFeatureEnabled(FeatureObjectType.ANNOTATION) ? popupID : null; formsIDs = config.isAnyFeatureEnabled(XOBJECTS) ? formsIDs : null; reporter.report( GFFeaturesObjectCreator.createAnnotFeaturesObject(annot, id, popupID, formsIDs)); } } return annotsId; }
public PDPage newPage(final double[] bbox, final int insertAt) { final PDPage page = new PDPage(bbox, document); this.addPage(page, insertAt); return page; }