Perplexed.PdfPolicy (Perplexed v0.3.0)

Copy Markdown View Source

Validated PDF page budgets, resolved per call before application settings.

Summary

Functions

Whether a resolved policy limits PDF conversion.

Recognizes a PDF header in the first 1024 raw bytes.

Whether the URL path names a PDF.

Resolves and validates page budget options.

Functions

active?(opts)

@spec active?(keyword()) :: boolean()

Whether a resolved policy limits PDF conversion.

pdf?(body)

@spec pdf?(binary()) :: boolean()

Recognizes a PDF header in the first 1024 raw bytes.

pdf_url?(url)

@spec pdf_url?(String.t() | nil) :: boolean()

Whether the URL path names a PDF.

resolve(opts)

@spec resolve(keyword()) :: {:ok, keyword()} | {:error, {:invalid_request, map()}}

Resolves and validates page budget options.