Pdfkit options pdf#
The following code sample generates a PDF document so that a text field is filled with the current date just before it is printed.
Typical usage includes setting a text field value after clicking a button or showing/hiding a field after entering/leaving a form field. A PDF document is fully scriptable on the client side. This action executes JavaScript against the current document. This action lets you import an FDF file by specifying the path. This action hides or shows one or more annotations or fields. The NamedDestination class lets you specify a destination by specifying the name of a destination in this collection. Named destinationĬlass Document has a property called NamedDestinations which is a collection of name-destination pairs. You can also specify additional settings such as zoom factor and the exact scroll position after jumping to the location. It is specified by the path of the PDF document and a page index. The RemoteDestination points to a page in an external PDF document. It is possible to specify the exact location of the viewer, the zoom factor and the way that the page is displayed. The InternalDestination points to a page inside the same document. The following types of destinations exist. The destination is set by assigning the GoToAction.Destination property. All actions in the collection are executed in order. Note that all properties are of type ActionCollection. The URL and submit options such as the format can be specified as properties of this action. SubmitFormAction: Submits the form data to a given destination. ResetFormAction: reset all form fields in the document to their default value FormActionįormAction is the abstract base class of the following actions:
Widget.MouseUpActions: These actions are executed when the mouse button is released while the pointer is inside the widgetīookmark.Actions: These actions are executed when the bookmark is selected Widget.MouseExitActions: These actions are executed when the mouse pointer leaves the widget Widget.MouseEntrerActions: These actions are executed when the mouse pointer enters the widget
Widget.MouseDownActions: These actions are executed when the mouse button is pressed while the pointer is inside the widget Widget.LostFocusActions: These actions are executed when the widget loses keyboard focus Widget.GotFocusActions: These actions are executed when the widget receives keyboard focus Link.MouseUpActions: These actions are executed when the mouse button is released while the pointer is inside the link The properties correspond to events.ĭocument.OpenActions: These actions are executed after the document has been openedĭocument.AfterPrint: These actions are executed after the document has been printedĭocument.AfterSave: These actions are executed after the document has been savedĭocument.BeforeClose: These actions are executed before the document is closedĭocument.BeforePrint: These actions are executed before the document is printedĭocument.BeforeSave: These actions are executed before the document has been saved The following properties are of type Action. It is the responsibility of the PDF reader to execute the actions that are associated with an event whenever the event occurs. JavaScriptAction: Perform scripted operations against the document (Professional edition only)Įach action type is discussed in detail below. GoToAction: Jump to a destination in the same document or to a page in another PDF document These actions are provided through the Action class and its specializations. PDF allows you to associate actions with events.