/** * Constructs a new <CODE>PdfAnnotation</CODE> of subtype text. */ public PdfAnnotation(PdfWriter writer, float llx, float lly, float urx, float ury, PdfString title, PdfString content) { this.writer = writer; put(PdfName.SUBTYPE, PdfName.TEXT); put(PdfName.T, title); put(PdfName.RECT, new PdfRectangle(llx, lly, urx, ury)); put(PdfName.CONTENTS, content); }
/** * Constructs a new <CODE>PdfAnnotation</CODE> of subtype link (Action). */ public PdfAnnotation(PdfWriter writer, float llx, float lly, float urx, float ury, PdfAction action) { this.writer = writer; put(PdfName.SUBTYPE, PdfName.LINK); put(PdfName.RECT, new PdfRectangle(llx, lly, urx, ury)); put(PdfName.A, action); put(PdfName.BORDER, new PdfBorderArray(0, 0, 0)); put(PdfName.C, new PdfColor(0x00, 0x00, 0xFF)); }
/** * 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; }
public PdfAnnotation(PdfWriter writer, Rectangle rect) { this.writer = writer; if (rect != null) put(PdfName.RECT, new PdfRectangle(rect)); }
/** * Sets the layer this annotation belongs to. * @param layer the layer this annotation belongs to */ public void setLayer(PdfOCG layer) { put(PdfName.OC, layer.getRef()); }
/** * Sets the layer this annotation belongs to. * @param layer the layer this annotation belongs to */ public void setLayer(PdfOCG layer) { put(PdfName.OC, layer.getRef()); }
public PdfAnnotation(PdfWriter writer, Rectangle rect) { this.writer = writer; if (rect != null) put(PdfName.RECT, new PdfRectangle(rect)); }
public void setTitle(String title) { if (title == null) { remove(PdfName.T); return; } put(PdfName.T, new PdfString(title, PdfObject.TEXT_UNICODE)); }
PdfDictionary getMK() { PdfDictionary mk = (PdfDictionary)get(PdfName.MK); if (mk == null) { mk = new PdfDictionary(); put(PdfName.MK, mk); } return mk; }
PdfDictionary getMK() { PdfDictionary mk = (PdfDictionary) get(PdfName.MK); if (mk == null) { mk = new PdfDictionary(); put(PdfName.MK, mk); } return mk; }
public void setAppearanceState(String state) { if (state == null) { remove(PdfName.AS); return; } put(PdfName.AS, new PdfName(state)); }
public void setTitle(String title) { if (title == null) { remove(PdfName.T); return; } put(PdfName.T, new PdfString(title, PdfObject.TEXT_UNICODE)); }
public void setFlags(int flags) { if (flags == 0) remove(PdfName.F); else put(PdfName.F, new PdfNumber(flags)); }
public void setTitle(String title) { if (title == null) { remove(PdfName.T); return; } put(PdfName.T, new PdfString(title, PdfObject.TEXT_UNICODE)); }
public void setAppearance(PdfName ap, PdfTemplate template) { PdfDictionary dic = (PdfDictionary)get(PdfName.AP); if (dic == null) dic = new PdfDictionary(); dic.put(ap, template.getIndirectReference()); put(PdfName.AP, dic); if (!form) return; if (templates == null) templates = new HashMap(); templates.put(template, null); }
public void setAppearance(PdfName ap, PdfTemplate template) { PdfDictionary dic = (PdfDictionary)get(PdfName.AP); if (dic == null) dic = new PdfDictionary(); dic.put(ap, template.getIndirectReference()); put(PdfName.AP, dic); if (!form) return; if (templates == null) templates = new HashMap(); templates.put(template, null); }
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 PdfAnnotation createAnnotation(PdfWriter writer) { PdfAnnotation annotation = new PdfAnnotation(writer, new Rectangle(llx, lly, urx, ury)); if (newPage != 0) { PdfIndirectReference ref = writer.getPageReference(newPage); destination.set(0, ref); } if (destination != null) annotation.put(PdfName.DEST, destination); annotation.hashMap.putAll(parameters); return annotation; }
public void setAdditionalActions(PdfName key, PdfAction action) { PdfDictionary dic; PdfObject obj = get(PdfName.AA); if (obj != null && obj.isDictionary()) { dic = (PdfDictionary) obj; } else { dic = new PdfDictionary(); } dic.put(key, action); put(PdfName.AA, dic); }
public void setAdditionalActions(PdfName key, PdfAction action) { PdfDictionary dic; PdfObject obj = get(PdfName.AA); if (obj != null && obj.isDictionary()) dic = (PdfDictionary)obj; else dic = new PdfDictionary(); dic.put(key, action); put(PdfName.AA, dic); }