@syncfusion/ej2-pdf 25.2.3 → 25.2.6

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,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 25.2.3
3
+ * version : 25.2.6
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. 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
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-pdf@*",
3
- "_id": "@syncfusion/ej2-pdf@25.1.42",
3
+ "_id": "@syncfusion/ej2-pdf@25.2.3",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-vqldWjmy3RjHr9lFc0s6OIA/usm/v9nfsEUtiJ57f74MsfDLPTKQRXGlOKkOKUj3ljrUkfn7JbjjW6K7OayEHA==",
5
+ "_integrity": "sha512-eHarTmqnGF5RV+CCdG4DTy72d4/1tOLOh2donMEWsOGWz62Vnpi+rl5/XxQr2aR3o0RvHy5XlzUBAOVugakq8g==",
6
6
  "_location": "/@syncfusion/ej2-pdf",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -21,8 +21,8 @@
21
21
  "/@syncfusion/ej2",
22
22
  "/@syncfusion/ej2-pdfviewer"
23
23
  ],
24
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-pdf/-/ej2-pdf-25.1.42.tgz",
25
- "_shasum": "3f06568c8e0bd79cdbcc53551c78de3dc406d5ba",
24
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-pdf/-/ej2-pdf-25.2.3.tgz",
25
+ "_shasum": "599fa64750e27b0d9c14148571ad89cf8aef6f93",
26
26
  "_spec": "@syncfusion/ej2-pdf@*",
27
27
  "_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
28
28
  "author": {
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "bundleDependencies": false,
32
32
  "dependencies": {
33
- "@syncfusion/ej2-base": "~25.2.3",
33
+ "@syncfusion/ej2-base": "~25.2.5",
34
34
  "@syncfusion/ej2-compression": "~25.2.3"
35
35
  },
36
36
  "deprecated": false,
@@ -55,7 +55,7 @@
55
55
  "url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/pdf"
56
56
  },
57
57
  "typings": "index.d.ts",
58
- "version": "25.2.3",
58
+ "version": "25.2.6",
59
59
  "sideEffects": false,
60
60
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
61
61
  }
