What's New in Documents for Word v1
GrapeCity Documents for Word API v1
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.
Working with Microsoft Word documents
If you're working in MS Word, you're likely performing some or all of the following functions:
- Generate, load, modify and save Word documents
- Insert formatted text, paragraphs, images, tables, hyperlinks, document sections, headers and footers, footnotes, endnotes, and comments
- Find and replace text
- Convert Word documents to PDF
With GcWord, you can accomplish all of this and more, including creating:
- Project plans
- Shopping store printing label im
- To-do lists
- Research papers
- and more...
Let's look at several examples of what GcWord offers and how it differs from the MS Word API:
- Supported file formats
- Generate, load, analyze, modify, and save Word documents
- Fast, efficient, and modern API
- Document elements
- Work with document content
- 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.
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).
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.
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
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
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.
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).
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
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:
- List Level properties
- List templates
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.
Insert bookmarks and hyperlinks in Word docs
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
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:
- Numbered lists
- 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.
- Drawing objects
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
- Tab stops
Bulleted and numbered lists formatting
- Numbering level
- List level
- Cell alignment
- Cell borders
- Cell width/row height setting.
- Cell fonts and colors
- Cell background-color
- Page setup
- Page size
- Page numbering
- Line numbering
- Multipage printing
- Paper size
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
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.