@embedpdf/models 1.0.0

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.
@@ -0,0 +1,2208 @@
1
+ /**
2
+ * Clockwise direction
3
+ * @public
4
+ */
5
+ declare enum Rotation {
6
+ Degree0 = 0,
7
+ Degree90 = 1,
8
+ Degree180 = 2,
9
+ Degree270 = 3
10
+ }
11
+ /** Clamp a Position to device-pixel integers (floor) */
12
+ declare function toIntPos(p: Position): Position;
13
+ /** Clamp a Size so it never truncates right / bottom (ceil) */
14
+ declare function toIntSize(s: Size): Size;
15
+ /** Apply both rules to a Rect */
16
+ declare function toIntRect(r: Rect): Rect;
17
+ /**
18
+ * Calculate degree that match the rotation type
19
+ * @param rotation - type of rotation
20
+ * @returns rotated degree
21
+ *
22
+ * @public
23
+ */
24
+ declare function calculateDegree(rotation: Rotation): 0 | 90 | 180 | 270;
25
+ /**
26
+ * Calculate angle that match the rotation type
27
+ * @param rotation - type of rotation
28
+ * @returns rotated angle
29
+ *
30
+ * @public
31
+ */
32
+ declare function calculateAngle(rotation: Rotation): number;
33
+ /**
34
+ * Represent the size of object
35
+ *
36
+ * @public
37
+ */
38
+ interface Size {
39
+ /**
40
+ * width of the object
41
+ */
42
+ width: number;
43
+ /**
44
+ * height of the object
45
+ */
46
+ height: number;
47
+ }
48
+ /**
49
+ * Represents a rectangle defined by its left, top, right, and bottom edges
50
+ *
51
+ * @public
52
+ */
53
+ interface Box {
54
+ /**
55
+ * The x-coordinate of the left edge
56
+ */
57
+ left: number;
58
+ /**
59
+ * The y-coordinate of the top edge
60
+ */
61
+ top: number;
62
+ /**
63
+ * The x-coordinate of the right edge
64
+ */
65
+ right: number;
66
+ /**
67
+ * The y-coordinate of the bottom edge
68
+ */
69
+ bottom: number;
70
+ }
71
+ /**
72
+ * Swap the width and height of the size object
73
+ * @param size - the original size
74
+ * @returns swapped size
75
+ *
76
+ * @public
77
+ */
78
+ declare function swap(size: Size): Size;
79
+ /**
80
+ * Transform size with specified rotation angle and scale factor
81
+ * @param size - orignal size of rect
82
+ * @param rotation - rotation angle
83
+ * @param scaleFactor - - scale factor
84
+ * @returns size that has been transformed
85
+ *
86
+ * @public
87
+ */
88
+ declare function transformSize(size: Size, rotation: Rotation, scaleFactor: number): Size;
89
+ /**
90
+ * position of point
91
+ *
92
+ * @public
93
+ */
94
+ interface Position {
95
+ /**
96
+ * x coordinate
97
+ */
98
+ x: number;
99
+ /**
100
+ * y coordinate
101
+ */
102
+ y: number;
103
+ }
104
+ /**
105
+ * Quadrilateral
106
+ *
107
+ * @public
108
+ */
109
+ interface Quad {
110
+ p1: Position;
111
+ p2: Position;
112
+ p3: Position;
113
+ p4: Position;
114
+ }
115
+ /**
116
+ * Convert quadrilateral to rectangle
117
+ * @param q - quadrilateral
118
+ * @returns rectangle
119
+ *
120
+ * @public
121
+ */
122
+ declare function quadToRect(q: Quad): Rect;
123
+ /**
124
+ * Rotate the container and calculate the new position for a point
125
+ * in specified position
126
+ * @param containerSize - size of the container
127
+ * @param position - position of the point
128
+ * @param rotation - rotated angle
129
+ * @returns new position of the point
130
+ *
131
+ * @public
132
+ */
133
+ declare function rotatePosition(containerSize: Size, position: Position, rotation: Rotation): Position;
134
+ /**
135
+ * Calculate the position of point by scaling the container
136
+ * @param position - position of the point
137
+ * @param scaleFactor - factor of scaling
138
+ * @returns new position of point
139
+ *
140
+ * @public
141
+ */
142
+ declare function scalePosition(position: Position, scaleFactor: number): Position;
143
+ /**
144
+ * Calculate the position of the point by applying the specified transformation
145
+ * @param containerSize - size of container
146
+ * @param position - position of the point
147
+ * @param rotation - rotated angle
148
+ * @param scaleFactor - factor of scaling
149
+ * @returns new position of point
150
+ *
151
+ * @public
152
+ */
153
+ declare function transformPosition(containerSize: Size, position: Position, rotation: Rotation, scaleFactor: number): Position;
154
+ /**
155
+ * Restore the position in a transformed cotainer
156
+ * @param containerSize - size of the container
157
+ * @param position - position of the point
158
+ * @param rotation - rotated angle
159
+ * @param scaleFactor - factor of scaling
160
+ * @returns the original position of the point
161
+ *
162
+ * @public
163
+ */
164
+ declare function restorePosition(containerSize: Size, position: Position, rotation: Rotation, scaleFactor: number): Position;
165
+ /**
166
+ * representation of rectangle
167
+ *
168
+ * @public
169
+ */
170
+ interface Rect {
171
+ /**
172
+ * origin of the rectangle
173
+ */
174
+ origin: Position;
175
+ /**
176
+ * size of the rectangle
177
+ */
178
+ size: Size;
179
+ }
180
+ /**
181
+ * Calculate the rect after rotated the container
182
+ * @param containerSize - size of container
183
+ * @param rect - target rect
184
+ * @param rotation - rotation angle
185
+ * @returns rotated rect
186
+ *
187
+ * @public
188
+ */
189
+ declare function rotateRect(containerSize: Size, rect: Rect, rotation: Rotation): Rect;
190
+ /**
191
+ * Scale the rectangle
192
+ * @param rect - rectangle
193
+ * @param scaleFactor - factor of scaling
194
+ * @returns new rectangle
195
+ *
196
+ * @public
197
+ */
198
+ declare function scaleRect(rect: Rect, scaleFactor: number): Rect;
199
+ /**
200
+ * Calculate new rectangle after transforming the container
201
+ * @param containerSize - size of the container
202
+ * @param rect - the target rectangle
203
+ * @param rotation - rotated angle
204
+ * @param scaleFactor - factor of scaling
205
+ * @returns new rectangle after transformation
206
+ *
207
+ * @public
208
+ */
209
+ declare function transformRect(containerSize: Size, rect: Rect, rotation: Rotation, scaleFactor: number): Rect;
210
+ /**
211
+ * Calculate new rectangle before transforming the container
212
+ * @param containerSize - size of the container
213
+ * @param rect - the target rectangle
214
+ * @param rotation - rotated angle
215
+ * @param scaleFactor - factor of scaling
216
+ * @returns original rectangle before transformation
217
+ *
218
+ * @public
219
+ */
220
+ declare function restoreRect(containerSize: Size, rect: Rect, rotation: Rotation, scaleFactor: number): Rect;
221
+ /**
222
+ * Calculate the original offset in a transformed container
223
+ * @param offset - position of the point
224
+ * @param rotation - rotated angle
225
+ * @param scaleFactor - factor of scaling
226
+ * @returns original position of the point
227
+ *
228
+ * @public
229
+ */
230
+ declare function restoreOffset(offset: Position, rotation: Rotation, scaleFactor: number): Position;
231
+ /**
232
+ * Return the smallest rectangle that encloses *all* `rects`.
233
+ * If the array is empty, returns `null`.
234
+ *
235
+ * @param rects - array of rectangles
236
+ * @returns smallest rectangle that encloses all the rectangles
237
+ *
238
+ * @public
239
+ */
240
+ declare function boundingRect(rects: Rect[]): Rect | null;
241
+
242
+ /**
243
+ * logger for logging
244
+ *
245
+ * @public
246
+ */
247
+ interface Logger {
248
+ /**
249
+ * Log debug message
250
+ * @param source - source of log
251
+ * @param category - category of log
252
+ * @param args - parameters of log
253
+ * @returns
254
+ *
255
+ * @public
256
+ */
257
+ debug: (source: string, category: string, ...args: any) => void;
258
+ /**
259
+ * Log infor message
260
+ * @param source - source of log
261
+ * @param category - category of log
262
+ * @param args - parameters of log
263
+ * @returns
264
+ *
265
+ * @public
266
+ */
267
+ info: (source: string, category: string, ...args: any) => void;
268
+ /**
269
+ * Log warning message
270
+ * @param source - source of log
271
+ * @param category - category of log
272
+ * @param args - parameters of log
273
+ * @returns
274
+ *
275
+ * @public
276
+ */
277
+ warn: (source: string, category: string, ...args: any) => void;
278
+ /**
279
+ * Log error message
280
+ * @param source - source of log
281
+ * @param category - category of log
282
+ * @param args - parameters of log
283
+ * @returns
284
+ *
285
+ * @public
286
+ */
287
+ error: (source: string, category: string, ...args: any) => void;
288
+ /**
289
+ * Log performance log
290
+ * @param source - source of log
291
+ * @param category - category of log
292
+ * @param event - event of log
293
+ * @param phase - event phase of log
294
+ * @param args - parameters of log
295
+ * @returns
296
+ *
297
+ * @public
298
+ */
299
+ perf: (source: string, category: string, event: string, phase: 'Begin' | 'End', ...args: any) => void;
300
+ }
301
+ /**
302
+ * Logger that log nothing, it will ignore all the logs
303
+ *
304
+ * @public
305
+ */
306
+ declare class NoopLogger implements Logger {
307
+ /** {@inheritDoc Logger.debug} */
308
+ debug(): void;
309
+ /** {@inheritDoc Logger.info} */
310
+ info(): void;
311
+ /** {@inheritDoc Logger.warn} */
312
+ warn(): void;
313
+ /** {@inheritDoc Logger.error} */
314
+ error(): void;
315
+ /** {@inheritDoc Logger.perf} */
316
+ perf(): void;
317
+ }
318
+ /**
319
+ * Logger that use console as the output
320
+ *
321
+ * @public
322
+ */
323
+ declare class ConsoleLogger implements Logger {
324
+ /** {@inheritDoc Logger.debug} */
325
+ debug(source: string, category: string, ...args: any): void;
326
+ /** {@inheritDoc Logger.info} */
327
+ info(source: string, category: string, ...args: any): void;
328
+ /** {@inheritDoc Logger.warn} */
329
+ warn(source: string, category: string, ...args: any): void;
330
+ /** {@inheritDoc Logger.error} */
331
+ error(source: string, category: string, ...args: any): void;
332
+ /** {@inheritDoc Logger.perf} */
333
+ perf(source: string, category: string, event: string, phase: 'Begin' | 'End', ...args: any): void;
334
+ }
335
+ /**
336
+ * Level of log
337
+ *
338
+ * @public
339
+ */
340
+ declare enum LogLevel {
341
+ Debug = 0,
342
+ Info = 1,
343
+ Warn = 2,
344
+ Error = 3
345
+ }
346
+ /**
347
+ * Logger that support filtering by log level
348
+ *
349
+ * @public
350
+ */
351
+ declare class LevelLogger implements Logger {
352
+ private logger;
353
+ private level;
354
+ /**
355
+ * create new LevelLogger
356
+ * @param logger - the original logger
357
+ * @param level - log level that used for filtering, all logs lower than this level will be filtered out
358
+ */
359
+ constructor(logger: Logger, level: LogLevel);
360
+ /** {@inheritDoc Logger.debug} */
361
+ debug(source: string, category: string, ...args: any): void;
362
+ /** {@inheritDoc Logger.info} */
363
+ info(source: string, category: string, ...args: any): void;
364
+ /** {@inheritDoc Logger.warn} */
365
+ warn(source: string, category: string, ...args: any): void;
366
+ /** {@inheritDoc Logger.error} */
367
+ error(source: string, category: string, ...args: any): void;
368
+ /** {@inheritDoc Logger.perf} */
369
+ perf(source: string, category: string, event: string, phase: 'Begin' | 'End', ...args: any): void;
370
+ }
371
+ /**
372
+ * Logger for performance tracking
373
+ *
374
+ * @public
375
+ */
376
+ declare class PerfLogger implements Logger {
377
+ /**
378
+ * create new PerfLogger
379
+ */
380
+ constructor();
381
+ /** {@inheritDoc Logger.debug} */
382
+ debug(source: string, category: string, ...args: any): void;
383
+ /** {@inheritDoc Logger.info} */
384
+ info(source: string, category: string, ...args: any): void;
385
+ /** {@inheritDoc Logger.warn} */
386
+ warn(source: string, category: string, ...args: any): void;
387
+ /** {@inheritDoc Logger.error} */
388
+ error(source: string, category: string, ...args: any): void;
389
+ /** {@inheritDoc Logger.perf} */
390
+ perf(source: string, category: string, event: string, phase: 'Begin' | 'End', identifier: string, ...args: any): void;
391
+ }
392
+ /**
393
+ * Logger that will track and call child loggers
394
+ *
395
+ * @public
396
+ */
397
+ declare class AllLogger implements Logger {
398
+ private loggers;
399
+ /**
400
+ * create new PerfLogger
401
+ */
402
+ constructor(loggers: Logger[]);
403
+ /** {@inheritDoc Logger.debug} */
404
+ debug(source: string, category: string, ...args: any): void;
405
+ /** {@inheritDoc Logger.info} */
406
+ info(source: string, category: string, ...args: any): void;
407
+ /** {@inheritDoc Logger.warn} */
408
+ warn(source: string, category: string, ...args: any): void;
409
+ /** {@inheritDoc Logger.error} */
410
+ error(source: string, category: string, ...args: any): void;
411
+ /** {@inheritDoc Logger.perf} */
412
+ perf(source: string, category: string, event: string, phase: 'Begin' | 'End', ...args: any): void;
413
+ }
414
+
415
+ /**
416
+ * Stage of task
417
+ *
418
+ * @public
419
+ */
420
+ declare enum TaskStage {
421
+ /**
422
+ * Task is pending, means it just start executing
423
+ */
424
+ Pending = 0,
425
+ /**
426
+ * Task is succeed
427
+ */
428
+ Resolved = 1,
429
+ /**
430
+ * Task is failed
431
+ */
432
+ Rejected = 2,
433
+ /**
434
+ * Task is aborted
435
+ */
436
+ Aborted = 3
437
+ }
438
+ interface TaskError<D> {
439
+ /**
440
+ * task error type
441
+ */
442
+ type: 'reject' | 'abort';
443
+ /**
444
+ * task error
445
+ */
446
+ reason: D;
447
+ }
448
+ /**
449
+ * callback that will be called when task is resolved
450
+ *
451
+ * @public
452
+ */
453
+ type ResolvedCallback<R> = (r: R) => void;
454
+ /**
455
+ * callback that will be called when task is rejected
456
+ *
457
+ * @public
458
+ */
459
+ type RejectedCallback<D> = (e: TaskError<D>) => void;
460
+ /**
461
+ * Task state in different stage
462
+ *
463
+ * @public
464
+ */
465
+ type TaskState<R, D> = {
466
+ stage: TaskStage.Pending;
467
+ } | {
468
+ stage: TaskStage.Resolved;
469
+ result: R;
470
+ } | {
471
+ stage: TaskStage.Rejected;
472
+ reason: D;
473
+ } | {
474
+ stage: TaskStage.Aborted;
475
+ reason: D;
476
+ };
477
+ declare class TaskAbortedError extends Error {
478
+ constructor(reason: string);
479
+ }
480
+ declare class TaskRejectedError extends Error {
481
+ constructor(reason: string);
482
+ }
483
+ /**
484
+ * Base class of task
485
+ *
486
+ * @public
487
+ */
488
+ declare class Task<R, D> {
489
+ state: TaskState<R, D>;
490
+ /**
491
+ * callbacks that will be executed when task is resolved
492
+ */
493
+ resolvedCallbacks: ResolvedCallback<R>[];
494
+ /**
495
+ * callbacks that will be executed when task is rejected
496
+ */
497
+ rejectedCallbacks: RejectedCallback<D>[];
498
+ /**
499
+ * Promise that will be resolved when task is settled
500
+ */
501
+ private _promise;
502
+ /**
503
+ * Convert task to promise
504
+ * @returns promise that will be resolved when task is settled
505
+ */
506
+ toPromise(): Promise<R>;
507
+ /**
508
+ * wait for task to be settled
509
+ * @param resolvedCallback - callback for resolved value
510
+ * @param rejectedCallback - callback for rejected value
511
+ */
512
+ wait(resolvedCallback: ResolvedCallback<R>, rejectedCallback: RejectedCallback<D>): void;
513
+ /**
514
+ * resolve task with specific result
515
+ * @param result - result value
516
+ */
517
+ resolve(result: R): void;
518
+ /**
519
+ * reject task with specific reason
520
+ * @param reason - abort reason
521
+ *
522
+ */
523
+ reject(reason: D): void;
524
+ /**
525
+ * abort task with specific reason
526
+ * @param reason - abort reason
527
+ */
528
+ abort(reason: D): void;
529
+ /**
530
+ * fail task with a TaskError from another task
531
+ * This is a convenience method for error propagation between tasks
532
+ * @param error - TaskError from another task
533
+ */
534
+ fail(error: TaskError<D>): void;
535
+ }
536
+ /**
537
+ * Type that represent the result of executing task
538
+ */
539
+ type TaskReturn<T extends Task<any, any>> = T extends Task<infer R, infer E> ? {
540
+ type: 'result';
541
+ value: R;
542
+ } | {
543
+ type: 'error';
544
+ value: TaskError<E>;
545
+ } : never;
546
+
547
+ /**
548
+ * Representation of pdf page
549
+ *
550
+ * @public
551
+ */
552
+ interface PdfPageObject {
553
+ /**
554
+ * Index of this page, starts from 0
555
+ */
556
+ index: number;
557
+ /**
558
+ * Orignal size of this page
559
+ */
560
+ size: Size;
561
+ }
562
+ /**
563
+ * Representation of pdf page with rotated size
564
+ *
565
+ * @public
566
+ */
567
+ interface PdfPageObjectWithRotatedSize extends PdfPageObject {
568
+ /**
569
+ * Rotated size of this page
570
+ */
571
+ rotatedSize: Size;
572
+ }
573
+ /**
574
+ * Representation of pdf document
575
+ *
576
+ * @public
577
+ */
578
+ interface PdfDocumentObject {
579
+ /**
580
+ * Identity of document
581
+ */
582
+ id: string;
583
+ /**
584
+ * Count of pages in this document
585
+ */
586
+ pageCount: number;
587
+ /**
588
+ * Pages in this document
589
+ */
590
+ pages: PdfPageObject[];
591
+ }
592
+ /**
593
+ * metadata of pdf document
594
+ *
595
+ * @public
596
+ */
597
+ interface PdfMetadataObject {
598
+ /**
599
+ * title of the document
600
+ */
601
+ title: string;
602
+ /**
603
+ * author of the document
604
+ */
605
+ author: string;
606
+ /**
607
+ * subject of the document
608
+ */
609
+ subject: string;
610
+ /**
611
+ * keywords of the document
612
+ */
613
+ keywords: string;
614
+ /**
615
+ * producer of the document
616
+ */
617
+ producer: string;
618
+ /**
619
+ * creator of the document
620
+ */
621
+ creator: string;
622
+ /**
623
+ * creation date of the document
624
+ */
625
+ creationDate: string;
626
+ /**
627
+ * modification date of the document
628
+ */
629
+ modificationDate: string;
630
+ }
631
+ /**
632
+ * zoom mode
633
+ *
634
+ * @public
635
+ */
636
+ declare enum PdfZoomMode {
637
+ Unknown = 0,
638
+ /**
639
+ * Zoom level with specified offset.
640
+ */
641
+ XYZ = 1,
642
+ /**
643
+ * Fit both the width and height of the page (whichever smaller).
644
+ */
645
+ FitPage = 2,
646
+ /**
647
+ * Fit the page width.
648
+ */
649
+ FitHorizontal = 3,
650
+ /**
651
+ * Fit the page height.
652
+ */
653
+ FitVertical = 4,
654
+ /**
655
+ * Fit a specific rectangle area within the window.
656
+ */
657
+ FitRectangle = 5
658
+ }
659
+ /**
660
+ * Representation of the linked destination
661
+ *
662
+ * @public
663
+ */
664
+ interface PdfDestinationObject {
665
+ /**
666
+ * Index of target page
667
+ */
668
+ pageIndex: number;
669
+ /**
670
+ * zoom config for target destination
671
+ */
672
+ zoom: {
673
+ mode: PdfZoomMode.Unknown;
674
+ } | {
675
+ mode: PdfZoomMode.XYZ;
676
+ params: {
677
+ x: number;
678
+ y: number;
679
+ zoom: number;
680
+ };
681
+ } | {
682
+ mode: PdfZoomMode.FitPage;
683
+ } | {
684
+ mode: PdfZoomMode.FitHorizontal;
685
+ } | {
686
+ mode: PdfZoomMode.FitVertical;
687
+ } | {
688
+ mode: PdfZoomMode.FitRectangle;
689
+ };
690
+ view: number[];
691
+ }
692
+ /**
693
+ * Type of pdf action
694
+ *
695
+ * @public
696
+ */
697
+ declare enum PdfActionType {
698
+ Unsupported = 0,
699
+ /**
700
+ * Goto specified position in this document
701
+ */
702
+ Goto = 1,
703
+ /**
704
+ * Goto specified position in another document
705
+ */
706
+ RemoteGoto = 2,
707
+ /**
708
+ * Goto specified URI
709
+ */
710
+ URI = 3,
711
+ /**
712
+ * Launch specifed application
713
+ */
714
+ LaunchAppOrOpenFile = 4
715
+ }
716
+ type PdfImage = {
717
+ data: Uint8ClampedArray;
718
+ width: number;
719
+ height: number;
720
+ };
721
+ /**
722
+ * Representation of pdf action
723
+ *
724
+ * @public
725
+ */
726
+ type PdfActionObject = {
727
+ type: PdfActionType.Unsupported;
728
+ } | {
729
+ type: PdfActionType.Goto;
730
+ destination: PdfDestinationObject;
731
+ } | {
732
+ type: PdfActionType.RemoteGoto;
733
+ destination: PdfDestinationObject;
734
+ } | {
735
+ type: PdfActionType.URI;
736
+ uri: string;
737
+ } | {
738
+ type: PdfActionType.LaunchAppOrOpenFile;
739
+ path: string;
740
+ };
741
+ /**
742
+ * target of pdf link
743
+ *
744
+ * @public
745
+ */
746
+ type PdfLinkTarget = {
747
+ type: 'action';
748
+ action: PdfActionObject;
749
+ } | {
750
+ type: 'destination';
751
+ destination: PdfDestinationObject;
752
+ };
753
+ /**
754
+ * PDF bookmark
755
+ *
756
+ * @public
757
+ */
758
+ interface PdfBookmarkObject {
759
+ /**
760
+ * title of bookmark
761
+ */
762
+ title: string;
763
+ /**
764
+ * target of bookmark
765
+ */
766
+ target?: PdfLinkTarget | undefined;
767
+ /**
768
+ * bookmarks in the next level
769
+ */
770
+ children?: PdfBookmarkObject[];
771
+ }
772
+ /**
773
+ * Pdf Signature
774
+ *
775
+ * @public
776
+ */
777
+ interface PdfSignatureObject {
778
+ /**
779
+ * contents of signature
780
+ */
781
+ contents: ArrayBuffer;
782
+ /**
783
+ * byte range of signature
784
+ */
785
+ byteRange: ArrayBuffer;
786
+ /**
787
+ * sub filters of signature
788
+ */
789
+ subFilter: ArrayBuffer;
790
+ /**
791
+ * reason of signature
792
+ */
793
+ reason: string;
794
+ /**
795
+ * creation time of signature
796
+ */
797
+ time: string;
798
+ /**
799
+ * MDP
800
+ */
801
+ docMDP: number;
802
+ }
803
+ /**
804
+ * Bookmark tree of pdf
805
+ *
806
+ * @public
807
+ */
808
+ interface PdfBookmarksObject {
809
+ bookmarks: PdfBookmarkObject[];
810
+ }
811
+ /**
812
+ * Text rectangle in pdf page
813
+ *
814
+ * @public
815
+ */
816
+ interface PdfTextRectObject {
817
+ /**
818
+ * Font of the text
819
+ */
820
+ font: {
821
+ /**
822
+ * font family
823
+ */
824
+ family: string;
825
+ /**
826
+ * font size
827
+ */
828
+ size: number;
829
+ };
830
+ /**
831
+ * content in this rectangle area
832
+ */
833
+ content: string;
834
+ /**
835
+ * rectangle of the text
836
+ */
837
+ rect: Rect;
838
+ }
839
+ /**
840
+ * Color
841
+ *
842
+ * @public
843
+ */
844
+ interface PdfAlphaColor {
845
+ /**
846
+ * red
847
+ */
848
+ red: number;
849
+ /**
850
+ * green
851
+ */
852
+ green: number;
853
+ /**
854
+ * blue
855
+ */
856
+ blue: number;
857
+ /**
858
+ * alpha
859
+ */
860
+ alpha: number;
861
+ }
862
+ /**
863
+ * Annotation type
864
+ *
865
+ * @public
866
+ */
867
+ declare enum PdfAnnotationSubtype {
868
+ UNKNOWN = 0,
869
+ TEXT = 1,
870
+ LINK = 2,
871
+ FREETEXT = 3,
872
+ LINE = 4,
873
+ SQUARE = 5,
874
+ CIRCLE = 6,
875
+ POLYGON = 7,
876
+ POLYLINE = 8,
877
+ HIGHLIGHT = 9,
878
+ UNDERLINE = 10,
879
+ SQUIGGLY = 11,
880
+ STRIKEOUT = 12,
881
+ STAMP = 13,
882
+ CARET = 14,
883
+ INK = 15,
884
+ POPUP = 16,
885
+ FILEATTACHMENT = 17,
886
+ SOUND = 18,
887
+ MOVIE = 19,
888
+ WIDGET = 20,
889
+ SCREEN = 21,
890
+ PRINTERMARK = 22,
891
+ TRAPNET = 23,
892
+ WATERMARK = 24,
893
+ THREED = 25,
894
+ RICHMEDIA = 26,
895
+ XFAWIDGET = 27,
896
+ REDACT = 28
897
+ }
898
+ /**
899
+ * Name of annotation type
900
+ *
901
+ * @public
902
+ */
903
+ declare const PdfAnnotationSubtypeName: Record<PdfAnnotationSubtype, string>;
904
+ /**
905
+ * Status of pdf annotation
906
+ *
907
+ * @public
908
+ */
909
+ declare enum PdfAnnotationObjectStatus {
910
+ /**
911
+ * Annotation is created
912
+ */
913
+ Created = 0,
914
+ /**
915
+ * Annotation is committed to PDF file
916
+ */
917
+ Committed = 1
918
+ }
919
+ /**
920
+ * Appearance mode
921
+ *
922
+ * @public
923
+ */
924
+ declare enum AppearanceMode {
925
+ Normal = 0,
926
+ Rollover = 1,
927
+ Down = 2
928
+ }
929
+ /**
930
+ * State of pdf annotation
931
+ *
932
+ * @public
933
+ */
934
+ declare enum PdfAnnotationState {
935
+ /**
936
+ * Annotation is active
937
+ */
938
+ Marked = "Marked",
939
+ /**
940
+ * Annotation is unmarked
941
+ */
942
+ Unmarked = "Unmarked",
943
+ /**
944
+ * Annotation is ink
945
+ */
946
+ Accepted = "Accepted",
947
+ /**
948
+ * Annotation is rejected
949
+ */
950
+ Rejected = "Rejected",
951
+ /**
952
+ * Annotation is complete
953
+ */
954
+ Complete = "Complete",
955
+ /**
956
+ * Annotation is cancelled
957
+ */
958
+ Cancelled = "Cancelled",
959
+ /**
960
+ * Annotation is none
961
+ */
962
+ None = "None"
963
+ }
964
+ /**
965
+ * State model of pdf annotation
966
+ *
967
+ * @public
968
+ */
969
+ declare enum PdfAnnotationStateModel {
970
+ /**
971
+ * Annotation is marked
972
+ */
973
+ Marked = "Marked",
974
+ /**
975
+ * Annotation is reviewed
976
+ */
977
+ Reviewed = "Reviewed"
978
+ }
979
+ /**
980
+ * Basic information of pdf annotation
981
+ *
982
+ * @public
983
+ */
984
+ interface PdfAnnotationObjectBase {
985
+ /**
986
+ * Author of the annotation
987
+ */
988
+ author?: string;
989
+ /**
990
+ * Modified date of the annotation
991
+ */
992
+ modified?: string;
993
+ /**
994
+ * Sub type of annotation
995
+ */
996
+ type: PdfAnnotationSubtype;
997
+ /**
998
+ * Status of pdf annotation
999
+ */
1000
+ status: PdfAnnotationObjectStatus;
1001
+ /**
1002
+ * The index of page that this annotation belong to
1003
+ */
1004
+ pageIndex: number;
1005
+ /**
1006
+ * id of the annotation
1007
+ */
1008
+ id: number;
1009
+ /**
1010
+ * Rectangle of the annotation
1011
+ */
1012
+ rect: Rect;
1013
+ /**
1014
+ * Related popup annotation
1015
+ */
1016
+ popup?: PdfPopupAnnoObject | undefined;
1017
+ /**
1018
+ * Appearences of annotation
1019
+ */
1020
+ appearances: {
1021
+ normal: string;
1022
+ rollover: string;
1023
+ down: string;
1024
+ };
1025
+ }
1026
+ /**
1027
+ * Popup annotation
1028
+ *
1029
+ * @public
1030
+ */
1031
+ interface PdfPopupAnnoObject extends PdfAnnotationObjectBase {
1032
+ /** {@inheritDoc PdfAnnotationObjectBase.type} */
1033
+ type: PdfAnnotationSubtype.POPUP;
1034
+ /**
1035
+ * Contents of the popup
1036
+ */
1037
+ contents: string;
1038
+ /**
1039
+ * Whether the popup is opened or not
1040
+ */
1041
+ open: boolean;
1042
+ }
1043
+ /**
1044
+ * Pdf Link annotation
1045
+ *
1046
+ * @public
1047
+ */
1048
+ interface PdfLinkAnnoObject extends PdfAnnotationObjectBase {
1049
+ /** {@inheritDoc PdfAnnotationObjectBase.type} */
1050
+ type: PdfAnnotationSubtype.LINK;
1051
+ /**
1052
+ * Text of the link
1053
+ */
1054
+ text: string;
1055
+ /**
1056
+ * target of the link
1057
+ */
1058
+ target: PdfLinkTarget | undefined;
1059
+ }
1060
+ /**
1061
+ * Pdf Text annotation
1062
+ *
1063
+ * @public
1064
+ */
1065
+ interface PdfTextAnnoObject extends PdfAnnotationObjectBase {
1066
+ /** {@inheritDoc PdfAnnotationObjectBase.type} */
1067
+ type: PdfAnnotationSubtype.TEXT;
1068
+ /**
1069
+ * Text contents of the annotation
1070
+ */
1071
+ contents: string;
1072
+ /**
1073
+ * Color of the text
1074
+ */
1075
+ color: PdfAlphaColor;
1076
+ /**
1077
+ * In reply to id
1078
+ */
1079
+ inReplyToId?: number;
1080
+ /**
1081
+ * State of the text annotation
1082
+ */
1083
+ state?: PdfAnnotationState;
1084
+ /**
1085
+ * State model of the text annotation
1086
+ */
1087
+ stateModel?: PdfAnnotationStateModel;
1088
+ }
1089
+ /**
1090
+ * Type of form field
1091
+ *
1092
+ * @public
1093
+ */
1094
+ declare enum PDF_FORM_FIELD_TYPE {
1095
+ /**
1096
+ * Unknow
1097
+ */
1098
+ UNKNOWN = 0,
1099
+ /**
1100
+ * push button type
1101
+ */
1102
+ PUSHBUTTON = 1,
1103
+ /**
1104
+ * check box type.
1105
+ */
1106
+ CHECKBOX = 2,
1107
+ /**
1108
+ * radio button type.
1109
+ */
1110
+ RADIOBUTTON = 3,
1111
+ /**
1112
+ * combo box type.
1113
+ */
1114
+ COMBOBOX = 4,
1115
+ /**
1116
+ * list box type.
1117
+ */
1118
+ LISTBOX = 5,
1119
+ /**
1120
+ * text field type
1121
+ */
1122
+ TEXTFIELD = 6,
1123
+ /**
1124
+ * signature field type.
1125
+ */
1126
+ SIGNATURE = 7,
1127
+ /**
1128
+ * Generic XFA type.
1129
+ */
1130
+ XFA = 8,
1131
+ /**
1132
+ * XFA check box type.
1133
+ */
1134
+ XFA_CHECKBOX = 9,
1135
+ /**
1136
+ * XFA combo box type.
1137
+ */
1138
+ XFA_COMBOBOX = 10,
1139
+ /**
1140
+ * XFA image field type.
1141
+ */
1142
+ XFA_IMAGEFIELD = 11,
1143
+ /**
1144
+ * XFA list box type.
1145
+ */
1146
+ XFA_LISTBOX = 12,
1147
+ /**
1148
+ * XFA push button type.
1149
+ */
1150
+ XFA_PUSHBUTTON = 13,
1151
+ /**
1152
+ * XFA signture field type.
1153
+ */
1154
+ XFA_SIGNATURE = 14,
1155
+ /**
1156
+ * XFA text field type.
1157
+ */
1158
+ XFA_TEXTFIELD = 15
1159
+ }
1160
+ /**
1161
+ * Flag of form field
1162
+ *
1163
+ * @public
1164
+ */
1165
+ declare enum PDF_FORM_FIELD_FLAG {
1166
+ NONE = 0,
1167
+ READONLY = 1,
1168
+ REQUIRED = 2,
1169
+ NOEXPORT = 4,
1170
+ TEXT_MULTIPLINE = 4096,
1171
+ TEXT_PASSWORD = 8192,
1172
+ CHOICE_COMBO = 131072,
1173
+ CHOICE_EDIT = 262144,
1174
+ CHOICE_MULTL_SELECT = 2097152
1175
+ }
1176
+ /**
1177
+ * Type of pdf object
1178
+ *
1179
+ * @public
1180
+ */
1181
+ declare enum PdfPageObjectType {
1182
+ UNKNOWN = 0,
1183
+ TEXT = 1,
1184
+ PATH = 2,
1185
+ IMAGE = 3,
1186
+ SHADING = 4,
1187
+ FORM = 5
1188
+ }
1189
+ /**
1190
+ * Options of pdf widget annotation
1191
+ *
1192
+ * @public
1193
+ */
1194
+ interface PdfWidgetAnnoOption {
1195
+ label: string;
1196
+ isSelected: boolean;
1197
+ }
1198
+ /**
1199
+ * Field of PDF widget annotation
1200
+ *
1201
+ * @public
1202
+ */
1203
+ interface PdfWidgetAnnoField {
1204
+ /**
1205
+ * flag of field
1206
+ */
1207
+ flag: PDF_FORM_FIELD_FLAG;
1208
+ /**
1209
+ * name of field
1210
+ */
1211
+ name: string;
1212
+ /**
1213
+ * alternate name of field
1214
+ */
1215
+ alternateName: string;
1216
+ /**
1217
+ * type of field
1218
+ */
1219
+ type: PDF_FORM_FIELD_TYPE;
1220
+ /**
1221
+ * value of field
1222
+ */
1223
+ value: string;
1224
+ /**
1225
+ * whether field is checked
1226
+ */
1227
+ isChecked: boolean;
1228
+ /**
1229
+ * options of field
1230
+ */
1231
+ options: PdfWidgetAnnoOption[];
1232
+ }
1233
+ /**
1234
+ * PDF widget object
1235
+ *
1236
+ * @public
1237
+ */
1238
+ interface PdfWidgetAnnoObject extends PdfAnnotationObjectBase {
1239
+ /** {@inheritDoc PdfAnnotationObjectBase.type} */
1240
+ type: PdfAnnotationSubtype.WIDGET;
1241
+ /**
1242
+ * Field of pdf widget object
1243
+ */
1244
+ field: PdfWidgetAnnoField;
1245
+ }
1246
+ /**
1247
+ * Pdf file attachments annotation
1248
+ *
1249
+ * @public
1250
+ */
1251
+ interface PdfFileAttachmentAnnoObject extends PdfAnnotationObjectBase {
1252
+ /** {@inheritDoc PdfAnnotationObjectBase.type} */
1253
+ type: PdfAnnotationSubtype.FILEATTACHMENT;
1254
+ }
1255
+ /**
1256
+ * ink list in pdf ink annotation
1257
+ *
1258
+ * @public
1259
+ */
1260
+ interface PdfInkListObject {
1261
+ points: Position[];
1262
+ }
1263
+ /**
1264
+ * Pdf ink annotation
1265
+ *
1266
+ * @public
1267
+ */
1268
+ interface PdfInkAnnoObject extends PdfAnnotationObjectBase {
1269
+ /** {@inheritDoc PdfAnnotationObjectBase.type} */
1270
+ type: PdfAnnotationSubtype.INK;
1271
+ inkList: PdfInkListObject[];
1272
+ }
1273
+ /**
1274
+ * Pdf polygon annotation
1275
+ *
1276
+ * @public
1277
+ */
1278
+ interface PdfPolygonAnnoObject extends PdfAnnotationObjectBase {
1279
+ /** {@inheritDoc PdfAnnotationObjectBase.type} */
1280
+ type: PdfAnnotationSubtype.POLYGON;
1281
+ /**
1282
+ * vertices of annotation
1283
+ */
1284
+ vertices: Position[];
1285
+ }
1286
+ /**
1287
+ * PDF polyline annotation
1288
+ *
1289
+ * @public
1290
+ */
1291
+ interface PdfPolylineAnnoObject extends PdfAnnotationObjectBase {
1292
+ /** {@inheritDoc PdfAnnotationObjectBase.type} */
1293
+ type: PdfAnnotationSubtype.POLYLINE;
1294
+ /**
1295
+ * vertices of annotation
1296
+ */
1297
+ vertices: Position[];
1298
+ }
1299
+ /**
1300
+ * PDF line annotation
1301
+ *
1302
+ * @public
1303
+ */
1304
+ interface PdfLineAnnoObject extends PdfAnnotationObjectBase {
1305
+ /** {@inheritDoc PdfAnnotationObjectBase.type} */
1306
+ type: PdfAnnotationSubtype.LINE;
1307
+ /**
1308
+ * start point of line
1309
+ */
1310
+ startPoint: Position;
1311
+ /**
1312
+ * end point of line
1313
+ */
1314
+ endPoint: Position;
1315
+ }
1316
+ /**
1317
+ * PDF highlight annotation
1318
+ *
1319
+ * @public
1320
+ */
1321
+ interface PdfHighlightAnnoObject extends PdfAnnotationObjectBase {
1322
+ /** {@inheritDoc PdfAnnotationObjectBase.type} */
1323
+ type: PdfAnnotationSubtype.HIGHLIGHT;
1324
+ /**
1325
+ * color of highlight area
1326
+ */
1327
+ color?: PdfAlphaColor;
1328
+ /**
1329
+ * quads of highlight area
1330
+ */
1331
+ segmentRects: Rect[];
1332
+ }
1333
+ /**
1334
+ * Matrix for transformation, in the form [a b c d e f], equivalent to:
1335
+ * | a b 0 |
1336
+ * | c d 0 |
1337
+ * | e f 1 |
1338
+ *
1339
+ * Translation is performed with [1 0 0 1 tx ty].
1340
+ * Scaling is performed with [sx 0 0 sy 0 0].
1341
+ * See PDF Reference 1.7, 4.2.2 Common Transformations for more.
1342
+ */
1343
+ interface PdfTransformMatrix {
1344
+ a: number;
1345
+ b: number;
1346
+ c: number;
1347
+ d: number;
1348
+ e: number;
1349
+ f: number;
1350
+ }
1351
+ /**
1352
+ * type of segment type in pdf path object
1353
+ *
1354
+ * @public
1355
+ */
1356
+ declare enum PdfSegmentObjectType {
1357
+ UNKNOWN = -1,
1358
+ LINETO = 0,
1359
+ BEZIERTO = 1,
1360
+ MOVETO = 2
1361
+ }
1362
+ /**
1363
+ * segment of path object
1364
+ *
1365
+ * @public
1366
+ */
1367
+ interface PdfSegmentObject {
1368
+ type: PdfSegmentObjectType;
1369
+ /**
1370
+ * point of the segment
1371
+ */
1372
+ point: Position;
1373
+ /**
1374
+ * whether this segment close the path
1375
+ */
1376
+ isClosed: boolean;
1377
+ }
1378
+ /**
1379
+ * Pdf path object
1380
+ *
1381
+ * @public
1382
+ */
1383
+ interface PdfPathObject {
1384
+ type: PdfPageObjectType.PATH;
1385
+ /**
1386
+ * bound that contains the path
1387
+ */
1388
+ bounds: {
1389
+ left: number;
1390
+ bottom: number;
1391
+ right: number;
1392
+ top: number;
1393
+ };
1394
+ /**
1395
+ * segments of the path
1396
+ */
1397
+ segments: PdfSegmentObject[];
1398
+ /**
1399
+ * transform matrix
1400
+ */
1401
+ matrix: PdfTransformMatrix;
1402
+ }
1403
+ /**
1404
+ * Pdf image object
1405
+ *
1406
+ * @public
1407
+ */
1408
+ interface PdfImageObject {
1409
+ type: PdfPageObjectType.IMAGE;
1410
+ /**
1411
+ * data of the image
1412
+ */
1413
+ imageData: ImageData;
1414
+ /**
1415
+ * transform matrix
1416
+ */
1417
+ matrix: PdfTransformMatrix;
1418
+ }
1419
+ /**
1420
+ * Pdf form object
1421
+ *
1422
+ * @public
1423
+ */
1424
+ interface PdfFormObject {
1425
+ type: PdfPageObjectType.FORM;
1426
+ /**
1427
+ * objects that in this form object
1428
+ */
1429
+ objects: (PdfImageObject | PdfPathObject | PdfFormObject)[];
1430
+ /**
1431
+ * transform matrix
1432
+ */
1433
+ matrix: PdfTransformMatrix;
1434
+ }
1435
+ /**
1436
+ * Contents type of pdf stamp annotation
1437
+ *
1438
+ * @public
1439
+ */
1440
+ type PdfStampAnnoObjectContents = Array<PdfPathObject | PdfImageObject | PdfFormObject>;
1441
+ /**
1442
+ * Pdf stamp annotation
1443
+ *
1444
+ * @public
1445
+ */
1446
+ interface PdfStampAnnoObject extends PdfAnnotationObjectBase {
1447
+ /** {@inheritDoc PdfAnnotationObjectBase.type} */
1448
+ type: PdfAnnotationSubtype.STAMP;
1449
+ /**
1450
+ * contents in this stamp annotation
1451
+ */
1452
+ contents: PdfStampAnnoObjectContents;
1453
+ }
1454
+ /**
1455
+ * Pdf circle annotation
1456
+ *
1457
+ * @public
1458
+ */
1459
+ interface PdfCircleAnnoObject extends PdfAnnotationObjectBase {
1460
+ /** {@inheritDoc PdfAnnotationObjectBase.type} */
1461
+ type: PdfAnnotationSubtype.CIRCLE;
1462
+ }
1463
+ /**
1464
+ * Pdf square annotation
1465
+ *
1466
+ * @public
1467
+ */
1468
+ interface PdfSquareAnnoObject extends PdfAnnotationObjectBase {
1469
+ /** {@inheritDoc PdfAnnotationObjectBase.type} */
1470
+ type: PdfAnnotationSubtype.SQUARE;
1471
+ }
1472
+ /**
1473
+ * Pdf squiggly annotation
1474
+ *
1475
+ * @public
1476
+ */
1477
+ interface PdfSquigglyAnnoObject extends PdfAnnotationObjectBase {
1478
+ /** {@inheritDoc PdfAnnotationObjectBase.type} */
1479
+ type: PdfAnnotationSubtype.SQUIGGLY;
1480
+ }
1481
+ /**
1482
+ * Pdf underline annotation
1483
+ *
1484
+ * @public
1485
+ */
1486
+ interface PdfUnderlineAnnoObject extends PdfAnnotationObjectBase {
1487
+ /** {@inheritDoc PdfAnnotationObjectBase.type} */
1488
+ type: PdfAnnotationSubtype.UNDERLINE;
1489
+ }
1490
+ /**
1491
+ * Pdf strike out annotation
1492
+ *
1493
+ * @public
1494
+ */
1495
+ interface PdfStrikeOutAnnoObject extends PdfAnnotationObjectBase {
1496
+ /** {@inheritDoc PdfAnnotationObjectBase.type} */
1497
+ type: PdfAnnotationSubtype.STRIKEOUT;
1498
+ }
1499
+ /**
1500
+ * Pdf caret annotation
1501
+ *
1502
+ * @public
1503
+ */
1504
+ interface PdfCaretAnnoObject extends PdfAnnotationObjectBase {
1505
+ /** {@inheritDoc PdfAnnotationObjectBase.type} */
1506
+ type: PdfAnnotationSubtype.CARET;
1507
+ }
1508
+ /**
1509
+ * Pdf free text annotation
1510
+ *
1511
+ * @public
1512
+ */
1513
+ interface PdfFreeTextAnnoObject extends PdfAnnotationObjectBase {
1514
+ /** {@inheritDoc PdfAnnotationObjectBase.type} */
1515
+ type: PdfAnnotationSubtype.FREETEXT;
1516
+ contents: string;
1517
+ }
1518
+ /**
1519
+ * All annotation that support
1520
+ *
1521
+ * @public
1522
+ */
1523
+ type PdfSupportedAnnoObject = PdfInkAnnoObject | PdfTextAnnoObject | PdfLinkAnnoObject | PdfPolygonAnnoObject | PdfPolylineAnnoObject | PdfHighlightAnnoObject | PdfLineAnnoObject | PdfWidgetAnnoObject | PdfFileAttachmentAnnoObject | PdfStampAnnoObject | PdfSquareAnnoObject | PdfCircleAnnoObject | PdfSquigglyAnnoObject | PdfUnderlineAnnoObject | PdfStrikeOutAnnoObject | PdfCaretAnnoObject | PdfFreeTextAnnoObject;
1524
+ /**
1525
+ * Pdf annotation that does not support
1526
+ *
1527
+ * @public
1528
+ */
1529
+ interface PdfUnsupportedAnnoObject extends PdfAnnotationObjectBase {
1530
+ type: Exclude<PdfAnnotationSubtype, PdfSupportedAnnoObject['type']>;
1531
+ }
1532
+ /**
1533
+ * all annotations
1534
+ *
1535
+ * @public
1536
+ */
1537
+ type PdfAnnotationObject = PdfSupportedAnnoObject | PdfUnsupportedAnnoObject;
1538
+ /**
1539
+ * Pdf attachment
1540
+ *
1541
+ * @public
1542
+ */
1543
+ interface PdfAttachmentObject {
1544
+ index: number;
1545
+ name: string;
1546
+ creationDate: string;
1547
+ checksum: string;
1548
+ }
1549
+ /**
1550
+ * Pdf engine features
1551
+ *
1552
+ * @public
1553
+ */
1554
+ declare enum PdfEngineFeature {
1555
+ RenderPage = 0,
1556
+ RenderPageRect = 1,
1557
+ Thumbnails = 2,
1558
+ Bookmarks = 3,
1559
+ Annotations = 4
1560
+ }
1561
+ /**
1562
+ * All operations for this engine
1563
+ *
1564
+ * @public
1565
+ */
1566
+ declare enum PdfEngineOperation {
1567
+ Create = 0,
1568
+ Read = 1,
1569
+ Update = 2,
1570
+ Delete = 3
1571
+ }
1572
+ /**
1573
+ * flags to match the text during searching
1574
+ *
1575
+ * @public
1576
+ */
1577
+ declare enum MatchFlag {
1578
+ None = 0,
1579
+ MatchCase = 1,
1580
+ MatchWholeWord = 2,
1581
+ MatchConsecutive = 4
1582
+ }
1583
+ /**
1584
+ * Union all the flags
1585
+ * @param flags - all the flags
1586
+ * @returns union of flags
1587
+ *
1588
+ * @public
1589
+ */
1590
+ declare function unionFlags(flags: MatchFlag[]): MatchFlag;
1591
+ /**
1592
+ * Targe for searching
1593
+ *
1594
+ * @public
1595
+ */
1596
+ interface SearchTarget {
1597
+ keyword: string;
1598
+ flags: MatchFlag[];
1599
+ }
1600
+ /**
1601
+ * compare 2 search target
1602
+ * @param targetA - first target for search
1603
+ * @param targetB - second target for search
1604
+ * @returns whether 2 search target are the same
1605
+ *
1606
+ * @public
1607
+ */
1608
+ declare function compareSearchTarget(targetA: SearchTarget, targetB: SearchTarget): boolean;
1609
+ /** Context of one hit */
1610
+ interface TextContext {
1611
+ /** Complete words that come *before* the hit (no ellipsis) */
1612
+ before: string;
1613
+ /** Exactly the text that matched (case-preserved) */
1614
+ match: string;
1615
+ /** Complete words that come *after* the hit (no ellipsis) */
1616
+ after: string;
1617
+ /** `true` ⇢ there were more words on the left that we cut off */
1618
+ truncatedLeft: boolean;
1619
+ /** `true` ⇢ there were more words on the right that we cut off */
1620
+ truncatedRight: boolean;
1621
+ }
1622
+ /**
1623
+ * search result
1624
+ *
1625
+ * @public
1626
+ */
1627
+ interface SearchResult {
1628
+ /**
1629
+ * Index of the pdf page
1630
+ */
1631
+ pageIndex: number;
1632
+ /**
1633
+ * index of the first character
1634
+ */
1635
+ charIndex: number;
1636
+ /**
1637
+ * count of the characters
1638
+ */
1639
+ charCount: number;
1640
+ /**
1641
+ * highlight rects
1642
+ */
1643
+ rects: Rect[];
1644
+ /**
1645
+ * context of the hit
1646
+ */
1647
+ context: TextContext;
1648
+ }
1649
+ /**
1650
+ * Results of searching through the entire document
1651
+ */
1652
+ interface SearchAllPagesResult {
1653
+ /**
1654
+ * Array of all search results across all pages
1655
+ */
1656
+ results: SearchResult[];
1657
+ /**
1658
+ * Total number of results found
1659
+ */
1660
+ total: number;
1661
+ }
1662
+ /**
1663
+ * Glyph object
1664
+ *
1665
+ * @public
1666
+ */
1667
+ interface PdfGlyphObject {
1668
+ /**
1669
+ * Origin of the glyph
1670
+ */
1671
+ origin: {
1672
+ x: number;
1673
+ y: number;
1674
+ };
1675
+ /**
1676
+ * Size of the glyph
1677
+ */
1678
+ size: {
1679
+ width: number;
1680
+ height: number;
1681
+ };
1682
+ /**
1683
+ * Whether the glyph is a space
1684
+ */
1685
+ isSpace?: boolean;
1686
+ /**
1687
+ * Whether the glyph is a empty
1688
+ */
1689
+ isEmpty?: boolean;
1690
+ }
1691
+ /**
1692
+ * Glyph object
1693
+ *
1694
+ * @public
1695
+ */
1696
+ interface PdfGlyphSlim {
1697
+ /**
1698
+ * X coordinate of the glyph
1699
+ */
1700
+ x: number;
1701
+ /**
1702
+ * Y coordinate of the glyph
1703
+ */
1704
+ y: number;
1705
+ /**
1706
+ * Width of the glyph
1707
+ */
1708
+ width: number;
1709
+ /**
1710
+ * Height of the glyph
1711
+ */
1712
+ height: number;
1713
+ /**
1714
+ * Flags of the glyph
1715
+ */
1716
+ flags: number;
1717
+ }
1718
+ /**
1719
+ * Run object
1720
+ *
1721
+ * @public
1722
+ */
1723
+ interface PdfRun {
1724
+ /**
1725
+ * Rectangle of the run
1726
+ */
1727
+ rect: {
1728
+ x: number;
1729
+ y: number;
1730
+ width: number;
1731
+ height: number;
1732
+ };
1733
+ /**
1734
+ * Start index of the run
1735
+ */
1736
+ charStart: number;
1737
+ /**
1738
+ * Glyphs of the run
1739
+ */
1740
+ glyphs: PdfGlyphSlim[];
1741
+ }
1742
+ /**
1743
+ * Page geometry
1744
+ *
1745
+ * @public
1746
+ */
1747
+ interface PdfPageGeometry {
1748
+ /**
1749
+ * Runs of the page
1750
+ */
1751
+ runs: PdfRun[];
1752
+ }
1753
+ /**
1754
+ * form field value
1755
+ * @public
1756
+ */
1757
+ type FormFieldValue = {
1758
+ kind: 'text';
1759
+ text: string;
1760
+ } | {
1761
+ kind: 'selection';
1762
+ index: number;
1763
+ isSelected: boolean;
1764
+ } | {
1765
+ kind: 'checked';
1766
+ isChecked: boolean;
1767
+ };
1768
+ /**
1769
+ * Transformation that will be applied to annotation
1770
+ *
1771
+ * @public
1772
+ */
1773
+ interface PdfAnnotationTransformation {
1774
+ /**
1775
+ * Translated offset
1776
+ */
1777
+ offset: Position;
1778
+ /**
1779
+ * Scaled factors
1780
+ */
1781
+ scale: Size;
1782
+ }
1783
+ /**
1784
+ * Render options
1785
+ *
1786
+ * @public
1787
+ */
1788
+ interface PdfRenderOptions {
1789
+ /**
1790
+ * Whether needs to render the page with annotations
1791
+ */
1792
+ withAnnotations: boolean;
1793
+ }
1794
+ /**
1795
+ * source can be byte array contains pdf content
1796
+ *
1797
+ * @public
1798
+ */
1799
+ type PdfFileContent = ArrayBuffer;
1800
+ declare enum PdfPermission {
1801
+ PrintDocument = 8,
1802
+ ModifyContent = 16,
1803
+ CopyOrExtract = 32,
1804
+ AddOrModifyTextAnnot = 64,
1805
+ FillInExistingForm = 512,
1806
+ ExtractTextOrGraphics = 1024,
1807
+ AssembleDocument = 2048,
1808
+ PrintHighQuality = 4096
1809
+ }
1810
+ declare enum PdfPageFlattenFlag {
1811
+ Display = 0,
1812
+ Print = 1
1813
+ }
1814
+ declare enum PdfPageFlattenResult {
1815
+ Fail = 0,
1816
+ Success = 1,
1817
+ NothingToDo = 2
1818
+ }
1819
+ /**
1820
+ * Pdf File without content
1821
+ *
1822
+ * @public
1823
+ */
1824
+ interface PdfFileWithoutContent {
1825
+ /**
1826
+ * id of file
1827
+ */
1828
+ id: string;
1829
+ }
1830
+ interface PdfFileLoader extends PdfFileWithoutContent {
1831
+ /**
1832
+ * length of file
1833
+ */
1834
+ fileLength: number;
1835
+ /**
1836
+ * read block of file
1837
+ * @param offset - offset of file
1838
+ * @param length - length of file
1839
+ * @returns block of file
1840
+ */
1841
+ callback: (offset: number, length: number) => Uint8Array;
1842
+ }
1843
+ /**
1844
+ * Pdf File
1845
+ *
1846
+ * @public
1847
+ */
1848
+ interface PdfFile extends PdfFileWithoutContent {
1849
+ /**
1850
+ * content of file
1851
+ */
1852
+ content: PdfFileContent;
1853
+ }
1854
+ interface PdfFileUrl extends PdfFileWithoutContent {
1855
+ url: string;
1856
+ }
1857
+ interface PdfUrlOptions {
1858
+ mode?: 'auto' | 'range-request' | 'full-fetch';
1859
+ password?: string;
1860
+ }
1861
+ declare enum PdfErrorCode {
1862
+ Ok = 0,// #define FPDF_ERR_SUCCESS 0 // No error.
1863
+ Unknown = 1,// #define FPDF_ERR_UNKNOWN 1 // Unknown error.
1864
+ NotFound = 2,// #define FPDF_ERR_FILE 2 // File not found or could not be opened.
1865
+ WrongFormat = 3,// #define FPDF_ERR_FORMAT 3 // File not in PDF format or corrupted.
1866
+ Password = 4,// #define FPDF_ERR_PASSWORD 4 // Password required or incorrect password.
1867
+ Security = 5,// #define FPDF_ERR_SECURITY 5 // Unsupported security scheme.
1868
+ PageError = 6,// #define FPDF_ERR_PAGE 6 // Page not found or content error.
1869
+ XFALoad = 7,// #ifdef PDF_ENABLE_XFA
1870
+ XFALayout = 8,//
1871
+ Cancelled = 9,
1872
+ Initialization = 10,
1873
+ NotReady = 11,
1874
+ NotSupport = 12,
1875
+ LoadDoc = 13,
1876
+ DocNotOpen = 14,
1877
+ CantCloseDoc = 15,
1878
+ CantCreateNewDoc = 16,
1879
+ CantImportPages = 17,
1880
+ CantCreateAnnot = 18,
1881
+ CantSetAnnotRect = 19,
1882
+ CantSetAnnotContent = 20,
1883
+ CantRemoveInkList = 21,
1884
+ CantAddInkStoke = 22,
1885
+ CantReadAttachmentSize = 23,
1886
+ CantReadAttachmentContent = 24,
1887
+ CantFocusAnnot = 25,
1888
+ CantSelectText = 26,
1889
+ CantSelectOption = 27,
1890
+ CantCheckField = 28
1891
+ }
1892
+ interface PdfErrorReason {
1893
+ code: PdfErrorCode;
1894
+ message: string;
1895
+ }
1896
+ type PdfEngineError = TaskError<PdfErrorReason>;
1897
+ type PdfTask<R> = Task<R, PdfErrorReason>;
1898
+ declare class PdfTaskHelper {
1899
+ /**
1900
+ * Create a task
1901
+ * @returns new task
1902
+ */
1903
+ static create<R>(): Task<R, PdfErrorReason>;
1904
+ /**
1905
+ * Create a task that has been resolved with value
1906
+ * @param result - resolved value
1907
+ * @returns resolved task
1908
+ */
1909
+ static resolve<R>(result: R): Task<R, PdfErrorReason>;
1910
+ /**
1911
+ * Create a task that has been rejected with error
1912
+ * @param reason - rejected error
1913
+ * @returns rejected task
1914
+ */
1915
+ static reject<T = any>(reason: PdfErrorReason): Task<T, PdfErrorReason>;
1916
+ /**
1917
+ * Create a task that has been aborted with error
1918
+ * @param reason - aborted error
1919
+ * @returns aborted task
1920
+ */
1921
+ static abort<T = any>(reason: PdfErrorReason): Task<T, PdfErrorReason>;
1922
+ }
1923
+ /**
1924
+ * Pdf engine
1925
+ *
1926
+ * @public
1927
+ */
1928
+ interface PdfEngine<T = Blob> {
1929
+ /**
1930
+ * Check whether pdf engine supports this feature
1931
+ * @param feature - which feature want to check
1932
+ * @returns support or not
1933
+ */
1934
+ isSupport?: (feature: PdfEngineFeature) => PdfTask<PdfEngineOperation[]>;
1935
+ /**
1936
+ * Initialize the engine
1937
+ * @returns task that indicate whether initialization is successful
1938
+ */
1939
+ initialize?: () => PdfTask<boolean>;
1940
+ /**
1941
+ * Destroy the engine
1942
+ * @returns task that indicate whether destroy is successful
1943
+ */
1944
+ destroy?: () => PdfTask<boolean>;
1945
+ /**
1946
+ * Open a PDF from a URL with specified mode
1947
+ * @param url - The PDF file URL
1948
+ * @param options - Additional options including mode (auto, range-request, full-fetch) and password
1949
+ * @returns Task that resolves with the PdfDocumentObject or an error
1950
+ */
1951
+ openDocumentUrl: (file: PdfFileUrl, options?: PdfUrlOptions) => PdfTask<PdfDocumentObject>;
1952
+ /**
1953
+ * Open pdf document from buffer
1954
+ * @param file - pdf file
1955
+ * @param password - protected password for this file
1956
+ * @returns task that contains the file or error
1957
+ */
1958
+ openDocumentFromBuffer: (file: PdfFile, password: string) => PdfTask<PdfDocumentObject>;
1959
+ /**
1960
+ * Open pdf document from loader
1961
+ * @param file - pdf file
1962
+ * @param password - protected password for this file
1963
+ * @returns task that contains the file or error
1964
+ */
1965
+ openDocumentFromLoader: (file: PdfFileLoader, password: string) => PdfTask<PdfDocumentObject>;
1966
+ /**
1967
+ * Get the metadata of the file
1968
+ * @param doc - pdf document
1969
+ * @returns task that contains the metadata or error
1970
+ */
1971
+ getMetadata: (doc: PdfDocumentObject) => PdfTask<PdfMetadataObject>;
1972
+ /**
1973
+ * Get permissions of the file
1974
+ * @param doc - pdf document
1975
+ * @returns task that contains a 32-bit integer indicating permission flags
1976
+ */
1977
+ getDocPermissions: (doc: PdfDocumentObject) => PdfTask<number>;
1978
+ /**
1979
+ * Get the user permissions of the file
1980
+ * @param doc - pdf document
1981
+ * @returns task that contains a 32-bit integer indicating permission flags
1982
+ */
1983
+ getDocUserPermissions: (doc: PdfDocumentObject) => PdfTask<number>;
1984
+ /**
1985
+ * Get the signatures of the file
1986
+ * @param doc - pdf document
1987
+ * @returns task that contains the signatures or error
1988
+ */
1989
+ getSignatures: (doc: PdfDocumentObject) => PdfTask<PdfSignatureObject[]>;
1990
+ /**
1991
+ * Get the bookmarks of the file
1992
+ * @param doc - pdf document
1993
+ * @returns task that contains the bookmarks or error
1994
+ */
1995
+ getBookmarks: (doc: PdfDocumentObject) => PdfTask<PdfBookmarksObject>;
1996
+ /**
1997
+ * Render the specified pdf page
1998
+ * @param doc - pdf document
1999
+ * @param page - pdf page
2000
+ * @param scaleFactor - factor of scaling
2001
+ * @param rotation - rotated angle
2002
+ * @param dpr - devicePixelRatio
2003
+ * @param options - render options
2004
+ * @returns task contains the rendered image or error
2005
+ */
2006
+ renderPage: (doc: PdfDocumentObject, page: PdfPageObject, scaleFactor: number, rotation: Rotation, dpr: number, options: PdfRenderOptions) => PdfTask<T>;
2007
+ /**
2008
+ * Render the specified rect of pdf page
2009
+ * @param doc - pdf document
2010
+ * @param page - pdf page
2011
+ * @param scaleFactor - factor of scaling
2012
+ * @param rotation - rotated angle
2013
+ * @param dpr - devicePixelRatio
2014
+ * @param rect - target rect
2015
+ * @param options - render options
2016
+ * @returns task contains the rendered image or error
2017
+ */
2018
+ renderPageRect: (doc: PdfDocumentObject, page: PdfPageObject, scaleFactor: number, rotation: Rotation, dpr: number, rect: Rect, options: PdfRenderOptions) => PdfTask<T>;
2019
+ /**
2020
+ * Get annotations of pdf page
2021
+ * @param doc - pdf document
2022
+ * @param page - pdf page
2023
+ * @param scaleFactor - factor of scaling
2024
+ * @param rotation - rotated angle
2025
+ * @returns task contains the annotations or error
2026
+ */
2027
+ getPageAnnotations: (doc: PdfDocumentObject, page: PdfPageObject) => PdfTask<PdfAnnotationObject[]>;
2028
+ /**
2029
+ * Create a annotation on specified page
2030
+ * @param doc - pdf document
2031
+ * @param page - pdf page
2032
+ * @param annotation - new annotations
2033
+ * @returns task whether the annotations is created successfully
2034
+ */
2035
+ createPageAnnotation: (doc: PdfDocumentObject, page: PdfPageObject, annotation: PdfAnnotationObject) => PdfTask<boolean>;
2036
+ /**
2037
+ * Transform the annotation
2038
+ * @param doc - pdf document
2039
+ * @param page - pdf page
2040
+ * @param annotation - new annotations
2041
+ * @param transformation - transformation applied on the annotation
2042
+ * @returns task whether the annotations is transformed successfully
2043
+ */
2044
+ transformPageAnnotation: (doc: PdfDocumentObject, page: PdfPageObject, annotation: PdfAnnotationObject, transformation: PdfAnnotationTransformation) => PdfTask<boolean>;
2045
+ /**
2046
+ * Remove a annotation on specified page
2047
+ * @param doc - pdf document
2048
+ * @param page - pdf page
2049
+ * @param annotation - new annotations
2050
+ * @returns task whether the annotations is removed successfully
2051
+ */
2052
+ removePageAnnotation: (doc: PdfDocumentObject, page: PdfPageObject, annotation: PdfAnnotationObject) => PdfTask<boolean>;
2053
+ /**
2054
+ * get all text rects in pdf page
2055
+ * @param doc - pdf document
2056
+ * @param page - pdf page
2057
+ * @param scaleFactor - factor of scaling
2058
+ * @param rotation - rotated angle
2059
+ * @returns task contains the text rects or error
2060
+ */
2061
+ getPageTextRects: (doc: PdfDocumentObject, page: PdfPageObject, scaleFactor: number, rotation: Rotation) => PdfTask<PdfTextRectObject[]>;
2062
+ /**
2063
+ * Render the thumbnail of specified pdf page
2064
+ * @param doc - pdf document
2065
+ * @param page - pdf page
2066
+ * @param scaleFactor - factor of scaling
2067
+ * @param rotation - rotated angle
2068
+ * @param dpr - devicePixelRatio
2069
+ * @param options - render options
2070
+ * @returns task contains the rendered image or error
2071
+ */
2072
+ renderThumbnail: (doc: PdfDocumentObject, page: PdfPageObject, scaleFactor: number, rotation: Rotation, dpr: number) => PdfTask<T>;
2073
+ /**
2074
+ * Search across all pages in the document
2075
+ * @param doc - pdf document
2076
+ * @param keyword - search keyword
2077
+ * @param flags - match flags for search
2078
+ * @returns Task contains all search results throughout the document
2079
+ */
2080
+ searchAllPages: (doc: PdfDocumentObject, keyword: string, flags?: MatchFlag[]) => PdfTask<SearchAllPagesResult>;
2081
+ /**
2082
+ * Get all annotations in this file
2083
+ * @param doc - pdf document
2084
+ * @returns task that contains the annotations or error
2085
+ */
2086
+ getAllAnnotations: (doc: PdfDocumentObject) => PdfTask<Record<number, PdfAnnotationObject[]>>;
2087
+ /**
2088
+ * Get all attachments in this file
2089
+ * @param doc - pdf document
2090
+ * @returns task that contains the attachments or error
2091
+ */
2092
+ getAttachments: (doc: PdfDocumentObject) => PdfTask<PdfAttachmentObject[]>;
2093
+ /**
2094
+ * Read content of pdf attachment
2095
+ * @param doc - pdf document
2096
+ * @param attachment - pdf attachments
2097
+ * @returns task that contains the content of specified attachment or error
2098
+ */
2099
+ readAttachmentContent: (doc: PdfDocumentObject, attachment: PdfAttachmentObject) => PdfTask<ArrayBuffer>;
2100
+ /**
2101
+ * Set form field value
2102
+ * @param doc - pdf document
2103
+ * @param page - pdf page
2104
+ * @param annotation - pdf annotation
2105
+ * @param text - text value
2106
+ */
2107
+ setFormFieldValue: (doc: PdfDocumentObject, page: PdfPageObject, annotation: PdfWidgetAnnoObject, value: FormFieldValue) => PdfTask<boolean>;
2108
+ /**
2109
+ * Flatten annotations and form fields into the page contents.
2110
+ * @param doc - pdf document
2111
+ * @param page - pdf page
2112
+ * @param flag - flatten flag
2113
+ */
2114
+ flattenPage: (doc: PdfDocumentObject, page: PdfPageObject, flag: PdfPageFlattenFlag) => PdfTask<PdfPageFlattenResult>;
2115
+ /**
2116
+ * Extract pdf pages to a new file
2117
+ * @param doc - pdf document
2118
+ * @param pageIndexes - indexes of pdf pages
2119
+ * @returns task contains the new pdf file content
2120
+ */
2121
+ extractPages: (doc: PdfDocumentObject, pageIndexes: number[]) => PdfTask<ArrayBuffer>;
2122
+ /**
2123
+ * Extract text on specified pdf pages
2124
+ * @param doc - pdf document
2125
+ * @param pageIndexes - indexes of pdf pages
2126
+ * @returns task contains the text
2127
+ */
2128
+ extractText: (doc: PdfDocumentObject, pageIndexes: number[]) => PdfTask<string>;
2129
+ /**
2130
+ * Get all glyphs in the specified pdf page
2131
+ * @param doc - pdf document
2132
+ * @param page - pdf page
2133
+ * @returns task contains the glyphs
2134
+ */
2135
+ getPageGlyphs: (doc: PdfDocumentObject, page: PdfPageObject) => PdfTask<PdfGlyphObject[]>;
2136
+ /**
2137
+ * Get the geometry of the specified pdf page
2138
+ * @param doc - pdf document
2139
+ * @param page - pdf page
2140
+ * @returns task contains the geometry
2141
+ */
2142
+ getPageGeometry: (doc: PdfDocumentObject, page: PdfPageObject) => PdfTask<PdfPageGeometry>;
2143
+ /**
2144
+ * Merge multiple pdf documents
2145
+ * @param files - all the pdf files
2146
+ * @returns task contains the merged pdf file
2147
+ */
2148
+ merge: (files: PdfFile[]) => PdfTask<PdfFile>;
2149
+ /**
2150
+ * Merge specific pages from multiple PDF documents in a custom order
2151
+ * @param mergeConfigs Array of configurations specifying which pages to merge from which documents
2152
+ * @returns A PdfTask that resolves with the merged PDF file
2153
+ * @public
2154
+ */
2155
+ mergePages: (mergeConfigs: Array<{
2156
+ docId: string;
2157
+ pageIndices: number[];
2158
+ }>) => PdfTask<PdfFile>;
2159
+ /**
2160
+ * Save a copy of pdf document
2161
+ * @param doc - pdf document
2162
+ * @returns task contains the new pdf file content
2163
+ */
2164
+ saveAsCopy: (doc: PdfDocumentObject) => PdfTask<ArrayBuffer>;
2165
+ /**
2166
+ * Close pdf document
2167
+ * @param doc - pdf document
2168
+ * @returns task that file is closed or not
2169
+ */
2170
+ closeDocument: (doc: PdfDocumentObject) => PdfTask<boolean>;
2171
+ }
2172
+ /**
2173
+ * Method name of PdfEngine interface
2174
+ *
2175
+ * @public
2176
+ */
2177
+ type PdfEngineMethodName = keyof Required<PdfEngine>;
2178
+ /**
2179
+ * Arguments of PdfEngine method
2180
+ *
2181
+ * @public
2182
+ */
2183
+ type PdfEngineMethodArgs<P extends PdfEngineMethodName> = Readonly<Parameters<Required<PdfEngine>[P]>>;
2184
+ /**
2185
+ * Return type of PdfEngine method
2186
+ *
2187
+ * @public
2188
+ */
2189
+ type PdfEngineMethodReturnType<P extends PdfEngineMethodName> = ReturnType<Required<PdfEngine>[P]>;
2190
+
2191
+ /**
2192
+ * Library contains the common definitions of data types and logic
2193
+ *
2194
+ * @remarks
2195
+ * The `@embedpdf/models` defines the interface and classes which are used to
2196
+ * handling PDF files.
2197
+ *
2198
+ * @packageDocumentation
2199
+ */
2200
+
2201
+ /**
2202
+ * ignore will do nothing when called.
2203
+ *
2204
+ * @public
2205
+ */
2206
+ declare function ignore(): void;
2207
+
2208
+ export { AllLogger, AppearanceMode, type Box, ConsoleLogger, type FormFieldValue, LevelLogger, LogLevel, type Logger, MatchFlag, NoopLogger, PDF_FORM_FIELD_FLAG, PDF_FORM_FIELD_TYPE, type PdfActionObject, PdfActionType, type PdfAlphaColor, type PdfAnnotationObject, type PdfAnnotationObjectBase, PdfAnnotationObjectStatus, PdfAnnotationState, PdfAnnotationStateModel, PdfAnnotationSubtype, PdfAnnotationSubtypeName, type PdfAnnotationTransformation, type PdfAttachmentObject, type PdfBookmarkObject, type PdfBookmarksObject, type PdfCaretAnnoObject, type PdfCircleAnnoObject, type PdfDestinationObject, type PdfDocumentObject, type PdfEngine, type PdfEngineError, PdfEngineFeature, type PdfEngineMethodArgs, type PdfEngineMethodName, type PdfEngineMethodReturnType, PdfEngineOperation, PdfErrorCode, type PdfErrorReason, type PdfFile, type PdfFileAttachmentAnnoObject, type PdfFileContent, type PdfFileLoader, type PdfFileUrl, type PdfFileWithoutContent, type PdfFormObject, type PdfFreeTextAnnoObject, type PdfGlyphObject, type PdfGlyphSlim, type PdfHighlightAnnoObject, type PdfImage, type PdfImageObject, type PdfInkAnnoObject, type PdfInkListObject, type PdfLineAnnoObject, type PdfLinkAnnoObject, type PdfLinkTarget, type PdfMetadataObject, PdfPageFlattenFlag, PdfPageFlattenResult, type PdfPageGeometry, type PdfPageObject, PdfPageObjectType, type PdfPageObjectWithRotatedSize, type PdfPathObject, PdfPermission, type PdfPolygonAnnoObject, type PdfPolylineAnnoObject, type PdfPopupAnnoObject, type PdfRenderOptions, type PdfRun, type PdfSegmentObject, PdfSegmentObjectType, type PdfSignatureObject, type PdfSquareAnnoObject, type PdfSquigglyAnnoObject, type PdfStampAnnoObject, type PdfStampAnnoObjectContents, type PdfStrikeOutAnnoObject, type PdfSupportedAnnoObject, type PdfTask, PdfTaskHelper, type PdfTextAnnoObject, type PdfTextRectObject, type PdfTransformMatrix, type PdfUnderlineAnnoObject, type PdfUnsupportedAnnoObject, type PdfUrlOptions, type PdfWidgetAnnoField, type PdfWidgetAnnoObject, type PdfWidgetAnnoOption, PdfZoomMode, PerfLogger, type Position, type Quad, type Rect, type RejectedCallback, type ResolvedCallback, Rotation, type SearchAllPagesResult, type SearchResult, type SearchTarget, type Size, Task, TaskAbortedError, type TaskError, TaskRejectedError, type TaskReturn, TaskStage, type TaskState, type TextContext, boundingRect, calculateAngle, calculateDegree, compareSearchTarget, ignore, quadToRect, restoreOffset, restorePosition, restoreRect, rotatePosition, rotateRect, scalePosition, scaleRect, swap, toIntPos, toIntRect, toIntSize, transformPosition, transformRect, transformSize, unionFlags };