PdfViewer.DocumentDisplayed Event
Occurs after the PDF document is displayed.
public event DocumentDisplayedEventHandler PdfViewer.DocumentDisplayed;
Public Event PdfViewer.DocumentDisplayed As DocumentDisplayedEventHandler
Event Handler
Licensing Info
This event is a DynamicPDF Viewer feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Viewer selected.
- A DynamicPDF Viewer for .NET v3.X Developer license.
Examples
This example shows, how to get displayed PDF document details using DocumentDisplayed event.Imports System
Imports System.Windows.Forms
Imports ceTe.DynamicPDF.Viewer
Public Class Form1
Inherits System.Windows.Forms.Form
Private MyPdfViewer As PdfViewer
Sub New()
InitializeComponent()
End Sub
Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
AddHandler MyPdfViewer.DocumentDisplayed, AddressOf MyPdfViewer_DocumentDisplayed
End Sub
Private Sub MyPdfViewer_DocumentDisplayed(ByVal sender As Object, ByVal e As ceTe.DynamicPDF.Viewer.DocumentDisplayedEventArgs)
' Get the displayed PDF document details.
Dim Author As String = e.Document.Author
Dim MyBookmarks As BookmarkList = e.Document.Bookmarks
Dim Creator As String = e.Document.Creator
Dim Keywords As String = e.Document.Keywords
Dim PageCount As Integer = e.Document.PageCount
Dim Producer As String = e.Document.Producer
Dim Subject As String = e.Document.Subject
Dim Title As String = e.Document.Title
End Sub
End Class
using System;
using System.Windows.Forms;
using ceTe.DynamicPDF.Viewer;
namespace DynamicPDFViewerDemo
{
public class Form1 : System.Windows.Forms.Form
{
private PdfViewer dpdfViewer;
public Form1()
{
InitializeComponent();
}
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void InitializeComponent()
{
this.dpdfViewer = new PdfViewer();
this.Controls.Add(dpdfViewer);
DocumentDisplayed += new ceTe.DynamicPDF.Viewer.DocumentDisplayedEventHandler(this.pdfViewer_DocumentDisplayed);
}
private void pdfViewer_DocumentDisplayed(object sender, ceTe.DynamicPDF.Viewer.DocumentDisplayedEventArgs e)
{
// Get the displayed PDF document details.
string Author = e.Document.Author;
BookmarkList Bookmarks = e.Document.Bookmarks;
string Creator = e.Document.Creator;
string Keywords = e.Document.Keywords;
int PageCount = e.Document.PageCount;
string Producer = e.Document.Producer;
string Subject = e.Document.Subject;
string Title = e.Document.Title;
}
}
}