@syncfusion/ej2-pdf 23.2.6 → 24.1.41
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 +0 -43
- 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 +27 -29
- package/dist/es6/ej2-pdf.es2015.js.map +1 -1
- package/dist/es6/ej2-pdf.es5.js +25 -27
- 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/import-export/json-document.js +16 -16
- package/src/pdf/core/import-export/xfdf-document.js +9 -11
|
@@ -42508,26 +42508,24 @@ class _XfdfDocument extends _ExportHelper {
|
|
|
42508
42508
|
const streamDictionary = primitive.dictionary;
|
|
42509
42509
|
this._writePrefix(writer, 'STREAM', key);
|
|
42510
42510
|
writer._writeAttributeString('DEFINE', '');
|
|
42511
|
+
const data = primitive.getString();
|
|
42512
|
+
if (!streamDictionary.has('Length') && data && data !== '') {
|
|
42513
|
+
streamDictionary.update('Length', primitive.length);
|
|
42514
|
+
}
|
|
42511
42515
|
this._writeAppearanceDictionary(writer, streamDictionary);
|
|
42512
42516
|
writer._writeStartElement('DATA');
|
|
42513
|
-
|
|
42514
|
-
if (length > 0 && (streamDictionary.has('Subtype') &&
|
|
42517
|
+
if ((streamDictionary.has('Subtype') &&
|
|
42515
42518
|
this._getValue(streamDictionary.get('Subtype')) === 'Image') ||
|
|
42516
42519
|
(!streamDictionary.has('Type') && !streamDictionary.has('Subtype'))) {
|
|
42517
42520
|
writer._writeAttributeString('MODE', 'RAW');
|
|
42518
42521
|
writer._writeAttributeString('ENCODING', 'HEX');
|
|
42519
|
-
const data = primitive.getString();
|
|
42520
|
-
if (data && data !== '') {
|
|
42521
|
-
writer._writeRaw(data);
|
|
42522
|
-
}
|
|
42523
42522
|
}
|
|
42524
|
-
else
|
|
42523
|
+
else {
|
|
42525
42524
|
writer._writeAttributeString('MODE', 'FILTERED');
|
|
42526
42525
|
writer._writeAttributeString('ENCODING', 'ASCII');
|
|
42527
|
-
|
|
42528
|
-
|
|
42529
|
-
|
|
42530
|
-
}
|
|
42526
|
+
}
|
|
42527
|
+
if (data && data !== '') {
|
|
42528
|
+
writer._writeRaw(data);
|
|
42531
42529
|
}
|
|
42532
42530
|
writer._writeEndElement();
|
|
42533
42531
|
writer._writeEndElement();
|
|
@@ -44649,27 +44647,27 @@ class _JsonDocument extends _ExportHelper {
|
|
|
44649
44647
|
const dataTable = new Map(); // eslint-disable-line
|
|
44650
44648
|
const streamTable = new Map(); // eslint-disable-line
|
|
44651
44649
|
const streamDictionary = value.dictionary;
|
|
44650
|
+
const data = value.getString(true);
|
|
44651
|
+
if (!streamDictionary.has('Length') && data && data !== '') {
|
|
44652
|
+
streamDictionary.update('Length', value.length);
|
|
44653
|
+
}
|
|
44652
44654
|
this._writeAppearanceDictionary(streamTable, streamDictionary);
|
|
44653
|
-
const length = streamDictionary.get('Length');
|
|
44654
44655
|
let type;
|
|
44655
44656
|
if (streamDictionary.has('Subtype')) {
|
|
44656
44657
|
type = this._getValue(streamDictionary.get('Subtype'));
|
|
44657
44658
|
}
|
|
44658
|
-
if (
|
|
44659
|
-
|
|
44660
|
-
(
|
|
44661
|
-
|
|
44662
|
-
|
|
44663
|
-
|
|
44664
|
-
|
|
44665
|
-
|
|
44666
|
-
|
|
44667
|
-
|
|
44668
|
-
|
|
44669
|
-
|
|
44670
|
-
if (data && data !== '') {
|
|
44671
|
-
dataTable.set('bytes', data);
|
|
44672
|
-
}
|
|
44659
|
+
if ((!streamDictionary.has('Type') && !streamDictionary.has('Subtype')) ||
|
|
44660
|
+
(streamDictionary.has('Subtype') &&
|
|
44661
|
+
(type === 'Image' || type === 'Form' || type === 'CIDFontType0C' || type === 'OpenType'))) {
|
|
44662
|
+
dataTable.set('mode', 'raw');
|
|
44663
|
+
dataTable.set('encoding', 'hex');
|
|
44664
|
+
}
|
|
44665
|
+
else {
|
|
44666
|
+
dataTable.set('mode', 'filtered');
|
|
44667
|
+
dataTable.set('encoding', 'ascii');
|
|
44668
|
+
}
|
|
44669
|
+
if (data && data !== '') {
|
|
44670
|
+
dataTable.set('bytes', data);
|
|
44673
44671
|
}
|
|
44674
44672
|
streamTable.set('data', this._convertToJson(dataTable));
|
|
44675
44673
|
this._writeTable('stream', this._convertToJson(streamTable), table, key, array);
|
|
@@ -48288,7 +48286,7 @@ class _ImageDecoder {
|
|
|
48288
48286
|
}
|
|
48289
48287
|
}
|
|
48290
48288
|
_skipStream() {
|
|
48291
|
-
|
|
48289
|
+
const length = this._getBuffer(this._position) << 8 | this._getBuffer(this._position + 1);
|
|
48292
48290
|
this._seek(2);
|
|
48293
48291
|
if (length < 2) {
|
|
48294
48292
|
throw new Error('Error decoding JPEG image');
|
|
@@ -48300,7 +48298,7 @@ class _ImageDecoder {
|
|
|
48300
48298
|
_readExceededJpegImage() {
|
|
48301
48299
|
let isContinueReading = true;
|
|
48302
48300
|
while (isContinueReading) {
|
|
48303
|
-
|
|
48301
|
+
const marker = this._getMarker();
|
|
48304
48302
|
switch (marker) {
|
|
48305
48303
|
case 0x00C0:
|
|
48306
48304
|
case 0x00C1:
|