cete.dynamicpdf.documentreaderevents
DocumentReaderEvents
- Namespace: ceTe.DynamicPDF
- Assemblies: ceTe.DynamicPDF.40.dll
Represents document reader events.
public class DocumentReaderEvents
Public Class DocumentReaderEvents
Inheritance: Object → DocumentReaderEvents
Licensing
This class is a DynamicPDF Generator Enterprise Edition feature. One of the following licenses is required for non-evaluation usage:
- DynamicPDF Generator for .NET Enterprise Edition
- DynamicPDF Merger for .NET Enterprise Edition
- DynamicPDF ReportWriter for .NET Enterprise Edition
- DynamicPDF Core Suite for .NET Enterprise Edition
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;
class MyClass
{
static void Main(string[] args)
{
// 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(@"c:\MyDocument.pdf");
}
}
Constructors
DocumentReaderEvents()
Initializes a new instance of the DocumentReaderEvents class.
public DocumentReaderEvents()
Public Sub New ()
Properties
DidPrint
Gets or sets document did print event actions.
public JavaScriptAction DidPrint { get; set; }
Public Property DidPrint As JavaScriptAction
Property Value
DidSave
Gets or sets document did save event actions.
public JavaScriptAction DidSave { get; set; }
Public Property DidSave As JavaScriptAction
Property Value
WillClose
Gets or sets document will close event actions.
public JavaScriptAction WillClose { get; set; }
Public Property WillClose As JavaScriptAction
Property Value
WillPrint
Gets or sets document will print event actions.
public JavaScriptAction WillPrint { get; set; }
Public Property WillPrint As JavaScriptAction
Property Value
WillSave
Gets or sets document will save event actions.
public JavaScriptAction WillSave { get; set; }
Public Property WillSave As JavaScriptAction
Property Value
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
- obj: Object
The Object to compare with the current Object .
Returns
true if the specified Object is equal to the current Object ; otherwise, false.
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 .
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.
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 .