mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
progress
This commit is contained in:
parent
b8dd054c7d
commit
6c5d2ac88b
2 changed files with 20 additions and 1 deletions
|
@ -231,6 +231,21 @@ canvas {
|
|||
-webkit-box-shadow: 0px 2px 10px #ff0;
|
||||
}
|
||||
|
||||
.textLayer {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.textLayer > div {
|
||||
color: transparent;
|
||||
position: absolute;
|
||||
line-height:1.3;
|
||||
}
|
||||
|
||||
#viewer {
|
||||
margin: 44px 0px 0px;
|
||||
padding: 8px 0px;
|
||||
|
|
|
@ -475,6 +475,10 @@ var PageView = function pageView(container, content, id, pageWidth, pageHeight,
|
|||
canvas.mozOpaque = true;
|
||||
div.appendChild(canvas);
|
||||
|
||||
var textDiv = document.createElement('div');
|
||||
textDiv.className = 'textLayer';
|
||||
div.appendChild(textDiv);
|
||||
|
||||
var scale = this.scale;
|
||||
canvas.width = pageWidth * scale;
|
||||
canvas.height = pageHeight * scale;
|
||||
|
@ -487,7 +491,7 @@ var PageView = function pageView(container, content, id, pageWidth, pageHeight,
|
|||
ctx.translate(-this.x * scale, -this.y * scale);
|
||||
|
||||
stats.begin = Date.now();
|
||||
this.content.startRendering(ctx, this.updateStats);
|
||||
this.content.startRendering(ctx, this.updateStats, textDiv, scale);
|
||||
|
||||
setupLinks(this.content, this.scale);
|
||||
div.setAttribute('data-loaded', true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue