/** * Constructs a namespace defined by the given namespace name. * @param namespaceName a {@link String} defining the namespace name (conventionally a uniform * resource identifier, or URI). */ public PdfNamespace(String namespaceName) { this(new PdfString(namespaceName)); }
/** * Sets the string defining the namespace name. * @param namespaceName a {@link String} defining the namespace name (conventionally a uniform * resource identifier, or URI). * @return this {@link PdfNamespace} instance. */ public PdfNamespace setNamespaceName(String namespaceName) { return setNamespaceName(new PdfString(namespaceName)); }
/** * Sets the /Cert value of this signature. * * @param cert the byte[] representing the certificate chain */ public void setCert(byte[] cert) { put(PdfName.Cert, new PdfString(cert)); }
/** * Sets the /Location value. * * @param location physical location of signing */ public void setLocation(String location) { put(PdfName.Location, new PdfString(location, PdfEncodings.UNICODE_BIG)); }
/** * Sets the /Reason value. * * @param reason reason for signing */ public void setReason(String reason) { put(PdfName.Reason, new PdfString(reason, PdfEncodings.UNICODE_BIG)); }
/** * Sets the name of the file in the EmbeddedFiles name tree for the child target located * in the EmbeddedFiles. * * @param name the name of the file * @return this object wrapper */ public PdfTarget setName(String name) { return put(PdfName.N, new PdfString(name)); }
/** * Changes the alternate name of the field to the specified value. The * alternate is a descriptive name to be used by status messages etc. * * @param name the new alternate name, as a String * @return the edited field */ public PdfFormField setAlternativeName(String name) { return put(PdfName.TU, new PdfString(name)); }
/** * Sets the /Location value. * * @param location physical location of signing */ public void setLocation(String location) { put(PdfName.Location, new PdfString(location, PdfEncodings.UNICODE_BIG)); }
@Override public AccessibilityProperties setLanguage(String language) { getBackingElem().setLang(new PdfString(language, PdfEncodings.UNICODE_BIG)); return this; }
@Override public AccessibilityProperties setExpansion(String expansion) { getBackingElem().setE(new PdfString(expansion, PdfEncodings.UNICODE_BIG)); return this; }
@Override public AccessibilityProperties setAlternateDescription(String alternateDescription) { getBackingElem().setAlt(new PdfString(alternateDescription, PdfEncodings.UNICODE_BIG)); return this; }
/** * Identifies the document that will be initially presented * in the user interface. * @param documentName a string that identifies an entry in the EmbeddedFiles name tree */ public PdfCollection setInitialDocument(String documentName) { getPdfObject().put(PdfName.D, new PdfString(documentName)); return this; }
public PdfUserProperty setValueFormattedRepresentation(String formattedRepresentation) { getPdfObject().put(PdfName.F, new PdfString(formattedRepresentation, PdfEncodings.UNICODE_BIG)); return this; }
private static PdfArray getArrayFromStringList(String[] strings) { PdfArray arr = new PdfArray(); for (String string : strings) { arr.add(new PdfString(string)); } return arr; }
/** * Creates a JavaScript action (section 12.6.4.16 of ISO 32000-1). * * @param javaScript a text string containing the JavaScript script to be executed. * @return created action */ public static PdfAction createJavaScript(String javaScript) { return new PdfAction().put(PdfName.S, PdfName.JavaScript).put(PdfName.JS, new PdfString(javaScript)); }
public PdfStructureAttributes addTextAttribute(String attributeName, String attributeValue) { PdfName name = PdfStructTreeRoot.convertRoleToPdfName(attributeName); getPdfObject().put(name, new PdfString(attributeValue, PdfEncodings.UNICODE_BIG)); setModified(); return this; }
public static PdfFileSpec createExternalFileSpec(PdfDocument doc, String filePath, PdfName afRelationshipValue) { PdfDictionary dict = new PdfDictionary(); dict.put(PdfName.Type, PdfName.Filespec); dict.put(PdfName.F, new PdfString(filePath)); dict.put(PdfName.UF, new PdfString(filePath, PdfEncodings.UNICODE_BIG)); if (afRelationshipValue != null) { dict.put(PdfName.AFRelationship, afRelationshipValue); } else { dict.put(PdfName.AFRelationship, PdfName.Unspecified); } return (PdfFileSpec) new PdfFileSpec(dict).makeIndirect(doc); }
/** * Creates a Hide action (section 12.6.4.10 of ISO 32000-1). * * @param text a text string giving the fully qualified field name of an interactive form field whose * associated widget annotation or annotations are to be affected * @param hidden a flag indicating whether to hide the annotation (<code>true</code>) or show it (<code>false</code>) * @return created action */ public static PdfAction createHide(String text, boolean hidden) { return new PdfAction().put(PdfName.S, PdfName.Hide).put(PdfName.T, new PdfString(text)). put(PdfName.H, PdfBoolean.valueOf(hidden)); }
private static PdfArray buildArray(Object[] names) { PdfArray array = new PdfArray(); for (Object obj : names) { if (obj instanceof String) { array.add(new PdfString((String) obj)); } else if (obj instanceof PdfAnnotation) { array.add(((PdfAnnotation) obj).getPdfObject()); } else { throw new PdfException("The array must contain string or PDFAnnotation"); } } return array; }
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)); }