mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-21 15:48:06 +02:00
[api-minor] Add a parameter to PDFPageProxy_getTextContent
that controls whether PartialEvaluator_getTextContent
will attempt to combine same line text items
From the discussion in issue 7445, it seems that there may be cases where an API consumer would want to get the text content as is, without combined text items.
This commit is contained in:
parent
9228a04061
commit
f297e4d17c
8 changed files with 42 additions and 27 deletions
|
@ -503,12 +503,12 @@ var PDFPageView = (function PDFPageViewClosure() {
|
|||
function pdfPageRenderCallback() {
|
||||
pageViewDrawCallback(null);
|
||||
if (textLayer) {
|
||||
self.pdfPage.getTextContent({ normalizeWhitespace: true }).then(
|
||||
function textContentResolved(textContent) {
|
||||
textLayer.setTextContent(textContent);
|
||||
textLayer.render(TEXT_LAYER_RENDER_DELAY);
|
||||
}
|
||||
);
|
||||
self.pdfPage.getTextContent({
|
||||
normalizeWhitespace: true,
|
||||
}).then(function textContentResolved(textContent) {
|
||||
textLayer.setTextContent(textContent);
|
||||
textLayer.render(TEXT_LAYER_RENDER_DELAY);
|
||||
});
|
||||
}
|
||||
},
|
||||
function pdfPageRenderError(error) {
|
||||
|
|
|
@ -784,7 +784,9 @@ var PDFViewer = (function pdfViewer() {
|
|||
|
||||
getPageTextContent: function (pageIndex) {
|
||||
return this.pdfDocument.getPage(pageIndex + 1).then(function (page) {
|
||||
return page.getTextContent({ normalizeWhitespace: true });
|
||||
return page.getTextContent({
|
||||
normalizeWhitespace: true,
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue