NativeElixirPdfUtilities.Validators.ImageMapValidator (native_elixir_pdf_utilities v1.1.0)

View Source

Canonical scoped HTML image-map association, area parsing and ordered hit testing.

Summary

Functions

Associates a usemap hash-name with the first map in the same authored tree.

Returns the first covering area's destination, a deliberate no-link mask, or no area. Coordinates are CSS pixels after image stretching.

Looks up the top painted image-map link at a real PDF-page point using the writer's actual composed/clipped geometry.

Indexes the first named map in each authored document/tree scope, excluding inert templates.

Functions

associate(node, index)

@spec associate(map(), map()) :: map() | nil

Associates a usemap hash-name with the first map in the same authored tree.

hit_test(model, x, y, width, height)

@spec hit_test(map(), term(), term(), term(), term()) ::
  {:ok, term()} | {:blocked, term()} | :none | {:error, {atom(), map()}}

Returns the first covering area's destination, a deliberate no-link mask, or no area. Coordinates are CSS pixels after image stretching.

lookup(pages, page_number, x, y)

@spec lookup(term(), term(), term(), term()) ::
  {:ok, term()} | :none | {:error, {atom(), map()}}

Looks up the top painted image-map link at a real PDF-page point using the writer's actual composed/clipped geometry.

prepare(children, links)

@spec prepare([map()], map()) :: {:ok, map()} | {:error, {atom(), map()}}

Indexes the first named map in each authored document/tree scope, excluding inert templates.