/** * Adds the title of the document. * * @param title the title of the document */ void addTitle(String title) { put(PdfName.TITLE, new PdfString(title, PdfObject.TEXT_UNICODE)); }
/** * 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)); }
/** * Adds the subject to the document. * * @param subject the subject of the document */ void addSubject(String subject) { put(PdfName.SUBJECT, new PdfString(subject, PdfObject.TEXT_UNICODE)); }
/** * Adds some keywords to the document. * * @param keywords the keywords of the document */ void addKeywords(String keywords) { put(PdfName.KEYWORDS, new PdfString(keywords, PdfObject.TEXT_UNICODE)); }
/** * Identifies the document that will be initially presented * in the user interface. * @param description the description that was used when attaching the file to the document */ public void setInitialDocument(String description) { put(PdfName.D, new PdfString(description, null)); }
/** * Adds the title of the document. * * @param title the title of the document */ void addTitle(String title) { put(PdfName.TITLE, new PdfString(title, PdfObject.TEXT_UNICODE)); }
/** * Identifies the document that will be initially presented * in the user interface. * @param description the description that was used when attaching the file to the document */ public void setInitialDocument(String description) { put(PdfName.D, new PdfString(description, null)); }
/** * If this dictionary refers to a child that is a file attachment added to a page, * you need to specify the page with setFileAttachmentPage or setFileAttachmentPageName, * and then specify the name of the attachment added to this page (or use setFileAttachmentIndex). * @param name the name of the attachment */ public void setFileAttachmentName(String name) { put(PdfName.A, new PdfString(name, PdfObject.TEXT_UNICODE)); }
/** * Adds the name of the author to the document. * * @param author the name of the author */ void addAuthor(String author) { put(PdfName.AUTHOR, new PdfString(author, PdfObject.TEXT_UNICODE)); }
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; }
protected static PdfArray processOptions(String[] options) { PdfArray array = new PdfArray(); for (int k = 0; k < options.length; ++k) { array.add(new PdfString(options[k], PdfObject.TEXT_UNICODE)); } return array; }
public void setTitle(String title) { if (title == null) { remove(PdfName.T); return; } put(PdfName.T, new PdfString(title, PdfObject.TEXT_UNICODE)); }
/** * Construct a new <CODE>PdfAction</CODE> of Subtype URI that accepts the x and y coordinate of the position that was clicked. * @param url * @param isMap */ public PdfAction(String url, boolean isMap) { put(PdfName.S, PdfName.URI); put(PdfName.URI, new PdfString(url)); if (isMap) put(PdfName.ISMAP, PdfBoolean.PDFTRUE); }
/** * Creates an Import field. * @param file * @return A PdfAction */ public static PdfAction createImportData(String file) { PdfAction action = new PdfAction(); action.put(PdfName.S, PdfName.IMPORTDATA); action.put(PdfName.F, new PdfString(file)); return action; }
/** * Creates an Import field. * @param file * @return A PdfAction */ public static PdfAction createImportData(String file) { PdfAction action = new PdfAction(); action.put(PdfName.S, PdfName.IMPORTDATA); action.put(PdfName.F, new PdfString(file)); return action; }
/** * Add some free text to the document. * * @return A PdfAnnotation */ public static PdfAnnotation createFreeText(PdfWriter writer, Rectangle rect, String contents, PdfContentByte defaultAppearance) { PdfAnnotation annot = new PdfAnnotation(writer, rect); annot.put(PdfName.SUBTYPE, PdfName.FREETEXT); annot.put(PdfName.CONTENTS, new PdfString(contents, PdfObject.TEXT_UNICODE)); annot.setDefaultAppearanceString(defaultAppearance); return annot; }
/** * 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]")); }
PdfMediaClipData(String file, PdfFileSpecification fs, String mimeType) throws IOException { put(PdfName.TYPE,new PdfName("MediaClip")); put(PdfName.S, new PdfName("MCD")); put(PdfName.N, new PdfString("Media clip for "+file)); put(new PdfName("CT"), new PdfString(mimeType)); PdfDictionary dic = new PdfDictionary(); dic.put(new PdfName("TF"), new PdfString("TEMPACCESS")); put(new PdfName("P"), dic); put(PdfName.D, fs.getReference()); } }
/** * Adds a Stamp to your document. Move over the stamp and a tooltip is shown * * @return A PdfAnnotation */ public static PdfAnnotation createStamp(PdfWriter writer, Rectangle rect, String contents, String name) { PdfAnnotation annot = new PdfAnnotation(writer, rect); annot.put(PdfName.SUBTYPE, PdfName.STAMP); annot.put(PdfName.CONTENTS, new PdfString(contents, PdfObject.TEXT_UNICODE)); annot.put(PdfName.NAME, new PdfName(name)); return annot; }
protected void startImage(JRPrintImage printImage) { if (isTagged) { PdfStructureElement imageTag = new PdfStructureElement(allTag, PdfName.IMAGE); pdfContentByte.beginMarkedContentSequence(imageTag); if (printImage.getHyperlinkTooltip() != null) imageTag.put(PdfName.ALT, new PdfString(printImage.getHyperlinkTooltip())); } }