unpdf 1.2.2 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/index.cjs +45 -3
- package/dist/index.d.cts +5 -2
- package/dist/index.d.mts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.mjs +45 -3
- package/dist/pdfjs.mjs +1 -1
- package/dist/types/src/display/annotation_layer.d.ts +5 -0
- package/dist/types/src/display/api.d.ts +41 -19
- package/dist/types/src/display/canvas.d.ts +82 -80
- package/dist/types/src/display/canvas_dependency_tracker.d.ts +144 -0
- package/dist/types/src/display/display_utils.d.ts +1 -1
- package/dist/types/src/display/draw_layer.d.ts +2 -2
- package/dist/types/src/display/editor/alt_text.d.ts +1 -1
- package/dist/types/src/display/editor/annotation_editor_layer.d.ts +1 -1
- package/dist/types/src/display/editor/color_picker.d.ts +2 -2
- package/dist/types/src/display/editor/draw.d.ts +7 -7
- package/dist/types/src/display/editor/drawers/freedraw.d.ts +3 -3
- package/dist/types/src/display/editor/drawers/signaturedraw.d.ts +13 -13
- package/dist/types/src/display/editor/editor.d.ts +7 -1
- package/dist/types/src/display/editor/freetext.d.ts +4 -2
- package/dist/types/src/display/editor/highlight.d.ts +3 -3
- package/dist/types/src/display/editor/stamp.d.ts +1 -1
- package/dist/types/src/display/editor/toolbar.d.ts +3 -3
- package/dist/types/src/display/editor/tools.d.ts +2 -1
- package/dist/types/src/display/fetch_stream.d.ts +2 -2
- package/dist/types/src/display/text_layer.d.ts +9 -9
- package/dist/types/src/display/worker_options.d.ts +2 -2
- package/dist/types/src/shared/util.d.ts +7 -3
- package/dist/types/web/annotation_layer_builder.d.ts +4 -1
- package/dist/types/web/app_options.d.ts +1 -1
- package/dist/types/web/autolinker.d.ts +2 -2
- package/dist/types/web/base_pdf_page_view.d.ts +2 -0
- package/dist/types/web/genericl10n.d.ts +5 -5
- package/dist/types/web/interfaces.d.ts +7 -0
- package/dist/types/web/l10n.d.ts +2 -2
- package/dist/types/web/pdf_link_service.d.ts +7 -0
- package/dist/types/web/pdf_page_detail_view.d.ts +1 -0
- package/dist/types/web/pdf_page_view.d.ts +9 -0
- package/dist/types/web/pdf_thumbnail_view.d.ts +1 -1
- package/dist/types/web/pdf_viewer.d.ts +13 -0
- package/dist/types/web/text_accessibility.d.ts +1 -1
- package/dist/types/web/text_layer_builder.d.ts +4 -4
- package/package.json +8 -8
|
@@ -170,6 +170,7 @@ declare class AnnotationElement {
|
|
|
170
170
|
renderForms: any;
|
|
171
171
|
svgFactory: any;
|
|
172
172
|
annotationStorage: any;
|
|
173
|
+
enableComment: any;
|
|
173
174
|
enableScripting: any;
|
|
174
175
|
hasJSActions: any;
|
|
175
176
|
_fieldObjects: any;
|
|
@@ -177,6 +178,10 @@ declare class AnnotationElement {
|
|
|
177
178
|
container: HTMLElement | undefined;
|
|
178
179
|
get _isEditable(): any;
|
|
179
180
|
get hasPopupData(): boolean;
|
|
181
|
+
get hasCommentButton(): any;
|
|
182
|
+
get commentButtonPosition(): any[] | null;
|
|
183
|
+
get commentButtonColor(): string | null;
|
|
184
|
+
_normalizePoint(point: any): any;
|
|
180
185
|
updateEdited(params: any): void;
|
|
181
186
|
popup: any;
|
|
182
187
|
resetEdited(): void;
|
|
@@ -413,14 +413,6 @@ export type GetAnnotationsParameters = {
|
|
|
413
413
|
* Page render parameters.
|
|
414
414
|
*/
|
|
415
415
|
export type RenderParameters = {
|
|
416
|
-
/**
|
|
417
|
-
* - 2D context of a DOM
|
|
418
|
-
* Canvas object for backwards compatibility; it is recommended to use the
|
|
419
|
-
* `canvas` parameter instead.
|
|
420
|
-
* If the context must absolutely be used to render the page, the canvas must
|
|
421
|
-
* be null.
|
|
422
|
-
*/
|
|
423
|
-
canvasContext: CanvasRenderingContext2D;
|
|
424
416
|
/**
|
|
425
417
|
* - A DOM Canvas object. The default
|
|
426
418
|
* value is the canvas associated with the `canvasContext` parameter if no
|
|
@@ -432,6 +424,14 @@ export type RenderParameters = {
|
|
|
432
424
|
* the `PDFPageProxy.getViewport` method.
|
|
433
425
|
*/
|
|
434
426
|
viewport: PageViewport;
|
|
427
|
+
/**
|
|
428
|
+
* - 2D context of a DOM
|
|
429
|
+
* Canvas object for backwards compatibility; it is recommended to use the
|
|
430
|
+
* `canvas` parameter instead.
|
|
431
|
+
* If the context must absolutely be used to render the page, the canvas must
|
|
432
|
+
* be null.
|
|
433
|
+
*/
|
|
434
|
+
canvasContext?: CanvasRenderingContext2D | undefined;
|
|
435
435
|
/**
|
|
436
436
|
* - Rendering intent, can be 'display', 'print',
|
|
437
437
|
* or 'any'. The default value is 'display'.
|
|
@@ -492,6 +492,16 @@ export type RenderParameters = {
|
|
|
492
492
|
* - Render the page in editing mode.
|
|
493
493
|
*/
|
|
494
494
|
isEditing?: boolean | undefined;
|
|
495
|
+
/**
|
|
496
|
+
* - Record the dependencies and bounding
|
|
497
|
+
* boxes of all PDF operations that render onto the canvas.
|
|
498
|
+
*/
|
|
499
|
+
recordOperations?: boolean | undefined;
|
|
500
|
+
/**
|
|
501
|
+
* - If provided, only run
|
|
502
|
+
* the PDF operations that are included in this set.
|
|
503
|
+
*/
|
|
504
|
+
filteredOperationIndexes?: Set<number> | undefined;
|
|
495
505
|
};
|
|
496
506
|
/**
|
|
497
507
|
* Page getOperatorList parameters.
|
|
@@ -811,7 +821,7 @@ export class PDFDataRangeTransport {
|
|
|
811
821
|
* after which individual pages can be rendered.
|
|
812
822
|
*/
|
|
813
823
|
export class PDFDocumentLoadingTask {
|
|
814
|
-
static
|
|
824
|
+
static #docId: number;
|
|
815
825
|
/**
|
|
816
826
|
* @private
|
|
817
827
|
*/
|
|
@@ -969,6 +979,13 @@ export class PDFDocumentProxy {
|
|
|
969
979
|
* for mapping named attachments to their content.
|
|
970
980
|
*/
|
|
971
981
|
getAttachments(): Promise<any>;
|
|
982
|
+
/**
|
|
983
|
+
* @param {Set<number>} types - The annotation types to retrieve.
|
|
984
|
+
* @param {Set<number>} pageIndexesToSkip
|
|
985
|
+
* @returns {Promise<Array<Object>>} A promise that is resolved with a list of
|
|
986
|
+
* annotations data.
|
|
987
|
+
*/
|
|
988
|
+
getAnnotationsByType(types: Set<number>, pageIndexesToSkip: Set<number>): Promise<Array<Object>>;
|
|
972
989
|
/**
|
|
973
990
|
* @returns {Promise<Object | null>} A promise that is resolved with
|
|
974
991
|
* an {Object} with the JavaScript actions:
|
|
@@ -1218,16 +1235,16 @@ export class PDFDocumentProxy {
|
|
|
1218
1235
|
* Page render parameters.
|
|
1219
1236
|
*
|
|
1220
1237
|
* @typedef {Object} RenderParameters
|
|
1221
|
-
* @property {CanvasRenderingContext2D} canvasContext - 2D context of a DOM
|
|
1222
|
-
* Canvas object for backwards compatibility; it is recommended to use the
|
|
1223
|
-
* `canvas` parameter instead.
|
|
1224
|
-
* If the context must absolutely be used to render the page, the canvas must
|
|
1225
|
-
* be null.
|
|
1226
1238
|
* @property {HTMLCanvasElement|null} canvas - A DOM Canvas object. The default
|
|
1227
1239
|
* value is the canvas associated with the `canvasContext` parameter if no
|
|
1228
1240
|
* value is provided explicitly.
|
|
1229
1241
|
* @property {PageViewport} viewport - Rendering viewport obtained by calling
|
|
1230
1242
|
* the `PDFPageProxy.getViewport` method.
|
|
1243
|
+
* @property {CanvasRenderingContext2D} [canvasContext] - 2D context of a DOM
|
|
1244
|
+
* Canvas object for backwards compatibility; it is recommended to use the
|
|
1245
|
+
* `canvas` parameter instead.
|
|
1246
|
+
* If the context must absolutely be used to render the page, the canvas must
|
|
1247
|
+
* be null.
|
|
1231
1248
|
* @property {string} [intent] - Rendering intent, can be 'display', 'print',
|
|
1232
1249
|
* or 'any'. The default value is 'display'.
|
|
1233
1250
|
* @property {number} [annotationMode] Controls which annotations are rendered
|
|
@@ -1265,6 +1282,10 @@ export class PDFDocumentProxy {
|
|
|
1265
1282
|
* annotation ids with canvases used to render them.
|
|
1266
1283
|
* @property {PrintAnnotationStorage} [printAnnotationStorage]
|
|
1267
1284
|
* @property {boolean} [isEditing] - Render the page in editing mode.
|
|
1285
|
+
* @property {boolean} [recordOperations] - Record the dependencies and bounding
|
|
1286
|
+
* boxes of all PDF operations that render onto the canvas.
|
|
1287
|
+
* @property {Set<number>} [filteredOperationIndexes] - If provided, only run
|
|
1288
|
+
* the PDF operations that are included in this set.
|
|
1268
1289
|
*/
|
|
1269
1290
|
/**
|
|
1270
1291
|
* Page getOperatorList parameters.
|
|
@@ -1327,6 +1348,7 @@ export class PDFPageProxy {
|
|
|
1327
1348
|
objs: PDFObjects;
|
|
1328
1349
|
_intentStates: Map<any, any>;
|
|
1329
1350
|
destroyed: boolean;
|
|
1351
|
+
recordedGroups: any;
|
|
1330
1352
|
/**
|
|
1331
1353
|
* @type {number} Page number of the page. First page is 1.
|
|
1332
1354
|
*/
|
|
@@ -1387,7 +1409,7 @@ export class PDFPageProxy {
|
|
|
1387
1409
|
* @returns {RenderTask} An object that contains a promise that is
|
|
1388
1410
|
* resolved when the page finishes rendering.
|
|
1389
1411
|
*/
|
|
1390
|
-
render({ canvasContext, canvas, viewport, intent, annotationMode, transform, background, optionalContentConfigPromise, annotationCanvasMap, pageColors, printAnnotationStorage, isEditing, }: RenderParameters): RenderTask;
|
|
1412
|
+
render({ canvasContext, canvas, viewport, intent, annotationMode, transform, background, optionalContentConfigPromise, annotationCanvasMap, pageColors, printAnnotationStorage, isEditing, recordOperations, filteredOperationIndexes, }: RenderParameters): RenderTask;
|
|
1391
1413
|
/**
|
|
1392
1414
|
* @param {GetOperatorListParameters} params - Page getOperatorList
|
|
1393
1415
|
* parameters.
|
|
@@ -1470,9 +1492,9 @@ export class PDFPageProxy {
|
|
|
1470
1492
|
* @param {PDFWorkerParameters} params - The worker initialization parameters.
|
|
1471
1493
|
*/
|
|
1472
1494
|
export class PDFWorker {
|
|
1473
|
-
static
|
|
1474
|
-
static
|
|
1475
|
-
static
|
|
1495
|
+
static #fakeWorkerId: number;
|
|
1496
|
+
static #isWorkerDisabled: boolean;
|
|
1497
|
+
static #workerPorts: WeakMap<object, any>;
|
|
1476
1498
|
/**
|
|
1477
1499
|
* @param {PDFWorkerParameters} params - The worker initialization parameters.
|
|
1478
1500
|
* @returns {PDFWorker}
|
|
@@ -1483,7 +1505,7 @@ export class PDFWorker {
|
|
|
1483
1505
|
* @type {string}
|
|
1484
1506
|
*/
|
|
1485
1507
|
static get workerSrc(): string;
|
|
1486
|
-
static get
|
|
1508
|
+
static get #mainThreadWorkerMessageHandler(): any;
|
|
1487
1509
|
static get _setupFakeWorkerGlobal(): any;
|
|
1488
1510
|
constructor({ name, port, verbosity, }?: {
|
|
1489
1511
|
name?: null | undefined;
|
|
@@ -2,7 +2,7 @@ export class CanvasGraphics {
|
|
|
2
2
|
constructor(canvasCtx: any, commonObjs: any, objs: any, canvasFactory: any, filterFactory: any, { optionalContentConfig, markedContentStack }: {
|
|
3
3
|
optionalContentConfig: any;
|
|
4
4
|
markedContentStack?: null | undefined;
|
|
5
|
-
}, annotationCanvasMap: any, pageColors: any);
|
|
5
|
+
}, annotationCanvasMap: any, pageColors: any, dependencyTracker: any);
|
|
6
6
|
ctx: any;
|
|
7
7
|
current: CanvasExtraState;
|
|
8
8
|
stateStack: any[];
|
|
@@ -35,7 +35,8 @@ export class CanvasGraphics {
|
|
|
35
35
|
_cachedScaleForStroking: number[];
|
|
36
36
|
_cachedGetSinglePixelWidth: number | null;
|
|
37
37
|
_cachedBitmapsMap: Map<any, any>;
|
|
38
|
-
|
|
38
|
+
dependencyTracker: any;
|
|
39
|
+
getObject(opIdx: any, data: any, fallback?: null): any;
|
|
39
40
|
beginDrawing({ transform, viewport, transparency, background, }: {
|
|
40
41
|
transform: any;
|
|
41
42
|
viewport: any;
|
|
@@ -44,26 +45,26 @@ export class CanvasGraphics {
|
|
|
44
45
|
}): void;
|
|
45
46
|
compositeCtx: any;
|
|
46
47
|
transparentCanvas: any;
|
|
47
|
-
executeOperatorList(operatorList: any, executionStartIdx: any, continueCallback: any, stepper: any): any;
|
|
48
|
+
executeOperatorList(operatorList: any, executionStartIdx: any, continueCallback: any, stepper: any, filteredOperationIndexes: any): any;
|
|
48
49
|
endDrawing(): void;
|
|
49
50
|
_scaleImage(img: any, inverseTransform: any): {
|
|
50
51
|
img: any;
|
|
51
52
|
paintWidth: any;
|
|
52
53
|
paintHeight: any;
|
|
53
54
|
};
|
|
54
|
-
_createMaskCanvas(img: any): {
|
|
55
|
+
_createMaskCanvas(opIdx: any, img: any): {
|
|
55
56
|
canvas: any;
|
|
56
57
|
offsetX: number;
|
|
57
58
|
offsetY: number;
|
|
58
59
|
};
|
|
59
|
-
setLineWidth(width: any): void;
|
|
60
|
-
setLineCap(style: any): void;
|
|
61
|
-
setLineJoin(style: any): void;
|
|
62
|
-
setMiterLimit(limit: any): void;
|
|
63
|
-
setDash(dashArray: any, dashPhase: any): void;
|
|
64
|
-
setRenderingIntent(intent: any): void;
|
|
65
|
-
setFlatness(flatness: any): void;
|
|
66
|
-
setGState(states: any): void;
|
|
60
|
+
setLineWidth(opIdx: any, width: any): void;
|
|
61
|
+
setLineCap(opIdx: any, style: any): void;
|
|
62
|
+
setLineJoin(opIdx: any, style: any): void;
|
|
63
|
+
setMiterLimit(opIdx: any, limit: any): void;
|
|
64
|
+
setDash(opIdx: any, dashArray: any, dashPhase: any): void;
|
|
65
|
+
setRenderingIntent(opIdx: any, intent: any): void;
|
|
66
|
+
setFlatness(opIdx: any, flatness: any): void;
|
|
67
|
+
setGState(opIdx: any, states: any): void;
|
|
67
68
|
get inSMaskMode(): boolean;
|
|
68
69
|
checkSMaskState(): void;
|
|
69
70
|
/**
|
|
@@ -75,83 +76,84 @@ export class CanvasGraphics {
|
|
|
75
76
|
* mode ends any clipping paths or transformations will still be active and in
|
|
76
77
|
* the right order on the canvas' graphics state stack.
|
|
77
78
|
*/
|
|
78
|
-
beginSMaskMode(): void;
|
|
79
|
+
beginSMaskMode(opIdx: any): void;
|
|
79
80
|
endSMaskMode(): void;
|
|
80
81
|
compose(dirtyBox: any): void;
|
|
81
82
|
composeSMask(ctx: any, smask: any, layerCtx: any, layerBox: any): void;
|
|
82
83
|
genericComposeSMask(maskCtx: any, layerCtx: any, width: any, height: any, subtype: any, backdrop: any, transferMap: any, layerOffsetX: any, layerOffsetY: any, maskOffsetX: any, maskOffsetY: any): void;
|
|
83
|
-
save(): void;
|
|
84
|
-
restore(): void;
|
|
85
|
-
transform(a: any, b: any, c: any, d: any, e: any, f: any): void;
|
|
86
|
-
constructPath(op: any, data: any, minMax: any): void;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
84
|
+
save(opIdx: any): void;
|
|
85
|
+
restore(opIdx: any): void;
|
|
86
|
+
transform(opIdx: any, a: any, b: any, c: any, d: any, e: any, f: any): void;
|
|
87
|
+
constructPath(opIdx: any, op: any, data: any, minMax: any): void;
|
|
88
|
+
_pathStartIdx: any;
|
|
89
|
+
closePath(opIdx: any): void;
|
|
90
|
+
stroke(opIdx: any, path: any, consumePath?: boolean): void;
|
|
91
|
+
closeStroke(opIdx: any, path: any): void;
|
|
92
|
+
fill(opIdx: any, path: any, consumePath?: boolean): void;
|
|
93
|
+
eoFill(opIdx: any, path: any): void;
|
|
94
|
+
fillStroke(opIdx: any, path: any): void;
|
|
95
|
+
eoFillStroke(opIdx: any, path: any): void;
|
|
96
|
+
closeFillStroke(opIdx: any, path: any): void;
|
|
97
|
+
closeEOFillStroke(opIdx: any, path: any): void;
|
|
98
|
+
endPath(opIdx: any, path: any): void;
|
|
99
|
+
rawFillPath(opIdx: any, path: any): void;
|
|
100
|
+
clip(opIdx: any): void;
|
|
101
|
+
eoClip(opIdx: any): void;
|
|
102
|
+
beginText(opIdx: any): void;
|
|
103
|
+
endText(opIdx: any): void;
|
|
104
|
+
setCharSpacing(opIdx: any, spacing: any): void;
|
|
105
|
+
setWordSpacing(opIdx: any, spacing: any): void;
|
|
106
|
+
setHScale(opIdx: any, scale: any): void;
|
|
107
|
+
setLeading(opIdx: any, leading: any): void;
|
|
108
|
+
setFont(opIdx: any, fontRefName: any, size: any): void;
|
|
109
|
+
setTextRenderingMode(opIdx: any, mode: any): void;
|
|
110
|
+
setTextRise(opIdx: any, rise: any): void;
|
|
111
|
+
moveText(opIdx: any, x: any, y: any): void;
|
|
112
|
+
setLeadingMoveText(opIdx: any, x: any, y: any): void;
|
|
113
|
+
setTextMatrix(opIdx: any, matrix: any): void;
|
|
114
|
+
nextLine(opIdx: any): void;
|
|
115
|
+
paintChar(opIdx: any, character: any, x: any, y: any, patternFillTransform: any, patternStrokeTransform: any): void;
|
|
114
116
|
get isFontSubpixelAAEnabled(): any;
|
|
115
|
-
showText(glyphs: any):
|
|
116
|
-
showType3Text(glyphs: any): void;
|
|
117
|
-
setCharWidth(xWidth: any, yWidth: any): void;
|
|
118
|
-
setCharWidthAndBounds(xWidth: any, yWidth: any, llx: any, lly: any, urx: any, ury: any): void;
|
|
119
|
-
getColorN_Pattern(IR: any): any;
|
|
120
|
-
setStrokeColorN(...args: any[]): void;
|
|
121
|
-
setFillColorN(...args: any[]): void;
|
|
122
|
-
setStrokeRGBColor(color: any): void;
|
|
123
|
-
setStrokeTransparent(): void;
|
|
124
|
-
setFillRGBColor(color: any): void;
|
|
125
|
-
setFillTransparent(): void;
|
|
126
|
-
_getPattern(objId: any, matrix?: null): any;
|
|
127
|
-
shadingFill(objId: any): void;
|
|
117
|
+
showText(opIdx: any, glyphs: any): undefined;
|
|
118
|
+
showType3Text(opIdx: any, glyphs: any): void;
|
|
119
|
+
setCharWidth(opIdx: any, xWidth: any, yWidth: any): void;
|
|
120
|
+
setCharWidthAndBounds(opIdx: any, xWidth: any, yWidth: any, llx: any, lly: any, urx: any, ury: any): void;
|
|
121
|
+
getColorN_Pattern(opIdx: any, IR: any): any;
|
|
122
|
+
setStrokeColorN(opIdx: any, ...args: any[]): void;
|
|
123
|
+
setFillColorN(opIdx: any, ...args: any[]): void;
|
|
124
|
+
setStrokeRGBColor(opIdx: any, color: any): void;
|
|
125
|
+
setStrokeTransparent(opIdx: any): void;
|
|
126
|
+
setFillRGBColor(opIdx: any, color: any): void;
|
|
127
|
+
setFillTransparent(opIdx: any): void;
|
|
128
|
+
_getPattern(opIdx: any, objId: any, matrix?: null): any;
|
|
129
|
+
shadingFill(opIdx: any, objId: any): void;
|
|
128
130
|
beginInlineImage(): void;
|
|
129
131
|
beginImageData(): void;
|
|
130
|
-
paintFormXObjectBegin(matrix: any, bbox: any): void;
|
|
131
|
-
paintFormXObjectEnd(): void;
|
|
132
|
-
beginGroup(group: any): void;
|
|
133
|
-
endGroup(group: any): void;
|
|
134
|
-
beginAnnotation(id: any, rect: any, transform: any, matrix: any, hasOwnCanvas: any): void;
|
|
132
|
+
paintFormXObjectBegin(opIdx: any, matrix: any, bbox: any): void;
|
|
133
|
+
paintFormXObjectEnd(opIdx: any): void;
|
|
134
|
+
beginGroup(opIdx: any, group: any): void;
|
|
135
|
+
endGroup(opIdx: any, group: any): void;
|
|
136
|
+
beginAnnotation(opIdx: any, id: any, rect: any, transform: any, matrix: any, hasOwnCanvas: any): void;
|
|
135
137
|
annotationCanvas: any;
|
|
136
|
-
endAnnotation(): void;
|
|
137
|
-
paintImageMaskXObject(img: any): void;
|
|
138
|
-
paintImageMaskXObjectRepeat(img: any, scaleX: any, skewX: number | undefined, skewY: number | undefined, scaleY: any, positions: any): void;
|
|
139
|
-
paintImageMaskXObjectGroup(images: any): void;
|
|
140
|
-
paintImageXObject(objId: any): void;
|
|
141
|
-
paintImageXObjectRepeat(objId: any, scaleX: any, scaleY: any, positions: any): void;
|
|
138
|
+
endAnnotation(opIdx: any): void;
|
|
139
|
+
paintImageMaskXObject(opIdx: any, img: any): void;
|
|
140
|
+
paintImageMaskXObjectRepeat(opIdx: any, img: any, scaleX: any, skewX: number | undefined, skewY: number | undefined, scaleY: any, positions: any): void;
|
|
141
|
+
paintImageMaskXObjectGroup(opIdx: any, images: any): void;
|
|
142
|
+
paintImageXObject(opIdx: any, objId: any): void;
|
|
143
|
+
paintImageXObjectRepeat(opIdx: any, objId: any, scaleX: any, scaleY: any, positions: any): void;
|
|
142
144
|
applyTransferMapsToCanvas(ctx: any): any;
|
|
143
145
|
applyTransferMapsToBitmap(imgData: any): any;
|
|
144
|
-
paintInlineImageXObject(imgData: any): void;
|
|
145
|
-
paintInlineImageXObjectGroup(imgData: any, map: any): void;
|
|
146
|
-
paintSolidColorImageMask(): void;
|
|
147
|
-
markPoint(tag: any): void;
|
|
148
|
-
markPointProps(tag: any, properties: any): void;
|
|
149
|
-
beginMarkedContent(tag: any): void;
|
|
150
|
-
beginMarkedContentProps(tag: any, properties: any): void;
|
|
151
|
-
endMarkedContent(): void;
|
|
152
|
-
beginCompat(): void;
|
|
153
|
-
endCompat(): void;
|
|
154
|
-
consumePath(path: any, clipBox: any): void;
|
|
146
|
+
paintInlineImageXObject(opIdx: any, imgData: any): void;
|
|
147
|
+
paintInlineImageXObjectGroup(opIdx: any, imgData: any, map: any): void;
|
|
148
|
+
paintSolidColorImageMask(opIdx: any): void;
|
|
149
|
+
markPoint(opIdx: any, tag: any): void;
|
|
150
|
+
markPointProps(opIdx: any, tag: any, properties: any): void;
|
|
151
|
+
beginMarkedContent(opIdx: any, tag: any): void;
|
|
152
|
+
beginMarkedContentProps(opIdx: any, tag: any, properties: any): void;
|
|
153
|
+
endMarkedContent(opIdx: any): void;
|
|
154
|
+
beginCompat(opIdx: any): void;
|
|
155
|
+
endCompat(opIdx: any): void;
|
|
156
|
+
consumePath(opIdx: any, path: any, clipBox: any): void;
|
|
155
157
|
getSinglePixelWidth(): number;
|
|
156
158
|
getScaleForStroking(): number[];
|
|
157
159
|
rescaleAndStroke(path: any, saveRestore: any): void;
|
|
@@ -159,7 +161,7 @@ export class CanvasGraphics {
|
|
|
159
161
|
#private;
|
|
160
162
|
}
|
|
161
163
|
declare class CanvasExtraState {
|
|
162
|
-
constructor(width: any, height: any);
|
|
164
|
+
constructor(width: any, height: any, preInit: any);
|
|
163
165
|
alphaIsShape: boolean;
|
|
164
166
|
fontSize: number;
|
|
165
167
|
fontSizeScale: number;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
export type SimpleDependency = "lineWidth" | "lineCap" | "lineJoin" | "miterLimit" | "dash" | "strokeAlpha" | "fillColor" | "fillAlpha" | "globalCompositeOperation" | "path" | "filter";
|
|
2
|
+
export type IncrementalDependency = "transform" | "moveText" | "sameLineText";
|
|
3
|
+
export type InternalIncrementalDependency = IncrementalDependency | typeof FORCED_DEPENDENCY_LABEL;
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {"lineWidth" | "lineCap" | "lineJoin" | "miterLimit" | "dash" |
|
|
6
|
+
* "strokeAlpha" | "fillColor" | "fillAlpha" | "globalCompositeOperation" |
|
|
7
|
+
* "path" | "filter"} SimpleDependency
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {"transform" | "moveText" | "sameLineText"} IncrementalDependency
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* @typedef {IncrementalDependency |
|
|
14
|
+
* typeof FORCED_DEPENDENCY_LABEL} InternalIncrementalDependency
|
|
15
|
+
*/
|
|
16
|
+
export class CanvasDependencyTracker {
|
|
17
|
+
constructor(canvas: any);
|
|
18
|
+
save(opIdx: any): this;
|
|
19
|
+
restore(opIdx: any): this;
|
|
20
|
+
/**
|
|
21
|
+
* @param {number} idx
|
|
22
|
+
*/
|
|
23
|
+
recordOpenMarker(idx: number): this;
|
|
24
|
+
getOpenMarker(): any;
|
|
25
|
+
recordCloseMarker(idx: any): this;
|
|
26
|
+
beginMarkedContent(opIdx: any): this;
|
|
27
|
+
endMarkedContent(opIdx: any): this;
|
|
28
|
+
pushBaseTransform(ctx: any): this;
|
|
29
|
+
popBaseTransform(): this;
|
|
30
|
+
/**
|
|
31
|
+
* @param {SimpleDependency} name
|
|
32
|
+
* @param {number} idx
|
|
33
|
+
*/
|
|
34
|
+
recordSimpleData(name: SimpleDependency, idx: number): this;
|
|
35
|
+
/**
|
|
36
|
+
* @param {IncrementalDependency} name
|
|
37
|
+
* @param {number} idx
|
|
38
|
+
*/
|
|
39
|
+
recordIncrementalData(name: IncrementalDependency, idx: number): this;
|
|
40
|
+
/**
|
|
41
|
+
* @param {IncrementalDependency} name
|
|
42
|
+
* @param {number} idx
|
|
43
|
+
*/
|
|
44
|
+
resetIncrementalData(name: IncrementalDependency, idx: number): this;
|
|
45
|
+
recordNamedData(name: any, idx: any): this;
|
|
46
|
+
recordFutureForcedDependency(name: any, idx: any): this;
|
|
47
|
+
inheritSimpleDataAsFutureForcedDependencies(names: any): this;
|
|
48
|
+
inheritPendingDependenciesAsFutureForcedDependencies(): this;
|
|
49
|
+
resetBBox(idx: any): this;
|
|
50
|
+
get hasPendingBBox(): boolean;
|
|
51
|
+
recordClipBox(idx: any, ctx: any, minX: any, maxX: any, minY: any, maxY: any): this;
|
|
52
|
+
recordBBox(idx: any, ctx: any, minX: any, maxX: any, minY: any, maxY: any): this;
|
|
53
|
+
recordCharacterBBox(idx: any, ctx: any, font: any, scale: number | undefined, x: number | undefined, y: number | undefined, getMeasure: any): this;
|
|
54
|
+
recordFullPageBBox(idx: any): this;
|
|
55
|
+
getSimpleIndex(dependencyName: any): any;
|
|
56
|
+
recordDependencies(idx: any, dependencyNames: any): this;
|
|
57
|
+
copyDependenciesFromIncrementalOperation(idx: any, name: any): this;
|
|
58
|
+
recordNamedDependency(idx: any, name: any): this;
|
|
59
|
+
/**
|
|
60
|
+
* @param {number} idx
|
|
61
|
+
*/
|
|
62
|
+
recordOperation(idx: number, preserveBbox?: boolean): this;
|
|
63
|
+
bboxToClipBoxDropOperation(idx: any): this;
|
|
64
|
+
_takePendingDependencies(): Set<any>;
|
|
65
|
+
_extractOperation(idx: any): any;
|
|
66
|
+
_pushPendingDependencies(dependencies: any): void;
|
|
67
|
+
take(): {
|
|
68
|
+
minX: number;
|
|
69
|
+
maxX: number;
|
|
70
|
+
minY: number;
|
|
71
|
+
maxY: number;
|
|
72
|
+
dependencies: any[];
|
|
73
|
+
idx: any;
|
|
74
|
+
}[];
|
|
75
|
+
#private;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Used to track dependencies of nested operations list, that
|
|
79
|
+
* should actually all map to the index of the operation that
|
|
80
|
+
* contains the nested list.
|
|
81
|
+
*
|
|
82
|
+
* @implements {CanvasDependencyTracker}
|
|
83
|
+
*/
|
|
84
|
+
export class CanvasNestedDependencyTracker implements CanvasDependencyTracker {
|
|
85
|
+
constructor(dependencyTracker: any, opIdx: any);
|
|
86
|
+
save(opIdx: any): this;
|
|
87
|
+
restore(opIdx: any): this;
|
|
88
|
+
recordOpenMarker(idx: any): this;
|
|
89
|
+
getOpenMarker(): any;
|
|
90
|
+
recordCloseMarker(idx: any): this;
|
|
91
|
+
beginMarkedContent(opIdx: any): this;
|
|
92
|
+
endMarkedContent(opIdx: any): this;
|
|
93
|
+
pushBaseTransform(ctx: any): this;
|
|
94
|
+
popBaseTransform(): this;
|
|
95
|
+
/**
|
|
96
|
+
* @param {SimpleDependency} name
|
|
97
|
+
* @param {number} idx
|
|
98
|
+
*/
|
|
99
|
+
recordSimpleData(name: SimpleDependency, idx: number): this;
|
|
100
|
+
/**
|
|
101
|
+
* @param {IncrementalDependency} name
|
|
102
|
+
* @param {number} idx
|
|
103
|
+
*/
|
|
104
|
+
recordIncrementalData(name: IncrementalDependency, idx: number): this;
|
|
105
|
+
/**
|
|
106
|
+
* @param {IncrementalDependency} name
|
|
107
|
+
* @param {number} idx
|
|
108
|
+
*/
|
|
109
|
+
resetIncrementalData(name: IncrementalDependency, idx: number): this;
|
|
110
|
+
recordNamedData(name: any, idx: any): this;
|
|
111
|
+
recordFutureForcedDependency(name: any, idx: any): this;
|
|
112
|
+
inheritSimpleDataAsFutureForcedDependencies(names: any): this;
|
|
113
|
+
inheritPendingDependenciesAsFutureForcedDependencies(): this;
|
|
114
|
+
resetBBox(idx: any): this;
|
|
115
|
+
get hasPendingBBox(): boolean;
|
|
116
|
+
recordClipBox(idx: any, ctx: any, minX: any, maxX: any, minY: any, maxY: any): this;
|
|
117
|
+
recordBBox(idx: any, ctx: any, minX: any, maxX: any, minY: any, maxY: any): this;
|
|
118
|
+
recordCharacterBBox(idx: any, ctx: any, font: any, scale: any, x: any, y: any, getMeasure: any): this;
|
|
119
|
+
recordFullPageBBox(idx: any): this;
|
|
120
|
+
getSimpleIndex(dependencyName: any): any;
|
|
121
|
+
recordDependencies(idx: any, dependencyNames: any): this;
|
|
122
|
+
copyDependenciesFromIncrementalOperation(idx: any, name: any): this;
|
|
123
|
+
recordNamedDependency(idx: any, name: any): this;
|
|
124
|
+
/**
|
|
125
|
+
* @param {number} idx
|
|
126
|
+
* @param {SimpleDependency[]} dependencyNames
|
|
127
|
+
*/
|
|
128
|
+
recordOperation(idx: number): this;
|
|
129
|
+
bboxToClipBoxDropOperation(idx: any): this;
|
|
130
|
+
recordNestedDependencies(): void;
|
|
131
|
+
take(): void;
|
|
132
|
+
#private;
|
|
133
|
+
}
|
|
134
|
+
export namespace Dependencies {
|
|
135
|
+
let stroke: string[];
|
|
136
|
+
let fill: string[];
|
|
137
|
+
let imageXObject: string[];
|
|
138
|
+
let rawFillPath: string[];
|
|
139
|
+
let showText: string[];
|
|
140
|
+
let transform: string[];
|
|
141
|
+
let transformAndFill: string[];
|
|
142
|
+
}
|
|
143
|
+
declare const FORCED_DEPENDENCY_LABEL: "__forcedDependency";
|
|
144
|
+
export {};
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* be able to use mix-blend-mode for some of them.
|
|
5
5
|
*/
|
|
6
6
|
export class DrawLayer {
|
|
7
|
-
static
|
|
7
|
+
static #id: number;
|
|
8
8
|
static get _svgFactory(): any;
|
|
9
|
-
static
|
|
9
|
+
static #setBox(element: any, [x, y, width, height]: [any, any, any, any]): void;
|
|
10
10
|
constructor({ pageIndex }: {
|
|
11
11
|
pageIndex: any;
|
|
12
12
|
});
|
|
@@ -46,7 +46,7 @@ export type RenderEditorLayerOptions = {
|
|
|
46
46
|
*/
|
|
47
47
|
export class AnnotationEditorLayer {
|
|
48
48
|
static _initialized: boolean;
|
|
49
|
-
static
|
|
49
|
+
static #editorTypes: Map<number, typeof FreeTextEditor | typeof HighlightEditor | typeof InkEditor | typeof SignatureEditor | typeof StampEditor>;
|
|
50
50
|
/**
|
|
51
51
|
* @param {AnnotationEditorLayerOptions} options
|
|
52
52
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* to select a color for the annotation.
|
|
5
5
|
*/
|
|
6
6
|
export class BasicColorPicker {
|
|
7
|
-
static
|
|
7
|
+
static #l10nColor: null;
|
|
8
8
|
constructor(editor: any);
|
|
9
9
|
renderButton(): HTMLInputElement;
|
|
10
10
|
update(value: any): void;
|
|
@@ -18,7 +18,7 @@ export class BasicColorPicker {
|
|
|
18
18
|
* to select a color for the annotation.
|
|
19
19
|
*/
|
|
20
20
|
export class ColorPicker {
|
|
21
|
-
static
|
|
21
|
+
static #l10nColor: null;
|
|
22
22
|
static get _keyboardManager(): any;
|
|
23
23
|
constructor({ editor, uiManager }: {
|
|
24
24
|
editor?: null | undefined;
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
export class DrawingEditor extends AnnotationEditor {
|
|
5
5
|
static _currentDrawId: number;
|
|
6
6
|
static _currentParent: null;
|
|
7
|
-
static
|
|
8
|
-
static
|
|
9
|
-
static
|
|
10
|
-
static
|
|
11
|
-
static
|
|
12
|
-
static
|
|
13
|
-
static
|
|
7
|
+
static #currentDraw: null;
|
|
8
|
+
static #currentDrawingAC: null;
|
|
9
|
+
static #currentDrawingOptions: null;
|
|
10
|
+
static #currentPointerId: number;
|
|
11
|
+
static #currentPointerType: null;
|
|
12
|
+
static #currentPointerIds: null;
|
|
13
|
+
static #currentMoveTimestamp: number;
|
|
14
14
|
static _INNER_MARGIN: number;
|
|
15
15
|
static _mergeSVGProperties(p1: any, p2: any): any;
|
|
16
16
|
/**
|
|
@@ -11,9 +11,9 @@ export class FreeDrawOutline extends Outline {
|
|
|
11
11
|
#private;
|
|
12
12
|
}
|
|
13
13
|
export class FreeDrawOutliner {
|
|
14
|
-
static
|
|
15
|
-
static
|
|
16
|
-
static
|
|
14
|
+
static #MIN_DIST: number;
|
|
15
|
+
static #MIN_DIFF: number;
|
|
16
|
+
static #MIN: number;
|
|
17
17
|
constructor({ x, y }: {
|
|
18
18
|
x: any;
|
|
19
19
|
y: any;
|
|
@@ -2,29 +2,29 @@
|
|
|
2
2
|
* Basic text editor in order to create a Signature annotation.
|
|
3
3
|
*/
|
|
4
4
|
export class SignatureExtractor {
|
|
5
|
-
static
|
|
5
|
+
static #PARAMETERS: {
|
|
6
6
|
maxDim: number;
|
|
7
7
|
sigmaSFactor: number;
|
|
8
8
|
sigmaR: number;
|
|
9
9
|
kernelSize: number;
|
|
10
10
|
};
|
|
11
|
-
static
|
|
12
|
-
static
|
|
13
|
-
static
|
|
14
|
-
static
|
|
15
|
-
static
|
|
11
|
+
static #neighborIndexToId(i0: any, j0: any, i: any, j: any): any;
|
|
12
|
+
static #neighborIdToIndex: Int32Array<ArrayBuffer>;
|
|
13
|
+
static #clockwiseNonZero(buf: any, width: any, i0: any, j0: any, i: any, j: any, offset: any): number;
|
|
14
|
+
static #counterClockwiseNonZero(buf: any, width: any, i0: any, j0: any, i: any, j: any, offset: any): number;
|
|
15
|
+
static #findContours(buf: any, width: any, height: any, threshold: any): {
|
|
16
16
|
isHole: boolean;
|
|
17
17
|
points: number[];
|
|
18
18
|
id: number;
|
|
19
19
|
parent: number;
|
|
20
20
|
}[];
|
|
21
|
-
static
|
|
22
|
-
static
|
|
23
|
-
static
|
|
24
|
-
static
|
|
25
|
-
static
|
|
26
|
-
static
|
|
27
|
-
static
|
|
21
|
+
static #douglasPeuckerHelper(points: any, start: any, end: any, output: any): void;
|
|
22
|
+
static #douglasPeucker(points: any): any[] | null;
|
|
23
|
+
static #bilateralFilter(buf: any, width: any, height: any, sigmaS: any, sigmaR: any, kernelSize: any): (Uint32Array<ArrayBuffer> | Uint8Array<any>)[];
|
|
24
|
+
static #getHistogram(buf: any): Uint32Array<ArrayBuffer>;
|
|
25
|
+
static #toUint8(buf: any): Uint8ClampedArray<ArrayBuffer>;
|
|
26
|
+
static #guessThreshold(histogram: any): number;
|
|
27
|
+
static #getGrayPixels(bitmap: any): any[];
|
|
28
28
|
static extractContoursFromText(text: any, { fontFamily, fontStyle, fontWeight }: {
|
|
29
29
|
fontFamily: any;
|
|
30
30
|
fontStyle: any;
|