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

PDF Viewer Margin Printer Setting have no effect

2 Answers 178 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
Kenneth
Top achievements
Rank 2
Iron
Kenneth asked on 21 Oct 2016, 03:03 PM

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

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 Answers, 1 is accepted

Sort by
0
Kenneth
Top achievements
Rank 2
Iron
answered on 21 Oct 2016, 03:48 PM

RESOLVED

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. 

0
Deyan
Telerik team
answered on 25 Oct 2016, 01:00 PM
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.

Regards,
Deyan
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
PDFViewer
Asked by
Kenneth
Top achievements
Rank 2
Iron
Answers by
Kenneth
Top achievements
Rank 2
Iron
Deyan
Telerik team
Share this question
or