Package org.pdfbox.pdmodel.interactive.action.type

Examples of org.pdfbox.pdmodel.interactive.action.type.PDActionURI


    public PDActionURI getPreviousURI()
    {
        COSDictionary pa = (COSDictionary) getDictionary().getDictionaryObject("PA");
        if ( pa != null )
        {
            return new PDActionURI( pa );
        }
        else
        {
            return null;
        }
View Full Code Here


                            PDAnnotationLink link = (PDAnnotationLink)annot;
                            PDAction action = link.getAction();
                            String urlText = stripper.getTextForRegion( "" + j );
                            if( action instanceof PDActionURI )
                            {
                                PDActionURI uri = (PDActionURI)action;
                                System.out.println( "Page " + (i+1) +":'" + urlText + "'=" + uri.getURI() );
                            }
                        }
                    }
                }
            }
View Full Code Here

                        {
                            PDAnnotationLink link = (PDAnnotationLink)annot;
                            PDAction action = link.getAction();
                            if( action instanceof PDActionURI )
                            {
                                PDActionURI uri = (PDActionURI)action;
                                String oldURI = uri.getURI();
                                String newURI = "http://www.pdfbox.org";
                                System.out.println( "Page " + (i+1) +": Replacing " + oldURI + " with " + newURI );
                                uri.setURI( newURI );
                            }
                        }
                    }
                }
                doc.save( args[1] );
View Full Code Here

            {
                retval = new PDActionRemoteGoTo( action );
            }
            else if( PDActionURI.SUB_TYPE.equals( type ) )
            {
                retval = new PDActionURI( action );
            }
        }
        return retval;
    }
View Full Code Here

     * Document level information in the URI.
     * @return Document level URI.
     */
    public PDActionURI getURI()
    {
        PDActionURI retval = null;
        COSDictionary uri = (COSDictionary)root.getDictionaryObject( "URI" );
        if( uri != null )
        {
            retval = new PDActionURI( uri );
        }
        return retval;
    }
View Full Code Here

                position.setUpperRightX(72 + textWidth);
                position.setUpperRightY(ph-(float)(1.5*inch));
                txtLink.setRectangle(position);
               
                // add an action
                PDActionURI action = new PDActionURI();
                action.setURI("http://www.pdfbox.org");
                txtLink.setAction(action);
               
                annotations.add(txtLink);
               
               
View Full Code Here

        for (int j = 0; j < linkAnnotations.size(); j++) {
            final PDAnnotationLink link = (PDAnnotationLink) linkAnnotations.get(j);
            final PDAction action = link.getAction();
            final String urlText = stripper.getTextForRegion(Integer.toString(j));
            if (action instanceof PDActionURI) {
              final PDActionURI uri = (PDActionURI) action;
                // internal links have no text
                if (urlText.length() > 0) {
                    textMap.put(linkRegions.get(j), urlText);
                }
                uriMap.put(linkRegions.get(j), uri.getURI());
            }
            else if (action instanceof PDActionGoTo) {
                // internal link text associated with goto
                if (urlText.length() > 0) {
                    textMap.put(linkRegions.get(j), urlText);
View Full Code Here

TOP

Related Classes of org.pdfbox.pdmodel.interactive.action.type.PDActionURI

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.