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

Set specific zoom percentage.

1 Answer 603 Views
PdfViewer
This is a migrated thread and some comments may be shown as answers.
Brete
Top achievements
Rank 1
Brete asked on 16 Mar 2020, 06:46 PM

Is it possible to set a specific zoom percentage, when/as a pdf is loading or to set the Default zoom to "Fit to Width" ?  

 

I looked in the Documentation and saw nothing about adjusting the default zoom.  

 

 

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 17 Mar 2020, 07:23 AM

Hi Brete,

You can set the desired zoom level to the Scale property of the PDF Viewer, so it will be applied when a new file is loaded:

        <telerik:RadPdfViewer runat="server" ID="RadPdfViewer1" Height="550px" Width="100%" Scale="0.9"> ...

You can also set the zoom level on the client-side in the Render handler of the controls. You can do it by using the underlying Kendo UI widget's API like follows:

        <script>
            var firstRender = true;

            function onRender(viewer, args) {
                var viewerWidget = viewer.get_kendoWidget();
                debugger;
                if (firstRender) {
                    viewerWidget.toolbar.zoom.combobox.value("fitToWidth");
                    viewerWidget.toolbar.zoom.combobox.trigger("change");
                    firstRender = false;
                }
            }
        </script>
        <telerik:RadPdfViewer runat="server" ID="RadPdfViewer1" Height="550px" Width="100%">
            <ClientEvents OnRender="onRender" />
            <PdfjsProcessingSettings File="test.pdf"></PdfjsProcessingSettings>
        </telerik:RadPdfViewer>

Regards,
Vessy
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
Tags
PdfViewer
Asked by
Brete
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or