-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathscribeDocDefaults.js
More file actions
146 lines (108 loc) · 4.31 KB
/
Copy pathscribeDocDefaults.js
File metadata and controls
146 lines (108 loc) · 4.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
export const scribeDocDefaults = {
/** @type {('color'|'gray'|'binary')} */
colorMode: 'color',
autoRotate: true,
confThreshHigh: 85,
confThreshMed: 75,
ligatures: false,
kerning: true,
enableUpscale: false,
ignorePunct: false,
ignoreCap: false,
saveDebugImages: false,
/**
* Keep the raw OCR data (e.g. AWS Textract JSON) in the document's internal data.
* Increases memory usage; only enable for debugging.
*/
keepRawData: false,
/** Generate debug visualizations when running OCR. */
debugVis: false,
/**
* Print recognition runtime for each page to console.
* Set to `true` to print every page.
* Set to a number of seconds to print only pages whose recognition time exceeds that threshold.
* @type {boolean | number}
*/
printRecognitionTime: false,
/** @type {'width' | 'sentence'} */
docxLineSplitMode: 'width',
/**
* How to use PDF text data extracted from input PDFs (if any).
* `native` controls visible text rendered by the PDF viewer; `ocr` controls invisible
* text printed over an image. `main: true` uses the data as the primary source.
* `supp: true` uses it as a supplemental source.
*/
usePDFText: {
native: { supp: true, main: true },
ocr: { supp: true, main: false },
},
/**
* Always convert and retain existing PDF text data, even when `usePDFText` would
* otherwise discard it. Disables a perf/memory optimization.
* Enable when input PDFs have corrupted text you still want to retain.
*/
keepPDFTextAlways: false,
/**
* Skip font loading and optimization during `importFiles`.
* For callers that only need raw OCR text/confidence and never render or export glyphs.
*/
skipFontOpt: false,
/**
* Which pages to run OCR on, from the import-time per-page content analysis.
* `'all'` (default) OCRs every page. `'none'` skips OCR entirely.
* `'autoShallow'` leaves text-native pages alone and OCRs only image-based content
* (scanned sections, broken-encoding pages, and existing-OCR pages unless `usePDFText.ocr.main` trusts the existing layer).
* `'autoDeep'` (alias `'auto'`) additionally OCRs any page that may hold baked-in text (a sizeable image, image-borne text, or path-rendered text).
* A per-call `recognize`/`extractText` override may also pass a boolean array to select pages explicitly.
* Image inputs always OCR every page.
* @type {('all'|'auto'|'autoShallow'|'autoDeep'|'none')}
*/
ocrPages: 'all',
/** @type {('invis'|'ebook'|'eval'|'proof'|'annot')} */
displayMode: 'invis',
overlayOpacity: 80,
addOverlay: true,
standardizePageSize: false,
humanReadablePDF: false,
reflow: true,
lineNumbers: false,
removeMargins: false,
includeImages: false,
/**
* When adding an invisible text overlay to a page with existing text contents,
* convert the existing text contents to paths to prevent a duplicative text layer.
*/
convertDupSourceTextToPaths: false,
/**
* Embed fonts inline (base64 `data:` URIs) in HTML exports instead of referencing the jsDelivr CDN.
*/
embedFonts: false,
enableLayout: false,
xlsxFilenameColumn: true,
xlsxPageNumberColumn: true,
compressScribe: true,
/**
* Include extra text data in `.scribe`/`.scribe.json` exports.
* Adds `text` fields at the line/paragraph/page level.
*/
includeExtraTextScribe: false,
/**
* Include per-character bounding boxes (`word.chars`) in `.scribe` exports..
*/
includeCharBoxesScribe: true,
/**
* Allow compressed `.scribe` exports above `scribeSegmentThreshold` to use the segmented layout (a header line plus one JSON record per page) instead of a single JSON document.
* Off by default because the standard interchange form is a single JSON document at every size, which any JSON tooling can read.
*/
scribeSegments: false,
/**
* Character count above which a compressed `.scribe` export with `scribeSegments` set switches to the segmented layout.
* The default leaves headroom under the JavaScript string limit a single-JSON reader has to fit the whole payload into.
*/
scribeSegmentThreshold: 400_000_000,
/**
* Include the application `session` block (text-edit records, native-text metadata) in `.scribe` exports.
* Opt-in because the standard interchange format carries no app-only data.
*/
scribeSession: false,
};