@chialab/pdfjs-lib 1.0.0-alpha.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 +29 -0
- package/dist/browser/FoxitDingbats-SB6TO3S5.js +9 -0
- package/dist/browser/FoxitFixed-UIGSMBQB.js +9 -0
- package/dist/browser/FoxitFixedBold-2PAEIZAT.js +9 -0
- package/dist/browser/FoxitFixedBoldItalic-OSQUQDEE.js +9 -0
- package/dist/browser/FoxitFixedItalic-W73RDK22.js +9 -0
- package/dist/browser/FoxitSerif-3HH3SOZF.js +9 -0
- package/dist/browser/FoxitSerifBold-HXP2QOO7.js +9 -0
- package/dist/browser/FoxitSerifBoldItalic-FZXLNWD7.js +9 -0
- package/dist/browser/FoxitSerifItalic-WQFHUBI2.js +9 -0
- package/dist/browser/FoxitSymbol-OVWU7LKS.js +9 -0
- package/dist/browser/LiberationMono-Regular-UUOCTXY2.js +9 -0
- package/dist/browser/LiberationSans-Bold-GSJN42N5.js +9 -0
- package/dist/browser/LiberationSans-BoldItalic-UCPQJ3L2.js +9 -0
- package/dist/browser/LiberationSans-Italic-6CIHEALY.js +9 -0
- package/dist/browser/LiberationSans-Regular-KIF3IRJY.js +9 -0
- package/dist/browser/LiberationSerif-Regular-ASQ2LI3D.js +9 -0
- package/dist/browser/chunk-DYHYQ33L.js +1775 -0
- package/dist/browser/chunk-O4UKW7AD.js +44 -0
- package/dist/browser/index.js +26324 -0
- package/dist/browser/worker.js +84242 -0
- package/dist/index.d.ts +10 -0
- package/dist/lib/AnnotationData.d.ts +204 -0
- package/dist/lib/Canvas.d.ts +17 -0
- package/dist/lib/PDFPageProxy.d.ts +1 -0
- package/dist/lib/Path2D.d.ts +72 -0
- package/dist/lib/StandardFontDataFactory.d.ts +14 -0
- package/dist/lib/SvgCanvasContext.d.ts +156 -0
- package/dist/lib/TextLayer.d.ts +51 -0
- package/dist/lib/polyfills.d.ts +0 -0
- package/dist/lib/utils.d.ts +13 -0
- package/dist/node/FoxitDingbats-65AZ2Z2V.js +9 -0
- package/dist/node/FoxitFixed-OZGLVVOQ.js +9 -0
- package/dist/node/FoxitFixedBold-37OOYMV7.js +9 -0
- package/dist/node/FoxitFixedBoldItalic-XYFHEG2V.js +9 -0
- package/dist/node/FoxitFixedItalic-MM7OSGS6.js +9 -0
- package/dist/node/FoxitSerif-MLMJQPRP.js +9 -0
- package/dist/node/FoxitSerifBold-AC7RJQWJ.js +9 -0
- package/dist/node/FoxitSerifBoldItalic-YCQ4CLKE.js +9 -0
- package/dist/node/FoxitSerifItalic-CXVTCST4.js +9 -0
- package/dist/node/FoxitSymbol-VUGMZN5C.js +9 -0
- package/dist/node/LiberationMono-Regular-KMFXXO3B.js +9 -0
- package/dist/node/LiberationSans-Bold-XSHQQBWB.js +9 -0
- package/dist/node/LiberationSans-BoldItalic-CTAZRFRL.js +9 -0
- package/dist/node/LiberationSans-Italic-WIOTUKLC.js +9 -0
- package/dist/node/LiberationSans-Regular-CDMMZL5S.js +9 -0
- package/dist/node/LiberationSerif-Regular-WAOWR76G.js +9 -0
- package/dist/node/chunk-7MW5RQZ5.js +30 -0
- package/dist/node/chunk-KTTVPO2G.js +1775 -0
- package/dist/node/index.js +26621 -0
- package/dist/node/worker.js +84242 -0
- package/dist/pdf.js/src/display/annotation_layer.d.ts +241 -0
- package/dist/pdf.js/src/display/annotation_storage.d.ts +99 -0
- package/dist/pdf.js/src/display/api.d.ts +1586 -0
- package/dist/pdf.js/src/display/canvas.d.ts +213 -0
- package/dist/pdf.js/src/display/canvas_factory.d.ts +27 -0
- package/dist/pdf.js/src/display/cmap_reader_factory.d.ts +25 -0
- package/dist/pdf.js/src/display/display_utils.d.ts +247 -0
- package/dist/pdf.js/src/display/draw_layer.d.ts +26 -0
- package/dist/pdf.js/src/display/editor/alt_text.d.ts +34 -0
- package/dist/pdf.js/src/display/editor/annotation_editor_layer.d.ts +230 -0
- package/dist/pdf.js/src/display/editor/color_picker.d.ts +20 -0
- package/dist/pdf.js/src/display/editor/draw.d.ts +121 -0
- package/dist/pdf.js/src/display/editor/drawers/contour.d.ts +3 -0
- package/dist/pdf.js/src/display/editor/drawers/freedraw.d.ts +31 -0
- package/dist/pdf.js/src/display/editor/drawers/highlight.d.ts +36 -0
- package/dist/pdf.js/src/display/editor/drawers/inkdraw.d.ts +129 -0
- package/dist/pdf.js/src/display/editor/drawers/outline.d.ts +19 -0
- package/dist/pdf.js/src/display/editor/drawers/signaturedraw.d.ts +79 -0
- package/dist/pdf.js/src/display/editor/editor.d.ts +474 -0
- package/dist/pdf.js/src/display/editor/freetext.d.ts +59 -0
- package/dist/pdf.js/src/display/editor/highlight.d.ts +70 -0
- package/dist/pdf.js/src/display/editor/ink.d.ts +36 -0
- package/dist/pdf.js/src/display/editor/signature.d.ts +79 -0
- package/dist/pdf.js/src/display/editor/stamp.d.ts +48 -0
- package/dist/pdf.js/src/display/editor/toolbar.d.ts +21 -0
- package/dist/pdf.js/src/display/editor/tools.d.ts +424 -0
- package/dist/pdf.js/src/display/filter_factory.d.ts +29 -0
- package/dist/pdf.js/src/display/font_loader.d.ts +39 -0
- package/dist/pdf.js/src/display/metadata.d.ts +11 -0
- package/dist/pdf.js/src/display/node_utils.d.ts +32 -0
- package/dist/pdf.js/src/display/optional_content_config.d.ts +18 -0
- package/dist/pdf.js/src/display/pattern_helper.d.ts +73 -0
- package/dist/pdf.js/src/display/standard_fontdata_factory.d.ts +20 -0
- package/dist/pdf.js/src/display/svg_factory.d.ts +14 -0
- package/dist/pdf.js/src/display/text_layer.d.ts +85 -0
- package/dist/pdf.js/src/display/touch_manager.d.ts +14 -0
- package/dist/pdf.js/src/display/transport_stream.d.ts +67 -0
- package/dist/pdf.js/src/display/wasm_factory.d.ts +20 -0
- package/dist/pdf.js/src/display/worker_options.d.ts +25 -0
- package/dist/pdf.js/src/display/xfa_layer.d.ts +47 -0
- package/dist/pdf.js/src/display/xfa_text.d.ts +21 -0
- package/dist/pdf.js/src/interfaces.d.ts +122 -0
- package/dist/pdf.js/src/pdf.d.ts +55 -0
- package/dist/pdf.js/src/shared/image_utils.d.ts +17 -0
- package/dist/pdf.js/src/shared/message_handler.d.ts +48 -0
- package/dist/pdf.js/src/shared/murmurhash3.d.ts +7 -0
- package/dist/pdf.js/src/shared/scripting_utils.d.ts +16 -0
- package/dist/pdf.js/src/shared/util.d.ts +388 -0
- package/dist/pdf.js/web/interfaces.d.ts +167 -0
- package/dist/pdf.js/web/struct_tree_layer_builder.d.ts +25 -0
- package/dist/pdf.js/web/text_accessibility.d.ts +44 -0
- package/dist/pdf.js/web/ui_utils.d.ts +273 -0
- package/package.json +43 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
export class CanvasGraphics {
|
|
2
|
+
constructor(canvasCtx: any, commonObjs: any, objs: any, canvasFactory: any, filterFactory: any, { optionalContentConfig, markedContentStack }: {
|
|
3
|
+
optionalContentConfig: any;
|
|
4
|
+
markedContentStack?: null | undefined;
|
|
5
|
+
}, annotationCanvasMap: any, pageColors: any);
|
|
6
|
+
ctx: any;
|
|
7
|
+
current: CanvasExtraState;
|
|
8
|
+
stateStack: any[];
|
|
9
|
+
pendingClip: {} | {} | null;
|
|
10
|
+
pendingEOFill: boolean;
|
|
11
|
+
res: any;
|
|
12
|
+
xobjs: any;
|
|
13
|
+
commonObjs: any;
|
|
14
|
+
objs: any;
|
|
15
|
+
canvasFactory: any;
|
|
16
|
+
filterFactory: any;
|
|
17
|
+
groupStack: any[];
|
|
18
|
+
processingType3: any;
|
|
19
|
+
baseTransform: any;
|
|
20
|
+
baseTransformStack: any[];
|
|
21
|
+
groupLevel: number;
|
|
22
|
+
smaskStack: any[];
|
|
23
|
+
smaskCounter: number;
|
|
24
|
+
tempSMask: any;
|
|
25
|
+
suspendedCtx: any;
|
|
26
|
+
contentVisible: boolean;
|
|
27
|
+
markedContentStack: never[];
|
|
28
|
+
optionalContentConfig: any;
|
|
29
|
+
cachedCanvases: CachedCanvases;
|
|
30
|
+
cachedPatterns: Map<any, any>;
|
|
31
|
+
annotationCanvasMap: any;
|
|
32
|
+
viewportScale: number;
|
|
33
|
+
outputScaleX: number;
|
|
34
|
+
outputScaleY: number;
|
|
35
|
+
pageColors: any;
|
|
36
|
+
_cachedScaleForStroking: number[];
|
|
37
|
+
_cachedGetSinglePixelWidth: number | null;
|
|
38
|
+
_cachedBitmapsMap: Map<any, any>;
|
|
39
|
+
getObject(data: any, fallback?: null): any;
|
|
40
|
+
beginDrawing({ transform, viewport, transparency, background, }: {
|
|
41
|
+
transform: any;
|
|
42
|
+
viewport: any;
|
|
43
|
+
transparency?: boolean | undefined;
|
|
44
|
+
background?: null | undefined;
|
|
45
|
+
}): void;
|
|
46
|
+
compositeCtx: any;
|
|
47
|
+
transparentCanvas: any;
|
|
48
|
+
executeOperatorList(operatorList: any, executionStartIdx: any, continueCallback: any, stepper: any): any;
|
|
49
|
+
endDrawing(): void;
|
|
50
|
+
_scaleImage(img: any, inverseTransform: any): {
|
|
51
|
+
img: any;
|
|
52
|
+
paintWidth: any;
|
|
53
|
+
paintHeight: any;
|
|
54
|
+
};
|
|
55
|
+
_createMaskCanvas(img: any): {
|
|
56
|
+
canvas: any;
|
|
57
|
+
offsetX: number;
|
|
58
|
+
offsetY: number;
|
|
59
|
+
};
|
|
60
|
+
setLineWidth(width: any): void;
|
|
61
|
+
setLineCap(style: any): void;
|
|
62
|
+
setLineJoin(style: any): void;
|
|
63
|
+
setMiterLimit(limit: any): void;
|
|
64
|
+
setDash(dashArray: any, dashPhase: any): void;
|
|
65
|
+
setRenderingIntent(intent: any): void;
|
|
66
|
+
setFlatness(flatness: any): void;
|
|
67
|
+
setGState(states: any): void;
|
|
68
|
+
get inSMaskMode(): boolean;
|
|
69
|
+
checkSMaskState(): void;
|
|
70
|
+
/**
|
|
71
|
+
* Soft mask mode takes the current main drawing canvas and replaces it with
|
|
72
|
+
* a temporary canvas. Any drawing operations that happen on the temporary
|
|
73
|
+
* canvas need to be composed with the main canvas that was suspended (see
|
|
74
|
+
* `compose()`). The temporary canvas also duplicates many of its operations
|
|
75
|
+
* on the suspended canvas to keep them in sync, so that when the soft mask
|
|
76
|
+
* mode ends any clipping paths or transformations will still be active and in
|
|
77
|
+
* the right order on the canvas' graphics state stack.
|
|
78
|
+
*/
|
|
79
|
+
beginSMaskMode(): void;
|
|
80
|
+
endSMaskMode(): void;
|
|
81
|
+
compose(dirtyBox: any): void;
|
|
82
|
+
composeSMask(ctx: any, smask: any, layerCtx: any, layerBox: any): void;
|
|
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;
|
|
84
|
+
save(): void;
|
|
85
|
+
restore(): void;
|
|
86
|
+
transform(a: any, b: any, c: any, d: any, e: any, f: any): void;
|
|
87
|
+
constructPath(ops: any, args: any, minMax: any): void;
|
|
88
|
+
closePath(): void;
|
|
89
|
+
stroke(consumePath?: boolean): void;
|
|
90
|
+
closeStroke(): void;
|
|
91
|
+
fill(consumePath?: boolean): void;
|
|
92
|
+
eoFill(): void;
|
|
93
|
+
fillStroke(): void;
|
|
94
|
+
eoFillStroke(): void;
|
|
95
|
+
closeFillStroke(): void;
|
|
96
|
+
closeEOFillStroke(): void;
|
|
97
|
+
endPath(): void;
|
|
98
|
+
clip(): void;
|
|
99
|
+
eoClip(): void;
|
|
100
|
+
beginText(): void;
|
|
101
|
+
endText(): void;
|
|
102
|
+
setCharSpacing(spacing: any): void;
|
|
103
|
+
setWordSpacing(spacing: any): void;
|
|
104
|
+
setHScale(scale: any): void;
|
|
105
|
+
setLeading(leading: any): void;
|
|
106
|
+
setFont(fontRefName: any, size: any): void;
|
|
107
|
+
setTextRenderingMode(mode: any): void;
|
|
108
|
+
setTextRise(rise: any): void;
|
|
109
|
+
moveText(x: any, y: any): void;
|
|
110
|
+
setLeadingMoveText(x: any, y: any): void;
|
|
111
|
+
setTextMatrix(a: any, b: any, c: any, d: any, e: any, f: any): void;
|
|
112
|
+
nextLine(): void;
|
|
113
|
+
paintChar(character: any, x: any, y: any, patternFillTransform: any, patternStrokeTransform: any): void;
|
|
114
|
+
get isFontSubpixelAAEnabled(): any;
|
|
115
|
+
showText(glyphs: any): void;
|
|
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(r: any, g: any, b: any): void;
|
|
123
|
+
setStrokeTransparent(): void;
|
|
124
|
+
setFillRGBColor(r: any, g: any, b: any): void;
|
|
125
|
+
setFillTransparent(): void;
|
|
126
|
+
_getPattern(objId: any, matrix?: null): any;
|
|
127
|
+
shadingFill(objId: any): void;
|
|
128
|
+
beginInlineImage(): void;
|
|
129
|
+
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;
|
|
135
|
+
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;
|
|
142
|
+
applyTransferMapsToCanvas(ctx: any): any;
|
|
143
|
+
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(clipBox: any): void;
|
|
155
|
+
getSinglePixelWidth(): number;
|
|
156
|
+
getScaleForStroking(): number[];
|
|
157
|
+
rescaleAndStroke(saveRestore: any): void;
|
|
158
|
+
isContentVisible(): boolean;
|
|
159
|
+
#private;
|
|
160
|
+
}
|
|
161
|
+
declare class CanvasExtraState {
|
|
162
|
+
constructor(width: any, height: any);
|
|
163
|
+
alphaIsShape: boolean;
|
|
164
|
+
fontSize: number;
|
|
165
|
+
fontSizeScale: number;
|
|
166
|
+
textMatrix: number[];
|
|
167
|
+
textMatrixScale: number;
|
|
168
|
+
fontMatrix: number[];
|
|
169
|
+
leading: number;
|
|
170
|
+
x: number;
|
|
171
|
+
y: number;
|
|
172
|
+
lineX: number;
|
|
173
|
+
lineY: number;
|
|
174
|
+
charSpacing: number;
|
|
175
|
+
wordSpacing: number;
|
|
176
|
+
textHScale: number;
|
|
177
|
+
textRenderingMode: number;
|
|
178
|
+
textRise: number;
|
|
179
|
+
fillColor: string;
|
|
180
|
+
strokeColor: string;
|
|
181
|
+
patternFill: boolean;
|
|
182
|
+
patternStroke: boolean;
|
|
183
|
+
fillAlpha: number;
|
|
184
|
+
strokeAlpha: number;
|
|
185
|
+
lineWidth: number;
|
|
186
|
+
activeSMask: any;
|
|
187
|
+
transferMaps: string;
|
|
188
|
+
clone(): any;
|
|
189
|
+
setCurrentPoint(x: any, y: any): void;
|
|
190
|
+
updatePathMinMax(transform: any, x: any, y: any): void;
|
|
191
|
+
minX: any;
|
|
192
|
+
minY: any;
|
|
193
|
+
maxX: any;
|
|
194
|
+
maxY: any;
|
|
195
|
+
updateRectMinMax(transform: any, rect: any): void;
|
|
196
|
+
updateScalingPathMinMax(transform: any, minMax: any): void;
|
|
197
|
+
updateCurvePathMinMax(transform: any, x0: any, y0: any, x1: any, y1: any, x2: any, y2: any, x3: any, y3: any, minMax: any): void;
|
|
198
|
+
getPathBoundingBox(pathType?: string, transform?: null): any[];
|
|
199
|
+
updateClipFromPath(): void;
|
|
200
|
+
isEmptyClip(): boolean;
|
|
201
|
+
startNewPathAndClipBox(box: any): void;
|
|
202
|
+
clipBox: any;
|
|
203
|
+
getClippedPathBoundingBox(pathType?: string, transform?: null): number[] | null;
|
|
204
|
+
}
|
|
205
|
+
declare class CachedCanvases {
|
|
206
|
+
constructor(canvasFactory: any);
|
|
207
|
+
canvasFactory: any;
|
|
208
|
+
cache: any;
|
|
209
|
+
getCanvas(id: any, width: any, height: any): any;
|
|
210
|
+
delete(id: any): void;
|
|
211
|
+
clear(): void;
|
|
212
|
+
}
|
|
213
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export class BaseCanvasFactory {
|
|
2
|
+
constructor({ enableHWA }: {
|
|
3
|
+
enableHWA?: boolean | undefined;
|
|
4
|
+
});
|
|
5
|
+
create(width: any, height: any): {
|
|
6
|
+
canvas: void;
|
|
7
|
+
context: any;
|
|
8
|
+
};
|
|
9
|
+
reset(canvasAndContext: any, width: any, height: any): void;
|
|
10
|
+
destroy(canvasAndContext: any): void;
|
|
11
|
+
/**
|
|
12
|
+
* @ignore
|
|
13
|
+
*/
|
|
14
|
+
_createCanvas(width: any, height: any): void;
|
|
15
|
+
#private;
|
|
16
|
+
}
|
|
17
|
+
export class DOMCanvasFactory extends BaseCanvasFactory {
|
|
18
|
+
constructor({ ownerDocument, enableHWA }: {
|
|
19
|
+
ownerDocument?: Document | undefined;
|
|
20
|
+
enableHWA?: boolean | undefined;
|
|
21
|
+
});
|
|
22
|
+
_document: Document;
|
|
23
|
+
/**
|
|
24
|
+
* @ignore
|
|
25
|
+
*/
|
|
26
|
+
_createCanvas(width: any, height: any): HTMLCanvasElement;
|
|
27
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export class BaseCMapReaderFactory {
|
|
2
|
+
constructor({ baseUrl, isCompressed }: {
|
|
3
|
+
baseUrl?: null | undefined;
|
|
4
|
+
isCompressed?: boolean | undefined;
|
|
5
|
+
});
|
|
6
|
+
baseUrl: any;
|
|
7
|
+
isCompressed: boolean;
|
|
8
|
+
fetch({ name }: {
|
|
9
|
+
name: any;
|
|
10
|
+
}): Promise<{
|
|
11
|
+
cMapData: Uint8Array<ArrayBufferLike>;
|
|
12
|
+
isCompressed: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* @ignore
|
|
16
|
+
* @returns {Promise<Uint8Array>}
|
|
17
|
+
*/
|
|
18
|
+
_fetch(url: any): Promise<Uint8Array>;
|
|
19
|
+
}
|
|
20
|
+
export class DOMCMapReaderFactory extends BaseCMapReaderFactory {
|
|
21
|
+
/**
|
|
22
|
+
* @ignore
|
|
23
|
+
*/
|
|
24
|
+
_fetch(url: any): Promise<Uint8Array<any>>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
export type PageViewportParameters = {
|
|
2
|
+
/**
|
|
3
|
+
* - The xMin, yMin, xMax and
|
|
4
|
+
* yMax coordinates.
|
|
5
|
+
*/
|
|
6
|
+
viewBox: Array<number>;
|
|
7
|
+
/**
|
|
8
|
+
* - The size of units.
|
|
9
|
+
*/
|
|
10
|
+
userUnit: number;
|
|
11
|
+
/**
|
|
12
|
+
* - The scale of the viewport.
|
|
13
|
+
*/
|
|
14
|
+
scale: number;
|
|
15
|
+
/**
|
|
16
|
+
* - The rotation, in degrees, of the viewport.
|
|
17
|
+
*/
|
|
18
|
+
rotation: number;
|
|
19
|
+
/**
|
|
20
|
+
* - The horizontal, i.e. x-axis, offset. The
|
|
21
|
+
* default value is `0`.
|
|
22
|
+
*/
|
|
23
|
+
offsetX?: number | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* - The vertical, i.e. y-axis, offset. The
|
|
26
|
+
* default value is `0`.
|
|
27
|
+
*/
|
|
28
|
+
offsetY?: number | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* - If true, the y-axis will not be flipped.
|
|
31
|
+
* The default value is `false`.
|
|
32
|
+
*/
|
|
33
|
+
dontFlip?: boolean | undefined;
|
|
34
|
+
};
|
|
35
|
+
export type PageViewportCloneParameters = {
|
|
36
|
+
/**
|
|
37
|
+
* - The scale, overriding the one in the cloned
|
|
38
|
+
* viewport. The default value is `this.scale`.
|
|
39
|
+
*/
|
|
40
|
+
scale?: number | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* - The rotation, in degrees, overriding the one
|
|
43
|
+
* in the cloned viewport. The default value is `this.rotation`.
|
|
44
|
+
*/
|
|
45
|
+
rotation?: number | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* - The horizontal, i.e. x-axis, offset.
|
|
48
|
+
* The default value is `this.offsetX`.
|
|
49
|
+
*/
|
|
50
|
+
offsetX?: number | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* - The vertical, i.e. y-axis, offset.
|
|
53
|
+
* The default value is `this.offsetY`.
|
|
54
|
+
*/
|
|
55
|
+
offsetY?: number | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* - If true, the x-axis will not be flipped.
|
|
58
|
+
* The default value is `false`.
|
|
59
|
+
*/
|
|
60
|
+
dontFlip?: boolean | undefined;
|
|
61
|
+
};
|
|
62
|
+
export function deprecated(details: any): void;
|
|
63
|
+
export function fetchData(url: any, type?: string): Promise<any>;
|
|
64
|
+
export function getColorValues(colors: any): void;
|
|
65
|
+
export function getCurrentTransform(ctx: any): any[];
|
|
66
|
+
export function getCurrentTransformInverse(ctx: any): any[];
|
|
67
|
+
/**
|
|
68
|
+
* Gets the filename from a given URL.
|
|
69
|
+
* @param {string} url
|
|
70
|
+
* @returns {string}
|
|
71
|
+
*/
|
|
72
|
+
export function getFilenameFromUrl(url: string): string;
|
|
73
|
+
/**
|
|
74
|
+
* Returns the filename or guessed filename from the url (see issue 3455).
|
|
75
|
+
* @param {string} url - The original PDF location.
|
|
76
|
+
* @param {string} defaultFilename - The value returned if the filename is
|
|
77
|
+
* unknown, or the protocol is unsupported.
|
|
78
|
+
* @returns {string} Guessed PDF filename.
|
|
79
|
+
*/
|
|
80
|
+
export function getPdfFilenameFromUrl(url: string, defaultFilename?: string): string;
|
|
81
|
+
export function getRGB(color: any): any;
|
|
82
|
+
/**
|
|
83
|
+
* NOTE: This is (mostly) intended to support printing of XFA forms.
|
|
84
|
+
*/
|
|
85
|
+
export function getXfaPageViewport(xfaPage: any, { scale, rotation }: {
|
|
86
|
+
scale?: number | undefined;
|
|
87
|
+
rotation?: number | undefined;
|
|
88
|
+
}): PageViewport;
|
|
89
|
+
export function isDataScheme(url: any): boolean;
|
|
90
|
+
export function isPdfFile(filename: any): boolean;
|
|
91
|
+
export function isValidFetchUrl(url: any, baseUrl: any): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Event handler to suppress context menu.
|
|
94
|
+
*/
|
|
95
|
+
export function noContextMenu(e: any): void;
|
|
96
|
+
/**
|
|
97
|
+
* Scale factors for the canvas, necessary with HiDPI displays.
|
|
98
|
+
*/
|
|
99
|
+
export class OutputScale {
|
|
100
|
+
/**
|
|
101
|
+
* @type {number} Horizontal scale.
|
|
102
|
+
*/
|
|
103
|
+
sx: number;
|
|
104
|
+
/**
|
|
105
|
+
* @type {number} Vertical scale.
|
|
106
|
+
*/
|
|
107
|
+
sy: number;
|
|
108
|
+
/**
|
|
109
|
+
* @type {boolean} Returns `true` when scaling is required, `false` otherwise.
|
|
110
|
+
*/
|
|
111
|
+
get scaled(): boolean;
|
|
112
|
+
get symmetric(): boolean;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* @typedef {Object} PageViewportParameters
|
|
116
|
+
* @property {Array<number>} viewBox - The xMin, yMin, xMax and
|
|
117
|
+
* yMax coordinates.
|
|
118
|
+
* @property {number} userUnit - The size of units.
|
|
119
|
+
* @property {number} scale - The scale of the viewport.
|
|
120
|
+
* @property {number} rotation - The rotation, in degrees, of the viewport.
|
|
121
|
+
* @property {number} [offsetX] - The horizontal, i.e. x-axis, offset. The
|
|
122
|
+
* default value is `0`.
|
|
123
|
+
* @property {number} [offsetY] - The vertical, i.e. y-axis, offset. The
|
|
124
|
+
* default value is `0`.
|
|
125
|
+
* @property {boolean} [dontFlip] - If true, the y-axis will not be flipped.
|
|
126
|
+
* The default value is `false`.
|
|
127
|
+
*/
|
|
128
|
+
/**
|
|
129
|
+
* @typedef {Object} PageViewportCloneParameters
|
|
130
|
+
* @property {number} [scale] - The scale, overriding the one in the cloned
|
|
131
|
+
* viewport. The default value is `this.scale`.
|
|
132
|
+
* @property {number} [rotation] - The rotation, in degrees, overriding the one
|
|
133
|
+
* in the cloned viewport. The default value is `this.rotation`.
|
|
134
|
+
* @property {number} [offsetX] - The horizontal, i.e. x-axis, offset.
|
|
135
|
+
* The default value is `this.offsetX`.
|
|
136
|
+
* @property {number} [offsetY] - The vertical, i.e. y-axis, offset.
|
|
137
|
+
* The default value is `this.offsetY`.
|
|
138
|
+
* @property {boolean} [dontFlip] - If true, the x-axis will not be flipped.
|
|
139
|
+
* The default value is `false`.
|
|
140
|
+
*/
|
|
141
|
+
/**
|
|
142
|
+
* PDF page viewport created based on scale, rotation and offset.
|
|
143
|
+
*/
|
|
144
|
+
export class PageViewport {
|
|
145
|
+
/**
|
|
146
|
+
* @param {PageViewportParameters}
|
|
147
|
+
*/
|
|
148
|
+
constructor({ viewBox, userUnit, scale, rotation, offsetX, offsetY, dontFlip, }: PageViewportParameters);
|
|
149
|
+
viewBox: number[];
|
|
150
|
+
userUnit: number;
|
|
151
|
+
scale: number;
|
|
152
|
+
rotation: number;
|
|
153
|
+
offsetX: number;
|
|
154
|
+
offsetY: number;
|
|
155
|
+
transform: number[];
|
|
156
|
+
width: number;
|
|
157
|
+
height: number;
|
|
158
|
+
/**
|
|
159
|
+
* The original, un-scaled, viewport dimensions.
|
|
160
|
+
* @type {Object}
|
|
161
|
+
*/
|
|
162
|
+
get rawDims(): Object;
|
|
163
|
+
/**
|
|
164
|
+
* Clones viewport, with optional additional properties.
|
|
165
|
+
* @param {PageViewportCloneParameters} [params]
|
|
166
|
+
* @returns {PageViewport} Cloned viewport.
|
|
167
|
+
*/
|
|
168
|
+
clone({ scale, rotation, offsetX, offsetY, dontFlip, }?: PageViewportCloneParameters): PageViewport;
|
|
169
|
+
/**
|
|
170
|
+
* Converts PDF point to the viewport coordinates. For examples, useful for
|
|
171
|
+
* converting PDF location into canvas pixel coordinates.
|
|
172
|
+
* @param {number} x - The x-coordinate.
|
|
173
|
+
* @param {number} y - The y-coordinate.
|
|
174
|
+
* @returns {Array} Array containing `x`- and `y`-coordinates of the
|
|
175
|
+
* point in the viewport coordinate space.
|
|
176
|
+
* @see {@link convertToPdfPoint}
|
|
177
|
+
* @see {@link convertToViewportRectangle}
|
|
178
|
+
*/
|
|
179
|
+
convertToViewportPoint(x: number, y: number): any[];
|
|
180
|
+
/**
|
|
181
|
+
* Converts PDF rectangle to the viewport coordinates.
|
|
182
|
+
* @param {Array} rect - The xMin, yMin, xMax and yMax coordinates.
|
|
183
|
+
* @returns {Array} Array containing corresponding coordinates of the
|
|
184
|
+
* rectangle in the viewport coordinate space.
|
|
185
|
+
* @see {@link convertToViewportPoint}
|
|
186
|
+
*/
|
|
187
|
+
convertToViewportRectangle(rect: any[]): any[];
|
|
188
|
+
/**
|
|
189
|
+
* Converts viewport coordinates to the PDF location. For examples, useful
|
|
190
|
+
* for converting canvas pixel location into PDF one.
|
|
191
|
+
* @param {number} x - The x-coordinate.
|
|
192
|
+
* @param {number} y - The y-coordinate.
|
|
193
|
+
* @returns {Array} Array containing `x`- and `y`-coordinates of the
|
|
194
|
+
* point in the PDF coordinate space.
|
|
195
|
+
* @see {@link convertToViewportPoint}
|
|
196
|
+
*/
|
|
197
|
+
convertToPdfPoint(x: number, y: number): any[];
|
|
198
|
+
}
|
|
199
|
+
export class PDFDateString {
|
|
200
|
+
static "__#2@#regex": any;
|
|
201
|
+
/**
|
|
202
|
+
* Convert a PDF date string to a JavaScript `Date` object.
|
|
203
|
+
*
|
|
204
|
+
* The PDF date string format is described in section 7.9.4 of the official
|
|
205
|
+
* PDF 32000-1:2008 specification. However, in the PDF 1.7 reference (sixth
|
|
206
|
+
* edition) Adobe describes the same format including a trailing apostrophe.
|
|
207
|
+
* This syntax in incorrect, but Adobe Acrobat creates PDF files that contain
|
|
208
|
+
* them. We ignore all apostrophes as they are not necessary for date parsing.
|
|
209
|
+
*
|
|
210
|
+
* Moreover, Adobe Acrobat doesn't handle changing the date to universal time
|
|
211
|
+
* and doesn't use the user's time zone (effectively ignoring the HH' and mm'
|
|
212
|
+
* parts of the date string).
|
|
213
|
+
*
|
|
214
|
+
* @param {string} input
|
|
215
|
+
* @returns {Date|null}
|
|
216
|
+
*/
|
|
217
|
+
static toDateObject(input: string): Date | null;
|
|
218
|
+
}
|
|
219
|
+
export class PixelsPerInch {
|
|
220
|
+
static CSS: number;
|
|
221
|
+
static PDF: number;
|
|
222
|
+
static PDF_TO_CSS_UNITS: number;
|
|
223
|
+
}
|
|
224
|
+
declare const RenderingCancelledException_base: any;
|
|
225
|
+
export class RenderingCancelledException extends RenderingCancelledException_base {
|
|
226
|
+
[x: string]: any;
|
|
227
|
+
constructor(msg: any, extraDelay?: number);
|
|
228
|
+
extraDelay: number;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* @param {HTMLDivElement} div
|
|
232
|
+
* @param {PageViewport} viewport
|
|
233
|
+
* @param {boolean} mustFlip
|
|
234
|
+
* @param {boolean} mustRotate
|
|
235
|
+
*/
|
|
236
|
+
export function setLayerDimensions(div: HTMLDivElement, viewport: PageViewport, mustFlip?: boolean, mustRotate?: boolean): void;
|
|
237
|
+
export class StatTimer {
|
|
238
|
+
started: any;
|
|
239
|
+
times: any[];
|
|
240
|
+
time(name: any): void;
|
|
241
|
+
timeEnd(name: any): void;
|
|
242
|
+
toString(): string;
|
|
243
|
+
}
|
|
244
|
+
export function stopEvent(e: any): void;
|
|
245
|
+
export const SupportedImageMimeTypes: string[];
|
|
246
|
+
export const SVG_NS: "http://www.w3.org/2000/svg";
|
|
247
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manage the SVGs drawn on top of the page canvas.
|
|
3
|
+
* It's important to have them directly on top of the canvas because we want to
|
|
4
|
+
* be able to use mix-blend-mode for some of them.
|
|
5
|
+
*/
|
|
6
|
+
export class DrawLayer {
|
|
7
|
+
static "__#33@#id": number;
|
|
8
|
+
static get _svgFactory(): any;
|
|
9
|
+
static "__#33@#setBox"(element: any, [x, y, width, height]: [any, any, any, any]): void;
|
|
10
|
+
constructor({ pageIndex }: {
|
|
11
|
+
pageIndex: any;
|
|
12
|
+
});
|
|
13
|
+
pageIndex: any;
|
|
14
|
+
setParent(parent: any): void;
|
|
15
|
+
draw(properties: any, isPathUpdatable?: boolean, hasClip?: boolean): {
|
|
16
|
+
id: number;
|
|
17
|
+
clipPathId: string;
|
|
18
|
+
};
|
|
19
|
+
drawOutline(properties: any, mustRemoveSelfIntersections: any): number;
|
|
20
|
+
finalizeDraw(id: any, properties: any): void;
|
|
21
|
+
updateProperties(elementOrId: any, properties: any): void;
|
|
22
|
+
updateParent(id: any, layer: any): void;
|
|
23
|
+
remove(id: any): void;
|
|
24
|
+
destroy(): void;
|
|
25
|
+
#private;
|
|
26
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export class AltText {
|
|
2
|
+
static "__#40@#l10nNewButton": null;
|
|
3
|
+
static _l10n: null;
|
|
4
|
+
static initialize(l10n: any): void;
|
|
5
|
+
constructor(editor: any);
|
|
6
|
+
render(): Promise<HTMLButtonElement>;
|
|
7
|
+
finish(): void;
|
|
8
|
+
isEmpty(): boolean;
|
|
9
|
+
hasData(): boolean;
|
|
10
|
+
get guessedText(): null;
|
|
11
|
+
setGuessedText(guessedText: any): Promise<void>;
|
|
12
|
+
toggleAltTextBadge(visibility?: boolean): void;
|
|
13
|
+
serialize(isForCopying: any): {
|
|
14
|
+
altText: null;
|
|
15
|
+
decorative: boolean;
|
|
16
|
+
guessedText: null;
|
|
17
|
+
textWithDisclaimer: null;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Set the alt text data.
|
|
21
|
+
*/
|
|
22
|
+
set data({ altText, decorative, guessedText, textWithDisclaimer, cancel, }: {
|
|
23
|
+
altText: null;
|
|
24
|
+
decorative: boolean;
|
|
25
|
+
});
|
|
26
|
+
get data(): {
|
|
27
|
+
altText: null;
|
|
28
|
+
decorative: boolean;
|
|
29
|
+
};
|
|
30
|
+
toggle(enabled?: boolean): void;
|
|
31
|
+
shown(): void;
|
|
32
|
+
destroy(): void;
|
|
33
|
+
#private;
|
|
34
|
+
}
|