Aspose.Words enables .NET and Java applications to read, modify and write Word® documents without utilizing Microsoft Word®. Aspose.Words supports a wide array of features including document creation, content and formatting manipulation, powerful mail merge abilities, comprehensive support of DOC, OOXML, RTF, WordprocessingML, HTML, OpenDocument and PDF formats. Aspose.Words is truly the most affordable, fastest and feature rich Word component on the market.
This documentation covers both Aspose.Words for .NET and Aspose.Words for Java. The differences between the two products are noted where applicable. Some features available in Aspose.Words for .NET are not available in Aspose.Words for Java. For a detailed list of supported features, see the Aspose.Words Features section.
Use Cases
The main scenarios where Aspose.Words is used are the following:
- Generate reports (populate pre-designed documents with data from various data sources).
- Build documents dynamically (combine documents or portions of documents, insert text, images and formatting).
- Modify documents programmatically or extract various content.
- Convert between different formats with a high degree of fidelity.
A typical scenario for Aspose.Words is an application that needs to generate hundreds or thousands of Word or other documents. By letting .NET and Java applications to work with Word documents without utilizing Microsoft Word, Aspose.Words helps to avoid using Office Automation and build reliable and high performance document processing applications that run in any server or desktop environment.
We have many customers who successfully use Aspose.Words to create the following types of documents:
- Legal documents
- Resumes
- Training course descriptions
- Invoices
- Mailing labels
- Contracts
- Student assignments
You can create new documents from scratch, modify existing, or use existing documents as templates for populating them with data from a database. Aspose.Words Application Programming Interface (API) is powerful yet easy to use. To minimize your learning curve, classes, properties and method names borrow the best practices from the two well-known APIs: Microsoft Word Object Model and System.Xml. Aspose.Words provides high-level reporting and document building functionality as well as detailed programmatic access to all document elements.
Business Benefits
- Avoid Microsoft Word automation in your .NET and Java applications.
- Design reports or template documents in the familiar environment of Microsoft Word, not in a custom report designer.
- Build or modify documents and formatting with ease using an object model similar to Microsoft Word Object Model and System.Xml.
- Populate documents with your data using just a few lines of code.
- Generate or process thousands of documents such as reports, letters, invoices, and forms in minutes.
General Features
- Open and save DOC, DOCX, RTF, WordprocessingML, HTML and TXT documents.
- In addition to the above formats, save as MHTML and OpenDocument (ODT) documents.
- Save documents in the Aspose.Pdf.Xml format that can be used by Aspose.Pdf to produce PDF files.
- Use Aspose.Words from within a COM or ASP application and pass data as ADO Recordset.
- Aspose.Words installation includes easy-to-understand demo projects for ASP.NET, Windows Forms and Swing with source code in C#, VB.NET and Java that you can use to start building your application in minutes.
Document Features
- Programmatically create, modify or remove sections, headers, footers, paragraphs, lists, tables, rows, cells, text, fields, form fields, bookmarks, images and other document elements.
- Specify detailed formatting for sections, paragraphs, text, rows and cells at runtime.
- Join or split documents, copy or move fragments between documents.
- Insert and format complex document elements such as images, hyperlinks, fields via a higher-level programming interface.
- All drawing objects including shapes, textboxes, images, OLE objects and controls are fully preserved in documents. Most of the drawing objects can also be programmatically created or modified.
- Insert HTML fragments into the document.
- Access and modify document built-in and custom properties.
- Protect and unprotect documents.
Reporting Features
- Use standard Microsoft Word mail merge fields or bookmarks in your reports.
- Use Aspose.Words extended syntax for mail merge fields to perform advanced operations during mail such as insert images or repeatable regions.
- Populate and dynamically grow tables or fragments in a document from your data source using mail merge regions.
- Populate documents from any .NET data source such as DataSet, DataTable, DataView, DataReader or from an XML file.
- Populate documents from any Java data source that implements the ResultSet interface.
- Take precise control, such as number formatting, over how your data is merged into the document using events.
Performance and Scalability
Aspose.Words was designed to perform well both on a server and on a client. Aspose.Words is just a single .NET assembly that can be deployed with any .NET application by copying Aspose.Words.dll. There are no services or any other modules to worry about.
You can literally generate thousands of documents in minutes with Aspose.Words and that involves opening a document, modifying content and formatting or populating it with data and saving.
Even most of the complex documents are opened and saved on a P4 2.4Ghz 1Gb RAM machine in fractions of a second. Document content manipulation, mail merge and find and replace operations are also performance optimized. It is worth noting that a document is always loaded into memory completely; this is by design as it is not possible to load a document in the Word binary format into memory partially.
Aspose.Words is multithread safe as long as only one thread works on a document at a time. It is a typical scenario to have one thread working on one document. Different threads can safely work on different documents at the same time.
Minimal Learning Curve
Although there are over 150 public classes and enumerations in Aspose.Words, the learning curve is minimal because the Aspose.Words API was modeled after two other well-known APIs:
- Microsoft Word Object Model
- System.Xml namespace in the .NET Framework
Aspose.Words is not a visual control, but a class library with object model similar to Microsoft Word Object Model. Developers, who used Microsoft Word Automation in their projects before switching to Aspose.Words, will find names and behavior of many classes, methods and properties familiar. The Document, Section, Paragraph, Bookmark, Range, PageSetup, ParagraphFormat, Font are some of the Aspose.Words classes.
At the same time, Aspose.Words is quite different from the Microsoft Word Object Model in that it represents the document as a tree of objects. In this aspect, Aspose.Words is similar to classes found in the System.Xml namespace of the .NET Framework. If you worked with XmlDocument, XmlElement and XmlNode in .NET, then you will find it is easy to understand and work with Aspose.Words’ classes Document, Node, CompositeNode and their properties and methods ParentNode, FirstChild, NextSibling, ChildNodes, InsertAfter, RemoveChild etc.
While developing Aspose.Words we also tried to keep up with the .NET Class Library Developer Guidelines and other industry best practices.