Arcana.FileParser.PDF.Poppler (Arcana v3.0.0)

Copy Markdown View Source

PDF parser using poppler's pdftotext command.

This is the default PDF parser for Arcana. It requires the pdftotext command from the Poppler library to be installed on the system.

Installation

# macOS
brew install poppler

# Ubuntu/Debian
apt-get install poppler-utils

# Fedora
dnf install poppler-utils

Options

  • :layout - Preserve original text layout (default: true)

Return shape

parse/2 returns {:ok, text, %{pages: [...]}} — the three-element form Arcana.FileParser allows — so callers can map chunks back to page numbers. Code that only wants the text should go through Arcana.FileParser.PDF.parse/3 or Arcana.Parser.parse/1, both of which normalize to {:ok, text}.

Summary

Functions

Checks if pdftotext is available on the system.

Returns false - Poppler requires a file path, not binary content.

Functions

available?()

Checks if pdftotext is available on the system.

Examples

iex> Arcana.FileParser.PDF.Poppler.available?()
true  # or false if poppler not installed

supports_binary?()

Returns false - Poppler requires a file path, not binary content.