Merge pull request #3027 from jimmejardine/master

Improved return type of getTextContent():
This commit is contained in:
Masahiro Wakame
2014-10-27 12:00:33 +09:00

16
pdf/pdf.d.ts vendored
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.
**/