GetDocument

GetDocument() → { ApiDocument }

Returns the main document.

Parameters:

This method doesn't have any parameters.

Returns:

Type
ApiDocument

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = Api.CreateParagraph();
oParagraph.AddText("This is a new paragraph");
oDocument.Push(oParagraph);
builder.SaveFile("docx", "GetDocument.docx");
builder.CloseFile();

Resulting document