@yudaocode/univer-pdfs 1.6.204 → 1.6.206

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/lib/es/index.js CHANGED
@@ -165,7 +165,7 @@ import {
165
165
  validatePdfTemplateVariables,
166
166
  visitTemplateVariables,
167
167
  wrapPdfTextLines
168
- } from "./chunk-7J2ODILT.js";
168
+ } from "./chunk-72OJSR4Z.js";
169
169
  import {
170
170
  Fragment,
171
171
  PDF_JSX_ELEMENT_SYMBOL,
@@ -6335,10 +6335,13 @@ async function renderPdfBytesToImages(pdfBytes, options) {
6335
6335
  const pdfjsLib = await import("pdfjs-dist");
6336
6336
  const getDoc = pdfjsLib?.getDocument ?? pdfjsLib?.default?.getDocument;
6337
6337
  if (typeof getDoc === "function") {
6338
+ const globalAssets = globalThis?.__YUDAO_UNIVER_PDFJS_ASSETS__;
6338
6339
  const loadingTask = getDoc({
6339
6340
  data: pdfBytes.slice(),
6340
6341
  disableWorker: true,
6341
- isEvalSupported: false
6342
+ isEvalSupported: false,
6343
+ ...globalAssets?.cMapUrl ? { cMapUrl: globalAssets.cMapUrl, cMapPacked: globalAssets.cMapPacked ?? true } : {},
6344
+ ...globalAssets?.standardFontDataUrl ? { standardFontDataUrl: globalAssets.standardFontDataUrl } : {}
6342
6345
  });
6343
6346
  const pdfJsDoc = await loadingTask.promise;
6344
6347
  try {
@@ -7105,11 +7108,14 @@ async function importPdfSource(source, options) {
7105
7108
  pdfjsLib = await import("pdfjs-dist").catch(() => null);
7106
7109
  }
7107
7110
  if (pdfjsLib && typeof pdfjsLib.getDocument === "function") {
7111
+ const globalAssets = globalThis?.__YUDAO_UNIVER_PDFJS_ASSETS__;
7108
7112
  const task = pdfjsLib.getDocument({
7109
7113
  data: bytes.slice(),
7110
7114
  password: options.password,
7111
7115
  disableWorker: true,
7112
- isEvalSupported: false
7116
+ isEvalSupported: false,
7117
+ ...globalAssets?.cMapUrl ? { cMapUrl: globalAssets.cMapUrl, cMapPacked: globalAssets.cMapPacked ?? true } : {},
7118
+ ...globalAssets?.standardFontDataUrl ? { standardFontDataUrl: globalAssets.standardFontDataUrl } : {}
7113
7119
  });
7114
7120
  const pdfDoc = await task.promise;
7115
7121
  try {