Improved return type of getTextContent():

Created TextContent interface
This commit is contained in:
jimmejardine
2014-10-24 17:02:52 +01:00
parent bd9a1922e4
commit ad6ef710f1
+15 -1
View File
@@ -255,7 +255,7 @@ interface PDFPageProxy {
/**
* A promise that is resolved with the string that is the text content frm the page.
**/
getTextContext(): PDFPromise<string>;
getTextContent(): PDFPromise<TextContent>;
/**
* 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.
**/