PdfElixide.Form (pdf_elixide v0.3.1)

Copy Markdown View Source

Representation of the form fields within a PDF document.

Summary

Functions

Extracts form fields from the given PDF document or editor.

Extracts form fields from the given PDF document or editor, raising an error if it fails.

Sets the value of an existing form field on the given editor.

Sets the value of an existing form field on the given editor, raising an error if it fails.

Types

source()

@type source() :: PdfElixide.Document.t() | PdfElixide.Editor.t()

Functions

fields(arg1)

@spec fields(source()) :: {:ok, [PdfElixide.Form.Field.t()]} | {:error, term()}

Extracts form fields from the given PDF document or editor.

fields!(source)

@spec fields!(source()) :: [PdfElixide.Form.Field.t()]

Extracts form fields from the given PDF document or editor, raising an error if it fails.

set_value(editor, name, value)

@spec set_value(PdfElixide.Editor.t(), String.t(), PdfElixide.Form.Field.value()) ::
  :ok | {:error, term()}

Sets the value of an existing form field on the given editor.

The value uses the same tagged-tuple shape returned by fields/1 (e.g. {:text, "Jane Doe"}, {:boolean, true}, nil).

set_value!(editor, name, value)

@spec set_value!(PdfElixide.Editor.t(), String.t(), PdfElixide.Form.Field.value()) ::
  :ok

Sets the value of an existing form field on the given editor, raising an error if it fails.