@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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 24.1.41
3
+ * version : 24.1.44
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@17.6.0",
3
+ "_id": "@syncfusion/ej2-pdf@24.1.41",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-umf2zK3uDiJd0vrloKfKe+U/coP8imiIPZQgQqK1CRFzK/johV9adrFP14+EyNsqzHz5gf+/+p2IbSpcVp2B4A==",
5
+ "_integrity": "sha512-d/PUqs1qo2SH9pW3tqbh/NXoCsW5XGJ5IQTQ+hYLPifPYAmOdiWFBQKhteGod+1D2NkeuRo0qtqcK2WgFIBJZA==",
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.syncfusion.com/repository/ej2-release/@syncfusion/ej2-pdf/-/ej2-pdf-17.6.0.tgz",
25
- "_shasum": "b36f79b8fb510562013a7baa83f0ff19ad7108ba",
24
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-pdf/-/ej2-pdf-24.1.41.tgz",
25
+ "_shasum": "07dae5e593718b34001402e4752d04376d2b135c",
26
26
  "_spec": "@syncfusion/ej2-pdf@*",
27
27
  "_where": "/jenkins/workspace/elease-automation_release_24.1.1/packages/included",
28
28
  "author": {
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "bundleDependencies": false,
32
32
  "dependencies": {
33
- "@syncfusion/ej2-base": "~24.1.41",
33
+ "@syncfusion/ej2-base": "~24.1.42",
34
34
  "@syncfusion/ej2-compression": "~24.1.41"
35
35
  },
36
36
  "deprecated": false,
@@ -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": "24.1.41",
58
+ "version": "24.1.44",
59
59
  "sideEffects": false,
60
60
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
61
61
  }
