com.lowagie.text.pdf
Class PdfAction

java.lang.Object
  |
  +--com.lowagie.text.pdf.PdfObject
        |
        +--com.lowagie.text.pdf.PdfDictionary
              |
              +--com.lowagie.text.pdf.PdfAction

public class PdfAction
extends PdfDictionary

A PdfAction defines an action that can be triggered from a PDF file.

See Also:
PdfDictionary

Field Summary
static int FIRSTPAGE
          A named action to go to the first page.
static int LASTPAGE
          A named action to go to the last page.
static int NEXTPAGE
          A named action to go to the next page.
static int PREVPAGE
          A named action to go to the previous page.
static int PRINTDIALOG
          A named action to open a print dialog.
static int RESET_EXCLUDE
           
static int SUBMIT_COORDINATES
           
static int SUBMIT_EXCLUDE
           
static int SUBMIT_HTML_FORMAT
           
static int SUBMIT_HTML_GET
           
static int SUBMIT_INCLUDE_NO_VALUE_FIELDS
           
 
Fields inherited from class com.lowagie.text.pdf.PdfDictionary
CATALOG, FONT, hashMap, OUTLINES, PAGE, PAGES
 
Fields inherited from class com.lowagie.text.pdf.PdfObject
ARRAY, BOOLEAN, bytes, DICTIONARY, INDIRECT, NAME, NOTHING, NULL, NUMBER, STREAM, STRING, TEXT_PDFDOCENCODING, TEXT_UNICODE, type
 
Constructor Summary
(package private) PdfAction()
          Create an empty action.
  PdfAction(int named)
          Implements name actions.
(package private) PdfAction(PdfIndirectReference destination)
          Constructs a new PdfAction of Subtype GoTo.
  PdfAction(String url)
          Constructs a new PdfAction of Subtype URI.
  PdfAction(String url, boolean isMap)
           
  PdfAction(String filename, int page)
          Constructs a new PdfAction of Subtype GoToR.
  PdfAction(String filename, String name)
          Constructs a new PdfAction of Subtype GoToR.
  PdfAction(String application, String parameters, String operation, String defaultDir)
          Launchs an application or a document.
  PdfAction(URL url)
          Constructs a new PdfAction of Subtype URI.
  PdfAction(URL url, boolean isMap)
           
 
Method Summary
(package private) static PdfArray buildArray(Object[] names)
           
static PdfAction createHide(Object[] names, boolean hide)
           
static PdfAction createHide(PdfAnnotation annot, boolean hide)
           
(package private) static PdfAction createHide(PdfObject obj, boolean hide)
           
static PdfAction createHide(String name, boolean hide)
           
static PdfAction createImportData(String file)
           
static PdfAction createResetForm(Object[] names, int flags)
           
static PdfAction createSubmitForm(String file, Object[] names, int flags)
           
static PdfAction gotoLocalPage(int page, PdfDestination dest, PdfWriter writer)
          Creates a GoTo action to an internal page.
static PdfAction javaScript(String code, PdfWriter writer)
          Creates a JavaScript action.
static PdfAction javaScript(String code, PdfWriter writer, boolean unicode)
          Creates a JavaScript action.
 void next(PdfAction na)
          Add a chained action.
 
Methods inherited from class com.lowagie.text.pdf.PdfDictionary
contains, get, getKeys, isCatalog, isDictionaryType, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, putDel, putEx, remove, size, toPdf
 
Methods inherited from class com.lowagie.text.pdf.PdfObject
getBytes, isArray, isBoolean, isDictionary, isName, isNull, isNumber, isStream, isString, length, setContent, toString, type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FIRSTPAGE

public static final int FIRSTPAGE
A named action to go to the first page.

See Also:
Constant Field Values

PREVPAGE

public static final int PREVPAGE
A named action to go to the previous page.

See Also:
Constant Field Values

NEXTPAGE

public static final int NEXTPAGE
A named action to go to the next page.

See Also:
Constant Field Values

LASTPAGE

public static final int LASTPAGE
A named action to go to the last page.

See Also:
Constant Field Values

PRINTDIALOG

public static final int PRINTDIALOG
A named action to open a print dialog.

See Also:
Constant Field Values

SUBMIT_EXCLUDE

public static final int SUBMIT_EXCLUDE
See Also:
Constant Field Values

SUBMIT_INCLUDE_NO_VALUE_FIELDS

public static final int SUBMIT_INCLUDE_NO_VALUE_FIELDS
See Also:
Constant Field Values

SUBMIT_HTML_FORMAT

public static final int SUBMIT_HTML_FORMAT
See Also:
Constant Field Values

SUBMIT_HTML_GET

public static final int SUBMIT_HTML_GET
See Also:
Constant Field Values

SUBMIT_COORDINATES

public static final int SUBMIT_COORDINATES
See Also:
Constant Field Values

RESET_EXCLUDE

public static final int RESET_EXCLUDE
See Also:
Constant Field Values
Constructor Detail

PdfAction

PdfAction()
Create an empty action.


PdfAction

public PdfAction(URL url)
Constructs a new PdfAction of Subtype URI.

Parameters:
url - the Url to go to

PdfAction

public PdfAction(URL url,
                 boolean isMap)

PdfAction

public PdfAction(String url)
Constructs a new PdfAction of Subtype URI.

Parameters:
url - the url to go to

PdfAction

public PdfAction(String url,
                 boolean isMap)

PdfAction

PdfAction(PdfIndirectReference destination)
Constructs a new PdfAction of Subtype GoTo.

Parameters:
destination - the destination to go to

PdfAction

public PdfAction(String filename,
                 String name)
Constructs a new PdfAction of Subtype GoToR.

Parameters:
filename - the file name to go to
name - the named destination to go to

PdfAction

public PdfAction(String filename,
                 int page)
Constructs a new PdfAction of Subtype GoToR.

Parameters:
filename - the file name to go to
page - the page destination to go to

PdfAction

public PdfAction(int named)
Implements name actions. The action can be FIRSTPAGE, LASTPAGE, NEXTPAGE and PREVPAGE.

Parameters:
named - the named action

PdfAction

public PdfAction(String application,
                 String parameters,
                 String operation,
                 String defaultDir)
Launchs an application or a document.

Parameters:
application - the application to be launched or the document to be opened or printed.
parameters - (Windows-specific) A parameter string to be passed to the application. It can be null.
operation - (Windows-specific) the operation to perform: "open" - Open a document, "print" - Print a document. It can be null.
defaultDir - (Windows-specific) the default directory in standard DOS syntax. It can be null.
Method Detail

javaScript

public static PdfAction javaScript(String code,
                                   PdfWriter writer,
                                   boolean unicode)
Creates a JavaScript action. If the JavaScript is smaller than 50 characters it will be placed as a string, otherwise it will be placed as a compressed stream.

Parameters:
code - the JavaScript code
writer - the writer for this action
unicode - select JavaScript unicode. Note that the internal Acrobat JavaScript engine does not support unicode, so this may or may not work for you
Returns:
the JavaScript action

javaScript

public static PdfAction javaScript(String code,
                                   PdfWriter writer)
Creates a JavaScript action. If the JavaScript is smaller than 50 characters it will be place as a string, otherwise it will be placed as a compressed stream.

Parameters:
code - the JavaScript code
writer - the writer for this action
Returns:
the JavaScript action

createHide

static PdfAction createHide(PdfObject obj,
                            boolean hide)

createHide

public static PdfAction createHide(PdfAnnotation annot,
                                   boolean hide)

createHide

public static PdfAction createHide(String name,
                                   boolean hide)

buildArray

static PdfArray buildArray(Object[] names)

createHide

public static PdfAction createHide(Object[] names,
                                   boolean hide)

createSubmitForm

public static PdfAction createSubmitForm(String file,
                                         Object[] names,
                                         int flags)

createResetForm

public static PdfAction createResetForm(Object[] names,
                                        int flags)

createImportData

public static PdfAction createImportData(String file)

next

public void next(PdfAction na)
Add a chained action.

Parameters:
na - the next action

gotoLocalPage

public static PdfAction gotoLocalPage(int page,
                                      PdfDestination dest,
                                      PdfWriter writer)
Creates a GoTo action to an internal page.

Parameters:
page - the page to go. First page is 1
dest - the destination for the page
writer - the writer for this action
Returns:
a GoTo action