Saving Files
The PdfViewer enables you to save the loaded document on the file system by wiring this functionality to the UI with the related command or through code execution.
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.
Execute the Save as command in code
this.pdfViewer.CommandDescriptors.SaveAsCommandDescriptor.Command.Execute(null);
SaveAsCommandDescriptor
to the UI by using the following approach. The example shows how to bind the command of the SaveAsCommandDescriptor
to the Command
property of a RadButton
control.
Bind a command to a button in XAML
<telerik:RadButton Content="Save As"
Command="{Binding ElementName=pdfViewer, Path=CommandDescriptors.SaveAsCommandDescriptor.Command}"/>
Save
method of RadPdfViewer
.
Save a file by using the Save method
this.pdfViewer.Save(new FileStream("C:\temp\Sample.pdf", FileMode.CreateNew));