/** Implements an action in an area. * @param action the <CODE>PdfAction</CODE> * @param llx the lower left x corner of the activation area * @param lly the lower left y corner of the activation area * @param urx the upper right x corner of the activation area * @param ury the upper right y corner of the activation area */ void setAction(final PdfAction action, final float llx, final float lly, final float urx, final float ury) { addAnnotation(writer.createAnnotation(llx, lly, urx, ury, action, null)); }
/** Implements an action in an area. * @param action the <CODE>PdfAction</CODE> * @param llx the lower left x corner of the activation area * @param lly the lower left y corner of the activation area * @param urx the upper right x corner of the activation area * @param ury the upper right y corner of the activation area */ void setAction(final PdfAction action, final float llx, final float lly, final float urx, final float ury) { addAnnotation(writer.createAnnotation(llx, lly, urx, ury, action, null)); }
public void setAction(PdfAction action, float llx, float lly, float urx, float ury) { ((PdfStamperImp)writer).addAnnotation(writer.createAnnotation(llx, lly, urx, ury, action, null), ps.pageN); }
/** * Implements a link to another document. * @param filename the filename for the remote document * @param page the page to jump to * @param llx the lower left x corner of the activation area * @param lly the lower left y corner of the activation area * @param urx the upper right x corner of the activation area * @param ury the upper right y corner of the activation area */ void remoteGoto(final String filename, final int page, final float llx, final float lly, final float urx, final float ury) { addAnnotation(writer.createAnnotation(llx, lly, urx, ury, new PdfAction(filename, page), null)); }
/** * Implements a link to another document. * @param filename the filename for the remote document * @param name the name to jump to * @param llx the lower left x corner of the activation area * @param lly the lower left y corner of the activation area * @param urx the upper right x corner of the activation area * @param ury the upper right y corner of the activation area */ void remoteGoto(final String filename, final String name, final float llx, final float lly, final float urx, final float ury) { annotationsImp.addPlainAnnotation(writer.createAnnotation(llx, lly, urx, ury, new PdfAction(filename, name), null)); }
/** * Implements a link to another document. * @param filename the filename for the remote document * @param page the page to jump to * @param llx the lower left x corner of the activation area * @param lly the lower left y corner of the activation area * @param urx the upper right x corner of the activation area * @param ury the upper right y corner of the activation area */ void remoteGoto(final String filename, final int page, final float llx, final float lly, final float urx, final float ury) { addAnnotation(writer.createAnnotation(llx, lly, urx, ury, new PdfAction(filename, page), null)); }
/** * Implements a link to another document. * @param filename the filename for the remote document * @param name the name to jump to * @param llx the lower left x corner of the activation area * @param lly the lower left y corner of the activation area * @param urx the upper right x corner of the activation area * @param ury the upper right y corner of the activation area */ void remoteGoto(final String filename, final String name, final float llx, final float lly, final float urx, final float ury) { annotationsImp.addPlainAnnotation(writer.createAnnotation(llx, lly, urx, ury, new PdfAction(filename, name), null)); }
/** * Creates a link. * @param writer * @param rect * @param highlight * @return A PdfAnnotation */ protected static PdfAnnotation createLink(PdfWriter writer, Rectangle rect, PdfName highlight) { PdfAnnotation annot = writer.createAnnotation(rect, PdfName.LINK); if (!highlight.equals(HIGHLIGHT_INVERT)) annot.put(PdfName.H, highlight); return annot; }
/** * Implements a link to other part of the document. The jump will * be made to a local destination with the same name, that must exist. * @param name the name for this link * @param llx the lower left x corner of the activation area * @param lly the lower left y corner of the activation area * @param urx the upper right x corner of the activation area * @param ury the upper right y corner of the activation area */ void localGoto(final String name, final float llx, final float lly, final float urx, final float ury) { PdfAction action = getLocalGotoAction(name); annotationsImp.addPlainAnnotation(writer.createAnnotation(llx, lly, urx, ury, action, null)); }
/** * Implements a link to other part of the document. The jump will * be made to a local destination with the same name, that must exist. * @param name the name for this link * @param llx the lower left x corner of the activation area * @param lly the lower left y corner of the activation area * @param urx the upper right x corner of the activation area * @param ury the upper right y corner of the activation area */ void localGoto(final String name, final float llx, final float lly, final float urx, final float ury) { PdfAction action = getLocalGotoAction(name); annotationsImp.addPlainAnnotation(writer.createAnnotation(llx, lly, urx, ury, action, null)); }
/** * Creates a link. * @param writer * @param rect * @param highlight * @return A PdfAnnotation */ protected static PdfAnnotation createLink(PdfWriter writer, Rectangle rect, PdfName highlight) { PdfAnnotation annot = writer.createAnnotation(rect, PdfName.LINK); if (!highlight.equals(HIGHLIGHT_INVERT)) annot.put(PdfName.H, highlight); return annot; }
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, 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 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; }
/** * Add some free text to the document. * @param writer * @param rect * @param contents * @param defaultAppearance * @return A PdfAnnotation */ public static PdfAnnotation createFreeText(PdfWriter writer, Rectangle rect, String contents, PdfContentByte defaultAppearance) { PdfAnnotation annot = writer.createAnnotation(rect, PdfName.FREETEXT); annot.put(PdfName.CONTENTS, new PdfString(contents, PdfObject.TEXT_UNICODE)); annot.setDefaultAppearanceString(defaultAppearance); return annot; }
/** * Adds a Stamp to your document. Move over the stamp and a tooltip is shown * @param writer * @param rect * @param contents * @param name * @return A PdfAnnotation */ public static PdfAnnotation createStamp(PdfWriter writer, Rectangle rect, String contents, String name) { PdfAnnotation annot = writer.createAnnotation(rect, PdfName.STAMP); annot.put(PdfName.CONTENTS, new PdfString(contents, PdfObject.TEXT_UNICODE)); annot.put(PdfName.NAME, new PdfName(name)); return annot; }
/** Creates a file attachment annotation * @param writer * @param rect * @param contents * @param fs * @return the annotation * @throws IOException */ public static PdfAnnotation createFileAttachment(PdfWriter writer, Rectangle rect, String contents, PdfFileSpecification fs) throws IOException { PdfAnnotation annot = writer.createAnnotation(rect, PdfName.FILEATTACHMENT); if (contents != null) annot.put(PdfName.CONTENTS, new PdfString(contents, PdfObject.TEXT_UNICODE)); annot.put(PdfName.FS, fs.getReference()); return annot; }
public static PdfAnnotation createInk(PdfWriter writer, Rectangle rect, String contents, float inkList[][]) { PdfAnnotation annot = writer.createAnnotation(rect, PdfName.INK); annot.put(PdfName.CONTENTS, new PdfString(contents, PdfObject.TEXT_UNICODE)); PdfArray outer = new PdfArray(); for (int k = 0; k < inkList.length; ++k) { PdfArray inner = new PdfArray(); float deep[] = inkList[k]; for (int j = 0; j < deep.length; ++j) inner.add(new PdfNumber(deep[j])); outer.add(inner); } annot.put(PdfName.INKLIST, outer); return annot; }