
org.openpdf.renderer.action.GoToAction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openpdf-renderer Show documentation
Show all versions of openpdf-renderer Show documentation
PDF renderer implementation supporting the subset of PDF 1.4 specification.
The newest version!
package org.openpdf.renderer.action;
import java.io.IOException;
import org.openpdf.renderer.PDFObject;
import org.openpdf.renderer.PDFDestination;
import org.openpdf.renderer.PDFParseException;
/**
* An action which specifies going to a particular destination
*/
public class GoToAction extends PDFAction {
/** the destination to go to */
private PDFDestination dest;
/**
* Creates a new instance of GoToAction from an object
*
* @param obj the PDFObject with the action information
*/
public GoToAction(PDFObject obj, PDFObject root) throws IOException {
super("GoTo");
// find the destination
PDFObject destObj = obj.getDictRef("D");
if (destObj == null) {
throw new PDFParseException("No destination in GoTo action " + obj);
}
// parse it
this.dest = PDFDestination.getDestination(destObj, root);
}
/**
* Create a new GoToAction from a destination
*/
public GoToAction(PDFDestination dest) {
super("GoTo");
this.dest = dest;
}
/**
* Get the destination this action refers to
*/
public PDFDestination getDestination() {
return this.dest;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy