Back to Devexpress

PdfViewerExtensions.SaveDocument(IPdfViewer, String, PdfSaveOptions) Method

officefileapi-devexpress-dot-pdf-dot-pdfviewerextensions-dot-savedocument-x28-devexpress-dot-pdf-dot-ipdfviewer-system-dot-string-devexpress-dot-pdf-dot-pdfsaveoptions-x29.md

latest3.3 KB
Original Source

PdfViewerExtensions.SaveDocument(IPdfViewer, String, PdfSaveOptions) Method

SECURITY-RELATED CONSIDERATIONS

Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.

Saves the document to the specified file path with encryption settings and document signature. This is an extension method.

Namespace : DevExpress.Pdf

Assembly : DevExpress.Docs.v25.2.dll

NuGet Package : DevExpress.Document.Processor

Declaration

csharp
public static bool SaveDocument(
    this IPdfViewer viewer,
    string path,
    PdfSaveOptions options
)
vb
<ExtensionAttribute>
Public Shared Function SaveDocument(
    viewer As IPdfViewer,
    path As String,
    options As PdfSaveOptions
) As Boolean

Parameters

NameTypeDescription
viewerIPdfViewer

A PdfViewer or PdfViewerControl object that implements the IPdfViewer interface.

| | path | String |

A System.String, specifying the path to the directory to which the PDF document should be saved.

| | options | PdfSaveOptions |

A PdfSaveOptions that contains the encryption and sign settings of a PDF document that should be saved.

|

Returns

TypeDescription
Boolean

true , if the document is saved successfully; false , if the document saving operation is cancelled by the user.

|

Remarks

See the Document Protection and Signing Document topics to learn more.

Note

The PDF Viewer locks a file while a document is saved (the PdfViewer.DetachStreamAfterLoadComplete or PdfViewerControl.DetachStreamOnLoadComplete property is set to false by default). To unlock the file, set the PdfViewer.DetachStreamAfterLoadComplete (PdfViewerControl.DetachStreamOnLoadComplete) property to true.

See Also

PdfViewerExtensions Class

PdfViewerExtensions Members

DevExpress.Pdf Namespace