@@ -2818,7 +2818,7 @@ var PdfLineAnnotation = /** @class */ (function (_super) {
2818
2818
  get: function () {
2819
2819
  if (typeof this._leaderExt === 'undefined' && this._dictionary.has('LLE')) {
2820
2820
  var leaderExt = this._dictionary.get('LLE');
2821
- if (typeof leaderExt !== 'undefined' && leaderExt >= 0) {
2821
+ if (typeof leaderExt !== 'undefined') {
2822
2822
  this._leaderExt = leaderExt;
2823
2823
  }
2824
2824
  }
@@ -2843,13 +2843,8 @@ var PdfLineAnnotation = /** @class */ (function (_super) {
2843
2843
  */
2844
2844
  set: function (value) {
2845
2845
  if (!Number.isNaN(value)) {
2846
- if (value >= 0) {
2847
- this._dictionary.update('LLE', value);
2848
- this._leaderExt = value;
2849
- }
2850
- else {
2851
- throw new Error('LeaderExt should be non negative number');
2852
- }
2846
+ this._dictionary.update('LLE', value);
2847
+ this._leaderExt = value;
2853
2848
  }
2854
2849
  },
2855
2850
  enumerable: true,
@@ -209,14 +209,14 @@ var _ImageDecoder = /** @class */ (function () {
209
209
  _ImageDecoder.prototype._getMarker = function () {
210
210
  var skippedByte = 0;
211
211
  var marker = this._readByte();
212
- while (marker != 255) {
212
+ while (marker !== 255) {
213
213
  skippedByte++;
214
214
  marker = this._readByte();
215
215
  }
216
216
  do {
217
217
  marker = this._readByte();
218
- } while (marker == 255);
219
- if (skippedByte != 0) {
218
+ } while (marker === 255);
219
+ if (skippedByte !== 0) {
220
220
  throw new Error('Error decoding JPEG image');
221
221
  }
222
222
  return this._toUnsigned16(marker);
@@ -1511,6 +1511,22 @@ var _JsonDocument = /** @class */ (function (_super) {
1511
1511
  }
1512
1512
  var stream = new _PdfContentStream(bytes);
1513
1513
  var dictionary = this._parseDictionary(element);
1514
+ var isImage = false;
1515
+ if (dictionary && dictionary.has('Subtype')) {
1516
+ var type = dictionary.get('Subtype');
1517
+ isImage = type && type.name === 'Image';
1518
+ }
1519
+ if (isImage) {
1520
+ stream._isCompress = false;
1521
+ }
1522
+ else {
1523
+ if (dictionary.has('Length')) {
1524
+ delete dictionary._map.Length;
1525
+ }
1526
+ if (dictionary.has('Filter')) {
1527
+ delete dictionary._map.Filter;
1528
+ }
1529
+ }
1514
1530
  stream.dictionary = dictionary;
1515
1531
  result = stream;
1516
1532
  }
@@ -1348,24 +1348,33 @@ var _XfdfDocument = /** @class */ (function (_super) {
1348
1348
  var streamDictionary = primitive.dictionary;
1349
1349
  this._writePrefix(writer, 'STREAM', key);
1350
1350
  writer._writeAttributeString('DEFINE', '');
1351
- var data = primitive.getString();
1352
- if (!streamDictionary.has('Length') && data && data !== '') {
1353
- streamDictionary.update('Length', primitive.length);
1354
- }
1355
- this._writeAppearanceDictionary(writer, streamDictionary);
1356
- writer._writeStartElement('DATA');
1357
1351
  if ((streamDictionary.has('Subtype') &&
1358
1352
  this._getValue(streamDictionary.get('Subtype')) === 'Image') ||
1359
1353
  (!streamDictionary.has('Type') && !streamDictionary.has('Subtype'))) {
1354
+ var data = primitive.getString(true);
1355
+ if (!streamDictionary.has('Length') && data && data !== '') {
1356
+ streamDictionary.update('Length', primitive.length);
1357
+ }
1358
+ this._writeAppearanceDictionary(writer, streamDictionary);
1359
+ writer._writeStartElement('DATA');
1360
1360
  writer._writeAttributeString('MODE', 'RAW');
1361
1361
  writer._writeAttributeString('ENCODING', 'HEX');
1362
+ if (data && data !== '') {
1363
+ writer._writeRaw(data);
1364
+ }
1362
1365
  }
1363
1366
  else {
1367
+ var data = primitive.getString();
1368
+ if (!streamDictionary.has('Length') && data && data !== '') {
1369
+ streamDictionary.update('Length', primitive.length);
1370
+ }
1371
+ this._writeAppearanceDictionary(writer, streamDictionary);
1372
+ writer._writeStartElement('DATA');
1364
1373
  writer._writeAttributeString('MODE', 'FILTERED');
1365
1374
  writer._writeAttributeString('ENCODING', 'ASCII');
1366
- }
1367
- if (data && data !== '') {
1368
- writer._writeRaw(data);
1375
+ if (data && data !== '') {
1376
+ writer._writeRaw(data);
1377
+ }
1369
1378
  }
1370
1379
  writer._writeEndElement();
1371
1380
  writer._writeEndElement();
@@ -2439,6 +2448,22 @@ var _XfdfDocument = /** @class */ (function (_super) {
2439
2448
  data = this._getData(element);
2440
2449
  if (data && data.length > 0 && source instanceof _PdfContentStream) {
2441
2450
  source._bytes = data;
2451
+ var isImage = false;
2452
+ if (appearance && appearance.has('Subtype')) {
2453
+ var type = appearance.get('Subtype');
2454
+ isImage = type && type.name === 'Image';
2455
+ }
2456
+ if (isImage) {
2457
+ source._isCompress = false;
2458
+ }
2459
+ else {
2460
+ if (source.dictionary.has('Length')) {
2461
+ delete source.dictionary._map.Length;
2462
+ }
2463
+ if (source.dictionary.has('Filter')) {
2464
+ delete source.dictionary._map.Filter;
2465
+ }
2466
+ }
2442
2467
  }
2443
2468
  break;
2444
2469
  }