ExPdfInspector.DetectionOptions (ExPdfInspector v0.1.0)

Copy Markdown View Source

Configures how PDF pages are inspected to identify the document type.

The default strategy inspects a sample of up to eight pages:

%ExPdfInspector.DetectionOptions{}

To inspect every page, use:

%ExPdfInspector.DetectionOptions{strategy: :full}

min_text_ops_per_page sets the number of text operations required for a page to be considered text-based. text_page_ratio_threshold sets the minimum ratio of text-based pages used to classify the document.

Summary

Types

The strategy used to select pages during detection.

t()

Options used to detect the type of a PDF.

Types

strategy()

@type strategy() ::
  :early_exit
  | :full
  | {:sample, non_neg_integer()}
  | {:pages, [non_neg_integer()]}

The strategy used to select pages during detection.

  • :early_exit stops as soon as enough information is available;
  • :full inspects every page;
  • {:sample, count} inspects a sample of pages;
  • {:pages, pages} inspects only the given page indexes.

t()

@type t() :: %ExPdfInspector.DetectionOptions{
  min_text_ops_per_page: non_neg_integer(),
  strategy: strategy(),
  text_page_ratio_threshold: float()
}

Options used to detect the type of a PDF.