@docmentis/udoc-viewer 0.6.17 → 0.6.19
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 +70 -5
- package/dist/package.json +1 -1
- package/dist/src/UDocClient.js +1 -1
- package/dist/src/UDocViewer.d.ts +27 -3
- package/dist/src/UDocViewer.d.ts.map +1 -1
- package/dist/src/UDocViewer.js +68 -8
- package/dist/src/UDocViewer.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/performance/PerformanceCounter.d.ts +1 -1
- package/dist/src/performance/PerformanceCounter.d.ts.map +1 -1
- package/dist/src/performance/PerformanceCounter.js.map +1 -1
- package/dist/src/ui/viewer/actions.d.ts +5 -2
- package/dist/src/ui/viewer/actions.d.ts.map +1 -1
- package/dist/src/ui/viewer/components/SearchPanel.d.ts.map +1 -1
- package/dist/src/ui/viewer/components/SearchPanel.js +5 -7
- package/dist/src/ui/viewer/components/SearchPanel.js.map +1 -1
- package/dist/src/ui/viewer/components/Spread.d.ts +2 -2
- package/dist/src/ui/viewer/components/Spread.d.ts.map +1 -1
- package/dist/src/ui/viewer/components/Spread.js +9 -11
- package/dist/src/ui/viewer/components/Spread.js.map +1 -1
- package/dist/src/ui/viewer/effects.d.ts.map +1 -1
- package/dist/src/ui/viewer/effects.js +14 -33
- package/dist/src/ui/viewer/effects.js.map +1 -1
- package/dist/src/ui/viewer/reducer.d.ts.map +1 -1
- package/dist/src/ui/viewer/reducer.js +8 -1
- package/dist/src/ui/viewer/reducer.js.map +1 -1
- package/dist/src/ui/viewer/search/search.d.ts +5 -4
- package/dist/src/ui/viewer/search/search.d.ts.map +1 -1
- package/dist/src/ui/viewer/search/search.js +150 -22
- package/dist/src/ui/viewer/search/search.js.map +1 -1
- package/dist/src/ui/viewer/shell.d.ts +3 -3
- package/dist/src/ui/viewer/shell.d.ts.map +1 -1
- package/dist/src/ui/viewer/shell.js +16 -0
- package/dist/src/ui/viewer/shell.js.map +1 -1
- package/dist/src/ui/viewer/state.d.ts +3 -3
- package/dist/src/ui/viewer/state.d.ts.map +1 -1
- package/dist/src/ui/viewer/styles-inline.d.ts +1 -1
- package/dist/src/ui/viewer/styles-inline.d.ts.map +1 -1
- package/dist/src/ui/viewer/styles-inline.js +21 -9
- package/dist/src/ui/viewer/styles-inline.js.map +1 -1
- package/dist/src/ui/viewer/text/index.d.ts +0 -1
- package/dist/src/ui/viewer/text/index.d.ts.map +1 -1
- package/dist/src/ui/viewer/text/index.js +3 -0
- package/dist/src/ui/viewer/text/index.js.map +1 -1
- package/dist/src/ui/viewer/text/render.d.ts +11 -14
- package/dist/src/ui/viewer/text/render.d.ts.map +1 -1
- package/dist/src/ui/viewer/text/render.js +403 -126
- package/dist/src/ui/viewer/text/render.js.map +1 -1
- package/dist/src/ui/viewer/text/selection.js +1 -1
- package/dist/src/ui/viewer/text/selection.js.map +1 -1
- package/dist/src/ui/viewer/transition.js +249 -36
- package/dist/src/ui/viewer/transition.js.map +1 -1
- package/dist/src/wasm/udoc.d.ts +161 -24
- package/dist/src/wasm/udoc.js +67 -75
- package/dist/src/wasm/udoc_bg.wasm +0 -0
- package/dist/src/wasm/udoc_bg.wasm.d.ts +5 -5
- package/dist/src/worker/WorkerClient.d.ts +2 -6
- package/dist/src/worker/WorkerClient.d.ts.map +1 -1
- package/dist/src/worker/WorkerClient.js +25 -17
- package/dist/src/worker/WorkerClient.js.map +1 -1
- package/dist/src/worker/worker-inline.js +1 -1
- package/dist/src/worker/worker.d.ts +4 -15
- package/dist/src/worker/worker.d.ts.map +1 -1
- package/dist/src/worker/worker.js +69 -84
- package/dist/src/worker/worker.js.map +1 -1
- package/package.json +1 -1
- package/dist/src/ui/viewer/text/types.d.ts +0 -37
- package/dist/src/ui/viewer/text/types.d.ts.map +0 -1
- package/dist/src/ui/viewer/text/types.js +0 -7
- package/dist/src/ui/viewer/text/types.js.map +0 -1
package/dist/src/wasm/udoc.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
export type JsViewerLayoutMode = "single-page" | "double-page-odd-right" | "double-page-odd-left";
|
|
4
|
+
|
|
5
|
+
export type JsViewerScrollMode = "spread" | "continuous";
|
|
6
|
+
|
|
7
|
+
export interface JsViewerPreferences {
|
|
8
|
+
layoutMode?: JsViewerLayoutMode;
|
|
9
|
+
scrollMode?: JsViewerScrollMode;
|
|
10
|
+
}
|
|
11
|
+
|
|
3
12
|
|
|
4
13
|
export type Orientation = "horizontal" | "vertical";
|
|
5
14
|
export type SideDirection = "left" | "right" | "up" | "down";
|
|
@@ -96,6 +105,133 @@ export interface FontUsageEntry {
|
|
|
96
105
|
}
|
|
97
106
|
|
|
98
107
|
|
|
108
|
+
export interface JsLayoutTable {
|
|
109
|
+
width: number;
|
|
110
|
+
height: number;
|
|
111
|
+
columns: JsLayoutTableColumn[];
|
|
112
|
+
rows: JsLayoutTableRow[];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface JsLayoutTableColumn {
|
|
116
|
+
x: number;
|
|
117
|
+
width: number;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface JsLayoutTableRow {
|
|
121
|
+
y: number;
|
|
122
|
+
height: number;
|
|
123
|
+
cells: JsLayoutTableCell[];
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface JsLayoutLine {
|
|
127
|
+
y: number;
|
|
128
|
+
width: number;
|
|
129
|
+
height: number;
|
|
130
|
+
spaceBefore: number;
|
|
131
|
+
spaceAfter: number;
|
|
132
|
+
isFirstLineOfPara: boolean;
|
|
133
|
+
isLastLineOfPara: boolean;
|
|
134
|
+
content: JsLayoutLineContent;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export type JsLayoutLineContent = ({ type: "runList" } & JsLayoutRunList) | ({ type: "table" } & JsLayoutTable);
|
|
138
|
+
|
|
139
|
+
export interface JsLayoutRunList {
|
|
140
|
+
baseline: number;
|
|
141
|
+
width: number;
|
|
142
|
+
height: number;
|
|
143
|
+
runs: JsLayoutRun[];
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export interface JsLayoutGrid {
|
|
147
|
+
x: number;
|
|
148
|
+
y: number;
|
|
149
|
+
width: number;
|
|
150
|
+
height: number;
|
|
151
|
+
scale: number;
|
|
152
|
+
columns: JsLayoutGridColumn[];
|
|
153
|
+
rows: JsLayoutGridRow[];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface JsLayoutParcel {
|
|
157
|
+
x: number;
|
|
158
|
+
y: number;
|
|
159
|
+
width: number;
|
|
160
|
+
height: number;
|
|
161
|
+
lines: JsLayoutLine[];
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export type JsLayoutRunContent = { type: "glyphs"; text: string; fontSize: number; ascent: number; descent: number; glyphs: JsLayoutGlyph[] } | { type: "space"; advance: number; fontSize: number; ascent: number; descent: number } | { type: "tab"; advance: number; fontSize: number; ascent: number; descent: number } | { type: "paragraphEnd"; advance: number } | { type: "break" } | { type: "inlineDrawing"; width: number; height: number };
|
|
165
|
+
|
|
166
|
+
export interface JsLayoutPage {
|
|
167
|
+
width: number;
|
|
168
|
+
height: number;
|
|
169
|
+
frames: JsLayoutFrame[];
|
|
170
|
+
grid?: JsLayoutGrid;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export interface JsLayoutGridColumn {
|
|
174
|
+
x: number;
|
|
175
|
+
width: number;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export interface JsLayoutGlyph {
|
|
179
|
+
x: number;
|
|
180
|
+
y: number;
|
|
181
|
+
advance: number;
|
|
182
|
+
/**
|
|
183
|
+
* Byte offset of this glyph\'s source character relative to the parent run\'s text.
|
|
184
|
+
*/
|
|
185
|
+
offset: number;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface JsTransform {
|
|
189
|
+
scaleX: number;
|
|
190
|
+
skewY: number;
|
|
191
|
+
skewX: number;
|
|
192
|
+
scaleY: number;
|
|
193
|
+
translateX: number;
|
|
194
|
+
translateY: number;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export interface JsLayoutRun {
|
|
198
|
+
x: number;
|
|
199
|
+
width: number;
|
|
200
|
+
transform: JsTransform;
|
|
201
|
+
content: JsLayoutRunContent;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export interface JsLayoutGridCell {
|
|
205
|
+
colIndex: number;
|
|
206
|
+
x: number;
|
|
207
|
+
y: number;
|
|
208
|
+
width: number;
|
|
209
|
+
height: number;
|
|
210
|
+
parcel?: JsLayoutParcel;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export interface JsLayoutFrame {
|
|
214
|
+
transform: JsTransform;
|
|
215
|
+
parcel?: JsLayoutParcel;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export interface JsLayoutTableCell {
|
|
219
|
+
colIndex: number;
|
|
220
|
+
colSpan: number;
|
|
221
|
+
rowSpan: number;
|
|
222
|
+
x: number;
|
|
223
|
+
y: number;
|
|
224
|
+
width: number;
|
|
225
|
+
height: number;
|
|
226
|
+
parcel?: JsLayoutParcel;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export interface JsLayoutGridRow {
|
|
230
|
+
y: number;
|
|
231
|
+
height: number;
|
|
232
|
+
cells: JsLayoutGridCell[];
|
|
233
|
+
}
|
|
234
|
+
|
|
99
235
|
|
|
100
236
|
export class Wasm {
|
|
101
237
|
free(): void;
|
|
@@ -132,15 +268,6 @@ export class Wasm {
|
|
|
132
268
|
* Check if a feature is enabled by the current license.
|
|
133
269
|
*/
|
|
134
270
|
has_feature(feature: string): boolean;
|
|
135
|
-
/**
|
|
136
|
-
* Get the preferred page layout for two-page viewing modes.
|
|
137
|
-
*
|
|
138
|
-
* Returns one of:
|
|
139
|
-
* - `"default"` - Viewer decides based on document type
|
|
140
|
-
* - `"odd-pages-right"` - Odd pages on right (page 1 alone, then 2|3, 4|5...)
|
|
141
|
-
* - `"odd-pages-left"` - Odd pages on left (1|2, 3|4, 5|6...)
|
|
142
|
-
*/
|
|
143
|
-
page_layout(id: string): string;
|
|
144
271
|
/**
|
|
145
272
|
* Compose new PDF documents by cherry-picking pages from source documents.
|
|
146
273
|
*
|
|
@@ -220,16 +347,6 @@ export class Wasm {
|
|
|
220
347
|
* More efficient than calling `page_info` for each page.
|
|
221
348
|
*/
|
|
222
349
|
all_page_info(id: string): PageInfo[];
|
|
223
|
-
/**
|
|
224
|
-
* Get text content for a specific page (for text selection).
|
|
225
|
-
*
|
|
226
|
-
* Returns an array of text runs, each containing:
|
|
227
|
-
* - `text`: Unicode text string
|
|
228
|
-
* - `glyphs`: Positioned glyphs with character mappings
|
|
229
|
-
* - `fontSize`: Font size in points
|
|
230
|
-
* - `transform`: Combined transform matrix
|
|
231
|
-
*/
|
|
232
|
-
get_page_text(id: string, page_index: number): any;
|
|
233
350
|
/**
|
|
234
351
|
* Get font usage information for a document.
|
|
235
352
|
*
|
|
@@ -305,6 +422,18 @@ export class Wasm {
|
|
|
305
422
|
* Returns one of: "pdf", "docx", "pptx", "xlsx", "image".
|
|
306
423
|
*/
|
|
307
424
|
document_format(id: string): string;
|
|
425
|
+
/**
|
|
426
|
+
* Get the layout model for a specific page.
|
|
427
|
+
*
|
|
428
|
+
* Returns the hierarchical layout structure (frames, parcels, lines, runs,
|
|
429
|
+
* glyphs, tables, grids) without building the full display list. This is
|
|
430
|
+
* more efficient than `get_page_text` for text selection/search and
|
|
431
|
+
* preserves semantic structure (paragraphs, tables, etc.).
|
|
432
|
+
*
|
|
433
|
+
* All coordinates are in points (1/72 inch). The viewer should scale by
|
|
434
|
+
* `canvasWidth / layoutPage.width` to convert to pixels.
|
|
435
|
+
*/
|
|
436
|
+
get_layout_page(id: string, page_index: number): JsLayoutPage;
|
|
308
437
|
/**
|
|
309
438
|
* Remove a document by ID.
|
|
310
439
|
*
|
|
@@ -385,6 +514,14 @@ export class Wasm {
|
|
|
385
514
|
* PNG-encoded image data as a byte array.
|
|
386
515
|
*/
|
|
387
516
|
render_page_to_png(id: string, page_index: number, width: number, height: number): Uint8Array;
|
|
517
|
+
/**
|
|
518
|
+
* Get viewer preferences embedded in the document.
|
|
519
|
+
*
|
|
520
|
+
* Returns a `JsViewerPreferences` with optional fields:
|
|
521
|
+
* - `layoutMode`: `"single-page"` | `"double-page-odd-right"` | `"double-page-odd-left"`
|
|
522
|
+
* - `scrollMode`: `"spread"` | `"continuous"`
|
|
523
|
+
*/
|
|
524
|
+
viewer_preferences(id: string): JsViewerPreferences;
|
|
388
525
|
/**
|
|
389
526
|
* Enable Google Fonts.
|
|
390
527
|
*
|
|
@@ -611,10 +748,10 @@ export interface InitOutput {
|
|
|
611
748
|
readonly wasm_get_all_annotations: (a: number, b: number, c: number, d: number) => void;
|
|
612
749
|
readonly wasm_get_bytes: (a: number, b: number, c: number, d: number) => void;
|
|
613
750
|
readonly wasm_get_font_usage: (a: number, b: number, c: number, d: number) => void;
|
|
751
|
+
readonly wasm_get_layout_page: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
614
752
|
readonly wasm_get_limit: (a: number, b: number, c: number, d: bigint) => bigint;
|
|
615
753
|
readonly wasm_get_outline: (a: number, b: number, c: number, d: number) => void;
|
|
616
754
|
readonly wasm_get_page_annotations: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
617
|
-
readonly wasm_get_page_text: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
618
755
|
readonly wasm_get_visibility_groups: (a: number, b: number, c: number, d: number) => void;
|
|
619
756
|
readonly wasm_has_document: (a: number, b: number, c: number) => number;
|
|
620
757
|
readonly wasm_has_feature: (a: number, b: number, c: number) => number;
|
|
@@ -631,7 +768,6 @@ export interface InitOutput {
|
|
|
631
768
|
readonly wasm_new: (a: number, b: number, c: number, d: number) => number;
|
|
632
769
|
readonly wasm_page_count: (a: number, b: number, c: number, d: number) => void;
|
|
633
770
|
readonly wasm_page_info: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
634
|
-
readonly wasm_page_layout: (a: number, b: number, c: number, d: number) => void;
|
|
635
771
|
readonly wasm_pdf_compose: (a: number, b: number, c: number, d: number) => void;
|
|
636
772
|
readonly wasm_pdf_compress: (a: number, b: number, c: number, d: number) => void;
|
|
637
773
|
readonly wasm_pdf_decompress: (a: number, b: number, c: number, d: number) => void;
|
|
@@ -646,9 +782,10 @@ export interface InitOutput {
|
|
|
646
782
|
readonly wasm_set_license: (a: number, b: number, c: number, d: number) => void;
|
|
647
783
|
readonly wasm_set_visibility_group_visible: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
648
784
|
readonly wasm_setup_telemetry: (a: number, b: number, c: number) => void;
|
|
649
|
-
readonly
|
|
650
|
-
readonly
|
|
651
|
-
readonly
|
|
785
|
+
readonly wasm_viewer_preferences: (a: number, b: number, c: number, d: number) => void;
|
|
786
|
+
readonly __wasm_bindgen_func_elem_2698: (a: number, b: number, c: number) => void;
|
|
787
|
+
readonly __wasm_bindgen_func_elem_2682: (a: number, b: number) => void;
|
|
788
|
+
readonly __wasm_bindgen_func_elem_16896: (a: number, b: number, c: number, d: number) => void;
|
|
652
789
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
653
790
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
654
791
|
readonly __wbindgen_export3: (a: number) => void;
|
package/dist/src/wasm/udoc.js
CHANGED
|
@@ -259,12 +259,12 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
259
259
|
|
|
260
260
|
let WASM_VECTOR_LEN = 0;
|
|
261
261
|
|
|
262
|
-
function
|
|
263
|
-
wasm.
|
|
262
|
+
function __wasm_bindgen_func_elem_2698(arg0, arg1, arg2) {
|
|
263
|
+
wasm.__wasm_bindgen_func_elem_2698(arg0, arg1, addHeapObject(arg2));
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
-
function
|
|
267
|
-
wasm.
|
|
266
|
+
function __wasm_bindgen_func_elem_16896(arg0, arg1, arg2, arg3) {
|
|
267
|
+
wasm.__wasm_bindgen_func_elem_16896(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
const __wbindgen_enum_GpuBufferBindingType = ["uniform", "storage", "read-only-storage"];
|
|
@@ -409,42 +409,6 @@ export class Wasm {
|
|
|
409
409
|
const ret = wasm.wasm_has_feature(this.__wbg_ptr, ptr0, len0);
|
|
410
410
|
return ret !== 0;
|
|
411
411
|
}
|
|
412
|
-
/**
|
|
413
|
-
* Get the preferred page layout for two-page viewing modes.
|
|
414
|
-
*
|
|
415
|
-
* Returns one of:
|
|
416
|
-
* - `"default"` - Viewer decides based on document type
|
|
417
|
-
* - `"odd-pages-right"` - Odd pages on right (page 1 alone, then 2|3, 4|5...)
|
|
418
|
-
* - `"odd-pages-left"` - Odd pages on left (1|2, 3|4, 5|6...)
|
|
419
|
-
* @param {string} id
|
|
420
|
-
* @returns {string}
|
|
421
|
-
*/
|
|
422
|
-
page_layout(id) {
|
|
423
|
-
let deferred3_0;
|
|
424
|
-
let deferred3_1;
|
|
425
|
-
try {
|
|
426
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
427
|
-
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
428
|
-
const len0 = WASM_VECTOR_LEN;
|
|
429
|
-
wasm.wasm_page_layout(retptr, this.__wbg_ptr, ptr0, len0);
|
|
430
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
431
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
432
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
433
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
434
|
-
var ptr2 = r0;
|
|
435
|
-
var len2 = r1;
|
|
436
|
-
if (r3) {
|
|
437
|
-
ptr2 = 0; len2 = 0;
|
|
438
|
-
throw takeObject(r2);
|
|
439
|
-
}
|
|
440
|
-
deferred3_0 = ptr2;
|
|
441
|
-
deferred3_1 = len2;
|
|
442
|
-
return getStringFromWasm0(ptr2, len2);
|
|
443
|
-
} finally {
|
|
444
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
445
|
-
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
412
|
/**
|
|
449
413
|
* Compose new PDF documents by cherry-picking pages from source documents.
|
|
450
414
|
*
|
|
@@ -639,35 +603,6 @@ export class Wasm {
|
|
|
639
603
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
640
604
|
}
|
|
641
605
|
}
|
|
642
|
-
/**
|
|
643
|
-
* Get text content for a specific page (for text selection).
|
|
644
|
-
*
|
|
645
|
-
* Returns an array of text runs, each containing:
|
|
646
|
-
* - `text`: Unicode text string
|
|
647
|
-
* - `glyphs`: Positioned glyphs with character mappings
|
|
648
|
-
* - `fontSize`: Font size in points
|
|
649
|
-
* - `transform`: Combined transform matrix
|
|
650
|
-
* @param {string} id
|
|
651
|
-
* @param {number} page_index
|
|
652
|
-
* @returns {any}
|
|
653
|
-
*/
|
|
654
|
-
get_page_text(id, page_index) {
|
|
655
|
-
try {
|
|
656
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
657
|
-
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
658
|
-
const len0 = WASM_VECTOR_LEN;
|
|
659
|
-
wasm.wasm_get_page_text(retptr, this.__wbg_ptr, ptr0, len0, page_index);
|
|
660
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
661
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
662
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
663
|
-
if (r2) {
|
|
664
|
-
throw takeObject(r1);
|
|
665
|
-
}
|
|
666
|
-
return takeObject(r0);
|
|
667
|
-
} finally {
|
|
668
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
606
|
/**
|
|
672
607
|
* Get the number of documents currently loaded.
|
|
673
608
|
* @returns {number}
|
|
@@ -863,6 +798,37 @@ export class Wasm {
|
|
|
863
798
|
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
864
799
|
}
|
|
865
800
|
}
|
|
801
|
+
/**
|
|
802
|
+
* Get the layout model for a specific page.
|
|
803
|
+
*
|
|
804
|
+
* Returns the hierarchical layout structure (frames, parcels, lines, runs,
|
|
805
|
+
* glyphs, tables, grids) without building the full display list. This is
|
|
806
|
+
* more efficient than `get_page_text` for text selection/search and
|
|
807
|
+
* preserves semantic structure (paragraphs, tables, etc.).
|
|
808
|
+
*
|
|
809
|
+
* All coordinates are in points (1/72 inch). The viewer should scale by
|
|
810
|
+
* `canvasWidth / layoutPage.width` to convert to pixels.
|
|
811
|
+
* @param {string} id
|
|
812
|
+
* @param {number} page_index
|
|
813
|
+
* @returns {JsLayoutPage}
|
|
814
|
+
*/
|
|
815
|
+
get_layout_page(id, page_index) {
|
|
816
|
+
try {
|
|
817
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
818
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
819
|
+
const len0 = WASM_VECTOR_LEN;
|
|
820
|
+
wasm.wasm_get_layout_page(retptr, this.__wbg_ptr, ptr0, len0, page_index);
|
|
821
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
822
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
823
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
824
|
+
if (r2) {
|
|
825
|
+
throw takeObject(r1);
|
|
826
|
+
}
|
|
827
|
+
return takeObject(r0);
|
|
828
|
+
} finally {
|
|
829
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
830
|
+
}
|
|
831
|
+
}
|
|
866
832
|
/**
|
|
867
833
|
* Remove a document by ID.
|
|
868
834
|
*
|
|
@@ -1030,6 +996,32 @@ export class Wasm {
|
|
|
1030
996
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1031
997
|
}
|
|
1032
998
|
}
|
|
999
|
+
/**
|
|
1000
|
+
* Get viewer preferences embedded in the document.
|
|
1001
|
+
*
|
|
1002
|
+
* Returns a `JsViewerPreferences` with optional fields:
|
|
1003
|
+
* - `layoutMode`: `"single-page"` | `"double-page-odd-right"` | `"double-page-odd-left"`
|
|
1004
|
+
* - `scrollMode`: `"spread"` | `"continuous"`
|
|
1005
|
+
* @param {string} id
|
|
1006
|
+
* @returns {JsViewerPreferences}
|
|
1007
|
+
*/
|
|
1008
|
+
viewer_preferences(id) {
|
|
1009
|
+
try {
|
|
1010
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1011
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1012
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1013
|
+
wasm.wasm_viewer_preferences(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1014
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1015
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1016
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1017
|
+
if (r2) {
|
|
1018
|
+
throw takeObject(r1);
|
|
1019
|
+
}
|
|
1020
|
+
return takeObject(r0);
|
|
1021
|
+
} finally {
|
|
1022
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1033
1025
|
/**
|
|
1034
1026
|
* Enable Google Fonts.
|
|
1035
1027
|
*
|
|
@@ -1998,7 +1990,7 @@ function __wbg_get_imports() {
|
|
|
1998
1990
|
const a = state0.a;
|
|
1999
1991
|
state0.a = 0;
|
|
2000
1992
|
try {
|
|
2001
|
-
return
|
|
1993
|
+
return __wasm_bindgen_func_elem_16896(a, state0.b, arg0, arg1);
|
|
2002
1994
|
} finally {
|
|
2003
1995
|
state0.a = a;
|
|
2004
1996
|
}
|
|
@@ -2478,16 +2470,16 @@ function __wbg_get_imports() {
|
|
|
2478
2470
|
const ret = arg0;
|
|
2479
2471
|
return addHeapObject(ret);
|
|
2480
2472
|
};
|
|
2481
|
-
imports.wbg.__wbindgen_cast_9d97beea3493d3db = function(arg0, arg1) {
|
|
2482
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 212, function: Function { arguments: [Externref], shim_idx: 213, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2483
|
-
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_2618, __wasm_bindgen_func_elem_2634);
|
|
2484
|
-
return addHeapObject(ret);
|
|
2485
|
-
};
|
|
2486
2473
|
imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
|
|
2487
2474
|
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
2488
2475
|
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
2489
2476
|
return addHeapObject(ret);
|
|
2490
2477
|
};
|
|
2478
|
+
imports.wbg.__wbindgen_cast_d5be308fce034eae = function(arg0, arg1) {
|
|
2479
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 210, function: Function { arguments: [Externref], shim_idx: 211, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2480
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_2682, __wasm_bindgen_func_elem_2698);
|
|
2481
|
+
return addHeapObject(ret);
|
|
2482
|
+
};
|
|
2491
2483
|
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
2492
2484
|
// Cast intrinsic for `F64 -> Externref`.
|
|
2493
2485
|
const ret = arg0;
|
|
Binary file
|
|
@@ -13,10 +13,10 @@ export const wasm_enableGoogleFonts: (a: number) => void;
|
|
|
13
13
|
export const wasm_get_all_annotations: (a: number, b: number, c: number, d: number) => void;
|
|
14
14
|
export const wasm_get_bytes: (a: number, b: number, c: number, d: number) => void;
|
|
15
15
|
export const wasm_get_font_usage: (a: number, b: number, c: number, d: number) => void;
|
|
16
|
+
export const wasm_get_layout_page: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
16
17
|
export const wasm_get_limit: (a: number, b: number, c: number, d: bigint) => bigint;
|
|
17
18
|
export const wasm_get_outline: (a: number, b: number, c: number, d: number) => void;
|
|
18
19
|
export const wasm_get_page_annotations: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
19
|
-
export const wasm_get_page_text: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
20
20
|
export const wasm_get_visibility_groups: (a: number, b: number, c: number, d: number) => void;
|
|
21
21
|
export const wasm_has_document: (a: number, b: number, c: number) => number;
|
|
22
22
|
export const wasm_has_feature: (a: number, b: number, c: number) => number;
|
|
@@ -33,7 +33,6 @@ export const wasm_needs_password: (a: number, b: number, c: number, d: number) =
|
|
|
33
33
|
export const wasm_new: (a: number, b: number, c: number, d: number) => number;
|
|
34
34
|
export const wasm_page_count: (a: number, b: number, c: number, d: number) => void;
|
|
35
35
|
export const wasm_page_info: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
36
|
-
export const wasm_page_layout: (a: number, b: number, c: number, d: number) => void;
|
|
37
36
|
export const wasm_pdf_compose: (a: number, b: number, c: number, d: number) => void;
|
|
38
37
|
export const wasm_pdf_compress: (a: number, b: number, c: number, d: number) => void;
|
|
39
38
|
export const wasm_pdf_decompress: (a: number, b: number, c: number, d: number) => void;
|
|
@@ -48,9 +47,10 @@ export const wasm_render_page_to_rgba: (a: number, b: number, c: number, d: numb
|
|
|
48
47
|
export const wasm_set_license: (a: number, b: number, c: number, d: number) => void;
|
|
49
48
|
export const wasm_set_visibility_group_visible: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
50
49
|
export const wasm_setup_telemetry: (a: number, b: number, c: number) => void;
|
|
51
|
-
export const
|
|
52
|
-
export const
|
|
53
|
-
export const
|
|
50
|
+
export const wasm_viewer_preferences: (a: number, b: number, c: number, d: number) => void;
|
|
51
|
+
export const __wasm_bindgen_func_elem_2698: (a: number, b: number, c: number) => void;
|
|
52
|
+
export const __wasm_bindgen_func_elem_2682: (a: number, b: number) => void;
|
|
53
|
+
export const __wasm_bindgen_func_elem_16896: (a: number, b: number, c: number, d: number) => void;
|
|
54
54
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
55
55
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
56
56
|
export const __wbindgen_export3: (a: number) => void;
|
|
@@ -172,10 +172,6 @@ export declare class WorkerClient {
|
|
|
172
172
|
* Results are cached for subsequent calls.
|
|
173
173
|
*/
|
|
174
174
|
getAllPageInfo(documentId: string): Promise<PageInfo[]>;
|
|
175
|
-
/**
|
|
176
|
-
* Get the page layout preference.
|
|
177
|
-
*/
|
|
178
|
-
getPageLayout(documentId: string): Promise<string>;
|
|
179
175
|
/**
|
|
180
176
|
* Get the document outline.
|
|
181
177
|
*/
|
|
@@ -190,10 +186,10 @@ export declare class WorkerClient {
|
|
|
190
186
|
*/
|
|
191
187
|
getPageAnnotations(documentId: string, pageIndex: number): Promise<unknown[]>;
|
|
192
188
|
/**
|
|
193
|
-
* Get
|
|
189
|
+
* Get the layout model for a specific page (for text selection/search).
|
|
194
190
|
* Routed through the unified work queue so renders take priority.
|
|
195
191
|
*/
|
|
196
|
-
|
|
192
|
+
getLayoutPage(documentId: string, pageIndex: number): Promise<unknown>;
|
|
197
193
|
/**
|
|
198
194
|
* Request annotations via the unified work queue.
|
|
199
195
|
* Lower priority than renders — waits for pending renders to complete first.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkerClient.d.ts","sourceRoot":"","sources":["../../../src/worker/WorkerClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACR,WAAW,EACX,WAAW,EACX,aAAa,EACb,cAAc,EACd,SAAS,EACT,aAAa,EACb,cAAc,EACd,oBAAoB,EAGvB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EACR,WAAW,EACX,aAAa,EACb,eAAe,EACf,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,cAAc,EACjB,MAAM,iBAAiB,CAAC;AAIzB,YAAY,EACR,WAAW,EACX,WAAW,EACX,aAAa,EACb,cAAc,EACd,SAAS,EACT,cAAc,EACd,oBAAoB,GACvB,CAAC;AAEF,YAAY,EAAE,aAAa,EAAE,CAAC;AAG9B,YAAY,EACR,WAAW,EACX,aAAa,EACb,eAAe,EACf,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,cAAc,GACjB,CAAC;AAGF,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,cAAc,EAAE,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,QAAQ;IACrB,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,iCAAiC;IACjC,MAAM,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,QAAQ;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,CAAC;IAC7B,mCAAmC;IACnC,UAAU,CAAC,EAAE,cAAc,CAAC;CAC/B;AAMD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;AAE1D,MAAM,WAAW,aAAa;IAC1B,KAAK,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AAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAoBvD;;;OAGG;IACG,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAyB3E;;;OAGG;IACG,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAwB7D;;OAEG;IACG,
|
|
1
|
+
{"version":3,"file":"WorkerClient.d.ts","sourceRoot":"","sources":["../../../src/worker/WorkerClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACR,WAAW,EACX,WAAW,EACX,aAAa,EACb,cAAc,EACd,SAAS,EACT,aAAa,EACb,cAAc,EACd,oBAAoB,EAGvB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EACR,WAAW,EACX,aAAa,EACb,eAAe,EACf,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,cAAc,EACjB,MAAM,iBAAiB,CAAC;AAIzB,YAAY,EACR,WAAW,EACX,WAAW,EACX,aAAa,EACb,cAAc,EACd,SAAS,EACT,cAAc,EACd,oBAAoB,GACvB,CAAC;AAEF,YAAY,EAAE,aAAa,EAAE,CAAC;AAG9B,YAAY,EACR,WAAW,EACX,aAAa,EACb,eAAe,EACf,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,cAAc,GACjB,CAAC;AAGF,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,cAAc,EAAE,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,QAAQ;IACrB,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,iCAAiC;IACjC,MAAM,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,QAAQ;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MA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CAAK;IAE5C;;;;OAIG;IACH,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAkCnG;;;OAGG;IACG,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IA2C5D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAK;IAExC;;;;;;;;;OASG;IACH,OAAO,CAAC,SAAS;IA2DjB;;OAEG;IACH,sBAAsB,IAAI,IAAI;IA0B9B,OAAO,CAAC,gBAAgB;YAwCV,QAAQ;YA0DR,YAAY;YAoBZ,MAAM;IAoBpB,OAAO,CAAC,gBAAgB;IAexB,OAAO,CAAC,QAAQ;IAoBhB;;OAEG;IACH,SAAS,IAAI,IAAI;IASjB,OAAO,CAAC,IAAI;IAQZ,OAAO,CAAC,aAAa;IAgBrB,OAAO,CAAC,WAAW;CAGtB"}
|
|
@@ -302,13 +302,6 @@ export class WorkerClient {
|
|
|
302
302
|
throw error;
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
|
-
/**
|
|
306
|
-
* Get the page layout preference.
|
|
307
|
-
*/
|
|
308
|
-
async getPageLayout(documentId) {
|
|
309
|
-
const response = (await this.send({ type: "getPageLayout", documentId }));
|
|
310
|
-
return response.layout;
|
|
311
|
-
}
|
|
312
305
|
/**
|
|
313
306
|
* Get the document outline.
|
|
314
307
|
*/
|
|
@@ -331,8 +324,19 @@ export class WorkerClient {
|
|
|
331
324
|
* Get font usage information for a document.
|
|
332
325
|
*/
|
|
333
326
|
async getFontUsage(documentId) {
|
|
334
|
-
const
|
|
335
|
-
|
|
327
|
+
const counter = this.getCounter(documentId);
|
|
328
|
+
const eventId = counter?.markStart("getFontUsage");
|
|
329
|
+
try {
|
|
330
|
+
const response = (await this.send({ type: "getFontUsage", documentId }));
|
|
331
|
+
if (eventId)
|
|
332
|
+
counter?.markEnd(eventId);
|
|
333
|
+
return response.entries;
|
|
334
|
+
}
|
|
335
|
+
catch (error) {
|
|
336
|
+
if (eventId)
|
|
337
|
+
counter?.markEnd(eventId, false, error.message);
|
|
338
|
+
throw error;
|
|
339
|
+
}
|
|
336
340
|
}
|
|
337
341
|
/**
|
|
338
342
|
* Get annotations for a specific page.
|
|
@@ -342,10 +346,10 @@ export class WorkerClient {
|
|
|
342
346
|
return this.requestAnnotations(documentId, pageIndex);
|
|
343
347
|
}
|
|
344
348
|
/**
|
|
345
|
-
* Get
|
|
349
|
+
* Get the layout model for a specific page (for text selection/search).
|
|
346
350
|
* Routed through the unified work queue so renders take priority.
|
|
347
351
|
*/
|
|
348
|
-
async
|
|
352
|
+
async getLayoutPage(documentId, pageIndex) {
|
|
349
353
|
return this.requestText(documentId, pageIndex);
|
|
350
354
|
}
|
|
351
355
|
/**
|
|
@@ -1060,8 +1064,12 @@ export class WorkerClient {
|
|
|
1060
1064
|
});
|
|
1061
1065
|
}
|
|
1062
1066
|
async doRender(req, key) {
|
|
1063
|
-
const counter =
|
|
1064
|
-
const eventType = req.type === "thumbnail"
|
|
1067
|
+
const counter = this.getCounter(req.docId);
|
|
1068
|
+
const eventType = req.type === "thumbnail"
|
|
1069
|
+
? "renderThumbnail"
|
|
1070
|
+
: req.type === "preview"
|
|
1071
|
+
? "renderPreview"
|
|
1072
|
+
: "renderPage";
|
|
1065
1073
|
const pageIndex = req.page - 1;
|
|
1066
1074
|
const eventId = counter?.markStart(eventType, { pageIndex, scale: req.scale });
|
|
1067
1075
|
try {
|
|
@@ -1130,17 +1138,17 @@ export class WorkerClient {
|
|
|
1130
1138
|
async doText(item) {
|
|
1131
1139
|
const pageIndex = item.page - 1;
|
|
1132
1140
|
const counter = this.getCounter(item.docId);
|
|
1133
|
-
const eventId = counter?.markStart("
|
|
1141
|
+
const eventId = counter?.markStart("getLayoutPage", { pageIndex });
|
|
1134
1142
|
try {
|
|
1135
1143
|
const response = (await this.send({
|
|
1136
|
-
type: "
|
|
1144
|
+
type: "getLayoutPage",
|
|
1137
1145
|
documentId: item.docId,
|
|
1138
1146
|
pageIndex,
|
|
1139
1147
|
}));
|
|
1140
1148
|
if (eventId)
|
|
1141
1149
|
counter?.markEnd(eventId);
|
|
1142
|
-
item.resolve(response.
|
|
1143
|
-
return response.
|
|
1150
|
+
item.resolve(response.layout);
|
|
1151
|
+
return response.layout;
|
|
1144
1152
|
}
|
|
1145
1153
|
catch (error) {
|
|
1146
1154
|
if (eventId)
|