View Source Pdf.Reader.Annotations (ExPDF v1.0.1)

Walker for per-page /Annots arrays.

Iterates each page; resolves each annotation ref; dispatches by /Subtype to type-specific extraction to build %Pdf.Reader.Annotation{} structs.

Spec references

Summary

Functions

Reads all annotations from all pages in the document.

Functions

@spec read(Pdf.Reader.Document.t()) ::
  {:ok, [Pdf.Reader.Annotation.t()], Pdf.Reader.Document.t()} | {:error, term()}

Reads all annotations from all pages in the document.

Returns {:ok, [Annotation.t()], doc} where annotations are ordered page-ascending. When no page has an /Annots array, returns {:ok, [], doc}.

The returned doc may have a warmer cache than the input.