@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.
@@ -13002,6 +13002,7 @@ var _JsonDocument = /** @__PURE__ @class */ (function (_super) {
13002
13002
  function _JsonDocument(fileName) {
13003
13003
  var _this = _super.call(this) || this;
13004
13004
  _this._isImport = false;
13005
+ _this._isColorSpace = false;
13005
13006
  if (fileName !== null && typeof fileName !== 'undefined') {
13006
13007
  _this._fileName = fileName;
13007
13008
  }
@@ -13587,16 +13588,31 @@ var _JsonDocument = /** @__PURE__ @class */ (function (_super) {
13587
13588
  }
13588
13589
  };
13589
13590
  _JsonDocument.prototype._writeObject = function (table, value, dictionary, key, array) {
13591
+ var _this = this;
13590
13592
  if (value instanceof _PdfName) {
13591
13593
  this._writeTable('name', value.name, table, key, array);
13592
13594
  }
13593
13595
  else if (Array.isArray(value)) {
13594
13596
  var list = [];
13597
+ if (key === 'ColorSpace') {
13598
+ value.forEach(function (element) {
13599
+ if (typeof element === 'string') {
13600
+ _this._isColorSpace = true;
13601
+ }
13602
+ });
13603
+ }
13595
13604
  this._writeArray(list, value, dictionary);
13605
+ this._isColorSpace = false;
13596
13606
  this._writeTable('array', this._convertToJsonArray(list), table, key, array);
13597
13607
  }
13598
13608
  else if (typeof value === 'string') {
13599
- this._writeTable('string', value, table, key, array);
13609
+ if (this._isColorSpace) {
13610
+ var bytes = _stringToBytes(value);
13611
+ this._writeTable('unicodeData', _byteArrayToHexString(bytes), table, key, array);
13612
+ }
13613
+ else {
13614
+ this._writeTable('string', value, table, key, array);
13615
+ }
13600
13616
  }
13601
13617
  else if (typeof value === 'number') {
13602
13618
  this._writeTable(Number.isInteger(value) ? 'int' : 'fixed', value.toString(), table, key, array);
@@ -13623,6 +13639,13 @@ var _JsonDocument = /** @__PURE__ @class */ (function (_super) {
13623
13639
  var stream = baseStream.stream;
13624
13640
  data = baseStream.getString(true, stream.getByteRange(stream.start, stream.end));
13625
13641
  }
13642
+ else if (baseStream.stream && baseStream.stream.stream) {
13643
+ var flateStream = baseStream.stream; // eslint-disable-line
13644
+ if (flateStream.stream && flateStream.stream instanceof _PdfStream) {
13645
+ var stream = flateStream.stream;
13646
+ data = flateStream.getString(true, stream.getByteRange(stream.start, stream.end));
13647
+ }
13648
+ }
13626
13649
  else {
13627
13650
  data = value.getString(true);
13628
13651
  }
@@ -14467,6 +14490,9 @@ var _JsonDocument = /** @__PURE__ @class */ (function (_super) {
14467
14490
  stream.dictionary.objId = value.objectNumber + ' ' + value.generationNumber;
14468
14491
  this._crossReference._cacheMap.set(value, stream);
14469
14492
  }
14493
+ else if (keys.indexOf('unicodeData') !== -1) {
14494
+ value = _bytesToString(_hexStringToByteArray(element.unicodeData, true));
14495
+ }
14470
14496
  else {
14471
14497
  value = null;
14472
14498
  }
@@ -50065,7 +50091,7 @@ var _PdfCrossReference = /** @__PURE__ @class */ (function () {
50065
50091
  }
50066
50092
  this._writeObject(archiveStream, buffer, archiveRef, cipher_2);
50067
50093
  }
50068
- var formatValue = Math.max(_getSize(this._stream.bytes.length), _getSize(this._nextReferenceNumber));
50094
+ var formatValue = Math.max(_getSize(this._stream.bytes.length + buffer.length), _getSize(this._nextReferenceNumber));
50069
50095
  var newRef = this._getNextReference();
50070
50096
  var newStartXref = currentLength + buffer.length;
50071
50097
  var newXref = new _PdfDictionary(this);