Skip to content
ComPDF

Samples

The Samples use preset parameters to call the API of PDF Generation SDK for Java for each function without UI interaction or parameter settings. This is achieved through modular code examples. Not only does it demonstrate HTML to PDF functionality, but it also provides complete examples of creating PDF documents directly using the Layout API.

These projects not only demonstrate the best practices for each function but also provide detailed introductions. The impact of each function on PDF documents can be observed in the output directory. With the help of the Samples, you can quickly learn how to use the functions you need and apply them to your projects.

HTML to PDF Examples

NameDescription
ConvertToPdfConvert HTML to PDF.
RenderTemplateCombine HTML template with JSON and generate complete HTML.
RenderAndConvertCombine HTML template with JSON data to generate complete HTML, and convert the complete HTML to PDF.

Layout API Examples

NameDescription
CreateParagraphCreate paragraphs with various text formatting options.
CreateTableCreate tables with headers, footers, and styled cells.
CreateListCreate ordered and unordered lists with multiple styles.