Examples of PDFDestination


Examples of com.lowagie.text.pdf.PdfDestination

    final PdfOutline pdfOutline;
    final int level;

    Bookmark(Bookmark parent, int x, int top, String title)
    {
      this(parent, new PdfDestination(PdfDestination.XYZ, x, top, 0), title);
    }
View Full Code Here

Examples of com.lowagie.text.pdf.PdfDestination

    final AffineTransform affineTransform = getGraphics().getTransform();
    final float translateX = (float) affineTransform.getTranslateX();

    final float upperY = translateX + (float) (globalHeight - StrictGeomUtility.toExternalValue(content.getY()));
    final float leftX = (float) (StrictGeomUtility.toExternalValue(content.getX()));
    final PdfDestination dest = new PdfDestination(PdfDestination.FIT, leftX, upperY, 0);
    writer.getDirectContent().localDestination(anchorName, dest);
  }
View Full Code Here

Examples of com.lowagie.text.pdf.PdfDestination

    final AffineTransform affineTransform = getGraphics().getTransform();
    final float translateX = (float) affineTransform.getTranslateX();

    final float upperY = translateX + (float) (globalHeight - StrictGeomUtility.toExternalValue(box.getY()));
    final float leftX = (float) (StrictGeomUtility.toExternalValue(box.getX()));
    final PdfDestination dest = new PdfDestination(PdfDestination.FIT, leftX, upperY, 0);
    new PdfOutline(root, dest, bookmark);
    // destination will always point to the 'current' page
    // todo: Make this a hierarchy ..
  }
View Full Code Here

Examples of com.lowagie.text.pdf.PdfDestination

     * @param position
     */
    public void onParagraph(PdfWriter writer, LwgDocument document, float position) {
        n++;
        PdfContentByte cb = writer.getDirectContent();
        PdfDestination destination = new PdfDestination(PdfDestination.FITH, position);
        new PdfOutline(cb.getRootOutline(), destination, "paragraph " + n);
    }
View Full Code Here

Examples of com.lowagie.text.pdf.PdfDestination

     * @param position
     */
    public void onParagraph(PdfWriter writer, LwgDocument document, float position) {
        n++;
        PdfContentByte cb = writer.getDirectContent();
        PdfDestination destination = new PdfDestination(PdfDestination.FITH, position);
        new PdfOutline(cb.getRootOutline(), destination, "paragraph " + n);
    }
View Full Code Here

Examples of com.lowagie.text.pdf.PdfDestination

            links.setColor(new Color(0x00, 0x80, 0x80));
            links.setStyle(LwgFont.BOLD);
            new PdfOutline(links, new PdfAction("http://www.lowagie.com/iText"), "Bruno's iText site");
            new PdfOutline(links, new PdfAction("http://itextpdf.sourceforge.net/"), "Paulo's iText site");
            new PdfOutline(links, new PdfAction("http://sourceforge.net/projects/itext/"), "iText @ SourceForge");
            PdfOutline other = new PdfOutline(root, new PdfDestination(PdfDestination.FIT), "other actions", false);
            other.setStyle(LwgFont.ITALIC);
            new PdfOutline(other, new PdfAction("remote.pdf", 1), "Go to yhe first page of a remote file");
            new PdfOutline(other, new PdfAction("remote.pdf", "test"), "Go to a local destination in a remote file");
            new PdfOutline(other, PdfAction.javaScript("app.alert('Hello');\r", writer), "Say Hello");
           
View Full Code Here

Examples of com.lowagie.text.pdf.PdfDestination

            cb.addTemplate(template, 187, 487);
            cb.addTemplate(template, 487, 287);
            cb.addTemplate(template, 87, 87);
           
            // we define the destinations
            PdfDestination d1 = new PdfDestination(PdfDestination.XYZ, 300, 800, 0);
            PdfDestination d2 = new PdfDestination(PdfDestination.FITH, 500);
            PdfDestination d3 = new PdfDestination(PdfDestination.FITR, 200, 300, 400, 500);
            PdfDestination d4 = new PdfDestination(PdfDestination.FITBV, 100);
            PdfDestination d5 = new PdfDestination(PdfDestination.FIT);
           
            // we define the outlines
            PdfOutline out1 = new PdfOutline(cb.getRootOutline(), d1, "root");
            PdfOutline out2 = new PdfOutline(out1, d2, "sub 1");
            new PdfOutline(out1, d3, "sub 2");
View Full Code Here

Examples of com.lowagie.text.pdf.PdfDestination

   @Override
   public void onParagraph(PdfWriter writer, LwgDocument document, float position)
   {
      n++;
      PdfContentByte cb = writer.getDirectContent();
      PdfDestination destination = new PdfDestination(PdfDestination.FITH, position);
      new PdfOutline(cb.getRootOutline(), destination, "paragraph " + n);
   }
View Full Code Here

Examples of com.lowagie.text.pdf.PdfDestination

      cb.stroke();
      document.newPage();
      // page 2
      writer.addAnnotation(PdfAnnotation.createLink(writer, new LwgRectangle(200f, 700f, 300f, 800f), PdfAnnotation.HIGHLIGHT_TOGGLE, PdfAction.javaScript("app.alert('Hello');\r", writer)));
      writer.addAnnotation(PdfAnnotation.createLink(writer, new LwgRectangle(200f, 550f, 300f, 650f), PdfAnnotation.HIGHLIGHT_OUTLINE, "top"));
      writer.addAnnotation(PdfAnnotation.createLink(writer, new LwgRectangle(200f, 400f, 300f, 500f), PdfAnnotation.HIGHLIGHT_PUSH, 1, new PdfDestination(PdfDestination.FIT)));
      writer.addAnnotation(PdfAnnotation.createSquareCircle(writer, new LwgRectangle(200f, 250f, 300f, 350f), "This Comment annotation was made with 'createSquareCircle'", false));
      document.newPage();
      // page 3
      PdfContentByte pcb = new PdfContentByte(writer);
      pcb.setColorFill(new Color(0xFF, 0x00, 0x00));
View Full Code Here

Examples of com.lowagie.text.pdf.PdfDestination

      PdfWriter.getInstance(remote, new FileOutputStream("remote.pdf"));
      // step 3:
      document.open();
      remote.open();
      // step 4: we add some content
      PdfAction action = PdfAction.gotoLocalPage(2, new PdfDestination(
          PdfDestination.XYZ, -1, 10000, 0), writer);
      writer.setOpenAction(action);
      document.add(new Paragraph("Page 1"));
      document.newPage();
      document.add(new Paragraph("Page 2"));
      document.add(new Chunk("goto page 1").setAction(PdfAction
          .gotoLocalPage(1, new PdfDestination(PdfDestination.FITH,
              500), writer)));
      document.add(Chunk.NEWLINE);
      document.add(new Chunk("goto another document").setAction(PdfAction
          .gotoRemotePage("remote.pdf", "test", false, true)));
      remote.add(new Paragraph("Some remote document"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.