Representation of a page of a PDF document.
Summary
Functions
Extracts the characters of the page, each with its bounding box, font metadata, and typographic placement.
Same as chars/1 but raises an error if it fails.
Returns the page's height in points.
Same as height/1 but raises an error if it fails.
Extracts the raster images of the page — photos, logos, and scanned pictures.
Same as images/1 but raises an error if it fails.
Extracts the vector paths of the page — lines, curves, rectangles, and shapes.
Same as paths/1 but raises an error if it fails.
Extracts the spans of the page, each a run of text sharing one text state.
Same as spans/1 but raises an error if it fails.
Detects the tables of the page.
Same as tables/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
@type t() :: %PdfElixide.Document.Page{ doc: PdfElixide.Document.t(), index: non_neg_integer() }
Functions
@spec chars(t()) :: {:ok, [PdfElixide.Document.Char.t()]} | {:error, PdfElixide.Error.t()}
Extracts the characters of the page, each with its bounding box, font metadata, and typographic placement.
@spec chars!(t()) :: [PdfElixide.Document.Char.t()]
Same as chars/1 but raises an error if it fails.
@spec height(t()) :: {:ok, float()} | {:error, PdfElixide.Error.t()}
Returns the page's height in points.
Same as height/1 but raises an error if it fails.
@spec images(t()) :: {:ok, [PdfElixide.Document.Image.t()]} | {:error, PdfElixide.Error.t()}
Extracts the raster images of the page — photos, logos, and scanned pictures.
Returns {:ok, []} when the page has no images.
@spec images!(t()) :: [PdfElixide.Document.Image.t()]
Same as images/1 but raises an error if it fails.
@spec paths(t()) :: {:ok, [PdfElixide.Document.Path.t()]} | {:error, PdfElixide.Error.t()}
Extracts the vector paths of the page — lines, curves, rectangles, and shapes.
Returns {:ok, []} when the page has no vector graphics.
@spec paths!(t()) :: [PdfElixide.Document.Path.t()]
Same as paths/1 but raises an error if it fails.
@spec spans(t()) :: {:ok, [PdfElixide.Document.Span.t()]} | {:error, PdfElixide.Error.t()}
Extracts the spans of the page, each a run of text sharing one text state.
@spec spans!(t()) :: [PdfElixide.Document.Span.t()]
Same as spans/1 but raises an error if it fails.
@spec tables(t()) :: {:ok, [PdfElixide.Document.Table.t()]} | {:error, PdfElixide.Error.t()}
Detects the tables of the page.
Returns {:ok, []} when the page has no detectable table.
@spec tables!(t()) :: [PdfElixide.Document.Table.t()]
Same as tables/1 but raises an error if it fails.
@spec text(t()) :: {:ok, binary()} | {:error, PdfElixide.Error.t()}
Extracts the text content of the page.
Same as text/1 but raises an error if it fails.
@spec text_lines(t()) :: {:ok, [PdfElixide.Document.TextLine.t()]} | {:error, PdfElixide.Error.t()}
Extracts the text lines of the page, each with its bounding box and words.
@spec text_lines!(t()) :: [PdfElixide.Document.TextLine.t()]
Same as text_lines/1 but raises an error if it fails.
@spec width(t()) :: {:ok, float()} | {:error, PdfElixide.Error.t()}
Returns the page's width in points.
Same as width/1 but raises an error if it fails.
@spec words(t()) :: {:ok, [PdfElixide.Document.Word.t()]} | {:error, PdfElixide.Error.t()}
Extracts the words of the page, each with its bounding box and font metadata.
@spec words!(t()) :: [PdfElixide.Document.Word.t()]
Same as words/1 but raises an error if it fails.