Skip to main content

DocumentReaderEvents

Version: 12.0

cete.dynamicpdf.documentreaderevents

DocumentReaderEvents​

Represents document reader events.

public class DocumentReaderEvents
Public Class DocumentReaderEvents

Inheritance: Object → DocumentReaderEvents

Licensing Info​

This class is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Examples​

The following example shows how to use document reader events.

Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements.Forms
Imports ceTe.DynamicPDF.PageElements

Module MyModule

Sub Main()

' Create a PDF Document
Dim MyDocument As Document = New Document()

' Create a page and add it to the document
Dim MyPage As Page = New Page()
MyDocument.Pages.Add(MyPage)

' Create labels and add it to the page
Dim MyLabel1 As Label = New Label("Document Additional Actions", 0, 50, 400, 50, Font.Courier, 20)
Dim MyLabel2 As Label = New Label("Enter some text in the text field and save the file to see the document action :", 0, 150, 400, 50, Font.Courier, 15)
MyPage.Elements.Add(MyLabel1)
MyPage.Elements.Add(MyLabel2)

' Create a text field and add it to the page
Dim MytextField As ceTe.DynamicPDF.PageElements.Forms.TextField = New ceTe.DynamicPDF.PageElements.Forms.TextField("Text1", 385, 155, 100, 30)
MyPage.Elements.Add(MytextField)

' Create a java script action and assign it to the document reader event.
Dim MyAction As JavaScriptAction = New JavaScriptAction("app.alert(""Hello your text Saved!!"")")
MyDocument.ReaderEvents.WillSave = MyAction

' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")

End Sub
End Module
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements.Forms;
using ceTe.DynamicPDF.PageElements;

public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();

// Create a page and add it to the document
Page page = new Page();
document.Pages.Add(page);

// Create labels and add it to the page
Label label1 = new Label("Document Additional Actions", 0, 50, 400, 50, Font.Courier, 20);
Label label2 = new Label("Enter some text in the text field and save the file to see the document action :", 0, 150, 400, 50, Font.Courier, 15);
page.Elements.Add(label1);
page.Elements.Add(label2);

// Create a text field and add it to the page
ceTe.DynamicPDF.PageElements.Forms.TextField textField = new ceTe.DynamicPDF.PageElements.Forms.TextField("Text1", 385, 155, 100, 30);
page.Elements.Add(textField);

// Create a java script action and assign it to the document reader event.
JavaScriptAction action = new JavaScriptAction("app.alert(\"Hello your text Saved!!\")");
document.ReaderEvents.WillSave = action;

// Save the PDF
document.Draw(outputPath);
}
}

Constructors​

DocumentReaderEvents()​

Initializes a new instance of the DocumentReaderEvents class.

public DocumentReaderEvents()
Public Sub New ()

Licensing Info​

This constructor is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Properties​

DidPrint​

Gets or sets document did print event actions.

public JavaScriptAction DidPrint { get; set; }
Public Property DidPrint As JavaScriptAction

Property Value​

JavaScriptAction

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

DidSave​

Gets or sets document did save event actions.

public JavaScriptAction DidSave { get; set; }
Public Property DidSave As JavaScriptAction

Property Value​

JavaScriptAction

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

WillClose​

Gets or sets document will close event actions.

public JavaScriptAction WillClose { get; set; }
Public Property WillClose As JavaScriptAction

Property Value​

JavaScriptAction

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

WillPrint​

Gets or sets document will print event actions.

public JavaScriptAction WillPrint { get; set; }
Public Property WillPrint As JavaScriptAction

Property Value​

JavaScriptAction

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

WillSave​

Gets or sets document will save event actions.

public JavaScriptAction WillSave { get; set; }
Public Property WillSave As JavaScriptAction

Property Value​

JavaScriptAction

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Methods​

Equals(Object)​

Determines whether the specified Object is equal to the current Object . (Inherited from Object)

public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean

Parameters​

The Object to compare with the current Object .

Returns​

true if the specified Object is equal to the current Object ; otherwise, false.

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

GetHashCode()​

Serves as a hash function for a particular type. (Inherited from Object)

public int GetHashCode()
Function GetHashCode() As Integer

Returns​

A hash code for the current Object .

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

GetType()​

Gets the Type of the current instance. (Inherited from Object)

public Type GetType()
Function GetType() As Type

Returns​

The Type instance that represents the exact runtime type of the current instance.

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

ToString()​

Returns a String that represents the current Object . (Inherited from Object)

public string ToString()
Function ToString() As String

Returns​

A String that represents the current Object .

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

See Also​

ceTe.DynamicPDF