Examples of PdfAction


Examples of com.lowagie.text.pdf.PdfAction

    if (box.isNodeVisible(getDrawArea()) == false)
    {
      return;
    }

    final PdfAction action = createActionForLink(target);

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

    final float leftX = translateX + (float) (StrictGeomUtility.toExternalValue(box.getX()));
View Full Code Here

Examples of com.lowagie.text.pdf.PdfAction

  {
    if (StringUtils.isEmpty(target))
    {
      return null;
    }
    final PdfAction action = new PdfAction();
    if (target.startsWith("#"))
    {
      // its a local link ..
      action.put(PdfName.S, PdfName.GOTO);
      action.put(PdfName.D, new PdfString(target.substring(1)));
    }
    else
    {
      action.put(PdfName.S, PdfName.URI);
      action.put(PdfName.URI, new PdfString(target));
    }
    return action;
  }
View Full Code Here

Examples of com.lowagie.text.pdf.PdfAction

   *            the <CODE>URL</CODE> to link to
   * @return this <CODE>Chunk</CODE>
   */

  public Chunk setAnchor(URL url) {
    return setAttribute(ACTION, new PdfAction(url.toExternalForm()));
  }
View Full Code Here

Examples of com.lowagie.text.pdf.PdfAction

   *            the url to link to
   * @return this <CODE>Chunk</CODE>
   */

  public Chunk setAnchor(String url) {
    return setAttribute(ACTION, new PdfAction(url));
  }
View Full Code Here

Examples of com.lowagie.text.pdf.PdfAction

            // we add some content
            document.add(new Paragraph("Outline action example"));
            // we add the outline
            PdfContentByte cb = writer.getDirectContent();
            PdfOutline root = cb.getRootOutline();
            PdfOutline links = new PdfOutline(root, new PdfAction("http://www.lowagie.com/iText/links.html"), "Useful links");
            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");
           
            remote.add(new Paragraph("Some remote document"));
            remote.newPage();
            Paragraph p = new Paragraph("This paragraph contains a ");
View Full Code Here

Examples of com.lowagie.text.pdf.PdfAction

      // step 3: we open the document
      document.open();
      // step 4: we add some content
      String application = args[0] + "notepad.exe";
      Paragraph p = new Paragraph(new Chunk("Click to open "
          + application).setAction(new PdfAction(application, null,
          null, null)));
      document.add(p);
    } catch (Exception de) {
      de.printStackTrace();
    }
View Full Code Here

Examples of com.lowagie.text.pdf.PdfAction

      PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(
          "ChainedActions.pdf"));
      // step 3: we add Javascript as Metadata and we open the document       
      document.open();
      // step 4: we add some content
      PdfAction action = PdfAction.javaScript("app.alert('Welcome at my site');\r", writer);
      action.next(new PdfAction("http://www.lowagie.com/iText/"));
      Paragraph p = new Paragraph(new Chunk("Click to go to Bruno's site")
          .setAction(action));
      document.add(p);
    } catch (Exception de) {
      de.printStackTrace();
View Full Code Here

Examples of com.lowagie.text.pdf.PdfAction

      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"));
View Full Code Here

Examples of com.lowagie.text.pdf.PdfAction

          new FileOutputStream("NamedActions.pdf"));
      // step 3: we open the document
      document.open();
      // step 4: we add some content
      Paragraph p = new Paragraph(new Chunk("Click to print")
          .setAction(new PdfAction(PdfAction.PRINTDIALOG)));
      LwgPdfPTable table = new LwgPdfPTable(4);
      table.getDefaultCell().setHorizontalAlignment(LwgElement.ALIGN_CENTER);
      table.add(new LwgPhrase(new Chunk("First Page")
          .setAction(new PdfAction(PdfAction.FIRSTPAGE))));
      table.add(new LwgPhrase(new Chunk("Prev Page")
          .setAction(new PdfAction(PdfAction.PREVPAGE))));
      table.add(new LwgPhrase(new Chunk("Next Page")
          .setAction(new PdfAction(PdfAction.NEXTPAGE))));
      table.add(new LwgPhrase(new Chunk("Last Page")
          .setAction(new PdfAction(PdfAction.LASTPAGE))));
      for (int k = 1; k <= 10; ++k) {
        document.add(new Paragraph("This is page " + k));
        document.add(Chunk.NEWLINE);
        document.add(table);
        document.add(p);
View Full Code Here

Examples of com.lowagie.text.pdf.PdfAction

            state.add("toggle");
            state.add(l1);
            state.add(l2);
            state.add(l3);
            state.add(l4);
            PdfAction action = PdfAction.setOCGstate(state, true);
            Chunk ck = new Chunk("Click here to toggle the layers", new LwgFont(LwgFont.HELVETICA, 18, LwgFont.NORMAL, Color.yellow)).setBackground(Color.blue).setAction(action);
            ColumnText.showTextAligned(cb, LwgElement.ALIGN_CENTER, new LwgPhrase(ck), 250, 400, 0);
            cb.sanityCheck();
           
            // step 5: closing the 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.