@embedpdf/engines 1.0.11 → 1.0.13

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.
Files changed (104) hide show
  1. package/dist/engine-B0ZTENqz.js +5441 -0
  2. package/dist/engine-B0ZTENqz.js.map +1 -0
  3. package/dist/engine-BB5n-Wej.cjs +2 -0
  4. package/dist/engine-BB5n-Wej.cjs.map +1 -0
  5. package/dist/index.cjs +1 -5846
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.ts +1 -1613
  8. package/dist/index.js +339 -5824
  9. package/dist/index.js.map +1 -1
  10. package/dist/lib/converters/index.cjs +2 -0
  11. package/dist/lib/converters/index.cjs.map +1 -0
  12. package/dist/{converters.d.ts → lib/converters/index.d.ts} +7 -10
  13. package/dist/lib/converters/index.js +80 -0
  14. package/dist/{converters.cjs.map → lib/converters/index.js.map} +1 -1
  15. package/dist/lib/index.d.ts +7 -0
  16. package/dist/lib/mock/index.d.ts +25 -0
  17. package/dist/lib/pdfium/cache.d.ts +62 -0
  18. package/dist/{pdfium.d.ts → lib/pdfium/engine.d.ts} +124 -178
  19. package/dist/lib/pdfium/helper.d.ts +21 -0
  20. package/dist/lib/pdfium/index.cjs +2 -0
  21. package/dist/lib/pdfium/index.cjs.map +1 -0
  22. package/dist/lib/pdfium/index.d.ts +3 -0
  23. package/dist/lib/pdfium/index.js +13 -0
  24. package/dist/lib/pdfium/index.js.map +1 -0
  25. package/dist/lib/pdfium/runner.d.ts +16 -0
  26. package/dist/lib/pdfium/web/direct-engine.cjs +2 -0
  27. package/dist/lib/pdfium/web/direct-engine.cjs.map +1 -0
  28. package/dist/lib/pdfium/web/direct-engine.d.ts +3 -0
  29. package/dist/lib/pdfium/web/direct-engine.js +12 -0
  30. package/dist/lib/pdfium/web/direct-engine.js.map +1 -0
  31. package/dist/lib/pdfium/web/worker-engine.cjs +2 -0
  32. package/dist/lib/pdfium/web/worker-engine.cjs.map +1 -0
  33. package/dist/lib/pdfium/web/worker-engine.d.ts +7 -0
  34. package/dist/lib/pdfium/web/worker-engine.js +15 -0
  35. package/dist/lib/pdfium/web/worker-engine.js.map +1 -0
  36. package/dist/lib/pdfium/worker.d.ts +1 -0
  37. package/dist/lib/pdfium-engine.d.ts +1 -0
  38. package/dist/lib/webworker/engine.cjs +2 -0
  39. package/dist/lib/webworker/engine.cjs.map +1 -0
  40. package/dist/{worker.d.ts → lib/webworker/engine.d.ts} +4 -34
  41. package/dist/lib/webworker/engine.js +887 -0
  42. package/dist/lib/webworker/engine.js.map +1 -0
  43. package/dist/lib/webworker/index.d.ts +2 -0
  44. package/dist/lib/webworker/runner.d.ts +128 -0
  45. package/dist/lib/webworker-engine.d.ts +1 -0
  46. package/dist/preact/adapter.d.ts +1 -0
  47. package/dist/preact/index.cjs +2 -0
  48. package/dist/preact/index.cjs.map +1 -0
  49. package/dist/preact/index.d.ts +1 -0
  50. package/dist/preact/index.js +37 -0
  51. package/dist/preact/index.js.map +1 -0
  52. package/dist/react/adapter.d.ts +1 -0
  53. package/dist/react/index.cjs +2 -0
  54. package/dist/react/index.cjs.map +1 -0
  55. package/dist/react/index.d.ts +1 -0
  56. package/dist/react/index.js +37 -0
  57. package/dist/react/index.js.map +1 -0
  58. package/dist/runner-B-s0R7NN.js +269 -0
  59. package/dist/runner-B-s0R7NN.js.map +1 -0
  60. package/dist/runner-BBBtCHic.cjs +2 -0
  61. package/dist/runner-BBBtCHic.cjs.map +1 -0
  62. package/dist/shared-preact/hooks/index.d.ts +1 -0
  63. package/dist/{preact.d.ts → shared-preact/hooks/use-pdfium-engine.d.ts} +3 -5
  64. package/dist/shared-preact/index.d.ts +1 -0
  65. package/dist/shared-react/hooks/index.d.ts +1 -0
  66. package/dist/{react.d.ts → shared-react/hooks/use-pdfium-engine.d.ts} +3 -5
  67. package/dist/shared-react/index.d.ts +1 -0
  68. package/dist/vue/hooks/index.d.ts +1 -0
  69. package/dist/vue/hooks/use-pdfium-engine.d.ts +18 -0
  70. package/dist/vue/index.cjs +2 -0
  71. package/dist/vue/index.cjs.map +1 -0
  72. package/dist/vue/index.d.ts +1 -0
  73. package/dist/vue/index.js +39 -0
  74. package/dist/vue/index.js.map +1 -0
  75. package/package.json +41 -41
  76. package/dist/converters.cjs +0 -139
  77. package/dist/converters.js +0 -133
  78. package/dist/converters.js.map +0 -1
  79. package/dist/pdfium-direct-engine.cjs +0 -4400
  80. package/dist/pdfium-direct-engine.cjs.map +0 -1
  81. package/dist/pdfium-direct-engine.d.ts +0 -1091
  82. package/dist/pdfium-direct-engine.js +0 -4398
  83. package/dist/pdfium-direct-engine.js.map +0 -1
  84. package/dist/pdfium-worker-engine.cjs +0 -851
  85. package/dist/pdfium-worker-engine.cjs.map +0 -1
  86. package/dist/pdfium-worker-engine.d.ts +0 -314
  87. package/dist/pdfium-worker-engine.js +0 -849
  88. package/dist/pdfium-worker-engine.js.map +0 -1
  89. package/dist/pdfium.cjs +0 -4667
  90. package/dist/pdfium.cjs.map +0 -1
  91. package/dist/pdfium.js +0 -4661
  92. package/dist/pdfium.js.map +0 -1
  93. package/dist/preact.cjs +0 -41
  94. package/dist/preact.cjs.map +0 -1
  95. package/dist/preact.js +0 -39
  96. package/dist/preact.js.map +0 -1
  97. package/dist/react.cjs +0 -41
  98. package/dist/react.cjs.map +0 -1
  99. package/dist/react.js +0 -39
  100. package/dist/react.js.map +0 -1
  101. package/dist/worker.cjs +0 -839
  102. package/dist/worker.cjs.map +0 -1
  103. package/dist/worker.js +0 -836
  104. package/dist/worker.js.map +0 -1
