Skip to content

modern-pdf-lib


modern-pdf-lib / createAnnotation

Function: createAnnotation()

createAnnotation(type, options): PdfAnnotation

Defined in: src/annotation/pdfAnnotation.ts:207

Create a new annotation with the given type and options.

This is a convenience function that creates a generic PdfAnnotation. For type-specific annotations, use the subclass create() methods.

Parameters

type

AnnotationType

The annotation subtype.

options

AnnotationOptions

Creation options (rect, contents, etc.).

Returns

PdfAnnotation

A new PdfAnnotation instance.

Released under the MIT License.