kordoc 4.25.5 → 4.25.6
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 +2 -2
- package/dist/{chunk-MSJ5PNU4.js → chunk-24J4EDVI.js} +2 -2
- package/dist/{chunk-LQECKSFZ.js → chunk-2RBIZALD.js} +8 -8
- package/dist/{chunk-BIYXEAPB.js → chunk-2VNL3FDS.js} +2 -2
- package/dist/{chunk-RVUTLW55.js → chunk-3URB7DI4.js} +2 -2
- package/dist/{chunk-M3XF63R2.js → chunk-3Y76RPK3.js} +6 -6
- package/dist/{chunk-WTYZ3ZF7.js → chunk-6L3VEOCI.js} +5 -5
- package/dist/{chunk-GKL5HC5U.js → chunk-6ZUQ6D3B.js} +6 -6
- package/dist/{chunk-FBIEJV6U.js → chunk-767ACEVN.js} +10 -4
- package/dist/{chunk-FBIEJV6U.js.map → chunk-767ACEVN.js.map} +2 -2
- package/dist/{chunk-QHDWV25F.js → chunk-D2WQC6ME.js} +18 -18
- package/dist/{chunk-TQ4ZM66H.js → chunk-D6MGUFRQ.js} +10 -10
- package/dist/{chunk-JKMM5YUX.js → chunk-DTUCE7H2.js} +2 -2
- package/dist/{chunk-6FQA6PD4.js → chunk-EDCNR6QZ.js} +2 -2
- package/dist/{chunk-KFRDHQU4.js → chunk-HMTLJJEC.js} +2 -2
- package/dist/{chunk-E6YEEM7Y.js → chunk-I7MD3WQR.js} +2 -2
- package/dist/{chunk-RXK3FHS5.js → chunk-IKQMEXGU.js} +4 -4
- package/dist/{chunk-KQBDAHB6.js → chunk-ILUYLDIW.js} +4 -4
- package/dist/{chunk-VL6BCOLO.js → chunk-IOADEIUV.js} +3 -3
- package/dist/{chunk-NAP746KZ.js → chunk-O4XRI7EC.js} +6 -6
- package/dist/{chunk-HP75SCKB.js → chunk-QQVTLNLV.js} +2 -2
- package/dist/{chunk-6HPTFECA.js → chunk-S4NQTGXD.js} +2 -2
- package/dist/{chunk-RTA4WJAJ.js → chunk-TH7SIDYM.js} +2 -2
- package/dist/{chunk-NY7DTOFT.js → chunk-VDF7ZVNW.js} +2 -2
- package/dist/{chunk-DYABE3CS.js → chunk-VHZYGCS4.js} +3 -3
- package/dist/{chunk-757KBA3R.js → chunk-VLOQQJ2D.js} +2 -2
- package/dist/{chunk-K42C2JMM.js → chunk-XI47ZEQB.js} +2 -2
- package/dist/{chunk-ZFL2PG3Z.js → chunk-ZEJCW4XP.js} +2 -2
- package/dist/chunks-GPCDFBSF.js +10 -0
- package/dist/cli.js +37 -37
- package/dist/{formula-PKUDP63D.js → formula-R6LXXMAS.js} +4 -4
- package/dist/{generator-IKCVYTYF.js → generator-ERKQ7LUN.js} +7 -7
- package/dist/{hancom-7PU6XSBN.js → hancom-VQUG46NV.js} +2 -2
- package/dist/{image-ocr-JKHVLMSE.js → image-ocr-MWQ6UDGP.js} +11 -11
- package/dist/index.cjs +113 -9
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +21 -21
- package/dist/mcp.js +33 -33
- package/dist/memo-7UFH4MNW.js +15 -0
- package/dist/{model-bundle-2H5JXIGE.js → model-bundle-3F33HOS2.js} +5 -5
- package/dist/{models-LAZ7DT2W.js → models-PD6EQIHL.js} +5 -5
- package/dist/{page-images-EQRGLULC.js → page-images-MZECTCSJ.js} +2 -2
- package/dist/{parse-worker-v2-YUJFOQGN.js → parse-worker-v2-ZXURNYJZ.js} +23 -23
- package/dist/{parser-V4CJLGOF.js → parser-WAJNO5VU.js} +108 -18
- package/dist/parser-WAJNO5VU.js.map +7 -0
- package/dist/{pdf-ocr-VTZZKVN4.js → pdf-ocr-GTVOOQNV.js} +9 -9
- package/dist/{profile-io-Q3KPUBIU.js → profile-io-UQSLXMWG.js} +3 -3
- package/dist/{rasterize-FXMAWFFL.js → rasterize-3QDKNJC3.js} +3 -3
- package/dist/{redact-doc-MB3MJUGW.js → redact-doc-IBLP55CI.js} +22 -22
- package/dist/{render-3Q3CUSNA.js → render-EPOTL6LB.js} +10 -10
- package/dist/{rewrite-fallback-G7TPY7GG.js → rewrite-fallback-5GPUDXDK.js} +12 -12
- package/dist/seal-7YV46Q77.js +14 -0
- package/dist/{setup-AO3MYKJN.js → setup-CTWIURYW.js} +3 -3
- package/dist/{to-hwpx-JY5PXKO5.js → to-hwpx-OJNCWBXT.js} +7 -7
- package/dist/visual-U7X4QE2V.js +42 -0
- package/dist/{watch-ACKPD7EP.js → watch-NXUTGUPA.js} +22 -22
- package/package.json +1 -1
- package/dist/chunks-NCKJSFGF.js +0 -10
- package/dist/memo-XPC6DDIZ.js +0 -15
- package/dist/parser-V4CJLGOF.js.map +0 -7
- package/dist/seal-TNKVQBKP.js +0 -14
- package/dist/visual-HTAI7YR4.js +0 -42
- /package/dist/{chunk-MSJ5PNU4.js.map → chunk-24J4EDVI.js.map} +0 -0
- /package/dist/{chunk-LQECKSFZ.js.map → chunk-2RBIZALD.js.map} +0 -0
- /package/dist/{chunk-BIYXEAPB.js.map → chunk-2VNL3FDS.js.map} +0 -0
- /package/dist/{chunk-RVUTLW55.js.map → chunk-3URB7DI4.js.map} +0 -0
- /package/dist/{chunk-M3XF63R2.js.map → chunk-3Y76RPK3.js.map} +0 -0
- /package/dist/{chunk-WTYZ3ZF7.js.map → chunk-6L3VEOCI.js.map} +0 -0
- /package/dist/{chunk-GKL5HC5U.js.map → chunk-6ZUQ6D3B.js.map} +0 -0
- /package/dist/{chunk-QHDWV25F.js.map → chunk-D2WQC6ME.js.map} +0 -0
- /package/dist/{chunk-TQ4ZM66H.js.map → chunk-D6MGUFRQ.js.map} +0 -0
- /package/dist/{chunk-JKMM5YUX.js.map → chunk-DTUCE7H2.js.map} +0 -0
- /package/dist/{chunk-6FQA6PD4.js.map → chunk-EDCNR6QZ.js.map} +0 -0
- /package/dist/{chunk-KFRDHQU4.js.map → chunk-HMTLJJEC.js.map} +0 -0
- /package/dist/{chunk-E6YEEM7Y.js.map → chunk-I7MD3WQR.js.map} +0 -0
- /package/dist/{chunk-RXK3FHS5.js.map → chunk-IKQMEXGU.js.map} +0 -0
- /package/dist/{chunk-KQBDAHB6.js.map → chunk-ILUYLDIW.js.map} +0 -0
- /package/dist/{chunk-VL6BCOLO.js.map → chunk-IOADEIUV.js.map} +0 -0
- /package/dist/{chunk-NAP746KZ.js.map → chunk-O4XRI7EC.js.map} +0 -0
- /package/dist/{chunk-HP75SCKB.js.map → chunk-QQVTLNLV.js.map} +0 -0
- /package/dist/{chunk-6HPTFECA.js.map → chunk-S4NQTGXD.js.map} +0 -0
- /package/dist/{chunk-RTA4WJAJ.js.map → chunk-TH7SIDYM.js.map} +0 -0
- /package/dist/{chunk-NY7DTOFT.js.map → chunk-VDF7ZVNW.js.map} +0 -0
- /package/dist/{chunk-DYABE3CS.js.map → chunk-VHZYGCS4.js.map} +0 -0
- /package/dist/{chunk-757KBA3R.js.map → chunk-VLOQQJ2D.js.map} +0 -0
- /package/dist/{chunk-K42C2JMM.js.map → chunk-XI47ZEQB.js.map} +0 -0
- /package/dist/{chunk-ZFL2PG3Z.js.map → chunk-ZEJCW4XP.js.map} +0 -0
- /package/dist/{chunks-NCKJSFGF.js.map → chunks-GPCDFBSF.js.map} +0 -0
- /package/dist/{formula-PKUDP63D.js.map → formula-R6LXXMAS.js.map} +0 -0
- /package/dist/{generator-IKCVYTYF.js.map → generator-ERKQ7LUN.js.map} +0 -0
- /package/dist/{hancom-7PU6XSBN.js.map → hancom-VQUG46NV.js.map} +0 -0
- /package/dist/{image-ocr-JKHVLMSE.js.map → image-ocr-MWQ6UDGP.js.map} +0 -0
- /package/dist/{memo-XPC6DDIZ.js.map → memo-7UFH4MNW.js.map} +0 -0
- /package/dist/{model-bundle-2H5JXIGE.js.map → model-bundle-3F33HOS2.js.map} +0 -0
- /package/dist/{models-LAZ7DT2W.js.map → models-PD6EQIHL.js.map} +0 -0
- /package/dist/{page-images-EQRGLULC.js.map → page-images-MZECTCSJ.js.map} +0 -0
- /package/dist/{parse-worker-v2-YUJFOQGN.js.map → parse-worker-v2-ZXURNYJZ.js.map} +0 -0
- /package/dist/{pdf-ocr-VTZZKVN4.js.map → pdf-ocr-GTVOOQNV.js.map} +0 -0
- /package/dist/{profile-io-Q3KPUBIU.js.map → profile-io-UQSLXMWG.js.map} +0 -0
- /package/dist/{rasterize-FXMAWFFL.js.map → rasterize-3QDKNJC3.js.map} +0 -0
- /package/dist/{redact-doc-MB3MJUGW.js.map → redact-doc-IBLP55CI.js.map} +0 -0
- /package/dist/{render-3Q3CUSNA.js.map → render-EPOTL6LB.js.map} +0 -0
- /package/dist/{rewrite-fallback-G7TPY7GG.js.map → rewrite-fallback-5GPUDXDK.js.map} +0 -0
- /package/dist/{seal-TNKVQBKP.js.map → seal-7YV46Q77.js.map} +0 -0
- /package/dist/{setup-AO3MYKJN.js.map → setup-CTWIURYW.js.map} +0 -0
- /package/dist/{to-hwpx-JY5PXKO5.js.map → to-hwpx-OJNCWBXT.js.map} +0 -0
- /package/dist/{visual-HTAI7YR4.js.map → visual-U7X4QE2V.js.map} +0 -0
- /package/dist/{watch-ACKPD7EP.js.map → watch-NXUTGUPA.js.map} +0 -0
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
restoreUnmappedCidSpaces,
|
|
17
17
|
restoreUnmappedGlyphs,
|
|
18
18
|
spaceMappedDots
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-DTUCE7H2.js";
|
|
20
20
|
import {
|
|
21
21
|
WEBP_UNAVAILABLE,
|
|
22
22
|
loadWebpEncoder
|
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
stripAbsorbedRunningLines,
|
|
82
82
|
trimTrailingEmptyTableCols,
|
|
83
83
|
wrapJoiner
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-767ACEVN.js";
|
|
85
85
|
import {
|
|
86
86
|
ImageKind,
|
|
87
87
|
OPS,
|
|
@@ -99,12 +99,12 @@ import {
|
|
|
99
99
|
stripScriptTags,
|
|
100
100
|
toTex,
|
|
101
101
|
unframeLayoutTables
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-I7MD3WQR.js";
|
|
103
103
|
import {
|
|
104
104
|
assignTableIds,
|
|
105
105
|
blocksToMarkdown,
|
|
106
106
|
escapeLiteralDollar
|
|
107
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-24J4EDVI.js";
|
|
108
108
|
import {
|
|
109
109
|
WINGDINGS,
|
|
110
110
|
enclosedNumber
|
|
@@ -113,13 +113,13 @@ import {
|
|
|
113
113
|
handwritingFallbackModels,
|
|
114
114
|
ocrModelsCached,
|
|
115
115
|
resolveOcrModels
|
|
116
|
-
} from "./chunk-
|
|
117
|
-
import "./chunk-
|
|
118
|
-
import "./chunk-
|
|
116
|
+
} from "./chunk-ZEJCW4XP.js";
|
|
117
|
+
import "./chunk-2VNL3FDS.js";
|
|
118
|
+
import "./chunk-EDCNR6QZ.js";
|
|
119
119
|
import {
|
|
120
120
|
KordocError,
|
|
121
121
|
sanitizeHref
|
|
122
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-3URB7DI4.js";
|
|
123
123
|
|
|
124
124
|
// src/pdf/image-extract.ts
|
|
125
125
|
import { createHash } from "node:crypto";
|
|
@@ -1638,6 +1638,16 @@ function outlineOnly(pairs, cell) {
|
|
|
1638
1638
|
const filled = pairs.filter(([, d]) => hasContent(d.cell));
|
|
1639
1639
|
return filled.length === 1 && outlineContinues(cell(filled[0][0]), cell(filled[0][1]));
|
|
1640
1640
|
}
|
|
1641
|
+
function joinNestedParts(u, d) {
|
|
1642
|
+
const prev = u.blocks?.[u.blocks.length - 1], curr = d.blocks?.[0];
|
|
1643
|
+
if (!prev?.table || !curr?.table || !prev.pageNumber || curr.pageNumber !== prev.pageNumber + 1) return null;
|
|
1644
|
+
const px = TABLE_COLXS.get(prev.table), cx = TABLE_COLXS.get(curr.table);
|
|
1645
|
+
if (!px || !cx || !shiftedSame(px, cx, false) || curr.table.cells[0].filter((c) => c.text.trim()).length < 2 || repeatedHeaderRows(prev.table, curr.table) <= 0) return null;
|
|
1646
|
+
const table = joinClipParts(prev, curr);
|
|
1647
|
+
if (!table || table.rows >= prev.table.rows + curr.table.rows) return null;
|
|
1648
|
+
markJoinedPages(table, prev, curr);
|
|
1649
|
+
return { ...prev, table };
|
|
1650
|
+
}
|
|
1641
1651
|
var NO_CUT = { open: false, ruled: false, list: "any" };
|
|
1642
1652
|
function mergeSplitRow(table, owner, first, colXs, textOnly = false, cut = NO_CUT) {
|
|
1643
1653
|
const last = first - 1;
|
|
@@ -1682,8 +1692,9 @@ function mergeSplitRow(table, owner, first, colXs, textOnly = false, cut = NO_CU
|
|
|
1682
1692
|
if (cut.ruled && hasNumberedRowSequence(table, owner, first)) return false;
|
|
1683
1693
|
if (cut.ruled && matchesIndependentRowPair(table, owner, first)) return false;
|
|
1684
1694
|
const contentPairs = pairs.filter(([u, d]) => hasContent(u.cell) && hasContent(d.cell));
|
|
1695
|
+
const nested = !textOnly && pairs.length === 1 ? joinNestedParts(cell(pairs[0][0]), cell(pairs[0][1])) : null;
|
|
1685
1696
|
const carriedSplit = !textOnly && carried && !newCell && (contentPairs.length <= 1 || contentPairs.every(([, d]) => d.rs > 1) || !cut.ruled && contentPairs.some(([u, d]) => wordOverflows(cell(u), cell(d), colXs[u.c], colXs[u.c + u.cs])));
|
|
1686
|
-
if (!carriedSplit && !band) {
|
|
1697
|
+
if (!nested && !carriedSplit && !band) {
|
|
1687
1698
|
const norm = (c) => flowText(c.text).replace(/\s+/g, "");
|
|
1688
1699
|
const openCut = cut.open && !newCell;
|
|
1689
1700
|
if (!openCut && pairs.some(([u, d]) => hasContent(d.cell) && norm(cell(d)) !== norm(cell(u)) && lineEnded(cell(u), colXs[u.c], colXs[u.c + u.cs], cell(d)))) return false;
|
|
@@ -1701,6 +1712,10 @@ function mergeSplitRow(table, owner, first, colXs, textOnly = false, cut = NO_CU
|
|
|
1701
1712
|
appendCell(table.cells[u.r][u.c], table.cells[d.r][d.c]);
|
|
1702
1713
|
if (d.rs > 1) table.cells[u.r][u.c].rowSpan = u.rs + d.rs;
|
|
1703
1714
|
}
|
|
1715
|
+
if (nested) {
|
|
1716
|
+
const blocks = cell(pairs[0][0]).blocks;
|
|
1717
|
+
blocks.splice(blocks.indexOf(cell(pairs[0][1]).blocks[0]) - 1, 2, nested);
|
|
1718
|
+
}
|
|
1704
1719
|
for (let r = 0; r < first; r++) for (let c = 0; c < table.cols; c++) {
|
|
1705
1720
|
const o = owner[r][c];
|
|
1706
1721
|
if (o && o.r === r && o.c === c && r + table.cells[r][c].rowSpan > first) table.cells[r][c].rowSpan--;
|
|
@@ -2189,6 +2204,80 @@ function marginContextBlocks(raw, page, view) {
|
|
|
2189
2204
|
});
|
|
2190
2205
|
}
|
|
2191
2206
|
|
|
2207
|
+
// src/pdf/vector-bullets.ts
|
|
2208
|
+
var mul2 = (m, t) => [
|
|
2209
|
+
m[0] * t[0] + m[2] * t[1],
|
|
2210
|
+
m[1] * t[0] + m[3] * t[1],
|
|
2211
|
+
m[0] * t[2] + m[2] * t[3],
|
|
2212
|
+
m[1] * t[2] + m[3] * t[3],
|
|
2213
|
+
m[0] * t[4] + m[2] * t[5] + m[4],
|
|
2214
|
+
m[1] * t[4] + m[3] * t[5] + m[5]
|
|
2215
|
+
];
|
|
2216
|
+
function filledDots(fnArray, argsArray) {
|
|
2217
|
+
const dots = [];
|
|
2218
|
+
let ctm = [1, 0, 0, 1, 0, 0];
|
|
2219
|
+
const stack = [];
|
|
2220
|
+
let path = null;
|
|
2221
|
+
for (let i = 0; i < fnArray.length; i++) {
|
|
2222
|
+
const op = fnArray[i], args = argsArray[i];
|
|
2223
|
+
if (op === OPS.save) stack.push(ctm);
|
|
2224
|
+
else if (op === OPS.restore) ctm = stack.pop() ?? [1, 0, 0, 1, 0, 0];
|
|
2225
|
+
else if (op === OPS.paintFormXObjectBegin) {
|
|
2226
|
+
stack.push(ctm);
|
|
2227
|
+
const m = args?.[0];
|
|
2228
|
+
if (Array.isArray(m) && m.length >= 6) ctm = mul2(ctm, m);
|
|
2229
|
+
} else if (op === OPS.paintFormXObjectEnd) ctm = stack.pop() ?? [1, 0, 0, 1, 0, 0];
|
|
2230
|
+
else if (op === OPS.transform && Array.isArray(args) && args.length >= 6) ctm = mul2(ctm, args);
|
|
2231
|
+
else if (op === OPS.constructPath) {
|
|
2232
|
+
const [subOps, coords] = args;
|
|
2233
|
+
path = null;
|
|
2234
|
+
if (!Array.isArray(subOps) || subOps.length < 6 || subOps[0] !== OPS.moveTo || subOps[subOps.length - 1] !== OPS.closePath || subOps.slice(1, -1).some((s) => s !== OPS.curveTo)) continue;
|
|
2235
|
+
let x1 = Infinity, y1 = Infinity, x2 = -Infinity, y2 = -Infinity;
|
|
2236
|
+
for (let k = 0; k + 1 < coords.length; k += 2) {
|
|
2237
|
+
const x = ctm[0] * coords[k] + ctm[2] * coords[k + 1] + ctm[4], y = ctm[1] * coords[k] + ctm[3] * coords[k + 1] + ctm[5];
|
|
2238
|
+
x1 = Math.min(x1, x);
|
|
2239
|
+
x2 = Math.max(x2, x);
|
|
2240
|
+
y1 = Math.min(y1, y);
|
|
2241
|
+
y2 = Math.max(y2, y);
|
|
2242
|
+
}
|
|
2243
|
+
path = { x1, y1, x2, y2 };
|
|
2244
|
+
} else if (op === OPS.fill || op === OPS.eoFill) {
|
|
2245
|
+
if (path) {
|
|
2246
|
+
const w = path.x2 - path.x1, h = path.y2 - path.y1;
|
|
2247
|
+
if (w >= 1.2 && w <= 6 && h >= 1.2 && h <= 6 && Math.abs(w - h) <= Math.max(w, h) * 0.15) dots.push(path);
|
|
2248
|
+
}
|
|
2249
|
+
path = null;
|
|
2250
|
+
}
|
|
2251
|
+
}
|
|
2252
|
+
return dots;
|
|
2253
|
+
}
|
|
2254
|
+
function restoreVectorBullets(items, fnArray, argsArray) {
|
|
2255
|
+
const found = [];
|
|
2256
|
+
for (const dot of filledDots(fnArray, argsArray)) {
|
|
2257
|
+
const cy = (dot.y1 + dot.y2) / 2;
|
|
2258
|
+
const line = items.filter((it) => !it.isHidden && it.fontSize > 0 && it.text.trim() && it.x >= dot.x2 && it.x - dot.x2 <= it.fontSize * 1.2 && cy >= it.y - it.fontSize * 0.1 && cy <= it.y + it.fontSize * 0.7 && dot.y2 - dot.y1 <= it.fontSize * 0.6).sort((a, b) => a.x - b.x)[0];
|
|
2259
|
+
if (!line || !new RegExp("^\\p{L}", "u").test(line.text.trim())) continue;
|
|
2260
|
+
if (items.some((it) => it !== line && !it.isHidden && it.text.trim() && Math.abs(it.y - line.y) <= line.fontSize * 0.3 && it.x < dot.x2 && it.x + it.w > dot.x1 - line.fontSize * 2)) continue;
|
|
2261
|
+
found.push({ dot, line, lx: line.x });
|
|
2262
|
+
}
|
|
2263
|
+
let restored = 0;
|
|
2264
|
+
const used = /* @__PURE__ */ new Set();
|
|
2265
|
+
for (const f of found) {
|
|
2266
|
+
const w = f.dot.x2 - f.dot.x1;
|
|
2267
|
+
const repeated = found.some((o) => o !== f && o.line !== f.line && Math.abs(o.dot.x1 - f.dot.x1) <= 1 && Math.abs(o.dot.x2 - o.dot.x1 - w) <= 0.5 && Math.abs(o.lx - f.lx) <= 1);
|
|
2268
|
+
if (!repeated || used.has(f.line)) continue;
|
|
2269
|
+
used.add(f.line);
|
|
2270
|
+
const line = f.line;
|
|
2271
|
+
line.w += line.x - f.dot.x1;
|
|
2272
|
+
line.x = f.dot.x1;
|
|
2273
|
+
line.text = "\u2022 " + line.text;
|
|
2274
|
+
line.fx = void 0;
|
|
2275
|
+
line.fw = void 0;
|
|
2276
|
+
restored++;
|
|
2277
|
+
}
|
|
2278
|
+
return restored;
|
|
2279
|
+
}
|
|
2280
|
+
|
|
2192
2281
|
// src/pdf/symbol-fonts.ts
|
|
2193
2282
|
var WINANSI_REVERSE = {
|
|
2194
2283
|
8364: 128,
|
|
@@ -2503,7 +2592,7 @@ function occludedTextItems(items, fnArray, argsArray) {
|
|
|
2503
2592
|
if (fn === OPS.save || fn === OPS.paintFormXObjectBegin) {
|
|
2504
2593
|
stack.push({ ctm: ctm.slice(), alpha, normalBlend, clip });
|
|
2505
2594
|
const m = fn === OPS.paintFormXObjectBegin ? args[0] : null;
|
|
2506
|
-
if (Array.isArray(m) && m.length >= 6) ctm =
|
|
2595
|
+
if (Array.isArray(m) && m.length >= 6) ctm = mul3(ctm, m);
|
|
2507
2596
|
const bbox = fn === OPS.paintFormXObjectBegin ? args[1] : null;
|
|
2508
2597
|
if (Array.isArray(bbox) && bbox.length === 4 && clip !== null) {
|
|
2509
2598
|
const axisAligned = ctm[1] === 0 && ctm[2] === 0 || ctm[0] === 0 && ctm[3] === 0;
|
|
@@ -2513,7 +2602,7 @@ function occludedTextItems(items, fnArray, argsArray) {
|
|
|
2513
2602
|
} else if (fn === OPS.restore || fn === OPS.paintFormXObjectEnd) {
|
|
2514
2603
|
const s = stack.pop();
|
|
2515
2604
|
if (s) ({ ctm, alpha, normalBlend, clip } = s);
|
|
2516
|
-
} else if (fn === OPS.transform) ctm =
|
|
2605
|
+
} else if (fn === OPS.transform) ctm = mul3(ctm, args);
|
|
2517
2606
|
else if (fn === OPS.setGState) {
|
|
2518
2607
|
const entries = args[0];
|
|
2519
2608
|
if (Array.isArray(entries)) for (const e of entries) {
|
|
@@ -2571,7 +2660,7 @@ function occludedTextItems(items, fnArray, argsArray) {
|
|
|
2571
2660
|
}
|
|
2572
2661
|
return hidden;
|
|
2573
2662
|
}
|
|
2574
|
-
function
|
|
2663
|
+
function mul3(m, t) {
|
|
2575
2664
|
return [
|
|
2576
2665
|
m[0] * t[0] + m[2] * t[1],
|
|
2577
2666
|
m[1] * t[0] + m[3] * t[1],
|
|
@@ -3542,7 +3631,7 @@ function mergeLinkRuns(markdown) {
|
|
|
3542
3631
|
|
|
3543
3632
|
// src/pdf/formula-ocr.ts
|
|
3544
3633
|
async function applyFormulaOcr(buffer, blocks, pageFilter, effectivePageCount, warnings, _onProgress) {
|
|
3545
|
-
const formulaMod = await import("./formula-
|
|
3634
|
+
const formulaMod = await import("./formula-R6LXXMAS.js");
|
|
3546
3635
|
const { FormulaPipeline, ensureFormulaModels } = formulaMod;
|
|
3547
3636
|
await ensureFormulaModels((p) => {
|
|
3548
3637
|
if (p.phase === "download" && p.total) {
|
|
@@ -3822,6 +3911,7 @@ async function parsePdfDocument(buffer, options) {
|
|
|
3822
3911
|
remapSymbolFontItems(visible, (loadedName) => fontObj(loadedName)?.name);
|
|
3823
3912
|
remapControlGlyphs(visible, differencesOf);
|
|
3824
3913
|
await restoreImageBullets(visible, imagePage, opList.fnArray, opList.argsArray, imageBulletShapes);
|
|
3914
|
+
restoreVectorBullets(visible, opList.fnArray, opList.argsArray);
|
|
3825
3915
|
const faces = /* @__PURE__ */ new Map();
|
|
3826
3916
|
for (const it of visible) {
|
|
3827
3917
|
if (!it.fontName) continue;
|
|
@@ -3908,7 +3998,7 @@ async function parsePdfDocument(buffer, options) {
|
|
|
3908
3998
|
const isImageBased = pageFilter?.size !== 0 && totalChars / Math.max(parsedPageCount, 1) < 10;
|
|
3909
3999
|
const ocrDone = /* @__PURE__ */ new Set();
|
|
3910
4000
|
const ocrLinesOut = /* @__PURE__ */ new Map();
|
|
3911
|
-
const pageRasters = options?.pageImages ? new (await import("./page-images-
|
|
4001
|
+
const pageRasters = options?.pageImages ? new (await import("./page-images-MZECTCSJ.js")).PageImageSink(options.pageImages) : null;
|
|
3912
4002
|
const allRegions = options?.ocr === true || typeof options?.ocr === "function";
|
|
3913
4003
|
const ocrRegions = allRegions || autoOcr ? ocrImageRegions(uncoveredImageRegions, largeImageRegions, allRegions) : /* @__PURE__ */ new Map();
|
|
3914
4004
|
if (ocrBuffer) {
|
|
@@ -3927,10 +4017,10 @@ async function parsePdfDocument(buffer, options) {
|
|
|
3927
4017
|
}
|
|
3928
4018
|
if (targets.size > 0) {
|
|
3929
4019
|
try {
|
|
3930
|
-
const { runPdfOcr } = await import("./pdf-ocr-
|
|
4020
|
+
const { runPdfOcr } = await import("./pdf-ocr-GTVOOQNV.js");
|
|
3931
4021
|
const mode = typeof options?.ocr === "function" ? options.ocr : "builtin";
|
|
3932
4022
|
const regionPages = new Map([...ocrRegions].filter(([p]) => options?.ocr !== "force" && !isImageBased && !pageQuality.find((q) => q.page === p)?.needsOcr));
|
|
3933
|
-
const { builtinOcrConfig } = await import("./pdf-ocr-
|
|
4023
|
+
const { builtinOcrConfig } = await import("./pdf-ocr-GTVOOQNV.js");
|
|
3934
4024
|
const ocrPageBlocks = await runPdfOcr(ocrBuffer, targets, mode, warnings, options?.onProgress, options?.tables !== false, vectorPageOps, regionPages, builtinOcrConfig(options), ocrLinesOut, pageRasters ?? void 0);
|
|
3935
4025
|
for (const obs of ocrPageBlocks.values()) stripScriptTags({ blocks: obs });
|
|
3936
4026
|
if (ocrPageBlocks.size > 0) {
|
|
@@ -3972,7 +4062,7 @@ async function parsePdfDocument(buffer, options) {
|
|
|
3972
4062
|
const rest = [];
|
|
3973
4063
|
for (let i = 1; i <= effectivePageCount; i++) if ((!pageFilter || pageFilter.has(i)) && !pageRasters.has(i)) rest.push(i);
|
|
3974
4064
|
try {
|
|
3975
|
-
const { renderPdfPageImages } = await import("./pdf-ocr-
|
|
4065
|
+
const { renderPdfPageImages } = await import("./pdf-ocr-GTVOOQNV.js");
|
|
3976
4066
|
await renderPdfPageImages(buffer, rest, pageRasters, warnings);
|
|
3977
4067
|
} catch (e) {
|
|
3978
4068
|
warnings.push({ message: `pageImages \uC2E4\uD589 \uBD88\uAC00: ${e instanceof Error ? e.message : String(e)}`, code: "SKIPPED_IMAGE" });
|
|
@@ -4179,4 +4269,4 @@ export {
|
|
|
4179
4269
|
parsePdfDocument,
|
|
4180
4270
|
removeHeaderFooterBlocks
|
|
4181
4271
|
};
|
|
4182
|
-
//# sourceMappingURL=parser-
|
|
4272
|
+
//# sourceMappingURL=parser-WAJNO5VU.js.map
|