This is a migrated thread and some comments may be shown as answers.
Customize Print Preview dialog
4 Answers 32 Views
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 21 Apr 2018, 09:58 PM

Hi, is it possible to customize the size and content of the print preview window?

 

thanks

4 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 23 Apr 2018, 09:49 AM
Hello Karen,

First, you need to make a form that inherits PdfPrintPreviewDialog which will allow you to see the default dialog at design time. Then you can use your dialog with the following code:
private void radButton1_Click(object sender, EventArgs e)
{
    RadPrintDocument document = new RadPrintDocument();
    document.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(0, 0, 0, 0);
    document.AssociatedObject = radPdfViewer1;
    PdfPrintPreviewDialog dialog = new PdfPrintPreviewDialog(document);
 
   
    if (dialog.DialogResult != DialogResult.Abort)
    {
        dialog.ShowDialog();
    }
 
    dialog.Dispose();
}

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
David
Top achievements
Rank 1
answered on 24 May 2018, 07:06 PM

OK, I have the viewer navigator using my form as follows:

in the user control that holds the pdf viewer:

radPdfViewerNavigator1.PrintButton.MouseDown += PrintButton_MouseDown;

in that event I have to code you posted, but referencing my new form

uvtPrintViewDialog dialog = new uvtPrintViewDialog(document);

My form has a constructor that takes the document:

  public uvtPrintViewDialog(RadPrintDocument printDocument) : base(printDocument)
        {
            InitializeComponent();
        }

And it shows my form. So that is great ;)

But my issue now is, all of the controls on the form are locked. all I want to do is make them bigger, hide the watermark button, some simple stuff. 

 

 

 

 

0
Dimitar
Telerik team
answered on 25 May 2018, 08:29 AM
Hi Karen,

Yes, currently all controls are declared private in the main form and the only way to change them would be in the code behind. I have logged this for improvement in our Feedback Portal. You can track its progress, subscribe to status changes and add your comment to it here. I have also updated your Telerik Points.

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
David
Top achievements
Rank 1
answered on 25 May 2018, 04:26 PM

Thanks!

Asked by
David
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
David
Top achievements
Rank 1
Share this question
or