@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,21 @@
|
|
|
1
|
+
export class ColorSpaceUtils {
|
|
2
|
+
static parse({ cs, xref, resources, pdfFunctionFactory, globalColorSpaceCache, localColorSpaceCache, asyncIfNotCached, }: {
|
|
3
|
+
cs: any;
|
|
4
|
+
xref: any;
|
|
5
|
+
resources?: null | undefined;
|
|
6
|
+
pdfFunctionFactory: any;
|
|
7
|
+
globalColorSpaceCache: any;
|
|
8
|
+
localColorSpaceCache: any;
|
|
9
|
+
asyncIfNotCached?: boolean | undefined;
|
|
10
|
+
}): any;
|
|
11
|
+
/**
|
|
12
|
+
* NOTE: This method should *only* be invoked from `this.#parse`,
|
|
13
|
+
* when parsing "sub" ColorSpaces.
|
|
14
|
+
*/
|
|
15
|
+
static "__#private@#subParse"(cs: any, options: any): any;
|
|
16
|
+
static "__#private@#parse"(cs: any, options: any): any;
|
|
17
|
+
static get gray(): any;
|
|
18
|
+
static get rgb(): any;
|
|
19
|
+
static get rgba(): any;
|
|
20
|
+
static get cmyk(): any;
|
|
21
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Combines multiple ArrayBuffers into a single Uint8Array.
|
|
3
|
+
* @param {Array<ArrayBuffer>} arr - An array of ArrayBuffers.
|
|
4
|
+
* @returns {Uint8Array}
|
|
5
|
+
*/
|
|
6
|
+
export function arrayBuffersToBytes(arr: Array<ArrayBuffer>): Uint8Array;
|
|
7
|
+
export function codePointIter(str: any): Generator<any, void, unknown>;
|
|
8
|
+
export function collectActions(xref: any, dict: any, eventType: any): any;
|
|
9
|
+
export function encodeToXmlString(str: any): any;
|
|
10
|
+
export function escapePDFName(str: any): any;
|
|
11
|
+
export function escapeString(str: any): any;
|
|
12
|
+
export function fetchBinaryData(url: any): Promise<Uint8Array<ArrayBuffer>>;
|
|
13
|
+
/**
|
|
14
|
+
* Get the value of an inheritable property.
|
|
15
|
+
*
|
|
16
|
+
* If the PDF specification explicitly lists a property in a dictionary as
|
|
17
|
+
* inheritable, then the value of the property may be present in the dictionary
|
|
18
|
+
* itself or in one or more parents of the dictionary.
|
|
19
|
+
*
|
|
20
|
+
* If the key is not found in the tree, `undefined` is returned. Otherwise,
|
|
21
|
+
* the value for the key is returned or, if `stopWhenFound` is `false`, a list
|
|
22
|
+
* of values is returned.
|
|
23
|
+
*
|
|
24
|
+
* @param {Dict} dict - Dictionary from where to start the traversal.
|
|
25
|
+
* @param {string} key - The key of the property to find the value for.
|
|
26
|
+
* @param {boolean} getArray - Whether or not the value should be fetched as an
|
|
27
|
+
* array. The default value is `false`.
|
|
28
|
+
* @param {boolean} stopWhenFound - Whether or not to stop the traversal when
|
|
29
|
+
* the key is found. If set to `false`, we always walk up the entire parent
|
|
30
|
+
* chain, for example to be able to find `\Resources` placed on multiple
|
|
31
|
+
* levels of the tree. The default value is `true`.
|
|
32
|
+
*/
|
|
33
|
+
export function getInheritableProperty({ dict, key, getArray, stopWhenFound, }: Dict): any;
|
|
34
|
+
export function getLookupTableFactory(initializer: any): () => any;
|
|
35
|
+
export function getNewAnnotationsMap(annotationStorage: any): Map<any, any> | null;
|
|
36
|
+
/**
|
|
37
|
+
* Get the parent dictionary to update when a property is set.
|
|
38
|
+
*
|
|
39
|
+
* @param {Dict} dict - Dictionary from where to start the traversal.
|
|
40
|
+
* @param {Ref} ref - The reference to the dictionary.
|
|
41
|
+
* @param {XRef} xref - The `XRef` instance.
|
|
42
|
+
*/
|
|
43
|
+
export function getParentToUpdate(dict: Dict, ref: Ref, xref: XRef): {
|
|
44
|
+
dict: null;
|
|
45
|
+
ref: null;
|
|
46
|
+
};
|
|
47
|
+
export function getRotationMatrix(rotation: any, width: any, height: any): any[];
|
|
48
|
+
/**
|
|
49
|
+
* Get the number of bytes to use to represent the given positive integer.
|
|
50
|
+
* If n is zero, the function returns 0 which means that we don't need to waste
|
|
51
|
+
* a byte to represent it.
|
|
52
|
+
* @param {number} x - a positive integer.
|
|
53
|
+
* @returns {number}
|
|
54
|
+
*/
|
|
55
|
+
export function getSizeInBytes(x: number): number;
|
|
56
|
+
export const IDENTITY_MATRIX: number[];
|
|
57
|
+
export function isAscii(str: any): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Checks if something is an Array containing only boolean values,
|
|
60
|
+
* and (optionally) checks its length.
|
|
61
|
+
* @param {any} arr
|
|
62
|
+
* @param {number | null} len
|
|
63
|
+
* @returns {boolean}
|
|
64
|
+
*/
|
|
65
|
+
export function isBooleanArray(arr: any, len: number | null): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Checks if something is an Array containing only numbers,
|
|
68
|
+
* and (optionally) checks its length.
|
|
69
|
+
* @param {any} arr
|
|
70
|
+
* @param {number | null} len
|
|
71
|
+
* @returns {boolean}
|
|
72
|
+
*/
|
|
73
|
+
export function isNumberArray(arr: any, len: number | null): boolean;
|
|
74
|
+
export function isWhiteSpace(ch: any): boolean;
|
|
75
|
+
export function log2(x: any): number;
|
|
76
|
+
export function lookupMatrix(arr: any, fallback: any): any;
|
|
77
|
+
export function lookupNormalRect(arr: any, fallback: any): any;
|
|
78
|
+
export function lookupRect(arr: any, fallback: any): any;
|
|
79
|
+
export const MAX_INT_32: number;
|
|
80
|
+
export const MIN_INT_32: number;
|
|
81
|
+
declare const MissingDataException_base: any;
|
|
82
|
+
export class MissingDataException extends MissingDataException_base {
|
|
83
|
+
[x: string]: any;
|
|
84
|
+
constructor(begin: any, end: any);
|
|
85
|
+
begin: any;
|
|
86
|
+
end: any;
|
|
87
|
+
}
|
|
88
|
+
export function numberToString(value: any): any;
|
|
89
|
+
declare const ParserEOFException_base: any;
|
|
90
|
+
export class ParserEOFException extends ParserEOFException_base {
|
|
91
|
+
[x: string]: any;
|
|
92
|
+
constructor(msg: any);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* AcroForm field names use an array like notation to refer to
|
|
96
|
+
* repeated XFA elements e.g. foo.bar[nnn].
|
|
97
|
+
* see: XFA Spec Chapter 3 - Repeated Elements
|
|
98
|
+
*
|
|
99
|
+
* @param {string} path - XFA path name.
|
|
100
|
+
* @returns {Array} - Array of Objects with the name and pos of
|
|
101
|
+
* each part of the path.
|
|
102
|
+
*/
|
|
103
|
+
export function parseXFAPath(path: string): any[];
|
|
104
|
+
export const PDF_VERSION_REGEXP: RegExp;
|
|
105
|
+
export function readInt16(data: any, offset: any): number;
|
|
106
|
+
export function readInt8(data: any, offset: any): number;
|
|
107
|
+
export function readUint16(data: any, offset: any): number;
|
|
108
|
+
export function readUint32(data: any, offset: any): number;
|
|
109
|
+
export function recoverJsURL(str: any): {
|
|
110
|
+
url: string;
|
|
111
|
+
newWindow: boolean;
|
|
112
|
+
} | null;
|
|
113
|
+
export const RESOURCES_KEYS_OPERATOR_LIST: string[];
|
|
114
|
+
export const RESOURCES_KEYS_TEXT_CONTENT: string[];
|
|
115
|
+
export function stringToAsciiOrUTF16BE(str: any): any;
|
|
116
|
+
export function stringToUTF16HexString(str: any): string;
|
|
117
|
+
export function stringToUTF16String(str: any, bigEndian?: boolean): string;
|
|
118
|
+
/**
|
|
119
|
+
* Converts positive integers to (upper case) Roman numerals.
|
|
120
|
+
* @param {number} number - The number that should be converted.
|
|
121
|
+
* @param {boolean} lowerCase - Indicates if the result should be converted
|
|
122
|
+
* to lower case letters. The default value is `false`.
|
|
123
|
+
* @returns {string} The resulting Roman number.
|
|
124
|
+
*/
|
|
125
|
+
export function toRomanNumerals(number: number, lowerCase?: boolean): string;
|
|
126
|
+
export function validateCSSFont(cssFontInfo: any): boolean;
|
|
127
|
+
export function validateFontName(fontFamily: any, mustWarn?: boolean): boolean;
|
|
128
|
+
declare const XRefEntryException_base: any;
|
|
129
|
+
export class XRefEntryException extends XRefEntryException_base {
|
|
130
|
+
[x: string]: any;
|
|
131
|
+
constructor(msg: any);
|
|
132
|
+
}
|
|
133
|
+
declare const XRefParseException_base: any;
|
|
134
|
+
export class XRefParseException extends XRefParseException_base {
|
|
135
|
+
[x: string]: any;
|
|
136
|
+
constructor(msg: any);
|
|
137
|
+
}
|
|
138
|
+
import { Dict } from "./primitives.js";
|
|
139
|
+
import { Ref } from "./primitives.js";
|
|
140
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export class DecodeStream extends BaseStream {
|
|
2
|
+
constructor(maybeMinBufferLength: any);
|
|
3
|
+
_rawMinBufferLength: any;
|
|
4
|
+
pos: number;
|
|
5
|
+
bufferLength: number;
|
|
6
|
+
eof: boolean;
|
|
7
|
+
buffer: Uint8Array<ArrayBuffer>;
|
|
8
|
+
minBufferLength: number;
|
|
9
|
+
get isEmpty(): boolean;
|
|
10
|
+
ensureBuffer(requested: any): Uint8Array<ArrayBuffer>;
|
|
11
|
+
getByte(): number;
|
|
12
|
+
getBytes(length: any, decoderOptions?: null): Uint8Array<ArrayBuffer>;
|
|
13
|
+
getImageData(length: any, decoderOptions: any): Promise<any>;
|
|
14
|
+
makeSubStream(start: any, length: any, dict?: null): Stream;
|
|
15
|
+
getBaseStreams(): any;
|
|
16
|
+
}
|
|
17
|
+
export class StreamsSequenceStream extends DecodeStream {
|
|
18
|
+
constructor(streams: any, onError?: null);
|
|
19
|
+
streams: any;
|
|
20
|
+
_onError: any;
|
|
21
|
+
readBlock(): void;
|
|
22
|
+
getBaseStreams(): any[] | null;
|
|
23
|
+
}
|
|
24
|
+
import { BaseStream } from "./base_stream.js";
|
|
25
|
+
import { Stream } from "./stream.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const ExpertEncoding: string[];
|
|
2
|
+
export function getEncoding(encodingName: any): string[] | null;
|
|
3
|
+
export const MacRomanEncoding: string[];
|
|
4
|
+
export const StandardEncoding: string[];
|
|
5
|
+
export const SymbolSetEncoding: string[];
|
|
6
|
+
export const WinAnsiEncoding: string[];
|
|
7
|
+
export const ZapfDingbatsEncoding: string[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class FlateStream extends DecodeStream {
|
|
2
|
+
constructor(str: any, maybeLength: any);
|
|
3
|
+
str: any;
|
|
4
|
+
dict: any;
|
|
5
|
+
codeSize: number;
|
|
6
|
+
codeBuf: number;
|
|
7
|
+
getImageData(length: any, _decoderOptions: any): Promise<Uint8Array<ArrayBuffer>>;
|
|
8
|
+
asyncGetBytes(): Promise<Uint8Array<ArrayBuffer> | null>;
|
|
9
|
+
getBits(bits: any): number;
|
|
10
|
+
getCode(table: any): number;
|
|
11
|
+
generateHuffmanTable(lengths: any): (number | Int32Array<ArrayBuffer>)[];
|
|
12
|
+
readBlock(): void;
|
|
13
|
+
#private;
|
|
14
|
+
}
|
|
15
|
+
import { DecodeStream } from "./decode_stream.js";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export class FontRendererFactory {
|
|
2
|
+
static create(font: any, seacAnalysisEnabled: any): TrueTypeCompiled | Type2Compiled;
|
|
3
|
+
}
|
|
4
|
+
declare class TrueTypeCompiled extends CompiledFont {
|
|
5
|
+
constructor(glyphs: any, cmap: any, fontMatrix: any);
|
|
6
|
+
glyphs: any;
|
|
7
|
+
cmap: any;
|
|
8
|
+
compileGlyphImpl(code: any, cmds: any): void;
|
|
9
|
+
}
|
|
10
|
+
declare class Type2Compiled extends CompiledFont {
|
|
11
|
+
constructor(cffInfo: any, cmap: any, fontMatrix: any);
|
|
12
|
+
glyphs: any;
|
|
13
|
+
gsubrs: any;
|
|
14
|
+
subrs: any;
|
|
15
|
+
cmap: any;
|
|
16
|
+
glyphNameMap: any;
|
|
17
|
+
gsubrsBias: number;
|
|
18
|
+
subrsBias: number;
|
|
19
|
+
isCFFCIDFont: any;
|
|
20
|
+
fdSelect: any;
|
|
21
|
+
fdArray: any;
|
|
22
|
+
compileGlyphImpl(code: any, cmds: any, glyphId: any): void;
|
|
23
|
+
}
|
|
24
|
+
declare class CompiledFont {
|
|
25
|
+
constructor(fontMatrix: any);
|
|
26
|
+
fontMatrix: any;
|
|
27
|
+
compiledGlyphs: any;
|
|
28
|
+
compiledCharCodeToGlyphId: any;
|
|
29
|
+
getPathJs(unicode: any): any;
|
|
30
|
+
compileGlyph(code: any, glyphId: any): string;
|
|
31
|
+
compileGlyphImpl(): void;
|
|
32
|
+
hasBuiltPath(unicode: any): boolean;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export class ErrorFont {
|
|
2
|
+
constructor(error: any);
|
|
3
|
+
error: any;
|
|
4
|
+
loadedName: string;
|
|
5
|
+
missingFile: boolean;
|
|
6
|
+
charsToGlyphs(): never[];
|
|
7
|
+
encodeString(chars: any): any[];
|
|
8
|
+
exportData(): {
|
|
9
|
+
error: any;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 'Font' is the class the outside world should use, it encapsulate all the font
|
|
14
|
+
* decoding logics whatever type it is (assuming the font type is supported).
|
|
15
|
+
*/
|
|
16
|
+
export class Font {
|
|
17
|
+
constructor(name: any, file: any, properties: any, evaluatorOptions: any);
|
|
18
|
+
name: any;
|
|
19
|
+
psName: any;
|
|
20
|
+
mimetype: string | null;
|
|
21
|
+
disableFontFace: any;
|
|
22
|
+
fontExtraProperties: any;
|
|
23
|
+
loadedName: any;
|
|
24
|
+
isType3Font: any;
|
|
25
|
+
missingFile: boolean;
|
|
26
|
+
cssFontInfo: any;
|
|
27
|
+
_charsCache: any;
|
|
28
|
+
_glyphCache: any;
|
|
29
|
+
isSerifFont: boolean;
|
|
30
|
+
isSymbolicFont: boolean;
|
|
31
|
+
isMonospace: boolean;
|
|
32
|
+
type: any;
|
|
33
|
+
subtype: any;
|
|
34
|
+
systemFontInfo: any;
|
|
35
|
+
isInvalidPDFjsFont: boolean;
|
|
36
|
+
fallbackName: any;
|
|
37
|
+
differences: any;
|
|
38
|
+
widths: any;
|
|
39
|
+
defaultWidth: any;
|
|
40
|
+
composite: any;
|
|
41
|
+
cMap: any;
|
|
42
|
+
capHeight: number;
|
|
43
|
+
ascent: number;
|
|
44
|
+
descent: number;
|
|
45
|
+
lineHeight: number;
|
|
46
|
+
fontMatrix: any;
|
|
47
|
+
bbox: any;
|
|
48
|
+
defaultEncoding: any;
|
|
49
|
+
toUnicode: any;
|
|
50
|
+
toFontChar: any[];
|
|
51
|
+
cidEncoding: any;
|
|
52
|
+
vertical: boolean | undefined;
|
|
53
|
+
vmetrics: any;
|
|
54
|
+
defaultVMetrics: any;
|
|
55
|
+
data: Uint8Array<ArrayBuffer> | undefined;
|
|
56
|
+
seacMap: any;
|
|
57
|
+
get renderer(): any;
|
|
58
|
+
exportData(): {
|
|
59
|
+
data: any;
|
|
60
|
+
extra?: undefined;
|
|
61
|
+
} | {
|
|
62
|
+
data: any;
|
|
63
|
+
extra: any;
|
|
64
|
+
};
|
|
65
|
+
fallbackToSystemFont(properties: any): void;
|
|
66
|
+
bold: boolean | undefined;
|
|
67
|
+
italic: boolean | undefined;
|
|
68
|
+
black: boolean | undefined;
|
|
69
|
+
remeasure: boolean | undefined;
|
|
70
|
+
checkAndRepair(name: any, font: any, properties: any): Uint8Array<ArrayBuffer>;
|
|
71
|
+
isOpenType: boolean | undefined;
|
|
72
|
+
lineGap: any;
|
|
73
|
+
convert(fontName: any, font: any, properties: any): Uint8Array<ArrayBuffer>;
|
|
74
|
+
/**
|
|
75
|
+
* @private
|
|
76
|
+
*/
|
|
77
|
+
private get _spaceWidth();
|
|
78
|
+
/**
|
|
79
|
+
* @private
|
|
80
|
+
*/
|
|
81
|
+
private _charToGlyph;
|
|
82
|
+
charsToGlyphs(chars: any): any;
|
|
83
|
+
/**
|
|
84
|
+
* Chars can have different sizes (depends on the encoding).
|
|
85
|
+
* @param {String} a string encoded with font encoding.
|
|
86
|
+
* @returns {Array<Array<number>>} the positions of each char in the string.
|
|
87
|
+
*/
|
|
88
|
+
getCharPositions(chars: any): Array<Array<number>>;
|
|
89
|
+
get glyphCacheValues(): any[];
|
|
90
|
+
/**
|
|
91
|
+
* Encode a js string using font encoding.
|
|
92
|
+
* The resulting array contains an encoded string at even positions
|
|
93
|
+
* (can be empty) and a non-encoded one at odd positions.
|
|
94
|
+
* @param {String} a js string.
|
|
95
|
+
* @returns {Array<String>} an array of encoded strings or non-encoded ones.
|
|
96
|
+
*/
|
|
97
|
+
encodeString(str: any): Array<string>;
|
|
98
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export function compileType3Glyph({ data: img, width, height }: {
|
|
2
|
+
data: any;
|
|
3
|
+
width: any;
|
|
4
|
+
height: any;
|
|
5
|
+
}): (number | Float32Array<ArrayBuffer> | Float32Array<ArrayBuffer>[])[] | null;
|
|
6
|
+
export namespace FontFlags {
|
|
7
|
+
let FixedPitch: number;
|
|
8
|
+
let Serif: number;
|
|
9
|
+
let Symbolic: number;
|
|
10
|
+
let Script: number;
|
|
11
|
+
let Nonsymbolic: number;
|
|
12
|
+
let Italic: number;
|
|
13
|
+
let AllCap: number;
|
|
14
|
+
let SmallCap: number;
|
|
15
|
+
let ForceBold: number;
|
|
16
|
+
}
|
|
17
|
+
export const getVerticalPresentationForm: () => any;
|
|
18
|
+
export const MacStandardGlyphOrdering: string[];
|
|
19
|
+
export function normalizeFontName(name: any): any;
|
|
20
|
+
export function recoverGlyphName(name: any, glyphsUnicodeMap: any): any;
|
|
21
|
+
export const SEAC_ANALYSIS_ENABLED: true;
|
|
22
|
+
/**
|
|
23
|
+
* Shared logic for building a char code to glyph id mapping for Type1 and
|
|
24
|
+
* simple CFF fonts. See section 9.6.6.2 of the spec.
|
|
25
|
+
* @param {Object} properties Font properties object.
|
|
26
|
+
* @param {Object} builtInEncoding The encoding contained within the actual font
|
|
27
|
+
* data.
|
|
28
|
+
* @param {Array} glyphNames Array of glyph names where the index is the
|
|
29
|
+
* glyph ID.
|
|
30
|
+
* @returns {Object} A char code to glyph ID map.
|
|
31
|
+
*/
|
|
32
|
+
export function type1FontGlyphMapping(properties: Object, builtInEncoding: Object, glyphNames: any[]): Object;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GlyfTable object represents a glyf table containing glyph information:
|
|
3
|
+
* - glyph header (xMin, yMin, xMax, yMax);
|
|
4
|
+
* - contours if any;
|
|
5
|
+
* - components if the glyph is a composite.
|
|
6
|
+
*
|
|
7
|
+
* It's possible to re-scale each glyph in order to have a new font which
|
|
8
|
+
* exactly fits an other one: the goal is to be able to build some substitution
|
|
9
|
+
* font for well-known fonts (Myriad, Arial, ...).
|
|
10
|
+
*
|
|
11
|
+
* A full description of glyf table can be found here
|
|
12
|
+
* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6glyf.html
|
|
13
|
+
*/
|
|
14
|
+
export class GlyfTable {
|
|
15
|
+
constructor({ glyfTable, isGlyphLocationsLong, locaTable, numGlyphs }: {
|
|
16
|
+
glyfTable: any;
|
|
17
|
+
isGlyphLocationsLong: any;
|
|
18
|
+
locaTable: any;
|
|
19
|
+
numGlyphs: any;
|
|
20
|
+
});
|
|
21
|
+
glyphs: Glyph[];
|
|
22
|
+
getSize(): any;
|
|
23
|
+
write(): {
|
|
24
|
+
isLocationLong: boolean;
|
|
25
|
+
loca: Uint8Array<ArrayBuffer>;
|
|
26
|
+
glyf: Uint8Array<ArrayBuffer>;
|
|
27
|
+
};
|
|
28
|
+
scale(factors: any): void;
|
|
29
|
+
}
|
|
30
|
+
declare class Glyph {
|
|
31
|
+
static parse(pos: any, glyf: any): Glyph;
|
|
32
|
+
constructor({ header, simple, composites }: {
|
|
33
|
+
header?: null | undefined;
|
|
34
|
+
simple?: null | undefined;
|
|
35
|
+
composites?: null | undefined;
|
|
36
|
+
});
|
|
37
|
+
header: any;
|
|
38
|
+
simple: any;
|
|
39
|
+
composites: any;
|
|
40
|
+
getSize(): any;
|
|
41
|
+
write(pos: any, buf: any): number;
|
|
42
|
+
scale(factor: any): void;
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export class CmykICCBasedCS extends IccColorSpace {
|
|
2
|
+
static "__#private@#iccUrl": any;
|
|
3
|
+
static setOptions({ iccUrl }: {
|
|
4
|
+
iccUrl: any;
|
|
5
|
+
}): void;
|
|
6
|
+
constructor();
|
|
7
|
+
}
|
|
8
|
+
export class IccColorSpace extends ColorSpace {
|
|
9
|
+
static "__#private@#useWasm": boolean;
|
|
10
|
+
static "__#private@#wasmUrl": null;
|
|
11
|
+
static "__#private@#finalizer": null;
|
|
12
|
+
static setOptions({ useWasm, useWorkerFetch, wasmUrl }: {
|
|
13
|
+
useWasm: any;
|
|
14
|
+
useWorkerFetch: any;
|
|
15
|
+
wasmUrl: any;
|
|
16
|
+
}): void;
|
|
17
|
+
static get isUsable(): any;
|
|
18
|
+
constructor(iccProfile: any, name: any, numComps: any);
|
|
19
|
+
getOutputLength(inputLength: any, alpha01: any): number;
|
|
20
|
+
#private;
|
|
21
|
+
}
|
|
22
|
+
import { ColorSpace } from "./colorspace.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const Jbig2Error_base: any;
|
|
2
|
+
export class Jbig2Error extends Jbig2Error_base {
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
constructor(msg: any);
|
|
5
|
+
}
|
|
6
|
+
export class Jbig2Image {
|
|
7
|
+
parseChunks(chunks: any): Uint8ClampedArray<ArrayBuffer> | undefined;
|
|
8
|
+
parse(data: any): Uint8ClampedArray<ArrayBuffer>;
|
|
9
|
+
width: any;
|
|
10
|
+
height: any;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* For JBIG2's we use a library to decode these images and
|
|
3
|
+
* the stream behaves like all the other DecodeStreams.
|
|
4
|
+
*/
|
|
5
|
+
export class Jbig2Stream extends DecodeStream {
|
|
6
|
+
constructor(stream: any, maybeLength: any, params: any);
|
|
7
|
+
stream: any;
|
|
8
|
+
dict: any;
|
|
9
|
+
maybeLength: any;
|
|
10
|
+
params: any;
|
|
11
|
+
get bytes(): any;
|
|
12
|
+
ensureBuffer(requested: any): void;
|
|
13
|
+
readBlock(): void;
|
|
14
|
+
decodeImage(bytes: any): Uint8Array<ArrayBuffer>;
|
|
15
|
+
get canAsyncDecodeImageFromBuffer(): any;
|
|
16
|
+
}
|
|
17
|
+
import { DecodeStream } from "./decode_stream.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* For JPEG's we use a library to decode these images and the stream behaves
|
|
3
|
+
* like all the other DecodeStreams.
|
|
4
|
+
*/
|
|
5
|
+
export class JpegStream extends DecodeStream {
|
|
6
|
+
static "__#private@#isImageDecoderSupported": any;
|
|
7
|
+
static get canUseImageDecoder(): any;
|
|
8
|
+
static setOptions({ isImageDecoderSupported }: {
|
|
9
|
+
isImageDecoderSupported?: boolean | undefined;
|
|
10
|
+
}): void;
|
|
11
|
+
constructor(stream: any, maybeLength: any, params: any);
|
|
12
|
+
stream: any;
|
|
13
|
+
dict: any;
|
|
14
|
+
maybeLength: any;
|
|
15
|
+
params: any;
|
|
16
|
+
get bytes(): any;
|
|
17
|
+
ensureBuffer(requested: any): void;
|
|
18
|
+
readBlock(): void;
|
|
19
|
+
get jpegOptions(): any;
|
|
20
|
+
decodeImage(bytes: any): Uint8Array<ArrayBuffer>;
|
|
21
|
+
get canAsyncDecodeImageFromBuffer(): any;
|
|
22
|
+
getTransferableImage(): Promise<VideoFrame | null>;
|
|
23
|
+
#private;
|
|
24
|
+
}
|
|
25
|
+
import { DecodeStream } from "./decode_stream.js";
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
declare const JpegError_base: any;
|
|
2
|
+
export class JpegError extends JpegError_base {
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
constructor(msg: any);
|
|
5
|
+
}
|
|
6
|
+
export class JpegImage {
|
|
7
|
+
static canUseImageDecoder(data: any, colorTransform?: number): {
|
|
8
|
+
exifStart: any;
|
|
9
|
+
exifEnd: any;
|
|
10
|
+
} | {
|
|
11
|
+
exifStart?: undefined;
|
|
12
|
+
exifEnd?: undefined;
|
|
13
|
+
} | null;
|
|
14
|
+
constructor({ decodeTransform, colorTransform }?: {
|
|
15
|
+
decodeTransform?: null | undefined;
|
|
16
|
+
colorTransform?: number | undefined;
|
|
17
|
+
});
|
|
18
|
+
_decodeTransform: any;
|
|
19
|
+
_colorTransform: number;
|
|
20
|
+
parse(data: any, { dnlScanLines }?: {
|
|
21
|
+
dnlScanLines?: null | undefined;
|
|
22
|
+
}): any;
|
|
23
|
+
width: any;
|
|
24
|
+
height: any;
|
|
25
|
+
jfif: {
|
|
26
|
+
version: {
|
|
27
|
+
major: any;
|
|
28
|
+
minor: any;
|
|
29
|
+
};
|
|
30
|
+
densityUnits: any;
|
|
31
|
+
xDensity: number;
|
|
32
|
+
yDensity: number;
|
|
33
|
+
thumbWidth: any;
|
|
34
|
+
thumbHeight: any;
|
|
35
|
+
thumbData: any;
|
|
36
|
+
} | null | undefined;
|
|
37
|
+
adobe: {
|
|
38
|
+
version: number;
|
|
39
|
+
flags0: number;
|
|
40
|
+
flags1: number;
|
|
41
|
+
transformCode: any;
|
|
42
|
+
} | null | undefined;
|
|
43
|
+
components: any[] | undefined;
|
|
44
|
+
numComponents: number | undefined;
|
|
45
|
+
_getLinearizedBlockData(width: any, height: any, isSourcePDF?: boolean): Uint8ClampedArray<ArrayBuffer>;
|
|
46
|
+
get _isColorConversionNeeded(): boolean;
|
|
47
|
+
_convertYccToRgb(data: any): any;
|
|
48
|
+
_convertYccToRgba(data: any, out: any): any;
|
|
49
|
+
_convertYcckToRgb(data: any): any;
|
|
50
|
+
_convertYcckToRgba(data: any): any;
|
|
51
|
+
_convertYcckToCmyk(data: any): any;
|
|
52
|
+
_convertCmykToRgb(data: any): any;
|
|
53
|
+
_convertCmykToRgba(data: any): any;
|
|
54
|
+
getData({ width, height, forceRGBA, forceRGB, isSourcePDF, }: {
|
|
55
|
+
width: any;
|
|
56
|
+
height: any;
|
|
57
|
+
forceRGBA?: boolean | undefined;
|
|
58
|
+
forceRGB?: boolean | undefined;
|
|
59
|
+
isSourcePDF?: boolean | undefined;
|
|
60
|
+
}): any;
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
declare const JpxError_base: any;
|
|
2
|
+
export class JpxError extends JpxError_base {
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
constructor(msg: any);
|
|
5
|
+
}
|
|
6
|
+
export class JpxImage {
|
|
7
|
+
static "__#private@#buffer": null;
|
|
8
|
+
static "__#private@#handler": null;
|
|
9
|
+
static "__#private@#modulePromise": null;
|
|
10
|
+
static "__#private@#useWasm": boolean;
|
|
11
|
+
static "__#private@#useWorkerFetch": boolean;
|
|
12
|
+
static "__#private@#wasmUrl": null;
|
|
13
|
+
static setOptions({ handler, useWasm, useWorkerFetch, wasmUrl }: {
|
|
14
|
+
handler: any;
|
|
15
|
+
useWasm: any;
|
|
16
|
+
useWorkerFetch: any;
|
|
17
|
+
wasmUrl: any;
|
|
18
|
+
}): void;
|
|
19
|
+
static "__#private@#getJsModule"(fallbackCallback: any): Promise<void>;
|
|
20
|
+
static "__#private@#instantiateWasm"(fallbackCallback: any, imports: any, successCallback: any): Promise<any>;
|
|
21
|
+
static decode(bytes: any, { numComponents, isIndexedColormap, smaskInData, reducePower, }?: {
|
|
22
|
+
numComponents?: number | undefined;
|
|
23
|
+
isIndexedColormap?: boolean | undefined;
|
|
24
|
+
smaskInData?: boolean | undefined;
|
|
25
|
+
reducePower?: number | undefined;
|
|
26
|
+
}): Promise<never>;
|
|
27
|
+
static cleanup(): void;
|
|
28
|
+
static parseImageProperties(stream: any): {
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
bitsPerComponent: number;
|
|
32
|
+
componentsCount: any;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* For JPEG 2000's we use a library to decode these images and
|
|
3
|
+
* the stream behaves like all the other DecodeStreams.
|
|
4
|
+
*/
|
|
5
|
+
export class JpxStream extends DecodeStream {
|
|
6
|
+
constructor(stream: any, maybeLength: any, params: any);
|
|
7
|
+
stream: any;
|
|
8
|
+
dict: any;
|
|
9
|
+
maybeLength: any;
|
|
10
|
+
params: any;
|
|
11
|
+
get bytes(): any;
|
|
12
|
+
ensureBuffer(requested: any): void;
|
|
13
|
+
readBlock(decoderOptions: any): void;
|
|
14
|
+
decodeImage(bytes: any, decoderOptions: any): Promise<Uint8Array<ArrayBuffer>>;
|
|
15
|
+
get canAsyncDecodeImageFromBuffer(): any;
|
|
16
|
+
}
|
|
17
|
+
import { DecodeStream } from "./decode_stream.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export class LZWStream extends DecodeStream {
|
|
2
|
+
constructor(str: any, maybeLength: any, earlyChange: any);
|
|
3
|
+
str: any;
|
|
4
|
+
dict: any;
|
|
5
|
+
cachedData: number;
|
|
6
|
+
bitsCached: number;
|
|
7
|
+
lzwState: {
|
|
8
|
+
earlyChange: any;
|
|
9
|
+
codeLength: number;
|
|
10
|
+
nextCode: number;
|
|
11
|
+
dictionaryValues: Uint8Array<ArrayBuffer>;
|
|
12
|
+
dictionaryLengths: Uint16Array<ArrayBuffer>;
|
|
13
|
+
dictionaryPrevCodes: Uint16Array<ArrayBuffer>;
|
|
14
|
+
currentSequence: Uint8Array<ArrayBuffer>;
|
|
15
|
+
currentSequenceLength: number;
|
|
16
|
+
};
|
|
17
|
+
readBits(n: any): number | null;
|
|
18
|
+
lastCode: any;
|
|
19
|
+
readBlock(): void;
|
|
20
|
+
}
|
|
21
|
+
import { DecodeStream } from "./decode_stream.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export class NameTree extends NameOrNumberTree {
|
|
2
|
+
constructor(root: any, xref: any);
|
|
3
|
+
}
|
|
4
|
+
export class NumberTree extends NameOrNumberTree {
|
|
5
|
+
constructor(root: any, xref: any);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A NameTree/NumberTree is like a Dict but has some advantageous properties,
|
|
9
|
+
* see the specification (7.9.6 and 7.9.7) for additional details.
|
|
10
|
+
* TODO: implement all the Dict functions and make this more efficient.
|
|
11
|
+
*/
|
|
12
|
+
declare class NameOrNumberTree {
|
|
13
|
+
constructor(root: any, xref: any, type: any);
|
|
14
|
+
root: any;
|
|
15
|
+
xref: any;
|
|
16
|
+
_type: any;
|
|
17
|
+
getAll(): Map<any, any>;
|
|
18
|
+
getRaw(key: any): any;
|
|
19
|
+
get(key: any): any;
|
|
20
|
+
}
|
|
21
|
+
export {};
|