PaperForge.PageCompiler (PaperForge v0.2.0)

Copy Markdown View Source

Compiles PaperForge.Page drawing operations into PDF page content.

The compiler owns the transition from high-level page operations to low-level PDF commands, including coordinate transforms, font/image registration, and page resource collection.

Summary

Functions

Compiles a page into {document, content, resources}.

Compiles page content without document-backed resources.

Functions

compile(page, document)

Compiles a page into {document, content, resources}.

Fonts and images used by the page are registered in the returned document. Content is returned as an uncompressed binary so the caller can decide which stream filters to apply.

compile_content(page)

@spec compile_content(PaperForge.Page.t()) :: binary()

Compiles page content without document-backed resources.

This is retained for compatibility with PaperForge.Page.content/1. Image operations are intentionally rejected because image XObjects must be registered in a document.