Class PdfAction
- Namespace
- iTextSharp.text.pdf
- Assembly
- iTextSharp.LGPLv2.Core.dll
A PdfAction defines an action that can be triggered from a PDF file. @see PdfDictionary
public class PdfAction : PdfDictionary
- Inheritance
-
PdfAction
- Inherited Members
Constructors
PdfAction()
Create an empty action.
public PdfAction()
PdfAction(int)
Constructs a new PdfAction of Subtype GoToR.
public PdfAction(int named)
Parameters
named
intthe named destination to go to
PdfAction(string)
Constructs a new PdfAction of Subtype URI.
public PdfAction(string url)
Parameters
url
stringthe url to go to
PdfAction(string, bool)
public PdfAction(string url, bool isMap)
Parameters
PdfAction(string, int)
public PdfAction(string filename, int page)
Parameters
PdfAction(string, string)
Constructs a new PdfAction of Subtype GoTo.
public PdfAction(string filename, string name)
Parameters
PdfAction(string, string, string, string)
Launchs an application or a document. It can be null . "print" - Print a document. It can be null . It can be null .
public PdfAction(string application, string parameters, string operation, string defaultDir)
Parameters
application
stringthe application to be launched or the document to be opened or printed.
parameters
string(Windows-specific) A parameter string to be passed to the application.
operation
string(Windows-specific) the operation to perform: "open" - Open a document,
defaultDir
string(Windows-specific) the default directory in standard DOS syntax.
PdfAction(Uri)
Constructs a new PdfAction of Subtype URI.
public PdfAction(Uri url)
Parameters
url
Urithe Url to go to
PdfAction(Uri, bool)
public PdfAction(Uri url, bool isMap)
Parameters
url
UriisMap
bool
Fields
FIRSTPAGE
A named action to go to the first page.
public const int FIRSTPAGE = 1
Field Value
LASTPAGE
A named action to go to the last page.
public const int LASTPAGE = 4
Field Value
NEXTPAGE
A named action to go to the next page.
public const int NEXTPAGE = 3
Field Value
PREVPAGE
A named action to go to the previous page.
public const int PREVPAGE = 2
Field Value
PRINTDIALOG
A named action to open a print dialog.
public const int PRINTDIALOG = 5
Field Value
RESET_EXCLUDE
a possible submitvalue
public const int RESET_EXCLUDE = 1
Field Value
SUBMIT_CANONICAL_FORMAT
a possible submitvalue
public const int SUBMIT_CANONICAL_FORMAT = 512
Field Value
SUBMIT_COORDINATES
public const int SUBMIT_COORDINATES = 16
Field Value
SUBMIT_EMBED_FORM
a possible submitvalue
public const int SUBMIT_EMBED_FORM = 8196
Field Value
SUBMIT_EXCLUDE
constructors
public const int SUBMIT_EXCLUDE = 1
Field Value
SUBMIT_EXCL_F_KEY
a possible submitvalue
public const int SUBMIT_EXCL_F_KEY = 2048
Field Value
SUBMIT_EXCL_NON_USER_ANNOTS
a possible submitvalue
public const int SUBMIT_EXCL_NON_USER_ANNOTS = 1024
Field Value
SUBMIT_HTML_FORMAT
public const int SUBMIT_HTML_FORMAT = 4
Field Value
SUBMIT_HTML_GET
public const int SUBMIT_HTML_GET = 8
Field Value
SUBMIT_INCLUDE_ANNOTATIONS
a possible submitvalue
public const int SUBMIT_INCLUDE_ANNOTATIONS = 128
Field Value
SUBMIT_INCLUDE_APPEND_SAVES
a possible submitvalue
public const int SUBMIT_INCLUDE_APPEND_SAVES = 64
Field Value
SUBMIT_INCLUDE_NO_VALUE_FIELDS
public const int SUBMIT_INCLUDE_NO_VALUE_FIELDS = 2
Field Value
SUBMIT_PDF
a possible submitvalue
public const int SUBMIT_PDF = 256
Field Value
SUBMIT_XFDF
a possible submitvalue
public const int SUBMIT_XFDF = 32
Field Value
Methods
CreateHide(object[], bool)
public static PdfAction CreateHide(object[] names, bool hide)
Parameters
Returns
CreateHide(string, bool)
public static PdfAction CreateHide(string name, bool hide)
Parameters
Returns
CreateHide(PdfAnnotation, bool)
public static PdfAction CreateHide(PdfAnnotation annot, bool hide)
Parameters
annot
PdfAnnotationhide
bool
Returns
CreateImportData(string)
public static PdfAction CreateImportData(string file)
Parameters
file
string
Returns
CreateLaunch(string, string, string, string)
Launchs an application or a document. It can be null . "print" - Print a document. It can be null . It can be null .
public static PdfAction CreateLaunch(string application, string parameters, string operation, string defaultDir)
Parameters
application
stringthe application to be launched or the document to be opened or printed.
parameters
string(Windows-specific) A parameter string to be passed to the application.
operation
string(Windows-specific) the operation to perform: "open" - Open a document,
defaultDir
string(Windows-specific) the default directory in standard DOS syntax.
Returns
- PdfAction
a Launch action
CreateResetForm(object[], int)
public static PdfAction CreateResetForm(object[] names, int flags)
Parameters
Returns
CreateSubmitForm(string, object[], int)
public static PdfAction CreateSubmitForm(string file, object[] names, int flags)
Parameters
Returns
GotoEmbedded(string, PdfTargetDictionary, string, bool, bool)
Creates a GoToE action to an embedded file.
public static PdfAction GotoEmbedded(string filename, PdfTargetDictionary target, string dest, bool isName, bool newWindow)
Parameters
filename
stringthe root document of the target (null if the target is in the same document)
target
PdfTargetDictionarydest
stringthe named destination
isName
boolif true sets the destination as a name, if false sets it as a String
newWindow
bool
Returns
- PdfAction
a GoToE action
GotoEmbedded(string, PdfTargetDictionary, PdfObject, bool)
Creates a GoToE action to an embedded file.
public static PdfAction GotoEmbedded(string filename, PdfTargetDictionary target, PdfObject dest, bool newWindow)
Parameters
filename
stringthe root document of the target (null if the target is in the same document)
target
PdfTargetDictionarya path to the target document of this action
dest
PdfObjectthe destination inside the target document, can be of type PdfDestination, PdfName, or PdfString
newWindow
boolif true, the destination document should be opened in a new window
Returns
- PdfAction
a GoToE action
GotoLocalPage(int, PdfDestination, PdfWriter)
Creates a GoTo action to an internal page.
public static PdfAction GotoLocalPage(int page, PdfDestination dest, PdfWriter writer)
Parameters
page
intthe page to go. First page is 1
dest
PdfDestinationthe destination for the page
writer
PdfWriterthe writer for this action
Returns
- PdfAction
a GoTo action
GotoLocalPage(string, bool)
Creates a GoTo action to a named destination.
public static PdfAction GotoLocalPage(string dest, bool isName)
Parameters
dest
stringthe named destination
isName
boolif true sets the destination as a name, if false sets it as a String
Returns
- PdfAction
a GoToR action
GotoRemotePage(string, string, bool, bool)
Creates a GoToR action to a named destination.
public static PdfAction GotoRemotePage(string filename, string dest, bool isName, bool newWindow)
Parameters
filename
stringthe file name to go to
dest
stringthe destination name
isName
boolif true sets the destination as a name, if false sets it as a String
newWindow
boolopen the document in a new window if true , if false the current document is replaced by the new document.
Returns
- PdfAction
a GoToR action
JavaScript(string, PdfWriter)
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.
public static PdfAction JavaScript(string code, PdfWriter writer)
Parameters
Returns
- PdfAction
the JavaScript action
JavaScript(string, PdfWriter, bool)
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. Acrobat JavaScript engine does not support unicode, so this may or may not work for you
public static PdfAction JavaScript(string code, PdfWriter writer, bool unicode)
Parameters
code
stringthe JavaScript code
writer
PdfWriterthe writer for this action
unicode
boolselect JavaScript unicode. Note that the internal
Returns
- PdfAction
the JavaScript action
Next(PdfAction)
Add a chained action.
public void Next(PdfAction na)
Parameters
na
PdfActionthe next action
Rendition(string, PdfFileSpecification, string, PdfIndirectReference)
Creates a Rendition action @throws IOException
public static PdfAction Rendition(string file, PdfFileSpecification fs, string mimeType, PdfIndirectReference refi)
Parameters
file
stringfs
PdfFileSpecificationmimeType
stringrefi
PdfIndirectReference
Returns
- PdfAction
a Media Clip action
SetOcGstate(IList<object>, bool)
A set-OCG-state action (PDF 1.5) sets the state of one or more optional content groups. or String (ON, OFF, or Toggle) followed by one or more optional content group dictionaries PdfLayer or a PdfIndirectReference to a PdfLayer . The array elements are processed from left to right; each name is applied to the subsequent groups until the next name is encountered: ON sets the state of subsequent groups to ON OFF sets the state of subsequent groups to OFF Toggle reverses the state of subsequent groups content groups (as specified by the RBGroups entry in the current configuration dictionary) should be preserved when the states in the state array are applied. That is, if a group is set to ON (either by ON or Toggle) during processing of the state array, any other groups belong to the same radio-button group are turned OFF. If a group is set to OFF, there is no effect on other groups. If false , radio-button state relationships, if any, are ignored
public static PdfAction SetOcGstate(IList<object> state, bool preserveRb)
Parameters
state
IList<object>an array consisting of any number of sequences beginning with a PdfName
preserveRb
boolif true , indicates that radio-button state relationships between optional
Returns
- PdfAction
the action