phpdftk API Documentation

Action
in package

FinalYes

Static factory for the most common PDF action types. Each method returns an `Action` subclass ready to be assigned to `Catalog::$openAction`, an annotation's `/A` entry, or a form field's `/AA` (additional actions) dict.

For action types not covered here, construct the relevant Phpdftk\Pdf\Core\Action\* class directly.

Table of Contents

Methods

goTo()  : GoToAction
GoTo action — jump to an explicit destination within this document.
goToRemote()  : GoToRAction
GoToR (Go-to-remote) — jump to a destination in another PDF.
javascript()  : JavaScriptAction
JavaScript action — execute the given source string when triggered.
launch()  : LaunchAction
Launch action — run an application or open a file via the platform's default handler.
namedAction()  : NamedAction
Named action — one of the four predefined names (`NextPage`, `PrevPage`, `FirstPage`, `LastPage`) or a viewer-specific extension.
resetForm()  : ResetFormAction
Reset-form action — clear form field values to their defaults.
submitForm()  : SubmitFormAction
Submit-form action — post form field values to an HTTP endpoint.
uri()  : URIAction
URI action — open a URL in the user's browser.

Methods

goToRemote()

GoToR (Go-to-remote) — jump to a destination in another PDF.

public static goToRemote(string $file, Destination|PdfReference|string $dest) : GoToRAction

$dest may be a destination array, a name string referring to a named destination, or a Destination value object.

Parameters
$file : string
$dest : Destination|PdfReference|string
Return values
GoToRAction

javascript()

JavaScript action — execute the given source string when triggered.

public static javascript(string $code) : JavaScriptAction
Parameters
$code : string
Return values
JavaScriptAction

launch()

Launch action — run an application or open a file via the platform's default handler.

public static launch(string $file) : LaunchAction
Parameters
$file : string
Return values
LaunchAction

namedAction()

Named action — one of the four predefined names (`NextPage`, `PrevPage`, `FirstPage`, `LastPage`) or a viewer-specific extension.

public static namedAction(string $name) : NamedAction
Parameters
$name : string
Return values
NamedAction

resetForm()

Reset-form action — clear form field values to their defaults.

public static resetForm([array<int, string>|null $fields = null ][, bool $includeExclude = false ]) : ResetFormAction

$fields is an optional list of field names; null resets all. $includeExclude controls /Flags bit 1 (true = include, false = exclude).

Parameters
$fields : array<int, string>|null = null
$includeExclude : bool = false
Return values
ResetFormAction

submitForm()

Submit-form action — post form field values to an HTTP endpoint.

public static submitForm(string $url) : SubmitFormAction
Parameters
$url : string
Return values
SubmitFormAction

uri()

URI action — open a URL in the user's browser.

public static uri(string $url) : URIAction
Parameters
$url : string
Return values
URIAction

        
On this page

Search results