VegaRise.NET
Back to VDocs

VDocsClass

Definition

Namespace
DOM
Assembly
VDocs.dll

The main entry point for the VDocs document processing framework.

Remarks

serves as the primary façade for creating, opening, editing, and exporting documents in various formats including Word (DOCX), HTML, and PDF. It provides a unified API for all document operations while handling license validation and delegating to appropriate backend services. VDocs The class supports: Creating new documents from scratch Opening existing Word documents Adding and manipulating document elements (paragraphs, tables, images, shapes, etc.) Exporting to HTML and PDF formats Saving back to Word format Theme management All export and save operations are protected by license validation through . If a license is not validated, warning messages are written to the console but operations continue (for evaluation purposes). LicenseManager

Examples

csharp
1// Create a new document
2using var doc = new VDocs();
3
4// Add a paragraph with styled text
5var paragraph = doc.AddParagraph();
6paragraph.AddText("Hello, World!").SetBold(true).SetFontSize(16);
7paragraph.AddText(" This is a VDocs document.");
8
9// Add an image
10var image = doc.AddImage("logo.png");
11image.SetPosition(100, 200, Units.pt);
12image.SetDimensions(300, 200, Units.pt);
13
14// Add a table
15var table = doc.AddTable();
16table.AddRow().AddCell("Name").AddCell("Value");
17table.AddRow().AddCell("Product").AddCell("VDocs");
18
19// Export to different formats
20doc.SaveAsWord("document.docx");
21doc.SaveAsHTML("document.html");
22doc.SaveAsPdf("document.pdf");
23

Constructors

VDocs()

Initializes a new, empty document using the default document services. VDocs

VDocs(string filePath)

Opens an existing Word document from the specified file path.

Properties

BackgroundColorIColor

Gets or sets the background color of the document.

This value typically maps to the document-level background or page color in the underlying XML representation. It affects all pages of the document.

ChildrenIElement

Gets or sets the direct children elements of this top-level document object.

Child elements typically include sections, paragraphs, tables, and other block-level elements that make up the document content.

DocumentGridIDocumentGrid

Gets or sets the document grid settings used for character/line layout.

The document grid provides a consistent baseline for character and line positioning. It is commonly used in East Asian typography to align text and improve readability.

DocumentStylesIDocumentStyles

Gets or sets the document styles.

Document styles define the formatting for paragraphs, characters, tables, and lists. Styles provide a consistent way to apply formatting and enable easy updates across the entire document.

Gets the document footers.

Footers appear at the bottom of pages and can contain text, images, page numbers, and other content that repeats across pages. Different footers can be defined for odd/even pages or the first page.

Gets the document headers.

Headers appear at the top of pages and can contain text, images, page numbers, and other content that repeats across pages. Different headers can be defined for odd/even pages or the first page.

ImagesIImage

Gets the images contained in the document.

Index

Gets the index of this element in its parent's child collection.

For the top-level document, this property may return 0 or -1 depending on the underlying implementation.

LicensePathLicenseManager

Gets or sets the optional path to a license file.

When set, this path is used by to validate the license before any save or export operation. If the license is invalid, warning messages are displayed but operations continue (evaluation mode). LicenseManager

PageColumnsIPageColumns

Gets or sets the column settings for the document sections.

This property controls how text flows across multiple columns on the page. It allows you to define the number of columns, their width, spacing between columns, and whether a vertical line separates them.

Gets the pages contained by the document.

This property provides access to page-level properties and content. Pages are automatically created based on content flow and section breaks.

PageSettingsIPageSetup

Gets or sets the page setup options for the document.

The page setup defines the physical layout of each page in the document. This includes: Page size (A4, Letter, etc.) Margins (top, bottom, left, right) Orientation (portrait or landscape) Page numbering style

ParagraphsIParagraph

Gets the paragraphs contained in the document.

Returns the parent element of this document.

Gets the SVG paths contained in the document.

RightToLeftLayout

Gets or sets whether the document layout is right-to-left.

This property is used for languages that are written right-to-left, such as Arabic, Hebrew, and Persian. When enabled, text and elements flow from right to left.

SectionBreakTypeSectionMarkValues

Gets or sets the section break type for this document when accessed through the interface. IDocumentSection

Gets the top-level sections of the document.

Sections represent major structural divisions in a document, similar to chapters or parts. Each section can have its own page settings, headers, footers, and columns.

ShapesIShape

Gets the shapes contained in the document.

Gets or sets the status of this document element.

TablesITable

Gets the tables contained in the document.

TextFlowDirectionTextDirectionValues

Gets or sets the text flow direction used by the document.

TextsIText

Gets the text elements contained in the document.

VerticalTextAlignmentOnPageVerticalJustificationValues

Gets or sets the vertical alignment of text on the page.

This property controls how text is distributed vertically within the page margins. For example, "center" will center the text block vertically on the page, which is commonly used for title pages.

Methods

Adds one or more child elements to the document.

Adds a footer to the document.

Adds a header to the document.

Adds an image element to the document.

Adds a new paragraph to the document.

Adds an SVG path element to the document.

Creates and adds a new section to the document.

Adds a shape element to the document.

Adds a table to the document.

Adds a text node with the specified string content to the document.

Creates a deep clone of this document element.

Exports the document to the specified file format and path.

Gets the currently active theme for the document.

Gets a child element of type by its index. T

Returns an HTML representation of the document.

Inserts elements after the specified source element.

Inserts elements before the specified source element.

Inserts child elements at the specified child index.

Produces a debug-friendly representation of the document object tree.

Opens an existing HTML document.

Opens an existing PDF document.

Opens an existing Word document using a static factory method.

Removes this element from its parent's child collection.

Removes all child elements from this document.

Removes the specified child elements from the document.

Replaces this element with in the parent collection. newChild

Saves the document as an HTML file.

Saves the document as a PDF file.

Saves the document as a Word (.docx) file.

Sets the active theme for the document by name.

VegaRiseVDocs.NET

Create Account

Create your VDocs account.

or

Already have an account? Sign in