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
this.pdfViewer.CommandDescriptors.SaveAsCommandDescriptor.Command.Execute(null);
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}"/>
Save
method of RadPdfViewer
.
Saving file using the Save method
this.pdfViewer.Save(new FileStream("C:\temp\Sample.pdf", FileMode.CreateNew));