Examples of PDActionURI


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

                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

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

                        {
                            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 " + pageNum +": Replacing " + oldURI + " with " + newURI );
                                uri.setURI( newURI );
                            }
                        }
                    }
                }
                doc.save( args[1] );
View Full Code Here

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

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

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

                            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 " + pageNum +":'" + urlText + "'=" + uri.getURI() );
                            }
                        }
                    }
                }
            }
View Full Code Here

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

public class TestUriAction extends AbstractTestAction
{

    protected PDActionURI createAction()
    {
        PDActionURI action = new PDActionURI();
        action.setURI("http://www.apache.org");
        return action;
    }
View Full Code Here

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

    }

    @Test
    public void testMissingURI() throws Exception
    {
        PDActionURI action = new PDActionURI();
        valid(action, false, PreflightConstants.ERROR_ACTION_MISING_KEY);
    }
View Full Code Here

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

    }

    @Test
    public void testInvalidURI() throws Exception
    {
        PDActionURI action = new PDActionURI();
        action.getCOSDictionary().setBoolean(COSName.URI, true);
        valid(action, false, PreflightConstants.ERROR_ACTION_INVALID_TYPE);
    }
View Full Code Here

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

    }

    @Test
    public void testNextValid() throws Exception
    {
        PDActionURI action = createAction();
        action.setNext(Arrays.asList(createAction()));
        valid(action, true);
    }
View Full Code Here

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

    }

    @Test
    public void testNextInvalid() throws Exception
    {
        PDActionURI action = createAction();
        action.setNext(Arrays.asList(new PDActionJavaScript()));
        valid(action, false, PreflightConstants.ERROR_ACTION_FORBIDDEN_ACTIONS_EXPLICITLY_FORBIDDEN);
    }
View Full Code Here

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

                    if( o instanceof PDAnnotationLink ) {
                        PDAnnotationLink annotationlink = (PDAnnotationLink) o;
                        if (annotationlink.getAction()  != null) {
                            PDAction action = annotationlink.getAction();
                            if( action instanceof PDActionURI ) {
                                PDActionURI uri = (PDActionURI) action;
                                String link = uri.getURI();
                                if (link != null) {
                                    handler.startElement("div", "class", "annotation");
                                    handler.startElement("a", "href", link);
                                    handler.endElement("a");
                                    handler.endElement("div");
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.