@syncfusion/ej2-pdf 23.2.6 → 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.
- package/CHANGELOG.md +3 -37
- package/dist/ej2-pdf.umd.min.js +2 -2
- package/dist/ej2-pdf.umd.min.js.map +1 -1
- package/dist/es6/ej2-pdf.es2015.js +70 -36
- package/dist/es6/ej2-pdf.es2015.js.map +1 -1
- package/dist/es6/ej2-pdf.es5.js +68 -34
- package/dist/es6/ej2-pdf.es5.js.map +1 -1
- package/dist/global/ej2-pdf.min.js +2 -2
- package/dist/global/ej2-pdf.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +8 -8
- package/src/pdf/core/annotations/annotation.js +3 -8
- package/src/pdf/core/graphics/images/image-decoder.js +3 -3
- package/src/pdf/core/import-export/json-document.js +32 -16
- package/src/pdf/core/import-export/xfdf-document.js +30 -7
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version :
|
|
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@
|
|
3
|
+
"_id": "@syncfusion/ej2-pdf@24.1.41",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-d/PUqs1qo2SH9pW3tqbh/NXoCsW5XGJ5IQTQ+hYLPifPYAmOdiWFBQKhteGod+1D2NkeuRo0qtqcK2WgFIBJZA==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-pdf",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -21,17 +21,17 @@
|
|
|
21
21
|
"/@syncfusion/ej2",
|
|
22
22
|
"/@syncfusion/ej2-pdfviewer"
|
|
23
23
|
],
|
|
24
|
-
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-pdf/-/ej2-pdf-
|
|
25
|
-
"_shasum": "
|
|
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
|
-
"_where": "/jenkins/workspace/elease-
|
|
27
|
+
"_where": "/jenkins/workspace/elease-automation_release_24.1.1/packages/included",
|
|
28
28
|
"author": {
|
|
29
29
|
"name": "Syncfusion Inc."
|
|
30
30
|
},
|
|
31
31
|
"bundleDependencies": false,
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@syncfusion/ej2-base": "~
|
|
34
|
-
"@syncfusion/ej2-compression": "~
|
|
33
|
+
"@syncfusion/ej2-base": "~24.1.42",
|
|
34
|
+
"@syncfusion/ej2-compression": "~24.1.41"
|
|
35
35
|
},
|
|
36
36
|
"deprecated": false,
|
|
37
37
|
"description": "Feature-rich JavaScript PDF library with built-in support for loading and manipulating PDF document.",
|
|
@@ -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": "
|
|
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'
|
|
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
|
-
|
|
2847
|
-
|
|
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
|
|
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
|
|
219
|
-
if (skippedByte
|
|
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);
|
|
@@ -624,27 +624,27 @@ var _JsonDocument = /** @class */ (function (_super) {
|
|
|
624
624
|
var dataTable = new Map(); // eslint-disable-line
|
|
625
625
|
var streamTable = new Map(); // eslint-disable-line
|
|
626
626
|
var streamDictionary = value.dictionary;
|
|
627
|
+
var data = value.getString(true);
|
|
628
|
+
if (!streamDictionary.has('Length') && data && data !== '') {
|
|
629
|
+
streamDictionary.update('Length', value.length);
|
|
630
|
+
}
|
|
627
631
|
this._writeAppearanceDictionary(streamTable, streamDictionary);
|
|
628
|
-
var length_1 = streamDictionary.get('Length');
|
|
629
632
|
var type = void 0;
|
|
630
633
|
if (streamDictionary.has('Subtype')) {
|
|
631
634
|
type = this._getValue(streamDictionary.get('Subtype'));
|
|
632
635
|
}
|
|
633
|
-
if (
|
|
634
|
-
|
|
635
|
-
(
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
if (data && data !== '') {
|
|
646
|
-
dataTable.set('bytes', data);
|
|
647
|
-
}
|
|
636
|
+
if ((!streamDictionary.has('Type') && !streamDictionary.has('Subtype')) ||
|
|
637
|
+
(streamDictionary.has('Subtype') &&
|
|
638
|
+
(type === 'Image' || type === 'Form' || type === 'CIDFontType0C' || type === 'OpenType'))) {
|
|
639
|
+
dataTable.set('mode', 'raw');
|
|
640
|
+
dataTable.set('encoding', 'hex');
|
|
641
|
+
}
|
|
642
|
+
else {
|
|
643
|
+
dataTable.set('mode', 'filtered');
|
|
644
|
+
dataTable.set('encoding', 'ascii');
|
|
645
|
+
}
|
|
646
|
+
if (data && data !== '') {
|
|
647
|
+
dataTable.set('bytes', data);
|
|
648
648
|
}
|
|
649
649
|
streamTable.set('data', this._convertToJson(dataTable));
|
|
650
650
|
this._writeTable('stream', this._convertToJson(streamTable), table, key, array);
|
|
@@ -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,23 +1348,30 @@ var _XfdfDocument = /** @class */ (function (_super) {
|
|
|
1348
1348
|
var streamDictionary = primitive.dictionary;
|
|
1349
1349
|
this._writePrefix(writer, 'STREAM', key);
|
|
1350
1350
|
writer._writeAttributeString('DEFINE', '');
|
|
1351
|
-
|
|
1352
|
-
writer._writeStartElement('DATA');
|
|
1353
|
-
var length_1 = streamDictionary.get('Length');
|
|
1354
|
-
if (length_1 > 0 && (streamDictionary.has('Subtype') &&
|
|
1351
|
+
if ((streamDictionary.has('Subtype') &&
|
|
1355
1352
|
this._getValue(streamDictionary.get('Subtype')) === 'Image') ||
|
|
1356
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');
|
|
1357
1360
|
writer._writeAttributeString('MODE', 'RAW');
|
|
1358
1361
|
writer._writeAttributeString('ENCODING', 'HEX');
|
|
1359
|
-
var data = primitive.getString();
|
|
1360
1362
|
if (data && data !== '') {
|
|
1361
1363
|
writer._writeRaw(data);
|
|
1362
1364
|
}
|
|
1363
1365
|
}
|
|
1364
|
-
else
|
|
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');
|
|
1365
1373
|
writer._writeAttributeString('MODE', 'FILTERED');
|
|
1366
1374
|
writer._writeAttributeString('ENCODING', 'ASCII');
|
|
1367
|
-
var data = primitive.getString();
|
|
1368
1375
|
if (data && data !== '') {
|
|
1369
1376
|
writer._writeRaw(data);
|
|
1370
1377
|
}
|
|
@@ -2441,6 +2448,22 @@ var _XfdfDocument = /** @class */ (function (_super) {
|
|
|
2441
2448
|
data = this._getData(element);
|
|
2442
2449
|
if (data && data.length > 0 && source instanceof _PdfContentStream) {
|
|
2443
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
|
+
}
|
|
2444
2467
|
}
|
|
2445
2468
|
break;
|
|
2446
2469
|
}
|