@evotecit/officeimo 0.1.21 → 0.1.43
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 +39 -8
- package/bundles/officeimo-canopyx-adapter.js +56 -36
- package/bundles/officeimo-canopyx-adapter.min.js +1 -1
- package/bundles/officeimo-canopyx-adapter.min.mjs +1 -1
- package/bundles/officeimo-canopyx-adapter.mjs +42 -22
- package/bundles/officeimo-canopyx.js +420 -177
- package/bundles/officeimo-canopyx.min.js +1 -1
- package/bundles/officeimo-canopyx.min.mjs +1 -1
- package/bundles/officeimo-canopyx.mjs +346 -103
- package/bundles/officeimo-chartforgex-adapter.js +1924 -0
- package/bundles/officeimo-chartforgex-adapter.min.js +2 -0
- package/bundles/officeimo-chartforgex-adapter.min.mjs +2 -0
- package/bundles/officeimo-chartforgex-adapter.mjs +1910 -0
- package/bundles/officeimo-chartforgex.js +13594 -0
- package/bundles/officeimo-chartforgex.min.js +2 -0
- package/bundles/officeimo-chartforgex.min.mjs +2 -0
- package/bundles/officeimo-chartforgex.mjs +13487 -0
- package/bundles/officeimo-csv.js +12 -7
- package/bundles/officeimo-csv.min.js +1 -1
- package/bundles/officeimo-csv.min.mjs +1 -1
- package/bundles/officeimo-csv.mjs +8 -3
- package/bundles/officeimo-datatables-adapter.js +11 -11
- package/bundles/officeimo-datatables-adapter.min.js +1 -1
- package/bundles/officeimo-datatables-adapter.min.mjs +1 -1
- package/bundles/officeimo-datatables-adapter.mjs +7 -7
- package/bundles/officeimo-datatables.js +375 -152
- package/bundles/officeimo-datatables.min.js +1 -1
- package/bundles/officeimo-datatables.min.mjs +1 -1
- package/bundles/officeimo-datatables.mjs +311 -88
- package/bundles/officeimo-execution.js +14 -9
- package/bundles/officeimo-execution.min.js +1 -1
- package/bundles/officeimo-execution.min.mjs +1 -1
- package/bundles/officeimo-execution.mjs +8 -3
- package/bundles/officeimo-pdf.js +286 -120
- package/bundles/officeimo-pdf.min.js +1 -1
- package/bundles/officeimo-pdf.min.mjs +1 -1
- package/bundles/officeimo-pdf.mjs +244 -78
- package/bundles/officeimo-xlsx.js +93 -31
- package/bundles/officeimo-xlsx.min.js +1 -1
- package/bundles/officeimo-xlsx.min.mjs +1 -1
- package/bundles/officeimo-xlsx.mjs +75 -13
- package/bundles/officeimo.js +373 -150
- package/bundles/officeimo.min.js +1 -1
- package/bundles/officeimo.min.mjs +1 -1
- package/bundles/officeimo.mjs +312 -89
- package/dist/core/progress.js +7 -2
- package/dist/index.d.ts +1 -1
- package/dist/integrations/canopyx/index.js +9 -2
- package/dist/integrations/canopyx/source.js +26 -13
- package/dist/integrations/chartforgex/capture.d.ts +31 -0
- package/dist/integrations/chartforgex/capture.js +103 -0
- package/dist/integrations/chartforgex/index.d.ts +13 -0
- package/dist/integrations/chartforgex/index.js +88 -0
- package/dist/integrations/chartforgex/svg-drawing.d.ts +5 -0
- package/dist/integrations/chartforgex/svg-drawing.js +775 -0
- package/dist/integrations/chartforgex/svg-geometry.d.ts +23 -0
- package/dist/integrations/chartforgex/svg-geometry.js +304 -0
- package/dist/integrations/chartforgex/svg-image.d.ts +9 -0
- package/dist/integrations/chartforgex/svg-image.js +46 -0
- package/dist/integrations/chartforgex/svg-markup.d.ts +10 -0
- package/dist/integrations/chartforgex/svg-markup.js +124 -0
- package/dist/integrations/chartforgex/svg-paint.d.ts +16 -0
- package/dist/integrations/chartforgex/svg-paint.js +146 -0
- package/dist/integrations/chartforgex/types.d.ts +77 -0
- package/dist/integrations/chartforgex/types.js +1 -0
- package/dist/integrations/chartforgex/winansi.d.ts +4 -0
- package/dist/integrations/chartforgex/winansi.js +48 -0
- package/dist/integrations/chartforgex/workbook.d.ts +12 -0
- package/dist/integrations/chartforgex/workbook.js +137 -0
- package/dist/pdf/document-drawings.d.ts +1 -1
- package/dist/pdf/document-drawings.js +91 -17
- package/dist/pdf/document-images.d.ts +7 -1
- package/dist/pdf/document-images.js +59 -24
- package/dist/pdf/document-types.d.ts +3 -1
- package/dist/pdf/document.d.ts +2 -2
- package/dist/pdf/document.js +3 -1
- package/dist/pdf/drawing-types.d.ts +37 -10
- package/dist/pdf/font-resources.d.ts +1 -1
- package/dist/pdf/font-resources.js +6 -3
- package/dist/pdf/index.d.ts +1 -1
- package/dist/pdf/pages.js +15 -0
- package/dist/pdf/png.d.ts +11 -2
- package/dist/pdf/png.js +50 -23
- package/dist/pdf/session.js +3 -2
- package/dist/pdf/settings.d.ts +2 -2
- package/dist/pdf/settings.js +7 -3
- package/dist/xlsx/options.js +1 -1
- package/dist/xlsx/types.d.ts +8 -0
- package/dist/xlsx/workbook.js +6 -0
- package/dist/xlsx/worksheet.d.ts +13 -1
- package/dist/xlsx/worksheet.js +60 -9
- package/package.json +9 -2
|
@@ -972,19 +972,24 @@ _modules.set("81b3d47c02b7d8443b79e02b3cfb52032d6b73d9a3fb592b777ebe028ad0ef00",
|
|
|
972
972
|
return _exports;
|
|
973
973
|
})();
|
|
974
974
|
|
|
975
|
-
const _m14 = _modules.get("
|
|
975
|
+
const _m14 = _modules.get("4eea31c4336d3c43bc743739843a3ef31803d8f0ed553f5645ee9de2554eb244") ?? (() => {
|
|
976
976
|
/** @internal Notify synchronously; observe an accidental promise before rejecting its unsupported use. */
|
|
977
977
|
function notifyProgress(callback, progress) {
|
|
978
|
+
notifySynchronously("onProgress", callback, progress);
|
|
979
|
+
}
|
|
980
|
+
/** @internal Run a host notification that must finish before the export continues. A returned promise is observed,
|
|
981
|
+
* so its rejection is never unhandled, and the export fails instead of reporting success before the callback ends. */
|
|
982
|
+
function notifySynchronously(name, callback, value) {
|
|
978
983
|
if (!callback)
|
|
979
984
|
return;
|
|
980
|
-
const result = callback(
|
|
985
|
+
const result = callback(value);
|
|
981
986
|
if (result && typeof result.then === "function") {
|
|
982
987
|
void Promise.resolve(result).catch(() => { });
|
|
983
|
-
throw new TypeError("
|
|
988
|
+
throw new TypeError(name + " must be synchronous.");
|
|
984
989
|
}
|
|
985
990
|
}
|
|
986
|
-
const _exports = Object.freeze({ notifyProgress: notifyProgress });
|
|
987
|
-
_modules.set("
|
|
991
|
+
const _exports = Object.freeze({ notifyProgress: notifyProgress, notifySynchronously: notifySynchronously });
|
|
992
|
+
_modules.set("4eea31c4336d3c43bc743739843a3ef31803d8f0ed553f5645ee9de2554eb244", _exports);
|
|
988
993
|
return _exports;
|
|
989
994
|
})();
|
|
990
995
|
|
|
@@ -1110,7 +1115,7 @@ _modules.set("f0627ba89e5c8fcb376ebe3ce72dcc8d68c34952981f8703e36b8bb1a9894208",
|
|
|
1110
1115
|
return _exports;
|
|
1111
1116
|
})();
|
|
1112
1117
|
|
|
1113
|
-
const _m15 = _modules.get("
|
|
1118
|
+
const _m15 = _modules.get("406ac6c93ee68eae70c6f52a1e6f4c56b84f43cae12576040c766dcc5598a580") ?? (() => {
|
|
1114
1119
|
const { beginTask, checkAbort, consumeRows, taskYieldDue, withAbort } = _m4;
|
|
1115
1120
|
|
|
1116
1121
|
const { BlobByteSink, ChunkedTextSink, withDestination } = _m3;
|
|
@@ -1260,7 +1265,7 @@ async function writeCsv(rows, configuration) {
|
|
|
1260
1265
|
}
|
|
1261
1266
|
}
|
|
1262
1267
|
const _exports = Object.freeze({ saveBlob: _m1.saveBlob, ExportCell: _m5.ExportCell, writeCsvTo: writeCsvTo, writeCsv: writeCsv });
|
|
1263
|
-
_modules.set("
|
|
1268
|
+
_modules.set("406ac6c93ee68eae70c6f52a1e6f4c56b84f43cae12576040c766dcc5598a580", _exports);
|
|
1264
1269
|
return _exports;
|
|
1265
1270
|
})();
|
|
1266
1271
|
|
|
@@ -3595,14 +3600,14 @@ _modules.set("13fa96d976e4dec7343dd3a392829567f1fcb574324a98f5a5d3a61c9a0dc27d",
|
|
|
3595
3600
|
return _exports;
|
|
3596
3601
|
})();
|
|
3597
3602
|
|
|
3598
|
-
const _m35 = _modules.get("
|
|
3603
|
+
const _m35 = _modules.get("d5957683aa1945575924c89c63b427878e6e6e47ef5c229dc524b1879d146499") ?? (() => {
|
|
3599
3604
|
const { checkAbort, consumeRows, inputRows, pause, taskYieldDue } = _m4;
|
|
3600
3605
|
|
|
3601
3606
|
const { ChunkedTextSink, BlobByteSink } = _m3;
|
|
3602
3607
|
|
|
3603
3608
|
const { OfficeIMOError } = _m2;
|
|
3604
3609
|
|
|
3605
|
-
const { notifyProgress } = _m14;
|
|
3610
|
+
const { notifyProgress, notifySynchronously } = _m14;
|
|
3606
3611
|
|
|
3607
3612
|
const { copyColumns, createRowProjector } = _m11;
|
|
3608
3613
|
|
|
@@ -3674,8 +3679,14 @@ class Worksheet {
|
|
|
3674
3679
|
pendingCharacters = 0;
|
|
3675
3680
|
reservedLayout = false;
|
|
3676
3681
|
internalLinks = [];
|
|
3682
|
+
// Evicted entries become holes and are compacted in one pass when the links are read, keeping eviction O(1).
|
|
3677
3683
|
links = [];
|
|
3684
|
+
evictedLinks = 0;
|
|
3678
3685
|
linkedCells = new Set();
|
|
3686
|
+
/** Indexes in `links` of data-cell links that `hyperlinkOverflow: "drop"` may give up, in row order. */
|
|
3687
|
+
droppable = [];
|
|
3688
|
+
droppableLinks = new WeakSet();
|
|
3689
|
+
droppedLinks = 0;
|
|
3679
3690
|
pictures = [];
|
|
3680
3691
|
nativeCharts = [];
|
|
3681
3692
|
conditional;
|
|
@@ -3887,7 +3898,8 @@ class Worksheet {
|
|
|
3887
3898
|
const cell = col.letter + row;
|
|
3888
3899
|
if (link || this.linkedCells.has(cell))
|
|
3889
3900
|
throw new TypeError("A text-preservation cell cannot also have an external hyperlink.");
|
|
3890
|
-
|
|
3901
|
+
this.makeLinkRoom();
|
|
3902
|
+
checkHyperlinkCount(this.linkCount + 1);
|
|
3891
3903
|
this.book.checkLinks(1);
|
|
3892
3904
|
// Replace a generated cell's original reservation with its preview and overflow records.
|
|
3893
3905
|
if (reservedCharacters !== undefined) {
|
|
@@ -3901,7 +3913,7 @@ class Worksheet {
|
|
|
3901
3913
|
value = preserved.preview;
|
|
3902
3914
|
}
|
|
3903
3915
|
if (link)
|
|
3904
|
-
this.appendHyperlink({ cell: col.letter + row, ...link });
|
|
3916
|
+
this.appendHyperlink({ cell: col.letter + row, ...link }, !header && !footer && !title && this.book.settings.hyperlinkOverflow === "drop");
|
|
3905
3917
|
if (type === "date")
|
|
3906
3918
|
value = excelDate(value, this.book.settings.dateMode);
|
|
3907
3919
|
if (!header && !footer && visible && (!formula || !isSubtotalFormula(formula)))
|
|
@@ -4210,20 +4222,61 @@ class Worksheet {
|
|
|
4210
4222
|
throw this.error;
|
|
4211
4223
|
this.appendHyperlink(link);
|
|
4212
4224
|
}
|
|
4213
|
-
appendHyperlink(link) {
|
|
4225
|
+
appendHyperlink(link, droppable = false) {
|
|
4226
|
+
// Validate before any overflow decision, so a dropped link can never hide an unsafe target.
|
|
4214
4227
|
const copied = copyHyperlink(link, this.book.settings.invalidCharacterPolicy);
|
|
4215
4228
|
const position = cellPosition(copied.cell);
|
|
4216
4229
|
if (this.layout.regions.covered(position.column, position.row))
|
|
4217
4230
|
throw new TypeError("Hyperlinks cannot address a covered merged cell.");
|
|
4218
4231
|
if (this.linkedCells.has(copied.cell))
|
|
4219
4232
|
throw new TypeError("Duplicate hyperlink cell: " + copied.cell);
|
|
4220
|
-
|
|
4233
|
+
if (droppable && this.linkCount >= maximumHyperlinks) {
|
|
4234
|
+
this.droppedLinks++;
|
|
4235
|
+
return;
|
|
4236
|
+
}
|
|
4237
|
+
if (!droppable)
|
|
4238
|
+
this.makeLinkRoom();
|
|
4239
|
+
checkHyperlinkCount(this.linkCount + 1);
|
|
4221
4240
|
this.book.retainLink();
|
|
4241
|
+
if (droppable) {
|
|
4242
|
+
this.droppable.push(this.links.length);
|
|
4243
|
+
this.droppableLinks.add(copied);
|
|
4244
|
+
}
|
|
4222
4245
|
this.links.push(copied);
|
|
4223
4246
|
this.linkedCells.add(copied.cell);
|
|
4224
4247
|
}
|
|
4248
|
+
/** Links the worksheet holds now, not counting evicted holes. */
|
|
4249
|
+
get linkCount() { return this.links.length - this.evictedLinks + this.internalLinks.length; }
|
|
4250
|
+
/** A full worksheet gives up its latest data-cell link for a link that cannot be dropped. Hyperlinks are serialized after
|
|
4251
|
+
* the rows, so the cell keeps its written value. The entry becomes a hole, so other indexes stay valid until compaction. */
|
|
4252
|
+
makeLinkRoom() {
|
|
4253
|
+
if (this.linkCount < maximumHyperlinks || !this.droppable.length)
|
|
4254
|
+
return;
|
|
4255
|
+
const index = this.droppable.pop(), removed = this.links[index];
|
|
4256
|
+
this.links[index] = undefined;
|
|
4257
|
+
this.evictedLinks++;
|
|
4258
|
+
this.linkedCells.delete(removed.cell);
|
|
4259
|
+
this.book.releaseLink();
|
|
4260
|
+
this.droppedLinks++;
|
|
4261
|
+
}
|
|
4262
|
+
/** One ordered pass removes evicted holes and rebuilds the droppable indexes. */
|
|
4263
|
+
compactLinks() {
|
|
4264
|
+
if (this.evictedLinks) {
|
|
4265
|
+
const kept = [], droppable = [];
|
|
4266
|
+
for (const link of this.links)
|
|
4267
|
+
if (link) {
|
|
4268
|
+
if (this.droppableLinks.has(link))
|
|
4269
|
+
droppable.push(kept.length);
|
|
4270
|
+
kept.push(link);
|
|
4271
|
+
}
|
|
4272
|
+
this.links = kept;
|
|
4273
|
+
this.droppable = droppable;
|
|
4274
|
+
this.evictedLinks = 0;
|
|
4275
|
+
}
|
|
4276
|
+
return this.links;
|
|
4277
|
+
}
|
|
4225
4278
|
/** @internal */
|
|
4226
|
-
get hyperlinks() { return this.
|
|
4279
|
+
get hyperlinks() { return this.compactLinks(); }
|
|
4227
4280
|
/** @internal */
|
|
4228
4281
|
get images() { return this.pictures; }
|
|
4229
4282
|
/** @internal An empty export has no data table; it still emits the declared headers. */
|
|
@@ -4274,7 +4327,7 @@ class Worksheet {
|
|
|
4274
4327
|
for (const binding of this.chartSources)
|
|
4275
4328
|
binding.finish();
|
|
4276
4329
|
this.chartSources.length = 0;
|
|
4277
|
-
for (const link of this.
|
|
4330
|
+
for (const link of this.compactLinks()) {
|
|
4278
4331
|
const position = cellPosition(link.cell);
|
|
4279
4332
|
if (position.column > this.columns.length || position.row > this.totalRows)
|
|
4280
4333
|
throw new RangeError("Hyperlinks must address cells within the exported rows and columns.");
|
|
@@ -4304,8 +4357,11 @@ class Worksheet {
|
|
|
4304
4357
|
await this.buffer.write(xml);
|
|
4305
4358
|
for (const xml of dataValidationsXml(this.validations, this.headerRows, this.count, detailRanges))
|
|
4306
4359
|
await this.buffer.write(xml);
|
|
4307
|
-
if (this.
|
|
4308
|
-
|
|
4360
|
+
if (this.droppedLinks)
|
|
4361
|
+
notifySynchronously("onHyperlinkOverflow", this.book.settings.onHyperlinkOverflow, Object.freeze({ sheetName: this.name, dropped: this.droppedLinks }));
|
|
4362
|
+
const links = this.compactLinks();
|
|
4363
|
+
if (links.length || this.internalLinks.length)
|
|
4364
|
+
await this.buffer.write(hyperlinksXml(links, this.book.settings.invalidCharacterPolicy, this.internalLinks));
|
|
4309
4365
|
await this.buffer.write(printXml(this.options.print, this.book.settings.invalidCharacterPolicy));
|
|
4310
4366
|
if (this.pictures.length || this.nativeCharts.length)
|
|
4311
4367
|
await this.buffer.write('<drawing r:id="drawing"/>');
|
|
@@ -4330,7 +4386,7 @@ class Worksheet {
|
|
|
4330
4386
|
async discard(error) { this.failed = true; this.error = error; this.pending = []; this.pendingCharacters = 0; this.prepared = undefined; this.buffer = undefined; this.nativeCharts.length = 0; this.chartSources.length = 0; this.output.discard(); await this.entry?.discard(error); }
|
|
4331
4387
|
}
|
|
4332
4388
|
const _exports = Object.freeze({ Worksheet: Worksheet });
|
|
4333
|
-
_modules.set("
|
|
4389
|
+
_modules.set("d5957683aa1945575924c89c63b427878e6e6e47ef5c229dc524b1879d146499", _exports);
|
|
4334
4390
|
return _exports;
|
|
4335
4391
|
})();
|
|
4336
4392
|
|
|
@@ -4449,11 +4505,11 @@ _modules.set("0c395783b9d7cc62dd39a21adeb698ad4a61e2c89f7b1fc8712e2eb2ccfe9d92",
|
|
|
4449
4505
|
return _exports;
|
|
4450
4506
|
})();
|
|
4451
4507
|
|
|
4452
|
-
const _m47 = _modules.get("
|
|
4508
|
+
const _m47 = _modules.get("fd70ccda89f27c6b874c8840ac944b3ec723dbdef3dfe7600f7bdb81f4660c96") ?? (() => {
|
|
4453
4509
|
const { captureFields } = _m10;
|
|
4454
4510
|
|
|
4455
4511
|
/** @internal The workbook owner captures these settings before validation or adapter merging. */
|
|
4456
|
-
const workbookOptionFields = ["signal", "onProgress", "limits", "sink", "dateMode", "compression", "invalidCharacterPolicy", "appProperties", "cellValueWriters", "oversizedText", "creator", "title", "subject", "description", "created", "modified"];
|
|
4512
|
+
const workbookOptionFields = ["signal", "onProgress", "limits", "sink", "dateMode", "compression", "invalidCharacterPolicy", "appProperties", "cellValueWriters", "oversizedText", "hyperlinkOverflow", "onHyperlinkOverflow", "creator", "title", "subject", "description", "created", "modified"];
|
|
4457
4513
|
/** @internal Worksheet settings also used by the portable sheet owner. */
|
|
4458
4514
|
const sheetOptionFields = ["columns", "includeHeader", "headerRows", "freezeHeader", "autoFilter", "boldHeader", "headerFill", "headerBorder", "headerWrap", "headerStyle", "alternatingRowStyle", "rowStyle", "cellStyle", "rowOutline", "maxOutlineLevel", "outlineSummaryBelow", "outlineSummaryRight", "columnOutlines", "rowHeight", "headerHeight", "defaultColumnWidth", "freezeColumns", "table", "autoSize", "footer", "print", "title", "mergedCells", "hyperlinks", "conditionalFormats", "dataValidation"];
|
|
4459
4515
|
/** @internal Includes inherited format-specific ceilings before a wrapper combines stream settings. */
|
|
@@ -4468,7 +4524,7 @@ function captureWorkbookOptions(options) {
|
|
|
4468
4524
|
return { ...captured, ...(captured.limits === undefined ? {} : { limits: captureWorkbookLimits(captured.limits) }) };
|
|
4469
4525
|
}
|
|
4470
4526
|
const _exports = Object.freeze({ workbookOptionFields: workbookOptionFields, sheetOptionFields: sheetOptionFields, workbookLimitFields: workbookLimitFields, captureWorkbookLimits: captureWorkbookLimits, captureWorkbookOptions: captureWorkbookOptions });
|
|
4471
|
-
_modules.set("
|
|
4527
|
+
_modules.set("fd70ccda89f27c6b874c8840ac944b3ec723dbdef3dfe7600f7bdb81f4660c96", _exports);
|
|
4472
4528
|
return _exports;
|
|
4473
4529
|
})();
|
|
4474
4530
|
|
|
@@ -4775,7 +4831,7 @@ _modules.set("24f1417c3c320a8a41137c28f70b72091256c63010be0c88b684dce85f54950c",
|
|
|
4775
4831
|
return _exports;
|
|
4776
4832
|
})();
|
|
4777
4833
|
|
|
4778
|
-
const _m21 = _modules.get("
|
|
4834
|
+
const _m21 = _modules.get("a34a46ed9564c388d5f3ca087c70819f8aa897e469ca50f8547233c264a8e8af") ?? (() => {
|
|
4779
4835
|
const { beginTask, checkAbort, pause, taskYieldDue } = _m4;
|
|
4780
4836
|
|
|
4781
4837
|
const { OfficeIMOError } = _m2;
|
|
@@ -4908,6 +4964,10 @@ class Workbook {
|
|
|
4908
4964
|
throw new RangeError("compression must be auto or store.");
|
|
4909
4965
|
if (options.oversizedText !== undefined && !["reject", "preserve"].includes(options.oversizedText))
|
|
4910
4966
|
throw new RangeError("oversizedText must be reject or preserve.");
|
|
4967
|
+
if (options.hyperlinkOverflow !== undefined && !["reject", "drop"].includes(options.hyperlinkOverflow))
|
|
4968
|
+
throw new RangeError("hyperlinkOverflow must be reject or drop.");
|
|
4969
|
+
if (options.onHyperlinkOverflow !== undefined && typeof options.onHyperlinkOverflow !== "function")
|
|
4970
|
+
throw new TypeError("onHyperlinkOverflow must be a function.");
|
|
4911
4971
|
cleanXml("", policy);
|
|
4912
4972
|
corePropertiesXml(options, policy);
|
|
4913
4973
|
this.budget = new ExportBudget(options.limits);
|
|
@@ -4985,6 +5045,8 @@ class Workbook {
|
|
|
4985
5045
|
}
|
|
4986
5046
|
/** @internal Reserve a preflighted worksheet batch or one row hyperlink. */
|
|
4987
5047
|
retainLink(count = 1) { this.checkLinks(count); this.links += count; }
|
|
5048
|
+
/** @internal A worksheet dropped a data-cell link it had retained. */
|
|
5049
|
+
releaseLink() { this.links--; }
|
|
4988
5050
|
/** @internal */
|
|
4989
5051
|
checkImage(bytes) {
|
|
4990
5052
|
if (this.settings.limits?.maxImageBytes !== undefined && this.imageBytes + bytes > this.settings.limits.maxImageBytes)
|
|
@@ -5258,11 +5320,11 @@ class Workbook {
|
|
|
5258
5320
|
}
|
|
5259
5321
|
}
|
|
5260
5322
|
const _exports = Object.freeze({ Workbook: Workbook });
|
|
5261
|
-
_modules.set("
|
|
5323
|
+
_modules.set("a34a46ed9564c388d5f3ca087c70819f8aa897e469ca50f8547233c264a8e8af", _exports);
|
|
5262
5324
|
return _exports;
|
|
5263
5325
|
})();
|
|
5264
5326
|
|
|
5265
|
-
const _m51 = _modules.get("
|
|
5327
|
+
const _m51 = _modules.get("d6884428c3e4d15a691ecf2523372a03b32de22a890edfbfc9961f2dc92711c2") ?? (() => {
|
|
5266
5328
|
const { ExportCell, assertScalar } = _m5;
|
|
5267
5329
|
|
|
5268
5330
|
const { captureWorkbookOptions, sheetOptionFields } = _m47;
|
|
@@ -5311,11 +5373,11 @@ function portableWorkbook(options = {}) {
|
|
|
5311
5373
|
return { ...options, cellValueWriters: wrapped };
|
|
5312
5374
|
}
|
|
5313
5375
|
const _exports = Object.freeze({ portableSheet: portableSheet, portableWorkbook: portableWorkbook });
|
|
5314
|
-
_modules.set("
|
|
5376
|
+
_modules.set("d6884428c3e4d15a691ecf2523372a03b32de22a890edfbfc9961f2dc92711c2", _exports);
|
|
5315
5377
|
return _exports;
|
|
5316
5378
|
})();
|
|
5317
5379
|
|
|
5318
|
-
const _m50 = _modules.get("
|
|
5380
|
+
const _m50 = _modules.get("b9b1793c41e466048fe823422088a6fcc1fd8393c67293df3f0cd83a5d5ec7e1") ?? (() => {
|
|
5319
5381
|
const { withDestination } = _m3;
|
|
5320
5382
|
|
|
5321
5383
|
const { copyColumns } = _m11;
|
|
@@ -5370,11 +5432,11 @@ async function writeXlsxTo(rows, destination, configuration) {
|
|
|
5370
5432
|
});
|
|
5371
5433
|
}
|
|
5372
5434
|
const _exports = Object.freeze({ writeXlsx: writeXlsx, writeXlsxTo: writeXlsxTo });
|
|
5373
|
-
_modules.set("
|
|
5435
|
+
_modules.set("b9b1793c41e466048fe823422088a6fcc1fd8393c67293df3f0cd83a5d5ec7e1", _exports);
|
|
5374
5436
|
return _exports;
|
|
5375
5437
|
})();
|
|
5376
5438
|
|
|
5377
|
-
const _m53 = _modules.get("
|
|
5439
|
+
const _m53 = _modules.get("ba0e1f29c8de5d46b966b7b097260529e42b80f662e92a7f9e8add22df747a50") ?? (() => {
|
|
5378
5440
|
const { assertGroupedReportSource } = _m8;
|
|
5379
5441
|
|
|
5380
5442
|
const { captureFields } = _m10;
|
|
@@ -5463,11 +5525,11 @@ function prepareGroupedSheet(report, configuration, maxConditionalFormats = 1000
|
|
|
5463
5525
|
...(options.grandTotalStyle ? { grandTotalStyle: copyStylePatch(options.grandTotalStyle) } : {}) };
|
|
5464
5526
|
}
|
|
5465
5527
|
const _exports = Object.freeze({ groupedOptionFields: groupedOptionFields, prepareGroupedSheet: prepareGroupedSheet });
|
|
5466
|
-
_modules.set("
|
|
5528
|
+
_modules.set("ba0e1f29c8de5d46b966b7b097260529e42b80f662e92a7f9e8add22df747a50", _exports);
|
|
5467
5529
|
return _exports;
|
|
5468
5530
|
})();
|
|
5469
5531
|
|
|
5470
|
-
const _m52 = _modules.get("
|
|
5532
|
+
const _m52 = _modules.get("d7cfa6a7b1be9758925a4ccb860a80a33eb0de2c88c80cc55e438213595f2b71") ?? (() => {
|
|
5471
5533
|
const { groupedReportOperation } = _m8;
|
|
5472
5534
|
|
|
5473
5535
|
const { checkAbort, withAbort } = _m4;
|
|
@@ -5640,14 +5702,14 @@ async function writeGroupedXlsxTo(report, destination, options) {
|
|
|
5640
5702
|
return withDestination(destination, async (sink) => (await write(report, prepared, sink)).result);
|
|
5641
5703
|
}
|
|
5642
5704
|
const _exports = Object.freeze({ addGroupedXlsx: addGroupedXlsx, writeGroupedXlsx: writeGroupedXlsx, writeGroupedXlsxTo: writeGroupedXlsxTo });
|
|
5643
|
-
_modules.set("
|
|
5705
|
+
_modules.set("d7cfa6a7b1be9758925a4ccb860a80a33eb0de2c88c80cc55e438213595f2b71", _exports);
|
|
5644
5706
|
return _exports;
|
|
5645
5707
|
})();
|
|
5646
5708
|
|
|
5647
|
-
const _m20 = _modules.get("
|
|
5709
|
+
const _m20 = _modules.get("edf1bf5cb6d749de0e6823397df6610a6c1cc88768898c1b4d7083ee96ef6759") ?? (() => {
|
|
5648
5710
|
|
|
5649
5711
|
const _exports = Object.freeze({ Workbook: _m21.Workbook, writeXlsx: _m50.writeXlsx, writeXlsxTo: _m50.writeXlsxTo, writeGroupedXlsx: _m52.writeGroupedXlsx, writeGroupedXlsxTo: _m52.writeGroupedXlsxTo, addGroupedXlsx: _m52.addGroupedXlsx, createGroupedReport: _m8.createGroupedReport, Worksheet: _m35.Worksheet, Cell: _m32.Cell, FormulaCell: _m33.FormulaCell, StyleRegistry: _m29.StyleRegistry, NumberFormats: _m29.NumberFormats, saveBlob: _m1.saveBlob, ExportCell: _m5.ExportCell });
|
|
5650
|
-
_modules.set("
|
|
5712
|
+
_modules.set("edf1bf5cb6d749de0e6823397df6610a6c1cc88768898c1b4d7083ee96ef6759", _exports);
|
|
5651
5713
|
return _exports;
|
|
5652
5714
|
})();
|
|
5653
5715
|
|
|
@@ -5760,7 +5822,7 @@ _modules.set("278e6adc6a5d4491e688589ef165bd1aa9cc74f557da6f9d6bdf53ecc0c6df47",
|
|
|
5760
5822
|
return _exports;
|
|
5761
5823
|
})();
|
|
5762
5824
|
|
|
5763
|
-
const _m56 = _modules.get("
|
|
5825
|
+
const _m56 = _modules.get("6c92204b587bb12cfa85c60eb1fd921804dfa51304538c7be3353e2927551b02") ?? (() => {
|
|
5764
5826
|
const { OfficeIMOError } = _m2;
|
|
5765
5827
|
|
|
5766
5828
|
const { ExportBudget } = _m9;
|
|
@@ -5787,12 +5849,16 @@ const sizes = {
|
|
|
5787
5849
|
};
|
|
5788
5850
|
/** @internal Shared capture schema for thin format adapters and the grouped writer. */
|
|
5789
5851
|
const pdfOptionFields = ["columns", "signal", "onProgress", "limits", "textShaper", "textDirection", "pageSize", "orientation", "margins", "fonts", "tagged", "fontSize",
|
|
5790
|
-
"title", "messageTop", "messageBottom", "includeHeader", "headerRows", "footer", "headerPresentation", "footerPresentation", "alternateRowColor", "padding",
|
|
5852
|
+
"title", "metadataTitle", "messageTop", "messageBottom", "includeHeader", "headerRows", "footer", "headerPresentation", "footerPresentation", "alternateRowColor", "padding",
|
|
5791
5853
|
"columnWidths", "wideTable", "pageHeader", "pageFooter", "pageNumbers", "pageNumberLabels", "booleanText", "formatValue", "formatRuns", "compression", "paragraphStyles"];
|
|
5792
5854
|
/** @internal Complete PDF limit schema used when a host combines format and shared limits. */
|
|
5793
5855
|
const pdfLimitFields = ["maxRows", "maxCells", "maxTextCharacters", "maxOutputBytes", "maxPages", "maxColumns", "maxTableBands", "maxTableWindowRows", "maxCellCharacters", "maxTextRuns", "maxGroupBlocks", "maxRowLines",
|
|
5794
5856
|
"maxFontBytes", "maxPageBytes", "maxHyperlinks", "maxImageBytes", "maxImagePixels", "maxImageWorkingBytes", "maxVectorCommands", "maxDrawingElements", "maxStructureElements",
|
|
5795
5857
|
"maxMarkedContentReferences", "maxSections", "maxBookmarks", "maxListItems", "maxParagraphStyles"];
|
|
5858
|
+
/** @internal Default ceilings shared by the drawing writer and its producers. */
|
|
5859
|
+
const pdfDrawingLimits = Object.freeze({ maxVectorCommands: 100000, maxDrawingElements: 100000 });
|
|
5860
|
+
/** @internal Maximum number of retained drawing levels including the leaf. */
|
|
5861
|
+
const pdfDrawingMaxDepth = 32;
|
|
5796
5862
|
/** @internal Capture supported structural properties once, including class-based options with prototype accessors. */
|
|
5797
5863
|
function capturePdfOptions(input) {
|
|
5798
5864
|
if (!input || typeof input !== "object" || Array.isArray(input))
|
|
@@ -5903,7 +5969,7 @@ function settings(input, document = false) {
|
|
|
5903
5969
|
footerPresentation: Object.freeze({ background: "eef2f6", bold: true, ...presentation(configuration.footerPresentation) }) };
|
|
5904
5970
|
const budget = new ExportBudget(options.limits);
|
|
5905
5971
|
const limits = { maxPages: 10000, maxColumns: 1024, maxTableBands: 64, maxTableWindowRows: 256, maxCellCharacters: 1000000, maxTextRuns: 10000, maxGroupBlocks: 256, maxRowLines: 100000, maxFontBytes: 16 * 1024 * 1024, maxPageBytes: 8 * 1024 * 1024, maxHyperlinks: 100000,
|
|
5906
|
-
maxImageBytes: 32 * 1024 * 1024, maxImagePixels: 16 * 1024 * 1024,
|
|
5972
|
+
maxImageBytes: 32 * 1024 * 1024, maxImagePixels: 16 * 1024 * 1024, ...pdfDrawingLimits,
|
|
5907
5973
|
maxStructureElements: 1000000, maxMarkedContentReferences: 2000000,
|
|
5908
5974
|
maxListItems: 100000, maxParagraphStyles: 256, maxSections: 1000, maxBookmarks: 10000 };
|
|
5909
5975
|
for (const key of Object.keys(limits)) {
|
|
@@ -5931,7 +5997,7 @@ function settings(input, document = false) {
|
|
|
5931
5997
|
const fontSize = positive(options.fontSize ?? 9, "Font size", 144), padding = options.padding ?? 4;
|
|
5932
5998
|
if (!Number.isFinite(padding) || padding < 0 || padding > 72)
|
|
5933
5999
|
throw new RangeError("PDF padding must be from 0 through 72 points.");
|
|
5934
|
-
for (const key of ["title", "messageTop", "messageBottom"])
|
|
6000
|
+
for (const key of ["title", "metadataTitle", "messageTop", "messageBottom"])
|
|
5935
6001
|
if (options[key] !== undefined && typeof options[key] !== "string")
|
|
5936
6002
|
throw new TypeError(key + " must be text.");
|
|
5937
6003
|
for (const key of ["pageHeader", "pageFooter"])
|
|
@@ -5967,8 +6033,8 @@ function settings(input, document = false) {
|
|
|
5967
6033
|
repeatedColumns: document ? Object.freeze([]) : repeatedColumns(options.wideTable, columns),
|
|
5968
6034
|
limits: { ...limits, ...(maxImageWorkingBytes === undefined ? {} : { maxImageWorkingBytes }) }, budget };
|
|
5969
6035
|
}
|
|
5970
|
-
const _exports = Object.freeze({ positive: _m58.positive, color: _m58.color, presentation: _m58.presentation, pdfOptionFields: pdfOptionFields, pdfLimitFields: pdfLimitFields, capturePdfOptions: capturePdfOptions, capturePdfLimits: capturePdfLimits, captureWideTable: captureWideTable, settings: settings });
|
|
5971
|
-
_modules.set("
|
|
6036
|
+
const _exports = Object.freeze({ positive: _m58.positive, color: _m58.color, presentation: _m58.presentation, pdfOptionFields: pdfOptionFields, pdfLimitFields: pdfLimitFields, pdfDrawingLimits: pdfDrawingLimits, pdfDrawingMaxDepth: pdfDrawingMaxDepth, capturePdfOptions: capturePdfOptions, capturePdfLimits: capturePdfLimits, captureWideTable: captureWideTable, settings: settings });
|
|
6037
|
+
_modules.set("6c92204b587bb12cfa85c60eb1fd921804dfa51304538c7be3353e2927551b02", _exports);
|
|
5972
6038
|
return _exports;
|
|
5973
6039
|
})();
|
|
5974
6040
|
|
|
@@ -7293,7 +7359,7 @@ _modules.set("59911f0fe023545e9e97521b268551078bdc4c5f303e446a13b7d52f905e8070",
|
|
|
7293
7359
|
return _exports;
|
|
7294
7360
|
})();
|
|
7295
7361
|
|
|
7296
|
-
const _m62 = _modules.get("
|
|
7362
|
+
const _m62 = _modules.get("7825c87ba92a9992baf6b5c8a5e146948268985c31584ef9c8bf395359942e4f") ?? (() => {
|
|
7297
7363
|
const { NotSupportedError, OfficeIMOError } = _m2;
|
|
7298
7364
|
|
|
7299
7365
|
const { fontProgram } = _m63;
|
|
@@ -7494,7 +7560,7 @@ class PdfFontResources {
|
|
|
7494
7560
|
this.fontBytes += bytes;
|
|
7495
7561
|
this.registered.add(font);
|
|
7496
7562
|
}
|
|
7497
|
-
select(bold = false, italic = false, explicit) {
|
|
7563
|
+
select(bold = false, italic = false, explicit, standardForMissingFace = false) {
|
|
7498
7564
|
if (explicit)
|
|
7499
7565
|
this.registerFont(explicit);
|
|
7500
7566
|
let selections = this.selections;
|
|
@@ -7504,10 +7570,13 @@ class PdfFontResources {
|
|
|
7504
7570
|
if (!found)
|
|
7505
7571
|
this.explicitSelections.set(explicit, selections);
|
|
7506
7572
|
}
|
|
7507
|
-
const
|
|
7573
|
+
const fallback = standardForMissingFace && !explicit && this.fonts !== undefined &&
|
|
7574
|
+
this.fonts[bold ? italic ? "boldItalic" : "bold" : italic ? "italic" : "regular"] === undefined;
|
|
7575
|
+
const key = (bold ? 2 : 0) | (italic ? 1 : 0) | (fallback ? 4 : 0), existing = selections.get(key);
|
|
7508
7576
|
if (existing)
|
|
7509
7577
|
return existing;
|
|
7510
|
-
const { font, syntheticBold, syntheticItalic } = explicit ? { font: explicit, syntheticBold: bold, syntheticItalic: italic } :
|
|
7578
|
+
const { font, syntheticBold, syntheticItalic } = explicit ? { font: explicit, syntheticBold: bold, syntheticItalic: italic } :
|
|
7579
|
+
selectFont(fallback ? undefined : this.fonts, bold, italic);
|
|
7511
7580
|
const shared = font ? this.programs.get(font) : undefined;
|
|
7512
7581
|
const resource = new PdfFontResource(this.resources.length + 1, bold, italic, font, this.objects, syntheticBold, syntheticItalic, shared, this.signal);
|
|
7513
7582
|
if (!shared) {
|
|
@@ -7521,7 +7590,7 @@ class PdfFontResources {
|
|
|
7521
7590
|
dictionary() { return "<< " + this.resources.map(f => "/" + f.name + " " + f.object + " 0 R").join(" ") + " >>"; }
|
|
7522
7591
|
}
|
|
7523
7592
|
const _exports = Object.freeze({ PdfFontResource: PdfFontResource, PdfFontResources: PdfFontResources });
|
|
7524
|
-
_modules.set("
|
|
7593
|
+
_modules.set("7825c87ba92a9992baf6b5c8a5e146948268985c31584ef9c8bf395359942e4f", _exports);
|
|
7525
7594
|
return _exports;
|
|
7526
7595
|
})();
|
|
7527
7596
|
|
|
@@ -7850,7 +7919,7 @@ _modules.set("8be3fb029e08d100ce8ffcf50916d5ba7f7bc00d62156cc33815fd58554a9ed6",
|
|
|
7850
7919
|
return _exports;
|
|
7851
7920
|
})();
|
|
7852
7921
|
|
|
7853
|
-
const _m71 = _modules.get("
|
|
7922
|
+
const _m71 = _modules.get("abbfad7ffb3c318822659c9fbde9126630ce2c137dc2e2b88402148424255e2d") ?? (() => {
|
|
7854
7923
|
const { NotSupportedError, OfficeIMOError } = _m2;
|
|
7855
7924
|
|
|
7856
7925
|
const { copyExportLink } = _m7;
|
|
@@ -8042,11 +8111,11 @@ async function wrapPdfText(captured, fonts, size, width, settings, wrap = true)
|
|
|
8042
8111
|
return lines;
|
|
8043
8112
|
}
|
|
8044
8113
|
const _exports = Object.freeze({ capturePdfText: capturePdfText, wrapPdfText: wrapPdfText });
|
|
8045
|
-
_modules.set("
|
|
8114
|
+
_modules.set("abbfad7ffb3c318822659c9fbde9126630ce2c137dc2e2b88402148424255e2d", _exports);
|
|
8046
8115
|
return _exports;
|
|
8047
8116
|
})();
|
|
8048
8117
|
|
|
8049
|
-
const _m73 = _modules.get("
|
|
8118
|
+
const _m73 = _modules.get("04b189837f06067364240b6731efdf86d61d81fd0848fac3666f25c5f27817b8") ?? (() => {
|
|
8050
8119
|
const { OfficeIMOError } = _m2;
|
|
8051
8120
|
|
|
8052
8121
|
const { wrapPdfText } = _m71;
|
|
@@ -8141,11 +8210,11 @@ function alignBandBlocks(bands, settings) {
|
|
|
8141
8210
|
cells: row.cells.map(cell => ({ ...cell, height: heights.slice(index, index + (cell.rowSpan ?? 1)).reduce((sum, value) => sum + value, 0) })) })));
|
|
8142
8211
|
}
|
|
8143
8212
|
const _exports = Object.freeze({ planTableBands: planTableBands, projectBandRows: projectBandRows, alignBandBlocks: alignBandBlocks });
|
|
8144
|
-
_modules.set("
|
|
8213
|
+
_modules.set("04b189837f06067364240b6731efdf86d61d81fd0848fac3666f25c5f27817b8", _exports);
|
|
8145
8214
|
return _exports;
|
|
8146
8215
|
})();
|
|
8147
8216
|
|
|
8148
|
-
const _m69 = _modules.get("
|
|
8217
|
+
const _m69 = _modules.get("6fd77694f46f8c87510a82e8a58a3c424099d6172bfb1942f92d048b39169945") ?? (() => {
|
|
8149
8218
|
const { ExportCell } = _m5;
|
|
8150
8219
|
|
|
8151
8220
|
const { copyExportLink } = _m7;
|
|
@@ -8376,7 +8445,7 @@ class PdfTableLayout {
|
|
|
8376
8445
|
}
|
|
8377
8446
|
}
|
|
8378
8447
|
const _exports = Object.freeze({ PdfTableLayout: PdfTableLayout });
|
|
8379
|
-
_modules.set("
|
|
8448
|
+
_modules.set("6fd77694f46f8c87510a82e8a58a3c424099d6172bfb1942f92d048b39169945", _exports);
|
|
8380
8449
|
return _exports;
|
|
8381
8450
|
})();
|
|
8382
8451
|
|
|
@@ -8732,7 +8801,7 @@ _modules.set("c68d18d668366fb9b96d1b53c79dc6305f84cb83c05e4942fcf1cdf96ed1a73f",
|
|
|
8732
8801
|
return _exports;
|
|
8733
8802
|
})();
|
|
8734
8803
|
|
|
8735
|
-
const _m79 = _modules.get("
|
|
8804
|
+
const _m79 = _modules.get("8fc594bfca7312071f0f128ad25fb929d023d176323e66e389cddd27032a4d15") ?? (() => {
|
|
8736
8805
|
const { settings } = _m56;
|
|
8737
8806
|
|
|
8738
8807
|
/** @internal Every section derives from captured document defaults, never the preceding section. */
|
|
@@ -8747,11 +8816,11 @@ function sectionSettings(base, section) {
|
|
|
8747
8816
|
return { ...base, page: derived.page, margins: derived.margins, options };
|
|
8748
8817
|
}
|
|
8749
8818
|
const _exports = Object.freeze({ sectionSettings: sectionSettings });
|
|
8750
|
-
_modules.set("
|
|
8819
|
+
_modules.set("8fc594bfca7312071f0f128ad25fb929d023d176323e66e389cddd27032a4d15", _exports);
|
|
8751
8820
|
return _exports;
|
|
8752
8821
|
})();
|
|
8753
8822
|
|
|
8754
|
-
const _m74 = _modules.get("
|
|
8823
|
+
const _m74 = _modules.get("c16c0303d9d4be12ab9e0bab7cfdac73b252ed233c9689e3e0141cc8115aa941") ?? (() => {
|
|
8755
8824
|
const { OfficeIMOError } = _m2;
|
|
8756
8825
|
|
|
8757
8826
|
const { checkAbort } = _m4;
|
|
@@ -8812,6 +8881,7 @@ class PdfPages {
|
|
|
8812
8881
|
rectangleLefts;
|
|
8813
8882
|
rectangleColumns = [];
|
|
8814
8883
|
externalObjects = new Map();
|
|
8884
|
+
opacityStates = new Map();
|
|
8815
8885
|
bandFlow;
|
|
8816
8886
|
bandCellBudget = false;
|
|
8817
8887
|
tableElement;
|
|
@@ -9394,6 +9464,20 @@ class PdfPages {
|
|
|
9394
9464
|
}
|
|
9395
9465
|
async pageBreak() { await this.ensureStarted(); await this.finishPage(); await this.start(false); }
|
|
9396
9466
|
registerXObject(name, id) { this.externalObjects.set(name, id); }
|
|
9467
|
+
/** One shared constant-opacity graphics state per serialized alpha value. */
|
|
9468
|
+
opacityState(alpha) {
|
|
9469
|
+
const value = pdfNumber(alpha);
|
|
9470
|
+
let name = this.opacityStates.get(value);
|
|
9471
|
+
if (!name) {
|
|
9472
|
+
name = "GA" + (this.opacityStates.size + 1);
|
|
9473
|
+
this.opacityStates.set(value, name);
|
|
9474
|
+
}
|
|
9475
|
+
return name;
|
|
9476
|
+
}
|
|
9477
|
+
graphicsStates() {
|
|
9478
|
+
const entries = [...this.opacityStates].map(([alpha, name]) => "/" + name + " << /ca " + alpha + " /CA " + alpha + " >>");
|
|
9479
|
+
return entries.length ? " /ExtGState << " + entries.join(" ") + " >>" : "";
|
|
9480
|
+
}
|
|
9397
9481
|
/** Height after the existing fit-to-page graphic policy, used by heading keep constraints. */
|
|
9398
9482
|
graphicHeight(width, height) {
|
|
9399
9483
|
const { page, margins } = this.settings;
|
|
@@ -9489,7 +9573,7 @@ class PdfPages {
|
|
|
9489
9573
|
}
|
|
9490
9574
|
}
|
|
9491
9575
|
const _exports = Object.freeze({ PdfPages: PdfPages });
|
|
9492
|
-
_modules.set("
|
|
9576
|
+
_modules.set("c16c0303d9d4be12ab9e0bab7cfdac73b252ed233c9689e3e0141cc8115aa941", _exports);
|
|
9493
9577
|
return _exports;
|
|
9494
9578
|
})();
|
|
9495
9579
|
|
|
@@ -9932,7 +10016,7 @@ _modules.set("52c78ca6833cee7e5a96b657e2c00172d550176daf2c95e742692f8416977bea",
|
|
|
9932
10016
|
return _exports;
|
|
9933
10017
|
})();
|
|
9934
10018
|
|
|
9935
|
-
const _m59 = _modules.get("
|
|
10019
|
+
const _m59 = _modules.get("3de6cb5a744388b84e9e2295a2e580e70ab993d44bbb4c94da5f98daba11c350") ?? (() => {
|
|
9936
10020
|
const { PdfObjects, unicodeHex } = _m60;
|
|
9937
10021
|
|
|
9938
10022
|
const { PdfFontResources } = _m62;
|
|
@@ -9984,22 +10068,23 @@ class PdfWriteSession {
|
|
|
9984
10068
|
await pages.finish();
|
|
9985
10069
|
for (const font of fonts.resources)
|
|
9986
10070
|
await font.write(objects, options.compression !== false);
|
|
9987
|
-
await objects.object(this.resources, "<< /Font " + fonts.dictionary() + pages.xobjects() + " >>");
|
|
10071
|
+
await objects.object(this.resources, "<< /Font " + fonts.dictionary() + pages.xobjects() + pages.graphicsStates() + " >>");
|
|
9988
10072
|
await objects.object(this.parent, "<< /Type /Pages /Count " + pages.references.length + " /Kids [" + pages.references.map(id => id + " 0 R").join(" ") + "] >>");
|
|
9989
10073
|
if (this.structure)
|
|
9990
10074
|
await this.structure.finish();
|
|
9991
10075
|
await this.outlines.finish();
|
|
9992
10076
|
await objects.object(this.root, "<< /Type /Catalog /Pages " + this.parent + " 0 R" + (this.structure?.catalogDictionary ?? "") + this.outlines.catalogDictionary + " >>");
|
|
9993
|
-
|
|
10077
|
+
const title = options.metadataTitle ?? options.title;
|
|
10078
|
+
await objects.object(this.info, "<< /Producer (OfficeIMO.js)" + (title === undefined ? "" : " /Title <feff" + unicodeHex(title) + ">") + " >>");
|
|
9994
10079
|
await objects.finish(this.root, this.info);
|
|
9995
10080
|
}
|
|
9996
10081
|
}
|
|
9997
10082
|
const _exports = Object.freeze({ PdfWriteSession: PdfWriteSession });
|
|
9998
|
-
_modules.set("
|
|
10083
|
+
_modules.set("3de6cb5a744388b84e9e2295a2e580e70ab993d44bbb4c94da5f98daba11c350", _exports);
|
|
9999
10084
|
return _exports;
|
|
10000
10085
|
})();
|
|
10001
10086
|
|
|
10002
|
-
const _m55 = _modules.get("
|
|
10087
|
+
const _m55 = _modules.get("01ffda1779a340d72e953fd6e02429f341c89fcab28eb0fce4dc8beb65a5fd43") ?? (() => {
|
|
10003
10088
|
const { BlobByteSink, withDestination } = _m3;
|
|
10004
10089
|
|
|
10005
10090
|
const { beginTask, checkAbort, consumeRows, pause, taskYieldDue } = _m4;
|
|
@@ -10064,11 +10149,11 @@ async function writePdfTo(rows, destination, configuration) {
|
|
|
10064
10149
|
});
|
|
10065
10150
|
}
|
|
10066
10151
|
const _exports = Object.freeze({ writePdf: writePdf, writePdfTo: writePdfTo });
|
|
10067
|
-
_modules.set("
|
|
10152
|
+
_modules.set("01ffda1779a340d72e953fd6e02429f341c89fcab28eb0fce4dc8beb65a5fd43", _exports);
|
|
10068
10153
|
return _exports;
|
|
10069
10154
|
})();
|
|
10070
10155
|
|
|
10071
|
-
const _m86 = _modules.get("
|
|
10156
|
+
const _m86 = _modules.get("6b0244b5ec6d550c705b4e4cbb47997331f1ecd99e2bf8a06f7c646eebbffbf8") ?? (() => {
|
|
10072
10157
|
const { NotSupportedError, OfficeIMOError } = _m2;
|
|
10073
10158
|
|
|
10074
10159
|
const { checkAbort, pause, taskYieldDue, withAbort } = _m4;
|
|
@@ -10077,15 +10162,10 @@ const { Crc32 } = _m28;
|
|
|
10077
10162
|
|
|
10078
10163
|
const signature = [137, 80, 78, 71, 13, 10, 26, 10];
|
|
10079
10164
|
const unsupportedChunks = new Set(["PLTE", "tRNS", "iCCP", "sRGB", "gAMA", "cHRM", "cICP", "mDCV", "cLLI", "sBIT", "eXIf", "acTL", "fcTL", "fdAT"]);
|
|
10080
|
-
/** Decode
|
|
10081
|
-
async function pngPixels(
|
|
10165
|
+
/** Decode an owned static unprofiled PNG without canvas or a second compression engine. */
|
|
10166
|
+
async function pngPixels(source, shape, signal) {
|
|
10082
10167
|
checkAbort(signal);
|
|
10083
|
-
const shape = pngShape(inputSource, maxPixels);
|
|
10084
10168
|
const imagePixels = shape.width * shape.height;
|
|
10085
|
-
const workingBytes = inputSource.length + imagePixels * shape.components + (shape.components === 4 ? shape.width * 8 : 0);
|
|
10086
|
-
if (maxWorkingBytes !== undefined && workingBytes > maxWorkingBytes)
|
|
10087
|
-
throw new OfficeIMOError("RESOURCE_LIMIT", "maxImageWorkingBytes exceeded by PNG source, image planes and scanlines.");
|
|
10088
|
-
const source = new Uint8Array(inputSource);
|
|
10089
10169
|
const header = await pngHeader(source, shape, signal);
|
|
10090
10170
|
checkAbort(signal);
|
|
10091
10171
|
let stream;
|
|
@@ -10099,9 +10179,6 @@ async function pngPixels(inputSource, maxPixels, signal, maxWorkingBytes) {
|
|
|
10099
10179
|
}
|
|
10100
10180
|
const { width, height, components } = header, rowBytes = width * components;
|
|
10101
10181
|
const expected = (rowBytes + 1) * height;
|
|
10102
|
-
// All dimensions and the exact filtered length are bounded before allocating decoded pixels.
|
|
10103
|
-
if (!Number.isSafeInteger(expected) || expected > 0x7fffffff)
|
|
10104
|
-
throw new OfficeIMOError("RESOURCE_LIMIT", "PNG filtered data exceeds the supported decoded byte length.");
|
|
10105
10182
|
// RGBA is reconstructed one scanline at a time directly into PDF RGB/alpha planes.
|
|
10106
10183
|
// It never retains an additional full interleaved RGBA image.
|
|
10107
10184
|
const pixels = new Uint8Array(width * height * 3), alpha = components === 4 ? new Uint8Array(imagePixels) : undefined;
|
|
@@ -10249,20 +10326,55 @@ async function verifyPngZlibEnd(source, header, expected, signal) {
|
|
|
10249
10326
|
reader.releaseLock();
|
|
10250
10327
|
}
|
|
10251
10328
|
}
|
|
10329
|
+
function pngChunk(source, view, offset) {
|
|
10330
|
+
if (offset + 12 > source.length)
|
|
10331
|
+
throw new TypeError("Truncated PNG chunk.");
|
|
10332
|
+
const length = view.getUint32(offset), end = offset + 12 + length;
|
|
10333
|
+
if (length > 0x7fffffff || end > source.length)
|
|
10334
|
+
throw new TypeError("Truncated or oversized PNG chunk.");
|
|
10335
|
+
const type = String.fromCharCode(...source.subarray(offset + 4, offset + 8));
|
|
10336
|
+
if (!/^[A-Za-z]{2}[A-Z][A-Za-z]$/.test(type))
|
|
10337
|
+
throw new TypeError("Invalid PNG chunk type.");
|
|
10338
|
+
return { length, end, type };
|
|
10339
|
+
}
|
|
10340
|
+
function checkAncillaryChunk(type) {
|
|
10341
|
+
if (unsupportedChunks.has(type))
|
|
10342
|
+
throw new NotSupportedError("PNG chunk " + type + "; normalize color, orientation, transparency or animation first");
|
|
10343
|
+
if (type.charCodeAt(0) < 97)
|
|
10344
|
+
throw new NotSupportedError("Required PNG chunk " + type);
|
|
10345
|
+
}
|
|
10346
|
+
/** Check the image profile for SVG placement without inflating pixels. Embedding still verifies CRCs and image data. */
|
|
10347
|
+
function pngEmbeddableSize(source) {
|
|
10348
|
+
const shape = pngShape(source, Infinity);
|
|
10349
|
+
const view = new DataView(source.buffer, source.byteOffset, source.byteLength);
|
|
10350
|
+
let hasData = false, dataClosed = false;
|
|
10351
|
+
for (let offset = 33; offset < source.length;) {
|
|
10352
|
+
const { length, end, type } = pngChunk(source, view, offset);
|
|
10353
|
+
if (type === "IEND") {
|
|
10354
|
+
if (length === 0 && hasData && end === source.length)
|
|
10355
|
+
return shape;
|
|
10356
|
+
break;
|
|
10357
|
+
}
|
|
10358
|
+
if (type === "IDAT") {
|
|
10359
|
+
if (dataClosed)
|
|
10360
|
+
throw new TypeError("PNG IDAT chunks must be consecutive.");
|
|
10361
|
+
hasData = true;
|
|
10362
|
+
}
|
|
10363
|
+
else {
|
|
10364
|
+
checkAncillaryChunk(type);
|
|
10365
|
+
dataClosed ||= hasData;
|
|
10366
|
+
}
|
|
10367
|
+
offset = end;
|
|
10368
|
+
}
|
|
10369
|
+
throw new TypeError("PNG requires a final empty IEND after IDAT.");
|
|
10370
|
+
}
|
|
10252
10371
|
/** Verify the complete source and critical chunk order before any decompressed image allocation. */
|
|
10253
10372
|
async function pngHeader(source, shape, signal) {
|
|
10254
10373
|
const view = new DataView(source.buffer, source.byteOffset, source.byteLength);
|
|
10255
10374
|
let firstData = 0, dataEnd = 0, lastDataByte = -1, dataClosed = false;
|
|
10256
10375
|
for (let offset = 8; offset < source.length;) {
|
|
10257
10376
|
checkAbort(signal);
|
|
10258
|
-
|
|
10259
|
-
throw new TypeError("Truncated PNG chunk.");
|
|
10260
|
-
const length = view.getUint32(offset), end = offset + 12 + length;
|
|
10261
|
-
if (length > 0x7fffffff || end > source.length)
|
|
10262
|
-
throw new TypeError("Truncated or oversized PNG chunk.");
|
|
10263
|
-
const type = String.fromCharCode(...source.subarray(offset + 4, offset + 8));
|
|
10264
|
-
if (!/^[A-Za-z]{2}[A-Z][A-Za-z]$/.test(type))
|
|
10265
|
-
throw new TypeError("Invalid PNG chunk type.");
|
|
10377
|
+
const { length, end, type } = pngChunk(source, view, offset);
|
|
10266
10378
|
const crc = new Crc32();
|
|
10267
10379
|
for (let p = offset + 4; p < end - 4; p += 65536) {
|
|
10268
10380
|
crc.update(source.subarray(p, Math.min(end - 4, p + 65536)));
|
|
@@ -10294,17 +10406,14 @@ async function pngHeader(source, shape, signal) {
|
|
|
10294
10406
|
throw new TypeError("PNG requires a final empty IEND after IDAT.");
|
|
10295
10407
|
return { ...shape, firstData, dataEnd, lastDataByte };
|
|
10296
10408
|
}
|
|
10297
|
-
|
|
10298
|
-
throw new NotSupportedError("PNG chunk " + type + "; normalize color, orientation, transparency or animation first");
|
|
10299
|
-
if ((source[offset + 4] & 32) === 0)
|
|
10300
|
-
throw new NotSupportedError("Required PNG chunk " + type);
|
|
10409
|
+
checkAncillaryChunk(type);
|
|
10301
10410
|
}
|
|
10302
10411
|
offset = end;
|
|
10303
10412
|
}
|
|
10304
10413
|
throw new TypeError("PNG requires a complete final IEND chunk.");
|
|
10305
10414
|
}
|
|
10306
10415
|
/** Check source metadata synchronously, before capturing source bytes or allocating any image plane. */
|
|
10307
|
-
function pngShape(source, maxPixels) {
|
|
10416
|
+
function pngShape(source, maxPixels, maxWorkingBytes) {
|
|
10308
10417
|
if (source.length < 33 || signature.some((value, index) => source[index] !== value))
|
|
10309
10418
|
throw new TypeError("Invalid PNG signature or truncated IHDR.");
|
|
10310
10419
|
const view = new DataView(source.buffer, source.byteOffset, source.byteLength);
|
|
@@ -10324,6 +10433,9 @@ function pngShape(source, maxPixels) {
|
|
|
10324
10433
|
const components = source[25] === 6 ? 4 : 3;
|
|
10325
10434
|
if (!Number.isSafeInteger((width * components + 1) * height) || (width * components + 1) * height > 0x7fffffff)
|
|
10326
10435
|
throw new OfficeIMOError("RESOURCE_LIMIT", "PNG filtered data exceeds the supported decoded byte length.");
|
|
10436
|
+
const workingBytes = source.length + width * height * components + (components === 4 ? width * 8 : 0);
|
|
10437
|
+
if (maxWorkingBytes !== undefined && workingBytes > maxWorkingBytes)
|
|
10438
|
+
throw new OfficeIMOError("RESOURCE_LIMIT", "maxImageWorkingBytes exceeded by PNG source, image planes and scanlines.");
|
|
10327
10439
|
return { width, height, components };
|
|
10328
10440
|
}
|
|
10329
10441
|
function paeth(left, up, upperLeft) {
|
|
@@ -10331,64 +10443,93 @@ function paeth(left, up, upperLeft) {
|
|
|
10331
10443
|
const a = Math.abs(prediction - left), b = Math.abs(prediction - up), c = Math.abs(prediction - upperLeft);
|
|
10332
10444
|
return a <= b && a <= c ? left : b <= c ? up : upperLeft;
|
|
10333
10445
|
}
|
|
10334
|
-
const _exports = Object.freeze({ pngPixels: pngPixels });
|
|
10335
|
-
_modules.set("
|
|
10446
|
+
const _exports = Object.freeze({ pngPixels: pngPixels, pngEmbeddableSize: pngEmbeddableSize, pngShape: pngShape });
|
|
10447
|
+
_modules.set("6b0244b5ec6d550c705b4e4cbb47997331f1ecd99e2bf8a06f7c646eebbffbf8", _exports);
|
|
10336
10448
|
return _exports;
|
|
10337
10449
|
})();
|
|
10338
10450
|
|
|
10339
|
-
const _m85 = _modules.get("
|
|
10451
|
+
const _m85 = _modules.get("32ca4982f963f400829c2e364b7d3479f36d91740dafb32d600f29b5cac487ec") ?? (() => {
|
|
10340
10452
|
const { NotSupportedError, OfficeIMOError } = _m2;
|
|
10341
10453
|
|
|
10342
10454
|
const { checkAbort, pause, taskYieldDue } = _m4;
|
|
10343
10455
|
|
|
10344
|
-
const { pngPixels } = _m86;
|
|
10456
|
+
const { pngPixels, pngShape } = _m86;
|
|
10345
10457
|
|
|
10346
10458
|
/** Shared document image resources; source objects are captured on first consumption. */
|
|
10347
10459
|
class PdfDocumentImages {
|
|
10348
10460
|
objects;
|
|
10349
10461
|
settings;
|
|
10350
10462
|
images = new Map();
|
|
10463
|
+
snapshots = new WeakMap();
|
|
10351
10464
|
bytes = 0;
|
|
10465
|
+
pendingBytes = 0;
|
|
10352
10466
|
constructor(objects, settings) {
|
|
10353
10467
|
this.objects = objects;
|
|
10354
10468
|
this.settings = settings;
|
|
10355
10469
|
}
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
if (
|
|
10359
|
-
return
|
|
10470
|
+
/** Own a drawing image before preparing earlier elements can yield to the caller. */
|
|
10471
|
+
snapshot(image) {
|
|
10472
|
+
if (this.images.has(image) || this.snapshots.has(image))
|
|
10473
|
+
return;
|
|
10474
|
+
const captured = this.capture(image);
|
|
10475
|
+
this.snapshots.set(image, captured);
|
|
10476
|
+
this.pendingBytes += captured.data.length;
|
|
10477
|
+
}
|
|
10478
|
+
capture(image) {
|
|
10360
10479
|
const { limits, options } = this.settings;
|
|
10480
|
+
checkAbort(options.signal);
|
|
10361
10481
|
if (!image || typeof image !== "object")
|
|
10362
10482
|
throw new TypeError("PDF images require a byte array.");
|
|
10363
|
-
const
|
|
10483
|
+
const format = image.format;
|
|
10484
|
+
// Dimension getters may change a resizable backing buffer. Read them before measuring the byte view.
|
|
10485
|
+
const raw = format === "rgb" || format === "rgba" ? image : undefined;
|
|
10486
|
+
const widthValue = raw?.width, heightValue = raw?.height;
|
|
10487
|
+
const data = image.data;
|
|
10364
10488
|
if (!(data instanceof Uint8Array))
|
|
10365
10489
|
throw new TypeError("PDF images require a byte array.");
|
|
10366
10490
|
const byteLength = data.length;
|
|
10367
|
-
if (this.bytes + byteLength > limits.maxImageBytes)
|
|
10491
|
+
if (this.bytes + this.pendingBytes + byteLength > limits.maxImageBytes)
|
|
10368
10492
|
throw new OfficeIMOError("RESOURCE_LIMIT", "maxImageBytes exceeded.");
|
|
10369
|
-
let width, height, components, decoded, decodedAlpha;
|
|
10370
10493
|
const maximumWorkingBytes = limits.maxImageWorkingBytes;
|
|
10371
|
-
if (format === "png")
|
|
10372
|
-
|
|
10373
|
-
|
|
10374
|
-
|
|
10494
|
+
if (format === "png") {
|
|
10495
|
+
const shape = pngShape(data, limits.maxImagePixels, maximumWorkingBytes);
|
|
10496
|
+
return { format, shape, data: new Uint8Array(data) };
|
|
10497
|
+
}
|
|
10498
|
+
let shape;
|
|
10499
|
+
if (format === "jpeg")
|
|
10500
|
+
shape = jpegSize(data);
|
|
10375
10501
|
else if (format === "rgb" || format === "rgba") {
|
|
10376
|
-
|
|
10377
|
-
components = format === "rgba" ? 4 : 3;
|
|
10502
|
+
shape = { width: widthValue, height: heightValue, components: format === "rgba" ? 4 : 3 };
|
|
10378
10503
|
}
|
|
10379
10504
|
else
|
|
10380
10505
|
throw new NotSupportedError("PDF images support unprofiled PNG/JPEG or decoded RGB/RGBA pixels.");
|
|
10506
|
+
const { width, height, components } = shape;
|
|
10381
10507
|
if (!Number.isSafeInteger(width) || !Number.isSafeInteger(height) || width < 1 || height < 1 ||
|
|
10382
10508
|
!Number.isSafeInteger(width * height) || width * height > limits.maxImagePixels)
|
|
10383
10509
|
throw new OfficeIMOError("RESOURCE_LIMIT", "Image dimensions must be positive integers within maxImagePixels.");
|
|
10384
|
-
if (
|
|
10510
|
+
if (format !== "jpeg" && byteLength !== width * height * components)
|
|
10385
10511
|
throw new RangeError("Raw image bytes must match width × height × channels exactly.");
|
|
10386
|
-
if (
|
|
10512
|
+
if (maximumWorkingBytes !== undefined && byteLength + (components === 4 ? width * height : 0) > maximumWorkingBytes)
|
|
10387
10513
|
throw new OfficeIMOError("RESOURCE_LIMIT", "maxImageWorkingBytes exceeded by image snapshot and alpha plane.");
|
|
10514
|
+
return { format, shape, data: new Uint8Array(data) };
|
|
10515
|
+
}
|
|
10516
|
+
async prepare(image) {
|
|
10517
|
+
const existing = this.images.get(image);
|
|
10518
|
+
if (existing)
|
|
10519
|
+
return existing;
|
|
10520
|
+
const { options } = this.settings, snapshot = this.snapshots.get(image);
|
|
10521
|
+
const source = snapshot ?? this.capture(image);
|
|
10522
|
+
if (snapshot) {
|
|
10523
|
+
this.snapshots.delete(image);
|
|
10524
|
+
this.pendingBytes -= source.data.length;
|
|
10525
|
+
}
|
|
10526
|
+
this.bytes += source.data.length;
|
|
10527
|
+
const { format } = source;
|
|
10528
|
+
const decoded = format === "png" ? await pngPixels(source.data, source.shape, options.signal) : undefined;
|
|
10529
|
+
const { width, height, components } = decoded ?? source.shape;
|
|
10388
10530
|
checkAbort(options.signal);
|
|
10389
10531
|
const id = this.objects.reserve(), name = "Image" + (this.images.size + 1);
|
|
10390
|
-
|
|
10391
|
-
const captured = decoded ?? new Uint8Array(data);
|
|
10532
|
+
const captured = decoded?.data ?? source.data, decodedAlpha = decoded?.alpha;
|
|
10392
10533
|
let pixels = captured, alpha = decodedAlpha, mask;
|
|
10393
10534
|
if (components === 4) {
|
|
10394
10535
|
// Compact the owned RGBA snapshot in place. Forward writes never overwrite unread channels.
|
|
@@ -10410,20 +10551,22 @@ class PdfDocumentImages {
|
|
|
10410
10551
|
mask = this.objects.reserve();
|
|
10411
10552
|
await this.objects.stream(mask, alpha, "/Type /XObject /Subtype /Image /Width " + width + " /Height " + height + " /ColorSpace /DeviceGray /BitsPerComponent 8", options.compression !== false, true);
|
|
10412
10553
|
}
|
|
10554
|
+
const jpegFilter = format === "jpeg" ? " /Filter /DCTDecode" +
|
|
10555
|
+
(source.shape.colorTransform === 0 ? " /DecodeParms << /ColorTransform 0 >>" : "") : "";
|
|
10413
10556
|
const dictionary = "/Type /XObject /Subtype /Image /Width " + width + " /Height " + height + " /ColorSpace /" +
|
|
10414
10557
|
(components === 1 ? "DeviceGray" : "DeviceRGB") + " /BitsPerComponent 8" + (mask ? " /SMask " + mask + " 0 R" : "") +
|
|
10415
|
-
|
|
10558
|
+
jpegFilter;
|
|
10416
10559
|
await this.objects.stream(id, pixels, dictionary, format === "jpeg" ? false : options.compression !== false, true);
|
|
10417
10560
|
const resource = { name, id, width, height };
|
|
10418
10561
|
this.images.set(image, resource);
|
|
10419
10562
|
return resource;
|
|
10420
10563
|
}
|
|
10421
10564
|
}
|
|
10422
|
-
/** Inspect bounded JPEG headers; JPEG entropy decoding remains the independent reader's job. */
|
|
10565
|
+
/** @internal Inspect bounded JPEG headers; JPEG entropy decoding remains the independent reader's job. */
|
|
10423
10566
|
function jpegSize(bytes) {
|
|
10424
10567
|
if (bytes.length < 4 || bytes[0] !== 255 || bytes[1] !== 216 || bytes[bytes.length - 2] !== 255 || bytes[bytes.length - 1] !== 217)
|
|
10425
10568
|
throw new TypeError("JPEG images need complete SOI/EOI markers.");
|
|
10426
|
-
let result;
|
|
10569
|
+
let result, rgb = false, adobe = false;
|
|
10427
10570
|
for (let p = 2; p < bytes.length;) {
|
|
10428
10571
|
if (bytes[p++] !== 255)
|
|
10429
10572
|
throw new TypeError("Invalid JPEG marker.");
|
|
@@ -10433,7 +10576,8 @@ function jpegSize(bytes) {
|
|
|
10433
10576
|
if (marker === 218) {
|
|
10434
10577
|
if (!result)
|
|
10435
10578
|
throw new TypeError("JPEG scan precedes its frame header.");
|
|
10436
|
-
|
|
10579
|
+
// PDF decoders otherwise assume a color transform for three-component JPEGs.
|
|
10580
|
+
return rgb && !adobe ? { ...result, colorTransform: 0 } : result;
|
|
10437
10581
|
}
|
|
10438
10582
|
if (marker === 217)
|
|
10439
10583
|
break;
|
|
@@ -10442,6 +10586,8 @@ function jpegSize(bytes) {
|
|
|
10442
10586
|
const length = bytes[p] * 256 + bytes[p + 1], end = p + length;
|
|
10443
10587
|
if (length < 2 || end > bytes.length)
|
|
10444
10588
|
throw new TypeError("Truncated JPEG segment.");
|
|
10589
|
+
if (marker === 238 && length >= 14 && String.fromCharCode(...bytes.subarray(p + 2, p + 7)) === "Adobe")
|
|
10590
|
+
adobe = true;
|
|
10445
10591
|
if (marker === 226 && length >= 14 && String.fromCharCode(...bytes.subarray(p + 2, p + 14)) === "ICC_PROFILE\0")
|
|
10446
10592
|
throw new NotSupportedError("Normalize ICC-profiled JPEG colors before PDF embedding.");
|
|
10447
10593
|
if (marker === 225 && length >= 8 && String.fromCharCode(...bytes.subarray(p + 2, p + 8)) === "Exif\0\0")
|
|
@@ -10454,7 +10600,8 @@ function jpegSize(bytes) {
|
|
|
10454
10600
|
throw new NotSupportedError("PDF JPEG images require grayscale or RGB components; CMYK is unsupported.");
|
|
10455
10601
|
if (components === 3) {
|
|
10456
10602
|
const ids = [bytes[p + 8], bytes[p + 11], bytes[p + 14]].join(",");
|
|
10457
|
-
|
|
10603
|
+
rgb = ids === "82,71,66";
|
|
10604
|
+
if (ids !== "1,2,3" && !rgb)
|
|
10458
10605
|
throw new NotSupportedError("Unsupported JPEG component color layout.");
|
|
10459
10606
|
}
|
|
10460
10607
|
if (result)
|
|
@@ -10465,12 +10612,12 @@ function jpegSize(bytes) {
|
|
|
10465
10612
|
}
|
|
10466
10613
|
throw new TypeError("JPEG image has no complete frame and scan.");
|
|
10467
10614
|
}
|
|
10468
|
-
const _exports = Object.freeze({ PdfDocumentImages: PdfDocumentImages });
|
|
10469
|
-
_modules.set("
|
|
10615
|
+
const _exports = Object.freeze({ PdfDocumentImages: PdfDocumentImages, jpegSize: jpegSize });
|
|
10616
|
+
_modules.set("32ca4982f963f400829c2e364b7d3479f36d91740dafb32d600f29b5cac487ec", _exports);
|
|
10470
10617
|
return _exports;
|
|
10471
10618
|
})();
|
|
10472
10619
|
|
|
10473
|
-
const _m87 = _modules.get("
|
|
10620
|
+
const _m87 = _modules.get("9ba2dfd6f5c8ef9b1a51427ddee0d0971b139afdd49a175bf6525812ca7d87c8") ?? (() => {
|
|
10474
10621
|
const { OfficeIMOError } = _m2;
|
|
10475
10622
|
|
|
10476
10623
|
const { checkAbort, pause, taskYieldDue } = _m4;
|
|
@@ -10553,16 +10700,16 @@ async function vectorCommands(block, settings, used) {
|
|
|
10553
10700
|
commands.join("") + (fill !== undefined && stroke !== undefined ? "B" : fill !== undefined ? "f" : "S") + (fill !== undefined && fillRule === "evenodd" ? "*" : "") + "\n" };
|
|
10554
10701
|
}
|
|
10555
10702
|
const _exports = Object.freeze({ vectorCommands: vectorCommands });
|
|
10556
|
-
_modules.set("
|
|
10703
|
+
_modules.set("9ba2dfd6f5c8ef9b1a51427ddee0d0971b139afdd49a175bf6525812ca7d87c8", _exports);
|
|
10557
10704
|
return _exports;
|
|
10558
10705
|
})();
|
|
10559
10706
|
|
|
10560
|
-
const _m88 = _modules.get("
|
|
10707
|
+
const _m88 = _modules.get("da0657c49ac1393409d051be5e5dd70d2a0dc5221d363b422d7da31e9b940ea2") ?? (() => {
|
|
10561
10708
|
const { NotSupportedError, OfficeIMOError } = _m2;
|
|
10562
10709
|
|
|
10563
10710
|
const { checkAbort, pause, taskYieldDue } = _m4;
|
|
10564
10711
|
|
|
10565
|
-
const { color, positive } = _m56;
|
|
10712
|
+
const { color, pdfDrawingMaxDepth, positive } = _m56;
|
|
10566
10713
|
|
|
10567
10714
|
const { pdfNumber: n } = _m60;
|
|
10568
10715
|
|
|
@@ -10584,22 +10731,50 @@ function clipRectangle(value) {
|
|
|
10584
10731
|
const clip = record(value, ["x", "y", "width", "height"], "drawing clip");
|
|
10585
10732
|
return { x: coordinate(clip.x), y: coordinate(clip.y), width: positive(clip.width, "Drawing clip width", 1000000), height: positive(clip.height, "Drawing clip height", 1000000) };
|
|
10586
10733
|
}
|
|
10734
|
+
/** A PDF dash array: 1 through 16 nonnegative lengths, not all zero, and a finite phase. */
|
|
10735
|
+
function dashPattern(value, offset) {
|
|
10736
|
+
if (value === undefined) {
|
|
10737
|
+
if (offset !== undefined)
|
|
10738
|
+
throw new TypeError("Drawing dashOffset requires dash.");
|
|
10739
|
+
return "";
|
|
10740
|
+
}
|
|
10741
|
+
if (!Array.isArray(value) || !value.length || value.length > 16)
|
|
10742
|
+
throw new TypeError("Drawing dash must list 1 through 16 nonnegative lengths with at least one positive length.");
|
|
10743
|
+
const lengths = Array.from(value, item => {
|
|
10744
|
+
if (typeof item !== "number" || !Number.isFinite(item) || item < 0 || item > 14400)
|
|
10745
|
+
throw new TypeError("Drawing dash lengths must be from 0 through 14,400 points.");
|
|
10746
|
+
return n(item);
|
|
10747
|
+
});
|
|
10748
|
+
if (lengths.every(length => length === "0"))
|
|
10749
|
+
throw new TypeError("Drawing dash needs a positive length after PDF rounding.");
|
|
10750
|
+
let phase = coordinate(offset ?? 0);
|
|
10751
|
+
if (phase < 0) {
|
|
10752
|
+
// Work in serialized thousandths of a point. Odd arrays repeat twice before the paint state repeats.
|
|
10753
|
+
const period = lengths.reduce((sum, length) => sum + Math.round(Number(length) * 1000), 0) * (lengths.length % 2 ? 2 : 1);
|
|
10754
|
+
phase = ((Math.round(phase * 1000) % period + period) % period) / 1000;
|
|
10755
|
+
}
|
|
10756
|
+
return "[" + lengths.join(" ") + "] " + n(phase) + " d\n";
|
|
10757
|
+
}
|
|
10587
10758
|
async function cooperate(settings) {
|
|
10588
10759
|
if (taskYieldDue())
|
|
10589
10760
|
await pause();
|
|
10590
10761
|
checkAbort(settings.options.signal);
|
|
10591
10762
|
}
|
|
10592
10763
|
/** Take ownership of one bounded schema before any cooperative or font work can run caller code. */
|
|
10593
|
-
function captureDrawing(drawing, settings, used) {
|
|
10764
|
+
function captureDrawing(drawing, settings, used, images) {
|
|
10594
10765
|
checkAbort(settings.options.signal);
|
|
10595
|
-
const root = record(drawing, ["version", "width", "height", "elements"], "drawing");
|
|
10596
|
-
|
|
10597
|
-
|
|
10766
|
+
const root = record(drawing, ["version", "width", "height", "elements", "standardFonts"], "drawing");
|
|
10767
|
+
const standardFonts = root.standardFonts;
|
|
10768
|
+
if (standardFonts !== undefined && typeof standardFonts !== "boolean")
|
|
10769
|
+
throw new TypeError("Drawing standardFonts must be boolean.");
|
|
10770
|
+
const version = root.version;
|
|
10771
|
+
if (version !== 1 && version !== 2)
|
|
10772
|
+
throw new NotSupportedError("Only portable drawing versions 1 and 2 are supported.");
|
|
10598
10773
|
const width = positive(root.width, "Drawing width"), height = positive(root.height, "Drawing height");
|
|
10599
10774
|
let commands = used.commands, elements = used.elements;
|
|
10600
10775
|
const ancestors = new Set();
|
|
10601
10776
|
function path(value) {
|
|
10602
|
-
record(value, ["kind", "commands", "fill", "stroke", "strokeWidth", "fillRule", "lineCap", "lineJoin"], "drawing path");
|
|
10777
|
+
record(value, ["kind", "commands", "fill", "stroke", "strokeWidth", "fillRule", "lineCap", "lineJoin", "miterLimit", "dash", "dashOffset"], "drawing path");
|
|
10603
10778
|
const source = value.commands;
|
|
10604
10779
|
if (!Array.isArray(source))
|
|
10605
10780
|
throw new TypeError("Drawing path commands must be an array.");
|
|
@@ -10621,6 +10796,10 @@ function captureDrawing(drawing, settings, used) {
|
|
|
10621
10796
|
throw new TypeError("Invalid drawing lineCap.");
|
|
10622
10797
|
if (lineJoin !== undefined && !["miter", "round", "bevel"].includes(lineJoin))
|
|
10623
10798
|
throw new TypeError("Invalid drawing lineJoin.");
|
|
10799
|
+
const miterLimit = positive(value.miterLimit ?? 10, "Drawing miter limit", 1000000);
|
|
10800
|
+
if (miterLimit < 1)
|
|
10801
|
+
throw new RangeError("Drawing miter limit must be at least 1.");
|
|
10802
|
+
const dash = dashPattern(value.dash, value.dashOffset);
|
|
10624
10803
|
for (let i = 0; i < snapshot.length; i++) {
|
|
10625
10804
|
const c = snapshot[i];
|
|
10626
10805
|
if (!c || typeof c !== "object")
|
|
@@ -10653,11 +10832,12 @@ function captureDrawing(drawing, settings, used) {
|
|
|
10653
10832
|
if (!started)
|
|
10654
10833
|
throw new TypeError("A drawing path needs at least one command.");
|
|
10655
10834
|
return { kind: "path", commands: copied, style: (fill === undefined ? "" : fill + " rg\n") + (stroke === undefined ? "" : stroke + " RG\n" + n(strokeWidth) + " w\n") +
|
|
10656
|
-
String(["butt", "round", "square"].indexOf(lineCap ?? "butt")) + " J\n" + String(["miter", "round", "bevel"].indexOf(lineJoin ?? "miter")) +
|
|
10835
|
+
String(["butt", "round", "square"].indexOf(lineCap ?? "butt")) + " J\n" + String(["miter", "round", "bevel"].indexOf(lineJoin ?? "miter")) +
|
|
10836
|
+
" j\n" + n(miterLimit) + " M\n" + dash,
|
|
10657
10837
|
paint: (fill !== undefined && stroke !== undefined ? "B" : fill !== undefined ? "f" : "S") + (fill !== undefined && fillRule === "evenodd" ? "*" : "") + "\n" };
|
|
10658
10838
|
}
|
|
10659
10839
|
function text(value) {
|
|
10660
|
-
record(value, ["kind", "text", "x", "y", "font", "fontSize", "color"], "drawing text");
|
|
10840
|
+
record(value, ["kind", "text", "x", "y", "font", "fontSize", "color", "anchor", "rotation"], "drawing text");
|
|
10661
10841
|
const snapshot = value.text, slot = value.font;
|
|
10662
10842
|
if (typeof snapshot !== "string")
|
|
10663
10843
|
throw new TypeError("Drawing text must be a string.");
|
|
@@ -10668,14 +10848,33 @@ function captureDrawing(drawing, settings, used) {
|
|
|
10668
10848
|
if (!["regular", "bold", "italic", "boldItalic"].includes(slot))
|
|
10669
10849
|
throw new TypeError("Invalid drawing font slot.");
|
|
10670
10850
|
const x = coordinate(value.x), y = coordinate(value.y), size = positive(value.fontSize, "Drawing font size"), foreground = color(value.color);
|
|
10851
|
+
const anchor = value.anchor, rotation = value.rotation ?? 0;
|
|
10852
|
+
if (anchor !== undefined && !["start", "middle", "end"].includes(anchor))
|
|
10853
|
+
throw new TypeError("Invalid drawing text anchor.");
|
|
10854
|
+
if (typeof rotation !== "number" || !Number.isFinite(rotation) || Math.abs(rotation) > 360)
|
|
10855
|
+
throw new RangeError("Drawing text rotation must be finite degrees within -360 through 360.");
|
|
10671
10856
|
settings.budget.cell(snapshot);
|
|
10672
|
-
|
|
10857
|
+
// Quarter turns stay exact so upright and vertical axis labels keep integral matrices.
|
|
10858
|
+
const turn = rotation % 90 === 0 ? (((rotation / 90) % 4) + 4) % 4 : -1, radians = rotation * Math.PI / 180;
|
|
10859
|
+
const cos = turn < 0 ? Math.cos(radians) : [1, 0, -1, 0][turn], sin = turn < 0 ? Math.sin(radians) : [0, 1, 0, -1][turn];
|
|
10860
|
+
return { kind: "text", text: snapshot, x, y, size, color: foreground, font: slot, anchor: anchor === "middle" ? .5 : anchor === "end" ? 1 : 0, cos, sin };
|
|
10861
|
+
}
|
|
10862
|
+
function image(value) {
|
|
10863
|
+
record(value, ["kind", "image", "x", "y", "width", "height", "opacity"], "drawing image");
|
|
10864
|
+
const x = coordinate(value.x), y = coordinate(value.y), suppliedOpacity = value.opacity;
|
|
10865
|
+
const opacity = suppliedOpacity === undefined ? 1 : suppliedOpacity;
|
|
10866
|
+
const width = positive(value.width, "Drawing image width", 1000000), height = positive(value.height, "Drawing image height", 1000000);
|
|
10867
|
+
if (typeof opacity !== "number" || !(opacity >= 0 && opacity <= 1))
|
|
10868
|
+
throw new RangeError("Drawing image opacity must be from 0 through 1.");
|
|
10869
|
+
const source = value.image;
|
|
10870
|
+
images.snapshot(source);
|
|
10871
|
+
return { kind: "image", image: source, x, y, width, height, opacity };
|
|
10673
10872
|
}
|
|
10674
10873
|
function children(input, depth) {
|
|
10675
10874
|
if (!Array.isArray(input))
|
|
10676
10875
|
throw new TypeError("Drawing elements must be an array.");
|
|
10677
|
-
if (depth >
|
|
10678
|
-
throw new RangeError("Drawing groups support at most
|
|
10876
|
+
if (depth > pdfDrawingMaxDepth && input.length)
|
|
10877
|
+
throw new RangeError("Drawing groups support at most " + pdfDrawingMaxDepth + " element levels.");
|
|
10679
10878
|
if (elements + input.length > settings.limits.maxDrawingElements)
|
|
10680
10879
|
throw new OfficeIMOError("RESOURCE_LIMIT", "maxDrawingElements exceeded.");
|
|
10681
10880
|
checkAbort(settings.options.signal);
|
|
@@ -10693,6 +10892,8 @@ function captureDrawing(drawing, settings, used) {
|
|
|
10693
10892
|
output.push(path(value));
|
|
10694
10893
|
else if (kind === "text")
|
|
10695
10894
|
output.push(text(value));
|
|
10895
|
+
else if (kind === "image" && version === 2)
|
|
10896
|
+
output.push(image(value));
|
|
10696
10897
|
else if (kind === "group") {
|
|
10697
10898
|
record(value, ["kind", "clip", "elements"], "drawing group");
|
|
10698
10899
|
const clipValue = value.clip, clip = clipValue === undefined ? undefined : clipRectangle(clipValue);
|
|
@@ -10709,29 +10910,35 @@ function captureDrawing(drawing, settings, used) {
|
|
|
10709
10910
|
}
|
|
10710
10911
|
const plan = children(root.elements, 1);
|
|
10711
10912
|
checkAbort(settings.options.signal);
|
|
10712
|
-
return { width, height, plan, commands: commands - used.commands, elements: elements - used.elements };
|
|
10913
|
+
return { width, height, plan, commands: commands - used.commands, elements: elements - used.elements, standardFonts: standardFonts === true };
|
|
10713
10914
|
}
|
|
10714
10915
|
/** Preflight and paint owned records. The existing font owner retains glyph maps and subsets. */
|
|
10715
|
-
async function prepareDrawing(drawing, settings, fonts, used) {
|
|
10916
|
+
async function prepareDrawing(drawing, settings, fonts, used, resources) {
|
|
10716
10917
|
// A drawing's bounded capture is synchronous; yielding here would leave later caller records borrowed.
|
|
10717
|
-
const captured = captureDrawing(drawing, settings, used), drawingFonts = new Map();
|
|
10918
|
+
const { images } = resources, captured = captureDrawing(drawing, settings, used, images), drawingFonts = new Map();
|
|
10718
10919
|
function fontFor(slot) {
|
|
10719
10920
|
const existing = drawingFonts.get(slot);
|
|
10720
10921
|
if (existing)
|
|
10721
10922
|
return existing;
|
|
10722
|
-
const font = fonts.select(slot === "bold" || slot === "boldItalic", slot === "italic" || slot === "boldItalic");
|
|
10723
|
-
if (
|
|
10923
|
+
const font = fonts.select(slot === "bold" || slot === "boldItalic", slot === "italic" || slot === "boldItalic", undefined, captured.standardFonts);
|
|
10924
|
+
if (font.syntheticBold || font.syntheticItalic || !font.program && !captured.standardFonts)
|
|
10724
10925
|
throw new NotSupportedError("Drawing text without an exact embedded font face at fonts." + slot);
|
|
10725
10926
|
drawingFonts.set(slot, font);
|
|
10726
10927
|
return font;
|
|
10727
10928
|
}
|
|
10728
10929
|
// The work budget belongs to the drawing, including short runs in separate sibling groups.
|
|
10729
10930
|
let preflightCharacters = 0, preflightElements = 0;
|
|
10931
|
+
const imageNames = new Map();
|
|
10730
10932
|
async function preflight(nodes) {
|
|
10731
10933
|
for (let i = 0; i < nodes.length; i++) {
|
|
10732
10934
|
const node = nodes[i];
|
|
10733
10935
|
if (node.kind === "group")
|
|
10734
10936
|
await preflight(node.children);
|
|
10937
|
+
else if (node.kind === "image" && !imageNames.has(node.image)) {
|
|
10938
|
+
const resource = await images.prepare(node.image);
|
|
10939
|
+
resources.registerImage(resource.name, resource.id);
|
|
10940
|
+
imageNames.set(node.image, resource.name);
|
|
10941
|
+
}
|
|
10735
10942
|
else if (node.kind === "text") {
|
|
10736
10943
|
const font = fontFor(node.font);
|
|
10737
10944
|
for (const character of node.text) {
|
|
@@ -10774,9 +10981,23 @@ async function prepareDrawing(drawing, settings, fonts, used) {
|
|
|
10774
10981
|
}
|
|
10775
10982
|
add(node.paint);
|
|
10776
10983
|
}
|
|
10984
|
+
else if (node.kind === "image") {
|
|
10985
|
+
// Image space is a unit square with a bottom-left origin; the drawing's y axis points down.
|
|
10986
|
+
if (node.opacity < 1)
|
|
10987
|
+
add("/" + resources.opacity(node.opacity) + " gs\n");
|
|
10988
|
+
add([node.width, 0, 0, -node.height, node.x, node.y + node.height].map(n).join(" ") + " cm /" + imageNames.get(node.image) + " Do\n");
|
|
10989
|
+
}
|
|
10777
10990
|
else {
|
|
10778
10991
|
const font = fontFor(node.font);
|
|
10779
|
-
|
|
10992
|
+
let shift = 0;
|
|
10993
|
+
if (node.anchor) {
|
|
10994
|
+
for (const character of node.text)
|
|
10995
|
+
shift += font.width(character.codePointAt(0));
|
|
10996
|
+
shift *= node.size / 1000 * node.anchor;
|
|
10997
|
+
}
|
|
10998
|
+
// Text space is upright in the drawing's downward y axis; rotation turns the baseline clockwise about its anchor.
|
|
10999
|
+
add(node.color + " rg\nBT /" + font.name + " " + n(node.size) + " Tf 0 Tr " +
|
|
11000
|
+
[node.cos, node.sin, node.sin, -node.cos, node.x - shift * node.cos, node.y - shift * node.sin].map(n).join(" ") + " Tm <");
|
|
10780
11001
|
let chunk = "";
|
|
10781
11002
|
for (const character of node.text) {
|
|
10782
11003
|
chunk += character;
|
|
@@ -10800,11 +11021,11 @@ async function prepareDrawing(drawing, settings, fonts, used) {
|
|
|
10800
11021
|
return { width: captured.width, height: captured.height, content: fragments.join(""), commands: captured.commands, elements: captured.elements };
|
|
10801
11022
|
}
|
|
10802
11023
|
const _exports = Object.freeze({ checkDrawingBlock: checkDrawingBlock, prepareDrawing: prepareDrawing });
|
|
10803
|
-
_modules.set("
|
|
11024
|
+
_modules.set("da0657c49ac1393409d051be5e5dd70d2a0dc5221d363b422d7da31e9b940ea2", _exports);
|
|
10804
11025
|
return _exports;
|
|
10805
11026
|
})();
|
|
10806
11027
|
|
|
10807
|
-
const _m89 = _modules.get("
|
|
11028
|
+
const _m89 = _modules.get("37923737a6bcae4c342ab023bd3cb01ddeaced28543718aad078b51b54d8f31d") ?? (() => {
|
|
10808
11029
|
const { OfficeIMOError } = _m2;
|
|
10809
11030
|
|
|
10810
11031
|
const { capturePdfText, wrapPdfText } = _m71;
|
|
@@ -10884,11 +11105,11 @@ function paragraphStartHeight(paragraphs) {
|
|
|
10884
11105
|
return required;
|
|
10885
11106
|
}
|
|
10886
11107
|
const _exports = Object.freeze({ captureParagraph: captureParagraph, captureCaption: captureCaption, prepareParagraph: prepareParagraph, checkParagraphBuffer: checkParagraphBuffer, paragraphStartHeight: paragraphStartHeight });
|
|
10887
|
-
_modules.set("
|
|
11108
|
+
_modules.set("37923737a6bcae4c342ab023bd3cb01ddeaced28543718aad078b51b54d8f31d", _exports);
|
|
10888
11109
|
return _exports;
|
|
10889
11110
|
})();
|
|
10890
11111
|
|
|
10891
|
-
const _m90 = _modules.get("
|
|
11112
|
+
const _m90 = _modules.get("964206f2e7c45a34e414d4d690243bf90eb4cf99793e13d1cda834de3d386773") ?? (() => {
|
|
10892
11113
|
const { capturePdfText, wrapPdfText } = _m71;
|
|
10893
11114
|
|
|
10894
11115
|
const { captureParagraph, prepareParagraph } = _m89;
|
|
@@ -10942,11 +11163,11 @@ async function prepareListItem(item, index, options, settings, fonts) {
|
|
|
10942
11163
|
height: paragraph.height + lineHeight - first.lineHeight, firstHeight: paragraph.spaceBefore + lineHeight } };
|
|
10943
11164
|
}
|
|
10944
11165
|
const _exports = Object.freeze({ captureListOptions: captureListOptions, prepareListItem: prepareListItem });
|
|
10945
|
-
_modules.set("
|
|
11166
|
+
_modules.set("964206f2e7c45a34e414d4d690243bf90eb4cf99793e13d1cda834de3d386773", _exports);
|
|
10946
11167
|
return _exports;
|
|
10947
11168
|
})();
|
|
10948
11169
|
|
|
10949
|
-
const _m92 = _modules.get("
|
|
11170
|
+
const _m92 = _modules.get("f254a333f483757dc21be9d40dbd3ca51013d32a3c646b564270e3902226a590") ?? (() => {
|
|
10950
11171
|
const { assertGroupedReportSource } = _m8;
|
|
10951
11172
|
|
|
10952
11173
|
const { captureFields } = _m10;
|
|
@@ -10992,11 +11213,11 @@ function captureGroupedPdfTableOptions(configuration) {
|
|
|
10992
11213
|
...(captured.footerPresentation === undefined ? {} : { footerPresentation: presentation(captured.footerPresentation) }) });
|
|
10993
11214
|
}
|
|
10994
11215
|
const _exports = Object.freeze({ groupedPdfLabelFields: groupedPdfLabelFields, groupedPdfTableFields: groupedPdfTableFields, pdfGroupedTable: pdfGroupedTable, captureGroupedPdfTableOptions: captureGroupedPdfTableOptions });
|
|
10995
|
-
_modules.set("
|
|
11216
|
+
_modules.set("f254a333f483757dc21be9d40dbd3ca51013d32a3c646b564270e3902226a590", _exports);
|
|
10996
11217
|
return _exports;
|
|
10997
11218
|
})();
|
|
10998
11219
|
|
|
10999
|
-
const _m91 = _modules.get("
|
|
11220
|
+
const _m91 = _modules.get("a3ebee86ff33369e9ebc8b994d71bad32497a55433a313c426676277cb660d2f") ?? (() => {
|
|
11000
11221
|
const { assertGroupedReportSource, groupedReportOperation } = _m8;
|
|
11001
11222
|
|
|
11002
11223
|
const { consumeRows } = _m4;
|
|
@@ -11250,11 +11471,11 @@ async function renderGroupedPdfTable(block, context) {
|
|
|
11250
11471
|
}
|
|
11251
11472
|
}
|
|
11252
11473
|
const _exports = Object.freeze({ renderGroupedPdfTable: renderGroupedPdfTable });
|
|
11253
|
-
_modules.set("
|
|
11474
|
+
_modules.set("a3ebee86ff33369e9ebc8b994d71bad32497a55433a313c426676277cb660d2f", _exports);
|
|
11254
11475
|
return _exports;
|
|
11255
11476
|
})();
|
|
11256
11477
|
|
|
11257
|
-
const _m84 = _modules.get("
|
|
11478
|
+
const _m84 = _modules.get("e7fe5a5c6b675c6217db5f5a72d8883609e8417ee3c6f3c2184d375463f93231") ?? (() => {
|
|
11258
11479
|
const { BlobByteSink, withDestination } = _m3;
|
|
11259
11480
|
|
|
11260
11481
|
const { OfficeIMOError } = _m2;
|
|
@@ -11504,7 +11725,9 @@ async function writePdfDocumentTo(blocks, destination, configuration = {}) {
|
|
|
11504
11725
|
const inputDrawing = block.drawing, capturedCaption = snapshotCaption(block.caption), alternative = graphicAlternative(block, pages.settings), alignment = graphicAlignment(block.alignment);
|
|
11505
11726
|
if (capturedCaption && alternative === undefined)
|
|
11506
11727
|
throw new TypeError("A captioned PDF graphic requires alternativeText and cannot be decorative.");
|
|
11507
|
-
const drawing = await prepareDrawing(inputDrawing, pages.settings, fonts, { commands, elements: drawingElements }
|
|
11728
|
+
const drawing = await prepareDrawing(inputDrawing, pages.settings, fonts, { commands, elements: drawingElements }, {
|
|
11729
|
+
images, registerImage: (name, id) => pages.registerXObject(name, id), opacity: alpha => pages.opacityState(alpha)
|
|
11730
|
+
}), caption = await prepareCaption(capturedCaption);
|
|
11508
11731
|
commands += drawing.commands;
|
|
11509
11732
|
drawingElements += drawing.elements;
|
|
11510
11733
|
await flushParagraphs((caption?.height ?? 0) + pages.graphicHeight(drawing.width, drawing.height));
|
|
@@ -11544,11 +11767,11 @@ function captureTableOptions(options) {
|
|
|
11544
11767
|
return { ...captured, ...(captured.wideTable === undefined ? {} : { wideTable: captureWideTable(captured.wideTable) }) };
|
|
11545
11768
|
}
|
|
11546
11769
|
const _exports = Object.freeze({ pdfTable: pdfTable, writePdfDocument: writePdfDocument, writePdfDocumentTo: writePdfDocumentTo });
|
|
11547
|
-
_modules.set("
|
|
11770
|
+
_modules.set("e7fe5a5c6b675c6217db5f5a72d8883609e8417ee3c6f3c2184d375463f93231", _exports);
|
|
11548
11771
|
return _exports;
|
|
11549
11772
|
})();
|
|
11550
11773
|
|
|
11551
|
-
const _m83 = _modules.get("
|
|
11774
|
+
const _m83 = _modules.get("37e4a768d57818c4335fd3d61b9b7aae633cde303e7634579655a6a3de4a86ce") ?? (() => {
|
|
11552
11775
|
const { assertGroupedReportSource } = _m8;
|
|
11553
11776
|
|
|
11554
11777
|
const { BlobByteSink } = _m3;
|
|
@@ -11594,7 +11817,7 @@ async function writeGroupedPdfTo(report, destination, configuration) {
|
|
|
11594
11817
|
return writePdfDocumentTo([pdfGroupedTable(report, tableOptions)], destination, documentOptions);
|
|
11595
11818
|
}
|
|
11596
11819
|
const _exports = Object.freeze({ pdfGroupedTable: _m92.pdfGroupedTable, writeGroupedPdf: writeGroupedPdf, writeGroupedPdfTo: writeGroupedPdfTo });
|
|
11597
|
-
_modules.set("
|
|
11820
|
+
_modules.set("37e4a768d57818c4335fd3d61b9b7aae633cde303e7634579655a6a3de4a86ce", _exports);
|
|
11598
11821
|
return _exports;
|
|
11599
11822
|
})();
|
|
11600
11823
|
|
|
@@ -11638,10 +11861,10 @@ _modules.set("3d777096288d1be55a05a80bc015d4674212e587703f25a7e7cf99a8065feb86",
|
|
|
11638
11861
|
return _exports;
|
|
11639
11862
|
})();
|
|
11640
11863
|
|
|
11641
|
-
const _m54 = _modules.get("
|
|
11864
|
+
const _m54 = _modules.get("344fd55ffe1a37b32a8eb6a2bdaa14dff90e0fee0f37282457f9e4c3b7bce1ca") ?? (() => {
|
|
11642
11865
|
|
|
11643
11866
|
const _exports = Object.freeze({ writePdf: _m55.writePdf, writePdfTo: _m55.writePdfTo, writeGroupedPdf: _m83.writeGroupedPdf, writeGroupedPdfTo: _m83.writeGroupedPdfTo, pdfGroupedTable: _m83.pdfGroupedTable, createGroupedReport: _m8.createGroupedReport, writePdfDocument: _m84.writePdfDocument, writePdfDocumentTo: _m84.writePdfDocumentTo, pdfTable: _m84.pdfTable, PdfFont: _m63.PdfFont, preflightPdfText: _m93.preflightPdfText, ExportCell: _m5.ExportCell, saveBlob: _m1.saveBlob });
|
|
11644
|
-
_modules.set("
|
|
11867
|
+
_modules.set("344fd55ffe1a37b32a8eb6a2bdaa14dff90e0fee0f37282457f9e4c3b7bce1ca", _exports);
|
|
11645
11868
|
return _exports;
|
|
11646
11869
|
})();
|
|
11647
11870
|
|
|
@@ -12015,7 +12238,7 @@ _modules.set("8edb7b3b19d6555ea24a92d771d532dc0448ad18101fdf663217b4c518b5a31b",
|
|
|
12015
12238
|
return _exports;
|
|
12016
12239
|
})();
|
|
12017
12240
|
|
|
12018
|
-
const _m97 = _modules.get("
|
|
12241
|
+
const _m97 = _modules.get("2ab57874b786ef4d2b4841b9072fedd27d40c308f72c6548962810139359deb9") ?? (() => {
|
|
12019
12242
|
const { captureFields } = _m10;
|
|
12020
12243
|
|
|
12021
12244
|
const { ExportBudget } = _m9;
|
|
@@ -12056,11 +12279,11 @@ function capturePdfOptions(input = {}) {
|
|
|
12056
12279
|
return { ...options, ...(options.limits === undefined ? {} : { limits: capturePdfLimits(options.limits) }) };
|
|
12057
12280
|
}
|
|
12058
12281
|
const _exports = Object.freeze({ captureCommonLimits: captureCommonLimits, mergeAdapterLimits: mergeAdapterLimits, captureXlsxOptions: captureXlsxOptions, captureCsvOptions: captureCsvOptions, capturePdfOptions: capturePdfOptions });
|
|
12059
|
-
_modules.set("
|
|
12282
|
+
_modules.set("2ab57874b786ef4d2b4841b9072fedd27d40c308f72c6548962810139359deb9", _exports);
|
|
12060
12283
|
return _exports;
|
|
12061
12284
|
})();
|
|
12062
12285
|
|
|
12063
|
-
const _m0 = _modules.get("
|
|
12286
|
+
const _m0 = _modules.get("147109a7d787a3eec697dcd8a556224afda45a042eedd08346b113f10a56a59c") ?? (() => {
|
|
12064
12287
|
const { BlobByteSink, checkAbort, saveBlob } = _m1;
|
|
12065
12288
|
|
|
12066
12289
|
const { notifyProgress } = _m14;
|
|
@@ -12243,7 +12466,7 @@ function registerDataTablesButtons(host, options = {}) {
|
|
|
12243
12466
|
}
|
|
12244
12467
|
}
|
|
12245
12468
|
const _exports = Object.freeze({ createDataTablesExport: _m96.createDataTablesExport, ExportCell: _m5.ExportCell, PdfFont: _m63.PdfFont, writeDataTableTo: writeDataTableTo, exportDataTable: exportDataTable, registerDataTablesButtons: registerDataTablesButtons });
|
|
12246
|
-
_modules.set("
|
|
12469
|
+
_modules.set("147109a7d787a3eec697dcd8a556224afda45a042eedd08346b113f10a56a59c", _exports);
|
|
12247
12470
|
return _exports;
|
|
12248
12471
|
})();
|
|
12249
12472
|
Object.assign(officeimo, _m0);
|