@syncfusion/ej2-pdf-export 27.1.51 → 28.1.33

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,7 +1,7 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 27.1.51
4
- * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
3
+ * version : 28.1.33
4
+ * Copyright Syncfusion Inc. 2001 - 2024. 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
7
7
  * licensing@syncfusion.com. Any infringement will be prosecuted under
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-pdf-export@*",
3
- "_id": "@syncfusion/ej2-pdf-export@27.1.50",
3
+ "_id": "@syncfusion/ej2-pdf-export@0.38.8",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-Pj0GRZZUgERUxCJxCmok/GOQtYlIeYHXs5/HQ9ufJS/Nao/qCpuDBrEX1V0k2f4QYKhxVGejqUJ7tBDI8eT2uQ==",
5
+ "_integrity": "sha512-Wxc5yKz19Za4UYAj3RoqbpM2B2ROUgbQyVub79u4wHXtGHbzXYihmSegVMpeOyXnNLmMqsIVYBr6f3itGCVZbw==",
6
6
  "_location": "/@syncfusion/ej2-pdf-export",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -27,16 +27,16 @@
27
27
  "/@syncfusion/ej2-pivotview",
28
28
  "/@syncfusion/ej2-treemap"
29
29
  ],
30
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-pdf-export/-/ej2-pdf-export-27.1.50.tgz",
31
- "_shasum": "4bf75c8d54ba7e30ed495e3d466de79be2196d3e",
30
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-release/@syncfusion/ej2-pdf-export/-/ej2-pdf-export-0.38.8.tgz",
31
+ "_shasum": "f428b8d900c48c98c0db53e1afd30d08ca056598",
32
32
  "_spec": "@syncfusion/ej2-pdf-export@*",
33
- "_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
33
+ "_where": "/jenkins/workspace/elease-automation_release_28.1.1/packages/included",
34
34
  "author": {
35
35
  "name": "Syncfusion Inc."
36
36
  },
37
37
  "bundleDependencies": false,
38
38
  "dependencies": {
39
- "@syncfusion/ej2-compression": "~27.1.50"
39
+ "@syncfusion/ej2-compression": "~28.1.33"
40
40
  },
41
41
  "deprecated": false,
42
42
  "description": "Syncfusion TypeScript Component",
@@ -47,7 +47,7 @@
47
47
  "module": "./index.js",
48
48
  "name": "@syncfusion/ej2-pdf-export",
49
49
  "typings": "index.d.ts",
50
- "version": "27.1.51",
50
+ "version": "28.1.33",
51
51
  "sideEffects": false,
52
52
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
53
53
  }
@@ -129,4 +129,9 @@ export declare class PdfDocumentBase {
129
129
  * @private
130
130
  */
131
131
  clone(): PdfDocument;
132
+ /**
133
+ * Save PDF document.
134
+ * @private
135
+ */
136
+ _save(): Uint8Array;
132
137
  }
@@ -131,6 +131,13 @@ var PdfDocumentBase = /** @class */ (function () {
131
131
  PdfDocumentBase.prototype.clone = function () {
132
132
  return this.document;
133
133
  };
134
+ /**
135
+ * Save PDF document.
136
+ * @private
137
+ */
138
+ PdfDocumentBase.prototype._save = function () {
139
+ return this.document._docSave();
140
+ };
134
141
  return PdfDocumentBase;
135
142
  }());
136
143
  export { PdfDocumentBase };
@@ -1,4 +1,5 @@
1
1
  import { StreamWriter } from '@syncfusion/ej2-file-utils';
2
+ import { PdfWriterHelper } from './../input-output/pdf-writer';
2
3
  import { PdfDocumentBase } from './pdf-document-base';
3
4
  import { PdfPageSettings } from './../pages/pdf-page-settings';
4
5
  import { PdfSectionCollection } from './../pages/pdf-section-collection';
