/** * Set the page of the <CODE>PdfDestination</CODE>-object. * * @param pageReference indirect reference to the page * @return <CODE>true</CODE> if this page was set as the <CODE>PdfDestination</CODE>-page. */ public bool setDestinationPage(PdfIndirectReference pageReference) { if (destination == null) { return(false); } return(destination.addPage(pageReference)); }
public static PdfAnnotation createLink(PdfWriter writer, Rectangle rect, PdfName highlight, int page, PdfDestination dest) { PdfAnnotation annot = createLink(writer, rect, highlight); PdfIndirectReference piref = writer.getPageReference(page); dest.addPage(piref); annot.put(PdfName.DEST, dest); return(annot); }
/** Creates a GoTo action to an internal page. * @param page the page to go. First page is 1 * @param dest the destination for the page * @param writer the writer for this action * @return a GoTo action */ public static PdfAction gotoLocalPage(int page, PdfDestination dest, PdfWriter writer) { PdfIndirectReference piref = writer.getPageReference(page); dest.addPage(piref); PdfAction action = new PdfAction(); action.put(PdfName.S, PdfName.GOTO); action.put(PdfName.D, dest); return(action); }