@syncfusion/ej2-pdf-export 35.1.37 → 35.1.43
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/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 +430 -2797
- package/dist/es6/ej2-pdf-export.es2015.js.map +1 -1
- package/dist/es6/ej2-pdf-export.es5.js +430 -2797
- 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 +1 -1
- package/src/implementation/actions/action.d.ts +0 -6
- package/src/implementation/actions/action.js +2 -8
- package/src/implementation/actions/uri-action.js +2 -2
- package/src/implementation/annotations/annotation-collection.d.ts +0 -6
- package/src/implementation/annotations/annotation-collection.js +1 -7
- package/src/implementation/annotations/annotation.d.ts +0 -6
- package/src/implementation/annotations/annotation.js +5 -11
- package/src/implementation/annotations/document-link-annotation.js +1 -1
- package/src/implementation/annotations/link-annotation.js +1 -1
- package/src/implementation/annotations/uri-annotation.js +2 -2
- package/src/implementation/document/pdf-viewer-preferences.d.ts +0 -2
- package/src/implementation/document/pdf-viewer-preferences.js +12 -14
- package/src/implementation/general/pdf-destination.d.ts +0 -6
- package/src/implementation/general/pdf-destination.js +2 -8
- package/src/implementation/graphics/brushes/pdf-brushes.d.ts +10 -4
- package/src/implementation/graphics/brushes/pdf-brushes.js +163 -1843
- package/src/implementation/graphics/brushes/pdf-gradient-brush.d.ts +0 -5
- package/src/implementation/graphics/brushes/pdf-gradient-brush.js +18 -24
- package/src/implementation/graphics/figures/pdf-template.d.ts +0 -6
- package/src/implementation/graphics/figures/pdf-template.js +7 -14
- package/src/implementation/graphics/fonts/pdf-standard-font-metrics-factory.d.ts +15 -1
- package/src/implementation/graphics/fonts/pdf-standard-font-metrics-factory.js +45 -161
- package/src/implementation/graphics/fonts/pdf-standard-font.d.ts +0 -5
- package/src/implementation/graphics/fonts/pdf-standard-font.js +4 -10
- package/src/implementation/graphics/fonts/rtl/rtl-bidirectional.d.ts +7 -0
- package/src/implementation/graphics/fonts/rtl/rtl-bidirectional.js +31 -461
- package/src/implementation/graphics/fonts/rtl/rtl-text-shape.d.ts +12 -0
- package/src/implementation/graphics/fonts/rtl/rtl-text-shape.js +32 -76
- package/src/implementation/graphics/fonts/unicode-true-type-font.d.ts +0 -5
- package/src/implementation/graphics/fonts/unicode-true-type-font.js +37 -43
- package/src/implementation/graphics/images/image-decoder.d.ts +0 -6
- package/src/implementation/graphics/images/image-decoder.js +14 -21
- package/src/implementation/graphics/images/pdf-bitmap.d.ts +0 -6
- package/src/implementation/graphics/images/pdf-bitmap.js +0 -7
- package/src/implementation/graphics/pdf-graphics.d.ts +0 -5
- package/src/implementation/graphics/pdf-graphics.js +0 -6
- package/src/implementation/graphics/pdf-resources.js +15 -15
- package/src/implementation/graphics/pdf-transparency.d.ts +0 -6
- package/src/implementation/graphics/pdf-transparency.js +6 -13
- package/src/implementation/input-output/pdf-cross-table.d.ts +0 -6
- package/src/implementation/input-output/pdf-cross-table.js +2 -9
- package/src/implementation/pages/pdf-page-base.d.ts +0 -7
- package/src/implementation/pages/pdf-page-base.js +4 -11
- package/src/implementation/pages/pdf-page-layer.d.ts +0 -5
- package/src/implementation/pages/pdf-page-layer.js +0 -6
- package/src/implementation/pages/pdf-page.js +5 -5
- package/src/implementation/pages/pdf-section-collection.d.ts +0 -5
- package/src/implementation/pages/pdf-section-collection.js +5 -11
- package/src/implementation/pages/pdf-section.d.ts +0 -5
- package/src/implementation/pages/pdf-section.js +6 -12
- package/src/implementation/primitives/pdf-reference.d.ts +0 -5
- package/src/implementation/primitives/pdf-reference.js +1 -7
- package/src/implementation/primitives/pdf-stream.js +7 -7
|
@@ -7,82 +7,20 @@ var ArabicShapeRenderer = /** @class */ (function () {
|
|
|
7
7
|
//#region Constructor
|
|
8
8
|
function ArabicShapeRenderer() {
|
|
9
9
|
//#region Constants
|
|
10
|
-
this.arabicCharTable = [
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
['\u0630', '\uFEAB', '\uFEAC'],
|
|
25
|
-
['\u0631', '\uFEAD', '\uFEAE'],
|
|
26
|
-
['\u0632', '\uFEAF', '\uFEB0'],
|
|
27
|
-
['\u0633', '\uFEB1', '\uFEB2', '\uFEB3', '\uFEB4'],
|
|
28
|
-
['\u0634', '\uFEB5', '\uFEB6', '\uFEB7', '\uFEB8'],
|
|
29
|
-
['\u0635', '\uFEB9', '\uFEBA', '\uFEBB', '\uFEBC'],
|
|
30
|
-
['\u0636', '\uFEBD', '\uFEBE', '\uFEBF', '\uFEC0'],
|
|
31
|
-
['\u0637', '\uFEC1', '\uFEC2', '\uFEC3', '\uFEC4'],
|
|
32
|
-
['\u0638', '\uFEC5', '\uFEC6', '\uFEC7', '\uFEC8'],
|
|
33
|
-
['\u0639', '\uFEC9', '\uFECA', '\uFECB', '\uFECC'],
|
|
34
|
-
['\u063A', '\uFECD', '\uFECE', '\uFECF', '\uFED0'],
|
|
35
|
-
['\u0640', '\u0640', '\u0640', '\u0640', '\u0640'],
|
|
36
|
-
['\u0641', '\uFED1', '\uFED2', '\uFED3', '\uFED4'],
|
|
37
|
-
['\u0642', '\uFED5', '\uFED6', '\uFED7', '\uFED8'],
|
|
38
|
-
['\u0643', '\uFED9', '\uFEDA', '\uFEDB', '\uFEDC'],
|
|
39
|
-
['\u0644', '\uFEDD', '\uFEDE', '\uFEDF', '\uFEE0'],
|
|
40
|
-
['\u0645', '\uFEE1', '\uFEE2', '\uFEE3', '\uFEE4'],
|
|
41
|
-
['\u0646', '\uFEE5', '\uFEE6', '\uFEE7', '\uFEE8'],
|
|
42
|
-
['\u0647', '\uFEE9', '\uFEEA', '\uFEEB', '\uFEEC'],
|
|
43
|
-
['\u0648', '\uFEED', '\uFEEE'],
|
|
44
|
-
['\u0649', '\uFEEF', '\uFEF0', '\uFBE8', '\uFBE9'],
|
|
45
|
-
['\u064A', '\uFEF1', '\uFEF2', '\uFEF3', '\uFEF4'],
|
|
46
|
-
['\u0671', '\uFB50', '\uFB51'],
|
|
47
|
-
['\u0679', '\uFB66', '\uFB67', '\uFB68', '\uFB69'],
|
|
48
|
-
['\u067A', '\uFB5E', '\uFB5F', '\uFB60', '\uFB61'],
|
|
49
|
-
['\u067B', '\uFB52', '\uFB53', '\uFB54', '\uFB55'],
|
|
50
|
-
['\u067E', '\uFB56', '\uFB57', '\uFB58', '\uFB59'],
|
|
51
|
-
['\u067F', '\uFB62', '\uFB63', '\uFB64', '\uFB65'],
|
|
52
|
-
['\u0680', '\uFB5A', '\uFB5B', '\uFB5C', '\uFB5D'],
|
|
53
|
-
['\u0683', '\uFB76', '\uFB77', '\uFB78', '\uFB79'],
|
|
54
|
-
['\u0684', '\uFB72', '\uFB73', '\uFB74', '\uFB75'],
|
|
55
|
-
['\u0686', '\uFB7A', '\uFB7B', '\uFB7C', '\uFB7D'],
|
|
56
|
-
['\u0687', '\uFB7E', '\uFB7F', '\uFB80', '\uFB81'],
|
|
57
|
-
['\u0688', '\uFB88', '\uFB89'],
|
|
58
|
-
['\u068C', '\uFB84', '\uFB85'],
|
|
59
|
-
['\u068D', '\uFB82', '\uFB83'],
|
|
60
|
-
['\u068E', '\uFB86', '\uFB87'],
|
|
61
|
-
['\u0691', '\uFB8C', '\uFB8D'],
|
|
62
|
-
['\u0698', '\uFB8A', '\uFB8B'],
|
|
63
|
-
['\u06A4', '\uFB6A', '\uFB6B', '\uFB6C', '\uFB6D'],
|
|
64
|
-
['\u06A6', '\uFB6E', '\uFB6F', '\uFB70', '\uFB71'],
|
|
65
|
-
['\u06A9', '\uFB8E', '\uFB8F', '\uFB90', '\uFB91'],
|
|
66
|
-
['\u06AD', '\uFBD3', '\uFBD4', '\uFBD5', '\uFBD6'],
|
|
67
|
-
['\u06AF', '\uFB92', '\uFB93', '\uFB94', '\uFB95'],
|
|
68
|
-
['\u06B1', '\uFB9A', '\uFB9B', '\uFB9C', '\uFB9D'],
|
|
69
|
-
['\u06B3', '\uFB96', '\uFB97', '\uFB98', '\uFB99'],
|
|
70
|
-
['\u06BA', '\uFB9E', '\uFB9F'],
|
|
71
|
-
['\u06BB', '\uFBA0', '\uFBA1', '\uFBA2', '\uFBA3'],
|
|
72
|
-
['\u06BE', '\uFBAA', '\uFBAB', '\uFBAC', '\uFBAD'],
|
|
73
|
-
['\u06C0', '\uFBA4', '\uFBA5'],
|
|
74
|
-
['\u06C1', '\uFBA6', '\uFBA7', '\uFBA8', '\uFBA9'],
|
|
75
|
-
['\u06C5', '\uFBE0', '\uFBE1'],
|
|
76
|
-
['\u06C6', '\uFBD9', '\uFBDA'],
|
|
77
|
-
['\u06C7', '\uFBD7', '\uFBD8'],
|
|
78
|
-
['\u06C8', '\uFBDB', '\uFBDC'],
|
|
79
|
-
['\u06C9', '\uFBE2', '\uFBE3'],
|
|
80
|
-
['\u06CB', '\uFBDE', '\uFBDF'],
|
|
81
|
-
['\u06CC', '\uFBFC', '\uFBFD', '\uFBFE', '\uFBFF'],
|
|
82
|
-
['\u06D0', '\uFBE4', '\uFBE5', '\uFBE6', '\uFBE7'],
|
|
83
|
-
['\u06D2', '\uFBAE', '\uFBAF'],
|
|
84
|
-
['\u06D3', '\uFBB0', '\uFBB1']
|
|
85
|
-
];
|
|
10
|
+
this.arabicCharTable = [];
|
|
11
|
+
/**
|
|
12
|
+
* Packed shaping rows with contiguous presentation forms. Each row is packed into three
|
|
13
|
+
* characters: the base character, the first presentation form and the number of forms.
|
|
14
|
+
* @private
|
|
15
|
+
*/
|
|
16
|
+
/* tslint:disable-next-line:max-line-length */
|
|
17
|
+
this.packedContiguousRows = '\u0621\ufe80\u0002\u0622\ufe81\u0003\u0623\ufe83\u0003\u0624\ufe85\u0003\u0625\ufe87\u0003\u0626\ufe89\u0005\u0627\ufe8d\u0003\u0628\ufe8f\u0005\u0629\ufe93\u0003\u062a\ufe95\u0005\u062b\ufe99\u0005\u062c\ufe9d\u0005\u062d\ufea1\u0005\u062e\ufea5\u0005\u062f\ufea9\u0003\u0630\ufeab\u0003\u0631\ufead\u0003\u0632\ufeaf\u0003\u0633\ufeb1\u0005\u0634\ufeb5\u0005\u0635\ufeb9\u0005\u0636\ufebd\u0005\u0637\ufec1\u0005\u0638\ufec5\u0005\u0639\ufec9\u0005\u063a\ufecd\u0005\u0641\ufed1\u0005\u0642\ufed5\u0005\u0643\ufed9\u0005\u0644\ufedd\u0005\u0645\ufee1\u0005\u0646\ufee5\u0005\u0647\ufee9\u0005\u0648\ufeed\u0003\u064a\ufef1\u0005\u0671\ufb50\u0003\u0679\ufb66\u0005\u067a\ufb5e\u0005\u067b\ufb52\u0005\u067e\ufb56\u0005\u067f\ufb62\u0005\u0680\ufb5a\u0005\u0683\ufb76\u0005\u0684\ufb72\u0005\u0686\ufb7a\u0005\u0687\ufb7e\u0005\u0688\ufb88\u0003\u068c\ufb84\u0003\u068d\ufb82\u0003\u068e\ufb86\u0003\u0691\ufb8c\u0003\u0698\ufb8a\u0003\u06a4\ufb6a\u0005\u06a6\ufb6e\u0005\u06a9\ufb8e\u0005\u06ad\ufbd3\u0005\u06af\ufb92\u0005\u06b1\ufb9a\u0005\u06b3\ufb96\u0005\u06ba\ufb9e\u0003\u06bb\ufba0\u0005\u06be\ufbaa\u0005\u06c0\ufba4\u0003\u06c1\ufba6\u0005\u06c5\ufbe0\u0003\u06c6\ufbd9\u0003\u06c7\ufbd7\u0003\u06c8\ufbdb\u0003\u06c9\ufbe2\u0003\u06cb\ufbde\u0003\u06cc\ufbfc\u0005\u06d0\ufbe4\u0005\u06d2\ufbae\u0003\u06d3\ufbb0\u0003';
|
|
18
|
+
/**
|
|
19
|
+
* Packed shaping rows with non-contiguous presentation forms (tatweel and alef maksura).
|
|
20
|
+
* Each row is packed as its characters concatenated.
|
|
21
|
+
* @private
|
|
22
|
+
*/
|
|
23
|
+
this.packedSpecialRows = '\u0640\u0640\u0640\u0640\u0640\u0649\ufeef\ufef0\ufbe8\ufbe9';
|
|
86
24
|
this.alef = '\u0627';
|
|
87
25
|
this.alefHamza = '\u0623';
|
|
88
26
|
this.alefHamzaBelow = '\u0625';
|
|
@@ -111,6 +49,24 @@ var ArabicShapeRenderer = /** @class */ (function () {
|
|
|
111
49
|
// #endregion
|
|
112
50
|
//#region Fields
|
|
113
51
|
this.arabicMapTable = new Dictionary();
|
|
52
|
+
var rows = this.packedContiguousRows;
|
|
53
|
+
for (var i = 0; i < rows.length; i += 3) {
|
|
54
|
+
var row = [rows.charAt(i)];
|
|
55
|
+
var firstForm = rows.charCodeAt(i + 1);
|
|
56
|
+
var formCount = rows.charCodeAt(i + 2);
|
|
57
|
+
for (var j = 1; j < formCount; j++) {
|
|
58
|
+
row.push(String.fromCharCode(firstForm + j - 1));
|
|
59
|
+
}
|
|
60
|
+
this.arabicCharTable.push(row);
|
|
61
|
+
}
|
|
62
|
+
rows = this.packedSpecialRows;
|
|
63
|
+
for (var i = 0; i < rows.length; i += 5) {
|
|
64
|
+
var row = [];
|
|
65
|
+
for (var j = 0; j < 5; j++) {
|
|
66
|
+
row.push(rows.charAt(i + j));
|
|
67
|
+
}
|
|
68
|
+
this.arabicCharTable.push(row);
|
|
69
|
+
}
|
|
114
70
|
for (var i = 0; i < this.arabicCharTable.length; i++) {
|
|
115
71
|
this.arabicMapTable.setValue(this.arabicCharTable[i][0], this.arabicCharTable[i]);
|
|
116
72
|
}
|
|
@@ -67,11 +67,6 @@ export declare class UnicodeTrueTypeFont {
|
|
|
67
67
|
* Font metrics.
|
|
68
68
|
*/
|
|
69
69
|
metrics: PdfFontMetrics;
|
|
70
|
-
/**
|
|
71
|
-
* Specifies the Internal variable to store fields of `PdfDictionaryProperties`.
|
|
72
|
-
* @private
|
|
73
|
-
*/
|
|
74
|
-
private dictionaryProperties;
|
|
75
70
|
/**
|
|
76
71
|
* Array of used chars.
|
|
77
72
|
* @private
|
|
@@ -13,7 +13,6 @@ import { PdfString } from './../../primitives/pdf-string';
|
|
|
13
13
|
import { PdfReferenceHolder } from './../../primitives/pdf-reference';
|
|
14
14
|
import { PdfFontMetrics } from './pdf-font-metrics';
|
|
15
15
|
import { StandardWidthTable } from './pdf-font-metrics';
|
|
16
|
-
import { DictionaryProperties } from './../../input-output/pdf-dictionary-properties';
|
|
17
16
|
import { Dictionary } from './../../collections/dictionary';
|
|
18
17
|
import { FontDescriptorFlags } from './enum';
|
|
19
18
|
import { RectangleF } from './../../drawing/pdf-drawing';
|
|
@@ -28,11 +27,6 @@ var UnicodeTrueTypeFont = /** @class */ (function () {
|
|
|
28
27
|
function UnicodeTrueTypeFont(base64String, size) {
|
|
29
28
|
// Fields
|
|
30
29
|
this.nameString = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
31
|
-
/**
|
|
32
|
-
* Specifies the Internal variable to store fields of `PdfDictionaryProperties`.
|
|
33
|
-
* @private
|
|
34
|
-
*/
|
|
35
|
-
this.dictionaryProperties = new DictionaryProperties();
|
|
36
30
|
/**
|
|
37
31
|
* Indicates whether the font program is compressed or not.
|
|
38
32
|
* @private
|
|
@@ -192,20 +186,20 @@ var UnicodeTrueTypeFont = /** @class */ (function () {
|
|
|
192
186
|
// Set property used to clone Font every time
|
|
193
187
|
this.descendantFont.isResource = true;
|
|
194
188
|
this.descendantFont.descendantFontBeginSave = new SaveDescendantFontEventHandler(this);
|
|
195
|
-
this.descendantFont.items.setValue(
|
|
189
|
+
this.descendantFont.items.setValue('Type', new PdfName('Font'));
|
|
196
190
|
if (this.ttfReader && this.ttfReader._isOpenTypeFont) {
|
|
197
|
-
this.descendantFont.items.setValue(
|
|
191
|
+
this.descendantFont.items.setValue('Subtype', new PdfName('CIDFontType0'));
|
|
198
192
|
}
|
|
199
193
|
else {
|
|
200
|
-
this.descendantFont.items.setValue(
|
|
194
|
+
this.descendantFont.items.setValue('Subtype', new PdfName('CIDFontType2'));
|
|
201
195
|
}
|
|
202
|
-
this.descendantFont.items.setValue(
|
|
203
|
-
this.descendantFont.items.setValue(
|
|
204
|
-
this.descendantFont.items.setValue(
|
|
196
|
+
this.descendantFont.items.setValue('BaseFont', new PdfName(this.subsetName));
|
|
197
|
+
this.descendantFont.items.setValue('CIDToGIDMap', new PdfName('Identity'));
|
|
198
|
+
this.descendantFont.items.setValue('DW', new PdfNumber(1000));
|
|
205
199
|
this.fontDescriptor = this.createFontDescriptor();
|
|
206
|
-
this.descendantFont.items.setValue(
|
|
200
|
+
this.descendantFont.items.setValue('FontDescriptor', new PdfReferenceHolder(this.fontDescriptor));
|
|
207
201
|
var systemInfo = this.createSystemInfo();
|
|
208
|
-
this.descendantFont.items.setValue(
|
|
202
|
+
this.descendantFont.items.setValue('CIDSystemInfo', systemInfo);
|
|
209
203
|
};
|
|
210
204
|
/**
|
|
211
205
|
* Creates font descriptor.
|
|
@@ -215,28 +209,28 @@ var UnicodeTrueTypeFont = /** @class */ (function () {
|
|
|
215
209
|
var metrics = this.ttfReader.metrics;
|
|
216
210
|
// Set property used to clone Font every time
|
|
217
211
|
descriptor.isResource = true;
|
|
218
|
-
descriptor.items.setValue(
|
|
219
|
-
descriptor.items.setValue(
|
|
220
|
-
descriptor.items.setValue(
|
|
221
|
-
descriptor.items.setValue(
|
|
222
|
-
descriptor.items.setValue(
|
|
223
|
-
descriptor.items.setValue(
|
|
224
|
-
descriptor.items.setValue(
|
|
225
|
-
descriptor.items.setValue(
|
|
226
|
-
descriptor.items.setValue(
|
|
227
|
-
descriptor.items.setValue(
|
|
228
|
-
descriptor.items.setValue(
|
|
229
|
-
descriptor.items.setValue(
|
|
212
|
+
descriptor.items.setValue('Type', new PdfName('FontDescriptor'));
|
|
213
|
+
descriptor.items.setValue('FontName', new PdfName(this.subsetName));
|
|
214
|
+
descriptor.items.setValue('Flags', new PdfNumber(this.getDescriptorFlags()));
|
|
215
|
+
descriptor.items.setValue('FontBBox', PdfArray.fromRectangle(this.getBoundBox()));
|
|
216
|
+
descriptor.items.setValue('MissingWidth', new PdfNumber(metrics.widthTable[32]));
|
|
217
|
+
descriptor.items.setValue('StemV', new PdfNumber(metrics.stemV));
|
|
218
|
+
descriptor.items.setValue('ItalicAngle', new PdfNumber(metrics.italicAngle));
|
|
219
|
+
descriptor.items.setValue('CapHeight', new PdfNumber(metrics.capHeight));
|
|
220
|
+
descriptor.items.setValue('Ascent', new PdfNumber(metrics.winAscent));
|
|
221
|
+
descriptor.items.setValue('Descent', new PdfNumber(metrics.winDescent));
|
|
222
|
+
descriptor.items.setValue('Leading', new PdfNumber(metrics.leading));
|
|
223
|
+
descriptor.items.setValue('AvgWidth', new PdfNumber(metrics.widthTable[32]));
|
|
230
224
|
if (this.ttfReader.metrics.contains) {
|
|
231
|
-
descriptor.items.setValue(
|
|
232
|
-
this.fontProgram.items.setValue(
|
|
225
|
+
descriptor.items.setValue('FontFile3', new PdfReferenceHolder(this.fontProgram));
|
|
226
|
+
this.fontProgram.items.setValue('Subtype', new PdfName('CIDFontType0C'));
|
|
233
227
|
}
|
|
234
228
|
else {
|
|
235
|
-
descriptor.items.setValue(
|
|
229
|
+
descriptor.items.setValue('FontFile2', new PdfReferenceHolder(this.fontProgram));
|
|
236
230
|
}
|
|
237
|
-
descriptor.items.setValue(
|
|
238
|
-
descriptor.items.setValue(
|
|
239
|
-
descriptor.items.setValue(
|
|
231
|
+
descriptor.items.setValue('MaxWidth', new PdfNumber(metrics.widthTable[32]));
|
|
232
|
+
descriptor.items.setValue('XHeight', new PdfNumber(0));
|
|
233
|
+
descriptor.items.setValue('StemH', new PdfNumber(0));
|
|
240
234
|
return descriptor;
|
|
241
235
|
};
|
|
242
236
|
/**
|
|
@@ -253,16 +247,16 @@ var UnicodeTrueTypeFont = /** @class */ (function () {
|
|
|
253
247
|
// Set property used to clone Font every time
|
|
254
248
|
this.fontDictionary.isResource = true;
|
|
255
249
|
this.fontDictionary.fontDictionaryBeginSave = new SaveFontDictionaryEventHandler(this);
|
|
256
|
-
this.fontDictionary.items.setValue(
|
|
257
|
-
this.fontDictionary.items.setValue(
|
|
258
|
-
this.fontDictionary.items.setValue(
|
|
259
|
-
this.fontDictionary.items.setValue(
|
|
250
|
+
this.fontDictionary.items.setValue('Type', new PdfName('Font'));
|
|
251
|
+
this.fontDictionary.items.setValue('BaseFont', new PdfName(this.subsetName));
|
|
252
|
+
this.fontDictionary.items.setValue('Subtype', new PdfName('Type0'));
|
|
253
|
+
this.fontDictionary.items.setValue('Encoding', new PdfName('Identity-H'));
|
|
260
254
|
var descFonts = new PdfArray();
|
|
261
255
|
var reference = new PdfReferenceHolder(this.descendantFont);
|
|
262
256
|
// Set property used to clone Font every time
|
|
263
257
|
descFonts.isFont = true;
|
|
264
258
|
descFonts.add(reference);
|
|
265
|
-
this.fontDictionary.items.setValue(
|
|
259
|
+
this.fontDictionary.items.setValue('DescendantFonts', descFonts);
|
|
266
260
|
};
|
|
267
261
|
/**
|
|
268
262
|
* Creates font program.
|
|
@@ -276,9 +270,9 @@ var UnicodeTrueTypeFont = /** @class */ (function () {
|
|
|
276
270
|
*/
|
|
277
271
|
UnicodeTrueTypeFont.prototype.createSystemInfo = function () {
|
|
278
272
|
var systemInfo = new PdfDictionary();
|
|
279
|
-
systemInfo.items.setValue(
|
|
280
|
-
systemInfo.items.setValue(
|
|
281
|
-
systemInfo.items.setValue(
|
|
273
|
+
systemInfo.items.setValue('Registry', new PdfString('Adobe'));
|
|
274
|
+
systemInfo.items.setValue('Ordering', new PdfString('Identity'));
|
|
275
|
+
systemInfo.items.setValue('Supplement', new PdfNumber(0));
|
|
282
276
|
return systemInfo;
|
|
283
277
|
};
|
|
284
278
|
/**
|
|
@@ -288,7 +282,7 @@ var UnicodeTrueTypeFont = /** @class */ (function () {
|
|
|
288
282
|
if (this.usedChars !== null && this.usedChars !== undefined && this.usedChars.size() > 0) {
|
|
289
283
|
var width = this.getDescendantWidth();
|
|
290
284
|
if (width !== null) {
|
|
291
|
-
this.descendantFont.items.setValue(
|
|
285
|
+
this.descendantFont.items.setValue('W', width);
|
|
292
286
|
}
|
|
293
287
|
}
|
|
294
288
|
};
|
|
@@ -303,8 +297,8 @@ var UnicodeTrueTypeFont = /** @class */ (function () {
|
|
|
303
297
|
*/
|
|
304
298
|
/* tslint:disable */
|
|
305
299
|
UnicodeTrueTypeFont.prototype.fontDictionaryBeginSave = function () {
|
|
306
|
-
if (this.usedChars !== null && this.usedChars !== undefined && this.usedChars.size() > 0 && !this.fontDictionary.containsKey(
|
|
307
|
-
this.fontDictionary.items.setValue(
|
|
300
|
+
if (this.usedChars !== null && this.usedChars !== undefined && this.usedChars.size() > 0 && !this.fontDictionary.containsKey('ToUnicode')) {
|
|
301
|
+
this.fontDictionary.items.setValue('ToUnicode', new PdfReferenceHolder(this.cmap));
|
|
308
302
|
}
|
|
309
303
|
};
|
|
310
304
|
/* tslint:enable */
|
|
@@ -152,12 +152,6 @@ export declare class ImageDecoder {
|
|
|
152
152
|
* @private
|
|
153
153
|
*/
|
|
154
154
|
private offset;
|
|
155
|
-
/**
|
|
156
|
-
* Internal variable for accessing fields from `DictionryProperties` class.
|
|
157
|
-
* @hidden
|
|
158
|
-
* @private
|
|
159
|
-
*/
|
|
160
|
-
private dictionaryProperties;
|
|
161
155
|
/**
|
|
162
156
|
* Initialize the new instance for `image-decoder` class.
|
|
163
157
|
* @private
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { ByteArray } from './byte-array';
|
|
5
5
|
import { PdfStream } from './../../primitives/pdf-stream';
|
|
6
|
-
import { DictionaryProperties } from './../../input-output/pdf-dictionary-properties';
|
|
7
6
|
import { PdfName } from './../../primitives/pdf-name';
|
|
8
7
|
import { PdfNumber } from './../../primitives/pdf-number';
|
|
9
8
|
import { PdfBoolean } from './../../primitives/pdf-boolean';
|
|
@@ -103,12 +102,6 @@ var ImageDecoder = /** @class */ (function () {
|
|
|
103
102
|
* @private
|
|
104
103
|
*/
|
|
105
104
|
this.mbitsPerComponent = 8;
|
|
106
|
-
/**
|
|
107
|
-
* Internal variable for accessing fields from `DictionryProperties` class.
|
|
108
|
-
* @hidden
|
|
109
|
-
* @private
|
|
110
|
-
*/
|
|
111
|
-
this.dictionaryProperties = new DictionaryProperties();
|
|
112
105
|
this.mStream = stream;
|
|
113
106
|
this.initialize();
|
|
114
107
|
}
|
|
@@ -296,14 +289,14 @@ var ImageDecoder = /** @class */ (function () {
|
|
|
296
289
|
}
|
|
297
290
|
this.imageStream.data = [decodedString];
|
|
298
291
|
this.imageStream.compress = false;
|
|
299
|
-
this.imageStream.items.setValue(
|
|
300
|
-
this.imageStream.items.setValue(
|
|
301
|
-
this.imageStream.items.setValue(
|
|
302
|
-
this.imageStream.items.setValue(
|
|
303
|
-
this.imageStream.items.setValue(
|
|
304
|
-
this.imageStream.items.setValue(
|
|
305
|
-
this.imageStream.items.setValue(
|
|
306
|
-
this.imageStream.items.setValue(
|
|
292
|
+
this.imageStream.items.setValue('Type', new PdfName('XObject'));
|
|
293
|
+
this.imageStream.items.setValue('Subtype', new PdfName('Image'));
|
|
294
|
+
this.imageStream.items.setValue('Width', new PdfNumber(this.width));
|
|
295
|
+
this.imageStream.items.setValue('Height', new PdfNumber(this.height));
|
|
296
|
+
this.imageStream.items.setValue('BitsPerComponent', new PdfNumber(this.bitsPerComponent));
|
|
297
|
+
this.imageStream.items.setValue('Filter', new PdfName('DCTDecode'));
|
|
298
|
+
this.imageStream.items.setValue('ColorSpace', new PdfName(this.getColorSpace()));
|
|
299
|
+
this.imageStream.items.setValue('DecodeParms', this.getDecodeParams());
|
|
307
300
|
return this.imageStream;
|
|
308
301
|
}
|
|
309
302
|
else {
|
|
@@ -316,7 +309,7 @@ var ImageDecoder = /** @class */ (function () {
|
|
|
316
309
|
* @private
|
|
317
310
|
*/
|
|
318
311
|
ImageDecoder.prototype.getColorSpace = function () {
|
|
319
|
-
return
|
|
312
|
+
return 'DeviceRGB';
|
|
320
313
|
};
|
|
321
314
|
/**
|
|
322
315
|
* Return `decode parameters` of an image.
|
|
@@ -325,11 +318,11 @@ var ImageDecoder = /** @class */ (function () {
|
|
|
325
318
|
*/
|
|
326
319
|
ImageDecoder.prototype.getDecodeParams = function () {
|
|
327
320
|
var decodeParams = new PdfDictionary();
|
|
328
|
-
decodeParams.items.setValue(
|
|
329
|
-
decodeParams.items.setValue(
|
|
330
|
-
decodeParams.items.setValue(
|
|
331
|
-
decodeParams.items.setValue(
|
|
332
|
-
decodeParams.items.setValue(
|
|
321
|
+
decodeParams.items.setValue('Columns', new PdfNumber(this.width));
|
|
322
|
+
decodeParams.items.setValue('BlackIs1', new PdfBoolean(true));
|
|
323
|
+
decodeParams.items.setValue('K', new PdfNumber(-1));
|
|
324
|
+
decodeParams.items.setValue('Predictor', new PdfNumber(15));
|
|
325
|
+
decodeParams.items.setValue('BitsPerComponent', new PdfNumber(this.bitsPerComponent));
|
|
333
326
|
return decodeParams;
|
|
334
327
|
};
|
|
335
328
|
/**
|
|
@@ -30,12 +30,6 @@ export declare class PdfBitmap extends PdfImage {
|
|
|
30
30
|
* @private
|
|
31
31
|
*/
|
|
32
32
|
private imageStatus;
|
|
33
|
-
/**
|
|
34
|
-
* Internal variable for accessing fields from `DictionryProperties` class.
|
|
35
|
-
* @hidden
|
|
36
|
-
* @private
|
|
37
|
-
*/
|
|
38
|
-
private dictionaryProperties;
|
|
39
33
|
/**
|
|
40
34
|
* `Type` of an image.
|
|
41
35
|
* @hidden
|
|
@@ -16,7 +16,6 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
16
16
|
*/
|
|
17
17
|
import { ImageDecoder } from './../../graphics/images/image-decoder';
|
|
18
18
|
import { ByteArray } from './../../graphics/images/byte-array';
|
|
19
|
-
import { DictionaryProperties } from './../../input-output/pdf-dictionary-properties';
|
|
20
19
|
import { PdfImage } from './pdf-image';
|
|
21
20
|
/**
|
|
22
21
|
* The 'PdfBitmap' contains methods and properties to handle the Bitmap images.
|
|
@@ -71,12 +70,6 @@ var PdfBitmap = /** @class */ (function (_super) {
|
|
|
71
70
|
* @private
|
|
72
71
|
*/
|
|
73
72
|
_this.imageStatus = true;
|
|
74
|
-
/**
|
|
75
|
-
* Internal variable for accessing fields from `DictionryProperties` class.
|
|
76
|
-
* @hidden
|
|
77
|
-
* @private
|
|
78
|
-
*/
|
|
79
|
-
_this.dictionaryProperties = new DictionaryProperties();
|
|
80
73
|
_this.loadImage(encodedString);
|
|
81
74
|
return _this;
|
|
82
75
|
}
|
|
@@ -221,11 +221,6 @@ export declare class PdfGraphics {
|
|
|
221
221
|
* @private
|
|
222
222
|
*/
|
|
223
223
|
private static transparencyObject;
|
|
224
|
-
/**
|
|
225
|
-
* Stores an instance of `DictionaryProperties`.
|
|
226
|
-
* @private
|
|
227
|
-
*/
|
|
228
|
-
private dictionaryProperties;
|
|
229
224
|
/**
|
|
230
225
|
* `last document colorspace`.
|
|
231
226
|
* @hidden
|
|
@@ -17,7 +17,6 @@ import { PdfStringFormat } from './fonts/pdf-string-format';
|
|
|
17
17
|
import { TemporaryDictionary } from './../collections/object-object-pair/dictionary';
|
|
18
18
|
import { PdfTransparency } from './pdf-transparency';
|
|
19
19
|
import { PdfStringLayouter, LineType } from './fonts/string-layouter';
|
|
20
|
-
import { DictionaryProperties } from './../input-output/pdf-dictionary-properties';
|
|
21
20
|
import { StringTokenizer } from './fonts/string-tokenizer';
|
|
22
21
|
import { PdfAutomaticFieldInfoCollection } from './../document/automatic-fields/automatic-field-info-collection';
|
|
23
22
|
import { PdfAutomaticFieldInfo } from './../document/automatic-fields/automatic-field-info';
|
|
@@ -137,11 +136,6 @@ var PdfGraphics = /** @class */ (function () {
|
|
|
137
136
|
* @private
|
|
138
137
|
*/
|
|
139
138
|
this.colorSpaceChanged = false;
|
|
140
|
-
/**
|
|
141
|
-
* Stores an instance of `DictionaryProperties`.
|
|
142
|
-
* @private
|
|
143
|
-
*/
|
|
144
|
-
this.dictionaryProperties = new DictionaryProperties();
|
|
145
139
|
/**
|
|
146
140
|
* Checks whether the x co-ordinate is need to set as client size or not.
|
|
147
141
|
* @hidden
|
|
@@ -111,7 +111,7 @@ var PdfResources = /** @class */ (function (_super) {
|
|
|
111
111
|
if (this.pdfNames == null) {
|
|
112
112
|
this.pdfNames = new TemporaryDictionary();
|
|
113
113
|
}
|
|
114
|
-
var fonts = this.items.getValue(
|
|
114
|
+
var fonts = this.items.getValue('Font');
|
|
115
115
|
if (fonts != null) {
|
|
116
116
|
var reference = fonts;
|
|
117
117
|
var dictionary = fonts;
|
|
@@ -127,10 +127,10 @@ var PdfResources = /** @class */ (function (_super) {
|
|
|
127
127
|
if (procedureSetName == null) {
|
|
128
128
|
throw new Error('ArgumentNullException:procedureSetName');
|
|
129
129
|
}
|
|
130
|
-
var procSets = this.items.getValue(
|
|
130
|
+
var procSets = this.items.getValue('ProcSet');
|
|
131
131
|
if (procSets == null) {
|
|
132
132
|
procSets = new PdfArray();
|
|
133
|
-
this.items.setValue(
|
|
133
|
+
this.items.setValue('ProcSet', procSets);
|
|
134
134
|
}
|
|
135
135
|
var name = new PdfName(procedureSetName);
|
|
136
136
|
if (!procSets.contains(name)) {
|
|
@@ -166,7 +166,7 @@ var PdfResources = /** @class */ (function (_super) {
|
|
|
166
166
|
PdfResources.prototype.add = function (arg1, arg2) {
|
|
167
167
|
if (arg1 instanceof PdfFont) {
|
|
168
168
|
var dictionary = null;
|
|
169
|
-
var fonts = this.items.getValue(
|
|
169
|
+
var fonts = this.items.getValue('Font');
|
|
170
170
|
if (fonts != null) {
|
|
171
171
|
var reference = fonts;
|
|
172
172
|
dictionary = fonts;
|
|
@@ -174,17 +174,17 @@ var PdfResources = /** @class */ (function (_super) {
|
|
|
174
174
|
}
|
|
175
175
|
else {
|
|
176
176
|
dictionary = new PdfDictionary();
|
|
177
|
-
this.items.setValue(
|
|
177
|
+
this.items.setValue('Font', dictionary);
|
|
178
178
|
}
|
|
179
179
|
dictionary.items.setValue(arg2.value, new PdfReferenceHolder(arg1.element));
|
|
180
180
|
}
|
|
181
181
|
else if (arg1 instanceof PdfTemplate) {
|
|
182
182
|
var xobjects = void 0;
|
|
183
|
-
xobjects = this.items.getValue(
|
|
183
|
+
xobjects = this.items.getValue('XObject');
|
|
184
184
|
// Create fonts dictionary.
|
|
185
185
|
if (xobjects == null) {
|
|
186
186
|
xobjects = new PdfDictionary();
|
|
187
|
-
this.items.setValue(
|
|
187
|
+
this.items.setValue('XObject', xobjects);
|
|
188
188
|
}
|
|
189
189
|
xobjects.items.setValue(arg2.value, new PdfReferenceHolder(arg1.element));
|
|
190
190
|
}
|
|
@@ -192,11 +192,11 @@ var PdfResources = /** @class */ (function (_super) {
|
|
|
192
192
|
if (arg1 instanceof PdfGradientBrush || arg1 instanceof PdfTilingBrush) {
|
|
193
193
|
var savable = arg1.element;
|
|
194
194
|
if (savable != null) {
|
|
195
|
-
var pattern = this.items.getValue(
|
|
195
|
+
var pattern = this.items.getValue('Pattern');
|
|
196
196
|
// Create a new pattern dictionary.
|
|
197
197
|
if (pattern == null) {
|
|
198
198
|
pattern = new PdfDictionary();
|
|
199
|
-
this.items.setValue(
|
|
199
|
+
this.items.setValue('Pattern', pattern);
|
|
200
200
|
}
|
|
201
201
|
pattern.items.setValue(arg2.value, new PdfReferenceHolder(savable));
|
|
202
202
|
}
|
|
@@ -205,27 +205,27 @@ var PdfResources = /** @class */ (function (_super) {
|
|
|
205
205
|
else if (arg1 instanceof PdfTransparency) {
|
|
206
206
|
var savable = arg1.element;
|
|
207
207
|
var transDic = null;
|
|
208
|
-
transDic = this.items.getValue(
|
|
208
|
+
transDic = this.items.getValue('ExtGState');
|
|
209
209
|
// Create a new pattern dictionary.
|
|
210
210
|
if (transDic == null) {
|
|
211
211
|
transDic = new PdfDictionary();
|
|
212
|
-
this.items.setValue(
|
|
212
|
+
this.items.setValue('ExtGState', transDic);
|
|
213
213
|
}
|
|
214
214
|
transDic.items.setValue(arg2.value, new PdfReferenceHolder(savable));
|
|
215
215
|
}
|
|
216
216
|
else {
|
|
217
217
|
/* tslint:disable */
|
|
218
|
-
var xobjects = this.Dictionary.items.getValue(
|
|
218
|
+
var xobjects = this.Dictionary.items.getValue('XObject');
|
|
219
219
|
var parentXObjects = void 0;
|
|
220
220
|
if (typeof this.pdfDocument !== 'undefined') {
|
|
221
|
-
parentXObjects = this.pdfDocument.sections.element.items.getValue(
|
|
221
|
+
parentXObjects = this.pdfDocument.sections.element.items.getValue('Resources').items.getValue('XObject');
|
|
222
222
|
}
|
|
223
223
|
var values = this.Dictionary.items.values();
|
|
224
224
|
var hasSameImageStream = false;
|
|
225
225
|
var oldReference = void 0;
|
|
226
226
|
if (typeof this.pdfDocument !== 'undefined' && (typeof parentXObjects === undefined || parentXObjects == null)) {
|
|
227
227
|
parentXObjects = new PdfDictionary();
|
|
228
|
-
this.pdfDocument.sections.element.items.getValue(
|
|
228
|
+
this.pdfDocument.sections.element.items.getValue('Resources').items.setValue('XObject', parentXObjects);
|
|
229
229
|
}
|
|
230
230
|
else if (typeof this.pdfDocument !== 'undefined') {
|
|
231
231
|
var values_1 = parentXObjects.items.values();
|
|
@@ -240,7 +240,7 @@ var PdfResources = /** @class */ (function (_super) {
|
|
|
240
240
|
}
|
|
241
241
|
if (xobjects == null) {
|
|
242
242
|
xobjects = new PdfDictionary();
|
|
243
|
-
this.Dictionary.items.setValue(
|
|
243
|
+
this.Dictionary.items.setValue('XObject', xobjects);
|
|
244
244
|
}
|
|
245
245
|
if (hasSameImageStream && typeof oldReference !== 'undefined') {
|
|
246
246
|
xobjects.items.setValue(arg2.value, oldReference);
|
|
@@ -15,12 +15,6 @@ export declare class PdfTransparency implements IPdfWrapper {
|
|
|
15
15
|
* @private
|
|
16
16
|
*/
|
|
17
17
|
private dictionary;
|
|
18
|
-
/**
|
|
19
|
-
* Internal variable for accessing fields from `DictionryProperties` class.
|
|
20
|
-
* @default new DictionaryProperties()
|
|
21
|
-
* @private
|
|
22
|
-
*/
|
|
23
|
-
private dictionaryProperties;
|
|
24
18
|
/**
|
|
25
19
|
* Initializes a new instance of the `Transparency` class.
|
|
26
20
|
* @private
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PdfDictionary } from './../primitives/pdf-dictionary';
|
|
2
2
|
import { PdfNumber } from './../primitives/pdf-number';
|
|
3
3
|
import { PdfName } from './../primitives/pdf-name';
|
|
4
|
-
import { DictionaryProperties } from './../input-output/pdf-dictionary-properties';
|
|
5
4
|
/**
|
|
6
5
|
* Represents a simple `transparency`.
|
|
7
6
|
* @private
|
|
@@ -13,7 +12,7 @@ var PdfTransparency = /** @class */ (function () {
|
|
|
13
12
|
// * @private
|
|
14
13
|
// */
|
|
15
14
|
// public get stroke() : number {
|
|
16
|
-
// let result : number = this.getNumber(
|
|
15
|
+
// let result : number = this.getNumber('CA');
|
|
17
16
|
// return result;
|
|
18
17
|
// }
|
|
19
18
|
// /**
|
|
@@ -21,7 +20,7 @@ var PdfTransparency = /** @class */ (function () {
|
|
|
21
20
|
// * @private
|
|
22
21
|
// */
|
|
23
22
|
// public get fill() : number {
|
|
24
|
-
// let result : number = this.getNumber(
|
|
23
|
+
// let result : number = this.getNumber('ca');
|
|
25
24
|
// return result;
|
|
26
25
|
// }
|
|
27
26
|
// /**
|
|
@@ -29,7 +28,7 @@ var PdfTransparency = /** @class */ (function () {
|
|
|
29
28
|
// * @private
|
|
30
29
|
// */
|
|
31
30
|
// public get mode() : PdfBlendMode {
|
|
32
|
-
// let result : string = this.getName(
|
|
31
|
+
// let result : string = this.getName('ca');
|
|
33
32
|
// return PdfBlendMode.Normal;
|
|
34
33
|
// }
|
|
35
34
|
// Constructors
|
|
@@ -45,15 +44,9 @@ var PdfTransparency = /** @class */ (function () {
|
|
|
45
44
|
* @private
|
|
46
45
|
*/
|
|
47
46
|
this.dictionary = new PdfDictionary();
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
* @private
|
|
52
|
-
*/
|
|
53
|
-
this.dictionaryProperties = new DictionaryProperties();
|
|
54
|
-
this.dictionary.items.setValue(this.dictionaryProperties.CA, new PdfNumber(stroke));
|
|
55
|
-
this.dictionary.items.setValue(this.dictionaryProperties.ca, new PdfNumber(fill));
|
|
56
|
-
this.dictionary.items.setValue(this.dictionaryProperties.BM, new PdfName(mode.toString()));
|
|
47
|
+
this.dictionary.items.setValue('CA', new PdfNumber(stroke));
|
|
48
|
+
this.dictionary.items.setValue('ca', new PdfNumber(fill));
|
|
49
|
+
this.dictionary.items.setValue('BM', new PdfName(mode.toString()));
|
|
57
50
|
}
|
|
58
51
|
Object.defineProperty(PdfTransparency.prototype, "element", {
|
|
59
52
|
// // Implementation
|
|
@@ -58,12 +58,6 @@ export declare class PdfCrossTable {
|
|
|
58
58
|
* @private
|
|
59
59
|
*/
|
|
60
60
|
private objectCount;
|
|
61
|
-
/**
|
|
62
|
-
* Internal variable for accessing fields from `DictionryProperties` class.
|
|
63
|
-
* @default new PdfDictionaryProperties()
|
|
64
|
-
* @private
|
|
65
|
-
*/
|
|
66
|
-
private dictionaryProperties;
|
|
67
61
|
/**
|
|
68
62
|
* Gets or sets if the document `is merged`.
|
|
69
63
|
* @private
|