Example usage for org.apache.pdfbox.pdmodel.interactive.action PDActionURI setURI

List of usage examples for org.apache.pdfbox.pdmodel.interactive.action PDActionURI setURI

Introduction

In this page you can find the example usage for org.apache.pdfbox.pdmodel.interactive.action PDActionURI setURI.

Prototype

public void setURI(String uri) 

Source Link

Document

This will set the uniform resource identifier to resolve, encoded in 7-bit ASCII.

Usage

From source file:net.bookinaction.utils.AnnotationMaker.java

License:Apache License

public PDAnnotationLink linkAnnotation(PDColor color, Rectangle2D.Float position, String url) {
    // Now add the link annotation, so the clickme works
    PDAnnotationLink txtLink = new PDAnnotationLink();
    txtLink.setBorderStyle(borderULine);

    // Set the rectangle containing the link
    txtLink.setRectangle(new PDRectangle(position.x, position.y, position.width, position.height));

    // add an action
    PDActionURI action = new PDActionURI();
    action.setURI(url);
    txtLink.setAction(action);//from w w  w.ja  v a2 s.  c o m

    return txtLink;
}