diff --git a/pdf/pdf.d.ts b/pdf/pdf.d.ts index 94733c3e3..8496a6c40 100644 --- a/pdf/pdf.d.ts +++ b/pdf/pdf.d.ts @@ -255,7 +255,7 @@ interface PDFPageProxy { /** * A promise that is resolved with the string that is the text content frm the page. **/ - getTextContext(): PDFPromise; + getTextContent(): PDFPromise; /** * marked as future feature @@ -268,6 +268,20 @@ interface PDFPageProxy { destroy(): void; } +interface TextContentItem { + str: string; + transform: number[]; // [0..5] 4=x, 5=y + width: number; + height: number; + dir: string; // Left-to-right (ltr), etc + fontName: string; // A lookup into the styles map of the owning TextContent +} + +interface TextContent { + items: TextContentItem[]; + styles: any; +} + /** * A PDF document and page is built of many objects. E.g. there are objects for fonts, images, rendering code and such. These objects might get processed inside of a worker. The `PDFObjects` implements some basic functions to manage these objects. **/