GroupDocs.Assembly for Java

Add dynamic lists to PDF files with our Java API

GroupDocs.Assembly for Java provides flexible tools to generate and insert data-rich lists directly into PDF documents.

How to add a data-driven list to a PDF document

GroupDocs.Assembly lets you quickly insert data-rich lists into PDF templates. Customize and organize content effortlessly.

  1. Design a template and specify placeholders for the list (PDF templates are not supported).
  2. Set the file path to the template.
  3. Fetch data from supported formats like JSON or XML.
  4. Save the finished document with the list included as a PDF.
// Include this tag in your template where the list should appear
// <<foreach [in customers]>><<[CustomerName]>><</foreach>>

// Define the file path of the template
// PDF templates are not supported at this time.
String template = "list_template.docx";

// Pull data from your chosen source
DataSourceInfo data 
    = new DataSourceInfo(GetData(), "label");

// Save the document with the embedded list
DocumentAssembler asm = new DocumentAssembler();
asm.assembleDocument(template, "result.pdf", data);
Maven XML
click to copy
copied
More examples Documentation

Generate documents from templates with data integration

GroupDocs.Assembly for Java simplifies adding dynamic lists, tables, charts, and other components into document templates.

Key Features of GroupDocs.Assembly

Build reports with data from various sources

Use data from formats like JSON, XML, and CSV to populate lists and other components efficiently.

Add lists and other data elements seamlessly

GroupDocs.Assembly enables embedding of lists, charts, tables, and more, alongside text, images, and links to create polished documents.

Precisely control where data appears

LINQ-based templates allow you to define exact locations for your lists and data. Use loops to create detailed lists automatically and apply custom formatting.

Supports various document formats

Create or edit files in formats such as MS Office, PDF, OpenOffice, HTML, and email. Merge content from multiple documents as needed.

How to create a list programmatically

This example shows how to add a list dynamically into a PDF file using GroupDocs.Assembly.

Java

// Add a placeholder tag in your template for the list
// <<foreach [in products]>><<[NumberOf()]>>. <<[ProductName]>>
// <</foreach>>

// Provide the file path to your template
// PDF templates are not supported at this time.
String template = "numlist_template.docx";

// Pull the required data to populate the list
XmlDataSource data_xml =
    new XmlDataSource("products.xml");

// Prepare the data source with the necessary details
DataSourceInfo data 
    = new DataSourceInfo(data_xml, "products");

// Initialize DocumentAssembler
DocumentAssembler asm = new DocumentAssembler();

// Save the output document with the completed list
asm.assembleDocument(template, "result.pdf", data);
Maven XML
click to copy
copied
More examples Documentation

What is GroupDocs.Assembly for Java?

GroupDocs.Assembly for Java makes it easy to design professional documents by pulling data from multiple sources. Use it to create lists, tables, charts, or text, and place these elements exactly where needed using advanced template features. With support for over 50 formats, including PDFs, MS Office files, and email documents, it helps automate and streamline your workflow.
Learn more
About illustration

Ready to get started?

Download GroupDocs.Assembly for free or get a trial license for full access!

Useful resources

Explore documentation, code samples, and community support to enhance your experience.

Discover what GroupDocs.Assembly can do

Easily design and generate content-rich documents with advanced data integration tools.

Produce documents in various formats

Java supports over 50 formats, allowing you to create structured documents by combining data and templates.

Temporary license tips

1
Sign up with your work email.
Free mail services are not allowed.
2
Use Get a temporary license button on the second step.
 English