PaperForge.Page (paper_forge v0.1.0)

Copy Markdown View Source

High-level representation of a PDF page.

Coordinates currently use the native PDF coordinate system:

  • origin at the bottom-left corner;
  • X grows toward the right;
  • Y grows toward the top.

Summary

Functions

Converts the high-level page into PDF indirect objects and adds them to the document.

Adds a circle drawing operation.

Converts all page operations into one PDF content stream.

Adds a line drawing operation.

Adds a rectangle drawing operation.

Adds a text drawing operation.

Types

operation()

@type operation() :: iodata()

t()

@type t() :: %PaperForge.Page{
  height: number(),
  operations: [operation()],
  width: number()
}

Functions

add_to_document(page, document)

@spec add_to_document(t(), PaperForge.Document.t()) :: PaperForge.Document.t()

Converts the high-level page into PDF indirect objects and adds them to the document.

circle(page, options)

@spec circle(
  t(),
  keyword()
) :: t()

Adds a circle drawing operation.

content(page)

@spec content(t()) :: iodata()

Converts all page operations into one PDF content stream.

line(page, options)

@spec line(
  t(),
  keyword()
) :: t()

Adds a line drawing operation.

new(options \\ [])

@spec new(keyword()) :: t()

rectangle(page, options)

@spec rectangle(
  t(),
  keyword()
) :: t()

Adds a rectangle drawing operation.

text(page, text, options \\ [])

@spec text(t(), binary(), keyword()) :: t()

Adds a text drawing operation.