@syncfusion/ej2-pdf-data-extract 30.1.42 → 30.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/ej2-pdf-data-extract.umd.min.js +1 -2
  2. package/dist/global/ej2-pdf-data-extract.min.js +1 -2
  3. package/dist/global/index.d.ts +1 -2
  4. package/package.json +14 -46
  5. package/dist/ts/index.d.ts +0 -20
  6. package/dist/ts/index.ts +0 -20
  7. package/dist/ts/pdf-data-extract/core/content-parser-helper.d.ts +0 -62
  8. package/dist/ts/pdf-data-extract/core/content-parser-helper.ts +0 -640
  9. package/dist/ts/pdf-data-extract/core/enum.d.ts +0 -6
  10. package/dist/ts/pdf-data-extract/core/enum.ts +0 -6
  11. package/dist/ts/pdf-data-extract/core/graphic-state.d.ts +0 -33
  12. package/dist/ts/pdf-data-extract/core/graphic-state.ts +0 -106
  13. package/dist/ts/pdf-data-extract/core/pdf-data-extractor.d.ts +0 -210
  14. package/dist/ts/pdf-data-extract/core/pdf-data-extractor.ts +0 -977
  15. package/dist/ts/pdf-data-extract/core/pdf-text-parser.d.ts +0 -67
  16. package/dist/ts/pdf-data-extract/core/pdf-text-parser.ts +0 -495
  17. package/dist/ts/pdf-data-extract/core/redaction/index.d.ts +0 -4
  18. package/dist/ts/pdf-data-extract/core/redaction/index.ts +0 -4
  19. package/dist/ts/pdf-data-extract/core/redaction/pdf-redaction-processor.d.ts +0 -55
  20. package/dist/ts/pdf-data-extract/core/redaction/pdf-redaction-processor.ts +0 -592
  21. package/dist/ts/pdf-data-extract/core/redaction/pdf-redaction-region.d.ts +0 -281
  22. package/dist/ts/pdf-data-extract/core/redaction/pdf-redaction-region.ts +0 -342
  23. package/dist/ts/pdf-data-extract/core/redaction/pdf-redactor.d.ts +0 -129
  24. package/dist/ts/pdf-data-extract/core/redaction/pdf-redactor.ts +0 -322
  25. package/dist/ts/pdf-data-extract/core/redaction/text-glyph-mapper.d.ts +0 -12
  26. package/dist/ts/pdf-data-extract/core/redaction/text-glyph-mapper.ts +0 -153
  27. package/dist/ts/pdf-data-extract/core/text-extraction/binary-cmap-reader.d.ts +0 -24
  28. package/dist/ts/pdf-data-extract/core/text-extraction/binary-cmap-reader.ts +0 -281
  29. package/dist/ts/pdf-data-extract/core/text-extraction/cmap.d.ts +0 -50
  30. package/dist/ts/pdf-data-extract/core/text-extraction/cmap.ts +0 -565
  31. package/dist/ts/pdf-data-extract/core/text-extraction/compact-font-parser.d.ts +0 -191
  32. package/dist/ts/pdf-data-extract/core/text-extraction/compact-font-parser.ts +0 -1928
  33. package/dist/ts/pdf-data-extract/core/text-extraction/encoding-utils.d.ts +0 -102
  34. package/dist/ts/pdf-data-extract/core/text-extraction/encoding-utils.ts +0 -5780
  35. package/dist/ts/pdf-data-extract/core/text-extraction/font-structure.d.ts +0 -167
  36. package/dist/ts/pdf-data-extract/core/text-extraction/font-structure.ts +0 -1842
  37. package/dist/ts/pdf-data-extract/core/text-extraction/font-tables.d.ts +0 -5
  38. package/dist/ts/pdf-data-extract/core/text-extraction/font-tables.ts +0 -16
  39. package/dist/ts/pdf-data-extract/core/text-extraction/font-utils.d.ts +0 -18
  40. package/dist/ts/pdf-data-extract/core/text-extraction/font-utils.ts +0 -630
  41. package/dist/ts/pdf-data-extract/core/text-extraction/glyph.d.ts +0 -93
  42. package/dist/ts/pdf-data-extract/core/text-extraction/glyph.ts +0 -622
  43. package/dist/ts/pdf-data-extract/core/text-extraction/index.d.ts +0 -10
  44. package/dist/ts/pdf-data-extract/core/text-extraction/index.ts +0 -10
  45. package/dist/ts/pdf-data-extract/core/text-extraction/matrix-helper.d.ts +0 -38
  46. package/dist/ts/pdf-data-extract/core/text-extraction/matrix-helper.ts +0 -150
  47. package/dist/ts/pdf-data-extract/core/text-extraction/metrics.d.ts +0 -16
  48. package/dist/ts/pdf-data-extract/core/text-extraction/metrics.ts +0 -2938
  49. package/dist/ts/pdf-data-extract/core/text-structure.d.ts +0 -628
  50. package/dist/ts/pdf-data-extract/core/text-structure.ts +0 -668
  51. package/dist/ts/pdf-data-extract/core/utils.d.ts +0 -99
  52. package/dist/ts/pdf-data-extract/core/utils.ts +0 -626
  53. package/dist/ts/pdf-data-extract/index.d.ts +0 -20
  54. package/dist/ts/pdf-data-extract/index.ts +0 -20
