/** Sets the field value as a string. * @param field the fully qualified field name * @param value the value * @return <CODE>true</CODE> if the value was inserted, * <CODE>false</CODE> if the name is incompatible with * an existing field */ public boolean setFieldAsString(String field, String value) { return setField(field, new PdfString(value, PdfObject.TEXT_UNICODE)); }
/** * The "user name" is the text shown as a tool. * @param s user name. */ public void setUserName(String s) { put(PdfName.TU, new PdfString(s, PdfObject.TEXT_UNICODE)); }
/** * If this dictionary refers to a child that is a file attachment added to a page, * you need to specify the name of the page (or use setFileAttachmentPage to specify the page number). * Once you have specified the page, you still need to specify the attachment using another method. * @param name the named destination referring to the page with the file attachment. */ public void setFileAttachmentPagename(String name) { put(PdfName.P, new PdfString(name, null)); }
/** * A Hide action hides or shows an annotation. * @param name * @param hide * @return A Hide Action */ public static PdfAction createHide(String name, boolean hide) { return createHide(new PdfString(name), hide); }
/** * Adds the subject to the document. * * @param subject the subject of the document */ void addSubject(final String subject) { put(PdfName.SUBJECT, new PdfString(subject, PdfObject.TEXT_UNICODE)); }
/** * The mapping name is the name this field uses when submitting form data. * @param s */ public void setMappingName(String s) { put(PdfName.TM, new PdfString(s, PdfObject.TEXT_UNICODE)); }
/** * Sets the alternative information for the image. * * @param alt * the alternative information */ public void setAlt(final String alt) { this.alt = alt; setAccessibleAttribute(PdfName.ALT, new PdfString(alt)); }
/** * Sets the name of this layer. * @param name the name of this layer */ public void setName(String name) { put(PdfName.NAME, new PdfString(name, PdfObject.TEXT_UNICODE)); }
/** * Sets the name of the annotation. * With this name the annotation can be identified among * all the annotations on a page (it has to be unique). */ public void setName(String name) { put(PdfName.NM, new PdfString(name)); }
/** * Adds the title of the document. * * @param title the title of the document */ void addTitle(final String title) { put(PdfName.TITLE, new PdfString(title, PdfObject.TEXT_UNICODE)); }
/** * Adds some keywords to the document. * * @param keywords the keywords of the document */ void addKeywords(final String keywords) { put(PdfName.KEYWORDS, new PdfString(keywords, PdfObject.TEXT_UNICODE)); }
/** * Sets the alternative information for the image. * * @param alt * the alternative information */ public void setAlt(final String alt) { this.alt = alt; setAccessibleAttribute(PdfName.ALT, new PdfString(alt)); }
/** * Sets the textual expansion of the abbreviation or acronym. * It is highly recommend to set textuual expansion when generating PDF/UA documents. * @param value */ public void setTextExpansion(String value) { setAccessibleAttribute(PdfName.E, new PdfString(value)); }
protected static PdfArray processOptions(String options[][]) { PdfArray array = new PdfArray(); for (int k = 0; k < options.length; ++k) { String subOption[] = options[k]; PdfArray ar2 = new PdfArray(new PdfString(subOption[0], PdfObject.TEXT_UNICODE)); ar2.add(new PdfString(subOption[1], PdfObject.TEXT_UNICODE)); array.add(ar2); } return array; }
/** * Constructs a new <CODE>PdfAction</CODE> of Subtype GoToR. * @param filename the file name to go to * @param name the named destination to go to */ public PdfAction(String filename, String name) { put(PdfName.S, PdfName.GOTOR); put(PdfName.F, new PdfString(filename)); put(PdfName.D, new PdfString(name)); }
/** * Sets the file name (the key /F) string as an hex representation * to support multi byte file names. The name must have the slash and * backslash escaped according to the file specification rules * @param fileName the file name as a byte array */ public void setMultiByteFileName(byte fileName[]) { put(PdfName.F, new PdfString(fileName).setHexWriting(true)); }
public void setDefaultAppearanceString(PdfContentByte cb) { byte b[] = cb.getInternalBuffer().toByteArray(); int len = b.length; for (int k = 0; k < len; ++k) { if (b[k] == '\n') b[k] = 32; } put(PdfName.DA, new PdfString(b)); }
public void setDefaultAppearanceString(PdfContentByte cb) { byte b[] = cb.getInternalBuffer().toByteArray(); int len = b.length; for (int k = 0; k < len; ++k) { if (b[k] == '\n') b[k] = 32; } put(PdfName.DA, new PdfString(b)); }
/** * Constructs a new <CODE>PdfAction</CODE> of Subtype GoToR. * @param filename the file name to go to * @param page the page destination to go to */ public PdfAction(String filename, int page) { put(PdfName.S, PdfName.GOTOR); put(PdfName.F, new PdfString(filename)); put(PdfName.D, new PdfLiteral("[" + (page - 1) + " /FitH 10000]")); }
PdfRendition(String file, PdfFileSpecification fs, String mimeType) throws IOException{ put(PdfName.S, new PdfName("MR")); put(PdfName.N, new PdfString("Rendition for "+file)); put(PdfName.C, new PdfMediaClipData(file, fs, mimeType)); }