PaperForge.Protection (PaperForge v1.4.1)

Copy Markdown View Source

Document-level protection policies independent from password encryption.

Protection can add watermarks and tamper-evident metadata, and can reject links or attachments that exceed an application's resource policy.

Summary

Functions

Applies watermark, audit policy, unique identifier, and fingerprint options.

Audits links and embedded files without mutating the document.

Returns a stable SHA-256 fingerprint of the document's semantic PDF objects.

Checks a document against its embedded PaperForge fingerprint.

Adds a centered text watermark to every page.

Types

issue()

@type issue() :: %{code: atom(), message: binary(), object_id: pos_integer()}

Functions

apply(document, options)

Applies watermark, audit policy, unique identifier, and fingerprint options.

audit(document, options \\ [])

@spec audit(
  PaperForge.Document.t(),
  keyword()
) :: {:ok, map()} | {:error, [issue()]}

Audits links and embedded files without mutating the document.

fingerprint(document)

@spec fingerprint(PaperForge.Document.t()) :: binary()

Returns a stable SHA-256 fingerprint of the document's semantic PDF objects.

verify_fingerprint(document)

@spec verify_fingerprint(PaperForge.Document.t()) ::
  :ok | {:error, :missing_fingerprint | :modified}

Checks a document against its embedded PaperForge fingerprint.

watermark(document, options)

@spec watermark(
  PaperForge.Document.t(),
  keyword()
) :: PaperForge.Document.t()

Adds a centered text watermark to every page.