@@ -1,628 +0,0 @@
1
- import { PdfFontStyle } from '@syncfusion/ej2-pdf';
2
- /**
3
- * Represents a single line of extracted text from the PDF page.
4
- * ```typescript
5
- * // Load an existing PDF document
6
- * let document: PdfDocument = new PdfDocument(data);
7
- * // Initialize a new instance of the `PdfDataExtractor` class
8
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
9
- * // Extract `TextLine` from the PDF document.
10
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
11
- * textLines.forEach((textLine: TextLine) => {
12
- * // Gets the bounds of the text line.
13
- * let lineBounds: number[] = textLine.bounds;
14
- * // Gets the single line of extracted text from the PDF page.
15
- * let line: string = textLine.text;
16
- * // Gets the page index of the text line extracted.
17
- * let pageIndex: number = textLine.pageIndex;
18
- * // Gets the collection of text words extracted from a specified page in a PDF document.
19
- * let words: TextWord[] = textLine.words;
20
- * // Gets the name of the font used for a particular line of text.
21
- * let fontName: string = textLine.fontName;
22
- * // Gets the font style used for a particular line of text.
23
- * let fontStyle: PdfFontStyle = textLine.fontStyle;
24
- * // Gets the font size used for a particular line of text.
25
- * let fontSize: number = textLine.fontSize;
26
- * });
27
- * // Save the document
28
- * document.save('output.pdf');
29
- * // Destroy the document
30
- * document.destroy();
31
- * ```
32
- */
33
- export declare class TextLine {
34
- _text: string;
35
- _wordCollection: TextWord[];
36
- _fontName: string;
37
- _fontSize: number;
38
- _fontStyle: PdfFontStyle;
39
- _bounds: number[];
40
- _pageIndex: number;
41
- /**
42
- * Gets the single line of extracted text from the PDF page.
43
- *
44
- * @returns {string} The single line of extracted text from the PDF page.
45
- *
46
- * ```typescript
47
- * // Load an existing PDF document
48
- * let document: PdfDocument = new PdfDocument(data);
49
- * // Initialize a new instance of the `PdfDataExtractor` class
50
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
51
- * // Extract `TextLine` from the PDF document.
52
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
53
- * textLines.forEach((textLine: TextLine) => {
54
- * // Gets the single line of extracted text from the PDF page.
55
- * let line: string = textLine.text;
56
- * });
57
- * // Save the document
58
- * document.save('output.pdf');
59
- * // Destroy the document
60
- * document.destroy();
61
- * ```
62
- */
63
- readonly text: string;
64
- /**
65
- * Gets the collection of text words extracted from a specified page in a PDF document.
66
- *
67
- * @returns {TextWord[]} The collection of text words extracted from a specified page in a PDF document.
68
- *
69
- * ```typescript
70
- * // Load an existing PDF document
71
- * let document: PdfDocument = new PdfDocument(data);
72
- * // Initialize a new instance of the `PdfDataExtractor` class
73
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
74
- * // Extract `TextLine` from the PDF document.
75
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
76
- * textLines.forEach((textLine: TextLine) => {
77
- * // Gets the collection of text words extracted from a specified page in a PDF document.
78
- * let words: TextWord[] = textLine.words;
79
- * });
80
- * // Save the document
81
- * document.save('output.pdf');
82
- * // Destroy the document
83
- * document.destroy();
84
- * ```
85
- */
86
- readonly words: TextWord[];
87
- /**
88
- * Gets the name of the font used for a particular line of text.
89
- *
90
- * @returns {string} The name of the font used for a particular line of text.
91
- *
92
- * ```typescript
93
- * // Load an existing PDF document
94
- * let document: PdfDocument = new PdfDocument(data);
95
- * // Initialize a new instance of the `PdfDataExtractor` class
96
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
97
- * // Extract `TextLine` from the PDF document.
98
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
99
- * textLines.forEach((textLine: TextLine) => {
100
- * // Gets the name of the font used for a particular line of text.
101
- * let fontName: string = textLine.fontName;
102
- * // Save the document
103
- * document.save('output.pdf');
104
- * // Destroy the document
105
- * document.destroy();
106
- * ```
107
- */
108
- readonly fontName: string;
109
- /**
110
- * Gets the font size used for a particular line of text.
111
- *
112
- * @returns {number} The font size used for a particular line of text.
113
- *
114
- * ```typescript
115
- * // Load an existing PDF document
116
- * let document: PdfDocument = new PdfDocument(data);
117
- * // Initialize a new instance of the `PdfDataExtractor` class
118
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
119
- * // Extract `TextLine` from the PDF document.
120
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
121
- * textLines.forEach((textLine: TextLine) => {
122
- * // Gets the font size used for a particular line of text.
123
- * let fontSize: number = textLine.fontSize;
124
- * });
125
- * // Save the document
126
- * document.save('output.pdf');
127
- * // Destroy the document
128
- * document.destroy();
129
- * ```
130
- */
131
- readonly fontSize: number;
132
- /**
133
- * Gets the font style used for a particular line of text.
134
- *
135
- * @returns {PdfFontStyle} The font style used for a particular line of text.
136
- *
137
- * ```typescript
138
- * // Load an existing PDF document
139
- * let document: PdfDocument = new PdfDocument(data);
140
- * // Initialize a new instance of the `PdfDataExtractor` class
141
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
142
- * // Extract `TextLine` from the PDF document.
143
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
144
- * textLines.forEach((textLine: TextLine) => {
145
- * // Gets the font style used for a particular line of text.
146
- * let fontStyle: number = textLine.fontStyle;
147
- * });
148
- * // Save the document
149
- * document.save('output.pdf');
150
- * // Destroy the document
151
- * document.destroy();
152
- * ```
153
- */
154
- readonly fontStyle: PdfFontStyle;
155
- /**
156
- * Gets the bounds of the text line.
157
- *
158
- * @returns {number[]} The bounds of the text line.
159
- *
160
- * ```typescript
161
- * // Load an existing PDF document
162
- * let document: PdfDocument = new PdfDocument(data);
163
- * // Initialize a new instance of the `PdfDataExtractor` class
164
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
165
- * // Extract `TextLine` from the PDF document.
166
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
167
- * textLines.forEach((textLine: TextLine) => {
168
- * // Gets the bounds of the text line.
169
- * let lineBounds: number[] = textLine.bounds;
170
- * });
171
- * // Save the document
172
- * document.save('output.pdf');
173
- * // Destroy the document
174
- * document.destroy();
175
- * ```
176
- */
177
- readonly bounds: number[];
178
- /**
179
- * Gets the page index of the text line extracted.
180
- *
181
- * @returns {number} Gets the page index of the text line extracted.
182
- *
183
- * ```typescript
184
- * // Load an existing PDF document
185
- * let document: PdfDocument = new PdfDocument(data);
186
- * // Initialize a new instance of the `PdfDataExtractor` class
187
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
188
- * // Extract `TextLine` from the PDF document.
189
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
190
- * textLines.forEach((textLine: TextLine) => {
191
- * // Gets the page index of the text line extracted.
192
- * let pageIndex: number = textLine.pageIndex;
193
- * });
194
- * // Save the document
195
- * document.save('output.pdf');
196
- * // Destroy the document
197
- * document.destroy();
198
- * ```
199
- */
200
- readonly pageIndex: number;
201
- }
202
- /**
203
- * Represents a single word of extracted text from the PDF page.
204
- * ```typescript
205
- * // Load an existing PDF document
206
- * let document: PdfDocument = new PdfDocument(data);
207
- * // Initialize a new instance of the `PdfDataExtractor` class
208
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
209
- * // Extract `TextLine` from the PDF document.
210
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
211
- * textLines.forEach((textLine: TextLine) => {
212
- * textLine.words.forEach((textWord: TextWord) => {
213
- * // Gets the bounds of the text word.
214
- * let wordBounds: number[] = textWord.bounds;
215
- * // Gets the single word of extracted text from the PDF page.
216
- * let word: string = textWord.text;
217
- * // Gets the collection of text glyphs extracted from a specified page in a PDF document.
218
- * let glyphs: TextGlyph[] = textword.glyphs;
219
- * // Gets the name of the font used for a particular word.
220
- * let wordFontName: string = textword.fontName;
221
- * // Gets the style of the font used for a particular word.
222
- * let wordFontStyle: PdfFontStyle = textword.fontStyle;
223
- * // Gets the size of the font used for a particular word.
224
- * let wordFontSize: number = textword.fontSize;
225
- * });
226
- * });
227
- * // Save the document
228
- * document.save('output.pdf');
229
- * // Destroy the document
230
- * document.destroy();
231
- * ```
232
- */
233
- export declare class TextWord {
234
- _text: string;
235
- _bounds: number[];
236
- _glyphs: TextGlyph[];
237
- _fontName: string;
238
- _fontSize: number;
239
- _fontStyle: PdfFontStyle;
240
- _words: string;
241
- /**
242
- * Gets the single word of extracted text from the PDF page.
243
- *
244
- * @returns {string} The single word of extracted text from the PDF page.
245
- *
246
- * ```typescript
247
- * // Load an existing PDF document
248
- * let document: PdfDocument = new PdfDocument(data);
249
- * // Initialize a new instance of the `PdfDataExtractor` class
250
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
251
- * // Extract `TextLine` from the PDF document.
252
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
253
- * textLines.forEach((textLine: TextLine) => {
254
- * textLine.words.forEach((textWord: TextWord) => {
255
- * // Gets the single word of extracted text from the PDF page.
256
- * let word: string = textWord.text;
257
- * });
258
- * });
259
- * // Save the document
260
- * document.save('output.pdf');
261
- * // Destroy the document
262
- * document.destroy();
263
- * ```
264
- */
265
- readonly text: string;
266
- /**
267
- * Gets the collection of text glyphs extracted from a specified page in a PDF document.
268
- *
269
- * @returns {TextGlyph[]} The collection of text glyphs extracted from a specified page in a PDF document.
270
- *
271
- * ```typescript
272
- * // Load an existing PDF document
273
- * let document: PdfDocument = new PdfDocument(data);
274
- * // Initialize a new instance of the `PdfDataExtractor` class
275
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
276
- * // Extract `TextLine` from the PDF document.
277
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
278
- * textLines.forEach((textLine: TextLine) => {
279
- * textLine.words.forEach((textWord: TextWord) => {
280
- * // Gets the collection of text glyphs extracted from a specified page in a PDF document.
281
- * let glyphs: TextGlyph[] = textword.glyphs;
282
- * });
283
- * });
284
- * // Save the document
285
- * document.save('output.pdf');
286
- * // Destroy the document
287
- * document.destroy();
288
- * ```
289
- */
290
- readonly glyphs: TextGlyph[];
291
- /**
292
- * Gets the name of the font used for a particular word.
293
- *
294
- * @returns {string} The name of the font used for a particular word.
295
- *
296
- * ```typescript
297
- * // Load an existing PDF document
298
- * let document: PdfDocument = new PdfDocument(data);
299
- * // Initialize a new instance of the `PdfDataExtractor` class
300
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
301
- * // Extract `TextLine` from the PDF document.
302
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
303
- * textLines.forEach((textLine: TextLine) => {
304
- * textLine.words.forEach((textWord: TextWord) => {
305
- * // Gets the name of the font used for a particular word.
306
- * let wordFontName: string = textword.fontName;
307
- * });
308
- * });
309
- * // Save the document
310
- * document.save('output.pdf');
311
- * // Destroy the document
312
- * document.destroy();
313
- * ```
314
- */
315
- readonly fontName: string;
316
- /**
317
- * Gets the size of the font used for a particular word.
318
- *
319
- * @returns {number} The size of the font used for a particular word.
320
- *
321
- * ```typescript
322
- * // Load an existing PDF document
323
- * let document: PdfDocument = new PdfDocument(data);
324
- * // Initialize a new instance of the `PdfDataExtractor` class
325
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
326
- * // Extract `TextLine` from the PDF document.
327
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
328
- * textLines.forEach((textLine: TextLine) => {
329
- * textLine.words.forEach((textWord: TextWord) => {
330
- * // Gets the size of the font used for a particular word.
331
- * let wordFontSize: number = textword.fontSize;
332
- * });
333
- * });
334
- * // Save the document
335
- * document.save('output.pdf');
336
- * // Destroy the document
337
- * document.destroy();
338
- * ```
339
- */
340
- readonly fontSize: number;
341
- /**
342
- * Gets the style of the font used for a particular word.
343
- *
344
- * @returns {PdfFontStyle} The style of the font used for a particular word.
345
- *
346
- * ```typescript
347
- * // Load an existing PDF document
348
- * let document: PdfDocument = new PdfDocument(data);
349
- * // Initialize a new instance of the `PdfDataExtractor` class
350
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
351
- * // Extract `TextLine` from the PDF document.
352
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
353
- * textLines.forEach((textLine: TextLine) => {
354
- * textLine.words.forEach((textWord: TextWord) => {
355
- * // Gets the style of the font used for a particular word.
356
- * let wordFontStyle: PdfFontStyle = textword.fontStyle;
357
- * });
358
- * });
359
- * // Save the document
360
- * document.save('output.pdf');
361
- * // Destroy the document
362
- * document.destroy();
363
- * ```
364
- */
365
- readonly fontStyle: PdfFontStyle;
366
- /**
367
- * Gets the bounds of the text word.
368
- *
369
- * @returns {number[]} The bounds of the text word.
370
- *
371
- * ```typescript
372
- * // Load an existing PDF document
373
- * let document: PdfDocument = new PdfDocument(data);
374
- * // Initialize a new instance of the `PdfDataExtractor` class
375
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
376
- * // Extract `TextLine` from the PDF document.
377
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
378
- * textLines.forEach((textLine: TextLine) => {
379
- * textLine.words.forEach((textWord: TextWord) => {
380
- * // Gets the bounds of the text word.
381
- * let wordBounds: number[] = textWord.bounds;
382
- * });
383
- * });
384
- * // Save the document
385
- * document.save('output.pdf');
386
- * // Destroy the document
387
- * document.destroy();
388
- * ```
389
- */
390
- readonly bounds: number[];
391
- }
392
- /**
393
- * Represents a single glyph of extracted text from the PDF page.
394
- * ```typescript
395
- * // Load an existing PDF document
396
- * let document: PdfDocument = new PdfDocument(data);
397
- * // Initialize a new instance of the `PdfDataExtractor` class
398
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
399
- * // Extract `TextLine` from the PDF document.
400
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
401
- * textLines.forEach((textLine: TextLine) => {
402
- * textLine.words.forEach((textWord: TextWord) => {
403
- * textWord.glyphs.forEach((textGlyph: TextGlyph) => {
404
- * // Gets the bounds of the text glyph
405
- * let glyphBounds: number[] = textGlyph.bounds;
406
- * // Gets the single character of extracted text from the PDF page.
407
- * let character: string = textGlyph.text;
408
- * // Gets the font size used for a particular character of the text.
409
- * let fontSize: number = textGlyph.fontSize;
410
- * // Gets the name of the font used for a particular character of the text.
411
- * let fontName: string = textGlyph.fontName;
412
- * // Gets the font style used for a particular character of the text.
413
- * let fontStyle: PdfFontStyle = textGlyph.fontStyle;
414
- * // Gets the text color of the text glyph.
415
- * let color: number[] = textGlyph.color;
416
- * // Gets the value indicating whether the glyph is rotated or not.
417
- * let isRotated: boolean = textGlyph.isRotated;
418
- * });
419
- * });
420
- * });
421
- * // Save the document
422
- * document.save('output.pdf');
423
- * // Destroy the document
424
- * document.destroy();
425
- * ```
426
- */
427
- export declare class TextGlyph {
428
- _text: string;
429
- _width: number;
430
- _fontName: string;
431
- _isHex: boolean;
432
- _charSpacing: number;
433
- _wordSpacing: number;
434
- _fontSize: number;
435
- _isReplace: boolean;
436
- _fontStyle: PdfFontStyle;
437
- _bounds: number[];
438
- _color: number[];
439
- _isRotated: boolean;
440
- /**
441
- * Gets the single character of extracted text from the PDF page.
442
- *
443
- * @returns {string} The single character of extracted text from the PDF page.
444
- *
445
- * ```typescript
446
- * // Load an existing PDF document
447
- * let document: PdfDocument = new PdfDocument(data);
448
- * // Initialize a new instance of the `PdfDataExtractor` class
449
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
450
- * // Extract `TextLine` from the PDF document.
451
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
452
- * textLines.forEach((textLine: TextLine) => {
453
- * textLine.words.forEach((textWord: TextWord) => {
454
- * textWord.glyphs.forEach((textGlyph: TextGlyph) => {
455
- * // Gets the single character of extracted text from the PDF page.
456
- * let character: string = textGlyph.text;
457
- * });
458
- * });
459
- * });
460
- * // Save the document
461
- * document.save('output.pdf');
462
- * // Destroy the document
463
- * document.destroy();
464
- * ```
465
- */
466
- readonly text: string;
467
- /**
468
- * Gets the name of the font used for a particular character of the text.
469
- *
470
- * @returns {string} The name of the font used for a particular character of the text.
471
- *
472
- * ```typescript
473
- * // Load an existing PDF document
474
- * let document: PdfDocument = new PdfDocument(data);
475
- * // Initialize a new instance of the `PdfDataExtractor` class
476
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
477
- * // Extract `TextLine` from the PDF document.
478
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
479
- * textLines.forEach((textLine: TextLine) => {
480
- * textLine.words.forEach((textWord: TextWord) => {
481
- * textWord.glyphs.forEach((textGlyph: TextGlyph) => {
482
- * // Gets the name of the font used for a particular character of the text.
483
- * let fontName: string = textGlyph.fontName;
484
- * });
485
- * });
486
- * });
487
- * // Save the document
488
- * document.save('output.pdf');
489
- * // Destroy the document
490
- * document.destroy();
491
- * ```
492
- */
493
- readonly fontName: string;
494
- /**
495
- * Gets the font size used for a particular character of the text.
496
- *
497
- * @returns {number} The font size used for a particular character of the text.
498
- *
499
- * ```typescript
500
- * // Load an existing PDF document
501
- * let document: PdfDocument = new PdfDocument(data);
502
- * // Initialize a new instance of the `PdfDataExtractor` class
503
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
504
- * // Extract `TextLine` from the PDF document.
505
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
506
- * textLines.forEach((textLine: TextLine) => {
507
- * textLine.words.forEach((textWord: TextWord) => {
508
- * textWord.glyphs.forEach((textGlyph: TextGlyph) => {
509
- * // Gets the font size used for a particular character of the text.
510
- * let fontSize: number = textGlyph.fontSize;
511
- * });
512
- * });
513
- * });
514
- * // Save the document
515
- * document.save('output.pdf');
516
- * // Destroy the document
517
- * document.destroy();
518
- * ```
519
- */
520
- readonly fontSize: number;
521
- /**
522
- * Gets the font style used for a particular character of the text.
523
- *
524
- * @returns {PdfFontStyle} The font style used for a particular character of the text.
525
- *
526
- * ```typescript
527
- * // Load an existing PDF document
528
- * let document: PdfDocument = new PdfDocument(data);
529
- * // Initialize a new instance of the `PdfDataExtractor` class
530
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
531
- * // Extract `TextLine` from the PDF document.
532
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
533
- * textLines.forEach((textLine: TextLine) => {
534
- * textLine.words.forEach((textWord: TextWord) => {
535
- * // Gets the font style used for a particular character of the text.
536
- * let fontStyle: PdfFontStyle = textGlyph.fontStyle;
537
- * });
538
- * });
539
- * });
540
- * // Save the document
541
- * document.save('output.pdf');
542
- * // Destroy the document
543
- * document.destroy();
544
- * ```
545
- */
546
- readonly fontStyle: PdfFontStyle;
547
- /**
548
- * Gets the bounds of the text glyph.
549
- *
550
- * @returns {string} The bounds of the text glyph.
551
- *
552
- * ```typescript
553
- * // Load an existing PDF document
554
- * let document: PdfDocument = new PdfDocument(data);
555
- * // Initialize a new instance of the `PdfDataExtractor` class
556
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
557
- * // Extract `TextLine` from the PDF document.
558
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
559
- * textLines.forEach((textLine: TextLine) => {
560
- * textLine.words.forEach((textWord: TextWord) => {
561
- * textWord.glyphs.forEach((textGlyph: TextGlyph) => {
562
- * // Gets the bounds of the text glyph
563
- * let glyphBounds: number[] = textGlyph.bounds;
564
- * });
565
- * });
566
- * });
567
- * // Save the document
568
- * document.save('output.pdf');
569
- * // Destroy the document
570
- * document.destroy();
571
- * ```
572
- */
573
- readonly bounds: number[];
574
- /**
575
- * Gets the color of the text glyph.
576
- *
577
- * @returns {number[]} Text color as an array of numbers.
578
- *
579
- * ```typescript
580
- * // Load an existing PDF document
581
- * let document: PdfDocument = new PdfDocument(data);
582
- * // Initialize a new instance of the `PdfDataExtractor` class
583
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
584
- * // Extract `TextLine` from the PDF document.
585
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
586
- * textLines.forEach((textLine: TextLine) => {
587
- * textLine.words.forEach((textWord: TextWord) => {
588
- * textWord.glyphs.forEach((textGlyph: TextGlyph) => {
589
- * // Gets the text color of the text glyph.
590
- * let color: number[] = textGlyph.color;
591
- * });
592
- * });
593
- * });
594
- * // Save the document
595
- * document.save('output.pdf');
596
- * // Destroy the document
597
- * document.destroy();
598
- * ```
599
- */
600
- readonly color: number[];
601
- /**
602
- * Gets the value indicating whether the glyph is rotated or not.
603
- *
604
- * @returns {boolean} The rotated value of text glyph.
605
- *
606
- * ```typescript
607
- * // Load an existing PDF document
608
- * let document: PdfDocument = new PdfDocument(data);
609
- * // Initialize a new instance of the `PdfDataExtractor` class
610
- * let extractor: PdfDataExtractor = new PdfDataExtractor(document);
611
- * // Extract `TextLine` from the PDF document.
612
- * let textLines: Array<TextLine> = extractor.extractTextLines({ startPageIndex: 0, endPageIndex: document.pageCount-1});
613
- * textLines.forEach((textLine: TextLine) => {
614
- * textLine.words.forEach((textWord: TextWord) => {
615
- * textWord.glyphs.forEach((textGlyph: TextGlyph) => {
616
- * // Gets the value indicating whether the glyph is rotated or not.
617
- * let isRotated: boolean = textGlyph.isRotated;
618
- * });
619
- * });
620
- * });
621
- * // Save the document
622
- * document.save('output.pdf');
623
- * // Destroy the document
624
- * document.destroy();
625
- * ```
626
- */
627
- readonly isRotated: boolean;
628
- }