NativeElixirPdfUtilities.Text (native_elixir_pdf_utilities v0.2.0)
View SourceBest-effort embedded text extraction for classic PDFs.
This module is native Elixir and does not perform OCR. It reads PDF content streams, decodes supported Flate-compressed streams, applies ToUnicode CMaps where present, and reconstructs approximate page layout from text matrix coordinates.
Summary
Functions
Extracts embedded text from a PDF binary.
Reads a PDF file and extracts embedded text from it.
Types
Functions
@spec extract(binary(), [extract_option()]) :: {:ok, String.t()} | {:error, atom()}
Extracts embedded text from a PDF binary.
Options:
:layout- when true, approximate visible text layout using spaces and line breaks. This is currently the only output mode and defaults to true.
@spec extract_file(String.t(), [extract_option()]) :: {:ok, String.t()} | {:error, atom() | File.posix()}
Reads a PDF file and extracts embedded text from it.