PrawnEx.PDF.ContentStream (prawn_ex v0.6.0)

Copy Markdown View Source

Builds PDF content stream bytes from a list of content operations.

Uses PDF graphics operators: BT/ET (text), Tm/Tf/Tj (position, font, show), m/l/re (path), S/f (stroke/fill), q/Q (save/restore state).

Summary

Functions

Converts a list of content ops to a single content stream binary.

Functions

build(ops, font_map \\ %{}, gs_map \\ %{})

@spec build([PrawnEx.Page.content_op()], %{required(String.t()) => String.t()}, %{
  required(number()) => String.t()
}) :: binary()

Converts a list of content ops to a single content stream binary.

Font name is mapped to a PDF resource name (e.g. Helvetica -> F1).