/** * Creates an instance of {@link PdfSigFieldLock}. * @param dict The dictionary whose entries should be added to * the signature field lock dictionary. */ public PdfSigFieldLock(PdfDictionary dict) { super(dict); getPdfObject().put(PdfName.Type, PdfName.SigFieldLock); }
protected PdfShading(PdfDictionary pdfObject, int type, PdfColorSpace colorSpace) { super(pdfObject); getPdfObject().put(PdfName.ShadingType, new PdfNumber(type)); if (colorSpace instanceof PdfSpecialCs.Pattern) { throw new IllegalArgumentException("colorSpace"); } getPdfObject().put(PdfName.ColorSpace, colorSpace.getPdfObject()); }
/** * Indication if the field value should be editable in the viewer. * * @param editable */ public PdfCollectionField setEditable(boolean editable) { getPdfObject().put(PdfName.E, PdfBoolean.valueOf(editable)); return this; }
private PdfNamespace put(PdfName key, PdfObject value) { getPdfObject().put(key, value); setModified(); return this; }
/** * Sets the Collection schema dictionary. * @param schema an overview of the collection fields */ public PdfCollection setSchema(PdfCollectionSchema schema) { getPdfObject().put(PdfName.Schema, schema.getPdfObject()); return this; }
/** * Sets the permissions granted for the document when the corresponding signature * field is signed. See {@link PdfSigFieldLock.LockPermissions} * for getting more info. * @param permissions The permissions granted for the document. * @return This {@link PdfSigFieldLock} object. */ public PdfSigFieldLock setDocumentPermissions(LockPermissions permissions) { getPdfObject().put(PdfName.P, getLockPermission(permissions)); return this; }
public PdfObjRef(PdfAnnotation annot, PdfStructElem parent, int nextStructParentIndex) { super(new PdfDictionary(), parent); annot.getPdfObject().put(PdfName.StructParent, new PdfNumber(nextStructParentIndex)); annot.setModified(); PdfDictionary dict = (PdfDictionary) getPdfObject(); dict.put(PdfName.Type, PdfName.OBJR); dict.put(PdfName.Obj, annot.getPdfObject()); }
/** * Indicates that the group contains a pagination artifact. * @param pe one of the following names: "HF" (Header Footer), * "FG" (Foreground), "BG" (Background), or "L" (Logo). */ public void setPageElement(String pe) { PdfDictionary usage = getUsage(); PdfDictionary dic = new PdfDictionary(); dic.put(PdfName.Subtype, new PdfName(pe)); usage.put(PdfName.PageElement, dic); usage.setModified(); }
/** * Sets the number of bits used to represent each colour component. * * @param bitsPerComponent the number of bits to be set. Shall be 1, 2, 4, 8, 12, or 16. */ public void setBitsPerComponent(int bitsPerComponent) { getPdfObject().put(PdfName.BitsPerComponent, new PdfNumber(bitsPerComponent)); setModified(); }
/** * Sets the number of bits used to represent each colour component. * * @param bitsPerComponent the number of bits to be set. Shall be 1, 2, 4, 8, 12, or 16. */ public void setBitsPerComponent(int bitsPerComponent) { getPdfObject().put(PdfName.BitsPerComponent, new PdfNumber(bitsPerComponent)); setModified(); }
/** * Constructs a PDF Collection Sort Dictionary. * * @param key the key of the field that will be used to sort entries */ public PdfCollectionSort(String key) { this(new PdfDictionary()); getPdfObject().put(PdfName.S, new PdfName(key)); }
/** * Sets the value of the collection item. * @param n */ public void addItem(String key, PdfNumber n) { PdfCollectionField field = schema.getField(key); if (field.subType == PdfCollectionField.NUMBER) { getPdfObject().put(new PdfName(key), n); } }
/** * Sets the paint type. * * @param colored if {@code true} then the paint type will be set as {@link PaintType#COLORED}, * and {@link PaintType#UNCOLORED} otherwise. */ public void setColored(boolean colored) { getPdfObject().put(PdfName.PaintType, new PdfNumber(colored ? PaintType.COLORED : PaintType.UNCOLORED)); setModified(); }
/** * 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(); }
public PdfStructElem(PdfDocument document, PdfName role, PdfAnnotation annot) { this(document, role); if (annot.getPage() == null) throw new PdfException(PdfException.AnnotationShallHaveReferenceToPage); getPdfObject().put(PdfName.Pg, annot.getPage().getPdfObject()); }
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)); }
private void updateProducerInInfoDictionary() { String producer = null; if (reader == null) { producer = versionInfo.getVersion(); } else { if (info.getPdfObject().containsKey(PdfName.Producer)) { producer = info.getPdfObject().getAsString(PdfName.Producer).toUnicodeString(); } producer = addModifiedPostfix(producer); } info.getPdfObject().put(PdfName.Producer, new PdfString(producer)); }
private void copyExistingField(PdfPage toPage, PdfAnnotation currentAnnot) { PdfFormField field = mergeFieldsWithTheSameName(PdfFormField.makeFormField(currentAnnot.getPdfObject(), toPage.getDocument())); PdfArray kids = field.getKids(); if (kids != null) { field.getPdfObject().remove(PdfName.Kids); formTo.addField(field, toPage); field.getPdfObject().put(PdfName.Kids, kids); } else { formTo.addField(field, toPage); } }