Unplanned
Last Updated: 09 Apr 2024 05:57 by Tino
Tino
Created on: 09 Apr 2024 05:57
Category: PdfViewer
Type: Bug Report
0
RadPdfViewer: InvalidOperationException when searching inside a document with no pages with the RadPdfViewerNavigator

Steps to reproduce:

1. Load a PDF document with 0 pages

2. Enter some text in the search textbox and click the next/prev buttons

Expected: the search textbox should be either disabled or should ignore any search operation

Actual: an error occurs

Workaround:

    Private Sub pdf_Viewer_DocumentLoaded(sender As Object, e As EventArgs)
        If pdf_Viewer.Document.Pages.Count = 0 Then
            pdf_Toolbar.SearchTextBox.Enabled = False
            pdf_Toolbar.NextButton.Enabled = False
            pdf_Toolbar.PreviousButton.Enabled = False
        Else
            pdf_Toolbar.SearchTextBox.Enabled = True
            pdf_Toolbar.NextButton.Enabled = True
            pdf_Toolbar.PreviousButton.Enabled = True
        End If
    End Sub

 

0 comments