Skip to main content Skip to footer

What's New in Documents for Word v1

GrapeCity Documents for Word API v1

GrapeCity introduces Documents for Word (GcWord), a Word API that offers a complete solution for working with Word documents in .NET Core. With an object model based on the Microsoft Office API, Word JavaScript API, and OpenXML SDK, you can create, load, edit, save, and convert Word documents in .NET Core applications—with zero dependencies on Microsoft Word.

With a familiar and easy-to-use object model, GrapeCity Word's high-performance library includes an object model to create DOCX files through code; load DOCX files; access the object model and add, remove, and modify objects (and their properties); and then save to a .docx file or export to PDF.

Word Document


Working with Microsoft Word documents

If you're working in MS Word, you're likely performing some or all of the following functions:

  1. Generate, load, modify and save Word documents
  2. Insert formatted text, paragraphs, images, tables, hyperlinks, document sections, headers and footers, footnotes, endnotes, and comments
  3. Find and replace text
  4. Convert Word documents to PDF

With GcWord, you can accomplish all of this and more, including creating:

  • Payslips
  • Receipts
  • Project plans
  • Resumes
  • Shopping store printing label
  • im
  • To-do lists
  • Journals
  • Research papers
  • Flyers
  • Newsletters
  • Brochures
  • and more...

GcWord features

Let's look at several examples of what GcWord offers and how it differs from the MS Word API:

  1. Supported file formats
  2. Generate, load, analyze, modify, and save Word documents
  3. Fast, efficient, and modern API
  4. Document elements
  5. Work with document content
  6. Conversion to PDF


Supported file formats

  • Input and Output: DOCX, DOTM, DOCM, DOTX

  • Input only: FlatOPC, FlatOpcMacroEnabled, FlatOpcTemplate, FlatOpcTemplateEnabled

  • Output: PDF, PDF/A


Generate, load, analyze, modify, and save Word documents in .NET

GcWord is a .NET Core library with no MS Office or platform specific dependencies. It can create Word documents from scratch, or load existing documents from streams or disk files. Documents can be analyzed and modified using an intuitive and efficient object model. All GcWord features are fully supported on Windows, Linux, and macOS

You can read existing Word documents from streams, bytes, and disks or add new pages to existing Word documents.

Visit Demo


Fast, efficient, and modern API for Microsoft Word

The GcWord API is fast and easy to use—it's a pure C# implementation of a useful subset of the MS Word object model on .NET Core. The GcWord demo displays the time taken to generate the Word document at the top. Check out the performance of GcWord while generating Word documents (or converting them to PDF).


Document elements

Create sections in a Word document

A Word document contains one or more sections. GcWord provides access to sections and allows to add or remove them and modify their properties (such as page headers and footers). Properties are organized into classes in a way similar to the grouping of properties in the familiar MS Word UI, making the object model more intuitive and easier to understand.

Sections

Visit Demo | Learn More

Text and paragraph formatting

When creating text and paragraphs, you can:

  • Add text and paragraphs to Word documents
  • Align text to center, left, right, and justify
  • Format text and paragraphs
  • Apply styles

Text and paragraph formatting

Visit Demo | Learn about Paragraphs

Create tables in a Word document

Data visualization is essential. Using tables is a practical way to layout data in rows and columns. Static and conditional formatting of table rows, columns, and cells depending on their position in a table.

GcWord supports the following table features:

  • Format rows of a table
  • Insert page breaks
  • Insert graphic elements inside the table
  • Insert tables in the header
  • Edit table formatting properties
  • Autofit contents of the cell

Tables

Visit Demo | Learn about tables

Headers and footers

Add logos, author info, titles, and page numbers into your document headers and footers. GcWord supports all the header and footer types, including the first page, odd page, and even page.

Header and Footer

Visit Demo | Read more about headers and footers

Footnotes and endnotes

In addition to the content, you can also add notes, descriptions, or references (either at the end of each page or the end of your document).

Footnotes and Endnotes

Visit Demo | Read about footnotes and endnotes

Comments

Team collaboration isn't complete without comments! Create and insert comments in any part of the document. You can:

  • Add comment text
  • Add reply comment
  • Add date/time
  • Add author
  • Add initials

Comments

Visit Demo | Read about adding comments

Add bulleted and numbered lists to Word documents

Lists and multilevel lists are vitally important for organizing information. With GcWord, you can create:

  • Multilevel lists
  • Numbered lists
  • Bulleted lists

You can apply the following list of features:

  • Styles
  • List Level properties
  • List templates

Lists

Visit Demo | How to add, modify, and delete lists

