@build-qube/papyra 0.2.0 → 0.4.0
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 +18 -0
- package/dist/attachments.d.ts +76 -0
- package/dist/attachments.d.ts.map +1 -0
- package/dist/attachments.js +65 -0
- package/dist/attachments.js.map +1 -0
- package/dist/canvas.d.ts +27 -2
- package/dist/canvas.d.ts.map +1 -1
- package/dist/canvas.js +58 -5
- package/dist/canvas.js.map +1 -1
- package/dist/cells.d.ts +148 -0
- package/dist/cells.d.ts.map +1 -0
- package/dist/cells.js +144 -0
- package/dist/cells.js.map +1 -0
- package/dist/document.d.ts +61 -0
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +105 -7
- package/dist/document.js.map +1 -1
- package/dist/errors.d.ts +12 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +17 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +18 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/structure.d.ts +119 -0
- package/dist/structure.d.ts.map +1 -0
- package/dist/structure.js +115 -0
- package/dist/structure.js.map +1 -0
- package/dist/styles.d.ts +96 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/styles.js +69 -0
- package/dist/styles.js.map +1 -0
- package/dist/text.d.ts +18 -0
- package/dist/text.d.ts.map +1 -1
- package/dist/text.js.map +1 -1
- package/dist/tiff.d.ts +95 -0
- package/dist/tiff.d.ts.map +1 -0
- package/dist/tiff.js +78 -0
- package/dist/tiff.js.map +1 -0
- package/dist/types.d.ts +25 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/viewport.d.ts +129 -0
- package/dist/viewport.d.ts.map +1 -0
- package/dist/viewport.js +163 -0
- package/dist/viewport.js.map +1 -0
- package/dist/workbook.d.ts +152 -0
- package/dist/workbook.d.ts.map +1 -0
- package/dist/workbook.js +158 -0
- package/dist/workbook.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rebuild the tree from the flat pre-order list the bindings return.
|
|
3
|
+
*
|
|
4
|
+
* The same stack-by-level pass {@link buildOutlineTree} uses, and correct for the same
|
|
5
|
+
* reason: pre-order guarantees a node's parent is the most recent node one level
|
|
6
|
+
* shallower. A level that skips a step cannot come from our own walker, and is clamped
|
|
7
|
+
* rather than trusted — a malformed document should flatten, not crash.
|
|
8
|
+
*/
|
|
9
|
+
export function buildStructTree(entries) {
|
|
10
|
+
const roots = [];
|
|
11
|
+
const stack = [];
|
|
12
|
+
for (const entry of entries) {
|
|
13
|
+
const node = {
|
|
14
|
+
role: entry.role,
|
|
15
|
+
rawRole: entry.rawRole,
|
|
16
|
+
content: entry.content,
|
|
17
|
+
alt: entry.alt ?? null,
|
|
18
|
+
actualText: entry.actualText ?? null,
|
|
19
|
+
lang: entry.lang ?? null,
|
|
20
|
+
title: entry.title ?? null,
|
|
21
|
+
children: [],
|
|
22
|
+
};
|
|
23
|
+
const level = Math.min(entry.level, stack.length);
|
|
24
|
+
stack.length = level;
|
|
25
|
+
const parent = stack[level - 1];
|
|
26
|
+
if (parent)
|
|
27
|
+
parent.children.push(node);
|
|
28
|
+
else
|
|
29
|
+
roots.push(node);
|
|
30
|
+
stack.push(node);
|
|
31
|
+
}
|
|
32
|
+
return roots;
|
|
33
|
+
}
|
|
34
|
+
/** Walk a structure tree depth-first, yielding each node with its depth. */
|
|
35
|
+
export function* walkStructTree(nodes, depth = 0) {
|
|
36
|
+
for (const node of nodes) {
|
|
37
|
+
yield { node, depth };
|
|
38
|
+
yield* walkStructTree(node.children, depth + 1);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Put a page's lines into the reading order the document declares.
|
|
43
|
+
*
|
|
44
|
+
* This is the payoff of a tagged PDF and the one thing geometry cannot recover: on a
|
|
45
|
+
* two-column page the content stream may draw both columns interleaved, and no line
|
|
46
|
+
* grouping fixes that, because the drawing order genuinely is what it is. The
|
|
47
|
+
* structure tree states the intended order outright.
|
|
48
|
+
*
|
|
49
|
+
* Lines are keyed by their first glyph's {@link TextLine.mcid}, so a line is placed by
|
|
50
|
+
* the element that *starts* it. Ties — several lines inside one `P`, which is the
|
|
51
|
+
* normal case for a wrapped paragraph — keep their original relative order, so within
|
|
52
|
+
* an element the result is still the content stream's sequence. That is what makes
|
|
53
|
+
* this safe on a document whose tagging is partial.
|
|
54
|
+
*
|
|
55
|
+
* Lines with no structure element go **last**, rather than being dropped: untagged
|
|
56
|
+
* content is usually a running head or a page number, and losing it silently would be
|
|
57
|
+
* worse than putting it at the end. Pass `includeUntagged: false` to drop them.
|
|
58
|
+
*
|
|
59
|
+
* Returns the lines in content-stream order, unchanged, when the page has no tagged
|
|
60
|
+
* content at all — an untagged document is the common case and should not come back
|
|
61
|
+
* empty or reshuffled.
|
|
62
|
+
*/
|
|
63
|
+
export function readingOrder(text, tree, options = {}) {
|
|
64
|
+
const { includeUntagged = true } = options;
|
|
65
|
+
// Pre-order position of the element owning each mcid on this page. Built once per
|
|
66
|
+
// call: a tagged document tags every paragraph, so this is the whole tree, and
|
|
67
|
+
// doing it per line would be quadratic on exactly the documents that use it.
|
|
68
|
+
const owner = new Map();
|
|
69
|
+
let order = 0;
|
|
70
|
+
for (const { node } of walkStructTree(tree)) {
|
|
71
|
+
const position = order++;
|
|
72
|
+
for (const content of node.content) {
|
|
73
|
+
if (content.page !== text.page)
|
|
74
|
+
continue;
|
|
75
|
+
// First writer wins: an mcid claimed twice is malformed, and the earlier
|
|
76
|
+
// element is the one pre-order would have reached first anyway.
|
|
77
|
+
if (!owner.has(content.mcid)) {
|
|
78
|
+
owner.set(content.mcid, { node, order: position });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const ordered = text.lines.map((line, index) => {
|
|
83
|
+
const found = line.mcid === undefined ? undefined : owner.get(line.mcid);
|
|
84
|
+
return {
|
|
85
|
+
line,
|
|
86
|
+
node: found?.node ?? null,
|
|
87
|
+
// Untagged lines sort after every tagged one.
|
|
88
|
+
order: found?.order ?? Number.POSITIVE_INFINITY,
|
|
89
|
+
index,
|
|
90
|
+
};
|
|
91
|
+
});
|
|
92
|
+
if (owner.size === 0) {
|
|
93
|
+
return includeUntagged
|
|
94
|
+
? ordered.map(({ line, node }) => ({ line, node }))
|
|
95
|
+
: [];
|
|
96
|
+
}
|
|
97
|
+
// `index` breaks ties, which keeps the sort stable across engines rather than
|
|
98
|
+
// relying on the specification's guarantee holding for every runtime we ship on.
|
|
99
|
+
ordered.sort((a, b) => a.order - b.order || a.index - b.index);
|
|
100
|
+
return ordered
|
|
101
|
+
.filter((entry) => includeUntagged || entry.node !== null)
|
|
102
|
+
.map(({ line, node }) => ({ line, node }));
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Every character of a page in declared reading order, one line per entry.
|
|
106
|
+
*
|
|
107
|
+
* The structure-aware counterpart to {@link pageString}; identical to it on an
|
|
108
|
+
* untagged page.
|
|
109
|
+
*/
|
|
110
|
+
export function structuredPageString(text, tree) {
|
|
111
|
+
return readingOrder(text, tree)
|
|
112
|
+
.map(({ line }) => line.text)
|
|
113
|
+
.join('\n');
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=structure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structure.js","sourceRoot":"","sources":["../src/structure.ts"],"names":[],"mappings":"AAiEA;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,OAA+B;IAC7D,MAAM,KAAK,GAAiB,EAAE,CAAC;IAC/B,MAAM,KAAK,GAAiB,EAAE,CAAC;IAE/B,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAe;YACvB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,OAAO,EAAE,KAAK,CAAC,O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;IACT,CAAC;IAED,8EAA8E;IAC9E,iFAAiF;IACjF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IAE/D,OAAO,OAAO;SACX,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;SACzD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAAc,EACd,IAA2B;IAE3B,OAAO,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC;SAC5B,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;SAC5B,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
|
package/dist/styles.d.ts
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { CellStyle as NativeCellStyle, SheetLayout as NativeSheetLayout } from '@build-qube/papyra-native';
|
|
2
|
+
/** How one edge of a border is drawn. Dash-dot variants arrive as `'dashed'`. */
|
|
3
|
+
export type BorderStyle = 'thin' | 'medium' | 'thick' | 'dashed' | 'dotted' | 'double' | 'hair';
|
|
4
|
+
/** One edge of a cell's border. */
|
|
5
|
+
export interface BorderEdge {
|
|
6
|
+
/** The line. */
|
|
7
|
+
style: BorderStyle;
|
|
8
|
+
/** `0xRRGGBB`. Absent means automatic, which Excel draws black. */
|
|
9
|
+
color?: number;
|
|
10
|
+
}
|
|
11
|
+
/** Horizontal alignment. Absent means Excel's default: text left, numbers right. */
|
|
12
|
+
export type HorizontalAlign = 'left' | 'center' | 'right' | 'justify' | 'centerContinuous' | 'fill' | 'distributed';
|
|
13
|
+
/** Vertical alignment. Absent means bottom. */
|
|
14
|
+
export type VerticalAlign = 'top' | 'center' | 'bottom' | 'justify' | 'distributed';
|
|
15
|
+
/**
|
|
16
|
+
* How a cell looks, apart from its number format — which is already applied to the
|
|
17
|
+
* text. Sheets share styles by index: see {@link CellWindow.style}.
|
|
18
|
+
*
|
|
19
|
+
* Colours are `0xRRGGBB` numbers; {@link cssColor} turns one into CSS. An absent
|
|
20
|
+
* colour means "automatic", which is the reader's to choose — black on white in
|
|
21
|
+
* Excel, but whatever the page's own text colour is in a dark theme.
|
|
22
|
+
*/
|
|
23
|
+
export interface CellStyle {
|
|
24
|
+
/** Bold text. */
|
|
25
|
+
bold: boolean;
|
|
26
|
+
/** Italic text. */
|
|
27
|
+
italic: boolean;
|
|
28
|
+
/** Underlined text. */
|
|
29
|
+
underline: boolean;
|
|
30
|
+
/** Struck-through text. */
|
|
31
|
+
strike: boolean;
|
|
32
|
+
/** Font size relative to the workbook's default font: 2 is twice the size. */
|
|
33
|
+
fontScale: number;
|
|
34
|
+
/** Text colour. Absent means automatic. */
|
|
35
|
+
color?: number;
|
|
36
|
+
/** Background. Absent means none. */
|
|
37
|
+
fill?: number;
|
|
38
|
+
/** Top border. */
|
|
39
|
+
borderTop?: BorderEdge;
|
|
40
|
+
/** Right border. */
|
|
41
|
+
borderRight?: BorderEdge;
|
|
42
|
+
/** Bottom border. */
|
|
43
|
+
borderBottom?: BorderEdge;
|
|
44
|
+
/** Left border. */
|
|
45
|
+
borderLeft?: BorderEdge;
|
|
46
|
+
/** Horizontal alignment. */
|
|
47
|
+
horizontal?: HorizontalAlign;
|
|
48
|
+
/** Vertical alignment. */
|
|
49
|
+
vertical?: VerticalAlign;
|
|
50
|
+
/** Wrap text onto further lines within the row's height. */
|
|
51
|
+
wrap: boolean;
|
|
52
|
+
/** Indent level. Excel draws each as roughly three characters. */
|
|
53
|
+
indent: number;
|
|
54
|
+
}
|
|
55
|
+
/** Columns sharing a width, inclusive at both ends. */
|
|
56
|
+
export interface ColumnSpan {
|
|
57
|
+
/** First column, 0-based. */
|
|
58
|
+
first: number;
|
|
59
|
+
/** Last column, inclusive. Often 16383 — "to the end of the sheet". */
|
|
60
|
+
last: number;
|
|
61
|
+
/** Pixels at 96 DPI. 0 means hidden. */
|
|
62
|
+
width: number;
|
|
63
|
+
}
|
|
64
|
+
/** A row with a height of its own. */
|
|
65
|
+
export interface RowSize {
|
|
66
|
+
/** The row, 0-based. */
|
|
67
|
+
row: number;
|
|
68
|
+
/** Pixels at 96 DPI. 0 means hidden. */
|
|
69
|
+
height: number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Column widths and row heights as the author left them, in pixels at 96 DPI —
|
|
73
|
+
* Excel's own geometry, so a 64px default column is 64px here.
|
|
74
|
+
*/
|
|
75
|
+
export interface SheetLayout {
|
|
76
|
+
/** Width of a column with no span of its own. */
|
|
77
|
+
defaultColWidth: number;
|
|
78
|
+
/** Height of a row with no size of its own. */
|
|
79
|
+
defaultRowHeight: number;
|
|
80
|
+
/** Columns with their own width, in the file's order. */
|
|
81
|
+
columns: readonly ColumnSpan[];
|
|
82
|
+
/** Rows with their own height, in row order. */
|
|
83
|
+
rows: readonly RowSize[];
|
|
84
|
+
/**
|
|
85
|
+
* `false` when the author turned gridlines off — usually a report or a
|
|
86
|
+
* dashboard, drawn with borders where lines are meant to be.
|
|
87
|
+
*/
|
|
88
|
+
showGridLines: boolean;
|
|
89
|
+
}
|
|
90
|
+
/** `0x1F4E79` → `'#1f4e79'`. */
|
|
91
|
+
export declare function cssColor(rgb: number): string;
|
|
92
|
+
/** @internal */
|
|
93
|
+
export declare function toCellStyle(s: NativeCellStyle): CellStyle;
|
|
94
|
+
/** @internal */
|
|
95
|
+
export declare function toSheetLayout(l: NativeSheetLayout): SheetLayout;
|
|
96
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
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AC;IACxB,4BAA4B;IAC5B,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,4DAA4D;IAC5D,IAAI,EAAE,OAAO,CAAC;IACd,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,uDAAuD;AACvD,MAAM,WAAW,UAAU;IACzB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,sCAAsC;AACtC,MAAM,WAAW,OAAO;IACtB,wBAAwB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,iDAAiD;IACjD,eAAe,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,gBAAgB,EAAE,MAAM,CAAC;IACzB,yDAAyD;IACzD,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;IAC/B,gDAAgD;IAChD,IAAI,EAAE,SAAS,OAAO,EAAE,CAAC;IACzB;;;OAGG;IACH,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,gCAAgC;AAChC,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5C;AASD,gBAAgB;AAChB,wBAAgB,WAAW,CAAC,CAAC,EAAE,eAAe,GAAG,SAAS,CAyBzD;AAED,gBAAgB;AAChB,wBAAgB,aAAa,CAAC,CAAC,EAAE,iBAAiB,GAAG,WAAW,CAoB/D"}
|
package/dist/styles.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/** `0x1F4E79` → `'#1f4e79'`. */
|
|
2
|
+
export function cssColor(rgb) {
|
|
3
|
+
return `#${(rgb & 0xffffff).toString(16).padStart(6, '0')}`;
|
|
4
|
+
}
|
|
5
|
+
function edge(e) {
|
|
6
|
+
if (!e)
|
|
7
|
+
return undefined;
|
|
8
|
+
return e.color === undefined || e.color === null
|
|
9
|
+
? { style: e.style }
|
|
10
|
+
: { style: e.style, color: e.color };
|
|
11
|
+
}
|
|
12
|
+
/** @internal */
|
|
13
|
+
export function toCellStyle(s) {
|
|
14
|
+
const out = {
|
|
15
|
+
bold: s.bold,
|
|
16
|
+
italic: s.italic,
|
|
17
|
+
underline: s.underline,
|
|
18
|
+
strike: s.strike,
|
|
19
|
+
fontScale: s.fontScale,
|
|
20
|
+
wrap: s.wrap,
|
|
21
|
+
indent: s.indent,
|
|
22
|
+
};
|
|
23
|
+
// Assigned only when present, so a style compares and spreads as the file meant
|
|
24
|
+
// it — `{ color: undefined }` and `{}` are different objects to a test.
|
|
25
|
+
if (s.color != null)
|
|
26
|
+
out.color = s.color;
|
|
27
|
+
if (s.fill != null)
|
|
28
|
+
out.fill = s.fill;
|
|
29
|
+
const top = edge(s.borderTop);
|
|
30
|
+
const right = edge(s.borderRight);
|
|
31
|
+
const bottom = edge(s.borderBottom);
|
|
32
|
+
const left = edge(s.borderLeft);
|
|
33
|
+
if (top)
|
|
34
|
+
out.borderTop = top;
|
|
35
|
+
if (right)
|
|
36
|
+
out.borderRight = right;
|
|
37
|
+
if (bottom)
|
|
38
|
+
out.borderBottom = bottom;
|
|
39
|
+
if (left)
|
|
40
|
+
out.borderLeft = left;
|
|
41
|
+
if (s.horizontal)
|
|
42
|
+
out.horizontal = s.horizontal;
|
|
43
|
+
if (s.vertical)
|
|
44
|
+
out.vertical = s.vertical;
|
|
45
|
+
return out;
|
|
46
|
+
}
|
|
47
|
+
/** @internal */
|
|
48
|
+
export function toSheetLayout(l) {
|
|
49
|
+
const columns = [];
|
|
50
|
+
for (let i = 0; i + 2 < l.cols.length; i += 3) {
|
|
51
|
+
columns.push({
|
|
52
|
+
first: l.cols[i] ?? 0,
|
|
53
|
+
last: l.cols[i + 1] ?? 0,
|
|
54
|
+
width: l.cols[i + 2] ?? 0,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
const rows = [];
|
|
58
|
+
for (let i = 0; i + 1 < l.rows.length; i += 2) {
|
|
59
|
+
rows.push({ row: l.rows[i] ?? 0, height: l.rows[i + 1] ?? 0 });
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
defaultColWidth: l.defaultColWidth,
|
|
63
|
+
defaultRowHeight: l.defaultRowHeight,
|
|
64
|
+
columns,
|
|
65
|
+
rows,
|
|
66
|
+
showGridLines: l.showGridLines,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAyHA,gCAAgC;AAChC,MAAM,UAAU,QAAQ,CAAC,GAAW;IAClC,OAAO,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;AAC9D,CAAC;AAED,SAAS,IAAI,CAAC,CAA+B;IAC3C,IAAI,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IACzB,OAAO,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,CAAC,KAAK,KAAK,IAAI;QAC9C,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAoB,EAAE;QACnC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAoB,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;AACxD,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,WAAW,CAAC,CAAkB;IAC5C,MAAM,GAAG,GAAc;QACrB,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,MAAM,EA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,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9C,OAAO,CAAC,IAAI,CAAC;YACX,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;YACrB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YACxB,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;SAC1B,CAAC,CAAC;IACL,CAAC;IACD,MAAM,IAAI,GAAc,EAAE,CAAC;IAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9C,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC;IACD,OAAO;QACL,eAAe,EAAE,CAAC,CAAC,eAAe;QAClC,gBAAgB,EAAE,CAAC,CAAC,gBAAgB;QACpC,OAAO;QACP,IAAI;QACJ,aAAa,EAAE,CAAC,CAAC,aAAa;KAC/B,CAAC;AACJ,CAAC"}
|
package/dist/text.d.ts
CHANGED
|
@@ -27,6 +27,24 @@ export interface TextLine {
|
|
|
27
27
|
readonly ascent: number;
|
|
28
28
|
/** Extent below the baseline. */
|
|
29
29
|
readonly descent: number;
|
|
30
|
+
/**
|
|
31
|
+
* Marked-content id of the line's **first** glyph, joining this line to the
|
|
32
|
+
* structure tree — see {@link StructNode.content} and {@link readingOrder}.
|
|
33
|
+
*
|
|
34
|
+
* Absent on an untagged page, and on a tagged page for content the document left
|
|
35
|
+
* outside any marked-content sequence, which is where running heads and page
|
|
36
|
+
* numbers usually live.
|
|
37
|
+
*
|
|
38
|
+
* Optional rather than `null` because lines cross the binding as-is rather than
|
|
39
|
+
* being rebuilt one by one — a page is thousands of them — so an absent id arrives
|
|
40
|
+
* as `undefined` and saying otherwise would be a lie about the runtime shape.
|
|
41
|
+
*
|
|
42
|
+
* The *first* glyph rather than all of them: lines are grouped by geometry and
|
|
43
|
+
* tagging does not change that grouping, so a line whose middle switches to a
|
|
44
|
+
* `Span` stays one line. Ordering by the element that starts a line is sound;
|
|
45
|
+
* reading this as "every character here belongs to that element" is not.
|
|
46
|
+
*/
|
|
47
|
+
readonly mcid?: number;
|
|
30
48
|
}
|
|
31
49
|
/**
|
|
32
50
|
* The text of one page.
|
package/dist/text.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../src/text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,IAAI,cAAc,EAE3B,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;GAOG;AACH,MAAM,WAAW,QAAQ;IACvB,wEAAwE;IACxE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B,gCAAgC;IAChC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,iCAAiC;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../src/text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,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AG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;AACzD,CAAC"}
|
package/dist/tiff.d.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { type TiffImage as NativeTiffImage } from '@build-qube/papyra-native';
|
|
2
|
+
import type { PdfSource, RenderedPage } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* How a TIFF page's pixels are stored.
|
|
5
|
+
*
|
|
6
|
+
* The three `ccitt-*` values are fax coding — `ccitt-g4` is what nearly every scanned
|
|
7
|
+
* drawing uses. `old-jpeg` is listed so a page can say what it is, but cannot be
|
|
8
|
+
* rendered.
|
|
9
|
+
*/
|
|
10
|
+
export type TiffCompression = 'none' | 'ccitt-rle' | 'ccitt-g3' | 'ccitt-g4' | 'lzw' | 'old-jpeg' | 'jpeg' | 'deflate' | 'packbits' | 'other';
|
|
11
|
+
/** One page of a TIFF, as it is shown: the file's `Orientation` is already applied. */
|
|
12
|
+
export interface TiffPage {
|
|
13
|
+
/** Width in pixels, at full resolution. */
|
|
14
|
+
readonly width: number;
|
|
15
|
+
/** Height in pixels, at full resolution. */
|
|
16
|
+
readonly height: number;
|
|
17
|
+
/**
|
|
18
|
+
* Resolution in dots per inch, when the file states one. Fax pages are typically
|
|
19
|
+
* 204 by 196, so the two can differ.
|
|
20
|
+
*/
|
|
21
|
+
readonly dpi: {
|
|
22
|
+
/** Horizontal dots per inch. */
|
|
23
|
+
readonly x: number;
|
|
24
|
+
/** Vertical dots per inch. */
|
|
25
|
+
readonly y: number;
|
|
26
|
+
} | undefined;
|
|
27
|
+
/** How the pixels are stored. */
|
|
28
|
+
readonly compression: TiffCompression;
|
|
29
|
+
/** Bits per sample: 1 for a bilevel scan, 8 for most others. */
|
|
30
|
+
readonly bitsPerSample: number;
|
|
31
|
+
/** Samples per pixel: 1 for grey, 3 for RGB, 4 with alpha or for CMYK. */
|
|
32
|
+
readonly samplesPerPixel: number;
|
|
33
|
+
/** TIFF `Orientation`, 1–8. 1 is upright; 6 and 8 are a quarter turn. */
|
|
34
|
+
readonly orientation: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Size limits for {@link TiffImage.renderPage}. The page keeps its aspect ratio and
|
|
38
|
+
* is never enlarged.
|
|
39
|
+
*/
|
|
40
|
+
export interface TiffRenderOptions {
|
|
41
|
+
/** The most pixels the result may have. Defaults to {@link TIFF_MAX_PIXELS}. */
|
|
42
|
+
maxPixels?: number;
|
|
43
|
+
/** The widest the result may be, in pixels. */
|
|
44
|
+
maxWidth?: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The default {@link TiffRenderOptions.maxPixels}: 4096 × 4096.
|
|
48
|
+
*
|
|
49
|
+
* It is iOS Safari's canvas limit, and 64 MB of RGBA. A 300-dpi E-size sheet comes out
|
|
50
|
+
* at about 100 dpi under it — readable, with hairlines in grey.
|
|
51
|
+
*/
|
|
52
|
+
export declare const TIFF_MAX_PIXELS: number;
|
|
53
|
+
/**
|
|
54
|
+
* Open a TIFF: single or multi-page, classic or BigTIFF.
|
|
55
|
+
*
|
|
56
|
+
* Reads fax-coded pages (CCITT Group 3 and Group 4, the usual case for a scanned
|
|
57
|
+
* drawing), and uncompressed, LZW, Deflate, PackBits and JPEG pages in grey, RGB or
|
|
58
|
+
* CMYK at 1 to 16 bits, in strips or tiles. Palette-colour and old-style JPEG pages
|
|
59
|
+
* are listed but fail to render.
|
|
60
|
+
*
|
|
61
|
+
* Only the directory is read here. Each page is decoded by
|
|
62
|
+
* {@link TiffImage.renderPage}, in Rust and off the JS thread, and straight to a
|
|
63
|
+
* reduced size — a page is never held at full resolution, so a 600-dpi colour scan of
|
|
64
|
+
* a sheet larger than the tab could allocate still opens.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const tiff = await openTiff(file);
|
|
69
|
+
* const page = await tiff.renderPage(0, { maxWidth: 1600 });
|
|
70
|
+
* paintToCanvas(page, canvas);
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare function openTiff(source: PdfSource): Promise<TiffImage>;
|
|
74
|
+
/** An opened TIFF. Get one from {@link openTiff}. */
|
|
75
|
+
export declare class TiffImage {
|
|
76
|
+
#private;
|
|
77
|
+
/**
|
|
78
|
+
* Every page, in file order. A reduced-resolution copy of a page — a thumbnail, a
|
|
79
|
+
* pyramid level — is not a page and is left out.
|
|
80
|
+
*/
|
|
81
|
+
readonly pages: readonly TiffPage[];
|
|
82
|
+
/** @internal — construct via {@link openTiff}. */
|
|
83
|
+
constructor(native: NativeTiffImage);
|
|
84
|
+
/** How many pages there are. */
|
|
85
|
+
get pageCount(): number;
|
|
86
|
+
/**
|
|
87
|
+
* Decode one page to RGBA, upright, at no more than `options` allows.
|
|
88
|
+
*
|
|
89
|
+
* Paint the result with `paintToCanvas`, or encode it with `encode`, exactly as a
|
|
90
|
+
* rendered PDF page. Each call decodes the page again; keep the result if it will
|
|
91
|
+
* be shown again.
|
|
92
|
+
*/
|
|
93
|
+
renderPage(index: number, options?: TiffRenderOptions): Promise<RenderedPage>;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=tiff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tiff.d.ts","sourceRoot":"","sources":["../src/tiff.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,IAAI,eAAe,EAClC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,WAAW,GACX,UAAU,GACV,UAAU,GACV,KAAK,GACL,UAAU,GACV,MAAM,GACN,SAAS,GACT,UAAU,GACV,OAAO,CAAC;AAEZ,uFAAuF;AACvF,MAAM,WAAW,QAAQ;IACvB,2CAA2C;IAC3C,QAAQ,CAAC,KAAK,EAAE,MAAM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toBytes } from './source.js';
|
|
3
|
+
/**
|
|
4
|
+
* The default {@link TiffRenderOptions.maxPixels}: 4096 × 4096.
|
|
5
|
+
*
|
|
6
|
+
* It is iOS Safari's canvas limit, and 64 MB of RGBA. A 300-dpi E-size sheet comes out
|
|
7
|
+
* at about 100 dpi under it — readable, with hairlines in grey.
|
|
8
|
+
*/
|
|
9
|
+
export const TIFF_MAX_PIXELS = 4096 * 4096;
|
|
10
|
+
/**
|
|
11
|
+
* Open a TIFF: single or multi-page, classic or BigTIFF.
|
|
12
|
+
*
|
|
13
|
+
* Reads fax-coded pages (CCITT Group 3 and Group 4, the usual case for a scanned
|
|
14
|
+
* drawing), and uncompressed, LZW, Deflate, PackBits and JPEG pages in grey, RGB or
|
|
15
|
+
* CMYK at 1 to 16 bits, in strips or tiles. Palette-colour and old-style JPEG pages
|
|
16
|
+
* are listed but fail to render.
|
|
17
|
+
*
|
|
18
|
+
* Only the directory is read here. Each page is decoded by
|
|
19
|
+
* {@link TiffImage.renderPage}, in Rust and off the JS thread, and straight to a
|
|
20
|
+
* reduced size — a page is never held at full resolution, so a 600-dpi colour scan of
|
|
21
|
+
* a sheet larger than the tab could allocate still opens.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const tiff = await openTiff(file);
|
|
26
|
+
* const page = await tiff.renderPage(0, { maxWidth: 1600 });
|
|
27
|
+
* paintToCanvas(page, canvas);
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export async function openTiff(source) {
|
|
31
|
+
const bytes = await toBytes(source);
|
|
32
|
+
return new TiffImage(await loadTiff(bytes));
|
|
33
|
+
}
|
|
34
|
+
/** An opened TIFF. Get one from {@link openTiff}. */
|
|
35
|
+
export class TiffImage {
|
|
36
|
+
/**
|
|
37
|
+
* Every page, in file order. A reduced-resolution copy of a page — a thumbnail, a
|
|
38
|
+
* pyramid level — is not a page and is left out.
|
|
39
|
+
*/
|
|
40
|
+
pages;
|
|
41
|
+
#native;
|
|
42
|
+
/** @internal — construct via {@link openTiff}. */
|
|
43
|
+
constructor(native) {
|
|
44
|
+
this.#native = native;
|
|
45
|
+
this.pages = native.pages.map((p) => ({
|
|
46
|
+
width: p.width,
|
|
47
|
+
height: p.height,
|
|
48
|
+
dpi: p.xDpi != null ? { x: p.xDpi, y: p.yDpi ?? p.xDpi } : undefined,
|
|
49
|
+
compression: p.compression,
|
|
50
|
+
bitsPerSample: p.bitsPerSample,
|
|
51
|
+
samplesPerPixel: p.samplesPerPixel,
|
|
52
|
+
orientation: p.orientation,
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
/** How many pages there are. */
|
|
56
|
+
get pageCount() {
|
|
57
|
+
return this.pages.length;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Decode one page to RGBA, upright, at no more than `options` allows.
|
|
61
|
+
*
|
|
62
|
+
* Paint the result with `paintToCanvas`, or encode it with `encode`, exactly as a
|
|
63
|
+
* rendered PDF page. Each call decodes the page again; keep the result if it will
|
|
64
|
+
* be shown again.
|
|
65
|
+
*/
|
|
66
|
+
renderPage(index, options = {}) {
|
|
67
|
+
if (!Number.isInteger(index) || index < 0 || index >= this.pages.length) {
|
|
68
|
+
return Promise.reject(new RangeError(`papyra: no TIFF page ${JSON.stringify(index)}`));
|
|
69
|
+
}
|
|
70
|
+
return this.#native.renderPage(index, {
|
|
71
|
+
maxPixels: options.maxPixels,
|
|
72
|
+
maxWidth: options.maxWidth === undefined
|
|
73
|
+
? undefined
|
|
74
|
+
: Math.max(1, Math.floor(options.maxWidth)),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=tiff.js.map
|
package/dist/tiff.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tiff.js","sourceRoot":"","sources":["../src/tiff.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,GAET,MAAM,2BAA2B,CAAC;AACn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,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YACxE,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,UAAU,CAAC,wBAAwB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAChE,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE;YACpC,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,QAAQ,EACN,OAAO,CAAC,QAAQ,KAAK,SAAS;gBAC5B,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;SAChD,CAA0B,CAAC;IAC9B,CAAC;CACF"}
|
package/dist/types.d.ts
CHANGED
|
@@ -26,6 +26,23 @@ export interface RenderOptions {
|
|
|
26
26
|
* cost proportional to what is actually displayed.
|
|
27
27
|
*/
|
|
28
28
|
fitWidth?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Draw the page's annotations — links, highlights, stamps, filled form fields.
|
|
31
|
+
*
|
|
32
|
+
* On by default, which is what a PDF viewer is expected to show. Turn it off when
|
|
33
|
+
* you are drawing them yourself: a viewer that paints its own link or highlight
|
|
34
|
+
* layer over the bitmap otherwise shows every annotation twice, once from the
|
|
35
|
+
* document's appearance stream and once from its own.
|
|
36
|
+
*
|
|
37
|
+
* A boolean rather than pdf.js's four-way `annotationMode`, because that is the
|
|
38
|
+
* whole of what the engine offers. The two modes this has no answer for —
|
|
39
|
+
* `enableForms` and `enableStorage` — are about writing field values back, which
|
|
40
|
+
* papyra does not do.
|
|
41
|
+
*
|
|
42
|
+
* Part of the cache key, so flipping it re-renders instead of returning the
|
|
43
|
+
* previous answer.
|
|
44
|
+
*/
|
|
45
|
+
annotations?: boolean;
|
|
29
46
|
}
|
|
30
47
|
/** {@link RenderOptions}, plus the two dials that only apply to a stream. */
|
|
31
48
|
export interface StreamOptions extends RenderOptions {
|
|
@@ -59,6 +76,14 @@ export interface SvgOptions {
|
|
|
59
76
|
* undo.
|
|
60
77
|
*/
|
|
61
78
|
background?: 'white' | 'transparent';
|
|
79
|
+
/**
|
|
80
|
+
* Draw annotations, exactly as in {@link RenderOptions.annotations}. Defaults to on.
|
|
81
|
+
*
|
|
82
|
+
* Worth turning off more often here than for a raster page: an SVG is usually headed
|
|
83
|
+
* somewhere that will lay its own interaction over the artwork, and a baked-in link
|
|
84
|
+
* border is not removable afterwards.
|
|
85
|
+
*/
|
|
86
|
+
annotations?: boolean;
|
|
62
87
|
}
|
|
63
88
|
/** A rendered page. `data` is tightly packed RGBA8, `height * stride` bytes. */
|
|
64
89
|
export interface RenderedPage {
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,iFAAiF;AACjF,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,eAAe,GAAG,IAAI,CAAC;AAE1E,4DAA4D;AAC5D,MAAM,WAAW,aAAa;IAC5B;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,mEAAmE;IACnE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,iFAAiF;AACjF,MAAM,MAAM,S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