ExPdfCore
Core PDF writer engine for Elixir — document, page, export, fonts, images, graphics state, and layout primitives. Uses only the Erlang/OTP standard library. No Hex runtime dependencies, no system tools.
Part of the ExPDF umbrella.
Installation
def deps do
[
{:ex_pdf_core, "~> 1.0"}
]
endMost users should depend on
ex_pdfinstead, which bundles core, components, and the reader.
What's included
Pdf— main API: build documents, add pages, draw text, images, shapes, and manage graphics statePdf.Document— document structure, page tree, fonts, objectsPdf.Page— individual page content streamsPdf.Export— serialize to PDF binaryPdf.Layout— text measurement and wrappingPdf.Font/Pdf.Fonts— built-in and external font handlingPdf.Component.Box— box with border, background, paddingPdf.Component.Row— horizontal column distribution by weightPdf.Component.Column— vertical row stacking with fixed heights
Usage
Pdf.build([size: :a4, compress: true], fn pdf ->
pdf
|> Pdf.set_font("Helvetica", 12)
|> Pdf.text_at({200, 200}, "Hello, world!")
|> Pdf.add_image({100, 100}, "logo.png")
end)
|> Pdf.export()License
MIT. See LICENSE.md.