Add images to Word documents from streams and disk files

When you're compiling a document in code that includes images, you can pull images from streams or disk files using GcWord. We support all common image formats, including PNG, BMP, JPEG, TIFF, GIF, EMF, WMF, and SVG.

GcWord together with GcImaging (another new GC component, currently in beta) allows you to access image properties such as size and resolution, for exact image positioning within a document.

Images

Visit Demo | Work with images in a Word document

When you have large documents, you'll probably want to jump to specific locations. You can interact with your documents using the following features:

  • Configure bookmarks for the objects in the document
  • Link to an object in the same document
  • Hyperlink to Web URLs
  • Hyperlink to other external files

Bookmarks and Hyperlinks

Visit Demo | How to work with links

Work with document content

When you're importing documents to your .NET app, you'll need to work with the existing objects in the document, or even preserve more advanced features like macros. Accessing ranges of content—for instance, a full paragraph, or even only a sentence— allows you to update the formatting or edit the text.

With GcWord, you can:

  • Get and set built-in document properties like author and title
  • Manipulate text objects
  • Preserve or remove VBA macros, or VBA digital signatures when loading and saving Word documents
  • Access a range of objects in the document
  • Access all content within a range
  • Insert objects before or after range objects

Insert, modify, and remove document elements in .NET

One of the major advantages of using GcWord is that you can load and modify Word documents. If your generated Word document is dependent on data changes at runtime or user input, you'll need to access document elements and edit them. You might need to change your company logo or brand colors in template documents.

GcWord can create documents from scratch, or load and modify existing Word documents. Via its object model, GcWord provides full programmatic control over the following types of Word objects, i.e., you can insert, modify, and remove these objects from a Word document:

  • Paragraphs
  • Text
  • Sections
  • Images
  • Tables
    • Rows
    • Cells
  • Headers
  • Footers
  • Footnotes
  • Endnotes
  • Comments
  • Bullets
  • Numbered lists
  • Fields
  • Hyperlinks
  • Bookmarks
  • Page breaks

There are some types of objects that GcWord does not yet support. This means that its object model does not provide access to the properties of those objects or means to add them to a document. However, GcWord preserves any objects that it does not recognize, so you can load a document containing such objects into GcWord, modify the document in some way and save it - any unknown to GcWord content will be preserved. Additionally, GcWord allows to programmatically remove objects that it does not support.

  • Shapes
  • Drawing objects
    • OLEObjects
    • Charts
    • Diagrams
    • Textboxes

Document formatting

Every document has its own formatting guidelines, and when programming with Word documents, you'll need to access different elements of the Word document and apply formatting to it as needed. You modify the formatting of a Word document in the following areas:

  • Create, extract and modify

    • Character formatting
    • Fonts
    • Colors
    • Borders
    • Shading
  • Paragraph Formatting

    • Indents
    • Spacing
    • Borders
    • Shading
    • Tab stops
  • Bulleted and numbered lists formatting

    • Numbering level
    • List level
  • Table formatting

    • Cell alignment
    • Orientation
    • Cell borders
    • Shading
    • Cell width/row height setting.
    • Cell fonts and colors
    • Cell background-color
    • Padding
  • Page formatting

    • Page setup
    • Page size
    • Margins
    • Page numbering
    • Line numbering
    • Multipage printing
  • Section properties

    • Paper size
    • Margins
    • Orientation
  • Document objects

    • Images
  • Document view types, zoom percent, and zoom types.

  • Create, modify and remove

    • Document Styles
    • Apply 375 in-built styles and apply custom styles
    • Apply 21 in-built List templates

Edit document and page settings

Sometimes working with Word documents means you'll need to edit the document at a more fundamental level--attach an author to it, for instance, or work with page settings like page orientation or margins. GcWord helps you use the following features when working with page settings in Word Documents:

  • Create multiple sections with different page sizes and orientation
  • Set document properties like author name, creation date, and keywords
  • Setting page margins in the document

Setting page margins in the document

Convert Word docs to PDF in .NET

If you need to preserve formatting and the final document for a period of time, you’ll need to generate a PDF. Once you create Word documents using GcWord, you can convert them to PDF using a simple method of GcWord. Like all other features of GcWord, conversion to PDF is platform-independent and works on all supported platforms (Windows, Linux, and macOS).

At this time, PDF conversion does not support footnotes/endnotes, shapes, and other objects that are not yet supported by the GcWord object model (see 5.2 above). Visit this help file to view the limitations for Word to PDF conversion.

Conversion to PDF

Visit Demo | How to convert a Word document to a PDF

Select Product Version...