ManuelGarcia

ManuelGarcia

Hi everyone,

I’m excited to share PaperForge, an open-source PDF platform built entirely in Elixir.

Build, secure, validate, and transform documents entirely in Elixir.

PaperForge started from a simple idea: generating professional documents should be a first-class capability of the BEAM. Applications should not need a browser, a headless rendering service, native compilation, or an external PDF executable to produce reliable PDFs.

PaperForge provides both a programmatic API and a declarative .paperforge format for reusable document templates.

What it supports

  • Flow-based document layout with automatic pagination.
  • Tables, lists, headers, footers, page templates, and navigation.
  • Embedded fonts, Unicode text, images, SVG/vector output, QR codes, and barcodes.
  • Charts, mathematical expressions, bibliographies, notes, references, and scientific-document features.
  • Links, named destinations, outlines, annotations, attachments, and AcroForms.
  • Document encryption, permissions, watermarks, content fingerprints, and digital-signature workflows.
  • Declarative .paperforge templates with variables, validation, conditions, loops, reusable components, themes, imports, and Design Systems.
  • HTML, Markdown, SVG, and PDF interoperability.
  • Concurrent rendering, supervised jobs, telemetry, batch workflows, and production-oriented performance tooling.

The project remains pure Elixir by default. The core library does not require a browser, native rendering engine, or external executable.

Quick example

document =
  PaperForge.new()
  |> PaperForge.Flow.heading("Quarterly report", level: 1)
  |> PaperForge.Flow.paragraph("Generated directly by the BEAM.")

PaperForge.write(document, "report.pdf")

For reusable, data-driven documents, templates can also live in a .paperforge file and be validated, compiled, and rendered without evaluating arbitrary Elixir code.

Why I built it

I wanted a document system that fits naturally into Elixir applications: deterministic, composable, observable, and safe to run under load.

The goal is not just to draw PDF pages. It is to make document generation, validation, security, accessibility, and production rendering feel like normal parts of an Elixir system.

1.4.1

This patch release focuses on rendering stability and declarative workflow hardening:

  • Improved layout behavior across text, tables, charts, formulas, and forms.
  • More robust declarative validation and error reporting.
  • Rendering edge-case fixes and compatibility improvements.
  • Deterministic output and public API compatibility preserved.
  • Expanded regression coverage for document-generation workflows.

Links

I would genuinely appreciate feedback from the community, especially around API ergonomics, PDF compatibility, declarative templates, and production usage patterns.

Thanks for taking a look.

Showing Posts 1 to 5

Werner

Werner

Wow, that’s really great…

A few days ago, there was a post about Tincture, now we have two PDF libraries written entirely in Elixir.

That’s really fantastic.

Thank’s a lot.

roflbobl

roflbobl

Really nice with the PHOENIX.md with great examples!

ManuelGarcia

ManuelGarcia OP

Thank you both for the kind comments! I really appreciate it, and I’m glad the PHOENIX.md examples were useful.

For now, I’m planning to keep this version as the stable base for a while. I want to focus on fixing bugs, improving compatibility, and addressing any issues that come up before adding another large set of features. So if you try PaperForge and find anything strange, feedback and bug reports are very welcome.

There’s actually a bit of history behind the project. The first PaperForge code has been sitting on my computer for around a year and a half. At the time, the architecture was pretty bad, responsibilities weren’t separated properly, and I was also dealing with a fairly heavy workload, so I never really felt motivated to turn it into something public.

Over the last few weeks I’ve finally had the time to revisit it properly. I’ve also been using AI as a development tool to help me review the architecture, organize the refactoring, look for potential vulnerabilities and edge cases, and challenge some of my implementation decisions. That made it much easier to turn the old prototype into something I felt comfortable testing, documenting, and releasing publicly.

I’m also working on PaperForge Studio, a desktop visual editor built on top of PaperForge. I’m hoping to have an early beta available in the next few weeks. It will be completely optional — PaperForge itself will remain usable independently — but if anyone here is interested in trying the Studio beta when it’s ready, I’d be very happy to get feedback from Elixir users.

Thanks again for taking the time to check out the project!

ManuelGarcia

ManuelGarcia OP

Small PaperForge 1.4.2 Maintenance update :fireworks:

Following up on the stabilization work I mentioned above, I’ve released PaperForge 1.4.2.

This is intentionally a small maintenance release rather than a feature release. Most of the work went into architecture, security, and making the internals easier to maintain going forward.

A few highlights:

  • Reorganized the internal source tree into explicit authoring, document, resources, layout, rendering, PDF, security, runtime, and legacy layers, while keeping the existing public API stable.

  • Added ARCHITECTURE.md documenting the internal layers and dependency rules.

  • Isolated the maintained legacy flow/table implementations from the current unified Flow layout engine.

  • Prevented untrusted .paperforge templates from creating arbitrary BEAM atoms. Declarative identifiers now use bounded/internal or binary representations where appropriate, without changing the existing atom-based Elixir API.

  • Tightened PDF page-import validation so malformed or out-of-range selections fail deterministically.

  • Reduced some temporary allocations in legacy rendering and added additional regression coverage.

There are no major new user-facing features in this release — and that’s intentional. For the moment I’m trying to keep the 1.4.x line stable, fix issues as I find them, and strengthen the foundations before moving on to larger additions.

As always, if anyone is using PaperForge and finds an edge case or something that behaves unexpectedly, reports are very welcome.

Thanks again for the feedback!

stocks29

stocks29

This is great! I have a PDF generation project coming up so I’ll give this a whirl.

— All posts loaded —

Where Next? Top

Trending in Announcing Top

bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
387 15136 120
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub. Docs are at OpenaiEx User Gu...
152 11030 135
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
shahryarjb
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly. One of i...
New
woylie
Phoenix components for pagination, sortable tables and filter forms with Flop and (optionally) Ecto. pagination cursor pagination sorta...
New
kip
Please say hi to a new lib, Astro that aims to deliver easy-to-consume astronomy calculations of practical use. For now it only calculat...
New

Other Trending Topics Top

akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
mudasobwa
I am seeing a lot of aplications of Argumentum ad Vericundiam in software discussions. They do link some piece of writing and point us to...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews