Package com.lowagie.text.pdf

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


            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

            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

   @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

      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

      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

            // step 4: we add some content
            document.add(new Paragraph("Page 1"));
            document.newPage();
            document.add(new Paragraph("This PDF file jumps directly to page 2 when opened"));
            PdfContentByte cb = writer.getDirectContent();
            cb.localDestination("page2", new PdfDestination(PdfDestination.XYZ, -1, 10000, 0));
            writer.setOpenAction("page2");
        }
        catch (Exception de) {
            de.printStackTrace();
        }
View Full Code Here

    headerFooterPageEvent.SetHeader(this.headerLogoFileName, document);
    headerFooterPageEvent.SetFooter(this.footerLogoFileName, document);
    pdfWriter.setPageEvent(headerFooterPageEvent);
    document.open();
    //set default zoom 100% when open doc
    PdfAction action = PdfAction.gotoLocalPage(1, new PdfDestination(PdfDestination.XYZ, -1, -1, 1f), pdfWriter);
    pdfWriter.setOpenAction(action);
  }
View Full Code Here

        _oldStroke = _stroke;
       
        setStrokeDiff(_stroke, null);
       
        if (_defaultDestination == null) {
            _defaultDestination = new PdfDestination(PdfDestination.FITH, height);
            _defaultDestination.addPage(_writer.getPageReference(1));
        }
       
        _linkTargetAreas = new HashSet();
    }
View Full Code Here

            if (uri != null) {
              if (uri.length() > 1 && uri.charAt(0) == '#') {
                    String anchor = uri.substring(1);
                    Box target = _sharedContext.getBoxById(anchor);
                    if (target != null) {
                        PdfDestination dest = createDestination(c, target);
                       
                        PdfAction action = new PdfAction();
                        if (!"".equals(handler.getAttributeValue(elem, "onclick"))) {
                            action = PdfAction.javaScript(handler.getAttributeValue(elem, "onclick"), _writer);
                        } else {
View Full Code Here

TOP

Related Classes of com.lowagie.text.pdf.PdfDestination

Copyright © 2018 www.massapicom. 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.