Click or drag to resize

Hello World Example

Before using GemBox.Document, you need to install the component using one of the following methods:

Step–by–step guide to using GemBox.Document

  1. Create a new .NET project (or use an existing one).

  2. If you installed Setup, then add a reference to the GemBox.Document component by using Add Reference dialog (it'll be under Assemblies -> Extensions); otherwise you can skip this step (NuGet automatically adds a reference).

  3. Add a directive for GemBox.Document namespace; for a C# project use "using GemBox.Document;", for a VB.NET project use "Import GemBox.Document".

  4. Set the license key to use GemBox.Document in Free mode; for a C# project use "ComponentInfo.SetLicense("FREE-LIMITED-KEY");", for a VB.NET project use "ComponentInfo.SetLicense("FREE-LIMITED-KEY")".

Now you can write your application–specific document processing code like the one below.


Using GemBox.Document component is easy and straightforward. The following code shows how to create a document with 'Hello World!' text:

// Create a new empty document.
var doc = new DocumentModel();

// Add document content.
doc.Sections.Add(new Section(doc, new Paragraph(doc, "Hello World!")));

// Save the document to DOCX and PDF file.