@syncfusion/ej2-pdf 24.1.41 → 24.1.44

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.
@@ -16936,7 +16936,7 @@ var PdfLineAnnotation = /** @__PURE__ @class */ (function (_super) {
16936
16936
  get: function () {
16937
16937
  if (typeof this._leaderExt === 'undefined' && this._dictionary.has('LLE')) {
16938
16938
  var leaderExt = this._dictionary.get('LLE');
16939
- if (typeof leaderExt !== 'undefined' && leaderExt >= 0) {
16939
+ if (typeof leaderExt !== 'undefined') {
16940
16940
  this._leaderExt = leaderExt;
16941
16941
  }
16942
16942
  }
@@ -16961,13 +16961,8 @@ var PdfLineAnnotation = /** @__PURE__ @class */ (function (_super) {
16961
16961
  */
16962
16962
  set: function (value) {
16963
16963
  if (!Number.isNaN(value)) {
16964
- if (value >= 0) {
16965
- this._dictionary.update('LLE', value);
16966
- this._leaderExt = value;
16967
- }
16968
- else {
16969
- throw new Error('LeaderExt should be non negative number');
16970
- }
16964
+ this._dictionary.update('LLE', value);
16965
+ this._leaderExt = value;
16971
16966
  }
16972
16967
  },
16973
16968
  enumerable: true,
@@ -44117,24 +44112,33 @@ var _XfdfDocument = /** @__PURE__ @class */ (function (_super) {
44117
44112
  var streamDictionary = primitive.dictionary;
44118
44113
  this._writePrefix(writer, 'STREAM', key);
44119
44114
  writer._writeAttributeString('DEFINE', '');
44120
- var data = primitive.getString();
44121
- if (!streamDictionary.has('Length') && data && data !== '') {
44122
- streamDictionary.update('Length', primitive.length);
44123
- }
44124
- this._writeAppearanceDictionary(writer, streamDictionary);
44125
- writer._writeStartElement('DATA');
44126
44115
  if ((streamDictionary.has('Subtype') &&
44127
44116
  this._getValue(streamDictionary.get('Subtype')) === 'Image') ||
44128
44117
  (!streamDictionary.has('Type') && !streamDictionary.has('Subtype'))) {
44118
+ var data = primitive.getString(true);
44119
+ if (!streamDictionary.has('Length') && data && data !== '') {
44120
+ streamDictionary.update('Length', primitive.length);
44121
+ }
44122
+ this._writeAppearanceDictionary(writer, streamDictionary);
44123
+ writer._writeStartElement('DATA');
44129
44124
  writer._writeAttributeString('MODE', 'RAW');
44130
44125
  writer._writeAttributeString('ENCODING', 'HEX');
44126
+ if (data && data !== '') {
44127
+ writer._writeRaw(data);
44128
+ }
44131
44129
  }
44132
44130
  else {
44131
+ var data = primitive.getString();
44132
+ if (!streamDictionary.has('Length') && data && data !== '') {
44133
+ streamDictionary.update('Length', primitive.length);
44134
+ }
44135
+ this._writeAppearanceDictionary(writer, streamDictionary);
44136
+ writer._writeStartElement('DATA');
44133
44137
  writer._writeAttributeString('MODE', 'FILTERED');
44134
44138
  writer._writeAttributeString('ENCODING', 'ASCII');
44135
- }
44136
- if (data && data !== '') {
44137
- writer._writeRaw(data);
44139
+ if (data && data !== '') {
44140
+ writer._writeRaw(data);
44141
+ }
44138
44142
  }
44139
44143
  writer._writeEndElement();
44140
44144
  writer._writeEndElement();
@@ -45208,6 +45212,22 @@ var _XfdfDocument = /** @__PURE__ @class */ (function (_super) {
45208
45212
  data = this._getData(element);
45209
45213
  if (data && data.length > 0 && source instanceof _PdfContentStream) {
45210
45214
  source._bytes = data;
45215
+ var isImage = false;
45216
+ if (appearance && appearance.has('Subtype')) {
45217
+ var type = appearance.get('Subtype');
45218
+ isImage = type && type.name === 'Image';
45219
+ }
45220
+ if (isImage) {
45221
+ source._isCompress = false;
45222
+ }
45223
+ else {
45224
+ if (source.dictionary.has('Length')) {
45225
+ delete source.dictionary._map.Length;
45226
+ }
45227
+ if (source.dictionary.has('Filter')) {
45228
+ delete source.dictionary._map.Filter;
45229
+ }
45230
+ }
45211
45231
  }
45212
45232
  break;
45213
45233
  }
@@ -47191,6 +47211,22 @@ var _JsonDocument = /** @__PURE__ @class */ (function (_super) {
47191
47211
  }
47192
47212
  var stream = new _PdfContentStream(bytes);
47193
47213
  var dictionary = this._parseDictionary(element);
47214
+ var isImage = false;
47215
+ if (dictionary && dictionary.has('Subtype')) {
47216
+ var type = dictionary.get('Subtype');
47217
+ isImage = type && type.name === 'Image';
47218
+ }
47219
+ if (isImage) {
47220
+ stream._isCompress = false;
47221
+ }
47222
+ else {
47223
+ if (dictionary.has('Length')) {
47224
+ delete dictionary._map.Length;
47225
+ }
47226
+ if (dictionary.has('Filter')) {
47227
+ delete dictionary._map.Filter;
47228
+ }
47229
+ }
47194
47230
  stream.dictionary = dictionary;
47195
47231
  result = stream;
47196
47232
  }
@@ -50196,14 +50232,14 @@ var _ImageDecoder = /** @__PURE__ @class */ (function () {
50196
50232
  _ImageDecoder.prototype._getMarker = function () {
50197
50233
  var skippedByte = 0;
50198
50234
  var marker = this._readByte();
50199
- while (marker != 255) {
50235
+ while (marker !== 255) {
50200
50236
  skippedByte++;
50201
50237
  marker = this._readByte();
50202
50238
  }
50203
50239
  do {
50204
50240
  marker = this._readByte();
50205
- } while (marker == 255);
50206
- if (skippedByte != 0) {
50241
+ } while (marker === 255);
50242
+ if (skippedByte !== 0) {
50207
50243
  throw new Error('Error decoding JPEG image');
50208
50244
  }
50209
50245
  return this._toUnsigned16(marker);