@chialab/pdfjs-lib 1.0.0-alpha.27 → 1.0.0-alpha.29
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/dist/browser/{FoxitDingbats-SB6TO3S5.js → FoxitDingbats-XZTZYAP6.js} +1 -1
- package/dist/browser/{FoxitFixed-UIGSMBQB.js → FoxitFixed-DRWD6QNM.js} +1 -1
- package/dist/browser/{FoxitFixedBold-2PAEIZAT.js → FoxitFixedBold-A3IBPIFC.js} +1 -1
- package/dist/browser/{FoxitFixedBoldItalic-OSQUQDEE.js → FoxitFixedBoldItalic-V4ORMFGL.js} +1 -1
- package/dist/browser/{FoxitFixedItalic-W73RDK22.js → FoxitFixedItalic-Z7BSNTJA.js} +1 -1
- package/dist/browser/{FoxitSerif-3HH3SOZF.js → FoxitSerif-Y34FHWHO.js} +1 -1
- package/dist/browser/{FoxitSerifBold-HXP2QOO7.js → FoxitSerifBold-NCWBT4GX.js} +1 -1
- package/dist/browser/{FoxitSerifBoldItalic-FZXLNWD7.js → FoxitSerifBoldItalic-YTEOG5ZU.js} +1 -1
- package/dist/browser/{FoxitSerifItalic-WQFHUBI2.js → FoxitSerifItalic-3H547RIJ.js} +1 -1
- package/dist/browser/{FoxitSymbol-OVWU7LKS.js → FoxitSymbol-EMTQEYPB.js} +1 -1
- package/dist/browser/{LiberationSans-Bold-GSJN42N5.js → LiberationSans-Bold-MGX34QV4.js} +1 -1
- package/dist/browser/LiberationSans-Bold-PQY5JZAT.js +9 -0
- package/dist/browser/LiberationSans-BoldItalic-PBNZJX4S.js +9 -0
- package/dist/browser/{LiberationSans-BoldItalic-UCPQJ3L2.js → LiberationSans-BoldItalic-WSEQ5LH5.js} +1 -1
- package/dist/browser/{LiberationSans-Italic-6CIHEALY.js → LiberationSans-Italic-E4SLDR4M.js} +1 -1
- package/dist/browser/LiberationSans-Italic-NAYVQTNG.js +9 -0
- package/dist/browser/{LiberationSans-Regular-KIF3IRJY.js → LiberationSans-Regular-3SH5NGZO.js} +1 -1
- package/dist/browser/LiberationSans-Regular-FMNBW2LE.js +9 -0
- package/dist/browser/{NodeUtilsStabs-MUAXKISB.js → NodeUtilsStabs-AQQCOPNR.js} +1 -1
- package/dist/browser/{chunk-O4UKW7AD.js → chunk-7YYVRRNF.js} +5 -0
- package/dist/browser/{chunk-YWSFNHP3.js → chunk-W35PJZ6L.js} +1 -1
- package/dist/browser/index.js +13323 -526
- package/dist/browser/{openjpeg-K2XBCFFN.js → openjpeg-QLA762TL.js} +1 -1
- package/dist/browser/{qcms_bg-Q7BRLLZG.js → qcms_bg-BCJEADMU.js} +1 -1
- package/dist/browser/worker.js +114 -5
- package/dist/index.d.ts +9 -2
- package/dist/lib/Canvas.d.ts +0 -5
- package/dist/lib/StructTreePage.d.ts +5 -0
- package/dist/lib/TextLayer.d.ts +32 -5
- package/dist/lib/TextLayer_v2.d.ts +8 -0
- package/dist/node/{FoxitDingbats-65AZ2Z2V.js → FoxitDingbats-UZC34T4F.js} +1 -1
- package/dist/node/{FoxitFixed-OZGLVVOQ.js → FoxitFixed-DSJVG3IJ.js} +1 -1
- package/dist/node/{FoxitFixedBold-37OOYMV7.js → FoxitFixedBold-YSX4X5NA.js} +1 -1
- package/dist/node/{FoxitFixedBoldItalic-XYFHEG2V.js → FoxitFixedBoldItalic-IFYYA6RR.js} +1 -1
- package/dist/node/{FoxitFixedItalic-MM7OSGS6.js → FoxitFixedItalic-4PEFPCQV.js} +1 -1
- package/dist/node/{FoxitSerif-MLMJQPRP.js → FoxitSerif-7SSP2H2U.js} +1 -1
- package/dist/node/{FoxitSerifBold-AC7RJQWJ.js → FoxitSerifBold-KLMURJ6N.js} +1 -1
- package/dist/node/{FoxitSerifBoldItalic-YCQ4CLKE.js → FoxitSerifBoldItalic-VSYHWLRM.js} +1 -1
- package/dist/node/{FoxitSerifItalic-CXVTCST4.js → FoxitSerifItalic-NTOPMQDD.js} +1 -1
- package/dist/node/{FoxitSymbol-VUGMZN5C.js → FoxitSymbol-QPUM74UN.js} +1 -1
- package/dist/node/{LiberationSans-Bold-XSHQQBWB.js → LiberationSans-Bold-BXFYN4PV.js} +1 -1
- package/dist/node/LiberationSans-Bold-VIZ4XT4N.js +9 -0
- package/dist/node/{LiberationSans-BoldItalic-CTAZRFRL.js → LiberationSans-BoldItalic-DQQC5TNJ.js} +1 -1
- package/dist/node/LiberationSans-BoldItalic-WXMOSICD.js +9 -0
- package/dist/node/LiberationSans-Italic-34IBVQZ4.js +9 -0
- package/dist/node/{LiberationSans-Italic-WIOTUKLC.js → LiberationSans-Italic-Z4MFN6PY.js} +1 -1
- package/dist/node/LiberationSans-Regular-JOSGNSW5.js +9 -0
- package/dist/node/{LiberationSans-Regular-CDMMZL5S.js → LiberationSans-Regular-MACKS2VL.js} +1 -1
- package/dist/node/{NodeUtils-ZGLDDB6J.js → NodeUtils-ZPPZPJWD.js} +3 -3
- package/dist/node/{chunk-GVC6TP3T.js → chunk-D4U3W2CD.js} +2 -2
- package/dist/node/{chunk-YDSKBMQ3.js → chunk-FHASHZBJ.js} +1 -1
- package/dist/node/{chunk-AC5JE2E3.js → chunk-GWGW2EKY.js} +2 -2
- package/dist/node/chunk-ZFIGV5OT.js +63 -0
- package/dist/node/index.js +13756 -930
- package/dist/node/{openjpeg-B2WN24QZ.js → openjpeg-TRZ4ANDN.js} +1 -1
- package/dist/node/{qcms_bg-T4RSHPOQ.js → qcms_bg-PRPVJQFC.js} +1 -1
- package/dist/node/worker.js +115 -6
- package/dist/pdf.js/external/openjpeg/openjpeg.d.ts +2 -0
- package/dist/pdf.js/external/qcms/qcms.d.ts +92 -0
- package/dist/pdf.js/external/qcms/qcms_utils.d.ts +14 -0
- package/dist/pdf.js/src/core/arithmetic_decoder.d.ts +21 -0
- package/dist/pdf.js/src/core/ascii_85_stream.d.ts +8 -0
- package/dist/pdf.js/src/core/ascii_hex_stream.d.ts +8 -0
- package/dist/pdf.js/src/core/base_stream.d.ts +32 -0
- package/dist/pdf.js/src/core/binary_cmap.d.ts +3 -0
- package/dist/pdf.js/src/core/ccitt.d.ts +72 -0
- package/dist/pdf.js/src/core/ccitt_stream.d.ts +9 -0
- package/dist/pdf.js/src/core/cff_font.d.ts +15 -0
- package/dist/pdf.js/src/core/cff_parser.d.ts +166 -0
- package/dist/pdf.js/src/core/charsets.d.ts +3 -0
- package/dist/pdf.js/src/core/cmap.d.ts +37 -0
- package/dist/pdf.js/src/core/colorspace.d.ts +177 -0
- package/dist/pdf.js/src/core/colorspace_utils.d.ts +21 -0
- package/dist/pdf.js/src/core/core_utils.d.ts +140 -0
- package/dist/pdf.js/src/core/decode_stream.d.ts +25 -0
- package/dist/pdf.js/src/core/encodings.d.ts +7 -0
- package/dist/pdf.js/src/core/flate_stream.d.ts +15 -0
- package/dist/pdf.js/src/core/font_renderer.d.ts +34 -0
- package/dist/pdf.js/src/core/fonts.d.ts +92 -0
- package/dist/pdf.js/src/core/fonts_utils.d.ts +32 -0
- package/dist/pdf.js/src/core/glyf.d.ts +44 -0
- package/dist/pdf.js/src/core/glyphlist.d.ts +2 -0
- package/dist/pdf.js/src/core/icc_colorspace.d.ts +22 -0
- package/dist/pdf.js/src/core/jbig2.d.ts +12 -0
- package/dist/pdf.js/src/core/jbig2_stream.d.ts +17 -0
- package/dist/pdf.js/src/core/jpeg_stream.d.ts +25 -0
- package/dist/pdf.js/src/core/jpg.d.ts +62 -0
- package/dist/pdf.js/src/core/jpx.d.ts +35 -0
- package/dist/pdf.js/src/core/jpx_stream.d.ts +17 -0
- package/dist/pdf.js/src/core/lzw_stream.d.ts +21 -0
- package/dist/pdf.js/src/core/metrics.d.ts +2 -0
- package/dist/pdf.js/src/core/name_number_tree.d.ts +21 -0
- package/dist/pdf.js/src/core/opentype_file_builder.d.ts +12 -0
- package/dist/pdf.js/src/core/parser.d.ts +81 -0
- package/dist/pdf.js/src/core/predictor_stream.d.ts +15 -0
- package/dist/pdf.js/src/core/primitives.d.ts +78 -0
- package/dist/pdf.js/src/core/run_length_stream.d.ts +7 -0
- package/dist/pdf.js/src/core/standard_fonts.d.ts +18 -0
- package/dist/pdf.js/src/core/stream.d.ts +21 -0
- package/dist/pdf.js/src/core/struct_tree.d.ts +92 -0
- package/dist/pdf.js/src/core/to_unicode_map.d.ts +21 -0
- package/dist/pdf.js/src/core/type1_font.d.ts +17 -0
- package/dist/pdf.js/src/core/type1_parser.d.ts +29 -0
- package/dist/pdf.js/src/core/unicode.d.ts +5 -0
- package/dist/pdf.js/src/display/api.d.ts +5 -5
- package/dist/pdf.js/src/display/display_utils.d.ts +1 -1
- package/dist/pdf.js/src/display/draw_layer.d.ts +2 -2
- package/dist/pdf.js/src/display/editor/alt_text.d.ts +1 -1
- package/dist/pdf.js/src/display/editor/annotation_editor_layer.d.ts +1 -1
- package/dist/pdf.js/src/display/editor/color_picker.d.ts +2 -2
- package/dist/pdf.js/src/display/editor/draw.d.ts +7 -7
- package/dist/pdf.js/src/display/editor/drawers/freedraw.d.ts +3 -3
- package/dist/pdf.js/src/display/editor/drawers/signaturedraw.d.ts +13 -13
- package/dist/pdf.js/src/display/editor/editor.d.ts +1 -1
- package/dist/pdf.js/src/display/editor/freetext.d.ts +2 -2
- package/dist/pdf.js/src/display/editor/highlight.d.ts +3 -3
- package/dist/pdf.js/src/display/editor/toolbar.d.ts +2 -2
- package/dist/pdf.js/src/display/text_layer.d.ts +9 -9
- package/dist/pdf.js/src/display/worker_options.d.ts +2 -2
- package/dist/pdf.js/src/shared/util.d.ts +2 -2
- package/dist/pdf.js/web/text_accessibility.d.ts +1 -1
- package/package.json +10 -1
- package/dist/node/chunk-7MW5RQZ5.js +0 -30
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export const CIRCULAR_REF: unique symbol;
|
|
2
|
+
export function clearPrimitiveCaches(): void;
|
|
3
|
+
export class Cmd {
|
|
4
|
+
static get(cmd: any): any;
|
|
5
|
+
constructor(cmd: any);
|
|
6
|
+
cmd: any;
|
|
7
|
+
}
|
|
8
|
+
export class Dict {
|
|
9
|
+
static get empty(): any;
|
|
10
|
+
static merge({ xref, dictArray, mergeSubDicts }: {
|
|
11
|
+
xref: any;
|
|
12
|
+
dictArray: any;
|
|
13
|
+
mergeSubDicts?: boolean | undefined;
|
|
14
|
+
}): any;
|
|
15
|
+
constructor(xref?: null);
|
|
16
|
+
_map: Map<any, any>;
|
|
17
|
+
xref: any;
|
|
18
|
+
objId: any;
|
|
19
|
+
suppressEncryption: boolean;
|
|
20
|
+
__nonSerializable__: () => /*elided*/ any;
|
|
21
|
+
assignXref(newXref: any): void;
|
|
22
|
+
get size(): number;
|
|
23
|
+
get(key1: any, key2: any, key3: any): any;
|
|
24
|
+
getAsync(key1: any, key2: any, key3: any): Promise<any>;
|
|
25
|
+
getArray(key1: any, key2: any, key3: any): any;
|
|
26
|
+
getRaw(key: any): any;
|
|
27
|
+
getKeys(): any[];
|
|
28
|
+
getRawValues(): any[];
|
|
29
|
+
set(key: any, value: any): void;
|
|
30
|
+
setIfNotExists(key: any, value: any): void;
|
|
31
|
+
setIfNumber(key: any, value: any): void;
|
|
32
|
+
setIfArray(key: any, value: any): void;
|
|
33
|
+
setIfDefined(key: any, value: any): void;
|
|
34
|
+
setIfName(key: any, value: any): void;
|
|
35
|
+
has(key: any): boolean;
|
|
36
|
+
clone(): Dict;
|
|
37
|
+
delete(key: any): void;
|
|
38
|
+
[Symbol.iterator](): Generator<any[], void, unknown>;
|
|
39
|
+
}
|
|
40
|
+
export const EOF: unique symbol;
|
|
41
|
+
export function isCmd(v: any, cmd: any): boolean;
|
|
42
|
+
export function isDict(v: any, type: any): boolean;
|
|
43
|
+
export function isName(v: any, name: any): boolean;
|
|
44
|
+
export function isRefsEqual(v1: any, v2: any): boolean;
|
|
45
|
+
export class Name {
|
|
46
|
+
static get(name: any): any;
|
|
47
|
+
constructor(name: any);
|
|
48
|
+
name: any;
|
|
49
|
+
}
|
|
50
|
+
export class Ref {
|
|
51
|
+
static fromString(str: any): any;
|
|
52
|
+
static get(num: any, gen: any): any;
|
|
53
|
+
constructor(num: any, gen: any);
|
|
54
|
+
num: any;
|
|
55
|
+
gen: any;
|
|
56
|
+
toString(): string;
|
|
57
|
+
}
|
|
58
|
+
export class RefSet {
|
|
59
|
+
constructor(parent?: null);
|
|
60
|
+
_set: Set<any>;
|
|
61
|
+
has(ref: any): boolean;
|
|
62
|
+
put(ref: any): void;
|
|
63
|
+
remove(ref: any): void;
|
|
64
|
+
clear(): void;
|
|
65
|
+
[Symbol.iterator](): SetIterator<any>;
|
|
66
|
+
}
|
|
67
|
+
export class RefSetCache {
|
|
68
|
+
_map: Map<any, any>;
|
|
69
|
+
get size(): number;
|
|
70
|
+
get(ref: any): any;
|
|
71
|
+
has(ref: any): boolean;
|
|
72
|
+
put(ref: any, obj: any): void;
|
|
73
|
+
putAlias(ref: any, aliasRef: any): void;
|
|
74
|
+
clear(): void;
|
|
75
|
+
values(): Generator<any, void, unknown>;
|
|
76
|
+
items(): Generator<any[], void, unknown>;
|
|
77
|
+
[Symbol.iterator](): MapIterator<any>;
|
|
78
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const getFontNameToFileMap: () => any;
|
|
2
|
+
export const getGlyphMapForStandardFonts: () => any;
|
|
3
|
+
/**
|
|
4
|
+
* Holds the map of the non-standard fonts that might be included as
|
|
5
|
+
* a standard fonts without glyph data.
|
|
6
|
+
*/
|
|
7
|
+
export const getNonStdFontMap: () => any;
|
|
8
|
+
export const getSerifFonts: () => any;
|
|
9
|
+
export function getStandardFontName(name: any): any;
|
|
10
|
+
/**
|
|
11
|
+
* Hold a map of decoded fonts and of the standard fourteen Type1
|
|
12
|
+
* fonts and their acronyms.
|
|
13
|
+
*/
|
|
14
|
+
export const getStdFontMap: () => any;
|
|
15
|
+
export const getSupplementalGlyphMapForArialBlack: () => any;
|
|
16
|
+
export const getSupplementalGlyphMapForCalibri: () => any;
|
|
17
|
+
export const getSymbolsFonts: () => any;
|
|
18
|
+
export function isKnownFontName(name: any): boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export class NullStream extends Stream {
|
|
2
|
+
constructor();
|
|
3
|
+
}
|
|
4
|
+
export class Stream extends BaseStream {
|
|
5
|
+
constructor(arrayBuffer: any, start: any, length: any, dict: any);
|
|
6
|
+
bytes: Uint8Array<any>;
|
|
7
|
+
start: any;
|
|
8
|
+
pos: any;
|
|
9
|
+
end: any;
|
|
10
|
+
dict: any;
|
|
11
|
+
get length(): number;
|
|
12
|
+
get isEmpty(): boolean;
|
|
13
|
+
getByte(): number;
|
|
14
|
+
getBytes(length: any): Uint8Array<any>;
|
|
15
|
+
getByteRange(begin: any, end: any): Uint8Array<any>;
|
|
16
|
+
makeSubStream(start: any, length: any, dict?: null): Stream;
|
|
17
|
+
}
|
|
18
|
+
export class StringStream extends Stream {
|
|
19
|
+
constructor(str: any);
|
|
20
|
+
}
|
|
21
|
+
import { BaseStream } from "./base_stream.js";
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export class StructTreePage {
|
|
2
|
+
constructor(structTreeRoot: any, pageDict: any);
|
|
3
|
+
root: any;
|
|
4
|
+
xref: any;
|
|
5
|
+
rootDict: any;
|
|
6
|
+
pageDict: any;
|
|
7
|
+
nodes: any[];
|
|
8
|
+
/**
|
|
9
|
+
* Collect all the objects (i.e. tag) that are part of the page and return a
|
|
10
|
+
* map of the structure element id to the object reference.
|
|
11
|
+
* @param {Ref} pageRef
|
|
12
|
+
* @returns {Map<number, Ref>}
|
|
13
|
+
*/
|
|
14
|
+
collectObjects(pageRef: Ref): Map<number, Ref>;
|
|
15
|
+
parse(pageRef: any): void;
|
|
16
|
+
addNode(dict: any, map: any, level?: number): any;
|
|
17
|
+
addTopLevelNode(dict: any, element: any): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Convert the tree structure into a simplified object literal that can
|
|
20
|
+
* be sent to the main thread.
|
|
21
|
+
* @returns {Object}
|
|
22
|
+
*/
|
|
23
|
+
get serializable(): Object;
|
|
24
|
+
}
|
|
25
|
+
export class StructTreeRoot {
|
|
26
|
+
static canCreateStructureTree({ catalogRef, pdfManager, newAnnotationsByPage, }: {
|
|
27
|
+
catalogRef: any;
|
|
28
|
+
pdfManager: any;
|
|
29
|
+
newAnnotationsByPage: any;
|
|
30
|
+
}): Promise<boolean>;
|
|
31
|
+
static createStructureTree({ newAnnotationsByPage, xref, catalogRef, pdfManager, changes, }: {
|
|
32
|
+
newAnnotationsByPage: any;
|
|
33
|
+
xref: any;
|
|
34
|
+
catalogRef: any;
|
|
35
|
+
pdfManager: any;
|
|
36
|
+
changes: any;
|
|
37
|
+
}): Promise<void>;
|
|
38
|
+
static "__#private@#writeKids"({ newAnnotationsByPage, structTreeRootRef, structTreeRoot, kids, nums, xref, pdfManager, changes, cache, }: {
|
|
39
|
+
newAnnotationsByPage: any;
|
|
40
|
+
structTreeRootRef: any;
|
|
41
|
+
structTreeRoot: any;
|
|
42
|
+
kids: any;
|
|
43
|
+
nums: any;
|
|
44
|
+
xref: any;
|
|
45
|
+
pdfManager: any;
|
|
46
|
+
changes: any;
|
|
47
|
+
cache: any;
|
|
48
|
+
}): Promise<number>;
|
|
49
|
+
static "__#private@#writeProperties"(tagDict: any, { type, title, lang, alt, expanded, actualText }: {
|
|
50
|
+
type: any;
|
|
51
|
+
title: any;
|
|
52
|
+
lang: any;
|
|
53
|
+
alt: any;
|
|
54
|
+
expanded: any;
|
|
55
|
+
actualText: any;
|
|
56
|
+
}): void;
|
|
57
|
+
static "__#private@#collectParents"({ elements, xref, pageDict, numberTree }: {
|
|
58
|
+
elements: any;
|
|
59
|
+
xref: any;
|
|
60
|
+
pageDict: any;
|
|
61
|
+
numberTree: any;
|
|
62
|
+
}): void;
|
|
63
|
+
static "__#private@#updateParentTag"({ structTreeParent, tagDict, newTagRef, structTreeRootRef, fallbackKids, xref, cache, }: {
|
|
64
|
+
structTreeParent: any;
|
|
65
|
+
tagDict: any;
|
|
66
|
+
newTagRef: any;
|
|
67
|
+
structTreeRootRef: any;
|
|
68
|
+
fallbackKids: any;
|
|
69
|
+
xref: any;
|
|
70
|
+
cache: any;
|
|
71
|
+
}): Promise<void>;
|
|
72
|
+
constructor(xref: any, rootDict: any, rootRef: any);
|
|
73
|
+
xref: any;
|
|
74
|
+
dict: any;
|
|
75
|
+
ref: Ref | null;
|
|
76
|
+
roleMap: Map<any, any>;
|
|
77
|
+
structParentIds: any;
|
|
78
|
+
init(): void;
|
|
79
|
+
addAnnotationIdToPage(pageRef: any, id: any): void;
|
|
80
|
+
readRoleMap(): void;
|
|
81
|
+
canUpdateStructTree({ pdfManager, newAnnotationsByPage }: {
|
|
82
|
+
pdfManager: any;
|
|
83
|
+
newAnnotationsByPage: any;
|
|
84
|
+
}): Promise<boolean>;
|
|
85
|
+
updateStructureTree({ newAnnotationsByPage, pdfManager, changes }: {
|
|
86
|
+
newAnnotationsByPage: any;
|
|
87
|
+
pdfManager: any;
|
|
88
|
+
changes: any;
|
|
89
|
+
}): Promise<void>;
|
|
90
|
+
#private;
|
|
91
|
+
}
|
|
92
|
+
import { Ref } from "./primitives.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export class IdentityToUnicodeMap {
|
|
2
|
+
constructor(firstChar: any, lastChar: any);
|
|
3
|
+
firstChar: any;
|
|
4
|
+
lastChar: any;
|
|
5
|
+
get length(): number;
|
|
6
|
+
forEach(callback: any): void;
|
|
7
|
+
has(i: any): boolean;
|
|
8
|
+
get(i: any): string | undefined;
|
|
9
|
+
charCodeOf(v: any): any;
|
|
10
|
+
amend(map: any): void;
|
|
11
|
+
}
|
|
12
|
+
export class ToUnicodeMap {
|
|
13
|
+
constructor(cmap?: any[]);
|
|
14
|
+
_map: any[];
|
|
15
|
+
get length(): number;
|
|
16
|
+
forEach(callback: any): void;
|
|
17
|
+
has(i: any): boolean;
|
|
18
|
+
get(i: any): any;
|
|
19
|
+
charCodeOf(value: any): number;
|
|
20
|
+
amend(map: any): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type1Font is also a CIDFontType0.
|
|
3
|
+
*/
|
|
4
|
+
export class Type1Font {
|
|
5
|
+
constructor(name: any, file: any, properties: any);
|
|
6
|
+
charstrings: any[];
|
|
7
|
+
data: never[];
|
|
8
|
+
seacs: any[];
|
|
9
|
+
get numGlyphs(): number;
|
|
10
|
+
getCharset(): string[];
|
|
11
|
+
getGlyphMapping(properties: any): any;
|
|
12
|
+
hasGlyphId(id: any): boolean;
|
|
13
|
+
getSeacs(charstrings: any): any[];
|
|
14
|
+
getType2Charstrings(type1Charstrings: any): any[];
|
|
15
|
+
getType2Subrs(type1Subrs: any): any[];
|
|
16
|
+
wrap(name: any, glyphs: any, charstrings: any, subrs: any, properties: any): never[];
|
|
17
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type1Parser encapsulate the needed code for parsing a Type1 font program.
|
|
3
|
+
* Some of its logic depends on the Type2 charstrings structure.
|
|
4
|
+
* NOTE: This doesn't really parse the font since that would require evaluation
|
|
5
|
+
* of PostScript, but it is possible in most cases to extract what we need
|
|
6
|
+
* without a full parse.
|
|
7
|
+
*/
|
|
8
|
+
export class Type1Parser {
|
|
9
|
+
constructor(stream: any, encrypted: any, seacAnalysisEnabled: any);
|
|
10
|
+
seacAnalysisEnabled: boolean;
|
|
11
|
+
stream: any;
|
|
12
|
+
readNumberArray(): number[];
|
|
13
|
+
readNumber(): number;
|
|
14
|
+
readInt(): number;
|
|
15
|
+
readBoolean(): 0 | 1;
|
|
16
|
+
nextChar(): any;
|
|
17
|
+
currentChar: any;
|
|
18
|
+
prevChar(): any;
|
|
19
|
+
getToken(): string | null;
|
|
20
|
+
readCharStrings(bytes: any, lenIV: any): any;
|
|
21
|
+
extractFontProgram(properties: any): {
|
|
22
|
+
subrs: never[];
|
|
23
|
+
charstrings: never[];
|
|
24
|
+
properties: {
|
|
25
|
+
privateData: any;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
extractFontHeader(properties: any): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export function clearUnicodeCaches(): void;
|
|
2
|
+
export function getCharUnicodeCategory(char: any): any;
|
|
3
|
+
export function getUnicodeForGlyph(name: any, glyphsUnicodeMap: any): any;
|
|
4
|
+
export function getUnicodeRangeFor(value: any, lastPosition?: number): number;
|
|
5
|
+
export function mapSpecialUnicodeValues(code: any): any;
|
|
@@ -821,7 +821,7 @@ export class PDFDataRangeTransport {
|
|
|
821
821
|
* after which individual pages can be rendered.
|
|
822
822
|
*/
|
|
823
823
|
export class PDFDocumentLoadingTask {
|
|
824
|
-
static #docId: number;
|
|
824
|
+
static "__#private@#docId": number;
|
|
825
825
|
/**
|
|
826
826
|
* @private
|
|
827
827
|
*/
|
|
@@ -1492,9 +1492,9 @@ export class PDFPageProxy {
|
|
|
1492
1492
|
* @param {PDFWorkerParameters} params - The worker initialization parameters.
|
|
1493
1493
|
*/
|
|
1494
1494
|
export class PDFWorker {
|
|
1495
|
-
static #fakeWorkerId: number;
|
|
1496
|
-
static #isWorkerDisabled: boolean;
|
|
1497
|
-
static #workerPorts: WeakMap<WeakKey, any>;
|
|
1495
|
+
static "__#private@#fakeWorkerId": number;
|
|
1496
|
+
static "__#private@#isWorkerDisabled": boolean;
|
|
1497
|
+
static "__#private@#workerPorts": WeakMap<WeakKey, any>;
|
|
1498
1498
|
/**
|
|
1499
1499
|
* @param {PDFWorkerParameters} params - The worker initialization parameters.
|
|
1500
1500
|
* @returns {PDFWorker}
|
|
@@ -1505,7 +1505,7 @@ export class PDFWorker {
|
|
|
1505
1505
|
* @type {string}
|
|
1506
1506
|
*/
|
|
1507
1507
|
static get workerSrc(): string;
|
|
1508
|
-
static get #mainThreadWorkerMessageHandler(): any;
|
|
1508
|
+
static get "__#private@#mainThreadWorkerMessageHandler"(): any;
|
|
1509
1509
|
static get _setupFakeWorkerGlobal(): any;
|
|
1510
1510
|
constructor({ name, port, verbosity, }?: {
|
|
1511
1511
|
name?: null | undefined;
|
|
@@ -208,7 +208,7 @@ export class PageViewport {
|
|
|
208
208
|
convertToPdfPoint(x: number, y: number): any[];
|
|
209
209
|
}
|
|
210
210
|
export class PDFDateString {
|
|
211
|
-
static #regex: any;
|
|
211
|
+
static "__#private@#regex": any;
|
|
212
212
|
/**
|
|
213
213
|
* Convert a PDF date string to a JavaScript `Date` object.
|
|
214
214
|
*
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* be able to use mix-blend-mode for some of them.
|
|
5
5
|
*/
|
|
6
6
|
export class DrawLayer {
|
|
7
|
-
static #id: number;
|
|
7
|
+
static "__#private@#id": number;
|
|
8
8
|
static get _svgFactory(): any;
|
|
9
|
-
static #setBox(element: any, [x, y, width, height]: [any, any, any, any]): void;
|
|
9
|
+
static "__#private@#setBox"(element: any, [x, y, width, height]: [any, any, any, any]): void;
|
|
10
10
|
constructor({ pageIndex }: {
|
|
11
11
|
pageIndex: any;
|
|
12
12
|
});
|
|
@@ -46,7 +46,7 @@ export type RenderEditorLayerOptions = {
|
|
|
46
46
|
*/
|
|
47
47
|
export class AnnotationEditorLayer {
|
|
48
48
|
static _initialized: boolean;
|
|
49
|
-
static #editorTypes: Map<number, typeof FreeTextEditor | typeof HighlightEditor | typeof InkEditor | typeof SignatureEditor | typeof StampEditor>;
|
|
49
|
+
static "__#private@#editorTypes": Map<number, typeof FreeTextEditor | typeof HighlightEditor | typeof InkEditor | typeof SignatureEditor | typeof StampEditor>;
|
|
50
50
|
/**
|
|
51
51
|
* @param {AnnotationEditorLayerOptions} options
|
|
52
52
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* to select a color for the annotation.
|
|
5
5
|
*/
|
|
6
6
|
export class BasicColorPicker {
|
|
7
|
-
static #l10nColor: null;
|
|
7
|
+
static "__#private@#l10nColor": null;
|
|
8
8
|
constructor(editor: any);
|
|
9
9
|
renderButton(): HTMLInputElement;
|
|
10
10
|
update(value: any): void;
|
|
@@ -18,7 +18,7 @@ export class BasicColorPicker {
|
|
|
18
18
|
* to select a color for the annotation.
|
|
19
19
|
*/
|
|
20
20
|
export class ColorPicker {
|
|
21
|
-
static #l10nColor: null;
|
|
21
|
+
static "__#private@#l10nColor": null;
|
|
22
22
|
static get _keyboardManager(): any;
|
|
23
23
|
constructor({ editor, uiManager }: {
|
|
24
24
|
editor?: null | undefined;
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
export class DrawingEditor extends AnnotationEditor {
|
|
5
5
|
static _currentDrawId: number;
|
|
6
6
|
static _currentParent: null;
|
|
7
|
-
static #currentDraw: null;
|
|
8
|
-
static #currentDrawingAC: null;
|
|
9
|
-
static #currentDrawingOptions: null;
|
|
10
|
-
static #currentPointerId: number;
|
|
11
|
-
static #currentPointerType: null;
|
|
12
|
-
static #currentPointerIds: null;
|
|
13
|
-
static #currentMoveTimestamp: number;
|
|
7
|
+
static "__#private@#currentDraw": null;
|
|
8
|
+
static "__#private@#currentDrawingAC": null;
|
|
9
|
+
static "__#private@#currentDrawingOptions": null;
|
|
10
|
+
static "__#private@#currentPointerId": number;
|
|
11
|
+
static "__#private@#currentPointerType": null;
|
|
12
|
+
static "__#private@#currentPointerIds": null;
|
|
13
|
+
static "__#private@#currentMoveTimestamp": number;
|
|
14
14
|
static _INNER_MARGIN: number;
|
|
15
15
|
static _mergeSVGProperties(p1: any, p2: any): any;
|
|
16
16
|
/**
|
|
@@ -11,9 +11,9 @@ export class FreeDrawOutline extends Outline {
|
|
|
11
11
|
#private;
|
|
12
12
|
}
|
|
13
13
|
export class FreeDrawOutliner {
|
|
14
|
-
static #MIN_DIST: number;
|
|
15
|
-
static #MIN_DIFF: number;
|
|
16
|
-
static #MIN: number;
|
|
14
|
+
static "__#private@#MIN_DIST": number;
|
|
15
|
+
static "__#private@#MIN_DIFF": number;
|
|
16
|
+
static "__#private@#MIN": number;
|
|
17
17
|
constructor({ x, y }: {
|
|
18
18
|
x: any;
|
|
19
19
|
y: any;
|
|
@@ -2,29 +2,29 @@
|
|
|
2
2
|
* Basic text editor in order to create a Signature annotation.
|
|
3
3
|
*/
|
|
4
4
|
export class SignatureExtractor {
|
|
5
|
-
static #PARAMETERS: {
|
|
5
|
+
static "__#private@#PARAMETERS": {
|
|
6
6
|
maxDim: number;
|
|
7
7
|
sigmaSFactor: number;
|
|
8
8
|
sigmaR: number;
|
|
9
9
|
kernelSize: number;
|
|
10
10
|
};
|
|
11
|
-
static #neighborIndexToId(i0: any, j0: any, i: any, j: any): any;
|
|
12
|
-
static #neighborIdToIndex: Int32Array<ArrayBuffer>;
|
|
13
|
-
static #clockwiseNonZero(buf: any, width: any, i0: any, j0: any, i: any, j: any, offset: any): number;
|
|
14
|
-
static #counterClockwiseNonZero(buf: any, width: any, i0: any, j0: any, i: any, j: any, offset: any): number;
|
|
15
|
-
static #findContours(buf: any, width: any, height: any, threshold: any): {
|
|
11
|
+
static "__#private@#neighborIndexToId"(i0: any, j0: any, i: any, j: any): any;
|
|
12
|
+
static "__#private@#neighborIdToIndex": Int32Array<ArrayBuffer>;
|
|
13
|
+
static "__#private@#clockwiseNonZero"(buf: any, width: any, i0: any, j0: any, i: any, j: any, offset: any): number;
|
|
14
|
+
static "__#private@#counterClockwiseNonZero"(buf: any, width: any, i0: any, j0: any, i: any, j: any, offset: any): number;
|
|
15
|
+
static "__#private@#findContours"(buf: any, width: any, height: any, threshold: any): {
|
|
16
16
|
isHole: boolean;
|
|
17
17
|
points: number[];
|
|
18
18
|
id: number;
|
|
19
19
|
parent: number;
|
|
20
20
|
}[];
|
|
21
|
-
static #douglasPeuckerHelper(points: any, start: any, end: any, output: any): void;
|
|
22
|
-
static #douglasPeucker(points: any): any[] | null;
|
|
23
|
-
static #bilateralFilter(buf: any, width: any, height: any, sigmaS: any, sigmaR: any, kernelSize: any): (Uint32Array<ArrayBuffer> | Uint8Array<any>)[];
|
|
24
|
-
static #getHistogram(buf: any): Uint32Array<ArrayBuffer>;
|
|
25
|
-
static #toUint8(buf: any): Uint8ClampedArray<ArrayBuffer>;
|
|
26
|
-
static #guessThreshold(histogram: any): number;
|
|
27
|
-
static #getGrayPixels(bitmap: any): any[];
|
|
21
|
+
static "__#private@#douglasPeuckerHelper"(points: any, start: any, end: any, output: any): void;
|
|
22
|
+
static "__#private@#douglasPeucker"(points: any): any[] | null;
|
|
23
|
+
static "__#private@#bilateralFilter"(buf: any, width: any, height: any, sigmaS: any, sigmaR: any, kernelSize: any): (Uint32Array<ArrayBuffer> | Uint8Array<any>)[];
|
|
24
|
+
static "__#private@#getHistogram"(buf: any): Uint32Array<ArrayBuffer>;
|
|
25
|
+
static "__#private@#toUint8"(buf: any): Uint8ClampedArray<ArrayBuffer>;
|
|
26
|
+
static "__#private@#guessThreshold"(histogram: any): number;
|
|
27
|
+
static "__#private@#getGrayPixels"(bitmap: any): any[];
|
|
28
28
|
static extractContoursFromText(text: any, { fontFamily, fontStyle, fontWeight }: {
|
|
29
29
|
fontFamily: any;
|
|
30
30
|
fontStyle: any;
|
|
@@ -73,7 +73,7 @@ export class AnnotationEditor {
|
|
|
73
73
|
* @param {AnnotationEditorLayer} parent
|
|
74
74
|
*/
|
|
75
75
|
static paste(item: DataTransferItem, parent: AnnotationEditorLayer): void;
|
|
76
|
-
static #rotatePoint(x: any, y: any, angle: any): any[];
|
|
76
|
+
static "__#private@#rotatePoint"(x: any, y: any, angle: any): any[];
|
|
77
77
|
static _round(x: any): number;
|
|
78
78
|
/**
|
|
79
79
|
* Deserialize the editor.
|
|
@@ -16,8 +16,8 @@ export class FreeTextEditor extends AnnotationEditor {
|
|
|
16
16
|
static updateDefaultParams(type: any, value: any): void;
|
|
17
17
|
/** @inheritdoc */
|
|
18
18
|
static get defaultPropertiesToUpdate(): any[][];
|
|
19
|
-
static #getNodeContent(node: any): any;
|
|
20
|
-
static #deserializeContent(content: any): any;
|
|
19
|
+
static "__#private@#getNodeContent"(node: any): any;
|
|
20
|
+
static "__#private@#deserializeContent"(content: any): any;
|
|
21
21
|
/** @inheritdoc */
|
|
22
22
|
static deserialize(data: any, parent: any, uiManager: any): Promise<AnnotationEditor | null>;
|
|
23
23
|
constructor(params: any);
|
|
@@ -19,14 +19,14 @@ export class HighlightEditor extends AnnotationEditor {
|
|
|
19
19
|
/** @inheritdoc */
|
|
20
20
|
static updateDefaultParams(type: any, value: any): void;
|
|
21
21
|
static get defaultPropertiesToUpdate(): (number | null)[][];
|
|
22
|
-
static #rotateBbox([x, y, width, height]: [any, any, any, any], angle: any): any[];
|
|
22
|
+
static "__#private@#rotateBbox"([x, y, width, height]: [any, any, any, any], angle: any): any[];
|
|
23
23
|
static startHighlighting(parent: any, isLTR: any, { target: textLayer, x, y }: {
|
|
24
24
|
target: any;
|
|
25
25
|
x: any;
|
|
26
26
|
y: any;
|
|
27
27
|
}): void;
|
|
28
|
-
static #highlightMove(parent: any, event: any): void;
|
|
29
|
-
static #endHighlight(parent: any, event: any): void;
|
|
28
|
+
static "__#private@#highlightMove"(parent: any, event: any): void;
|
|
29
|
+
static "__#private@#endHighlight"(parent: any, event: any): void;
|
|
30
30
|
/** @inheritdoc */
|
|
31
31
|
static deserialize(data: any, parent: any, uiManager: any): Promise<AnnotationEditor | null>;
|
|
32
32
|
constructor(params: any);
|
|
@@ -31,24 +31,24 @@ export type TextLayerUpdateParameters = {
|
|
|
31
31
|
onBefore?: Function | undefined;
|
|
32
32
|
};
|
|
33
33
|
export class TextLayer {
|
|
34
|
-
static #ascentCache: Map<any, any>;
|
|
35
|
-
static #canvasContexts: Map<any, any>;
|
|
36
|
-
static #canvasCtxFonts: WeakMap<WeakKey, any>;
|
|
37
|
-
static #minFontSize: null;
|
|
38
|
-
static #pendingTextLayers: Set<any>;
|
|
34
|
+
static "__#private@#ascentCache": Map<any, any>;
|
|
35
|
+
static "__#private@#canvasContexts": Map<any, any>;
|
|
36
|
+
static "__#private@#canvasCtxFonts": WeakMap<WeakKey, any>;
|
|
37
|
+
static "__#private@#minFontSize": null;
|
|
38
|
+
static "__#private@#pendingTextLayers": Set<any>;
|
|
39
39
|
static get fontFamilyMap(): any;
|
|
40
40
|
/**
|
|
41
41
|
* Clean-up global textLayer data.
|
|
42
42
|
* @returns {undefined}
|
|
43
43
|
*/
|
|
44
44
|
static cleanup(): undefined;
|
|
45
|
-
static #getCtx(lang?: null): any;
|
|
46
|
-
static #ensureCtxFont(ctx: any, size: any, family: any): void;
|
|
45
|
+
static "__#private@#getCtx"(lang?: null): any;
|
|
46
|
+
static "__#private@#ensureCtxFont"(ctx: any, size: any, family: any): void;
|
|
47
47
|
/**
|
|
48
48
|
* Compute the minimum font size enforced by the browser.
|
|
49
49
|
*/
|
|
50
|
-
static #ensureMinFontSizeComputed(): void;
|
|
51
|
-
static #getAscent(fontFamily: any, style: any, lang: any): any;
|
|
50
|
+
static "__#private@#ensureMinFontSizeComputed"(): void;
|
|
51
|
+
static "__#private@#getAscent"(fontFamily: any, style: any, lang: any): any;
|
|
52
52
|
/**
|
|
53
53
|
* @param {TextLayerParameters} options
|
|
54
54
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export class GlobalWorkerOptions {
|
|
2
|
-
static #port: null;
|
|
3
|
-
static #src: string;
|
|
2
|
+
static "__#private@#port": null;
|
|
3
|
+
static "__#private@#src": string;
|
|
4
4
|
/**
|
|
5
5
|
* @param {Worker | null} workerPort - Defines global port for worker process.
|
|
6
6
|
* Overrides the `workerSrc` option.
|
|
@@ -402,8 +402,8 @@ export class Util {
|
|
|
402
402
|
static intersect(rect1: any, rect2: any): number[] | null;
|
|
403
403
|
static pointBoundingBox(x: any, y: any, minMax: any): void;
|
|
404
404
|
static rectBoundingBox(x0: any, y0: any, x1: any, y1: any, minMax: any): void;
|
|
405
|
-
static #getExtremumOnCurve(x0: any, x1: any, x2: any, x3: any, y0: any, y1: any, y2: any, y3: any, t: any, minMax: any): void;
|
|
406
|
-
static #getExtremum(x0: any, x1: any, x2: any, x3: any, y0: any, y1: any, y2: any, y3: any, a: any, b: any, c: any, minMax: any): void;
|
|
405
|
+
static "__#private@#getExtremumOnCurve"(x0: any, x1: any, x2: any, x3: any, y0: any, y1: any, y2: any, y3: any, t: any, minMax: any): void;
|
|
406
|
+
static "__#private@#getExtremum"(x0: any, x1: any, x2: any, x3: any, y0: any, y1: any, y2: any, y3: any, a: any, b: any, c: any, minMax: any): void;
|
|
407
407
|
static bezierBoundingBox(x0: any, y0: any, x1: any, y1: any, x2: any, y2: any, x3: any, y3: any, minMax: any): void;
|
|
408
408
|
}
|
|
409
409
|
export namespace VerbosityLevel {
|
|
@@ -14,7 +14,7 @@ export class TextAccessibilityManager {
|
|
|
14
14
|
* @param {HTMLElement} e2
|
|
15
15
|
* @returns {number}
|
|
16
16
|
*/
|
|
17
|
-
static #compareElementPositions(e1: HTMLElement, e2: HTMLElement): number;
|
|
17
|
+
static "__#private@#compareElementPositions"(e1: HTMLElement, e2: HTMLElement): number;
|
|
18
18
|
setTextMapping(textDivs: any): void;
|
|
19
19
|
/**
|
|
20
20
|
* Function called when the text layer has finished rendering.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chialab/pdfjs-lib",
|
|
3
3
|
"description": "A custom Mozilla's PDF.js build with better Node support and extras.",
|
|
4
|
-
"version": "1.0.0-alpha.
|
|
4
|
+
"version": "1.0.0-alpha.29",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Chialab <dev@chialab.it>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"build": "rimraf 'dist' && tsc && node build.js",
|
|
14
14
|
"check": "biome check",
|
|
15
15
|
"test": "vitest",
|
|
16
|
+
"screenshots": "docker run --rm -v \"$(pwd)\":/app -w /app node:latest bash -c \"rm -rf node_modules && yarn install && yarn playwright install chromium --with-deps --only-shell && yarn test\"",
|
|
16
17
|
"publint": "publint --pack npm",
|
|
17
18
|
"prepack": "yarn build && publint --pack npm"
|
|
18
19
|
},
|
|
@@ -34,11 +35,19 @@
|
|
|
34
35
|
"@biomejs/biome": "^1.9.4",
|
|
35
36
|
"@changesets/cli": "^2.28.1",
|
|
36
37
|
"@types/node": "^22.13.5",
|
|
38
|
+
"@types/opentype.js": "^1.3.8",
|
|
39
|
+
"@types/pngjs": "^6.0.5",
|
|
37
40
|
"esbuild": "^0.25.0",
|
|
38
41
|
"magic-string": "^0.30.17",
|
|
42
|
+
"opentype.js": "^1.3.4",
|
|
43
|
+
"pixelmatch": "^7.1.0",
|
|
44
|
+
"playwright": "^1.56.0",
|
|
45
|
+
"pngjs": "^7.0.0",
|
|
39
46
|
"publint": "^0.3.7",
|
|
40
47
|
"rimraf": "^6.0.1",
|
|
48
|
+
"sharp": "^0.34.4",
|
|
41
49
|
"typescript": "^5.7.3",
|
|
50
|
+
"vite": "^7.1.9",
|
|
42
51
|
"vitest": "^3.1.1"
|
|
43
52
|
},
|
|
44
53
|
"packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
|