UNPKG

@compdfkit_pdf_sdk/react_native

Version:

ComPDFKit for React Native is a comprehensive SDK that allows you to quickly add PDF functionality to Android, iOS, and React Native applications.

43 lines 1.18 kB
import { CPDFAnnotation } from "./CPDFAnnotation"; /** * @class CPDFNoteAnnotation * @group Annotations * @property { string } [color] The color of the annotation * @property { number } [alpha] The alpha of the annotation */ export class CPDFNoteAnnotation extends CPDFAnnotation { color; alpha; constructor(params) { super(params); this.type = 'note'; this.color = params.color ?? '#FF0000'; this.alpha = params.alpha ?? 255; } /** * Update note annotation properties with type safety * @param updates Partial object containing properties to update * @returns this instance for chaining * * @example * noteAnnotation.update({ * title: 'Updated Title', * content: 'Updated content', * color: '#FF0000', * alpha: 200 * }); * await document.updateAnnotation(noteAnnotation); */ update(updates) { Object.assign(this, updates); return this; } toJSON() { return { ...super.toJSON(), color: this.color, alpha: this.alpha, }; } } //# sourceMappingURL=CPDFNoteAnnotation.js.map