@@ -4154,6 +4154,7 @@ export declare class PdfWidgetAnnotation extends PdfAnnotation {
4154
4154
  _fontName: string;
4155
4155
  _isFont: boolean;
4156
4156
  _isTransparentBackColor: boolean;
4157
+ _isTransparentBorderColor: boolean;
4157
4158
  /**
4158
4159
  * Initializes a new instance of the `PdfWidgetAnnotation` class.
4159
4160
  *
@@ -4263,6 +4264,7 @@ export declare class PdfWidgetAnnotation extends PdfAnnotation {
4263
4264
  */
4264
4265
  backColor: number[];
4265
4266
  readonly _hasBackColor: boolean;
4267
+ readonly _hasBorderColor: boolean;
4266
4268
  /**
4267
4269
  * Gets the border color of the annotation.
4268
4270
  *
@@ -4283,7 +4285,7 @@ export declare class PdfWidgetAnnotation extends PdfAnnotation {
4283
4285
  /**
4284
4286
  * Sets the border color of the annotation.
4285
4287
  *
4286
- * @param {number[]} value Color as R, G, B color array in between 0 to 255.
4288
+ * @param {number[]} value Array with R, G, B, A color values in between 0 to 255.. For optional A (0-254), it signifies transparency.
4287
4289
  * ```typescript
4288
4290
  * // Load an existing PDF document
4289
4291
  * let document: PdfDocument = new PdfDocument(data, password);
@@ -4544,7 +4546,9 @@ export declare class PdfWidgetAnnotation extends PdfAnnotation {
4544
4546
  _getPage(): PdfPage;
4545
4547
  _beginSave(): void;
4546
4548
  _parseBackColor(): number[];
4549
+ _parseBorderColor(): number[];
4547
4550
  _updateBackColor(value: number[], setAppearance?: boolean): void;
4551
+ _updateBorderColor(value: number[], setAppearance?: boolean): void;
4548
4552
  }
4549
4553
  /**
4550
4554
  * `PdfStateItem` class represents the check box field item objects.
@@ -12010,6 +12010,7 @@ var PdfWidgetAnnotation = /** @class */ (function (_super) {
12010
12010
  _this._visibility = PdfFormFieldVisibility.visible;
12011
12011
  _this._isFont = false;
12012
12012
  _this._isTransparentBackColor = false;
12013
+ _this._isTransparentBorderColor = false;
12013
12014
  _this._isWidget = true;
12014
12015
  _this._type = _PdfAnnotationType.widgetAnnotation;
12015
12016
  return _this;
@@ -12173,6 +12174,19 @@ var PdfWidgetAnnotation = /** @class */ (function (_super) {
12173
12174
  enumerable: true,
12174
12175
  configurable: true
12175
12176
  });
12177
+ Object.defineProperty(PdfWidgetAnnotation.prototype, "_hasBorderColor", {
12178
+ get: function () {
12179
+ if (this._isLoaded) {
12180
+ var mkDictionary = this._mkDictionary;
12181
+ return (mkDictionary && mkDictionary.has('BC'));
12182
+ }
12183
+ else {
12184
+ return !this._isTransparentBorderColor;
12185
+ }
12186
+ },
12187
+ enumerable: true,
12188
+ configurable: true
12189
+ });
12176
12190
  Object.defineProperty(PdfWidgetAnnotation.prototype, "borderColor", {
12177
12191
  /**
12178
12192
  * Gets the border color of the annotation.
@@ -12192,24 +12206,12 @@ var PdfWidgetAnnotation = /** @class */ (function (_super) {
12192
12206
  * ```
12193
12207
  */
12194
12208
  get: function () {
12195
- if (typeof this._borderColor === 'undefined') {
12196
- var mkDict = this._mkDictionary;
12197
- if (mkDict && mkDict.has('BC')) {
12198
- var bcArray = mkDict.getArray('BC');
12199
- if (bcArray) {
12200
- this._borderColor = _parseColor(bcArray);
12201
- }
12202
- }
12203
- }
12204
- if (typeof this._borderColor === 'undefined' || this._borderColor === null) {
12205
- this._borderColor = [0, 0, 0];
12206
- }
12207
- return this._borderColor;
12209
+ return this._parseBorderColor();
12208
12210
  },
12209
12211
  /**
12210
12212
  * Sets the border color of the annotation.
12211
12213
  *
12212
- * @param {number[]} value Color as R, G, B color array in between 0 to 255.
12214
+ * @param {number[]} value Array with R, G, B, A color values in between 0 to 255.. For optional A (0-254), it signifies transparency.
12213
12215
  * ```typescript
12214
12216
  * // Load an existing PDF document
12215
12217
  * let document: PdfDocument = new PdfDocument(data, password);
@@ -12226,15 +12228,7 @@ var PdfWidgetAnnotation = /** @class */ (function (_super) {
12226
12228
  * ```
12227
12229
  */
12228
12230
  set: function (value) {
12229
- if (typeof this.borderColor === 'undefined' || this.borderColor !== value) {
12230
- if (typeof this._mkDictionary === 'undefined') {
12231
- this._dictionary.update('MK', new _PdfDictionary(this._crossReference));
12232
- }
12233
- this._mkDictionary.update('BC', [Number.parseFloat((value[0] / 255).toFixed(3)),
12234
- Number.parseFloat((value[1] / 255).toFixed(3)),
12235
- Number.parseFloat((value[2] / 255).toFixed(3))]);
12236
- this._borderColor = value;
12237
- }
12231
+ this._updateBorderColor(value, true);
12238
12232
  },
12239
12233
  enumerable: true,
12240
12234
  configurable: true
@@ -12868,6 +12862,25 @@ var PdfWidgetAnnotation = /** @class */ (function (_super) {
12868
12862
  }
12869
12863
  return value;
12870
12864
  };
12865
+ PdfWidgetAnnotation.prototype._parseBorderColor = function () {
12866
+ var value;
12867
+ if ((this._isLoaded && this._hasBorderColor) || (!this._isLoaded && !this._isTransparentBorderColor)) {
12868
+ if (typeof this._borderColor === 'undefined') {
12869
+ var dictionary = this._mkDictionary;
12870
+ if (dictionary && dictionary.has('BC')) {
12871
+ var colorArray = dictionary.getArray('BC');
12872
+ if (colorArray) {
12873
+ this._borderColor = _parseColor(colorArray);
12874
+ }
12875
+ }
12876
+ }
12877
+ if (typeof this._borderColor === 'undefined' || this._borderColor === null) {
12878
+ this._borderColor = [0, 0, 0];
12879
+ }
12880
+ value = this._borderColor;
12881
+ }
12882
+ return value;
12883
+ };
12871
12884
  PdfWidgetAnnotation.prototype._updateBackColor = function (value, setAppearance) {
12872
12885
  if (setAppearance === void 0) { setAppearance = false; }
12873
12886
  var isChanged = false;
@@ -12902,6 +12915,39 @@ var PdfWidgetAnnotation = /** @class */ (function (_super) {
12902
12915
  this._field._setAppearance = true;
12903
12916
  }
12904
12917
  };
12918
+ PdfWidgetAnnotation.prototype._updateBorderColor = function (value, setAppearance) {
12919
+ if (setAppearance === void 0) { setAppearance = false; }
12920
+ if (value.length === 4 && value[3] !== 255) {
12921
+ this._isTransparentBorderColor = true;
12922
+ if (this._dictionary.has('BC')) {
12923
+ delete this._dictionary._map.BC;
12924
+ }
12925
+ var mkDictionary = this._mkDictionary;
12926
+ if (mkDictionary && mkDictionary.has('BC')) {
12927
+ delete mkDictionary._map.BC;
12928
+ if (this._dictionary.has('BS')) {
12929
+ var bsDictionary = this._dictionary.get('BS');
12930
+ if (bsDictionary && bsDictionary.has('W')) {
12931
+ delete bsDictionary._map.W;
12932
+ }
12933
+ }
12934
+ this._dictionary._updated = true;
12935
+ }
12936
+ }
12937
+ else {
12938
+ this._isTransparentBorderColor = false;
12939
+ if (typeof this.borderColor === 'undefined' || this.borderColor !== value) {
12940
+ if (typeof this._mkDictionary === 'undefined') {
12941
+ this._dictionary.update('MK', new _PdfDictionary(this._crossReference));
12942
+ }
12943
+ this._mkDictionary.update('BC', [Number.parseFloat((value[0] / 255).toFixed(3)),
12944
+ Number.parseFloat((value[1] / 255).toFixed(3)),
12945
+ Number.parseFloat((value[2] / 255).toFixed(3))]);
12946
+ this._borderColor = [value[0], value[1], value[2]];
12947
+ this._dictionary._updated = true;
12948
+ }
12949
+ }
12950
+ };
12905
12951
  return PdfWidgetAnnotation;
12906
12952
  }(PdfAnnotation));
12907
12953
  export { PdfWidgetAnnotation };
@@ -53,6 +53,7 @@ export declare abstract class PdfField {
53
53
  _white: PdfBrush;
54
54
  _black: PdfBrush;
55
55
  _isTransparentBackColor: boolean;
56
+ _isTransparentBorderColor: boolean;
56
57
  _tabIndex: number;
57
58
  _annotationIndex: number;
58
59
  _defaultFont: PdfStandardFont;
@@ -405,7 +406,7 @@ export declare abstract class PdfField {
405
406
  /**
406
407
  * Sets the border color of the field.
407
408
  *
408
- * @param {number[]} value R, G, B color values in between 0 to 255.
409
+ * @param {number[]} Value Array with R, G, B, A color values in between 0 to 255. For optional A (0-254), it signifies transparency.
409
410
  * ```typescript
410
411
  * // Load an existing PDF document
411
412
  * let document: PdfDocument = new PdfDocument(data, password);
@@ -706,8 +707,11 @@ export declare abstract class PdfField {
706
707
  readonly _blackBrush: PdfBrush;
707
708
  readonly _kidsCount: number;
708
709
  readonly _hasBackColor: boolean;
710
+ readonly _hasBorderColor: boolean;
709
711
  _parseBackColor(hasTransparency: boolean): number[];
712
+ _parseBorderColor(hasTransparency: boolean): number[];
710
713
  _updateBackColor(value: number[], hasTransparency?: boolean): void;
714
+ _updateBorderColor(value: number[], hasTransparency?: boolean): void;
711
715
  /**
712
716
  * Gets the field item as `PdfWidgetAnnotation` at the specified index.
713
717
  *
@@ -1952,6 +1956,41 @@ export declare class PdfCheckBoxField extends PdfField {
1952
1956
  * ```
1953
1957
  */
1954
1958
  backColor: number[];
1959
+ /**
1960
+ * Gets the border color of the field.
1961
+ *
1962
+ * @returns {number[]} R, G, B color values in between 0 to 255.
1963
+ * ```typescript
1964
+ * // Load an existing PDF document
1965
+ * let document: PdfDocument = new PdfDocument(data, password);
1966
+ * // Access the form field at index 0
1967
+ * let field: PdfField = document.form.fieldAt(0);
1968
+ * // Gets the border color of the field.
1969
+ * let borderColor: number[] = field.borderColor;
1970
+ * // Save the document
1971
+ * document.save('output.pdf');
1972
+ * // Destroy the document
1973
+ * document.destroy();
1974
+ * ```
1975
+ */
1976
+ /**
1977
+ * Sets the border color of the field.
1978
+ *
1979
+ * @param {number[]} value Array with R, G, B, A color values in between 0 to 255. For optional A (0-254), it signifies transparency.
1980
+ * ```typescript
1981
+ * // Load an existing PDF document
1982
+ * let document: PdfDocument = new PdfDocument(data, password);
1983
+ * // Access the form field at index 0
1984
+ * let field: PdfField = document.form.fieldAt(0);
1985
+ * // Sets the border color of the field.
1986
+ * field.borderColor = [255, 0, 0];
1987
+ * // Save the document
1988
+ * document.save('output.pdf');
1989
+ * // Destroy the document
1990
+ * document.destroy();
1991
+ * ```
1992
+ */
1993
+ borderColor: number[];
1955
1994
  _initialize(page: PdfPage, name: string, bounds: {
1956
1995
  x: number;
1957
1996
  y: number;
@@ -2116,6 +2155,41 @@ export declare class PdfRadioButtonListField extends PdfField {
2116
2155
  * ```
2117
2156
  */
2118
2157
  selectedIndex: number;
2158
+ /**
2159
+ * Gets the border color of the field.
2160
+ *
2161
+ * @returns {number[]} R, G, B color values in between 0 to 255.
2162
+ * ```typescript
2163
+ * // Load an existing PDF document
2164
+ * let document: PdfDocument = new PdfDocument(data, password);
2165
+ * // Access the form field at index 0
2166
+ * let field: PdfField = document.form.fieldAt(0);
2167
+ * // Gets the border color of the field.
2168
+ * let borderColor: number[] = field.borderColor;
2169
+ * // Save the document
2170
+ * document.save('output.pdf');
2171
+ * // Destroy the document
2172
+ * document.destroy();
2173
+ * ```
2174
+ */
2175
+ /**
2176
+ * Sets the border color of the field.
2177
+ *
2178
+ * @param {number[]} value Array with R, G, B, A color values in between 0 to 255. For optional A (0-254), it signifies transparency.
2179
+ * ```typescript
2180
+ * // Load an existing PDF document
2181
+ * let document: PdfDocument = new PdfDocument(data, password);
2182
+ * // Access the form field at index 0
2183
+ * let field: PdfField = document.form.fieldAt(0);
2184
+ * // Sets the border color of the field.
2185
+ * field.borderColor = [255, 0, 0];
2186
+ * // Save the document
2187
+ * document.save('output.pdf');
2188
+ * // Destroy the document
2189
+ * document.destroy();
2190
+ * ```
2191
+ */
2192
+ borderColor: number[];
2119
2193
  /**
2120
2194
  * Gets the item at the specified index.
2121
2195
  *