PdfViewer.ExceptionOccurred Event
Occurs before the PDF file is opened.
public event ExceptionOccurredEventHandler PdfViewer.ExceptionOccurred;
Public Event PdfViewer.ExceptionOccurred As ExceptionOccurredEventHandler
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 cancel a PDF file open using the FileOpening event.Imports System.Windows.Forms
Imports ceTe.DynamicPDF.Viewer
Namespace DynamicPDFViewerDemo
Public Class Form1
Inherits Form
Private dpdfViewer As PdfViewer
Public Sub New()
InitializeComponent()
End Sub
Public Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.dpdfViewer = New PdfViewer()
Me.Controls.Add(dpdfViewer)
AddHandler Me.ExceptionOccurred, New ExceptionOccurredEventHandler(AddressOf pdfViewer_ExceptionOccurred)
End Sub
Private Sub pdfViewer_ExceptionOccurred(sender As Object, e As ExceptionOccurredEventArgs)
MessageBox.Show(e.Exception.Message)
End Sub
End Class
End Namespace
using System;
using System.Windows.Forms;
using ceTe.DynamicPDF.Viewer;
namespace DynamicPDFViewerDemo
{
public class Form1 : 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);
this.ExceptionOccurred += pdfViewer_ExceptionOccurred;
}
void pdfViewer_ExceptionOccurred(object sender, ExceptionOccurredEventArgs e)
{
MessageBox.Show(e.Exception.Message);
}
}
}