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

Method addAnnotationRef

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

* Add an annotation reference to the page's /Annots array. * Internal method - also invalidates the annotation cache.

(annotRef: PdfRef)

Source from the content-addressed store, hash-verified

2332 * Internal method - also invalidates the annotation cache.
2333 */
2334 private addAnnotationRef(annotRef: PdfRef): void {
2335 let annots = this.dict.getArray("Annots");
2336
2337 if (!annots) {
2338 annots = new PdfArray([]);
2339 this.dict.set("Annots", annots);
2340 }
2341
2342 annots.push(annotRef);
2343 this.invalidateAnnotationCache();
2344 }
2345
2346 /**
2347 * Invalidate the annotation cache.

Callers 9

drawFieldMethod · 0.95
addLinkAnnotationMethod · 0.95
addTextAnnotationMethod · 0.95
addLineAnnotationMethod · 0.95
addSquareAnnotationMethod · 0.95
addCircleAnnotationMethod · 0.95
addStampAnnotationMethod · 0.95
addInkAnnotationMethod · 0.95

Calls 4

getArrayMethod · 0.80
pushMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected