@syncfusion/ej2-pdf 23.2.6 → 24.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.
@@ -44117,26 +44117,24 @@ var _XfdfDocument = /** @__PURE__ @class */ (function (_super) {
44117
44117
  var streamDictionary = primitive.dictionary;
44118
44118
  this._writePrefix(writer, 'STREAM', key);
44119
44119
  writer._writeAttributeString('DEFINE', '');
44120
+ var data = primitive.getString();
44121
+ if (!streamDictionary.has('Length') && data && data !== '') {
44122
+ streamDictionary.update('Length', primitive.length);
44123
+ }
44120
44124
  this._writeAppearanceDictionary(writer, streamDictionary);
44121
44125
  writer._writeStartElement('DATA');
44122
- var length_1 = streamDictionary.get('Length');
44123
- if (length_1 > 0 && (streamDictionary.has('Subtype') &&
44126
+ if ((streamDictionary.has('Subtype') &&
44124
44127
  this._getValue(streamDictionary.get('Subtype')) === 'Image') ||
44125
44128
  (!streamDictionary.has('Type') && !streamDictionary.has('Subtype'))) {
44126
44129
  writer._writeAttributeString('MODE', 'RAW');
44127
44130
  writer._writeAttributeString('ENCODING', 'HEX');
44128
- var data = primitive.getString();
44129
- if (data && data !== '') {
44130
- writer._writeRaw(data);
44131
- }
44132
44131
  }
44133
- else if (length_1 > 0) {
44132
+ else {
44134
44133
  writer._writeAttributeString('MODE', 'FILTERED');
44135
44134
  writer._writeAttributeString('ENCODING', 'ASCII');
44136
- var data = primitive.getString();
44137
- if (data && data !== '') {
44138
- writer._writeRaw(data);
44139
- }
44135
+ }
44136
+ if (data && data !== '') {
44137
+ writer._writeRaw(data);
44140
44138
  }
44141
44139
  writer._writeEndElement();
44142
44140
  writer._writeEndElement();
@@ -46306,27 +46304,27 @@ var _JsonDocument = /** @__PURE__ @class */ (function (_super) {
46306
46304
  var dataTable = new Map(); // eslint-disable-line
46307
46305
  var streamTable = new Map(); // eslint-disable-line
46308
46306
  var streamDictionary = value.dictionary;
46307
+ var data = value.getString(true);
46308
+ if (!streamDictionary.has('Length') && data && data !== '') {
46309
+ streamDictionary.update('Length', value.length);
46310
+ }
46309
46311
  this._writeAppearanceDictionary(streamTable, streamDictionary);
46310
- var length_1 = streamDictionary.get('Length');
46311
46312
  var type = void 0;
46312
46313
  if (streamDictionary.has('Subtype')) {
46313
46314
  type = this._getValue(streamDictionary.get('Subtype'));
46314
46315
  }
46315
- if (length_1 > 0) {
46316
- if ((!streamDictionary.has('Type') && !streamDictionary.has('Subtype')) ||
46317
- (streamDictionary.has('Subtype') &&
46318
- (type === 'Image' || type === 'Form' || type === 'CIDFontType0C' || type === 'OpenType'))) {
46319
- dataTable.set('mode', 'raw');
46320
- dataTable.set('encoding', 'hex');
46321
- }
46322
- else {
46323
- dataTable.set('mode', 'filtered');
46324
- dataTable.set('encoding', 'ascii');
46325
- }
46326
- var data = value.getString(true);
46327
- if (data && data !== '') {
46328
- dataTable.set('bytes', data);
46329
- }
46316
+ if ((!streamDictionary.has('Type') && !streamDictionary.has('Subtype')) ||
46317
+ (streamDictionary.has('Subtype') &&
46318
+ (type === 'Image' || type === 'Form' || type === 'CIDFontType0C' || type === 'OpenType'))) {
46319
+ dataTable.set('mode', 'raw');
46320
+ dataTable.set('encoding', 'hex');
46321
+ }
46322
+ else {
46323
+ dataTable.set('mode', 'filtered');
46324
+ dataTable.set('encoding', 'ascii');
46325
+ }
46326
+ if (data && data !== '') {
46327
+ dataTable.set('bytes', data);
46330
46328
  }
46331
46329
  streamTable.set('data', this._convertToJson(dataTable));
46332
46330
  this._writeTable('stream', this._convertToJson(streamTable), table, key, array);