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

Hide Print Settings on PdfViewerNavigator

1 Answer 78 Views
PdfViewer and PdfViewerNavigator
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 15 Mar 2018, 06:38 AM

I can hide the print preview using this code 

radPdfViewerNavigator1.ShowPrintPreview = false;

but how can I hide print preview on the picture shown. Thanks

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 15 Mar 2018, 01:16 PM
Hello, Richard, 

Thank you for writing.  

When you set the ShowPrintPreview property to false the print preview dialog is not shown at all. However, if you need to hide the Print Settings button in the print preview dialog you can use the following code snippet for custom RadPdfViewer implementation: 
  
public class CustomPdfView : RadPdfViewer
{
    protected override RadPdfViewerElement CreateViewerElement()
    {
        return new CustomRadPdfViewerElement();
    }
}
 
public class CustomRadPdfViewerElement : RadPdfViewerElement
{
    public CustomRadPdfViewerElement()
    {
    }
 
    public override void PrintPreview(RadPrintDocument document)
    {
        if (document != null)
        {
            document.AssociatedObject = this;
            PdfPrintPreviewDialog dialog = new PdfPrintPreviewDialog(document);
            dialog.Controls["radGroupBoxSettings"].Controls["radButtonSettings"].Visible = false;
            dialog.ThemeName = ((RadControl)this.ElementTree.Control).ThemeName;
            if (dialog.DialogResult != DialogResult.Abort)
            {
                dialog.ShowDialog();
            }
 
            dialog.Dispose();
        }
    }
}



I hope this information helps. Should you have further questions I would be glad to help. 
 
 Regards,
Dess
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.
Tags
PdfViewer and PdfViewerNavigator
Asked by
Richard
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or