API Reference
Complete reference for all public types and functions in compose2pdf.
import com.chrisjenx.compose2pdf.*
Quick reference
| Function / Type | Description |
|---|---|
renderToPdf { content } |
Render to PDF, returns ByteArray |
renderToPdf(outputStream) { content } |
Render to PDF, writes to OutputStream (streaming) |
renderToPdf(pages) { pageIndex -> content } |
Render multiple pages, returns ByteArray |
renderToPdf(outputStream, pages) { pageIndex -> content } |
Render multiple pages, writes to OutputStream |
PdfPagination |
AUTO (auto-paginate) or SINGLE_PAGE (clip) |
PdfPageConfig |
Page dimensions and margins (A4, Letter, A3, custom) |
PdfMargins |
Page margin presets and custom margins |
PdfLink |
Clickable URL annotation composable |
PaginatedColumn |
Column layout with page-break protection |
LocalPdfPageConfig |
CompositionLocal for page dimensions inside renderToPdf |
PdfPageInfo |
Page index/count passed to header/footer slots |
RenderMode |
Vector or raster rendering mode |
PdfRoundedCornerShape |
PDF-safe rounded corners for non-uniform radii |
Shape.asPdfSafe() |
Wrap any shape for correct PDF rendering |
InterFontFamily |
Bundled Inter font family |
Compose2PdfException |
Exception thrown on rendering failure |