public PdfAnnotation(PdfWriter writer, Rectangle rect) { this.writer = writer; if (rect != null) put(PdfName.RECT, new PdfRectangle(rect)); }
/** * 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)); }
public PdfAnnotation(PdfWriter writer, Rectangle rect) { this.writer = writer; if (rect != null) put(PdfName.RECT, new PdfRectangle(rect)); }
public void setFlags(int flags) { if (flags == 0) remove(PdfName.F); else put(PdfName.F, new PdfNumber(flags)); }
/** * Sets the annotation's highlighting mode. The values can be * <CODE>HIGHLIGHT_NONE</CODE>, <CODE>HIGHLIGHT_INVERT</CODE>, * <CODE>HIGHLIGHT_OUTLINE</CODE> and <CODE>HIGHLIGHT_PUSH</CODE>; * @param highlight the annotation's highlighting mode */ public void setHighlighting(PdfName highlight) { if (highlight.equals(HIGHLIGHT_INVERT)) remove(PdfName.H); else put(PdfName.H, highlight); }
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; }
public void setAppearanceState(String state) { if (state == null) { remove(PdfName.AS); return; } put(PdfName.AS, new PdfName(state)); }
public void setFlags(int flags) { if (flags == 0) remove(PdfName.F); else put(PdfName.F, new PdfNumber(flags)); }
public void setAppearanceState(String state) { if (state == null) { remove(PdfName.AS); return; } put(PdfName.AS, new PdfName(state)); }
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 HashSet<PdfTemplate>(); templates.add(template); }
public boolean setFieldAsJavascript(String field, PdfName jsTrigName, String js) { PdfAnnotation dict = wrt.createAnnotation(null, null); PdfAction javascript = PdfAction.javaScript(js, wrt); dict.put(jsTrigName, javascript); return setField(field, dict); }
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)); }
public PdfAnnotation createAnnotation(PdfWriter writer) { PdfAnnotation annotation = writer.createAnnotation(new Rectangle(llx, lly, urx, ury), null); 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; }
@Override public PdfAnnotation createAnnotation(float llx, float lly, float urx, float ury, PdfAction action, PdfName subtype) { PdfAnnotation a = super.createAnnotation(llx, lly, urx, ury, action, subtype); if (!PdfName.POPUP.equals(subtype)) a.put(PdfName.F, new PdfNumber(PdfAnnotation.FLAGS_PRINT)); return a; }
@Override public PdfAnnotation createAnnotation(Rectangle rect, PdfName subtype) { PdfAnnotation a = super.createAnnotation(rect, subtype); if (!PdfName.POPUP.equals(subtype)) a.put(PdfName.F, new PdfNumber(PdfAnnotation.FLAGS_PRINT)); return a; }
@Override public PdfAnnotation createAnnotation(float llx, float lly, float urx, float ury, PdfString title, PdfString content, PdfName subtype) { PdfAnnotation a = super.createAnnotation(llx, lly, urx, ury, title, content, subtype); if (!PdfName.POPUP.equals(subtype)) a.put(PdfName.F, new PdfNumber(PdfAnnotation.FLAGS_PRINT)); return a; }
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); }