@syncfusion/ej2-pdf 25.1.39 → 25.1.40
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 +8 -0
- 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 +64 -22
- package/dist/es6/ej2-pdf.es2015.js.map +1 -1
- package/dist/es6/ej2-pdf.es5.js +64 -22
- 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 +5 -5
- package/src/pdf/core/form/form.js +0 -1
- package/src/pdf/core/pdf-catalog.js +2 -0
- package/src/pdf/core/pdf-cross-reference.js +10 -8
- package/src/pdf/core/pdf-document.js +14 -12
- package/src/pdf/core/pdf-page.js +4 -1
- package/src/pdf/core/utils.d.ts +7 -0
- package/src/pdf/core/utils.js +34 -0
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 25.1.
|
|
3
|
+
* version : 25.1.40
|
|
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@25.1.
|
|
3
|
+
"_id": "@syncfusion/ej2-pdf@25.1.39",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-pWE0zlFyKavaIdUTvXidwDuQ3V8v58EB5Vgp+sqfyF+XyBoes9xjzKAsS7lKfnjJ+69lmjP6+cc6hnXfp5lsxg==",
|
|
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.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-pdf/-/ej2-pdf-25.1.
|
|
25
|
-
"_shasum": "
|
|
24
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-pdf/-/ej2-pdf-25.1.39.tgz",
|
|
25
|
+
"_shasum": "5a2d3f5d6c5b9c74f92db621290da632cc3682c0",
|
|
26
26
|
"_spec": "@syncfusion/ej2-pdf@*",
|
|
27
27
|
"_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
|
|
28
28
|
"author": {
|
|
@@ -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": "25.1.
|
|
58
|
+
"version": "25.1.40",
|
|
59
59
|
"sideEffects": false,
|
|
60
60
|
"homepage": "https://www.syncfusion.com/javascript-ui-controls"
|
|
61
61
|
}
|
|
@@ -239,7 +239,6 @@ var PdfForm = /** @class */ (function () {
|
|
|
239
239
|
this._dictionary.update('Fields', this._fields);
|
|
240
240
|
this._parsedFields.set(this._fields.length - 1, field);
|
|
241
241
|
field._form = this;
|
|
242
|
-
this._crossReference._allowCatalog = true;
|
|
243
242
|
this._crossReference._root._updated = true;
|
|
244
243
|
if (field._kidsCount > 0) {
|
|
245
244
|
for (var i = 0; i < field._kidsCount; i++) {
|
|
@@ -60,6 +60,8 @@ var _PdfCatalog = /** @class */ (function () {
|
|
|
60
60
|
this._crossReference._cacheMap.set(ref, form);
|
|
61
61
|
this._catalogDictionary.set('AcroForm', ref);
|
|
62
62
|
this._catalogDictionary._updated = true;
|
|
63
|
+
this._crossReference._allowCatalog = true;
|
|
64
|
+
form._updated = true;
|
|
63
65
|
return form;
|
|
64
66
|
};
|
|
65
67
|
_PdfCatalog.prototype.getPageDictionary = function (pageIndex) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _PdfStream } from './base-stream';
|
|
2
2
|
import { _PdfDictionary, _PdfReferenceSet, _isCommand, _PdfReference, _PdfName } from './pdf-primitives';
|
|
3
|
-
import { BaseException, FormatError, _escapePdfName, _bytesToString, ParserEndOfFileException, _numberToString, _stringToPdfString } from './utils';
|
|
3
|
+
import { BaseException, FormatError, _escapePdfName, _bytesToString, ParserEndOfFileException, _numberToString, _stringToPdfString, _getSize } from './utils';
|
|
4
4
|
import { _PdfParser, _PdfLexicalOperator } from './pdf-parser';
|
|
5
5
|
import { _PdfBaseStream } from './base-stream';
|
|
6
6
|
import { PdfCrossReferenceType } from './enumerator';
|
|
@@ -742,39 +742,40 @@ var _PdfCrossReference = /** @class */ (function () {
|
|
|
742
742
|
}
|
|
743
743
|
this._writeObject(archiveStream, buffer, archiveRef, cipher_2);
|
|
744
744
|
}
|
|
745
|
+
var formatValue = Math.max(_getSize(this._stream.bytes.length), _getSize(this._nextReferenceNumber));
|
|
745
746
|
var newRef = this._getNextReference();
|
|
746
747
|
var newStartXref = currentLength + buffer.length;
|
|
747
748
|
var newXref = new _PdfDictionary(this);
|
|
748
749
|
newXref.set('Type', _PdfName.get('XRef'));
|
|
749
750
|
newXref.set('Index', indexes_1);
|
|
750
|
-
newXref.set('W', [1,
|
|
751
|
+
newXref.set('W', [1, formatValue, 1]);
|
|
751
752
|
this._copyTrailer(newXref);
|
|
752
753
|
if (this._ids && this._ids.length > 0) {
|
|
753
754
|
newXref.update('ID', [this._ids[0], this._computeMessageDigest(newStartXref)]);
|
|
754
755
|
}
|
|
755
756
|
var newXrefData = [];
|
|
756
757
|
this._writeLong(0, 1, newXrefData);
|
|
757
|
-
this._writeLong(1,
|
|
758
|
+
this._writeLong(1, formatValue, newXrefData);
|
|
758
759
|
this._writeLong(-1, 1, newXrefData);
|
|
759
760
|
if (uncompressedCount > 0) {
|
|
760
761
|
for (var index = 0; index < uncompressedCount; index++) {
|
|
761
762
|
this._writeLong(1, 1, newXrefData);
|
|
762
|
-
this._writeLong(uncompressedOffsets_1[index],
|
|
763
|
+
this._writeLong(uncompressedOffsets_1[index], formatValue, newXrefData); // eslint-disable-line
|
|
763
764
|
this._writeLong(0, 1, newXrefData);
|
|
764
765
|
}
|
|
765
766
|
}
|
|
766
767
|
if (updatedCount > 0) {
|
|
767
768
|
for (var index = 0; index < updatedCount; index++) {
|
|
768
769
|
this._writeLong(2, 1, newXrefData);
|
|
769
|
-
this._writeLong(archiveRef.objectNumber,
|
|
770
|
+
this._writeLong(archiveRef.objectNumber, formatValue, newXrefData);
|
|
770
771
|
this._writeLong(index, 1, newXrefData);
|
|
771
772
|
}
|
|
772
773
|
this._writeLong(1, 1, newXrefData);
|
|
773
|
-
this._writeLong(archiveOffset,
|
|
774
|
+
this._writeLong(archiveOffset, formatValue, newXrefData);
|
|
774
775
|
this._writeLong(0, 1, newXrefData);
|
|
775
776
|
}
|
|
776
777
|
this._writeLong(1, 1, newXrefData);
|
|
777
|
-
this._writeLong(newStartXref,
|
|
778
|
+
this._writeLong(newStartXref, formatValue, newXrefData);
|
|
778
779
|
this._writeLong(0, 1, newXrefData);
|
|
779
780
|
newXref.set('Length', newXrefData.length);
|
|
780
781
|
var newXrefStream = new _PdfStream(newXrefData, newXref, 0, newXrefData.length);
|
|
@@ -826,7 +827,8 @@ var _PdfCrossReference = /** @class */ (function () {
|
|
|
826
827
|
return array;
|
|
827
828
|
};
|
|
828
829
|
_PdfCrossReference.prototype._copyTrailer = function (newXref) {
|
|
829
|
-
|
|
830
|
+
var reference = this._getNextReference();
|
|
831
|
+
newXref.set('Size', reference.objectNumber);
|
|
830
832
|
newXref.set('Prev', this._prevXRefOffset);
|
|
831
833
|
var root = this._trailer.getRaw('Root'); // eslint-disable-line
|
|
832
834
|
if (typeof root !== 'undefined' && root !== null) {
|
|
@@ -1110,19 +1110,21 @@ var PdfDocument = /** @class */ (function () {
|
|
|
1110
1110
|
};
|
|
1111
1111
|
PdfDocument.prototype._doPostProcessOnFormFields = function (isFlatten) {
|
|
1112
1112
|
if (isFlatten === void 0) { isFlatten = false; }
|
|
1113
|
-
this.
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1113
|
+
if (this._catalog._catalogDictionary.has('AcroForm')) {
|
|
1114
|
+
this.form._doPostProcess(isFlatten);
|
|
1115
|
+
if (isFlatten) {
|
|
1116
|
+
var formObject = this._catalog._catalogDictionary.getRaw('AcroForm');
|
|
1117
|
+
var dictionary = new _PdfDictionary(this._crossReference);
|
|
1118
|
+
dictionary._updated = true;
|
|
1119
|
+
if (formObject instanceof _PdfReference) {
|
|
1120
|
+
this._crossReference._cacheMap.set(formObject, dictionary);
|
|
1121
|
+
}
|
|
1122
|
+
else {
|
|
1123
|
+
this.form._dictionary = dictionary;
|
|
1124
|
+
this._crossReference._allowCatalog = true;
|
|
1125
|
+
}
|
|
1126
|
+
this.form._clear();
|
|
1124
1127
|
}
|
|
1125
|
-
this.form._clear();
|
|
1126
1128
|
}
|
|
1127
1129
|
};
|
|
1128
1130
|
PdfDocument.prototype._doPostProcessOnAnnotations = function (isFlatten) {
|
package/src/pdf/core/pdf-page.js
CHANGED
|
@@ -59,7 +59,10 @@ var PdfPage = /** @class */ (function () {
|
|
|
59
59
|
if (this._pageDictionary.has('Annots')) {
|
|
60
60
|
var annots = this._getProperty('Annots');
|
|
61
61
|
if (annots && Array.isArray(annots)) {
|
|
62
|
-
var widgets_1
|
|
62
|
+
var widgets_1;
|
|
63
|
+
if (this._crossReference._document._catalog._catalogDictionary.has('AcroForm')) {
|
|
64
|
+
widgets_1 = this._crossReference._document.form._parseWidgetReferences();
|
|
65
|
+
}
|
|
63
66
|
if (widgets_1 && widgets_1.length > 0) {
|
|
64
67
|
var validAnnotations_1 = [];
|
|
65
68
|
annots.forEach(function (entry) {
|
package/src/pdf/core/utils.d.ts
CHANGED
|
@@ -758,3 +758,10 @@ export declare function _updateBounds(annotation: PdfAnnotation, bounds?: number
|
|
|
758
758
|
* @returns {string} Decoded text.
|
|
759
759
|
*/
|
|
760
760
|
export declare function _decodeText(text: string, isColorSpace: boolean, isPassword: boolean): string;
|
|
761
|
+
/**
|
|
762
|
+
* Number of bytes required to save the number.
|
|
763
|
+
*
|
|
764
|
+
* @param {number} input number.
|
|
765
|
+
* @returns {number} number of bytes.
|
|
766
|
+
*/
|
|
767
|
+
export declare function _getSize(input: number): number;
|
package/src/pdf/core/utils.js
CHANGED
|
@@ -3957,3 +3957,37 @@ export function _decodeText(text, isColorSpace, isPassword) {
|
|
|
3957
3957
|
}
|
|
3958
3958
|
return text;
|
|
3959
3959
|
}
|
|
3960
|
+
/**
|
|
3961
|
+
* Number of bytes required to save the number.
|
|
3962
|
+
*
|
|
3963
|
+
* @param {number} input number.
|
|
3964
|
+
* @returns {number} number of bytes.
|
|
3965
|
+
*/
|
|
3966
|
+
export function _getSize(input) {
|
|
3967
|
+
var size = 0;
|
|
3968
|
+
var uintMaxValue = 0xFFFFFFFF;
|
|
3969
|
+
var ushortMaxValue = 0xFFFF;
|
|
3970
|
+
var byteMaxValue = 0xFF;
|
|
3971
|
+
if (input <= uintMaxValue) {
|
|
3972
|
+
if (input <= ushortMaxValue) {
|
|
3973
|
+
if (input <= byteMaxValue) {
|
|
3974
|
+
size = 1;
|
|
3975
|
+
}
|
|
3976
|
+
else {
|
|
3977
|
+
size = 2;
|
|
3978
|
+
}
|
|
3979
|
+
}
|
|
3980
|
+
else {
|
|
3981
|
+
if (input <= (ushortMaxValue | (ushortMaxValue << 8))) {
|
|
3982
|
+
size = 3;
|
|
3983
|
+
}
|
|
3984
|
+
else {
|
|
3985
|
+
size = 4;
|
|
3986
|
+
}
|
|
3987
|
+
}
|
|
3988
|
+
}
|
|
3989
|
+
else {
|
|
3990
|
+
size = 8;
|
|
3991
|
+
}
|
|
3992
|
+
return size;
|
|
3993
|
+
}
|