@poe-platform/safe-bash 0.1.754 → 0.1.756
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/dist/image-ast/index.browser.js +39 -3
- package/dist/image-ast/index.js +39 -3
- package/dist/pdf-ast/canvas.d.ts +1 -0
- package/dist/pdf-ast/fonts/truetype.d.ts +1 -0
- package/dist/pdf-ast/index.js +39 -3
- package/dist/safe-bash/chunks/{chunk-3W6CRM25.js → chunk-CBVANNKK.js} +553 -289
- package/dist/safe-bash/chunks/{chunk-R2WG64VB.js → chunk-JCN3FXLP.js} +40 -4
- package/dist/safe-bash/chunks/{chunk-WNB4XH45.js → chunk-OSUXMC43.js} +3 -3
- package/dist/safe-bash/chunks/{chunk-37Y7GZTK.js → chunk-RSAWYAEH.js} +2 -2
- package/dist/safe-bash/chunks/{pdf-renderer-DHQDZC6N.js → pdf-renderer-CMF3CSVU.js} +3 -3
- package/dist/safe-bash/chunks/{src-S52LORVD.js → src-MXIKQCIC.js} +5 -3
- package/dist/safe-bash/command-chunks/{chunk-IJHV6I6X.js → chunk-3DOHQQJR.js} +8 -6
- package/dist/safe-bash/command-chunks/{chunk-PUOJAS3O.js → chunk-H2FQA4OU.js} +39 -3
- package/dist/safe-bash/command-chunks/chunk-IDR3WWKI.js +46 -0
- package/dist/safe-bash/command-chunks/{chunk-XAZ3NTJ4.js → chunk-KBBI4CSU.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-YY7HJMBG.js → chunk-KOM3FNCE.js} +1 -37
- package/dist/safe-bash/command-chunks/chunk-QQOAK7JQ.js +888 -0
- package/dist/safe-bash/command-chunks/{chunk-BE4AM2JW.js → chunk-UGX6MXDD.js} +5 -3
- package/dist/safe-bash/command-chunks/{chunk-CM4SVTIA.js → chunk-WI35236J.js} +1 -1
- package/dist/safe-bash/commands/ssconvert/index.d.ts +1 -2
- package/dist/safe-bash/commands/ssconvert/index.js +6 -260
- package/dist/safe-bash/core.browser.js +5 -207
- package/dist/safe-bash-command-csvkit/index.js +277 -49
- package/dist/safe-bash-command-ffmpeg/index.js +1741 -1717
- package/dist/safe-bash-command-imagemagick/index.js +2 -2
- package/dist/safe-bash-command-pandoc/command.js +3 -3
- package/dist/safe-bash-command-pandoc/index.js +3 -3
- package/dist/safe-bash-command-pdfimages/index.js +39 -3
- package/dist/safe-bash-command-pdfinfo/index.js +39 -3
- package/dist/safe-bash-command-pdftk/index.js +39 -3
- package/dist/safe-bash-command-pdftoppm/index.js +39 -3
- package/dist/safe-bash-command-pdftotext/index.js +39 -3
- package/dist/safe-bash-command-qpdf/index.js +39 -3
- package/dist/safe-bash-command-sips/index.js +2 -2
- package/dist/safe-bash-command-soffice/index.js +5 -4
- package/dist/safe-bash-command-ssconvert/formats/csv.js +4 -3
- package/dist/safe-bash-command-ssconvert/formats/spreadsheetml.js +4 -2
- package/dist/safe-bash-command-ssconvert/formats/xls.js +10 -666
- package/dist/safe-bash-command-ssconvert/index.d.ts +1 -0
- package/dist/safe-bash-command-ssconvert/index.js +706 -392
- package/dist/safe-bash-command-ssconvert/sync.d.ts +7 -0
- package/dist/safe-bash-command-timeout/index.js +1 -1
- package/dist/safe-bash-command-wkhtmltopdf/index.js +39 -3
- package/dist/spreadsheet-format-csv/text-export.d.ts +14 -0
- package/dist/spreadsheet-format-csv/text-export.js +2 -2
- package/dist/spreadsheet-format-xls/biff-binary.d.ts +7 -2
- package/dist/spreadsheet-format-xls/biff-binary.js +10 -1
- package/dist/spreadsheet-format-xls/biff-strings.d.ts +2 -3
- package/dist/spreadsheet-format-xls/biff-strings.js +14 -2
- package/package.json +2 -3
- package/third-party/pdf-ast/THIRD_PARTY_NOTICES.md +8 -1
- package/dist/safe-bash/command-chunks/chunk-MPUNHXWI.js +0 -205
|
@@ -31043,17 +31043,22 @@ function parseTrueTypeFont(bytes) {
|
|
|
31043
31043
|
const cmapNumTables = cmap ? readU16(view, cmapOffset + 2) : 0;
|
|
31044
31044
|
let format4Offset = 0;
|
|
31045
31045
|
let format12Offset = 0;
|
|
31046
|
+
let format4IsSymbolic = false;
|
|
31047
|
+
let format12IsSymbolic = false;
|
|
31046
31048
|
for (let i = 0; i < cmapNumTables; i++) {
|
|
31047
31049
|
const rec = cmapOffset + 4 + i * 8;
|
|
31048
31050
|
if (rec + 8 > bytes.byteLength) break;
|
|
31049
31051
|
const platformID = readU16(view, rec);
|
|
31052
|
+
const encodingID = readU16(view, rec + 2);
|
|
31050
31053
|
const subOffset = cmapOffset + readU32(view, rec + 4);
|
|
31051
31054
|
if (subOffset + 4 > bytes.byteLength) continue;
|
|
31052
31055
|
const fmt = readU16(view, subOffset);
|
|
31053
31056
|
if (fmt === 12 && (platformID === 3 || platformID === 0)) {
|
|
31054
31057
|
format12Offset = subOffset;
|
|
31058
|
+
format12IsSymbolic = platformID === 3 && encodingID === 0;
|
|
31055
31059
|
} else if (fmt === 4 && (platformID === 3 || platformID === 0)) {
|
|
31056
31060
|
format4Offset = subOffset;
|
|
31061
|
+
format4IsSymbolic = platformID === 3 && encodingID === 0;
|
|
31057
31062
|
}
|
|
31058
31063
|
}
|
|
31059
31064
|
if (format12Offset > 0) {
|
|
@@ -31342,6 +31347,7 @@ function parseTrueTypeFont(bytes) {
|
|
|
31342
31347
|
numGlyphs,
|
|
31343
31348
|
isCff: renderCffGlyph !== void 0,
|
|
31344
31349
|
hasCmap: cmap !== void 0,
|
|
31350
|
+
isSymbolicCmap: format12Offset > 0 ? format12IsSymbolic : format4IsSymbolic,
|
|
31345
31351
|
glyphNames,
|
|
31346
31352
|
getGlyphId(codePoint) {
|
|
31347
31353
|
return codePointToGlyph.get(codePoint) ?? 0;
|
|
@@ -31606,7 +31612,13 @@ function resolvePageFonts(doc, resourcesDict) {
|
|
|
31606
31612
|
embeddedCff = parseEmbeddedCffFont(doc.decodeStream(program), baseEncoding?.kind === "name" ? baseEncoding.decoded : void 0, glyphNames);
|
|
31607
31613
|
} else {
|
|
31608
31614
|
embeddedTrueType = parseTrueTypeFont(doc.decodeStream(program));
|
|
31609
|
-
if (subtype !== "Type0" &&
|
|
31615
|
+
if (subtype !== "Type0" && embeddedTrueType.isSymbolicCmap) {
|
|
31616
|
+
simpleToGid = /* @__PURE__ */ new Map();
|
|
31617
|
+
for (let code = 0; code < 256; code++) {
|
|
31618
|
+
const gid = embeddedTrueType.getGlyphId(61440 + code) || embeddedTrueType.getGlyphId(code);
|
|
31619
|
+
if (gid > 0) simpleToGid.set(code, gid);
|
|
31620
|
+
}
|
|
31621
|
+
} else if (subtype !== "Type0" && !embeddedTrueType.hasCmap) {
|
|
31610
31622
|
simpleToGid = /* @__PURE__ */ new Map();
|
|
31611
31623
|
const encoding = baseEncoding?.kind === "name" ? getEncoding(baseEncoding.decoded) : void 0;
|
|
31612
31624
|
for (let code = 0; code < 256; code++) {
|
|
@@ -34756,7 +34768,7 @@ var PdfPage = class {
|
|
|
34756
34768
|
this.cachedContentAst = parseContentStream(bytes);
|
|
34757
34769
|
this.isolatedInitialStream = false;
|
|
34758
34770
|
const stm = cosStream(bytes, { compress });
|
|
34759
|
-
|
|
34771
|
+
this.replaceContentStream(stm);
|
|
34760
34772
|
this.cachedContentsNode = dictGet(this.pageDict, "Contents");
|
|
34761
34773
|
}
|
|
34762
34774
|
getIsolatedContentAst() {
|
|
@@ -34773,9 +34785,33 @@ var PdfPage = class {
|
|
|
34773
34785
|
this.cachedContentAst = [...nodes];
|
|
34774
34786
|
const bytes = serializeContentAst(this.cachedContentAst);
|
|
34775
34787
|
const streamObj = cosStream(bytes, { compress });
|
|
34776
|
-
|
|
34788
|
+
this.replaceContentStream(streamObj);
|
|
34777
34789
|
this.cachedContentsNode = dictGet(this.pageDict, "Contents");
|
|
34778
34790
|
}
|
|
34791
|
+
replaceContentStream(stream) {
|
|
34792
|
+
const contents = dictGet(this.pageDict, "Contents");
|
|
34793
|
+
if (contents?.kind === "ref") {
|
|
34794
|
+
let references = 0;
|
|
34795
|
+
const pending = [...this.cosDoc.objects.values()].map((object) => object.value);
|
|
34796
|
+
const visited = /* @__PURE__ */ new Set();
|
|
34797
|
+
while (pending.length > 0 && references < 2) {
|
|
34798
|
+
const node = pending.pop();
|
|
34799
|
+
if (node.kind === "ref") {
|
|
34800
|
+
if (node.objectNumber === contents.objectNumber && node.generationNumber === contents.generationNumber) references++;
|
|
34801
|
+
} else if (!visited.has(node)) {
|
|
34802
|
+
visited.add(node);
|
|
34803
|
+
if (node.kind === "array") for (const item of node.items) pending.push(item);
|
|
34804
|
+
else if (node.kind === "dict") for (const entry of node.entries) pending.push(entry.value);
|
|
34805
|
+
else if (node.kind === "stream") pending.push(node.dict);
|
|
34806
|
+
}
|
|
34807
|
+
}
|
|
34808
|
+
if (references === 1) {
|
|
34809
|
+
this.cosDoc.setObject(contents.objectNumber, stream, contents.generationNumber);
|
|
34810
|
+
return;
|
|
34811
|
+
}
|
|
34812
|
+
}
|
|
34813
|
+
dictSet(this.pageDict, "Contents", this.cosDoc.allocateObject(stream));
|
|
34814
|
+
}
|
|
34779
34815
|
drawText(text, options) {
|
|
34780
34816
|
const size = options.size ?? options.fontSize ?? 12;
|
|
34781
34817
|
const color = options.color ?? { r: 0, g: 0, b: 0 };
|
|
@@ -38944,4 +38980,4 @@ export {
|
|
|
38944
38980
|
* Copyright 2017 Mozilla Foundation. Licensed under Apache-2.0.
|
|
38945
38981
|
* See licenses/PDFJS-APACHE-2.0.txt and THIRD_PARTY_NOTICES.md.
|
|
38946
38982
|
*/
|
|
38947
|
-
//# sourceMappingURL=chunk-
|
|
38983
|
+
//# sourceMappingURL=chunk-JCN3FXLP.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PdfDocument,
|
|
3
3
|
decodePng
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JCN3FXLP.js";
|
|
5
5
|
import {
|
|
6
6
|
init_platform
|
|
7
7
|
} from "./chunk-ZG7GWQ5P.js";
|
|
@@ -1250,7 +1250,7 @@ async function runWkhtmltopdf(context, options = {}) {
|
|
|
1250
1250
|
await writeBytes(stdout.output, encoder.encode(text), signal);
|
|
1251
1251
|
result = { kind: "information", exitCode: 0 };
|
|
1252
1252
|
} else {
|
|
1253
|
-
const renderer = options.renderer ?? (await import("./pdf-renderer-
|
|
1253
|
+
const renderer = options.renderer ?? (await import("./pdf-renderer-CMF3CSVU.js")).pdfAstRenderer;
|
|
1254
1254
|
requireRendererFeatures(renderer.profile, []);
|
|
1255
1255
|
let outputBytes = 0;
|
|
1256
1256
|
let outputChunks = 0;
|
|
@@ -2314,4 +2314,4 @@ export {
|
|
|
2314
2314
|
pdfAstWkhtmltopdfCommands,
|
|
2315
2315
|
wkhtmltopdfLimits
|
|
2316
2316
|
};
|
|
2317
|
-
//# sourceMappingURL=chunk-
|
|
2317
|
+
//# sourceMappingURL=chunk-OSUXMC43.js.map
|
|
@@ -620,7 +620,7 @@ function evalSyncTimeout(args) {
|
|
|
620
620
|
if (i >= args.length) return void 0;
|
|
621
621
|
const durStr = args[i];
|
|
622
622
|
const parsed = parseDuration(durStr);
|
|
623
|
-
if (parsed.kind !== "value" || parsed.milliseconds
|
|
623
|
+
if (parsed.kind !== "value" || parsed.milliseconds <= 0) return void 0;
|
|
624
624
|
if (killAfterMs !== void 0 && killAfterMs !== 0 && parsed.milliseconds !== 0 && parsed.milliseconds !== Infinity) {
|
|
625
625
|
return void 0;
|
|
626
626
|
}
|
|
@@ -970,4 +970,4 @@ export {
|
|
|
970
970
|
portableTrapExtension,
|
|
971
971
|
defaultPortableTrapExtension
|
|
972
972
|
};
|
|
973
|
-
//# sourceMappingURL=chunk-
|
|
973
|
+
//# sourceMappingURL=chunk-RSAWYAEH.js.map
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
pdfAstWkhtmltopdfCommand,
|
|
7
7
|
pdfAstWkhtmltopdfCommands,
|
|
8
8
|
renderPdfAstSync
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-OSUXMC43.js";
|
|
10
|
+
import "./chunk-JCN3FXLP.js";
|
|
11
11
|
import "./chunk-64OE6Q6X.js";
|
|
12
12
|
import "./chunk-ZG7GWQ5P.js";
|
|
13
13
|
export {
|
|
@@ -19,4 +19,4 @@ export {
|
|
|
19
19
|
pdfAstWkhtmltopdfCommands,
|
|
20
20
|
renderPdfAstSync
|
|
21
21
|
};
|
|
22
|
-
//# sourceMappingURL=pdf-renderer-
|
|
22
|
+
//# sourceMappingURL=pdf-renderer-CMF3CSVU.js.map
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
createResourceIO,
|
|
18
18
|
createSsconvertCommand,
|
|
19
19
|
createSsconvertCommands,
|
|
20
|
+
createSyncSsconvertEvaluator,
|
|
20
21
|
createVfsOutput,
|
|
21
22
|
createXlsxWriter,
|
|
22
23
|
csvFormat,
|
|
@@ -86,9 +87,9 @@ import {
|
|
|
86
87
|
visitFormula,
|
|
87
88
|
xlsFormat,
|
|
88
89
|
xlsxFormat
|
|
89
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-CBVANNKK.js";
|
|
90
91
|
import "./chunk-22XPAAOI.js";
|
|
91
|
-
import "./chunk-
|
|
92
|
+
import "./chunk-JCN3FXLP.js";
|
|
92
93
|
import "./chunk-EMAJ7WUW.js";
|
|
93
94
|
import "./chunk-64OE6Q6X.js";
|
|
94
95
|
import "./chunk-CTYJJD4O.js";
|
|
@@ -112,6 +113,7 @@ export {
|
|
|
112
113
|
createResourceIO,
|
|
113
114
|
createSsconvertCommand,
|
|
114
115
|
createSsconvertCommands,
|
|
116
|
+
createSyncSsconvertEvaluator,
|
|
115
117
|
createVfsOutput,
|
|
116
118
|
createXlsxWriter,
|
|
117
119
|
csvFormat,
|
|
@@ -182,4 +184,4 @@ export {
|
|
|
182
184
|
xlsFormat,
|
|
183
185
|
xlsxFormat
|
|
184
186
|
};
|
|
185
|
-
//# sourceMappingURL=src-
|
|
187
|
+
//# sourceMappingURL=src-MXIKQCIC.js.map
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
encodeText,
|
|
3
3
|
nativeTextCharsets
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UGX6MXDD.js";
|
|
5
5
|
import {
|
|
6
|
-
encodingName
|
|
7
|
-
|
|
8
|
-
} from "./chunk-YY7HJMBG.js";
|
|
6
|
+
encodingName
|
|
7
|
+
} from "./chunk-IDR3WWKI.js";
|
|
9
8
|
import {
|
|
10
9
|
exportRangeForSheet,
|
|
11
10
|
inferText,
|
|
@@ -21,6 +20,9 @@ import {
|
|
|
21
20
|
import {
|
|
22
21
|
exportOptionPairs
|
|
23
22
|
} from "./chunk-REYTQLLB.js";
|
|
23
|
+
import {
|
|
24
|
+
singleByteTables
|
|
25
|
+
} from "./chunk-KOM3FNCE.js";
|
|
24
26
|
import {
|
|
25
27
|
formattingLocale,
|
|
26
28
|
readByteTextCharacter,
|
|
@@ -638,7 +640,7 @@ function byteField(source, options, maximum, tick) {
|
|
|
638
640
|
append([quote]);
|
|
639
641
|
return Uint8Array.from(result);
|
|
640
642
|
}
|
|
641
|
-
function
|
|
643
|
+
function appendTextField(text, options, append) {
|
|
642
644
|
const whitespace = (c) => c !== void 0 && c !== "\v" && c !== "\uFEFF" && c.trim() === "";
|
|
643
645
|
const quoted = options.mode === "always" || options.mode === "auto" && (text.includes(",") || text.includes(" ") || text.includes(" ") || text.includes("\n") || text.includes('"') || options.whitespace && (whitespace(text[0]) || whitespace(text.at(-1))));
|
|
644
646
|
if (!quoted || !options.quote) {
|
|
@@ -717,7 +719,7 @@ async function exportText(args, options) {
|
|
|
717
719
|
);
|
|
718
720
|
length += bytes.length;
|
|
719
721
|
chunks.push(bytes);
|
|
720
|
-
} else
|
|
722
|
+
} else appendTextField(cell ? await renderCellText(cell, book, renderingContext, options.format) : "", options, append);
|
|
721
723
|
}
|
|
722
724
|
append(options.eol);
|
|
723
725
|
}
|
|
@@ -30494,17 +30494,22 @@ function parseTrueTypeFont(bytes) {
|
|
|
30494
30494
|
const cmapNumTables = cmap ? readU16(view, cmapOffset + 2) : 0;
|
|
30495
30495
|
let format4Offset = 0;
|
|
30496
30496
|
let format12Offset = 0;
|
|
30497
|
+
let format4IsSymbolic = false;
|
|
30498
|
+
let format12IsSymbolic = false;
|
|
30497
30499
|
for (let i = 0; i < cmapNumTables; i++) {
|
|
30498
30500
|
const rec = cmapOffset + 4 + i * 8;
|
|
30499
30501
|
if (rec + 8 > bytes.byteLength) break;
|
|
30500
30502
|
const platformID = readU16(view, rec);
|
|
30503
|
+
const encodingID = readU16(view, rec + 2);
|
|
30501
30504
|
const subOffset = cmapOffset + readU32(view, rec + 4);
|
|
30502
30505
|
if (subOffset + 4 > bytes.byteLength) continue;
|
|
30503
30506
|
const fmt = readU16(view, subOffset);
|
|
30504
30507
|
if (fmt === 12 && (platformID === 3 || platformID === 0)) {
|
|
30505
30508
|
format12Offset = subOffset;
|
|
30509
|
+
format12IsSymbolic = platformID === 3 && encodingID === 0;
|
|
30506
30510
|
} else if (fmt === 4 && (platformID === 3 || platformID === 0)) {
|
|
30507
30511
|
format4Offset = subOffset;
|
|
30512
|
+
format4IsSymbolic = platformID === 3 && encodingID === 0;
|
|
30508
30513
|
}
|
|
30509
30514
|
}
|
|
30510
30515
|
if (format12Offset > 0) {
|
|
@@ -30793,6 +30798,7 @@ function parseTrueTypeFont(bytes) {
|
|
|
30793
30798
|
numGlyphs,
|
|
30794
30799
|
isCff: renderCffGlyph !== void 0,
|
|
30795
30800
|
hasCmap: cmap !== void 0,
|
|
30801
|
+
isSymbolicCmap: format12Offset > 0 ? format12IsSymbolic : format4IsSymbolic,
|
|
30796
30802
|
glyphNames,
|
|
30797
30803
|
getGlyphId(codePoint) {
|
|
30798
30804
|
return codePointToGlyph.get(codePoint) ?? 0;
|
|
@@ -31057,7 +31063,13 @@ function resolvePageFonts(doc, resourcesDict) {
|
|
|
31057
31063
|
embeddedCff = parseEmbeddedCffFont(doc.decodeStream(program), baseEncoding?.kind === "name" ? baseEncoding.decoded : void 0, glyphNames);
|
|
31058
31064
|
} else {
|
|
31059
31065
|
embeddedTrueType = parseTrueTypeFont(doc.decodeStream(program));
|
|
31060
|
-
if (subtype !== "Type0" &&
|
|
31066
|
+
if (subtype !== "Type0" && embeddedTrueType.isSymbolicCmap) {
|
|
31067
|
+
simpleToGid = /* @__PURE__ */ new Map();
|
|
31068
|
+
for (let code = 0; code < 256; code++) {
|
|
31069
|
+
const gid = embeddedTrueType.getGlyphId(61440 + code) || embeddedTrueType.getGlyphId(code);
|
|
31070
|
+
if (gid > 0) simpleToGid.set(code, gid);
|
|
31071
|
+
}
|
|
31072
|
+
} else if (subtype !== "Type0" && !embeddedTrueType.hasCmap) {
|
|
31061
31073
|
simpleToGid = /* @__PURE__ */ new Map();
|
|
31062
31074
|
const encoding = baseEncoding?.kind === "name" ? getEncoding(baseEncoding.decoded) : void 0;
|
|
31063
31075
|
for (let code = 0; code < 256; code++) {
|
|
@@ -35378,7 +35390,7 @@ var PdfPage = class {
|
|
|
35378
35390
|
this.cachedContentAst = parseContentStream(bytes);
|
|
35379
35391
|
this.isolatedInitialStream = false;
|
|
35380
35392
|
const stm = cosStream(bytes, { compress });
|
|
35381
|
-
|
|
35393
|
+
this.replaceContentStream(stm);
|
|
35382
35394
|
this.cachedContentsNode = dictGet(this.pageDict, "Contents");
|
|
35383
35395
|
}
|
|
35384
35396
|
getIsolatedContentAst() {
|
|
@@ -35395,9 +35407,33 @@ var PdfPage = class {
|
|
|
35395
35407
|
this.cachedContentAst = [...nodes];
|
|
35396
35408
|
const bytes = serializeContentAst(this.cachedContentAst);
|
|
35397
35409
|
const streamObj = cosStream(bytes, { compress });
|
|
35398
|
-
|
|
35410
|
+
this.replaceContentStream(streamObj);
|
|
35399
35411
|
this.cachedContentsNode = dictGet(this.pageDict, "Contents");
|
|
35400
35412
|
}
|
|
35413
|
+
replaceContentStream(stream) {
|
|
35414
|
+
const contents = dictGet(this.pageDict, "Contents");
|
|
35415
|
+
if (contents?.kind === "ref") {
|
|
35416
|
+
let references = 0;
|
|
35417
|
+
const pending = [...this.cosDoc.objects.values()].map((object) => object.value);
|
|
35418
|
+
const visited = /* @__PURE__ */ new Set();
|
|
35419
|
+
while (pending.length > 0 && references < 2) {
|
|
35420
|
+
const node = pending.pop();
|
|
35421
|
+
if (node.kind === "ref") {
|
|
35422
|
+
if (node.objectNumber === contents.objectNumber && node.generationNumber === contents.generationNumber) references++;
|
|
35423
|
+
} else if (!visited.has(node)) {
|
|
35424
|
+
visited.add(node);
|
|
35425
|
+
if (node.kind === "array") for (const item of node.items) pending.push(item);
|
|
35426
|
+
else if (node.kind === "dict") for (const entry of node.entries) pending.push(entry.value);
|
|
35427
|
+
else if (node.kind === "stream") pending.push(node.dict);
|
|
35428
|
+
}
|
|
35429
|
+
}
|
|
35430
|
+
if (references === 1) {
|
|
35431
|
+
this.cosDoc.setObject(contents.objectNumber, stream, contents.generationNumber);
|
|
35432
|
+
return;
|
|
35433
|
+
}
|
|
35434
|
+
}
|
|
35435
|
+
dictSet(this.pageDict, "Contents", this.cosDoc.allocateObject(stream));
|
|
35436
|
+
}
|
|
35401
35437
|
drawText(text, options) {
|
|
35402
35438
|
const size = options.size ?? options.fontSize ?? 12;
|
|
35403
35439
|
const color = options.color ?? { r: 0, g: 0, b: 0 };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
encodingAliases
|
|
3
|
+
} from "./chunk-KOM3FNCE.js";
|
|
4
|
+
import {
|
|
5
|
+
init_buffer
|
|
6
|
+
} from "./chunk-HX3SHTCE.js";
|
|
7
|
+
|
|
8
|
+
// packages/spreadsheet-engine/src/encoding/names.ts
|
|
9
|
+
init_buffer();
|
|
10
|
+
var capturedNames = Object.freeze({
|
|
11
|
+
"ansi_x3.4-1968": "ascii",
|
|
12
|
+
ibm437: "cp437",
|
|
13
|
+
ibm850: "cp850",
|
|
14
|
+
ibm852: "cp852",
|
|
15
|
+
ibm855: "cp855",
|
|
16
|
+
ibm857: "cp857",
|
|
17
|
+
ibm858: "cp858",
|
|
18
|
+
ibm860: "cp860",
|
|
19
|
+
ibm861: "cp861",
|
|
20
|
+
ibm862: "cp862",
|
|
21
|
+
ibm863: "cp863",
|
|
22
|
+
ibm864: "cp864",
|
|
23
|
+
ibm865: "cp865",
|
|
24
|
+
ibm866: "cp866",
|
|
25
|
+
ibm869: "cp869",
|
|
26
|
+
"mac-uk": "mac-cyrillic",
|
|
27
|
+
ucs2: "ucs-2",
|
|
28
|
+
ucs4: "ucs-4",
|
|
29
|
+
cp1250: "windows-1250",
|
|
30
|
+
cp1251: "windows-1251",
|
|
31
|
+
cp1252: "windows-1252",
|
|
32
|
+
cp1253: "windows-1253",
|
|
33
|
+
cp1254: "windows-1254",
|
|
34
|
+
cp1255: "windows-1255",
|
|
35
|
+
cp1256: "windows-1256",
|
|
36
|
+
cp1257: "windows-1257",
|
|
37
|
+
cp1258: "windows-1258"
|
|
38
|
+
});
|
|
39
|
+
function encodingName(charset) {
|
|
40
|
+
const name = charset.toLowerCase();
|
|
41
|
+
return Object.hasOwn(capturedNames, name) ? capturedNames[name] : Object.hasOwn(encodingAliases, name) ? encodingAliases[name] : name;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export {
|
|
45
|
+
encodingName
|
|
46
|
+
};
|
|
@@ -48,11 +48,11 @@ import {
|
|
|
48
48
|
trimImage,
|
|
49
49
|
unflattenImage,
|
|
50
50
|
unpremultiplyRgbaImage
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-WI35236J.js";
|
|
52
52
|
import {
|
|
53
53
|
PdfDocument,
|
|
54
54
|
encodePng
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-H2FQA4OU.js";
|
|
56
56
|
import {
|
|
57
57
|
createLuaFilterCapability
|
|
58
58
|
} from "./chunk-Y2KHC6TZ.js";
|
|
@@ -291,43 +291,7 @@ var encodingAliases = Object.freeze({
|
|
|
291
291
|
"koi8u": "koi8-u"
|
|
292
292
|
});
|
|
293
293
|
|
|
294
|
-
// packages/spreadsheet-engine/src/encoding/names.ts
|
|
295
|
-
init_buffer();
|
|
296
|
-
var capturedNames = Object.freeze({
|
|
297
|
-
"ansi_x3.4-1968": "ascii",
|
|
298
|
-
ibm437: "cp437",
|
|
299
|
-
ibm850: "cp850",
|
|
300
|
-
ibm852: "cp852",
|
|
301
|
-
ibm855: "cp855",
|
|
302
|
-
ibm857: "cp857",
|
|
303
|
-
ibm858: "cp858",
|
|
304
|
-
ibm860: "cp860",
|
|
305
|
-
ibm861: "cp861",
|
|
306
|
-
ibm862: "cp862",
|
|
307
|
-
ibm863: "cp863",
|
|
308
|
-
ibm864: "cp864",
|
|
309
|
-
ibm865: "cp865",
|
|
310
|
-
ibm866: "cp866",
|
|
311
|
-
ibm869: "cp869",
|
|
312
|
-
"mac-uk": "mac-cyrillic",
|
|
313
|
-
ucs2: "ucs-2",
|
|
314
|
-
ucs4: "ucs-4",
|
|
315
|
-
cp1250: "windows-1250",
|
|
316
|
-
cp1251: "windows-1251",
|
|
317
|
-
cp1252: "windows-1252",
|
|
318
|
-
cp1253: "windows-1253",
|
|
319
|
-
cp1254: "windows-1254",
|
|
320
|
-
cp1255: "windows-1255",
|
|
321
|
-
cp1256: "windows-1256",
|
|
322
|
-
cp1257: "windows-1257",
|
|
323
|
-
cp1258: "windows-1258"
|
|
324
|
-
});
|
|
325
|
-
function encodingName(charset) {
|
|
326
|
-
const name = charset.toLowerCase();
|
|
327
|
-
return Object.hasOwn(capturedNames, name) ? capturedNames[name] : Object.hasOwn(encodingAliases, name) ? encodingAliases[name] : name;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
294
|
export {
|
|
331
295
|
singleByteTables,
|
|
332
|
-
|
|
296
|
+
encodingAliases
|
|
333
297
|
};
|