@syncfusion/ej2-pdf 24.1.47 → 24.1.48
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.umd.min.js +1 -10
- package/dist/ej2-pdf.umd.min.js.map +1 -1
- package/dist/es6/ej2-pdf.es2015.js +548 -167
- package/dist/es6/ej2-pdf.es2015.js.map +1 -1
- package/dist/es6/ej2-pdf.es5.js +582 -167
- package/dist/es6/ej2-pdf.es5.js.map +1 -1
- package/dist/global/ej2-pdf.min.js +1 -10
- package/dist/global/ej2-pdf.min.js.map +1 -1
- package/dist/global/index.d.ts +0 -9
- package/package.json +60 -60
- package/src/pdf/core/annotations/annotation.d.ts +57 -14
- package/src/pdf/core/annotations/annotation.js +129 -34
- package/src/pdf/core/form/field.d.ts +203 -5
- package/src/pdf/core/form/field.js +453 -133
|
@@ -51,7 +51,7 @@ export declare abstract class PdfField {
|
|
|
51
51
|
_silver: PdfBrush;
|
|
52
52
|
_white: PdfBrush;
|
|
53
53
|
_black: PdfBrush;
|
|
54
|
-
|
|
54
|
+
_isTransparentBackColor: boolean;
|
|
55
55
|
_tabIndex: number;
|
|
56
56
|
_annotationIndex: number;
|
|
57
57
|
_defaultFont: PdfStandardFont;
|
|
@@ -350,7 +350,7 @@ export declare abstract class PdfField {
|
|
|
350
350
|
*/
|
|
351
351
|
color: number[];
|
|
352
352
|
/**
|
|
353
|
-
* Gets the
|
|
353
|
+
* Gets the background color of the field.
|
|
354
354
|
*
|
|
355
355
|
* @returns {number[]} R, G, B color values in between 0 to 255.
|
|
356
356
|
* ```typescript
|
|
@@ -358,7 +358,7 @@ export declare abstract class PdfField {
|
|
|
358
358
|
* let document: PdfDocument = new PdfDocument(data, password);
|
|
359
359
|
* // Access the form field at index 0
|
|
360
360
|
* let field: PdfField = document.form.fieldAt(0);
|
|
361
|
-
* // Gets the
|
|
361
|
+
* // Gets the background color of the field.
|
|
362
362
|
* let backColor: number[] = field.backColor;
|
|
363
363
|
* // Save the document
|
|
364
364
|
* document.save('output.pdf');
|
|
@@ -367,7 +367,7 @@ export declare abstract class PdfField {
|
|
|
367
367
|
* ```
|
|
368
368
|
*/
|
|
369
369
|
/**
|
|
370
|
-
* Sets the
|
|
370
|
+
* Sets the background color of the field.
|
|
371
371
|
*
|
|
372
372
|
* @param {number[]} value R, G, B color values in between 0 to 255.
|
|
373
373
|
* ```typescript
|
|
@@ -375,7 +375,7 @@ export declare abstract class PdfField {
|
|
|
375
375
|
* let document: PdfDocument = new PdfDocument(data, password);
|
|
376
376
|
* // Access the form field at index 0
|
|
377
377
|
* let field: PdfField = document.form.fieldAt(0);
|
|
378
|
-
* // Sets the
|
|
378
|
+
* // Sets the background color of the field.
|
|
379
379
|
* field.backColor = [255, 0, 0];
|
|
380
380
|
* // Save the document
|
|
381
381
|
* document.save('output.pdf');
|
|
@@ -704,6 +704,9 @@ export declare abstract class PdfField {
|
|
|
704
704
|
readonly _whiteBrush: PdfBrush;
|
|
705
705
|
readonly _blackBrush: PdfBrush;
|
|
706
706
|
readonly _kidsCount: number;
|
|
707
|
+
readonly _hasBackColor: boolean;
|
|
708
|
+
_parseBackColor(hasTransparency: boolean): number[];
|
|
709
|
+
_updateBackColor(value: number[], hasTransparency?: boolean): void;
|
|
707
710
|
/**
|
|
708
711
|
* Gets the field item as `PdfWidgetAnnotation` at the specified index.
|
|
709
712
|
*
|
|
@@ -1349,6 +1352,45 @@ export declare class PdfTextBoxField extends PdfField {
|
|
|
1349
1352
|
* ```
|
|
1350
1353
|
*/
|
|
1351
1354
|
font: PdfFont;
|
|
1355
|
+
/**
|
|
1356
|
+
* Gets the background color of the field.
|
|
1357
|
+
*
|
|
1358
|
+
* @returns {number[]} R, G, B color values in between 0 to 255.
|
|
1359
|
+
* ```typescript
|
|
1360
|
+
* // Load an existing PDF document
|
|
1361
|
+
* let document: PdfDocument = new PdfDocument(data, password);
|
|
1362
|
+
* // Access the form field at index 0
|
|
1363
|
+
* let field: PdfField = document.form.fieldAt(0);
|
|
1364
|
+
* // Gets the background color of the field.
|
|
1365
|
+
* let backColor: number[] = field.backColor;
|
|
1366
|
+
* // Save the document
|
|
1367
|
+
* document.save('output.pdf');
|
|
1368
|
+
* // Destroy the document
|
|
1369
|
+
* document.destroy();
|
|
1370
|
+
* ```
|
|
1371
|
+
*/
|
|
1372
|
+
/**
|
|
1373
|
+
* Sets the background color of the field.
|
|
1374
|
+
*
|
|
1375
|
+
* @param {number[]} value Array with R, G, B, A color values in between 0 to 255. For optional A (0-254), it signifies transparency.
|
|
1376
|
+
* ```typescript
|
|
1377
|
+
* // Load an existing PDF document
|
|
1378
|
+
* let document: PdfDocument = new PdfDocument(data, password);
|
|
1379
|
+
* // Access the text box field at index 0
|
|
1380
|
+
* let firstName: PdfField = document.form.fieldAt(0);
|
|
1381
|
+
* // Sets the background color of the field.
|
|
1382
|
+
* firstName.backColor = [255, 0, 0];
|
|
1383
|
+
* // Access the text box field at index 1
|
|
1384
|
+
* let secondName: PdfField = document.form.fieldAt(1);
|
|
1385
|
+
* // Sets the background color of the field to transparent.
|
|
1386
|
+
* secondName.backColor = [0, 0, 0, 0];
|
|
1387
|
+
* // Save the document
|
|
1388
|
+
* document.save('output.pdf');
|
|
1389
|
+
* // Destroy the document
|
|
1390
|
+
* document.destroy();
|
|
1391
|
+
* ```
|
|
1392
|
+
*/
|
|
1393
|
+
backColor: number[];
|
|
1352
1394
|
_initialize(page: PdfPage, name: string, bounds: {
|
|
1353
1395
|
x: number;
|
|
1354
1396
|
y: number;
|
|
@@ -1565,6 +1607,45 @@ export declare class PdfButtonField extends PdfField {
|
|
|
1565
1607
|
* ```
|
|
1566
1608
|
*/
|
|
1567
1609
|
font: PdfFont;
|
|
1610
|
+
/**
|
|
1611
|
+
* Gets the background color of the field.
|
|
1612
|
+
*
|
|
1613
|
+
* @returns {number[]} R, G, B color values in between 0 to 255.
|
|
1614
|
+
* ```typescript
|
|
1615
|
+
* // Load an existing PDF document
|
|
1616
|
+
* let document: PdfDocument = new PdfDocument(data, password);
|
|
1617
|
+
* // Access the form field at index 0
|
|
1618
|
+
* let field: PdfField = document.form.fieldAt(0);
|
|
1619
|
+
* // Gets the background color of the field.
|
|
1620
|
+
* let backColor: number[] = field.backColor;
|
|
1621
|
+
* // Save the document
|
|
1622
|
+
* document.save('output.pdf');
|
|
1623
|
+
* // Destroy the document
|
|
1624
|
+
* document.destroy();
|
|
1625
|
+
* ```
|
|
1626
|
+
*/
|
|
1627
|
+
/**
|
|
1628
|
+
* Sets the background color of the field.
|
|
1629
|
+
*
|
|
1630
|
+
* @param {number[]} value Array with R, G, B, A color values in between 0 to 255. For optional A (0-254), it signifies transparency.
|
|
1631
|
+
* ```typescript
|
|
1632
|
+
* // Load an existing PDF document
|
|
1633
|
+
* let document: PdfDocument = new PdfDocument(data, password);
|
|
1634
|
+
* // Access the button field at index 0
|
|
1635
|
+
* let submitButton: PdfField = document.form.fieldAt(0);
|
|
1636
|
+
* // Sets the background color of the field.
|
|
1637
|
+
* submitButton.backColor = [255, 0, 0];
|
|
1638
|
+
* // Access the button field at index 1
|
|
1639
|
+
* let cancelButton: PdfField = document.form.fieldAt(1);
|
|
1640
|
+
* // Sets the background color of the field to transparent.
|
|
1641
|
+
* cancelButton.backColor = [0, 0, 0, 0];
|
|
1642
|
+
* // Save the document
|
|
1643
|
+
* document.save('output.pdf');
|
|
1644
|
+
* // Destroy the document
|
|
1645
|
+
* document.destroy();
|
|
1646
|
+
* ```
|
|
1647
|
+
*/
|
|
1648
|
+
backColor: number[];
|
|
1568
1649
|
_assignText(fieldDictionary: _PdfDictionary, value: string): void;
|
|
1569
1650
|
/**
|
|
1570
1651
|
* Parse an existing button field.
|
|
@@ -1810,6 +1891,45 @@ export declare class PdfCheckBoxField extends PdfField {
|
|
|
1810
1891
|
* ```
|
|
1811
1892
|
*/
|
|
1812
1893
|
textAlignment: PdfTextAlignment;
|
|
1894
|
+
/**
|
|
1895
|
+
* Gets the background color of the field.
|
|
1896
|
+
*
|
|
1897
|
+
* @returns {number[]} R, G, B color values in between 0 to 255.
|
|
1898
|
+
* ```typescript
|
|
1899
|
+
* // Load an existing PDF document
|
|
1900
|
+
* let document: PdfDocument = new PdfDocument(data, password);
|
|
1901
|
+
* // Access the form field at index 0
|
|
1902
|
+
* let field: PdfField = document.form.fieldAt(0);
|
|
1903
|
+
* // Gets the background color of the field.
|
|
1904
|
+
* let backColor: number[] = field.backColor;
|
|
1905
|
+
* // Save the document
|
|
1906
|
+
* document.save('output.pdf');
|
|
1907
|
+
* // Destroy the document
|
|
1908
|
+
* document.destroy();
|
|
1909
|
+
* ```
|
|
1910
|
+
*/
|
|
1911
|
+
/**
|
|
1912
|
+
* Sets the background color of the field.
|
|
1913
|
+
*
|
|
1914
|
+
* @param {number[]} value Array with R, G, B, A color values in between 0 to 255. For optional A (0-254), it signifies transparency.
|
|
1915
|
+
* ```typescript
|
|
1916
|
+
* // Load an existing PDF document
|
|
1917
|
+
* let document: PdfDocument = new PdfDocument(data, password);
|
|
1918
|
+
* // Access the check box field at index 0
|
|
1919
|
+
* let checkBox1: PdfField = document.form.fieldAt(0);
|
|
1920
|
+
* // Sets the background color of the field.
|
|
1921
|
+
* checkBox1.backColor = [255, 0, 0];
|
|
1922
|
+
* // Access the check box field at index 1
|
|
1923
|
+
* let checkBox2: PdfField = document.form.fieldAt(1);
|
|
1924
|
+
* // Sets the background color of the field to transparent.
|
|
1925
|
+
* checkBox2.backColor = [0, 0, 0, 0];
|
|
1926
|
+
* // Save the document
|
|
1927
|
+
* document.save('output.pdf');
|
|
1928
|
+
* // Destroy the document
|
|
1929
|
+
* document.destroy();
|
|
1930
|
+
* ```
|
|
1931
|
+
*/
|
|
1932
|
+
backColor: number[];
|
|
1813
1933
|
_initialize(page: PdfPage, name: string, bounds: {
|
|
1814
1934
|
x: number;
|
|
1815
1935
|
y: number;
|
|
@@ -2572,6 +2692,45 @@ export declare abstract class PdfListField extends PdfField {
|
|
|
2572
2692
|
* ```
|
|
2573
2693
|
*/
|
|
2574
2694
|
textAlignment: PdfTextAlignment;
|
|
2695
|
+
/**
|
|
2696
|
+
* Gets the background color of the field.
|
|
2697
|
+
*
|
|
2698
|
+
* @returns {number[]} R, G, B color values in between 0 to 255.
|
|
2699
|
+
* ```typescript
|
|
2700
|
+
* // Load an existing PDF document
|
|
2701
|
+
* let document: PdfDocument = new PdfDocument(data, password);
|
|
2702
|
+
* // Access the form field at index 0
|
|
2703
|
+
* let field: PdfField = document.form.fieldAt(0);
|
|
2704
|
+
* // Gets the background color of the field.
|
|
2705
|
+
* let backColor: number[] = field.backColor;
|
|
2706
|
+
* // Save the document
|
|
2707
|
+
* document.save('output.pdf');
|
|
2708
|
+
* // Destroy the document
|
|
2709
|
+
* document.destroy();
|
|
2710
|
+
* ```
|
|
2711
|
+
*/
|
|
2712
|
+
/**
|
|
2713
|
+
* Sets the background color of the field.
|
|
2714
|
+
*
|
|
2715
|
+
* @param {number[]} value Array with R, G, B, A color values in between 0 to 255. For optional A (0-254), it signifies transparency.
|
|
2716
|
+
* ```typescript
|
|
2717
|
+
* // Load an existing PDF document
|
|
2718
|
+
* let document: PdfDocument = new PdfDocument(data, password);
|
|
2719
|
+
* // Access the list field at index 0
|
|
2720
|
+
* let list1: PdfField = document.form.fieldAt(0);
|
|
2721
|
+
* // Sets the background color of the field.
|
|
2722
|
+
* list1.backColor = [255, 0, 0];
|
|
2723
|
+
* // Access the list field at index 1
|
|
2724
|
+
* let list2: PdfField = document.form.fieldAt(1);
|
|
2725
|
+
* // Sets the background color of the field to transparent.
|
|
2726
|
+
* list2.backColor = [0, 0, 0, 0];
|
|
2727
|
+
* // Save the document
|
|
2728
|
+
* document.save('output.pdf');
|
|
2729
|
+
* // Destroy the document
|
|
2730
|
+
* document.destroy();
|
|
2731
|
+
* ```
|
|
2732
|
+
*/
|
|
2733
|
+
backColor: number[];
|
|
2575
2734
|
readonly _options: Array<string[]>;
|
|
2576
2735
|
/**
|
|
2577
2736
|
* Gets the item at the specified index.
|
|
@@ -2966,6 +3125,45 @@ export declare class PdfSignatureField extends PdfField {
|
|
|
2966
3125
|
* ```
|
|
2967
3126
|
*/
|
|
2968
3127
|
readonly isSigned: boolean;
|
|
3128
|
+
/**
|
|
3129
|
+
* Gets the background color of the field.
|
|
3130
|
+
*
|
|
3131
|
+
* @returns {number[]} R, G, B color values in between 0 to 255.
|
|
3132
|
+
* ```typescript
|
|
3133
|
+
* // Load an existing PDF document
|
|
3134
|
+
* let document: PdfDocument = new PdfDocument(data, password);
|
|
3135
|
+
* // Access the form field at index 0
|
|
3136
|
+
* let field: PdfField = document.form.fieldAt(0);
|
|
3137
|
+
* // Gets the background color of the field.
|
|
3138
|
+
* let backColor: number[] = field.backColor;
|
|
3139
|
+
* // Save the document
|
|
3140
|
+
* document.save('output.pdf');
|
|
3141
|
+
* // Destroy the document
|
|
3142
|
+
* document.destroy();
|
|
3143
|
+
* ```
|
|
3144
|
+
*/
|
|
3145
|
+
/**
|
|
3146
|
+
* Sets the background color of the field.
|
|
3147
|
+
*
|
|
3148
|
+
* @param {number[]} value Array with R, G, B, A color values in between 0 to 255. For optional A (0-254), it signifies transparency.
|
|
3149
|
+
* ```typescript
|
|
3150
|
+
* // Load an existing PDF document
|
|
3151
|
+
* let document: PdfDocument = new PdfDocument(data, password);
|
|
3152
|
+
* // Access the signature field at index 0
|
|
3153
|
+
* let field1: PdfField = document.form.fieldAt(0);
|
|
3154
|
+
* // Sets the background color of the field.
|
|
3155
|
+
* field1.backColor = [255, 0, 0];
|
|
3156
|
+
* // Access the signature field at index 1
|
|
3157
|
+
* let field2: PdfField = document.form.fieldAt(1);
|
|
3158
|
+
* // Sets the background color of the field to transparent.
|
|
3159
|
+
* field2.backColor = [0, 0, 0, 0];
|
|
3160
|
+
* // Save the document
|
|
3161
|
+
* document.save('output.pdf');
|
|
3162
|
+
* // Destroy the document
|
|
3163
|
+
* document.destroy();
|
|
3164
|
+
* ```
|
|
3165
|
+
*/
|
|
3166
|
+
backColor: number[];
|
|
2969
3167
|
static _load(form: PdfForm, dictionary: _PdfDictionary, crossReference: _PdfCrossReference, reference: _PdfReference): PdfSignatureField;
|
|
2970
3168
|
_initialize(page: PdfPage, name: string, bounds: {
|
|
2971
3169
|
x: number;
|