@syncfusion/ej2-pdf 25.1.40 → 25.1.41

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 25.1.40
3
+ * version : 25.1.41
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-pdf@*",
3
- "_id": "@syncfusion/ej2-pdf@25.1.39",
3
+ "_id": "@syncfusion/ej2-pdf@25.1.40",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-pWE0zlFyKavaIdUTvXidwDuQ3V8v58EB5Vgp+sqfyF+XyBoes9xjzKAsS7lKfnjJ+69lmjP6+cc6hnXfp5lsxg==",
5
+ "_integrity": "sha512-pBiQSd8rMc6N9jXuEse841ZfDh5gOANZFNGhT2im35bSEJ1Sg7+6HAvcuTUUEjU6v92Xm9oVgZpbOKyWC+d7Ug==",
6
6
  "_location": "/@syncfusion/ej2-pdf",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -21,8 +21,8 @@
21
21
  "/@syncfusion/ej2",
22
22
  "/@syncfusion/ej2-pdfviewer"
23
23
  ],
24
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-pdf/-/ej2-pdf-25.1.39.tgz",
25
- "_shasum": "5a2d3f5d6c5b9c74f92db621290da632cc3682c0",
24
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-pdf/-/ej2-pdf-25.1.40.tgz",
25
+ "_shasum": "d62d8fd1ff43ad30c2db1da539000197f57715f0",
26
26
  "_spec": "@syncfusion/ej2-pdf@*",
27
27
  "_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
28
28
  "author": {
@@ -55,7 +55,7 @@
55
55
  "url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/pdf"
56
56
  },
57
57
  "typings": "index.d.ts",
58
- "version": "25.1.40",
58
+ "version": "25.1.41",
59
59
  "sideEffects": false,
60
60
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
61
61
  }
@@ -5,6 +5,7 @@ import { _PdfDictionary } from './../pdf-primitives';
5
5
  import { _PdfContentStream } from './../base-stream';
6
6
  export declare class _JsonDocument extends _ExportHelper {
7
7
  _isImport: boolean;
8
+ _isColorSpace: boolean;
8
9
  constructor(fileName?: string);
9
10
  _exportAnnotations(document: PdfDocument): Uint8Array;
10
11
  _exportFormFields(document: PdfDocument): Uint8Array;
@@ -21,6 +21,7 @@ var _JsonDocument = /** @class */ (function (_super) {
21
21
  function _JsonDocument(fileName) {
22
22
  var _this = _super.call(this) || this;
23
23
  _this._isImport = false;
24
+ _this._isColorSpace = false;
24
25
  if (fileName !== null && typeof fileName !== 'undefined') {
25
26
  _this._fileName = fileName;
26
27
  }
@@ -606,16 +607,31 @@ var _JsonDocument = /** @class */ (function (_super) {
606
607
  }
607
608
  };
608
609
  _JsonDocument.prototype._writeObject = function (table, value, dictionary, key, array) {
610
+ var _this = this;
609
611
  if (value instanceof _PdfName) {
610
612
  this._writeTable('name', value.name, table, key, array);
611
613
  }
612
614
  else if (Array.isArray(value)) {
613
615
  var list = [];
616
+ if (key === 'ColorSpace') {
617
+ value.forEach(function (element) {
618
+ if (typeof element === 'string') {
619
+ _this._isColorSpace = true;
620
+ }
621
+ });
622
+ }
614
623
  this._writeArray(list, value, dictionary);
624
+ this._isColorSpace = false;
615
625
  this._writeTable('array', this._convertToJsonArray(list), table, key, array);
616
626
  }
617
627
  else if (typeof value === 'string') {
618
- this._writeTable('string', value, table, key, array);
628
+ if (this._isColorSpace) {
629
+ var bytes = _stringToBytes(value);
630
+ this._writeTable('unicodeData', _byteArrayToHexString(bytes), table, key, array);
631
+ }
632
+ else {
633
+ this._writeTable('string', value, table, key, array);
634
+ }
619
635
  }
620
636
  else if (typeof value === 'number') {
621
637
  this._writeTable(Number.isInteger(value) ? 'int' : 'fixed', value.toString(), table, key, array);
@@ -642,6 +658,13 @@ var _JsonDocument = /** @class */ (function (_super) {
642
658
  var stream = baseStream.stream;
643
659
  data = baseStream.getString(true, stream.getByteRange(stream.start, stream.end));
644
660
  }
661
+ else if (baseStream.stream && baseStream.stream.stream) {
662
+ var flateStream = baseStream.stream; // eslint-disable-line
663
+ if (flateStream.stream && flateStream.stream instanceof _PdfStream) {
664
+ var stream = flateStream.stream;
665
+ data = flateStream.getString(true, stream.getByteRange(stream.start, stream.end));
666
+ }
667
+ }
645
668
  else {
646
669
  data = value.getString(true);
647
670
  }
@@ -1486,6 +1509,9 @@ var _JsonDocument = /** @class */ (function (_super) {
1486
1509
  stream.dictionary.objId = value.objectNumber + ' ' + value.generationNumber;
1487
1510
  this._crossReference._cacheMap.set(value, stream);
1488
1511
  }
1512
+ else if (keys.indexOf('unicodeData') !== -1) {
1513
+ value = _bytesToString(_hexStringToByteArray(element.unicodeData, true));
1514
+ }
1489
1515
  else {
1490
1516
  value = null;
1491
1517
  }
@@ -742,7 +742,7 @@ var _PdfCrossReference = /** @class */ (function () {
742
742
  }
743
743
  this._writeObject(archiveStream, buffer, archiveRef, cipher_2);
744
744
  }
745
- var formatValue = Math.max(_getSize(this._stream.bytes.length), _getSize(this._nextReferenceNumber));
745
+ var formatValue = Math.max(_getSize(this._stream.bytes.length + buffer.length), _getSize(this._nextReferenceNumber));
746
746
  var newRef = this._getNextReference();
747
747
  var newStartXref = currentLength + buffer.length;
748
748
  var newXref = new _PdfDictionary(this);