DocumentSave(String) Method

Saves the document to a file. Automatically determines the save format from the extension.

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 21.11.0

ExpandedSyntax

public SaveOutputParameters Save(
	string fileName
)

Parameters

fileName
Type: SystemString
The name for the document. If a document with the specified file name already exists, the existing document is overwritten.

Return Value

Type: SaveOutputParameters
Additional information that you can optionally use.

ExpandedExamples

Shows how to open a document and convert it to .PDF.
Document doc = new Document(MyDir + "Document.docx");

doc.Save(ArtifactsDir + "Document.ConvertToPdf.pdf");
Shows how to convert a PDF to a .docx.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.Write("Hello world!");

doc.Save(ArtifactsDir + "PDF2Word.ConvertPdfToDocx.pdf");

// Load the PDF document that we just saved, and convert it to .docx.
Document pdfDoc = new Document(ArtifactsDir + "PDF2Word.ConvertPdfToDocx.pdf");

pdfDoc.Save(ArtifactsDir + "PDF2Word.ConvertPdfToDocx.docx");

ExpandedSee Also