@syncfusion/ej2-pdf 23.1.36 → 23.1.39
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 +19 -0
- package/dist/ej2-pdf.umd.min.js +3 -3
- package/dist/ej2-pdf.umd.min.js.map +1 -1
- package/dist/es6/ej2-pdf.es2015.js +168 -38
- package/dist/es6/ej2-pdf.es2015.js.map +1 -1
- package/dist/es6/ej2-pdf.es5.js +168 -39
- package/dist/es6/ej2-pdf.es5.js.map +1 -1
- package/dist/global/ej2-pdf.min.js +3 -3
- package/dist/global/ej2-pdf.min.js.map +1 -1
- package/dist/global/index.d.ts +2 -2
- package/package.json +6 -6
- package/src/pdf/core/annotations/annotation-collection.js +12 -1
- package/src/pdf/core/annotations/annotation.d.ts +21 -1
- package/src/pdf/core/annotations/annotation.js +23 -23
- package/src/pdf/core/graphics/images/image-decoder.d.ts +7 -0
- package/src/pdf/core/graphics/images/image-decoder.js +98 -1
- package/src/pdf/core/import-export/xfdf-document.js +1 -1
- package/src/pdf/core/import-export/xml-document.js +3 -3
- package/src/pdf/core/pdf-cross-reference.js +1 -1
- package/src/pdf/core/security/encryptor.js +12 -9
- package/src/pdf/core/utils.d.ts +9 -1
- package/src/pdf/core/utils.js +18 -0
package/dist/es6/ej2-pdf.es5.js
CHANGED
|
@@ -15046,6 +15046,9 @@ var PdfAnnotation = /** @__PURE__ @class */ (function () {
|
|
|
15046
15046
|
if (typeof this._rotate === 'undefined' && this._dictionary.has('Rotate')) {
|
|
15047
15047
|
this._rotate = (this._dictionary.get('Rotate') / 90);
|
|
15048
15048
|
}
|
|
15049
|
+
if (this._rotate === null || typeof this._rotate === 'undefined') {
|
|
15050
|
+
this._rotate = PdfRotationAngle.angle0;
|
|
15051
|
+
}
|
|
15049
15052
|
return this._rotate;
|
|
15050
15053
|
},
|
|
15051
15054
|
/**
|
|
@@ -20661,6 +20664,7 @@ var PdfInkAnnotation = /** @__PURE__ @class */ (function (_super) {
|
|
|
20661
20664
|
var _this = _super.call(this) || this;
|
|
20662
20665
|
_this._inkPointsCollection = [];
|
|
20663
20666
|
_this._previousCollection = [];
|
|
20667
|
+
_this._isModified = false;
|
|
20664
20668
|
_this._dictionary = new _PdfDictionary();
|
|
20665
20669
|
_this._dictionary.update('Type', _PdfName.get('Annot'));
|
|
20666
20670
|
_this._dictionary.update('Subtype', _PdfName.get('Ink'));
|
|
@@ -20726,6 +20730,7 @@ var PdfInkAnnotation = /** @__PURE__ @class */ (function (_super) {
|
|
|
20726
20730
|
set: function (value) {
|
|
20727
20731
|
if (Array.isArray(value) && value.length > 0 && value !== this._inkPointsCollection) {
|
|
20728
20732
|
this._inkPointsCollection = value;
|
|
20733
|
+
this._isModified = true;
|
|
20729
20734
|
if (this._isLoaded) {
|
|
20730
20735
|
this._dictionary.update('InkList', value);
|
|
20731
20736
|
}
|
|
@@ -20789,7 +20794,6 @@ var PdfInkAnnotation = /** @__PURE__ @class */ (function (_super) {
|
|
|
20789
20794
|
}
|
|
20790
20795
|
};
|
|
20791
20796
|
PdfInkAnnotation.prototype._doPostProcess = function (isFlatten) {
|
|
20792
|
-
var _this = this;
|
|
20793
20797
|
if (isFlatten === void 0) { isFlatten = false; }
|
|
20794
20798
|
this._isFlatten = isFlatten;
|
|
20795
20799
|
if (this._isLoaded) {
|
|
@@ -20861,10 +20865,6 @@ var PdfInkAnnotation = /** @__PURE__ @class */ (function (_super) {
|
|
|
20861
20865
|
}
|
|
20862
20866
|
}
|
|
20863
20867
|
}
|
|
20864
|
-
this._previousCollection.forEach(function (element) {
|
|
20865
|
-
_this._inkPointsCollection.push(element);
|
|
20866
|
-
});
|
|
20867
|
-
this._previousCollection = [];
|
|
20868
20868
|
}
|
|
20869
20869
|
if (typeof this.flattenPopups !== 'undefined' && this.flattenPopups) {
|
|
20870
20870
|
if (this._isLoaded) {
|
|
@@ -21030,32 +21030,32 @@ var PdfInkAnnotation = /** @__PURE__ @class */ (function (_super) {
|
|
|
21030
21030
|
};
|
|
21031
21031
|
PdfInkAnnotation.prototype._addInkPoints = function () {
|
|
21032
21032
|
var _this = this;
|
|
21033
|
-
|
|
21034
|
-
|
|
21035
|
-
_this._previousCollection.push(inkList);
|
|
21036
|
-
});
|
|
21037
|
-
}
|
|
21038
|
-
var _inkCollection = [];
|
|
21039
|
-
if (this._linePoints !== null) {
|
|
21033
|
+
var inkCollection = [];
|
|
21034
|
+
if (this._linePoints !== null && (this._previousCollection.length === 0 || this._isModified)) {
|
|
21040
21035
|
this._inkPointsCollection.unshift(this._linePoints);
|
|
21036
|
+
this._isModified = false;
|
|
21041
21037
|
}
|
|
21042
|
-
|
|
21038
|
+
var isEqual = _checkInkPoints(this._inkPointsCollection, this._previousCollection);
|
|
21039
|
+
if (this._inkPointsCollection !== null && !isEqual) {
|
|
21043
21040
|
for (var i = 0; i < this._inkPointsCollection.length; i++) {
|
|
21044
21041
|
var inkList = this._inkPointsCollection[Number.parseInt(i.toString(), 10)];
|
|
21045
|
-
|
|
21042
|
+
inkCollection.push(inkList);
|
|
21046
21043
|
}
|
|
21044
|
+
this._dictionary.update('InkList', inkCollection);
|
|
21045
|
+
}
|
|
21046
|
+
if (this._inkPointsCollection.length > 0) {
|
|
21047
|
+
this._inkPointsCollection.forEach(function (inkList) {
|
|
21048
|
+
_this._previousCollection.push(inkList);
|
|
21049
|
+
});
|
|
21047
21050
|
}
|
|
21048
|
-
this._dictionary.update('InkList', _inkCollection);
|
|
21049
21051
|
return this._getInkBoundsValue();
|
|
21050
21052
|
};
|
|
21051
21053
|
PdfInkAnnotation.prototype._getInkBoundsValue = function () {
|
|
21052
21054
|
var bounds = [0, 0, 0, 0];
|
|
21053
|
-
if (
|
|
21054
|
-
bounds =
|
|
21055
|
-
}
|
|
21056
|
-
else {
|
|
21057
|
-
bounds = [this.bounds.x, this.bounds.y, this.bounds.width, this.bounds.height];
|
|
21055
|
+
if (this._points) {
|
|
21056
|
+
this.bounds = { x: this._points[0], y: this._points[1], width: this._points[2], height: this._points[3] };
|
|
21058
21057
|
}
|
|
21058
|
+
bounds = [this.bounds.x, this.bounds.y, this.bounds.width, this.bounds.height];
|
|
21059
21059
|
var borderWidth = this.border.width;
|
|
21060
21060
|
if (this._inkPointsCollection !== null) {
|
|
21061
21061
|
if (this._inkPointsCollection.length > 0) {
|
|
@@ -21477,7 +21477,7 @@ var PdfPopupAnnotation = /** @__PURE__ @class */ (function (_super) {
|
|
|
21477
21477
|
};
|
|
21478
21478
|
PdfPopupAnnotation.prototype._postProcess = function () {
|
|
21479
21479
|
if (typeof this.bounds === 'undefined' || this.bounds === null) {
|
|
21480
|
-
|
|
21480
|
+
this._bounds = { x: 0, y: 0, width: 0, height: 0 };
|
|
21481
21481
|
}
|
|
21482
21482
|
var borderWidth;
|
|
21483
21483
|
if (this._dictionary.has('BS')) {
|
|
@@ -23879,7 +23879,7 @@ var PdfRubberStampAnnotation = /** @__PURE__ @class */ (function (_super) {
|
|
|
23879
23879
|
}
|
|
23880
23880
|
else {
|
|
23881
23881
|
this._iconString = this._obtainIconName(this._icon);
|
|
23882
|
-
this._dictionary.update('Name', _PdfName.get('#' + this._iconString));
|
|
23882
|
+
this._dictionary.update('Name', _PdfName.get('#23' + this._iconString));
|
|
23883
23883
|
appearance = new PdfAppearance(this, nativeRectangle);
|
|
23884
23884
|
appearance.normal = new PdfTemplate(nativeRectangle, this._crossReference);
|
|
23885
23885
|
}
|
|
@@ -28408,7 +28408,18 @@ var PdfAnnotationCollection = /** @__PURE__ @class */ (function () {
|
|
|
28408
28408
|
var index = this._annotations.length;
|
|
28409
28409
|
this._annotations.push(reference);
|
|
28410
28410
|
this._parsedAnnotations.set(index, annotation);
|
|
28411
|
-
|
|
28411
|
+
var isAdded = false;
|
|
28412
|
+
if (this._page._pageDictionary.has('Annots')) {
|
|
28413
|
+
var collection = this._page._pageDictionary.get('Annots');
|
|
28414
|
+
if (collection !== null && typeof collection !== 'undefined' && collection.indexOf(reference) === -1) {
|
|
28415
|
+
collection.push(reference);
|
|
28416
|
+
this._page._pageDictionary.set('Annots', collection);
|
|
28417
|
+
isAdded = true;
|
|
28418
|
+
}
|
|
28419
|
+
}
|
|
28420
|
+
if (!isAdded) {
|
|
28421
|
+
this._page._pageDictionary.set('Annots', this._annotations);
|
|
28422
|
+
}
|
|
28412
28423
|
this._page._pageDictionary._updated = true;
|
|
28413
28424
|
if (annotation instanceof PdfComment) {
|
|
28414
28425
|
this._addCommentsAndReview(annotation, annotation._dictionary.get('F'));
|
|
@@ -35926,6 +35937,24 @@ function _tryParseFontStream(widgetDictionary, crossReference, annotation) {
|
|
|
35926
35937
|
}
|
|
35927
35938
|
return fontData;
|
|
35928
35939
|
}
|
|
35940
|
+
/**
|
|
35941
|
+
* Gets the boolean if two arrays are equal.
|
|
35942
|
+
*
|
|
35943
|
+
* @param {Array<number[]>} inkPointsCollection Ink points collection.
|
|
35944
|
+
* @param {Array<number[]>} previousCollection Previous collection.
|
|
35945
|
+
* @returns {boolean} result.
|
|
35946
|
+
*/
|
|
35947
|
+
function _checkInkPoints(inkPointsCollection, previousCollection) {
|
|
35948
|
+
if (inkPointsCollection.length !== previousCollection.length) {
|
|
35949
|
+
return false;
|
|
35950
|
+
}
|
|
35951
|
+
for (var i = 0; i < inkPointsCollection.length; i++) {
|
|
35952
|
+
if (!_areArrayEqual(inkPointsCollection[Number.parseInt(i.toString(), 10)], previousCollection[Number.parseInt(i.toString(), 10)])) {
|
|
35953
|
+
return false;
|
|
35954
|
+
}
|
|
35955
|
+
}
|
|
35956
|
+
return true;
|
|
35957
|
+
}
|
|
35929
35958
|
|
|
35930
35959
|
/* eslint-disable */
|
|
35931
35960
|
var nameCache = Object.create(null);
|
|
@@ -38907,21 +38936,21 @@ var _PdfEncryptor = /** @__PURE__ @class */ (function () {
|
|
|
38907
38936
|
else {
|
|
38908
38937
|
algorithm_1 = new _BasicEncryption();
|
|
38909
38938
|
}
|
|
38910
|
-
var
|
|
38939
|
+
var p = void 0;
|
|
38911
38940
|
if (passwordBytes) {
|
|
38912
|
-
|
|
38941
|
+
p = passwordBytes.subarray(0, Math.min(127, passwordBytes.length));
|
|
38913
38942
|
}
|
|
38914
38943
|
else {
|
|
38915
|
-
|
|
38944
|
+
p = new Uint8Array([]);
|
|
38916
38945
|
}
|
|
38917
|
-
if (algorithm_1._checkUserPassword(
|
|
38918
|
-
encryptionKey = this._createEncryptionKey(true,
|
|
38946
|
+
if (algorithm_1._checkUserPassword(p, userValidationSalt, userPassword)) {
|
|
38947
|
+
encryptionKey = this._createEncryptionKey(true, p, ownerKeySalt, uBytes, userKeySalt, ownerEncryption, userEncryption, algorithm_1);
|
|
38919
38948
|
this._isUserPassword = true;
|
|
38920
|
-
if (
|
|
38949
|
+
if (password.length && algorithm_1._checkOwnerPassword(p, ownerValidationSalt, uBytes, ownerPassword)) {
|
|
38921
38950
|
this._hasUserPasswordOnly = true;
|
|
38922
38951
|
}
|
|
38923
38952
|
}
|
|
38924
|
-
else if (
|
|
38953
|
+
else if (password.length && algorithm_1._checkOwnerPassword(p, ownerValidationSalt, uBytes, ownerPassword)) {
|
|
38925
38954
|
encryptionKey = this._createEncryptionKey(false, passwordBytes, ownerKeySalt, uBytes, userKeySalt, ownerEncryption, userEncryption, algorithm_1);
|
|
38926
38955
|
this._isUserPassword = false;
|
|
38927
38956
|
}
|
|
@@ -38936,7 +38965,6 @@ var _PdfEncryptor = /** @__PURE__ @class */ (function () {
|
|
|
38936
38965
|
throw new Error('Cannot open an encrypted document. The password is invalid.');
|
|
38937
38966
|
}
|
|
38938
38967
|
}
|
|
38939
|
-
this._encryptionKey = encryptionKey;
|
|
38940
38968
|
if (algorithm >= 4) {
|
|
38941
38969
|
var cipherDictionary = dictionary.get('CF');
|
|
38942
38970
|
if (cipherDictionary) {
|
|
@@ -38956,6 +38984,10 @@ var _PdfEncryptor = /** @__PURE__ @class */ (function () {
|
|
|
38956
38984
|
this._string = dictionary.get('StrF') || _PdfName.get('Identity');
|
|
38957
38985
|
this._eff = dictionary.get('EFF') || this._stream;
|
|
38958
38986
|
}
|
|
38987
|
+
if (!encryptionKey && !this._encryptOnlyAttachment) {
|
|
38988
|
+
throw new Error('Cannot open an encrypted document. The password is invalid.');
|
|
38989
|
+
}
|
|
38990
|
+
this._encryptionKey = encryptionKey;
|
|
38959
38991
|
}
|
|
38960
38992
|
Object.defineProperty(_PdfEncryptor.prototype, "_md5", {
|
|
38961
38993
|
get: function () {
|
|
@@ -40348,7 +40380,7 @@ var _AdvancedEncryption256Cipher = /** @__PURE__ @class */ (function (_super) {
|
|
|
40348
40380
|
}
|
|
40349
40381
|
}
|
|
40350
40382
|
for (var n = 0; n < 4; ++n) {
|
|
40351
|
-
result[Number.parseInt(
|
|
40383
|
+
result[Number.parseInt(j.toString(), 10)] = t1 ^= result[j - 32];
|
|
40352
40384
|
result[j + 1] = t2 ^= result[j - 31];
|
|
40353
40385
|
result[j + 2] = t3 ^= result[j - 30];
|
|
40354
40386
|
result[j + 3] = t4 ^= result[j - 29];
|
|
@@ -41346,7 +41378,7 @@ var _PdfCrossReference = /** @__PURE__ @class */ (function () {
|
|
|
41346
41378
|
};
|
|
41347
41379
|
_PdfCrossReference.prototype._writeValue = function (value, buffer, transform, isCrossReference) {
|
|
41348
41380
|
if (value instanceof _PdfName) {
|
|
41349
|
-
this._writeString("/" +
|
|
41381
|
+
this._writeString("/" + value.name, buffer);
|
|
41350
41382
|
}
|
|
41351
41383
|
else if (value instanceof _PdfReference) {
|
|
41352
41384
|
this._writeString(value.toString() + " R", buffer);
|
|
@@ -45338,7 +45370,7 @@ var _XfdfDocument = /** @__PURE__ @class */ (function (_super) {
|
|
|
45338
45370
|
if (measurement) {
|
|
45339
45371
|
measureDictionary.update('Type', _PdfName.get('Measure'));
|
|
45340
45372
|
if (measurement.hasAttribute('rateValue')) {
|
|
45341
|
-
var attribute = measurement.getAttribute
|
|
45373
|
+
var attribute = measurement.getAttribute('rateValue');
|
|
45342
45374
|
if (attribute && attribute !== '') {
|
|
45343
45375
|
measureDictionary.update('R', attribute);
|
|
45344
45376
|
}
|
|
@@ -48741,7 +48773,7 @@ var _XmlDocument = /** @__PURE__ @class */ (function (_super) {
|
|
|
48741
48773
|
if (isAcrobat) {
|
|
48742
48774
|
this._table.forEach(function (value, key) {
|
|
48743
48775
|
if (key.includes(' ')) {
|
|
48744
|
-
var text = key.replace(
|
|
48776
|
+
var text = key.replace(/ /g, '');
|
|
48745
48777
|
writer._writeStartElement(text.toString());
|
|
48746
48778
|
writer._writeAttributeString('original', key.toString(), 'xfdf', null);
|
|
48747
48779
|
}
|
|
@@ -48755,7 +48787,7 @@ var _XmlDocument = /** @__PURE__ @class */ (function (_super) {
|
|
|
48755
48787
|
else {
|
|
48756
48788
|
this._table.forEach(function (value, key) {
|
|
48757
48789
|
if (key.includes(' ')) {
|
|
48758
|
-
key = key.replace(
|
|
48790
|
+
key = key.replace(/ /g, '_x0020_');
|
|
48759
48791
|
}
|
|
48760
48792
|
writer._writeStartElement(key.toString());
|
|
48761
48793
|
writer._writeString(value.toString());
|
|
@@ -48815,7 +48847,7 @@ var _XmlDocument = /** @__PURE__ @class */ (function (_super) {
|
|
|
48815
48847
|
}
|
|
48816
48848
|
var text = key.toString();
|
|
48817
48849
|
if (text.indexOf('_x0020_') !== -1) {
|
|
48818
|
-
text = text.replace(
|
|
48850
|
+
text = text.replace(/_x0020_/g, ' ');
|
|
48819
48851
|
}
|
|
48820
48852
|
var index = form._getFieldIndex(text);
|
|
48821
48853
|
if (index !== -1 && index < count) {
|
|
@@ -49937,8 +49969,11 @@ var _ImageDecoder = /** @__PURE__ @class */ (function () {
|
|
|
49937
49969
|
*/
|
|
49938
49970
|
function _ImageDecoder(stream) {
|
|
49939
49971
|
this._format = _ImageFormat.unknown;
|
|
49972
|
+
this._height = 0;
|
|
49973
|
+
this._width = 0;
|
|
49940
49974
|
this._bitsPerComponent = 8;
|
|
49941
49975
|
this._position = 0;
|
|
49976
|
+
this._noOfComponents = -1;
|
|
49942
49977
|
this._stream = stream;
|
|
49943
49978
|
this._initialize();
|
|
49944
49979
|
}
|
|
@@ -49970,19 +50005,32 @@ var _ImageDecoder = /** @__PURE__ @class */ (function () {
|
|
|
49970
50005
|
this._read(imgData, 0, imgData.byteLength);
|
|
49971
50006
|
var i = 4;
|
|
49972
50007
|
var length = this._getBuffer(i) * 256 + this._getBuffer(i + 1);
|
|
50008
|
+
var isLengthExceed = false;
|
|
49973
50009
|
while (i < imgData.byteLength) {
|
|
49974
50010
|
i += length;
|
|
49975
50011
|
if (i < imgData.byteLength) {
|
|
49976
50012
|
if (this._getBuffer(i + 1) === 192) {
|
|
49977
50013
|
this._height = this._getBuffer(i + 5) * 256 + this._getBuffer(i + 6);
|
|
49978
50014
|
this._width = this._getBuffer(i + 7) * 256 + this._getBuffer(i + 8);
|
|
49979
|
-
|
|
50015
|
+
this._noOfComponents = this._getBuffer(i + 9);
|
|
50016
|
+
if (this._width !== 0 && this._height !== 0) {
|
|
50017
|
+
return;
|
|
50018
|
+
}
|
|
49980
50019
|
}
|
|
49981
50020
|
else {
|
|
49982
50021
|
i += 2;
|
|
49983
50022
|
length = this._getBuffer(i) * 256 + this._getBuffer(i + 1);
|
|
49984
50023
|
}
|
|
49985
50024
|
}
|
|
50025
|
+
else {
|
|
50026
|
+
isLengthExceed = true;
|
|
50027
|
+
break;
|
|
50028
|
+
}
|
|
50029
|
+
}
|
|
50030
|
+
if (isLengthExceed) {
|
|
50031
|
+
this._reset();
|
|
50032
|
+
this._seek(2);
|
|
50033
|
+
this._readExceededJpegImage();
|
|
49986
50034
|
}
|
|
49987
50035
|
};
|
|
49988
50036
|
_ImageDecoder.prototype._checkIfJpeg = function () {
|
|
@@ -50040,6 +50088,12 @@ var _ImageDecoder = /** @__PURE__ @class */ (function () {
|
|
|
50040
50088
|
return this._imageStream;
|
|
50041
50089
|
};
|
|
50042
50090
|
_ImageDecoder.prototype._getColorSpace = function () {
|
|
50091
|
+
if (this._noOfComponents === 1) {
|
|
50092
|
+
return 'DeviceGray';
|
|
50093
|
+
}
|
|
50094
|
+
else if (this._noOfComponents === 4) {
|
|
50095
|
+
return 'DeviceCMYK';
|
|
50096
|
+
}
|
|
50043
50097
|
return 'DeviceRGB';
|
|
50044
50098
|
};
|
|
50045
50099
|
_ImageDecoder.prototype._getDecodeParams = function () {
|
|
@@ -50051,6 +50105,81 @@ var _ImageDecoder = /** @__PURE__ @class */ (function () {
|
|
|
50051
50105
|
decodeParams.set('BitsPerComponent', this._bitsPerComponent);
|
|
50052
50106
|
return decodeParams;
|
|
50053
50107
|
};
|
|
50108
|
+
_ImageDecoder.prototype._seek = function (length) {
|
|
50109
|
+
this._position += length;
|
|
50110
|
+
};
|
|
50111
|
+
_ImageDecoder.prototype._readByte = function () {
|
|
50112
|
+
if (this._position < this._stream.byteLength) {
|
|
50113
|
+
var value = this._getBuffer(this._position);
|
|
50114
|
+
this._position += 1;
|
|
50115
|
+
return value;
|
|
50116
|
+
}
|
|
50117
|
+
else {
|
|
50118
|
+
throw new Error('Error decoding JPEG image. Invalid offset.');
|
|
50119
|
+
}
|
|
50120
|
+
};
|
|
50121
|
+
_ImageDecoder.prototype._skipStream = function () {
|
|
50122
|
+
var length = this._getBuffer(this._position) << 8 | this._getBuffer(this._position + 1);
|
|
50123
|
+
this._seek(2);
|
|
50124
|
+
if (length < 2) {
|
|
50125
|
+
throw new Error('Error decoding JPEG image');
|
|
50126
|
+
}
|
|
50127
|
+
else if (length > 0) {
|
|
50128
|
+
this._seek(length - 2);
|
|
50129
|
+
}
|
|
50130
|
+
};
|
|
50131
|
+
_ImageDecoder.prototype._readExceededJpegImage = function () {
|
|
50132
|
+
var isContinueReading = true;
|
|
50133
|
+
while (isContinueReading) {
|
|
50134
|
+
var marker = this._getMarker();
|
|
50135
|
+
switch (marker) {
|
|
50136
|
+
case 0x00C0:
|
|
50137
|
+
case 0x00C1:
|
|
50138
|
+
case 0x00C2:
|
|
50139
|
+
case 0x00C3:
|
|
50140
|
+
case 0x00C5:
|
|
50141
|
+
case 0x00C6:
|
|
50142
|
+
case 0x00C7:
|
|
50143
|
+
case 0x00C9:
|
|
50144
|
+
case 0x00CA:
|
|
50145
|
+
case 0x00CB:
|
|
50146
|
+
case 0x00CD:
|
|
50147
|
+
case 0x00CE:
|
|
50148
|
+
case 0x00CF:
|
|
50149
|
+
this._seek(3);
|
|
50150
|
+
this._height = this._getBuffer(this._position) << 8 | this._getBuffer(this._position + 1);
|
|
50151
|
+
this._seek(2);
|
|
50152
|
+
this._width = this._getBuffer(this._position) << 8 | this._getBuffer(this._position + 1);
|
|
50153
|
+
this._seek(2);
|
|
50154
|
+
this._noOfComponents = this._getBuffer(this._position);
|
|
50155
|
+
this._seek(1);
|
|
50156
|
+
isContinueReading = false;
|
|
50157
|
+
break;
|
|
50158
|
+
default:
|
|
50159
|
+
this._skipStream();
|
|
50160
|
+
break;
|
|
50161
|
+
}
|
|
50162
|
+
}
|
|
50163
|
+
};
|
|
50164
|
+
_ImageDecoder.prototype._toUnsigned16 = function (value) {
|
|
50165
|
+
value = value & 0xFFFF;
|
|
50166
|
+
return value < 0 ? (value + 0x10000) : value;
|
|
50167
|
+
};
|
|
50168
|
+
_ImageDecoder.prototype._getMarker = function () {
|
|
50169
|
+
var skippedByte = 0;
|
|
50170
|
+
var marker = this._readByte();
|
|
50171
|
+
while (marker != 255) {
|
|
50172
|
+
skippedByte++;
|
|
50173
|
+
marker = this._readByte();
|
|
50174
|
+
}
|
|
50175
|
+
do {
|
|
50176
|
+
marker = this._readByte();
|
|
50177
|
+
} while (marker == 255);
|
|
50178
|
+
if (skippedByte != 0) {
|
|
50179
|
+
throw new Error('Error decoding JPEG image');
|
|
50180
|
+
}
|
|
50181
|
+
return this._toUnsigned16(marker);
|
|
50182
|
+
};
|
|
50054
50183
|
_ImageDecoder._jpegHeader = [255, 216];
|
|
50055
50184
|
return _ImageDecoder;
|
|
50056
50185
|
}());
|
|
@@ -50120,5 +50249,5 @@ var PdfBitmap = /** @__PURE__ @class */ (function (_super) {
|
|
|
50120
50249
|
return PdfBitmap;
|
|
50121
50250
|
}(PdfImage));
|
|
50122
50251
|
|
|
50123
|
-
export { _PdfBaseStream, _PdfStream, _PdfContentStream, _PdfNullStream, _ContentParser, _ContentLexer, _PdfRecord, _PdfDecodeStream, _PdfDecryptStream, PdfAnnotationFlag, PdfLineEndingStyle, PdfLineIntent, PdfLineCaptionType, PdfBorderStyle, PdfBorderEffectStyle, PdfRotationAngle, PdfCrossReferenceType, PdfHighlightMode, PdfTextAlignment, PdfFormFieldVisibility, PdfMeasurementUnit, PdfCircleMeasurementType, PdfRubberStampAnnotationIcon, PdfCheckBoxStyle, PdfTextMarkupAnnotationType, PdfPopupIcon, PdfAnnotationState, PdfAnnotationStateModel, PdfAttachmentIcon, PdfAnnotationIntent, PdfDestinationMode, DataFormat, PdfFormFieldsTabOrder, _PdfAnnotationType, _PdfGraphicsUnit, _FieldFlag, _SignatureFlag, _PdfCheckFieldState, PdfPermissionFlag, PdfPageOrientation, PdfTextDirection, PdfSubSuperScript, PdfBlendMode, PdfFillMode, PdfDashStyle, PdfLineCap, PdfLineJoin, _PdfWordWrapType, _FontDescriptorFlag, _TrueTypeCmapFormat, _TrueTypeCmapEncoding, _TrueTypePlatformID, _TrueTypeMicrosoftEncodingID, _TrueTypeMacintoshEncodingID, _TrueTypeCompositeGlyphFlag, _ImageFormat, _TokenType, PdfTextStyle, _PdfFlateStream, _PdfCatalog, _PdfCrossReference, PdfDocument, PdfAnnotationExportSettings, PdfFormFieldExportSettings, PdfFileStructure, PdfPage, PdfDestination, PdfBookmarkBase, PdfBookmark, PdfNamedDestination, _PdfNamedDestinationCollection, _PdfLexicalOperator, _PdfParser, _Linearization, _PdfName, _PdfCommand, _PdfReference, _PdfReferenceSet, _PdfReferenceSetCache, Dictionary, _PdfDictionary, _PdfNull, _clearPrimitiveCaches, _isName, _isCommand, PdfPredictorStream, _checkRotation, _getPageIndex, _annotationFlagsToString, _stringToAnnotationFlags, _stringToPdfString, _stringToBytes, _convertStringToBytes, _areArrayEqual, _numberToString, _areNotEqual, _bytesToString, _stringToUnicodeArray, _byteArrayToHexString, _hexStringToByteArray, _hexStringToString, _isWhiteSpace, _decode, _encode, _getInheritableProperty, _parseRectangle, _calculateBounds, _toRectangle, _fromRectangle, _getUpdatedBounds, _convertToColor, _parseColor, _mapBorderStyle, _mapBorderEffectStyle, _reverseMapEndingStyle, _mapLineEndingStyle, _mapHighlightMode, _reverseMapHighlightMode, _reverseMapBlendMode, _mapBlendMode, _floatToString, _addProcSet, _getNewGuidString, _escapePdfName, _getBezierArc, _findPage, _checkField, _getItemValue, _getStateTemplate, _getColorValue, _setMatrix, _styleToString, _stringToStyle, _mapMeasurementUnit, _mapMarkupAnnotationType, _reverseMarkupAnnotationType, _mapGraphicsUnit, _mapRubberStampIcon, _mapPopupIcon, _reverseMapAnnotationState, _mapAnnotationState, _reverseMapAnnotationStateModel, _mapAnnotationStateModel, _mapAttachmentIcon, _mapAnnotationIntent, _reverseMapPdfFontStyle, _getSpecialCharacter, _getLatinCharacter, _encodeValue, _getCommentsOrReview, _checkReview, _checkComment, _updateVisibility, _removeDuplicateReference, _removeDuplicateFromResources, _removeReferences, BaseException, FormatError, ParserEndOfFileException, _defaultToString, _obtainFontDetails, _getFontStyle, _mapFont, _tryParseFontStream, PdfAnnotationCollection, PdfPopupAnnotationCollection, PdfAnnotation, PdfComment, PdfLineAnnotation, PdfCircleAnnotation, PdfEllipseAnnotation, PdfSquareAnnotation, PdfRectangleAnnotation, PdfPolygonAnnotation, PdfPolyLineAnnotation, PdfAngleMeasurementAnnotation, PdfInkAnnotation, PdfPopupAnnotation, PdfFileLinkAnnotation, PdfUriAnnotation, PdfDocumentLinkAnnotation, PdfTextWebLinkAnnotation, PdfAttachmentAnnotation, Pdf3DAnnotation, PdfTextMarkupAnnotation, PdfWatermarkAnnotation, PdfRubberStampAnnotation, PdfSoundAnnotation, PdfFreeTextAnnotation, PdfRedactionAnnotation, PdfRichMediaAnnotation, PdfWidgetAnnotation, PdfStateItem, PdfRadioButtonListItem, PdfListFieldItem, PdfAnnotationCaption, PdfAnnotationLineEndingStyle, PdfInteractiveBorder, PdfAnnotationBorder, PdfBorderEffect, _PaintParameter, PdfAppearance, _PdfPaddings, _PdfFontMetrics, _WidthTable, _StandardWidthTable, _CjkWidthTable, _CjkWidth, _CjkSameWidth, _CjkDifferentWidth, PdfFont, PdfStandardFont, PdfCjkStandardFont, PdfTrueTypeFont, _PdfStandardFontMetricsFactory, _PdfCjkStandardFontMetricsFactory, _PdfCjkFontDescriptorFactory, PdfFontStyle, PdfFontFamily, PdfCjkFontFamily, _UnicodeLine, PdfStringFormat, PdfVerticalAlignment, _PdfStringLayouter, _PdfStringLayoutResult, _LineInfo, _LineType, _StringTokenizer, _TrueTypeReader, _TrueTypeNameRecord, _TrueTypeMetrics, _TrueTypeLongHorMetric, _TrueTypeGlyph, _TrueTypeLocaTable, _TrueTypeGlyphHeader, _BigEndianWriter, _TrueTypeTableInfo, _TrueTypeOS2Table, _TrueTypePostTable, _TrueTypeNameTable, _TrueTypeMicrosoftCmapSubTable, _TrueTypeHorizontalHeaderTable, _TrueTypeHeadTable, _TrueTypeCmapTable, _TrueTypeCmapSubTable, _TrueTypeAppleCmapSubTable, _TrueTypeTrimmedCmapSubTable, _UnicodeTrueTypeFont, PdfField, PdfTextBoxField, PdfButtonField, PdfCheckBoxField, PdfRadioButtonListField, PdfListField, PdfComboBoxField, PdfListBoxField, PdfSignatureField, _PdfDefaultAppearance, PdfForm, PdfGraphics, _PdfTransformationMatrix, _Matrix, PdfGraphicsState, _TextRenderingMode, PdfBrush, PdfPen, _PdfUnitConvertor, _PdfPath, _PathPointType, _PdfStreamWriter, PdfTemplate, _Bidirectional, _RtlCharacters, _ArabicShapeRenderer, _ArabicShape, _RtlRenderer, _ImageDecoder, PdfBitmap, PdfImage, _PdfEncryptor, _MD5, _Sha256, _Sha512, _Word64, _EncryptionKey, _BasicEncryption, _AdvancedEncryption, _Cipher, _NormalCipherFour, _AdvancedEncryptionBaseCipher, _AdvancedEncryption128Cipher, _AdvancedEncryption256Cipher, _NullCipher, _CipherTransform, _ExportHelper, _XfdfDocument, _FontStructure, _XmlWriter, _Namespace, _XmlElement, _XmlAttribute, _FdfDocument, _FdfHelper, _JsonDocument, _XmlDocument };
|
|
50252
|
+
export { _PdfBaseStream, _PdfStream, _PdfContentStream, _PdfNullStream, _ContentParser, _ContentLexer, _PdfRecord, _PdfDecodeStream, _PdfDecryptStream, PdfAnnotationFlag, PdfLineEndingStyle, PdfLineIntent, PdfLineCaptionType, PdfBorderStyle, PdfBorderEffectStyle, PdfRotationAngle, PdfCrossReferenceType, PdfHighlightMode, PdfTextAlignment, PdfFormFieldVisibility, PdfMeasurementUnit, PdfCircleMeasurementType, PdfRubberStampAnnotationIcon, PdfCheckBoxStyle, PdfTextMarkupAnnotationType, PdfPopupIcon, PdfAnnotationState, PdfAnnotationStateModel, PdfAttachmentIcon, PdfAnnotationIntent, PdfDestinationMode, DataFormat, PdfFormFieldsTabOrder, _PdfAnnotationType, _PdfGraphicsUnit, _FieldFlag, _SignatureFlag, _PdfCheckFieldState, PdfPermissionFlag, PdfPageOrientation, PdfTextDirection, PdfSubSuperScript, PdfBlendMode, PdfFillMode, PdfDashStyle, PdfLineCap, PdfLineJoin, _PdfWordWrapType, _FontDescriptorFlag, _TrueTypeCmapFormat, _TrueTypeCmapEncoding, _TrueTypePlatformID, _TrueTypeMicrosoftEncodingID, _TrueTypeMacintoshEncodingID, _TrueTypeCompositeGlyphFlag, _ImageFormat, _TokenType, PdfTextStyle, _PdfFlateStream, _PdfCatalog, _PdfCrossReference, PdfDocument, PdfAnnotationExportSettings, PdfFormFieldExportSettings, PdfFileStructure, PdfPage, PdfDestination, PdfBookmarkBase, PdfBookmark, PdfNamedDestination, _PdfNamedDestinationCollection, _PdfLexicalOperator, _PdfParser, _Linearization, _PdfName, _PdfCommand, _PdfReference, _PdfReferenceSet, _PdfReferenceSetCache, Dictionary, _PdfDictionary, _PdfNull, _clearPrimitiveCaches, _isName, _isCommand, PdfPredictorStream, _checkRotation, _getPageIndex, _annotationFlagsToString, _stringToAnnotationFlags, _stringToPdfString, _stringToBytes, _convertStringToBytes, _areArrayEqual, _numberToString, _areNotEqual, _bytesToString, _stringToUnicodeArray, _byteArrayToHexString, _hexStringToByteArray, _hexStringToString, _isWhiteSpace, _decode, _encode, _getInheritableProperty, _parseRectangle, _calculateBounds, _toRectangle, _fromRectangle, _getUpdatedBounds, _convertToColor, _parseColor, _mapBorderStyle, _mapBorderEffectStyle, _reverseMapEndingStyle, _mapLineEndingStyle, _mapHighlightMode, _reverseMapHighlightMode, _reverseMapBlendMode, _mapBlendMode, _floatToString, _addProcSet, _getNewGuidString, _escapePdfName, _getBezierArc, _findPage, _checkField, _getItemValue, _getStateTemplate, _getColorValue, _setMatrix, _styleToString, _stringToStyle, _mapMeasurementUnit, _mapMarkupAnnotationType, _reverseMarkupAnnotationType, _mapGraphicsUnit, _mapRubberStampIcon, _mapPopupIcon, _reverseMapAnnotationState, _mapAnnotationState, _reverseMapAnnotationStateModel, _mapAnnotationStateModel, _mapAttachmentIcon, _mapAnnotationIntent, _reverseMapPdfFontStyle, _getSpecialCharacter, _getLatinCharacter, _encodeValue, _getCommentsOrReview, _checkReview, _checkComment, _updateVisibility, _removeDuplicateReference, _removeDuplicateFromResources, _removeReferences, BaseException, FormatError, ParserEndOfFileException, _defaultToString, _obtainFontDetails, _getFontStyle, _mapFont, _tryParseFontStream, _checkInkPoints, PdfAnnotationCollection, PdfPopupAnnotationCollection, PdfAnnotation, PdfComment, PdfLineAnnotation, PdfCircleAnnotation, PdfEllipseAnnotation, PdfSquareAnnotation, PdfRectangleAnnotation, PdfPolygonAnnotation, PdfPolyLineAnnotation, PdfAngleMeasurementAnnotation, PdfInkAnnotation, PdfPopupAnnotation, PdfFileLinkAnnotation, PdfUriAnnotation, PdfDocumentLinkAnnotation, PdfTextWebLinkAnnotation, PdfAttachmentAnnotation, Pdf3DAnnotation, PdfTextMarkupAnnotation, PdfWatermarkAnnotation, PdfRubberStampAnnotation, PdfSoundAnnotation, PdfFreeTextAnnotation, PdfRedactionAnnotation, PdfRichMediaAnnotation, PdfWidgetAnnotation, PdfStateItem, PdfRadioButtonListItem, PdfListFieldItem, PdfAnnotationCaption, PdfAnnotationLineEndingStyle, PdfInteractiveBorder, PdfAnnotationBorder, PdfBorderEffect, _PaintParameter, PdfAppearance, _PdfPaddings, _PdfFontMetrics, _WidthTable, _StandardWidthTable, _CjkWidthTable, _CjkWidth, _CjkSameWidth, _CjkDifferentWidth, PdfFont, PdfStandardFont, PdfCjkStandardFont, PdfTrueTypeFont, _PdfStandardFontMetricsFactory, _PdfCjkStandardFontMetricsFactory, _PdfCjkFontDescriptorFactory, PdfFontStyle, PdfFontFamily, PdfCjkFontFamily, _UnicodeLine, PdfStringFormat, PdfVerticalAlignment, _PdfStringLayouter, _PdfStringLayoutResult, _LineInfo, _LineType, _StringTokenizer, _TrueTypeReader, _TrueTypeNameRecord, _TrueTypeMetrics, _TrueTypeLongHorMetric, _TrueTypeGlyph, _TrueTypeLocaTable, _TrueTypeGlyphHeader, _BigEndianWriter, _TrueTypeTableInfo, _TrueTypeOS2Table, _TrueTypePostTable, _TrueTypeNameTable, _TrueTypeMicrosoftCmapSubTable, _TrueTypeHorizontalHeaderTable, _TrueTypeHeadTable, _TrueTypeCmapTable, _TrueTypeCmapSubTable, _TrueTypeAppleCmapSubTable, _TrueTypeTrimmedCmapSubTable, _UnicodeTrueTypeFont, PdfField, PdfTextBoxField, PdfButtonField, PdfCheckBoxField, PdfRadioButtonListField, PdfListField, PdfComboBoxField, PdfListBoxField, PdfSignatureField, _PdfDefaultAppearance, PdfForm, PdfGraphics, _PdfTransformationMatrix, _Matrix, PdfGraphicsState, _TextRenderingMode, PdfBrush, PdfPen, _PdfUnitConvertor, _PdfPath, _PathPointType, _PdfStreamWriter, PdfTemplate, _Bidirectional, _RtlCharacters, _ArabicShapeRenderer, _ArabicShape, _RtlRenderer, _ImageDecoder, PdfBitmap, PdfImage, _PdfEncryptor, _MD5, _Sha256, _Sha512, _Word64, _EncryptionKey, _BasicEncryption, _AdvancedEncryption, _Cipher, _NormalCipherFour, _AdvancedEncryptionBaseCipher, _AdvancedEncryption128Cipher, _AdvancedEncryption256Cipher, _NullCipher, _CipherTransform, _ExportHelper, _XfdfDocument, _FontStructure, _XmlWriter, _Namespace, _XmlElement, _XmlAttribute, _FdfDocument, _FdfHelper, _JsonDocument, _XmlDocument };
|
|
50124
50253
|
//# sourceMappingURL=ej2-pdf.es5.js.map
|