diff --git a/app/pub/scripts/anviewer.js b/app/pub/scripts/anviewer.js index 7ea9bac..373fa13 100644 --- a/app/pub/scripts/anviewer.js +++ b/app/pub/scripts/anviewer.js @@ -16,6 +16,7 @@ function renderPage() { var context = canvas.getContext('2d'); //var viewport = page.getViewport({scale: scale}); var viewport = page.getViewport({scale: 1.5}); + // var viewport = page.getViewport(canvas.width / page.getViewport(0.5).width) canvas.height = viewport.height; @@ -37,7 +38,7 @@ function renderPage() { pageNumPending = null; } - document.getElementById('zoompdf').innerHTML = scale + 'x'; + // document.getElementById('zoompdf').innerHTML = scale + 'x'; el_title.innerHTML = 'Приятного чтения ↓'; }); }); @@ -83,12 +84,16 @@ function resize_plus(){ var div = document.getElementById("the-canvas"); cnt += 4; div.style.width = cnt+"%"; + setzoom(cnt); } function resize_minus(){ var div = document.getElementById("the-canvas"); cnt -= 4; div.style.width = cnt+"%"; + setzoom(cnt); } + + function getzoom(){ var name = 'pdfscale'; @@ -120,11 +125,13 @@ function setzoom( cvalue, exdays = 30 ) { function startpdfviewer(){ - + var div = document.getElementById("the-canvas"); + czoom = getzoom(); if (czoom != null) - scale = czoom; + div.style.width = czoom+"%"; + pdfjsLib.getDocument(url).promise.then(function(pdfDoc_) { diff --git a/app/views/layout.phtml b/app/views/layout.phtml index b39ee94..52a2fbe 100644 --- a/app/views/layout.phtml +++ b/app/views/layout.phtml @@ -2,7 +2,7 @@ Еженедельник Аргументы Недели - <?=$title?> - +