@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.
@@ -12591,6 +12591,7 @@ class _JsonDocument extends _ExportHelper {
12591
12591
  constructor(fileName) {
12592
12592
  super();
12593
12593
  this._isImport = false;
12594
+ this._isColorSpace = false;
12594
12595
  if (fileName !== null && typeof fileName !== 'undefined') {
12595
12596
  this._fileName = fileName;
12596
12597
  }
@@ -13175,11 +13176,25 @@ class _JsonDocument extends _ExportHelper {
13175
13176
  }
13176
13177
  else if (Array.isArray(value)) {
13177
13178
  const list = [];
13179
+ if (key === 'ColorSpace') {
13180
+ value.forEach(element => {
13181
+ if (typeof element === 'string') {
13182
+ this._isColorSpace = true;
13183
+ }
13184
+ });
13185
+ }
13178
13186
  this._writeArray(list, value, dictionary);
13187
+ this._isColorSpace = false;
13179
13188
  this._writeTable('array', this._convertToJsonArray(list), table, key, array);
13180
13189
  }
13181
13190
  else if (typeof value === 'string') {
13182
- this._writeTable('string', value, table, key, array);
13191
+ if (this._isColorSpace) {
13192
+ const bytes = _stringToBytes(value);
13193
+ this._writeTable('unicodeData', _byteArrayToHexString(bytes), table, key, array);
13194
+ }
13195
+ else {
13196
+ this._writeTable('string', value, table, key, array);
13197
+ }
13183
13198
  }
13184
13199
  else if (typeof value === 'number') {
13185
13200
  this._writeTable(Number.isInteger(value) ? 'int' : 'fixed', value.toString(), table, key, array);
@@ -13206,6 +13221,13 @@ class _JsonDocument extends _ExportHelper {
13206
13221
  const stream = baseStream.stream;
13207
13222
  data = baseStream.getString(true, stream.getByteRange(stream.start, stream.end));
13208
13223
  }
13224
+ else if (baseStream.stream && baseStream.stream.stream) {
13225
+ const flateStream = baseStream.stream; // eslint-disable-line
13226
+ if (flateStream.stream && flateStream.stream instanceof _PdfStream) {
13227
+ const stream = flateStream.stream;
13228
+ data = flateStream.getString(true, stream.getByteRange(stream.start, stream.end));
13229
+ }
13230
+ }
13209
13231
  else {
13210
13232
  data = value.getString(true);
13211
13233
  }
@@ -14041,6 +14063,9 @@ class _JsonDocument extends _ExportHelper {
14041
14063
  stream.dictionary.objId = value.objectNumber + ' ' + value.generationNumber;
14042
14064
  this._crossReference._cacheMap.set(value, stream);
14043
14065
  }
14066
+ else if (keys.indexOf('unicodeData') !== -1) {
14067
+ value = _bytesToString(_hexStringToByteArray(element.unicodeData, true));
14068
+ }
14044
14069
  else {
14045
14070
  value = null;
14046
14071
  }
@@ -48275,7 +48300,7 @@ class _PdfCrossReference {
48275
48300
  }
48276
48301
  this._writeObject(archiveStream, buffer, archiveRef, cipher);
48277
48302
  }
48278
- const formatValue = Math.max(_getSize(this._stream.bytes.length), _getSize(this._nextReferenceNumber));
48303
+ const formatValue = Math.max(_getSize(this._stream.bytes.length + buffer.length), _getSize(this._nextReferenceNumber));
48279
48304
  const newRef = this._getNextReference();
48280
48305
  const newStartXref = currentLength + buffer.length;
48281
48306
  const newXref = new _PdfDictionary(this);