From 389abe953bf582e522acdf2c0e7b17b8fab3e18d Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Wed, 14 Oct 2015 13:03:51 +0200 Subject: JS changes to work with mobile Application --- pdf-as-web/src/main/webapp/assets/js/pdf.js/web/app.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'pdf-as-web/src/main/webapp/assets/js/pdf.js/web') diff --git a/pdf-as-web/src/main/webapp/assets/js/pdf.js/web/app.js b/pdf-as-web/src/main/webapp/assets/js/pdf.js/web/app.js index 1af630d6..d21f5d51 100644 --- a/pdf-as-web/src/main/webapp/assets/js/pdf.js/web/app.js +++ b/pdf-as-web/src/main/webapp/assets/js/pdf.js/web/app.js @@ -458,8 +458,6 @@ function makeSignatureDraggable(signature) { // function updateSignaturePosition(signature) { var page = signature.page; - var canvas_height = $("#page" + page.toString()).attr("height"); - var current_scale = PDFViewerApplication.pdfViewer.currentScale; var thisPos = $(signature.sig).position(); var x; var y; @@ -467,9 +465,10 @@ function updateSignaturePosition(signature) { x = thisPos.left; y = thisPos.top; + var pdfPos = PDFViewerApplication.pdfViewer.pages[page-1].viewport.convertToPdfPoint(x, y); - signature.posx = Math.floor(x / current_scale / (4.0/3.0)).toString(); - signature.posy = Math.floor((parseInt(canvas_height) - (y)) / current_scale / (4.0/3.0)).toString(); + signature.posx = pdfPos[0]; + signature.posy = pdfPos[1]; last_left = $("#img_signature").css("left"); -- cgit v1.2.3