@chialab/pdfjs-lib 1.0.0-alpha.4 → 1.0.0-alpha.40
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 +15 -7
- package/dist/browser/NodeUtilsStabs-MUAXKISB.js +19 -0
- package/dist/browser/chunk-3ZTAZS2X.js +25 -0
- package/dist/browser/{chunk-DYHYQ33L.js → chunk-AQCSGHG6.js} +1578 -83
- package/dist/browser/index.js +8181 -4159
- package/dist/browser/openjpeg-QOD5OH7M.js +9 -0
- package/dist/browser/qcms_bg-Q7BRLLZG.js +9 -0
- package/dist/browser/worker.js +8390 -7851
- package/dist/index.d.ts +10 -1
- package/dist/lib/AnnotationData.d.ts +12 -8
- package/dist/lib/AnnotationOperatorsList.d.ts +21 -0
- package/dist/lib/Canvas.d.ts +2 -7
- package/dist/lib/CanvasGraphics.d.ts +1 -0
- package/dist/lib/NodeCanvasFactory.d.ts +9 -0
- package/dist/lib/NodeFilterFactory.d.ts +10 -0
- package/dist/lib/NodeUtils.d.ts +24 -0
- package/dist/lib/Path2D.d.ts +9 -49
- package/dist/lib/StandardFontDataFactory.d.ts +2 -2
- package/dist/lib/StructTreePage.d.ts +5 -0
- package/dist/lib/Svg.d.ts +144 -0
- package/dist/lib/SvgCanvasContext.d.ts +38 -24
- package/dist/lib/TextLayer.d.ts +56 -17
- package/dist/lib/WasmFactory.d.ts +5 -0
- package/dist/lib/utils.d.ts +26 -3
- package/dist/node/NodeUtils-WQF223ZR.js +20 -0
- package/dist/node/chunk-5N6O7ENF.js +2065 -0
- package/dist/node/chunk-QUZQQXZM.js +1225 -0
- package/dist/node/chunk-SW5MJNUM.js +2090 -0
- package/dist/node/index.js +7309 -4996
- package/dist/node/openjpeg-JTQTBXER.js +9 -0
- package/dist/node/qcms_bg-T4RSHPOQ.js +9 -0
- package/dist/node/worker.js +8399 -7858
- 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/bidi.d.ts +4 -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 +98 -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/annotation_layer.d.ts +35 -5
- package/dist/pdf.js/src/display/annotation_storage.d.ts +3 -8
- package/dist/pdf.js/src/display/api.d.ts +86 -77
- package/dist/pdf.js/src/display/api_utils.d.ts +13 -0
- package/dist/pdf.js/src/display/canvas.d.ts +88 -94
- package/dist/pdf.js/src/display/canvas_dependency_tracker.d.ts +160 -0
- package/dist/pdf.js/src/display/display_utils.d.ts +34 -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 +10 -8
- package/dist/pdf.js/src/display/editor/color_picker.d.ts +20 -1
- package/dist/pdf.js/src/display/editor/comment.d.ts +47 -0
- package/dist/pdf.js/src/display/editor/draw.d.ts +8 -8
- package/dist/pdf.js/src/display/editor/drawers/freedraw.d.ts +4 -3
- package/dist/pdf.js/src/display/editor/drawers/highlight.d.ts +2 -1
- package/dist/pdf.js/src/display/editor/drawers/signaturedraw.d.ts +13 -13
- package/dist/pdf.js/src/display/editor/editor.d.ts +117 -16
- package/dist/pdf.js/src/display/editor/freetext.d.ts +11 -7
- package/dist/pdf.js/src/display/editor/highlight.d.ts +9 -3
- package/dist/pdf.js/src/display/editor/ink.d.ts +6 -0
- package/dist/pdf.js/src/display/editor/signature.d.ts +3 -5
- package/dist/pdf.js/src/display/editor/stamp.d.ts +4 -3
- package/dist/pdf.js/src/display/editor/toolbar.d.ts +8 -3
- package/dist/pdf.js/src/display/editor/tools.d.ts +36 -12
- package/dist/pdf.js/src/display/font_loader.d.ts +27 -1
- package/dist/pdf.js/src/display/metadata.d.ts +1 -2
- package/dist/pdf.js/src/display/optional_content_config.d.ts +1 -1
- package/dist/pdf.js/src/display/pattern_helper.d.ts +6 -4
- package/dist/pdf.js/src/display/pdf_objects.d.ts +40 -0
- package/dist/pdf.js/src/display/text_layer.d.ts +9 -9
- package/dist/pdf.js/src/display/touch_manager.d.ts +5 -1
- package/dist/pdf.js/src/display/worker_options.d.ts +2 -2
- package/dist/pdf.js/src/pdf.d.ts +9 -1
- package/dist/pdf.js/src/shared/obj-bin-transform.d.ts +64 -0
- package/dist/pdf.js/src/shared/scripting_utils.d.ts +2 -0
- package/dist/pdf.js/src/shared/util.d.ts +129 -102
- package/dist/pdf.js/web/comment_manager.d.ts +20 -0
- package/dist/pdf.js/web/interfaces.d.ts +7 -0
- package/dist/pdf.js/web/text_accessibility.d.ts +1 -1
- package/package.json +12 -3
- package/dist/node/chunk-KTTVPO2G.js +0 -1775
- package/dist/pdf.js/src/display/node_utils.d.ts +0 -32
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export class OpenTypeFileBuilder {
|
|
2
|
+
static getSearchParams(entriesCount: any, entrySize: any): {
|
|
3
|
+
range: number;
|
|
4
|
+
entry: number;
|
|
5
|
+
rangeShift: number;
|
|
6
|
+
};
|
|
7
|
+
constructor(sfnt: any);
|
|
8
|
+
sfnt: any;
|
|
9
|
+
tables: any;
|
|
10
|
+
toArray(): Uint8Array<ArrayBuffer>;
|
|
11
|
+
addTable(tag: any, data: any): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export class Lexer {
|
|
2
|
+
constructor(stream: any, knownCommands?: null);
|
|
3
|
+
stream: any;
|
|
4
|
+
strBuf: any[];
|
|
5
|
+
knownCommands: any;
|
|
6
|
+
_hexStringNumWarn: number;
|
|
7
|
+
beginInlineImagePos: number;
|
|
8
|
+
nextChar(): any;
|
|
9
|
+
currentChar: any;
|
|
10
|
+
peekChar(): any;
|
|
11
|
+
getNumber(): number;
|
|
12
|
+
getString(): string;
|
|
13
|
+
getName(): any;
|
|
14
|
+
/**
|
|
15
|
+
* @private
|
|
16
|
+
*/
|
|
17
|
+
private _hexStringWarn;
|
|
18
|
+
getHexString(): string;
|
|
19
|
+
getObj(): any;
|
|
20
|
+
skipToNextLine(): void;
|
|
21
|
+
}
|
|
22
|
+
export class Linearization {
|
|
23
|
+
static create(stream: any): {
|
|
24
|
+
length: any;
|
|
25
|
+
hints: any[];
|
|
26
|
+
objectNumberFirst: any;
|
|
27
|
+
endFirst: any;
|
|
28
|
+
numPages: any;
|
|
29
|
+
mainXRefEntriesOffset: any;
|
|
30
|
+
pageFirst: any;
|
|
31
|
+
} | null;
|
|
32
|
+
}
|
|
33
|
+
export class Parser {
|
|
34
|
+
constructor({ lexer, xref, allowStreams, recoveryMode }: {
|
|
35
|
+
lexer: any;
|
|
36
|
+
xref: any;
|
|
37
|
+
allowStreams?: boolean | undefined;
|
|
38
|
+
recoveryMode?: boolean | undefined;
|
|
39
|
+
});
|
|
40
|
+
lexer: any;
|
|
41
|
+
xref: any;
|
|
42
|
+
allowStreams: boolean;
|
|
43
|
+
recoveryMode: boolean;
|
|
44
|
+
imageCache: any;
|
|
45
|
+
_imageId: number;
|
|
46
|
+
refill(): void;
|
|
47
|
+
buf1: any;
|
|
48
|
+
buf2: any;
|
|
49
|
+
shift(): void;
|
|
50
|
+
tryShift(): boolean;
|
|
51
|
+
getObj(cipherTransform?: null): any;
|
|
52
|
+
/**
|
|
53
|
+
* Find the end of the stream by searching for the /EI\s/.
|
|
54
|
+
* @returns {number} The inline stream length.
|
|
55
|
+
*/
|
|
56
|
+
findDefaultInlineStreamEnd(stream: any): number;
|
|
57
|
+
/**
|
|
58
|
+
* Find the EOI (end-of-image) marker 0xFFD9 of the stream.
|
|
59
|
+
* @returns {number} The inline stream length.
|
|
60
|
+
*/
|
|
61
|
+
findDCTDecodeInlineStreamEnd(stream: any): number;
|
|
62
|
+
/**
|
|
63
|
+
* Find the EOD (end-of-data) marker '~>' (i.e. TILDE + GT) of the stream.
|
|
64
|
+
* @returns {number} The inline stream length.
|
|
65
|
+
*/
|
|
66
|
+
findASCII85DecodeInlineStreamEnd(stream: any): number;
|
|
67
|
+
/**
|
|
68
|
+
* Find the EOD (end-of-data) marker '>' (i.e. GT) of the stream.
|
|
69
|
+
* @returns {number} The inline stream length.
|
|
70
|
+
*/
|
|
71
|
+
findASCIIHexDecodeInlineStreamEnd(stream: any): number;
|
|
72
|
+
/**
|
|
73
|
+
* Skip over the /EI/ for streams where we search for an EOD marker.
|
|
74
|
+
*/
|
|
75
|
+
inlineStreamSkipEI(stream: any): void;
|
|
76
|
+
makeInlineImage(cipherTransform: any): any;
|
|
77
|
+
makeStream(dict: any, cipherTransform: any): any;
|
|
78
|
+
filter(stream: any, dict: any, length: any): any;
|
|
79
|
+
makeFilter(stream: any, name: any, maybeLength: any, params: any): any;
|
|
80
|
+
#private;
|
|
81
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class PredictorStream extends DecodeStream {
|
|
2
|
+
constructor(str: any, maybeLength: any, params: any);
|
|
3
|
+
predictor: any;
|
|
4
|
+
readBlock: (() => void) | undefined;
|
|
5
|
+
str: any;
|
|
6
|
+
dict: any;
|
|
7
|
+
colors: any;
|
|
8
|
+
bits: any;
|
|
9
|
+
columns: any;
|
|
10
|
+
pixBytes: number | undefined;
|
|
11
|
+
rowBytes: number | undefined;
|
|
12
|
+
readBlockTiff(): void;
|
|
13
|
+
readBlockPng(): void;
|
|
14
|
+
}
|
|
15
|
+
import { DecodeStream } from "./decode_stream.js";
|
|
@@ -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;
|
|
@@ -5,6 +5,7 @@ export type IDownloadManager = import("../../web/interfaces").IDownloadManager;
|
|
|
5
5
|
export type IPDFLinkService = import("../../web/interfaces").IPDFLinkService;
|
|
6
6
|
export type AnnotationEditorUIManager = any;
|
|
7
7
|
export type StructTreeLayerBuilder = import("../../web/struct_tree_layer_builder.js").StructTreeLayerBuilder;
|
|
8
|
+
export type CommentManager = import("../../web/comment_manager.js").CommentManager;
|
|
8
9
|
export type AnnotationElementParameters = {
|
|
9
10
|
data: Object;
|
|
10
11
|
layer: HTMLDivElement;
|
|
@@ -52,6 +53,10 @@ export type AnnotationLayerParameters = {
|
|
|
52
53
|
accessibilityManager?: import("../../web/text_accessibility.js").TextAccessibilityManager | undefined;
|
|
53
54
|
annotationEditorUIManager?: AnnotationEditorUIManager;
|
|
54
55
|
structTreeLayer?: import("../../web/struct_tree_layer_builder.js").StructTreeLayerBuilder | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* - The comment manager instance.
|
|
58
|
+
*/
|
|
59
|
+
commentManager?: import("../../web/comment_manager.js").CommentManager | undefined;
|
|
55
60
|
};
|
|
56
61
|
/**
|
|
57
62
|
* @typedef {Object} AnnotationLayerParameters
|
|
@@ -73,6 +78,7 @@ export type AnnotationLayerParameters = {
|
|
|
73
78
|
* @property {TextAccessibilityManager} [accessibilityManager]
|
|
74
79
|
* @property {AnnotationEditorUIManager} [annotationEditorUIManager]
|
|
75
80
|
* @property {StructTreeLayerBuilder} [structTreeLayer]
|
|
81
|
+
* @property {CommentManager} [commentManager] - The comment manager instance.
|
|
76
82
|
*/
|
|
77
83
|
/**
|
|
78
84
|
* Manage the layer containing all the annotations.
|
|
@@ -82,7 +88,7 @@ export class AnnotationLayer {
|
|
|
82
88
|
* @private
|
|
83
89
|
*/
|
|
84
90
|
private static get _defaultBorderStyle();
|
|
85
|
-
constructor({ div, accessibilityManager, annotationCanvasMap, annotationEditorUIManager, page, viewport, structTreeLayer, }: {
|
|
91
|
+
constructor({ div, accessibilityManager, annotationCanvasMap, annotationEditorUIManager, page, viewport, structTreeLayer, commentManager, linkService, annotationStorage, }: {
|
|
86
92
|
div: any;
|
|
87
93
|
accessibilityManager: any;
|
|
88
94
|
annotationCanvasMap: any;
|
|
@@ -90,12 +96,16 @@ export class AnnotationLayer {
|
|
|
90
96
|
page: any;
|
|
91
97
|
viewport: any;
|
|
92
98
|
structTreeLayer: any;
|
|
99
|
+
commentManager: any;
|
|
100
|
+
linkService: any;
|
|
101
|
+
annotationStorage: any;
|
|
93
102
|
});
|
|
94
103
|
div: any;
|
|
95
104
|
page: any;
|
|
96
105
|
viewport: any;
|
|
97
106
|
zIndex: number;
|
|
98
107
|
_annotationEditorUIManager: any;
|
|
108
|
+
_commentManager: any;
|
|
99
109
|
popupShow: any[] | undefined;
|
|
100
110
|
hasEditableAnnotations(): boolean;
|
|
101
111
|
/**
|
|
@@ -112,7 +122,7 @@ export class AnnotationLayer {
|
|
|
112
122
|
* @param {IPDFLinkService} linkService
|
|
113
123
|
* @memberof AnnotationLayer
|
|
114
124
|
*/
|
|
115
|
-
addLinkAnnotations(annotations: Array<Object
|
|
125
|
+
addLinkAnnotations(annotations: Array<Object>): Promise<void>;
|
|
116
126
|
/**
|
|
117
127
|
* Update the annotation elements on existing annotation layer.
|
|
118
128
|
*
|
|
@@ -122,6 +132,7 @@ export class AnnotationLayer {
|
|
|
122
132
|
update({ viewport }: AnnotationLayerParameters): void;
|
|
123
133
|
getEditableAnnotations(): any[];
|
|
124
134
|
getEditableAnnotation(id: any): any;
|
|
135
|
+
addFakeAnnotation(editor: any): EditorAnnotationElement;
|
|
125
136
|
#private;
|
|
126
137
|
}
|
|
127
138
|
export class FreeTextAnnotationElement extends AnnotationElement {
|
|
@@ -151,9 +162,15 @@ export class StampAnnotationElement extends AnnotationElement {
|
|
|
151
162
|
render(): HTMLElement | undefined;
|
|
152
163
|
}
|
|
153
164
|
import { AnnotationStorage } from "./annotation_storage.js";
|
|
165
|
+
declare class EditorAnnotationElement extends AnnotationElement {
|
|
166
|
+
constructor(parameters: any);
|
|
167
|
+
editor: any;
|
|
168
|
+
render(): HTMLElement | undefined;
|
|
169
|
+
createOrUpdatePopup(): void;
|
|
170
|
+
remove(): void;
|
|
171
|
+
}
|
|
154
172
|
declare class AnnotationElement {
|
|
155
|
-
static _hasPopupData({
|
|
156
|
-
titleObj: any;
|
|
173
|
+
static _hasPopupData({ contentsObj, richText }: {
|
|
157
174
|
contentsObj: any;
|
|
158
175
|
richText: any;
|
|
159
176
|
}): boolean;
|
|
@@ -171,13 +188,22 @@ declare class AnnotationElement {
|
|
|
171
188
|
renderForms: any;
|
|
172
189
|
svgFactory: any;
|
|
173
190
|
annotationStorage: any;
|
|
191
|
+
enableComment: any;
|
|
174
192
|
enableScripting: any;
|
|
175
193
|
hasJSActions: any;
|
|
176
194
|
_fieldObjects: any;
|
|
177
195
|
parent: any;
|
|
178
196
|
container: HTMLElement | undefined;
|
|
179
197
|
get _isEditable(): any;
|
|
180
|
-
get hasPopupData():
|
|
198
|
+
get hasPopupData(): any;
|
|
199
|
+
get commentData(): any;
|
|
200
|
+
get hasCommentButton(): any;
|
|
201
|
+
get commentButtonPosition(): any;
|
|
202
|
+
_normalizePoint(point: any): any;
|
|
203
|
+
set commentText(text: any);
|
|
204
|
+
get commentText(): any;
|
|
205
|
+
removePopup(): void;
|
|
206
|
+
popup: any;
|
|
181
207
|
updateEdited(params: any): void;
|
|
182
208
|
resetEdited(): void;
|
|
183
209
|
/**
|
|
@@ -205,10 +231,14 @@ declare class AnnotationElement {
|
|
|
205
231
|
* annotations that do not have a Popup entry in the dictionary, but
|
|
206
232
|
* are of a type that works with popups (such as Highlight annotations).
|
|
207
233
|
*
|
|
234
|
+
* @param {Object} [popupData] - The data for the popup, if any.
|
|
235
|
+
*
|
|
208
236
|
* @private
|
|
209
237
|
* @memberof AnnotationElement
|
|
210
238
|
*/
|
|
211
239
|
private _createPopup;
|
|
240
|
+
get hasPopupElement(): boolean;
|
|
241
|
+
get extraPopupElement(): null;
|
|
212
242
|
/**
|
|
213
243
|
* Render the annotation's HTML element(s).
|
|
214
244
|
*
|
|
@@ -35,14 +35,6 @@ export class AnnotationStorage {
|
|
|
35
35
|
* @returns {boolean}
|
|
36
36
|
*/
|
|
37
37
|
has(key: string): boolean;
|
|
38
|
-
/**
|
|
39
|
-
* @returns {Object | null}
|
|
40
|
-
*/
|
|
41
|
-
getAll(): Object | null;
|
|
42
|
-
/**
|
|
43
|
-
* @param {Object} obj
|
|
44
|
-
*/
|
|
45
|
-
setAll(obj: Object): void;
|
|
46
38
|
get size(): number;
|
|
47
39
|
resetModified(): void;
|
|
48
40
|
/**
|
|
@@ -64,6 +56,8 @@ export class AnnotationStorage {
|
|
|
64
56
|
};
|
|
65
57
|
get editorStats(): any;
|
|
66
58
|
resetModifiedIds(): void;
|
|
59
|
+
updateEditor(annotationId: any, data: any): boolean;
|
|
60
|
+
getEditor(annotationId: any): any;
|
|
67
61
|
/**
|
|
68
62
|
* @returns {{ids: Set<string>, hash: string}}
|
|
69
63
|
*/
|
|
@@ -71,6 +65,7 @@ export class AnnotationStorage {
|
|
|
71
65
|
ids: Set<string>;
|
|
72
66
|
hash: string;
|
|
73
67
|
};
|
|
68
|
+
[Symbol.iterator](): MapIterator<[any, any]>;
|
|
74
69
|
#private;
|
|
75
70
|
}
|
|
76
71
|
/**
|