-
-
Notifications
You must be signed in to change notification settings - Fork 155
Home
Welcome to the Boxable library documentation!
Boxable is a high-level Java library built on top of Apache PDFBox that makes it easy to create tables in PDF documents. It provides a simple API for generating professional-looking tables with rich formatting options.
- Easy table creation - Simple API for building tables programmatically
-
Rich HTML formatting - Support for HTML tags including
<b>,<i>,<u>,<s>,<h1>-<h6>,<sup>,<sub>,<ul>,<ol>,<li>, and more - Data import - Import data from CSV files or Java Lists
- Multi-page support - Tables automatically span multiple pages with repeating headers
- Advanced styling - Cell colors, borders, alignment, transparency, images, and more
- Nested tables - Create complex layouts with tables inside cells
- Fixed-height rows - Auto-fit text in constrained spaces
- Rotated text - 90-degree rotation for vertical labels
<dependency>
<groupId>com.github.dhorions</groupId>
<artifactId>boxable</artifactId>
<version>1.8.2</version>
</dependency>// Initialize PDF document
PDDocument document = new PDDocument();
PDPage page = new PDPage();
document.addPage(page);
// Create table
float margin = 50;
float yStart = page.getMediaBox().getHeight() - margin;
float tableWidth = page.getMediaBox().getWidth() - (2 * margin);
float bottomMargin = 70;
BaseTable table = new BaseTable(yStart, yStart, bottomMargin,
tableWidth, margin, document, page,
true, true);
// Add rows
Row<PDPage> headerRow = table.createRow(20f);
headerRow.createCell(50, "Name");
headerRow.createCell(50, "Value");
Row<PDPage> dataRow = table.createRow(15f);
dataRow.createCell(50, "Item 1");
dataRow.createCell(50, "Value 1");
// Draw and save
table.draw();
document.save("output.pdf");
document.close();- Getting Started - Installation and first steps
- Tutorials - 12 comprehensive tutorials with examples
- API Reference - Detailed API documentation
- HTML Tags Reference - Supported HTML tags
- FAQ - Frequently asked questions
The library includes 12 runnable tutorials that demonstrate all features:
- Basic Table - Simple table creation
- HTML Formatting - Text formatting with HTML
- Colors and Transparency - Color management
- Alignment - Text alignment options
- Images - Images in cells
- Borders and Styling - Border customization
- Header Rows - Repeating headers
- Data Import - CSV and List imports
- Multi-Page Tables - Page spanning
- Nested Tables - Tables within cells
- Fixed Height Rows - Auto-fit text
- Advanced Features - Rotated text, colspan
Run all tutorials:
mvn test -Dtest=TutorialRunner- GitHub Repository: https://github.com/dhorions/boxable
- Issues: https://github.com/dhorions/boxable/issues
- Contributing: Contributions are welcome! See issue #41
Licensed under the Apache License, Version 2.0. See the LICENSE file for details.
Special thanks to :
=======
Copyright 2026
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.