New to Telerik UI for WinUI? Download free 30-day trial

Save File

PdfViewer enables you to save the loaded document on file system. This functionality can be easily wired to the UI using the related command or executed in code.

To open a save file dialog that allows you to choose a destination for the saved file on the file system, use the SaveAsCommandDescriptor and its command.

Executing the save as command in code

The SaveAsCommandDescriptor can be wired to the UI using the following approach. The example shows how to bind the command of the SaveAsCommandDescriptor to the Command property of a RadButton control.

Binding a command to a button in XAML

 <telerik:RadButton Content="Save As"  
                    Command="{Binding ElementName=pdfViewer, Path=CommandDescriptors.SaveAsCommandDescriptor.Command}"/> 
To save the file silently, without opening the Save As dialog, call the Save method of RadPdfViewer.

Saving file using the Save method

this.pdfViewer.Save(new FileStream("C:\temp\Sample.pdf", FileMode.CreateNew)); 

See Also

In this article
Not finding the help you need?