PaperForge.Graphics.Image (PaperForge v0.2.0)

Copy Markdown View Source

Builds PDF drawing commands for image XObjects.

Images are drawn with the PDF cm transformation matrix followed by the Do operator.

Example output

q
180 0 0 90 72 600 cm
/Im1 Do
Q

Summary

Functions

Generates the PDF commands required to draw an image.

Types

option()

@type option() ::
  {:x, number()} | {:y, number()} | {:width, number()} | {:height, number()}

Functions

command(resource_name, options)

@spec command(binary(), [option()]) :: iodata()

Generates the PDF commands required to draw an image.

Required arguments:

  • resource_name — internal PDF resource name such as "Im1"
  • :x
  • :y
  • :width
  • :height

Example

PaperForge.Graphics.Image.command(
  "Im1",
  x: 72,
  y: 600,
  width: 180,
  height: 90
)