@syncfusion/ej2-pdf-export 20.3.56 → 20.4.38

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.
Files changed (155) hide show
  1. package/.eslintrc.json +16 -1
  2. package/dist/ej2-pdf-export.min.js +1 -1
  3. package/dist/ej2-pdf-export.umd.min.js +1 -1
  4. package/dist/global/ej2-pdf-export.min.js +1 -1
  5. package/dist/global/index.d.ts +1 -1
  6. package/package.json +6 -7
  7. package/dist/ts/implementation/actions/action.ts +0 -76
  8. package/dist/ts/implementation/actions/uri-action.ts +0 -52
  9. package/dist/ts/implementation/annotations/action-link-annotation.ts +0 -43
  10. package/dist/ts/implementation/annotations/annotation-collection.ts +0 -159
  11. package/dist/ts/implementation/annotations/annotation.ts +0 -241
  12. package/dist/ts/implementation/annotations/document-link-annotation.ts +0 -118
  13. package/dist/ts/implementation/annotations/link-annotation.ts +0 -32
  14. package/dist/ts/implementation/annotations/pdf-text-web-link.ts +0 -265
  15. package/dist/ts/implementation/annotations/uri-annotation.ts +0 -86
  16. package/dist/ts/implementation/collections/dictionary.ts +0 -150
  17. package/dist/ts/implementation/collections/object-object-pair/dictionary.ts +0 -125
  18. package/dist/ts/implementation/collections/utils.ts +0 -38
  19. package/dist/ts/implementation/document/automatic-fields/automatic-field-info-collection.ts +0 -39
  20. package/dist/ts/implementation/document/automatic-fields/automatic-field-info.ts +0 -108
  21. package/dist/ts/implementation/document/automatic-fields/automatic-field.ts +0 -127
  22. package/dist/ts/implementation/document/automatic-fields/composite-field.ts +0 -76
  23. package/dist/ts/implementation/document/automatic-fields/multiple-value-field.ts +0 -37
  24. package/dist/ts/implementation/document/automatic-fields/page-count-field.ts +0 -75
  25. package/dist/ts/implementation/document/automatic-fields/pdf-numbers-convertor.ts +0 -157
  26. package/dist/ts/implementation/document/automatic-fields/pdf-page-number-field.ts +0 -82
  27. package/dist/ts/implementation/document/automatic-fields/pdf-template-value-pair.ts +0 -60
  28. package/dist/ts/implementation/document/automatic-fields/single-value-field.ts +0 -48
  29. package/dist/ts/implementation/document/pdf-catalog.ts +0 -52
  30. package/dist/ts/implementation/document/pdf-document-base.ts +0 -166
  31. package/dist/ts/implementation/document/pdf-document-template.ts +0 -310
  32. package/dist/ts/implementation/document/pdf-document.ts +0 -342
  33. package/dist/ts/implementation/drawing/pdf-drawing.ts +0 -218
  34. package/dist/ts/implementation/general/enum.ts +0 -21
  35. package/dist/ts/implementation/general/functions/pdf-function.ts +0 -66
  36. package/dist/ts/implementation/general/functions/pdf-sampled-function.ts +0 -62
  37. package/dist/ts/implementation/general/pdf-cache-collection.ts +0 -97
  38. package/dist/ts/implementation/general/pdf-collection.ts +0 -41
  39. package/dist/ts/implementation/general/pdf-destination.ts +0 -170
  40. package/dist/ts/implementation/graphics/brushes/enum.ts +0 -237
  41. package/dist/ts/implementation/graphics/brushes/pdf-blend.ts +0 -294
  42. package/dist/ts/implementation/graphics/brushes/pdf-brush.ts +0 -68
  43. package/dist/ts/implementation/graphics/brushes/pdf-brushes.ts +0 -2438
  44. package/dist/ts/implementation/graphics/brushes/pdf-color-blend.ts +0 -295
  45. package/dist/ts/implementation/graphics/brushes/pdf-gradient-brush.ts +0 -311
  46. package/dist/ts/implementation/graphics/brushes/pdf-linear-gradient-brush.ts +0 -406
  47. package/dist/ts/implementation/graphics/brushes/pdf-radial-gradient-brush.ts +0 -290
  48. package/dist/ts/implementation/graphics/brushes/pdf-solid-brush.ts +0 -107
  49. package/dist/ts/implementation/graphics/brushes/pdf-tiling-brush.ts +0 -304
  50. package/dist/ts/implementation/graphics/constants.ts +0 -31
  51. package/dist/ts/implementation/graphics/enum.ts +0 -413
  52. package/dist/ts/implementation/graphics/figures/arc.ts +0 -133
  53. package/dist/ts/implementation/graphics/figures/base/draw-element.ts +0 -59
  54. package/dist/ts/implementation/graphics/figures/base/element-layouter.ts +0 -260
  55. package/dist/ts/implementation/graphics/figures/base/fill-element.ts +0 -72
  56. package/dist/ts/implementation/graphics/figures/base/graphics-element.ts +0 -34
  57. package/dist/ts/implementation/graphics/figures/base/pdf-shape-element.ts +0 -69
  58. package/dist/ts/implementation/graphics/figures/base/shape-layouter.ts +0 -276
  59. package/dist/ts/implementation/graphics/figures/base/text-layouter.ts +0 -205
  60. package/dist/ts/implementation/graphics/figures/ellipse-part.ts +0 -76
  61. package/dist/ts/implementation/graphics/figures/enum.ts +0 -80
  62. package/dist/ts/implementation/graphics/figures/layout-element.ts +0 -132
  63. package/dist/ts/implementation/graphics/figures/path.ts +0 -646
  64. package/dist/ts/implementation/graphics/figures/pdf-template.ts +0 -205
  65. package/dist/ts/implementation/graphics/figures/rectangle-area.ts +0 -108
  66. package/dist/ts/implementation/graphics/figures/text-element.ts +0 -445
  67. package/dist/ts/implementation/graphics/fonts/enum.ts +0 -385
  68. package/dist/ts/implementation/graphics/fonts/pdf-font-metrics.ts +0 -248
  69. package/dist/ts/implementation/graphics/fonts/pdf-font.ts +0 -316
  70. package/dist/ts/implementation/graphics/fonts/pdf-standard-font-metrics-factory.ts +0 -606
  71. package/dist/ts/implementation/graphics/fonts/pdf-standard-font.ts +0 -243
  72. package/dist/ts/implementation/graphics/fonts/pdf-string-format.ts +0 -474
  73. package/dist/ts/implementation/graphics/fonts/pdf-true-type-font.ts +0 -165
  74. package/dist/ts/implementation/graphics/fonts/rtl/rtl-bidirectional.ts +0 -958
  75. package/dist/ts/implementation/graphics/fonts/rtl/rtl-text-shape.ts +0 -374
  76. package/dist/ts/implementation/graphics/fonts/rtl-renderer.ts +0 -255
  77. package/dist/ts/implementation/graphics/fonts/string-layouter.ts +0 -617
  78. package/dist/ts/implementation/graphics/fonts/string-tokenizer.ts +0 -275
  79. package/dist/ts/implementation/graphics/fonts/ttf-OS2-Table.ts +0 -206
  80. package/dist/ts/implementation/graphics/fonts/ttf-apple-cmap-sub-table.ts +0 -18
  81. package/dist/ts/implementation/graphics/fonts/ttf-cmap-sub-table.ts +0 -18
  82. package/dist/ts/implementation/graphics/fonts/ttf-cmap-table.ts +0 -14
  83. package/dist/ts/implementation/graphics/fonts/ttf-glyph-header.ts +0 -26
  84. package/dist/ts/implementation/graphics/fonts/ttf-glyph-info.ts +0 -35
  85. package/dist/ts/implementation/graphics/fonts/ttf-head-table.ts +0 -94
  86. package/dist/ts/implementation/graphics/fonts/ttf-horizontal-header-table.ts +0 -56
  87. package/dist/ts/implementation/graphics/fonts/ttf-loca-table.ts +0 -10
  88. package/dist/ts/implementation/graphics/fonts/ttf-long-hor-metric.ts +0 -14
  89. package/dist/ts/implementation/graphics/fonts/ttf-metrics.ts +0 -106
  90. package/dist/ts/implementation/graphics/fonts/ttf-microsoft-cmap-sub-table.ts +0 -58
  91. package/dist/ts/implementation/graphics/fonts/ttf-name-record.ts +0 -33
  92. package/dist/ts/implementation/graphics/fonts/ttf-name-table.ts +0 -22
  93. package/dist/ts/implementation/graphics/fonts/ttf-post-table.ts +0 -42
  94. package/dist/ts/implementation/graphics/fonts/ttf-reader.ts +0 -1254
  95. package/dist/ts/implementation/graphics/fonts/ttf-table-info.ts +0 -26
  96. package/dist/ts/implementation/graphics/fonts/ttf-trimmed-cmap-sub-table.ts +0 -26
  97. package/dist/ts/implementation/graphics/fonts/unicode-true-type-font.ts +0 -577
  98. package/dist/ts/implementation/graphics/images/byte-array.ts +0 -137
  99. package/dist/ts/implementation/graphics/images/image-decoder.ts +0 -437
  100. package/dist/ts/implementation/graphics/images/pdf-bitmap.ts +0 -110
  101. package/dist/ts/implementation/graphics/images/pdf-image.ts +0 -132
  102. package/dist/ts/implementation/graphics/pdf-color.ts +0 -478
  103. package/dist/ts/implementation/graphics/pdf-graphics.ts +0 -2424
  104. package/dist/ts/implementation/graphics/pdf-margins.ts +0 -124
  105. package/dist/ts/implementation/graphics/pdf-pen.ts +0 -370
  106. package/dist/ts/implementation/graphics/pdf-resources.ts +0 -300
  107. package/dist/ts/implementation/graphics/pdf-transformation-matrix.ts +0 -246
  108. package/dist/ts/implementation/graphics/pdf-transparency.ts +0 -93
  109. package/dist/ts/implementation/graphics/unit-convertor.ts +0 -96
  110. package/dist/ts/implementation/input-output/big-endian-writer.ts +0 -121
  111. package/dist/ts/implementation/input-output/cross-table.ts +0 -21
  112. package/dist/ts/implementation/input-output/enum.ts +0 -16
  113. package/dist/ts/implementation/input-output/pdf-cross-table.ts +0 -524
  114. package/dist/ts/implementation/input-output/pdf-dictionary-properties.ts +0 -515
  115. package/dist/ts/implementation/input-output/pdf-main-object-collection.ts +0 -194
  116. package/dist/ts/implementation/input-output/pdf-operators.ts +0 -363
  117. package/dist/ts/implementation/input-output/pdf-stream-writer.ts +0 -681
  118. package/dist/ts/implementation/input-output/pdf-writer.ts +0 -88
  119. package/dist/ts/implementation/pages/enum.ts +0 -201
  120. package/dist/ts/implementation/pages/page-added-event-arguments.ts +0 -39
  121. package/dist/ts/implementation/pages/pdf-document-page-collection.ts +0 -180
  122. package/dist/ts/implementation/pages/pdf-page-base.ts +0 -181
  123. package/dist/ts/implementation/pages/pdf-page-layer-collection.ts +0 -348
  124. package/dist/ts/implementation/pages/pdf-page-layer.ts +0 -271
  125. package/dist/ts/implementation/pages/pdf-page-settings.ts +0 -192
  126. package/dist/ts/implementation/pages/pdf-page-size.ts +0 -162
  127. package/dist/ts/implementation/pages/pdf-page-template-element.ts +0 -659
  128. package/dist/ts/implementation/pages/pdf-page.ts +0 -235
  129. package/dist/ts/implementation/pages/pdf-section-collection.ts +0 -187
  130. package/dist/ts/implementation/pages/pdf-section-page-collection.ts +0 -61
  131. package/dist/ts/implementation/pages/pdf-section-templates.ts +0 -96
  132. package/dist/ts/implementation/pages/pdf-section.ts +0 -644
  133. package/dist/ts/implementation/primitives/pdf-array.ts +0 -386
  134. package/dist/ts/implementation/primitives/pdf-boolean.ts +0 -119
  135. package/dist/ts/implementation/primitives/pdf-dictionary.ts +0 -513
  136. package/dist/ts/implementation/primitives/pdf-name.ts +0 -218
  137. package/dist/ts/implementation/primitives/pdf-number.ts +0 -165
  138. package/dist/ts/implementation/primitives/pdf-reference.ts +0 -430
  139. package/dist/ts/implementation/primitives/pdf-stream.ts +0 -336
  140. package/dist/ts/implementation/primitives/pdf-string.ts +0 -397
  141. package/dist/ts/implementation/structured-elements/grid/layout/grid-layouter.ts +0 -2027
  142. package/dist/ts/implementation/structured-elements/grid/pdf-grid-cell.ts +0 -1189
  143. package/dist/ts/implementation/structured-elements/grid/pdf-grid-column.ts +0 -206
  144. package/dist/ts/implementation/structured-elements/grid/pdf-grid-row.ts +0 -470
  145. package/dist/ts/implementation/structured-elements/grid/pdf-grid.ts +0 -853
  146. package/dist/ts/implementation/structured-elements/grid/styles/pdf-borders.ts +0 -240
  147. package/dist/ts/implementation/structured-elements/grid/styles/style.ts +0 -424
  148. package/dist/ts/implementation/structured-elements/tables/light-tables/enum.ts +0 -16
  149. package/dist/ts/interfaces/i-pdf-cache.ts +0 -23
  150. package/dist/ts/interfaces/i-pdf-changable.ts +0 -17
  151. package/dist/ts/interfaces/i-pdf-clonable.ts +0 -12
  152. package/dist/ts/interfaces/i-pdf-primitives.ts +0 -45
  153. package/dist/ts/interfaces/i-pdf-true-type-font.ts +0 -48
  154. package/dist/ts/interfaces/i-pdf-wrapper.ts +0 -13
  155. package/dist/ts/interfaces/i-pdf-writer.ts +0 -29
