This is a migrated thread and some comments may be shown as answers.

Hide Vertical Scrollbar

2 Answers 181 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
Andreas Decke
Top achievements
Rank 1
Andreas Decke asked on 15 Feb 2018, 09:53 PM

Hello,
I only want to display the first page of a PDF document. In addition, the vertical scrollbar should be permanently invisible. Is that possible?

2 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 20 Feb 2018, 01:06 PM
Hello Andreas Decke,

You may try using RadPdfViewer's DocumentChanged event. In its event handler implementation, you may remove all pages except the first one and set the ScaleMode to FitToPage so that the scroll bars are invisible. The following code shows a sample implementation of such event handler:
private void RadPdfViewer_DocumentChanged(object sender, DocumentChangedEventArgs e)
{
    RadPdfViewer radPdfViewer = (RadPdfViewer)sender;
    RadFixedDocument document = radPdfViewer.Document;
 
    if (document != null)
    {
        foreach (RadFixedPage page in document.Pages.Skip(1).ToArray())
        {
            document.Pages.Remove(page);
        }
 
        radPdfViewer.ScaleMode = ScaleMode.FitToPage;
    }
}

I hope this is helpful.

Regards,
Deyan
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Andreas Decke
Top achievements
Rank 1
answered on 21 Feb 2018, 08:42 AM
Perfect
That's exactly what I imagined, thank you.
Tags
PDFViewer
Asked by
Andreas Decke
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Andreas Decke
Top achievements
Rank 1
Share this question
or