private List<CosLang> getLang() { if (this.catalog != null) { COSObject baseLang = catalog.getKey(ASAtom.LANG); if (baseLang != null && baseLang.getType() == COSObjType.COS_STRING) { List<CosLang> list = new ArrayList<>(MAX_NUMBER_OF_ELEMENTS); list.add(new GFCosLang((COSString) baseLang.getDirectBase())); return Collections.unmodifiableList(list); } } return Collections.emptyList(); }
private List<PDPerms> getPerms() { if(this.catalog != null) { COSObject perms = this.catalog.getKey(ASAtom.PERMS); if (perms != null && perms.getType().isDictionaryBased()) { List<PDPerms> list = new ArrayList<>(MAX_NUMBER_OF_ELEMENTS); list.add(new GFPDPerms(perms)); return Collections.unmodifiableList(list); } } return Collections.emptyList(); }
public PDStructTreeRoot getStructTreeRoot() { COSObject base = getKey(ASAtom.STRUCT_TREE_ROOT); if (base != null && base.getType() == COSObjType.COS_DICT) { return new PDStructTreeRoot(base); } return null; }
public PDAction getOpenAction() { COSObject openAction = getKey(ASAtom.OPEN_ACTION); if (openAction != null && openAction.getType() == COSObjType.COS_DICT) { return new PDAction(openAction); } return null; }
public PDCatalogAdditionalActions getAdditionalActions() { COSObject aaDict = getKey(ASAtom.AA); if (aaDict != null && aaDict.getType() == COSObjType.COS_DICT) { return new PDCatalogAdditionalActions(aaDict); } return null; }
public PDMetadata getMetadata() { COSObject metadata = getKey(ASAtom.METADATA); if (metadata != null && metadata.getType() == COSObjType.COS_STREAM) { return new PDMetadata(metadata); } return null; }
public PDNamesDictionary getNamesDictionary() { COSObject buffer = getKey(ASAtom.NAMES); if (buffer != null && buffer.getType() == COSObjType.COS_DICT) { return new PDNamesDictionary(buffer); } return null; }
public PDOutlineDictionary getOutlines() { COSObject outlines = getKey(ASAtom.OUTLINES); if (outlines != null && outlines.getType().isDictionaryBased()) { return new PDOutlineDictionary(outlines); } return null; }
public PDOptionalContentProperties getOCProperties() { COSObject object = getKey(ASAtom.OCPROPERTIES); if (object != null && !object.empty() && object.getType() == COSObjType.COS_DICT) { return new PDOptionalContentProperties(object); } return null; }
public PDAcroForm getAcroForm() { COSObject acroForm = getKey(ASAtom.ACRO_FORM); if (acroForm != null && acroForm.getType().isDictionaryBased()) { return new PDAcroForm(acroForm); } return null; }
/** * @return true if the document permissions dictionary contains DocMDP * entry. */ @Override public Boolean getpermsContainDocMDP() { PDCatalog catalog = StaticContainers.getDocument().getCatalog(); COSDictionary perms = (COSDictionary) catalog.getKey(ASAtom.PERMS).getDirectBase(); if (perms != null) { return perms.knownKey(GFPDPerms.DOC_MDP); } return Boolean.valueOf(false); } }
public List<PDOutputIntent> getOutputIntents() { COSObject base = getKey(ASAtom.OUTPUT_INTENTS); if (base != null && base.getType() == COSObjType.COS_ARRAY) { if (base.isIndirect()) { base = base.getDirect(); } List<PDOutputIntent> result = new ArrayList<>(base.size()); for (COSObject obj : (COSArray) base.getDirectBase()) { if (obj != null && obj.getType().isDictionaryBased()) { result.add(new PDOutputIntent(obj)); } } return Collections.unmodifiableList(result); } return Collections.emptyList(); }
public PageLabels getPageLabels() { COSObject labelsTree = getKey(ASAtom.PAGE_LABELS); if (labelsTree != null && !labelsTree.empty() && labelsTree.getType() == COSObjType.COS_DICT) { return new PageLabels((COSDictionary) labelsTree.getDirectBase()); } return null; }