89 words, 1 min read
⚠️ This post links to an external website. ⚠️
High-level API for rendering Typst templates to PDF, SVG, and PNG formats.
Typster is an Elixir wrapper for the Typst document preparation system, providing easy-to-use functions for compiling Typst templates with variable binding, package support, and metadata injection.
Quick Start
# Simple PDF renderingsource = "#set page(width: 200pt, height: 100pt)\n= Hello World"{:ok, pdf} = Typster.render_pdf(source)File.write!("output.pdf", pdf)# With variablestemplate = "= Invoice for #customer_name"{:ok, pdf} = Typster.render_pdf(template, %{customer_name: "Acme Corp"})# With metadata{:ok, pdf} = Typster.render_pdf(template, %{}, metadata: %{title: "Invoice", author: "Billing System"})
continue reading on hexdocs.pm
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.