@syncfusion/ej2-pdf 24.2.5 → 24.2.8

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.
@@ -39361,18 +39361,24 @@ class _PdfCrossReference {
39361
39361
  }
39362
39362
  }
39363
39363
  let hasRoot = false;
39364
+ let root;
39364
39365
  try {
39365
- const root = trailerDictionary.get('Root');
39366
- if (root) {
39366
+ root = trailerDictionary.get('Root');
39367
+ }
39368
+ catch (e) {
39369
+ throw new BaseException('Invalid cross reference', 'XRefParseException');
39370
+ }
39371
+ if (root) {
39372
+ try {
39367
39373
  const pagesEntry = root.get('Pages');
39368
39374
  if (pagesEntry) {
39369
39375
  this._root = root;
39370
39376
  hasRoot = true;
39371
39377
  }
39372
39378
  }
39373
- }
39374
- catch (ex) {
39375
- throw new BaseException('Invalid cross reference', 'InvalidXRef');
39379
+ catch (ex) {
39380
+ throw new BaseException('Invalid cross reference', 'InvalidXRef');
39381
+ }
39376
39382
  }
39377
39383
  if (!hasRoot) {
39378
39384
  if (!recoveryMode) {
@@ -44914,6 +44920,14 @@ class _JsonDocument extends _ExportHelper {
44914
44920
  case 'ca':
44915
44921
  this._writeAttributeString(key.toLowerCase(), primitive);
44916
44922
  break;
44923
+ case 'CustomData':
44924
+ if (primitive && primitive.length > 2 && primitive.startsWith('{') && primitive.endsWith('}')) {
44925
+ this._table.set(key, primitive);
44926
+ }
44927
+ else {
44928
+ this._writeAttributeString(key, primitive);
44929
+ }
44930
+ break;
44917
44931
  default:
44918
44932
  this._writeAttributeString(key, primitive);
44919
44933
  break;
@@ -45559,7 +45573,7 @@ class _JsonDocument extends _ExportHelper {
45559
45573
  }
45560
45574
  break;
45561
45575
  case 'customdata':
45562
- this._addString(dictionary, 'CustomData', value);
45576
+ this._addString(dictionary, 'CustomData', typeof value === 'string' ? value : JSON.stringify(value));
45563
45577
  break;
45564
45578
  case 'appearance':
45565
45579
  this._addAppearanceData(dictionary, value);