Skip to main content

PageReaderEvents

Version: 9.0

cete.dynamicpdf.pagereaderevents

PageReaderEvents​

Represents page reader events.

public class PageReaderEvents
Public Class PageReaderEvents

Inheritance: Object → PageReaderEvents

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 page reader events.

Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements

Module MyModule

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

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

' Create labels and add it to the page
Dim MyLabel1 As Label = New Label("Page Additional Actions", 50, 50, 400, 50, Font.Courier, 20)
Dim MyLabel2 As Label = New Label("Go to the second page to see the page open action", 50, 150, 300, 50, Font.Courier, 15)
Dim MyLabel3 As Label = New Label("Second page", 50, 100, 300, 50, Font.Courier, 15)
MyPage.Elements.Add(MyLabel1)
MyPage.Elements.Add(MyLabel2)
MyPage.Elements.Add(MyLabel3)

' Create a java script action and assign to the page reader event.
Dim MyAction As JavaScriptAction = New JavaScriptAction("app.alert(\"Welcome to the second page!!\")")
MyPage1.ReaderEvents.Open = MyAction

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

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

class MyClass
{
static void Main(string[] args)
{
// Create a PDF Document
Document document = new Document();

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

// Create labels and add it to the page
Label label1 = new Label("Page Additional Actions", 50, 50, 400, 50, Font.Courier, 20);
Label label2 = new Label("Go to the second page to see the page open action", 50, 150, 300, 50, Font.Courier, 15);
Label label3 = new Label("Second page", 50, 100, 300, 50, Font.Courier, 15);
page.Elements.Add(label1);
page.Elements.Add(label2);
page1.Elements.Add(label3);

// Create a java script action and assign to the page reader event.
JavaScriptAction action = new JavaScriptAction("app.alert(\"Welcome to the second page!!\")");
page1.ReaderEvents.Open = action;

// Save the PDF
document.Draw(@"c:\MyDocument.pdf");
}
}

Constructors​

PageReaderEvents()​

Initializes a new instance of the PageReaderEvents class.

public PageReaderEvents()
Public Sub New ()

Properties​

Close​

Gets or sets page close event actions.

public OutlineAnnotationAction Close { get; set; }
Public Property Close As OutlineAnnotationAction

Property Value​

OutlineAnnotationAction

Open​

Gets or sets page open event actions.

public OutlineAnnotationAction Open { get; set; }
Public Property Open As OutlineAnnotationAction

Property Value​

OutlineAnnotationAction

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.

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 .

See Also​

ceTe.DynamicPDF