pdfjs-serverless 1.0.1 → 1.2.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.
- package/README.md +14 -44
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/types/src/display/annotation_layer.d.ts +49 -16
- package/dist/types/src/display/annotation_storage.d.ts +10 -8
- package/dist/types/src/display/api.d.ts +134 -126
- package/dist/types/src/display/api_utils.d.ts +13 -0
- package/dist/types/src/display/binary_data_factory.d.ts +26 -0
- package/dist/types/src/display/canvas.d.ts +97 -92
- package/dist/types/src/display/canvas_dependency_tracker.d.ts +216 -0
- package/dist/types/src/display/canvas_factory.d.ts +3 -1
- package/dist/types/src/display/display_utils.d.ts +27 -3
- package/dist/types/src/display/draw_layer.d.ts +2 -6
- package/dist/types/src/display/editor/alt_text.d.ts +1 -1
- package/dist/types/src/display/editor/annotation_editor_layer.d.ts +16 -19
- package/dist/types/src/display/editor/color_picker.d.ts +20 -1
- package/dist/types/src/display/editor/comment.d.ts +59 -0
- package/dist/types/src/display/editor/draw.d.ts +4 -8
- package/dist/types/src/display/editor/drawers/freedraw.d.ts +4 -3
- package/dist/types/src/display/editor/drawers/highlight.d.ts +2 -1
- package/dist/types/src/display/editor/drawers/signaturedraw.d.ts +13 -13
- package/dist/types/src/display/editor/editor.d.ts +119 -15
- package/dist/types/src/display/editor/freetext.d.ts +11 -7
- package/dist/types/src/display/editor/highlight.d.ts +8 -3
- package/dist/types/src/display/editor/ink.d.ts +5 -0
- package/dist/types/src/display/editor/signature.d.ts +2 -5
- package/dist/types/src/display/editor/stamp.d.ts +3 -1
- package/dist/types/src/display/editor/toolbar.d.ts +8 -3
- package/dist/types/src/display/editor/tools.d.ts +72 -6
- package/dist/types/src/display/fetch_stream.d.ts +3 -56
- package/dist/types/src/display/font_loader.d.ts +28 -1
- package/dist/types/src/display/network.d.ts +14 -80
- package/dist/types/src/display/network_stream.d.ts +2 -0
- package/dist/types/src/display/network_utils.d.ts +3 -3
- package/dist/types/src/display/node_stream.d.ts +2 -52
- package/dist/types/src/display/node_utils.d.ts +5 -19
- package/dist/types/src/display/obj_bin_transform_display.d.ts +67 -0
- package/dist/types/src/display/pages_mapper.d.ts +72 -0
- package/dist/types/src/display/pattern_helper.d.ts +9 -4
- package/dist/types/src/display/pdf_objects.d.ts +40 -0
- package/dist/types/src/display/text_layer.d.ts +16 -10
- package/dist/types/src/display/text_layer_images.d.ts +10 -0
- package/dist/types/src/display/transport_stream.d.ts +8 -64
- package/dist/types/src/display/webgpu_mesh.d.ts +3 -0
- package/dist/types/src/display/worker_options.d.ts +2 -2
- package/dist/types/src/display/xfa_layer.d.ts +3 -3
- package/dist/types/src/pdf.d.ts +11 -2
- package/dist/types/src/{interfaces.d.ts → shared/base_pdf_stream.d.ts} +26 -27
- package/dist/types/src/shared/obj_bin_transform_utils.d.ts +26 -0
- package/dist/types/src/shared/scripting_utils.d.ts +2 -0
- package/dist/types/src/shared/util.d.ts +21 -8
- package/dist/types/web/annotation_editor_layer_builder.d.ts +7 -8
- package/dist/types/web/annotation_layer_builder.d.ts +18 -23
- package/dist/types/web/app_options.d.ts +1 -1
- package/dist/types/web/autolinker.d.ts +3 -2
- package/dist/types/web/base_download_manager.d.ts +24 -0
- package/dist/types/web/base_pdf_page_view.d.ts +7 -6
- package/dist/types/web/comment_manager.d.ts +20 -0
- package/dist/types/web/download_manager.d.ts +3 -12
- package/dist/types/web/draw_layer_builder.d.ts +0 -12
- package/dist/types/web/event_utils.d.ts +1 -1
- package/dist/types/web/genericl10n.d.ts +6 -10
- package/dist/types/web/l10n.d.ts +3 -6
- package/dist/types/web/menu.d.ts +11 -0
- package/dist/types/web/pdf_find_controller.d.ts +10 -12
- package/dist/types/web/pdf_history.d.ts +3 -3
- package/dist/types/web/pdf_link_service.d.ts +10 -7
- package/dist/types/web/pdf_page_detail_view.d.ts +2 -7
- package/dist/types/web/pdf_page_view.d.ts +39 -17
- package/dist/types/web/pdf_rendering_queue.d.ts +10 -14
- package/dist/types/web/pdf_thumbnail_view.d.ts +18 -50
- package/dist/types/web/pdf_thumbnail_viewer.d.ts +57 -13
- package/dist/types/web/pdf_viewer.component.d.ts +1 -1
- package/dist/types/web/pdf_viewer.d.ts +95 -29
- package/dist/types/web/renderable_view.d.ts +33 -0
- package/dist/types/web/sidebar.d.ts +65 -0
- package/dist/types/web/struct_tree_layer_builder.d.ts +1 -1
- package/dist/types/web/text_accessibility.d.ts +1 -1
- package/dist/types/web/text_layer_builder.d.ts +11 -6
- package/dist/types/web/ui_utils.d.ts +3 -11
- package/dist/types/web/xfa_layer_builder.d.ts +4 -4
- package/package.json +18 -15
- package/dist/types/src/display/cmap_reader_factory.d.ts +0 -25
- package/dist/types/src/display/standard_fontdata_factory.d.ts +0 -20
- package/dist/types/src/display/wasm_factory.d.ts +0 -20
- package/dist/types/web/interfaces.d.ts +0 -167
|
@@ -2,14 +2,12 @@ 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, imagesTracker: any);
|
|
6
6
|
ctx: any;
|
|
7
7
|
current: CanvasExtraState;
|
|
8
8
|
stateStack: any[];
|
|
9
9
|
pendingClip: {} | {} | null;
|
|
10
10
|
pendingEOFill: boolean;
|
|
11
|
-
res: any;
|
|
12
|
-
xobjs: any;
|
|
13
11
|
commonObjs: any;
|
|
14
12
|
objs: any;
|
|
15
13
|
canvasFactory: any;
|
|
@@ -21,11 +19,11 @@ export class CanvasGraphics {
|
|
|
21
19
|
smaskStack: any[];
|
|
22
20
|
smaskCounter: number;
|
|
23
21
|
tempSMask: any;
|
|
22
|
+
smaskGroupCanvases: any[];
|
|
24
23
|
suspendedCtx: any;
|
|
25
24
|
contentVisible: boolean;
|
|
26
25
|
markedContentStack: never[];
|
|
27
26
|
optionalContentConfig: any;
|
|
28
|
-
cachedCanvases: CachedCanvases;
|
|
29
27
|
cachedPatterns: Map<any, any>;
|
|
30
28
|
annotationCanvasMap: any;
|
|
31
29
|
viewportScale: number;
|
|
@@ -35,35 +33,45 @@ export class CanvasGraphics {
|
|
|
35
33
|
_cachedScaleForStroking: number[];
|
|
36
34
|
_cachedGetSinglePixelWidth: number | null;
|
|
37
35
|
_cachedBitmapsMap: Map<any, any>;
|
|
38
|
-
|
|
36
|
+
dependencyTracker: any;
|
|
37
|
+
imagesTracker: any;
|
|
38
|
+
getObject(opIdx: any, data: any, fallback?: null): any;
|
|
39
39
|
beginDrawing({ transform, viewport, transparency, background, }: {
|
|
40
40
|
transform: any;
|
|
41
41
|
viewport: any;
|
|
42
42
|
transparency?: boolean | undefined;
|
|
43
43
|
background?: null | undefined;
|
|
44
44
|
}): void;
|
|
45
|
+
transparentCanvasEntry: any;
|
|
45
46
|
compositeCtx: any;
|
|
47
|
+
executeOperatorList(operatorList: any, executionStartIdx: any, continueCallback: any, stepper: any, operationsFilter: any): any;
|
|
46
48
|
transparentCanvas: any;
|
|
47
|
-
executeOperatorList(operatorList: any, executionStartIdx: any, continueCallback: any, stepper: 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;
|
|
54
|
+
tmpCanvas: any;
|
|
53
55
|
};
|
|
54
|
-
_createMaskCanvas(img: any): {
|
|
56
|
+
_createMaskCanvas(opIdx: any, img: any): {
|
|
55
57
|
canvas: any;
|
|
56
58
|
offsetX: number;
|
|
57
59
|
offsetY: number;
|
|
60
|
+
canvasEntry?: undefined;
|
|
61
|
+
} | {
|
|
62
|
+
canvas: any;
|
|
63
|
+
canvasEntry: any;
|
|
64
|
+
offsetX: number;
|
|
65
|
+
offsetY: number;
|
|
58
66
|
};
|
|
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;
|
|
67
|
+
setLineWidth(opIdx: any, width: any): void;
|
|
68
|
+
setLineCap(opIdx: any, style: any): void;
|
|
69
|
+
setLineJoin(opIdx: any, style: any): void;
|
|
70
|
+
setMiterLimit(opIdx: any, limit: any): void;
|
|
71
|
+
setDash(opIdx: any, dashArray: any, dashPhase: any): void;
|
|
72
|
+
setRenderingIntent(opIdx: any, intent: any): void;
|
|
73
|
+
setFlatness(opIdx: any, flatness: any): void;
|
|
74
|
+
setGState(opIdx: any, states: any): void;
|
|
67
75
|
get inSMaskMode(): boolean;
|
|
68
76
|
checkSMaskState(): void;
|
|
69
77
|
/**
|
|
@@ -75,83 +83,88 @@ export class CanvasGraphics {
|
|
|
75
83
|
* mode ends any clipping paths or transformations will still be active and in
|
|
76
84
|
* the right order on the canvas' graphics state stack.
|
|
77
85
|
*/
|
|
78
|
-
beginSMaskMode(): void;
|
|
86
|
+
beginSMaskMode(opIdx: any): void;
|
|
87
|
+
smaskScratchCanvas: any;
|
|
79
88
|
endSMaskMode(): void;
|
|
80
89
|
compose(dirtyBox: any): void;
|
|
81
90
|
composeSMask(ctx: any, smask: any, layerCtx: any, layerBox: any): void;
|
|
82
91
|
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
|
-
|
|
92
|
+
save(opIdx: any): void;
|
|
93
|
+
restore(opIdx: any): void;
|
|
94
|
+
transform(opIdx: any, a: any, b: any, c: any, d: any, e: any, f: any): void;
|
|
95
|
+
constructPath(opIdx: any, op: any, data: any, minMax: any): void;
|
|
96
|
+
_pathStartIdx: any;
|
|
97
|
+
closePath(opIdx: any): void;
|
|
98
|
+
stroke(opIdx: any, path: any, consumePath?: boolean): void;
|
|
99
|
+
closeStroke(opIdx: any, path: any): void;
|
|
100
|
+
fill(opIdx: any, path: any, consumePath?: boolean): void;
|
|
101
|
+
eoFill(opIdx: any, path: any): void;
|
|
102
|
+
fillStroke(opIdx: any, path: any): void;
|
|
103
|
+
eoFillStroke(opIdx: any, path: any): void;
|
|
104
|
+
closeFillStroke(opIdx: any, path: any): void;
|
|
105
|
+
closeEOFillStroke(opIdx: any, path: any): void;
|
|
106
|
+
endPath(opIdx: any, path: any): void;
|
|
107
|
+
rawFillPath(opIdx: any, path: any): void;
|
|
108
|
+
clip(opIdx: any): void;
|
|
109
|
+
eoClip(opIdx: any): void;
|
|
110
|
+
beginText(opIdx: any): void;
|
|
111
|
+
endText(opIdx: any): void;
|
|
112
|
+
setCharSpacing(opIdx: any, spacing: any): void;
|
|
113
|
+
setWordSpacing(opIdx: any, spacing: any): void;
|
|
114
|
+
setHScale(opIdx: any, scale: any): void;
|
|
115
|
+
setLeading(opIdx: any, leading: any): void;
|
|
116
|
+
setFont(opIdx: any, fontRefName: any, size: any): void;
|
|
117
|
+
setTextRenderingMode(opIdx: any, mode: any): void;
|
|
118
|
+
setTextRise(opIdx: any, rise: any): void;
|
|
119
|
+
moveText(opIdx: any, x: any, y: any): void;
|
|
120
|
+
setLeadingMoveText(opIdx: any, x: any, y: any): void;
|
|
121
|
+
setTextMatrix(opIdx: any, matrix: any): void;
|
|
122
|
+
nextLine(opIdx: any): void;
|
|
123
|
+
paintChar(opIdx: any, character: any, x: any, y: any, patternFillTransform: any, patternStrokeTransform: any): void;
|
|
114
124
|
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(
|
|
123
|
-
setStrokeTransparent(): void;
|
|
124
|
-
setFillRGBColor(
|
|
125
|
-
setFillTransparent(): void;
|
|
126
|
-
_getPattern(objId: any, matrix?: null): any;
|
|
127
|
-
shadingFill(objId: any): void;
|
|
125
|
+
showText(opIdx: any, glyphs: any): undefined;
|
|
126
|
+
showType3Text(opIdx: any, glyphs: any): void;
|
|
127
|
+
setCharWidth(opIdx: any, xWidth: any, yWidth: any): void;
|
|
128
|
+
setCharWidthAndBounds(opIdx: any, xWidth: any, yWidth: any, llx: any, lly: any, urx: any, ury: any): void;
|
|
129
|
+
getColorN_Pattern(opIdx: any, IR: any): any;
|
|
130
|
+
setStrokeColorN(opIdx: any, ...args: any[]): void;
|
|
131
|
+
setFillColorN(opIdx: any, ...args: any[]): void;
|
|
132
|
+
setStrokeRGBColor(opIdx: any, color: any): void;
|
|
133
|
+
setStrokeTransparent(opIdx: any): void;
|
|
134
|
+
setFillRGBColor(opIdx: any, color: any): void;
|
|
135
|
+
setFillTransparent(opIdx: any): void;
|
|
136
|
+
_getPattern(opIdx: any, objId: any, matrix?: null): any;
|
|
137
|
+
shadingFill(opIdx: any, objId: any): void;
|
|
128
138
|
beginInlineImage(): void;
|
|
129
139
|
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;
|
|
140
|
+
paintFormXObjectBegin(opIdx: any, matrix: any, bbox: any): void;
|
|
141
|
+
paintFormXObjectEnd(opIdx: any): void;
|
|
142
|
+
beginGroup(opIdx: any, group: any): void;
|
|
143
|
+
endGroup(opIdx: any, group: any): void;
|
|
144
|
+
beginAnnotation(opIdx: any, id: any, rect: any, transform: any, matrix: any, hasOwnCanvas: any): void;
|
|
135
145
|
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;
|
|
146
|
+
endAnnotation(opIdx: any): void;
|
|
147
|
+
paintImageMaskXObject(opIdx: any, img: any): void;
|
|
148
|
+
paintImageMaskXObjectRepeat(opIdx: any, img: any, scaleX: any, skewX: number | undefined, skewY: number | undefined, scaleY: any, positions: any): void;
|
|
149
|
+
paintImageMaskXObjectGroup(opIdx: any, images: any): void;
|
|
150
|
+
paintImageXObject(opIdx: any, objId: any): void;
|
|
151
|
+
paintImageXObjectRepeat(opIdx: any, objId: any, scaleX: any, scaleY: any, positions: any): void;
|
|
142
152
|
applyTransferMapsToCanvas(ctx: any): any;
|
|
143
|
-
applyTransferMapsToBitmap(imgData: any):
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
applyTransferMapsToBitmap(imgData: any): {
|
|
154
|
+
img: any;
|
|
155
|
+
canvasEntry: any;
|
|
156
|
+
};
|
|
157
|
+
paintInlineImageXObject(opIdx: any, imgData: any): void;
|
|
158
|
+
paintInlineImageXObjectGroup(opIdx: any, imgData: any, map: any): void;
|
|
159
|
+
paintSolidColorImageMask(opIdx: any): void;
|
|
160
|
+
markPoint(opIdx: any, tag: any): void;
|
|
161
|
+
markPointProps(opIdx: any, tag: any, properties: any): void;
|
|
162
|
+
beginMarkedContent(opIdx: any, tag: any): void;
|
|
163
|
+
beginMarkedContentProps(opIdx: any, tag: any, properties: any): void;
|
|
164
|
+
endMarkedContent(opIdx: any): void;
|
|
165
|
+
beginCompat(opIdx: any): void;
|
|
166
|
+
endCompat(opIdx: any): void;
|
|
167
|
+
consumePath(opIdx: any, path: any, clipBox: any): void;
|
|
155
168
|
getSinglePixelWidth(): number;
|
|
156
169
|
getScaleForStroking(): number[];
|
|
157
170
|
rescaleAndStroke(path: any, saveRestore: any): void;
|
|
@@ -185,8 +198,8 @@ declare class CanvasExtraState {
|
|
|
185
198
|
lineWidth: number;
|
|
186
199
|
activeSMask: null;
|
|
187
200
|
transferMaps: string;
|
|
188
|
-
clipBox: Float32Array<ArrayBuffer>;
|
|
189
201
|
minMax: Float32Array<ArrayBuffer>;
|
|
202
|
+
clipBox: Float32Array<ArrayBuffer>;
|
|
190
203
|
clone(): any;
|
|
191
204
|
getPathBoundingBox(pathType?: string, transform?: null): Float32Array<ArrayBuffer>;
|
|
192
205
|
updateClipFromPath(): void;
|
|
@@ -194,12 +207,4 @@ declare class CanvasExtraState {
|
|
|
194
207
|
startNewPathAndClipBox(box: any): void;
|
|
195
208
|
getClippedPathBoundingBox(pathType?: string, transform?: null): number[] | null;
|
|
196
209
|
}
|
|
197
|
-
declare class CachedCanvases {
|
|
198
|
-
constructor(canvasFactory: any);
|
|
199
|
-
canvasFactory: any;
|
|
200
|
-
cache: any;
|
|
201
|
-
getCanvas(id: any, width: any, height: any): any;
|
|
202
|
-
delete(id: any): void;
|
|
203
|
-
clear(): void;
|
|
204
|
-
}
|
|
205
210
|
export {};
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
export type SimpleDependency = "lineWidth" | "lineCap" | "lineJoin" | "miterLimit" | "dash" | "strokeAlpha" | "fillColor" | "fillAlpha" | "globalCompositeOperation" | "path" | "filter" | "font" | "fontObj";
|
|
2
|
+
export type IncrementalDependency = "transform" | "moveText" | "sameLineText";
|
|
3
|
+
export type InternalIncrementalDependency = IncrementalDependency | typeof FORCED_DEPENDENCY_LABEL;
|
|
4
|
+
export class CanvasBBoxTracker {
|
|
5
|
+
constructor(canvas: any, operationsCount: any);
|
|
6
|
+
_pendingBBoxIdx: number;
|
|
7
|
+
_savesStack: any[];
|
|
8
|
+
_markedContentStack: any[];
|
|
9
|
+
growOperationsCount(operationsCount: any): void;
|
|
10
|
+
get clipBox(): number[];
|
|
11
|
+
save(opIdx: any): this;
|
|
12
|
+
restore(opIdx: any, onSavePopped: any): this;
|
|
13
|
+
/**
|
|
14
|
+
* @param {number} idx
|
|
15
|
+
*/
|
|
16
|
+
recordOpenMarker(idx: number): this;
|
|
17
|
+
getOpenMarker(): any;
|
|
18
|
+
recordCloseMarker(opIdx: any, onSavePopped: any): this;
|
|
19
|
+
beginMarkedContent(opIdx: any): this;
|
|
20
|
+
endMarkedContent(opIdx: any, onSavePopped: any): this;
|
|
21
|
+
pushBaseTransform(ctx: any): this;
|
|
22
|
+
popBaseTransform(): this;
|
|
23
|
+
resetBBox(idx: any): this;
|
|
24
|
+
recordClipBox(idx: any, ctx: any, minX: any, maxX: any, minY: any, maxY: any): this;
|
|
25
|
+
recordBBox(idx: any, ctx: any, minX: any, maxX: any, minY: any, maxY: any): this;
|
|
26
|
+
recordFullPageBBox(idx: any): this;
|
|
27
|
+
/**
|
|
28
|
+
* @param {number} idx
|
|
29
|
+
*/
|
|
30
|
+
recordOperation(idx: number, preserve: boolean | undefined, dependencyLists: any): this;
|
|
31
|
+
bboxToClipBoxDropOperation(idx: any): this;
|
|
32
|
+
take(): BBoxReader;
|
|
33
|
+
takeDebugMetadata(): void;
|
|
34
|
+
recordSimpleData(name: any, idx: any): this;
|
|
35
|
+
recordIncrementalData(name: any, idx: any): this;
|
|
36
|
+
resetIncrementalData(name: any, idx: any): this;
|
|
37
|
+
recordNamedData(name: any, idx: any): this;
|
|
38
|
+
recordSimpleDataFromNamed(name: any, depName: any, fallbackIdx: any): this;
|
|
39
|
+
recordFutureForcedDependency(name: any, idx: any): this;
|
|
40
|
+
inheritSimpleDataAsFutureForcedDependencies(names: any): this;
|
|
41
|
+
inheritPendingDependenciesAsFutureForcedDependencies(): this;
|
|
42
|
+
recordCharacterBBox(idx: any, ctx: any, font: any, scale: number | undefined, x: number | undefined, y: number | undefined, getMeasure: any): this;
|
|
43
|
+
getSimpleIndex(dependencyName: any): undefined;
|
|
44
|
+
recordDependencies(idx: any, dependencyNames: any): this;
|
|
45
|
+
recordNamedDependency(idx: any, name: any): this;
|
|
46
|
+
recordShowTextOperation(idx: any, preserve?: boolean): this;
|
|
47
|
+
#private;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @typedef {"lineWidth" | "lineCap" | "lineJoin" | "miterLimit" | "dash" |
|
|
51
|
+
* "strokeAlpha" | "fillColor" | "fillAlpha" | "globalCompositeOperation" |
|
|
52
|
+
* "path" | "filter" | "font" | "fontObj"} SimpleDependency
|
|
53
|
+
*/
|
|
54
|
+
/**
|
|
55
|
+
* @typedef {"transform" | "moveText" | "sameLineText"} IncrementalDependency
|
|
56
|
+
*/
|
|
57
|
+
/**
|
|
58
|
+
* @typedef {IncrementalDependency |
|
|
59
|
+
* typeof FORCED_DEPENDENCY_LABEL} InternalIncrementalDependency
|
|
60
|
+
*/
|
|
61
|
+
export class CanvasDependencyTracker {
|
|
62
|
+
constructor(bboxTracker: any, recordDebugMetadata?: boolean);
|
|
63
|
+
get clipBox(): any;
|
|
64
|
+
growOperationsCount(operationsCount: any): void;
|
|
65
|
+
save(opIdx: any): this;
|
|
66
|
+
restore(opIdx: any): this;
|
|
67
|
+
recordOpenMarker(opIdx: any): this;
|
|
68
|
+
getOpenMarker(): any;
|
|
69
|
+
recordCloseMarker(opIdx: any): this;
|
|
70
|
+
/**
|
|
71
|
+
* @param {number} opIdx
|
|
72
|
+
*/
|
|
73
|
+
beginMarkedContent(opIdx: number): this;
|
|
74
|
+
endMarkedContent(opIdx: any): this;
|
|
75
|
+
pushBaseTransform(ctx: any): this;
|
|
76
|
+
popBaseTransform(): this;
|
|
77
|
+
/**
|
|
78
|
+
* @param {SimpleDependency} name
|
|
79
|
+
* @param {number} idx
|
|
80
|
+
*/
|
|
81
|
+
recordSimpleData(name: SimpleDependency, idx: number): this;
|
|
82
|
+
/**
|
|
83
|
+
* @param {IncrementalDependency} name
|
|
84
|
+
* @param {number} idx
|
|
85
|
+
*/
|
|
86
|
+
recordIncrementalData(name: IncrementalDependency, idx: number): this;
|
|
87
|
+
/**
|
|
88
|
+
* @param {IncrementalDependency} name
|
|
89
|
+
* @param {number} idx
|
|
90
|
+
*/
|
|
91
|
+
resetIncrementalData(name: IncrementalDependency, idx: number): this;
|
|
92
|
+
recordNamedData(name: any, idx: any): this;
|
|
93
|
+
/**
|
|
94
|
+
* @param {SimpleDependency} name
|
|
95
|
+
* @param {string} depName
|
|
96
|
+
* @param {number} fallbackIdx
|
|
97
|
+
*/
|
|
98
|
+
recordSimpleDataFromNamed(name: SimpleDependency, depName: string, fallbackIdx: number): void;
|
|
99
|
+
recordFutureForcedDependency(name: any, idx: any): this;
|
|
100
|
+
inheritSimpleDataAsFutureForcedDependencies(names: any): this;
|
|
101
|
+
inheritPendingDependenciesAsFutureForcedDependencies(): this;
|
|
102
|
+
resetBBox(idx: any): this;
|
|
103
|
+
recordClipBox(idx: any, ctx: any, minX: any, maxX: any, minY: any, maxY: any): this;
|
|
104
|
+
recordBBox(idx: any, ctx: any, minX: any, maxX: any, minY: any, maxY: any): this;
|
|
105
|
+
recordCharacterBBox(idx: any, ctx: any, font: any, scale: number | undefined, x: number | undefined, y: number | undefined, getMeasure: any): this;
|
|
106
|
+
recordFullPageBBox(idx: any): this;
|
|
107
|
+
getSimpleIndex(dependencyName: any): any;
|
|
108
|
+
recordDependencies(idx: any, dependencyNames: any): this;
|
|
109
|
+
recordNamedDependency(idx: any, name: any): this;
|
|
110
|
+
/**
|
|
111
|
+
* @param {number} idx
|
|
112
|
+
*/
|
|
113
|
+
recordOperation(idx: number, preserve?: boolean): this;
|
|
114
|
+
recordShowTextOperation(idx: any, preserve?: boolean): this;
|
|
115
|
+
bboxToClipBoxDropOperation(idx: any, preserve?: boolean): this;
|
|
116
|
+
take(): any;
|
|
117
|
+
takeDebugMetadata(): Map<any, any> | undefined;
|
|
118
|
+
#private;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Track the locations of images in the canvas. For each image it computes
|
|
122
|
+
* a bounding box as a potentially rotated rectangle, matching the rotation of
|
|
123
|
+
* the current canvas transform.
|
|
124
|
+
*/
|
|
125
|
+
export class CanvasImagesTracker {
|
|
126
|
+
static "__#private@#CoordsArray": Float32ArrayConstructor | Float16ArrayConstructor;
|
|
127
|
+
constructor(canvas: any);
|
|
128
|
+
record(ctx: any, width: any, height: any, clipBox: any): void;
|
|
129
|
+
take(): Float32Array<ArrayBuffer> | Float16Array<ArrayBuffer>;
|
|
130
|
+
#private;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Used to track dependencies of nested operations list, that
|
|
134
|
+
* should actually all map to the index of the operation that
|
|
135
|
+
* contains the nested list.
|
|
136
|
+
*
|
|
137
|
+
* @implements {CanvasDependencyTracker}
|
|
138
|
+
*/
|
|
139
|
+
export class CanvasNestedDependencyTracker implements CanvasDependencyTracker {
|
|
140
|
+
constructor(dependencyTracker: any, opIdx: any, ignoreBBoxes: any);
|
|
141
|
+
get clipBox(): any;
|
|
142
|
+
growOperationsCount(): void;
|
|
143
|
+
save(opIdx: any): this;
|
|
144
|
+
restore(opIdx: any): this;
|
|
145
|
+
recordOpenMarker(idx: any): this;
|
|
146
|
+
getOpenMarker(): any;
|
|
147
|
+
recordCloseMarker(idx: any): this;
|
|
148
|
+
beginMarkedContent(opIdx: any): this;
|
|
149
|
+
endMarkedContent(opIdx: any): this;
|
|
150
|
+
pushBaseTransform(ctx: any): this;
|
|
151
|
+
popBaseTransform(): this;
|
|
152
|
+
/**
|
|
153
|
+
* @param {SimpleDependency} name
|
|
154
|
+
* @param {number} idx
|
|
155
|
+
*/
|
|
156
|
+
recordSimpleData(name: SimpleDependency, idx: number): this;
|
|
157
|
+
/**
|
|
158
|
+
* @param {IncrementalDependency} name
|
|
159
|
+
* @param {number} idx
|
|
160
|
+
*/
|
|
161
|
+
recordIncrementalData(name: IncrementalDependency, idx: number): this;
|
|
162
|
+
/**
|
|
163
|
+
* @param {IncrementalDependency} name
|
|
164
|
+
* @param {number} idx
|
|
165
|
+
*/
|
|
166
|
+
resetIncrementalData(name: IncrementalDependency, idx: number): this;
|
|
167
|
+
recordNamedData(name: any, idx: any): this;
|
|
168
|
+
/**
|
|
169
|
+
* @param {SimpleDependency} name
|
|
170
|
+
* @param {string} depName
|
|
171
|
+
* @param {number} fallbackIdx
|
|
172
|
+
*/
|
|
173
|
+
recordSimpleDataFromNamed(name: SimpleDependency, depName: string, fallbackIdx: number): this;
|
|
174
|
+
recordFutureForcedDependency(name: any, idx: any): this;
|
|
175
|
+
inheritSimpleDataAsFutureForcedDependencies(names: any): this;
|
|
176
|
+
inheritPendingDependenciesAsFutureForcedDependencies(): this;
|
|
177
|
+
resetBBox(idx: any): this;
|
|
178
|
+
recordClipBox(idx: any, ctx: any, minX: any, maxX: any, minY: any, maxY: any): this;
|
|
179
|
+
recordBBox(idx: any, ctx: any, minX: any, maxX: any, minY: any, maxY: any): this;
|
|
180
|
+
recordCharacterBBox(idx: any, ctx: any, font: any, scale: any, x: any, y: any, getMeasure: any): this;
|
|
181
|
+
recordFullPageBBox(idx: any): this;
|
|
182
|
+
getSimpleIndex(dependencyName: any): any;
|
|
183
|
+
recordDependencies(idx: any, dependencyNames: any): this;
|
|
184
|
+
recordNamedDependency(idx: any, name: any): this;
|
|
185
|
+
/**
|
|
186
|
+
* @param {number} idx
|
|
187
|
+
* @param {SimpleDependency[]} dependencyNames
|
|
188
|
+
*/
|
|
189
|
+
recordOperation(idx: number): this;
|
|
190
|
+
recordShowTextOperation(idx: any): this;
|
|
191
|
+
bboxToClipBoxDropOperation(idx: any): this;
|
|
192
|
+
take(): void;
|
|
193
|
+
takeDebugMetadata(): void;
|
|
194
|
+
#private;
|
|
195
|
+
}
|
|
196
|
+
export namespace Dependencies {
|
|
197
|
+
let stroke: string[];
|
|
198
|
+
let fill: string[];
|
|
199
|
+
let imageXObject: string[];
|
|
200
|
+
let rawFillPath: string[];
|
|
201
|
+
let showText: string[];
|
|
202
|
+
let transform: string[];
|
|
203
|
+
let transformAndFill: string[];
|
|
204
|
+
}
|
|
205
|
+
declare const FORCED_DEPENDENCY_LABEL: "__forcedDependency";
|
|
206
|
+
declare class BBoxReader {
|
|
207
|
+
constructor(bboxes: any, coords: any);
|
|
208
|
+
get length(): any;
|
|
209
|
+
isEmpty(i: any): boolean;
|
|
210
|
+
minX(i: any): number;
|
|
211
|
+
minY(i: any): number;
|
|
212
|
+
maxX(i: any): number;
|
|
213
|
+
maxY(i: any): number;
|
|
214
|
+
#private;
|
|
215
|
+
}
|
|
216
|
+
export {};
|
|
@@ -6,7 +6,9 @@ export class BaseCanvasFactory {
|
|
|
6
6
|
canvas: void;
|
|
7
7
|
context: any;
|
|
8
8
|
};
|
|
9
|
-
reset(
|
|
9
|
+
reset({ canvas }: {
|
|
10
|
+
canvas: any;
|
|
11
|
+
}, width: any, height: any): void;
|
|
10
12
|
destroy(canvasAndContext: any): void;
|
|
11
13
|
/**
|
|
12
14
|
* @ignore
|
|
@@ -59,8 +59,25 @@ export type PageViewportCloneParameters = {
|
|
|
59
59
|
*/
|
|
60
60
|
dontFlip?: boolean | undefined;
|
|
61
61
|
};
|
|
62
|
+
export function applyOpacity(color: any, opacity: any): any;
|
|
63
|
+
export class ColorScheme {
|
|
64
|
+
static get isDarkMode(): any;
|
|
65
|
+
}
|
|
66
|
+
export class CSSConstants {
|
|
67
|
+
static get commentForegroundColor(): any;
|
|
68
|
+
}
|
|
62
69
|
export function deprecated(details: any): void;
|
|
63
70
|
export function fetchData(url: any, type?: string): Promise<any>;
|
|
71
|
+
/**
|
|
72
|
+
* Find a color that has sufficient contrast against a fixed color.
|
|
73
|
+
* The luminance (in HSL color space) of the base color is adjusted
|
|
74
|
+
* until the contrast ratio between the base color and the fixed color
|
|
75
|
+
* is at least the minimum contrast ratio required by WCAG 2.1.
|
|
76
|
+
* @param {Array<number>} baseColor
|
|
77
|
+
* @param {Array<number>} fixedColor
|
|
78
|
+
* @returns {string}
|
|
79
|
+
*/
|
|
80
|
+
export function findContrastColor(baseColor: Array<number>, fixedColor: Array<number>): string;
|
|
64
81
|
export function getColorValues(colors: any): void;
|
|
65
82
|
export function getCurrentTransform(ctx: any): any[];
|
|
66
83
|
export function getCurrentTransformInverse(ctx: any): any[];
|
|
@@ -89,6 +106,7 @@ export function getXfaPageViewport(xfaPage: any, { scale, rotation }: {
|
|
|
89
106
|
export function isDataScheme(url: any): boolean;
|
|
90
107
|
export function isPdfFile(filename: any): boolean;
|
|
91
108
|
export function isValidFetchUrl(url: any, baseUrl: any): boolean;
|
|
109
|
+
export function makePathFromDrawOPS(data: any): Path2D;
|
|
92
110
|
/**
|
|
93
111
|
* Event handler to suppress context menu.
|
|
94
112
|
*/
|
|
@@ -98,6 +116,7 @@ export function noContextMenu(e: any): void;
|
|
|
98
116
|
*/
|
|
99
117
|
export class OutputScale {
|
|
100
118
|
static get pixelRatio(): number;
|
|
119
|
+
static capPixels(maxPixels: any, capAreaFactor: any): any;
|
|
101
120
|
/**
|
|
102
121
|
* @type {number} Horizontal scale.
|
|
103
122
|
*/
|
|
@@ -119,7 +138,7 @@ export class OutputScale {
|
|
|
119
138
|
* @returns {boolean} Returns `true` if scaling was limited,
|
|
120
139
|
* `false` otherwise.
|
|
121
140
|
*/
|
|
122
|
-
limitCanvas(width: any, height: any, maxPixels: any, maxDim: any): boolean;
|
|
141
|
+
limitCanvas(width: any, height: any, maxPixels: any, maxDim: any, capAreaFactor?: number): boolean;
|
|
123
142
|
}
|
|
124
143
|
/**
|
|
125
144
|
* @typedef {Object} PageViewportParameters
|
|
@@ -207,7 +226,7 @@ export class PageViewport {
|
|
|
207
226
|
convertToPdfPoint(x: number, y: number): any[];
|
|
208
227
|
}
|
|
209
228
|
export class PDFDateString {
|
|
210
|
-
static "__#
|
|
229
|
+
static "__#private@#regex": any;
|
|
211
230
|
/**
|
|
212
231
|
* Convert a PDF date string to a JavaScript `Date` object.
|
|
213
232
|
*
|
|
@@ -237,6 +256,11 @@ export class RenderingCancelledException extends RenderingCancelledException_bas
|
|
|
237
256
|
constructor(msg: any, extraDelay?: number);
|
|
238
257
|
extraDelay: number;
|
|
239
258
|
}
|
|
259
|
+
export function renderRichText({ html, dir, className }: {
|
|
260
|
+
html: any;
|
|
261
|
+
dir: any;
|
|
262
|
+
className: any;
|
|
263
|
+
}, container: any): void;
|
|
240
264
|
/**
|
|
241
265
|
* @param {HTMLDivElement} div
|
|
242
266
|
* @param {PageViewport} viewport
|
|
@@ -245,11 +269,11 @@ export class RenderingCancelledException extends RenderingCancelledException_bas
|
|
|
245
269
|
*/
|
|
246
270
|
export function setLayerDimensions(div: HTMLDivElement, viewport: PageViewport, mustFlip?: boolean, mustRotate?: boolean): void;
|
|
247
271
|
export class StatTimer {
|
|
248
|
-
started: any;
|
|
249
272
|
times: any[];
|
|
250
273
|
time(name: any): void;
|
|
251
274
|
timeEnd(name: any): void;
|
|
252
275
|
toString(): string;
|
|
276
|
+
#private;
|
|
253
277
|
}
|
|
254
278
|
export function stopEvent(e: any): void;
|
|
255
279
|
export const SupportedImageMimeTypes: string[];
|
|
@@ -4,13 +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 "__#private@#id": number;
|
|
8
8
|
static get _svgFactory(): any;
|
|
9
|
-
static "__#
|
|
10
|
-
constructor({ pageIndex }: {
|
|
11
|
-
pageIndex: any;
|
|
12
|
-
});
|
|
13
|
-
pageIndex: any;
|
|
9
|
+
static "__#private@#setBox"(element: any, [x, y, width, height]: [any, any, any, any]): void;
|
|
14
10
|
setParent(parent: any): void;
|
|
15
11
|
draw(properties: any, isPathUpdatable?: boolean, hasClip?: boolean): {
|
|
16
12
|
id: number;
|