@embedpdf/engines 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +709 -378
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +162 -66
- package/dist/index.js +710 -379
- package/dist/index.js.map +1 -1
- package/dist/pdfium-direct-engine.cjs +653 -358
- package/dist/pdfium-direct-engine.cjs.map +1 -1
- package/dist/pdfium-direct-engine.d.ts +153 -59
- package/dist/pdfium-direct-engine.js +654 -359
- package/dist/pdfium-direct-engine.js.map +1 -1
- package/dist/pdfium-worker-engine.cjs +40 -10
- package/dist/pdfium-worker-engine.cjs.map +1 -1
- package/dist/pdfium-worker-engine.d.ts +10 -8
- package/dist/pdfium-worker-engine.js +40 -10
- package/dist/pdfium-worker-engine.js.map +1 -1
- package/dist/pdfium.cjs +661 -360
- package/dist/pdfium.cjs.map +1 -1
- package/dist/pdfium.d.ts +153 -59
- package/dist/pdfium.js +662 -361
- package/dist/pdfium.js.map +1 -1
- package/dist/preact.cjs +4 -3
- package/dist/preact.cjs.map +1 -1
- package/dist/preact.d.ts +4 -3
- package/dist/preact.js +4 -3
- package/dist/preact.js.map +1 -1
- package/dist/react.cjs +4 -3
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.ts +4 -3
- package/dist/react.js +4 -3
- package/dist/react.js.map +1 -1
- package/dist/worker.cjs +39 -9
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.d.ts +10 -8
- package/dist/worker.js +39 -9
- package/dist/worker.js.map +1 -1
- package/package.json +3 -3
package/dist/pdfium.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pdfium.cjs","sources":["../src/lib/pdfium/helper.ts","../src/lib/pdfium/cache.ts","../src/lib/pdfium/engine.ts","../src/lib/webworker/runner.ts","../src/lib/pdfium/runner.ts"],"sourcesContent":["import { PdfiumRuntimeMethods, PdfiumModule } from '@embedpdf/pdfium';\n\n/**\n * Read string from WASM heap\n * @param wasmModule - pdfium wasm module instance\n * @param readChars - function to read chars\n * @param parseChars - function to parse chars\n * @param defaultLength - default length of chars that needs to read\n * @returns string from the heap\n *\n * @public\n */\nexport function readString(\n wasmModule: PdfiumRuntimeMethods & PdfiumModule,\n readChars: (buffer: number, bufferLength: number) => number,\n parseChars: (buffer: number) => string,\n defaultLength: number = 100,\n): string {\n let buffer = wasmModule.wasmExports.malloc(defaultLength);\n for (let i = 0; i < defaultLength; i++) {\n wasmModule.HEAP8[buffer + i] = 0;\n }\n const actualLength = readChars(buffer, defaultLength);\n let str: string;\n if (actualLength > defaultLength) {\n wasmModule.wasmExports.free(buffer);\n buffer = wasmModule.wasmExports.malloc(actualLength);\n for (let i = 0; i < actualLength; i++) {\n wasmModule.HEAP8[buffer + i] = 0;\n }\n readChars(buffer, actualLength);\n str = parseChars(buffer);\n } else {\n str = parseChars(buffer);\n }\n wasmModule.wasmExports.free(buffer);\n\n return str;\n}\n/**\n * Read arraybyffer from WASM heap\n * @param wasmModule - pdfium wasm module instance\n * @param readChars - function to read chars\n * @returns arraybuffer from the heap\n *\n * @public\n */\nexport function readArrayBuffer(\n wasmModule: PdfiumRuntimeMethods & PdfiumModule,\n readChars: (buffer: number, bufferLength: number) => number,\n): ArrayBuffer {\n const bufferSize = readChars(0, 0);\n\n const bufferPtr = wasmModule.wasmExports.malloc(bufferSize);\n\n readChars(bufferPtr, bufferSize);\n\n const arrayBuffer = new ArrayBuffer(bufferSize);\n const view = new DataView(arrayBuffer);\n\n for (let i = 0; i < bufferSize; i++) {\n view.setInt8(i, wasmModule.getValue(bufferPtr + i, 'i8'));\n }\n\n wasmModule.wasmExports.free(bufferPtr);\n\n return arrayBuffer;\n}\n","import { WrappedPdfiumModule } from '@embedpdf/pdfium';\n\nexport class PdfCache {\n private readonly docs = new Map<string, DocumentContext>();\n\n constructor(private readonly pdfium: WrappedPdfiumModule) {}\n\n /** Open (or re-use) a document */\n setDocument(id: string, filePtr: number, docPtr: number) {\n let ctx = this.docs.get(id);\n if (!ctx) {\n ctx = new DocumentContext(filePtr, docPtr, this.pdfium);\n this.docs.set(id, ctx);\n }\n }\n\n /** Retrieve the DocumentContext for a given PdfDocumentObject */\n getContext(docId: string): DocumentContext | undefined {\n return this.docs.get(docId);\n }\n\n /** Close & fully release a document and all its pages */\n closeDocument(docId: string): boolean {\n const ctx = this.docs.get(docId);\n if (!ctx) return false;\n ctx.dispose(); // tears down pages first, then FPDF_CloseDocument, free()\n this.docs.delete(docId);\n return true;\n }\n}\n\nexport class DocumentContext {\n private readonly pageCache: PageCache;\n\n constructor(\n public readonly filePtr: number,\n public readonly docPtr: number,\n pdfium: WrappedPdfiumModule,\n ) {\n this.pageCache = new PageCache(pdfium, docPtr);\n }\n\n /** Main accessor for pages */\n acquirePage(pageIdx: number): PageContext {\n return this.pageCache.acquire(pageIdx);\n }\n\n /** Tear down all pages + this document */\n dispose(): void {\n // 1️⃣ release all pages (with their TTL or immediate)\n this.pageCache.forceReleaseAll();\n\n // 2️⃣ close the PDFium document\n this.pageCache.pdf.FPDF_CloseDocument(this.docPtr);\n\n // 3️⃣ free the file handle\n this.pageCache.pdf.pdfium.wasmExports.free(this.filePtr);\n }\n}\n\nexport class PageCache {\n private readonly cache = new Map<number, PageContext>();\n\n constructor(\n public readonly pdf: WrappedPdfiumModule,\n private readonly docPtr: number,\n ) {}\n\n acquire(pageIdx: number): PageContext {\n let ctx = this.cache.get(pageIdx);\n if (!ctx) {\n const pagePtr = this.pdf.FPDF_LoadPage(this.docPtr, pageIdx);\n ctx = new PageContext(this.pdf, this.docPtr, pageIdx, pagePtr, () => {\n this.cache.delete(pageIdx);\n });\n this.cache.set(pageIdx, ctx);\n }\n ctx.clearExpiryTimer(); // cancel any pending teardown\n ctx.bumpRefCount(); // bump ref‐count\n return ctx;\n }\n\n forceReleaseAll(): void {\n for (const ctx of this.cache.values()) {\n ctx.disposeImmediate();\n }\n this.cache.clear();\n }\n}\n\nconst PAGE_TTL = 5000; // 5 seconds\n\nexport class PageContext {\n private refCount = 0;\n private expiryTimer?: ReturnType<typeof setTimeout>;\n private disposed = false;\n\n // lazy helpers\n private textPagePtr?: number;\n private formInfoPtr?: number;\n private formHandle?: number;\n\n constructor(\n private readonly pdf: WrappedPdfiumModule,\n public readonly docPtr: number,\n public readonly pageIdx: number,\n public readonly pagePtr: number,\n private readonly onFinalDispose: () => void,\n ) {}\n\n /** Called by PageCache.acquire() */\n bumpRefCount() {\n if (this.disposed) throw new Error('Context already disposed');\n this.refCount++;\n }\n\n /** Called by PageCache.acquire() */\n clearExpiryTimer() {\n if (this.expiryTimer) {\n clearTimeout(this.expiryTimer);\n this.expiryTimer = undefined;\n }\n }\n\n /** Called by PageCache.release() internally */\n release() {\n if (this.disposed) return;\n this.refCount--;\n if (this.refCount === 0) {\n // schedule the one-and-only timer for the page\n this.expiryTimer = setTimeout(() => this.disposeImmediate(), PAGE_TTL);\n }\n }\n\n /** Tear down _all_ sub-pointers & the page. */\n disposeImmediate() {\n if (this.disposed) return;\n this.disposed = true;\n\n // 2️⃣ close text-page if opened\n if (this.textPagePtr !== undefined) {\n this.pdf.FPDFText_ClosePage(this.textPagePtr);\n }\n\n // 3️⃣ close form-fill if opened\n if (this.formHandle !== undefined) {\n this.pdf.FORM_OnBeforeClosePage(this.pagePtr, this.formHandle);\n this.pdf.PDFiumExt_ExitFormFillEnvironment(this.formHandle);\n }\n if (this.formInfoPtr !== undefined) {\n this.pdf.PDFiumExt_CloseFormFillInfo(this.formInfoPtr);\n }\n\n // 4️⃣ finally close the page itself\n this.pdf.FPDF_ClosePage(this.pagePtr);\n\n // 5️⃣ remove from the cache\n this.onFinalDispose();\n }\n\n // ── public helpers ──\n\n /** Always safe: opens (once) and returns the text-page ptr. */\n getTextPage(): number {\n this.ensureAlive();\n if (this.textPagePtr === undefined) {\n this.textPagePtr = this.pdf.FPDFText_LoadPage(this.pagePtr);\n }\n return this.textPagePtr;\n }\n\n /** Always safe: opens (once) and returns the form-fill handle. */\n getFormHandle(): number {\n this.ensureAlive();\n if (this.formHandle === undefined) {\n this.formInfoPtr = this.pdf.PDFiumExt_OpenFormFillInfo();\n this.formHandle = this.pdf.PDFiumExt_InitFormFillEnvironment(this.docPtr, this.formInfoPtr);\n this.pdf.FORM_OnAfterLoadPage(this.pagePtr, this.formHandle);\n }\n return this.formHandle;\n }\n\n /**\n * Safely execute `fn` with an annotation pointer.\n * Pointer is ALWAYS closed afterwards.\n */\n withAnnotation<T>(annotIdx: number, fn: (annotPtr: number) => T): T {\n this.ensureAlive();\n const annotPtr = this.pdf.FPDFPage_GetAnnot(this.pagePtr, annotIdx);\n try {\n return fn(annotPtr);\n } finally {\n this.pdf.FPDFPage_CloseAnnot(annotPtr);\n }\n }\n\n private ensureAlive() {\n if (this.disposed) throw new Error('PageContext already disposed');\n }\n}\n","import {\n PdfActionObject,\n PdfAnnotationObject,\n PdfTextRectObject,\n PdfAnnotationSubtype,\n PdfLinkAnnoObject,\n PdfWidgetAnnoObject,\n PdfLinkTarget,\n PdfZoomMode,\n Logger,\n NoopLogger,\n SearchResult,\n SearchTarget,\n MatchFlag,\n PdfDestinationObject,\n PdfBookmarkObject,\n PdfDocumentObject,\n PdfEngine,\n PdfPageObject,\n PdfActionType,\n Rotation,\n PDF_FORM_FIELD_FLAG,\n PDF_FORM_FIELD_TYPE,\n PdfWidgetAnnoOption,\n PdfFileAttachmentAnnoObject,\n Rect,\n PdfAttachmentObject,\n PdfUnsupportedAnnoObject,\n PdfTextAnnoObject,\n PdfPopupAnnoObject,\n PdfSignatureObject,\n PdfRenderOptions,\n PdfInkAnnoObject,\n PdfInkListObject,\n Position,\n PdfStampAnnoObject,\n PdfCircleAnnoObject,\n PdfSquareAnnoObject,\n PdfFreeTextAnnoObject,\n PdfCaretAnnoObject,\n PdfSquigglyAnnoObject,\n PdfStrikeOutAnnoObject,\n PdfUnderlineAnnoObject,\n transformSize,\n PdfFile,\n PdfAnnotationObjectStatus,\n PdfAnnotationTransformation,\n PdfSegmentObject,\n AppearanceMode,\n PdfImageObject,\n PdfPageObjectType,\n PdfPathObject,\n PdfFormObject,\n PdfPolygonAnnoObject,\n PdfPolylineAnnoObject,\n PdfLineAnnoObject,\n PdfHighlightAnnoObject,\n PdfStampAnnoObjectContents,\n PdfWidgetAnnoField,\n PdfTransformMatrix,\n FormFieldValue,\n PdfErrorCode,\n PdfTaskHelper,\n PdfPageFlattenFlag,\n PdfPageFlattenResult,\n PdfTask,\n PdfFileLoader,\n transformRect,\n SearchAllPagesResult,\n PdfUrlOptions,\n PdfFileUrl,\n Task,\n PdfErrorReason,\n TextContext,\n PdfGlyphObject,\n PdfPageGeometry,\n PdfRun,\n toIntRect,\n toIntSize,\n Quad,\n PdfAlphaColor,\n PdfAnnotationState,\n PdfAnnotationStateModel,\n quadToRect,\n PdfImage,\n ImageConversionTypes,\n PageTextSlice,\n stripPdfUnwantedMarkers,\n} from '@embedpdf/models';\nimport { readArrayBuffer, readString } from './helper';\nimport { WrappedPdfiumModule } from '@embedpdf/pdfium';\nimport { DocumentContext, PageContext, PdfCache } from './cache';\n\n/**\n * Format of bitmap\n */\nexport enum BitmapFormat {\n Bitmap_Gray = 1,\n Bitmap_BGR = 2,\n Bitmap_BGRx = 3,\n Bitmap_BGRA = 4,\n}\n\n/**\n * Pdf rendering flag\n */\nexport enum RenderFlag {\n ANNOT = 0x01, // Set if annotations are to be rendered.\n LCD_TEXT = 0x02, // Set if using text rendering optimized for LCD display.\n NO_NATIVETEXT = 0x04, // Don't use the native text output available on some platforms\n GRAYSCALE = 0x08, // Grayscale output.\n DEBUG_INFO = 0x80, // Set if you want to get some debug info. Please discuss with Foxit first if you need to collect debug info.\n NO_CATCH = 0x100, // Set if you don't want to catch exception.\n RENDER_LIMITEDIMAGECACHE = 0x200, // Limit image cache size.\n RENDER_FORCEHALFTONE = 0x400, // Always use halftone for image stretching.\n PRINTING = 0x800, // Render for printing.\n REVERSE_BYTE_ORDER = 0x10, // Set whether render in a reverse Byte order, this flag only.\n}\n\nconst LOG_SOURCE = 'PDFiumEngine';\nconst LOG_CATEGORY = 'Engine';\n\n/**\n * Context used for searching\n */\nexport interface SearchContext {\n /**\n * search target\n */\n target: SearchTarget;\n /**\n * current page index\n */\n currPageIndex: number;\n /**\n * index of text in the current pdf page, -1 means reach the end\n */\n startIndex: number;\n}\n\n/**\n * Error code of pdfium library\n */\nexport enum PdfiumErrorCode {\n Success = 0,\n Unknown = 1,\n File = 2,\n Format = 3,\n Password = 4,\n Security = 5,\n Page = 6,\n XFALoad = 7,\n XFALayout = 8,\n}\n\n/**\n * Function type for converting ImageData to Blob\n * In browser: uses OffscreenCanvas\n * In Node.js: can use Sharp or other image processing libraries\n */\nexport type ImageDataConverter<T = Blob> = (\n imageData: PdfImage,\n imageType?: ImageConversionTypes,\n) => Promise<T>;\n\nexport const browserImageDataToBlobConverter: ImageDataConverter<Blob> = (\n pdfImageData: PdfImage,\n imageType: ImageConversionTypes = 'image/webp',\n): Promise<Blob> => {\n // Check if we're in a browser environment\n if (typeof OffscreenCanvas === 'undefined') {\n throw new Error(\n 'OffscreenCanvas is not available in this environment. ' +\n 'This converter is intended for browser use only. ' +\n 'Please use createNodeImageDataToBlobConverter() or createNodeCanvasImageDataToBlobConverter() for Node.js.',\n );\n }\n\n const imageData = new ImageData(pdfImageData.data, pdfImageData.width, pdfImageData.height);\n const off = new OffscreenCanvas(imageData.width, imageData.height);\n off.getContext('2d')!.putImageData(imageData, 0, 0);\n return off.convertToBlob({ type: imageType });\n};\n\n/**\n * Pdf engine that based on pdfium wasm\n */\nexport class PdfiumEngine<T = Blob> implements PdfEngine<T> {\n /**\n * pdf documents that opened\n */\n private readonly cache: PdfCache;\n\n /**\n * Create an instance of PdfiumEngine\n * @param wasmModule - pdfium wasm module\n * @param logger - logger instance\n * @param imageDataToBlobConverter - function to convert ImageData to Blob\n */\n constructor(\n private pdfiumModule: WrappedPdfiumModule,\n private logger: Logger = new NoopLogger(),\n private imageDataConverter: ImageDataConverter<T> = browserImageDataToBlobConverter as ImageDataConverter<T>,\n ) {\n this.cache = new PdfCache(this.pdfiumModule);\n }\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.initialize}\n *\n * @public\n */\n initialize() {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'initialize');\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `Initialize`, 'Begin', 'General');\n this.pdfiumModule.PDFiumExt_Init();\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `Initialize`, 'End', 'General');\n return PdfTaskHelper.resolve(true);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.destroy}\n *\n * @public\n */\n destroy() {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'destroy');\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `Destroy`, 'Begin', 'General');\n this.pdfiumModule.FPDF_DestroyLibrary();\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `Destroy`, 'End', 'General');\n return PdfTaskHelper.resolve(true);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.openDocumentUrl}\n *\n * @public\n */\n public openDocumentUrl(file: PdfFileUrl, options?: PdfUrlOptions) {\n const mode = options?.mode ?? 'auto';\n const password = options?.password ?? '';\n\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'openDocumentUrl called', file.url, mode);\n\n // We'll create a task to wrap asynchronous steps\n const task = PdfTaskHelper.create<PdfDocumentObject>();\n\n // Start an async procedure\n (async () => {\n try {\n // Decide on approach\n if (mode === 'full-fetch') {\n const fetchFullTask = await this.fetchFullAndOpen(file, password);\n fetchFullTask.wait(\n (doc) => task.resolve(doc),\n (err) => task.reject(err.reason),\n );\n } else if (mode === 'range-request') {\n const openDocumentWithRangeRequestTask = await this.openDocumentWithRangeRequest(\n file,\n password,\n );\n openDocumentWithRangeRequestTask.wait(\n (doc) => task.resolve(doc),\n (err) => task.reject(err.reason),\n );\n } else {\n // mode: 'auto'\n const { supportsRanges, fileLength, content } = await this.checkRangeSupport(file.url);\n if (supportsRanges) {\n const openDocumentWithRangeRequestTask = await this.openDocumentWithRangeRequest(\n file,\n password,\n fileLength,\n );\n openDocumentWithRangeRequestTask.wait(\n (doc) => task.resolve(doc),\n (err) => task.reject(err.reason),\n );\n } else if (content) {\n // If we already have the content from the range check, use it\n const pdfFile: PdfFile = { id: file.id, content };\n this.openDocumentFromBuffer(pdfFile, password).wait(\n (doc) => task.resolve(doc),\n (err) => task.reject(err.reason),\n );\n } else {\n const fetchFullTask = await this.fetchFullAndOpen(file, password);\n fetchFullTask.wait(\n (doc) => task.resolve(doc),\n (err) => task.reject(err.reason),\n );\n }\n }\n } catch (err) {\n this.logger.error(LOG_SOURCE, LOG_CATEGORY, 'openDocumentUrl error', err);\n task.reject({\n code: PdfErrorCode.Unknown,\n message: String(err),\n });\n }\n })();\n\n return task;\n }\n\n /**\n * Check if the server supports range requests:\n * Sends a HEAD request and sees if 'Accept-Ranges: bytes'.\n */\n private async checkRangeSupport(\n url: string,\n ): Promise<{ supportsRanges: boolean; fileLength: number; content: ArrayBuffer | null }> {\n try {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'checkRangeSupport', url);\n\n // First try HEAD request\n const headResponse = await fetch(url, { method: 'HEAD' });\n const fileLength = headResponse.headers.get('Content-Length');\n const acceptRanges = headResponse.headers.get('Accept-Ranges');\n\n // If server explicitly supports ranges, we're done\n if (acceptRanges === 'bytes') {\n return {\n supportsRanges: true,\n fileLength: parseInt(fileLength ?? '0'),\n content: null,\n };\n }\n\n // Test actual range request support\n const testResponse = await fetch(url, {\n headers: { Range: 'bytes=0-1' },\n });\n\n // If we get 200 instead of 206, server doesn't support ranges\n // Return the full content since we'll need it anyway\n if (testResponse.status === 200) {\n const content = await testResponse.arrayBuffer();\n return {\n supportsRanges: false,\n fileLength: parseInt(fileLength ?? '0'),\n content: content,\n };\n }\n\n // 206 Partial Content indicates range support\n return {\n supportsRanges: testResponse.status === 206,\n fileLength: parseInt(fileLength ?? '0'),\n content: null,\n };\n } catch (e) {\n this.logger.error(LOG_SOURCE, LOG_CATEGORY, 'checkRangeSupport failed', e);\n throw new Error('Failed to check range support: ' + e);\n }\n }\n\n /**\n * Fully fetch the file (using fetch) into an ArrayBuffer,\n * then call openDocumentFromBuffer.\n */\n private async fetchFullAndOpen(file: PdfFileUrl, password: string) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'fetchFullAndOpen', file.url);\n\n // 1. fetch entire PDF as array buffer\n const response = await fetch(file.url);\n if (!response.ok) {\n throw new Error(`Could not fetch PDF: ${response.statusText}`);\n }\n const arrayBuf = await response.arrayBuffer();\n\n // 2. create a PdfFile object\n const pdfFile: PdfFile = {\n id: file.id,\n content: arrayBuf,\n };\n\n // 3. call openDocumentFromBuffer (the method you already have)\n // that returns a PdfTask, but let's wrap it in a Promise\n return this.openDocumentFromBuffer(pdfFile, password);\n }\n\n /**\n * Use your synchronous partial-loading approach:\n * - In your snippet, it's done via `openDocumentFromLoader`.\n * - We'll do a synchronous XHR read callback that pulls\n * the desired byte ranges.\n */\n private async openDocumentWithRangeRequest(\n file: PdfFileUrl,\n password: string,\n knownFileLength?: number,\n ) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'openDocumentWithRangeRequest', file.url);\n\n // We first do a HEAD or a partial fetch to get the fileLength:\n const fileLength = knownFileLength ?? (await this.retrieveFileLength(file.url)).fileLength;\n\n // 2. define the callback function used by openDocumentFromLoader\n const callback = (offset: number, length: number) => {\n // Perform synchronous XHR:\n const xhr = new XMLHttpRequest();\n xhr.open('GET', file.url, false); // note: block in the Worker\n xhr.overrideMimeType('text/plain; charset=x-user-defined');\n xhr.setRequestHeader('Range', `bytes=${offset}-${offset + length - 1}`);\n xhr.send(null);\n\n if (xhr.status === 206 || xhr.status === 200) {\n return this.convertResponseToUint8Array(xhr.responseText);\n }\n throw new Error(`Range request failed with status ${xhr.status}`);\n };\n\n // 3. call `openDocumentFromLoader`\n return this.openDocumentFromLoader(\n {\n id: file.id,\n fileLength,\n callback,\n },\n password,\n );\n }\n\n /**\n * Helper to do a HEAD request or partial GET to find file length.\n */\n private async retrieveFileLength(url: string): Promise<{ fileLength: number }> {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'retrieveFileLength', url);\n\n // We'll do a HEAD request to get Content-Length\n const resp = await fetch(url, { method: 'HEAD' });\n if (!resp.ok) {\n throw new Error(`Failed HEAD request for file length: ${resp.statusText}`);\n }\n const lenStr = resp.headers.get('Content-Length') || '0';\n const fileLength = parseInt(lenStr, 10) || 0;\n if (!fileLength) {\n throw new Error(`Content-Length not found or zero.`);\n }\n return { fileLength };\n }\n\n /**\n * Convert response text (x-user-defined) to a Uint8Array\n * for partial data.\n */\n private convertResponseToUint8Array(text: string): Uint8Array {\n const array = new Uint8Array(text.length);\n for (let i = 0; i < text.length; i++) {\n // & 0xff ensures we only get the lower 8 bits\n array[i] = text.charCodeAt(i) & 0xff;\n }\n return array;\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.openDocument}\n *\n * @public\n */\n openDocumentFromBuffer(file: PdfFile, password: string = '') {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'openDocumentFromBuffer', file, password);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `OpenDocumentFromBuffer`, 'Begin', file.id);\n const array = new Uint8Array(file.content);\n const length = array.length;\n const filePtr = this.malloc(length);\n this.pdfiumModule.pdfium.HEAPU8.set(array, filePtr);\n\n const docPtr = this.pdfiumModule.FPDF_LoadMemDocument(filePtr, length, password);\n\n if (!docPtr) {\n const lastError = this.pdfiumModule.FPDF_GetLastError();\n this.logger.error(LOG_SOURCE, LOG_CATEGORY, `FPDF_LoadMemDocument failed with ${lastError}`);\n this.free(filePtr);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `OpenDocumentFromBuffer`, 'End', file.id);\n\n return PdfTaskHelper.reject<PdfDocumentObject>({\n code: lastError,\n message: `FPDF_LoadMemDocument failed`,\n });\n }\n\n const pageCount = this.pdfiumModule.FPDF_GetPageCount(docPtr);\n\n const pages: PdfPageObject[] = [];\n const sizePtr = this.malloc(8);\n for (let index = 0; index < pageCount; index++) {\n const result = this.pdfiumModule.FPDF_GetPageSizeByIndexF(docPtr, index, sizePtr);\n if (!result) {\n const lastError = this.pdfiumModule.FPDF_GetLastError();\n this.logger.error(\n LOG_SOURCE,\n LOG_CATEGORY,\n `FPDF_GetPageSizeByIndexF failed with ${lastError}`,\n );\n this.free(sizePtr);\n this.pdfiumModule.FPDF_CloseDocument(docPtr);\n this.free(filePtr);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `OpenDocumentFromBuffer`, 'End', file.id);\n return PdfTaskHelper.reject<PdfDocumentObject>({\n code: lastError,\n message: `FPDF_GetPageSizeByIndexF failed`,\n });\n }\n\n const page = {\n index,\n size: {\n width: this.pdfiumModule.pdfium.getValue(sizePtr, 'float'),\n height: this.pdfiumModule.pdfium.getValue(sizePtr + 4, 'float'),\n },\n };\n\n pages.push(page);\n }\n this.free(sizePtr);\n\n const pdfDoc = {\n id: file.id,\n pageCount,\n pages,\n };\n\n this.cache.setDocument(file.id, filePtr, docPtr);\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `OpenDocumentFromBuffer`, 'End', file.id);\n\n return PdfTaskHelper.resolve(pdfDoc);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.openDocumentFromLoader}\n *\n * @public\n */\n openDocumentFromLoader(fileLoader: PdfFileLoader, password: string = '') {\n const { fileLength, callback, ...file } = fileLoader;\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'openDocumentFromLoader', file, password);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `OpenDocumentFromLoader`, 'Begin', file.id);\n\n const readBlock = (\n _pThis: number, // Pointer to the FPDF_FILEACCESS structure\n offset: number, // Pointer to a buffer to receive the data\n pBuf: number, // Offset position from the beginning of the file\n length: number, // Number of bytes to read\n ): number => {\n try {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'readBlock', offset, length, pBuf);\n\n if (offset < 0 || offset >= fileLength) {\n this.logger.error(LOG_SOURCE, LOG_CATEGORY, 'Offset out of bounds:', offset);\n return 0;\n }\n\n // Get data chunk using the callback\n const data = callback(offset, length);\n\n // Copy the data to PDFium's buffer\n const dest = new Uint8Array(this.pdfiumModule.pdfium.HEAPU8.buffer, pBuf, data.length);\n dest.set(data);\n\n return data.length;\n } catch (error) {\n this.logger.error(LOG_SOURCE, LOG_CATEGORY, 'ReadBlock error:', error);\n return 0;\n }\n };\n\n const callbackPtr = this.pdfiumModule.pdfium.addFunction(readBlock, 'iiiii');\n\n // Create FPDF_FILEACCESS struct\n const structSize = 12;\n const fileAccessPtr = this.malloc(structSize);\n\n // Set up struct fields\n this.pdfiumModule.pdfium.setValue(fileAccessPtr, fileLength, 'i32');\n this.pdfiumModule.pdfium.setValue(fileAccessPtr + 4, callbackPtr, 'i32');\n this.pdfiumModule.pdfium.setValue(fileAccessPtr + 8, 0, 'i32');\n\n // Load document\n const docPtr = this.pdfiumModule.FPDF_LoadCustomDocument(fileAccessPtr, password);\n\n if (!docPtr) {\n const lastError = this.pdfiumModule.FPDF_GetLastError();\n this.logger.error(\n LOG_SOURCE,\n LOG_CATEGORY,\n `FPDF_LoadCustomDocument failed with ${lastError}`,\n );\n this.free(fileAccessPtr);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `OpenDocumentFromLoader`, 'End', file.id);\n\n return PdfTaskHelper.reject<PdfDocumentObject>({\n code: lastError,\n message: `FPDF_LoadCustomDocument failed`,\n });\n }\n\n const pageCount = this.pdfiumModule.FPDF_GetPageCount(docPtr);\n\n const pages: PdfPageObject[] = [];\n const sizePtr = this.malloc(8);\n for (let index = 0; index < pageCount; index++) {\n const result = this.pdfiumModule.FPDF_GetPageSizeByIndexF(docPtr, index, sizePtr);\n if (!result) {\n const lastError = this.pdfiumModule.FPDF_GetLastError();\n this.logger.error(\n LOG_SOURCE,\n LOG_CATEGORY,\n `FPDF_GetPageSizeByIndexF failed with ${lastError}`,\n );\n this.free(sizePtr);\n this.pdfiumModule.FPDF_CloseDocument(docPtr);\n this.free(fileAccessPtr);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `OpenDocumentFromLoader`, 'End', file.id);\n return PdfTaskHelper.reject<PdfDocumentObject>({\n code: lastError,\n message: `FPDF_GetPageSizeByIndexF failed`,\n });\n }\n\n const page = {\n index,\n size: {\n width: this.pdfiumModule.pdfium.getValue(sizePtr, 'float'),\n height: this.pdfiumModule.pdfium.getValue(sizePtr + 4, 'float'),\n },\n };\n\n pages.push(page);\n }\n this.free(sizePtr);\n\n const pdfDoc = {\n id: file.id,\n pageCount,\n pages,\n };\n this.cache.setDocument(file.id, fileAccessPtr, docPtr);\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `OpenDocumentFromLoader`, 'End', file.id);\n\n return PdfTaskHelper.resolve(pdfDoc);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.getMetadata}\n *\n * @public\n */\n getMetadata(doc: PdfDocumentObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'getMetadata', doc);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetMetadata`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetMetadata`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const metadata = {\n title: this.readMetaText(ctx.docPtr, 'Title'),\n author: this.readMetaText(ctx.docPtr, 'Author'),\n subject: this.readMetaText(ctx.docPtr, 'Subject'),\n keywords: this.readMetaText(ctx.docPtr, 'Keywords'),\n producer: this.readMetaText(ctx.docPtr, 'Producer'),\n creator: this.readMetaText(ctx.docPtr, 'Creator'),\n creationDate: this.readMetaText(ctx.docPtr, 'CreationDate'),\n modificationDate: this.readMetaText(ctx.docPtr, 'ModDate'),\n };\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetMetadata`, 'End', doc.id);\n\n return PdfTaskHelper.resolve(metadata);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.getDocPermissions}\n *\n * @public\n */\n getDocPermissions(doc: PdfDocumentObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'getDocPermissions', doc);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `getDocPermissions`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `getDocPermissions`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const permissions = this.pdfiumModule.FPDF_GetDocPermissions(ctx.docPtr);\n\n return PdfTaskHelper.resolve(permissions);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.getDocUserPermissions}\n *\n * @public\n */\n getDocUserPermissions(doc: PdfDocumentObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'getDocUserPermissions', doc);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `getDocUserPermissions`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `getDocUserPermissions`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const permissions = this.pdfiumModule.FPDF_GetDocUserPermissions(ctx.docPtr);\n\n return PdfTaskHelper.resolve(permissions);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.getSignatures}\n *\n * @public\n */\n getSignatures(doc: PdfDocumentObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'getSignatures', doc);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetSignatures`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetSignatures`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const signatures: PdfSignatureObject[] = [];\n\n const count = this.pdfiumModule.FPDF_GetSignatureCount(ctx.docPtr);\n for (let i = 0; i < count; i++) {\n const signatureObjPtr = this.pdfiumModule.FPDF_GetSignatureObject(ctx.docPtr, i);\n\n const contents = readArrayBuffer(this.pdfiumModule.pdfium, (buffer, bufferSize) => {\n return this.pdfiumModule.FPDFSignatureObj_GetContents(signatureObjPtr, buffer, bufferSize);\n });\n\n const byteRange = readArrayBuffer(this.pdfiumModule.pdfium, (buffer, bufferSize) => {\n return (\n this.pdfiumModule.FPDFSignatureObj_GetByteRange(signatureObjPtr, buffer, bufferSize) * 4\n );\n });\n\n const subFilter = readArrayBuffer(this.pdfiumModule.pdfium, (buffer, bufferSize) => {\n return this.pdfiumModule.FPDFSignatureObj_GetSubFilter(signatureObjPtr, buffer, bufferSize);\n });\n\n const reason = readString(\n this.pdfiumModule.pdfium,\n (buffer, bufferLength) => {\n return this.pdfiumModule.FPDFSignatureObj_GetReason(\n signatureObjPtr,\n buffer,\n bufferLength,\n );\n },\n this.pdfiumModule.pdfium.UTF16ToString,\n );\n\n const time = readString(\n this.pdfiumModule.pdfium,\n (buffer, bufferLength) => {\n return this.pdfiumModule.FPDFSignatureObj_GetTime(signatureObjPtr, buffer, bufferLength);\n },\n this.pdfiumModule.pdfium.UTF8ToString,\n );\n\n const docMDP = this.pdfiumModule.FPDFSignatureObj_GetDocMDPPermission(signatureObjPtr);\n\n signatures.push({\n contents,\n byteRange,\n subFilter,\n reason,\n time,\n docMDP,\n });\n }\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetSignatures`, 'End', doc.id);\n\n return PdfTaskHelper.resolve(signatures);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.getBookmarks}\n *\n * @public\n */\n getBookmarks(doc: PdfDocumentObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'getBookmarks', doc);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetBookmarks`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `getBookmarks`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const bookmarks = this.readPdfBookmarks(ctx.docPtr, 0);\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetBookmarks`, 'End', doc.id);\n\n return PdfTaskHelper.resolve({\n bookmarks,\n });\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.renderPage}\n *\n * @public\n */\n renderPage(\n doc: PdfDocumentObject,\n page: PdfPageObject,\n scaleFactor: number = 1,\n rotation: Rotation = Rotation.Degree0,\n dpr: number = 1,\n options: PdfRenderOptions = { withAnnotations: false },\n imageType: ImageConversionTypes = 'image/webp',\n ): PdfTask<T> {\n const task = new Task<T, PdfErrorReason>();\n\n this.logger.debug(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'renderPage',\n doc,\n page,\n scaleFactor,\n rotation,\n dpr,\n options,\n );\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `RenderPage`, 'Begin', `${doc.id}-${page.index}`);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `RenderPage`, 'End', `${doc.id}-${page.index}`);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const imageData = this.renderPageRectToImageData(\n ctx,\n page,\n {\n origin: { x: 0, y: 0 },\n size: page.size,\n },\n scaleFactor,\n rotation,\n dpr,\n options,\n );\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `RenderPage`, 'End', `${doc.id}-${page.index}`);\n\n this.imageDataConverter(imageData, imageType).then((blob) => task.resolve(blob));\n\n return task;\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.renderPageRect}\n *\n * @public\n */\n renderPageRect(\n doc: PdfDocumentObject,\n page: PdfPageObject,\n scaleFactor: number,\n rotation: Rotation,\n dpr: number,\n rect: Rect,\n options: PdfRenderOptions,\n imageType: ImageConversionTypes = 'image/webp',\n ): PdfTask<T> {\n const task = new Task<T, PdfErrorReason>();\n\n this.logger.debug(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'renderPageRect',\n doc,\n page,\n scaleFactor,\n rotation,\n dpr,\n rect,\n options,\n );\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `RenderPageRect`,\n 'Begin',\n `${doc.id}-${page.index}`,\n );\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `RenderPageRect`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const imageData = this.renderPageRectToImageData(\n ctx,\n page,\n rect,\n scaleFactor,\n rotation,\n dpr,\n options,\n );\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `RenderPageRect`, 'End', `${doc.id}-${page.index}`);\n\n this.imageDataConverter(imageData, imageType).then((blob) => task.resolve(blob));\n\n return task;\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.getAllAnnotations}\n *\n * @public\n */\n getAllAnnotations(doc: PdfDocumentObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'getAllAnnotations', doc);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetAllAnnotations`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetAllAnnotations`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const annotations = this.readAllAnnotations(doc, ctx);\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetAllAnnotations`, 'End', doc.id);\n\n return PdfTaskHelper.resolve(annotations);\n }\n\n private readAllAnnotations(\n doc: PdfDocumentObject,\n ctx: DocumentContext,\n ): Record<number, PdfAnnotationObject[]> {\n const annotationsByPage: Record<number, PdfAnnotationObject[]> = {};\n\n for (let i = 0; i < doc.pageCount; i++) {\n const pageAnnotations = this.readPageAnnotations(ctx, doc.pages[i]);\n annotationsByPage[i] = pageAnnotations;\n }\n\n return annotationsByPage;\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.getPageAnnotations}\n *\n * @public\n */\n getPageAnnotations(doc: PdfDocumentObject, page: PdfPageObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'getPageAnnotations', doc, page);\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `GetPageAnnotations`,\n 'Begin',\n `${doc.id}-${page.index}`,\n );\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `GetPageAnnotations`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const annotations = this.readPageAnnotations(ctx, page);\n\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `GetPageAnnotations`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n\n this.logger.debug(\n LOG_SOURCE,\n LOG_CATEGORY,\n `GetPageAnnotations`,\n `${doc.id}-${page.index}`,\n annotations,\n );\n\n return PdfTaskHelper.resolve(annotations);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.createPageAnnotation}\n *\n * @public\n */\n createPageAnnotation(\n doc: PdfDocumentObject,\n page: PdfPageObject,\n annotation: PdfAnnotationObject,\n ) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'createPageAnnotation', doc, page, annotation);\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `CreatePageAnnotation`,\n 'Begin',\n `${doc.id}-${page.index}`,\n );\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `CreatePageAnnotation`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const pageCtx = ctx.acquirePage(page.index);\n const annotationPtr = this.pdfiumModule.FPDFPage_CreateAnnot(pageCtx.pagePtr, annotation.type);\n if (!annotationPtr) {\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `CreatePageAnnotation`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n pageCtx.release();\n\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantCreateAnnot,\n message: 'can not create annotation with specified type',\n });\n }\n\n if (!this.setPageAnnoRect(page, pageCtx.pagePtr, annotationPtr, annotation.rect)) {\n this.pdfiumModule.FPDFPage_CloseAnnot(annotationPtr);\n pageCtx.release();\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `CreatePageAnnotation`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantSetAnnotRect,\n message: 'can not set the rect of the annotation',\n });\n }\n\n let isSucceed = false;\n switch (annotation.type) {\n case PdfAnnotationSubtype.INK:\n isSucceed = this.addInkStroke(page, pageCtx.pagePtr, annotationPtr, annotation.inkList);\n break;\n case PdfAnnotationSubtype.STAMP:\n isSucceed = this.addStampContent(\n ctx.docPtr,\n page,\n pageCtx.pagePtr,\n annotationPtr,\n annotation.rect,\n annotation.contents,\n );\n break;\n }\n\n if (!isSucceed) {\n this.pdfiumModule.FPDFPage_RemoveAnnot(pageCtx.pagePtr, annotationPtr);\n pageCtx.release();\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `CreatePageAnnotation`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantSetAnnotContent,\n message: 'can not add content of the annotation',\n });\n }\n\n this.pdfiumModule.FPDFPage_GenerateContent(pageCtx.pagePtr);\n\n this.pdfiumModule.FPDFPage_CloseAnnot(annotationPtr);\n pageCtx.release();\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `CreatePageAnnotation`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n\n return PdfTaskHelper.resolve(true);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.transformPageAnnotation}\n *\n * @public\n */\n transformPageAnnotation(\n doc: PdfDocumentObject,\n page: PdfPageObject,\n annotation: PdfAnnotationObject,\n transformation: PdfAnnotationTransformation,\n ) {\n this.logger.debug(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'transformPageAnnotation',\n doc,\n page,\n annotation,\n transformation,\n );\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `TransformPageAnnotation`,\n 'Begin',\n `${doc.id}-${page.index}`,\n );\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `TransformPageAnnotation`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const pageCtx = ctx.acquirePage(page.index);\n const annotationPtr = this.pdfiumModule.FPDFPage_GetAnnot(pageCtx.pagePtr, annotation.id);\n const rect = {\n origin: {\n x: annotation.rect.origin.x + transformation.offset.x,\n y: annotation.rect.origin.y + transformation.offset.y,\n },\n size: {\n width: annotation.rect.size.width * transformation.scale.width,\n height: annotation.rect.size.height * transformation.scale.height,\n },\n };\n if (!this.setPageAnnoRect(page, pageCtx.pagePtr, annotationPtr, rect)) {\n this.pdfiumModule.FPDFPage_CloseAnnot(annotationPtr);\n pageCtx.release();\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `TransformPageAnnotation`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantSetAnnotRect,\n message: 'can not set the rect of the annotation',\n });\n }\n\n switch (annotation.type) {\n case PdfAnnotationSubtype.INK:\n {\n if (!this.pdfiumModule.FPDFAnnot_RemoveInkList(annotationPtr)) {\n this.pdfiumModule.FPDFPage_CloseAnnot(annotationPtr);\n pageCtx.release();\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `TransformPageAnnotation`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantRemoveInkList,\n message: 'can not set the rect of the annotation',\n });\n }\n const inkList = annotation.inkList.map((inkStroke) => {\n return {\n points: inkStroke.points.map((point) => {\n return {\n x:\n rect.origin.x +\n (point.x - annotation.rect.origin.x) * transformation.scale.width,\n y:\n rect.origin.y +\n (point.y - annotation.rect.origin.y) * transformation.scale.height,\n };\n }),\n };\n });\n if (!this.addInkStroke(page, pageCtx.pagePtr, annotationPtr, inkList)) {\n this.pdfiumModule.FPDFPage_CloseAnnot(annotationPtr);\n pageCtx.release();\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `TransformPageAnnotation`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantAddInkStoke,\n message: 'can not add stroke to the ink list of annotation',\n });\n }\n }\n break;\n }\n\n this.pdfiumModule.FPDFPage_GenerateContent(pageCtx.pagePtr);\n\n this.pdfiumModule.FPDFPage_CloseAnnot(annotationPtr);\n pageCtx.release();\n\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `TransformPageAnnotation`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.resolve(true);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.removePageAnnotation}\n *\n * @public\n */\n removePageAnnotation(\n doc: PdfDocumentObject,\n page: PdfPageObject,\n annotation: PdfAnnotationObject,\n ) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'removePageAnnotation', doc, page, annotation);\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `RemovePageAnnotation`,\n 'Begin',\n `${doc.id}-${page.index}`,\n );\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `RemovePageAnnotation`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const pageCtx = ctx.acquirePage(page.index);\n let result = false;\n result = this.pdfiumModule.FPDFPage_RemoveAnnot(pageCtx.pagePtr, annotation.id);\n if (!result) {\n this.logger.error(\n LOG_SOURCE,\n LOG_CATEGORY,\n `FPDFPage_RemoveAnnot Failed`,\n `${doc.id}-${page.index}`,\n );\n } else {\n result = this.pdfiumModule.FPDFPage_GenerateContent(pageCtx.pagePtr);\n if (!result) {\n this.logger.error(\n LOG_SOURCE,\n LOG_CATEGORY,\n `FPDFPage_GenerateContent Failed`,\n `${doc.id}-${page.index}`,\n );\n }\n }\n\n pageCtx.release();\n\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `RemovePageAnnotation`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.resolve(result);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.getPageTextRects}\n *\n * @public\n */\n getPageTextRects(\n doc: PdfDocumentObject,\n page: PdfPageObject,\n scaleFactor: number,\n rotation: Rotation,\n ) {\n this.logger.debug(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'getPageTextRects',\n doc,\n page,\n scaleFactor,\n rotation,\n );\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `GetPageTextRects`,\n 'Begin',\n `${doc.id}-${page.index}`,\n );\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `GetPageTextRects`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const pageCtx = ctx.acquirePage(page.index);\n const textPagePtr = this.pdfiumModule.FPDFText_LoadPage(pageCtx.pagePtr);\n\n const textRects = this.readPageTextRects(page, pageCtx.docPtr, pageCtx.pagePtr, textPagePtr);\n\n this.pdfiumModule.FPDFText_ClosePage(textPagePtr);\n pageCtx.release();\n\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `GetPageTextRects`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.resolve(textRects);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.renderThumbnail}\n *\n * @public\n */\n renderThumbnail(\n doc: PdfDocumentObject,\n page: PdfPageObject,\n scaleFactor: number,\n rotation: Rotation,\n dpr: number,\n ): PdfTask<T> {\n this.logger.debug(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'renderThumbnail',\n doc,\n page,\n scaleFactor,\n rotation,\n dpr,\n );\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `RenderThumbnail`,\n 'Begin',\n `${doc.id}-${page.index}`,\n );\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `RenderThumbnail`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n scaleFactor = Math.max(scaleFactor, 0.5);\n const result = this.renderPage(doc, page, scaleFactor, rotation, dpr, {\n withAnnotations: true,\n });\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `RenderThumbnail`, 'End', `${doc.id}-${page.index}`);\n\n return result;\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.getAttachments}\n *\n * @public\n */\n getAttachments(doc: PdfDocumentObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'getAttachments', doc);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetAttachments`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetAttachments`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const attachments: PdfAttachmentObject[] = [];\n\n const count = this.pdfiumModule.FPDFDoc_GetAttachmentCount(ctx.docPtr);\n for (let i = 0; i < count; i++) {\n const attachment = this.readPdfAttachment(ctx.docPtr, i);\n attachments.push(attachment);\n }\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetAttachments`, 'End', doc.id);\n return PdfTaskHelper.resolve(attachments);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.readAttachmentContent}\n *\n * @public\n */\n readAttachmentContent(doc: PdfDocumentObject, attachment: PdfAttachmentObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'readAttachmentContent', doc, attachment);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ReadAttachmentContent`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ReadAttachmentContent`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const attachmentPtr = this.pdfiumModule.FPDFDoc_GetAttachment(ctx.docPtr, attachment.index);\n const sizePtr = this.malloc(8);\n if (!this.pdfiumModule.FPDFAttachment_GetFile(attachmentPtr, 0, 0, sizePtr)) {\n this.free(sizePtr);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ReadAttachmentContent`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantReadAttachmentSize,\n message: 'can not read attachment size',\n });\n }\n const size = this.pdfiumModule.pdfium.getValue(sizePtr, 'i64');\n\n const contentPtr = this.malloc(size);\n if (!this.pdfiumModule.FPDFAttachment_GetFile(attachmentPtr, contentPtr, size, sizePtr)) {\n this.free(sizePtr);\n this.free(contentPtr);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ReadAttachmentContent`, 'End', doc.id);\n\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantReadAttachmentContent,\n message: 'can not read attachment content',\n });\n }\n\n const buffer = new ArrayBuffer(size);\n const view = new DataView(buffer);\n for (let i = 0; i < size; i++) {\n view.setInt8(i, this.pdfiumModule.pdfium.getValue(contentPtr + i, 'i8'));\n }\n\n this.free(sizePtr);\n this.free(contentPtr);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ReadAttachmentContent`, 'End', doc.id);\n\n return PdfTaskHelper.resolve(buffer);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.setFormFieldValue}\n *\n * @public\n */\n setFormFieldValue(\n doc: PdfDocumentObject,\n page: PdfPageObject,\n annotation: PdfWidgetAnnoObject,\n value: FormFieldValue,\n ) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'SetFormFieldValue', doc, annotation, value);\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `SetFormFieldValue`,\n 'Begin',\n `${doc.id}-${annotation.id}`,\n );\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'SetFormFieldValue', 'document is not opened');\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `SetFormFieldValue`,\n 'End',\n `${doc.id}-${annotation.id}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const formFillInfoPtr = this.pdfiumModule.PDFiumExt_OpenFormFillInfo();\n const formHandle = this.pdfiumModule.PDFiumExt_InitFormFillEnvironment(\n ctx.docPtr,\n formFillInfoPtr,\n );\n\n const pageCtx = ctx.acquirePage(page.index);\n\n this.pdfiumModule.FORM_OnAfterLoadPage(pageCtx.pagePtr, formHandle);\n\n const annotationPtr = this.pdfiumModule.FPDFPage_GetAnnot(pageCtx.pagePtr, annotation.id);\n\n if (!this.pdfiumModule.FORM_SetFocusedAnnot(formHandle, annotationPtr)) {\n this.logger.debug(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'SetFormFieldValue',\n 'failed to set focused annotation',\n );\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `SetFormFieldValue`,\n 'End',\n `${doc.id}-${annotation.id}`,\n );\n this.pdfiumModule.FPDFPage_CloseAnnot(annotationPtr);\n this.pdfiumModule.FORM_OnBeforeClosePage(pageCtx.pagePtr, formHandle);\n pageCtx.release();\n this.pdfiumModule.PDFiumExt_ExitFormFillEnvironment(formHandle);\n this.pdfiumModule.PDFiumExt_CloseFormFillInfo(formFillInfoPtr);\n\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantFocusAnnot,\n message: 'failed to set focused annotation',\n });\n }\n\n switch (value.kind) {\n case 'text':\n {\n if (!this.pdfiumModule.FORM_SelectAllText(formHandle, pageCtx.pagePtr)) {\n this.logger.debug(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'SetFormFieldValue',\n 'failed to select all text',\n );\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `SetFormFieldValue`,\n 'End',\n `${doc.id}-${annotation.id}`,\n );\n this.pdfiumModule.FORM_ForceToKillFocus(formHandle);\n this.pdfiumModule.FPDFPage_CloseAnnot(annotationPtr);\n this.pdfiumModule.FORM_OnBeforeClosePage(pageCtx.pagePtr, formHandle);\n pageCtx.release();\n this.pdfiumModule.PDFiumExt_ExitFormFillEnvironment(formHandle);\n this.pdfiumModule.PDFiumExt_CloseFormFillInfo(formFillInfoPtr);\n\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantSelectText,\n message: 'failed to select all text',\n });\n }\n const length = 2 * (value.text.length + 1);\n const textPtr = this.malloc(length);\n this.pdfiumModule.pdfium.stringToUTF16(value.text, textPtr, length);\n this.pdfiumModule.FORM_ReplaceSelection(formHandle, pageCtx.pagePtr, textPtr);\n this.free(textPtr);\n }\n break;\n case 'selection':\n {\n if (\n !this.pdfiumModule.FORM_SetIndexSelected(\n formHandle,\n pageCtx.pagePtr,\n value.index,\n value.isSelected,\n )\n ) {\n this.logger.debug(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'SetFormFieldValue',\n 'failed to set index selected',\n );\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `SetFormFieldValue`,\n 'End',\n `${doc.id}-${annotation.id}`,\n );\n this.pdfiumModule.FORM_ForceToKillFocus(formHandle);\n this.pdfiumModule.FPDFPage_CloseAnnot(annotationPtr);\n this.pdfiumModule.FORM_OnBeforeClosePage(pageCtx.pagePtr, formHandle);\n pageCtx.release();\n this.pdfiumModule.PDFiumExt_ExitFormFillEnvironment(formHandle);\n this.pdfiumModule.PDFiumExt_CloseFormFillInfo(formFillInfoPtr);\n\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantSelectOption,\n message: 'failed to set index selected',\n });\n }\n }\n break;\n case 'checked':\n {\n const kReturn = 0x0d;\n if (!this.pdfiumModule.FORM_OnChar(formHandle, pageCtx.pagePtr, kReturn, 0)) {\n this.logger.debug(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'SetFormFieldValue',\n 'failed to set field checked',\n );\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `SetFormFieldValue`,\n 'End',\n `${doc.id}-${annotation.id}`,\n );\n this.pdfiumModule.FORM_ForceToKillFocus(formHandle);\n this.pdfiumModule.FPDFPage_CloseAnnot(annotationPtr);\n this.pdfiumModule.FORM_OnBeforeClosePage(pageCtx.pagePtr, formHandle);\n pageCtx.release();\n this.pdfiumModule.PDFiumExt_ExitFormFillEnvironment(formHandle);\n this.pdfiumModule.PDFiumExt_CloseFormFillInfo(formFillInfoPtr);\n\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantCheckField,\n message: 'failed to set field checked',\n });\n }\n }\n break;\n }\n\n this.pdfiumModule.FORM_ForceToKillFocus(formHandle);\n\n this.pdfiumModule.FPDFPage_CloseAnnot(annotationPtr);\n this.pdfiumModule.FORM_OnBeforeClosePage(pageCtx.pagePtr, formHandle);\n pageCtx.release();\n\n this.pdfiumModule.PDFiumExt_ExitFormFillEnvironment(formHandle);\n this.pdfiumModule.PDFiumExt_CloseFormFillInfo(formFillInfoPtr);\n\n return PdfTaskHelper.resolve<boolean>(true);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.flattenPage}\n *\n * @public\n */\n flattenPage(\n doc: PdfDocumentObject,\n page: PdfPageObject,\n flag: PdfPageFlattenFlag,\n ): PdfTask<PdfPageFlattenResult> {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'flattenPage', doc, page, flag);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `flattenPage`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `flattenPage`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const pageCtx = ctx.acquirePage(page.index);\n const result = this.pdfiumModule.FPDFPage_Flatten(pageCtx.pagePtr, flag);\n pageCtx.release();\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `flattenPage`, 'End', doc.id);\n\n return PdfTaskHelper.resolve(result);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.extractPages}\n *\n * @public\n */\n extractPages(doc: PdfDocumentObject, pageIndexes: number[]) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'extractPages', doc, pageIndexes);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ExtractPages`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ExtractPages`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const newDocPtr = this.pdfiumModule.FPDF_CreateNewDocument();\n if (!newDocPtr) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ExtractPages`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantCreateNewDoc,\n message: 'can not create new document',\n });\n }\n\n const pageIndexesPtr = this.malloc(pageIndexes.length * 4);\n for (let i = 0; i < pageIndexes.length; i++) {\n this.pdfiumModule.pdfium.setValue(pageIndexesPtr + i * 4, pageIndexes[i], 'i32');\n }\n\n if (\n !this.pdfiumModule.FPDF_ImportPagesByIndex(\n newDocPtr,\n ctx.docPtr,\n pageIndexesPtr,\n pageIndexes.length,\n 0,\n )\n ) {\n this.pdfiumModule.FPDF_CloseDocument(newDocPtr);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ExtractPages`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantImportPages,\n message: 'can not import pages to new document',\n });\n }\n\n const buffer = this.saveDocument(newDocPtr);\n\n this.pdfiumModule.FPDF_CloseDocument(newDocPtr);\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ExtractPages`, 'End', doc.id);\n return PdfTaskHelper.resolve(buffer);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.extractText}\n *\n * @public\n */\n extractText(doc: PdfDocumentObject, pageIndexes: number[]) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'extractText', doc, pageIndexes);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ExtractText`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ExtractText`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const strings: string[] = [];\n for (let i = 0; i < pageIndexes.length; i++) {\n const pageCtx = ctx.acquirePage(pageIndexes[i]);\n const textPagePtr = this.pdfiumModule.FPDFText_LoadPage(pageCtx.pagePtr);\n const charCount = this.pdfiumModule.FPDFText_CountChars(textPagePtr);\n const bufferPtr = this.malloc((charCount + 1) * 2);\n this.pdfiumModule.FPDFText_GetText(textPagePtr, 0, charCount, bufferPtr);\n const text = this.pdfiumModule.pdfium.UTF16ToString(bufferPtr);\n this.free(bufferPtr);\n strings.push(text);\n this.pdfiumModule.FPDFText_ClosePage(textPagePtr);\n pageCtx.release();\n }\n\n const text = strings.join('\\n\\n');\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ExtractText`, 'End', doc.id);\n return PdfTaskHelper.resolve(text);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.getTextSlices}\n *\n * @public\n */\n getTextSlices(doc: PdfDocumentObject, slices: PageTextSlice[]): PdfTask<string[]> {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'getTextSlices', doc, slices);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, 'GetTextSlices', 'Begin', doc.id);\n\n /* ⚠︎ 1 — trivial case */\n if (slices.length === 0) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, 'GetTextSlices', 'End', doc.id);\n return PdfTaskHelper.resolve<string[]>([]);\n }\n\n /* ⚠︎ 2 — document must be open */\n const ctx = this.cache.getContext(doc.id);\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, 'GetTextSlices', 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n try {\n /* keep caller order */\n const out = new Array<string>(slices.length);\n\n /* group → open each page once */\n const byPage = new Map<number, { slice: PageTextSlice; pos: number }[]>();\n slices.forEach((s, i) => {\n (byPage.get(s.pageIndex) ?? byPage.set(s.pageIndex, []).get(s.pageIndex))!.push({\n slice: s,\n pos: i,\n });\n });\n\n for (const [pageIdx, list] of byPage) {\n const pageCtx = ctx.acquirePage(pageIdx);\n const textPagePtr = pageCtx.getTextPage();\n\n for (const { slice, pos } of list) {\n const bufPtr = this.malloc(2 * (slice.charCount + 1)); // UTF-16 + NIL\n this.pdfiumModule.FPDFText_GetText(textPagePtr, slice.charIndex, slice.charCount, bufPtr);\n out[pos] = stripPdfUnwantedMarkers(this.pdfiumModule.pdfium.UTF16ToString(bufPtr));\n this.free(bufPtr);\n }\n pageCtx.release();\n }\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, 'GetTextSlices', 'End', doc.id);\n return PdfTaskHelper.resolve(out);\n } catch (e) {\n this.logger.error(LOG_SOURCE, LOG_CATEGORY, 'getTextSlices error', e);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, 'GetTextSlices', 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.Unknown,\n message: String(e),\n });\n }\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.merge}\n *\n * @public\n */\n merge(files: PdfFile[]) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'merge', files);\n const fileIds = files.map((file) => file.id).join('.');\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `Merge`, 'Begin', fileIds);\n\n const newDocPtr = this.pdfiumModule.FPDF_CreateNewDocument();\n if (!newDocPtr) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `Merge`, 'End', fileIds);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantCreateNewDoc,\n message: 'can not create new document',\n });\n }\n\n const ptrs: { docPtr: number; filePtr: number }[] = [];\n for (const file of files.reverse()) {\n const array = new Uint8Array(file.content);\n const length = array.length;\n const filePtr = this.malloc(length);\n this.pdfiumModule.pdfium.HEAPU8.set(array, filePtr);\n\n const docPtr = this.pdfiumModule.FPDF_LoadMemDocument(filePtr, length, '');\n if (!docPtr) {\n const lastError = this.pdfiumModule.FPDF_GetLastError();\n this.logger.error(\n LOG_SOURCE,\n LOG_CATEGORY,\n `FPDF_LoadMemDocument failed with ${lastError}`,\n );\n this.free(filePtr);\n\n for (const ptr of ptrs) {\n this.pdfiumModule.FPDF_CloseDocument(ptr.docPtr);\n this.free(ptr.filePtr);\n }\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `Merge`, 'End', fileIds);\n return PdfTaskHelper.reject<PdfFile>({\n code: lastError,\n message: `FPDF_LoadMemDocument failed`,\n });\n }\n ptrs.push({ filePtr, docPtr });\n\n if (!this.pdfiumModule.FPDF_ImportPages(newDocPtr, docPtr, '', 0)) {\n this.pdfiumModule.FPDF_CloseDocument(newDocPtr);\n\n for (const ptr of ptrs) {\n this.pdfiumModule.FPDF_CloseDocument(ptr.docPtr);\n this.free(ptr.filePtr);\n }\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `Merge`, 'End', fileIds);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantImportPages,\n message: 'can not import pages to new document',\n });\n }\n }\n const buffer = this.saveDocument(newDocPtr);\n\n this.pdfiumModule.FPDF_CloseDocument(newDocPtr);\n\n for (const ptr of ptrs) {\n this.pdfiumModule.FPDF_CloseDocument(ptr.docPtr);\n this.free(ptr.filePtr);\n }\n\n const file: PdfFile = {\n id: `${Math.random()}`,\n content: buffer,\n };\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `Merge`, 'End', fileIds);\n return PdfTaskHelper.resolve(file);\n }\n\n /**\n * Merges specific pages from multiple PDF documents in a custom order\n *\n * @param mergeConfigs Array of configurations specifying which pages to merge from which documents\n * @returns A PdfTask that resolves with the merged PDF file\n * @public\n */\n mergePages(mergeConfigs: Array<{ docId: string; pageIndices: number[] }>) {\n const configIds = mergeConfigs\n .map((config) => `${config.docId}:${config.pageIndices.join(',')}`)\n .join('|');\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'mergePages', mergeConfigs);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `MergePages`, 'Begin', configIds);\n\n // Create a new document to import pages into\n const newDocPtr = this.pdfiumModule.FPDF_CreateNewDocument();\n if (!newDocPtr) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `MergePages`, 'End', configIds);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantCreateNewDoc,\n message: 'Cannot create new document',\n });\n }\n\n try {\n // Process each merge configuration in reverse order (since we're inserting at position 0)\n // This ensures the final document has pages in the order specified by the user\n for (const config of [...mergeConfigs].reverse()) {\n // Check if the document is open\n const ctx = this.cache.getContext(config.docId);\n\n if (!ctx) {\n this.logger.warn(\n LOG_SOURCE,\n LOG_CATEGORY,\n `Document ${config.docId} is not open, skipping`,\n );\n continue;\n }\n\n // Get the page count for this document\n const pageCount = this.pdfiumModule.FPDF_GetPageCount(ctx.docPtr);\n\n // Filter out invalid page indices\n const validPageIndices = config.pageIndices.filter(\n (index) => index >= 0 && index < pageCount,\n );\n\n if (validPageIndices.length === 0) {\n continue; // No valid pages to import\n }\n\n // Convert 0-based indices to 1-based for PDFium and join with commas\n const pageString = validPageIndices.map((index) => index + 1).join(',');\n\n try {\n // Import all specified pages at once from this document\n if (\n !this.pdfiumModule.FPDF_ImportPages(\n newDocPtr,\n ctx.docPtr,\n pageString,\n 0, // Insert at the beginning\n )\n ) {\n throw new Error(`Failed to import pages ${pageString} from document ${config.docId}`);\n }\n } finally {\n }\n }\n\n // Save the new document to buffer\n const buffer = this.saveDocument(newDocPtr);\n\n const file: PdfFile = {\n id: `${Math.random()}`,\n content: buffer,\n };\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `MergePages`, 'End', configIds);\n return PdfTaskHelper.resolve(file);\n } catch (error) {\n this.logger.error(LOG_SOURCE, LOG_CATEGORY, 'mergePages failed', error);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `MergePages`, 'End', configIds);\n\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantImportPages,\n message: error instanceof Error ? error.message : 'Failed to merge pages',\n });\n } finally {\n // Clean up the new document\n if (newDocPtr) {\n this.pdfiumModule.FPDF_CloseDocument(newDocPtr);\n }\n }\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.saveAsCopy}\n *\n * @public\n */\n saveAsCopy(doc: PdfDocumentObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'saveAsCopy', doc);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `SaveAsCopy`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `SaveAsCopy`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const buffer = this.saveDocument(ctx.docPtr);\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `SaveAsCopy`, 'End', doc.id);\n return PdfTaskHelper.resolve(buffer);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.closeDocument}\n *\n * @public\n */\n closeDocument(doc: PdfDocumentObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'closeDocument', doc);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `CloseDocument`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `CloseDocument`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n ctx.dispose();\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `CloseDocument`, 'End', doc.id);\n return PdfTaskHelper.resolve(true);\n }\n\n /**\n * Memory allocation\n * @param size - size of memory space\n * @returns pointer to memory space\n *\n * @public\n */\n malloc(size: number) {\n const ptr = this.pdfiumModule.pdfium.wasmExports.malloc(size);\n for (let i = 0; i < size; i++) {\n this.pdfiumModule.pdfium.HEAP8[ptr + i] = 0;\n }\n\n return ptr;\n }\n\n /**\n * Free memory space\n * @param ptr pointer to memory space\n *\n * @public\n */\n free(ptr: number) {\n this.pdfiumModule.pdfium.wasmExports.free(ptr);\n }\n\n /**\n * Set the rect of specified annotation\n * @param page - page info that the annotation is belonged to\n * @param pagePtr - pointer of page object\n * @param annotationPtr - pointer to annotation object\n * @param inkList - ink lists that added to the annotation\n * @returns whether the ink lists is setted\n *\n * @private\n */\n addInkStroke(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n inkList: PdfInkListObject[],\n ) {\n for (const inkStroke of inkList) {\n const inkPointsCount = inkStroke.points.length;\n const inkPointsPtr = this.malloc(inkPointsCount * 8);\n for (let i = 0; i < inkPointsCount; i++) {\n const point = inkStroke.points[i];\n const { x, y } = this.convertDevicePointToPagePoint(page, point);\n\n this.pdfiumModule.pdfium.setValue(inkPointsPtr + i * 8, x, 'float');\n this.pdfiumModule.pdfium.setValue(inkPointsPtr + i * 8 + 4, y, 'float');\n }\n\n if (\n this.pdfiumModule.FPDFAnnot_AddInkStroke(annotationPtr, inkPointsPtr, inkPointsCount) === -1\n ) {\n this.free(inkPointsPtr);\n return false;\n }\n\n this.free(inkPointsPtr);\n }\n\n return true;\n }\n\n /**\n * Add contents to stamp annotation\n * @param docPtr - pointer to pdf document object\n * @param page - page info\n * @param pagePtr - pointer to page object\n * @param annotationPtr - pointer to stamp annotation\n * @param rect - rect of stamp annotation\n * @param contents - contents of stamp annotation\n * @returns whether contents is added to annotation\n *\n * @private\n */\n addStampContent(\n docPtr: number,\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n rect: Rect,\n contents: PdfStampAnnoObjectContents,\n ) {\n for (const content of contents) {\n switch (content.type) {\n case PdfPageObjectType.IMAGE:\n return this.addImageObject(\n docPtr,\n page,\n pagePtr,\n annotationPtr,\n rect.origin,\n content.imageData,\n );\n }\n }\n\n return false;\n }\n\n /**\n * Add image object to annotation\n * @param docPtr - pointer to pdf document object\n * @param page - page info\n * @param pagePtr - pointer to page object\n * @param annotationPtr - pointer to stamp annotation\n * @param position - position of image\n * @param imageData - data of image\n * @returns whether image is added to annotation\n *\n * @private\n */\n addImageObject(\n docPtr: number,\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n position: Position,\n imageData: ImageData,\n ) {\n const bytesPerPixel = 4;\n const pixelCount = imageData.width * imageData.height;\n\n const bitmapBufferPtr = this.malloc(bytesPerPixel * pixelCount);\n if (!bitmapBufferPtr) {\n return false;\n }\n\n for (let i = 0; i < pixelCount; i++) {\n const red = imageData.data[i * bytesPerPixel];\n const green = imageData.data[i * bytesPerPixel + 1];\n const blue = imageData.data[i * bytesPerPixel + 2];\n const alpha = imageData.data[i * bytesPerPixel + 3];\n\n this.pdfiumModule.pdfium.setValue(bitmapBufferPtr + i * bytesPerPixel, blue, 'i8');\n this.pdfiumModule.pdfium.setValue(bitmapBufferPtr + i * bytesPerPixel + 1, green, 'i8');\n this.pdfiumModule.pdfium.setValue(bitmapBufferPtr + i * bytesPerPixel + 2, red, 'i8');\n this.pdfiumModule.pdfium.setValue(bitmapBufferPtr + i * bytesPerPixel + 3, alpha, 'i8');\n }\n\n const format = BitmapFormat.Bitmap_BGRA;\n const bitmapPtr = this.pdfiumModule.FPDFBitmap_CreateEx(\n imageData.width,\n imageData.height,\n format,\n bitmapBufferPtr,\n 0,\n );\n if (!bitmapPtr) {\n this.free(bitmapBufferPtr);\n return false;\n }\n\n const imageObjectPtr = this.pdfiumModule.FPDFPageObj_NewImageObj(docPtr);\n if (!imageObjectPtr) {\n this.pdfiumModule.FPDFBitmap_Destroy(bitmapPtr);\n this.free(bitmapBufferPtr);\n return false;\n }\n\n if (!this.pdfiumModule.FPDFImageObj_SetBitmap(pagePtr, 0, imageObjectPtr, bitmapPtr)) {\n this.pdfiumModule.FPDFBitmap_Destroy(bitmapPtr);\n this.pdfiumModule.FPDFPageObj_Destroy(imageObjectPtr);\n this.free(bitmapBufferPtr);\n return false;\n }\n\n const matrixPtr = this.malloc(6 * 4);\n this.pdfiumModule.pdfium.setValue(matrixPtr, imageData.width, 'float');\n this.pdfiumModule.pdfium.setValue(matrixPtr + 4, 0, 'float');\n this.pdfiumModule.pdfium.setValue(matrixPtr + 8, 0, 'float');\n this.pdfiumModule.pdfium.setValue(matrixPtr + 12, imageData.height, 'float');\n this.pdfiumModule.pdfium.setValue(matrixPtr + 16, 0, 'float');\n this.pdfiumModule.pdfium.setValue(matrixPtr + 20, 0, 'float');\n if (!this.pdfiumModule.FPDFPageObj_SetMatrix(imageObjectPtr, matrixPtr)) {\n this.free(matrixPtr);\n this.pdfiumModule.FPDFBitmap_Destroy(bitmapPtr);\n this.pdfiumModule.FPDFPageObj_Destroy(imageObjectPtr);\n this.free(bitmapBufferPtr);\n return false;\n }\n this.free(matrixPtr);\n\n this.pdfiumModule.FPDFPageObj_Transform(imageObjectPtr, 1, 0, 0, 1, position.x, position.y);\n\n if (!this.pdfiumModule.FPDFAnnot_AppendObject(annotationPtr, imageObjectPtr)) {\n this.pdfiumModule.FPDFBitmap_Destroy(bitmapPtr);\n this.pdfiumModule.FPDFPageObj_Destroy(imageObjectPtr);\n this.free(bitmapBufferPtr);\n return false;\n }\n\n this.pdfiumModule.FPDFPage_GenerateContent(pagePtr);\n this.pdfiumModule.FPDFBitmap_Destroy(bitmapPtr);\n this.free(bitmapBufferPtr);\n\n return true;\n }\n\n /**\n * Save document to array buffer\n * @param docPtr - pointer to pdf document\n * @returns array buffer contains the pdf content\n *\n * @private\n */\n saveDocument(docPtr: number) {\n const writerPtr = this.pdfiumModule.PDFiumExt_OpenFileWriter();\n this.pdfiumModule.PDFiumExt_SaveAsCopy(docPtr, writerPtr);\n const size = this.pdfiumModule.PDFiumExt_GetFileWriterSize(writerPtr);\n const dataPtr = this.malloc(size);\n this.pdfiumModule.PDFiumExt_GetFileWriterData(writerPtr, dataPtr, size);\n const buffer = new ArrayBuffer(size);\n const view = new DataView(buffer);\n for (let i = 0; i < size; i++) {\n view.setInt8(i, this.pdfiumModule.pdfium.getValue(dataPtr + i, 'i8'));\n }\n this.free(dataPtr);\n this.pdfiumModule.PDFiumExt_CloseFileWriter(writerPtr);\n\n return buffer;\n }\n\n /**\n * Read metadata from pdf document\n * @param docPtr - pointer to pdf document\n * @param key - key of metadata field\n * @returns metadata value\n *\n * @private\n */\n readMetaText(docPtr: number, key: string) {\n return readString(\n this.pdfiumModule.pdfium,\n (buffer, bufferLength) => {\n return this.pdfiumModule.FPDF_GetMetaText(docPtr, key, buffer, bufferLength);\n },\n this.pdfiumModule.pdfium.UTF16ToString,\n );\n }\n\n /**\n * Read bookmarks in the pdf document\n * @param docPtr - pointer to pdf document\n * @param rootBookmarkPtr - pointer to root bookmark\n * @returns bookmarks in the pdf document\n *\n * @private\n */\n readPdfBookmarks(docPtr: number, rootBookmarkPtr = 0) {\n let bookmarkPtr = this.pdfiumModule.FPDFBookmark_GetFirstChild(docPtr, rootBookmarkPtr);\n\n const bookmarks: PdfBookmarkObject[] = [];\n while (bookmarkPtr) {\n const bookmark = this.readPdfBookmark(docPtr, bookmarkPtr);\n bookmarks.push(bookmark);\n\n const nextBookmarkPtr = this.pdfiumModule.FPDFBookmark_GetNextSibling(docPtr, bookmarkPtr);\n\n bookmarkPtr = nextBookmarkPtr;\n }\n\n return bookmarks;\n }\n\n /**\n * Read bookmark in the pdf document\n * @param docPtr - pointer to pdf document\n * @param bookmarkPtr - pointer to bookmark object\n * @returns pdf bookmark object\n *\n * @private\n */\n private readPdfBookmark(docPtr: number, bookmarkPtr: number): PdfBookmarkObject {\n const title = readString(\n this.pdfiumModule.pdfium,\n (buffer, bufferLength) => {\n return this.pdfiumModule.FPDFBookmark_GetTitle(bookmarkPtr, buffer, bufferLength);\n },\n this.pdfiumModule.pdfium.UTF16ToString,\n );\n\n const bookmarks = this.readPdfBookmarks(docPtr, bookmarkPtr);\n\n const target = this.readPdfBookmarkTarget(\n docPtr,\n () => {\n return this.pdfiumModule.FPDFBookmark_GetAction(bookmarkPtr);\n },\n () => {\n return this.pdfiumModule.FPDFBookmark_GetDest(docPtr, bookmarkPtr);\n },\n );\n\n return {\n title,\n target,\n children: bookmarks,\n };\n }\n\n /**\n * Read text rects in pdf page\n * @param page - pdf page info\n * @param docPtr - pointer to pdf document\n * @param pagePtr - pointer to pdf page\n * @param textPagePtr - pointer to pdf text page\n * @returns text rects in the pdf page\n *\n * @public\n */\n private readPageTextRects(\n page: PdfPageObject,\n docPtr: number,\n pagePtr: number,\n textPagePtr: number,\n ) {\n const rectsCount = this.pdfiumModule.FPDFText_CountRects(textPagePtr, 0, -1);\n\n const textRects: PdfTextRectObject[] = [];\n for (let i = 0; i < rectsCount; i++) {\n const topPtr = this.malloc(8);\n const leftPtr = this.malloc(8);\n const rightPtr = this.malloc(8);\n const bottomPtr = this.malloc(8);\n const isSucceed = this.pdfiumModule.FPDFText_GetRect(\n textPagePtr,\n i,\n leftPtr,\n topPtr,\n rightPtr,\n bottomPtr,\n );\n if (!isSucceed) {\n this.free(leftPtr);\n this.free(topPtr);\n this.free(rightPtr);\n this.free(bottomPtr);\n continue;\n }\n\n const left = this.pdfiumModule.pdfium.getValue(leftPtr, 'double');\n const top = this.pdfiumModule.pdfium.getValue(topPtr, 'double');\n const right = this.pdfiumModule.pdfium.getValue(rightPtr, 'double');\n const bottom = this.pdfiumModule.pdfium.getValue(bottomPtr, 'double');\n\n this.free(leftPtr);\n this.free(topPtr);\n this.free(rightPtr);\n this.free(bottomPtr);\n\n const deviceXPtr = this.malloc(4);\n const deviceYPtr = this.malloc(4);\n this.pdfiumModule.FPDF_PageToDevice(\n pagePtr,\n 0,\n 0,\n page.size.width,\n page.size.height,\n 0,\n left,\n top,\n deviceXPtr,\n deviceYPtr,\n );\n const x = this.pdfiumModule.pdfium.getValue(deviceXPtr, 'i32');\n const y = this.pdfiumModule.pdfium.getValue(deviceYPtr, 'i32');\n this.free(deviceXPtr);\n this.free(deviceYPtr);\n\n const rect = {\n origin: {\n x,\n y,\n },\n size: {\n width: Math.ceil(Math.abs(right - left)),\n height: Math.ceil(Math.abs(top - bottom)),\n },\n };\n\n const utf16Length = this.pdfiumModule.FPDFText_GetBoundedText(\n textPagePtr,\n left,\n top,\n right,\n bottom,\n 0,\n 0,\n );\n const bytesCount = (utf16Length + 1) * 2; // include NIL\n const textBuffer = this.malloc(bytesCount);\n this.pdfiumModule.FPDFText_GetBoundedText(\n textPagePtr,\n left,\n top,\n right,\n bottom,\n textBuffer,\n utf16Length,\n );\n const content = this.pdfiumModule.pdfium.UTF16ToString(textBuffer);\n this.free(textBuffer);\n\n const charIndex = this.pdfiumModule.FPDFText_GetCharIndexAtPos(textPagePtr, left, top, 2, 2);\n let fontFamily = '';\n let fontSize = rect.size.height;\n if (charIndex >= 0) {\n fontSize = this.pdfiumModule.FPDFText_GetFontSize(textPagePtr, charIndex);\n\n const fontNameLength = this.pdfiumModule.FPDFText_GetFontInfo(\n textPagePtr,\n charIndex,\n 0,\n 0,\n 0,\n );\n\n const bytesCount = fontNameLength + 1; // include NIL\n const textBufferPtr = this.malloc(bytesCount);\n const flagsPtr = this.malloc(4);\n this.pdfiumModule.FPDFText_GetFontInfo(\n textPagePtr,\n charIndex,\n textBufferPtr,\n bytesCount,\n flagsPtr,\n );\n fontFamily = this.pdfiumModule.pdfium.UTF8ToString(textBufferPtr);\n this.free(textBufferPtr);\n this.free(flagsPtr);\n }\n\n const textRect: PdfTextRectObject = {\n content,\n rect,\n font: {\n family: fontFamily,\n size: fontSize,\n },\n };\n\n textRects.push(textRect);\n }\n\n return textRects;\n }\n\n /**\n * Return geometric + logical text layout for one page\n * (glyph-only implementation, no FPDFText_GetRect).\n *\n * @public\n */\n getPageGeometry(doc: PdfDocumentObject, page: PdfPageObject): PdfTask<PdfPageGeometry> {\n const label = 'getPageGeometry';\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, label, 'Begin', doc.id);\n\n /* ── guards ───────────────────────────────────────────── */\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, label, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n /* ── native handles ──────────────────────────────────── */\n const pageCtx = ctx.acquirePage(page.index);\n const textPagePtr = pageCtx.getTextPage();\n\n /* ── 1. read ALL glyphs in logical order ─────────────── */\n const glyphCount = this.pdfiumModule.FPDFText_CountChars(textPagePtr);\n const glyphs: PdfGlyphObject[] = [];\n\n for (let i = 0; i < glyphCount; i++) {\n const g = this.readGlyphInfo(page, pageCtx.pagePtr, textPagePtr, i);\n glyphs.push(g);\n }\n\n /* ── 2. build visual runs from glyph stream ───────────── */\n const runs: PdfRun[] = this.buildRunsFromGlyphs(glyphs, textPagePtr);\n\n /* ── 3. cleanup & resolve task ───────────────────────── */\n pageCtx.release();\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, label, 'End', doc.id);\n return PdfTaskHelper.resolve({ runs });\n }\n\n /**\n * Group consecutive glyphs that belong to the same CPDF_TextObject\n * using FPDFText_GetTextObject(), and calculate rotation from glyph positions.\n */\n private buildRunsFromGlyphs(glyphs: PdfGlyphObject[], textPagePtr: number): PdfRun[] {\n const runs: PdfRun[] = [];\n let current: PdfRun | null = null;\n let curObjPtr: number | null = null;\n let bounds: { minX: number; minY: number; maxX: number; maxY: number } | null = null;\n\n /** ── main loop ──────────────────────────────────────────── */\n for (let i = 0; i < glyphs.length; i++) {\n const g = glyphs[i];\n\n /* 1 — find the CPDF_TextObject this glyph belongs to */\n const objPtr = this.pdfiumModule.FPDFText_GetTextObject(textPagePtr, i) as number;\n\n /* 2 — start a new run when the text object changes */\n if (objPtr !== curObjPtr) {\n curObjPtr = objPtr;\n current = {\n rect: {\n x: g.origin.x,\n y: g.origin.y,\n width: g.size.width,\n height: g.size.height,\n },\n charStart: i,\n glyphs: [],\n };\n bounds = {\n minX: g.origin.x,\n minY: g.origin.y,\n maxX: g.origin.x + g.size.width,\n maxY: g.origin.y + g.size.height,\n };\n runs.push(current);\n }\n\n /* 3 — append the slim glyph record */\n current!.glyphs.push({\n x: g.origin.x,\n y: g.origin.y,\n width: g.size.width,\n height: g.size.height,\n flags: g.isEmpty ? 2 : g.isSpace ? 1 : 0,\n });\n\n /* 4 — expand the run's bounding rect */\n if (g.isEmpty) {\n continue;\n }\n\n const right = g.origin.x + g.size.width;\n const bottom = g.origin.y + g.size.height;\n\n // Update bounds\n bounds!.minX = Math.min(bounds!.minX, g.origin.x);\n bounds!.minY = Math.min(bounds!.minY, g.origin.y);\n bounds!.maxX = Math.max(bounds!.maxX, right);\n bounds!.maxY = Math.max(bounds!.maxY, bottom);\n\n // Calculate final rect from bounds\n current!.rect.x = bounds!.minX;\n current!.rect.y = bounds!.minY;\n current!.rect.width = bounds!.maxX - bounds!.minX;\n current!.rect.height = bounds!.maxY - bounds!.minY;\n }\n\n return runs;\n }\n\n /**\n * Extract glyph geometry + metadata for `charIndex`\n *\n * Returns device–space coordinates:\n * x,y → **top-left** corner (integer-pixels)\n * w,h → width / height (integer-pixels, ≥ 1)\n *\n * And two flags:\n * isSpace → true if the glyph's Unicode code-point is U+0020\n */\n private readGlyphInfo(\n page: PdfPageObject,\n pagePtr: number,\n textPagePtr: number,\n charIndex: number,\n ): PdfGlyphObject {\n // ── native stack temp pointers ──────────────────────────────\n const dx1Ptr = this.malloc(4);\n const dy1Ptr = this.malloc(4);\n const dx2Ptr = this.malloc(4);\n const dy2Ptr = this.malloc(4);\n const rectPtr = this.malloc(16); // 4 floats = 16 bytes\n\n let x = 0,\n y = 0,\n width = 0,\n height = 0,\n isSpace = false;\n\n // ── 1) raw glyph bbox in page-user-space\n if (this.pdfiumModule.FPDFText_GetLooseCharBox(textPagePtr, charIndex, rectPtr)) {\n const left = this.pdfiumModule.pdfium.getValue(rectPtr, 'float');\n const top = this.pdfiumModule.pdfium.getValue(rectPtr + 4, 'float');\n const right = this.pdfiumModule.pdfium.getValue(rectPtr + 8, 'float');\n const bottom = this.pdfiumModule.pdfium.getValue(rectPtr + 12, 'float');\n\n if (left === right || top === bottom) {\n return {\n origin: { x: 0, y: 0 },\n size: { width: 0, height: 0 },\n isEmpty: true,\n };\n }\n\n // ── 2) map 2 opposite corners to device-space\n this.pdfiumModule.FPDF_PageToDevice(\n pagePtr,\n 0,\n 0,\n page.size.width,\n page.size.height,\n /*rotate=*/ 0,\n left,\n top,\n dx1Ptr,\n dy1Ptr,\n );\n this.pdfiumModule.FPDF_PageToDevice(\n pagePtr,\n 0,\n 0,\n page.size.width,\n page.size.height,\n /*rotate=*/ 0,\n right,\n bottom,\n dx2Ptr,\n dy2Ptr,\n );\n\n const x1 = this.pdfiumModule.pdfium.getValue(dx1Ptr, 'i32');\n const y1 = this.pdfiumModule.pdfium.getValue(dy1Ptr, 'i32');\n const x2 = this.pdfiumModule.pdfium.getValue(dx2Ptr, 'i32');\n const y2 = this.pdfiumModule.pdfium.getValue(dy2Ptr, 'i32');\n\n x = Math.min(x1, x2);\n y = Math.min(y1, y2);\n width = Math.max(1, Math.abs(x2 - x1));\n height = Math.max(1, Math.abs(y2 - y1));\n\n // ── 3) extra flags ───────────────────────────────────────\n const uc = this.pdfiumModule.FPDFText_GetUnicode(textPagePtr, charIndex);\n isSpace = uc === 32;\n }\n\n // ── free tmps ───────────────────────────────────────────────\n [rectPtr, dx1Ptr, dy1Ptr, dx2Ptr, dy2Ptr].forEach((p) => this.free(p));\n\n return {\n origin: { x, y },\n size: { width, height },\n ...(isSpace && { isSpace }),\n };\n }\n\n /**\n * Geometry-only text extraction\n * ------------------------------------------\n * Returns every glyph on the requested page\n * in the logical order delivered by PDFium.\n *\n * The promise resolves to an array of objects:\n * {\n * idx: number; // glyph index on the page (0…n-1)\n * origin: { x: number; y: number };\n * size: { width: number; height: number };\n * angle: number; // degrees, counter-clock-wise\n * isSpace: boolean; // true → U+0020\n * }\n *\n * No Unicode is included; front-end decides whether to hydrate it.\n */\n public getPageGlyphs(doc: PdfDocumentObject, page: PdfPageObject): PdfTask<PdfGlyphObject[]> {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'getPageGlyphs', doc, page);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, 'getPageGlyphs', 'Begin', doc.id);\n\n // ── 1) safety: document handle must be alive ───────────────\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, 'getPageGlyphs', 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n // ── 2) load page + text page handles ───────────────────────\n const pageCtx = ctx.acquirePage(page.index);\n const textPagePtr = pageCtx.getTextPage();\n\n // ── 3) iterate all glyphs in logical order ─────────────────\n const total = this.pdfiumModule.FPDFText_CountChars(textPagePtr);\n const glyphs = new Array(total);\n\n for (let i = 0; i < total; i++) {\n const g = this.readGlyphInfo(page, pageCtx.pagePtr, textPagePtr, i);\n\n if (g.isEmpty) {\n continue;\n }\n\n glyphs[i] = { ...g };\n }\n\n // ── 4) clean-up native handles ─────────────────────────────\n pageCtx.release();\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, 'getPageGlyphs', 'End', doc.id);\n\n return PdfTaskHelper.resolve(glyphs);\n }\n\n private readCharBox(\n page: PdfPageObject,\n pagePtr: number,\n textPagePtr: number,\n charIndex: number,\n ): Rect {\n const topPtr = this.malloc(8);\n const leftPtr = this.malloc(8);\n const bottomPtr = this.malloc(8);\n const rightPtr = this.malloc(8);\n let x = 0;\n let y = 0;\n let width = 0;\n let height = 0;\n if (\n this.pdfiumModule.FPDFText_GetCharBox(\n textPagePtr,\n charIndex,\n leftPtr,\n rightPtr,\n bottomPtr,\n topPtr,\n )\n ) {\n const top = this.pdfiumModule.pdfium.getValue(topPtr, 'double');\n const left = this.pdfiumModule.pdfium.getValue(leftPtr, 'double');\n const bottom = this.pdfiumModule.pdfium.getValue(bottomPtr, 'double');\n const right = this.pdfiumModule.pdfium.getValue(rightPtr, 'double');\n\n const deviceXPtr = this.malloc(4);\n const deviceYPtr = this.malloc(4);\n this.pdfiumModule.FPDF_PageToDevice(\n pagePtr,\n 0,\n 0,\n page.size.width,\n page.size.height,\n 0,\n left,\n top,\n deviceXPtr,\n deviceYPtr,\n );\n x = this.pdfiumModule.pdfium.getValue(deviceXPtr, 'i32');\n y = this.pdfiumModule.pdfium.getValue(deviceYPtr, 'i32');\n this.free(deviceXPtr);\n this.free(deviceYPtr);\n\n width = Math.ceil(Math.abs(right - left));\n height = Math.ceil(Math.abs(top - bottom));\n }\n this.free(topPtr);\n this.free(leftPtr);\n this.free(bottomPtr);\n this.free(rightPtr);\n\n return {\n origin: {\n x,\n y,\n },\n size: {\n width,\n height,\n },\n };\n }\n\n /**\n * Read page annotations\n * @param page - page info\n * @param docPtr - pointer to pdf document\n * @param pagePtr - pointer to pdf page\n * @param textPagePtr - pointe to pdf text page\n * @param scaleFactor - scale factor\n * @param rotation - rotation angle\n * @returns annotations on the pdf page\n *\n * @private\n */\n private readPageAnnotations(ctx: DocumentContext, page: PdfPageObject) {\n const pageCtx = ctx.acquirePage(page.index);\n const annotationCount = this.pdfiumModule.FPDFPage_GetAnnotCount(pageCtx.pagePtr);\n\n const annotations: PdfAnnotationObject[] = [];\n for (let i = 0; i < annotationCount; i++) {\n pageCtx.withAnnotation(i, (annotPtr) => {\n const annotation = this.readPageAnnotation(page, pageCtx, annotPtr, i);\n if (annotation) {\n annotations.push(annotation);\n }\n });\n }\n\n return annotations;\n }\n\n /**\n * Read pdf annotation from pdf document\n * @param page - pdf page infor\n * @param docPtr - pointer to pdf document object\n * @param pagePtr - pointer to pdf page object\n * @param textPagePtr - pointer to pdf text page object\n * @param formHandle - form handle\n * @param index - index of annotation in the pdf page\n * @param scaleFactor - factor of scalling\n * @param rotation - rotation angle\n * @returns pdf annotation\n *\n * @private\n */\n private readPageAnnotation(\n page: PdfPageObject,\n pageCtx: PageContext,\n annotationPtr: number,\n index: number,\n ) {\n const subType = this.pdfiumModule.FPDFAnnot_GetSubtype(\n annotationPtr,\n ) as PdfAnnotationObject['type'];\n let annotation: PdfAnnotationObject | undefined;\n switch (subType) {\n case PdfAnnotationSubtype.TEXT:\n {\n annotation = this.readPdfTextAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.FREETEXT:\n {\n annotation = this.readPdfFreeTextAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.LINK:\n {\n annotation = this.readPdfLinkAnno(\n page,\n pageCtx.docPtr,\n pageCtx.pagePtr,\n pageCtx.getTextPage(),\n annotationPtr,\n index,\n );\n }\n break;\n case PdfAnnotationSubtype.WIDGET:\n {\n annotation = this.readPdfWidgetAnno(\n page,\n pageCtx.pagePtr,\n annotationPtr,\n pageCtx.getFormHandle(),\n index,\n );\n }\n break;\n case PdfAnnotationSubtype.FILEATTACHMENT:\n {\n annotation = this.readPdfFileAttachmentAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.INK:\n {\n annotation = this.readPdfInkAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.POLYGON:\n {\n annotation = this.readPdfPolygonAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.POLYLINE:\n {\n annotation = this.readPdfPolylineAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.LINE:\n {\n annotation = this.readPdfLineAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.HIGHLIGHT:\n annotation = this.readPdfHighlightAnno(page, pageCtx.pagePtr, annotationPtr, index);\n break;\n case PdfAnnotationSubtype.STAMP:\n {\n annotation = this.readPdfStampAnno(\n pageCtx.docPtr,\n page,\n pageCtx.pagePtr,\n annotationPtr,\n index,\n );\n }\n break;\n case PdfAnnotationSubtype.SQUARE:\n {\n annotation = this.readPdfSquareAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.CIRCLE:\n {\n annotation = this.readPdfCircleAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.UNDERLINE:\n {\n annotation = this.readPdfUnderlineAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.SQUIGGLY:\n {\n annotation = this.readPdfSquigglyAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.STRIKEOUT:\n {\n annotation = this.readPdfStrikeOutAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.CARET:\n {\n annotation = this.readPdfCaretAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.POPUP:\n break;\n default:\n {\n annotation = this.readPdfAnno(page, pageCtx.pagePtr, subType, annotationPtr, index);\n }\n break;\n }\n\n return annotation;\n }\n\n /**\n * Return the colour stored directly in the annotation dictionary's `/C` entry.\n *\n * Most PDFs created by Acrobat, Microsoft Office, LaTeX, etc. include this entry.\n * When the key is absent (common in macOS Preview, Chrome, Drawboard) the call\n * fails and the function returns `undefined`.\n *\n * @param annotationPtr - pointer to an `FPDF_ANNOTATION`\n * @returns An RGBA tuple (0-255 channels) or `undefined` if no `/C` entry exists\n *\n * @private\n */\n private readAnnotationColor(annotationPtr: number): PdfAlphaColor | undefined {\n const rPtr = this.malloc(4);\n const gPtr = this.malloc(4);\n const bPtr = this.malloc(4);\n const aPtr = this.malloc(4);\n\n // colourType 0 = \"colour\" (stroke/fill); other types are interior/border\n const ok = this.pdfiumModule.FPDFAnnot_GetColor(\n annotationPtr,\n /* colorType = */ 0,\n rPtr,\n gPtr,\n bPtr,\n aPtr,\n );\n\n let colour: PdfAlphaColor | undefined;\n\n if (ok) {\n colour = {\n red: this.pdfiumModule.pdfium.getValue(rPtr, 'i32') & 0xff,\n green: this.pdfiumModule.pdfium.getValue(gPtr, 'i32') & 0xff,\n blue: this.pdfiumModule.pdfium.getValue(bPtr, 'i32') & 0xff,\n alpha: this.pdfiumModule.pdfium.getValue(aPtr, 'i32') & 0xff, // 0 = transparent, 255 = opaque\n };\n }\n\n this.free(rPtr);\n this.free(gPtr);\n this.free(bPtr);\n this.free(aPtr);\n\n return colour;\n }\n\n /* --------------------------------------------------------------------------- */\n /**\n * Extract the fill (or, if absent, the stroke) colour from a **path object**\n * inside an appearance stream.\n *\n * Works for simple highlights produced by Chrome, Preview, etc. that paint a\n * single filled rectangle with the desired tint.\n *\n * @param pathPtr - pointer to a `FPDF_PAGEOBJECT` of type **PATH**\n * @returns RGBA tuple or `undefined` when no colour is set on the path\n *\n * @private\n */\n private getColorFromPath(pathPtr: number): PdfAlphaColor | undefined {\n const r = this.malloc(4),\n g = this.malloc(4),\n b = this.malloc(4),\n a = this.malloc(4);\n\n const fillOk = this.pdfiumModule.FPDFPageObj_GetFillColor(pathPtr, r, g, b, a);\n const strokeOk =\n !fillOk && // try stroke only if fill failed\n this.pdfiumModule.FPDFPageObj_GetStrokeColor(pathPtr, r, g, b, a);\n\n const ok = fillOk || strokeOk;\n let c: PdfAlphaColor | undefined;\n if (ok) {\n c = {\n red: this.pdfiumModule.pdfium.getValue(r, 'i32') & 0xff,\n green: this.pdfiumModule.pdfium.getValue(g, 'i32') & 0xff,\n blue: this.pdfiumModule.pdfium.getValue(b, 'i32') & 0xff,\n alpha: this.pdfiumModule.pdfium.getValue(a, 'i32') & 0xff,\n };\n }\n this.free(r);\n this.free(g);\n this.free(b);\n this.free(a);\n return c;\n }\n\n /* --------------------------------------------------------------------------- */\n /**\n * Recursively walk a page-object tree (PATHs and nested FORM XObjects) until\n * a colour can be extracted.\n *\n * Acrobat often wraps its highlight rectangle in a Form XObject referenced by\n * the \"Do\" operator, so this function drills down unlimited depth.\n *\n * @param objPtr - pointer to a `FPDF_PAGEOBJECT`\n * @returns First RGBA tint found, or `undefined` if none of the descendants\n * carry an explicit fill/stroke colour\n *\n * @private\n */\n private walkPageObjTree(objPtr: number): PdfAlphaColor | undefined {\n const type = this.pdfiumModule.FPDFPageObj_GetType(objPtr);\n\n if (type === PdfPageObjectType.PATH) return this.getColorFromPath(objPtr);\n if (type !== PdfPageObjectType.FORM) return undefined;\n\n const cnt = this.pdfiumModule.FPDFFormObj_CountObjects(objPtr);\n for (let i = 0; i < cnt; i++) {\n const child = this.pdfiumModule.FPDFFormObj_GetObject(objPtr, i);\n if (!child) continue;\n const c = this.walkPageObjTree(child);\n if (c) return c;\n }\n return undefined;\n }\n\n /* --------------------------------------------------------------------------- */\n /**\n * Iterate over every top-level object in the annotation's **appearance stream**\n * and invoke {@link walkPageObjTree} to locate a usable tint.\n *\n * Catches:\n * • Simple filled path (Preview, Chrome)\n * • Form XObject containing the path (Acrobat)\n *\n * @param annotPtr - pointer to an `FPDF_ANNOTATION`\n * @returns RGBA tuple or `undefined` when no colour can be resolved from AP\n *\n * @private\n */\n private colorFromAppearance(annotPtr: number): PdfAlphaColor | undefined {\n const n = this.pdfiumModule.FPDFAnnot_GetObjectCount(annotPtr);\n for (let i = 0; i < n; i++) {\n const obj = this.pdfiumModule.FPDFAnnot_GetObject(annotPtr, i);\n if (!obj) continue;\n const c = this.walkPageObjTree(obj);\n if (c) return c;\n }\n return undefined;\n }\n\n /* --------------------------------------------------------------------------- */\n /**\n * Resolve the visible fill colour for **Highlight / Underline / StrikeOut /\n * Squiggly** markup annotations.\n *\n * Resolution order (first non-`undefined` wins):\n * 1. `/C` dictionary entry – fast, present in Acrobat / Office PDFs\n * 2. Appearance-stream objects – drills into paths & nested forms\n * 3. Hard-coded fallback (Acrobat-style opaque yellow)\n *\n * @param annotationPtr - pointer to an `FPDF_ANNOTATION`\n * @param fallback - colour to use when the PDF stores no tint at all\n * @returns Guaranteed RGBA tuple (never `undefined`)\n *\n * @private\n */\n private resolveAnnotationColor(\n annotationPtr: number,\n fallback: PdfAlphaColor = { red: 255, green: 245, blue: 155, alpha: 255 },\n ): PdfAlphaColor {\n return (\n this.readAnnotationColor(annotationPtr) ?? // 1 – /C entry\n this.colorFromAppearance(annotationPtr) ?? // 2 – AP stream walk\n fallback // 3 – default\n );\n }\n\n /**\n * Read `/QuadPoints` from any annotation and convert each quadrilateral to\n * device-space coordinates.\n *\n * The four points are returned in natural reading order:\n * `p1 → p2` (top edge) and `p4 → p3` (bottom edge).\n * This preserves the true shape for rotated / skewed text, whereas callers\n * that only need axis-aligned boxes can collapse each quad themselves.\n *\n * @param page - logical page info object (`PdfPageObject`)\n * @param annotationPtr - pointer to the annotation whose quads are needed\n * @returns Array of `Quad` objects (`[]` if the annotation has no quads)\n *\n * @private\n */\n private readAnnotationQuads(page: PdfPageObject, annotationPtr: number): Quad[] {\n const quadCount = this.pdfiumModule.FPDFAnnot_CountAttachmentPoints(annotationPtr);\n if (quadCount === 0) return [];\n\n const FS_QUADPOINTSF_SIZE = 8 * 4; // eight floats, 32 bytes\n const quads: Quad[] = [];\n\n for (let qi = 0; qi < quadCount; qi++) {\n const quadPtr = this.malloc(FS_QUADPOINTSF_SIZE);\n\n const ok = this.pdfiumModule.FPDFAnnot_GetAttachmentPoints(annotationPtr, qi, quadPtr);\n\n if (ok) {\n // read the eight floats\n const xs: number[] = [];\n const ys: number[] = [];\n for (let i = 0; i < 4; i++) {\n const base = quadPtr + i * 8; // 8 bytes per point (x+y)\n xs.push(this.pdfiumModule.pdfium.getValue(base, 'float'));\n ys.push(this.pdfiumModule.pdfium.getValue(base + 4, 'float'));\n }\n\n // convert to device-space\n const p1 = this.convertPagePointToDevicePoint(page, { x: xs[0], y: ys[0] });\n const p2 = this.convertPagePointToDevicePoint(page, { x: xs[1], y: ys[1] });\n const p3 = this.convertPagePointToDevicePoint(page, { x: xs[2], y: ys[2] });\n const p4 = this.convertPagePointToDevicePoint(page, { x: xs[3], y: ys[3] });\n\n quads.push({ p1, p2, p3, p4 });\n }\n\n this.free(quadPtr);\n }\n\n return quads;\n }\n\n /**\n * Read pdf text annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf text annotation\n *\n * @private\n */\n private readPdfTextAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfTextAnnoObject | undefined {\n const appearances = this.readPageAnnoAppearanceStreams(annotationPtr);\n const annoRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, annoRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = this.toIsoDate(modifiedRaw);\n\n const contents = this.getAnnotString(annotationPtr, 'Contents') || '';\n const state = this.getAnnotString(annotationPtr, 'State') as PdfAnnotationState;\n const stateModel = this.getAnnotString(annotationPtr, 'StateModel') as PdfAnnotationStateModel;\n const color = this.resolveAnnotationColor(annotationPtr);\n const inReplyToId = this.getInReplyToId(pagePtr, annotationPtr);\n\n const popup = !inReplyToId\n ? this.readPdfAnnoLinkedPopup(page, pagePtr, annotationPtr, index)\n : undefined;\n\n return {\n status: PdfAnnotationObjectStatus.Committed,\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.TEXT,\n contents,\n color,\n rect,\n popup,\n appearances,\n inReplyToId,\n author,\n modified,\n state,\n stateModel,\n };\n }\n\n /**\n * Read pdf freetext annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf freetext annotation\n *\n * @private\n */\n private readPdfFreeTextAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfFreeTextAnnoObject | undefined {\n const appearances = this.readPageAnnoAppearanceStreams(annotationPtr);\n const annoRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, annoRect);\n const contents = this.getAnnotString(annotationPtr, 'Contents') || '';\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = this.toIsoDate(modifiedRaw);\n\n const popup = this.readPdfAnnoLinkedPopup(page, pagePtr, annotationPtr, index);\n\n return {\n status: PdfAnnotationObjectStatus.Committed,\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.FREETEXT,\n contents,\n author,\n modified,\n rect,\n popup,\n appearances,\n };\n }\n\n /**\n * Read pdf link annotation from pdf document\n * @param page - pdf page infor\n * @param docPtr - pointer to pdf document object\n * @param pagePtr - pointer to pdf page object\n * @param textPagePtr - pointer to pdf text page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf link annotation\n *\n * @private\n */\n private readPdfLinkAnno(\n page: PdfPageObject,\n docPtr: number,\n pagePtr: number,\n textPagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfLinkAnnoObject | undefined {\n const linkPtr = this.pdfiumModule.FPDFAnnot_GetLink(annotationPtr);\n if (!linkPtr) {\n return;\n }\n\n const appearances = this.readPageAnnoAppearanceStreams(annotationPtr);\n const annoRect = this.readPageAnnoRect(annotationPtr);\n const { left, top, right, bottom } = annoRect;\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, annoRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = this.toIsoDate(modifiedRaw);\n\n const utf16Length = this.pdfiumModule.FPDFText_GetBoundedText(\n textPagePtr,\n left,\n top,\n right,\n bottom,\n 0,\n 0,\n );\n const bytesCount = (utf16Length + 1) * 2; // include NIL\n const textBufferPtr = this.malloc(bytesCount);\n this.pdfiumModule.FPDFText_GetBoundedText(\n textPagePtr,\n left,\n top,\n right,\n bottom,\n textBufferPtr,\n utf16Length,\n );\n const text = this.pdfiumModule.pdfium.UTF16ToString(textBufferPtr);\n this.free(textBufferPtr);\n\n const target = this.readPdfLinkAnnoTarget(\n docPtr,\n () => {\n return this.pdfiumModule.FPDFLink_GetAction(linkPtr);\n },\n () => {\n return this.pdfiumModule.FPDFLink_GetDest(docPtr, linkPtr);\n },\n );\n const popup = this.readPdfAnnoLinkedPopup(page, pagePtr, annotationPtr, index);\n\n return {\n status: PdfAnnotationObjectStatus.Committed,\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.LINK,\n text,\n target,\n rect,\n popup,\n appearances,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf widget annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param formHandle - form handle\n * @param index - index of annotation in the pdf page\n * @returns pdf widget annotation\n *\n * @private\n */\n private readPdfWidgetAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n formHandle: number,\n index: number,\n ): PdfWidgetAnnoObject | undefined {\n const appearances = this.readPageAnnoAppearanceStreams(annotationPtr);\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = this.toIsoDate(modifiedRaw);\n const popup = this.readPdfAnnoLinkedPopup(page, pagePtr, annotationPtr, index);\n\n const field = this.readPdfWidgetAnnoField(formHandle, annotationPtr);\n\n return {\n status: PdfAnnotationObjectStatus.Committed,\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.WIDGET,\n rect,\n field,\n popup,\n appearances,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf file attachment annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf file attachment annotation\n *\n * @private\n */\n private readPdfFileAttachmentAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfFileAttachmentAnnoObject | undefined {\n const appearances = this.readPageAnnoAppearanceStreams(annotationPtr);\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = this.toIsoDate(modifiedRaw);\n const popup = this.readPdfAnnoLinkedPopup(page, pagePtr, annotationPtr, index);\n\n return {\n status: PdfAnnotationObjectStatus.Committed,\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.FILEATTACHMENT,\n rect,\n popup,\n appearances,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf ink annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf ink annotation\n *\n * @private\n */\n private readPdfInkAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfInkAnnoObject | undefined {\n const appearances = this.readPageAnnoAppearanceStreams(annotationPtr);\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = this.toIsoDate(modifiedRaw);\n const popup = this.readPdfAnnoLinkedPopup(page, pagePtr, annotationPtr, index);\n\n const inkList: PdfInkListObject[] = [];\n\n const count = this.pdfiumModule.FPDFAnnot_GetInkListCount(annotationPtr);\n for (let i = 0; i < count; i++) {\n const points: Position[] = [];\n const pointsCount = this.pdfiumModule.FPDFAnnot_GetInkListPath(annotationPtr, i, 0, 0);\n if (pointsCount > 0) {\n const pointMemorySize = 8;\n const pointsPtr = this.malloc(pointsCount * pointMemorySize);\n this.pdfiumModule.FPDFAnnot_GetInkListPath(annotationPtr, i, pointsPtr, pointsCount);\n\n for (let j = 0; j < pointsCount; j++) {\n const pointX = this.pdfiumModule.pdfium.getValue(pointsPtr + j * 8, 'float');\n const pointY = this.pdfiumModule.pdfium.getValue(pointsPtr + j * 8 + 4, 'float');\n const { x, y } = this.convertPagePointToDevicePoint(page, {\n x: pointX,\n y: pointY,\n });\n points.push({ x, y });\n }\n\n this.free(pointsPtr);\n }\n\n inkList.push({ points });\n }\n\n return {\n status: PdfAnnotationObjectStatus.Committed,\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.INK,\n rect,\n popup,\n inkList,\n appearances,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf polygon annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf polygon annotation\n *\n * @private\n */\n private readPdfPolygonAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfPolygonAnnoObject | undefined {\n const appearances = this.readPageAnnoAppearanceStreams(annotationPtr);\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = this.toIsoDate(modifiedRaw);\n const popup = this.readPdfAnnoLinkedPopup(page, pagePtr, annotationPtr, index);\n const vertices = this.readPdfAnnoVertices(page, pagePtr, annotationPtr);\n\n return {\n status: PdfAnnotationObjectStatus.Committed,\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.POLYGON,\n rect,\n popup,\n vertices,\n appearances,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf polyline annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf polyline annotation\n *\n * @private\n */\n private readPdfPolylineAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfPolylineAnnoObject | undefined {\n const appearances = this.readPageAnnoAppearanceStreams(annotationPtr);\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = this.toIsoDate(modifiedRaw);\n const popup = this.readPdfAnnoLinkedPopup(page, pagePtr, annotationPtr, index);\n const vertices = this.readPdfAnnoVertices(page, pagePtr, annotationPtr);\n\n return {\n status: PdfAnnotationObjectStatus.Committed,\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.POLYLINE,\n rect,\n popup,\n vertices,\n appearances,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf line annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf line annotation\n *\n * @private\n */\n private readPdfLineAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfLineAnnoObject | undefined {\n const appearances = this.readPageAnnoAppearanceStreams(annotationPtr);\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = this.toIsoDate(modifiedRaw);\n const popup = this.readPdfAnnoLinkedPopup(page, pagePtr, annotationPtr, index);\n const startPointPtr = this.malloc(8);\n const endPointPtr = this.malloc(8);\n\n this.pdfiumModule.FPDFAnnot_GetLine(annotationPtr, startPointPtr, endPointPtr);\n\n const startPointX = this.pdfiumModule.pdfium.getValue(startPointPtr, 'float');\n const startPointY = this.pdfiumModule.pdfium.getValue(startPointPtr + 4, 'float');\n const startPoint = this.convertPagePointToDevicePoint(page, {\n x: startPointX,\n y: startPointY,\n });\n\n const endPointX = this.pdfiumModule.pdfium.getValue(endPointPtr, 'float');\n const endPointY = this.pdfiumModule.pdfium.getValue(endPointPtr + 4, 'float');\n const endPoint = this.convertPagePointToDevicePoint(page, {\n x: endPointX,\n y: endPointY,\n });\n\n this.free(startPointPtr);\n this.free(endPointPtr);\n\n return {\n status: PdfAnnotationObjectStatus.Committed,\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.LINE,\n rect,\n popup,\n startPoint,\n endPoint,\n appearances,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf highlight annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf highlight annotation\n *\n * @private\n */\n private readPdfHighlightAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfHighlightAnnoObject | undefined {\n const appearances = this.readPageAnnoAppearanceStreams(annotationPtr);\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const quads = this.readAnnotationQuads(page, annotationPtr);\n const color = this.resolveAnnotationColor(annotationPtr);\n const popup = this.readPdfAnnoLinkedPopup(page, pagePtr, annotationPtr, index);\n\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = this.toIsoDate(modifiedRaw);\n\n return {\n status: PdfAnnotationObjectStatus.Committed,\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.HIGHLIGHT,\n rect,\n popup,\n appearances,\n segmentRects: quads.map(quadToRect),\n color,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf underline annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf underline annotation\n *\n * @private\n */\n private readPdfUnderlineAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfUnderlineAnnoObject | undefined {\n const appearances = this.readPageAnnoAppearanceStreams(annotationPtr);\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = this.toIsoDate(modifiedRaw);\n const popup = this.readPdfAnnoLinkedPopup(page, pagePtr, annotationPtr, index);\n\n return {\n status: PdfAnnotationObjectStatus.Committed,\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.UNDERLINE,\n rect,\n popup,\n appearances,\n author,\n modified,\n };\n }\n\n /**\n * Read strikeout annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf strikeout annotation\n *\n * @private\n */\n private readPdfStrikeOutAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfStrikeOutAnnoObject | undefined {\n const appearances = this.readPageAnnoAppearanceStreams(annotationPtr);\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = this.toIsoDate(modifiedRaw);\n const popup = this.readPdfAnnoLinkedPopup(page, pagePtr, annotationPtr, index);\n\n return {\n status: PdfAnnotationObjectStatus.Committed,\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.STRIKEOUT,\n rect,\n popup,\n appearances,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf squiggly annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf squiggly annotation\n *\n * @private\n */\n private readPdfSquigglyAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfSquigglyAnnoObject | undefined {\n const appearances = this.readPageAnnoAppearanceStreams(annotationPtr);\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = this.toIsoDate(modifiedRaw);\n const popup = this.readPdfAnnoLinkedPopup(page, pagePtr, annotationPtr, index);\n\n return {\n status: PdfAnnotationObjectStatus.Committed,\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.SQUIGGLY,\n rect,\n popup,\n appearances,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf caret annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf caret annotation\n *\n * @private\n */\n private readPdfCaretAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfCaretAnnoObject | undefined {\n const appearances = this.readPageAnnoAppearanceStreams(annotationPtr);\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = this.toIsoDate(modifiedRaw);\n const popup = this.readPdfAnnoLinkedPopup(page, pagePtr, annotationPtr, index);\n\n return {\n status: PdfAnnotationObjectStatus.Committed,\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.CARET,\n rect,\n popup,\n appearances,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf stamp annotation\n * @param docPtr - pointer to pdf document object\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf stamp annotation\n *\n * @private\n */\n private readPdfStampAnno(\n docPtr: number,\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfStampAnnoObject | undefined {\n const appearances = this.readPageAnnoAppearanceStreams(annotationPtr);\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = this.toIsoDate(modifiedRaw);\n const popup = this.readPdfAnnoLinkedPopup(page, pagePtr, annotationPtr, index);\n const contents: PdfStampAnnoObject['contents'] = [];\n\n const objectCount = this.pdfiumModule.FPDFAnnot_GetObjectCount(annotationPtr);\n for (let i = 0; i < objectCount; i++) {\n const annotationObjectPtr = this.pdfiumModule.FPDFAnnot_GetObject(annotationPtr, i);\n\n const pageObj = this.readPdfPageObject(annotationObjectPtr);\n if (pageObj) {\n contents.push(pageObj);\n }\n }\n\n return {\n status: PdfAnnotationObjectStatus.Committed,\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.STAMP,\n rect,\n popup,\n contents,\n appearances,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf object in pdf page\n * @param pageObjectPtr - pointer to pdf object in page\n * @returns pdf object in page\n *\n * @private\n */\n private readPdfPageObject(pageObjectPtr: number) {\n const type = this.pdfiumModule.FPDFPageObj_GetType(pageObjectPtr) as PdfPageObjectType;\n switch (type) {\n case PdfPageObjectType.PATH:\n return this.readPathObject(pageObjectPtr);\n case PdfPageObjectType.IMAGE:\n return this.readImageObject(pageObjectPtr);\n case PdfPageObjectType.FORM:\n return this.readFormObject(pageObjectPtr);\n }\n }\n\n /**\n * Read pdf path object\n * @param pathObjectPtr - pointer to pdf path object in page\n * @returns pdf path object\n *\n * @private\n */\n private readPathObject(pathObjectPtr: number): PdfPathObject {\n const segmentCount = this.pdfiumModule.FPDFPath_CountSegments(pathObjectPtr);\n\n const leftPtr = this.malloc(4);\n const bottomPtr = this.malloc(4);\n const rightPtr = this.malloc(4);\n const topPtr = this.malloc(4);\n this.pdfiumModule.FPDFPageObj_GetBounds(pathObjectPtr, leftPtr, bottomPtr, rightPtr, topPtr);\n const left = this.pdfiumModule.pdfium.getValue(leftPtr, 'float');\n const bottom = this.pdfiumModule.pdfium.getValue(bottomPtr, 'float');\n const right = this.pdfiumModule.pdfium.getValue(rightPtr, 'float');\n const top = this.pdfiumModule.pdfium.getValue(topPtr, 'float');\n const bounds = { left, bottom, right, top };\n this.free(leftPtr);\n this.free(bottomPtr);\n this.free(rightPtr);\n this.free(topPtr);\n const segments: PdfSegmentObject[] = [];\n for (let i = 0; i < segmentCount; i++) {\n const segment = this.readPdfSegment(pathObjectPtr, i);\n segments.push(segment);\n }\n\n const matrix = this.readPdfPageObjectTransformMatrix(pathObjectPtr);\n\n return {\n type: PdfPageObjectType.PATH,\n bounds,\n segments,\n matrix,\n };\n }\n\n /**\n * Read segment of pdf path object\n * @param annotationObjectPtr - pointer to pdf path object\n * @param segmentIndex - index of segment\n * @returns pdf segment in pdf path\n *\n * @private\n */\n private readPdfSegment(annotationObjectPtr: number, segmentIndex: number): PdfSegmentObject {\n const segmentPtr = this.pdfiumModule.FPDFPath_GetPathSegment(annotationObjectPtr, segmentIndex);\n const segmentType = this.pdfiumModule.FPDFPathSegment_GetType(segmentPtr);\n const isClosed = this.pdfiumModule.FPDFPathSegment_GetClose(segmentPtr);\n const pointXPtr = this.malloc(4);\n const pointYPtr = this.malloc(4);\n this.pdfiumModule.FPDFPathSegment_GetPoint(segmentPtr, pointXPtr, pointYPtr);\n const pointX = this.pdfiumModule.pdfium.getValue(pointXPtr, 'float');\n const pointY = this.pdfiumModule.pdfium.getValue(pointYPtr, 'float');\n this.free(pointXPtr);\n this.free(pointYPtr);\n\n return {\n type: segmentType,\n point: { x: pointX, y: pointY },\n isClosed,\n };\n }\n\n /**\n * Read pdf image object from pdf document\n * @param pageObjectPtr - pointer to pdf image object in page\n * @returns pdf image object\n *\n * @private\n */\n private readImageObject(imageObjectPtr: number): PdfImageObject {\n const bitmapPtr = this.pdfiumModule.FPDFImageObj_GetBitmap(imageObjectPtr);\n const bitmapBufferPtr = this.pdfiumModule.FPDFBitmap_GetBuffer(bitmapPtr);\n const bitmapWidth = this.pdfiumModule.FPDFBitmap_GetWidth(bitmapPtr);\n const bitmapHeight = this.pdfiumModule.FPDFBitmap_GetHeight(bitmapPtr);\n const format = this.pdfiumModule.FPDFBitmap_GetFormat(bitmapPtr) as BitmapFormat;\n\n const pixelCount = bitmapWidth * bitmapHeight;\n const bytesPerPixel = 4;\n const array = new Uint8ClampedArray(pixelCount * bytesPerPixel);\n for (let i = 0; i < pixelCount; i++) {\n switch (format) {\n case BitmapFormat.Bitmap_BGR:\n {\n const blue = this.pdfiumModule.pdfium.getValue(bitmapBufferPtr + i * 3, 'i8');\n const green = this.pdfiumModule.pdfium.getValue(bitmapBufferPtr + i * 3 + 1, 'i8');\n const red = this.pdfiumModule.pdfium.getValue(bitmapBufferPtr + i * 3 + 2, 'i8');\n array[i * bytesPerPixel] = red;\n array[i * bytesPerPixel + 1] = green;\n array[i * bytesPerPixel + 2] = blue;\n array[i * bytesPerPixel + 3] = 100;\n }\n break;\n }\n }\n\n const imageData = new ImageData(array, bitmapWidth, bitmapHeight);\n const matrix = this.readPdfPageObjectTransformMatrix(imageObjectPtr);\n\n return {\n type: PdfPageObjectType.IMAGE,\n imageData,\n matrix,\n };\n }\n\n /**\n * Read form object from pdf document\n * @param formObjectPtr - pointer to pdf form object in page\n * @returns pdf form object\n *\n * @private\n */\n private readFormObject(formObjectPtr: number): PdfFormObject {\n const objectCount = this.pdfiumModule.FPDFFormObj_CountObjects(formObjectPtr);\n const objects: (PdfFormObject | PdfImageObject | PdfPathObject)[] = [];\n for (let i = 0; i < objectCount; i++) {\n const pageObjectPtr = this.pdfiumModule.FPDFFormObj_GetObject(formObjectPtr, i);\n const pageObj = this.readPdfPageObject(pageObjectPtr);\n if (pageObj) {\n objects.push(pageObj);\n }\n }\n const matrix = this.readPdfPageObjectTransformMatrix(formObjectPtr);\n\n return {\n type: PdfPageObjectType.FORM,\n objects,\n matrix,\n };\n }\n\n /**\n * Read pdf object in pdf page\n * @param pageObjectPtr - pointer to pdf object in page\n * @returns pdf object in page\n *\n * @private\n */\n private readPdfPageObjectTransformMatrix(pageObjectPtr: number): PdfTransformMatrix {\n const matrixPtr = this.malloc(4 * 6);\n if (this.pdfiumModule.FPDFPageObj_GetMatrix(pageObjectPtr, matrixPtr)) {\n const a = this.pdfiumModule.pdfium.getValue(matrixPtr, 'float');\n const b = this.pdfiumModule.pdfium.getValue(matrixPtr + 4, 'float');\n const c = this.pdfiumModule.pdfium.getValue(matrixPtr + 8, 'float');\n const d = this.pdfiumModule.pdfium.getValue(matrixPtr + 12, 'float');\n const e = this.pdfiumModule.pdfium.getValue(matrixPtr + 16, 'float');\n const f = this.pdfiumModule.pdfium.getValue(matrixPtr + 20, 'float');\n this.free(matrixPtr);\n\n return { a, b, c, d, e, f };\n }\n\n this.free(matrixPtr);\n\n return { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0 };\n }\n\n /**\n * Read circle annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf circle annotation\n *\n * @private\n */\n private readPdfCircleAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfCircleAnnoObject {\n const appearances = this.readPageAnnoAppearanceStreams(annotationPtr);\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = this.toIsoDate(modifiedRaw);\n const popup = this.readPdfAnnoLinkedPopup(page, pagePtr, annotationPtr, index);\n\n return {\n status: PdfAnnotationObjectStatus.Committed,\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.CIRCLE,\n rect,\n popup,\n appearances,\n author,\n modified,\n };\n }\n\n /**\n * Read square annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf square annotation\n *\n * @private\n */\n private readPdfSquareAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfSquareAnnoObject {\n const appearances = this.readPageAnnoAppearanceStreams(annotationPtr);\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = this.toIsoDate(modifiedRaw);\n const popup = this.readPdfAnnoLinkedPopup(page, pagePtr, annotationPtr, index);\n\n return {\n status: PdfAnnotationObjectStatus.Committed,\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.SQUARE,\n rect,\n popup,\n appearances,\n author,\n modified,\n };\n }\n\n /**\n * Read basic info of unsupported pdf annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param type - type of annotation\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf annotation\n *\n * @private\n */\n private readPdfAnno(\n page: PdfPageObject,\n pagePtr: number,\n type: PdfUnsupportedAnnoObject['type'],\n annotationPtr: number,\n index: number,\n ): PdfUnsupportedAnnoObject {\n const appearances = this.readPageAnnoAppearanceStreams(annotationPtr);\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = this.toIsoDate(modifiedRaw);\n const popup = this.readPdfAnnoLinkedPopup(page, pagePtr, annotationPtr, index);\n\n return {\n status: PdfAnnotationObjectStatus.Committed,\n pageIndex: page.index,\n id: index,\n type,\n rect,\n popup,\n appearances,\n author,\n modified,\n };\n }\n\n /**\n * Resolve `/IRT` → parent-annotation index on the same page.\n *\n * @param pagePtr - pointer to FPDF_PAGE\n * @param annotationPtr - pointer to FPDF_ANNOTATION\n * @returns index (`0…count-1`) or `undefined` when the annotation is *not* a reply\n *\n * @private\n */\n private getInReplyToId(pagePtr: number, annotationPtr: number): number | undefined {\n const parentPtr = this.pdfiumModule.FPDFAnnot_GetLinkedAnnot(annotationPtr, 'IRT');\n if (!parentPtr) return;\n\n // PDFium ≥ 5100 – returns −1 when annot not found on page\n const idx = this.pdfiumModule.FPDFPage_GetAnnotIndex(pagePtr, parentPtr);\n return idx >= 0 ? idx : undefined;\n }\n\n /**\n * Parse a PDF date string **D:YYYYMMDDHHmmSSOHH'mm'** to ISO-8601.\n *\n * Returns `undefined` if the input is malformed.\n *\n * @private\n */\n private toIsoDate(pdfDate?: string): string | undefined {\n if (!pdfDate?.startsWith('D:')) return;\n\n // Minimal parse – ignore timezone for brevity\n const y = pdfDate.substring(2, 6);\n const m = pdfDate.substring(6, 8) || '01';\n const d = pdfDate.substring(8, 10) || '01';\n const H = pdfDate.substring(10, 12) || '00';\n const M = pdfDate.substring(12, 14) || '00';\n const S = pdfDate.substring(14, 16) || '00';\n\n return `${y}-${m}-${d}T${H}:${M}:${S}`;\n }\n\n /**\n * Fetch a string value (`/T`, `/M`, `/State`, …) from an annotation.\n *\n * @returns decoded UTF-8 string or `undefined` when the key is absent\n *\n * @private\n */\n private getAnnotString(annotationPtr: number, key: string): string | undefined {\n const len = this.pdfiumModule.FPDFAnnot_GetStringValue(annotationPtr, key, 0, 0);\n if (len === 0) return;\n\n const bytes = (len + 1) * 2;\n const ptr = this.malloc(bytes);\n\n this.pdfiumModule.FPDFAnnot_GetStringValue(annotationPtr, key, ptr, bytes);\n const value = this.pdfiumModule.pdfium.UTF16ToString(ptr);\n this.free(ptr);\n\n return value || undefined;\n }\n\n /**\n * Read linked popup of pdf annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf popup linked to annotation\n *\n * @private\n */\n private readPdfAnnoLinkedPopup(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfPopupAnnoObject | undefined {\n const appearances = this.readPageAnnoAppearanceStreams(annotationPtr);\n const popupAnnotationPtr = this.pdfiumModule.FPDFAnnot_GetLinkedAnnot(annotationPtr, 'Popup');\n if (!popupAnnotationPtr) {\n return;\n }\n\n const pageRect = this.readPageAnnoRect(popupAnnotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = this.toIsoDate(modifiedRaw);\n const contents = this.getAnnotString(annotationPtr, 'Contents') || '';\n const open = this.getAnnotString(annotationPtr, 'Open') || 'false';\n\n this.pdfiumModule.FPDFPage_CloseAnnot(popupAnnotationPtr);\n\n return {\n status: PdfAnnotationObjectStatus.Committed,\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.POPUP,\n rect,\n contents,\n open: open === 'true',\n appearances,\n author,\n modified,\n };\n }\n\n /**\n * Read vertices of pdf annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @returns vertices of pdf annotation\n *\n * @private\n */\n private readPdfAnnoVertices(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n ): Position[] {\n const vertices: Position[] = [];\n const count = this.pdfiumModule.FPDFAnnot_GetVertices(annotationPtr, 0, 0);\n const pointMemorySize = 8;\n const pointsPtr = this.malloc(count * pointMemorySize);\n this.pdfiumModule.FPDFAnnot_GetVertices(annotationPtr, pointsPtr, count);\n for (let i = 0; i < count; i++) {\n const pointX = this.pdfiumModule.pdfium.getValue(pointsPtr + i * pointMemorySize, 'float');\n const pointY = this.pdfiumModule.pdfium.getValue(\n pointsPtr + i * pointMemorySize + 4,\n 'float',\n );\n\n const { x, y } = this.convertPagePointToDevicePoint(page, {\n x: pointX,\n y: pointY,\n });\n vertices.push({\n x,\n y,\n });\n }\n this.free(pointsPtr);\n\n return vertices;\n }\n\n /**\n * Read the target of pdf bookmark\n * @param docPtr - pointer to pdf document object\n * @param getActionPtr - callback function to retrive the pointer of action\n * @param getDestinationPtr - callback function to retrive the pointer of destination\n * @returns target of pdf bookmark\n *\n * @private\n */\n private readPdfBookmarkTarget(\n docPtr: number,\n getActionPtr: () => number,\n getDestinationPtr: () => number,\n ): PdfLinkTarget | undefined {\n const actionPtr = getActionPtr();\n if (actionPtr) {\n const action = this.readPdfAction(docPtr, actionPtr);\n\n return {\n type: 'action',\n action,\n };\n } else {\n const destinationPtr = getDestinationPtr();\n if (destinationPtr) {\n const destination = this.readPdfDestination(docPtr, destinationPtr);\n\n return {\n type: 'destination',\n destination,\n };\n }\n }\n }\n\n /**\n * Read field of pdf widget annotation\n * @param formHandle - form handle\n * @param annotationPtr - pointer to pdf annotation\n * @returns field of pdf widget annotation\n *\n * @private\n */\n private readPdfWidgetAnnoField(formHandle: number, annotationPtr: number): PdfWidgetAnnoField {\n const flag = this.pdfiumModule.FPDFAnnot_GetFormFieldFlags(\n formHandle,\n annotationPtr,\n ) as PDF_FORM_FIELD_FLAG;\n\n const type = this.pdfiumModule.FPDFAnnot_GetFormFieldType(\n formHandle,\n annotationPtr,\n ) as PDF_FORM_FIELD_TYPE;\n\n const name = readString(\n this.pdfiumModule.pdfium,\n (buffer: number, bufferLength) => {\n return this.pdfiumModule.FPDFAnnot_GetFormFieldName(\n formHandle,\n annotationPtr,\n buffer,\n bufferLength,\n );\n },\n this.pdfiumModule.pdfium.UTF16ToString,\n );\n\n const alternateName = readString(\n this.pdfiumModule.pdfium,\n (buffer: number, bufferLength) => {\n return this.pdfiumModule.FPDFAnnot_GetFormFieldAlternateName(\n formHandle,\n annotationPtr,\n buffer,\n bufferLength,\n );\n },\n this.pdfiumModule.pdfium.UTF16ToString,\n );\n\n const value = readString(\n this.pdfiumModule.pdfium,\n (buffer: number, bufferLength) => {\n return this.pdfiumModule.FPDFAnnot_GetFormFieldValue(\n formHandle,\n annotationPtr,\n buffer,\n bufferLength,\n );\n },\n this.pdfiumModule.pdfium.UTF16ToString,\n );\n\n const options: PdfWidgetAnnoOption[] = [];\n if (type === PDF_FORM_FIELD_TYPE.COMBOBOX || type === PDF_FORM_FIELD_TYPE.LISTBOX) {\n const count = this.pdfiumModule.FPDFAnnot_GetOptionCount(formHandle, annotationPtr);\n for (let i = 0; i < count; i++) {\n const label = readString(\n this.pdfiumModule.pdfium,\n (buffer: number, bufferLength) => {\n return this.pdfiumModule.FPDFAnnot_GetOptionLabel(\n formHandle,\n annotationPtr,\n i,\n buffer,\n bufferLength,\n );\n },\n this.pdfiumModule.pdfium.UTF16ToString,\n );\n const isSelected = this.pdfiumModule.FPDFAnnot_IsOptionSelected(\n formHandle,\n annotationPtr,\n i,\n );\n options.push({\n label,\n isSelected,\n });\n }\n }\n\n let isChecked = false;\n if (type === PDF_FORM_FIELD_TYPE.CHECKBOX || type === PDF_FORM_FIELD_TYPE.RADIOBUTTON) {\n isChecked = this.pdfiumModule.FPDFAnnot_IsChecked(formHandle, annotationPtr);\n }\n\n return {\n flag,\n type,\n name,\n alternateName,\n value,\n isChecked,\n options,\n };\n }\n\n /**\n * render rectangle of pdf page to image\n * @param docPtr - pointer to pdf document object\n * @param page - pdf page infor\n * @param rect - rectangle info\n * @param scaleFactor - factor of scalling\n * @param rotation - rotation angle\n * @param options - render options\n * @returns image data\n *\n * @private\n */\n private renderPageRectToImageData(\n ctx: DocumentContext,\n page: PdfPageObject,\n rect: Rect,\n scaleFactor: number,\n rotation: Rotation,\n dpr: number,\n options: PdfRenderOptions,\n ) {\n const format = BitmapFormat.Bitmap_BGRA;\n const bytesPerPixel = 4;\n\n // Round the transformed dimensions to whole pixels\n const rectSize = toIntRect(transformRect(page.size, rect, rotation, scaleFactor * dpr));\n const pageSize = toIntSize(transformSize(page.size, rotation, scaleFactor * dpr));\n\n const bitmapHeapLength = rectSize.size.width * rectSize.size.height * bytesPerPixel;\n const bitmapHeapPtr = this.malloc(bitmapHeapLength);\n const bitmapPtr = this.pdfiumModule.FPDFBitmap_CreateEx(\n rectSize.size.width,\n rectSize.size.height,\n format,\n bitmapHeapPtr,\n rectSize.size.width * bytesPerPixel,\n );\n\n this.pdfiumModule.FPDFBitmap_FillRect(\n bitmapPtr,\n 0,\n 0,\n rectSize.size.width,\n rectSize.size.height,\n 0xffffffff,\n );\n\n let flags = RenderFlag.REVERSE_BYTE_ORDER;\n if (options?.withAnnotations) {\n flags = flags | RenderFlag.ANNOT;\n }\n\n const pageCtx = ctx.acquirePage(page.index);\n\n this.pdfiumModule.FPDF_RenderPageBitmap(\n bitmapPtr,\n pageCtx.pagePtr,\n -rectSize.origin.x,\n -rectSize.origin.y,\n pageSize.width,\n pageSize.height,\n rotation,\n flags,\n );\n\n this.pdfiumModule.FPDFBitmap_Destroy(bitmapPtr);\n pageCtx.release();\n\n const data = this.pdfiumModule.pdfium.HEAPU8.subarray(\n bitmapHeapPtr,\n bitmapHeapPtr + bitmapHeapLength,\n );\n\n const imageData = {\n data: new Uint8ClampedArray(data),\n width: rectSize.size.width,\n height: rectSize.size.height,\n };\n\n this.free(bitmapHeapPtr);\n\n return imageData;\n }\n\n /**\n * Read the target of pdf link annotation\n * @param docPtr - pointer to pdf document object\n * @param getActionPtr - callback function to retrive the pointer of action\n * @param getDestinationPtr - callback function to retrive the pointer of destination\n * @returns target of link\n *\n * @private\n */\n private readPdfLinkAnnoTarget(\n docPtr: number,\n getActionPtr: () => number,\n getDestinationPtr: () => number,\n ): PdfLinkTarget | undefined {\n const destinationPtr = getDestinationPtr();\n if (destinationPtr) {\n const destination = this.readPdfDestination(docPtr, destinationPtr);\n\n return {\n type: 'destination',\n destination,\n };\n } else {\n const actionPtr = getActionPtr();\n if (actionPtr) {\n const action = this.readPdfAction(docPtr, actionPtr);\n\n return {\n type: 'action',\n action,\n };\n }\n }\n }\n\n /**\n * Read pdf action from pdf document\n * @param docPtr - pointer to pdf document object\n * @param actionPtr - pointer to pdf action object\n * @returns pdf action object\n *\n * @private\n */\n private readPdfAction(docPtr: number, actionPtr: number): PdfActionObject {\n const actionType = this.pdfiumModule.FPDFAction_GetType(actionPtr) as PdfActionType;\n let action: PdfActionObject;\n switch (actionType) {\n case PdfActionType.Unsupported:\n action = {\n type: PdfActionType.Unsupported,\n };\n break;\n case PdfActionType.Goto:\n {\n const destinationPtr = this.pdfiumModule.FPDFAction_GetDest(docPtr, actionPtr);\n if (destinationPtr) {\n const destination = this.readPdfDestination(docPtr, destinationPtr);\n\n action = {\n type: PdfActionType.Goto,\n destination,\n };\n } else {\n action = {\n type: PdfActionType.Unsupported,\n };\n }\n }\n break;\n case PdfActionType.RemoteGoto:\n {\n // In case of remote goto action,\n // the application should first use FPDFAction_GetFilePath\n // to get file path, then load that particular document,\n // and use its document handle to call this\n action = {\n type: PdfActionType.Unsupported,\n };\n }\n break;\n case PdfActionType.URI:\n {\n const uri = readString(\n this.pdfiumModule.pdfium,\n (buffer, bufferLength) => {\n return this.pdfiumModule.FPDFAction_GetURIPath(\n docPtr,\n actionPtr,\n buffer,\n bufferLength,\n );\n },\n this.pdfiumModule.pdfium.UTF8ToString,\n );\n\n action = {\n type: PdfActionType.URI,\n uri,\n };\n }\n break;\n case PdfActionType.LaunchAppOrOpenFile:\n {\n const path = readString(\n this.pdfiumModule.pdfium,\n (buffer, bufferLength) => {\n return this.pdfiumModule.FPDFAction_GetFilePath(actionPtr, buffer, bufferLength);\n },\n this.pdfiumModule.pdfium.UTF8ToString,\n );\n action = {\n type: PdfActionType.LaunchAppOrOpenFile,\n path,\n };\n }\n break;\n }\n\n return action;\n }\n\n /**\n * Read pdf destination object\n * @param docPtr - pointer to pdf document object\n * @param destinationPtr - pointer to pdf destination\n * @returns pdf destination object\n *\n * @private\n */\n private readPdfDestination(docPtr: number, destinationPtr: number): PdfDestinationObject {\n const pageIndex = this.pdfiumModule.FPDFDest_GetDestPageIndex(docPtr, destinationPtr);\n // Every params is a float value\n const maxParmamsCount = 4;\n const paramsCountPtr = this.malloc(maxParmamsCount);\n const paramsPtr = this.malloc(maxParmamsCount * 4);\n const zoomMode = this.pdfiumModule.FPDFDest_GetView(\n destinationPtr,\n paramsCountPtr,\n paramsPtr,\n ) as PdfZoomMode;\n const paramsCount = this.pdfiumModule.pdfium.getValue(paramsCountPtr, 'i32');\n const view: number[] = [];\n for (let i = 0; i < paramsCount; i++) {\n const paramPtr = paramsPtr + i * 4;\n view.push(this.pdfiumModule.pdfium.getValue(paramPtr, 'float'));\n }\n this.free(paramsCountPtr);\n this.free(paramsPtr);\n\n if (zoomMode === PdfZoomMode.XYZ) {\n const hasXPtr = this.malloc(1);\n const hasYPtr = this.malloc(1);\n const hasZPtr = this.malloc(1);\n const xPtr = this.malloc(4);\n const yPtr = this.malloc(4);\n const zPtr = this.malloc(4);\n\n const isSucceed = this.pdfiumModule.FPDFDest_GetLocationInPage(\n destinationPtr,\n hasXPtr,\n hasYPtr,\n hasZPtr,\n xPtr,\n yPtr,\n zPtr,\n );\n if (isSucceed) {\n const hasX = this.pdfiumModule.pdfium.getValue(hasXPtr, 'i8');\n const hasY = this.pdfiumModule.pdfium.getValue(hasYPtr, 'i8');\n const hasZ = this.pdfiumModule.pdfium.getValue(hasZPtr, 'i8');\n\n const x = hasX ? this.pdfiumModule.pdfium.getValue(xPtr, 'float') : 0;\n const y = hasY ? this.pdfiumModule.pdfium.getValue(yPtr, 'float') : 0;\n const zoom = hasZ ? this.pdfiumModule.pdfium.getValue(zPtr, 'float') : 0;\n\n this.free(hasXPtr);\n this.free(hasYPtr);\n this.free(hasZPtr);\n this.free(xPtr);\n this.free(yPtr);\n this.free(zPtr);\n\n return {\n pageIndex,\n zoom: {\n mode: zoomMode,\n params: {\n x,\n y,\n zoom,\n },\n },\n view,\n };\n }\n\n this.free(hasXPtr);\n this.free(hasYPtr);\n this.free(hasZPtr);\n this.free(xPtr);\n this.free(yPtr);\n this.free(zPtr);\n\n return {\n pageIndex,\n zoom: {\n mode: zoomMode,\n params: {\n x: 0,\n y: 0,\n zoom: 0,\n },\n },\n view,\n };\n }\n\n return {\n pageIndex,\n zoom: {\n mode: zoomMode,\n },\n view,\n };\n }\n\n /**\n * Read attachmet from pdf document\n * @param docPtr - pointer to pdf document object\n * @param index - index of attachment\n * @returns attachment content\n *\n * @private\n */\n private readPdfAttachment(docPtr: number, index: number): PdfAttachmentObject {\n const attachmentPtr = this.pdfiumModule.FPDFDoc_GetAttachment(docPtr, index);\n const name = readString(\n this.pdfiumModule.pdfium,\n (buffer, bufferLength) => {\n return this.pdfiumModule.FPDFAttachment_GetName(attachmentPtr, buffer, bufferLength);\n },\n this.pdfiumModule.pdfium.UTF16ToString,\n );\n const creationDate = readString(\n this.pdfiumModule.pdfium,\n (buffer, bufferLength) => {\n return this.pdfiumModule.FPDFAttachment_GetStringValue(\n attachmentPtr,\n 'CreationDate',\n buffer,\n bufferLength,\n );\n },\n this.pdfiumModule.pdfium.UTF16ToString,\n );\n const checksum = readString(\n this.pdfiumModule.pdfium,\n (buffer, bufferLength) => {\n return this.pdfiumModule.FPDFAttachment_GetStringValue(\n attachmentPtr,\n 'Checksum',\n buffer,\n bufferLength,\n );\n },\n this.pdfiumModule.pdfium.UTF16ToString,\n );\n\n return {\n index,\n name,\n creationDate,\n checksum,\n };\n }\n\n /**\n * Convert coordinate of point from device coordinate to page coordinate\n * @param page - pdf page infor\n * @param position - position of point\n * @returns converted position\n *\n * @private\n */\n private convertDevicePointToPagePoint(page: PdfPageObject, position: Position): Position {\n const x = position.x;\n const y = page.size.height - position.y;\n\n return { x, y };\n }\n\n /**\n * Convert coordinate of point from page coordinate to device coordinate\n * @param page - pdf page infor\n * @param position - position of point\n * @returns converted position\n *\n * @private\n */\n private convertPagePointToDevicePoint(page: PdfPageObject, position: Position): Position {\n const x = position.x;\n const y = page.size.height - position.y;\n\n return { x, y };\n }\n\n /**\n * Convert coordinate of rectangle from page coordinate to device coordinate\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param pageRect - rectangle that needs to be converted\n * @returns converted rectangle\n *\n * @private\n */\n private convertPageRectToDeviceRect(\n page: PdfPageObject,\n pagePtr: number,\n pageRect: {\n left: number;\n top: number;\n right: number;\n bottom: number;\n },\n ): Rect {\n const { x, y } = this.convertPagePointToDevicePoint(page, {\n x: pageRect.left,\n y: pageRect.top,\n });\n const rect = {\n origin: {\n x,\n y,\n },\n size: {\n width: Math.abs(pageRect.right - pageRect.left),\n height: Math.abs(pageRect.top - pageRect.bottom),\n },\n };\n\n return rect;\n }\n\n /**\n * Read the appearance stream of annotation\n * @param annotationPtr - pointer to pdf annotation\n * @param mode - appearance mode\n * @returns appearance stream\n *\n * @private\n */\n private readPageAnnoAppearanceStreams(annotationPtr: number) {\n return {\n normal: this.readPageAnnoAppearanceStream(annotationPtr, AppearanceMode.Normal),\n rollover: this.readPageAnnoAppearanceStream(annotationPtr, AppearanceMode.Rollover),\n down: this.readPageAnnoAppearanceStream(annotationPtr, AppearanceMode.Down),\n };\n }\n\n /**\n * Read the appearance stream of annotation\n * @param annotationPtr - pointer to pdf annotation\n * @param mode - appearance mode\n * @returns appearance stream\n *\n * @private\n */\n private readPageAnnoAppearanceStream(annotationPtr: number, mode = AppearanceMode.Normal) {\n const utf16Length = this.pdfiumModule.FPDFAnnot_GetAP(annotationPtr, mode, 0, 0);\n const bytesCount = (utf16Length + 1) * 2; // include NIL\n const bufferPtr = this.malloc(bytesCount);\n this.pdfiumModule.FPDFAnnot_GetAP(annotationPtr, mode, bufferPtr, bytesCount);\n const ap = this.pdfiumModule.pdfium.UTF16ToString(bufferPtr);\n this.free(bufferPtr);\n\n return ap;\n }\n\n /**\n * Set the rect of specified annotation\n * @param page - page info that the annotation is belonged to\n * @param pagePtr - pointer of page object\n * @param annotationPtr - pointer to annotation object\n * @param rect - target rectangle\n * @returns whether the rect is setted\n *\n * @private\n */\n setPageAnnoRect(page: PdfPageObject, pagePtr: number, annotationPtr: number, rect: Rect) {\n const pageXPtr = this.malloc(8);\n const pageYPtr = this.malloc(8);\n if (\n !this.pdfiumModule.FPDF_DeviceToPage(\n pagePtr,\n 0,\n 0,\n page.size.width,\n page.size.height,\n 0,\n rect.origin.x,\n rect.origin.y,\n pageXPtr,\n pageYPtr,\n )\n ) {\n this.free(pageXPtr);\n this.free(pageYPtr);\n return false;\n }\n const pageX = this.pdfiumModule.pdfium.getValue(pageXPtr, 'double');\n const pageY = this.pdfiumModule.pdfium.getValue(pageYPtr, 'double');\n this.free(pageXPtr);\n this.free(pageYPtr);\n\n const pageRectPtr = this.malloc(4 * 4);\n this.pdfiumModule.pdfium.setValue(pageRectPtr, pageX, 'float');\n this.pdfiumModule.pdfium.setValue(pageRectPtr + 4, pageY, 'float');\n this.pdfiumModule.pdfium.setValue(pageRectPtr + 8, pageX + rect.size.width, 'float');\n this.pdfiumModule.pdfium.setValue(pageRectPtr + 12, pageY - rect.size.height, 'float');\n\n if (!this.pdfiumModule.FPDFAnnot_SetRect(annotationPtr, pageRectPtr)) {\n this.free(pageRectPtr);\n return false;\n }\n this.free(pageRectPtr);\n\n return true;\n }\n\n /**\n * Read the rectangle of annotation\n * @param annotationPtr - pointer to pdf annotation\n * @returns rectangle of annotation\n *\n * @private\n */\n private readPageAnnoRect(annotationPtr: number) {\n const pageRectPtr = this.malloc(4 * 4);\n const pageRect = {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n };\n if (this.pdfiumModule.FPDFAnnot_GetRect(annotationPtr, pageRectPtr)) {\n pageRect.left = this.pdfiumModule.pdfium.getValue(pageRectPtr, 'float');\n pageRect.top = this.pdfiumModule.pdfium.getValue(pageRectPtr + 4, 'float');\n pageRect.right = this.pdfiumModule.pdfium.getValue(pageRectPtr + 8, 'float');\n pageRect.bottom = this.pdfiumModule.pdfium.getValue(pageRectPtr + 12, 'float');\n }\n this.free(pageRectPtr);\n\n return pageRect;\n }\n\n /**\n * Get highlight rects for a specific character range (for search highlighting)\n * @param page - pdf page info\n * @param pagePtr - pointer to pdf page\n * @param textPagePtr - pointer to pdf text page\n * @param startIndex - starting character index\n * @param charCount - number of characters in the range\n * @returns array of rectangles for highlighting the specified character range\n *\n * @private\n */\n private getHighlightRects(\n page: PdfPageObject,\n pagePtr: number,\n textPagePtr: number,\n startIndex: number,\n charCount: number,\n ): Rect[] {\n const rectsCount = this.pdfiumModule.FPDFText_CountRects(textPagePtr, startIndex, charCount);\n\n const highlightRects: Rect[] = [];\n for (let i = 0; i < rectsCount; i++) {\n const topPtr = this.malloc(8);\n const leftPtr = this.malloc(8);\n const rightPtr = this.malloc(8);\n const bottomPtr = this.malloc(8);\n const isSucceed = this.pdfiumModule.FPDFText_GetRect(\n textPagePtr,\n i,\n leftPtr,\n topPtr,\n rightPtr,\n bottomPtr,\n );\n if (!isSucceed) {\n this.free(leftPtr);\n this.free(topPtr);\n this.free(rightPtr);\n this.free(bottomPtr);\n continue;\n }\n\n const left = this.pdfiumModule.pdfium.getValue(leftPtr, 'double');\n const top = this.pdfiumModule.pdfium.getValue(topPtr, 'double');\n const right = this.pdfiumModule.pdfium.getValue(rightPtr, 'double');\n const bottom = this.pdfiumModule.pdfium.getValue(bottomPtr, 'double');\n\n this.free(leftPtr);\n this.free(topPtr);\n this.free(rightPtr);\n this.free(bottomPtr);\n\n const deviceXPtr = this.malloc(4);\n const deviceYPtr = this.malloc(4);\n this.pdfiumModule.FPDF_PageToDevice(\n pagePtr,\n 0,\n 0,\n page.size.width,\n page.size.height,\n 0,\n left,\n top,\n deviceXPtr,\n deviceYPtr,\n );\n const x = this.pdfiumModule.pdfium.getValue(deviceXPtr, 'i32');\n const y = this.pdfiumModule.pdfium.getValue(deviceYPtr, 'i32');\n this.free(deviceXPtr);\n this.free(deviceYPtr);\n\n // Convert the bottom-right coordinates to width/height\n const width = Math.ceil(Math.abs(right - left));\n const height = Math.ceil(Math.abs(top - bottom));\n\n highlightRects.push({\n origin: { x, y },\n size: { width, height },\n });\n }\n\n return highlightRects;\n }\n\n /**\n * Search for a keyword across all pages in the document\n * Returns all search results throughout the entire document\n *\n * @param doc - Pdf document object\n * @param keyword - Search keyword\n * @param flags - Match flags for search\n * @returns Promise of all search results in the document\n *\n * @public\n */\n searchAllPages(doc: PdfDocumentObject, keyword: string, flags: MatchFlag[] = []) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'searchAllPages', doc, keyword, flags);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `SearchAllPages`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `SearchAllPages`, 'End', doc.id);\n return PdfTaskHelper.resolve<SearchAllPagesResult>({ results: [], total: 0 });\n }\n\n const length = 2 * (keyword.length + 1);\n const keywordPtr = this.malloc(length);\n this.pdfiumModule.pdfium.stringToUTF16(keyword, keywordPtr, length);\n\n const flag = flags.reduce((flag: MatchFlag, currFlag: MatchFlag) => {\n return flag | currFlag;\n }, MatchFlag.None);\n\n const results: SearchResult[] = [];\n\n // Search through all pages\n const searchAllPagesTask = PdfTaskHelper.create<SearchAllPagesResult>();\n\n // Execute search in a separate function to avoid issues with resolve parameter\n const executeSearch = async () => {\n for (let pageIndex = 0; pageIndex < doc.pageCount; pageIndex++) {\n // Get all results for the current page efficiently (load page only once)\n const pageResults = this.searchAllInPage(ctx, doc.pages[pageIndex], keywordPtr, flag);\n\n results.push(...pageResults);\n }\n\n this.free(keywordPtr);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `SearchAllPages`, 'End', doc.id);\n\n searchAllPagesTask.resolve({\n results,\n total: results.length,\n });\n };\n\n // Start the search process\n executeSearch().catch((error) => {\n this.free(keywordPtr);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `SearchAllPages`, 'End', doc.id);\n searchAllPagesTask.reject({\n code: PdfErrorCode.Unknown,\n message: `Error searching document: ${error}`,\n });\n });\n\n return searchAllPagesTask;\n }\n\n /**\n * Extract word-aligned context for a search hit.\n *\n * @param fullText full UTF-16 page text (fetch this once per page!)\n * @param start index of 1st char that matched\n * @param count number of chars in the match\n * @param windowChars minimum context chars to keep left & right\n */\n private buildContext(\n fullText: string,\n start: number,\n count: number,\n windowChars = 30,\n ): TextContext {\n const WORD_BREAK = /[\\s\\u00A0.,;:!?()\\[\\]{}<>/\\\\\\-\"'`\"”\\u2013\\u2014]/;\n\n // Find the start of a word moving left\n const findWordStart = (index: number): number => {\n while (index > 0 && !WORD_BREAK.test(fullText[index - 1])) index--;\n return index;\n };\n\n // Find the end of a word moving right\n const findWordEnd = (index: number): number => {\n while (index < fullText.length && !WORD_BREAK.test(fullText[index])) index++;\n return index;\n };\n\n // Move left to build context\n let left = start;\n while (left > 0 && WORD_BREAK.test(fullText[left - 1])) left--; // Skip blanks\n let collected = 0;\n while (left > 0 && collected < windowChars) {\n left--;\n if (!WORD_BREAK.test(fullText[left])) collected++;\n }\n left = findWordStart(left);\n\n // Move right to build context\n let right = start + count;\n while (right < fullText.length && WORD_BREAK.test(fullText[right])) right++; // Skip blanks\n collected = 0;\n while (right < fullText.length && collected < windowChars) {\n if (!WORD_BREAK.test(fullText[right])) collected++;\n right++;\n }\n right = findWordEnd(right);\n\n // Compose the context\n const before = fullText.slice(left, start).replace(/\\s+/g, ' ').trimStart();\n const match = fullText.slice(start, start + count);\n const after = fullText\n .slice(start + count, right)\n .replace(/\\s+/g, ' ')\n .trimEnd();\n\n return {\n before: this.tidy(before),\n match: this.tidy(match),\n after: this.tidy(after),\n truncatedLeft: left > 0,\n truncatedRight: right < fullText.length,\n };\n }\n\n /**\n * Tidy the text to remove any non-printable characters and whitespace\n * @param s - text to tidy\n * @returns tidied text\n *\n * @private\n */\n private tidy(s: string): string {\n return (\n s\n /* 1️⃣ join words split by hyphen + U+FFFE + whitespace */\n .replace(/-\\uFFFE\\s*/g, '')\n\n /* 2️⃣ drop any remaining U+FFFE, soft-hyphen, zero-width chars */\n .replace(/[\\uFFFE\\u00AD\\u200B\\u2060\\uFEFF]/g, '')\n\n /* 3️⃣ collapse whitespace so we stay on one line */\n .replace(/\\s+/g, ' ')\n );\n }\n\n /**\n * Search for all occurrences of a keyword on a single page\n * This method efficiently loads the page only once and finds all matches\n *\n * @param docPtr - pointer to pdf document\n * @param page - pdf page object\n * @param pageIndex - index of the page\n * @param keywordPtr - pointer to the search keyword\n * @param flag - search flags\n * @returns array of search results on this page\n *\n * @private\n */\n private searchAllInPage(\n ctx: DocumentContext,\n page: PdfPageObject,\n keywordPtr: number,\n flag: number,\n ): SearchResult[] {\n const pageIndex = page.index;\n // Load the page and text page only once\n const pageCtx = ctx.acquirePage(pageIndex);\n const textPagePtr = pageCtx.getTextPage();\n\n // Load the full text of the page once\n const total = this.pdfiumModule.FPDFText_CountChars(textPagePtr);\n const bufPtr = this.malloc(2 * (total + 1));\n this.pdfiumModule.FPDFText_GetText(textPagePtr, 0, total, bufPtr);\n const fullText = this.pdfiumModule.pdfium.UTF16ToString(bufPtr);\n this.free(bufPtr);\n\n const pageResults: SearchResult[] = [];\n\n // Initialize search handle once for the page\n const searchHandle = this.pdfiumModule.FPDFText_FindStart(\n textPagePtr,\n keywordPtr,\n flag,\n 0, // Start from the beginning of the page\n );\n\n // Call FindNext repeatedly to get all matches on the page\n while (this.pdfiumModule.FPDFText_FindNext(searchHandle)) {\n const charIndex = this.pdfiumModule.FPDFText_GetSchResultIndex(searchHandle);\n const charCount = this.pdfiumModule.FPDFText_GetSchCount(searchHandle);\n\n const rects = this.getHighlightRects(\n page,\n pageCtx.pagePtr,\n textPagePtr,\n charIndex,\n charCount,\n );\n\n const context = this.buildContext(fullText, charIndex, charCount);\n\n pageResults.push({\n pageIndex,\n charIndex,\n charCount,\n rects,\n context,\n });\n }\n\n // Close the search handle only once after finding all results\n this.pdfiumModule.FPDFText_FindClose(searchHandle);\n\n // Close the text page and page only once\n pageCtx.release();\n\n return pageResults;\n }\n}\n","import {\n Logger,\n NoopLogger,\n PdfEngine,\n PdfEngineError,\n PdfEngineMethodArgs,\n PdfEngineMethodName,\n PdfEngineMethodReturnType,\n PdfErrorCode,\n TaskReturn,\n} from '@embedpdf/models';\n\n/**\n * Request body that represent method calls of PdfEngine, it contains the\n * method name and arguments\n */\nexport type PdfEngineMethodRequestBody = {\n [P in PdfEngineMethodName]: {\n name: P;\n args: PdfEngineMethodArgs<P>;\n };\n}[PdfEngineMethodName];\n\n/**\n * Response body that represent return value of PdfEngine\n */\nexport type PdfEngineMethodResponseBody = {\n [P in PdfEngineMethodName]: TaskReturn<PdfEngineMethodReturnType<P>>;\n}[PdfEngineMethodName];\n\n/**\n * Request that abort the specified task\n */\nexport interface AbortRequest {\n /**\n * message id\n */\n id: string;\n /**\n * request type\n */\n type: 'AbortRequest';\n}\n/**\n * Request that execute pdf engine method\n */\nexport interface ExecuteRequest {\n /**\n * message id\n */\n id: string;\n /**\n * request type\n */\n type: 'ExecuteRequest';\n /**\n * request body\n */\n data: PdfEngineMethodRequestBody;\n}\n/**\n * Response that execute pdf engine method\n */\nexport interface ExecuteResponse {\n /**\n * message id\n */\n id: string;\n /**\n * response type\n */\n type: 'ExecuteResponse';\n /**\n * response body\n */\n data: PdfEngineMethodResponseBody;\n}\n\n/**\n * Response that indicate engine is ready\n */\nexport interface ReadyResponse {\n /**\n * message id\n */\n id: string;\n /**\n * response type\n */\n type: 'ReadyResponse';\n}\n\n/**\n * Request type\n */\nexport type Request = ExecuteRequest | AbortRequest;\n/**\n * Response type\n */\nexport type Response = ExecuteResponse | ReadyResponse;\n\nconst LOG_SOURCE = 'WebWorkerEngineRunner';\nconst LOG_CATEGORY = 'Engine';\n\n/**\n * Pdf engine runner, it will execute pdf engine based on the request it received and\n * send back the response with post message\n */\nexport class EngineRunner {\n engine: PdfEngine | undefined;\n\n /**\n * Create instance of EngineRunnder\n * @param logger - logger instance\n */\n constructor(public logger: Logger = new NoopLogger()) {}\n\n /**\n * Listening on post message\n */\n listen() {\n self.onmessage = (evt: MessageEvent<Request>) => {\n return this.handle(evt);\n };\n }\n\n /**\n * Handle post message\n */\n handle(evt: MessageEvent<Request>) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'webworker receive message event: ', evt.data);\n try {\n const request = evt.data as Request;\n switch (request.type) {\n case 'ExecuteRequest':\n this.execute(request);\n break;\n }\n } catch (e) {\n this.logger.info(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'webworker met error when processing message event:',\n e,\n );\n }\n }\n\n /**\n * Send the ready response when pdf engine is ready\n * @returns\n *\n * @protected\n */\n ready() {\n this.listen();\n\n this.respond({\n id: '0',\n type: 'ReadyResponse',\n });\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'runner is ready');\n }\n\n /**\n * Execute the request\n * @param request - request that represent the pdf engine call\n * @returns\n *\n * @protected\n */\n execute = (request: ExecuteRequest) => {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'runner start exeucte request');\n if (!this.engine) {\n const error: PdfEngineError = {\n type: 'reject',\n reason: {\n code: PdfErrorCode.NotReady,\n message: 'engine has not started yet',\n },\n };\n const response: ExecuteResponse = {\n id: request.id,\n type: 'ExecuteResponse',\n data: {\n type: 'error',\n value: error,\n },\n };\n this.respond(response);\n return;\n }\n\n const engine = this.engine;\n const { name, args } = request.data;\n if (!engine[name]) {\n const error: PdfEngineError = {\n type: 'reject',\n reason: {\n code: PdfErrorCode.NotSupport,\n message: 'engine method has not supported yet',\n },\n };\n const response: ExecuteResponse = {\n id: request.id,\n type: 'ExecuteResponse',\n data: {\n type: 'error',\n value: error,\n },\n };\n this.respond(response);\n return;\n }\n\n let task: PdfEngineMethodReturnType<typeof name>;\n switch (name) {\n case 'isSupport':\n task = this.engine[name]!(...args);\n break;\n case 'initialize':\n task = this.engine[name]!(...args);\n break;\n case 'destroy':\n task = this.engine[name]!(...args);\n break;\n case 'openDocumentUrl':\n task = this.engine[name]!(...args);\n break;\n case 'openDocumentFromBuffer':\n task = this.engine[name]!(...args);\n break;\n case 'openDocumentFromLoader':\n task = this.engine[name]!(...args);\n break;\n case 'getDocPermissions':\n task = this.engine[name]!(...args);\n break;\n case 'getDocUserPermissions':\n task = this.engine[name]!(...args);\n break;\n case 'getMetadata':\n task = this.engine[name]!(...args);\n break;\n case 'getBookmarks':\n task = this.engine[name]!(...args);\n break;\n case 'getSignatures':\n task = this.engine[name]!(...args);\n break;\n case 'renderPage':\n task = this.engine[name]!(...args);\n break;\n case 'renderPageRect':\n task = this.engine[name]!(...args);\n break;\n case 'renderThumbnail':\n task = this.engine[name]!(...args);\n break;\n case 'getAllAnnotations':\n task = this.engine[name]!(...args);\n break;\n case 'getPageAnnotations':\n task = this.engine[name]!(...args);\n break;\n case 'createPageAnnotation':\n task = this.engine[name]!(...args);\n break;\n case 'transformPageAnnotation':\n task = this.engine[name]!(...args);\n break;\n case 'removePageAnnotation':\n task = this.engine[name]!(...args);\n break;\n case 'getPageTextRects':\n task = this.engine[name]!(...args);\n break;\n case 'searchAllPages':\n task = this.engine[name]!(...args);\n break;\n case 'closeDocument':\n task = this.engine[name]!(...args);\n break;\n case 'saveAsCopy':\n task = this.engine[name]!(...args);\n break;\n case 'getAttachments':\n task = this.engine[name]!(...args);\n break;\n case 'readAttachmentContent':\n task = this.engine[name]!(...args);\n break;\n case 'setFormFieldValue':\n task = this.engine[name]!(...args);\n break;\n case 'flattenPage':\n task = this.engine[name]!(...args);\n break;\n case 'extractPages':\n task = this.engine[name]!(...args);\n break;\n case 'extractText':\n task = this.engine[name]!(...args);\n break;\n case 'getTextSlices':\n task = this.engine[name]!(...args);\n break;\n case 'getPageGlyphs':\n task = this.engine[name]!(...args);\n break;\n case 'getPageGeometry':\n task = this.engine[name]!(...args);\n break;\n case 'merge':\n task = this.engine[name]!(...args);\n break;\n case 'mergePages':\n task = this.engine[name]!(...args);\n break;\n }\n\n task.wait(\n (result) => {\n const response: ExecuteResponse = {\n id: request.id,\n type: 'ExecuteResponse',\n data: {\n type: 'result',\n value: result,\n },\n };\n this.respond(response);\n },\n (error) => {\n const response: ExecuteResponse = {\n id: request.id,\n type: 'ExecuteResponse',\n data: {\n type: 'error',\n value: error,\n },\n };\n this.respond(response);\n },\n );\n };\n\n /**\n * Send back the response\n * @param response - response that needs sent back\n *\n * @protected\n */\n respond(response: Response) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'runner respond: ', response);\n self.postMessage(response);\n }\n}\n","import { init } from '@embedpdf/pdfium';\nimport { EngineRunner } from '../webworker/runner';\nimport { PdfiumEngine } from './engine';\n\n/**\n * EngineRunner for pdfium-based wasm engine\n */\nexport class PdfiumEngineRunner extends EngineRunner {\n /**\n * Create an instance of PdfiumEngineRunner\n * @param wasmBinary - wasm binary that contains the pdfium wasm file\n */\n constructor(private wasmBinary: ArrayBuffer) {\n super();\n }\n\n /**\n * Initialize runner\n */\n async prepare() {\n const wasmBinary = this.wasmBinary;\n const wasmModule = await init({ wasmBinary });\n this.engine = new PdfiumEngine(wasmModule);\n this.ready();\n }\n}\n"],"names":["BitmapFormat","RenderFlag","LOG_SOURCE","LOG_CATEGORY","PdfiumErrorCode","NoopLogger","PdfTaskHelper","PdfErrorCode","Rotation","Task","PdfAnnotationSubtype","stripPdfUnwantedMarkers","PdfPageObjectType","PdfAnnotationObjectStatus","quadToRect","PDF_FORM_FIELD_TYPE","toIntRect","transformRect","toIntSize","transformSize","PdfActionType","PdfZoomMode","AppearanceMode","MatchFlag","init"],"mappings":";;;;;AAEA;;;;;;;;;AASG;AACG,SAAU,UAAU,CACxB,UAA+C,EAC/C,SAA2D,EAC3D,UAAsC,EACtC,aAAA,GAAwB,GAAG,EAAA;IAE3B,IAAI,MAAM,GAAG,UAAU,CAAC,W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IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;KAC5B;AACF;;ACjWD;;AAEG;AACG,MAAO,kBAAmB,SAAQ,YAAY,CAAA;AAClD;;;AAGG;AACH,IAAA,WAAA,CAAoB,UAAuB,EAAA;AACzC,QAAA,KAAK,EAAE,CAAC;QADU,IAAU,CAAA,UAAA,GAAV,UAAU,CAAa;KAE1C;AAED;;AAEG;AACH,IAAA,MAAM,OAAO,GAAA;AACX,QAAA,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACnC,MAAM,UAAU,GAAG,MAAMiB,WAAI,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,KAAK,EAAE,CAAC;KACd;AACF;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"pdfium.cjs","sources":["../src/lib/pdfium/helper.ts","../src/lib/pdfium/cache.ts","../src/lib/pdfium/engine.ts","../src/lib/webworker/runner.ts","../src/lib/pdfium/runner.ts"],"sourcesContent":["import { PdfiumRuntimeMethods, PdfiumModule } from '@embedpdf/pdfium';\n\n/**\n * Read string from WASM heap\n * @param wasmModule - pdfium wasm module instance\n * @param readChars - function to read chars\n * @param parseChars - function to parse chars\n * @param defaultLength - default length of chars that needs to read\n * @returns string from the heap\n *\n * @public\n */\nexport function readString(\n wasmModule: PdfiumRuntimeMethods & PdfiumModule,\n readChars: (buffer: number, bufferLength: number) => number,\n parseChars: (buffer: number) => string,\n defaultLength: number = 100,\n): string {\n let buffer = wasmModule.wasmExports.malloc(defaultLength);\n for (let i = 0; i < defaultLength; i++) {\n wasmModule.HEAP8[buffer + i] = 0;\n }\n const actualLength = readChars(buffer, defaultLength);\n let str: string;\n if (actualLength > defaultLength) {\n wasmModule.wasmExports.free(buffer);\n buffer = wasmModule.wasmExports.malloc(actualLength);\n for (let i = 0; i < actualLength; i++) {\n wasmModule.HEAP8[buffer + i] = 0;\n }\n readChars(buffer, actualLength);\n str = parseChars(buffer);\n } else {\n str = parseChars(buffer);\n }\n wasmModule.wasmExports.free(buffer);\n\n return str;\n}\n/**\n * Read arraybyffer from WASM heap\n * @param wasmModule - pdfium wasm module instance\n * @param readChars - function to read chars\n * @returns arraybuffer from the heap\n *\n * @public\n */\nexport function readArrayBuffer(\n wasmModule: PdfiumRuntimeMethods & PdfiumModule,\n readChars: (buffer: number, bufferLength: number) => number,\n): ArrayBuffer {\n const bufferSize = readChars(0, 0);\n\n const bufferPtr = wasmModule.wasmExports.malloc(bufferSize);\n\n readChars(bufferPtr, bufferSize);\n\n const arrayBuffer = new ArrayBuffer(bufferSize);\n const view = new DataView(arrayBuffer);\n\n for (let i = 0; i < bufferSize; i++) {\n view.setInt8(i, wasmModule.getValue(bufferPtr + i, 'i8'));\n }\n\n wasmModule.wasmExports.free(bufferPtr);\n\n return arrayBuffer;\n}\n","import { WrappedPdfiumModule } from '@embedpdf/pdfium';\n\nexport class PdfCache {\n private readonly docs = new Map<string, DocumentContext>();\n\n constructor(private readonly pdfium: WrappedPdfiumModule) {}\n\n /** Open (or re-use) a document */\n setDocument(id: string, filePtr: number, docPtr: number) {\n let ctx = this.docs.get(id);\n if (!ctx) {\n ctx = new DocumentContext(filePtr, docPtr, this.pdfium);\n this.docs.set(id, ctx);\n }\n }\n\n /** Retrieve the DocumentContext for a given PdfDocumentObject */\n getContext(docId: string): DocumentContext | undefined {\n return this.docs.get(docId);\n }\n\n /** Close & fully release a document and all its pages */\n closeDocument(docId: string): boolean {\n const ctx = this.docs.get(docId);\n if (!ctx) return false;\n ctx.dispose(); // tears down pages first, then FPDF_CloseDocument, free()\n this.docs.delete(docId);\n return true;\n }\n}\n\nexport class DocumentContext {\n private readonly pageCache: PageCache;\n\n constructor(\n public readonly filePtr: number,\n public readonly docPtr: number,\n pdfium: WrappedPdfiumModule,\n ) {\n this.pageCache = new PageCache(pdfium, docPtr);\n }\n\n /** Main accessor for pages */\n acquirePage(pageIdx: number): PageContext {\n return this.pageCache.acquire(pageIdx);\n }\n\n /** Tear down all pages + this document */\n dispose(): void {\n // 1️⃣ release all pages (with their TTL or immediate)\n this.pageCache.forceReleaseAll();\n\n // 2️⃣ close the PDFium document\n this.pageCache.pdf.FPDF_CloseDocument(this.docPtr);\n\n // 3️⃣ free the file handle\n this.pageCache.pdf.pdfium.wasmExports.free(this.filePtr);\n }\n}\n\nexport class PageCache {\n private readonly cache = new Map<number, PageContext>();\n\n constructor(\n public readonly pdf: WrappedPdfiumModule,\n private readonly docPtr: number,\n ) {}\n\n acquire(pageIdx: number): PageContext {\n let ctx = this.cache.get(pageIdx);\n if (!ctx) {\n const pagePtr = this.pdf.FPDF_LoadPage(this.docPtr, pageIdx);\n ctx = new PageContext(this.pdf, this.docPtr, pageIdx, pagePtr, () => {\n this.cache.delete(pageIdx);\n });\n this.cache.set(pageIdx, ctx);\n }\n ctx.clearExpiryTimer(); // cancel any pending teardown\n ctx.bumpRefCount(); // bump ref‐count\n return ctx;\n }\n\n forceReleaseAll(): void {\n for (const ctx of this.cache.values()) {\n ctx.disposeImmediate();\n }\n this.cache.clear();\n }\n}\n\nconst PAGE_TTL = 5000; // 5 seconds\n\nexport class PageContext {\n private refCount = 0;\n private expiryTimer?: ReturnType<typeof setTimeout>;\n private disposed = false;\n\n // lazy helpers\n private textPagePtr?: number;\n private formInfoPtr?: number;\n private formHandle?: number;\n\n constructor(\n private readonly pdf: WrappedPdfiumModule,\n public readonly docPtr: number,\n public readonly pageIdx: number,\n public readonly pagePtr: number,\n private readonly onFinalDispose: () => void,\n ) {}\n\n /** Called by PageCache.acquire() */\n bumpRefCount() {\n if (this.disposed) throw new Error('Context already disposed');\n this.refCount++;\n }\n\n /** Called by PageCache.acquire() */\n clearExpiryTimer() {\n if (this.expiryTimer) {\n clearTimeout(this.expiryTimer);\n this.expiryTimer = undefined;\n }\n }\n\n /** Called by PageCache.release() internally */\n release() {\n if (this.disposed) return;\n this.refCount--;\n if (this.refCount === 0) {\n // schedule the one-and-only timer for the page\n this.expiryTimer = setTimeout(() => this.disposeImmediate(), PAGE_TTL);\n }\n }\n\n /** Tear down _all_ sub-pointers & the page. */\n disposeImmediate() {\n if (this.disposed) return;\n this.disposed = true;\n\n // 2️⃣ close text-page if opened\n if (this.textPagePtr !== undefined) {\n this.pdf.FPDFText_ClosePage(this.textPagePtr);\n }\n\n // 3️⃣ close form-fill if opened\n if (this.formHandle !== undefined) {\n this.pdf.FORM_OnBeforeClosePage(this.pagePtr, this.formHandle);\n this.pdf.PDFiumExt_ExitFormFillEnvironment(this.formHandle);\n }\n if (this.formInfoPtr !== undefined) {\n this.pdf.PDFiumExt_CloseFormFillInfo(this.formInfoPtr);\n }\n\n // 4️⃣ finally close the page itself\n this.pdf.FPDF_ClosePage(this.pagePtr);\n\n // 5️⃣ remove from the cache\n this.onFinalDispose();\n }\n\n // ── public helpers ──\n\n /** Always safe: opens (once) and returns the text-page ptr. */\n getTextPage(): number {\n this.ensureAlive();\n if (this.textPagePtr === undefined) {\n this.textPagePtr = this.pdf.FPDFText_LoadPage(this.pagePtr);\n }\n return this.textPagePtr;\n }\n\n /** Always safe: opens (once) and returns the form-fill handle. */\n getFormHandle(): number {\n this.ensureAlive();\n if (this.formHandle === undefined) {\n this.formInfoPtr = this.pdf.PDFiumExt_OpenFormFillInfo();\n this.formHandle = this.pdf.PDFiumExt_InitFormFillEnvironment(this.docPtr, this.formInfoPtr);\n this.pdf.FORM_OnAfterLoadPage(this.pagePtr, this.formHandle);\n }\n return this.formHandle;\n }\n\n /**\n * Safely execute `fn` with an annotation pointer.\n * Pointer is ALWAYS closed afterwards.\n */\n withAnnotation<T>(annotIdx: number, fn: (annotPtr: number) => T): T {\n this.ensureAlive();\n const annotPtr = this.pdf.FPDFPage_GetAnnot(this.pagePtr, annotIdx);\n try {\n return fn(annotPtr);\n } finally {\n this.pdf.FPDFPage_CloseAnnot(annotPtr);\n }\n }\n\n private ensureAlive() {\n if (this.disposed) throw new Error('PageContext already disposed');\n }\n}\n","import {\n PdfActionObject,\n PdfAnnotationObject,\n PdfTextRectObject,\n PdfAnnotationSubtype,\n PdfLinkAnnoObject,\n PdfWidgetAnnoObject,\n PdfLinkTarget,\n PdfZoomMode,\n Logger,\n NoopLogger,\n SearchResult,\n SearchTarget,\n MatchFlag,\n PdfDestinationObject,\n PdfBookmarkObject,\n PdfDocumentObject,\n PdfEngine,\n PdfPageObject,\n PdfActionType,\n Rotation,\n PDF_FORM_FIELD_FLAG,\n PDF_FORM_FIELD_TYPE,\n PdfWidgetAnnoOption,\n PdfFileAttachmentAnnoObject,\n Rect,\n PdfAttachmentObject,\n PdfUnsupportedAnnoObject,\n PdfTextAnnoObject,\n PdfSignatureObject,\n PdfRenderOptions,\n PdfInkAnnoObject,\n PdfInkListObject,\n Position,\n PdfStampAnnoObject,\n PdfCircleAnnoObject,\n PdfSquareAnnoObject,\n PdfFreeTextAnnoObject,\n PdfCaretAnnoObject,\n PdfSquigglyAnnoObject,\n PdfStrikeOutAnnoObject,\n PdfUnderlineAnnoObject,\n transformSize,\n PdfFile,\n PdfAnnotationTransformation,\n PdfSegmentObject,\n AppearanceMode,\n PdfImageObject,\n PdfPageObjectType,\n PdfPathObject,\n PdfFormObject,\n PdfPolygonAnnoObject,\n PdfPolylineAnnoObject,\n PdfLineAnnoObject,\n PdfHighlightAnnoObject,\n PdfStampAnnoObjectContents,\n PdfWidgetAnnoField,\n PdfTransformMatrix,\n FormFieldValue,\n PdfErrorCode,\n PdfTaskHelper,\n PdfPageFlattenFlag,\n PdfPageFlattenResult,\n PdfTask,\n PdfFileLoader,\n transformRect,\n SearchAllPagesResult,\n PdfUrlOptions,\n PdfFileUrl,\n Task,\n PdfErrorReason,\n TextContext,\n PdfGlyphObject,\n PdfPageGeometry,\n PdfRun,\n toIntRect,\n toIntSize,\n Quad,\n PdfAlphaColor,\n PdfAnnotationState,\n PdfAnnotationStateModel,\n quadToRect,\n PdfImage,\n ImageConversionTypes,\n PdfAnnotationObjectBase,\n PageTextSlice,\n stripPdfUnwantedMarkers,\n webAlphaColorToPdfAlphaColor,\n pdfAlphaColorToWebAlphaColor,\n rectToQuad,\n WebAlphaColor,\n dateToPdfDate,\n pdfDateToDate,\n PdfAnnotationColorType,\n PdfAnnotationBorderStyle,\n flagsToNames,\n PdfAnnotationFlagName,\n makeMatrix,\n} from '@embedpdf/models';\nimport { readArrayBuffer, readString } from './helper';\nimport { WrappedPdfiumModule } from '@embedpdf/pdfium';\nimport { DocumentContext, PageContext, PdfCache } from './cache';\n\n/**\n * Format of bitmap\n */\nexport enum BitmapFormat {\n Bitmap_Gray = 1,\n Bitmap_BGR = 2,\n Bitmap_BGRx = 3,\n Bitmap_BGRA = 4,\n}\n\n/**\n * Pdf rendering flag\n */\nexport enum RenderFlag {\n ANNOT = 0x01, // Set if annotations are to be rendered.\n LCD_TEXT = 0x02, // Set if using text rendering optimized for LCD display.\n NO_NATIVETEXT = 0x04, // Don't use the native text output available on some platforms\n GRAYSCALE = 0x08, // Grayscale output.\n DEBUG_INFO = 0x80, // Set if you want to get some debug info. Please discuss with Foxit first if you need to collect debug info.\n NO_CATCH = 0x100, // Set if you don't want to catch exception.\n RENDER_LIMITEDIMAGECACHE = 0x200, // Limit image cache size.\n RENDER_FORCEHALFTONE = 0x400, // Always use halftone for image stretching.\n PRINTING = 0x800, // Render for printing.\n REVERSE_BYTE_ORDER = 0x10, // Set whether render in a reverse Byte order, this flag only.\n}\n\nconst LOG_SOURCE = 'PDFiumEngine';\nconst LOG_CATEGORY = 'Engine';\n\n/**\n * Context used for searching\n */\nexport interface SearchContext {\n /**\n * search target\n */\n target: SearchTarget;\n /**\n * current page index\n */\n currPageIndex: number;\n /**\n * index of text in the current pdf page, -1 means reach the end\n */\n startIndex: number;\n}\n\n/**\n * Error code of pdfium library\n */\nexport enum PdfiumErrorCode {\n Success = 0,\n Unknown = 1,\n File = 2,\n Format = 3,\n Password = 4,\n Security = 5,\n Page = 6,\n XFALoad = 7,\n XFALayout = 8,\n}\n\n/**\n * Function type for converting ImageData to Blob\n * In browser: uses OffscreenCanvas\n * In Node.js: can use Sharp or other image processing libraries\n */\nexport type ImageDataConverter<T = Blob> = (\n imageData: PdfImage,\n imageType?: ImageConversionTypes,\n) => Promise<T>;\n\nexport const browserImageDataToBlobConverter: ImageDataConverter<Blob> = (\n pdfImageData: PdfImage,\n imageType: ImageConversionTypes = 'image/webp',\n): Promise<Blob> => {\n // Check if we're in a browser environment\n if (typeof OffscreenCanvas === 'undefined') {\n throw new Error(\n 'OffscreenCanvas is not available in this environment. ' +\n 'This converter is intended for browser use only. ' +\n 'Please use createNodeImageDataToBlobConverter() or createNodeCanvasImageDataToBlobConverter() for Node.js.',\n );\n }\n\n const imageData = new ImageData(pdfImageData.data, pdfImageData.width, pdfImageData.height);\n const off = new OffscreenCanvas(imageData.width, imageData.height);\n off.getContext('2d')!.putImageData(imageData, 0, 0);\n return off.convertToBlob({ type: imageType });\n};\n\n/**\n * Pdf engine that based on pdfium wasm\n */\nexport class PdfiumEngine<T = Blob> implements PdfEngine<T> {\n /**\n * pdf documents that opened\n */\n private readonly cache: PdfCache;\n\n /**\n * Create an instance of PdfiumEngine\n * @param wasmModule - pdfium wasm module\n * @param logger - logger instance\n * @param imageDataToBlobConverter - function to convert ImageData to Blob\n */\n constructor(\n private pdfiumModule: WrappedPdfiumModule,\n private logger: Logger = new NoopLogger(),\n private imageDataConverter: ImageDataConverter<T> = browserImageDataToBlobConverter as ImageDataConverter<T>,\n ) {\n this.cache = new PdfCache(this.pdfiumModule);\n }\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.initialize}\n *\n * @public\n */\n initialize() {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'initialize');\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `Initialize`, 'Begin', 'General');\n this.pdfiumModule.PDFiumExt_Init();\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `Initialize`, 'End', 'General');\n return PdfTaskHelper.resolve(true);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.destroy}\n *\n * @public\n */\n destroy() {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'destroy');\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `Destroy`, 'Begin', 'General');\n this.pdfiumModule.FPDF_DestroyLibrary();\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `Destroy`, 'End', 'General');\n return PdfTaskHelper.resolve(true);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.openDocumentUrl}\n *\n * @public\n */\n public openDocumentUrl(file: PdfFileUrl, options?: PdfUrlOptions) {\n const mode = options?.mode ?? 'auto';\n const password = options?.password ?? '';\n\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'openDocumentUrl called', file.url, mode);\n\n // We'll create a task to wrap asynchronous steps\n const task = PdfTaskHelper.create<PdfDocumentObject>();\n\n // Start an async procedure\n (async () => {\n try {\n // Decide on approach\n if (mode === 'full-fetch') {\n const fetchFullTask = await this.fetchFullAndOpen(file, password);\n fetchFullTask.wait(\n (doc) => task.resolve(doc),\n (err) => task.reject(err.reason),\n );\n } else if (mode === 'range-request') {\n const openDocumentWithRangeRequestTask = await this.openDocumentWithRangeRequest(\n file,\n password,\n );\n openDocumentWithRangeRequestTask.wait(\n (doc) => task.resolve(doc),\n (err) => task.reject(err.reason),\n );\n } else {\n // mode: 'auto'\n const { supportsRanges, fileLength, content } = await this.checkRangeSupport(file.url);\n if (supportsRanges) {\n const openDocumentWithRangeRequestTask = await this.openDocumentWithRangeRequest(\n file,\n password,\n fileLength,\n );\n openDocumentWithRangeRequestTask.wait(\n (doc) => task.resolve(doc),\n (err) => task.reject(err.reason),\n );\n } else if (content) {\n // If we already have the content from the range check, use it\n const pdfFile: PdfFile = { id: file.id, content };\n this.openDocumentFromBuffer(pdfFile, password).wait(\n (doc) => task.resolve(doc),\n (err) => task.reject(err.reason),\n );\n } else {\n const fetchFullTask = await this.fetchFullAndOpen(file, password);\n fetchFullTask.wait(\n (doc) => task.resolve(doc),\n (err) => task.reject(err.reason),\n );\n }\n }\n } catch (err) {\n this.logger.error(LOG_SOURCE, LOG_CATEGORY, 'openDocumentUrl error', err);\n task.reject({\n code: PdfErrorCode.Unknown,\n message: String(err),\n });\n }\n })();\n\n return task;\n }\n\n /**\n * Check if the server supports range requests:\n * Sends a HEAD request and sees if 'Accept-Ranges: bytes'.\n */\n private async checkRangeSupport(\n url: string,\n ): Promise<{ supportsRanges: boolean; fileLength: number; content: ArrayBuffer | null }> {\n try {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'checkRangeSupport', url);\n\n // First try HEAD request\n const headResponse = await fetch(url, { method: 'HEAD' });\n const fileLength = headResponse.headers.get('Content-Length');\n const acceptRanges = headResponse.headers.get('Accept-Ranges');\n\n // If server explicitly supports ranges, we're done\n if (acceptRanges === 'bytes') {\n return {\n supportsRanges: true,\n fileLength: parseInt(fileLength ?? '0'),\n content: null,\n };\n }\n\n // Test actual range request support\n const testResponse = await fetch(url, {\n headers: { Range: 'bytes=0-1' },\n });\n\n // If we get 200 instead of 206, server doesn't support ranges\n // Return the full content since we'll need it anyway\n if (testResponse.status === 200) {\n const content = await testResponse.arrayBuffer();\n return {\n supportsRanges: false,\n fileLength: parseInt(fileLength ?? '0'),\n content: content,\n };\n }\n\n // 206 Partial Content indicates range support\n return {\n supportsRanges: testResponse.status === 206,\n fileLength: parseInt(fileLength ?? '0'),\n content: null,\n };\n } catch (e) {\n this.logger.error(LOG_SOURCE, LOG_CATEGORY, 'checkRangeSupport failed', e);\n throw new Error('Failed to check range support: ' + e);\n }\n }\n\n /**\n * Fully fetch the file (using fetch) into an ArrayBuffer,\n * then call openDocumentFromBuffer.\n */\n private async fetchFullAndOpen(file: PdfFileUrl, password: string) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'fetchFullAndOpen', file.url);\n\n // 1. fetch entire PDF as array buffer\n const response = await fetch(file.url);\n if (!response.ok) {\n throw new Error(`Could not fetch PDF: ${response.statusText}`);\n }\n const arrayBuf = await response.arrayBuffer();\n\n // 2. create a PdfFile object\n const pdfFile: PdfFile = {\n id: file.id,\n content: arrayBuf,\n };\n\n // 3. call openDocumentFromBuffer (the method you already have)\n // that returns a PdfTask, but let's wrap it in a Promise\n return this.openDocumentFromBuffer(pdfFile, password);\n }\n\n /**\n * Use your synchronous partial-loading approach:\n * - In your snippet, it's done via `openDocumentFromLoader`.\n * - We'll do a synchronous XHR read callback that pulls\n * the desired byte ranges.\n */\n private async openDocumentWithRangeRequest(\n file: PdfFileUrl,\n password: string,\n knownFileLength?: number,\n ) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'openDocumentWithRangeRequest', file.url);\n\n // We first do a HEAD or a partial fetch to get the fileLength:\n const fileLength = knownFileLength ?? (await this.retrieveFileLength(file.url)).fileLength;\n\n // 2. define the callback function used by openDocumentFromLoader\n const callback = (offset: number, length: number) => {\n // Perform synchronous XHR:\n const xhr = new XMLHttpRequest();\n xhr.open('GET', file.url, false); // note: block in the Worker\n xhr.overrideMimeType('text/plain; charset=x-user-defined');\n xhr.setRequestHeader('Range', `bytes=${offset}-${offset + length - 1}`);\n xhr.send(null);\n\n if (xhr.status === 206 || xhr.status === 200) {\n return this.convertResponseToUint8Array(xhr.responseText);\n }\n throw new Error(`Range request failed with status ${xhr.status}`);\n };\n\n // 3. call `openDocumentFromLoader`\n return this.openDocumentFromLoader(\n {\n id: file.id,\n fileLength,\n callback,\n },\n password,\n );\n }\n\n /**\n * Helper to do a HEAD request or partial GET to find file length.\n */\n private async retrieveFileLength(url: string): Promise<{ fileLength: number }> {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'retrieveFileLength', url);\n\n // We'll do a HEAD request to get Content-Length\n const resp = await fetch(url, { method: 'HEAD' });\n if (!resp.ok) {\n throw new Error(`Failed HEAD request for file length: ${resp.statusText}`);\n }\n const lenStr = resp.headers.get('Content-Length') || '0';\n const fileLength = parseInt(lenStr, 10) || 0;\n if (!fileLength) {\n throw new Error(`Content-Length not found or zero.`);\n }\n return { fileLength };\n }\n\n /**\n * Convert response text (x-user-defined) to a Uint8Array\n * for partial data.\n */\n private convertResponseToUint8Array(text: string): Uint8Array {\n const array = new Uint8Array(text.length);\n for (let i = 0; i < text.length; i++) {\n // & 0xff ensures we only get the lower 8 bits\n array[i] = text.charCodeAt(i) & 0xff;\n }\n return array;\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.openDocument}\n *\n * @public\n */\n openDocumentFromBuffer(file: PdfFile, password: string = '') {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'openDocumentFromBuffer', file, password);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `OpenDocumentFromBuffer`, 'Begin', file.id);\n const array = new Uint8Array(file.content);\n const length = array.length;\n const filePtr = this.malloc(length);\n this.pdfiumModule.pdfium.HEAPU8.set(array, filePtr);\n\n const docPtr = this.pdfiumModule.FPDF_LoadMemDocument(filePtr, length, password);\n\n if (!docPtr) {\n const lastError = this.pdfiumModule.FPDF_GetLastError();\n this.logger.error(LOG_SOURCE, LOG_CATEGORY, `FPDF_LoadMemDocument failed with ${lastError}`);\n this.free(filePtr);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `OpenDocumentFromBuffer`, 'End', file.id);\n\n return PdfTaskHelper.reject<PdfDocumentObject>({\n code: lastError,\n message: `FPDF_LoadMemDocument failed`,\n });\n }\n\n const pageCount = this.pdfiumModule.FPDF_GetPageCount(docPtr);\n\n const pages: PdfPageObject[] = [];\n const sizePtr = this.malloc(8);\n for (let index = 0; index < pageCount; index++) {\n const result = this.pdfiumModule.FPDF_GetPageSizeByIndexF(docPtr, index, sizePtr);\n if (!result) {\n const lastError = this.pdfiumModule.FPDF_GetLastError();\n this.logger.error(\n LOG_SOURCE,\n LOG_CATEGORY,\n `FPDF_GetPageSizeByIndexF failed with ${lastError}`,\n );\n this.free(sizePtr);\n this.pdfiumModule.FPDF_CloseDocument(docPtr);\n this.free(filePtr);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `OpenDocumentFromBuffer`, 'End', file.id);\n return PdfTaskHelper.reject<PdfDocumentObject>({\n code: lastError,\n message: `FPDF_GetPageSizeByIndexF failed`,\n });\n }\n\n const page = {\n index,\n size: {\n width: this.pdfiumModule.pdfium.getValue(sizePtr, 'float'),\n height: this.pdfiumModule.pdfium.getValue(sizePtr + 4, 'float'),\n },\n };\n\n pages.push(page);\n }\n this.free(sizePtr);\n\n const pdfDoc = {\n id: file.id,\n pageCount,\n pages,\n };\n\n this.cache.setDocument(file.id, filePtr, docPtr);\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `OpenDocumentFromBuffer`, 'End', file.id);\n\n return PdfTaskHelper.resolve(pdfDoc);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.openDocumentFromLoader}\n *\n * @public\n */\n openDocumentFromLoader(fileLoader: PdfFileLoader, password: string = '') {\n const { fileLength, callback, ...file } = fileLoader;\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'openDocumentFromLoader', file, password);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `OpenDocumentFromLoader`, 'Begin', file.id);\n\n const readBlock = (\n _pThis: number, // Pointer to the FPDF_FILEACCESS structure\n offset: number, // Pointer to a buffer to receive the data\n pBuf: number, // Offset position from the beginning of the file\n length: number, // Number of bytes to read\n ): number => {\n try {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'readBlock', offset, length, pBuf);\n\n if (offset < 0 || offset >= fileLength) {\n this.logger.error(LOG_SOURCE, LOG_CATEGORY, 'Offset out of bounds:', offset);\n return 0;\n }\n\n // Get data chunk using the callback\n const data = callback(offset, length);\n\n // Copy the data to PDFium's buffer\n const dest = new Uint8Array(this.pdfiumModule.pdfium.HEAPU8.buffer, pBuf, data.length);\n dest.set(data);\n\n return data.length;\n } catch (error) {\n this.logger.error(LOG_SOURCE, LOG_CATEGORY, 'ReadBlock error:', error);\n return 0;\n }\n };\n\n const callbackPtr = this.pdfiumModule.pdfium.addFunction(readBlock, 'iiiii');\n\n // Create FPDF_FILEACCESS struct\n const structSize = 12;\n const fileAccessPtr = this.malloc(structSize);\n\n // Set up struct fields\n this.pdfiumModule.pdfium.setValue(fileAccessPtr, fileLength, 'i32');\n this.pdfiumModule.pdfium.setValue(fileAccessPtr + 4, callbackPtr, 'i32');\n this.pdfiumModule.pdfium.setValue(fileAccessPtr + 8, 0, 'i32');\n\n // Load document\n const docPtr = this.pdfiumModule.FPDF_LoadCustomDocument(fileAccessPtr, password);\n\n if (!docPtr) {\n const lastError = this.pdfiumModule.FPDF_GetLastError();\n this.logger.error(\n LOG_SOURCE,\n LOG_CATEGORY,\n `FPDF_LoadCustomDocument failed with ${lastError}`,\n );\n this.free(fileAccessPtr);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `OpenDocumentFromLoader`, 'End', file.id);\n\n return PdfTaskHelper.reject<PdfDocumentObject>({\n code: lastError,\n message: `FPDF_LoadCustomDocument failed`,\n });\n }\n\n const pageCount = this.pdfiumModule.FPDF_GetPageCount(docPtr);\n\n const pages: PdfPageObject[] = [];\n const sizePtr = this.malloc(8);\n for (let index = 0; index < pageCount; index++) {\n const result = this.pdfiumModule.FPDF_GetPageSizeByIndexF(docPtr, index, sizePtr);\n if (!result) {\n const lastError = this.pdfiumModule.FPDF_GetLastError();\n this.logger.error(\n LOG_SOURCE,\n LOG_CATEGORY,\n `FPDF_GetPageSizeByIndexF failed with ${lastError}`,\n );\n this.free(sizePtr);\n this.pdfiumModule.FPDF_CloseDocument(docPtr);\n this.free(fileAccessPtr);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `OpenDocumentFromLoader`, 'End', file.id);\n return PdfTaskHelper.reject<PdfDocumentObject>({\n code: lastError,\n message: `FPDF_GetPageSizeByIndexF failed`,\n });\n }\n\n const page = {\n index,\n size: {\n width: this.pdfiumModule.pdfium.getValue(sizePtr, 'float'),\n height: this.pdfiumModule.pdfium.getValue(sizePtr + 4, 'float'),\n },\n };\n\n pages.push(page);\n }\n this.free(sizePtr);\n\n const pdfDoc = {\n id: file.id,\n pageCount,\n pages,\n };\n this.cache.setDocument(file.id, fileAccessPtr, docPtr);\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `OpenDocumentFromLoader`, 'End', file.id);\n\n return PdfTaskHelper.resolve(pdfDoc);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.getMetadata}\n *\n * @public\n */\n getMetadata(doc: PdfDocumentObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'getMetadata', doc);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetMetadata`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetMetadata`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const metadata = {\n title: this.readMetaText(ctx.docPtr, 'Title'),\n author: this.readMetaText(ctx.docPtr, 'Author'),\n subject: this.readMetaText(ctx.docPtr, 'Subject'),\n keywords: this.readMetaText(ctx.docPtr, 'Keywords'),\n producer: this.readMetaText(ctx.docPtr, 'Producer'),\n creator: this.readMetaText(ctx.docPtr, 'Creator'),\n creationDate: this.readMetaText(ctx.docPtr, 'CreationDate'),\n modificationDate: this.readMetaText(ctx.docPtr, 'ModDate'),\n };\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetMetadata`, 'End', doc.id);\n\n return PdfTaskHelper.resolve(metadata);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.getDocPermissions}\n *\n * @public\n */\n getDocPermissions(doc: PdfDocumentObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'getDocPermissions', doc);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `getDocPermissions`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `getDocPermissions`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const permissions = this.pdfiumModule.FPDF_GetDocPermissions(ctx.docPtr);\n\n return PdfTaskHelper.resolve(permissions);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.getDocUserPermissions}\n *\n * @public\n */\n getDocUserPermissions(doc: PdfDocumentObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'getDocUserPermissions', doc);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `getDocUserPermissions`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `getDocUserPermissions`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const permissions = this.pdfiumModule.FPDF_GetDocUserPermissions(ctx.docPtr);\n\n return PdfTaskHelper.resolve(permissions);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.getSignatures}\n *\n * @public\n */\n getSignatures(doc: PdfDocumentObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'getSignatures', doc);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetSignatures`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetSignatures`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const signatures: PdfSignatureObject[] = [];\n\n const count = this.pdfiumModule.FPDF_GetSignatureCount(ctx.docPtr);\n for (let i = 0; i < count; i++) {\n const signatureObjPtr = this.pdfiumModule.FPDF_GetSignatureObject(ctx.docPtr, i);\n\n const contents = readArrayBuffer(this.pdfiumModule.pdfium, (buffer, bufferSize) => {\n return this.pdfiumModule.FPDFSignatureObj_GetContents(signatureObjPtr, buffer, bufferSize);\n });\n\n const byteRange = readArrayBuffer(this.pdfiumModule.pdfium, (buffer, bufferSize) => {\n return (\n this.pdfiumModule.FPDFSignatureObj_GetByteRange(signatureObjPtr, buffer, bufferSize) * 4\n );\n });\n\n const subFilter = readArrayBuffer(this.pdfiumModule.pdfium, (buffer, bufferSize) => {\n return this.pdfiumModule.FPDFSignatureObj_GetSubFilter(signatureObjPtr, buffer, bufferSize);\n });\n\n const reason = readString(\n this.pdfiumModule.pdfium,\n (buffer, bufferLength) => {\n return this.pdfiumModule.FPDFSignatureObj_GetReason(\n signatureObjPtr,\n buffer,\n bufferLength,\n );\n },\n this.pdfiumModule.pdfium.UTF16ToString,\n );\n\n const time = readString(\n this.pdfiumModule.pdfium,\n (buffer, bufferLength) => {\n return this.pdfiumModule.FPDFSignatureObj_GetTime(signatureObjPtr, buffer, bufferLength);\n },\n this.pdfiumModule.pdfium.UTF8ToString,\n );\n\n const docMDP = this.pdfiumModule.FPDFSignatureObj_GetDocMDPPermission(signatureObjPtr);\n\n signatures.push({\n contents,\n byteRange,\n subFilter,\n reason,\n time,\n docMDP,\n });\n }\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetSignatures`, 'End', doc.id);\n\n return PdfTaskHelper.resolve(signatures);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.getBookmarks}\n *\n * @public\n */\n getBookmarks(doc: PdfDocumentObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'getBookmarks', doc);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetBookmarks`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `getBookmarks`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const bookmarks = this.readPdfBookmarks(ctx.docPtr, 0);\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetBookmarks`, 'End', doc.id);\n\n return PdfTaskHelper.resolve({\n bookmarks,\n });\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.renderPage}\n *\n * @public\n */\n renderPage(\n doc: PdfDocumentObject,\n page: PdfPageObject,\n scaleFactor: number = 1,\n rotation: Rotation = Rotation.Degree0,\n dpr: number = 1,\n options: PdfRenderOptions = { withAnnotations: false },\n imageType: ImageConversionTypes = 'image/webp',\n ): PdfTask<T> {\n const task = new Task<T, PdfErrorReason>();\n\n this.logger.debug(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'renderPage',\n doc,\n page,\n scaleFactor,\n rotation,\n dpr,\n options,\n );\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `RenderPage`, 'Begin', `${doc.id}-${page.index}`);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `RenderPage`, 'End', `${doc.id}-${page.index}`);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const imageData = this.renderPageRectToImageData(\n ctx,\n page,\n {\n origin: { x: 0, y: 0 },\n size: page.size,\n },\n scaleFactor,\n rotation,\n dpr,\n options,\n );\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `RenderPage`, 'End', `${doc.id}-${page.index}`);\n\n this.imageDataConverter(imageData, imageType).then((blob) => task.resolve(blob));\n\n return task;\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.renderPageRect}\n *\n * @public\n */\n renderPageRect(\n doc: PdfDocumentObject,\n page: PdfPageObject,\n scaleFactor: number,\n rotation: Rotation,\n dpr: number,\n rect: Rect,\n options: PdfRenderOptions,\n imageType: ImageConversionTypes = 'image/webp',\n ): PdfTask<T> {\n const task = new Task<T, PdfErrorReason>();\n\n this.logger.debug(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'renderPageRect',\n doc,\n page,\n scaleFactor,\n rotation,\n dpr,\n rect,\n options,\n );\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `RenderPageRect`,\n 'Begin',\n `${doc.id}-${page.index}`,\n );\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `RenderPageRect`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const imageData = this.renderPageRectToImageData(\n ctx,\n page,\n rect,\n scaleFactor,\n rotation,\n dpr,\n options,\n );\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `RenderPageRect`, 'End', `${doc.id}-${page.index}`);\n\n this.imageDataConverter(imageData, imageType).then((blob) => task.resolve(blob));\n\n return task;\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.getAllAnnotations}\n *\n * @public\n */\n getAllAnnotations(doc: PdfDocumentObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'getAllAnnotations', doc);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetAllAnnotations`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetAllAnnotations`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const annotations = this.readAllAnnotations(doc, ctx);\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetAllAnnotations`, 'End', doc.id);\n\n return PdfTaskHelper.resolve(annotations);\n }\n\n private readAllAnnotations(\n doc: PdfDocumentObject,\n ctx: DocumentContext,\n ): Record<number, PdfAnnotationObject[]> {\n const annotationsByPage: Record<number, PdfAnnotationObject[]> = {};\n\n for (let i = 0; i < doc.pageCount; i++) {\n const pageAnnotations = this.readPageAnnotations(ctx, doc.pages[i]);\n annotationsByPage[i] = pageAnnotations;\n }\n\n return annotationsByPage;\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.getPageAnnotations}\n *\n * @public\n */\n getPageAnnotations(doc: PdfDocumentObject, page: PdfPageObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'getPageAnnotations', doc, page);\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `GetPageAnnotations`,\n 'Begin',\n `${doc.id}-${page.index}`,\n );\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `GetPageAnnotations`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const annotations = this.readPageAnnotations(ctx, page);\n\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `GetPageAnnotations`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n\n this.logger.debug(\n LOG_SOURCE,\n LOG_CATEGORY,\n `GetPageAnnotations`,\n `${doc.id}-${page.index}`,\n annotations,\n );\n\n return PdfTaskHelper.resolve(annotations);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.createPageAnnotation}\n *\n * @public\n */\n createPageAnnotation(\n doc: PdfDocumentObject,\n page: PdfPageObject,\n annotation: PdfAnnotationObject,\n ): PdfTask<number> {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'createPageAnnotation', doc, page, annotation);\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `CreatePageAnnotation`,\n 'Begin',\n `${doc.id}-${page.index}`,\n );\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `CreatePageAnnotation`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const pageCtx = ctx.acquirePage(page.index);\n const annotationPtr = this.pdfiumModule.FPDFPage_CreateAnnot(pageCtx.pagePtr, annotation.type);\n if (!annotationPtr) {\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `CreatePageAnnotation`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n pageCtx.release();\n\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantCreateAnnot,\n message: 'can not create annotation with specified type',\n });\n }\n\n if (!this.setPageAnnoRect(page, pageCtx.pagePtr, annotationPtr, annotation.rect)) {\n this.pdfiumModule.FPDFPage_CloseAnnot(annotationPtr);\n pageCtx.release();\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `CreatePageAnnotation`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantSetAnnotRect,\n message: 'can not set the rect of the annotation',\n });\n }\n\n let isSucceed = false;\n switch (annotation.type) {\n case PdfAnnotationSubtype.INK:\n isSucceed = this.addInkStroke(page, pageCtx.pagePtr, annotationPtr, annotation);\n break;\n case PdfAnnotationSubtype.STAMP:\n isSucceed = this.addStampContent(\n ctx.docPtr,\n page,\n pageCtx.pagePtr,\n annotationPtr,\n annotation.rect,\n annotation.contents,\n );\n break;\n case PdfAnnotationSubtype.UNDERLINE:\n case PdfAnnotationSubtype.STRIKEOUT:\n case PdfAnnotationSubtype.SQUIGGLY:\n case PdfAnnotationSubtype.HIGHLIGHT:\n isSucceed = this.addTextMarkupContent(page, pageCtx.pagePtr, annotationPtr, annotation);\n break;\n }\n\n if (!isSucceed) {\n this.pdfiumModule.FPDFPage_RemoveAnnot(pageCtx.pagePtr, annotationPtr);\n pageCtx.release();\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `CreatePageAnnotation`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantSetAnnotContent,\n message: 'can not add content of the annotation',\n });\n }\n\n this.pdfiumModule.EPDFAnnot_GenerateAppearance(annotationPtr);\n this.pdfiumModule.FPDFPage_GenerateContent(pageCtx.pagePtr);\n\n const annotId = this.pdfiumModule.FPDFPage_GetAnnotIndex(pageCtx.pagePtr, annotationPtr);\n\n this.pdfiumModule.FPDFPage_CloseAnnot(annotationPtr);\n pageCtx.release();\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `CreatePageAnnotation`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n\n return annotId >= 0\n ? PdfTaskHelper.resolve<number>(annotId)\n : PdfTaskHelper.reject<number>({\n code: PdfErrorCode.CantCreateAnnot,\n message: 'annotation created but index could not be determined',\n });\n }\n\n /**\n * Update an existing page annotation in-place\n *\n * • Locates the annot by page-local index (`annotation.id`)\n * • Re-writes its /Rect and type-specific payload\n * • Calls FPDFPage_GenerateContent so the new appearance is rendered\n *\n * @returns PdfTask<boolean> – true on success\n */\n updatePageAnnotation(\n doc: PdfDocumentObject,\n page: PdfPageObject,\n annotation: PdfAnnotationObject,\n ): PdfTask<boolean> {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'updatePageAnnotation', doc, page, annotation);\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'UpdatePageAnnotation',\n 'Begin',\n `${doc.id}-${page.index}`,\n );\n\n const ctx = this.cache.getContext(doc.id);\n if (!ctx) {\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'UpdatePageAnnotation',\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const pageCtx = ctx.acquirePage(page.index);\n const annotPtr = this.pdfiumModule.FPDFPage_GetAnnot(pageCtx.pagePtr, annotation.id);\n if (!annotPtr) {\n pageCtx.release();\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'UpdatePageAnnotation',\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.reject({ code: PdfErrorCode.NotFound, message: 'annotation not found' });\n }\n\n /* 1 ── (re)set bounding-box ────────────────────────────────────────────── */\n if (!this.setPageAnnoRect(page, pageCtx.pagePtr, annotPtr, annotation.rect)) {\n this.pdfiumModule.FPDFPage_CloseAnnot(annotPtr);\n pageCtx.release();\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'UpdatePageAnnotation',\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantSetAnnotRect,\n message: 'failed to move annotation',\n });\n }\n\n /* 2 ── wipe previous payload and rebuild fresh one ─────────────────────── */\n let ok = false;\n switch (annotation.type) {\n /* ── Ink ─────────────────────────────────────────────────────────────── */\n case PdfAnnotationSubtype.INK: {\n /* clear every existing stroke first */\n if (!this.pdfiumModule.FPDFAnnot_RemoveInkList(annotPtr)) break;\n ok = this.addInkStroke(page, pageCtx.pagePtr, annotPtr, annotation);\n break;\n }\n\n /* ── Stamp ───────────────────────────────────────────────────────────── */\n case PdfAnnotationSubtype.STAMP: {\n /* drop every page-object inside the annot */\n for (let i = this.pdfiumModule.FPDFAnnot_GetObjectCount(annotPtr) - 1; i >= 0; i--) {\n this.pdfiumModule.FPDFAnnot_RemoveObject(annotPtr, i);\n }\n ok = this.addStampContent(\n ctx.docPtr,\n page,\n pageCtx.pagePtr,\n annotPtr,\n annotation.rect,\n annotation.contents,\n );\n break;\n }\n\n /* ── Text-markup family ──────────────────────────────────────────────── */\n case PdfAnnotationSubtype.HIGHLIGHT:\n case PdfAnnotationSubtype.UNDERLINE:\n case PdfAnnotationSubtype.STRIKEOUT:\n case PdfAnnotationSubtype.SQUIGGLY: {\n /* replace quad-points / colour / strings in one go */\n ok = this.addTextMarkupContent(page, pageCtx.pagePtr, annotPtr, annotation);\n break;\n }\n\n /* ── Unsupported edits – fall through to error ───────────────────────── */\n default:\n ok = false;\n }\n\n /* 3 ── regenerate appearance if payload was changed ───────────────────── */\n if (ok) {\n this.pdfiumModule.EPDFAnnot_GenerateAppearance(annotPtr);\n this.pdfiumModule.FPDFPage_GenerateContent(pageCtx.pagePtr);\n }\n\n /* 4 ── tidy-up native handles ──────────────────────────────────────────── */\n this.pdfiumModule.FPDFPage_CloseAnnot(annotPtr);\n pageCtx.release();\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'UpdatePageAnnotation',\n 'End',\n `${doc.id}-${page.index}`,\n );\n\n return ok\n ? PdfTaskHelper.resolve<boolean>(true)\n : PdfTaskHelper.reject<boolean>({\n code: PdfErrorCode.CantSetAnnotContent,\n message: 'failed to update annotation',\n });\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.removePageAnnotation}\n *\n * @public\n */\n removePageAnnotation(\n doc: PdfDocumentObject,\n page: PdfPageObject,\n annotation: PdfAnnotationObject,\n ) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'removePageAnnotation', doc, page, annotation);\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `RemovePageAnnotation`,\n 'Begin',\n `${doc.id}-${page.index}`,\n );\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `RemovePageAnnotation`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const pageCtx = ctx.acquirePage(page.index);\n let result = false;\n result = this.pdfiumModule.FPDFPage_RemoveAnnot(pageCtx.pagePtr, annotation.id);\n if (!result) {\n this.logger.error(\n LOG_SOURCE,\n LOG_CATEGORY,\n `FPDFPage_RemoveAnnot Failed`,\n `${doc.id}-${page.index}`,\n );\n } else {\n result = this.pdfiumModule.FPDFPage_GenerateContent(pageCtx.pagePtr);\n if (!result) {\n this.logger.error(\n LOG_SOURCE,\n LOG_CATEGORY,\n `FPDFPage_GenerateContent Failed`,\n `${doc.id}-${page.index}`,\n );\n }\n }\n\n pageCtx.release();\n\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `RemovePageAnnotation`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.resolve(result);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.getPageTextRects}\n *\n * @public\n */\n getPageTextRects(\n doc: PdfDocumentObject,\n page: PdfPageObject,\n scaleFactor: number,\n rotation: Rotation,\n ) {\n this.logger.debug(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'getPageTextRects',\n doc,\n page,\n scaleFactor,\n rotation,\n );\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `GetPageTextRects`,\n 'Begin',\n `${doc.id}-${page.index}`,\n );\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `GetPageTextRects`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const pageCtx = ctx.acquirePage(page.index);\n const textPagePtr = this.pdfiumModule.FPDFText_LoadPage(pageCtx.pagePtr);\n\n const textRects = this.readPageTextRects(page, pageCtx.docPtr, pageCtx.pagePtr, textPagePtr);\n\n this.pdfiumModule.FPDFText_ClosePage(textPagePtr);\n pageCtx.release();\n\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `GetPageTextRects`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.resolve(textRects);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.renderThumbnail}\n *\n * @public\n */\n renderThumbnail(\n doc: PdfDocumentObject,\n page: PdfPageObject,\n scaleFactor: number,\n rotation: Rotation,\n dpr: number,\n ): PdfTask<T> {\n this.logger.debug(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'renderThumbnail',\n doc,\n page,\n scaleFactor,\n rotation,\n dpr,\n );\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `RenderThumbnail`,\n 'Begin',\n `${doc.id}-${page.index}`,\n );\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `RenderThumbnail`,\n 'End',\n `${doc.id}-${page.index}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n scaleFactor = Math.max(scaleFactor, 0.5);\n const result = this.renderPage(doc, page, scaleFactor, rotation, dpr, {\n withAnnotations: true,\n });\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `RenderThumbnail`, 'End', `${doc.id}-${page.index}`);\n\n return result;\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.getAttachments}\n *\n * @public\n */\n getAttachments(doc: PdfDocumentObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'getAttachments', doc);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetAttachments`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetAttachments`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const attachments: PdfAttachmentObject[] = [];\n\n const count = this.pdfiumModule.FPDFDoc_GetAttachmentCount(ctx.docPtr);\n for (let i = 0; i < count; i++) {\n const attachment = this.readPdfAttachment(ctx.docPtr, i);\n attachments.push(attachment);\n }\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `GetAttachments`, 'End', doc.id);\n return PdfTaskHelper.resolve(attachments);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.readAttachmentContent}\n *\n * @public\n */\n readAttachmentContent(doc: PdfDocumentObject, attachment: PdfAttachmentObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'readAttachmentContent', doc, attachment);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ReadAttachmentContent`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ReadAttachmentContent`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const attachmentPtr = this.pdfiumModule.FPDFDoc_GetAttachment(ctx.docPtr, attachment.index);\n const sizePtr = this.malloc(8);\n if (!this.pdfiumModule.FPDFAttachment_GetFile(attachmentPtr, 0, 0, sizePtr)) {\n this.free(sizePtr);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ReadAttachmentContent`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantReadAttachmentSize,\n message: 'can not read attachment size',\n });\n }\n const size = this.pdfiumModule.pdfium.getValue(sizePtr, 'i64');\n\n const contentPtr = this.malloc(size);\n if (!this.pdfiumModule.FPDFAttachment_GetFile(attachmentPtr, contentPtr, size, sizePtr)) {\n this.free(sizePtr);\n this.free(contentPtr);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ReadAttachmentContent`, 'End', doc.id);\n\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantReadAttachmentContent,\n message: 'can not read attachment content',\n });\n }\n\n const buffer = new ArrayBuffer(size);\n const view = new DataView(buffer);\n for (let i = 0; i < size; i++) {\n view.setInt8(i, this.pdfiumModule.pdfium.getValue(contentPtr + i, 'i8'));\n }\n\n this.free(sizePtr);\n this.free(contentPtr);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ReadAttachmentContent`, 'End', doc.id);\n\n return PdfTaskHelper.resolve(buffer);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.setFormFieldValue}\n *\n * @public\n */\n setFormFieldValue(\n doc: PdfDocumentObject,\n page: PdfPageObject,\n annotation: PdfWidgetAnnoObject,\n value: FormFieldValue,\n ) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'SetFormFieldValue', doc, annotation, value);\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `SetFormFieldValue`,\n 'Begin',\n `${doc.id}-${annotation.id}`,\n );\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'SetFormFieldValue', 'document is not opened');\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `SetFormFieldValue`,\n 'End',\n `${doc.id}-${annotation.id}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const formFillInfoPtr = this.pdfiumModule.PDFiumExt_OpenFormFillInfo();\n const formHandle = this.pdfiumModule.PDFiumExt_InitFormFillEnvironment(\n ctx.docPtr,\n formFillInfoPtr,\n );\n\n const pageCtx = ctx.acquirePage(page.index);\n\n this.pdfiumModule.FORM_OnAfterLoadPage(pageCtx.pagePtr, formHandle);\n\n const annotationPtr = this.pdfiumModule.FPDFPage_GetAnnot(pageCtx.pagePtr, annotation.id);\n\n if (!this.pdfiumModule.FORM_SetFocusedAnnot(formHandle, annotationPtr)) {\n this.logger.debug(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'SetFormFieldValue',\n 'failed to set focused annotation',\n );\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `SetFormFieldValue`,\n 'End',\n `${doc.id}-${annotation.id}`,\n );\n this.pdfiumModule.FPDFPage_CloseAnnot(annotationPtr);\n this.pdfiumModule.FORM_OnBeforeClosePage(pageCtx.pagePtr, formHandle);\n pageCtx.release();\n this.pdfiumModule.PDFiumExt_ExitFormFillEnvironment(formHandle);\n this.pdfiumModule.PDFiumExt_CloseFormFillInfo(formFillInfoPtr);\n\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantFocusAnnot,\n message: 'failed to set focused annotation',\n });\n }\n\n switch (value.kind) {\n case 'text':\n {\n if (!this.pdfiumModule.FORM_SelectAllText(formHandle, pageCtx.pagePtr)) {\n this.logger.debug(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'SetFormFieldValue',\n 'failed to select all text',\n );\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `SetFormFieldValue`,\n 'End',\n `${doc.id}-${annotation.id}`,\n );\n this.pdfiumModule.FORM_ForceToKillFocus(formHandle);\n this.pdfiumModule.FPDFPage_CloseAnnot(annotationPtr);\n this.pdfiumModule.FORM_OnBeforeClosePage(pageCtx.pagePtr, formHandle);\n pageCtx.release();\n this.pdfiumModule.PDFiumExt_ExitFormFillEnvironment(formHandle);\n this.pdfiumModule.PDFiumExt_CloseFormFillInfo(formFillInfoPtr);\n\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantSelectText,\n message: 'failed to select all text',\n });\n }\n const length = 2 * (value.text.length + 1);\n const textPtr = this.malloc(length);\n this.pdfiumModule.pdfium.stringToUTF16(value.text, textPtr, length);\n this.pdfiumModule.FORM_ReplaceSelection(formHandle, pageCtx.pagePtr, textPtr);\n this.free(textPtr);\n }\n break;\n case 'selection':\n {\n if (\n !this.pdfiumModule.FORM_SetIndexSelected(\n formHandle,\n pageCtx.pagePtr,\n value.index,\n value.isSelected,\n )\n ) {\n this.logger.debug(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'SetFormFieldValue',\n 'failed to set index selected',\n );\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `SetFormFieldValue`,\n 'End',\n `${doc.id}-${annotation.id}`,\n );\n this.pdfiumModule.FORM_ForceToKillFocus(formHandle);\n this.pdfiumModule.FPDFPage_CloseAnnot(annotationPtr);\n this.pdfiumModule.FORM_OnBeforeClosePage(pageCtx.pagePtr, formHandle);\n pageCtx.release();\n this.pdfiumModule.PDFiumExt_ExitFormFillEnvironment(formHandle);\n this.pdfiumModule.PDFiumExt_CloseFormFillInfo(formFillInfoPtr);\n\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantSelectOption,\n message: 'failed to set index selected',\n });\n }\n }\n break;\n case 'checked':\n {\n const kReturn = 0x0d;\n if (!this.pdfiumModule.FORM_OnChar(formHandle, pageCtx.pagePtr, kReturn, 0)) {\n this.logger.debug(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'SetFormFieldValue',\n 'failed to set field checked',\n );\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `SetFormFieldValue`,\n 'End',\n `${doc.id}-${annotation.id}`,\n );\n this.pdfiumModule.FORM_ForceToKillFocus(formHandle);\n this.pdfiumModule.FPDFPage_CloseAnnot(annotationPtr);\n this.pdfiumModule.FORM_OnBeforeClosePage(pageCtx.pagePtr, formHandle);\n pageCtx.release();\n this.pdfiumModule.PDFiumExt_ExitFormFillEnvironment(formHandle);\n this.pdfiumModule.PDFiumExt_CloseFormFillInfo(formFillInfoPtr);\n\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantCheckField,\n message: 'failed to set field checked',\n });\n }\n }\n break;\n }\n\n this.pdfiumModule.FORM_ForceToKillFocus(formHandle);\n\n this.pdfiumModule.FPDFPage_CloseAnnot(annotationPtr);\n this.pdfiumModule.FORM_OnBeforeClosePage(pageCtx.pagePtr, formHandle);\n pageCtx.release();\n\n this.pdfiumModule.PDFiumExt_ExitFormFillEnvironment(formHandle);\n this.pdfiumModule.PDFiumExt_CloseFormFillInfo(formFillInfoPtr);\n\n return PdfTaskHelper.resolve<boolean>(true);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.flattenPage}\n *\n * @public\n */\n flattenPage(\n doc: PdfDocumentObject,\n page: PdfPageObject,\n flag: PdfPageFlattenFlag,\n ): PdfTask<PdfPageFlattenResult> {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'flattenPage', doc, page, flag);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `flattenPage`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `flattenPage`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const pageCtx = ctx.acquirePage(page.index);\n const result = this.pdfiumModule.FPDFPage_Flatten(pageCtx.pagePtr, flag);\n pageCtx.release();\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `flattenPage`, 'End', doc.id);\n\n return PdfTaskHelper.resolve(result);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.extractPages}\n *\n * @public\n */\n extractPages(doc: PdfDocumentObject, pageIndexes: number[]) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'extractPages', doc, pageIndexes);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ExtractPages`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ExtractPages`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const newDocPtr = this.pdfiumModule.FPDF_CreateNewDocument();\n if (!newDocPtr) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ExtractPages`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantCreateNewDoc,\n message: 'can not create new document',\n });\n }\n\n const pageIndexesPtr = this.malloc(pageIndexes.length * 4);\n for (let i = 0; i < pageIndexes.length; i++) {\n this.pdfiumModule.pdfium.setValue(pageIndexesPtr + i * 4, pageIndexes[i], 'i32');\n }\n\n if (\n !this.pdfiumModule.FPDF_ImportPagesByIndex(\n newDocPtr,\n ctx.docPtr,\n pageIndexesPtr,\n pageIndexes.length,\n 0,\n )\n ) {\n this.pdfiumModule.FPDF_CloseDocument(newDocPtr);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ExtractPages`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantImportPages,\n message: 'can not import pages to new document',\n });\n }\n\n const buffer = this.saveDocument(newDocPtr);\n\n this.pdfiumModule.FPDF_CloseDocument(newDocPtr);\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ExtractPages`, 'End', doc.id);\n return PdfTaskHelper.resolve(buffer);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.extractText}\n *\n * @public\n */\n extractText(doc: PdfDocumentObject, pageIndexes: number[]) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'extractText', doc, pageIndexes);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ExtractText`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ExtractText`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const strings: string[] = [];\n for (let i = 0; i < pageIndexes.length; i++) {\n const pageCtx = ctx.acquirePage(pageIndexes[i]);\n const textPagePtr = this.pdfiumModule.FPDFText_LoadPage(pageCtx.pagePtr);\n const charCount = this.pdfiumModule.FPDFText_CountChars(textPagePtr);\n const bufferPtr = this.malloc((charCount + 1) * 2);\n this.pdfiumModule.FPDFText_GetText(textPagePtr, 0, charCount, bufferPtr);\n const text = this.pdfiumModule.pdfium.UTF16ToString(bufferPtr);\n this.free(bufferPtr);\n strings.push(text);\n this.pdfiumModule.FPDFText_ClosePage(textPagePtr);\n pageCtx.release();\n }\n\n const text = strings.join('\\n\\n');\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `ExtractText`, 'End', doc.id);\n return PdfTaskHelper.resolve(text);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.getTextSlices}\n *\n * @public\n */\n getTextSlices(doc: PdfDocumentObject, slices: PageTextSlice[]): PdfTask<string[]> {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'getTextSlices', doc, slices);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, 'GetTextSlices', 'Begin', doc.id);\n\n /* ⚠︎ 1 — trivial case */\n if (slices.length === 0) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, 'GetTextSlices', 'End', doc.id);\n return PdfTaskHelper.resolve<string[]>([]);\n }\n\n /* ⚠︎ 2 — document must be open */\n const ctx = this.cache.getContext(doc.id);\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, 'GetTextSlices', 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n try {\n /* keep caller order */\n const out = new Array<string>(slices.length);\n\n /* group → open each page once */\n const byPage = new Map<number, { slice: PageTextSlice; pos: number }[]>();\n slices.forEach((s, i) => {\n (byPage.get(s.pageIndex) ?? byPage.set(s.pageIndex, []).get(s.pageIndex))!.push({\n slice: s,\n pos: i,\n });\n });\n\n for (const [pageIdx, list] of byPage) {\n const pageCtx = ctx.acquirePage(pageIdx);\n const textPagePtr = pageCtx.getTextPage();\n\n for (const { slice, pos } of list) {\n const bufPtr = this.malloc(2 * (slice.charCount + 1)); // UTF-16 + NIL\n this.pdfiumModule.FPDFText_GetText(textPagePtr, slice.charIndex, slice.charCount, bufPtr);\n out[pos] = stripPdfUnwantedMarkers(this.pdfiumModule.pdfium.UTF16ToString(bufPtr));\n this.free(bufPtr);\n }\n pageCtx.release();\n }\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, 'GetTextSlices', 'End', doc.id);\n return PdfTaskHelper.resolve(out);\n } catch (e) {\n this.logger.error(LOG_SOURCE, LOG_CATEGORY, 'getTextSlices error', e);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, 'GetTextSlices', 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.Unknown,\n message: String(e),\n });\n }\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.merge}\n *\n * @public\n */\n merge(files: PdfFile[]) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'merge', files);\n const fileIds = files.map((file) => file.id).join('.');\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `Merge`, 'Begin', fileIds);\n\n const newDocPtr = this.pdfiumModule.FPDF_CreateNewDocument();\n if (!newDocPtr) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `Merge`, 'End', fileIds);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantCreateNewDoc,\n message: 'can not create new document',\n });\n }\n\n const ptrs: { docPtr: number; filePtr: number }[] = [];\n for (const file of files.reverse()) {\n const array = new Uint8Array(file.content);\n const length = array.length;\n const filePtr = this.malloc(length);\n this.pdfiumModule.pdfium.HEAPU8.set(array, filePtr);\n\n const docPtr = this.pdfiumModule.FPDF_LoadMemDocument(filePtr, length, '');\n if (!docPtr) {\n const lastError = this.pdfiumModule.FPDF_GetLastError();\n this.logger.error(\n LOG_SOURCE,\n LOG_CATEGORY,\n `FPDF_LoadMemDocument failed with ${lastError}`,\n );\n this.free(filePtr);\n\n for (const ptr of ptrs) {\n this.pdfiumModule.FPDF_CloseDocument(ptr.docPtr);\n this.free(ptr.filePtr);\n }\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `Merge`, 'End', fileIds);\n return PdfTaskHelper.reject<PdfFile>({\n code: lastError,\n message: `FPDF_LoadMemDocument failed`,\n });\n }\n ptrs.push({ filePtr, docPtr });\n\n if (!this.pdfiumModule.FPDF_ImportPages(newDocPtr, docPtr, '', 0)) {\n this.pdfiumModule.FPDF_CloseDocument(newDocPtr);\n\n for (const ptr of ptrs) {\n this.pdfiumModule.FPDF_CloseDocument(ptr.docPtr);\n this.free(ptr.filePtr);\n }\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `Merge`, 'End', fileIds);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantImportPages,\n message: 'can not import pages to new document',\n });\n }\n }\n const buffer = this.saveDocument(newDocPtr);\n\n this.pdfiumModule.FPDF_CloseDocument(newDocPtr);\n\n for (const ptr of ptrs) {\n this.pdfiumModule.FPDF_CloseDocument(ptr.docPtr);\n this.free(ptr.filePtr);\n }\n\n const file: PdfFile = {\n id: `${Math.random()}`,\n content: buffer,\n };\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `Merge`, 'End', fileIds);\n return PdfTaskHelper.resolve(file);\n }\n\n /**\n * Merges specific pages from multiple PDF documents in a custom order\n *\n * @param mergeConfigs Array of configurations specifying which pages to merge from which documents\n * @returns A PdfTask that resolves with the merged PDF file\n * @public\n */\n mergePages(mergeConfigs: Array<{ docId: string; pageIndices: number[] }>) {\n const configIds = mergeConfigs\n .map((config) => `${config.docId}:${config.pageIndices.join(',')}`)\n .join('|');\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'mergePages', mergeConfigs);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `MergePages`, 'Begin', configIds);\n\n // Create a new document to import pages into\n const newDocPtr = this.pdfiumModule.FPDF_CreateNewDocument();\n if (!newDocPtr) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `MergePages`, 'End', configIds);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantCreateNewDoc,\n message: 'Cannot create new document',\n });\n }\n\n try {\n // Process each merge configuration in reverse order (since we're inserting at position 0)\n // This ensures the final document has pages in the order specified by the user\n for (const config of [...mergeConfigs].reverse()) {\n // Check if the document is open\n const ctx = this.cache.getContext(config.docId);\n\n if (!ctx) {\n this.logger.warn(\n LOG_SOURCE,\n LOG_CATEGORY,\n `Document ${config.docId} is not open, skipping`,\n );\n continue;\n }\n\n // Get the page count for this document\n const pageCount = this.pdfiumModule.FPDF_GetPageCount(ctx.docPtr);\n\n // Filter out invalid page indices\n const validPageIndices = config.pageIndices.filter(\n (index) => index >= 0 && index < pageCount,\n );\n\n if (validPageIndices.length === 0) {\n continue; // No valid pages to import\n }\n\n // Convert 0-based indices to 1-based for PDFium and join with commas\n const pageString = validPageIndices.map((index) => index + 1).join(',');\n\n try {\n // Import all specified pages at once from this document\n if (\n !this.pdfiumModule.FPDF_ImportPages(\n newDocPtr,\n ctx.docPtr,\n pageString,\n 0, // Insert at the beginning\n )\n ) {\n throw new Error(`Failed to import pages ${pageString} from document ${config.docId}`);\n }\n } finally {\n }\n }\n\n // Save the new document to buffer\n const buffer = this.saveDocument(newDocPtr);\n\n const file: PdfFile = {\n id: `${Math.random()}`,\n content: buffer,\n };\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `MergePages`, 'End', configIds);\n return PdfTaskHelper.resolve(file);\n } catch (error) {\n this.logger.error(LOG_SOURCE, LOG_CATEGORY, 'mergePages failed', error);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `MergePages`, 'End', configIds);\n\n return PdfTaskHelper.reject({\n code: PdfErrorCode.CantImportPages,\n message: error instanceof Error ? error.message : 'Failed to merge pages',\n });\n } finally {\n // Clean up the new document\n if (newDocPtr) {\n this.pdfiumModule.FPDF_CloseDocument(newDocPtr);\n }\n }\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.saveAsCopy}\n *\n * @public\n */\n saveAsCopy(doc: PdfDocumentObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'saveAsCopy', doc);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `SaveAsCopy`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `SaveAsCopy`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n const buffer = this.saveDocument(ctx.docPtr);\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `SaveAsCopy`, 'End', doc.id);\n return PdfTaskHelper.resolve(buffer);\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.closeDocument}\n *\n * @public\n */\n closeDocument(doc: PdfDocumentObject) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'closeDocument', doc);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `CloseDocument`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `CloseDocument`, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n ctx.dispose();\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `CloseDocument`, 'End', doc.id);\n return PdfTaskHelper.resolve(true);\n }\n\n /**\n * Memory allocation\n * @param size - size of memory space\n * @returns pointer to memory space\n *\n * @public\n */\n malloc(size: number) {\n const ptr = this.pdfiumModule.pdfium.wasmExports.malloc(size);\n for (let i = 0; i < size; i++) {\n this.pdfiumModule.pdfium.HEAP8[ptr + i] = 0;\n }\n\n return ptr;\n }\n\n /**\n * Free memory space\n * @param ptr pointer to memory space\n *\n * @public\n */\n free(ptr: number) {\n this.pdfiumModule.pdfium.wasmExports.free(ptr);\n }\n\n /**\n * Set the rect of specified annotation\n * @param page - page info that the annotation is belonged to\n * @param pagePtr - pointer of page object\n * @param annotationPtr - pointer to annotation object\n * @param inkList - ink lists that added to the annotation\n * @returns whether the ink lists is setted\n *\n * @private\n */\n addInkStroke(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n annotation: PdfInkAnnoObject,\n ) {\n if (\n !this.setBorderStyle(annotationPtr, PdfAnnotationBorderStyle.SOLID, annotation.strokeWidth)\n ) {\n return false;\n }\n if (!this.setPageAnnoRect(page, pagePtr, annotationPtr, annotation.rect)) {\n return false;\n }\n if (!this.setInkList(page, annotationPtr, annotation.inkList)) {\n return false;\n }\n if (!this.setAnnotString(annotationPtr, 'T', annotation.author || '')) {\n return false;\n }\n if (!this.setAnnotString(annotationPtr, 'M', dateToPdfDate(annotation.modified))) {\n return false;\n }\n if (\n !this.setAnnotationColor(\n annotationPtr,\n {\n color: annotation.color ?? '#FFFF00',\n opacity: annotation.opacity ?? 1,\n },\n PdfAnnotationColorType.Color,\n )\n ) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Add highlight content to annotation\n * @param page - page info\n * @param annotationPtr - pointer to highlight annotation\n * @param annotation - highlight annotation\n * @returns whether highlight content is added to annotation\n *\n * @private\n */\n addTextMarkupContent(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n annotation:\n | PdfHighlightAnnoObject\n | PdfUnderlineAnnoObject\n | PdfStrikeOutAnnoObject\n | PdfSquigglyAnnoObject,\n ) {\n if (!this.setPageAnnoRect(page, pagePtr, annotationPtr, annotation.rect)) {\n return false;\n }\n if (!this.syncQuadPointsAnno(page, annotationPtr, annotation.segmentRects)) {\n return false;\n }\n if (!this.setAnnotString(annotationPtr, 'Contents', annotation.contents ?? '')) {\n return false;\n }\n if (!this.setAnnotString(annotationPtr, 'T', annotation.author || '')) {\n return false;\n }\n if (!this.setAnnotString(annotationPtr, 'M', dateToPdfDate(annotation.modified))) {\n return false;\n }\n if (\n !this.setAnnotationColor(\n annotationPtr,\n {\n color: annotation.color ?? '#FFFF00',\n opacity: annotation.opacity ?? 1,\n },\n PdfAnnotationColorType.Color,\n )\n ) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Add contents to stamp annotation\n * @param docPtr - pointer to pdf document object\n * @param page - page info\n * @param pagePtr - pointer to page object\n * @param annotationPtr - pointer to stamp annotation\n * @param rect - rect of stamp annotation\n * @param contents - contents of stamp annotation\n * @returns whether contents is added to annotation\n *\n * @private\n */\n addStampContent(\n docPtr: number,\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n rect: Rect,\n contents: PdfStampAnnoObjectContents,\n ) {\n for (const content of contents) {\n switch (content.type) {\n case PdfPageObjectType.IMAGE:\n return this.addImageObject(\n docPtr,\n page,\n pagePtr,\n annotationPtr,\n rect.origin,\n content.imageData,\n );\n }\n }\n\n return false;\n }\n\n /**\n * Add image object to annotation\n * @param docPtr - pointer to pdf document object\n * @param page - page info\n * @param pagePtr - pointer to page object\n * @param annotationPtr - pointer to stamp annotation\n * @param position - position of image\n * @param imageData - data of image\n * @returns whether image is added to annotation\n *\n * @private\n */\n addImageObject(\n docPtr: number,\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n position: Position,\n imageData: ImageData,\n ) {\n const bytesPerPixel = 4;\n const pixelCount = imageData.width * imageData.height;\n\n const bitmapBufferPtr = this.malloc(bytesPerPixel * pixelCount);\n if (!bitmapBufferPtr) {\n return false;\n }\n\n for (let i = 0; i < pixelCount; i++) {\n const red = imageData.data[i * bytesPerPixel];\n const green = imageData.data[i * bytesPerPixel + 1];\n const blue = imageData.data[i * bytesPerPixel + 2];\n const alpha = imageData.data[i * bytesPerPixel + 3];\n\n this.pdfiumModule.pdfium.setValue(bitmapBufferPtr + i * bytesPerPixel, blue, 'i8');\n this.pdfiumModule.pdfium.setValue(bitmapBufferPtr + i * bytesPerPixel + 1, green, 'i8');\n this.pdfiumModule.pdfium.setValue(bitmapBufferPtr + i * bytesPerPixel + 2, red, 'i8');\n this.pdfiumModule.pdfium.setValue(bitmapBufferPtr + i * bytesPerPixel + 3, alpha, 'i8');\n }\n\n const format = BitmapFormat.Bitmap_BGRA;\n const bitmapPtr = this.pdfiumModule.FPDFBitmap_CreateEx(\n imageData.width,\n imageData.height,\n format,\n bitmapBufferPtr,\n 0,\n );\n if (!bitmapPtr) {\n this.free(bitmapBufferPtr);\n return false;\n }\n\n const imageObjectPtr = this.pdfiumModule.FPDFPageObj_NewImageObj(docPtr);\n if (!imageObjectPtr) {\n this.pdfiumModule.FPDFBitmap_Destroy(bitmapPtr);\n this.free(bitmapBufferPtr);\n return false;\n }\n\n if (!this.pdfiumModule.FPDFImageObj_SetBitmap(pagePtr, 0, imageObjectPtr, bitmapPtr)) {\n this.pdfiumModule.FPDFBitmap_Destroy(bitmapPtr);\n this.pdfiumModule.FPDFPageObj_Destroy(imageObjectPtr);\n this.free(bitmapBufferPtr);\n return false;\n }\n\n const matrixPtr = this.malloc(6 * 4);\n this.pdfiumModule.pdfium.setValue(matrixPtr, imageData.width, 'float');\n this.pdfiumModule.pdfium.setValue(matrixPtr + 4, 0, 'float');\n this.pdfiumModule.pdfium.setValue(matrixPtr + 8, 0, 'float');\n this.pdfiumModule.pdfium.setValue(matrixPtr + 12, imageData.height, 'float');\n this.pdfiumModule.pdfium.setValue(matrixPtr + 16, 0, 'float');\n this.pdfiumModule.pdfium.setValue(matrixPtr + 20, 0, 'float');\n if (!this.pdfiumModule.FPDFPageObj_SetMatrix(imageObjectPtr, matrixPtr)) {\n this.free(matrixPtr);\n this.pdfiumModule.FPDFBitmap_Destroy(bitmapPtr);\n this.pdfiumModule.FPDFPageObj_Destroy(imageObjectPtr);\n this.free(bitmapBufferPtr);\n return false;\n }\n this.free(matrixPtr);\n\n this.pdfiumModule.FPDFPageObj_Transform(imageObjectPtr, 1, 0, 0, 1, position.x, position.y);\n\n if (!this.pdfiumModule.FPDFAnnot_AppendObject(annotationPtr, imageObjectPtr)) {\n this.pdfiumModule.FPDFBitmap_Destroy(bitmapPtr);\n this.pdfiumModule.FPDFPageObj_Destroy(imageObjectPtr);\n this.free(bitmapBufferPtr);\n return false;\n }\n\n this.pdfiumModule.FPDFPage_GenerateContent(pagePtr);\n this.pdfiumModule.FPDFBitmap_Destroy(bitmapPtr);\n this.free(bitmapBufferPtr);\n\n return true;\n }\n\n /**\n * Save document to array buffer\n * @param docPtr - pointer to pdf document\n * @returns array buffer contains the pdf content\n *\n * @private\n */\n saveDocument(docPtr: number) {\n const writerPtr = this.pdfiumModule.PDFiumExt_OpenFileWriter();\n this.pdfiumModule.PDFiumExt_SaveAsCopy(docPtr, writerPtr);\n const size = this.pdfiumModule.PDFiumExt_GetFileWriterSize(writerPtr);\n const dataPtr = this.malloc(size);\n this.pdfiumModule.PDFiumExt_GetFileWriterData(writerPtr, dataPtr, size);\n const buffer = new ArrayBuffer(size);\n const view = new DataView(buffer);\n for (let i = 0; i < size; i++) {\n view.setInt8(i, this.pdfiumModule.pdfium.getValue(dataPtr + i, 'i8'));\n }\n this.free(dataPtr);\n this.pdfiumModule.PDFiumExt_CloseFileWriter(writerPtr);\n\n return buffer;\n }\n\n /**\n * Read metadata from pdf document\n * @param docPtr - pointer to pdf document\n * @param key - key of metadata field\n * @returns metadata value\n *\n * @private\n */\n readMetaText(docPtr: number, key: string) {\n return readString(\n this.pdfiumModule.pdfium,\n (buffer, bufferLength) => {\n return this.pdfiumModule.FPDF_GetMetaText(docPtr, key, buffer, bufferLength);\n },\n this.pdfiumModule.pdfium.UTF16ToString,\n );\n }\n\n /**\n * Read bookmarks in the pdf document\n * @param docPtr - pointer to pdf document\n * @param rootBookmarkPtr - pointer to root bookmark\n * @returns bookmarks in the pdf document\n *\n * @private\n */\n readPdfBookmarks(docPtr: number, rootBookmarkPtr = 0) {\n let bookmarkPtr = this.pdfiumModule.FPDFBookmark_GetFirstChild(docPtr, rootBookmarkPtr);\n\n const bookmarks: PdfBookmarkObject[] = [];\n while (bookmarkPtr) {\n const bookmark = this.readPdfBookmark(docPtr, bookmarkPtr);\n bookmarks.push(bookmark);\n\n const nextBookmarkPtr = this.pdfiumModule.FPDFBookmark_GetNextSibling(docPtr, bookmarkPtr);\n\n bookmarkPtr = nextBookmarkPtr;\n }\n\n return bookmarks;\n }\n\n /**\n * Read bookmark in the pdf document\n * @param docPtr - pointer to pdf document\n * @param bookmarkPtr - pointer to bookmark object\n * @returns pdf bookmark object\n *\n * @private\n */\n private readPdfBookmark(docPtr: number, bookmarkPtr: number): PdfBookmarkObject {\n const title = readString(\n this.pdfiumModule.pdfium,\n (buffer, bufferLength) => {\n return this.pdfiumModule.FPDFBookmark_GetTitle(bookmarkPtr, buffer, bufferLength);\n },\n this.pdfiumModule.pdfium.UTF16ToString,\n );\n\n const bookmarks = this.readPdfBookmarks(docPtr, bookmarkPtr);\n\n const target = this.readPdfBookmarkTarget(\n docPtr,\n () => {\n return this.pdfiumModule.FPDFBookmark_GetAction(bookmarkPtr);\n },\n () => {\n return this.pdfiumModule.FPDFBookmark_GetDest(docPtr, bookmarkPtr);\n },\n );\n\n return {\n title,\n target,\n children: bookmarks,\n };\n }\n\n /**\n * Read text rects in pdf page\n * @param page - pdf page info\n * @param docPtr - pointer to pdf document\n * @param pagePtr - pointer to pdf page\n * @param textPagePtr - pointer to pdf text page\n * @returns text rects in the pdf page\n *\n * @public\n */\n private readPageTextRects(\n page: PdfPageObject,\n docPtr: number,\n pagePtr: number,\n textPagePtr: number,\n ) {\n const rectsCount = this.pdfiumModule.FPDFText_CountRects(textPagePtr, 0, -1);\n\n const textRects: PdfTextRectObject[] = [];\n for (let i = 0; i < rectsCount; i++) {\n const topPtr = this.malloc(8);\n const leftPtr = this.malloc(8);\n const rightPtr = this.malloc(8);\n const bottomPtr = this.malloc(8);\n const isSucceed = this.pdfiumModule.FPDFText_GetRect(\n textPagePtr,\n i,\n leftPtr,\n topPtr,\n rightPtr,\n bottomPtr,\n );\n if (!isSucceed) {\n this.free(leftPtr);\n this.free(topPtr);\n this.free(rightPtr);\n this.free(bottomPtr);\n continue;\n }\n\n const left = this.pdfiumModule.pdfium.getValue(leftPtr, 'double');\n const top = this.pdfiumModule.pdfium.getValue(topPtr, 'double');\n const right = this.pdfiumModule.pdfium.getValue(rightPtr, 'double');\n const bottom = this.pdfiumModule.pdfium.getValue(bottomPtr, 'double');\n\n this.free(leftPtr);\n this.free(topPtr);\n this.free(rightPtr);\n this.free(bottomPtr);\n\n const deviceXPtr = this.malloc(4);\n const deviceYPtr = this.malloc(4);\n this.pdfiumModule.FPDF_PageToDevice(\n pagePtr,\n 0,\n 0,\n page.size.width,\n page.size.height,\n 0,\n left,\n top,\n deviceXPtr,\n deviceYPtr,\n );\n const x = this.pdfiumModule.pdfium.getValue(deviceXPtr, 'i32');\n const y = this.pdfiumModule.pdfium.getValue(deviceYPtr, 'i32');\n this.free(deviceXPtr);\n this.free(deviceYPtr);\n\n const rect = {\n origin: {\n x,\n y,\n },\n size: {\n width: Math.ceil(Math.abs(right - left)),\n height: Math.ceil(Math.abs(top - bottom)),\n },\n };\n\n const utf16Length = this.pdfiumModule.FPDFText_GetBoundedText(\n textPagePtr,\n left,\n top,\n right,\n bottom,\n 0,\n 0,\n );\n const bytesCount = (utf16Length + 1) * 2; // include NIL\n const textBuffer = this.malloc(bytesCount);\n this.pdfiumModule.FPDFText_GetBoundedText(\n textPagePtr,\n left,\n top,\n right,\n bottom,\n textBuffer,\n utf16Length,\n );\n const content = this.pdfiumModule.pdfium.UTF16ToString(textBuffer);\n this.free(textBuffer);\n\n const charIndex = this.pdfiumModule.FPDFText_GetCharIndexAtPos(textPagePtr, left, top, 2, 2);\n let fontFamily = '';\n let fontSize = rect.size.height;\n if (charIndex >= 0) {\n fontSize = this.pdfiumModule.FPDFText_GetFontSize(textPagePtr, charIndex);\n\n const fontNameLength = this.pdfiumModule.FPDFText_GetFontInfo(\n textPagePtr,\n charIndex,\n 0,\n 0,\n 0,\n );\n\n const bytesCount = fontNameLength + 1; // include NIL\n const textBufferPtr = this.malloc(bytesCount);\n const flagsPtr = this.malloc(4);\n this.pdfiumModule.FPDFText_GetFontInfo(\n textPagePtr,\n charIndex,\n textBufferPtr,\n bytesCount,\n flagsPtr,\n );\n fontFamily = this.pdfiumModule.pdfium.UTF8ToString(textBufferPtr);\n this.free(textBufferPtr);\n this.free(flagsPtr);\n }\n\n const textRect: PdfTextRectObject = {\n content,\n rect,\n font: {\n family: fontFamily,\n size: fontSize,\n },\n };\n\n textRects.push(textRect);\n }\n\n return textRects;\n }\n\n /**\n * Return geometric + logical text layout for one page\n * (glyph-only implementation, no FPDFText_GetRect).\n *\n * @public\n */\n getPageGeometry(doc: PdfDocumentObject, page: PdfPageObject): PdfTask<PdfPageGeometry> {\n const label = 'getPageGeometry';\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, label, 'Begin', doc.id);\n\n /* ── guards ───────────────────────────────────────────── */\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, label, 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n /* ── native handles ──────────────────────────────────── */\n const pageCtx = ctx.acquirePage(page.index);\n const textPagePtr = pageCtx.getTextPage();\n\n /* ── 1. read ALL glyphs in logical order ─────────────── */\n const glyphCount = this.pdfiumModule.FPDFText_CountChars(textPagePtr);\n const glyphs: PdfGlyphObject[] = [];\n\n for (let i = 0; i < glyphCount; i++) {\n const g = this.readGlyphInfo(page, pageCtx.pagePtr, textPagePtr, i);\n glyphs.push(g);\n }\n\n /* ── 2. build visual runs from glyph stream ───────────── */\n const runs: PdfRun[] = this.buildRunsFromGlyphs(glyphs, textPagePtr);\n\n /* ── 3. cleanup & resolve task ───────────────────────── */\n pageCtx.release();\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, label, 'End', doc.id);\n return PdfTaskHelper.resolve({ runs });\n }\n\n /**\n * Group consecutive glyphs that belong to the same CPDF_TextObject\n * using FPDFText_GetTextObject(), and calculate rotation from glyph positions.\n */\n private buildRunsFromGlyphs(glyphs: PdfGlyphObject[], textPagePtr: number): PdfRun[] {\n const runs: PdfRun[] = [];\n let current: PdfRun | null = null;\n let curObjPtr: number | null = null;\n let bounds: { minX: number; minY: number; maxX: number; maxY: number } | null = null;\n\n /** ── main loop ──────────────────────────────────────────── */\n for (let i = 0; i < glyphs.length; i++) {\n const g = glyphs[i];\n\n /* 1 — find the CPDF_TextObject this glyph belongs to */\n const objPtr = this.pdfiumModule.FPDFText_GetTextObject(textPagePtr, i) as number;\n\n /* 2 — start a new run when the text object changes */\n if (objPtr !== curObjPtr) {\n curObjPtr = objPtr;\n current = {\n rect: {\n x: g.origin.x,\n y: g.origin.y,\n width: g.size.width,\n height: g.size.height,\n },\n charStart: i,\n glyphs: [],\n };\n bounds = {\n minX: g.origin.x,\n minY: g.origin.y,\n maxX: g.origin.x + g.size.width,\n maxY: g.origin.y + g.size.height,\n };\n runs.push(current);\n }\n\n /* 3 — append the slim glyph record */\n current!.glyphs.push({\n x: g.origin.x,\n y: g.origin.y,\n width: g.size.width,\n height: g.size.height,\n flags: g.isEmpty ? 2 : g.isSpace ? 1 : 0,\n });\n\n /* 4 — expand the run's bounding rect */\n if (g.isEmpty) {\n continue;\n }\n\n const right = g.origin.x + g.size.width;\n const bottom = g.origin.y + g.size.height;\n\n // Update bounds\n bounds!.minX = Math.min(bounds!.minX, g.origin.x);\n bounds!.minY = Math.min(bounds!.minY, g.origin.y);\n bounds!.maxX = Math.max(bounds!.maxX, right);\n bounds!.maxY = Math.max(bounds!.maxY, bottom);\n\n // Calculate final rect from bounds\n current!.rect.x = bounds!.minX;\n current!.rect.y = bounds!.minY;\n current!.rect.width = bounds!.maxX - bounds!.minX;\n current!.rect.height = bounds!.maxY - bounds!.minY;\n }\n\n return runs;\n }\n\n /**\n * Extract glyph geometry + metadata for `charIndex`\n *\n * Returns device–space coordinates:\n * x,y → **top-left** corner (integer-pixels)\n * w,h → width / height (integer-pixels, ≥ 1)\n *\n * And two flags:\n * isSpace → true if the glyph's Unicode code-point is U+0020\n */\n private readGlyphInfo(\n page: PdfPageObject,\n pagePtr: number,\n textPagePtr: number,\n charIndex: number,\n ): PdfGlyphObject {\n // ── native stack temp pointers ──────────────────────────────\n const dx1Ptr = this.malloc(4);\n const dy1Ptr = this.malloc(4);\n const dx2Ptr = this.malloc(4);\n const dy2Ptr = this.malloc(4);\n const rectPtr = this.malloc(16); // 4 floats = 16 bytes\n\n let x = 0,\n y = 0,\n width = 0,\n height = 0,\n isSpace = false;\n\n // ── 1) raw glyph bbox in page-user-space\n if (this.pdfiumModule.FPDFText_GetLooseCharBox(textPagePtr, charIndex, rectPtr)) {\n const left = this.pdfiumModule.pdfium.getValue(rectPtr, 'float');\n const top = this.pdfiumModule.pdfium.getValue(rectPtr + 4, 'float');\n const right = this.pdfiumModule.pdfium.getValue(rectPtr + 8, 'float');\n const bottom = this.pdfiumModule.pdfium.getValue(rectPtr + 12, 'float');\n\n if (left === right || top === bottom) {\n return {\n origin: { x: 0, y: 0 },\n size: { width: 0, height: 0 },\n isEmpty: true,\n };\n }\n\n // ── 2) map 2 opposite corners to device-space\n this.pdfiumModule.FPDF_PageToDevice(\n pagePtr,\n 0,\n 0,\n page.size.width,\n page.size.height,\n /*rotate=*/ 0,\n left,\n top,\n dx1Ptr,\n dy1Ptr,\n );\n this.pdfiumModule.FPDF_PageToDevice(\n pagePtr,\n 0,\n 0,\n page.size.width,\n page.size.height,\n /*rotate=*/ 0,\n right,\n bottom,\n dx2Ptr,\n dy2Ptr,\n );\n\n const x1 = this.pdfiumModule.pdfium.getValue(dx1Ptr, 'i32');\n const y1 = this.pdfiumModule.pdfium.getValue(dy1Ptr, 'i32');\n const x2 = this.pdfiumModule.pdfium.getValue(dx2Ptr, 'i32');\n const y2 = this.pdfiumModule.pdfium.getValue(dy2Ptr, 'i32');\n\n x = Math.min(x1, x2);\n y = Math.min(y1, y2);\n width = Math.max(1, Math.abs(x2 - x1));\n height = Math.max(1, Math.abs(y2 - y1));\n\n // ── 3) extra flags ───────────────────────────────────────\n const uc = this.pdfiumModule.FPDFText_GetUnicode(textPagePtr, charIndex);\n isSpace = uc === 32;\n }\n\n // ── free tmps ───────────────────────────────────────────────\n [rectPtr, dx1Ptr, dy1Ptr, dx2Ptr, dy2Ptr].forEach((p) => this.free(p));\n\n return {\n origin: { x, y },\n size: { width, height },\n ...(isSpace && { isSpace }),\n };\n }\n\n /**\n * Geometry-only text extraction\n * ------------------------------------------\n * Returns every glyph on the requested page\n * in the logical order delivered by PDFium.\n *\n * The promise resolves to an array of objects:\n * {\n * idx: number; // glyph index on the page (0…n-1)\n * origin: { x: number; y: number };\n * size: { width: number; height: number };\n * angle: number; // degrees, counter-clock-wise\n * isSpace: boolean; // true → U+0020\n * }\n *\n * No Unicode is included; front-end decides whether to hydrate it.\n */\n public getPageGlyphs(doc: PdfDocumentObject, page: PdfPageObject): PdfTask<PdfGlyphObject[]> {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'getPageGlyphs', doc, page);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, 'getPageGlyphs', 'Begin', doc.id);\n\n // ── 1) safety: document handle must be alive ───────────────\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, 'getPageGlyphs', 'End', doc.id);\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n // ── 2) load page + text page handles ───────────────────────\n const pageCtx = ctx.acquirePage(page.index);\n const textPagePtr = pageCtx.getTextPage();\n\n // ── 3) iterate all glyphs in logical order ─────────────────\n const total = this.pdfiumModule.FPDFText_CountChars(textPagePtr);\n const glyphs = new Array(total);\n\n for (let i = 0; i < total; i++) {\n const g = this.readGlyphInfo(page, pageCtx.pagePtr, textPagePtr, i);\n\n if (g.isEmpty) {\n continue;\n }\n\n glyphs[i] = { ...g };\n }\n\n // ── 4) clean-up native handles ─────────────────────────────\n pageCtx.release();\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, 'getPageGlyphs', 'End', doc.id);\n\n return PdfTaskHelper.resolve(glyphs);\n }\n\n private readCharBox(\n page: PdfPageObject,\n pagePtr: number,\n textPagePtr: number,\n charIndex: number,\n ): Rect {\n const topPtr = this.malloc(8);\n const leftPtr = this.malloc(8);\n const bottomPtr = this.malloc(8);\n const rightPtr = this.malloc(8);\n let x = 0;\n let y = 0;\n let width = 0;\n let height = 0;\n if (\n this.pdfiumModule.FPDFText_GetCharBox(\n textPagePtr,\n charIndex,\n leftPtr,\n rightPtr,\n bottomPtr,\n topPtr,\n )\n ) {\n const top = this.pdfiumModule.pdfium.getValue(topPtr, 'double');\n const left = this.pdfiumModule.pdfium.getValue(leftPtr, 'double');\n const bottom = this.pdfiumModule.pdfium.getValue(bottomPtr, 'double');\n const right = this.pdfiumModule.pdfium.getValue(rightPtr, 'double');\n\n const deviceXPtr = this.malloc(4);\n const deviceYPtr = this.malloc(4);\n this.pdfiumModule.FPDF_PageToDevice(\n pagePtr,\n 0,\n 0,\n page.size.width,\n page.size.height,\n 0,\n left,\n top,\n deviceXPtr,\n deviceYPtr,\n );\n x = this.pdfiumModule.pdfium.getValue(deviceXPtr, 'i32');\n y = this.pdfiumModule.pdfium.getValue(deviceYPtr, 'i32');\n this.free(deviceXPtr);\n this.free(deviceYPtr);\n\n width = Math.ceil(Math.abs(right - left));\n height = Math.ceil(Math.abs(top - bottom));\n }\n this.free(topPtr);\n this.free(leftPtr);\n this.free(bottomPtr);\n this.free(rightPtr);\n\n return {\n origin: {\n x,\n y,\n },\n size: {\n width,\n height,\n },\n };\n }\n\n /**\n * Read page annotations\n * @param page - page info\n * @param docPtr - pointer to pdf document\n * @param pagePtr - pointer to pdf page\n * @param textPagePtr - pointe to pdf text page\n * @param scaleFactor - scale factor\n * @param rotation - rotation angle\n * @returns annotations on the pdf page\n *\n * @private\n */\n private readPageAnnotations(ctx: DocumentContext, page: PdfPageObject) {\n const pageCtx = ctx.acquirePage(page.index);\n const annotationCount = this.pdfiumModule.FPDFPage_GetAnnotCount(pageCtx.pagePtr);\n\n const annotations: PdfAnnotationObject[] = [];\n for (let i = 0; i < annotationCount; i++) {\n pageCtx.withAnnotation(i, (annotPtr) => {\n const annotation = this.readPageAnnotation(page, pageCtx, annotPtr, i);\n if (annotation) {\n annotations.push(annotation);\n }\n });\n }\n\n return annotations;\n }\n\n /**\n * Read pdf annotation from pdf document\n * @param page - pdf page infor\n * @param docPtr - pointer to pdf document object\n * @param pagePtr - pointer to pdf page object\n * @param textPagePtr - pointer to pdf text page object\n * @param formHandle - form handle\n * @param index - index of annotation in the pdf page\n * @param scaleFactor - factor of scalling\n * @param rotation - rotation angle\n * @returns pdf annotation\n *\n * @private\n */\n private readPageAnnotation(\n page: PdfPageObject,\n pageCtx: PageContext,\n annotationPtr: number,\n index: number,\n ) {\n const subType = this.pdfiumModule.FPDFAnnot_GetSubtype(\n annotationPtr,\n ) as PdfAnnotationObject['type'];\n let annotation: PdfAnnotationObject | undefined;\n switch (subType) {\n case PdfAnnotationSubtype.TEXT:\n {\n annotation = this.readPdfTextAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.FREETEXT:\n {\n annotation = this.readPdfFreeTextAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.LINK:\n {\n annotation = this.readPdfLinkAnno(\n page,\n pageCtx.docPtr,\n pageCtx.pagePtr,\n pageCtx.getTextPage(),\n annotationPtr,\n index,\n );\n }\n break;\n case PdfAnnotationSubtype.WIDGET:\n {\n annotation = this.readPdfWidgetAnno(\n page,\n pageCtx.pagePtr,\n annotationPtr,\n pageCtx.getFormHandle(),\n index,\n );\n }\n break;\n case PdfAnnotationSubtype.FILEATTACHMENT:\n {\n annotation = this.readPdfFileAttachmentAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.INK:\n {\n annotation = this.readPdfInkAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.POLYGON:\n {\n annotation = this.readPdfPolygonAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.POLYLINE:\n {\n annotation = this.readPdfPolylineAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.LINE:\n {\n annotation = this.readPdfLineAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.HIGHLIGHT:\n annotation = this.readPdfHighlightAnno(page, pageCtx.pagePtr, annotationPtr, index);\n break;\n case PdfAnnotationSubtype.STAMP:\n {\n annotation = this.readPdfStampAnno(\n pageCtx.docPtr,\n page,\n pageCtx.pagePtr,\n annotationPtr,\n index,\n );\n }\n break;\n case PdfAnnotationSubtype.SQUARE:\n {\n annotation = this.readPdfSquareAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.CIRCLE:\n {\n annotation = this.readPdfCircleAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.UNDERLINE:\n {\n annotation = this.readPdfUnderlineAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.SQUIGGLY:\n {\n annotation = this.readPdfSquigglyAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.STRIKEOUT:\n {\n annotation = this.readPdfStrikeOutAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n case PdfAnnotationSubtype.CARET:\n {\n annotation = this.readPdfCaretAnno(page, pageCtx.pagePtr, annotationPtr, index);\n }\n break;\n default:\n {\n annotation = this.readPdfAnno(page, pageCtx.pagePtr, subType, annotationPtr, index);\n }\n break;\n }\n\n return annotation;\n }\n\n /**\n * Return the colour stored directly in the annotation dictionary's `/C` entry.\n *\n * Most PDFs created by Acrobat, Microsoft Office, LaTeX, etc. include this entry.\n * When the key is absent (common in macOS Preview, Chrome, Drawboard) the call\n * fails and the function returns `undefined`.\n *\n * @param annotationPtr - pointer to an `FPDF_ANNOTATION`\n * @returns An RGBA tuple (0-255 channels) or `undefined` if no `/C` entry exists\n *\n * @private\n */\n private readAnnotationColor(\n annotationPtr: number,\n colorType: PdfAnnotationColorType = PdfAnnotationColorType.Color,\n ): PdfAlphaColor | undefined {\n const rPtr = this.malloc(4);\n const gPtr = this.malloc(4);\n const bPtr = this.malloc(4);\n const aPtr = this.malloc(4);\n\n // colourType 0 = \"colour\" (stroke/fill); other types are interior/border\n const ok = this.pdfiumModule.EPDFAnnot_GetColor(\n annotationPtr,\n colorType,\n rPtr,\n gPtr,\n bPtr,\n aPtr,\n );\n\n let colour: PdfAlphaColor | undefined;\n\n if (ok) {\n colour = {\n red: this.pdfiumModule.pdfium.getValue(rPtr, 'i32') & 0xff,\n green: this.pdfiumModule.pdfium.getValue(gPtr, 'i32') & 0xff,\n blue: this.pdfiumModule.pdfium.getValue(bPtr, 'i32') & 0xff,\n alpha: this.pdfiumModule.pdfium.getValue(aPtr, 'i32') & 0xff, // 0 = transparent, 255 = opaque\n };\n }\n\n this.free(rPtr);\n this.free(gPtr);\n this.free(bPtr);\n this.free(aPtr);\n\n return colour;\n }\n\n /* --------------------------------------------------------------------------- */\n /**\n * Resolve the visible fill colour for **Highlight / Underline / StrikeOut /\n * Squiggly** markup annotations.\n *\n * Resolution order (first non-`undefined` wins):\n * 1. `/C` dictionary entry – fast, present in Acrobat / Office PDFs\n * 2. Appearance-stream objects – drills into paths & nested forms\n * 3. Hard-coded fallback (Acrobat-style opaque yellow)\n *\n * @param annotationPtr - pointer to an `FPDF_ANNOTATION`\n * @param fallback - colour to use when the PDF stores no tint at all\n * @returns WebAlphaColor with hex color and opacity (0-1)\n *\n * @private\n */\n private resolveAnnotationColor(\n annotationPtr: number,\n colorType: PdfAnnotationColorType = PdfAnnotationColorType.Color,\n fallback: PdfAlphaColor = { red: 255, green: 245, blue: 155, alpha: 255 },\n ): WebAlphaColor {\n const pdfColor = this.readAnnotationColor(annotationPtr, colorType) ?? fallback;\n\n return pdfAlphaColorToWebAlphaColor(pdfColor);\n }\n\n /**\n * Set the fill/stroke colour for a **Highlight / Underline / StrikeOut / Squiggly** markup annotation.\n *\n * @param annotationPtr - pointer to the annotation whose colour is being set\n * @param webAlphaColor - WebAlphaColor with hex color and opacity (0-1)\n * @param shouldClearAP - whether to clear the /AP entry\n * @param which - which colour to set (0 = fill, 1 = stroke)\n * @returns `true` if the operation was successful\n *\n * @private\n */\n private setAnnotationColor(\n annotationPtr: number,\n webAlphaColor: WebAlphaColor,\n colorType: PdfAnnotationColorType = PdfAnnotationColorType.Color,\n ): boolean {\n const pdfAlphaColor = webAlphaColorToPdfAlphaColor(webAlphaColor);\n\n return this.pdfiumModule.EPDFAnnot_SetColor(\n annotationPtr,\n colorType,\n pdfAlphaColor.red & 0xff,\n pdfAlphaColor.green & 0xff,\n pdfAlphaColor.blue & 0xff,\n (pdfAlphaColor.alpha ?? 255) & 0xff,\n );\n }\n\n /**\n * Border‐style + width helper\n *\n * Tries the new PDFium helper `EPDFAnnot_GetBorderStyle()` (patch series\n * 9 July 2025).\n *\n * @param annotationPtr pointer to an `FPDF_ANNOTATION`\n * @returns `{ ok, style, width }`\n * • `ok` – `true` when the call succeeded\n * • `style` – `PdfAnnotationBorderStyle` enum\n * • `width` – stroke-width in points (defaults to 0 pt)\n */\n private getBorderStyle(annotationPtr: number): {\n ok: boolean;\n style: PdfAnnotationBorderStyle;\n width: number;\n } {\n /* 1 ── allocate tmp storage for the returned width ─────────────── */\n const widthPtr = this.malloc(4);\n let width = 0;\n let style: PdfAnnotationBorderStyle = PdfAnnotationBorderStyle.UNKNOWN;\n let ok = false;\n\n style = this.pdfiumModule.EPDFAnnot_GetBorderStyle(annotationPtr, widthPtr);\n width = this.pdfiumModule.pdfium.getValue(widthPtr, 'float');\n ok = style !== PdfAnnotationBorderStyle.UNKNOWN;\n this.free(widthPtr);\n return { ok, style, width };\n }\n\n private setBorderStyle(\n annotationPtr: number,\n style: PdfAnnotationBorderStyle,\n width: number,\n ): boolean {\n return this.pdfiumModule.EPDFAnnot_SetBorderStyle(annotationPtr, style, width);\n }\n\n /**\n * Border-effect (“cloudy”) helper\n *\n * Calls the new PDFium function `EPDFAnnot_GetBorderEffect()` (July 2025).\n *\n * @param annotationPtr pointer to an `FPDF_ANNOTATION`\n * @returns `{ ok, intensity }`\n * • `ok` – `true` when the annotation *does* have a\n * valid cloudy-border effect\n * • `intensity` – radius/intensity value (0 when `ok` is false)\n */\n private getBorderEffect(annotationPtr: number): { ok: boolean; intensity: number } {\n const intensityPtr = this.malloc(4);\n\n const ok = !!this.pdfiumModule.EPDFAnnot_GetBorderEffect(annotationPtr, intensityPtr);\n\n const intensity = ok ? this.pdfiumModule.pdfium.getValue(intensityPtr, 'float') : 0;\n\n this.free(intensityPtr);\n return { ok, intensity };\n }\n\n /**\n * Rectangle-differences helper ( /RD array on Square / Circle annots )\n *\n * Calls `EPDFAnnot_GetRectangleDifferences()` introduced in July 2025.\n *\n * @param annotationPtr pointer to an `FPDF_ANNOTATION`\n * @returns `{ ok, left, top, right, bottom }`\n * • `ok` – `true` when the annotation *has* an /RD entry\n * • the four floats are 0 when `ok` is false\n */\n private getRectangleDifferences(annotationPtr: number): {\n ok: boolean;\n left: number;\n top: number;\n right: number;\n bottom: number;\n } {\n /* tmp storage ─────────────────────────────────────────── */\n const lPtr = this.malloc(4);\n const tPtr = this.malloc(4);\n const rPtr = this.malloc(4);\n const bPtr = this.malloc(4);\n\n const ok = !!this.pdfiumModule.EPDFAnnot_GetRectangleDifferences(\n annotationPtr,\n lPtr,\n tPtr,\n rPtr,\n bPtr,\n );\n\n const pdf = this.pdfiumModule.pdfium;\n const left = pdf.getValue(lPtr, 'float');\n const top = pdf.getValue(tPtr, 'float');\n const right = pdf.getValue(rPtr, 'float');\n const bottom = pdf.getValue(bPtr, 'float');\n\n /* cleanup ─────────────────────────────────────────────── */\n this.free(lPtr);\n this.free(tPtr);\n this.free(rPtr);\n this.free(bPtr);\n\n return { ok, left, top, right, bottom };\n }\n\n /**\n * Dash-pattern helper ( /BS → /D array, dashed borders only )\n *\n * Uses the two new PDFium helpers:\n * • `EPDFAnnot_GetBorderDashPatternCount`\n * • `EPDFAnnot_GetBorderDashPattern`\n *\n * @param annotationPtr pointer to an `FPDF_ANNOTATION`\n * @returns `{ ok, pattern }`\n * • `ok` – `true` when the annot is dashed *and* the array\n * was retrieved successfully\n * • `pattern` – numeric array of dash/space lengths (empty when `ok` is false)\n */\n private getBorderDashPattern(annotationPtr: number): { ok: boolean; pattern: number[] } {\n const count = this.pdfiumModule.EPDFAnnot_GetBorderDashPatternCount(annotationPtr);\n if (count === 0) {\n return { ok: false, pattern: [] };\n }\n\n /* allocate `count` floats on the WASM heap */\n const arrPtr = this.malloc(4 * count);\n const okNative = !!this.pdfiumModule.EPDFAnnot_GetBorderDashPattern(\n annotationPtr,\n arrPtr,\n count,\n );\n\n /* copy out */\n const pattern: number[] = [];\n if (okNative) {\n const pdf = this.pdfiumModule.pdfium;\n for (let i = 0; i < count; i++) {\n pattern.push(pdf.getValue(arrPtr + 4 * i, 'float'));\n }\n }\n\n this.free(arrPtr);\n return { ok: okNative, pattern };\n }\n\n /**\n * Read `/QuadPoints` from any annotation and convert each quadrilateral to\n * device-space coordinates.\n *\n * The four points are returned in natural reading order:\n * `p1 → p2` (top edge) and `p4 → p3` (bottom edge).\n * This preserves the true shape for rotated / skewed text, whereas callers\n * that only need axis-aligned boxes can collapse each quad themselves.\n *\n * @param page - logical page info object (`PdfPageObject`)\n * @param annotationPtr - pointer to the annotation whose quads are needed\n * @returns Array of `Rect` objects (`[]` if the annotation has no quads)\n *\n * @private\n */\n private getQuadPointsAnno(page: PdfPageObject, annotationPtr: number): Rect[] {\n const quadCount = this.pdfiumModule.FPDFAnnot_CountAttachmentPoints(annotationPtr);\n if (quadCount === 0) return [];\n\n const FS_QUADPOINTSF_SIZE = 8 * 4; // eight floats, 32 bytes\n const quads: Quad[] = [];\n\n for (let qi = 0; qi < quadCount; qi++) {\n const quadPtr = this.malloc(FS_QUADPOINTSF_SIZE);\n\n const ok = this.pdfiumModule.FPDFAnnot_GetAttachmentPoints(annotationPtr, qi, quadPtr);\n\n if (ok) {\n // read the eight floats\n const xs: number[] = [];\n const ys: number[] = [];\n for (let i = 0; i < 4; i++) {\n const base = quadPtr + i * 8; // 8 bytes per point (x+y)\n xs.push(this.pdfiumModule.pdfium.getValue(base, 'float'));\n ys.push(this.pdfiumModule.pdfium.getValue(base + 4, 'float'));\n }\n\n // convert to device-space\n const p1 = this.convertPagePointToDevicePoint(page, { x: xs[0], y: ys[0] });\n const p2 = this.convertPagePointToDevicePoint(page, { x: xs[1], y: ys[1] });\n const p3 = this.convertPagePointToDevicePoint(page, { x: xs[2], y: ys[2] });\n const p4 = this.convertPagePointToDevicePoint(page, { x: xs[3], y: ys[3] });\n\n quads.push({ p1, p2, p3, p4 });\n }\n\n this.free(quadPtr);\n }\n\n return quads.map(quadToRect);\n }\n\n /**\n * Set the quadrilaterals for a **Highlight / Underline / StrikeOut / Squiggly** markup annotation.\n *\n * @param page - logical page info object (`PdfPageObject`)\n * @param annotationPtr - pointer to the annotation whose quads are needed\n * @param rects - array of `Rect` objects (`[]` if the annotation has no quads)\n * @returns `true` if the operation was successful\n *\n * @private\n */\n private syncQuadPointsAnno(page: PdfPageObject, annotPtr: number, rects: Rect[]): boolean {\n const FS_QUADPOINTSF_SIZE = 8 * 4; // eight floats, 32 bytes\n const pdf = this.pdfiumModule.pdfium;\n const count = this.pdfiumModule.FPDFAnnot_CountAttachmentPoints(annotPtr);\n const buf = this.malloc(FS_QUADPOINTSF_SIZE);\n\n /** write one quad into `buf` in annotation space */\n const writeQuad = (r: Rect) => {\n const q = rectToQuad(r); // TL, TR, BR, BL\n const p1 = this.convertDevicePointToPagePoint(page, q.p1);\n const p2 = this.convertDevicePointToPagePoint(page, q.p2);\n const p3 = this.convertDevicePointToPagePoint(page, q.p3); // BR\n const p4 = this.convertDevicePointToPagePoint(page, q.p4); // BL\n\n // PDF QuadPoints order: BL, BR, TL, TR (bottom-left, bottom-right, top-left, top-right)\n pdf.setValue(buf + 0, p1.x, 'float'); // BL (bottom-left)\n pdf.setValue(buf + 4, p1.y, 'float');\n\n pdf.setValue(buf + 8, p2.x, 'float'); // BR (bottom-right)\n pdf.setValue(buf + 12, p2.y, 'float');\n\n pdf.setValue(buf + 16, p4.x, 'float'); // TL (top-left)\n pdf.setValue(buf + 20, p4.y, 'float');\n\n pdf.setValue(buf + 24, p3.x, 'float'); // TR (top-right)\n pdf.setValue(buf + 28, p3.y, 'float');\n };\n\n /* ----------------------------------------------------------------------- */\n /* 1. overwrite the quads that already exist */\n const min = Math.min(count, rects.length);\n for (let i = 0; i < min; i++) {\n writeQuad(rects[i]);\n if (!this.pdfiumModule.FPDFAnnot_SetAttachmentPoints(annotPtr, i, buf)) {\n this.free(buf);\n return false;\n }\n }\n\n /* 2. append new quads if rects.length > count */\n for (let i = count; i < rects.length; i++) {\n writeQuad(rects[i]);\n if (!this.pdfiumModule.FPDFAnnot_AppendAttachmentPoints(annotPtr, buf)) {\n this.free(buf);\n return false;\n }\n }\n\n this.free(buf);\n return true;\n }\n\n /**\n * Read ink list from annotation\n * @param page - logical page info object (`PdfPageObject`)\n * @param annotationPtr - pointer to the annotation whose ink list is needed\n * @returns ink list\n */\n private getInkList(page: PdfPageObject, annotationPtr: number): PdfInkListObject[] {\n const inkList: PdfInkListObject[] = [];\n\n const count = this.pdfiumModule.FPDFAnnot_GetInkListCount(annotationPtr);\n for (let i = 0; i < count; i++) {\n const points: Position[] = [];\n const pointsCount = this.pdfiumModule.FPDFAnnot_GetInkListPath(annotationPtr, i, 0, 0);\n if (pointsCount > 0) {\n const pointMemorySize = 8;\n const pointsPtr = this.malloc(pointsCount * pointMemorySize);\n this.pdfiumModule.FPDFAnnot_GetInkListPath(annotationPtr, i, pointsPtr, pointsCount);\n\n for (let j = 0; j < pointsCount; j++) {\n const pointX = this.pdfiumModule.pdfium.getValue(pointsPtr + j * 8, 'float');\n const pointY = this.pdfiumModule.pdfium.getValue(pointsPtr + j * 8 + 4, 'float');\n const { x, y } = this.convertPagePointToDevicePoint(page, {\n x: pointX,\n y: pointY,\n });\n points.push({ x, y });\n }\n\n this.free(pointsPtr);\n }\n\n inkList.push({ points });\n }\n\n return inkList;\n }\n\n /**\n * Add ink list to annotation\n * @param page - logical page info object (`PdfPageObject`)\n * @param annotationPtr - pointer to the annotation whose ink list is needed\n * @param annotation - annotation object (`PdfInkAnnoObject`)\n * @returns `true` if the operation was successful\n */\n private setInkList(\n page: PdfPageObject,\n annotationPtr: number,\n inkList: PdfInkListObject[],\n ): boolean {\n for (const inkStroke of inkList) {\n const inkPointsCount = inkStroke.points.length;\n const inkPointsPtr = this.malloc(inkPointsCount * 8);\n for (let i = 0; i < inkPointsCount; i++) {\n const point = inkStroke.points[i];\n const { x, y } = this.convertDevicePointToPagePoint(page, point);\n\n this.pdfiumModule.pdfium.setValue(inkPointsPtr + i * 8, x, 'float');\n this.pdfiumModule.pdfium.setValue(inkPointsPtr + i * 8 + 4, y, 'float');\n }\n\n if (\n this.pdfiumModule.FPDFAnnot_AddInkStroke(annotationPtr, inkPointsPtr, inkPointsCount) === -1\n ) {\n this.free(inkPointsPtr);\n return false;\n }\n\n this.free(inkPointsPtr);\n }\n\n return true;\n }\n\n /**\n * Read pdf text annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf text annotation\n *\n * @private\n */\n private readPdfTextAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfTextAnnoObject | undefined {\n const annoRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, annoRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = pdfDateToDate(modifiedRaw);\n\n const contents = this.getAnnotString(annotationPtr, 'Contents') || '';\n const state = this.getAnnotString(annotationPtr, 'State') as PdfAnnotationState;\n const stateModel = this.getAnnotString(annotationPtr, 'StateModel') as PdfAnnotationStateModel;\n const webAlphaColor = this.resolveAnnotationColor(annotationPtr);\n const inReplyToId = this.getInReplyToId(pagePtr, annotationPtr);\n\n return {\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.TEXT,\n contents,\n ...webAlphaColor,\n rect,\n inReplyToId,\n author,\n modified,\n state,\n stateModel,\n };\n }\n\n /**\n * Read pdf freetext annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf freetext annotation\n *\n * @private\n */\n private readPdfFreeTextAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfFreeTextAnnoObject | undefined {\n const annoRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, annoRect);\n const contents = this.getAnnotString(annotationPtr, 'Contents') || '';\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = pdfDateToDate(modifiedRaw);\n\n return {\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.FREETEXT,\n contents,\n author,\n modified,\n rect,\n };\n }\n\n /**\n * Read pdf link annotation from pdf document\n * @param page - pdf page infor\n * @param docPtr - pointer to pdf document object\n * @param pagePtr - pointer to pdf page object\n * @param textPagePtr - pointer to pdf text page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf link annotation\n *\n * @private\n */\n private readPdfLinkAnno(\n page: PdfPageObject,\n docPtr: number,\n pagePtr: number,\n textPagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfLinkAnnoObject | undefined {\n const linkPtr = this.pdfiumModule.FPDFAnnot_GetLink(annotationPtr);\n if (!linkPtr) {\n return;\n }\n\n const annoRect = this.readPageAnnoRect(annotationPtr);\n const { left, top, right, bottom } = annoRect;\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, annoRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = pdfDateToDate(modifiedRaw);\n\n const utf16Length = this.pdfiumModule.FPDFText_GetBoundedText(\n textPagePtr,\n left,\n top,\n right,\n bottom,\n 0,\n 0,\n );\n const bytesCount = (utf16Length + 1) * 2; // include NIL\n const textBufferPtr = this.malloc(bytesCount);\n this.pdfiumModule.FPDFText_GetBoundedText(\n textPagePtr,\n left,\n top,\n right,\n bottom,\n textBufferPtr,\n utf16Length,\n );\n const text = this.pdfiumModule.pdfium.UTF16ToString(textBufferPtr);\n this.free(textBufferPtr);\n\n const target = this.readPdfLinkAnnoTarget(\n docPtr,\n () => {\n return this.pdfiumModule.FPDFLink_GetAction(linkPtr);\n },\n () => {\n return this.pdfiumModule.FPDFLink_GetDest(docPtr, linkPtr);\n },\n );\n\n return {\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.LINK,\n text,\n target,\n rect,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf widget annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param formHandle - form handle\n * @param index - index of annotation in the pdf page\n * @returns pdf widget annotation\n *\n * @private\n */\n private readPdfWidgetAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n formHandle: number,\n index: number,\n ): PdfWidgetAnnoObject | undefined {\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = pdfDateToDate(modifiedRaw);\n\n const field = this.readPdfWidgetAnnoField(formHandle, annotationPtr);\n\n return {\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.WIDGET,\n rect,\n field,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf file attachment annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf file attachment annotation\n *\n * @private\n */\n private readPdfFileAttachmentAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfFileAttachmentAnnoObject | undefined {\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = pdfDateToDate(modifiedRaw);\n\n return {\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.FILEATTACHMENT,\n rect,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf ink annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf ink annotation\n *\n * @private\n */\n private readPdfInkAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfInkAnnoObject | undefined {\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = pdfDateToDate(modifiedRaw);\n const webAlphaColor = this.resolveAnnotationColor(annotationPtr);\n const { width: strokeWidth } = this.getBorderStyle(annotationPtr);\n const inkList = this.getInkList(page, annotationPtr);\n\n return {\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.INK,\n ...webAlphaColor,\n strokeWidth,\n rect,\n inkList,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf polygon annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf polygon annotation\n *\n * @private\n */\n private readPdfPolygonAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfPolygonAnnoObject | undefined {\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = pdfDateToDate(modifiedRaw);\n const vertices = this.readPdfAnnoVertices(page, pagePtr, annotationPtr);\n\n return {\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.POLYGON,\n rect,\n vertices,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf polyline annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf polyline annotation\n *\n * @private\n */\n private readPdfPolylineAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfPolylineAnnoObject | undefined {\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = pdfDateToDate(modifiedRaw);\n const vertices = this.readPdfAnnoVertices(page, pagePtr, annotationPtr);\n\n return {\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.POLYLINE,\n rect,\n vertices,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf line annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf line annotation\n *\n * @private\n */\n private readPdfLineAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfLineAnnoObject | undefined {\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = pdfDateToDate(modifiedRaw);\n const startPointPtr = this.malloc(8);\n const endPointPtr = this.malloc(8);\n\n this.pdfiumModule.FPDFAnnot_GetLine(annotationPtr, startPointPtr, endPointPtr);\n\n const startPointX = this.pdfiumModule.pdfium.getValue(startPointPtr, 'float');\n const startPointY = this.pdfiumModule.pdfium.getValue(startPointPtr + 4, 'float');\n const startPoint = this.convertPagePointToDevicePoint(page, {\n x: startPointX,\n y: startPointY,\n });\n\n const endPointX = this.pdfiumModule.pdfium.getValue(endPointPtr, 'float');\n const endPointY = this.pdfiumModule.pdfium.getValue(endPointPtr + 4, 'float');\n const endPoint = this.convertPagePointToDevicePoint(page, {\n x: endPointX,\n y: endPointY,\n });\n\n this.free(startPointPtr);\n this.free(endPointPtr);\n\n return {\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.LINE,\n rect,\n startPoint,\n endPoint,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf highlight annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf highlight annotation\n *\n * @private\n */\n private readPdfHighlightAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfHighlightAnnoObject | undefined {\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const segmentRects = this.getQuadPointsAnno(page, annotationPtr);\n const webAlphaColor = this.resolveAnnotationColor(annotationPtr);\n\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = pdfDateToDate(modifiedRaw);\n const contents = this.getAnnotString(annotationPtr, 'Contents') || '';\n\n return {\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.HIGHLIGHT,\n rect,\n contents,\n segmentRects,\n ...webAlphaColor,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf underline annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf underline annotation\n *\n * @private\n */\n private readPdfUnderlineAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfUnderlineAnnoObject | undefined {\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = pdfDateToDate(modifiedRaw);\n const segmentRects = this.getQuadPointsAnno(page, annotationPtr);\n const contents = this.getAnnotString(annotationPtr, 'Contents') || '';\n const webAlphaColor = this.resolveAnnotationColor(annotationPtr);\n\n return {\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.UNDERLINE,\n rect,\n contents,\n segmentRects,\n ...webAlphaColor,\n author,\n modified,\n };\n }\n\n /**\n * Read strikeout annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf strikeout annotation\n *\n * @private\n */\n private readPdfStrikeOutAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfStrikeOutAnnoObject | undefined {\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = pdfDateToDate(modifiedRaw);\n const segmentRects = this.getQuadPointsAnno(page, annotationPtr);\n const contents = this.getAnnotString(annotationPtr, 'Contents') || '';\n const webAlphaColor = this.resolveAnnotationColor(annotationPtr);\n\n return {\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.STRIKEOUT,\n rect,\n contents,\n segmentRects,\n ...webAlphaColor,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf squiggly annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf squiggly annotation\n *\n * @private\n */\n private readPdfSquigglyAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfSquigglyAnnoObject | undefined {\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = pdfDateToDate(modifiedRaw);\n const segmentRects = this.getQuadPointsAnno(page, annotationPtr);\n const contents = this.getAnnotString(annotationPtr, 'Contents') || '';\n const webAlphaColor = this.resolveAnnotationColor(annotationPtr);\n\n return {\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.SQUIGGLY,\n rect,\n contents,\n segmentRects,\n ...webAlphaColor,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf caret annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf caret annotation\n *\n * @private\n */\n private readPdfCaretAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfCaretAnnoObject | undefined {\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = pdfDateToDate(modifiedRaw);\n\n return {\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.CARET,\n rect,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf stamp annotation\n * @param docPtr - pointer to pdf document object\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf stamp annotation\n *\n * @private\n */\n private readPdfStampAnno(\n docPtr: number,\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfStampAnnoObject | undefined {\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = pdfDateToDate(modifiedRaw);\n const contents: PdfStampAnnoObject['contents'] = [];\n\n const objectCount = this.pdfiumModule.FPDFAnnot_GetObjectCount(annotationPtr);\n for (let i = 0; i < objectCount; i++) {\n const annotationObjectPtr = this.pdfiumModule.FPDFAnnot_GetObject(annotationPtr, i);\n\n const pageObj = this.readPdfPageObject(annotationObjectPtr);\n if (pageObj) {\n contents.push(pageObj);\n }\n }\n\n return {\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.STAMP,\n rect,\n contents,\n author,\n modified,\n };\n }\n\n /**\n * Read pdf object in pdf page\n * @param pageObjectPtr - pointer to pdf object in page\n * @returns pdf object in page\n *\n * @private\n */\n private readPdfPageObject(pageObjectPtr: number) {\n const type = this.pdfiumModule.FPDFPageObj_GetType(pageObjectPtr) as PdfPageObjectType;\n switch (type) {\n case PdfPageObjectType.PATH:\n return this.readPathObject(pageObjectPtr);\n case PdfPageObjectType.IMAGE:\n return this.readImageObject(pageObjectPtr);\n case PdfPageObjectType.FORM:\n return this.readFormObject(pageObjectPtr);\n }\n }\n\n /**\n * Read pdf path object\n * @param pathObjectPtr - pointer to pdf path object in page\n * @returns pdf path object\n *\n * @private\n */\n private readPathObject(pathObjectPtr: number): PdfPathObject {\n const segmentCount = this.pdfiumModule.FPDFPath_CountSegments(pathObjectPtr);\n\n const leftPtr = this.malloc(4);\n const bottomPtr = this.malloc(4);\n const rightPtr = this.malloc(4);\n const topPtr = this.malloc(4);\n this.pdfiumModule.FPDFPageObj_GetBounds(pathObjectPtr, leftPtr, bottomPtr, rightPtr, topPtr);\n const left = this.pdfiumModule.pdfium.getValue(leftPtr, 'float');\n const bottom = this.pdfiumModule.pdfium.getValue(bottomPtr, 'float');\n const right = this.pdfiumModule.pdfium.getValue(rightPtr, 'float');\n const top = this.pdfiumModule.pdfium.getValue(topPtr, 'float');\n const bounds = { left, bottom, right, top };\n this.free(leftPtr);\n this.free(bottomPtr);\n this.free(rightPtr);\n this.free(topPtr);\n const segments: PdfSegmentObject[] = [];\n for (let i = 0; i < segmentCount; i++) {\n const segment = this.readPdfSegment(pathObjectPtr, i);\n segments.push(segment);\n }\n\n const matrix = this.readPdfPageObjectTransformMatrix(pathObjectPtr);\n\n return {\n type: PdfPageObjectType.PATH,\n bounds,\n segments,\n matrix,\n };\n }\n\n /**\n * Read segment of pdf path object\n * @param annotationObjectPtr - pointer to pdf path object\n * @param segmentIndex - index of segment\n * @returns pdf segment in pdf path\n *\n * @private\n */\n private readPdfSegment(annotationObjectPtr: number, segmentIndex: number): PdfSegmentObject {\n const segmentPtr = this.pdfiumModule.FPDFPath_GetPathSegment(annotationObjectPtr, segmentIndex);\n const segmentType = this.pdfiumModule.FPDFPathSegment_GetType(segmentPtr);\n const isClosed = this.pdfiumModule.FPDFPathSegment_GetClose(segmentPtr);\n const pointXPtr = this.malloc(4);\n const pointYPtr = this.malloc(4);\n this.pdfiumModule.FPDFPathSegment_GetPoint(segmentPtr, pointXPtr, pointYPtr);\n const pointX = this.pdfiumModule.pdfium.getValue(pointXPtr, 'float');\n const pointY = this.pdfiumModule.pdfium.getValue(pointYPtr, 'float');\n this.free(pointXPtr);\n this.free(pointYPtr);\n\n return {\n type: segmentType,\n point: { x: pointX, y: pointY },\n isClosed,\n };\n }\n\n /**\n * Read pdf image object from pdf document\n * @param pageObjectPtr - pointer to pdf image object in page\n * @returns pdf image object\n *\n * @private\n */\n private readImageObject(imageObjectPtr: number): PdfImageObject {\n const bitmapPtr = this.pdfiumModule.FPDFImageObj_GetBitmap(imageObjectPtr);\n const bitmapBufferPtr = this.pdfiumModule.FPDFBitmap_GetBuffer(bitmapPtr);\n const bitmapWidth = this.pdfiumModule.FPDFBitmap_GetWidth(bitmapPtr);\n const bitmapHeight = this.pdfiumModule.FPDFBitmap_GetHeight(bitmapPtr);\n const format = this.pdfiumModule.FPDFBitmap_GetFormat(bitmapPtr) as BitmapFormat;\n\n const pixelCount = bitmapWidth * bitmapHeight;\n const bytesPerPixel = 4;\n const array = new Uint8ClampedArray(pixelCount * bytesPerPixel);\n for (let i = 0; i < pixelCount; i++) {\n switch (format) {\n case BitmapFormat.Bitmap_BGR:\n {\n const blue = this.pdfiumModule.pdfium.getValue(bitmapBufferPtr + i * 3, 'i8');\n const green = this.pdfiumModule.pdfium.getValue(bitmapBufferPtr + i * 3 + 1, 'i8');\n const red = this.pdfiumModule.pdfium.getValue(bitmapBufferPtr + i * 3 + 2, 'i8');\n array[i * bytesPerPixel] = red;\n array[i * bytesPerPixel + 1] = green;\n array[i * bytesPerPixel + 2] = blue;\n array[i * bytesPerPixel + 3] = 100;\n }\n break;\n }\n }\n\n const imageData = new ImageData(array, bitmapWidth, bitmapHeight);\n const matrix = this.readPdfPageObjectTransformMatrix(imageObjectPtr);\n\n return {\n type: PdfPageObjectType.IMAGE,\n imageData,\n matrix,\n };\n }\n\n /**\n * Read form object from pdf document\n * @param formObjectPtr - pointer to pdf form object in page\n * @returns pdf form object\n *\n * @private\n */\n private readFormObject(formObjectPtr: number): PdfFormObject {\n const objectCount = this.pdfiumModule.FPDFFormObj_CountObjects(formObjectPtr);\n const objects: (PdfFormObject | PdfImageObject | PdfPathObject)[] = [];\n for (let i = 0; i < objectCount; i++) {\n const pageObjectPtr = this.pdfiumModule.FPDFFormObj_GetObject(formObjectPtr, i);\n const pageObj = this.readPdfPageObject(pageObjectPtr);\n if (pageObj) {\n objects.push(pageObj);\n }\n }\n const matrix = this.readPdfPageObjectTransformMatrix(formObjectPtr);\n\n return {\n type: PdfPageObjectType.FORM,\n objects,\n matrix,\n };\n }\n\n /**\n * Read pdf object in pdf page\n * @param pageObjectPtr - pointer to pdf object in page\n * @returns pdf object in page\n *\n * @private\n */\n private readPdfPageObjectTransformMatrix(pageObjectPtr: number): PdfTransformMatrix {\n const matrixPtr = this.malloc(4 * 6);\n if (this.pdfiumModule.FPDFPageObj_GetMatrix(pageObjectPtr, matrixPtr)) {\n const a = this.pdfiumModule.pdfium.getValue(matrixPtr, 'float');\n const b = this.pdfiumModule.pdfium.getValue(matrixPtr + 4, 'float');\n const c = this.pdfiumModule.pdfium.getValue(matrixPtr + 8, 'float');\n const d = this.pdfiumModule.pdfium.getValue(matrixPtr + 12, 'float');\n const e = this.pdfiumModule.pdfium.getValue(matrixPtr + 16, 'float');\n const f = this.pdfiumModule.pdfium.getValue(matrixPtr + 20, 'float');\n this.free(matrixPtr);\n\n return { a, b, c, d, e, f };\n }\n\n this.free(matrixPtr);\n\n return { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0 };\n }\n\n /**\n * Return the stroke-width declared in the annotation’s /Border or /BS entry.\n * Falls back to 1 pt when nothing is defined.\n *\n * @param annotationPtr - pointer to pdf annotation\n * @returns stroke-width\n *\n * @private\n */\n private getStrokeWidth(annotationPtr: number): number {\n // FPDFAnnot_GetBorder(annot, &hRadius, &vRadius, &borderWidth)\n const hPtr = this.malloc(4);\n const vPtr = this.malloc(4);\n const wPtr = this.malloc(4);\n\n const ok = this.pdfiumModule.FPDFAnnot_GetBorder(annotationPtr, hPtr, vPtr, wPtr);\n const width = ok ? this.pdfiumModule.pdfium.getValue(wPtr, 'float') : 1; // default 1 pt\n\n this.free(hPtr);\n this.free(vPtr);\n this.free(wPtr);\n\n return width;\n }\n\n /**\n * Fetches the `/F` flag bit-field from an annotation.\n *\n * @param annotationPtr pointer to an `FPDF_ANNOTATION`\n * @returns `{ raw, flags }`\n * • `raw` – the 32-bit integer returned by PDFium\n * • `flags` – object with individual booleans\n */\n private getAnnotationFlags(annotationPtr: number): PdfAnnotationFlagName[] {\n const rawFlags = this.pdfiumModule.FPDFAnnot_GetFlags(annotationPtr); // number\n\n return flagsToNames(rawFlags);\n }\n\n /**\n * Read circle annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf circle annotation\n *\n * @private\n */\n private readPdfCircleAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfCircleAnnoObject {\n const flags = this.getAnnotationFlags(annotationPtr);\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = pdfDateToDate(modifiedRaw);\n const { color, opacity } = this.resolveAnnotationColor(\n annotationPtr,\n PdfAnnotationColorType.InteriorColor,\n );\n const { color: strokeColor } = this.resolveAnnotationColor(annotationPtr);\n let { style: strokeStyle, width: strokeWidth } = this.getBorderStyle(annotationPtr);\n\n let cloudyBorderIntensity: number | undefined;\n let cloudyBorderInset: number[] | undefined;\n if (\n strokeStyle === PdfAnnotationBorderStyle.CLOUDY ||\n strokeStyle === PdfAnnotationBorderStyle.UNKNOWN\n ) {\n const { ok: hasEffect, intensity } = this.getBorderEffect(annotationPtr);\n\n if (hasEffect) {\n cloudyBorderIntensity = intensity;\n strokeStyle = PdfAnnotationBorderStyle.CLOUDY;\n const {\n ok: hasInset,\n left,\n top,\n right,\n bottom,\n } = this.getRectangleDifferences(annotationPtr);\n if (hasInset) cloudyBorderInset = [left, top, right, bottom];\n }\n }\n\n let strokeDashArray: number[] | undefined;\n if (strokeStyle === PdfAnnotationBorderStyle.DASHED) {\n const { ok, pattern } = this.getBorderDashPattern(annotationPtr);\n if (ok) {\n strokeDashArray = pattern;\n }\n }\n\n return {\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.CIRCLE,\n flags,\n color,\n opacity,\n strokeWidth,\n strokeColor,\n strokeStyle,\n rect,\n author,\n modified,\n ...(cloudyBorderIntensity !== undefined && { cloudyBorderIntensity }),\n ...(cloudyBorderInset !== undefined && { cloudyBorderInset }),\n ...(strokeDashArray !== undefined && { strokeDashArray }),\n };\n }\n\n /**\n * Read square annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf square annotation\n *\n * @private\n */\n private readPdfSquareAnno(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n index: number,\n ): PdfSquareAnnoObject {\n const flags = this.getAnnotationFlags(annotationPtr);\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = pdfDateToDate(modifiedRaw);\n const { color, opacity } = this.resolveAnnotationColor(\n annotationPtr,\n PdfAnnotationColorType.InteriorColor,\n );\n const { color: strokeColor } = this.resolveAnnotationColor(annotationPtr);\n let { style: strokeStyle, width: strokeWidth } = this.getBorderStyle(annotationPtr);\n\n let cloudyBorderIntensity: number | undefined;\n let cloudyBorderInset: number[] | undefined;\n if (\n strokeStyle === PdfAnnotationBorderStyle.CLOUDY ||\n strokeStyle === PdfAnnotationBorderStyle.UNKNOWN\n ) {\n const { ok: hasEffect, intensity } = this.getBorderEffect(annotationPtr);\n\n if (hasEffect) {\n cloudyBorderIntensity = intensity;\n strokeStyle = PdfAnnotationBorderStyle.CLOUDY;\n const {\n ok: hasInset,\n left,\n top,\n right,\n bottom,\n } = this.getRectangleDifferences(annotationPtr);\n if (hasInset) cloudyBorderInset = [left, top, right, bottom];\n }\n }\n\n let strokeDashArray: number[] | undefined;\n if (strokeStyle === PdfAnnotationBorderStyle.DASHED) {\n const { ok, pattern } = this.getBorderDashPattern(annotationPtr);\n if (ok) {\n strokeDashArray = pattern;\n }\n }\n\n return {\n pageIndex: page.index,\n id: index,\n type: PdfAnnotationSubtype.SQUARE,\n flags,\n color,\n opacity,\n strokeColor,\n strokeWidth,\n strokeStyle,\n rect,\n author,\n modified,\n ...(cloudyBorderIntensity !== undefined && { cloudyBorderIntensity }),\n ...(cloudyBorderInset !== undefined && { cloudyBorderInset }),\n ...(strokeDashArray !== undefined && { strokeDashArray }),\n };\n }\n\n /**\n * Read basic info of unsupported pdf annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param type - type of annotation\n * @param annotationPtr - pointer to pdf annotation\n * @param index - index of annotation in the pdf page\n * @returns pdf annotation\n *\n * @private\n */\n private readPdfAnno(\n page: PdfPageObject,\n pagePtr: number,\n type: PdfUnsupportedAnnoObject['type'],\n annotationPtr: number,\n index: number,\n ): PdfUnsupportedAnnoObject {\n const pageRect = this.readPageAnnoRect(annotationPtr);\n const rect = this.convertPageRectToDeviceRect(page, pagePtr, pageRect);\n const author = this.getAnnotString(annotationPtr, 'T');\n const modifiedRaw = this.getAnnotString(annotationPtr, 'M');\n const modified = pdfDateToDate(modifiedRaw);\n\n return {\n pageIndex: page.index,\n id: index,\n type,\n rect,\n author,\n modified,\n };\n }\n\n /**\n * Resolve `/IRT` → parent-annotation index on the same page.\n *\n * @param pagePtr - pointer to FPDF_PAGE\n * @param annotationPtr - pointer to FPDF_ANNOTATION\n * @returns index (`0…count-1`) or `undefined` when the annotation is *not* a reply\n *\n * @private\n */\n private getInReplyToId(pagePtr: number, annotationPtr: number): number | undefined {\n const parentPtr = this.pdfiumModule.FPDFAnnot_GetLinkedAnnot(annotationPtr, 'IRT');\n if (!parentPtr) return;\n\n // PDFium ≥ 5100 – returns −1 when annot not found on page\n const idx = this.pdfiumModule.FPDFPage_GetAnnotIndex(pagePtr, parentPtr);\n return idx >= 0 ? idx : undefined;\n }\n\n /**\n * Fetch a string value (`/T`, `/M`, `/State`, …) from an annotation.\n *\n * @returns decoded UTF-8 string or `undefined` when the key is absent\n *\n * @private\n */\n private getAnnotString(annotationPtr: number, key: string): string | undefined {\n const len = this.pdfiumModule.FPDFAnnot_GetStringValue(annotationPtr, key, 0, 0);\n if (len === 0) return;\n\n const bytes = (len + 1) * 2;\n const ptr = this.malloc(bytes);\n\n this.pdfiumModule.FPDFAnnot_GetStringValue(annotationPtr, key, ptr, bytes);\n const value = this.pdfiumModule.pdfium.UTF16ToString(ptr);\n this.free(ptr);\n\n return value || undefined;\n }\n\n /**\n * Set a string value (`/T`, `/M`, `/State`, …) to an annotation.\n *\n * @returns `true` if the operation was successful\n *\n * @private\n */\n private setAnnotString(annotationPtr: number, key: string, value: string): boolean {\n const bytes = 2 * (value.length + 1);\n const ptr = this.malloc(bytes);\n this.pdfiumModule.pdfium.stringToUTF16(value, ptr, bytes);\n const ok = this.pdfiumModule.FPDFAnnot_SetStringValue(annotationPtr, key, ptr);\n this.free(ptr);\n return ok;\n }\n\n /**\n * Read vertices of pdf annotation\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param annotationPtr - pointer to pdf annotation\n * @returns vertices of pdf annotation\n *\n * @private\n */\n private readPdfAnnoVertices(\n page: PdfPageObject,\n pagePtr: number,\n annotationPtr: number,\n ): Position[] {\n const vertices: Position[] = [];\n const count = this.pdfiumModule.FPDFAnnot_GetVertices(annotationPtr, 0, 0);\n const pointMemorySize = 8;\n const pointsPtr = this.malloc(count * pointMemorySize);\n this.pdfiumModule.FPDFAnnot_GetVertices(annotationPtr, pointsPtr, count);\n for (let i = 0; i < count; i++) {\n const pointX = this.pdfiumModule.pdfium.getValue(pointsPtr + i * pointMemorySize, 'float');\n const pointY = this.pdfiumModule.pdfium.getValue(\n pointsPtr + i * pointMemorySize + 4,\n 'float',\n );\n\n const { x, y } = this.convertPagePointToDevicePoint(page, {\n x: pointX,\n y: pointY,\n });\n vertices.push({\n x,\n y,\n });\n }\n this.free(pointsPtr);\n\n return vertices;\n }\n\n /**\n * Read the target of pdf bookmark\n * @param docPtr - pointer to pdf document object\n * @param getActionPtr - callback function to retrive the pointer of action\n * @param getDestinationPtr - callback function to retrive the pointer of destination\n * @returns target of pdf bookmark\n *\n * @private\n */\n private readPdfBookmarkTarget(\n docPtr: number,\n getActionPtr: () => number,\n getDestinationPtr: () => number,\n ): PdfLinkTarget | undefined {\n const actionPtr = getActionPtr();\n if (actionPtr) {\n const action = this.readPdfAction(docPtr, actionPtr);\n\n return {\n type: 'action',\n action,\n };\n } else {\n const destinationPtr = getDestinationPtr();\n if (destinationPtr) {\n const destination = this.readPdfDestination(docPtr, destinationPtr);\n\n return {\n type: 'destination',\n destination,\n };\n }\n }\n }\n\n /**\n * Read field of pdf widget annotation\n * @param formHandle - form handle\n * @param annotationPtr - pointer to pdf annotation\n * @returns field of pdf widget annotation\n *\n * @private\n */\n private readPdfWidgetAnnoField(formHandle: number, annotationPtr: number): PdfWidgetAnnoField {\n const flag = this.pdfiumModule.FPDFAnnot_GetFormFieldFlags(\n formHandle,\n annotationPtr,\n ) as PDF_FORM_FIELD_FLAG;\n\n const type = this.pdfiumModule.FPDFAnnot_GetFormFieldType(\n formHandle,\n annotationPtr,\n ) as PDF_FORM_FIELD_TYPE;\n\n const name = readString(\n this.pdfiumModule.pdfium,\n (buffer: number, bufferLength) => {\n return this.pdfiumModule.FPDFAnnot_GetFormFieldName(\n formHandle,\n annotationPtr,\n buffer,\n bufferLength,\n );\n },\n this.pdfiumModule.pdfium.UTF16ToString,\n );\n\n const alternateName = readString(\n this.pdfiumModule.pdfium,\n (buffer: number, bufferLength) => {\n return this.pdfiumModule.FPDFAnnot_GetFormFieldAlternateName(\n formHandle,\n annotationPtr,\n buffer,\n bufferLength,\n );\n },\n this.pdfiumModule.pdfium.UTF16ToString,\n );\n\n const value = readString(\n this.pdfiumModule.pdfium,\n (buffer: number, bufferLength) => {\n return this.pdfiumModule.FPDFAnnot_GetFormFieldValue(\n formHandle,\n annotationPtr,\n buffer,\n bufferLength,\n );\n },\n this.pdfiumModule.pdfium.UTF16ToString,\n );\n\n const options: PdfWidgetAnnoOption[] = [];\n if (type === PDF_FORM_FIELD_TYPE.COMBOBOX || type === PDF_FORM_FIELD_TYPE.LISTBOX) {\n const count = this.pdfiumModule.FPDFAnnot_GetOptionCount(formHandle, annotationPtr);\n for (let i = 0; i < count; i++) {\n const label = readString(\n this.pdfiumModule.pdfium,\n (buffer: number, bufferLength) => {\n return this.pdfiumModule.FPDFAnnot_GetOptionLabel(\n formHandle,\n annotationPtr,\n i,\n buffer,\n bufferLength,\n );\n },\n this.pdfiumModule.pdfium.UTF16ToString,\n );\n const isSelected = this.pdfiumModule.FPDFAnnot_IsOptionSelected(\n formHandle,\n annotationPtr,\n i,\n );\n options.push({\n label,\n isSelected,\n });\n }\n }\n\n let isChecked = false;\n if (type === PDF_FORM_FIELD_TYPE.CHECKBOX || type === PDF_FORM_FIELD_TYPE.RADIOBUTTON) {\n isChecked = this.pdfiumModule.FPDFAnnot_IsChecked(formHandle, annotationPtr);\n }\n\n return {\n flag,\n type,\n name,\n alternateName,\n value,\n isChecked,\n options,\n };\n }\n\n /**\n * {@inheritDoc @embedpdf/models!PdfEngine.renderAnnotation}\n *\n * @public\n */\n renderAnnotation(\n doc: PdfDocumentObject,\n page: PdfPageObject,\n annotation: PdfAnnotationObject,\n scaleFactor: number,\n rotation: Rotation,\n dpr: number = 1, // device-pixel-ratio (canvas)\n mode: AppearanceMode = AppearanceMode.Normal,\n imageType: ImageConversionTypes = 'image/webp',\n ): PdfTask<T> {\n this.logger.debug(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'renderAnnotation',\n doc,\n page,\n annotation,\n scaleFactor,\n rotation,\n dpr,\n mode,\n imageType,\n );\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `RenderAnnotation`,\n 'Begin',\n `${doc.id}-${page.index}-${annotation.id}`,\n );\n const task = new Task<T, PdfErrorReason>();\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `RenderAnnotation`,\n 'End',\n `${doc.id}-${page.index}-${annotation.id}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: 'document does not open',\n });\n }\n\n /* ── 1. grab native handles ───────────────────────────────────────── */\n const pageCtx = ctx.acquirePage(page.index);\n const annotPtr = this.pdfiumModule.FPDFPage_GetAnnot(pageCtx.pagePtr, annotation.id);\n if (!annotPtr) {\n pageCtx.release();\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `RenderAnnotation`,\n 'End',\n `${doc.id}-${page.index}-${annotation.id}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.NotFound,\n message: 'annotation not found',\n });\n }\n\n const finalScale = scaleFactor * dpr;\n /* ── 2. decide bitmap size (integer pixels) ──────────────────────── */\n const annotRect = annotation.rect;\n const bitmapRect = toIntRect(transformRect(page.size, annotRect, rotation, finalScale));\n\n const format = BitmapFormat.Bitmap_BGRA;\n const bytesPerPixel = 4;\n const bitmapHeapLength = bitmapRect.size.width * bitmapRect.size.height * bytesPerPixel;\n const bitmapHeapPtr = this.malloc(bitmapHeapLength);\n const bitmapPtr = this.pdfiumModule.FPDFBitmap_CreateEx(\n bitmapRect.size.width,\n bitmapRect.size.height,\n format,\n bitmapHeapPtr,\n bitmapRect.size.width * bytesPerPixel,\n );\n this.pdfiumModule.FPDFBitmap_FillRect(\n bitmapPtr,\n 0,\n 0,\n bitmapRect.size.width,\n bitmapRect.size.height,\n 0x00000000,\n );\n\n const matrix = makeMatrix(annotation.rect, rotation, finalScale);\n\n // Allocate memory for the matrix on the wasm heap and write to it\n const matrixSize = 6 * 4;\n const matrixPtr = this.malloc(matrixSize);\n const matrixView = new Float32Array(this.pdfiumModule.pdfium.HEAPF32.buffer, matrixPtr, 6);\n matrixView.set([matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f]);\n\n /* ── 5. call the native helper with the new matrix ───────────────── */\n const FLAGS = RenderFlag.REVERSE_BYTE_ORDER;\n const ok = !!this.pdfiumModule.EPDF_RenderAnnotBitmap(\n bitmapPtr,\n pageCtx.pagePtr,\n annotPtr,\n mode,\n matrixPtr,\n FLAGS,\n );\n\n /* ── 6. tear down native resources ───────────────────────────────── */\n this.free(matrixPtr); // Free the matrix memory\n this.pdfiumModule.FPDFBitmap_Destroy(bitmapPtr);\n this.pdfiumModule.FPDFPage_CloseAnnot(annotPtr);\n pageCtx.release();\n\n if (!ok) {\n this.free(bitmapHeapPtr);\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `RenderAnnotation`,\n 'End',\n `${doc.id}-${page.index}-${annotation.id}`,\n );\n return PdfTaskHelper.reject({\n code: PdfErrorCode.Unknown,\n message: 'EPDF_RenderAnnotBitmap failed',\n });\n }\n\n /* ── 6. copy out + convert to Blob (reuse existing converter) ─────── */\n const data = this.pdfiumModule.pdfium.HEAPU8.subarray(\n bitmapHeapPtr,\n bitmapHeapPtr + bitmapHeapLength,\n );\n\n const imageData: PdfImage = {\n data: new Uint8ClampedArray(data),\n width: bitmapRect.size.width,\n height: bitmapRect.size.height,\n };\n\n this.free(bitmapHeapPtr);\n\n this.logger.perf(\n LOG_SOURCE,\n LOG_CATEGORY,\n `RenderAnnotation`,\n 'End',\n `${doc.id}-${page.index}-${annotation.id}`,\n );\n\n this.imageDataConverter(imageData, imageType)\n .then((blob) => task.resolve(blob))\n .catch((err) => task.reject({ code: PdfErrorCode.Unknown, message: String(err) }));\n\n return task;\n }\n\n /**\n * render rectangle of pdf page to image\n * @param docPtr - pointer to pdf document object\n * @param page - pdf page infor\n * @param rect - rectangle info\n * @param scaleFactor - factor of scalling\n * @param rotation - rotation angle\n * @param options - render options\n * @returns image data\n *\n * @private\n */\n private renderPageRectToImageData(\n ctx: DocumentContext,\n page: PdfPageObject,\n rect: Rect,\n scaleFactor: number,\n rotation: Rotation,\n dpr: number,\n options: PdfRenderOptions,\n ) {\n const format = BitmapFormat.Bitmap_BGRA;\n const bytesPerPixel = 4;\n\n // Round the transformed dimensions to whole pixels\n const rectSize = toIntRect(transformRect(page.size, rect, rotation, scaleFactor * dpr));\n const pageSize = toIntSize(transformSize(page.size, rotation, scaleFactor * dpr));\n\n const bitmapHeapLength = rectSize.size.width * rectSize.size.height * bytesPerPixel;\n const bitmapHeapPtr = this.malloc(bitmapHeapLength);\n const bitmapPtr = this.pdfiumModule.FPDFBitmap_CreateEx(\n rectSize.size.width,\n rectSize.size.height,\n format,\n bitmapHeapPtr,\n rectSize.size.width * bytesPerPixel,\n );\n\n this.pdfiumModule.FPDFBitmap_FillRect(\n bitmapPtr,\n 0,\n 0,\n rectSize.size.width,\n rectSize.size.height,\n 0xffffffff,\n );\n\n let flags = RenderFlag.REVERSE_BYTE_ORDER;\n if (options?.withAnnotations) {\n flags = flags | RenderFlag.ANNOT;\n }\n\n const pageCtx = ctx.acquirePage(page.index);\n\n this.pdfiumModule.FPDF_RenderPageBitmap(\n bitmapPtr,\n pageCtx.pagePtr,\n -rectSize.origin.x,\n -rectSize.origin.y,\n pageSize.width,\n pageSize.height,\n rotation,\n flags,\n );\n\n this.pdfiumModule.FPDFBitmap_Destroy(bitmapPtr);\n pageCtx.release();\n\n const data = this.pdfiumModule.pdfium.HEAPU8.subarray(\n bitmapHeapPtr,\n bitmapHeapPtr + bitmapHeapLength,\n );\n\n const imageData = {\n data: new Uint8ClampedArray(data),\n width: rectSize.size.width,\n height: rectSize.size.height,\n };\n\n this.free(bitmapHeapPtr);\n\n return imageData;\n }\n\n /**\n * Read the target of pdf link annotation\n * @param docPtr - pointer to pdf document object\n * @param getActionPtr - callback function to retrive the pointer of action\n * @param getDestinationPtr - callback function to retrive the pointer of destination\n * @returns target of link\n *\n * @private\n */\n private readPdfLinkAnnoTarget(\n docPtr: number,\n getActionPtr: () => number,\n getDestinationPtr: () => number,\n ): PdfLinkTarget | undefined {\n const destinationPtr = getDestinationPtr();\n if (destinationPtr) {\n const destination = this.readPdfDestination(docPtr, destinationPtr);\n\n return {\n type: 'destination',\n destination,\n };\n } else {\n const actionPtr = getActionPtr();\n if (actionPtr) {\n const action = this.readPdfAction(docPtr, actionPtr);\n\n return {\n type: 'action',\n action,\n };\n }\n }\n }\n\n /**\n * Read pdf action from pdf document\n * @param docPtr - pointer to pdf document object\n * @param actionPtr - pointer to pdf action object\n * @returns pdf action object\n *\n * @private\n */\n private readPdfAction(docPtr: number, actionPtr: number): PdfActionObject {\n const actionType = this.pdfiumModule.FPDFAction_GetType(actionPtr) as PdfActionType;\n let action: PdfActionObject;\n switch (actionType) {\n case PdfActionType.Unsupported:\n action = {\n type: PdfActionType.Unsupported,\n };\n break;\n case PdfActionType.Goto:\n {\n const destinationPtr = this.pdfiumModule.FPDFAction_GetDest(docPtr, actionPtr);\n if (destinationPtr) {\n const destination = this.readPdfDestination(docPtr, destinationPtr);\n\n action = {\n type: PdfActionType.Goto,\n destination,\n };\n } else {\n action = {\n type: PdfActionType.Unsupported,\n };\n }\n }\n break;\n case PdfActionType.RemoteGoto:\n {\n // In case of remote goto action,\n // the application should first use FPDFAction_GetFilePath\n // to get file path, then load that particular document,\n // and use its document handle to call this\n action = {\n type: PdfActionType.Unsupported,\n };\n }\n break;\n case PdfActionType.URI:\n {\n const uri = readString(\n this.pdfiumModule.pdfium,\n (buffer, bufferLength) => {\n return this.pdfiumModule.FPDFAction_GetURIPath(\n docPtr,\n actionPtr,\n buffer,\n bufferLength,\n );\n },\n this.pdfiumModule.pdfium.UTF8ToString,\n );\n\n action = {\n type: PdfActionType.URI,\n uri,\n };\n }\n break;\n case PdfActionType.LaunchAppOrOpenFile:\n {\n const path = readString(\n this.pdfiumModule.pdfium,\n (buffer, bufferLength) => {\n return this.pdfiumModule.FPDFAction_GetFilePath(actionPtr, buffer, bufferLength);\n },\n this.pdfiumModule.pdfium.UTF8ToString,\n );\n action = {\n type: PdfActionType.LaunchAppOrOpenFile,\n path,\n };\n }\n break;\n }\n\n return action;\n }\n\n /**\n * Read pdf destination object\n * @param docPtr - pointer to pdf document object\n * @param destinationPtr - pointer to pdf destination\n * @returns pdf destination object\n *\n * @private\n */\n private readPdfDestination(docPtr: number, destinationPtr: number): PdfDestinationObject {\n const pageIndex = this.pdfiumModule.FPDFDest_GetDestPageIndex(docPtr, destinationPtr);\n // Every params is a float value\n const maxParmamsCount = 4;\n const paramsCountPtr = this.malloc(maxParmamsCount);\n const paramsPtr = this.malloc(maxParmamsCount * 4);\n const zoomMode = this.pdfiumModule.FPDFDest_GetView(\n destinationPtr,\n paramsCountPtr,\n paramsPtr,\n ) as PdfZoomMode;\n const paramsCount = this.pdfiumModule.pdfium.getValue(paramsCountPtr, 'i32');\n const view: number[] = [];\n for (let i = 0; i < paramsCount; i++) {\n const paramPtr = paramsPtr + i * 4;\n view.push(this.pdfiumModule.pdfium.getValue(paramPtr, 'float'));\n }\n this.free(paramsCountPtr);\n this.free(paramsPtr);\n\n if (zoomMode === PdfZoomMode.XYZ) {\n const hasXPtr = this.malloc(1);\n const hasYPtr = this.malloc(1);\n const hasZPtr = this.malloc(1);\n const xPtr = this.malloc(4);\n const yPtr = this.malloc(4);\n const zPtr = this.malloc(4);\n\n const isSucceed = this.pdfiumModule.FPDFDest_GetLocationInPage(\n destinationPtr,\n hasXPtr,\n hasYPtr,\n hasZPtr,\n xPtr,\n yPtr,\n zPtr,\n );\n if (isSucceed) {\n const hasX = this.pdfiumModule.pdfium.getValue(hasXPtr, 'i8');\n const hasY = this.pdfiumModule.pdfium.getValue(hasYPtr, 'i8');\n const hasZ = this.pdfiumModule.pdfium.getValue(hasZPtr, 'i8');\n\n const x = hasX ? this.pdfiumModule.pdfium.getValue(xPtr, 'float') : 0;\n const y = hasY ? this.pdfiumModule.pdfium.getValue(yPtr, 'float') : 0;\n const zoom = hasZ ? this.pdfiumModule.pdfium.getValue(zPtr, 'float') : 0;\n\n this.free(hasXPtr);\n this.free(hasYPtr);\n this.free(hasZPtr);\n this.free(xPtr);\n this.free(yPtr);\n this.free(zPtr);\n\n return {\n pageIndex,\n zoom: {\n mode: zoomMode,\n params: {\n x,\n y,\n zoom,\n },\n },\n view,\n };\n }\n\n this.free(hasXPtr);\n this.free(hasYPtr);\n this.free(hasZPtr);\n this.free(xPtr);\n this.free(yPtr);\n this.free(zPtr);\n\n return {\n pageIndex,\n zoom: {\n mode: zoomMode,\n params: {\n x: 0,\n y: 0,\n zoom: 0,\n },\n },\n view,\n };\n }\n\n return {\n pageIndex,\n zoom: {\n mode: zoomMode,\n },\n view,\n };\n }\n\n /**\n * Read attachmet from pdf document\n * @param docPtr - pointer to pdf document object\n * @param index - index of attachment\n * @returns attachment content\n *\n * @private\n */\n private readPdfAttachment(docPtr: number, index: number): PdfAttachmentObject {\n const attachmentPtr = this.pdfiumModule.FPDFDoc_GetAttachment(docPtr, index);\n const name = readString(\n this.pdfiumModule.pdfium,\n (buffer, bufferLength) => {\n return this.pdfiumModule.FPDFAttachment_GetName(attachmentPtr, buffer, bufferLength);\n },\n this.pdfiumModule.pdfium.UTF16ToString,\n );\n const creationDate = readString(\n this.pdfiumModule.pdfium,\n (buffer, bufferLength) => {\n return this.pdfiumModule.FPDFAttachment_GetStringValue(\n attachmentPtr,\n 'CreationDate',\n buffer,\n bufferLength,\n );\n },\n this.pdfiumModule.pdfium.UTF16ToString,\n );\n const checksum = readString(\n this.pdfiumModule.pdfium,\n (buffer, bufferLength) => {\n return this.pdfiumModule.FPDFAttachment_GetStringValue(\n attachmentPtr,\n 'Checksum',\n buffer,\n bufferLength,\n );\n },\n this.pdfiumModule.pdfium.UTF16ToString,\n );\n\n return {\n index,\n name,\n creationDate,\n checksum,\n };\n }\n\n /**\n * Convert coordinate of point from device coordinate to page coordinate\n * @param page - pdf page infor\n * @param position - position of point\n * @returns converted position\n *\n * @private\n */\n private convertDevicePointToPagePoint(page: PdfPageObject, position: Position): Position {\n const x = position.x;\n const y = page.size.height - position.y;\n\n return { x, y };\n }\n\n /**\n * Convert coordinate of point from page coordinate to device coordinate\n * @param page - pdf page infor\n * @param position - position of point\n * @returns converted position\n *\n * @private\n */\n private convertPagePointToDevicePoint(page: PdfPageObject, position: Position): Position {\n const x = position.x;\n const y = page.size.height - position.y;\n\n return { x, y };\n }\n\n /**\n * Convert coordinate of rectangle from page coordinate to device coordinate\n * @param page - pdf page infor\n * @param pagePtr - pointer to pdf page object\n * @param pageRect - rectangle that needs to be converted\n * @returns converted rectangle\n *\n * @private\n */\n private convertPageRectToDeviceRect(\n page: PdfPageObject,\n pagePtr: number,\n pageRect: {\n left: number;\n top: number;\n right: number;\n bottom: number;\n },\n ): Rect {\n const { x, y } = this.convertPagePointToDevicePoint(page, {\n x: pageRect.left,\n y: pageRect.top,\n });\n const rect = {\n origin: {\n x,\n y,\n },\n size: {\n width: Math.abs(pageRect.right - pageRect.left),\n height: Math.abs(pageRect.top - pageRect.bottom),\n },\n };\n\n return rect;\n }\n\n /**\n * Read the appearance stream of annotation\n * @param annotationPtr - pointer to pdf annotation\n * @param mode - appearance mode\n * @returns appearance stream\n *\n * @private\n */\n private readPageAnnoAppearanceStreams(annotationPtr: number) {\n return {\n normal: this.readPageAnnoAppearanceStream(annotationPtr, AppearanceMode.Normal),\n rollover: this.readPageAnnoAppearanceStream(annotationPtr, AppearanceMode.Rollover),\n down: this.readPageAnnoAppearanceStream(annotationPtr, AppearanceMode.Down),\n };\n }\n\n /**\n * Read the appearance stream of annotation\n * @param annotationPtr - pointer to pdf annotation\n * @param mode - appearance mode\n * @returns appearance stream\n *\n * @private\n */\n private readPageAnnoAppearanceStream(annotationPtr: number, mode = AppearanceMode.Normal) {\n const utf16Length = this.pdfiumModule.FPDFAnnot_GetAP(annotationPtr, mode, 0, 0);\n const bytesCount = (utf16Length + 1) * 2; // include NIL\n const bufferPtr = this.malloc(bytesCount);\n this.pdfiumModule.FPDFAnnot_GetAP(annotationPtr, mode, bufferPtr, bytesCount);\n const ap = this.pdfiumModule.pdfium.UTF16ToString(bufferPtr);\n this.free(bufferPtr);\n\n return ap;\n }\n\n /**\n * Change the visible colour (and opacity) of an existing annotation.\n *\n * For markup annotations (highlight / underline / strikeout / squiggly) we\n * first clear the AP dictionary entry, otherwise the stored appearance stream\n * will override the new tint. For all other sub-types we keep the existing\n * AP so custom artwork isn't lost.\n *\n * @param doc logical document object\n * @param page logical page object\n * @param annotation the annotation we want to recolour\n * @param colour RGBA tuple (0-255 per channel)\n * @param which 0 = stroke/fill colour (PDFium's \"colourType\" param)\n *\n * @returns `true` when the operation succeeded\n */\n public updateAnnotationColor(\n doc: PdfDocumentObject,\n page: PdfPageObject,\n annotation: PdfAnnotationObjectBase,\n color: WebAlphaColor,\n which: number = 0, // 0 → \"colour\" (fill/stroke)\n ): PdfTask<boolean> {\n this.logger.debug(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'setAnnotationColor',\n doc,\n page,\n annotation,\n color,\n which,\n );\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, 'setAnnotationColor', 'Begin', doc.id);\n const task = PdfTaskHelper.create<boolean>();\n\n try {\n /* 1 ── sanity & native handles ────────────────────────────────────────── */\n const ctx = this.cache.getContext(doc.id);\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, 'setAnnotationColor', 'End', doc.id);\n this.logger.warn(LOG_SOURCE, LOG_CATEGORY, 'setAnnotationColor: doc closed');\n task.resolve(false);\n return task;\n }\n\n const pageCtx = ctx.acquirePage(page.index);\n const annotPtr = this.pdfiumModule.FPDFPage_GetAnnot(pageCtx.pagePtr, annotation.id);\n if (!annotPtr) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, 'setAnnotationColor', 'End', doc.id);\n this.logger.warn(LOG_SOURCE, LOG_CATEGORY, 'setAnnotationColor: annot not found');\n pageCtx.release();\n task.resolve(false);\n return task;\n }\n\n const ok = this.setAnnotationColor(annotPtr, color, which);\n\n /* 4 ── regenerate appearance & clean-up ───────────────────────────────── */\n if (ok) {\n this.pdfiumModule.FPDFPage_GenerateContent(pageCtx.pagePtr);\n }\n\n this.pdfiumModule.FPDFPage_CloseAnnot(annotPtr);\n pageCtx.release();\n\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, 'setAnnotationColor', 'End', doc.id);\n task.resolve(!!ok);\n } catch (error) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, 'setAnnotationColor', 'End', doc.id);\n this.logger.error(LOG_SOURCE, LOG_CATEGORY, 'setAnnotationColor: error', error);\n task.reject({\n code: PdfErrorCode.Unknown,\n message: `Failed to set annotation color: ${error instanceof Error ? error.message : String(error)}`,\n });\n }\n\n return task;\n }\n\n /**\n * Set the rect of specified annotation\n * @param page - page info that the annotation is belonged to\n * @param pagePtr - pointer of page object\n * @param annotationPtr - pointer to annotation object\n * @param rect - target rectangle\n * @returns whether the rect is setted\n *\n * @private\n */\n setPageAnnoRect(page: PdfPageObject, pagePtr: number, annotationPtr: number, rect: Rect) {\n const pageXPtr = this.malloc(8);\n const pageYPtr = this.malloc(8);\n if (\n !this.pdfiumModule.FPDF_DeviceToPage(\n pagePtr,\n 0,\n 0,\n page.size.width,\n page.size.height,\n 0,\n rect.origin.x,\n rect.origin.y,\n pageXPtr,\n pageYPtr,\n )\n ) {\n this.free(pageXPtr);\n this.free(pageYPtr);\n return false;\n }\n const pageX = this.pdfiumModule.pdfium.getValue(pageXPtr, 'double');\n const pageY = this.pdfiumModule.pdfium.getValue(pageYPtr, 'double');\n this.free(pageXPtr);\n this.free(pageYPtr);\n\n const pageRectPtr = this.malloc(4 * 4);\n this.pdfiumModule.pdfium.setValue(pageRectPtr, pageX, 'float');\n this.pdfiumModule.pdfium.setValue(pageRectPtr + 4, pageY, 'float');\n this.pdfiumModule.pdfium.setValue(pageRectPtr + 8, pageX + rect.size.width, 'float');\n this.pdfiumModule.pdfium.setValue(pageRectPtr + 12, pageY - rect.size.height, 'float');\n\n if (!this.pdfiumModule.FPDFAnnot_SetRect(annotationPtr, pageRectPtr)) {\n this.free(pageRectPtr);\n return false;\n }\n this.free(pageRectPtr);\n\n return true;\n }\n\n /**\n * Read the rectangle of annotation\n * @param annotationPtr - pointer to pdf annotation\n * @returns rectangle of annotation\n *\n * @private\n */\n private readPageAnnoRect(annotationPtr: number) {\n const pageRectPtr = this.malloc(4 * 4);\n const pageRect = {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n };\n if (this.pdfiumModule.FPDFAnnot_GetRect(annotationPtr, pageRectPtr)) {\n pageRect.left = this.pdfiumModule.pdfium.getValue(pageRectPtr, 'float');\n pageRect.top = this.pdfiumModule.pdfium.getValue(pageRectPtr + 4, 'float');\n pageRect.right = this.pdfiumModule.pdfium.getValue(pageRectPtr + 8, 'float');\n pageRect.bottom = this.pdfiumModule.pdfium.getValue(pageRectPtr + 12, 'float');\n }\n this.free(pageRectPtr);\n\n return pageRect;\n }\n\n /**\n * Get highlight rects for a specific character range (for search highlighting)\n * @param page - pdf page info\n * @param pagePtr - pointer to pdf page\n * @param textPagePtr - pointer to pdf text page\n * @param startIndex - starting character index\n * @param charCount - number of characters in the range\n * @returns array of rectangles for highlighting the specified character range\n *\n * @private\n */\n private getHighlightRects(\n page: PdfPageObject,\n pagePtr: number,\n textPagePtr: number,\n startIndex: number,\n charCount: number,\n ): Rect[] {\n const rectsCount = this.pdfiumModule.FPDFText_CountRects(textPagePtr, startIndex, charCount);\n\n const highlightRects: Rect[] = [];\n for (let i = 0; i < rectsCount; i++) {\n const topPtr = this.malloc(8);\n const leftPtr = this.malloc(8);\n const rightPtr = this.malloc(8);\n const bottomPtr = this.malloc(8);\n const isSucceed = this.pdfiumModule.FPDFText_GetRect(\n textPagePtr,\n i,\n leftPtr,\n topPtr,\n rightPtr,\n bottomPtr,\n );\n if (!isSucceed) {\n this.free(leftPtr);\n this.free(topPtr);\n this.free(rightPtr);\n this.free(bottomPtr);\n continue;\n }\n\n const left = this.pdfiumModule.pdfium.getValue(leftPtr, 'double');\n const top = this.pdfiumModule.pdfium.getValue(topPtr, 'double');\n const right = this.pdfiumModule.pdfium.getValue(rightPtr, 'double');\n const bottom = this.pdfiumModule.pdfium.getValue(bottomPtr, 'double');\n\n this.free(leftPtr);\n this.free(topPtr);\n this.free(rightPtr);\n this.free(bottomPtr);\n\n const deviceXPtr = this.malloc(4);\n const deviceYPtr = this.malloc(4);\n this.pdfiumModule.FPDF_PageToDevice(\n pagePtr,\n 0,\n 0,\n page.size.width,\n page.size.height,\n 0,\n left,\n top,\n deviceXPtr,\n deviceYPtr,\n );\n const x = this.pdfiumModule.pdfium.getValue(deviceXPtr, 'i32');\n const y = this.pdfiumModule.pdfium.getValue(deviceYPtr, 'i32');\n this.free(deviceXPtr);\n this.free(deviceYPtr);\n\n // Convert the bottom-right coordinates to width/height\n const width = Math.ceil(Math.abs(right - left));\n const height = Math.ceil(Math.abs(top - bottom));\n\n highlightRects.push({\n origin: { x, y },\n size: { width, height },\n });\n }\n\n return highlightRects;\n }\n\n /**\n * Search for a keyword across all pages in the document\n * Returns all search results throughout the entire document\n *\n * @param doc - Pdf document object\n * @param keyword - Search keyword\n * @param flags - Match flags for search\n * @returns Promise of all search results in the document\n *\n * @public\n */\n searchAllPages(doc: PdfDocumentObject, keyword: string, flags: MatchFlag[] = []) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'searchAllPages', doc, keyword, flags);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `SearchAllPages`, 'Begin', doc.id);\n\n const ctx = this.cache.getContext(doc.id);\n\n if (!ctx) {\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `SearchAllPages`, 'End', doc.id);\n return PdfTaskHelper.resolve<SearchAllPagesResult>({ results: [], total: 0 });\n }\n\n const length = 2 * (keyword.length + 1);\n const keywordPtr = this.malloc(length);\n this.pdfiumModule.pdfium.stringToUTF16(keyword, keywordPtr, length);\n\n const flag = flags.reduce((flag: MatchFlag, currFlag: MatchFlag) => {\n return flag | currFlag;\n }, MatchFlag.None);\n\n const results: SearchResult[] = [];\n\n // Search through all pages\n const searchAllPagesTask = PdfTaskHelper.create<SearchAllPagesResult>();\n\n // Execute search in a separate function to avoid issues with resolve parameter\n const executeSearch = async () => {\n for (let pageIndex = 0; pageIndex < doc.pageCount; pageIndex++) {\n // Get all results for the current page efficiently (load page only once)\n const pageResults = this.searchAllInPage(ctx, doc.pages[pageIndex], keywordPtr, flag);\n\n results.push(...pageResults);\n }\n\n this.free(keywordPtr);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `SearchAllPages`, 'End', doc.id);\n\n searchAllPagesTask.resolve({\n results,\n total: results.length,\n });\n };\n\n // Start the search process\n executeSearch().catch((error) => {\n this.free(keywordPtr);\n this.logger.perf(LOG_SOURCE, LOG_CATEGORY, `SearchAllPages`, 'End', doc.id);\n searchAllPagesTask.reject({\n code: PdfErrorCode.Unknown,\n message: `Error searching document: ${error}`,\n });\n });\n\n return searchAllPagesTask;\n }\n\n /**\n * Extract word-aligned context for a search hit.\n *\n * @param fullText full UTF-16 page text (fetch this once per page!)\n * @param start index of 1st char that matched\n * @param count number of chars in the match\n * @param windowChars minimum context chars to keep left & right\n */\n private buildContext(\n fullText: string,\n start: number,\n count: number,\n windowChars = 30,\n ): TextContext {\n const WORD_BREAK = /[\\s\\u00A0.,;:!?()\\[\\]{}<>/\\\\\\-\"'`\"”\\u2013\\u2014]/;\n\n // Find the start of a word moving left\n const findWordStart = (index: number): number => {\n while (index > 0 && !WORD_BREAK.test(fullText[index - 1])) index--;\n return index;\n };\n\n // Find the end of a word moving right\n const findWordEnd = (index: number): number => {\n while (index < fullText.length && !WORD_BREAK.test(fullText[index])) index++;\n return index;\n };\n\n // Move left to build context\n let left = start;\n while (left > 0 && WORD_BREAK.test(fullText[left - 1])) left--; // Skip blanks\n let collected = 0;\n while (left > 0 && collected < windowChars) {\n left--;\n if (!WORD_BREAK.test(fullText[left])) collected++;\n }\n left = findWordStart(left);\n\n // Move right to build context\n let right = start + count;\n while (right < fullText.length && WORD_BREAK.test(fullText[right])) right++; // Skip blanks\n collected = 0;\n while (right < fullText.length && collected < windowChars) {\n if (!WORD_BREAK.test(fullText[right])) collected++;\n right++;\n }\n right = findWordEnd(right);\n\n // Compose the context\n const before = fullText.slice(left, start).replace(/\\s+/g, ' ').trimStart();\n const match = fullText.slice(start, start + count);\n const after = fullText\n .slice(start + count, right)\n .replace(/\\s+/g, ' ')\n .trimEnd();\n\n return {\n before: this.tidy(before),\n match: this.tidy(match),\n after: this.tidy(after),\n truncatedLeft: left > 0,\n truncatedRight: right < fullText.length,\n };\n }\n\n /**\n * Tidy the text to remove any non-printable characters and whitespace\n * @param s - text to tidy\n * @returns tidied text\n *\n * @private\n */\n private tidy(s: string): string {\n return (\n s\n /* 1️⃣ join words split by hyphen + U+FFFE + whitespace */\n .replace(/-\\uFFFE\\s*/g, '')\n\n /* 2️⃣ drop any remaining U+FFFE, soft-hyphen, zero-width chars */\n .replace(/[\\uFFFE\\u00AD\\u200B\\u2060\\uFEFF]/g, '')\n\n /* 3️⃣ collapse whitespace so we stay on one line */\n .replace(/\\s+/g, ' ')\n );\n }\n\n /**\n * Search for all occurrences of a keyword on a single page\n * This method efficiently loads the page only once and finds all matches\n *\n * @param docPtr - pointer to pdf document\n * @param page - pdf page object\n * @param pageIndex - index of the page\n * @param keywordPtr - pointer to the search keyword\n * @param flag - search flags\n * @returns array of search results on this page\n *\n * @private\n */\n private searchAllInPage(\n ctx: DocumentContext,\n page: PdfPageObject,\n keywordPtr: number,\n flag: number,\n ): SearchResult[] {\n const pageIndex = page.index;\n // Load the page and text page only once\n const pageCtx = ctx.acquirePage(pageIndex);\n const textPagePtr = pageCtx.getTextPage();\n\n // Load the full text of the page once\n const total = this.pdfiumModule.FPDFText_CountChars(textPagePtr);\n const bufPtr = this.malloc(2 * (total + 1));\n this.pdfiumModule.FPDFText_GetText(textPagePtr, 0, total, bufPtr);\n const fullText = this.pdfiumModule.pdfium.UTF16ToString(bufPtr);\n this.free(bufPtr);\n\n const pageResults: SearchResult[] = [];\n\n // Initialize search handle once for the page\n const searchHandle = this.pdfiumModule.FPDFText_FindStart(\n textPagePtr,\n keywordPtr,\n flag,\n 0, // Start from the beginning of the page\n );\n\n // Call FindNext repeatedly to get all matches on the page\n while (this.pdfiumModule.FPDFText_FindNext(searchHandle)) {\n const charIndex = this.pdfiumModule.FPDFText_GetSchResultIndex(searchHandle);\n const charCount = this.pdfiumModule.FPDFText_GetSchCount(searchHandle);\n\n const rects = this.getHighlightRects(\n page,\n pageCtx.pagePtr,\n textPagePtr,\n charIndex,\n charCount,\n );\n\n const context = this.buildContext(fullText, charIndex, charCount);\n\n pageResults.push({\n pageIndex,\n charIndex,\n charCount,\n rects,\n context,\n });\n }\n\n // Close the search handle only once after finding all results\n this.pdfiumModule.FPDFText_FindClose(searchHandle);\n\n // Close the text page and page only once\n pageCtx.release();\n\n return pageResults;\n }\n}\n","import {\n Logger,\n NoopLogger,\n PdfEngine,\n PdfEngineError,\n PdfEngineMethodArgs,\n PdfEngineMethodName,\n PdfEngineMethodReturnType,\n PdfErrorCode,\n TaskReturn,\n} from '@embedpdf/models';\n\n/**\n * Request body that represent method calls of PdfEngine, it contains the\n * method name and arguments\n */\nexport type PdfEngineMethodRequestBody = {\n [P in PdfEngineMethodName]: {\n name: P;\n args: PdfEngineMethodArgs<P>;\n };\n}[PdfEngineMethodName];\n\n/**\n * Response body that represent return value of PdfEngine\n */\nexport type PdfEngineMethodResponseBody = {\n [P in PdfEngineMethodName]: TaskReturn<PdfEngineMethodReturnType<P>>;\n}[PdfEngineMethodName];\n\n/**\n * Request that abort the specified task\n */\nexport interface AbortRequest {\n /**\n * message id\n */\n id: string;\n /**\n * request type\n */\n type: 'AbortRequest';\n}\n/**\n * Request that execute pdf engine method\n */\nexport interface ExecuteRequest {\n /**\n * message id\n */\n id: string;\n /**\n * request type\n */\n type: 'ExecuteRequest';\n /**\n * request body\n */\n data: PdfEngineMethodRequestBody;\n}\n/**\n * Response that execute pdf engine method\n */\nexport interface ExecuteResponse {\n /**\n * message id\n */\n id: string;\n /**\n * response type\n */\n type: 'ExecuteResponse';\n /**\n * response body\n */\n data: PdfEngineMethodResponseBody;\n}\n\n/**\n * Response that indicate engine is ready\n */\nexport interface ReadyResponse {\n /**\n * message id\n */\n id: string;\n /**\n * response type\n */\n type: 'ReadyResponse';\n}\n\n/**\n * Request type\n */\nexport type Request = ExecuteRequest | AbortRequest;\n/**\n * Response type\n */\nexport type Response = ExecuteResponse | ReadyResponse;\n\nconst LOG_SOURCE = 'WebWorkerEngineRunner';\nconst LOG_CATEGORY = 'Engine';\n\n/**\n * Pdf engine runner, it will execute pdf engine based on the request it received and\n * send back the response with post message\n */\nexport class EngineRunner {\n engine: PdfEngine | undefined;\n\n /**\n * Create instance of EngineRunnder\n * @param logger - logger instance\n */\n constructor(public logger: Logger = new NoopLogger()) {}\n\n /**\n * Listening on post message\n */\n listen() {\n self.onmessage = (evt: MessageEvent<Request>) => {\n return this.handle(evt);\n };\n }\n\n /**\n * Handle post message\n */\n handle(evt: MessageEvent<Request>) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'webworker receive message event: ', evt.data);\n try {\n const request = evt.data as Request;\n switch (request.type) {\n case 'ExecuteRequest':\n this.execute(request);\n break;\n }\n } catch (e) {\n this.logger.info(\n LOG_SOURCE,\n LOG_CATEGORY,\n 'webworker met error when processing message event:',\n e,\n );\n }\n }\n\n /**\n * Send the ready response when pdf engine is ready\n * @returns\n *\n * @protected\n */\n ready() {\n this.listen();\n\n this.respond({\n id: '0',\n type: 'ReadyResponse',\n });\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'runner is ready');\n }\n\n /**\n * Execute the request\n * @param request - request that represent the pdf engine call\n * @returns\n *\n * @protected\n */\n execute = (request: ExecuteRequest) => {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'runner start exeucte request');\n if (!this.engine) {\n const error: PdfEngineError = {\n type: 'reject',\n reason: {\n code: PdfErrorCode.NotReady,\n message: 'engine has not started yet',\n },\n };\n const response: ExecuteResponse = {\n id: request.id,\n type: 'ExecuteResponse',\n data: {\n type: 'error',\n value: error,\n },\n };\n this.respond(response);\n return;\n }\n\n const engine = this.engine;\n const { name, args } = request.data;\n if (!engine[name]) {\n const error: PdfEngineError = {\n type: 'reject',\n reason: {\n code: PdfErrorCode.NotSupport,\n message: `engine method ${name} is not supported yet`,\n },\n };\n const response: ExecuteResponse = {\n id: request.id,\n type: 'ExecuteResponse',\n data: {\n type: 'error',\n value: error,\n },\n };\n this.respond(response);\n return;\n }\n\n let task: PdfEngineMethodReturnType<typeof name>;\n switch (name) {\n case 'isSupport':\n task = this.engine[name]!(...args);\n break;\n case 'initialize':\n task = this.engine[name]!(...args);\n break;\n case 'destroy':\n task = this.engine[name]!(...args);\n break;\n case 'openDocumentUrl':\n task = this.engine[name]!(...args);\n break;\n case 'openDocumentFromBuffer':\n task = this.engine[name]!(...args);\n break;\n case 'openDocumentFromLoader':\n task = this.engine[name]!(...args);\n break;\n case 'getDocPermissions':\n task = this.engine[name]!(...args);\n break;\n case 'getDocUserPermissions':\n task = this.engine[name]!(...args);\n break;\n case 'getMetadata':\n task = this.engine[name]!(...args);\n break;\n case 'getBookmarks':\n task = this.engine[name]!(...args);\n break;\n case 'getSignatures':\n task = this.engine[name]!(...args);\n break;\n case 'renderPage':\n task = this.engine[name]!(...args);\n break;\n case 'renderPageRect':\n task = this.engine[name]!(...args);\n break;\n case 'renderAnnotation':\n task = this.engine[name]!(...args);\n break;\n case 'renderThumbnail':\n task = this.engine[name]!(...args);\n break;\n case 'getAllAnnotations':\n task = this.engine[name]!(...args);\n break;\n case 'getPageAnnotations':\n task = this.engine[name]!(...args);\n break;\n case 'createPageAnnotation':\n task = this.engine[name]!(...args);\n break;\n case 'updatePageAnnotation':\n task = this.engine[name]!(...args);\n break;\n case 'removePageAnnotation':\n task = this.engine[name]!(...args);\n break;\n case 'updateAnnotationColor':\n task = this.engine[name]!(...args);\n break;\n case 'getPageTextRects':\n task = this.engine[name]!(...args);\n break;\n case 'searchAllPages':\n task = this.engine[name]!(...args);\n break;\n case 'closeDocument':\n task = this.engine[name]!(...args);\n break;\n case 'saveAsCopy':\n task = this.engine[name]!(...args);\n break;\n case 'getAttachments':\n task = this.engine[name]!(...args);\n break;\n case 'readAttachmentContent':\n task = this.engine[name]!(...args);\n break;\n case 'setFormFieldValue':\n task = this.engine[name]!(...args);\n break;\n case 'flattenPage':\n task = this.engine[name]!(...args);\n break;\n case 'extractPages':\n task = this.engine[name]!(...args);\n break;\n case 'extractText':\n task = this.engine[name]!(...args);\n break;\n case 'getTextSlices':\n task = this.engine[name]!(...args);\n break;\n case 'getPageGlyphs':\n task = this.engine[name]!(...args);\n break;\n case 'getPageGeometry':\n task = this.engine[name]!(...args);\n break;\n case 'merge':\n task = this.engine[name]!(...args);\n break;\n case 'mergePages':\n task = this.engine[name]!(...args);\n break;\n }\n\n task.wait(\n (result) => {\n const response: ExecuteResponse = {\n id: request.id,\n type: 'ExecuteResponse',\n data: {\n type: 'result',\n value: result,\n },\n };\n this.respond(response);\n },\n (error) => {\n const response: ExecuteResponse = {\n id: request.id,\n type: 'ExecuteResponse',\n data: {\n type: 'error',\n value: error,\n },\n };\n this.respond(response);\n },\n );\n };\n\n /**\n * Send back the response\n * @param response - response that needs sent back\n *\n * @protected\n */\n respond(response: Response) {\n this.logger.debug(LOG_SOURCE, LOG_CATEGORY, 'runner respond: ', response);\n self.postMessage(response);\n }\n}\n","import { init } from '@embedpdf/pdfium';\nimport { EngineRunner } from '../webworker/runner';\nimport { PdfiumEngine } from './engine';\n\n/**\n * EngineRunner for pdfium-based wasm engine\n */\nexport class PdfiumEngineRunner extends EngineRunner {\n /**\n * Create an instance of PdfiumEngineRunner\n * @param wasmBinary - wasm binary that contains the pdfium wasm file\n */\n constructor(private wasmBinary: ArrayBuffer) {\n super();\n }\n\n /**\n * Initialize runner\n */\n async prepare() {\n const wasmBinary = this.wasmBinary;\n const wasmModule = await init({ wasmBinary });\n this.engine = new PdfiumEngine(wasmModule);\n this.ready();\n }\n}\n"],"names":["BitmapFormat","RenderFlag","LOG_SOURCE","LOG_CATEGORY","PdfiumErrorCode","NoopLogger","PdfTaskHelper","PdfErrorCode","Rotation","Task","PdfAnnotationSubtype","stripPdfUnwantedMarkers","PdfAnnotationBorderStyle","dateToPdfDate","PdfAnnotationColorType","PdfPageObjectType","pdfAlphaColorToWebAlphaColor","webAlphaColorToPdfAlphaColor","quadToRect","rectToQuad","pdfDateToDate","flagsToNames","PDF_FORM_FIELD_TYPE","AppearanceMode","toIntRect","transformRect","makeMatrix","toIntSize","transformSize","PdfActionType","PdfZoomMode","MatchFlag","init"],"mappings":";;;;;AAEA;;;;;;;;;AASG;AACG,SAAU,UAAU,CACxB,UAA+C,EAC/C,SAA2D,EAC3D,UAAsC,EACtC,aAAA,GAAwB,GAAG,EAAA;IAE3B,IAAI,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;AAC1D,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,EAAE,CAAC,EAAE,EAAE;QACtC,UAAU,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;KAClC;IACD,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AACtD,IAAA,IAAI,GAAW,CAAC;AAChB,IAAA,IAAI,YAAY,GAAG,aAAa,EAAE;AAChC,QAAA,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpC,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AACrD,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,EAAE,CAAC,EAAE,EAAE;YACrC,UAAU,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;SAClC;AACD,QAAA,SAAS,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AAChC,QAAA,GAAG,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;KAC1B;SAAM;AACL,QAAA,GAAG,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;KAC1B;AACD,IAAA,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAEpC,IAAA,OAAO,GAAG,CAAC;AACb,CAAC;AACD;;;;;;;AAOG;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