pdfjs-serverless 1.0.1 → 1.1.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 +1 -1
- package/dist/index.mjs +1 -1
- package/dist/types/src/display/annotation_layer.d.ts +10 -2
- package/dist/types/src/display/api.d.ts +53 -75
- package/dist/types/src/display/api_utils.d.ts +13 -0
- 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 +3 -2
- 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 +6 -6
- package/dist/types/src/display/editor/color_picker.d.ts +20 -1
- package/dist/types/src/display/editor/comment.d.ts +32 -0
- package/dist/types/src/display/editor/draw.d.ts +8 -8
- 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 +54 -5
- package/dist/types/src/display/editor/freetext.d.ts +11 -7
- package/dist/types/src/display/editor/highlight.d.ts +6 -3
- package/dist/types/src/display/editor/ink.d.ts +4 -0
- package/dist/types/src/display/editor/signature.d.ts +2 -0
- package/dist/types/src/display/editor/stamp.d.ts +3 -1
- package/dist/types/src/display/editor/toolbar.d.ts +6 -3
- package/dist/types/src/display/editor/tools.d.ts +16 -4
- package/dist/types/src/display/fetch_stream.d.ts +2 -2
- package/dist/types/src/display/pdf_objects.d.ts +40 -0
- 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/pdf.d.ts +3 -2
- package/dist/types/src/shared/scripting_utils.d.ts +2 -0
- package/dist/types/src/shared/util.d.ts +9 -5
- 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 -1
- package/dist/types/web/event_utils.d.ts +1 -1
- 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_find_controller.d.ts +1 -1
- 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 +18 -7
- package/dist/types/web/pdf_thumbnail_view.d.ts +2 -10
- package/dist/types/web/pdf_viewer.d.ts +55 -1
- package/dist/types/web/text_accessibility.d.ts +1 -1
- package/dist/types/web/text_layer_builder.d.ts +4 -4
- package/package.json +10 -10
|
@@ -152,8 +152,7 @@ export class StampAnnotationElement extends AnnotationElement {
|
|
|
152
152
|
}
|
|
153
153
|
import { AnnotationStorage } from "./annotation_storage.js";
|
|
154
154
|
declare class AnnotationElement {
|
|
155
|
-
static _hasPopupData({
|
|
156
|
-
titleObj: any;
|
|
155
|
+
static _hasPopupData({ contentsObj, richText }: {
|
|
157
156
|
contentsObj: any;
|
|
158
157
|
richText: any;
|
|
159
158
|
}): boolean;
|
|
@@ -171,6 +170,7 @@ declare class AnnotationElement {
|
|
|
171
170
|
renderForms: any;
|
|
172
171
|
svgFactory: any;
|
|
173
172
|
annotationStorage: any;
|
|
173
|
+
enableComment: any;
|
|
174
174
|
enableScripting: any;
|
|
175
175
|
hasJSActions: any;
|
|
176
176
|
_fieldObjects: any;
|
|
@@ -178,7 +178,12 @@ declare class AnnotationElement {
|
|
|
178
178
|
container: HTMLElement | undefined;
|
|
179
179
|
get _isEditable(): any;
|
|
180
180
|
get hasPopupData(): boolean;
|
|
181
|
+
get hasCommentButton(): any;
|
|
182
|
+
get commentButtonPosition(): any[] | null;
|
|
183
|
+
get commentButtonColor(): string | null;
|
|
184
|
+
_normalizePoint(point: any): any;
|
|
181
185
|
updateEdited(params: any): void;
|
|
186
|
+
popup: any;
|
|
182
187
|
resetEdited(): void;
|
|
183
188
|
/**
|
|
184
189
|
* Create an empty container for the annotation's HTML element.
|
|
@@ -205,10 +210,13 @@ declare class AnnotationElement {
|
|
|
205
210
|
* annotations that do not have a Popup entry in the dictionary, but
|
|
206
211
|
* are of a type that works with popups (such as Highlight annotations).
|
|
207
212
|
*
|
|
213
|
+
* @param {Object} [popupData] - The data for the popup, if any.
|
|
214
|
+
*
|
|
208
215
|
* @private
|
|
209
216
|
* @memberof AnnotationElement
|
|
210
217
|
*/
|
|
211
218
|
private _createPopup;
|
|
219
|
+
get hasPopupElement(): boolean;
|
|
212
220
|
/**
|
|
213
221
|
* Render the annotation's HTML element(s).
|
|
214
222
|
*
|
|
@@ -48,7 +48,7 @@ export type DocumentInitParameters = {
|
|
|
48
48
|
range?: PDFDataRangeTransport | undefined;
|
|
49
49
|
/**
|
|
50
50
|
* - Specify maximum number of bytes fetched
|
|
51
|
-
* per range request. The default value is
|
|
51
|
+
* per range request. The default value is 65536 (= 2^16).
|
|
52
52
|
*/
|
|
53
53
|
rangeChunkSize?: number | undefined;
|
|
54
54
|
/**
|
|
@@ -414,15 +414,24 @@ export type GetAnnotationsParameters = {
|
|
|
414
414
|
*/
|
|
415
415
|
export type RenderParameters = {
|
|
416
416
|
/**
|
|
417
|
-
* - A
|
|
418
|
-
*
|
|
417
|
+
* - A DOM Canvas object. The default
|
|
418
|
+
* value is the canvas associated with the `canvasContext` parameter if no
|
|
419
|
+
* value is provided explicitly.
|
|
419
420
|
*/
|
|
420
|
-
|
|
421
|
+
canvas: HTMLCanvasElement | null;
|
|
421
422
|
/**
|
|
422
423
|
* - Rendering viewport obtained by calling
|
|
423
424
|
* the `PDFPageProxy.getViewport` method.
|
|
424
425
|
*/
|
|
425
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;
|
|
426
435
|
/**
|
|
427
436
|
* - Rendering intent, can be 'display', 'print',
|
|
428
437
|
* or 'any'. The default value is 'display'.
|
|
@@ -483,6 +492,16 @@ export type RenderParameters = {
|
|
|
483
492
|
* - Render the page in editing mode.
|
|
484
493
|
*/
|
|
485
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;
|
|
486
505
|
};
|
|
487
506
|
/**
|
|
488
507
|
* Page getOperatorList parameters.
|
|
@@ -609,7 +628,7 @@ export const build: string;
|
|
|
609
628
|
* @property {PDFDataRangeTransport} [range] - Allows for using a custom range
|
|
610
629
|
* transport implementation.
|
|
611
630
|
* @property {number} [rangeChunkSize] - Specify maximum number of bytes fetched
|
|
612
|
-
* per range request. The default value is
|
|
631
|
+
* per range request. The default value is 65536 (= 2^16).
|
|
613
632
|
* @property {PDFWorker} [worker] - The worker that will be used for loading and
|
|
614
633
|
* parsing the PDF data.
|
|
615
634
|
* @property {number} [verbosity] - Controls the logging level; the constants
|
|
@@ -732,14 +751,6 @@ export const build: string;
|
|
|
732
751
|
* @returns {PDFDocumentLoadingTask}
|
|
733
752
|
*/
|
|
734
753
|
export function getDocument(src?: string | URL | TypedArray | ArrayBuffer | DocumentInitParameters): PDFDocumentLoadingTask;
|
|
735
|
-
export const isValidExplicitDest: (dest?: any) => boolean;
|
|
736
|
-
export class LoopbackPort {
|
|
737
|
-
postMessage(obj: any, transfer: any): void;
|
|
738
|
-
addEventListener(name: any, listener: any, options?: null): void;
|
|
739
|
-
removeEventListener(name: any, listener: any): void;
|
|
740
|
-
terminate(): void;
|
|
741
|
-
#private;
|
|
742
|
-
}
|
|
743
754
|
/**
|
|
744
755
|
* Abstract class to support range requests file loading.
|
|
745
756
|
*
|
|
@@ -759,11 +770,6 @@ export class PDFDataRangeTransport {
|
|
|
759
770
|
initialData: Uint8Array<ArrayBufferLike> | null;
|
|
760
771
|
progressiveDone: boolean;
|
|
761
772
|
contentDispositionFilename: string;
|
|
762
|
-
_rangeListeners: any[];
|
|
763
|
-
_progressListeners: any[];
|
|
764
|
-
_progressiveReadListeners: any[];
|
|
765
|
-
_progressiveDoneListeners: any[];
|
|
766
|
-
_readyCapability: any;
|
|
767
773
|
/**
|
|
768
774
|
* @param {function} listener
|
|
769
775
|
*/
|
|
@@ -802,6 +808,7 @@ export class PDFDataRangeTransport {
|
|
|
802
808
|
*/
|
|
803
809
|
requestDataRange(begin: number, end: number): void;
|
|
804
810
|
abort(): void;
|
|
811
|
+
#private;
|
|
805
812
|
}
|
|
806
813
|
/**
|
|
807
814
|
* @typedef {Object} OnProgressParameters
|
|
@@ -814,7 +821,7 @@ export class PDFDataRangeTransport {
|
|
|
814
821
|
* after which individual pages can be rendered.
|
|
815
822
|
*/
|
|
816
823
|
export class PDFDocumentLoadingTask {
|
|
817
|
-
static
|
|
824
|
+
static #docId: number;
|
|
818
825
|
/**
|
|
819
826
|
* @private
|
|
820
827
|
*/
|
|
@@ -972,6 +979,13 @@ export class PDFDocumentProxy {
|
|
|
972
979
|
* for mapping named attachments to their content.
|
|
973
980
|
*/
|
|
974
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>>;
|
|
975
989
|
/**
|
|
976
990
|
* @returns {Promise<Object | null>} A promise that is resolved with
|
|
977
991
|
* an {Object} with the JavaScript actions:
|
|
@@ -1221,10 +1235,16 @@ export class PDFDocumentProxy {
|
|
|
1221
1235
|
* Page render parameters.
|
|
1222
1236
|
*
|
|
1223
1237
|
* @typedef {Object} RenderParameters
|
|
1224
|
-
* @property {
|
|
1225
|
-
*
|
|
1238
|
+
* @property {HTMLCanvasElement|null} canvas - A DOM Canvas object. The default
|
|
1239
|
+
* value is the canvas associated with the `canvasContext` parameter if no
|
|
1240
|
+
* value is provided explicitly.
|
|
1226
1241
|
* @property {PageViewport} viewport - Rendering viewport obtained by calling
|
|
1227
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.
|
|
1228
1248
|
* @property {string} [intent] - Rendering intent, can be 'display', 'print',
|
|
1229
1249
|
* or 'any'. The default value is 'display'.
|
|
1230
1250
|
* @property {number} [annotationMode] Controls which annotations are rendered
|
|
@@ -1262,6 +1282,10 @@ export class PDFDocumentProxy {
|
|
|
1262
1282
|
* annotation ids with canvases used to render them.
|
|
1263
1283
|
* @property {PrintAnnotationStorage} [printAnnotationStorage]
|
|
1264
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.
|
|
1265
1289
|
*/
|
|
1266
1290
|
/**
|
|
1267
1291
|
* Page getOperatorList parameters.
|
|
@@ -1324,6 +1348,7 @@ export class PDFPageProxy {
|
|
|
1324
1348
|
objs: PDFObjects;
|
|
1325
1349
|
_intentStates: Map<any, any>;
|
|
1326
1350
|
destroyed: boolean;
|
|
1351
|
+
recordedGroups: any;
|
|
1327
1352
|
/**
|
|
1328
1353
|
* @type {number} Page number of the page. First page is 1.
|
|
1329
1354
|
*/
|
|
@@ -1384,7 +1409,7 @@ export class PDFPageProxy {
|
|
|
1384
1409
|
* @returns {RenderTask} An object that contains a promise that is
|
|
1385
1410
|
* resolved when the page finishes rendering.
|
|
1386
1411
|
*/
|
|
1387
|
-
render({ canvasContext, 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;
|
|
1388
1413
|
/**
|
|
1389
1414
|
* @param {GetOperatorListParameters} params - Page getOperatorList
|
|
1390
1415
|
* parameters.
|
|
@@ -1467,20 +1492,20 @@ export class PDFPageProxy {
|
|
|
1467
1492
|
* @param {PDFWorkerParameters} params - The worker initialization parameters.
|
|
1468
1493
|
*/
|
|
1469
1494
|
export class PDFWorker {
|
|
1470
|
-
static
|
|
1471
|
-
static
|
|
1472
|
-
static
|
|
1495
|
+
static #fakeWorkerId: number;
|
|
1496
|
+
static #isWorkerDisabled: boolean;
|
|
1497
|
+
static #workerPorts: WeakMap<object, any>;
|
|
1473
1498
|
/**
|
|
1474
1499
|
* @param {PDFWorkerParameters} params - The worker initialization parameters.
|
|
1475
1500
|
* @returns {PDFWorker}
|
|
1476
1501
|
*/
|
|
1477
|
-
static
|
|
1502
|
+
static create(params: PDFWorkerParameters): PDFWorker;
|
|
1478
1503
|
/**
|
|
1479
1504
|
* The current `workerSrc`, when it exists.
|
|
1480
1505
|
* @type {string}
|
|
1481
1506
|
*/
|
|
1482
1507
|
static get workerSrc(): string;
|
|
1483
|
-
static get
|
|
1508
|
+
static get #mainThreadWorkerMessageHandler(): any;
|
|
1484
1509
|
static get _setupFakeWorkerGlobal(): any;
|
|
1485
1510
|
constructor({ name, port, verbosity, }?: {
|
|
1486
1511
|
name?: null | undefined;
|
|
@@ -1490,10 +1515,6 @@ export class PDFWorker {
|
|
|
1490
1515
|
name: any;
|
|
1491
1516
|
destroyed: boolean;
|
|
1492
1517
|
verbosity: number;
|
|
1493
|
-
_readyCapability: any;
|
|
1494
|
-
_port: any;
|
|
1495
|
-
_webWorker: Worker | null;
|
|
1496
|
-
_messageHandler: MessageHandler | null;
|
|
1497
1518
|
/**
|
|
1498
1519
|
* Promise for worker initialization completion.
|
|
1499
1520
|
* @type {Promise<void>}
|
|
@@ -1509,9 +1530,6 @@ export class PDFWorker {
|
|
|
1509
1530
|
* @type {MessageHandler}
|
|
1510
1531
|
*/
|
|
1511
1532
|
get messageHandler(): MessageHandler;
|
|
1512
|
-
_initializeFromPort(port: any): void;
|
|
1513
|
-
_initialize(): void;
|
|
1514
|
-
_setupFakeWorker(): void;
|
|
1515
1533
|
/**
|
|
1516
1534
|
* Destroys the worker instance.
|
|
1517
1535
|
*/
|
|
@@ -1567,45 +1585,5 @@ import { PrintAnnotationStorage } from "./annotation_storage.js";
|
|
|
1567
1585
|
import { AnnotationStorage } from "./annotation_storage.js";
|
|
1568
1586
|
import { Metadata } from "./metadata.js";
|
|
1569
1587
|
import { StatTimer } from "./display_utils.js";
|
|
1570
|
-
|
|
1571
|
-
* A PDF document and page is built of many objects. E.g. there are objects for
|
|
1572
|
-
* fonts, images, rendering code, etc. These objects may get processed inside of
|
|
1573
|
-
* a worker. This class implements some basic methods to manage these objects.
|
|
1574
|
-
*/
|
|
1575
|
-
declare class PDFObjects {
|
|
1576
|
-
/**
|
|
1577
|
-
* If called *without* callback, this returns the data of `objId` but the
|
|
1578
|
-
* object needs to be resolved. If it isn't, this method throws.
|
|
1579
|
-
*
|
|
1580
|
-
* If called *with* a callback, the callback is called with the data of the
|
|
1581
|
-
* object once the object is resolved. That means, if you call this method
|
|
1582
|
-
* and the object is already resolved, the callback gets called right away.
|
|
1583
|
-
*
|
|
1584
|
-
* @param {string} objId
|
|
1585
|
-
* @param {function} [callback]
|
|
1586
|
-
* @returns {any}
|
|
1587
|
-
*/
|
|
1588
|
-
get(objId: string, callback?: Function): any;
|
|
1589
|
-
/**
|
|
1590
|
-
* @param {string} objId
|
|
1591
|
-
* @returns {boolean}
|
|
1592
|
-
*/
|
|
1593
|
-
has(objId: string): boolean;
|
|
1594
|
-
/**
|
|
1595
|
-
* @param {string} objId
|
|
1596
|
-
* @returns {boolean}
|
|
1597
|
-
*/
|
|
1598
|
-
delete(objId: string): boolean;
|
|
1599
|
-
/**
|
|
1600
|
-
* Resolves the object `objId` with optional `data`.
|
|
1601
|
-
*
|
|
1602
|
-
* @param {string} objId
|
|
1603
|
-
* @param {any} [data]
|
|
1604
|
-
*/
|
|
1605
|
-
resolve(objId: string, data?: any): void;
|
|
1606
|
-
clear(): void;
|
|
1607
|
-
[Symbol.iterator](): Generator<any[], void, unknown>;
|
|
1608
|
-
#private;
|
|
1609
|
-
}
|
|
1588
|
+
import { PDFObjects } from "./pdf_objects.js";
|
|
1610
1589
|
import { MessageHandler } from "../shared/message_handler.js";
|
|
1611
|
-
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function getDataProp(val: any): Uint8Array<any>;
|
|
2
|
+
export function getFactoryUrlProp(val: any): string | null;
|
|
3
|
+
export function getUrlProp(val: any): string | null;
|
|
4
|
+
export function isNameProxy(v: any): boolean;
|
|
5
|
+
export function isRefProxy(v: any): boolean;
|
|
6
|
+
export const isValidExplicitDest: (dest?: any) => boolean;
|
|
7
|
+
export class LoopbackPort {
|
|
8
|
+
postMessage(obj: any, transfer: any): void;
|
|
9
|
+
addEventListener(name: any, listener: any, options?: null): void;
|
|
10
|
+
removeEventListener(name: any, listener: any): void;
|
|
11
|
+
terminate(): void;
|
|
12
|
+
#private;
|
|
13
|
+
}
|
|
@@ -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(
|
|
123
|
-
setStrokeTransparent(): void;
|
|
124
|
-
setFillRGBColor(
|
|
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 {};
|