Customize Print Preview dialog

5 posts, 0 answers
  1. Karen
    Karen avatar
    8 posts
    Member since:
    Dec 2017

    Posted 21 Apr 2018 Link to this post

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

     

    thanks

  2. Dimitar
    Admin
    Dimitar avatar
    2743 posts

    Posted 23 Apr 2018 Link to this post

    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.
  3. Karen
    Karen avatar
    8 posts
    Member since:
    Dec 2017

    Posted 24 May 2018 Link to this post

    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. 

     

     

     

     

  4. Dimitar
    Admin
    Dimitar avatar
    2743 posts

    Posted 25 May 2018 Link to this post

    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.
  5. Karen
    Karen avatar
    8 posts
    Member since:
    Dec 2017

    Posted 25 May 2018 in reply to Dimitar Link to this post

    Thanks!

Back to Top