/** * An annotation object that this annotation is "in reply to." * Both annotations shall be on the same page of the document. * The relationship between the two annotations shall be specified by the RT entry * (see {@link PdfMarkupAnnotation#getReplyType()}). * @return a {@link PdfDictionary} that represents an annotation that this annotation is "in reply to." */ public PdfDictionary getInReplyToObject() { return getPdfObject().getAsDictionary(PdfName.IRT); }
/** * An appearance characteristics dictionary containing additional information for constructing the * annotation’s appearance stream. See ISO-320001, Table 189. * * @return an appearance characteristics dictionary or null if it isn't specified. */ public PdfDictionary getAppearanceCharacteristics() { return getPdfObject().getAsDictionary(PdfName.MK); }
/** * The dictionaries for some annotation types (such as free text and polygon annotations) can include the BS entry. * That entry specifies a border style dictionary that has more settings than the array specified for the Border * entry (see {@link PdfAnnotation#getBorder()}). If an annotation dictionary includes the BS entry, then the Border * entry is ignored. If annotation includes AP (see {@link PdfAnnotation#getAppearanceDictionary()}) it takes * precedence over the BS entry. For more info on BS entry see ISO-320001, Table 166. * @return {@link PdfDictionary} which is a border style dictionary or null if it is not specified. */ public PdfDictionary getBorderStyle() { return getPdfObject().getAsDictionary(PdfName.BS); }
/** * The dictionaries for some annotation types (such as free text and polygon annotations) can include the BS entry. * That entry specifies a border style dictionary that has more settings than the array specified for the Border * entry (see {@link PdfAnnotation#getBorder()}). If an annotation dictionary includes the BS entry, then the Border * entry is ignored. If annotation includes AP (see {@link PdfAnnotation#getAppearanceDictionary()}) it takes * precedence over the BS entry. For more info on BS entry see ISO-320001, Table 166. * @return {@link PdfDictionary} which is a border style dictionary or null if it is not specified. */ public PdfDictionary getBorderStyle() { return getPdfObject().getAsDictionary(PdfName.BS); }
/** * Gets a border effect dictionary that specifies an effect that shall be applied to the border of the annotations. * @return a {@link PdfDictionary}, which is a border effect dictionary (see ISO-320001, Table 167). */ public PdfDictionary getBorderEffect() { return getPdfObject().getAsDictionary(PdfName.BE); }
/** * An {@link PdfAction} to perform, such as launching an application, playing a sound, * changing an annotation’s appearance state etc, when the annotation is activated. * @return {@link PdfDictionary} which defines the characteristics and behaviour of an action. */ public PdfDictionary getAction() { return getPdfObject().getAsDictionary(PdfName.A); }
@Override public PdfDictionary getPageObject() { PdfDictionary page = ((PdfDictionary)getPdfObject()).getAsDictionary(PdfName.Pg); if (page == null) page = parent.getPdfObject().getAsDictionary(PdfName.Pg); return page; }
/** * The dictionaries for some annotation types (such as free text and polygon annotations) can include the BS entry. * That entry specifies a border style dictionary that has more settings than the array specified for the Border * entry (see {@link PdfAnnotation#getBorder()}). If an annotation dictionary includes the BS entry, then the Border * entry is ignored. If annotation includes AP (see {@link PdfAnnotation#getAppearanceDictionary()}) it takes * precedence over the BS entry. For more info on BS entry see ISO-320001, Table 166. * @return {@link PdfDictionary} which is a border style dictionary or null if it is not specified. */ public PdfDictionary getBorderStyle() { return getPdfObject().getAsDictionary(PdfName.BS); }
/** * A measure dictionary (see ISO-320001, Table 261) that specifies the scale and units that apply to the line annotation. * @return a {@link PdfDictionary} that represents a measure dictionary. */ public PdfDictionary getMeasure() { return getPdfObject().getAsDictionary(PdfName.Measure); }
/** * The dictionaries for some annotation types (such as free text and polygon annotations) can include the BS entry. * That entry specifies a border style dictionary that has more settings than the array specified for the Border * entry (see {@link PdfAnnotation#getBorder()}). If an annotation dictionary includes the BS entry, then the Border * entry is ignored. If annotation includes AP (see {@link PdfAnnotation#getAppearanceDictionary()}) it takes * precedence over the BS entry. For more info on BS entry see ISO-320001, Table 166. * @return {@link PdfDictionary} which is a border style dictionary or null if it is not specified. */ public PdfDictionary getBorderStyle() { return getPdfObject().getAsDictionary(PdfName.BS); }
@Override public PdfDictionary getPageObject() { PdfDictionary page = ((PdfDictionary)getPdfObject()).getAsDictionary(PdfName.Pg); if (page == null) page = parent.getPdfObject().getAsDictionary(PdfName.Pg); return page; } }
public PdfViewerPreferences getViewerPreferences() { PdfDictionary viewerPreferences = getPdfObject().getAsDictionary(PdfName.ViewerPreferences); if (viewerPreferences != null) { return new PdfViewerPreferences(viewerPreferences); } else { return null; } }
protected PdfDocument getDocument() { PdfDictionary structDict = getPdfObject(); PdfIndirectReference indRef = structDict.getIndirectReference(); if (indRef == null && structDict.getAsDictionary(PdfName.P) != null) { // If parent is direct - it's definitely an invalid structure tree. // MustBeIndirect state won't be met during reading, and all newly created struct elements shall have ind ref. indRef = structDict.getAsDictionary(PdfName.P).getIndirectReference(); } return indRef != null ? indRef.getDocument() : null; }
/** * Return the XFA Object, could be an array, could be a Stream. * Returns null if no XFA Object is present. * * @param pdfDocument a PdfDocument instance * @return the XFA object */ private static PdfObject getXfaObject(PdfDocument pdfDocument) { PdfDictionary af = pdfDocument.getCatalog().getPdfObject().getAsDictionary(PdfName.AcroForm); return af == null ? null : af.get(PdfName.XFA); }
/** * Gets the Outline root in {@link PdfOutline#pdfDoc}'s catalog entry * * @return The {@link PdfDictionary} of the document's Outline root, or {@code null} if it can't be found. */ private PdfDictionary getOutlineRoot() { if (!pdfDoc.hasOutlines()) { return null; } return pdfDoc.getCatalog().getPdfObject().getAsDictionary(PdfName.Outlines); }
private PdfName getTypeFromParent(PdfDictionary field) { PdfDictionary parent = field.getAsDictionary(PdfName.Parent); PdfName formType = field.getAsName(PdfName.FT); if (parent != null) { formType = parent.getAsName(PdfName.FT); if (formType == null) { formType = getTypeFromParent(parent); } } return formType; }
static PdfColorSpace determineColorSpace(PdfName colorSpace, PdfCanvasProcessor processor) { PdfColorSpace pdfColorSpace = null; if (PdfColorSpace.directColorSpaces.contains(colorSpace)) { pdfColorSpace = PdfColorSpace.makeColorSpace(colorSpace); } else { PdfResources pdfResources = processor.getResources(); PdfDictionary resourceColorSpace = pdfResources.getPdfObject().getAsDictionary(PdfName.ColorSpace); pdfColorSpace = PdfColorSpace.makeColorSpace(resourceColorSpace.get(colorSpace)); } return pdfColorSpace; } }
/** * Removes the XFA stream from the document. */ public void removeXfaForm() { if (hasXfaForm()) { PdfDictionary root = document.getCatalog().getPdfObject(); PdfDictionary acroform = root.getAsDictionary(PdfName.AcroForm); acroform.remove(PdfName.XFA); xfaForm = null; } }
private void flushWithResources(PdfDictionary objsCollection) { if (objsCollection == null) { return; } for (PdfObject obj : objsCollection.values()) { if (obj.isFlushed()) continue; flushResourcesContentStreams(((PdfDictionary) obj).getAsDictionary(PdfName.Resources)); flushMustBeIndirectObject(obj); } }
private void updateValueInMarkInfoDict(PdfName key, PdfObject value) { PdfDictionary markInfo = catalog.getPdfObject().getAsDictionary(PdfName.MarkInfo); if (markInfo == null) { markInfo = new PdfDictionary(); catalog.getPdfObject().put(PdfName.MarkInfo, markInfo); } markInfo.put(key, value); }