@@ -1,1091 +0,0 @@
1
- import { PdfEngine, Logger, Task, PdfErrorReason, PdfFileUrl, PdfUrlOptions, PdfDocumentObject, PdfFile, PdfFileLoader, PdfSignatureObject, PdfBookmarkObject, PdfPageObject, Rotation, PdfRenderOptions, ImageConversionTypes, PdfTask, Rect, PdfAnnotationObject, PdfTextRectObject, PdfAttachmentObject, PdfWidgetAnnoObject, FormFieldValue, PdfPageFlattenFlag, PdfPageFlattenResult, PageTextSlice, PdfInkAnnoObject, PdfHighlightAnnoObject, PdfUnderlineAnnoObject, PdfStrikeOutAnnoObject, PdfSquigglyAnnoObject, PdfStampAnnoObjectContents, Position, PdfPageGeometry, PdfGlyphObject, AppearanceMode, PdfAnnotationObjectBase, WebAlphaColor, MatchFlag, SearchAllPagesResult, PdfImage } from '@embedpdf/models';
2
- import { WrappedPdfiumModule } from '@embedpdf/pdfium';
3
-
4
- /**
5
- * Function type for converting ImageData to Blob
6
- * In browser: uses OffscreenCanvas
7
- * In Node.js: can use Sharp or other image processing libraries
8
- */
9
- type ImageDataConverter<T = Blob> = (imageData: PdfImage, imageType?: ImageConversionTypes) => Promise<T>;
10
- /**
11
- * Pdf engine that based on pdfium wasm
12
- */
13
- declare class PdfiumEngine<T = Blob> implements PdfEngine<T> {
14
- private pdfiumModule;
15
- private logger;
16
- private imageDataConverter;
17
- /**
18
- * pdf documents that opened
19
- */
20
- private readonly cache;
21
- /**
22
- * Create an instance of PdfiumEngine
23
- * @param wasmModule - pdfium wasm module
24
- * @param logger - logger instance
25
- * @param imageDataToBlobConverter - function to convert ImageData to Blob
26
- */
27
- constructor(pdfiumModule: WrappedPdfiumModule, logger?: Logger, imageDataConverter?: ImageDataConverter<T>);
28
- /**
29
- * {@inheritDoc @embedpdf/models!PdfEngine.initialize}
30
- *
31
- * @public
32
- */
33
- initialize(): Task<boolean, PdfErrorReason>;
34
- /**
35
- * {@inheritDoc @embedpdf/models!PdfEngine.destroy}
36
- *
37
- * @public
38
- */
39
- destroy(): Task<boolean, PdfErrorReason>;
40
- /**
41
- * {@inheritDoc @embedpdf/models!PdfEngine.openDocumentUrl}
42
- *
43
- * @public
44
- */
45
- openDocumentUrl(file: PdfFileUrl, options?: PdfUrlOptions): Task<PdfDocumentObject, PdfErrorReason>;
46
- /**
47
- * Check if the server supports range requests:
48
- * Sends a HEAD request and sees if 'Accept-Ranges: bytes'.
49
- */
50
- private checkRangeSupport;
51
- /**
52
- * Fully fetch the file (using fetch) into an ArrayBuffer,
53
- * then call openDocumentFromBuffer.
54
- */
55
- private fetchFullAndOpen;
56
- /**
57
- * Use your synchronous partial-loading approach:
58
- * - In your snippet, it's done via `openDocumentFromLoader`.
59
- * - We'll do a synchronous XHR read callback that pulls
60
- * the desired byte ranges.
61
- */
62
- private openDocumentWithRangeRequest;
63
- /**
64
- * Helper to do a HEAD request or partial GET to find file length.
65
- */
66
- private retrieveFileLength;
67
- /**
68
- * Convert response text (x-user-defined) to a Uint8Array
69
- * for partial data.
70
- */
71
- private convertResponseToUint8Array;
72
- /**
73
- * {@inheritDoc @embedpdf/models!PdfEngine.openDocument}
74
- *
75
- * @public
76
- */
77
- openDocumentFromBuffer(file: PdfFile, password?: string): Task<PdfDocumentObject, PdfErrorReason>;
78
- /**
79
- * {@inheritDoc @embedpdf/models!PdfEngine.openDocumentFromLoader}
80
- *
81
- * @public
82
- */
83
- openDocumentFromLoader(fileLoader: PdfFileLoader, password?: string): Task<PdfDocumentObject, PdfErrorReason>;
84
- /**
85
- * {@inheritDoc @embedpdf/models!PdfEngine.getMetadata}
86
- *
87
- * @public
88
- */
89
- getMetadata(doc: PdfDocumentObject): Task<any, PdfErrorReason> | Task<{
90
- title: string;
91
- author: string;
92
- subject: string;
93
- keywords: string;
94
- producer: string;
95
- creator: string;
96
- creationDate: string;
97
- modificationDate: string;
98
- }, PdfErrorReason>;
99
- /**
100
- * {@inheritDoc @embedpdf/models!PdfEngine.getDocPermissions}
101
- *
102
- * @public
103
- */
104
- getDocPermissions(doc: PdfDocumentObject): Task<any, PdfErrorReason> | Task<number, PdfErrorReason>;
105
- /**
106
- * {@inheritDoc @embedpdf/models!PdfEngine.getDocUserPermissions}
107
- *
108
- * @public
109
- */
110
- getDocUserPermissions(doc: PdfDocumentObject): Task<any, PdfErrorReason> | Task<number, PdfErrorReason>;
111
- /**
112
- * {@inheritDoc @embedpdf/models!PdfEngine.getSignatures}
113
- *
114
- * @public
115
- */
116
- getSignatures(doc: PdfDocumentObject): Task<any, PdfErrorReason> | Task<PdfSignatureObject[], PdfErrorReason>;
117
- /**
118
- * {@inheritDoc @embedpdf/models!PdfEngine.getBookmarks}
119
- *
120
- * @public
121
- */
122
- getBookmarks(doc: PdfDocumentObject): Task<any, PdfErrorReason> | Task<{
123
- bookmarks: PdfBookmarkObject[];
124
- }, PdfErrorReason>;
125
- /**
126
- * {@inheritDoc @embedpdf/models!PdfEngine.renderPage}
127
- *
128
- * @public
129
- */
130
- renderPage(doc: PdfDocumentObject, page: PdfPageObject, scaleFactor?: number, rotation?: Rotation, dpr?: number, options?: PdfRenderOptions, imageType?: ImageConversionTypes): PdfTask<T>;
131
- /**
132
- * {@inheritDoc @embedpdf/models!PdfEngine.renderPageRect}
133
- *
134
- * @public
135
- */
136
- renderPageRect(doc: PdfDocumentObject, page: PdfPageObject, scaleFactor: number, rotation: Rotation, dpr: number, rect: Rect, options: PdfRenderOptions, imageType?: ImageConversionTypes): PdfTask<T>;
137
- /**
138
- * {@inheritDoc @embedpdf/models!PdfEngine.getAllAnnotations}
139
- *
140
- * @public
141
- */
142
- getAllAnnotations(doc: PdfDocumentObject): Task<any, PdfErrorReason> | Task<Record<number, PdfAnnotationObject[]>, PdfErrorReason>;
143
- private readAllAnnotations;
144
- /**
145
- * {@inheritDoc @embedpdf/models!PdfEngine.getPageAnnotations}
146
- *
147
- * @public
148
- */
149
- getPageAnnotations(doc: PdfDocumentObject, page: PdfPageObject): Task<any, PdfErrorReason> | Task<PdfAnnotationObject[], PdfErrorReason>;
150
- /**
151
- * {@inheritDoc @embedpdf/models!PdfEngine.createPageAnnotation}
152
- *
153
- * @public
154
- */
155
- createPageAnnotation(doc: PdfDocumentObject, page: PdfPageObject, annotation: PdfAnnotationObject): PdfTask<number>;
156
- /**
157
- * Update an existing page annotation in-place
158
- *
159
- * • Locates the annot by page-local index (`annotation.id`)
160
- * • Re-writes its /Rect and type-specific payload
161
- * • Calls FPDFPage_GenerateContent so the new appearance is rendered
162
- *
163
- * @returns PdfTask<boolean> – true on success
164
- */
165
- updatePageAnnotation(doc: PdfDocumentObject, page: PdfPageObject, annotation: PdfAnnotationObject): PdfTask<boolean>;
166
- /**
167
- * {@inheritDoc @embedpdf/models!PdfEngine.removePageAnnotation}
168
- *
169
- * @public
170
- */
171
- removePageAnnotation(doc: PdfDocumentObject, page: PdfPageObject, annotation: PdfAnnotationObject): Task<boolean, PdfErrorReason> | Task<any, PdfErrorReason>;
172
- /**
173
- * {@inheritDoc @embedpdf/models!PdfEngine.getPageTextRects}
174
- *
175
- * @public
176
- */
177
- getPageTextRects(doc: PdfDocumentObject, page: PdfPageObject, scaleFactor: number, rotation: Rotation): Task<any, PdfErrorReason> | Task<PdfTextRectObject[], PdfErrorReason>;
178
- /**
179
- * {@inheritDoc @embedpdf/models!PdfEngine.renderThumbnail}
180
- *
181
- * @public
182
- */
183
- renderThumbnail(doc: PdfDocumentObject, page: PdfPageObject, scaleFactor: number, rotation: Rotation, dpr: number): PdfTask<T>;
184
- /**
185
- * {@inheritDoc @embedpdf/models!PdfEngine.getAttachments}
186
- *
187
- * @public
188
- */
189
- getAttachments(doc: PdfDocumentObject): Task<any, PdfErrorReason> | Task<PdfAttachmentObject[], PdfErrorReason>;
190
- /**
191
- * {@inheritDoc @embedpdf/models!PdfEngine.readAttachmentContent}
192
- *
193
- * @public
194
- */
195
- readAttachmentContent(doc: PdfDocumentObject, attachment: PdfAttachmentObject): Task<any, PdfErrorReason> | Task<ArrayBuffer, PdfErrorReason>;
196
- /**
197
- * {@inheritDoc @embedpdf/models!PdfEngine.setFormFieldValue}
198
- *
199
- * @public
200
- */
201
- setFormFieldValue(doc: PdfDocumentObject, page: PdfPageObject, annotation: PdfWidgetAnnoObject, value: FormFieldValue): Task<boolean, PdfErrorReason> | Task<any, PdfErrorReason>;
202
- /**
203
- * {@inheritDoc @embedpdf/models!PdfEngine.flattenPage}
204
- *
205
- * @public
206
- */
207
- flattenPage(doc: PdfDocumentObject, page: PdfPageObject, flag: PdfPageFlattenFlag): PdfTask<PdfPageFlattenResult>;
208
- /**
209
- * {@inheritDoc @embedpdf/models!PdfEngine.extractPages}
210
- *
211
- * @public
212
- */
213
- extractPages(doc: PdfDocumentObject, pageIndexes: number[]): Task<any, PdfErrorReason> | Task<ArrayBuffer, PdfErrorReason>;
214
- /**
215
- * {@inheritDoc @embedpdf/models!PdfEngine.extractText}
216
- *
217
- * @public
218
- */
219
- extractText(doc: PdfDocumentObject, pageIndexes: number[]): Task<any, PdfErrorReason> | Task<string, PdfErrorReason>;
220
- /**
221
- * {@inheritDoc @embedpdf/models!PdfEngine.getTextSlices}
222
- *
223
- * @public
224
- */
225
- getTextSlices(doc: PdfDocumentObject, slices: PageTextSlice[]): PdfTask<string[]>;
226
- /**
227
- * {@inheritDoc @embedpdf/models!PdfEngine.merge}
228
- *
229
- * @public
230
- */
231
- merge(files: PdfFile[]): Task<any, PdfErrorReason> | Task<PdfFile, PdfErrorReason>;
232
- /**
233
- * Merges specific pages from multiple PDF documents in a custom order
234
- *
235
- * @param mergeConfigs Array of configurations specifying which pages to merge from which documents
236
- * @returns A PdfTask that resolves with the merged PDF file
237
- * @public
238
- */
239
- mergePages(mergeConfigs: Array<{
240
- docId: string;
241
- pageIndices: number[];
242
- }>): Task<any, PdfErrorReason> | Task<PdfFile, PdfErrorReason>;
243
- /**
244
- * {@inheritDoc @embedpdf/models!PdfEngine.saveAsCopy}
245
- *
246
- * @public
247
- */
248
- saveAsCopy(doc: PdfDocumentObject): Task<any, PdfErrorReason> | Task<ArrayBuffer, PdfErrorReason>;
249
- /**
250
- * {@inheritDoc @embedpdf/models!PdfEngine.closeDocument}
251
- *
252
- * @public
253
- */
254
- closeDocument(doc: PdfDocumentObject): Task<boolean, PdfErrorReason> | Task<any, PdfErrorReason>;
255
- /**
256
- * Memory allocation
257
- * @param size - size of memory space
258
- * @returns pointer to memory space
259
- *
260
- * @public
261
- */
262
- malloc(size: number): number;
263
- /**
264
- * Free memory space
265
- * @param ptr pointer to memory space
266
- *
267
- * @public
268
- */
269
- free(ptr: number): void;
270
- /**
271
- * Set the rect of specified annotation
272
- * @param page - page info that the annotation is belonged to
273
- * @param pagePtr - pointer of page object
274
- * @param annotationPtr - pointer to annotation object
275
- * @param inkList - ink lists that added to the annotation
276
- * @returns whether the ink lists is setted
277
- *
278
- * @private
279
- */
280
- addInkStroke(page: PdfPageObject, pagePtr: number, annotationPtr: number, annotation: PdfInkAnnoObject): boolean;
281
- /**
282
- * Add highlight content to annotation
283
- * @param page - page info
284
- * @param annotationPtr - pointer to highlight annotation
285
- * @param annotation - highlight annotation
286
- * @returns whether highlight content is added to annotation
287
- *
288
- * @private
289
- */
290
- addTextMarkupContent(page: PdfPageObject, pagePtr: number, annotationPtr: number, annotation: PdfHighlightAnnoObject | PdfUnderlineAnnoObject | PdfStrikeOutAnnoObject | PdfSquigglyAnnoObject): boolean;
291
- /**
292
- * Add contents to stamp annotation
293
- * @param docPtr - pointer to pdf document object
294
- * @param page - page info
295
- * @param pagePtr - pointer to page object
296
- * @param annotationPtr - pointer to stamp annotation
297
- * @param rect - rect of stamp annotation
298
- * @param contents - contents of stamp annotation
299
- * @returns whether contents is added to annotation
300
- *
301
- * @private
302
- */
303
- addStampContent(docPtr: number, page: PdfPageObject, pagePtr: number, annotationPtr: number, rect: Rect, contents: PdfStampAnnoObjectContents): boolean;
304
- /**
305
- * Add image object to annotation
306
- * @param docPtr - pointer to pdf document object
307
- * @param page - page info
308
- * @param pagePtr - pointer to page object
309
- * @param annotationPtr - pointer to stamp annotation
310
- * @param position - position of image
311
- * @param imageData - data of image
312
- * @returns whether image is added to annotation
313
- *
314
- * @private
315
- */
316
- addImageObject(docPtr: number, page: PdfPageObject, pagePtr: number, annotationPtr: number, position: Position, imageData: ImageData): boolean;
317
- /**
318
- * Save document to array buffer
319
- * @param docPtr - pointer to pdf document
320
- * @returns array buffer contains the pdf content
321
- *
322
- * @private
323
- */
324
- saveDocument(docPtr: number): ArrayBuffer;
325
- /**
326
- * Read metadata from pdf document
327
- * @param docPtr - pointer to pdf document
328
- * @param key - key of metadata field
329
- * @returns metadata value
330
- *
331
- * @private
332
- */
333
- readMetaText(docPtr: number, key: string): string;
334
- /**
335
- * Read bookmarks in the pdf document
336
- * @param docPtr - pointer to pdf document
337
- * @param rootBookmarkPtr - pointer to root bookmark
338
- * @returns bookmarks in the pdf document
339
- *
340
- * @private
341
- */
342
- readPdfBookmarks(docPtr: number, rootBookmarkPtr?: number): PdfBookmarkObject[];
343
- /**
344
- * Read bookmark in the pdf document
345
- * @param docPtr - pointer to pdf document
346
- * @param bookmarkPtr - pointer to bookmark object
347
- * @returns pdf bookmark object
348
- *
349
- * @private
350
- */
351
- private readPdfBookmark;
352
- /**
353
- * Read text rects in pdf page
354
- * @param page - pdf page info
355
- * @param docPtr - pointer to pdf document
356
- * @param pagePtr - pointer to pdf page
357
- * @param textPagePtr - pointer to pdf text page
358
- * @returns text rects in the pdf page
359
- *
360
- * @public
361
- */
362
- private readPageTextRects;
363
- /**
364
- * Return geometric + logical text layout for one page
365
- * (glyph-only implementation, no FPDFText_GetRect).
366
- *
367
- * @public
368
- */
369
- getPageGeometry(doc: PdfDocumentObject, page: PdfPageObject): PdfTask<PdfPageGeometry>;
370
- /**
371
- * Group consecutive glyphs that belong to the same CPDF_TextObject
372
- * using FPDFText_GetTextObject(), and calculate rotation from glyph positions.
373
- */
374
- private buildRunsFromGlyphs;
375
- /**
376
- * Extract glyph geometry + metadata for `charIndex`
377
- *
378
- * Returns device–space coordinates:
379
- * x,y → **top-left** corner (integer-pixels)
380
- * w,h → width / height (integer-pixels, ≥ 1)
381
- *
382
- * And two flags:
383
- * isSpace → true if the glyph's Unicode code-point is U+0020
384
- */
385
- private readGlyphInfo;
386
- /**
387
- * Geometry-only text extraction
388
- * ------------------------------------------
389
- * Returns every glyph on the requested page
390
- * in the logical order delivered by PDFium.
391
- *
392
- * The promise resolves to an array of objects:
393
- * {
394
- * idx: number; // glyph index on the page (0…n-1)
395
- * origin: { x: number; y: number };
396
- * size: { width: number; height: number };
397
- * angle: number; // degrees, counter-clock-wise
398
- * isSpace: boolean; // true → U+0020
399
- * }
400
- *
401
- * No Unicode is included; front-end decides whether to hydrate it.
402
- */
403
- getPageGlyphs(doc: PdfDocumentObject, page: PdfPageObject): PdfTask<PdfGlyphObject[]>;
404
- private readCharBox;
405
- /**
406
- * Read page annotations
407
- * @param page - page info
408
- * @param docPtr - pointer to pdf document
409
- * @param pagePtr - pointer to pdf page
410
- * @param textPagePtr - pointe to pdf text page
411
- * @param scaleFactor - scale factor
412
- * @param rotation - rotation angle
413
- * @returns annotations on the pdf page
414
- *
415
- * @private
416
- */
417
- private readPageAnnotations;
418
- /**
419
- * Read pdf annotation from pdf document
420
- * @param page - pdf page infor
421
- * @param docPtr - pointer to pdf document object
422
- * @param pagePtr - pointer to pdf page object
423
- * @param textPagePtr - pointer to pdf text page object
424
- * @param formHandle - form handle
425
- * @param index - index of annotation in the pdf page
426
- * @param scaleFactor - factor of scalling
427
- * @param rotation - rotation angle
428
- * @returns pdf annotation
429
- *
430
- * @private
431
- */
432
- private readPageAnnotation;
433
- /**
434
- * Return the colour stored directly in the annotation dictionary's `/C` entry.
435
- *
436
- * Most PDFs created by Acrobat, Microsoft Office, LaTeX, etc. include this entry.
437
- * When the key is absent (common in macOS Preview, Chrome, Drawboard) the call
438
- * fails and the function returns `undefined`.
439
- *
440
- * @param annotationPtr - pointer to an `FPDF_ANNOTATION`
441
- * @returns An RGBA tuple (0-255 channels) or `undefined` if no `/C` entry exists
442
- *
443
- * @private
444
- */
445
- private readAnnotationColor;
446
- /**
447
- * Resolve the visible fill colour for **Highlight / Underline / StrikeOut /
448
- * Squiggly** markup annotations.
449
- *
450
- * Resolution order (first non-`undefined` wins):
451
- * 1. `/C` dictionary entry – fast, present in Acrobat / Office PDFs
452
- * 2. Appearance-stream objects – drills into paths & nested forms
453
- * 3. Hard-coded fallback (Acrobat-style opaque yellow)
454
- *
455
- * @param annotationPtr - pointer to an `FPDF_ANNOTATION`
456
- * @param fallback - colour to use when the PDF stores no tint at all
457
- * @returns WebAlphaColor with hex color and opacity (0-1)
458
- *
459
- * @private
460
- */
461
- private resolveAnnotationColor;
462
- /**
463
- * Set the fill/stroke colour for a **Highlight / Underline / StrikeOut / Squiggly** markup annotation.
464
- *
465
- * @param annotationPtr - pointer to the annotation whose colour is being set
466
- * @param webAlphaColor - WebAlphaColor with hex color and opacity (0-1)
467
- * @param shouldClearAP - whether to clear the /AP entry
468
- * @param which - which colour to set (0 = fill, 1 = stroke)
469
- * @returns `true` if the operation was successful
470
- *
471
- * @private
472
- */
473
- private setAnnotationColor;
474
- /**
475
- * Border‐style + width helper
476
- *
477
- * Tries the new PDFium helper `EPDFAnnot_GetBorderStyle()` (patch series
478
- * 9 July 2025).
479
- *
480
- * @param annotationPtr pointer to an `FPDF_ANNOTATION`
481
- * @returns `{ ok, style, width }`
482
- * • `ok` – `true` when the call succeeded
483
- * • `style` – `PdfAnnotationBorderStyle` enum
484
- * • `width` – stroke-width in points (defaults to 0 pt)
485
- */
486
- private getBorderStyle;
487
- private setBorderStyle;
488
- /**
489
- * Border-effect (“cloudy”) helper
490
- *
491
- * Calls the new PDFium function `EPDFAnnot_GetBorderEffect()` (July 2025).
492
- *
493
- * @param annotationPtr pointer to an `FPDF_ANNOTATION`
494
- * @returns `{ ok, intensity }`
495
- * • `ok` – `true` when the annotation *does* have a
496
- * valid cloudy-border effect
497
- * • `intensity` – radius/intensity value (0 when `ok` is false)
498
- */
499
- private getBorderEffect;
500
- /**
501
- * Rectangle-differences helper ( /RD array on Square / Circle annots )
502
- *
503
- * Calls `EPDFAnnot_GetRectangleDifferences()` introduced in July 2025.
504
- *
505
- * @param annotationPtr pointer to an `FPDF_ANNOTATION`
506
- * @returns `{ ok, left, top, right, bottom }`
507
- * • `ok` – `true` when the annotation *has* an /RD entry
508
- * • the four floats are 0 when `ok` is false
509
- */
510
- private getRectangleDifferences;
511
- /**
512
- * Dash-pattern helper ( /BS → /D array, dashed borders only )
513
- *
514
- * Uses the two new PDFium helpers:
515
- * • `EPDFAnnot_GetBorderDashPatternCount`
516
- * • `EPDFAnnot_GetBorderDashPattern`
517
- *
518
- * @param annotationPtr pointer to an `FPDF_ANNOTATION`
519
- * @returns `{ ok, pattern }`
520
- * • `ok` – `true` when the annot is dashed *and* the array
521
- * was retrieved successfully
522
- * • `pattern` – numeric array of dash/space lengths (empty when `ok` is false)
523
- */
524
- private getBorderDashPattern;
525
- /**
526
- * Read `/QuadPoints` from any annotation and convert each quadrilateral to
527
- * device-space coordinates.
528
- *
529
- * The four points are returned in natural reading order:
530
- * `p1 → p2` (top edge) and `p4 → p3` (bottom edge).
531
- * This preserves the true shape for rotated / skewed text, whereas callers
532
- * that only need axis-aligned boxes can collapse each quad themselves.
533
- *
534
- * @param page - logical page info object (`PdfPageObject`)
535
- * @param annotationPtr - pointer to the annotation whose quads are needed
536
- * @returns Array of `Rect` objects (`[]` if the annotation has no quads)
537
- *
538
- * @private
539
- */
540
- private getQuadPointsAnno;
541
- /**
542
- * Set the quadrilaterals for a **Highlight / Underline / StrikeOut / Squiggly** markup annotation.
543
- *
544
- * @param page - logical page info object (`PdfPageObject`)
545
- * @param annotationPtr - pointer to the annotation whose quads are needed
546
- * @param rects - array of `Rect` objects (`[]` if the annotation has no quads)
547
- * @returns `true` if the operation was successful
548
- *
549
- * @private
550
- */
551
- private syncQuadPointsAnno;
552
- /**
553
- * Read ink list from annotation
554
- * @param page - logical page info object (`PdfPageObject`)
555
- * @param annotationPtr - pointer to the annotation whose ink list is needed
556
- * @returns ink list
557
- */
558
- private getInkList;
559
- /**
560
- * Add ink list to annotation
561
- * @param page - logical page info object (`PdfPageObject`)
562
- * @param annotationPtr - pointer to the annotation whose ink list is needed
563
- * @param annotation - annotation object (`PdfInkAnnoObject`)
564
- * @returns `true` if the operation was successful
565
- */
566
- private setInkList;
567
- /**
568
- * Read pdf text annotation
569
- * @param page - pdf page infor
570
- * @param pagePtr - pointer to pdf page object
571
- * @param annotationPtr - pointer to pdf annotation
572
- * @param index - index of annotation in the pdf page
573
- * @returns pdf text annotation
574
- *
575
- * @private
576
- */
577
- private readPdfTextAnno;
578
- /**
579
- * Read pdf freetext annotation
580
- * @param page - pdf page infor
581
- * @param pagePtr - pointer to pdf page object
582
- * @param annotationPtr - pointer to pdf annotation
583
- * @param index - index of annotation in the pdf page
584
- * @returns pdf freetext annotation
585
- *
586
- * @private
587
- */
588
- private readPdfFreeTextAnno;
589
- /**
590
- * Read pdf link annotation from pdf document
591
- * @param page - pdf page infor
592
- * @param docPtr - pointer to pdf document object
593
- * @param pagePtr - pointer to pdf page object
594
- * @param textPagePtr - pointer to pdf text page object
595
- * @param annotationPtr - pointer to pdf annotation
596
- * @param index - index of annotation in the pdf page
597
- * @returns pdf link annotation
598
- *
599
- * @private
600
- */
601
- private readPdfLinkAnno;
602
- /**
603
- * Read pdf widget annotation
604
- * @param page - pdf page infor
605
- * @param pagePtr - pointer to pdf page object
606
- * @param annotationPtr - pointer to pdf annotation
607
- * @param formHandle - form handle
608
- * @param index - index of annotation in the pdf page
609
- * @returns pdf widget annotation
610
- *
611
- * @private
612
- */
613
- private readPdfWidgetAnno;
614
- /**
615
- * Read pdf file attachment annotation
616
- * @param page - pdf page infor
617
- * @param pagePtr - pointer to pdf page object
618
- * @param annotationPtr - pointer to pdf annotation
619
- * @param index - index of annotation in the pdf page
620
- * @returns pdf file attachment annotation
621
- *
622
- * @private
623
- */
624
- private readPdfFileAttachmentAnno;
625
- /**
626
- * Read pdf ink annotation
627
- * @param page - pdf page infor
628
- * @param pagePtr - pointer to pdf page object
629
- * @param annotationPtr - pointer to pdf annotation
630
- * @param index - index of annotation in the pdf page
631
- * @returns pdf ink annotation
632
- *
633
- * @private
634
- */
635
- private readPdfInkAnno;
636
- /**
637
- * Read pdf polygon annotation
638
- * @param page - pdf page infor
639
- * @param pagePtr - pointer to pdf page object
640
- * @param annotationPtr - pointer to pdf annotation
641
- * @param index - index of annotation in the pdf page
642
- * @returns pdf polygon annotation
643
- *
644
- * @private
645
- */
646
- private readPdfPolygonAnno;
647
- /**
648
- * Read pdf polyline annotation
649
- * @param page - pdf page infor
650
- * @param pagePtr - pointer to pdf page object
651
- * @param annotationPtr - pointer to pdf annotation
652
- * @param index - index of annotation in the pdf page
653
- * @returns pdf polyline annotation
654
- *
655
- * @private
656
- */
657
- private readPdfPolylineAnno;
658
- /**
659
- * Read pdf line annotation
660
- * @param page - pdf page infor
661
- * @param pagePtr - pointer to pdf page object
662
- * @param annotationPtr - pointer to pdf annotation
663
- * @param index - index of annotation in the pdf page
664
- * @returns pdf line annotation
665
- *
666
- * @private
667
- */
668
- private readPdfLineAnno;
669
- /**
670
- * Read pdf highlight annotation
671
- * @param page - pdf page infor
672
- * @param pagePtr - pointer to pdf page object
673
- * @param annotationPtr - pointer to pdf annotation
674
- * @param index - index of annotation in the pdf page
675
- * @returns pdf highlight annotation
676
- *
677
- * @private
678
- */
679
- private readPdfHighlightAnno;
680
- /**
681
- * Read pdf underline annotation
682
- * @param page - pdf page infor
683
- * @param pagePtr - pointer to pdf page object
684
- * @param annotationPtr - pointer to pdf annotation
685
- * @param index - index of annotation in the pdf page
686
- * @returns pdf underline annotation
687
- *
688
- * @private
689
- */
690
- private readPdfUnderlineAnno;
691
- /**
692
- * Read strikeout annotation
693
- * @param page - pdf page infor
694
- * @param pagePtr - pointer to pdf page object
695
- * @param annotationPtr - pointer to pdf annotation
696
- * @param index - index of annotation in the pdf page
697
- * @returns pdf strikeout annotation
698
- *
699
- * @private
700
- */
701
- private readPdfStrikeOutAnno;
702
- /**
703
- * Read pdf squiggly annotation
704
- * @param page - pdf page infor
705
- * @param pagePtr - pointer to pdf page object
706
- * @param annotationPtr - pointer to pdf annotation
707
- * @param index - index of annotation in the pdf page
708
- * @returns pdf squiggly annotation
709
- *
710
- * @private
711
- */
712
- private readPdfSquigglyAnno;
713
- /**
714
- * Read pdf caret annotation
715
- * @param page - pdf page infor
716
- * @param pagePtr - pointer to pdf page object
717
- * @param annotationPtr - pointer to pdf annotation
718
- * @param index - index of annotation in the pdf page
719
- * @returns pdf caret annotation
720
- *
721
- * @private
722
- */
723
- private readPdfCaretAnno;
724
- /**
725
- * Read pdf stamp annotation
726
- * @param docPtr - pointer to pdf document object
727
- * @param page - pdf page infor
728
- * @param pagePtr - pointer to pdf page object
729
- * @param annotationPtr - pointer to pdf annotation
730
- * @param index - index of annotation in the pdf page
731
- * @returns pdf stamp annotation
732
- *
733
- * @private
734
- */
735
- private readPdfStampAnno;
736
- /**
737
- * Read pdf object in pdf page
738
- * @param pageObjectPtr - pointer to pdf object in page
739
- * @returns pdf object in page
740
- *
741
- * @private
742
- */
743
- private readPdfPageObject;
744
- /**
745
- * Read pdf path object
746
- * @param pathObjectPtr - pointer to pdf path object in page
747
- * @returns pdf path object
748
- *
749
- * @private
750
- */
751
- private readPathObject;
752
- /**
753
- * Read segment of pdf path object
754
- * @param annotationObjectPtr - pointer to pdf path object
755
- * @param segmentIndex - index of segment
756
- * @returns pdf segment in pdf path
757
- *
758
- * @private
759
- */
760
- private readPdfSegment;
761
- /**
762
- * Read pdf image object from pdf document
763
- * @param pageObjectPtr - pointer to pdf image object in page
764
- * @returns pdf image object
765
- *
766
- * @private
767
- */
768
- private readImageObject;
769
- /**
770
- * Read form object from pdf document
771
- * @param formObjectPtr - pointer to pdf form object in page
772
- * @returns pdf form object
773
- *
774
- * @private
775
- */
776
- private readFormObject;
777
- /**
778
- * Read pdf object in pdf page
779
- * @param pageObjectPtr - pointer to pdf object in page
780
- * @returns pdf object in page
781
- *
782
- * @private
783
- */
784
- private readPdfPageObjectTransformMatrix;
785
- /**
786
- * Return the stroke-width declared in the annotation’s /Border or /BS entry.
787
- * Falls back to 1 pt when nothing is defined.
788
- *
789
- * @param annotationPtr - pointer to pdf annotation
790
- * @returns stroke-width
791
- *
792
- * @private
793
- */
794
- private getStrokeWidth;
795
- /**
796
- * Fetches the `/F` flag bit-field from an annotation.
797
- *
798
- * @param annotationPtr pointer to an `FPDF_ANNOTATION`
799
- * @returns `{ raw, flags }`
800
- * • `raw` – the 32-bit integer returned by PDFium
801
- * • `flags` – object with individual booleans
802
- */
803
- private getAnnotationFlags;
804
- /**
805
- * Read circle annotation
806
- * @param page - pdf page infor
807
- * @param pagePtr - pointer to pdf page object
808
- * @param annotationPtr - pointer to pdf annotation
809
- * @param index - index of annotation in the pdf page
810
- * @returns pdf circle annotation
811
- *
812
- * @private
813
- */
814
- private readPdfCircleAnno;
815
- /**
816
- * Read square annotation
817
- * @param page - pdf page infor
818
- * @param pagePtr - pointer to pdf page object
819
- * @param annotationPtr - pointer to pdf annotation
820
- * @param index - index of annotation in the pdf page
821
- * @returns pdf square annotation
822
- *
823
- * @private
824
- */
825
- private readPdfSquareAnno;
826
- /**
827
- * Read basic info of unsupported pdf annotation
828
- * @param page - pdf page infor
829
- * @param pagePtr - pointer to pdf page object
830
- * @param type - type of annotation
831
- * @param annotationPtr - pointer to pdf annotation
832
- * @param index - index of annotation in the pdf page
833
- * @returns pdf annotation
834
- *
835
- * @private
836
- */
837
- private readPdfAnno;
838
- /**
839
- * Resolve `/IRT` → parent-annotation index on the same page.
840
- *
841
- * @param pagePtr - pointer to FPDF_PAGE
842
- * @param annotationPtr - pointer to FPDF_ANNOTATION
843
- * @returns index (`0…count-1`) or `undefined` when the annotation is *not* a reply
844
- *
845
- * @private
846
- */
847
- private getInReplyToId;
848
- /**
849
- * Fetch a string value (`/T`, `/M`, `/State`, …) from an annotation.
850
- *
851
- * @returns decoded UTF-8 string or `undefined` when the key is absent
852
- *
853
- * @private
854
- */
855
- private getAnnotString;
856
- /**
857
- * Set a string value (`/T`, `/M`, `/State`, …) to an annotation.
858
- *
859
- * @returns `true` if the operation was successful
860
- *
861
- * @private
862
- */
863
- private setAnnotString;
864
- /**
865
- * Read vertices of pdf annotation
866
- * @param page - pdf page infor
867
- * @param pagePtr - pointer to pdf page object
868
- * @param annotationPtr - pointer to pdf annotation
869
- * @returns vertices of pdf annotation
870
- *
871
- * @private
872
- */
873
- private readPdfAnnoVertices;
874
- /**
875
- * Read the target of pdf bookmark
876
- * @param docPtr - pointer to pdf document object
877
- * @param getActionPtr - callback function to retrive the pointer of action
878
- * @param getDestinationPtr - callback function to retrive the pointer of destination
879
- * @returns target of pdf bookmark
880
- *
881
- * @private
882
- */
883
- private readPdfBookmarkTarget;
884
- /**
885
- * Read field of pdf widget annotation
886
- * @param formHandle - form handle
887
- * @param annotationPtr - pointer to pdf annotation
888
- * @returns field of pdf widget annotation
889
- *
890
- * @private
891
- */
892
- private readPdfWidgetAnnoField;
893
- /**
894
- * {@inheritDoc @embedpdf/models!PdfEngine.renderAnnotation}
895
- *
896
- * @public
897
- */
898
- renderAnnotation(doc: PdfDocumentObject, page: PdfPageObject, annotation: PdfAnnotationObject, scaleFactor: number, rotation: Rotation, dpr?: number, // device-pixel-ratio (canvas)
899
- mode?: AppearanceMode, imageType?: ImageConversionTypes): PdfTask<T>;
900
- /**
901
- * render rectangle of pdf page to image
902
- * @param docPtr - pointer to pdf document object
903
- * @param page - pdf page infor
904
- * @param rect - rectangle info
905
- * @param scaleFactor - factor of scalling
906
- * @param rotation - rotation angle
907
- * @param options - render options
908
- * @returns image data
909
- *
910
- * @private
911
- */
912
- private renderPageRectToImageData;
913
- /**
914
- * Read the target of pdf link annotation
915
- * @param docPtr - pointer to pdf document object
916
- * @param getActionPtr - callback function to retrive the pointer of action
917
- * @param getDestinationPtr - callback function to retrive the pointer of destination
918
- * @returns target of link
919
- *
920
- * @private
921
- */
922
- private readPdfLinkAnnoTarget;
923
- /**
924
- * Read pdf action from pdf document
925
- * @param docPtr - pointer to pdf document object
926
- * @param actionPtr - pointer to pdf action object
927
- * @returns pdf action object
928
- *
929
- * @private
930
- */
931
- private readPdfAction;
932
- /**
933
- * Read pdf destination object
934
- * @param docPtr - pointer to pdf document object
935
- * @param destinationPtr - pointer to pdf destination
936
- * @returns pdf destination object
937
- *
938
- * @private
939
- */
940
- private readPdfDestination;
941
- /**
942
- * Read attachmet from pdf document
943
- * @param docPtr - pointer to pdf document object
944
- * @param index - index of attachment
945
- * @returns attachment content
946
- *
947
- * @private
948
- */
949
- private readPdfAttachment;
950
- /**
951
- * Convert coordinate of point from device coordinate to page coordinate
952
- * @param page - pdf page infor
953
- * @param position - position of point
954
- * @returns converted position
955
- *
956
- * @private
957
- */
958
- private convertDevicePointToPagePoint;
959
- /**
960
- * Convert coordinate of point from page coordinate to device coordinate
961
- * @param page - pdf page infor
962
- * @param position - position of point
963
- * @returns converted position
964
- *
965
- * @private
966
- */
967
- private convertPagePointToDevicePoint;
968
- /**
969
- * Convert coordinate of rectangle from page coordinate to device coordinate
970
- * @param page - pdf page infor
971
- * @param pagePtr - pointer to pdf page object
972
- * @param pageRect - rectangle that needs to be converted
973
- * @returns converted rectangle
974
- *
975
- * @private
976
- */
977
- private convertPageRectToDeviceRect;
978
- /**
979
- * Read the appearance stream of annotation
980
- * @param annotationPtr - pointer to pdf annotation
981
- * @param mode - appearance mode
982
- * @returns appearance stream
983
- *
984
- * @private
985
- */
986
- private readPageAnnoAppearanceStreams;
987
- /**
988
- * Read the appearance stream of annotation
989
- * @param annotationPtr - pointer to pdf annotation
990
- * @param mode - appearance mode
991
- * @returns appearance stream
992
- *
993
- * @private
994
- */
995
- private readPageAnnoAppearanceStream;
996
- /**
997
- * Change the visible colour (and opacity) of an existing annotation.
998
- *
999
- * For markup annotations (highlight / underline / strikeout / squiggly) we
1000
- * first clear the AP dictionary entry, otherwise the stored appearance stream
1001
- * will override the new tint. For all other sub-types we keep the existing
1002
- * AP so custom artwork isn't lost.
1003
- *
1004
- * @param doc logical document object
1005
- * @param page logical page object
1006
- * @param annotation the annotation we want to recolour
1007
- * @param colour RGBA tuple (0-255 per channel)
1008
- * @param which 0 = stroke/fill colour (PDFium's "colourType" param)
1009
- *
1010
- * @returns `true` when the operation succeeded
1011
- */
1012
- updateAnnotationColor(doc: PdfDocumentObject, page: PdfPageObject, annotation: PdfAnnotationObjectBase, color: WebAlphaColor, which?: number): PdfTask<boolean>;
1013
- /**
1014
- * Set the rect of specified annotation
1015
- * @param page - page info that the annotation is belonged to
1016
- * @param pagePtr - pointer of page object
1017
- * @param annotationPtr - pointer to annotation object
1018
- * @param rect - target rectangle
1019
- * @returns whether the rect is setted
1020
- *
1021
- * @private
1022
- */
1023
- setPageAnnoRect(page: PdfPageObject, pagePtr: number, annotationPtr: number, rect: Rect): boolean;
1024
- /**
1025
- * Read the rectangle of annotation
1026
- * @param annotationPtr - pointer to pdf annotation
1027
- * @returns rectangle of annotation
1028
- *
1029
- * @private
1030
- */
1031
- private readPageAnnoRect;
1032
- /**
1033
- * Get highlight rects for a specific character range (for search highlighting)
1034
- * @param page - pdf page info
1035
- * @param pagePtr - pointer to pdf page
1036
- * @param textPagePtr - pointer to pdf text page
1037
- * @param startIndex - starting character index
1038
- * @param charCount - number of characters in the range
1039
- * @returns array of rectangles for highlighting the specified character range
1040
- *
1041
- * @private
1042
- */
1043
- private getHighlightRects;
1044
- /**
1045
- * Search for a keyword across all pages in the document
1046
- * Returns all search results throughout the entire document
1047
- *
1048
- * @param doc - Pdf document object
1049
- * @param keyword - Search keyword
1050
- * @param flags - Match flags for search
1051
- * @returns Promise of all search results in the document
1052
- *
1053
- * @public
1054
- */
1055
- searchAllPages(doc: PdfDocumentObject, keyword: string, flags?: MatchFlag[]): Task<SearchAllPagesResult, PdfErrorReason>;
1056
- /**
1057
- * Extract word-aligned context for a search hit.
1058
- *
1059
- * @param fullText full UTF-16 page text (fetch this once per page!)
1060
- * @param start index of 1st char that matched
1061
- * @param count number of chars in the match
1062
- * @param windowChars minimum context chars to keep left & right
1063
- */
1064
- private buildContext;
1065
- /**
1066
- * Tidy the text to remove any non-printable characters and whitespace
1067
- * @param s - text to tidy
1068
- * @returns tidied text
1069
- *
1070
- * @private
1071
- */
1072
- private tidy;
1073
- /**
1074
- * Search for all occurrences of a keyword on a single page
1075
- * This method efficiently loads the page only once and finds all matches
1076
- *
1077
- * @param docPtr - pointer to pdf document
1078
- * @param page - pdf page object
1079
- * @param pageIndex - index of the page
1080
- * @param keywordPtr - pointer to the search keyword
1081
- * @param flag - search flags
1082
- * @returns array of search results on this page
1083
- *
1084
- * @private
1085
- */
1086
- private searchAllInPage;
1087
- }
1088
-
1089
- declare function createPdfiumEngine(wasmUrl: string, logger?: Logger): Promise<PdfiumEngine>;
1090
-
1091
- export { createPdfiumEngine };