@groupdocs/groupdocs.assembly
v26.10.1
Published
Document automation and report generation API to build DOCX, XLSX, PPTX, PDF, HTML, email and other documents from templates and JSON, XML, CSV or database data using JavaScript.
Readme
Powerful document automation and report generation API for Node.js (powered by Java) to build documents from templates and data. Generate Microsoft Word, Excel, PowerPoint, Outlook, OpenDocument, PDF, HTML and other documents by merging templates with data from JSON, XML, CSV, databases and external documents using LINQ-based template syntax.
Quick links
Key Features
- Build reports from template documents using the LINQ-based template syntax.
- Use JSON, XML, CSV, databases and external documents as data sources.
- Insert images, barcodes, charts, hyperlinks, HTML and document contents dynamically.
- Load and save document tables via the DocumentTable API.
- Assemble e-mail messages including their attachments.
- Convert assembled documents to other formats on the fly.
Supported Formats
Microsoft Office Formats
- Microsoft Word: DOC, DOT, DOCX, DOCM, DOTX, DOTM, RTF, FlatOPC
- Microsoft Excel: XLS, XLT, XLSX, XLSM, XLTX, XLTM, XLSB
- Microsoft PowerPoint: PPT, PPS, POT, PPTX, PPTM, POTX, POTM, PPSX, PPSM
- Microsoft Outlook: MSG, EML, EMLX
Other Supported Formats
- OpenDocument: ODT, OTT, ODS, ODP
- Web: HTML, MHTML, MD
- Fixed layout and image: PDF, XPS, TIFF, PNG, JPEG, BMP, SVG, EPUB
- Text: TXT
Getting Started
Prerequisites
- Node.js (LTS recommended)
- Java Runtime Environment (JRE) 8 or later
- Windows, Linux, or macOS
Installation
To install the package, check the System Requirements and Installation documentation topics for platform-specific instructions.
Use cases
Here are some typical use cases:
Generate a report from JSON
This example shows how to assemble a DOCX report from a template and a JSON data source.
'use strict';
const groupdocs = require('@groupdocs/groupdocs.assembly');
// Apply license, required for non-evaluation usage
const license = new groupdocs.License();
license.setLicense("GroupDocs.Assembly.lic");
// Prepare data source, "managers" is the name used in the template
const dataSource = new groupdocs.JsonDataSource("managers.json");
const dataSourceInfo = new groupdocs.DataSourceInfo(dataSource, "managers");
// Assemble document
const assembler = new groupdocs.DocumentAssembler();
assembler.assembleDocument("template.docx", "report.docx", dataSourceInfo);
// Exit
process.exit(0);Generate a report from CSV
'use strict';
const groupdocs = require('@groupdocs/groupdocs.assembly');
// The first line of the CSV file contains column names
const options = new groupdocs.CsvDataLoadOptions(true);
const dataSource = new groupdocs.CsvDataSource("persons.csv", options);
const dataSourceInfo = new groupdocs.DataSourceInfo(dataSource, "persons");
const assembler = new groupdocs.DocumentAssembler();
assembler.assembleDocument("template.txt", "report.txt", dataSourceInfo);
process.exit(0);Convert the assembled document to PDF
This code example shows how to assemble a Word template and save the result as PDF in one step.
'use strict';
const java = require('java');
const groupdocs = require('@groupdocs/groupdocs.assembly');
const dataSource = new groupdocs.XmlDataSource("managers.xml");
const dataSourceInfo = new groupdocs.DataSourceInfo(dataSource, "managers");
const dataSources = java.newArray('com.groupdocs.assembly.DataSourceInfo', [dataSourceInfo]);
const options = new groupdocs.LoadSaveOptions(groupdocs.FileFormat.PDF);
const assembler = new groupdocs.DocumentAssembler();
assembler.assembleDocument("template.docx", "report.pdf", options, dataSources);
process.exit(0);Troubleshooting
- Download during installation fails (corporate proxy/firewall): Ensure your environment allows downloading the required JAR during
postinstall. If needed, download the file manually to thelib/directory as described in the Installation Guide. - Java not found: Make sure Java (JRE 8+) is installed and available on your system
PATH. - Permission issues when writing output files: Verify your process has write access to the target directory.
Licensing
For testing without trial limitations, you can request a 30-day Temporary License:
- Visit the Get a Temporary License page
- Follow the instructions to request your temporary license
- Copy the license file and apply it using the code example
'use strict';
const groupdocs = require('@groupdocs/groupdocs.assembly');
// Apply license
const license = new groupdocs.License();
license.setLicense("GroupDocs.Assembly.lic");This product is licensed under the GroupDocs End User License Agreement (EULA). For pricing information, visit the GroupDocs.Assembly for Node.js via Java pricing page.
Support
GroupDocs provides unlimited free technical support for all of its products. Support is available to all users, including evaluation. The support is provided at Free Support Forum, Paid Support Helpdesk and Paid Consulting.
Free Support Forum
The GroupDocs Free Support Forum is available to all users and provides:
- Direct access to the GroupDocs.Total development team
- Community-driven support and knowledge sharing
- No time limitations on support requests
- Access to historical solutions and discussions
Paid Support Helpdesk
The Paid Support Helpdesk offers:
- Higher priority response times
- Dedicated support team
- Extended support hours
- Priority issue resolution
Paid Consulting
We can work together with you on your project and develop a part or complete application. If you need new features in the existing GroupDocs product or to create API for new file formats, send us a request at consulting.groupdocs.com/contact.
Home | Product Home | Documentation | Blog | Free Support | Temporary License | Pricing
