From dd7ba18d3a134f2becc2ad53f9b3d2191798e686 Mon Sep 17 00:00:00 2001 From: Thomas Felber Date: Mon, 11 May 2015 00:54:45 -0700 Subject: switched to jspdf with pdf.js, added movable signatureblock prototype, updated js in order to make pdf.js work --- pdf-as-web/src/main/webapp/assets/js/pdf.js/web/viewer.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'pdf-as-web/src/main/webapp/assets/js/pdf.js/web/viewer.js') diff --git a/pdf-as-web/src/main/webapp/assets/js/pdf.js/web/viewer.js b/pdf-as-web/src/main/webapp/assets/js/pdf.js/web/viewer.js index 34c44e46..9801be2f 100644 --- a/pdf-as-web/src/main/webapp/assets/js/pdf.js/web/viewer.js +++ b/pdf-as-web/src/main/webapp/assets/js/pdf.js/web/viewer.js @@ -27,7 +27,7 @@ 'use strict'; -var DEFAULT_URL = 'compressed.tracemonkey-pldi-09.pdf'; +var DEFAULT_URL = ''; var DEFAULT_SCALE_DELTA = 1.1; var MIN_SCALE = 0.25; var MAX_SCALE = 10.0; @@ -5843,7 +5843,7 @@ var PDFViewerApplication = { function getDocumentCallback(pdfDocument) { self.load(pdfDocument, scale); self.loading = false; - }, + }, function getDocumentError(exception) { var message = exception && exception.message; var loadingErrorMessage = mozL10n.get('loading_error', null, @@ -6666,14 +6666,18 @@ window.PDFView = PDFViewerApplication; // obsolete name, using it as an alias function webViewerLoad(evt) { - PDFViewerApplication.initialize().then(webViewerInitialized); + //PDFViewerApplication.initialize().then(webViewerInitialized); + PDFViewerApplication.initialize().then(function() { + webViewerInitialized(); + window.parent.postMessage("asdf yooooooo","*"); + }); } function webViewerInitialized() { var queryString = document.location.search.substring(1); var params = PDFViewerApplication.parseQueryString(queryString); var file = 'file' in params ? params.file : DEFAULT_URL; - + var fileInput = document.createElement('input'); fileInput.id = 'fileInput'; fileInput.className = 'fileInput'; @@ -7005,6 +7009,7 @@ window.addEventListener('change', function webViewerChange(evt) { if (!files || files.length === 0) { return; } + var file = files[0]; if (!PDFJS.disableCreateObjectURL && -- cgit v1.2.3