@@ -58,7 +59,7 @@ export declare class PdfDocument extends PdfDocumentBase {
58
59
  * @default null
59
60
  * @private
60
61
  */
61
- streamWriter: StreamWriter;
62
+ streamWriter: StreamWriter | PdfWriterHelper;
62
63
  /**
63
64
  * Defines the `color space` of the document
64
65
  * @private
@@ -193,6 +194,11 @@ export declare class PdfDocument extends PdfDocumentBase {
193
194
  * @private
194
195
  */
195
196
  docSave(stream: StreamWriter, filename: string, isBase: boolean): void;
197
+ /**
198
+ * Saves the document to the specified output stream and return the stream as byte array.
199
+ * @private
200
+ */
201
+ _docSave(): Uint8Array;
196
202
  /**
197
203
  * Checks the pages `presence`.
198
204
  * @private
@@ -11,7 +11,7 @@ var __extends = (this && this.__extends) || (function () {
11
11
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
12
  };
13
13
  })();
14
- import { PdfWriter } from './../input-output/pdf-writer';
14
+ import { PdfWriter, PdfWriterHelper } from './../input-output/pdf-writer';
15
15
  import { PdfMainObjectCollection } from './../input-output/pdf-main-object-collection';
16
16
  import { PdfDocumentBase } from './pdf-document-base';
17
17
  import { PdfCrossTable } from './../input-output/pdf-cross-table';
@@ -280,6 +280,21 @@ var PdfDocument = /** @class */ (function (_super) {
280
280
  this.crossTable.save(writer, arg2);
281
281
  }
282
282
  };
283
+ /**
284
+ * Saves the document to the specified output stream and return the stream as byte array.
285
+ * @private
286
+ */
287
+ PdfDocument.prototype._docSave = function () {
288
+ var stream = new PdfWriterHelper();
289
+ this.checkPagesPresence();
290
+ if (stream === null) {
291
+ throw new Error('ArgumentNullException : stream');
292
+ }
293
+ this.streamWriter = stream;
294
+ var writer = new PdfWriter(stream);
295
+ writer.document = this;
296
+ return this.crossTable._save(writer);
297
+ };
283
298
  /**
284
299
  * Checks the pages `presence`.
285
300
  * @private
@@ -321,7 +336,9 @@ var PdfDocument = /** @class */ (function (_super) {
321
336
  PdfDocument.cache.destroy();
322
337
  this.crossTable.pdfObjects.destroy();
323
338
  PdfDocument.cache = undefined;
324
- this.streamWriter.destroy();
339
+ if (this.streamWriter) {
340
+ this.streamWriter.destroy();
341
+ }
325
342
  };
326
343
  /**
327
344
  * `Font` used in complex objects to draw strings and text when it is not defined explicitly.
@@ -4,7 +4,6 @@
4
4
  import { PdfStreamWriter } from './../../input-output/pdf-stream-writer';
5
5
  import { GetResourceEventHandler } from './../pdf-graphics';
6
6
  import { PdfColorSpace } from './../enum';
7
- import { PdfColor } from './../pdf-color';
8
7
  import { ICloneable } from './../../../interfaces/i-pdf-clonable';
9
8
  /**
10
9
  * `PdfBrush` class provides objects used to fill the interiors of graphical shapes such as rectangles,
@@ -18,11 +17,6 @@ export declare abstract class PdfBrush implements ICloneable {
18
17
  * @private
19
18
  */
20
19
  constructor();
21
- /**
22
- * Stores the instance of `PdfColor` class.
23
- * @private
24
- */
25
- color: PdfColor;
26
20
  /**
27
21
  * `MonitorChanges` abstract method overload.
28
22
  * @hidden
@@ -109,6 +109,16 @@ export declare class PdfCrossTable {
109
109
  * @private
110
110
  */
111
111
  save(writer: PdfWriter, filename: string): void;
112
+ /**
113
+ * Saves the cross-reference table into the stream.
114
+ * @private
115
+ */
116
+ _saveProcess(writer: PdfWriter): void;
117
+ /**
118
+ * Saves the cross-reference table into the stream.
119
+ * @private
120
+ */
121
+ _save(writer: PdfWriter): Uint8Array;
112
122
  /**
113
123
  * `Saves the endess` of the file.
114
124
  * @private
@@ -132,8 +132,20 @@ var PdfCrossTable = /** @class */ (function () {
132
132
  configurable: true
133
133
  });
134
134
  PdfCrossTable.prototype.save = function (writer, filename) {
135
+ this._saveProcess(writer);
136
+ if (typeof filename === 'undefined') {
137
+ return writer.stream.buffer;
138
+ }
139
+ else {
140
+ writer.stream.save(filename);
141
+ }
142
+ };
143
+ /**
144
+ * Saves the cross-reference table into the stream.
145
+ * @private
146
+ */
147
+ PdfCrossTable.prototype._saveProcess = function (writer) {
135
148
  this.saveHead(writer);
136
- var state = false;
137
149
  this.mappedReferences = null;
138
150
  this.objects.clear();
139
151
  this.markTrailerReferences();
@@ -152,12 +164,14 @@ var PdfCrossTable = /** @class */ (function () {
152
164
  var oi = this.objectCollection.items(i);
153
165
  oi.object.isSaving = false;
154
166
  }
155
- if (typeof filename === 'undefined') {
156
- return writer.stream.buffer;
157
- }
158
- else {
159
- writer.stream.save(filename);
160
- }
167
+ };
168
+ /**
169
+ * Saves the cross-reference table into the stream.
170
+ * @private
171
+ */
172
+ PdfCrossTable.prototype._save = function (writer) {
173
+ this._saveProcess(writer);
174
+ return new Uint8Array(writer.stream.buffer.buffer);
161
175
  };
162
176
  /**
163
177
  * `Saves the endess` of the file.
@@ -387,7 +401,6 @@ var PdfCrossTable = /** @class */ (function () {
387
401
  * @private
388
402
  */
389
403
  PdfCrossTable.prototype.doSaveObject = function (obj, reference, writer) {
390
- var correctPosition = writer.length;
391
404
  writer.write(reference.objNumber.toString());
392
405
  writer.write(Operators.whiteSpace);
393
406
  writer.write(reference.genNumber.toString());
@@ -395,7 +408,6 @@ var PdfCrossTable = /** @class */ (function () {
395
408
  writer.write(Operators.obj);
396
409
  writer.write(Operators.newLine);
397
410
  obj.save(writer);
398
- var stream = writer.stream;
399
411
  writer.write(Operators.endObj);
400
412
  writer.write(Operators.newLine);
401
413
  };
@@ -40,6 +40,11 @@ export declare class PdfWriter implements IPdfWriter {
40
40
  * @private
41
41
  */
42
42
  constructor(stream: StreamWriter);
43
+ /**
44
+ * Initialize an instance of `PdfWriter` class.
45
+ * @private
46
+ */
47
+ constructor(stream: PdfWriterHelper);
43
48
  /**
44
49
  * Gets and Sets the `document`.
45
50
  * @private
@@ -59,10 +64,59 @@ export declare class PdfWriter implements IPdfWriter {
59
64
  * Gets the `stream`.
60
65
  * @private
61
66
  */
62
- readonly stream: StreamWriter;
67
+ readonly stream: StreamWriter | PdfWriterHelper;
63
68
  /**
64
69
  * `Writes the specified data`.
65
70
  * @private
66
71
  */
67
72
  write(overload: IPdfPrimitive | number | string | number[]): void;
68
73
  }
74
+ /**
75
+ * Helper class for PDF writer.
76
+ * @private
77
+ */
78
+ export declare class PdfWriterHelper {
79
+ buffer: PdfArrayBuffer;
80
+ /**
81
+ * Initialize an instance of `PdfWriterHelper` class.
82
+ * @private
83
+ */
84
+ constructor();
85
+ /**
86
+ * Writes the specified data.
87
+ * @private
88
+ */
89
+ write(data: string): void;
90
+ /**
91
+ * Destroy the array buffer.
92
+ * @private
93
+ */
94
+ destroy(): void;
95
+ }
96
+ /**
97
+ * Helper class for PDF writer.
98
+ * @private
99
+ */
100
+ export declare class PdfArrayBuffer {
101
+ buffer: number[];
102
+ /**
103
+ * Initialize an instance of `PdfArrayBuffer` class.
104
+ * @private
105
+ */
106
+ constructor();
107
+ /**
108
+ * Gets the `size`.
109
+ * @private
110
+ */
111
+ readonly size: number;
112
+ /**
113
+ * Writes the specified data.
114
+ * @private
115
+ */
116
+ write(value: string): void;
117
+ /**
118
+ * Destroy the array buffer.
119
+ * @private
120
+ */
121
+ destroy(): void;
122
+ }
@@ -3,10 +3,6 @@
3
3
  * @private
4
4
  */
5
5
  var PdfWriter = /** @class */ (function () {
6
- /**
7
- * Initialize an instance of `PdfWriter` class.
8
- * @private
9
- */
10
6
  function PdfWriter(stream) {
11
7
  this.streamWriter = stream;
12
8
  }
@@ -53,8 +49,7 @@ var PdfWriter = /** @class */ (function () {
53
49
  * @private
54
50
  */
55
51
  get: function () {
56
- var result = this.streamWriter;
57
- return result;
52
+ return this.streamWriter;
58
53
  },
59
54
  enumerable: true,
60
55
  configurable: true
@@ -72,3 +67,80 @@ var PdfWriter = /** @class */ (function () {
72
67
  return PdfWriter;
73
68
  }());
74
69
  export { PdfWriter };
70
+ /**
71
+ * Helper class for PDF writer.
72
+ * @private
73
+ */
74
+ var PdfWriterHelper = /** @class */ (function () {
75
+ /**
76
+ * Initialize an instance of `PdfWriterHelper` class.
77
+ * @private
78
+ */
79
+ function PdfWriterHelper() {
80
+ this.buffer = new PdfArrayBuffer();
81
+ }
82
+ /**
83
+ * Writes the specified data.
84
+ * @private
85
+ */
86
+ PdfWriterHelper.prototype.write = function (data) {
87
+ this.buffer.write(data);
88
+ };
89
+ /**
90
+ * Destroy the array buffer.
91
+ * @private
92
+ */
93
+ PdfWriterHelper.prototype.destroy = function () {
94
+ if (this.buffer) {
95
+ this.buffer.destroy();
96
+ this.buffer = undefined;
97
+ }
98
+ };
99
+ return PdfWriterHelper;
100
+ }());
101
+ export { PdfWriterHelper };
102
+ /**
103
+ * Helper class for PDF writer.
104
+ * @private
105
+ */
106
+ var PdfArrayBuffer = /** @class */ (function () {
107
+ /**
108
+ * Initialize an instance of `PdfArrayBuffer` class.
109
+ * @private
110
+ */
111
+ function PdfArrayBuffer() {
112
+ this.buffer = [];
113
+ }
114
+ Object.defineProperty(PdfArrayBuffer.prototype, "size", {
115
+ /**
116
+ * Gets the `size`.
117
+ * @private
118
+ */
119
+ get: function () {
120
+ return this.buffer.length;
121
+ },
122
+ enumerable: true,
123
+ configurable: true
124
+ });
125
+ /**
126
+ * Writes the specified data.
127
+ * @private
128
+ */
129
+ PdfArrayBuffer.prototype.write = function (value) {
130
+ for (var i = 0; i < value.length; i++) {
131
+ this.buffer.push(value.charCodeAt(i) & 0xff);
132
+ }
133
+ };
134
+ /**
135
+ * Destroy the array buffer.
136
+ * @private
137
+ */
138
+ PdfArrayBuffer.prototype.destroy = function () {
139
+ if (this.buffer) {
140
+ this.buffer = [];
141
+ this.buffer = undefined;
142
+ }
143
+ };
144
+ return PdfArrayBuffer;
145
+ }());
146
+ export { PdfArrayBuffer };