Examples of PdfAction


Examples of com.lowagie.text.pdf.PdfAction

    }
   
    public static PdfAnnotation convertAnnotation(PdfWriter writer, Annotation annot, LwgRectangle defaultRect) throws IOException {
        switch(annot.annotationType()) {
           case Annotation.URL_NET:
               return new PdfAnnotation(writer, annot.llx(), annot.lly(), annot.urx(), annot.ury(), new PdfAction((URL) annot.attributes().get(Annotation.URL)));
           case Annotation.URL_AS_STRING:
               return new PdfAnnotation(writer, annot.llx(), annot.lly(), annot.urx(), annot.ury(), new PdfAction((String) annot.attributes().get(Annotation.FILE)));
           case Annotation.FILE_DEST:
               return new PdfAnnotation(writer, annot.llx(), annot.lly(), annot.urx(), annot.ury(), new PdfAction((String) annot.attributes().get(Annotation.FILE), (String) annot.attributes().get(Annotation.DESTINATION)));
           case Annotation.SCREEN:
               boolean sparams[] = (boolean[])annot.attributes().get(Annotation.PARAMETERS);
               String fname = (String) annot.attributes().get(Annotation.FILE);
               String mimetype = (String) annot.attributes().get(Annotation.MIMETYPE);
               PdfFileSpecification fs;
               if (sparams[0])
                   fs = PdfFileSpecification.fileEmbedded(writer, fname, fname, null);
               else
                   fs = PdfFileSpecification.fileExtern(writer, fname);
               PdfAnnotation ann = PdfAnnotation.createScreen(writer, new LwgRectangle(annot.llx(), annot.lly(), annot.urx(), annot.ury()),
                       fname, fs, mimetype, sparams[1]);
               return ann;
           case Annotation.FILE_PAGE:
               return new PdfAnnotation(writer, annot.llx(), annot.lly(), annot.urx(), annot.ury(), new PdfAction((String) annot.attributes().get(Annotation.FILE), ((Integer) annot.attributes().get(Annotation.PAGE)).intValue()));
           case Annotation.NAMED_DEST:
               return new PdfAnnotation(writer, annot.llx(), annot.lly(), annot.urx(), annot.ury(), new PdfAction(((Integer) annot.attributes().get(Annotation.NAMED)).intValue()));
           case Annotation.LAUNCH:
               return new PdfAnnotation(writer, annot.llx(), annot.lly(), annot.urx(), annot.ury(), new PdfAction((String) annot.attributes().get(Annotation.APPLICATION),(String) annot.attributes().get(Annotation.PARAMETERS),(String) annot.attributes().get(Annotation.OPERATION),(String) annot.attributes().get(Annotation.DEFAULTDIR)));
           default:
             return new PdfAnnotation(writer, defaultRect.getLeft(), defaultRect.getBottom(), defaultRect.getRight(), defaultRect.getTop(), new PdfString(annot.title(), PdfObject.TEXT_UNICODE), new PdfString(annot.content(), PdfObject.TEXT_UNICODE));
       }
   }
View Full Code Here

Examples of com.lowagie.text.pdf.PdfAction

    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

Examples of com.lowagie.text.pdf.PdfAction

        // loop over the rows
        for (int line = 0; line < heights.length - 1; ++line) {
          // loop over the columns
            for (int col = 0; col < widths.length - 1; ++col) {
                if (line == 0 && col == 0)
                    cb.setAction(new PdfAction("http://www.lowagie.com/iText/"),
                        widths[col], heights[line + 1], widths[col + 1], heights[line]);
                cb.setRGBColorStrokeF((float)Math.random(), (float)Math.random(), (float)Math.random());
                // horizontal borderline
                cb.moveTo(widths[col], heights[line]);
                cb.lineTo(widths[col + 1], heights[line]);
View Full Code Here

Examples of com.lowagie.text.pdf.PdfAction

        for (int line = 0; line < heights.length - 1; ++line) {
            widths = width[line];
          // loop over the columns
            for (int col = 0; col < widths.length - 1; ++col) {
                if (line == 0 && col == 0)
                    cb.setAction(new PdfAction("http://www.lowagie.com/iText/"),
                        widths[col], heights[line + 1], widths[col + 1], heights[line]);
                cb.setRGBColorStrokeF((float)Math.random(), (float)Math.random(), (float)Math.random());
                // horizontal borderline
                cb.moveTo(widths[col], heights[line]);
                cb.lineTo(widths[col + 1], heights[line]);
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.sun.pdfview.action.PDFAction

            if (node == null) {
                return;
            }

            try {
                PDFAction action = node.getAction();
                if (action == null) {
                    return;
                }

                if (action instanceof GoToAction) {
View Full Code Here

Examples of com.sun.pdfview.action.PDFAction

                String title = scan.getDictRef("Title").getTextStringValue();
                OutlineNode build = new OutlineNode(title);
                work.add(build);

                // find the action
                PDFAction action = null;

                PDFObject actionObj = scan.getDictRef("A");
                if (actionObj != null) {
                    try {
                        action = PDFAction.getAction(actionObj, getRoot());
View Full Code Here

Examples of org.apache.fop.pdf.PDFAction

        boolean annotsAllowed = pdfDoc.getProfile().isAnnotationAllowed();

        // stuff we only need if a link must be created:
        Rectangle2D ipRect = null;
        PDFFactory factory = null;
        PDFAction action   = null;
        if (annotsAllowed) {
            // make sure the rect is determined *before* calling super!
            int ipp = currentIPPosition;
            int bpp = currentBPPosition + ip.getOffset();
            ipRect = new Rectangle2D.Float(ipp / 1000f, bpp / 1000f,
View Full Code Here

Examples of org.apache.fop.pdf.PDFAction

        boolean annotsAllowed = pdfDoc.getProfile().isAnnotationAllowed();

        // stuff we only need if a link must be created:
        Rectangle2D ipRect = null;
        PDFFactory factory = null;
        PDFAction action   = null;
        if (annotsAllowed) {
            // make sure the rect is determined *before* calling super!
            int ipp = currentIPPosition;
            int bpp = currentBPPosition + ip.getOffset();
            ipRect = new Rectangle2D.Float(ipp / 1000f, bpp / 1000f,
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.