update pdf.js to 2.1.166
This commit is contained in:
parent
925554b79c
commit
f6a4767d37
File diff suppressed because one or more lines are too long
2
app/src/main/assets/pdf.worker.js
vendored
2
app/src/main/assets/pdf.worker.js
vendored
File diff suppressed because one or more lines are too long
@ -14,7 +14,7 @@ body, canvas {
|
||||
line-height: 1.0;
|
||||
}
|
||||
|
||||
.textLayer > div {
|
||||
.textLayer > span {
|
||||
color: transparent;
|
||||
position: absolute;
|
||||
white-space: pre;
|
||||
|
@ -93,7 +93,7 @@ function renderPage(pageNumber, lazy, prerender, prerenderTrigger=0) {
|
||||
}
|
||||
|
||||
const newCanvas = document.createElement("canvas");
|
||||
const viewport = page.getViewport(newZoomLevel / 100, orientationDegrees)
|
||||
const viewport = page.getViewport({scale: newZoomLevel / 100, rotation: orientationDegrees})
|
||||
const ratio = window.devicePixelRatio;
|
||||
newCanvas.height = viewport.height * ratio;
|
||||
newCanvas.width = viewport.width * ratio;
|
||||
@ -115,7 +115,7 @@ function renderPage(pageNumber, lazy, prerender, prerenderTrigger=0) {
|
||||
viewport: viewport
|
||||
});
|
||||
|
||||
task.then(function() {
|
||||
task.promise.then(function() {
|
||||
task = null;
|
||||
|
||||
let rendered = false;
|
||||
@ -129,7 +129,7 @@ function renderPage(pageNumber, lazy, prerender, prerenderTrigger=0) {
|
||||
render();
|
||||
|
||||
const textLayerFrag = document.createDocumentFragment();
|
||||
task = PDFJS.renderTextLayer({
|
||||
task = pdfjsLib.renderTextLayer({
|
||||
textContentStream: page.streamTextContent(),
|
||||
container: textLayerFrag,
|
||||
viewport: viewport
|
||||
@ -185,7 +185,7 @@ function onRenderPage(lazy) {
|
||||
}
|
||||
}
|
||||
|
||||
PDFJS.getDocument("https://localhost/placeholder.pdf").then(function(newDoc) {
|
||||
pdfjsLib.getDocument("https://localhost/placeholder.pdf").promise.then(function(newDoc) {
|
||||
pdfDoc = newDoc;
|
||||
channel.setNumPages(pdfDoc.numPages);
|
||||
pdfDoc.getMetadata().then(function(data) {
|
||||
|
Loading…
Reference in New Issue
Block a user