PDF Viewer Margin Printer Setting have no effect

3 posts, 0 answers
  1. Kenneth
    Kenneth avatar
    104 posts
    Member since:
    Apr 2014

    Posted 21 Oct 2016 Link to this post

            Dim ps As New PrintSettings()
            ps.PageMargins = New Thickness(0)

    When I use Adobe reader to print a form the page margins are smaller than when I use the Telerik pdfViewer to print,

    The laser printer I'm using supports a minimum of 1/4 inch margins all around, and the adobe reader seems to be using this 1/4".

    The telerik control seems to be suing about 1/2", making the document appear smaller on the printed page.

    I tried setting the margins as above to various thickness, 50, 25, 0, each prints the page the same way.

    To print I'm using the rad tool bar as per the example in pdfviwer firstlook.

    Am I doing something wrong in how I'm setting the margin?  I tried to set it both before and after the document was loaded, which I load from a stream.


  2. Kenneth
    Kenneth avatar
    104 posts
    Member since:
    Apr 2014

    Posted 21 Oct 2016 in reply to Kenneth Link to this post


    The code above works but it needs to be called from the rad toolbar's print button.

    I was calling it in page load (which incidentally did not print anything) then to print I was using the default wired print button of the rad toolbar, which now I understand uses the default margins. 

  3. Deyan
    Deyan avatar
    171 posts

    Posted 25 Oct 2016 Link to this post

    Hello Kenneth,

    As you have found out when you bind the print button to default RadPdfViewer's print command then the default PrintSettings are used. If you need to change the print settings as mentioned in this documentation section then you should call the code from a button click interaction. Due to Silverlight limitations when the Print method is not user-initiated then a SecurityException is thrown.

    If you have other questions or concerns please do not hesitate to contact us again.

    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top