MCPcopy Create free account
hub / github.com/LibPDF-js/core / addLineAnnotation

Method addLineAnnotation

src/api/pdf-page.ts:2122–2131  ·  view source on GitHub ↗

* Add a line annotation. * * @param options - Line annotation options * @returns The created annotation

(options: LineAnnotationOptions)

Source from the content-addressed store, hash-verified

2120 * @returns The created annotation
2121 */
2122 addLineAnnotation(options: LineAnnotationOptions): PDFLineAnnotation {
2123 const annotDict = PDFLineAnnotation.create(options);
2124
2125 // Register and add to page
2126 const annotRef = this.ctx.register(annotDict);
2127 this.addAnnotationRef(annotRef);
2128
2129 // oxlint-disable-next-line typescript/no-unsafe-type-assertion
2130 return createAnnotation(annotDict, annotRef, this.ctx.registry) as PDFLineAnnotation;
2131 }
2132
2133 /**
2134 * Add a square (rectangle) annotation.

Callers 2

Calls 4

addAnnotationRefMethod · 0.95
createAnnotationFunction · 0.90
createMethod · 0.65
registerMethod · 0.45

Tested by

no test coverage detected