PdfElixide.Document.Page (pdf_elixide v0.5.0)

Copy Markdown View Source

Representation of a page of a PDF document.

Summary

Functions

Returns the page's height in points.

Same as height/1 but raises an error if it fails.

Extracts the text content of the page.

Same as text/1 but raises an error if it fails.

Extracts the text lines of the page, each with its bounding box and words.

Same as text_lines/1 but raises an error if it fails.

Returns the page's width in points.

Same as width/1 but raises an error if it fails.

Extracts the words of the page, each with its bounding box and font metadata.

Same as words/1 but raises an error if it fails.

Types

t()

@type t() :: %PdfElixide.Document.Page{
  doc: PdfElixide.Document.t(),
  index: non_neg_integer()
}

Functions

height(page)

@spec height(t()) :: {:ok, float()} | {:error, term()}

Returns the page's height in points.

height!(page)

@spec height!(t()) :: float()

Same as height/1 but raises an error if it fails.

text(page)

@spec text(t()) :: {:ok, binary()} | {:error, term()}

Extracts the text content of the page.

text!(page)

@spec text!(t()) :: binary()

Same as text/1 but raises an error if it fails.

text_lines(page)

@spec text_lines(t()) :: {:ok, [PdfElixide.Document.TextLine.t()]} | {:error, term()}

Extracts the text lines of the page, each with its bounding box and words.

text_lines!(page)

@spec text_lines!(t()) :: [PdfElixide.Document.TextLine.t()]

Same as text_lines/1 but raises an error if it fails.

width(page)

@spec width(t()) :: {:ok, float()} | {:error, term()}

Returns the page's width in points.

width!(page)

@spec width!(t()) :: float()

Same as width/1 but raises an error if it fails.

words(page)

@spec words(t()) :: {:ok, [PdfElixide.Document.Word.t()]} | {:error, term()}

Extracts the words of the page, each with its bounding box and font metadata.

words!(page)

@spec words!(t()) :: [PdfElixide.Document.Word.t()]

Same as words/1 but raises an error if it fails.