01944fc6 by Jeff Balicki

pdf.js working ie 10

1 parent 28355607
//var pluginUrl = window.location.protocol + '//' + window.location.host + '/commonwell';
//var pdf_customizer = "http://localhost:8888/pdf-customizer/public";
var pluginUrl = window.location.protocol + '//' + window.location.host + '/commonwell';
var pdf_customizer = "http://localhost:8888/pdf-customizer/public";
var pluginUrl = window.location.protocol + '//' + window.location.host;
var pdf_customizer = "https://pdf-customizer.synapsus.co";
//var pluginUrl = window.location.protocol + '//' + window.location.host;
//var pdf_customizer = "https://pdf-customizer.synapsus.co";
var imageHeight = "";
......@@ -740,7 +740,7 @@ function finalPdf(data, json) {
var strVar2 = ""
strVar2 += '<div id="seepdf" style=" width:' + imageWidth + 'px; height: ' + imageHeight + 'px; overflow: hidden;" > <div id="page"><canvas id="the-canvas"></canvas></page></div>';
strVar2 += '<div id="seepdf" style=" width:' + imageWidth + 'px; height: ' + imageHeight + 'px; overflow: hidden;" > <canvas id="the-canvas" width="' + imageWidth + '" height="' + imageHeight + '"></canvas></div>';
document.getElementById('pdfPreviewInner').innerHTML = strVar2;
......@@ -761,10 +761,12 @@ PDFJS.getDocument(pfd_url)
})
.then(function(page) {
// Set scale (zoom) level
var scale = 1.35;
var scale = 1;
// Get viewport (dimensions)
var viewport = page.getViewport(scale);
//var viewport = page.getViewport(scale);
// Get canvas#the-canvas
var canvas = document.getElementById('the-canvas');
......@@ -773,9 +775,10 @@ PDFJS.getDocument(pfd_url)
var context = canvas.getContext('2d');
// Set dimensions to Canvas
canvas.height = viewport.height;
canvas.width = viewport.width;
canvas.height = imageHeight;
canvas.width = imageWidth;
var viewport = page.getViewport(canvas.width / page.getViewport(1.0).width);
// Prepare object needed by render method
var renderContext = {
canvasContext: context,
......