RadPdfViewerNavigator buttons always enabled

1 Answer 63 Views
PdfViewer and PdfViewerNavigator
Giovanni
Top achievements
Rank 1
Iron
Iron
Iron
Giovanni asked on 30 Oct 2023, 01:57 PM

Hi, I'm using a RadPdfViewer to show a document, and a RadPdfViewerNavigator associated with him.

I have 2 questions:

1) I've noticed that even if the pdf document is not loaded in the RadPdfViewer control, all buttons in the RadPdfViewerNavigator are enbaled, then the user can click on some button and I tthink this is not correct (further, the application can crash if he clicks for example, on the rotate button). Is there a way to tells that to the RadPdfViewerNavigator to enable/disable buttons in base of loaded document, or I need to do it programmatically?
2) The print preview form is very well and powerful, but I've noticed that it is very slow to move from a page to another... It can be a problem on my own, or it is by design?

Thank you for any assistance.

 

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 02 Nov 2023, 09:52 AM

Hi, Giovanni,

Indeed, the button elements are always enabled in RadPdfViewerNavigator even though you may not have  a loaded document in RadPdfViewer. Please note that one of the buttons allows you to open a document which is good to beenabled for the user. The possible solution that I can suggest is to disable the navigator by default. Then, handle the DocumentLoaded event that RadPdfViewer offers and enable the navigator once the event gets fired. I have prepared a sample code snippet for your reference:

        string filePath;
        public Form1()
        {
            InitializeComponent();

            this.radPdfViewerNavigator1.Enabled = false;
            radPdfViewer1.DocumentLoaded += RadPdfViewer1_DocumentLoaded;
           
        }
        private void RadPdfViewer1_DocumentLoaded(object sender, EventArgs e)
        {
            this.radPdfViewerNavigator1.Enabled = true;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            filePath = @"..\..\TestForm1.pdf";
            radPdfViewer1.LoadDocument(filePath);
        }

As to the print preview performance, I believe that it depends on the document that is being loaded in the viewer. Would it be possible to provide a document which demonstrates the print preview slow loading  you are facing?

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Giovanni
Top achievements
Rank 1
Iron
Iron
Iron
commented on 02 Nov 2023, 02:21 PM

Hi Dess, thank you.

Thank you for the enable/disable explanation.

About the print preview performance please consider the attached sample pdf file and the video, where you can see that after a click on the button print I have to wait abaut 3 seconds to see the preview form open and then, after click on the next page button I have to wait 1 or 2 second per page.

Dess | Tech Support Engineer, Principal
Telerik team
commented on 07 Nov 2023, 12:30 PM

Hi, Giovanni,

Thank you for the provided pdf document and video illustrating the behavior on your side. Indeed, the video shows that in the print preview when you move to the next page, it takes a few seconds to load the content on the page. However, when navigating the pages in the viewer, it is almost instantly. 

I believe that we can accomplish at least the same performance when navigating the pages in the PdfPrintPreviewDialog. 

I have logged it in our feedback portal by creating a public thread on your behalf. You can track its progress, subscribe for status changes, and add your comments on the following link - feedback item.

I have also updated your Telerik points.

We will investigate the possible options for improving the pages navigation.

Tags
PdfViewer and PdfViewerNavigator
Asked by
Giovanni
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or