]> git.parisson.com Git - pdf.js.git/commitdiff
progress
authorArtur Adib <arturadib@gmail.com>
Fri, 28 Oct 2011 16:16:17 +0000 (12:16 -0400)
committerArtur Adib <arturadib@gmail.com>
Fri, 28 Oct 2011 16:16:17 +0000 (12:16 -0400)
web/viewer.css
web/viewer.js

index 27ad0638a59ef0d7bc109a643248fe0914eb5f26..52852d591fe41a56511d2ddd421d74c6f9f02489 100644 (file)
@@ -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;
index 1ab2c555c60a2c65b83d9fba31682e7704cbc0d9..63215a6d8830cc67f624cbc2a2e4470e62248b9e 100644 (file)
@@ -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);