PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
The Layout API organizes document content using a tree structure:
CDocument (Document)
├─ CPage (Page)
│ ├─ CDiv (Container)
│ │ ├─ CParagraph (Paragraph)
│ │ ├─ CTable (Table)
│ │ ├─ CList (List)
│ │ ├─ CImage (Image)
│ │ ├─ CText (Text)
│ │ └─ CLineSeparator (Separator)
│ └─ ... (Other elements)
└─ CStyle (Style)1. Container Elements
2. Content Elements
3. Other Elements
The Layout API uses the CUnitValue structure to represent dimension values, supporting two units:
// Point unit - 1 point = 1/72 inch
CUnitValue pointValue = CUnitValue.createPointValue(100f);
// Percentage unit
CUnitValue percentValue = CUnitValue.createPercentValue(50f);Use the CColor structure to define RGBA colors:
// Create color using RGBA values
CColor color = new CColor(255, 0, 0, 255); // Red, fully opaque
// Use predefined colors
CColor black = CColor.Black;
CColor white = CColor.White;
CColor red = CColor.Red;