Save Method
- Namespace
TXTextControl.DocumentServer. Web
- Package
TXTextControl.asTextControl. ASP. SDK TXDocumentServer.from the private NuGet feed or Text Control Offline PackagesWeb. DocumentViewer. dll
Description
Initiates saving the currently loaded document. The actual saving is performed by a method which has to be bound to the DocumentServer.Web.DocumentViewer.SaveDocument event.
Syntax
Save(FileFormat)
Saves the document in a specific document format.
public void Save(FileFormat format);Public Sub Save(format As FileFormat)| Parameter | Description |
|---|---|
| format | Specifies one of the DocumentServer.FileFormat values. |
Save(string)
Saves the document to a specific path.
public void Save(string path);Public Sub Save(path As String)| Parameter | Description |
|---|---|
| path | Specifies where the document should be saved. |
Save(string, FileFormat)
Saves the document to a specific path in a specific document format.
public void Save(string path, FileFormat format);Public Sub Save(path As String, format As FileFormat)| Parameter | Description |
|---|---|
| path | Specifies where the document should be saved. |
| format | Specifies one of the DocumentServer.FileFormat values. |
Examples
DocumentServer.Web.DocumentViewer.Save belongs to the legacy Web Forms viewer. In the current ASP.NET Core viewer, configure the server-rendered component through DocumentViewerSettings.DocumentPath; interactive page state and styling are handled by the viewer client.
documentViewerSettings.DocumentPath = @"App_Data\document.docx";
if (!string.IsNullOrWhiteSpace(documentViewerSettings.DocumentPath))
{
Console.WriteLine($"Document Path: {documentViewerSettings.DocumentPath}");
}documentViewerSettings.DocumentPath = "App_Data\document.docx"
If Not String.IsNullOrWhiteSpace(documentViewerSettings.DocumentPath) Then
Console.WriteLine($"Document Path: {documentViewerSettings.DocumentPath}")
End IfRemarks
A given path is always relating to the server the document viewer is runnig on. Thus, it is good practice to define the path parameter using the HttpServerUtility.MapPath() method.