@@ -1,386 +0,0 @@
1
- /**
2
- * PdfArray.ts class for EJ2-PDF
3
- */
4
- import { IPdfPrimitive } from './../../interfaces/i-pdf-primitives';
5
- import { IPdfWriter } from './../../interfaces/i-pdf-writer';
6
- import { ObjectStatus } from './../input-output/enum';
7
- import { PdfCrossTable } from './../input-output/pdf-cross-table';
8
- import { PdfNumber } from './pdf-number';
9
- import { RectangleF } from './../drawing/pdf-drawing';
10
- import { Operators } from './../input-output/pdf-operators';
11
- import { PdfName } from './pdf-name';
12
- /**
13
- * `PdfArray` class is used to perform array related primitive operations.
14
- * @private
15
- */
16
- export class PdfArray implements IPdfPrimitive {
17
- //Fields
18
- /**
19
- * `startMark` - '['
20
- * @private
21
- */
22
- public startMark : string = '[';
23
- /**
24
- * `endMark` - ']'.
25
- * @private
26
- */
27
- public endMark : string = ']';
28
- /**
29
- * The `elements` of the PDF array.
30
- * @private
31
- */
32
- private internalElements : IPdfPrimitive[];
33
- /**
34
- * Indicates if the array `was changed`.
35
- * @private
36
- */
37
- private bChanged : boolean;
38
- /**
39
- * Shows the type of object `status` whether it is object registered or other status;
40
- * @private
41
- */
42
- private status9 : ObjectStatus;
43
- /**
44
- * Indicates if the object is currently in `saving state` or not.
45
- * @private
46
- */
47
- private isSaving9 : boolean;
48
- /**
49
- * Holds the `index` number of the object.
50
- * @private
51
- */
52
- private index9 : number;
53
- /**
54
- * Internal variable to store the `position`.
55
- * @default -1
56
- * @private
57
- */
58
- private position9 : number = -1;
59
- /**
60
- * Internal variable to hold `PdfCrossTable` reference.
61
- * @private
62
- */
63
- private pdfCrossTable : PdfCrossTable;
64
- /**
65
- * Internal variable to hold `cloned object`.
66
- * @default null
67
- * @private
68
- */
69
- private clonedObject9 : PdfArray = null;
70
- /**
71
- * Represents the Font dictionary.
72
- * @hidden
73
- * @private
74
- */
75
- public isFont : boolean = false;
76
- //property
77
- /**
78
- * Gets the `IPdfSavable` at the specified index.
79
- * @private
80
- */
81
- public items(index : number) : IPdfPrimitive {
82
- // if (index < 0 || index >= this.Count) {
83
- // throw new Error('ArgumentOutOfRangeException : index, The index can"t be less then zero or greater then Count.');
84
- // }
85
- return this.internalElements[index] as IPdfPrimitive;
86
- }
87
- /**
88
- * Gets the `count`.
89
- * @private
90
- */
91
- public get count() : number {
92
- return this.internalElements.length;
93
- }
94
- /**
95
- * Gets or sets the `Status` of the specified object.
96
- * @private
97
- */
98
- public get status() : ObjectStatus {
99
- return this.status9;
100
- }
101
- public set status(value : ObjectStatus) {
102
- this.status9 = value;
103
- }
104
- /**
105
- * Gets or sets a value indicating whether this document `is saving` or not.
106
- * @private
107
- */
108
- public get isSaving() : boolean {
109
- return this.isSaving9;
110
- }
111
- public set isSaving(value : boolean) {
112
- this.isSaving9 = value;
113
- }
114
- /**
115
- * Returns `cloned object`.
116
- * @private
117
- */
118
- public get clonedObject() : IPdfPrimitive {
119
- return this.clonedObject9;
120
- }
121
- /**
122
- * Gets or sets the `position` of the object.
123
- * @private
124
- */
125
- public get position() : number {
126
- return this.position9;
127
- }
128
- public set position(value : number) {
129
- this.position9 = value;
130
- }
131
- /**
132
- * Gets or sets the `index` value of the specified object.
133
- * @private
134
- */
135
- public get objectCollectionIndex() : number {
136
- return this.index9;
137
- }
138
- public set objectCollectionIndex(value : number) {
139
- this.index9 = value;
140
- }
141
- /**
142
- * Returns `PdfCrossTable` associated with the object.
143
- * @private
144
- */
145
- public get CrossTable() : PdfCrossTable {
146
- return this.pdfCrossTable;
147
- }
148
- /**
149
- * Gets the `elements` of the Pdf Array.
150
- * @private
151
- */
152
- public get elements() : IPdfPrimitive[] {
153
- return this.internalElements;
154
- }
155
- //constructor
156
- /**
157
- * Initializes a new instance of the `PdfArray` class.
158
- * @private
159
- */
160
- constructor()
161
- /**
162
- * Initializes a new instance of the `PdfArray` class.
163
- * @private
164
- */
165
- constructor(array : PdfArray|number[])
166
- constructor(array? : PdfArray|number[]) {
167
- if (typeof array === 'undefined') {
168
- this.internalElements = [];
169
- } else {
170
- if (typeof array !== 'undefined' && !(array instanceof PdfArray)) {
171
- let tempNumberArray : number[] = array;
172
- for (let index : number = 0; index < tempNumberArray.length; index++) {
173
- let pdfNumber : PdfNumber = new PdfNumber(tempNumberArray[index]);
174
- this.add(pdfNumber);
175
- }
176
- // } else if (typeof array !== 'undefined' && (array instanceof PdfArray)) {
177
- } else {
178
- let tempArray : PdfArray = array as PdfArray;
179
- // if (tempArray.Elements.length > 0) {
180
- this.internalElements = [];
181
- for (let index : number = 0; index < tempArray.elements.length; index++) {
182
- this.internalElements.push(tempArray.elements[index]);
183
- }
184
- // }
185
- }
186
- }
187
- }
188
- /**
189
- * `Adds` the specified element to the PDF array.
190
- * @private
191
- */
192
- public add(element : IPdfPrimitive) : void {
193
- // if (element === null) {
194
- // throw new Error('ArgumentNullException : obj');
195
- // }
196
- if (typeof this.internalElements === 'undefined') {
197
- this.internalElements = [];
198
- }
199
- this.internalElements.push(element);
200
- this.markedChange();
201
- }
202
- /**
203
- * `Marks` the object changed.
204
- * @private
205
- */
206
- private markedChange() : void {
207
- this.bChanged = true;
208
- }
209
- /**
210
- * `Determines` whether the specified element is within the array.
211
- * @private
212
- */
213
- public contains(element : IPdfPrimitive) : boolean {
214
- let returnValue : boolean = false;
215
- for (let index : number = 0; index < this.internalElements.length; index++) {
216
- let tempElement : PdfName = this.internalElements[index] as PdfName;
217
- let inputElement : PdfName = element as PdfName;
218
- if (tempElement != null && typeof tempElement !== 'undefined' && inputElement != null && typeof inputElement !== 'undefined') {
219
- if (tempElement.value === inputElement.value) {
220
- return true;
221
- }
222
- }
223
- // if (this.internalElements[index] === element) {
224
- // returnValue = true;
225
- // }
226
- }
227
- return returnValue;
228
- }
229
- /**
230
- * Returns the `primitive object` of input index.
231
- * @private
232
- */
233
- public getItems(index : number) : IPdfPrimitive {
234
- // if (index < 0 || index >= this.Count) {
235
- // throw new Error('ArgumentOutOfRangeException : index , The index can"t be less then zero or greater then Count.');
236
- // }
237
- return this.internalElements[index] as IPdfPrimitive;
238
- }
239
- /**
240
- * `Saves` the object using the specified writer.
241
- * @private
242
- */
243
- public save(writer : IPdfWriter) : void {
244
- // if (writer === null) {
245
- // throw new Error('ArgumentNullException : writer');
246
- // }
247
- writer.write(this.startMark);
248
- for (let i : number = 0, len : number = this.count; i < len; i++) {
249
- this.getItems(i).save(writer);
250
- if (i + 1 !== len) {
251
- writer.write(Operators.whiteSpace);
252
- }
253
- }
254
- writer.write(this.endMark);
255
- }
256
- /**
257
- * Creates a `copy of PdfArray`.
258
- * @private
259
- */
260
- public clone(crossTable : PdfCrossTable) : IPdfPrimitive {
261
- // if (this.clonedObject9 !== null && this.clonedObject9.CrossTable === crossTable) {
262
- // return this.clonedObject9;
263
- // } else {
264
- this.clonedObject9 = null;
265
- // Else clone the object.
266
- let newArray : PdfArray = new PdfArray();
267
- for (let index : number = 0; index < this.internalElements.length; index++) {
268
- let obj : IPdfPrimitive = this.internalElements[index];
269
- newArray.add(obj.clone(crossTable));
270
- }
271
- newArray.pdfCrossTable = crossTable;
272
- this.clonedObject9 = newArray;
273
- return newArray;
274
- }
275
- /**
276
- * Creates filled PDF array `from the rectangle`.
277
- * @private
278
- */
279
- public static fromRectangle(bounds : RectangleF) : PdfArray {
280
- let values : number[] = [bounds.x, bounds.y, bounds.width, bounds.height];
281
- let array : PdfArray = new PdfArray(values);
282
- return array;
283
- }
284
- // /**
285
- // * Creates the rectangle from filled PDF array.
286
- // * @private
287
- // */
288
- // public ToRectangle() : RectangleF {
289
- // if (this.Count < 4) {
290
- // throw Error('InvalidOperationException-Can not convert to rectangle.');
291
- // }
292
- // let x1 : number;
293
- // let x2 : number;
294
- // let y1 : number;
295
- // let y2 : number;
296
- // let num : PdfNumber = this.getItems(0) as PdfNumber;
297
- // x1 = num.IntValue;
298
- // num = this.getItems(1) as PdfNumber;
299
- // y1 = num.IntValue;
300
- // num = this.getItems(2) as PdfNumber;
301
- // x2 = num.IntValue;
302
- // num = this.getItems(3) as PdfNumber;
303
- // y2 = num.IntValue;
304
-
305
- // let x : number = Math.min(x1, x2);
306
- // let y : number = Math.min(y1, y2);
307
- // let width : number = Math.abs(x1 - x2);
308
- // let height : number = Math.abs(y1 - y2);
309
- // let rect : RectangleF = new RectangleF(new PointF(x, y), new SizeF(width, height));
310
- // return rect;
311
- // }
312
- /**
313
- * `Inserts` the element into the array.
314
- * @private
315
- */
316
- public insert(index : number, element : IPdfPrimitive) : void {
317
- if (index < this.internalElements.length && index > 0) {
318
- let tempElements : IPdfPrimitive[] = [];
319
- for (let i : number = 0; i < index ; i++) {
320
- tempElements.push(this.internalElements[i]);
321
- }
322
- tempElements.push(element);
323
- for (let i : number = index; i < this.internalElements.length ; i++) {
324
- tempElements.push(this.internalElements[i]);
325
- }
326
- this.internalElements = tempElements;
327
- } else {
328
- this.internalElements.push(element);
329
- }
330
- this.markChanged();
331
- }
332
- /**
333
- * `Checks whether array contains the element`.
334
- * @private
335
- */
336
- public indexOf(element : IPdfPrimitive) : number {
337
- return this.internalElements.indexOf(element);
338
- }
339
- /**
340
- * `Removes` element from the array.
341
- * @private
342
- */
343
- public remove(element : IPdfPrimitive) : void {
344
- // if (element === null) {
345
- // throw new Error('ArgumentNullException : element');
346
- // }
347
- let index : number = this.internalElements.indexOf(element);
348
- // if (index >= 0 && index < this.internalElements.length) {
349
- this.internalElements[index] = null;
350
- // }
351
- this.markChanged();
352
- }
353
- /**
354
- * `Remove` the element from the array by its index.
355
- * @private
356
- */
357
- public removeAt(index : number) : void {
358
- // this.internalElements.RemoveAt(index);
359
- if (this.internalElements.length > index) {
360
- let tempArray : IPdfPrimitive[] = [];
361
- for (let i : number = 0; i < index; i++) {
362
- tempArray.push(this.internalElements[i]);
363
- }
364
- for (let i : number = index + 1; i < this.internalElements.length; i++) {
365
- tempArray.push(this.internalElements[i]);
366
- }
367
- this.internalElements = tempArray;
368
- }
369
- this.markChanged();
370
- }
371
- /**
372
- * `Clear` the array.
373
- * @private
374
- */
375
- public clear() : void {
376
- this.internalElements = [];
377
- this.markChanged();
378
- }
379
- /**
380
- * `Marks` the object changed.
381
- * @private
382
- */
383
- public markChanged() : void {
384
- this.bChanged = true;
385
- }
386
- }
@@ -1,119 +0,0 @@
1
- /**
2
- * PdfBoolean.ts class for EJ2-PDF
3
- */
4
- import { IPdfPrimitive } from './../../interfaces/i-pdf-primitives';
5
- import { IPdfWriter } from './../../interfaces/i-pdf-writer';
6
- import { ObjectStatus } from './../input-output/enum';
7
- import { PdfCrossTable } from './../input-output/pdf-cross-table';
8
- /**
9
- * `PdfBoolean` class is used to perform boolean related primitive operations.
10
- * @private
11
- */
12
- export class PdfBoolean implements IPdfPrimitive {
13
- /**
14
- * Shows the type of object `status` whether it is object registered or other status;
15
- * @private
16
- */
17
- private objectStatus : ObjectStatus;
18
- /**
19
- * Indicates if the object `is currently in saving state` or not.
20
- * @private
21
- */
22
- private saving : boolean;
23
- /**
24
- * Holds the `index` number of the object.
25
- * @private
26
- */
27
- private index : number;
28
- /**
29
- * The `value` of the PDF boolean.
30
- * @private
31
- */
32
- public value : boolean;
33
- /**
34
- * Internal variable to store the `position`.
35
- * @default -1
36
- * @private
37
- */
38
- private currentPosition : number = -1;
39
- //constructor
40
- /**
41
- * Initializes a new instance of the `PdfBoolean` class.
42
- * @private
43
- */
44
- constructor(value : boolean) {
45
- this.value = value;
46
- }
47
- //Properties
48
- /**
49
- * Gets or sets the `Status` of the specified object.
50
- * @private
51
- */
52
- public get status() : ObjectStatus {
53
- return this.objectStatus;
54
- }
55
- public set status(value : ObjectStatus) {
56
- this.objectStatus = value;
57
- }
58
- /**
59
- * Gets or sets a value indicating whether this document `is saving` or not.
60
- * @private
61
- */
62
- public get isSaving() : boolean {
63
- return this.saving;
64
- }
65
- public set isSaving(value : boolean) {
66
- this.saving = value;
67
- }
68
- /**
69
- * Gets or sets the `index` value of the specified object.
70
- * @private
71
- */
72
- public get objectCollectionIndex() : number {
73
- return this.index;
74
- }
75
- public set objectCollectionIndex(value : number) {
76
- this.index = value;
77
- }
78
- /**
79
- * Gets or sets the `position` of the object.
80
- * @private
81
- */
82
- public get position() : number {
83
- return this.currentPosition;
84
- }
85
- public set position(value : number) {
86
- this.currentPosition = value;
87
- }
88
- /**
89
- * Returns `cloned object`.
90
- * @private
91
- */
92
- public get clonedObject() : IPdfPrimitive {
93
- let rValue : IPdfPrimitive = null;
94
- return rValue;
95
- }
96
- /**
97
- * `Saves` the object using the specified writer.
98
- * @private
99
- */
100
- public save(writer : IPdfWriter) : void {
101
- writer.write(this.boolToStr(this.value));
102
- }
103
- /**
104
- * Creates a `copy of PdfBoolean`.
105
- * @private
106
- */
107
- public clone(crossTable : PdfCrossTable) : IPdfPrimitive {
108
- let newNumber : PdfBoolean = new PdfBoolean(this.value);
109
- return newNumber;
110
- }
111
- // Implementation
112
- /**
113
- * Converts `boolean to string` - 0/1 'true'/'false'.
114
- * @private
115
- */
116
- private boolToStr(value : boolean) : string {
117
- return value ? 'true' : 'false';
118
- }
119
- }