# Printing

**RadPdfViewer** allows printing of the document shown in it. The following article describes the available printing methods, as well as how to use the respective for the feature API.

## Using UI

**RadPdfViewer**'s sample UI allows you to print the currently shown PDF document with a simple button click.
![Rad Pdf Viewer Printing 03](https://www.telerik.com/products/wpf/documentation/assets/f32e0a08628aed965c4e3dc5ff3a5adf/radpdfviewer_printing_03.png)

The button shown in the above picture is actually bound to the **PrintPdfDocumentCommand** with the help of the **PrintCommandDescriptor**, so you can modify the UI to fit your needs.

```XAML
	      <telerik:RadButton Command="{Binding PrintCommandDescriptor.Command}" Visibility="{Binding PrintCommandDescriptor.IsEnabled, Converter={StaticResource BoolToVisibilityConverter}}" HorizontalAlignment="Left" VerticalAlignment="Stretch" Margin="2" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" IsBackgroundVisible="False">
	        <ToolTipService.ToolTip>
	          <TextBlock Text="Print" />
	        </ToolTipService.ToolTip>
	        <Image Source="/Telerik.Windows.Controls.FixedDocumentViewers;component/Images/printer.png" Stretch="None" />
	      </telerik:RadButton>
```

> tip More about command descriptors you can find [here](https://www.telerik.com/products/wpf/documentation/controls/radpdfviewer/ui/command-descriptors).

## Printing Programmatically

Additionally, to using the UI, you can print by taking advantage of the **Print()** and **Print(PrintSettings printSettings)** methods of **RadPdfViewer**.

The **PrintSettings** class holds all possible customization options when invoking printing:

* **DocumentName**: Specifies the name of the document.

* **PageMargins**: Specifies the page margin of the document.

* **UseDefaultPrinter**: Forces silent printing to the default printer.

```C#
PrintSettings settings = new PrintSettings()
{
    DocumentName = "My document",
    PageMargins = new Thickness(50),
    UseDefaultPrinter = true
};

this.pdfViewer.Print(settings);
```

RadPdfViewer also provides a **Print(PrintDialog printDialog, PrintSettings settings)** method. It allows you to pass an already initialized PrintDialog instance to the method and print the PDF document shown in the viewer. This means that you have control over the way the document is printed and can, for example, print it silently to a printer other than the default one.

> tip You can download a runnable project showing how you can customize the printing functionality from our online [SDK repository on GitHub](https://github.com/telerik/xaml-sdk/tree/master/PdfViewer/CustomPrinting).

## See Also

* [Wiring UI](https://www.telerik.com/products/wpf/documentation/controls/radpdfviewer/ui/wiring-ui)
