From ad6ef710f19e428019c90542b858d96b4ec212ec Mon Sep 17 00:00:00 2001 From: jimmejardine Date: Fri, 24 Oct 2014 17:02:52 +0100 Subject: [PATCH] Improved return type of getTextContent(): Created TextContent interface --- pdf/pdf.d.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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. **/