]> git.parisson.com Git - pdf.js.git/commitdiff
convert twips->CSS pixels
authorChris Jones <jones.chris.g@gmail.com>
Tue, 28 Jun 2011 03:18:40 +0000 (20:18 -0700)
committerChris Jones <jones.chris.g@gmail.com>
Tue, 28 Jun 2011 03:18:40 +0000 (20:18 -0700)
test/test_slave.html

index b87af83648372b2e84d41a38ac98ae92bc41eadc..c64c6a390548361bb11f88cf6e58c86f2a38ab4e 100644 (file)
@@ -103,8 +103,10 @@ function nextPage() {
 
   try {
     // using mediaBox for the canvas size
-    canvas.width = currentPage.mediaBox[2];
-    canvas.height = currentPage.mediaBox[3];
+    var wTwips = (currentPage.mediaBox[2] - currentPage.mediaBox[0]);
+    var hTwips = (currentPage.mediaBox[3] - currentPage.mediaBox[1]);
+    canvas.width = wTwips * 96.0 / 72.0;
+    canvas.height = hTwips * 96.0 / 72.0;
     clear(ctx);
   } catch(e) {
     failure = 'page setup: '+ e.toString();