PDFViewer ScaleFactor

2 posts, 0 answers
  1. Tarik
    Tarik avatar
    12 posts
    Member since:
    May 2015

    Posted 07 Sep 2015 Link to this post


     I am trying integrating a rad PDFViewer which show a pdf generated in a Stream to print it, at first, i would like to show the pdf document with a scalefactor of 0.5 and give the user the possibility to increase or decrease the zoom. In way to perform that, i added a RadSlider and bound the scalefactor of the pdf viewer with the value of the rad slider like show the code below (The problem i encounter is that the scalefactor is initially set to 1, however the pdf viewer width allow to show the 0.5 scale value) : 

    <telerik:RadPdfViewer x:Name="pdfViewer"
                          DocumentSource="{Binding Document,
                          ScaleFactor="{Binding ElementName=ZoomSlider,
                          ScrollViewer.VerticalScrollBarVisibility="Auto" />

    Then the code of the RadSlider:

    <telerik:RadSlider x:Name="ZoomSlider"
                    <TextBlock Text="{Binding}" />

  2. Nikolay Demirev
    Nikolay Demirev avatar
    102 posts

    Posted 10 Sep 2015 Link to this post

    Hi Tarik,

    When the document of the RadPdfViewer is changed the ScaleFactor is set to the default scale factor value of 1. If you want the initial scale factor to be 0.5 you could attach to DocumentChanged event of the RadPdfViewer and change it after setting its document.

    Another approach is to bind the scale factor using your ViewModel and after setting the Document property of the view model to set the ScaleFactor property to 0.5.

    I hope this helps.

    Nikolay Demirev
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
Back to Top