@syncfusion/ej2-pdf-export 24.1.41 → 24.1.47
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-export.min.js +2 -2
- package/dist/ej2-pdf-export.umd.min.js +2 -2
- package/dist/ej2-pdf-export.umd.min.js.map +1 -1
- package/dist/es6/ej2-pdf-export.es2015.js +157 -28
- package/dist/es6/ej2-pdf-export.es2015.js.map +1 -1
- package/dist/es6/ej2-pdf-export.es5.js +157 -28
- package/dist/es6/ej2-pdf-export.es5.js.map +1 -1
- package/dist/global/ej2-pdf-export.min.js +2 -2
- package/dist/global/ej2-pdf-export.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +5 -5
- package/src/implementation/graphics/pdf-graphics.d.ts +35 -0
- package/src/implementation/graphics/pdf-graphics.js +157 -29
- package/dist/ts/implementation/actions/action.ts +0 -76
- package/dist/ts/implementation/actions/uri-action.ts +0 -52
- package/dist/ts/implementation/annotations/action-link-annotation.ts +0 -43
- package/dist/ts/implementation/annotations/annotation-collection.ts +0 -159
- package/dist/ts/implementation/annotations/annotation.ts +0 -241
- package/dist/ts/implementation/annotations/document-link-annotation.ts +0 -118
- package/dist/ts/implementation/annotations/link-annotation.ts +0 -32
- package/dist/ts/implementation/annotations/pdf-text-web-link.ts +0 -265
- package/dist/ts/implementation/annotations/uri-annotation.ts +0 -86
- package/dist/ts/implementation/collections/dictionary.ts +0 -150
- package/dist/ts/implementation/collections/object-object-pair/dictionary.ts +0 -125
- package/dist/ts/implementation/collections/utils.ts +0 -38
- package/dist/ts/implementation/document/automatic-fields/automatic-field-info-collection.ts +0 -39
- package/dist/ts/implementation/document/automatic-fields/automatic-field-info.ts +0 -108
- package/dist/ts/implementation/document/automatic-fields/automatic-field.ts +0 -127
- package/dist/ts/implementation/document/automatic-fields/composite-field.ts +0 -76
- package/dist/ts/implementation/document/automatic-fields/multiple-value-field.ts +0 -37
- package/dist/ts/implementation/document/automatic-fields/page-count-field.ts +0 -75
- package/dist/ts/implementation/document/automatic-fields/pdf-numbers-convertor.ts +0 -157
- package/dist/ts/implementation/document/automatic-fields/pdf-page-number-field.ts +0 -82
- package/dist/ts/implementation/document/automatic-fields/pdf-template-value-pair.ts +0 -60
- package/dist/ts/implementation/document/automatic-fields/single-value-field.ts +0 -48
- package/dist/ts/implementation/document/pdf-catalog.ts +0 -65
- package/dist/ts/implementation/document/pdf-document-base.ts +0 -180
- package/dist/ts/implementation/document/pdf-document-template.ts +0 -310
- package/dist/ts/implementation/document/pdf-document.ts +0 -342
- package/dist/ts/implementation/document/pdf-viewer-preferences.ts +0 -578
- package/dist/ts/implementation/drawing/pdf-drawing.ts +0 -218
- package/dist/ts/implementation/general/enum.ts +0 -21
- package/dist/ts/implementation/general/functions/pdf-function.ts +0 -66
- package/dist/ts/implementation/general/functions/pdf-sampled-function.ts +0 -63
- package/dist/ts/implementation/general/pdf-cache-collection.ts +0 -97
- package/dist/ts/implementation/general/pdf-collection.ts +0 -41
- package/dist/ts/implementation/general/pdf-destination.ts +0 -170
- package/dist/ts/implementation/graphics/brushes/enum.ts +0 -237
- package/dist/ts/implementation/graphics/brushes/pdf-blend.ts +0 -294
- package/dist/ts/implementation/graphics/brushes/pdf-brush.ts +0 -68
- package/dist/ts/implementation/graphics/brushes/pdf-brushes.ts +0 -2438
- package/dist/ts/implementation/graphics/brushes/pdf-color-blend.ts +0 -295
- package/dist/ts/implementation/graphics/brushes/pdf-gradient-brush.ts +0 -311
- package/dist/ts/implementation/graphics/brushes/pdf-linear-gradient-brush.ts +0 -406
- package/dist/ts/implementation/graphics/brushes/pdf-radial-gradient-brush.ts +0 -290
- package/dist/ts/implementation/graphics/brushes/pdf-solid-brush.ts +0 -107
- package/dist/ts/implementation/graphics/brushes/pdf-tiling-brush.ts +0 -304
- package/dist/ts/implementation/graphics/constants.ts +0 -31
- package/dist/ts/implementation/graphics/enum.ts +0 -413
- package/dist/ts/implementation/graphics/figures/arc.ts +0 -133
- package/dist/ts/implementation/graphics/figures/base/draw-element.ts +0 -59
- package/dist/ts/implementation/graphics/figures/base/element-layouter.ts +0 -260
- package/dist/ts/implementation/graphics/figures/base/fill-element.ts +0 -72
- package/dist/ts/implementation/graphics/figures/base/graphics-element.ts +0 -34
- package/dist/ts/implementation/graphics/figures/base/pdf-shape-element.ts +0 -69
- package/dist/ts/implementation/graphics/figures/base/shape-layouter.ts +0 -276
- package/dist/ts/implementation/graphics/figures/base/text-layouter.ts +0 -205
- package/dist/ts/implementation/graphics/figures/ellipse-part.ts +0 -76
- package/dist/ts/implementation/graphics/figures/enum.ts +0 -80
- package/dist/ts/implementation/graphics/figures/layout-element.ts +0 -132
- package/dist/ts/implementation/graphics/figures/path.ts +0 -646
- package/dist/ts/implementation/graphics/figures/pdf-template.ts +0 -205
- package/dist/ts/implementation/graphics/figures/rectangle-area.ts +0 -108
- package/dist/ts/implementation/graphics/figures/text-element.ts +0 -445
- package/dist/ts/implementation/graphics/fonts/enum.ts +0 -385
- package/dist/ts/implementation/graphics/fonts/pdf-font-metrics.ts +0 -248
- package/dist/ts/implementation/graphics/fonts/pdf-font.ts +0 -316
- package/dist/ts/implementation/graphics/fonts/pdf-standard-font-metrics-factory.ts +0 -606
- package/dist/ts/implementation/graphics/fonts/pdf-standard-font.ts +0 -243
- package/dist/ts/implementation/graphics/fonts/pdf-string-format.ts +0 -474
- package/dist/ts/implementation/graphics/fonts/pdf-true-type-font.ts +0 -165
- package/dist/ts/implementation/graphics/fonts/rtl/rtl-bidirectional.ts +0 -958
- package/dist/ts/implementation/graphics/fonts/rtl/rtl-text-shape.ts +0 -374
- package/dist/ts/implementation/graphics/fonts/rtl-renderer.ts +0 -255
- package/dist/ts/implementation/graphics/fonts/string-layouter.ts +0 -617
- package/dist/ts/implementation/graphics/fonts/string-tokenizer.ts +0 -275
- package/dist/ts/implementation/graphics/fonts/ttf-OS2-Table.ts +0 -206
- package/dist/ts/implementation/graphics/fonts/ttf-apple-cmap-sub-table.ts +0 -18
- package/dist/ts/implementation/graphics/fonts/ttf-cmap-sub-table.ts +0 -18
- package/dist/ts/implementation/graphics/fonts/ttf-cmap-table.ts +0 -14
- package/dist/ts/implementation/graphics/fonts/ttf-glyph-header.ts +0 -26
- package/dist/ts/implementation/graphics/fonts/ttf-glyph-info.ts +0 -35
- package/dist/ts/implementation/graphics/fonts/ttf-head-table.ts +0 -94
- package/dist/ts/implementation/graphics/fonts/ttf-horizontal-header-table.ts +0 -56
- package/dist/ts/implementation/graphics/fonts/ttf-loca-table.ts +0 -10
- package/dist/ts/implementation/graphics/fonts/ttf-long-hor-metric.ts +0 -14
- package/dist/ts/implementation/graphics/fonts/ttf-metrics.ts +0 -106
- package/dist/ts/implementation/graphics/fonts/ttf-microsoft-cmap-sub-table.ts +0 -58
- package/dist/ts/implementation/graphics/fonts/ttf-name-record.ts +0 -33
- package/dist/ts/implementation/graphics/fonts/ttf-name-table.ts +0 -22
- package/dist/ts/implementation/graphics/fonts/ttf-post-table.ts +0 -42
- package/dist/ts/implementation/graphics/fonts/ttf-reader.ts +0 -1254
- package/dist/ts/implementation/graphics/fonts/ttf-table-info.ts +0 -26
- package/dist/ts/implementation/graphics/fonts/ttf-trimmed-cmap-sub-table.ts +0 -26
- package/dist/ts/implementation/graphics/fonts/unicode-true-type-font.ts +0 -577
- package/dist/ts/implementation/graphics/images/byte-array.ts +0 -137
- package/dist/ts/implementation/graphics/images/image-decoder.ts +0 -439
- package/dist/ts/implementation/graphics/images/pdf-bitmap.ts +0 -110
- package/dist/ts/implementation/graphics/images/pdf-image.ts +0 -132
- package/dist/ts/implementation/graphics/pdf-color.ts +0 -478
- package/dist/ts/implementation/graphics/pdf-graphics.ts +0 -2429
- package/dist/ts/implementation/graphics/pdf-margins.ts +0 -124
- package/dist/ts/implementation/graphics/pdf-pen.ts +0 -370
- package/dist/ts/implementation/graphics/pdf-resources.ts +0 -300
- package/dist/ts/implementation/graphics/pdf-transformation-matrix.ts +0 -246
- package/dist/ts/implementation/graphics/pdf-transparency.ts +0 -93
- package/dist/ts/implementation/graphics/unit-convertor.ts +0 -96
- package/dist/ts/implementation/input-output/big-endian-writer.ts +0 -121
- package/dist/ts/implementation/input-output/cross-table.ts +0 -21
- package/dist/ts/implementation/input-output/enum.ts +0 -16
- package/dist/ts/implementation/input-output/pdf-cross-table.ts +0 -524
- package/dist/ts/implementation/input-output/pdf-dictionary-properties.ts +0 -571
- package/dist/ts/implementation/input-output/pdf-main-object-collection.ts +0 -194
- package/dist/ts/implementation/input-output/pdf-operators.ts +0 -363
- package/dist/ts/implementation/input-output/pdf-stream-writer.ts +0 -681
- package/dist/ts/implementation/input-output/pdf-writer.ts +0 -88
- package/dist/ts/implementation/pages/enum.ts +0 -201
- package/dist/ts/implementation/pages/page-added-event-arguments.ts +0 -39
- package/dist/ts/implementation/pages/pdf-document-page-collection.ts +0 -180
- package/dist/ts/implementation/pages/pdf-page-base.ts +0 -181
- package/dist/ts/implementation/pages/pdf-page-layer-collection.ts +0 -348
- package/dist/ts/implementation/pages/pdf-page-layer.ts +0 -271
- package/dist/ts/implementation/pages/pdf-page-settings.ts +0 -192
- package/dist/ts/implementation/pages/pdf-page-size.ts +0 -162
- package/dist/ts/implementation/pages/pdf-page-template-element.ts +0 -663
- package/dist/ts/implementation/pages/pdf-page.ts +0 -235
- package/dist/ts/implementation/pages/pdf-section-collection.ts +0 -187
- package/dist/ts/implementation/pages/pdf-section-page-collection.ts +0 -61
- package/dist/ts/implementation/pages/pdf-section-templates.ts +0 -96
- package/dist/ts/implementation/pages/pdf-section.ts +0 -644
- package/dist/ts/implementation/primitives/pdf-array.ts +0 -386
- package/dist/ts/implementation/primitives/pdf-boolean.ts +0 -119
- package/dist/ts/implementation/primitives/pdf-dictionary.ts +0 -513
- package/dist/ts/implementation/primitives/pdf-name.ts +0 -218
- package/dist/ts/implementation/primitives/pdf-number.ts +0 -165
- package/dist/ts/implementation/primitives/pdf-reference.ts +0 -430
- package/dist/ts/implementation/primitives/pdf-stream.ts +0 -306
- package/dist/ts/implementation/primitives/pdf-string.ts +0 -397
- package/dist/ts/implementation/structured-elements/grid/layout/grid-layouter.ts +0 -2027
- package/dist/ts/implementation/structured-elements/grid/pdf-grid-cell.ts +0 -1193
- package/dist/ts/implementation/structured-elements/grid/pdf-grid-column.ts +0 -206
- package/dist/ts/implementation/structured-elements/grid/pdf-grid-row.ts +0 -470
- package/dist/ts/implementation/structured-elements/grid/pdf-grid.ts +0 -853
- package/dist/ts/implementation/structured-elements/grid/styles/pdf-borders.ts +0 -240
- package/dist/ts/implementation/structured-elements/grid/styles/style.ts +0 -424
- package/dist/ts/implementation/structured-elements/tables/light-tables/enum.ts +0 -16
- package/dist/ts/interfaces/i-pdf-cache.ts +0 -23
- package/dist/ts/interfaces/i-pdf-changable.ts +0 -17
- package/dist/ts/interfaces/i-pdf-clonable.ts +0 -12
- package/dist/ts/interfaces/i-pdf-primitives.ts +0 -45
- package/dist/ts/interfaces/i-pdf-true-type-font.ts +0 -48
- package/dist/ts/interfaces/i-pdf-wrapper.ts +0 -13
- package/dist/ts/interfaces/i-pdf-writer.ts +0 -29
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Coordinates of Position for `PointF`.
|
|
3
|
-
* @private
|
|
4
|
-
*/
|
|
5
|
-
export class PointF {
|
|
6
|
-
/**
|
|
7
|
-
* Value of `X`.
|
|
8
|
-
* @private
|
|
9
|
-
*/
|
|
10
|
-
public x : number;
|
|
11
|
-
/**
|
|
12
|
-
* Value of `Y`.
|
|
13
|
-
* @private
|
|
14
|
-
*/
|
|
15
|
-
public y : number;
|
|
16
|
-
//public static readonly empty : PointF = new PointF(0, 0);
|
|
17
|
-
/**
|
|
18
|
-
* Instance of `PointF` class.
|
|
19
|
-
* @private
|
|
20
|
-
*/
|
|
21
|
-
constructor()
|
|
22
|
-
/**
|
|
23
|
-
* Instance of `PointF` class with X, Y co-ordinates.
|
|
24
|
-
* @private
|
|
25
|
-
*/
|
|
26
|
-
constructor(x : number, y : number)
|
|
27
|
-
constructor(x? : number, y? : number) {
|
|
28
|
-
if (typeof x === 'undefined') {
|
|
29
|
-
this.x = 0;
|
|
30
|
-
this.y = 0;
|
|
31
|
-
} else {
|
|
32
|
-
if (x !== null) {
|
|
33
|
-
this.x = x;
|
|
34
|
-
} else {
|
|
35
|
-
this.x = 0;
|
|
36
|
-
}
|
|
37
|
-
if (y !== null) {
|
|
38
|
-
this.y = y;
|
|
39
|
-
} else {
|
|
40
|
-
this.y = 0;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Width and Height as `Size`.
|
|
47
|
-
* @private
|
|
48
|
-
*/
|
|
49
|
-
export class SizeF {
|
|
50
|
-
/**
|
|
51
|
-
* Value of ``Height``.
|
|
52
|
-
* @private
|
|
53
|
-
*/
|
|
54
|
-
public height : number;
|
|
55
|
-
/**
|
|
56
|
-
* Value of `Width`.
|
|
57
|
-
* @private
|
|
58
|
-
*/
|
|
59
|
-
public width : number;
|
|
60
|
-
//public static readonly empty : SizeF = new SizeF(0, 0);
|
|
61
|
-
/**
|
|
62
|
-
* Instance of `SizeF` class.
|
|
63
|
-
* @private
|
|
64
|
-
*/
|
|
65
|
-
constructor()
|
|
66
|
-
/**
|
|
67
|
-
* Instance of `SizeF` class with Width and Height.
|
|
68
|
-
* @private
|
|
69
|
-
*/
|
|
70
|
-
constructor(width : number, height : number)
|
|
71
|
-
constructor(width? : number, height? : number) {
|
|
72
|
-
if (typeof height === 'undefined') {
|
|
73
|
-
this.height = 0;
|
|
74
|
-
this.width = 0;
|
|
75
|
-
} else {
|
|
76
|
-
if (height !== null) {
|
|
77
|
-
this.height = height;
|
|
78
|
-
} else {
|
|
79
|
-
this.height = 0;
|
|
80
|
-
}
|
|
81
|
-
if (width !== null) {
|
|
82
|
-
this.width = width;
|
|
83
|
-
} else {
|
|
84
|
-
this.width = 0;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* `RectangleF` with Position and size.
|
|
91
|
-
* @private
|
|
92
|
-
*/
|
|
93
|
-
export class RectangleF {
|
|
94
|
-
/**
|
|
95
|
-
* Value of `X`.
|
|
96
|
-
* @private
|
|
97
|
-
*/
|
|
98
|
-
public x : number;
|
|
99
|
-
/**
|
|
100
|
-
* Value of `Y`.
|
|
101
|
-
* @private
|
|
102
|
-
*/
|
|
103
|
-
public y : number;
|
|
104
|
-
/**
|
|
105
|
-
* Value of `Height`.
|
|
106
|
-
* @private
|
|
107
|
-
*/
|
|
108
|
-
public height : number;
|
|
109
|
-
/**
|
|
110
|
-
* Value of `Width`.
|
|
111
|
-
* @private
|
|
112
|
-
*/
|
|
113
|
-
public width : number;
|
|
114
|
-
/**
|
|
115
|
-
* Instance of `RectangleF` class.
|
|
116
|
-
* @private
|
|
117
|
-
*/
|
|
118
|
-
public constructor()
|
|
119
|
-
/**
|
|
120
|
-
* Instance of `RectangleF` class with X, Y, Width and Height.
|
|
121
|
-
* @private
|
|
122
|
-
*/
|
|
123
|
-
public constructor(x : number, y : number, height : number, width : number)
|
|
124
|
-
/**
|
|
125
|
-
* Instance of `RectangleF` class with PointF, SizeF.
|
|
126
|
-
* @private
|
|
127
|
-
*/
|
|
128
|
-
public constructor(pointF : PointF, sizeF : SizeF)
|
|
129
|
-
public constructor(arg1? : PointF | number, arg2? : SizeF | number, arg3 ?: number, arg4 ?: number ) {
|
|
130
|
-
if (typeof arg1 === typeof arg1 && typeof arg1 === 'undefined') {
|
|
131
|
-
this.x = 0;
|
|
132
|
-
this.y = 0;
|
|
133
|
-
this.height = 0;
|
|
134
|
-
this.width = 0;
|
|
135
|
-
} else {
|
|
136
|
-
if (arg1 instanceof PointF && arg2 instanceof SizeF && typeof arg3 === 'undefined') {
|
|
137
|
-
let pointf : PointF = arg1 as PointF;
|
|
138
|
-
this.x = pointf.x;
|
|
139
|
-
this.y = pointf.y;
|
|
140
|
-
let sizef : SizeF = arg2 as SizeF;
|
|
141
|
-
this.height = sizef.height;
|
|
142
|
-
this.width = sizef.width;
|
|
143
|
-
} else {
|
|
144
|
-
let x : number = arg1 as number;
|
|
145
|
-
let y : number = arg2 as number;
|
|
146
|
-
let width : number = arg3 as number;
|
|
147
|
-
let height : number = arg4 as number;
|
|
148
|
-
this.x = x;
|
|
149
|
-
this.y = y;
|
|
150
|
-
this.height = height;
|
|
151
|
-
this.width = width;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* `Rectangle` with left, right, top and bottom.
|
|
158
|
-
* @private
|
|
159
|
-
*/
|
|
160
|
-
export class Rectangle {
|
|
161
|
-
/**
|
|
162
|
-
* Value of `left`.
|
|
163
|
-
* @private
|
|
164
|
-
*/
|
|
165
|
-
public left : number;
|
|
166
|
-
/**
|
|
167
|
-
* Value of `top`.
|
|
168
|
-
* @private
|
|
169
|
-
*/
|
|
170
|
-
public top : number;
|
|
171
|
-
/**
|
|
172
|
-
* Value of `right`.
|
|
173
|
-
* @private
|
|
174
|
-
*/
|
|
175
|
-
public right : number;
|
|
176
|
-
/**
|
|
177
|
-
* Value of `bottom`.
|
|
178
|
-
* @private
|
|
179
|
-
*/
|
|
180
|
-
public bottom : number;
|
|
181
|
-
/**
|
|
182
|
-
* Instance of `RectangleF` class with X, Y, Width and Height.
|
|
183
|
-
* @private
|
|
184
|
-
*/
|
|
185
|
-
public constructor(left : number, top : number, right : number, bottom : number) {
|
|
186
|
-
this.left = left;
|
|
187
|
-
this.top = top;
|
|
188
|
-
this.right = right;
|
|
189
|
-
this.bottom = bottom;
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Gets a value of width
|
|
193
|
-
*/
|
|
194
|
-
public get width() : number {
|
|
195
|
-
return this.right - this.left;
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Gets a value of height
|
|
199
|
-
*/
|
|
200
|
-
public get height() : number {
|
|
201
|
-
return this.bottom - this.top;
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Gets a value of Top and Left
|
|
205
|
-
*/
|
|
206
|
-
public get topLeft() : PointF {
|
|
207
|
-
return new PointF(this.left, this.top);
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Gets a value of size
|
|
211
|
-
*/
|
|
212
|
-
public get size() : SizeF {
|
|
213
|
-
return new SizeF(this.width, this.height);
|
|
214
|
-
}
|
|
215
|
-
public toString() : string {
|
|
216
|
-
return this.topLeft + 'x' + this.size;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* public Enum for `PdfDestinationMode`.
|
|
3
|
-
* @private
|
|
4
|
-
*/
|
|
5
|
-
export enum PdfDestinationMode {
|
|
6
|
-
/**
|
|
7
|
-
* Specifies the type of `Location`.
|
|
8
|
-
* @private
|
|
9
|
-
*/
|
|
10
|
-
Location,
|
|
11
|
-
/**
|
|
12
|
-
* Specifies the type of `FitToPage`.
|
|
13
|
-
* @private
|
|
14
|
-
*/
|
|
15
|
-
FitToPage,
|
|
16
|
-
/**
|
|
17
|
-
* Specifies the type of `FitR`.
|
|
18
|
-
* @private
|
|
19
|
-
*/
|
|
20
|
-
FitR
|
|
21
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PdfFunction.ts class for EJ2-PDF
|
|
3
|
-
* Implements the base class for all functions.
|
|
4
|
-
*/
|
|
5
|
-
import { PdfDictionary } from '../../primitives/pdf-dictionary';
|
|
6
|
-
import { IPdfWrapper} from '../../../interfaces/i-pdf-wrapper';
|
|
7
|
-
import { DictionaryProperties } from './../../input-output/pdf-dictionary-properties';
|
|
8
|
-
import { PdfArray } from './../../primitives/pdf-array';
|
|
9
|
-
import { IPdfPrimitive } from './../../../interfaces/i-pdf-primitives';
|
|
10
|
-
export abstract class PdfFunction implements IPdfWrapper {
|
|
11
|
-
//Field
|
|
12
|
-
/**
|
|
13
|
-
* Internal variable to store dictionary.
|
|
14
|
-
* @private
|
|
15
|
-
*/
|
|
16
|
-
private mDictionary: PdfDictionary = null;
|
|
17
|
-
/**
|
|
18
|
-
* Local variable to store the dictionary properties.
|
|
19
|
-
* @private
|
|
20
|
-
*/
|
|
21
|
-
protected mDictionaryProperties : DictionaryProperties = new DictionaryProperties();
|
|
22
|
-
//Constructor
|
|
23
|
-
/**
|
|
24
|
-
* Initializes a new instance of the `PdfFunction` class.
|
|
25
|
-
* @public
|
|
26
|
-
*/
|
|
27
|
-
public constructor(dictionary: PdfDictionary) {
|
|
28
|
-
this.mDictionary = dictionary;
|
|
29
|
-
}
|
|
30
|
-
//Properties
|
|
31
|
-
/**
|
|
32
|
-
* Gets or sets the domain of the function.
|
|
33
|
-
* @public
|
|
34
|
-
*/
|
|
35
|
-
protected get domain(): PdfArray {
|
|
36
|
-
let domain: PdfArray = (<PdfArray>this.mDictionary.items.getValue(this.mDictionaryProperties.domain));
|
|
37
|
-
return domain;
|
|
38
|
-
}
|
|
39
|
-
protected set domain(value: PdfArray) {
|
|
40
|
-
this.mDictionary.items.setValue(this.mDictionaryProperties.domain, value);
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Gets or sets the range.
|
|
44
|
-
* @public
|
|
45
|
-
*/
|
|
46
|
-
protected get range(): PdfArray {
|
|
47
|
-
let range: PdfArray = (<PdfArray>(this.mDictionary.items.getValue(this.mDictionaryProperties.range)));
|
|
48
|
-
return range;
|
|
49
|
-
}
|
|
50
|
-
protected set range(value: PdfArray) {
|
|
51
|
-
this.mDictionary.items.setValue(this.mDictionaryProperties.range, value);
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Gets the dictionary.
|
|
55
|
-
*/
|
|
56
|
-
protected get dictionary(): PdfDictionary {
|
|
57
|
-
return this.mDictionary;
|
|
58
|
-
}
|
|
59
|
-
//IPdfWrapper Members
|
|
60
|
-
/**
|
|
61
|
-
* Gets the element.
|
|
62
|
-
*/
|
|
63
|
-
get element(): IPdfPrimitive {
|
|
64
|
-
return this.mDictionary;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PdfSampledFunction.ts class for EJ2-PDF
|
|
3
|
-
* Implements PDF Sampled Function.
|
|
4
|
-
*/
|
|
5
|
-
import { PdfArray } from './../../primitives/pdf-array';
|
|
6
|
-
import { PdfFunction} from './pdf-function';
|
|
7
|
-
import { PdfStream } from './../../primitives/pdf-stream';
|
|
8
|
-
import { PdfNumber} from './../../primitives/pdf-number';
|
|
9
|
-
export class PdfSampledFunction extends PdfFunction {
|
|
10
|
-
//Constructor
|
|
11
|
-
/**
|
|
12
|
-
* Initializes a new instance of the `PdfSampledFunction` class.
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
public constructor()
|
|
16
|
-
/**
|
|
17
|
-
* Initializes a new instance of the `PdfSampledFunction` class.
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
20
|
-
public constructor(domain: number[], range: number[], sizes: number[], samples: number[])
|
|
21
|
-
/**
|
|
22
|
-
* Initializes a new instance of the `PdfSampledFunction` class.
|
|
23
|
-
* @public
|
|
24
|
-
*/
|
|
25
|
-
public constructor(domain?: number[], range?: number[], sizes?: number[], samples?: number[]) {
|
|
26
|
-
super(new PdfStream());
|
|
27
|
-
if (typeof domain === 'undefined') {
|
|
28
|
-
this.dictionary.items.setValue(this.mDictionaryProperties.functionType, new PdfNumber(0));
|
|
29
|
-
} else {
|
|
30
|
-
this.dictionary.items.setValue(this.mDictionaryProperties.functionType, new PdfNumber(0));
|
|
31
|
-
this.checkParams(domain, range, sizes, samples);
|
|
32
|
-
this.setDomainAndRange(domain, range);
|
|
33
|
-
this.setSizeAndValues(sizes, samples);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
// Helper methods
|
|
37
|
-
/**
|
|
38
|
-
* Checks the input parameters.
|
|
39
|
-
*/
|
|
40
|
-
private checkParams(domain: number[], range: number[], sizes: number[], samples: number[]) : void {
|
|
41
|
-
let rLength: number = range.length;
|
|
42
|
-
let dLength: number = domain.length;
|
|
43
|
-
let sLength: number = samples.length;
|
|
44
|
-
let frameLength: number = (rLength * (dLength / 4));
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Sets the domain and range.
|
|
48
|
-
*/
|
|
49
|
-
private setDomainAndRange(domain: number[], range: number[]) : void {
|
|
50
|
-
this.domain = new PdfArray(domain);
|
|
51
|
-
this.range = new PdfArray(range);
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Sets the size and values.
|
|
55
|
-
*/
|
|
56
|
-
private setSizeAndValues(sizes: number[], samples: number[]) : void {
|
|
57
|
-
let s: PdfStream = (<PdfStream>(this.dictionary));
|
|
58
|
-
s.isResource = true;
|
|
59
|
-
this.dictionary.items.setValue(this.mDictionaryProperties.size, new PdfArray(sizes));
|
|
60
|
-
this.dictionary.items.setValue(this.mDictionaryProperties.bitsPerSample, new PdfNumber(8));
|
|
61
|
-
s.writeBytes(samples);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PdfCacheCollection.ts class for EJ2-PDF
|
|
3
|
-
*/
|
|
4
|
-
import { Dictionary } from './../collections/dictionary';
|
|
5
|
-
import { PdfFont } from './../graphics/fonts/pdf-font';
|
|
6
|
-
import { IPdfCache } from './../../interfaces/i-pdf-cache';
|
|
7
|
-
/**
|
|
8
|
-
* `Collection of the cached objects`.
|
|
9
|
-
* @private
|
|
10
|
-
*/
|
|
11
|
-
export class PdfCacheCollection {
|
|
12
|
-
// Fields
|
|
13
|
-
/**
|
|
14
|
-
* Stores the similar `objects`.
|
|
15
|
-
* @private
|
|
16
|
-
*/
|
|
17
|
-
private referenceObjects : Object[][];
|
|
18
|
-
/**
|
|
19
|
-
* Stores the references of font with GUID `objects`.
|
|
20
|
-
* @private
|
|
21
|
-
*/
|
|
22
|
-
private pdfFontCollection : Dictionary<string, PdfFont>;
|
|
23
|
-
// Constructors
|
|
24
|
-
/**
|
|
25
|
-
* Initializes a new instance of the `PdfCacheCollection` class.
|
|
26
|
-
* @private
|
|
27
|
-
*/
|
|
28
|
-
public constructor() {
|
|
29
|
-
this.referenceObjects = [];
|
|
30
|
-
this.pdfFontCollection = new Dictionary<string, PdfFont>();
|
|
31
|
-
}
|
|
32
|
-
// Public methods
|
|
33
|
-
/**
|
|
34
|
-
* `Searches` for the similar cached object. If is not found - adds the object to the cache.
|
|
35
|
-
* @private
|
|
36
|
-
*/
|
|
37
|
-
public search(obj : IPdfCache) : IPdfCache {
|
|
38
|
-
let result : IPdfCache = null;
|
|
39
|
-
let group : Object[] = this.getGroup(obj);
|
|
40
|
-
if (group == null) {
|
|
41
|
-
group = this.createNewGroup();
|
|
42
|
-
} else if (group.length > 0) {
|
|
43
|
-
result = group[0] as IPdfCache;
|
|
44
|
-
}
|
|
45
|
-
group.push(obj);
|
|
46
|
-
return result;
|
|
47
|
-
}
|
|
48
|
-
// Implementation
|
|
49
|
-
/**
|
|
50
|
-
* `Creates` a new group.
|
|
51
|
-
* @private
|
|
52
|
-
*/
|
|
53
|
-
public createNewGroup() : Object[] {
|
|
54
|
-
let group : Object[] = [];
|
|
55
|
-
this.referenceObjects.push(group);
|
|
56
|
-
return group;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* `Find and Return` a group.
|
|
60
|
-
* @private
|
|
61
|
-
*/
|
|
62
|
-
public getGroup(result : IPdfCache) : Object[] {
|
|
63
|
-
let group : Object[] = null;
|
|
64
|
-
if (result !== null) {
|
|
65
|
-
let len : number = this.referenceObjects.length;
|
|
66
|
-
for (let i : number = 0; i < len; i++) {
|
|
67
|
-
if (this.referenceObjects.length > 0) {
|
|
68
|
-
let tGroup : Object[] = this.referenceObjects[i];
|
|
69
|
-
if (tGroup.length > 0) {
|
|
70
|
-
let representative : IPdfCache = tGroup[0] as IPdfCache;
|
|
71
|
-
if (result.equalsTo(representative)) {
|
|
72
|
-
group = tGroup;
|
|
73
|
-
break;
|
|
74
|
-
}
|
|
75
|
-
} else {
|
|
76
|
-
this.removeGroup(tGroup);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
len = this.referenceObjects.length;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return group;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Remove a group from the storage.
|
|
86
|
-
*/
|
|
87
|
-
public removeGroup(group : Object[]) : void {
|
|
88
|
-
if (group !== null) {
|
|
89
|
-
let index : number = this.referenceObjects.indexOf(group);
|
|
90
|
-
this.referenceObjects.slice(index, index + 1);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
public destroy() : void {
|
|
94
|
-
this.pdfFontCollection = undefined;
|
|
95
|
-
this.referenceObjects = undefined;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PdfCollection.ts class for EJ2-PDF
|
|
3
|
-
* The class used to handle the collection of PdF objects.
|
|
4
|
-
*/
|
|
5
|
-
export class PdfCollection {
|
|
6
|
-
// Fields
|
|
7
|
-
/**
|
|
8
|
-
* Stores the `objects` as array.
|
|
9
|
-
* @private
|
|
10
|
-
*/
|
|
11
|
-
private collection : Object[];
|
|
12
|
-
// Constructors
|
|
13
|
-
/**
|
|
14
|
-
* Initializes a new instance of the `Collection` class.
|
|
15
|
-
* @private
|
|
16
|
-
*/
|
|
17
|
-
public constructor() {
|
|
18
|
-
//
|
|
19
|
-
}
|
|
20
|
-
// Properties
|
|
21
|
-
/**
|
|
22
|
-
* Gets the `Count` of stored objects.
|
|
23
|
-
* @private
|
|
24
|
-
*/
|
|
25
|
-
public get count() : number {
|
|
26
|
-
if (typeof this.collection === 'undefined') {
|
|
27
|
-
this.collection = [];
|
|
28
|
-
}
|
|
29
|
-
return this.collection.length;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Gets the `list` of stored objects.
|
|
33
|
-
* @private
|
|
34
|
-
*/
|
|
35
|
-
public get list() : Object[] {
|
|
36
|
-
if (typeof this.collection === 'undefined') {
|
|
37
|
-
this.collection = [];
|
|
38
|
-
}
|
|
39
|
-
return this.collection;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PdfDestination.ts class for EJ2-PDF
|
|
3
|
-
*/
|
|
4
|
-
import { IPdfWrapper } from './../../interfaces/i-pdf-wrapper';
|
|
5
|
-
import { IPdfPrimitive } from './../../interfaces/i-pdf-primitives';
|
|
6
|
-
import { PointF, RectangleF } from './../drawing/pdf-drawing';
|
|
7
|
-
import { PdfPageBase } from './../pages/pdf-page-base';
|
|
8
|
-
import { PdfArray } from './../primitives/pdf-array';
|
|
9
|
-
import { PdfPage } from './../pages/pdf-page';
|
|
10
|
-
import { PdfPageRotateAngle } from './../pages/enum';
|
|
11
|
-
import { PdfDestinationMode } from './../general/enum';
|
|
12
|
-
import { PdfSection } from './../pages/pdf-section';
|
|
13
|
-
import { PdfReferenceHolder } from './../primitives/pdf-reference';
|
|
14
|
-
import { PdfName } from './../primitives/pdf-name';
|
|
15
|
-
import { PdfNumber } from './../primitives/pdf-number';
|
|
16
|
-
import { DictionaryProperties } from './../input-output/pdf-dictionary-properties';
|
|
17
|
-
/**
|
|
18
|
-
* `PdfDestination` class represents an anchor in the document
|
|
19
|
-
* where bookmarks or annotations can direct when clicked.
|
|
20
|
-
*/
|
|
21
|
-
export class PdfDestination implements IPdfWrapper {
|
|
22
|
-
// Fields
|
|
23
|
-
/**
|
|
24
|
-
* Internal variable for accessing fields from `DictionryProperties` class.
|
|
25
|
-
* @private
|
|
26
|
-
*/
|
|
27
|
-
protected dictionaryProperties : DictionaryProperties = new DictionaryProperties();
|
|
28
|
-
/**
|
|
29
|
-
* Type of the `destination`.
|
|
30
|
-
* @private
|
|
31
|
-
*/
|
|
32
|
-
private destinationMode : PdfDestinationMode = PdfDestinationMode.Location;
|
|
33
|
-
/**
|
|
34
|
-
* `Zoom` factor.
|
|
35
|
-
* @private
|
|
36
|
-
* @default 0
|
|
37
|
-
*/
|
|
38
|
-
private zoomFactor : number = 0;
|
|
39
|
-
/**
|
|
40
|
-
* `Location` of the destination.
|
|
41
|
-
* @default new PointF() with 0 ,0 as co-ordinates
|
|
42
|
-
* @private
|
|
43
|
-
*/
|
|
44
|
-
private destinationLocation : PointF = new PointF(0, 0);
|
|
45
|
-
/**
|
|
46
|
-
* `Bounds` of the destination as RectangleF.
|
|
47
|
-
* @default RectangleF.Empty
|
|
48
|
-
* @private
|
|
49
|
-
*/
|
|
50
|
-
private bounds : RectangleF = new RectangleF();
|
|
51
|
-
/**
|
|
52
|
-
* Parent `page` reference.
|
|
53
|
-
* @private
|
|
54
|
-
*/
|
|
55
|
-
private pdfPage : PdfPageBase;
|
|
56
|
-
/**
|
|
57
|
-
* Pdf primitive representing `this` object.
|
|
58
|
-
* @private
|
|
59
|
-
*/
|
|
60
|
-
private array : PdfArray = new PdfArray();
|
|
61
|
-
// Constructors
|
|
62
|
-
/**
|
|
63
|
-
* Initializes a new instance of the `PdfDestination` class with page object.
|
|
64
|
-
* @private
|
|
65
|
-
*/
|
|
66
|
-
public constructor(page : PdfPageBase)
|
|
67
|
-
/**
|
|
68
|
-
* Initializes a new instance of the `PdfDestination` class with page object and location.
|
|
69
|
-
* @private
|
|
70
|
-
*/
|
|
71
|
-
public constructor(page : PdfPageBase, location : PointF)
|
|
72
|
-
/**
|
|
73
|
-
* Initializes a new instance of the `PdfDestination` class with page object and bounds.
|
|
74
|
-
* @private
|
|
75
|
-
*/
|
|
76
|
-
public constructor(page : PdfPageBase, rectangle : RectangleF)
|
|
77
|
-
public constructor(arg1 : PdfPageBase, arg2 ?: RectangleF | PointF) {
|
|
78
|
-
let angle : PdfPageRotateAngle = PdfPageRotateAngle.RotateAngle0;
|
|
79
|
-
this.destinationLocation = new PointF(0, this.destinationLocation.y);
|
|
80
|
-
this.pdfPage = arg1;
|
|
81
|
-
if (arg2 instanceof PointF) {
|
|
82
|
-
this.destinationLocation = arg2;
|
|
83
|
-
} else {
|
|
84
|
-
this.bounds = arg2;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
// Properties
|
|
88
|
-
/**
|
|
89
|
-
* Gets and Sets the `zoom` factor.
|
|
90
|
-
* @private
|
|
91
|
-
*/
|
|
92
|
-
public get zoom() : number {
|
|
93
|
-
return this.zoomFactor;
|
|
94
|
-
}
|
|
95
|
-
public set zoom(value : number) {
|
|
96
|
-
this.zoomFactor = value;
|
|
97
|
-
this.initializePrimitive();
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Gets and Sets the `page` object.
|
|
101
|
-
* @private
|
|
102
|
-
*/
|
|
103
|
-
public get page() : PdfPageBase {
|
|
104
|
-
return this.pdfPage;
|
|
105
|
-
}
|
|
106
|
-
public set page(value : PdfPageBase) {
|
|
107
|
-
this.pdfPage = value;
|
|
108
|
-
this.initializePrimitive();
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Gets and Sets the destination `mode`.
|
|
112
|
-
* @private
|
|
113
|
-
*/
|
|
114
|
-
public get mode() : PdfDestinationMode {
|
|
115
|
-
return this. destinationMode;
|
|
116
|
-
}
|
|
117
|
-
public set mode(value : PdfDestinationMode) {
|
|
118
|
-
this.destinationMode = value;
|
|
119
|
-
this.initializePrimitive();
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Gets and Sets the `location`.
|
|
123
|
-
* @private
|
|
124
|
-
*/
|
|
125
|
-
public get location() : PointF {
|
|
126
|
-
return this.destinationLocation;
|
|
127
|
-
}
|
|
128
|
-
public set location(value : PointF) {
|
|
129
|
-
this.destinationLocation = value;
|
|
130
|
-
this.initializePrimitive();
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* `Translates` co-ordinates to PDF co-ordinate system (lower/left).
|
|
134
|
-
* @private
|
|
135
|
-
*/
|
|
136
|
-
private pointToNativePdf(page : PdfPage, point : PointF) : PointF {
|
|
137
|
-
let section : PdfSection = page.section;
|
|
138
|
-
return section.pointToNativePdf(page, point);
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* `In fills` array by correct values.
|
|
142
|
-
* @private
|
|
143
|
-
*/
|
|
144
|
-
private initializePrimitive() : void {
|
|
145
|
-
this.array.clear();
|
|
146
|
-
this.array.add(new PdfReferenceHolder(this.pdfPage));
|
|
147
|
-
switch (this.destinationMode) {
|
|
148
|
-
case PdfDestinationMode.Location:
|
|
149
|
-
let simplePage : PdfPage = this.pdfPage as PdfPage;
|
|
150
|
-
let point : PointF = new PointF();
|
|
151
|
-
point = this.pointToNativePdf(simplePage, this.destinationLocation);
|
|
152
|
-
this.array.add(new PdfName(this.dictionaryProperties.xyz));
|
|
153
|
-
this.array.add(new PdfNumber(point.x));
|
|
154
|
-
this.array.add(new PdfNumber(point.y));
|
|
155
|
-
this.array.add(new PdfNumber(this.zoomFactor));
|
|
156
|
-
break;
|
|
157
|
-
case PdfDestinationMode.FitToPage:
|
|
158
|
-
this.array.add(new PdfName(this.dictionaryProperties.fit));
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Gets the `element` representing this object.
|
|
164
|
-
* @private
|
|
165
|
-
*/
|
|
166
|
-
public get element() : IPdfPrimitive {
|
|
167
|
-
this.initializePrimitive();
|
|
168
|
-
return this.array;
|
|
169
|
-
}
|
|
170
|
-
}
|