/** * Sets the array of floats that represents the transformation matrix that maps the domain rectangle * into a corresponding figure in the target coordinate space. * * @param matrix the {@code float[]} of transformation matrix to be set. */ public void setMatrix(float[] matrix) { setMatrix(new PdfArray(matrix)); }
/** * Sets the Extend object with the two {@code boolean} value. * * @param extendStart if true will extend shading beyond the starting point of Coords * @param extendEnd if true will extend shading beyond the ending point of Coords */ public void setExtend(boolean extendStart, boolean extendEnd) { setExtend(new PdfArray(new boolean[] {extendStart, extendEnd})); }
/** * Sets the Domain with the array of two {@code float} [t0, t1] that represent the limiting values * of a parametric variable t, that becomes an input of color function(s). * * @param t0 first limit of variable t * @param t1 second limit of variable t */ public void setDomain(float t0, float t1) { setDomain(new PdfArray(new float[] {t0, t1})); }
/** * Sets the Extend object with the two {@code boolean} value. * * @param extendStart if true will extend shading beyond the starting circle of Coords. * @param extendEnd if true will extend shading beyond the ending circle of Coords. */ public void setExtend(boolean extendStart, boolean extendEnd) { setExtend(new PdfArray(new boolean[] {extendStart, extendEnd})); }
/** * Sets the {@code float[]} 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. * * @param decode the {@code float[]} of Decode object to set. */ public void setDecode(float[] decode) { setDecode(new PdfArray(decode)); }
/** * Sets the {@code float[]} 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. * * @param decode the {@code float[]} of Decode object to set. */ public void setDecode(float[] decode) { setDecode(new PdfArray(decode)); }
/** * Sets the Media Box object, that defines the boundaries of the physical medium * on which the page shall be displayed or printed. * * @param rectangle the {@link Rectangle} object to set, expressed in default user space units. * @return this {@link PdfPage} instance. */ public PdfPage setMediaBox(Rectangle rectangle) { put(PdfName.MediaBox, new PdfArray(rectangle)); return this; }
/** * Sets the CropBox object, that defines the visible region of default user space. * When the page is displayed or printed, its contents shall be clipped (cropped) to this rectangle * and then shall be imposed on the output medium in some implementation-defined manner. * * @param rectangle the {@link Rectangle} object to set, expressed in default user space units. * @return this {@link PdfPage} instance. */ public PdfPage setCropBox(Rectangle rectangle) { put(PdfName.CropBox, new PdfArray(rectangle)); return this; }
/** * Sets an annotation color. For more details on annotation color purposes and the format * of the passing array see {@link PdfAnnotation#getColorObject()}. * * @param color an array of numbers in the range 0.0 to 1.0, specifying color. * @return this {@link PdfAnnotation} instance. */ public PdfAnnotation setColor(float[] color) { return setColor(new PdfArray(color)); }
/** * An array of numbers in the range 0.0 to 1.0 specifying the interior color * which is used to fill the annotation's line endings. * * @param interiorColor an array of floats in the range 0.0 to 1.0. * @return this {@link PdfLineAnnotation} instance. */ public PdfLineAnnotation setInteriorColor(float[] interiorColor) { return setInteriorColor(new PdfArray(interiorColor)); }
private static PdfArray getInitialPdfArray(final InputStream iccStream, final float[] range) { ArrayList<PdfObject> tempArray = new ArrayList<PdfObject>(2); tempArray.add(PdfName.ICCBased); tempArray.add(range == null ? getIccProfileStream(iccStream) : getIccProfileStream(iccStream, range)); return new PdfArray(tempArray); } }
public PdfPolyGeomAnnotation setVertices(float[] vertices) { if (getPdfObject().containsKey(PdfName.Path)) { LoggerFactory.getLogger(getClass()).warn(LogMessageConstant.PATH_KEY_IS_PRESENT_VERTICES_WILL_BE_IGNORED); } return (PdfPolyGeomAnnotation) put(PdfName.Vertices, new PdfArray(vertices)); }
private PdfArray getDashPatternArray(float[] dashArray, float phase) { PdfArray dashPatternArray = new PdfArray(); PdfArray dArray = new PdfArray(); if (dashArray != null) { for (float fl : dashArray) { dArray.add(new PdfNumber(fl)); } } dashPatternArray.add(dArray); dashPatternArray.add(new PdfNumber(phase)); return dashPatternArray; }
/** * Sets the pattern cell's bounding box. These boundaries shall be used to clip the pattern cell. * * @param bbox pattern cell's bounding box to set. */ public void setBBox(Rectangle bbox) { getPdfObject().put(PdfName.BBox, new PdfArray(bbox)); setModified(); }
/** * Sets the /ByteRange. * * @param range 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 void setByteRange(int[] range) { PdfArray array = new PdfArray(); for (int k = 0; k < range.length; ++k) { array.add(new PdfNumber(range[k])); } put(PdfName.ByteRange, array); }
/** * Creates a visibility expression. * @param operator should be either PdfName#And, PdfName#Or, or PdfName#Not */ public PdfVisibilityExpression(PdfName operator) { super(new PdfArray()); if (operator == null || !PdfName.Or.equals(operator) && !PdfName.And.equals(operator) && !PdfName.Not.equals(operator)) throw new IllegalArgumentException("Invalid operator"); getPdfObject().add(operator); }
public CalGray(float[] whitePoint) { this(getInitialPdfArray()); if (whitePoint == null || whitePoint.length != 3) throw new PdfException(PdfException.WhitePointIsIncorrectlySpecified, this); PdfDictionary d = ((PdfArray)getPdfObject()).getAsDictionary(1); d.put(PdfName.WhitePoint, new PdfArray(whitePoint)); }
public Lab(float[] whitePoint) { this(getInitialPdfArray()); if (whitePoint == null || whitePoint.length != 3) throw new PdfException(PdfException.WhitePointIsIncorrectlySpecified, this); PdfDictionary d = ((PdfArray)getPdfObject()).getAsDictionary(1); d.put(PdfName.WhitePoint, new PdfArray(whitePoint)); }
public CalGray(float[] whitePoint, float[] blackPoint, float gamma) { this(whitePoint); PdfDictionary d = ((PdfArray)getPdfObject()).getAsDictionary(1); if (blackPoint != null) d.put(PdfName.BlackPoint, new PdfArray(blackPoint)); if (gamma != Float.NaN) d.put(PdfName.Gamma, new PdfNumber(gamma)); }
public DeviceN(List<String> names, PdfColorSpace alternateSpace, PdfFunction tintTransform) { this(new PdfArray(names, true), alternateSpace.getPdfObject(), tintTransform.getPdfObject()); if (tintTransform.getInputSize() != getNumberOfComponents() || tintTransform.getOutputSize() != alternateSpace.getNumberOfComponents()) { throw new PdfException(PdfException.FunctionIsNotCompatibleWitColorSpace, this); } }