/** * Creates an Annotation with an Action. * @param writer * @param rect * @param highlight * @param action * @return A PdfAnnotation */ public static PdfAnnotation createLink(PdfWriter writer, Rectangle rect, PdfName highlight, PdfAction action) { PdfAnnotation annot = createLink(writer, rect, highlight); annot.putEx(PdfName.A, action); return annot; }
/** * Creates an Annotation with an Action. * @param writer * @param rect * @param highlight * @param action * @return A PdfAnnotation */ public static PdfAnnotation createLink(PdfWriter writer, Rectangle rect, PdfName highlight, PdfAction action) { PdfAnnotation annot = createLink(writer, rect, highlight); annot.putEx(PdfName.A, action); return annot; }
/** * Creates an Annotation with an local destination. * @param writer * @param rect * @param highlight * @param namedDestination * @return A PdfAnnotation */ public static PdfAnnotation createLink(PdfWriter writer, Rectangle rect, PdfName highlight, String namedDestination) { PdfAnnotation annot = createLink(writer, rect, highlight); annot.put(PdfName.DEST, new PdfString(namedDestination, PdfObject.TEXT_UNICODE)); return annot; }
/** * Creates an Annotation with an local destination. * @param writer * @param rect * @param highlight * @param namedDestination * @return A PdfAnnotation */ public static PdfAnnotation createLink(PdfWriter writer, Rectangle rect, PdfName highlight, String namedDestination) { PdfAnnotation annot = createLink(writer, rect, highlight); annot.put(PdfName.DEST, new PdfString(namedDestination, PdfObject.TEXT_UNICODE)); return annot; }
/** * Creates an Annotation with a PdfDestination. * @param writer * @param rect * @param highlight * @param page * @param dest * @return A PdfAnnotation */ public static PdfAnnotation createLink(PdfWriter writer, Rectangle rect, PdfName highlight, int page, PdfDestination dest) { PdfAnnotation annot = createLink(writer, rect, highlight); PdfIndirectReference ref = writer.getPageReference(page); PdfDestination d = new PdfDestination(dest); d.addPage(ref); annot.put(PdfName.DEST, d); return annot; }
/** * Creates an Annotation with a PdfDestination. * @param writer * @param rect * @param highlight * @param page * @param dest * @return A PdfAnnotation */ public static PdfAnnotation createLink(PdfWriter writer, Rectangle rect, PdfName highlight, int page, PdfDestination dest) { PdfAnnotation annot = createLink(writer, rect, highlight); PdfIndirectReference ref = writer.getPageReference(page); PdfDestination d = new PdfDestination(dest); d.addPage(ref); annot.put(PdfName.DEST, d); return annot; }