/** * Gets a transformation matrix that maps the pattern’s internal coordinate system * to the default coordinate system of the pattern’s parent content stream. * The concatenation of the pattern matrix with that of the parent content stream * establishes the pattern coordinate space, within which all graphics objects in the pattern shall be interpreted. * * @return pattern matrix */ public PdfArray getMatrix() { return getPdfObject().getAsArray(PdfName.Matrix); }
/** * An array of two names specifying the line ending styles that is used in drawing the line. * The first and second elements of the array shall specify the line ending styles for the endpoints defined, * respectively, by the first and second pairs of coordinates, (x1, y1) and (x2, y2), in the {@link PdfName#L} array * (see {@link #getLine()}. For possible values see {@link #setLineEndingStyles(PdfArray)}. * @return An array of two names specifying the line ending styles that is used in drawing the line; or null if line * endings style is not explicitly defined, default value is [/None /None]. */ public PdfArray getLineEndingStyles() { return getPdfObject().getAsArray(PdfName.LE); }
protected Rectangle getRect(PdfDictionary field) { PdfArray rect = field.getAsArray(PdfName.Rect); if (rect == null) { PdfArray kids = field.getAsArray(PdfName.Kids); if (kids == null) { throw new PdfException(PdfException.WrongFormFieldAddAnnotationToTheField); } rect = ((PdfDictionary) kids.get(0)).getAsArray(PdfName.Rect); } return rect != null ? rect.toRectangle() : null; }
/** * Returns the value associated to this key as a Rectangle. If the value isn't a PdfArray of which the * firt four elements are PdfNumbers, null is returned. * * @param key the key of which the associated value needs to be returned * @return PdfArray associated with this key * @see PdfArray#toRectangle() */ public Rectangle getAsRectangle(PdfName key) { PdfArray a = getAsArray(key); return a == null ? null : a.toRectangle(); }
/** * A set of four numbers describing the numerical differences between two rectangles: * the Rect entry of the annotation and the actual boundaries of the underlying square. * * @return null if not specified, otherwise a {@link PdfArray} with four numbers which correspond to the * differences in default user space between the left, top, right, and bottom coordinates of Rect and those * of the inner rectangle, respectively. */ public PdfArray getRectangleDifferences() { return getPdfObject().getAsArray(PdfName.RD); }
/** * Gets the array of predefined procedure set names (see ISO-320001 Paragraph 14.2). * Deprecated in PDF 2.0. * * @return the array of predefined procedure set names. */ public PdfArray getProcSet() { return getPdfObject().getAsArray(PdfName.ProcSet); }
/** * Gets the {@link PdfArray} of numbers specifying how to map vertex coordinates and colour components * into the appropriate ranges of values. The ranges shall be specified as follows: * [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. * Only one pair of color values shall be specified if a Function entry is present. * * @return the {@link PdfArray} Decode object. */ public PdfArray getDecode() { return getPdfObject().getAsArray(PdfName.Decode); }
/** * An unordered array of all objects present in the page description at the time the trap networks were generated * and that, if changed, could affect the appearance of the page. * * @return an unordered {@link PdfArray} of all objects present in the page description at the time the trap networks * were generated. */ public PdfArray getVersion() { return getPdfObject().getAsArray(PdfName.Version); }
/** * An array of name objects representing the appearance states for annotations associated with the page. * See also {@link #setAnnotStates(PdfArray)}. * * @return a {@link PdfArray} of name objects representing the appearance states for annotations associated with the page, */ public PdfArray getAnnotStates() { return getPdfObject().getAsArray(PdfName.AnnotStates); }
/** * A set of four numbers describing the numerical differences between two rectangles: * the Rect entry of the annotation and the actual boundaries of the underlying caret. * * @return null if not specified, otherwise a {@link PdfArray} with four numbers which correspond to the * differences in default user space between the left, top, right, and bottom coordinates of Rect and those * of the inner rectangle, respectively. */ public PdfArray getRectangleDifferences() { return getPdfObject().getAsArray(PdfName.RD); }
/** * Gets options for the form field. Should only return usable values for * checkboxes and radio buttons. * * @return the options, as an {@link PdfArray} of {@link PdfString} objects */ public PdfArray getOptions() { return getPdfObject().getAsArray(PdfName.Opt); }
/** * Gets the /ByteRange. * @return an array of pairs of integers that specifies the byte range used in the digest calculation. A pair consists of the starting byte offset and the length. */ public PdfArray getByteRange() { return getPdfObject().getAsArray(PdfName.ByteRange); }
/** * A set of four numbers describing the numerical differences between two rectangles: * the Rect entry of the annotation and the inner rectangle where the annotation's text should be displayed * * @return null if not specified, otherwise a {@link PdfArray} with four numbers which correspond to the * differences in default user space between the left, top, right, and bottom coordinates of Rect and those * of the inner rectangle, respectively. */ public PdfArray getRectangleDifferences() { return getPdfObject().getAsArray(PdfName.RD); }
/** * Gets the {@link PdfArray} domain rectangle object that establishes an internal coordinate space * for the shading that is independent of the target coordinate space in which it shall be painted. * * @return {@link PdfArray} domain rectangle. */ public PdfArray getDomain() { return getPdfObject().getAsArray(PdfName.Domain); }
/** * Gets the Coords object - a {@link PdfArray} of four numbers [x0 y0 x1 y1] that specified the starting * and the endings coordinates of thew axis, expressed in the shading's target coordinate space. * * @return the {@link PdfArray} Coords object. */ public PdfArray getCoords() { return getPdfObject().getAsArray(PdfName.Coords); }
/** * An array of four numbers, [x1 y1 x2 y2], specifying the starting and ending coordinates of the line * in default user space. If the {@link PdfName#LL} entry is present, this value represents * the endpoints of the leader lines rather than the endpoints of the line itself. * @return An array of four numbers specifying the starting and ending coordinates of the line in default user space. */ public PdfArray getLine() { return getPdfObject().getAsArray(PdfName.L); }
/** * The interior color which is used to fill the annotation's line endings. * * @return {@link Color} of either {@link DeviceGray}, {@link DeviceRgb} or {@link DeviceCmyk} type which defines * interior color of the annotation, or null if interior color is not specified. */ public Color getInteriorColor() { return InteriorColorUtil.parseInteriorColor(getPdfObject().getAsArray(PdfName.IC)); }
private PdfArray getDestArray(PdfObject obj) { if (obj == null) return null; if (obj.isArray()) return (PdfArray) obj; else if (obj.isDictionary()) { PdfArray arr = ((PdfDictionary) obj).getAsArray(PdfName.D); return arr; } return null; } }
/** * Gets the pattern cell's bounding box. These boundaries shall be used to clip the pattern cell. * * @return pattern cell's bounding box. */ public Rectangle getBBox() { return getPdfObject().getAsArray(PdfName.BBox).toRectangle(); }
public PdfUserPropertiesAttributes addUserProperty(PdfUserProperty userProperty) { getPdfObject().getAsArray(PdfName.P).add(userProperty.getPdfObject()); setModified(); return this; }