Quick Start
Creating Your First PDF Document
java
import CPDFGeneration.layout.*;
public class Example {
public static void main(String[] args) {
// Create a document
CDocument document = new CDocument();
// Create a page (A4 size: 595x842 points)
CPage page = document.createPage(595, 842);
// Create a div container
CDiv div = page.createDivElement();
// Add text
CText text = div.createTextElement("Hello, PDF Generation!");
text.setFontSize(24);
text.setFontColor(CColor.BLACK);
// Save to file
document.saveToFile("output.pdf");
}
}