1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

implementing transform matrix to getTextContent

This commit is contained in:
Srishti 2013-09-14 23:28:58 +05:30
parent 4f243b39b4
commit 3808d02a53
3 changed files with 137 additions and 0 deletions

View file

@ -36,6 +36,7 @@ var TextLayerBuilder = function textLayerBuilder(options) {
this.pageIdx = options.pageIndex;
this.matches = [];
this.lastScrollSource = options.lastScrollSource;
this.viewport = options.viewport;
this.isViewerInPresentationMode = options.isViewerInPresentationMode;
if(typeof PDFFindController === 'undefined') {
@ -158,6 +159,12 @@ var TextLayerBuilder = function textLayerBuilder(options) {
}
textDiv.textContent = bidiText.str;
// TODO refactor text layer to use text content position
/**
* var arr = this.viewport.convertToViewportPoint(bidiText.x, bidiText.y);
* textDiv.style.left = arr[0] + 'px';
* textDiv.style.top = arr[1] + 'px';
*/
// bidiText.dir may be 'ttb' for vertical texts.
textDiv.dir = bidiText.dir;
}

View file

@ -1912,6 +1912,7 @@ var PageView = function pageView(container, id, scale,
textLayerDiv: textLayerDiv,
pageIndex: this.id - 1,
lastScrollSource: PDFView,
viewport: this.viewport,
isViewerInPresentationMode: PDFView.isPresentationMode
}) : null;