# Create production output (pdf.js, and corresponding changes to web files)
#
production: | bundle
- @echo "Preparing production viewer..."; \
+ @echo "Preparing viewer-production.html..."; \
cd web; \
sed '/PDFJSSCRIPT_REMOVE/d' viewer.html > viewer-1.tmp; \
sed '/PDFJSSCRIPT_INCLUDE_BUILD/ r viewer-snippet.html' viewer-1.tmp > viewer-production.html; \
// <canvas> contexts store most of the state we need natively.
// However, PDF needs a bit more state, which we store here.
+
+'use strict';
+
var CanvasExtraState = (function canvasExtraState() {
function constructor(old) {
// Are soft masks and alpha values shapes or opacities?
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
+'use strict';
+
var ISOAdobeCharset = [
'.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar',
'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright',
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
+'use strict';
+
var CIDToUnicodeMaps = {
'Adobe-Japan1': [[32, 160], {f: 12, c: 33}, [45, 8209], {f: 46, c: 46}, 165,
{f: 2, c: 93}, [95, 818], [96, 768], {f: 27, c: 97}, 166, 125, [732, 771],
+/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
+
+'use strict';
+
var ColorSpace = (function colorSpaceColorSpace() {
// Constructor should define this.numComps, this.defaultColor, this.name
function constructor() {
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
+'use strict';
+
+var globalScope = (typeof window === 'undefined') ? this : window;
+
var ERRORS = 0, WARNINGS = 1, TODOS = 5;
var verbosity = WARNINGS;
-
var useWorker = false;
// The global PDF object exposes the API
// In production, it will be declared outside a global wrapper
// In development, it will be declared here
-if (typeof PDF === 'undefined') {
- PDF = {};
+if (!globalScope.PDF) {
+ globalScope.PDF = {};
}
// getPdf()
};
xhr.send(null);
}
-PDF.getPdf = getPdf;
+globalScope.PDF.getPdf = getPdf;
var Page = (function pagePage() {
function constructor(xref, pageNumber, pageDict, ref) {
return constructor;
})();
-PDF.PDFDoc = PDFDoc;
+globalScope.PDF.PDFDoc = PDFDoc;
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
+'use strict';
+
var ARCFourCipher = (function arcFourCipher() {
function constructor(key) {
this.a = 0;
+/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
+
+'use strict';
+
var PartialEvaluator = (function partialEvaluator() {
function constructor(xref, handler, uniquePrefix) {
this.state = new EvalState();
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
+'use strict';
+
var isWorker = (typeof window == 'undefined');
/**
+/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
+
+'use strict';
+
var PDFFunction = (function() {
var CONSTRUCT_SAMPLED = 0;
var CONSTRUCT_INTERPOLATED = 2;
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
+'use strict';
+
var GlyphsUnicode = {
A: 0x0041,
AE: 0x00C6,
+/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
+
+'use strict';
+
var PDFImage = (function pdfImage() {
function constructor(xref, res, image, inline) {
this.image = image;
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
+'use strict';
+
var Metrics = {
'Courier': 600,
'Courier-Bold': 600,
+/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
+
+'use strict';
+
var Name = (function nameName() {
function constructor(name) {
this.name = name;
+/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
+
+'use strict';
+
var EOF = {};
function isEOF(v) {
+/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
+
+'use strict';
+
var Pattern = (function patternPattern() {
// Constructor should define this.getPattern
function constructor() {
+/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
+
+'use strict';
+
var Stream = (function streamStream() {
function constructor(arrayBuffer, start, length, dict) {
this.bytes = new Uint8Array(arrayBuffer);
+/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
+
+'use strict';
+
function log(msg) {
if (console && console.log)
console.log(msg);
-/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /
+/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
+'use strict';
+
function MessageHandler(name, comObj) {
this.name = name;
this.comObj = comObj;
// Worker thread?
if (typeof window === 'undefined') {
- console = workerConsole;
+ globalScope.console = workerConsole;
// Listen for messages from the main thread.
- var handler = new MessageHandler('worker_processor', this);
+ var handler = new MessageHandler('worker_processor', globalScope);
WorkerProcessorHandler.setup(handler);
}
+/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
+
+'use strict';
+
importScripts('../src/core.js');
importScripts('../src/util.js');
importScripts('../src/canvas.js');