DocumentReaderEvents

Represents document reader events.

public class DocumentReaderEvents
Public Class DocumentReaderEvents

Inheritance: ObjectDocumentReaderEvents

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.

Properties

DidPrintGets or sets document did print event actions.
DidSaveGets or sets document did save event actions.
WillCloseGets or sets document will close event actions.
WillPrintGets or sets document will print event actions.
WillSaveGets or sets document will save event actions.

Methods

Equals(Object)Determines whether the specified Object is equal to the current Object .
(Inherited from Object)
GetHashCode()Serves as a hash function for a particular type.
(Inherited from Object)
GetType()Gets the Type of the current instance.
(Inherited from Object)
ToString()Returns a String that represents the current Object .
(Inherited from Object)

See Also

ceTe.DynamicPDF

In this topic