GroupDocs.Assembly for Java

Easily populate tables in PDF files with our Java API

GroupDocs.Assembly for Java simplifies the process of filling tables in PDF documents with data from various inputs.

Steps to insert data into a PDF table

GroupDocs.Assembly helps you populate table templates for PDF and other formats. Use dynamic data from your sources to create tables with ease.

  1. Design a template with placeholders for the table (PDF templates are not currently supported).
  2. Pull data from any supported input source.
  3. Filter or preprocess the data to match your needs.
  4. Save the document with the table filled in as a PDF file.
// Use these tags in a table row placeholder within your template
// <<foreach [c in ds]>>
// <<[c.Client]>><<[c.Manager]>><<[c.Price]>>
// <</foreach>>

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

// Load data from your chosen source
DataSourceInfo data 
    = new DataSourceInfo(GetData(), "ds");

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

Create documents with data-filled tables

GroupDocs.Assembly for Java makes it simple to automate table creation in your documents. It also supports adding elements like charts, lists, and images using templates.

Main Features of GroupDocs.Assembly

Generate reports from multiple data formats

The API works seamlessly with JSON, XML, CSV, and other formats to fill tables in your documents with organized data.

Present information visually

GroupDocs.Assembly helps you build professional tables, lists, and charts, as well as insert links, text, and images, for a polished look.

Place table content with precision

Use flexible LINQ-based syntax to add rows and columns dynamically. Customize appearance, such as font styles and colors, programmatically.

Compatible with multiple formats

Work with MS Office, OpenOffice, PDF, HTML, and more. Merge tables into any supported file format effortlessly.

Dynamically create a data-filled table

This example shows how to populate a table in a PDF document using dynamic input data.

Java

// Design a template with a placeholder for the table
// <<foreach [c in items]>> <<[c.Client]>><<[c.Manager]>>
//  <<[c.Price]>> <</foreach>>

// Set the template file location
// PDF templates are not supported at this time.
String template = "table_template.docx";

// Load data from your preferred source
JsonDataSource data_json = 
  new JsonDataSource("Items.json");

// Prepare a data object containing the necessary fields
DataSourceInfo data 
    = new DataSourceInfo(data_json, "items");

// Create an instance of DocumentAssembler
DocumentAssembler asm = new DocumentAssembler();

// Save the document with the table populated
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 is a tool for generating documents and reports by automatically inserting data into pre-designed templates. You can effortlessly add tables, lists, charts, and images. Its advanced features allow you to precisely place content within your documents. Compatible with over 50 file types, including PDF, MS Office, and email formats.
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.

Key features at a glance

Our API simplifies creating professional documents by automating table population alongside other powerful components.

Produce detailed tables in various formats

With Java, you can populate templates with data and generate detailed reports in over 50 file types.

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