AddPage() public method

public AddPage ( PdfIndirectReference page ) : bool
page PdfIndirectReference
return bool
Esempio n. 1
0
        /** 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);
        }
Esempio n. 2
0
 /**
 * Adds one named destination.
 * @param    name    the name for the destination
 * @param    page    the page number where you want to jump to
 * @param    dest    an explicit destination
 * @since    iText 5.0
 */
 public void AddNamedDestination(String name, int page, PdfDestination dest) {
     dest.AddPage(GetPageReference(page));
     pdf.LocalDestination(name, dest);
 }
 /**
 * The local destination to where a local goto with the same
 * name will jump to.
 * @param name the name of this local destination
 * @param destination the <CODE>PdfDestination</CODE> with the jump coordinates
 * @return <CODE>true</CODE> if the local destination was added,
 * <CODE>false</CODE> if a local destination with the same name
 * already existed
 */
 internal bool LocalDestination(String name, PdfDestination destination) {
     Destination dest;
     if (localDestinations.ContainsKey(name))
         dest = localDestinations[name];
     else
         dest = new Destination();
     if (dest.destination != null)
         return false;
     dest.destination = destination;
     localDestinations[name] = dest;
     if (!destination.HasPage())
         destination.AddPage(writer.CurrentPage);
     return true;
 }
Esempio n. 4
0
 /** 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);
     PdfDestination d = new PdfDestination(dest);
     d.AddPage(piref);
     PdfAction action = new PdfAction();
     action.Put(PdfName.S, PdfName.GOTO);
     action.Put(PdfName.D, d);
     return action;
 }
 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;
 }
Esempio n. 6
0
 /**
 * The local destination to where a local goto with the same
 * name will jump to.
 * @param name the name of this local destination
 * @param destination the <CODE>PdfDestination</CODE> with the jump coordinates
 * @return <CODE>true</CODE> if the local destination was added,
 * <CODE>false</CODE> if a local destination with the same name
 * already existed
 */
 internal bool LocalDestination(String name, PdfDestination destination) {
     Object[] obj = (Object[])localDestinations[name];
     if (obj == null)
         obj = new Object[3];
     if (obj[2] != null)
         return false;
     obj[2] = destination;
     localDestinations[name] = obj;
     if (!destination.HasPage())
         destination.AddPage(writer.CurrentPage);
     return true;
 }
Esempio n. 7
0
 /**
 * Adds one named destination.
 * @param    name    the name for the destination
 * @param    page    the page number where you want to jump to
 * @param    dest    an explicit destination
 * @since    iText 5.0
 */
 virtual public void AddNamedDestination(String name, int page, PdfDestination dest) {
     PdfDestination d = new PdfDestination(dest);
     d.AddPage(GetPageReference(page));
     pdf.LocalDestination(name, d);
 }