setasign\SetaPDF2\Core\Document\Action
JavaScriptAction Class representing a JavaScript action
File: /SetaPDF v2/Core/Document/Action/JavaScriptAction.php
Old class name (alias):
\SetaPDF_Core_Document_Action_JavaScript
Execute a JavaScript script. See PDF 32000-1:2008 - 12.6.4.16
Class hierarchy
Summary
Properties
Static Methods
byObjectOrDictionary()
Creates an action object by an action dictionary.
Parameters
- $objectOrDictionary : \setasign\SetaPDF2\Core\Type\PdfIndirectObject|\setasign\SetaPDF2\Core\Type\PdfIndirectReference|\setasign\SetaPDF2\Core\Type\PdfDictionary
Exceptions
Throws \setasign\SetaPDF2\Core\Type\Exception
Throws \InvalidArgumentException
createActionDictionary()
Create a JavaScript Action dictionary.
Parameters
- $javaScript : string|\setasign\SetaPDF2\Core\Type\PdfString|\setasign\SetaPDF2\Core\Type\PdfHexString|\setasign\SetaPDF2\Core\Type\PdfStream
Exceptions
Throws \InvalidArgumentException
Methods
__construct()
The constructor.
Parameters
- $objectOrDictionary : string|\setasign\SetaPDF2\Core\Type\PdfDictionary|\setasign\SetaPDF2\Core\Type\IndirectObjectInterface
Exceptions
Throws \InvalidArgumentException
getIndirectObject()
Get the indirect object of this annotation or creates it in the specific document context.
Parameters
- $document : ?\setasign\SetaPDF2\Core\Document
The document instance
getJavaScript()
Get the JavaScript code.
Parameters
- $encoding : string
The expected encoding of the JavaScript code.
getNext()
Gets the PDF value of the next entry.
setIndirectObject()
Set the indirect object of this annotation.
Parameters
- $indirectReference : \setasign\SetaPDF2\Core\Type\IndirectObjectInterface
setJavaScript()
Set the JavaScript code.
Parameters
- $javaScript : string
JavaScript in either PDFDocEncoding or UTF-16BE including BOM.
setNext()
Set the next action which should be executed after this one.