aboutsummaryrefslogtreecommitdiff
path: root/point/libs/pdfjs/pdf.js
diff options
context:
space:
mode:
Diffstat (limited to 'point/libs/pdfjs/pdf.js')
-rw-r--r--point/libs/pdfjs/pdf.js8550
1 files changed, 8550 insertions, 0 deletions
<
diff --git a/point/libs/pdfjs/pdf.js b/point/libs/pdfjs/pdf.js
new file mode 100644
index 0000000..929914f
--- /dev/null
+++ b/point/libs/pdfjs/pdf.js
@@ -0,0 +1,8550 @@
1/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
3/* Copyright 2012 Mozilla Foundation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17/*jshint globalstrict: false */
18
19// Initializing PDFJS global object (if still undefined)
20if (typeof PDFJS === 'undefined') {
21 (typeof window !== 'undefined' ? window : this).PDFJS = {};
22}
23
24PDFJS.version = '1.0.68';
25PDFJS.build = 'ead4cbf';
26
27(function pdfjsWrapper() {
28 // Use strict in our context only - users might not want it
29 'use strict';
30
31 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
32 /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
33 /* Copyright 2012 Mozilla Foundation
34 *
35 * Licensed under the Apache License, Version 2.0 (the "License");
36 * you may not use this file except in compliance with the License.
37 * You may obtain a copy of the License at
38 *
39 * http://www.apache.org/licenses/LICENSE-2.0
40 *
41 * Unless required by applicable law or agreed to in writing, software
42 * distributed under the License is distributed on an "AS IS" BASIS,
43 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
44 * See the License for the specific language governing permissions and
45 * limitations under the License.
46 */
47 /* globals Cmd, ColorSpace, Dict, MozBlobBuilder, Name, PDFJS, Ref, URL,
48 Promise */
49
50 'use strict';
51
52 var globalScope = (typeof window === 'undefined') ? this : window;
53
54 var isWorker = (typeof window == 'undefined');
55
56 var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];
57
58 var TextRenderingMode = {
59 FILL: 0,
60 STROKE: 1,
61 FILL_STROKE: 2,
62 INVISIBLE: 3,
63 FILL_ADD_TO_PATH: 4,
64 STROKE_ADD_TO_PATH: 5,
65 FILL_STROKE_ADD_TO_PATH: 6,
66 ADD_TO_PATH: 7,
67 FILL_STROKE_MASK: 3,
68 ADD_TO_PATH_FLAG: 4
69 };
70
71 var ImageKind = {
72 GRAYSCALE_1BPP: 1,
73 RGB_24BPP: 2,
74 RGBA_32BPP: 3
75 };
76
77// The global PDFJS object exposes the API
78// In production, it will be declared outside a global wrapper
79// In development, it will be declared here
80 if (!globalScope.PDFJS) {
81 globalScope.PDFJS = {};
82 }
83
84 globalScope.PDFJS.pdfBug = false;
85
86 PDFJS.VERBOSITY_LEVELS = {
87 errors: 0,
88 warnings: 1,
89 infos: 5
90 };
91
92// All the possible operations for an operator list.
93 var OPS = PDFJS.OPS = {
94 // Intentionally start from 1 so it is easy to spot bad operators that will be
95 // 0's.
96 dependency: 1,
97 setLineWidth: 2,
98 setLineCap: 3,
99 setLineJoin: 4,
100 setMiterLimit: 5,
101 setDash: 6,
102 setRenderingIntent: 7,
103 setFlatness: 8,
104 setGState: 9,
105 save: 10,
106 restore: 11,
107 transform: 12,
108 moveTo: 13,
109 lineTo: 14,
110 curveTo: 15,
111 curveTo2: 16,
112 curveTo3: 17,
113 closePath: 18,
114 rectangle: 19,
115 stroke: 20,
116 closeStroke: 21,
117 fill: 22,
118 eoFill: 23,
119 fillStroke: 24,
120 eoFillStroke: 25,
121 closeFillStroke: 26,
122 closeEOFillStroke: 27,
123 endPath: 28,
124 clip: 29,
125 eoClip: 30,
126 beginText: 31,
127 endText: 32,
128 setCharSpacing: 33,
129 setWordSpacing: 34,
130 setHScale: 35,
131 setLeading: 36,
132 setFont: 37,
133 setTextRenderingMode: 38,
134 setTextRise: 39,
135 moveText: 40,
136 setLeadingMoveText: 41,
137 setTextMatrix: 42,
138 nextLine: 43,
139 showText: 44,
140 showSpacedText: 45,
141 nextLineShowText: 46,
142 nextLineSetSpacingShowText: 47,
143 setCharWidth: 48,
144 setCharWidthAndBounds: 49,
145 setStrokeColorSpace: 50,
146 setFillColorSpace: 51,
147 setStrokeColor: 52,
148 setStrokeColorN: 53,
149 setFillColor: 54,
150 setFillColorN: 55,
151 setStrokeGray: 56,
152 setFillGray: 57,
153 setStrokeRGBColor: 58,
154 setFillRGBColor: 59,
155 setStrokeCMYKColor: 60,
156 setFillCMYKColor: 61,
157 shadingFill: 62,
158 beginInlineImage: 63,
159 beginImageData: 64,
160 endInlineImage: 65,
161 paintXObject: 66,
162 markPoint: 67,
163 markPointProps: 68,
164 beginMarkedContent: 69,
165 beginMarkedContentProps: 70,
166 endMarkedContent: 71,
167 beginCompat: 72,
168 endCompat: 73,
169 paintFormXObjectBegin: 74,
170 paintFormXObjectEnd: 75,
171 beginGroup: 76,
172 endGroup: 77,
173 beginAnnotations: 78,
174 endAnnotations: 79,
175 beginAnnotation: 80,
176 endAnnotation: 81,
177 paintJpegXObject: 82,
178 paintImageMaskXObject: 83,
179 paintImageMaskXObjectGroup: 84,
180 paintImageXObject: 85,
181 paintInlineImageXObject: 86,
182 paintInlineImageXObjectGroup: 87,
183 paintImageXObjectRepeat: 88,
184 paintImageMaskXObjectRepeat: 89,
185 paintSolidColorImageMask: 90
186 };
187
188// A notice for devs. These are good for things that are helpful to devs, such
189// as warning that Workers were disabled, which is important to devs but not
190// end users.
191 function info(msg) {
192 if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.infos) {
193 console.log('Info: ' + msg);
194 }
195 }
196
197// Non-fatal warnings.
198 function warn(msg) {
199 if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.warnings) {
200 console.log('Warning: ' + msg);
201 }
202 }
203
204// Fatal errors that should trigger the fallback UI and halt execution by
205// throwing an exception.
206 function error(msg) {
207 // If multiple arguments were passed, pass them all to the log function.
208 if (arguments.length > 1) {
209 var logArguments = ['Error:'];
210 logArguments.push.apply(logArguments, arguments);
211 console.log.apply(console, logArguments);
212 // Join the arguments into a single string for the lines below.
213 msg = [].join.call(arguments, ' ');
214 } else {
215 console.log('Error: ' + msg);
216 }
217 console.log(backtrace());
218 UnsupportedManager.notify(UNSUPPORTED_FEATURES.unknown);
219 throw new Error(msg);
220 }
221
222 function backtrace() {
223 try {
224 throw new Error();
225 } catch (e) {
226 return e.stack ? e.stack.split('\n').slice(2).join('\n') : '';
227 }
228 }
229
230 function assert(cond, msg) {
231 if (!cond) {
232 error(msg);
233 }
234 }
235
236 var UNSUPPORTED_FEATURES = PDFJS.UNSUPPORTED_FEATURES = {
237 unknown: 'unknown',
238 forms: 'forms',
239 javaScript: 'javaScript',
240 smask: 'smask',
241 shadingPattern: 'shadingPattern',
242 font: 'font'
243 };