'use strict';
-PDF.getPdf('helloworld.pdf', function getPdfHelloWorld(data) {
+PDFJS.getPdf('helloworld.pdf', function getPdfHelloWorld(data) {
//
// Instantiate PDFDoc with PDF data
//
- var pdf = new PDF.PDFDoc(data);
+ var pdf = new PDFJS.PDFDoc(data);
var page = pdf.getPage(1);
var scale = 1.5;
var verbosity = WARNINGS;
var useWorker = false;
-// The global PDF object exposes the API
+// The global PDFJS object exposes the API
// In production, it will be declared outside a global wrapper
// In development, it will be declared here
-if (!globalScope.PDF) {
- globalScope.PDF = {};
+if (!globalScope.PDFJS) {
+ globalScope.PDFJS = {};
}
// getPdf()
};
xhr.send(null);
}
-globalScope.PDF.getPdf = getPdf;
+globalScope.PDFJS.getPdf = getPdf;
var Page = (function pagePage() {
function constructor(xref, pageNumber, pageDict, ref) {
return constructor;
})();
-globalScope.PDF.PDFDoc = PDFDoc;
+globalScope.PDFJS.PDFDoc = PDFDoc;
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
-var PDF = {};
+var PDFJS = {};
-(function() {
+(function pdfjsWrapper() {
// Use strict in our context only - users might not want it
'use strict';
getPdf(task.file, function nextTaskGetPdf(data) {
var failure;
try {
- task.pdfDoc = new PDFDoc(data);
+ task.pdfDoc = new PDFJS.PDFDoc(data);
} catch (e) {
failure = 'load PDF doc : ' + e.toString();
}
document.title = this.url = url;
var self = this;
- PDF.getPdf(
+ PDFJS.getPdf(
{
url: url,
progress: function getPdfProgress(evt) {
while (container.hasChildNodes())
container.removeChild(container.lastChild);
- var pdf = new PDF.PDFDoc(data);
+ var pdf = new PDFJS.PDFDoc(data);
var pagesCount = pdf.numPages;
document.getElementById('numPages').innerHTML = pagesCount;
document.getElementById('pageNumber').max = pagesCount;