From 4f270cfbaaf46fb728f9ef6c901b0f7913056dc6 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 2 Mar 2017 09:32:42 +0000 Subject: [PATCH 1/3] delete pdfjs-1.3.91 --- .../js/libs/pdfjs-1.3.91/compatibility.js | 593 - .../web/public/js/libs/pdfjs-1.3.91/pdf.js | 9534 ---- .../public/js/libs/pdfjs-1.3.91/pdf.worker.js | 40692 ---------------- 3 files changed, 50819 deletions(-) delete mode 100644 services/web/public/js/libs/pdfjs-1.3.91/compatibility.js delete mode 100644 services/web/public/js/libs/pdfjs-1.3.91/pdf.js delete mode 100644 services/web/public/js/libs/pdfjs-1.3.91/pdf.worker.js diff --git a/services/web/public/js/libs/pdfjs-1.3.91/compatibility.js b/services/web/public/js/libs/pdfjs-1.3.91/compatibility.js deleted file mode 100644 index 1119a2742a..0000000000 --- a/services/web/public/js/libs/pdfjs-1.3.91/compatibility.js +++ /dev/null @@ -1,593 +0,0 @@ -/* Copyright 2012 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* globals VBArray, PDFJS */ - -'use strict'; - -// Initializing PDFJS global object here, it case if we need to change/disable -// some PDF.js features, e.g. range requests -if (typeof PDFJS === 'undefined') { - (typeof window !== 'undefined' ? window : this).PDFJS = {}; -} - -// Checking if the typed arrays are supported -// Support: iOS<6.0 (subarray), IE<10, Android<4.0 -(function checkTypedArrayCompatibility() { - if (typeof Uint8Array !== 'undefined') { - // Support: iOS<6.0 - if (typeof Uint8Array.prototype.subarray === 'undefined') { - Uint8Array.prototype.subarray = function subarray(start, end) { - return new Uint8Array(this.slice(start, end)); - }; - Float32Array.prototype.subarray = function subarray(start, end) { - return new Float32Array(this.slice(start, end)); - }; - } - - // Support: Android<4.1 - if (typeof Float64Array === 'undefined') { - window.Float64Array = Float32Array; - } - return; - } - - function subarray(start, end) { - return new TypedArray(this.slice(start, end)); - } - - function setArrayOffset(array, offset) { - if (arguments.length < 2) { - offset = 0; - } - for (var i = 0, n = array.length; i < n; ++i, ++offset) { - this[offset] = array[i] & 0xFF; - } - } - - function TypedArray(arg1) { - var result, i, n; - if (typeof arg1 === 'number') { - result = []; - for (i = 0; i < arg1; ++i) { - result[i] = 0; - } - } else if ('slice' in arg1) { - result = arg1.slice(0); - } else { - result = []; - for (i = 0, n = arg1.length; i < n; ++i) { - result[i] = arg1[i]; - } - } - - result.subarray = subarray; - result.buffer = result; - result.byteLength = result.length; - result.set = setArrayOffset; - - if (typeof arg1 === 'object' && arg1.buffer) { - result.buffer = arg1.buffer; - } - return result; - } - - window.Uint8Array = TypedArray; - window.Int8Array = TypedArray; - - // we don't need support for set, byteLength for 32-bit array - // so we can use the TypedArray as well - window.Uint32Array = TypedArray; - window.Int32Array = TypedArray; - window.Uint16Array = TypedArray; - window.Float32Array = TypedArray; - window.Float64Array = TypedArray; -})(); - -// URL = URL || webkitURL -// Support: Safari<7, Android 4.2+ -(function normalizeURLObject() { - if (!window.URL) { - window.URL = window.webkitURL; - } -})(); - -// Object.defineProperty()? -// Support: Android<4.0, Safari<5.1 -(function checkObjectDefinePropertyCompatibility() { - if (typeof Object.defineProperty !== 'undefined') { - var definePropertyPossible = true; - try { - // some browsers (e.g. safari) cannot use defineProperty() on DOM objects - // and thus the native version is not sufficient - Object.defineProperty(new Image(), 'id', { value: 'test' }); - // ... another test for android gb browser for non-DOM objects - var Test = function Test() {}; - Test.prototype = { get id() { } }; - Object.defineProperty(new Test(), 'id', - { value: '', configurable: true, enumerable: true, writable: false }); - } catch (e) { - definePropertyPossible = false; - } - if (definePropertyPossible) { - return; - } - } - - Object.defineProperty = function objectDefineProperty(obj, name, def) { - delete obj[name]; - if ('get' in def) { - obj.__defineGetter__(name, def['get']); - } - if ('set' in def) { - obj.__defineSetter__(name, def['set']); - } - if ('value' in def) { - obj.__defineSetter__(name, function objectDefinePropertySetter(value) { - this.__defineGetter__(name, function objectDefinePropertyGetter() { - return value; - }); - return value; - }); - obj[name] = def.value; - } - }; -})(); - - -// No XMLHttpRequest#response? -// Support: IE<11, Android <4.0 -(function checkXMLHttpRequestResponseCompatibility() { - var xhrPrototype = XMLHttpRequest.prototype; - var xhr = new XMLHttpRequest(); - if (!('overrideMimeType' in xhr)) { - // IE10 might have response, but not overrideMimeType - // Support: IE10 - Object.defineProperty(xhrPrototype, 'overrideMimeType', { - value: function xmlHttpRequestOverrideMimeType(mimeType) {} - }); - } - if ('responseType' in xhr) { - return; - } - - // The worker will be using XHR, so we can save time and disable worker. - PDFJS.disableWorker = true; - - Object.defineProperty(xhrPrototype, 'responseType', { - get: function xmlHttpRequestGetResponseType() { - return this._responseType || 'text'; - }, - set: function xmlHttpRequestSetResponseType(value) { - if (value === 'text' || value === 'arraybuffer') { - this._responseType = value; - if (value === 'arraybuffer' && - typeof this.overrideMimeType === 'function') { - this.overrideMimeType('text/plain; charset=x-user-defined'); - } - } - } - }); - - // Support: IE9 - if (typeof VBArray !== 'undefined') { - Object.defineProperty(xhrPrototype, 'response', { - get: function xmlHttpRequestResponseGet() { - if (this.responseType === 'arraybuffer') { - return new Uint8Array(new VBArray(this.responseBody).toArray()); - } else { - return this.responseText; - } - } - }); - return; - } - - Object.defineProperty(xhrPrototype, 'response', { - get: function xmlHttpRequestResponseGet() { - if (this.responseType !== 'arraybuffer') { - return this.responseText; - } - var text = this.responseText; - var i, n = text.length; - var result = new Uint8Array(n); - for (i = 0; i < n; ++i) { - result[i] = text.charCodeAt(i) & 0xFF; - } - return result.buffer; - } - }); -})(); - -// window.btoa (base64 encode function) ? -// Support: IE<10 -(function checkWindowBtoaCompatibility() { - if ('btoa' in window) { - return; - } - - var digits = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - - window.btoa = function windowBtoa(chars) { - var buffer = ''; - var i, n; - for (i = 0, n = chars.length; i < n; i += 3) { - var b1 = chars.charCodeAt(i) & 0xFF; - var b2 = chars.charCodeAt(i + 1) & 0xFF; - var b3 = chars.charCodeAt(i + 2) & 0xFF; - var d1 = b1 >> 2, d2 = ((b1 & 3) << 4) | (b2 >> 4); - var d3 = i + 1 < n ? ((b2 & 0xF) << 2) | (b3 >> 6) : 64; - var d4 = i + 2 < n ? (b3 & 0x3F) : 64; - buffer += (digits.charAt(d1) + digits.charAt(d2) + - digits.charAt(d3) + digits.charAt(d4)); - } - return buffer; - }; -})(); - -// window.atob (base64 encode function)? -// Support: IE<10 -(function checkWindowAtobCompatibility() { - if ('atob' in window) { - return; - } - - // https://github.com/davidchambers/Base64.js - var digits = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - window.atob = function (input) { - input = input.replace(/=+$/, ''); - if (input.length % 4 === 1) { - throw new Error('bad atob input'); - } - for ( - // initialize result and counters - var bc = 0, bs, buffer, idx = 0, output = ''; - // get next character - buffer = input.charAt(idx++); - // character found in table? - // initialize bit storage and add its ascii value - ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, - // and if not first of each 4 characters, - // convert the first 8 bits to one ascii character - bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 - ) { - // try to find character in table (0-63, not found => -1) - buffer = digits.indexOf(buffer); - } - return output; - }; -})(); - -// Function.prototype.bind? -// Support: Android<4.0, iOS<6.0 -(function checkFunctionPrototypeBindCompatibility() { - if (typeof Function.prototype.bind !== 'undefined') { - return; - } - - Function.prototype.bind = function functionPrototypeBind(obj) { - var fn = this, headArgs = Array.prototype.slice.call(arguments, 1); - var bound = function functionPrototypeBindBound() { - var args = headArgs.concat(Array.prototype.slice.call(arguments)); - return fn.apply(obj, args); - }; - return bound; - }; -})(); - -// HTMLElement dataset property -// Support: IE<11, Safari<5.1, Android<4.0 -(function checkDatasetProperty() { - var div = document.createElement('div'); - if ('dataset' in div) { - return; // dataset property exists - } - - Object.defineProperty(HTMLElement.prototype, 'dataset', { - get: function() { - if (this._dataset) { - return this._dataset; - } - - var dataset = {}; - for (var j = 0, jj = this.attributes.length; j < jj; j++) { - var attribute = this.attributes[j]; - if (attribute.name.substring(0, 5) !== 'data-') { - continue; - } - var key = attribute.name.substring(5).replace(/\-([a-z])/g, - function(all, ch) { - return ch.toUpperCase(); - }); - dataset[key] = attribute.value; - } - - Object.defineProperty(this, '_dataset', { - value: dataset, - writable: false, - enumerable: false - }); - return dataset; - }, - enumerable: true - }); -})(); - -// HTMLElement classList property -// Support: IE<10, Android<4.0, iOS<5.0 -(function checkClassListProperty() { - var div = document.createElement('div'); - if ('classList' in div) { - return; // classList property exists - } - - function changeList(element, itemName, add, remove) { - var s = element.className || ''; - var list = s.split(/\s+/g); - if (list[0] === '') { - list.shift(); - } - var index = list.indexOf(itemName); - if (index < 0 && add) { - list.push(itemName); - } - if (index >= 0 && remove) { - list.splice(index, 1); - } - element.className = list.join(' '); - return (index >= 0); - } - - var classListPrototype = { - add: function(name) { - changeList(this.element, name, true, false); - }, - contains: function(name) { - return changeList(this.element, name, false, false); - }, - remove: function(name) { - changeList(this.element, name, false, true); - }, - toggle: function(name) { - changeList(this.element, name, true, true); - } - }; - - Object.defineProperty(HTMLElement.prototype, 'classList', { - get: function() { - if (this._classList) { - return this._classList; - } - - var classList = Object.create(classListPrototype, { - element: { - value: this, - writable: false, - enumerable: true - } - }); - Object.defineProperty(this, '_classList', { - value: classList, - writable: false, - enumerable: false - }); - return classList; - }, - enumerable: true - }); -})(); - -// Check console compatibility -// In older IE versions the console object is not available -// unless console is open. -// Support: IE<10 -(function checkConsoleCompatibility() { - if (!('console' in window)) { - window.console = { - log: function() {}, - error: function() {}, - warn: function() {} - }; - } else if (!('bind' in console.log)) { - // native functions in IE9 might not have bind - console.log = (function(fn) { - return function(msg) { return fn(msg); }; - })(console.log); - console.error = (function(fn) { - return function(msg) { return fn(msg); }; - })(console.error); - console.warn = (function(fn) { - return function(msg) { return fn(msg); }; - })(console.warn); - } -})(); - -// Check onclick compatibility in Opera -// Support: Opera<15 -(function checkOnClickCompatibility() { - // workaround for reported Opera bug DSK-354448: - // onclick fires on disabled buttons with opaque content - function ignoreIfTargetDisabled(event) { - if (isDisabled(event.target)) { - event.stopPropagation(); - } - } - function isDisabled(node) { - return node.disabled || (node.parentNode && isDisabled(node.parentNode)); - } - if (navigator.userAgent.indexOf('Opera') !== -1) { - // use browser detection since we cannot feature-check this bug - document.addEventListener('click', ignoreIfTargetDisabled, true); - } -})(); - -// Checks if possible to use URL.createObjectURL() -// Support: IE -(function checkOnBlobSupport() { - // sometimes IE loosing the data created with createObjectURL(), see #3977 - if (navigator.userAgent.indexOf('Trident') >= 0) { - PDFJS.disableCreateObjectURL = true; - } -})(); - -// Checks if navigator.language is supported -(function checkNavigatorLanguage() { - if ('language' in navigator) { - return; - } - PDFJS.locale = navigator.userLanguage || 'en-US'; -})(); - -(function checkRangeRequests() { - // Safari has issues with cached range requests see: - // https://github.com/mozilla/pdf.js/issues/3260 - // Last tested with version 6.0.4. - // Support: Safari 6.0+ - var isSafari = Object.prototype.toString.call( - window.HTMLElement).indexOf('Constructor') > 0; - - // Older versions of Android (pre 3.0) has issues with range requests, see: - // https://github.com/mozilla/pdf.js/issues/3381. - // Make sure that we only match webkit-based Android browsers, - // since Firefox/Fennec works as expected. - // Support: Android<3.0 - var regex = /Android\s[0-2][^\d]/; - var isOldAndroid = regex.test(navigator.userAgent); - - // Range requests are broken in Chrome 39 and 40, https://crbug.com/442318 - var isChromeWithRangeBug = /Chrome\/(39|40)\./.test(navigator.userAgent); - - if (isSafari || isOldAndroid || isChromeWithRangeBug) { - PDFJS.disableRange = true; - PDFJS.disableStream = true; - } -})(); - -// Check if the browser supports manipulation of the history. -// Support: IE<10, Android<4.2 -(function checkHistoryManipulation() { - // Android 2.x has so buggy pushState support that it was removed in - // Android 3.0 and restored as late as in Android 4.2. - // Support: Android 2.x - if (!history.pushState || navigator.userAgent.indexOf('Android 2.') >= 0) { - PDFJS.disableHistory = true; - } -})(); - -// Support: IE<11, Chrome<21, Android<4.4, Safari<6 -(function checkSetPresenceInImageData() { - // IE < 11 will use window.CanvasPixelArray which lacks set function. - if (window.CanvasPixelArray) { - if (typeof window.CanvasPixelArray.prototype.set !== 'function') { - window.CanvasPixelArray.prototype.set = function(arr) { - for (var i = 0, ii = this.length; i < ii; i++) { - this[i] = arr[i]; - } - }; - } - } else { - // Old Chrome and Android use an inaccessible CanvasPixelArray prototype. - // Because we cannot feature detect it, we rely on user agent parsing. - var polyfill = false, versionMatch; - if (navigator.userAgent.indexOf('Chrom') >= 0) { - versionMatch = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./); - // Chrome < 21 lacks the set function. - polyfill = versionMatch && parseInt(versionMatch[2]) < 21; - } else if (navigator.userAgent.indexOf('Android') >= 0) { - // Android < 4.4 lacks the set function. - // Android >= 4.4 will contain Chrome in the user agent, - // thus pass the Chrome check above and not reach this block. - polyfill = /Android\s[0-4][^\d]/g.test(navigator.userAgent); - } else if (navigator.userAgent.indexOf('Safari') >= 0) { - versionMatch = navigator.userAgent. - match(/Version\/([0-9]+)\.([0-9]+)\.([0-9]+) Safari\//); - // Safari < 6 lacks the set function. - polyfill = versionMatch && parseInt(versionMatch[1]) < 6; - } - - if (polyfill) { - var contextPrototype = window.CanvasRenderingContext2D.prototype; - var createImageData = contextPrototype.createImageData; - contextPrototype.createImageData = function(w, h) { - var imageData = createImageData.call(this, w, h); - imageData.data.set = function(arr) { - for (var i = 0, ii = this.length; i < ii; i++) { - this[i] = arr[i]; - } - }; - return imageData; - }; - // this closure will be kept referenced, so clear its vars - contextPrototype = null; - } - } -})(); - -// Support: IE<10, Android<4.0, iOS -(function checkRequestAnimationFrame() { - function fakeRequestAnimationFrame(callback) { - window.setTimeout(callback, 20); - } - - var isIOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent); - if (isIOS) { - // requestAnimationFrame on iOS is broken, replacing with fake one. - window.requestAnimationFrame = fakeRequestAnimationFrame; - return; - } - if ('requestAnimationFrame' in window) { - return; - } - window.requestAnimationFrame = - window.mozRequestAnimationFrame || - window.webkitRequestAnimationFrame || - fakeRequestAnimationFrame; -})(); - -(function checkCanvasSizeLimitation() { - var isIOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent); - var isAndroid = /Android/g.test(navigator.userAgent); - if (isIOS || isAndroid) { - // 5MP - PDFJS.maxCanvasPixels = 5242880; - } -})(); - -// Disable fullscreen support for certain problematic configurations. -// Support: IE11+ (when embedded). -(function checkFullscreenSupport() { - var isEmbeddedIE = (navigator.userAgent.indexOf('Trident') >= 0 && - window.parent !== window); - if (isEmbeddedIE) { - PDFJS.disableFullscreen = true; - } -})(); - -// Provides document.currentScript support -// Support: IE, Chrome<29. -(function checkCurrentScript() { - if ('currentScript' in document) { - return; - } - Object.defineProperty(document, 'currentScript', { - get: function () { - var scripts = document.getElementsByTagName('script'); - return scripts[scripts.length - 1]; - }, - enumerable: true, - configurable: true - }); -})(); diff --git a/services/web/public/js/libs/pdfjs-1.3.91/pdf.js b/services/web/public/js/libs/pdfjs-1.3.91/pdf.js deleted file mode 100644 index 5079c5dcbf..0000000000 --- a/services/web/public/js/libs/pdfjs-1.3.91/pdf.js +++ /dev/null @@ -1,9534 +0,0 @@ -/* Copyright 2012 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/*jshint globalstrict: false */ -/* globals PDFJS */ - -// Initializing PDFJS global object (if still undefined) -if (typeof PDFJS === 'undefined') { - (typeof window !== 'undefined' ? window : this).PDFJS = {}; -} - -PDFJS.version = '1.3.91'; -PDFJS.build = 'd1e83b5'; - -(function pdfjsWrapper() { - // Use strict in our context only - users might not want it - 'use strict'; - - - -var globalScope = (typeof window === 'undefined') ? this : window; - -var isWorker = (typeof window === 'undefined'); - -var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; - -var TextRenderingMode = { - FILL: 0, - STROKE: 1, - FILL_STROKE: 2, - INVISIBLE: 3, - FILL_ADD_TO_PATH: 4, - STROKE_ADD_TO_PATH: 5, - FILL_STROKE_ADD_TO_PATH: 6, - ADD_TO_PATH: 7, - FILL_STROKE_MASK: 3, - ADD_TO_PATH_FLAG: 4 -}; - -var ImageKind = { - GRAYSCALE_1BPP: 1, - RGB_24BPP: 2, - RGBA_32BPP: 3 -}; - -var AnnotationType = { - TEXT: 1, - LINK: 2, - FREETEXT: 3, - LINE: 4, - SQUARE: 5, - CIRCLE: 6, - POLYGON: 7, - POLYLINE: 8, - HIGHLIGHT: 9, - UNDERLINE: 10, - SQUIGGLY: 11, - STRIKEOUT: 12, - STAMP: 13, - CARET: 14, - INK: 15, - POPUP: 16, - FILEATTACHMENT: 17, - SOUND: 18, - MOVIE: 19, - WIDGET: 20, - SCREEN: 21, - PRINTERMARK: 22, - TRAPNET: 23, - WATERMARK: 24, - THREED: 25, - REDACT: 26 -}; - -var AnnotationFlag = { - INVISIBLE: 0x01, - HIDDEN: 0x02, - PRINT: 0x04, - NOZOOM: 0x08, - NOROTATE: 0x10, - NOVIEW: 0x20, - READONLY: 0x40, - LOCKED: 0x80, - TOGGLENOVIEW: 0x100, - LOCKEDCONTENTS: 0x200 -}; - -var AnnotationBorderStyleType = { - SOLID: 1, - DASHED: 2, - BEVELED: 3, - INSET: 4, - UNDERLINE: 5 -}; - -var StreamType = { - UNKNOWN: 0, - FLATE: 1, - LZW: 2, - DCT: 3, - JPX: 4, - JBIG: 5, - A85: 6, - AHX: 7, - CCF: 8, - RL: 9 -}; - -var FontType = { - UNKNOWN: 0, - TYPE1: 1, - TYPE1C: 2, - CIDFONTTYPE0: 3, - CIDFONTTYPE0C: 4, - TRUETYPE: 5, - CIDFONTTYPE2: 6, - TYPE3: 7, - OPENTYPE: 8, - TYPE0: 9, - MMTYPE1: 10 -}; - -// 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.PDFJS) { - globalScope.PDFJS = {}; -} - -globalScope.PDFJS.pdfBug = false; - -PDFJS.VERBOSITY_LEVELS = { - errors: 0, - warnings: 1, - infos: 5 -}; - -// All the possible operations for an operator list. -var OPS = PDFJS.OPS = { - // Intentionally start from 1 so it is easy to spot bad operators that will be - // 0's. - dependency: 1, - setLineWidth: 2, - setLineCap: 3, - setLineJoin: 4, - setMiterLimit: 5, - setDash: 6, - setRenderingIntent: 7, - setFlatness: 8, - setGState: 9, - save: 10, - restore: 11, - transform: 12, - moveTo: 13, - lineTo: 14, - curveTo: 15, - curveTo2: 16, - curveTo3: 17, - closePath: 18, - rectangle: 19, - stroke: 20, - closeStroke: 21, - fill: 22, - eoFill: 23, - fillStroke: 24, - eoFillStroke: 25, - closeFillStroke: 26, - closeEOFillStroke: 27, - endPath: 28, - clip: 29, - eoClip: 30, - beginText: 31, - endText: 32, - setCharSpacing: 33, - setWordSpacing: 34, - setHScale: 35, - setLeading: 36, - setFont: 37, - setTextRenderingMode: 38, - setTextRise: 39, - moveText: 40, - setLeadingMoveText: 41, - setTextMatrix: 42, - nextLine: 43, - showText: 44, - showSpacedText: 45, - nextLineShowText: 46, - nextLineSetSpacingShowText: 47, - setCharWidth: 48, - setCharWidthAndBounds: 49, - setStrokeColorSpace: 50, - setFillColorSpace: 51, - setStrokeColor: 52, - setStrokeColorN: 53, - setFillColor: 54, - setFillColorN: 55, - setStrokeGray: 56, - setFillGray: 57, - setStrokeRGBColor: 58, - setFillRGBColor: 59, - setStrokeCMYKColor: 60, - setFillCMYKColor: 61, - shadingFill: 62, - beginInlineImage: 63, - beginImageData: 64, - endInlineImage: 65, - paintXObject: 66, - markPoint: 67, - markPointProps: 68, - beginMarkedContent: 69, - beginMarkedContentProps: 70, - endMarkedContent: 71, - beginCompat: 72, - endCompat: 73, - paintFormXObjectBegin: 74, - paintFormXObjectEnd: 75, - beginGroup: 76, - endGroup: 77, - beginAnnotations: 78, - endAnnotations: 79, - beginAnnotation: 80, - endAnnotation: 81, - paintJpegXObject: 82, - paintImageMaskXObject: 83, - paintImageMaskXObjectGroup: 84, - paintImageXObject: 85, - paintInlineImageXObject: 86, - paintInlineImageXObjectGroup: 87, - paintImageXObjectRepeat: 88, - paintImageMaskXObjectRepeat: 89, - paintSolidColorImageMask: 90, - constructPath: 91 -}; - -// A notice for devs. These are good for things that are helpful to devs, such -// as warning that Workers were disabled, which is important to devs but not -// end users. -function info(msg) { - if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.infos) { - console.log('Info: ' + msg); - } -} - -// Non-fatal warnings. -function warn(msg) { - if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.warnings) { - console.log('Warning: ' + msg); - } -} - -// Deprecated API function -- treated as warnings. -function deprecated(details) { - warn('Deprecated API usage: ' + details); -} - -// Fatal errors that should trigger the fallback UI and halt execution by -// throwing an exception. -function error(msg) { - if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.errors) { - console.log('Error: ' + msg); - console.log(backtrace()); - } - throw new Error(msg); -} - -function backtrace() { - try { - throw new Error(); - } catch (e) { - return e.stack ? e.stack.split('\n').slice(2).join('\n') : ''; - } -} - -function assert(cond, msg) { - if (!cond) { - error(msg); - } -} - -var UNSUPPORTED_FEATURES = PDFJS.UNSUPPORTED_FEATURES = { - unknown: 'unknown', - forms: 'forms', - javaScript: 'javaScript', - smask: 'smask', - shadingPattern: 'shadingPattern', - font: 'font' -}; - -// Combines two URLs. The baseUrl shall be absolute URL. If the url is an -// absolute URL, it will be returned as is. -function combineUrl(baseUrl, url) { - if (!url) { - return baseUrl; - } - return new URL(url, baseUrl).href; -} - -// Validates if URL is safe and allowed, e.g. to avoid XSS. -function isValidUrl(url, allowRelative) { - if (!url) { - return false; - } - // RFC 3986 (http://tools.ietf.org/html/rfc3986#section-3.1) - // scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - var protocol = /^[a-z][a-z0-9+\-.]*(?=:)/i.exec(url); - if (!protocol) { - return allowRelative; - } - protocol = protocol[0].toLowerCase(); - switch (protocol) { - case 'http': - case 'https': - case 'ftp': - case 'mailto': - case 'tel': - return true; - default: - return false; - } -} -PDFJS.isValidUrl = isValidUrl; - -function shadow(obj, prop, value) { - Object.defineProperty(obj, prop, { value: value, - enumerable: true, - configurable: true, - writable: false }); - return value; -} -PDFJS.shadow = shadow; - -var LinkTarget = PDFJS.LinkTarget = { - NONE: 0, // Default value. - SELF: 1, - BLANK: 2, - PARENT: 3, - TOP: 4, -}; -var LinkTargetStringMap = [ - '', - '_self', - '_blank', - '_parent', - '_top' -]; - -function isExternalLinkTargetSet() { - if (PDFJS.openExternalLinksInNewWindow) { - deprecated('PDFJS.openExternalLinksInNewWindow, please use ' + - '"PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK" instead.'); - if (PDFJS.externalLinkTarget === LinkTarget.NONE) { - PDFJS.externalLinkTarget = LinkTarget.BLANK; - } - // Reset the deprecated parameter, to suppress further warnings. - PDFJS.openExternalLinksInNewWindow = false; - } - switch (PDFJS.externalLinkTarget) { - case LinkTarget.NONE: - return false; - case LinkTarget.SELF: - case LinkTarget.BLANK: - case LinkTarget.PARENT: - case LinkTarget.TOP: - return true; - } - warn('PDFJS.externalLinkTarget is invalid: ' + PDFJS.externalLinkTarget); - // Reset the external link target, to suppress further warnings. - PDFJS.externalLinkTarget = LinkTarget.NONE; - return false; -} -PDFJS.isExternalLinkTargetSet = isExternalLinkTargetSet; - -var PasswordResponses = PDFJS.PasswordResponses = { - NEED_PASSWORD: 1, - INCORRECT_PASSWORD: 2 -}; - -var PasswordException = (function PasswordExceptionClosure() { - function PasswordException(msg, code) { - this.name = 'PasswordException'; - this.message = msg; - this.code = code; - } - - PasswordException.prototype = new Error(); - PasswordException.constructor = PasswordException; - - return PasswordException; -})(); -PDFJS.PasswordException = PasswordException; - -var UnknownErrorException = (function UnknownErrorExceptionClosure() { - function UnknownErrorException(msg, details) { - this.name = 'UnknownErrorException'; - this.message = msg; - this.details = details; - } - - UnknownErrorException.prototype = new Error(); - UnknownErrorException.constructor = UnknownErrorException; - - return UnknownErrorException; -})(); -PDFJS.UnknownErrorException = UnknownErrorException; - -var InvalidPDFException = (function InvalidPDFExceptionClosure() { - function InvalidPDFException(msg) { - this.name = 'InvalidPDFException'; - this.message = msg; - } - - InvalidPDFException.prototype = new Error(); - InvalidPDFException.constructor = InvalidPDFException; - - return InvalidPDFException; -})(); -PDFJS.InvalidPDFException = InvalidPDFException; - -var MissingPDFException = (function MissingPDFExceptionClosure() { - function MissingPDFException(msg) { - this.name = 'MissingPDFException'; - this.message = msg; - } - - MissingPDFException.prototype = new Error(); - MissingPDFException.constructor = MissingPDFException; - - return MissingPDFException; -})(); -PDFJS.MissingPDFException = MissingPDFException; - -var UnexpectedResponseException = - (function UnexpectedResponseExceptionClosure() { - function UnexpectedResponseException(msg, status) { - this.name = 'UnexpectedResponseException'; - this.message = msg; - this.status = status; - } - - UnexpectedResponseException.prototype = new Error(); - UnexpectedResponseException.constructor = UnexpectedResponseException; - - return UnexpectedResponseException; -})(); -PDFJS.UnexpectedResponseException = UnexpectedResponseException; - -var NotImplementedException = (function NotImplementedExceptionClosure() { - function NotImplementedException(msg) { - this.message = msg; - } - - NotImplementedException.prototype = new Error(); - NotImplementedException.prototype.name = 'NotImplementedException'; - NotImplementedException.constructor = NotImplementedException; - - return NotImplementedException; -})(); - -var MissingDataException = (function MissingDataExceptionClosure() { - function MissingDataException(begin, end) { - this.begin = begin; - this.end = end; - this.message = 'Missing data [' + begin + ', ' + end + ')'; - } - - MissingDataException.prototype = new Error(); - MissingDataException.prototype.name = 'MissingDataException'; - MissingDataException.constructor = MissingDataException; - - return MissingDataException; -})(); - -var XRefParseException = (function XRefParseExceptionClosure() { - function XRefParseException(msg) { - this.message = msg; - } - - XRefParseException.prototype = new Error(); - XRefParseException.prototype.name = 'XRefParseException'; - XRefParseException.constructor = XRefParseException; - - return XRefParseException; -})(); - - -function bytesToString(bytes) { - assert(bytes !== null && typeof bytes === 'object' && - bytes.length !== undefined, 'Invalid argument for bytesToString'); - var length = bytes.length; - var MAX_ARGUMENT_COUNT = 8192; - if (length < MAX_ARGUMENT_COUNT) { - return String.fromCharCode.apply(null, bytes); - } - var strBuf = []; - for (var i = 0; i < length; i += MAX_ARGUMENT_COUNT) { - var chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); - var chunk = bytes.subarray(i, chunkEnd); - strBuf.push(String.fromCharCode.apply(null, chunk)); - } - return strBuf.join(''); -} - -function stringToBytes(str) { - assert(typeof str === 'string', 'Invalid argument for stringToBytes'); - var length = str.length; - var bytes = new Uint8Array(length); - for (var i = 0; i < length; ++i) { - bytes[i] = str.charCodeAt(i) & 0xFF; - } - return bytes; -} - -function string32(value) { - return String.fromCharCode((value >> 24) & 0xff, (value >> 16) & 0xff, - (value >> 8) & 0xff, value & 0xff); -} - -function log2(x) { - var n = 1, i = 0; - while (x > n) { - n <<= 1; - i++; - } - return i; -} - -function readInt8(data, start) { - return (data[start] << 24) >> 24; -} - -function readUint16(data, offset) { - return (data[offset] << 8) | data[offset + 1]; -} - -function readUint32(data, offset) { - return ((data[offset] << 24) | (data[offset + 1] << 16) | - (data[offset + 2] << 8) | data[offset + 3]) >>> 0; -} - -// Lazy test the endianness of the platform -// NOTE: This will be 'true' for simulated TypedArrays -function isLittleEndian() { - var buffer8 = new Uint8Array(2); - buffer8[0] = 1; - var buffer16 = new Uint16Array(buffer8.buffer); - return (buffer16[0] === 1); -} - -Object.defineProperty(PDFJS, 'isLittleEndian', { - configurable: true, - get: function PDFJS_isLittleEndian() { - return shadow(PDFJS, 'isLittleEndian', isLittleEndian()); - } -}); - - // Lazy test if the userAgent support CanvasTypedArrays -function hasCanvasTypedArrays() { - var canvas = document.createElement('canvas'); - canvas.width = canvas.height = 1; - var ctx = canvas.getContext('2d'); - var imageData = ctx.createImageData(1, 1); - return (typeof imageData.data.buffer !== 'undefined'); -} - -Object.defineProperty(PDFJS, 'hasCanvasTypedArrays', { - configurable: true, - get: function PDFJS_hasCanvasTypedArrays() { - return shadow(PDFJS, 'hasCanvasTypedArrays', hasCanvasTypedArrays()); - } -}); - -var Uint32ArrayView = (function Uint32ArrayViewClosure() { - - function Uint32ArrayView(buffer, length) { - this.buffer = buffer; - this.byteLength = buffer.length; - this.length = length === undefined ? (this.byteLength >> 2) : length; - ensureUint32ArrayViewProps(this.length); - } - Uint32ArrayView.prototype = Object.create(null); - - var uint32ArrayViewSetters = 0; - function createUint32ArrayProp(index) { - return { - get: function () { - var buffer = this.buffer, offset = index << 2; - return (buffer[offset] | (buffer[offset + 1] << 8) | - (buffer[offset + 2] << 16) | (buffer[offset + 3] << 24)) >>> 0; - }, - set: function (value) { - var buffer = this.buffer, offset = index << 2; - buffer[offset] = value & 255; - buffer[offset + 1] = (value >> 8) & 255; - buffer[offset + 2] = (value >> 16) & 255; - buffer[offset + 3] = (value >>> 24) & 255; - } - }; - } - - function ensureUint32ArrayViewProps(length) { - while (uint32ArrayViewSetters < length) { - Object.defineProperty(Uint32ArrayView.prototype, - uint32ArrayViewSetters, - createUint32ArrayProp(uint32ArrayViewSetters)); - uint32ArrayViewSetters++; - } - } - - return Uint32ArrayView; -})(); - -var IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; - -var Util = PDFJS.Util = (function UtilClosure() { - function Util() {} - - var rgbBuf = ['rgb(', 0, ',', 0, ',', 0, ')']; - - // makeCssRgb() can be called thousands of times. Using |rgbBuf| avoids - // creating many intermediate strings. - Util.makeCssRgb = function Util_makeCssRgb(r, g, b) { - rgbBuf[1] = r; - rgbBuf[3] = g; - rgbBuf[5] = b; - return rgbBuf.join(''); - }; - - // Concatenates two transformation matrices together and returns the result. - Util.transform = function Util_transform(m1, m2) { - return [ - m1[0] * m2[0] + m1[2] * m2[1], - m1[1] * m2[0] + m1[3] * m2[1], - m1[0] * m2[2] + m1[2] * m2[3], - m1[1] * m2[2] + m1[3] * m2[3], - m1[0] * m2[4] + m1[2] * m2[5] + m1[4], - m1[1] * m2[4] + m1[3] * m2[5] + m1[5] - ]; - }; - - // For 2d affine transforms - Util.applyTransform = function Util_applyTransform(p, m) { - var xt = p[0] * m[0] + p[1] * m[2] + m[4]; - var yt = p[0] * m[1] + p[1] * m[3] + m[5]; - return [xt, yt]; - }; - - Util.applyInverseTransform = function Util_applyInverseTransform(p, m) { - var d = m[0] * m[3] - m[1] * m[2]; - var xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; - var yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; - return [xt, yt]; - }; - - // Applies the transform to the rectangle and finds the minimum axially - // aligned bounding box. - Util.getAxialAlignedBoundingBox = - function Util_getAxialAlignedBoundingBox(r, m) { - - var p1 = Util.applyTransform(r, m); - var p2 = Util.applyTransform(r.slice(2, 4), m); - var p3 = Util.applyTransform([r[0], r[3]], m); - var p4 = Util.applyTransform([r[2], r[1]], m); - return [ - Math.min(p1[0], p2[0], p3[0], p4[0]), - Math.min(p1[1], p2[1], p3[1], p4[1]), - Math.max(p1[0], p2[0], p3[0], p4[0]), - Math.max(p1[1], p2[1], p3[1], p4[1]) - ]; - }; - - Util.inverseTransform = function Util_inverseTransform(m) { - var d = m[0] * m[3] - m[1] * m[2]; - return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, - (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d]; - }; - - // Apply a generic 3d matrix M on a 3-vector v: - // | a b c | | X | - // | d e f | x | Y | - // | g h i | | Z | - // M is assumed to be serialized as [a,b,c,d,e,f,g,h,i], - // with v as [X,Y,Z] - Util.apply3dTransform = function Util_apply3dTransform(m, v) { - return [ - m[0] * v[0] + m[1] * v[1] + m[2] * v[2], - m[3] * v[0] + m[4] * v[1] + m[5] * v[2], - m[6] * v[0] + m[7] * v[1] + m[8] * v[2] - ]; - }; - - // This calculation uses Singular Value Decomposition. - // The SVD can be represented with formula A = USV. We are interested in the - // matrix S here because it represents the scale values. - Util.singularValueDecompose2dScale = - function Util_singularValueDecompose2dScale(m) { - - var transpose = [m[0], m[2], m[1], m[3]]; - - // Multiply matrix m with its transpose. - var a = m[0] * transpose[0] + m[1] * transpose[2]; - var b = m[0] * transpose[1] + m[1] * transpose[3]; - var c = m[2] * transpose[0] + m[3] * transpose[2]; - var d = m[2] * transpose[1] + m[3] * transpose[3]; - - // Solve the second degree polynomial to get roots. - var first = (a + d) / 2; - var second = Math.sqrt((a + d) * (a + d) - 4 * (a * d - c * b)) / 2; - var sx = first + second || 1; - var sy = first - second || 1; - - // Scale values are the square roots of the eigenvalues. - return [Math.sqrt(sx), Math.sqrt(sy)]; - }; - - // Normalize rectangle rect=[x1, y1, x2, y2] so that (x1,y1) < (x2,y2) - // For coordinate systems whose origin lies in the bottom-left, this - // means normalization to (BL,TR) ordering. For systems with origin in the - // top-left, this means (TL,BR) ordering. - Util.normalizeRect = function Util_normalizeRect(rect) { - var r = rect.slice(0); // clone rect - if (rect[0] > rect[2]) { - r[0] = rect[2]; - r[2] = rect[0]; - } - if (rect[1] > rect[3]) { - r[1] = rect[3]; - r[3] = rect[1]; - } - return r; - }; - - // Returns a rectangle [x1, y1, x2, y2] corresponding to the - // intersection of rect1 and rect2. If no intersection, returns 'false' - // The rectangle coordinates of rect1, rect2 should be [x1, y1, x2, y2] - Util.intersect = function Util_intersect(rect1, rect2) { - function compare(a, b) { - return a - b; - } - - // Order points along the axes - var orderedX = [rect1[0], rect1[2], rect2[0], rect2[2]].sort(compare), - orderedY = [rect1[1], rect1[3], rect2[1], rect2[3]].sort(compare), - result = []; - - rect1 = Util.normalizeRect(rect1); - rect2 = Util.normalizeRect(rect2); - - // X: first and second points belong to different rectangles? - if ((orderedX[0] === rect1[0] && orderedX[1] === rect2[0]) || - (orderedX[0] === rect2[0] && orderedX[1] === rect1[0])) { - // Intersection must be between second and third points - result[0] = orderedX[1]; - result[2] = orderedX[2]; - } else { - return false; - } - - // Y: first and second points belong to different rectangles? - if ((orderedY[0] === rect1[1] && orderedY[1] === rect2[1]) || - (orderedY[0] === rect2[1] && orderedY[1] === rect1[1])) { - // Intersection must be between second and third points - result[1] = orderedY[1]; - result[3] = orderedY[2]; - } else { - return false; - } - - return result; - }; - - Util.sign = function Util_sign(num) { - return num < 0 ? -1 : 1; - }; - - Util.appendToArray = function Util_appendToArray(arr1, arr2) { - Array.prototype.push.apply(arr1, arr2); - }; - - Util.prependToArray = function Util_prependToArray(arr1, arr2) { - Array.prototype.unshift.apply(arr1, arr2); - }; - - Util.extendObj = function extendObj(obj1, obj2) { - for (var key in obj2) { - obj1[key] = obj2[key]; - } - }; - - Util.getInheritableProperty = function Util_getInheritableProperty(dict, - name) { - while (dict && !dict.has(name)) { - dict = dict.get('Parent'); - } - if (!dict) { - return null; - } - return dict.get(name); - }; - - Util.inherit = function Util_inherit(sub, base, prototype) { - sub.prototype = Object.create(base.prototype); - sub.prototype.constructor = sub; - for (var prop in prototype) { - sub.prototype[prop] = prototype[prop]; - } - }; - - Util.loadScript = function Util_loadScript(src, callback) { - var script = document.createElement('script'); - var loaded = false; - script.setAttribute('src', src); - if (callback) { - script.onload = function() { - if (!loaded) { - callback(); - } - loaded = true; - }; - } - document.getElementsByTagName('head')[0].appendChild(script); - }; - - return Util; -})(); - -/** - * PDF page viewport created based on scale, rotation and offset. - * @class - * @alias PDFJS.PageViewport - */ -var PageViewport = PDFJS.PageViewport = (function PageViewportClosure() { - /** - * @constructor - * @private - * @param viewBox {Array} xMin, yMin, xMax and yMax coordinates. - * @param scale {number} scale of the viewport. - * @param rotation {number} rotations of the viewport in degrees. - * @param offsetX {number} offset X - * @param offsetY {number} offset Y - * @param dontFlip {boolean} if true, axis Y will not be flipped. - */ - function PageViewport(viewBox, scale, rotation, offsetX, offsetY, dontFlip) { - this.viewBox = viewBox; - this.scale = scale; - this.rotation = rotation; - this.offsetX = offsetX; - this.offsetY = offsetY; - - // creating transform to convert pdf coordinate system to the normal - // canvas like coordinates taking in account scale and rotation - var centerX = (viewBox[2] + viewBox[0]) / 2; - var centerY = (viewBox[3] + viewBox[1]) / 2; - var rotateA, rotateB, rotateC, rotateD; - rotation = rotation % 360; - rotation = rotation < 0 ? rotation + 360 : rotation; - switch (rotation) { - case 180: - rotateA = -1; rotateB = 0; rotateC = 0; rotateD = 1; - break; - case 90: - rotateA = 0; rotateB = 1; rotateC = 1; rotateD = 0; - break; - case 270: - rotateA = 0; rotateB = -1; rotateC = -1; rotateD = 0; - break; - //case 0: - default: - rotateA = 1; rotateB = 0; rotateC = 0; rotateD = -1; - break; - } - - if (dontFlip) { - rotateC = -rotateC; rotateD = -rotateD; - } - - var offsetCanvasX, offsetCanvasY; - var width, height; - if (rotateA === 0) { - offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX; - offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY; - width = Math.abs(viewBox[3] - viewBox[1]) * scale; - height = Math.abs(viewBox[2] - viewBox[0]) * scale; - } else { - offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX; - offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY; - width = Math.abs(viewBox[2] - viewBox[0]) * scale; - height = Math.abs(viewBox[3] - viewBox[1]) * scale; - } - // creating transform for the following operations: - // translate(-centerX, -centerY), rotate and flip vertically, - // scale, and translate(offsetCanvasX, offsetCanvasY) - this.transform = [ - rotateA * scale, - rotateB * scale, - rotateC * scale, - rotateD * scale, - offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY, - offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY - ]; - - this.width = width; - this.height = height; - this.fontScale = scale; - } - PageViewport.prototype = /** @lends PDFJS.PageViewport.prototype */ { - /** - * Clones viewport with additional properties. - * @param args {Object} (optional) If specified, may contain the 'scale' or - * 'rotation' properties to override the corresponding properties in - * the cloned viewport. - * @returns {PDFJS.PageViewport} Cloned viewport. - */ - clone: function PageViewPort_clone(args) { - args = args || {}; - var scale = 'scale' in args ? args.scale : this.scale; - var rotation = 'rotation' in args ? args.rotation : this.rotation; - return new PageViewport(this.viewBox.slice(), scale, rotation, - this.offsetX, this.offsetY, args.dontFlip); - }, - /** - * Converts PDF point to the viewport coordinates. For examples, useful for - * converting PDF location into canvas pixel coordinates. - * @param x {number} X coordinate. - * @param y {number} Y coordinate. - * @returns {Object} Object that contains 'x' and 'y' properties of the - * point in the viewport coordinate space. - * @see {@link convertToPdfPoint} - * @see {@link convertToViewportRectangle} - */ - convertToViewportPoint: function PageViewport_convertToViewportPoint(x, y) { - return Util.applyTransform([x, y], this.transform); - }, - /** - * Converts PDF rectangle to the viewport coordinates. - * @param rect {Array} xMin, yMin, xMax and yMax coordinates. - * @returns {Array} Contains corresponding coordinates of the rectangle - * in the viewport coordinate space. - * @see {@link convertToViewportPoint} - */ - convertToViewportRectangle: - function PageViewport_convertToViewportRectangle(rect) { - var tl = Util.applyTransform([rect[0], rect[1]], this.transform); - var br = Util.applyTransform([rect[2], rect[3]], this.transform); - return [tl[0], tl[1], br[0], br[1]]; - }, - /** - * Converts viewport coordinates to the PDF location. For examples, useful - * for converting canvas pixel location into PDF one. - * @param x {number} X coordinate. - * @param y {number} Y coordinate. - * @returns {Object} Object that contains 'x' and 'y' properties of the - * point in the PDF coordinate space. - * @see {@link convertToViewportPoint} - */ - convertToPdfPoint: function PageViewport_convertToPdfPoint(x, y) { - return Util.applyInverseTransform([x, y], this.transform); - } - }; - return PageViewport; -})(); - -var PDFStringTranslateTable = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0x2D8, 0x2C7, 0x2C6, 0x2D9, 0x2DD, 0x2DB, 0x2DA, 0x2DC, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, - 0x2013, 0x192, 0x2044, 0x2039, 0x203A, 0x2212, 0x2030, 0x201E, 0x201C, - 0x201D, 0x2018, 0x2019, 0x201A, 0x2122, 0xFB01, 0xFB02, 0x141, 0x152, 0x160, - 0x178, 0x17D, 0x131, 0x142, 0x153, 0x161, 0x17E, 0, 0x20AC -]; - -function stringToPDFString(str) { - var i, n = str.length, strBuf = []; - if (str[0] === '\xFE' && str[1] === '\xFF') { - // UTF16BE BOM - for (i = 2; i < n; i += 2) { - strBuf.push(String.fromCharCode( - (str.charCodeAt(i) << 8) | str.charCodeAt(i + 1))); - } - } else { - for (i = 0; i < n; ++i) { - var code = PDFStringTranslateTable[str.charCodeAt(i)]; - strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); - } - } - return strBuf.join(''); -} - -function stringToUTF8String(str) { - return decodeURIComponent(escape(str)); -} - -function utf8StringToString(str) { - return unescape(encodeURIComponent(str)); -} - -function isEmptyObj(obj) { - for (var key in obj) { - return false; - } - return true; -} - -function isBool(v) { - return typeof v === 'boolean'; -} - -function isInt(v) { - return typeof v === 'number' && ((v | 0) === v); -} - -function isNum(v) { - return typeof v === 'number'; -} - -function isString(v) { - return typeof v === 'string'; -} - -function isName(v) { - return v instanceof Name; -} - -function isCmd(v, cmd) { - return v instanceof Cmd && (cmd === undefined || v.cmd === cmd); -} - -function isDict(v, type) { - if (!(v instanceof Dict)) { - return false; - } - if (!type) { - return true; - } - var dictType = v.get('Type'); - return isName(dictType) && dictType.name === type; -} - -function isArray(v) { - return v instanceof Array; -} - -function isStream(v) { - return typeof v === 'object' && v !== null && v.getBytes !== undefined; -} - -function isArrayBuffer(v) { - return typeof v === 'object' && v !== null && v.byteLength !== undefined; -} - -function isRef(v) { - return v instanceof Ref; -} - -/** - * Promise Capability object. - * - * @typedef {Object} PromiseCapability - * @property {Promise} promise - A promise object. - * @property {function} resolve - Fullfills the promise. - * @property {function} reject - Rejects the promise. - */ - -/** - * Creates a promise capability object. - * @alias PDFJS.createPromiseCapability - * - * @return {PromiseCapability} A capability object contains: - * - a Promise, resolve and reject methods. - */ -function createPromiseCapability() { - var capability = {}; - capability.promise = new Promise(function (resolve, reject) { - capability.resolve = resolve; - capability.reject = reject; - }); - return capability; -} - -PDFJS.createPromiseCapability = createPromiseCapability; - -/** - * Polyfill for Promises: - * The following promise implementation tries to generally implement the - * Promise/A+ spec. Some notable differences from other promise libaries are: - * - There currently isn't a seperate deferred and promise object. - * - Unhandled rejections eventually show an error if they aren't handled. - * - * Based off of the work in: - * https://bugzilla.mozilla.org/show_bug.cgi?id=810490 - */ -(function PromiseClosure() { - if (globalScope.Promise) { - // Promises existing in the DOM/Worker, checking presence of all/resolve - if (typeof globalScope.Promise.all !== 'function') { - globalScope.Promise.all = function (iterable) { - var count = 0, results = [], resolve, reject; - var promise = new globalScope.Promise(function (resolve_, reject_) { - resolve = resolve_; - reject = reject_; - }); - iterable.forEach(function (p, i) { - count++; - p.then(function (result) { - results[i] = result; - count--; - if (count === 0) { - resolve(results); - } - }, reject); - }); - if (count === 0) { - resolve(results); - } - return promise; - }; - } - if (typeof globalScope.Promise.resolve !== 'function') { - globalScope.Promise.resolve = function (value) { - return new globalScope.Promise(function (resolve) { resolve(value); }); - }; - } - if (typeof globalScope.Promise.reject !== 'function') { - globalScope.Promise.reject = function (reason) { - return new globalScope.Promise(function (resolve, reject) { - reject(reason); - }); - }; - } - if (typeof globalScope.Promise.prototype.catch !== 'function') { - globalScope.Promise.prototype.catch = function (onReject) { - return globalScope.Promise.prototype.then(undefined, onReject); - }; - } - return; - } - var STATUS_PENDING = 0; - var STATUS_RESOLVED = 1; - var STATUS_REJECTED = 2; - - // In an attempt to avoid silent exceptions, unhandled rejections are - // tracked and if they aren't handled in a certain amount of time an - // error is logged. - var REJECTION_TIMEOUT = 500; - - var HandlerManager = { - handlers: [], - running: false, - unhandledRejections: [], - pendingRejectionCheck: false, - - scheduleHandlers: function scheduleHandlers(promise) { - if (promise._status === STATUS_PENDING) { - return; - } - - this.handlers = this.handlers.concat(promise._handlers); - promise._handlers = []; - - if (this.running) { - return; - } - this.running = true; - - setTimeout(this.runHandlers.bind(this), 0); - }, - - runHandlers: function runHandlers() { - var RUN_TIMEOUT = 1; // ms - var timeoutAt = Date.now() + RUN_TIMEOUT; - while (this.handlers.length > 0) { - var handler = this.handlers.shift(); - - var nextStatus = handler.thisPromise._status; - var nextValue = handler.thisPromise._value; - - try { - if (nextStatus === STATUS_RESOLVED) { - if (typeof handler.onResolve === 'function') { - nextValue = handler.onResolve(nextValue); - } - } else if (typeof handler.onReject === 'function') { - nextValue = handler.onReject(nextValue); - nextStatus = STATUS_RESOLVED; - - if (handler.thisPromise._unhandledRejection) { - this.removeUnhandeledRejection(handler.thisPromise); - } - } - } catch (ex) { - nextStatus = STATUS_REJECTED; - nextValue = ex; - } - - handler.nextPromise._updateStatus(nextStatus, nextValue); - if (Date.now() >= timeoutAt) { - break; - } - } - - if (this.handlers.length > 0) { - setTimeout(this.runHandlers.bind(this), 0); - return; - } - - this.running = false; - }, - - addUnhandledRejection: function addUnhandledRejection(promise) { - this.unhandledRejections.push({ - promise: promise, - time: Date.now() - }); - this.scheduleRejectionCheck(); - }, - - removeUnhandeledRejection: function removeUnhandeledRejection(promise) { - promise._unhandledRejection = false; - for (var i = 0; i < this.unhandledRejections.length; i++) { - if (this.unhandledRejections[i].promise === promise) { - this.unhandledRejections.splice(i); - i--; - } - } - }, - - scheduleRejectionCheck: function scheduleRejectionCheck() { - if (this.pendingRejectionCheck) { - return; - } - this.pendingRejectionCheck = true; - setTimeout(function rejectionCheck() { - this.pendingRejectionCheck = false; - var now = Date.now(); - for (var i = 0; i < this.unhandledRejections.length; i++) { - if (now - this.unhandledRejections[i].time > REJECTION_TIMEOUT) { - var unhandled = this.unhandledRejections[i].promise._value; - var msg = 'Unhandled rejection: ' + unhandled; - if (unhandled.stack) { - msg += '\n' + unhandled.stack; - } - warn(msg); - this.unhandledRejections.splice(i); - i--; - } - } - if (this.unhandledRejections.length) { - this.scheduleRejectionCheck(); - } - }.bind(this), REJECTION_TIMEOUT); - } - }; - - function Promise(resolver) { - this._status = STATUS_PENDING; - this._handlers = []; - try { - resolver.call(this, this._resolve.bind(this), this._reject.bind(this)); - } catch (e) { - this._reject(e); - } - } - /** - * Builds a promise that is resolved when all the passed in promises are - * resolved. - * @param {array} array of data and/or promises to wait for. - * @return {Promise} New dependant promise. - */ - Promise.all = function Promise_all(promises) { - var resolveAll, rejectAll; - var deferred = new Promise(function (resolve, reject) { - resolveAll = resolve; - rejectAll = reject; - }); - var unresolved = promises.length; - var results = []; - if (unresolved === 0) { - resolveAll(results); - return deferred; - } - function reject(reason) { - if (deferred._status === STATUS_REJECTED) { - return; - } - results = []; - rejectAll(reason); - } - for (var i = 0, ii = promises.length; i < ii; ++i) { - var promise = promises[i]; - var resolve = (function(i) { - return function(value) { - if (deferred._status === STATUS_REJECTED) { - return; - } - results[i] = value; - unresolved--; - if (unresolved === 0) { - resolveAll(results); - } - }; - })(i); - if (Promise.isPromise(promise)) { - promise.then(resolve, reject); - } else { - resolve(promise); - } - } - return deferred; - }; - - /** - * Checks if the value is likely a promise (has a 'then' function). - * @return {boolean} true if value is thenable - */ - Promise.isPromise = function Promise_isPromise(value) { - return value && typeof value.then === 'function'; - }; - - /** - * Creates resolved promise - * @param value resolve value - * @returns {Promise} - */ - Promise.resolve = function Promise_resolve(value) { - return new Promise(function (resolve) { resolve(value); }); - }; - - /** - * Creates rejected promise - * @param reason rejection value - * @returns {Promise} - */ - Promise.reject = function Promise_reject(reason) { - return new Promise(function (resolve, reject) { reject(reason); }); - }; - - Promise.prototype = { - _status: null, - _value: null, - _handlers: null, - _unhandledRejection: null, - - _updateStatus: function Promise__updateStatus(status, value) { - if (this._status === STATUS_RESOLVED || - this._status === STATUS_REJECTED) { - return; - } - - if (status === STATUS_RESOLVED && - Promise.isPromise(value)) { - value.then(this._updateStatus.bind(this, STATUS_RESOLVED), - this._updateStatus.bind(this, STATUS_REJECTED)); - return; - } - - this._status = status; - this._value = value; - - if (status === STATUS_REJECTED && this._handlers.length === 0) { - this._unhandledRejection = true; - HandlerManager.addUnhandledRejection(this); - } - - HandlerManager.scheduleHandlers(this); - }, - - _resolve: function Promise_resolve(value) { - this._updateStatus(STATUS_RESOLVED, value); - }, - - _reject: function Promise_reject(reason) { - this._updateStatus(STATUS_REJECTED, reason); - }, - - then: function Promise_then(onResolve, onReject) { - var nextPromise = new Promise(function (resolve, reject) { - this.resolve = resolve; - this.reject = reject; - }); - this._handlers.push({ - thisPromise: this, - onResolve: onResolve, - onReject: onReject, - nextPromise: nextPromise - }); - HandlerManager.scheduleHandlers(this); - return nextPromise; - }, - - catch: function Promise_catch(onReject) { - return this.then(undefined, onReject); - } - }; - - globalScope.Promise = Promise; -})(); - -var StatTimer = (function StatTimerClosure() { - function rpad(str, pad, length) { - while (str.length < length) { - str += pad; - } - return str; - } - function StatTimer() { - this.started = {}; - this.times = []; - this.enabled = true; - } - StatTimer.prototype = { - time: function StatTimer_time(name) { - if (!this.enabled) { - return; - } - if (name in this.started) { - warn('Timer is already running for ' + name); - } - this.started[name] = Date.now(); - }, - timeEnd: function StatTimer_timeEnd(name) { - if (!this.enabled) { - return; - } - if (!(name in this.started)) { - warn('Timer has not been started for ' + name); - } - this.times.push({ - 'name': name, - 'start': this.started[name], - 'end': Date.now() - }); - // Remove timer from started so it can be called again. - delete this.started[name]; - }, - toString: function StatTimer_toString() { - var i, ii; - var times = this.times; - var out = ''; - // Find the longest name for padding purposes. - var longest = 0; - for (i = 0, ii = times.length; i < ii; ++i) { - var name = times[i]['name']; - if (name.length > longest) { - longest = name.length; - } - } - for (i = 0, ii = times.length; i < ii; ++i) { - var span = times[i]; - var duration = span.end - span.start; - out += rpad(span['name'], ' ', longest) + ' ' + duration + 'ms\n'; - } - return out; - } - }; - return StatTimer; -})(); - -PDFJS.createBlob = function createBlob(data, contentType) { - if (typeof Blob !== 'undefined') { - return new Blob([data], { type: contentType }); - } - // Blob builder is deprecated in FF14 and removed in FF18. - var bb = new MozBlobBuilder(); - bb.append(data); - return bb.getBlob(contentType); -}; - -PDFJS.createObjectURL = (function createObjectURLClosure() { - // Blob/createObjectURL is not available, falling back to data schema. - var digits = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - - return function createObjectURL(data, contentType) { - if (!PDFJS.disableCreateObjectURL && - typeof URL !== 'undefined' && URL.createObjectURL) { - var blob = PDFJS.createBlob(data, contentType); - return URL.createObjectURL(blob); - } - - var buffer = 'data:' + contentType + ';base64,'; - for (var i = 0, ii = data.length; i < ii; i += 3) { - var b1 = data[i] & 0xFF; - var b2 = data[i + 1] & 0xFF; - var b3 = data[i + 2] & 0xFF; - var d1 = b1 >> 2, d2 = ((b1 & 3) << 4) | (b2 >> 4); - var d3 = i + 1 < ii ? ((b2 & 0xF) << 2) | (b3 >> 6) : 64; - var d4 = i + 2 < ii ? (b3 & 0x3F) : 64; - buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4]; - } - return buffer; - }; -})(); - -function MessageHandler(sourceName, targetName, comObj) { - this.sourceName = sourceName; - this.targetName = targetName; - this.comObj = comObj; - this.callbackIndex = 1; - this.postMessageTransfers = true; - var callbacksCapabilities = this.callbacksCapabilities = {}; - var ah = this.actionHandler = {}; - - this._onComObjOnMessage = function messageHandlerComObjOnMessage(event) { - var data = event.data; - if (data.targetName !== this.sourceName) { - return; - } - if (data.isReply) { - var callbackId = data.callbackId; - if (data.callbackId in callbacksCapabilities) { - var callback = callbacksCapabilities[callbackId]; - delete callbacksCapabilities[callbackId]; - if ('error' in data) { - callback.reject(data.error); - } else { - callback.resolve(data.data); - } - } else { - error('Cannot resolve callback ' + callbackId); - } - } else if (data.action in ah) { - var action = ah[data.action]; - if (data.callbackId) { - var sourceName = this.sourceName; - var targetName = data.sourceName; - Promise.resolve().then(function () { - return action[0].call(action[1], data.data); - }).then(function (result) { - comObj.postMessage({ - sourceName: sourceName, - targetName: targetName, - isReply: true, - callbackId: data.callbackId, - data: result - }); - }, function (reason) { - if (reason instanceof Error) { - // Serialize error to avoid "DataCloneError" - reason = reason + ''; - } - comObj.postMessage({ - sourceName: sourceName, - targetName: targetName, - isReply: true, - callbackId: data.callbackId, - error: reason - }); - }); - } else { - action[0].call(action[1], data.data); - } - } else { - error('Unknown action from worker: ' + data.action); - } - }.bind(this); - comObj.addEventListener('message', this._onComObjOnMessage); -} - -MessageHandler.prototype = { - on: function messageHandlerOn(actionName, handler, scope) { - var ah = this.actionHandler; - if (ah[actionName]) { - error('There is already an actionName called "' + actionName + '"'); - } - ah[actionName] = [handler, scope]; - }, - /** - * Sends a message to the comObj to invoke the action with the supplied data. - * @param {String} actionName Action to call. - * @param {JSON} data JSON data to send. - * @param {Array} [transfers] Optional list of transfers/ArrayBuffers - */ - send: function messageHandlerSend(actionName, data, transfers) { - var message = { - sourceName: this.sourceName, - targetName: this.targetName, - action: actionName, - data: data - }; - this.postMessage(message, transfers); - }, - /** - * Sends a message to the comObj to invoke the action with the supplied data. - * Expects that other side will callback with the response. - * @param {String} actionName Action to call. - * @param {JSON} data JSON data to send. - * @param {Array} [transfers] Optional list of transfers/ArrayBuffers. - * @returns {Promise} Promise to be resolved with response data. - */ - sendWithPromise: - function messageHandlerSendWithPromise(actionName, data, transfers) { - var callbackId = this.callbackIndex++; - var message = { - sourceName: this.sourceName, - targetName: this.targetName, - action: actionName, - data: data, - callbackId: callbackId - }; - var capability = createPromiseCapability(); - this.callbacksCapabilities[callbackId] = capability; - try { - this.postMessage(message, transfers); - } catch (e) { - capability.reject(e); - } - return capability.promise; - }, - /** - * Sends raw message to the comObj. - * @private - * @param message {Object} Raw message. - * @param transfers List of transfers/ArrayBuffers, or undefined. - */ - postMessage: function (message, transfers) { - if (transfers && this.postMessageTransfers) { - this.comObj.postMessage(message, transfers); - } else { - this.comObj.postMessage(message); - } - }, - - destroy: function () { - this.comObj.removeEventListener('message', this._onComObjOnMessage); - } -}; - -function loadJpegStream(id, imageUrl, objs) { - var img = new Image(); - img.onload = (function loadJpegStream_onloadClosure() { - objs.resolve(id, img); - }); - img.onerror = (function loadJpegStream_onerrorClosure() { - objs.resolve(id, null); - warn('Error during JPEG image loading'); - }); - img.src = imageUrl; -} - - // Polyfill from https://github.com/Polymer/URL -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ -(function checkURLConstructor(scope) { - /* jshint ignore:start */ - - // feature detect for URL constructor - var hasWorkingUrl = false; - if (typeof URL === 'function' && ('origin' in URL.prototype)) { - try { - var u = new URL('b', 'http://a'); - u.pathname = 'c%20d'; - hasWorkingUrl = u.href === 'http://a/c%20d'; - } catch(e) {} - } - - if (hasWorkingUrl) - return; - - var relative = Object.create(null); - relative['ftp'] = 21; - relative['file'] = 0; - relative['gopher'] = 70; - relative['http'] = 80; - relative['https'] = 443; - relative['ws'] = 80; - relative['wss'] = 443; - - var relativePathDotMapping = Object.create(null); - relativePathDotMapping['%2e'] = '.'; - relativePathDotMapping['.%2e'] = '..'; - relativePathDotMapping['%2e.'] = '..'; - relativePathDotMapping['%2e%2e'] = '..'; - - function isRelativeScheme(scheme) { - return relative[scheme] !== undefined; - } - - function invalid() { - clear.call(this); - this._isInvalid = true; - } - - function IDNAToASCII(h) { - if ('' == h) { - invalid.call(this) - } - // XXX - return h.toLowerCase() - } - - function percentEscape(c) { - var unicode = c.charCodeAt(0); - if (unicode > 0x20 && - unicode < 0x7F && - // " # < > ? ` - [0x22, 0x23, 0x3C, 0x3E, 0x3F, 0x60].indexOf(unicode) == -1 - ) { - return c; - } - return encodeURIComponent(c); - } - - function percentEscapeQuery(c) { - // XXX This actually needs to encode c using encoding and then - // convert the bytes one-by-one. - - var unicode = c.charCodeAt(0); - if (unicode > 0x20 && - unicode < 0x7F && - // " # < > ` (do not escape '?') - [0x22, 0x23, 0x3C, 0x3E, 0x60].indexOf(unicode) == -1 - ) { - return c; - } - return encodeURIComponent(c); - } - - var EOF = undefined, - ALPHA = /[a-zA-Z]/, - ALPHANUMERIC = /[a-zA-Z0-9\+\-\.]/; - - function parse(input, stateOverride, base) { - function err(message) { - errors.push(message) - } - - var state = stateOverride || 'scheme start', - cursor = 0, - buffer = '', - seenAt = false, - seenBracket = false, - errors = []; - - loop: while ((input[cursor - 1] != EOF || cursor == 0) && !this._isInvalid) { - var c = input[cursor]; - switch (state) { - case 'scheme start': - if (c && ALPHA.test(c)) { - buffer += c.toLowerCase(); // ASCII-safe - state = 'scheme'; - } else if (!stateOverride) { - buffer = ''; - state = 'no scheme'; - continue; - } else { - err('Invalid scheme.'); - break loop; - } - break; - - case 'scheme': - if (c && ALPHANUMERIC.test(c)) { - buffer += c.toLowerCase(); // ASCII-safe - } else if (':' == c) { - this._scheme = buffer; - buffer = ''; - if (stateOverride) { - break loop; - } - if (isRelativeScheme(this._scheme)) { - this._isRelative = true; - } - if ('file' == this._scheme) { - state = 'relative'; - } else if (this._isRelative && base && base._scheme == this._scheme) { - state = 'relative or authority'; - } else if (this._isRelative) { - state = 'authority first slash'; - } else { - state = 'scheme data'; - } - } else if (!stateOverride) { - buffer = ''; - cursor = 0; - state = 'no scheme'; - continue; - } else if (EOF == c) { - break loop; - } else { - err('Code point not allowed in scheme: ' + c) - break loop; - } - break; - - case 'scheme data': - if ('?' == c) { - this._query = '?'; - state = 'query'; - } else if ('#' == c) { - this._fragment = '#'; - state = 'fragment'; - } else { - // XXX error handling - if (EOF != c && '\t' != c && '\n' != c && '\r' != c) { - this._schemeData += percentEscape(c); - } - } - break; - - case 'no scheme': - if (!base || !(isRelativeScheme(base._scheme))) { - err('Missing scheme.'); - invalid.call(this); - } else { - state = 'relative'; - continue; - } - break; - - case 'relative or authority': - if ('/' == c && '/' == input[cursor+1]) { - state = 'authority ignore slashes'; - } else { - err('Expected /, got: ' + c); - state = 'relative'; - continue - } - break; - - case 'relative': - this._isRelative = true; - if ('file' != this._scheme) - this._scheme = base._scheme; - if (EOF == c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = base._query; - this._username = base._username; - this._password = base._password; - break loop; - } else if ('/' == c || '\\' == c) { - if ('\\' == c) - err('\\ is an invalid code point.'); - state = 'relative slash'; - } else if ('?' == c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = '?'; - this._username = base._username; - this._password = base._password; - state = 'query'; - } else if ('#' == c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = base._query; - this._fragment = '#'; - this._username = base._username; - this._password = base._password; - state = 'fragment'; - } else { - var nextC = input[cursor+1] - var nextNextC = input[cursor+2] - if ( - 'file' != this._scheme || !ALPHA.test(c) || - (nextC != ':' && nextC != '|') || - (EOF != nextNextC && '/' != nextNextC && '\\' != nextNextC && '?' != nextNextC && '#' != nextNextC)) { - this._host = base._host; - this._port = base._port; - this._username = base._username; - this._password = base._password; - this._path = base._path.slice(); - this._path.pop(); - } - state = 'relative path'; - continue; - } - break; - - case 'relative slash': - if ('/' == c || '\\' == c) { - if ('\\' == c) { - err('\\ is an invalid code point.'); - } - if ('file' == this._scheme) { - state = 'file host'; - } else { - state = 'authority ignore slashes'; - } - } else { - if ('file' != this._scheme) { - this._host = base._host; - this._port = base._port; - this._username = base._username; - this._password = base._password; - } - state = 'relative path'; - continue; - } - break; - - case 'authority first slash': - if ('/' == c) { - state = 'authority second slash'; - } else { - err("Expected '/', got: " + c); - state = 'authority ignore slashes'; - continue; - } - break; - - case 'authority second slash': - state = 'authority ignore slashes'; - if ('/' != c) { - err("Expected '/', got: " + c); - continue; - } - break; - - case 'authority ignore slashes': - if ('/' != c && '\\' != c) { - state = 'authority'; - continue; - } else { - err('Expected authority, got: ' + c); - } - break; - - case 'authority': - if ('@' == c) { - if (seenAt) { - err('@ already seen.'); - buffer += '%40'; - } - seenAt = true; - for (var i = 0; i < buffer.length; i++) { - var cp = buffer[i]; - if ('\t' == cp || '\n' == cp || '\r' == cp) { - err('Invalid whitespace in authority.'); - continue; - } - // XXX check URL code points - if (':' == cp && null === this._password) { - this._password = ''; - continue; - } - var tempC = percentEscape(cp); - (null !== this._password) ? this._password += tempC : this._username += tempC; - } - buffer = ''; - } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) { - cursor -= buffer.length; - buffer = ''; - state = 'host'; - continue; - } else { - buffer += c; - } - break; - - case 'file host': - if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) { - if (buffer.length == 2 && ALPHA.test(buffer[0]) && (buffer[1] == ':' || buffer[1] == '|')) { - state = 'relative path'; - } else if (buffer.length == 0) { - state = 'relative path start'; - } else { - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'relative path start'; - } - continue; - } else if ('\t' == c || '\n' == c || '\r' == c) { - err('Invalid whitespace in file host.'); - } else { - buffer += c; - } - break; - - case 'host': - case 'hostname': - if (':' == c && !seenBracket) { - // XXX host parsing - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'port'; - if ('hostname' == stateOverride) { - break loop; - } - } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) { - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'relative path start'; - if (stateOverride) { - break loop; - } - continue; - } else if ('\t' != c && '\n' != c && '\r' != c) { - if ('[' == c) { - seenBracket = true; - } else if (']' == c) { - seenBracket = false; - } - buffer += c; - } else { - err('Invalid code point in host/hostname: ' + c); - } - break; - - case 'port': - if (/[0-9]/.test(c)) { - buffer += c; - } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c || stateOverride) { - if ('' != buffer) { - var temp = parseInt(buffer, 10); - if (temp != relative[this._scheme]) { - this._port = temp + ''; - } - buffer = ''; - } - if (stateOverride) { - break loop; - } - state = 'relative path start'; - continue; - } else if ('\t' == c || '\n' == c || '\r' == c) { - err('Invalid code point in port: ' + c); - } else { - invalid.call(this); - } - break; - - case 'relative path start': - if ('\\' == c) - err("'\\' not allowed in path."); - state = 'relative path'; - if ('/' != c && '\\' != c) { - continue; - } - break; - - case 'relative path': - if (EOF == c || '/' == c || '\\' == c || (!stateOverride && ('?' == c || '#' == c))) { - if ('\\' == c) { - err('\\ not allowed in relative path.'); - } - var tmp; - if (tmp = relativePathDotMapping[buffer.toLowerCase()]) { - buffer = tmp; - } - if ('..' == buffer) { - this._path.pop(); - if ('/' != c && '\\' != c) { - this._path.push(''); - } - } else if ('.' == buffer && '/' != c && '\\' != c) { - this._path.push(''); - } else if ('.' != buffer) { - if ('file' == this._scheme && this._path.length == 0 && buffer.length == 2 && ALPHA.test(buffer[0]) && buffer[1] == '|') { - buffer = buffer[0] + ':'; - } - this._path.push(buffer); - } - buffer = ''; - if ('?' == c) { - this._query = '?'; - state = 'query'; - } else if ('#' == c) { - this._fragment = '#'; - state = 'fragment'; - } - } else if ('\t' != c && '\n' != c && '\r' != c) { - buffer += percentEscape(c); - } - break; - - case 'query': - if (!stateOverride && '#' == c) { - this._fragment = '#'; - state = 'fragment'; - } else if (EOF != c && '\t' != c && '\n' != c && '\r' != c) { - this._query += percentEscapeQuery(c); - } - break; - - case 'fragment': - if (EOF != c && '\t' != c && '\n' != c && '\r' != c) { - this._fragment += c; - } - break; - } - - cursor++; - } - } - - function clear() { - this._scheme = ''; - this._schemeData = ''; - this._username = ''; - this._password = null; - this._host = ''; - this._port = ''; - this._path = []; - this._query = ''; - this._fragment = ''; - this._isInvalid = false; - this._isRelative = false; - } - - // Does not process domain names or IP addresses. - // Does not handle encoding for the query parameter. - function jURL(url, base /* , encoding */) { - if (base !== undefined && !(base instanceof jURL)) - base = new jURL(String(base)); - - this._url = url; - clear.call(this); - - var input = url.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, ''); - // encoding = encoding || 'utf-8' - - parse.call(this, input, null, base); - } - - jURL.prototype = { - toString: function() { - return this.href; - }, - get href() { - if (this._isInvalid) - return this._url; - - var authority = ''; - if ('' != this._username || null != this._password) { - authority = this._username + - (null != this._password ? ':' + this._password : '') + '@'; - } - - return this.protocol + - (this._isRelative ? '//' + authority + this.host : '') + - this.pathname + this._query + this._fragment; - }, - set href(href) { - clear.call(this); - parse.call(this, href); - }, - - get protocol() { - return this._scheme + ':'; - }, - set protocol(protocol) { - if (this._isInvalid) - return; - parse.call(this, protocol + ':', 'scheme start'); - }, - - get host() { - return this._isInvalid ? '' : this._port ? - this._host + ':' + this._port : this._host; - }, - set host(host) { - if (this._isInvalid || !this._isRelative) - return; - parse.call(this, host, 'host'); - }, - - get hostname() { - return this._host; - }, - set hostname(hostname) { - if (this._isInvalid || !this._isRelative) - return; - parse.call(this, hostname, 'hostname'); - }, - - get port() { - return this._port; - }, - set port(port) { - if (this._isInvalid || !this._isRelative) - return; - parse.call(this, port, 'port'); - }, - - get pathname() { - return this._isInvalid ? '' : this._isRelative ? - '/' + this._path.join('/') : this._schemeData; - }, - set pathname(pathname) { - if (this._isInvalid || !this._isRelative) - return; - this._path = []; - parse.call(this, pathname, 'relative path start'); - }, - - get search() { - return this._isInvalid || !this._query || '?' == this._query ? - '' : this._query; - }, - set search(search) { - if (this._isInvalid || !this._isRelative) - return; - this._query = '?'; - if ('?' == search[0]) - search = search.slice(1); - parse.call(this, search, 'query'); - }, - - get hash() { - return this._isInvalid || !this._fragment || '#' == this._fragment ? - '' : this._fragment; - }, - set hash(hash) { - if (this._isInvalid) - return; - this._fragment = '#'; - if ('#' == hash[0]) - hash = hash.slice(1); - parse.call(this, hash, 'fragment'); - }, - - get origin() { - var host; - if (this._isInvalid || !this._scheme) { - return ''; - } - // javascript: Gecko returns String(""), WebKit/Blink String("null") - // Gecko throws error for "data://" - // data: Gecko returns "", Blink returns "data://", WebKit returns "null" - // Gecko returns String("") for file: mailto: - // WebKit/Blink returns String("SCHEME://") for file: mailto: - switch (this._scheme) { - case 'data': - case 'file': - case 'javascript': - case 'mailto': - return 'null'; - } - host = this.host; - if (!host) { - return ''; - } - return this._scheme + '://' + host; - } - }; - - // Copy over the static methods - var OriginalURL = scope.URL; - if (OriginalURL) { - jURL.createObjectURL = function(blob) { - // IE extension allows a second optional options argument. - // http://msdn.microsoft.com/en-us/library/ie/hh772302(v=vs.85).aspx - return OriginalURL.createObjectURL.apply(OriginalURL, arguments); - }; - jURL.revokeObjectURL = function(url) { - OriginalURL.revokeObjectURL(url); - }; - } - - scope.URL = jURL; - /* jshint ignore:end */ -})(globalScope); - - -var DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536 - -/** - * The maximum allowed image size in total pixels e.g. width * height. Images - * above this value will not be drawn. Use -1 for no limit. - * @var {number} - */ -PDFJS.maxImageSize = (PDFJS.maxImageSize === undefined ? - -1 : PDFJS.maxImageSize); - -/** - * The url of where the predefined Adobe CMaps are located. Include trailing - * slash. - * @var {string} - */ -PDFJS.cMapUrl = (PDFJS.cMapUrl === undefined ? null : PDFJS.cMapUrl); - -/** - * Specifies if CMaps are binary packed. - * @var {boolean} - */ -PDFJS.cMapPacked = PDFJS.cMapPacked === undefined ? false : PDFJS.cMapPacked; - -/** - * By default fonts are converted to OpenType fonts and loaded via font face - * rules. If disabled, the font will be rendered using a built in font renderer - * that constructs the glyphs with primitive path commands. - * @var {boolean} - */ -PDFJS.disableFontFace = (PDFJS.disableFontFace === undefined ? - false : PDFJS.disableFontFace); - -/** - * Path for image resources, mainly for annotation icons. Include trailing - * slash. - * @var {string} - */ -PDFJS.imageResourcesPath = (PDFJS.imageResourcesPath === undefined ? - '' : PDFJS.imageResourcesPath); - -/** - * Disable the web worker and run all code on the main thread. This will happen - * automatically if the browser doesn't support workers or sending typed arrays - * to workers. - * @var {boolean} - */ -PDFJS.disableWorker = (PDFJS.disableWorker === undefined ? - false : PDFJS.disableWorker); - -/** - * Path and filename of the worker file. Required when the worker is enabled in - * development mode. If unspecified in the production build, the worker will be - * loaded based on the location of the pdf.js file. It is recommended that - * the workerSrc is set in a custom application to prevent issues caused by - * third-party frameworks and libraries. - * @var {string} - */ -PDFJS.workerSrc = (PDFJS.workerSrc === undefined ? null : PDFJS.workerSrc); - -/** - * Disable range request loading of PDF files. When enabled and if the server - * supports partial content requests then the PDF will be fetched in chunks. - * Enabled (false) by default. - * @var {boolean} - */ -PDFJS.disableRange = (PDFJS.disableRange === undefined ? - false : PDFJS.disableRange); - -/** - * Disable streaming of PDF file data. By default PDF.js attempts to load PDF - * in chunks. This default behavior can be disabled. - * @var {boolean} - */ -PDFJS.disableStream = (PDFJS.disableStream === undefined ? - false : PDFJS.disableStream); - -/** - * Disable pre-fetching of PDF file data. When range requests are enabled PDF.js - * will automatically keep fetching more data even if it isn't needed to display - * the current page. This default behavior can be disabled. - * - * NOTE: It is also necessary to disable streaming, see above, - * in order for disabling of pre-fetching to work correctly. - * @var {boolean} - */ -PDFJS.disableAutoFetch = (PDFJS.disableAutoFetch === undefined ? - false : PDFJS.disableAutoFetch); - -/** - * Enables special hooks for debugging PDF.js. - * @var {boolean} - */ -PDFJS.pdfBug = (PDFJS.pdfBug === undefined ? false : PDFJS.pdfBug); - -/** - * Enables transfer usage in postMessage for ArrayBuffers. - * @var {boolean} - */ -PDFJS.postMessageTransfers = (PDFJS.postMessageTransfers === undefined ? - true : PDFJS.postMessageTransfers); - -/** - * Disables URL.createObjectURL usage. - * @var {boolean} - */ -PDFJS.disableCreateObjectURL = (PDFJS.disableCreateObjectURL === undefined ? - false : PDFJS.disableCreateObjectURL); - -/** - * Disables WebGL usage. - * @var {boolean} - */ -PDFJS.disableWebGL = (PDFJS.disableWebGL === undefined ? - true : PDFJS.disableWebGL); - -/** - * Disables fullscreen support, and by extension Presentation Mode, - * in browsers which support the fullscreen API. - * @var {boolean} - */ -PDFJS.disableFullscreen = (PDFJS.disableFullscreen === undefined ? - false : PDFJS.disableFullscreen); - -/** - * Enables CSS only zooming. - * @var {boolean} - */ -PDFJS.useOnlyCssZoom = (PDFJS.useOnlyCssZoom === undefined ? - false : PDFJS.useOnlyCssZoom); - -/** - * Controls the logging level. - * The constants from PDFJS.VERBOSITY_LEVELS should be used: - * - errors - * - warnings [default] - * - infos - * @var {number} - */ -PDFJS.verbosity = (PDFJS.verbosity === undefined ? - PDFJS.VERBOSITY_LEVELS.warnings : PDFJS.verbosity); - -/** - * The maximum supported canvas size in total pixels e.g. width * height. - * The default value is 4096 * 4096. Use -1 for no limit. - * @var {number} - */ -PDFJS.maxCanvasPixels = (PDFJS.maxCanvasPixels === undefined ? - 16777216 : PDFJS.maxCanvasPixels); - -/** - * (Deprecated) Opens external links in a new window if enabled. - * The default behavior opens external links in the PDF.js window. - * - * NOTE: This property has been deprecated, please use - * `PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK` instead. - * @var {boolean} - */ -PDFJS.openExternalLinksInNewWindow = ( - PDFJS.openExternalLinksInNewWindow === undefined ? - false : PDFJS.openExternalLinksInNewWindow); - -/** - * Specifies the |target| attribute for external links. - * The constants from PDFJS.LinkTarget should be used: - * - NONE [default] - * - SELF - * - BLANK - * - PARENT - * - TOP - * @var {number} - */ -PDFJS.externalLinkTarget = (PDFJS.externalLinkTarget === undefined ? - PDFJS.LinkTarget.NONE : PDFJS.externalLinkTarget); - -/** - * Determines if we can eval strings as JS. Primarily used to improve - * performance for font rendering. - * @var {boolean} - */ -PDFJS.isEvalSupported = (PDFJS.isEvalSupported === undefined ? - true : PDFJS.isEvalSupported); - -/** - * Document initialization / loading parameters object. - * - * @typedef {Object} DocumentInitParameters - * @property {string} url - The URL of the PDF. - * @property {TypedArray|Array|string} data - Binary PDF data. Use typed arrays - * (Uint8Array) to improve the memory usage. If PDF data is BASE64-encoded, - * use atob() to convert it to a binary string first. - * @property {Object} httpHeaders - Basic authentication headers. - * @property {boolean} withCredentials - Indicates whether or not cross-site - * Access-Control requests should be made using credentials such as cookies - * or authorization headers. The default is false. - * @property {string} password - For decrypting password-protected PDFs. - * @property {TypedArray} initialData - A typed array with the first portion or - * all of the pdf data. Used by the extension since some data is already - * loaded before the switch to range requests. - * @property {number} length - The PDF file length. It's used for progress - * reports and range requests operations. - * @property {PDFDataRangeTransport} range - * @property {number} rangeChunkSize - Optional parameter to specify - * maximum number of bytes fetched per range request. The default value is - * 2^16 = 65536. - * @property {PDFWorker} worker - The worker that will be used for the loading - * and parsing of the PDF data. - */ - -/** - * @typedef {Object} PDFDocumentStats - * @property {Array} streamTypes - Used stream types in the document (an item - * is set to true if specific stream ID was used in the document). - * @property {Array} fontTypes - Used font type in the document (an item is set - * to true if specific font ID was used in the document). - */ - -/** - * This is the main entry point for loading a PDF and interacting with it. - * NOTE: If a URL is used to fetch the PDF data a standard XMLHttpRequest(XHR) - * is used, which means it must follow the same origin rules that any XHR does - * e.g. No cross domain requests without CORS. - * - * @param {string|TypedArray|DocumentInitParameters|PDFDataRangeTransport} src - * Can be a url to where a PDF is located, a typed array (Uint8Array) - * already populated with data or parameter object. - * - * @param {PDFDataRangeTransport} pdfDataRangeTransport (deprecated) It is used - * if you want to manually serve range requests for data in the PDF. - * - * @param {function} passwordCallback (deprecated) It is used to request a - * password if wrong or no password was provided. The callback receives two - * parameters: function that needs to be called with new password and reason - * (see {PasswordResponses}). - * - * @param {function} progressCallback (deprecated) It is used to be able to - * monitor the loading progress of the PDF file (necessary to implement e.g. - * a loading bar). The callback receives an {Object} with the properties: - * {number} loaded and {number} total. - * - * @return {PDFDocumentLoadingTask} - */ -PDFJS.getDocument = function getDocument(src, - pdfDataRangeTransport, - passwordCallback, - progressCallback) { - var task = new PDFDocumentLoadingTask(); - - // Support of the obsolete arguments (for compatibility with API v1.0) - if (arguments.length > 1) { - deprecated('getDocument is called with pdfDataRangeTransport, ' + - 'passwordCallback or progressCallback argument'); - } - if (pdfDataRangeTransport) { - if (!(pdfDataRangeTransport instanceof PDFDataRangeTransport)) { - // Not a PDFDataRangeTransport instance, trying to add missing properties. - pdfDataRangeTransport = Object.create(pdfDataRangeTransport); - pdfDataRangeTransport.length = src.length; - pdfDataRangeTransport.initialData = src.initialData; - if (!pdfDataRangeTransport.abort) { - pdfDataRangeTransport.abort = function () {}; - } - } - src = Object.create(src); - src.range = pdfDataRangeTransport; - } - task.onPassword = passwordCallback || null; - task.onProgress = progressCallback || null; - - var source; - if (typeof src === 'string') { - source = { url: src }; - } else if (isArrayBuffer(src)) { - source = { data: src }; - } else if (src instanceof PDFDataRangeTransport) { - source = { range: src }; - } else { - if (typeof src !== 'object') { - error('Invalid parameter in getDocument, need either Uint8Array, ' + - 'string or a parameter object'); - } - if (!src.url && !src.data && !src.range) { - error('Invalid parameter object: need either .data, .range or .url'); - } - - source = src; - } - - var params = {}; - var rangeTransport = null; - var worker = null; - for (var key in source) { - if (key === 'url' && typeof window !== 'undefined') { - // The full path is required in the 'url' field. - params[key] = combineUrl(window.location.href, source[key]); - continue; - } else if (key === 'range') { - rangeTransport = source[key]; - continue; - } else if (key === 'worker') { - worker = source[key]; - continue; - } else if (key === 'data' && !(source[key] instanceof Uint8Array)) { - // Converting string or array-like data to Uint8Array. - var pdfBytes = source[key]; - if (typeof pdfBytes === 'string') { - params[key] = stringToBytes(pdfBytes); - } else if (typeof pdfBytes === 'object' && pdfBytes !== null && - !isNaN(pdfBytes.length)) { - params[key] = new Uint8Array(pdfBytes); - } else if (isArrayBuffer(pdfBytes)) { - params[key] = new Uint8Array(pdfBytes); - } else { - error('Invalid PDF binary data: either typed array, string or ' + - 'array-like object is expected in the data property.'); - } - continue; - } - params[key] = source[key]; - } - - params.rangeChunkSize = params.rangeChunkSize || DEFAULT_RANGE_CHUNK_SIZE; - - if (!worker) { - // Worker was not provided -- creating and owning our own. - worker = new PDFWorker(); - task._worker = worker; - } - var docId = task.docId; - worker.promise.then(function () { - if (task.destroyed) { - throw new Error('Loading aborted'); - } - return _fetchDocument(worker, params, rangeTransport, docId).then( - function (workerId) { - if (task.destroyed) { - throw new Error('Loading aborted'); - } - var messageHandler = new MessageHandler(docId, workerId, worker.port); - messageHandler.send('Ready', null); - var transport = new WorkerTransport(messageHandler, task, rangeTransport); - task._transport = transport; - }); - }, task._capability.reject); - - return task; -}; - -/** - * Starts fetching of specified PDF document/data. - * @param {PDFWorker} worker - * @param {Object} source - * @param {PDFDataRangeTransport} pdfDataRangeTransport - * @param {string} docId Unique document id, used as MessageHandler id. - * @returns {Promise} The promise, which is resolved when worker id of - * MessageHandler is known. - * @private - */ -function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { - if (worker.destroyed) { - return Promise.reject(new Error('Worker was destroyed')); - } - - source.disableAutoFetch = PDFJS.disableAutoFetch; - source.disableStream = PDFJS.disableStream; - source.chunkedViewerLoading = !!pdfDataRangeTransport; - if (pdfDataRangeTransport) { - source.length = pdfDataRangeTransport.length; - source.initialData = pdfDataRangeTransport.initialData; - } - return worker.messageHandler.sendWithPromise('GetDocRequest', { - docId: docId, - source: source, - disableRange: PDFJS.disableRange, - maxImageSize: PDFJS.maxImageSize, - cMapUrl: PDFJS.cMapUrl, - cMapPacked: PDFJS.cMapPacked, - disableFontFace: PDFJS.disableFontFace, - disableCreateObjectURL: PDFJS.disableCreateObjectURL, - verbosity: PDFJS.verbosity - }).then(function (workerId) { - if (worker.destroyed) { - throw new Error('Worker was destroyed'); - } - return workerId; - }); -} - -/** - * PDF document loading operation. - * @class - * @alias PDFDocumentLoadingTask - */ -var PDFDocumentLoadingTask = (function PDFDocumentLoadingTaskClosure() { - var nextDocumentId = 0; - - /** @constructs PDFDocumentLoadingTask */ - function PDFDocumentLoadingTask() { - this._capability = createPromiseCapability(); - this._transport = null; - this._worker = null; - - /** - * Unique document loading task id -- used in MessageHandlers. - * @type {string} - */ - this.docId = 'd' + (nextDocumentId++); - - /** - * Shows if loading task is destroyed. - * @type {boolean} - */ - this.destroyed = false; - - /** - * Callback to request a password if wrong or no password was provided. - * The callback receives two parameters: function that needs to be called - * with new password and reason (see {PasswordResponses}). - */ - this.onPassword = null; - - /** - * Callback to be able to monitor the loading progress of the PDF file - * (necessary to implement e.g. a loading bar). The callback receives - * an {Object} with the properties: {number} loaded and {number} total. - */ - this.onProgress = null; - - /** - * Callback to when unsupported feature is used. The callback receives - * an {PDFJS.UNSUPPORTED_FEATURES} argument. - */ - this.onUnsupportedFeature = null; - } - - PDFDocumentLoadingTask.prototype = - /** @lends PDFDocumentLoadingTask.prototype */ { - /** - * @return {Promise} - */ - get promise() { - return this._capability.promise; - }, - - /** - * Aborts all network requests and destroys worker. - * @return {Promise} A promise that is resolved after destruction activity - * is completed. - */ - destroy: function () { - this.destroyed = true; - - var transportDestroyed = !this._transport ? Promise.resolve() : - this._transport.destroy(); - return transportDestroyed.then(function () { - this._transport = null; - if (this._worker) { - this._worker.destroy(); - this._worker = null; - } - }.bind(this)); - }, - - /** - * Registers callbacks to indicate the document loading completion. - * - * @param {function} onFulfilled The callback for the loading completion. - * @param {function} onRejected The callback for the loading failure. - * @return {Promise} A promise that is resolved after the onFulfilled or - * onRejected callback. - */ - then: function PDFDocumentLoadingTask_then(onFulfilled, onRejected) { - return this.promise.then.apply(this.promise, arguments); - } - }; - - return PDFDocumentLoadingTask; -})(); - -/** - * Abstract class to support range requests file loading. - * @class - * @alias PDFJS.PDFDataRangeTransport - * @param {number} length - * @param {Uint8Array} initialData - */ -var PDFDataRangeTransport = (function pdfDataRangeTransportClosure() { - function PDFDataRangeTransport(length, initialData) { - this.length = length; - this.initialData = initialData; - - this._rangeListeners = []; - this._progressListeners = []; - this._progressiveReadListeners = []; - this._readyCapability = createPromiseCapability(); - } - PDFDataRangeTransport.prototype = - /** @lends PDFDataRangeTransport.prototype */ { - addRangeListener: - function PDFDataRangeTransport_addRangeListener(listener) { - this._rangeListeners.push(listener); - }, - - addProgressListener: - function PDFDataRangeTransport_addProgressListener(listener) { - this._progressListeners.push(listener); - }, - - addProgressiveReadListener: - function PDFDataRangeTransport_addProgressiveReadListener(listener) { - this._progressiveReadListeners.push(listener); - }, - - onDataRange: function PDFDataRangeTransport_onDataRange(begin, chunk) { - var listeners = this._rangeListeners; - for (var i = 0, n = listeners.length; i < n; ++i) { - listeners[i](begin, chunk); - } - }, - - onDataProgress: function PDFDataRangeTransport_onDataProgress(loaded) { - this._readyCapability.promise.then(function () { - var listeners = this._progressListeners; - for (var i = 0, n = listeners.length; i < n; ++i) { - listeners[i](loaded); - } - }.bind(this)); - }, - - onDataProgressiveRead: - function PDFDataRangeTransport_onDataProgress(chunk) { - this._readyCapability.promise.then(function () { - var listeners = this._progressiveReadListeners; - for (var i = 0, n = listeners.length; i < n; ++i) { - listeners[i](chunk); - } - }.bind(this)); - }, - - transportReady: function PDFDataRangeTransport_transportReady() { - this._readyCapability.resolve(); - }, - - requestDataRange: - function PDFDataRangeTransport_requestDataRange(begin, end) { - throw new Error('Abstract method PDFDataRangeTransport.requestDataRange'); - }, - - abort: function PDFDataRangeTransport_abort() { - } - }; - return PDFDataRangeTransport; -})(); - -PDFJS.PDFDataRangeTransport = PDFDataRangeTransport; - -/** - * Proxy to a PDFDocument in the worker thread. Also, contains commonly used - * properties that can be read synchronously. - * @class - * @alias PDFDocumentProxy - */ -var PDFDocumentProxy = (function PDFDocumentProxyClosure() { - function PDFDocumentProxy(pdfInfo, transport, loadingTask) { - this.pdfInfo = pdfInfo; - this.transport = transport; - this.loadingTask = loadingTask; - } - PDFDocumentProxy.prototype = /** @lends PDFDocumentProxy.prototype */ { - /** - * @return {number} Total number of pages the PDF contains. - */ - get numPages() { - return this.pdfInfo.numPages; - }, - /** - * @return {string} A unique ID to identify a PDF. Not guaranteed to be - * unique. - */ - get fingerprint() { - return this.pdfInfo.fingerprint; - }, - /** - * @param {number} pageNumber The page number to get. The first page is 1. - * @return {Promise} A promise that is resolved with a {@link PDFPageProxy} - * object. - */ - getPage: function PDFDocumentProxy_getPage(pageNumber) { - return this.transport.getPage(pageNumber); - }, - /** - * @param {{num: number, gen: number}} ref The page reference. Must have - * the 'num' and 'gen' properties. - * @return {Promise} A promise that is resolved with the page index that is - * associated with the reference. - */ - getPageIndex: function PDFDocumentProxy_getPageIndex(ref) { - return this.transport.getPageIndex(ref); - }, - /** - * @return {Promise} A promise that is resolved with a lookup table for - * mapping named destinations to reference numbers. - * - * This can be slow for large documents: use getDestination instead - */ - getDestinations: function PDFDocumentProxy_getDestinations() { - return this.transport.getDestinations(); - }, - /** - * @param {string} id The named destination to get. - * @return {Promise} A promise that is resolved with all information - * of the given named destination. - */ - getDestination: function PDFDocumentProxy_getDestination(id) { - return this.transport.getDestination(id); - }, - /** - * @return {Promise} A promise that is resolved with a lookup table for - * mapping named attachments to their content. - */ - getAttachments: function PDFDocumentProxy_getAttachments() { - return this.transport.getAttachments(); - }, - /** - * @return {Promise} A promise that is resolved with an array of all the - * JavaScript strings in the name tree. - */ - getJavaScript: function PDFDocumentProxy_getJavaScript() { - return this.transport.getJavaScript(); - }, - /** - * @return {Promise} A promise that is resolved with an {Array} that is a - * tree outline (if it has one) of the PDF. The tree is in the format of: - * [ - * { - * title: string, - * bold: boolean, - * italic: boolean, - * color: rgb array, - * dest: dest obj, - * items: array of more items like this - * }, - * ... - * ]. - */ - getOutline: function PDFDocumentProxy_getOutline() { - return this.transport.getOutline(); - }, - /** - * @return {Promise} A promise that is resolved with an {Object} that has - * info and metadata properties. Info is an {Object} filled with anything - * available in the information dictionary and similarly metadata is a - * {Metadata} object with information from the metadata section of the PDF. - */ - getMetadata: function PDFDocumentProxy_getMetadata() { - return this.transport.getMetadata(); - }, - /** - * @return {Promise} A promise that is resolved with a TypedArray that has - * the raw data from the PDF. - */ - getData: function PDFDocumentProxy_getData() { - return this.transport.getData(); - }, - /** - * @return {Promise} A promise that is resolved when the document's data - * is loaded. It is resolved with an {Object} that contains the length - * property that indicates size of the PDF data in bytes. - */ - getDownloadInfo: function PDFDocumentProxy_getDownloadInfo() { - return this.transport.downloadInfoCapability.promise; - }, - /** - * @return {Promise} A promise this is resolved with current stats about - * document structures (see {@link PDFDocumentStats}). - */ - getStats: function PDFDocumentProxy_getStats() { - return this.transport.getStats(); - }, - /** - * Cleans up resources allocated by the document, e.g. created @font-face. - */ - cleanup: function PDFDocumentProxy_cleanup() { - this.transport.startCleanup(); - }, - /** - * Destroys current document instance and terminates worker. - */ - destroy: function PDFDocumentProxy_destroy() { - return this.loadingTask.destroy(); - } - }; - return PDFDocumentProxy; -})(); - -/** - * Page getTextContent parameters. - * - * @typedef {Object} getTextContentParameters - * @param {boolean} normalizeWhitespace - replaces all occurrences of - * whitespace with standard spaces (0x20). The default value is `false`. - */ - -/** - * Page text content. - * - * @typedef {Object} TextContent - * @property {array} items - array of {@link TextItem} - * @property {Object} styles - {@link TextStyles} objects, indexed by font - * name. - */ - -/** - * Page text content part. - * - * @typedef {Object} TextItem - * @property {string} str - text content. - * @property {string} dir - text direction: 'ttb', 'ltr' or 'rtl'. - * @property {array} transform - transformation matrix. - * @property {number} width - width in device space. - * @property {number} height - height in device space. - * @property {string} fontName - font name used by pdf.js for converted font. - */ - -/** - * Text style. - * - * @typedef {Object} TextStyle - * @property {number} ascent - font ascent. - * @property {number} descent - font descent. - * @property {boolean} vertical - text is in vertical mode. - * @property {string} fontFamily - possible font family - */ - -/** - * Page annotation parameters. - * - * @typedef {Object} GetAnnotationsParameters - * @param {string} intent - Determines the annotations that will be fetched, - * can be either 'display' (viewable annotations) or 'print' - * (printable annotations). - * If the parameter is omitted, all annotations are fetched. - */ - -/** - * Page render parameters. - * - * @typedef {Object} RenderParameters - * @property {Object} canvasContext - A 2D context of a DOM Canvas object. - * @property {PDFJS.PageViewport} viewport - Rendering viewport obtained by - * calling of PDFPage.getViewport method. - * @property {string} intent - Rendering intent, can be 'display' or 'print' - * (default value is 'display'). - * @property {Array} transform - (optional) Additional transform, applied - * just before viewport transform. - * @property {Object} imageLayer - (optional) An object that has beginLayout, - * endLayout and appendImage functions. - * @property {function} continueCallback - (deprecated) A function that will be - * called each time the rendering is paused. To continue - * rendering call the function that is the first argument - * to the callback. - */ - -/** - * PDF page operator list. - * - * @typedef {Object} PDFOperatorList - * @property {Array} fnArray - Array containing the operator functions. - * @property {Array} argsArray - Array containing the arguments of the - * functions. - */ - -/** - * Proxy to a PDFPage in the worker thread. - * @class - * @alias PDFPageProxy - */ -var PDFPageProxy = (function PDFPageProxyClosure() { - function PDFPageProxy(pageIndex, pageInfo, transport) { - this.pageIndex = pageIndex; - this.pageInfo = pageInfo; - this.transport = transport; - this.stats = new StatTimer(); - this.stats.enabled = !!globalScope.PDFJS.enableStats; - this.commonObjs = transport.commonObjs; - this.objs = new PDFObjects(); - this.cleanupAfterRender = false; - this.pendingCleanup = false; - this.intentStates = {}; - this.destroyed = false; - } - PDFPageProxy.prototype = /** @lends PDFPageProxy.prototype */ { - /** - * @return {number} Page number of the page. First page is 1. - */ - get pageNumber() { - return this.pageIndex + 1; - }, - /** - * @return {number} The number of degrees the page is rotated clockwise. - */ - get rotate() { - return this.pageInfo.rotate; - }, - /** - * @return {Object} The reference that points to this page. It has 'num' and - * 'gen' properties. - */ - get ref() { - return this.pageInfo.ref; - }, - /** - * @return {Array} An array of the visible portion of the PDF page in the - * user space units - [x1, y1, x2, y2]. - */ - get view() { - return this.pageInfo.view; - }, - /** - * @param {number} scale The desired scale of the viewport. - * @param {number} rotate Degrees to rotate the viewport. If omitted this - * defaults to the page rotation. - * @return {PDFJS.PageViewport} Contains 'width' and 'height' properties - * along with transforms required for rendering. - */ - getViewport: function PDFPageProxy_getViewport(scale, rotate) { - if (arguments.length < 2) { - rotate = this.rotate; - } - return new PDFJS.PageViewport(this.view, scale, rotate, 0, 0); - }, - /** - * @param {GetAnnotationsParameters} params - Annotation parameters. - * @return {Promise} A promise that is resolved with an {Array} of the - * annotation objects. - */ - getAnnotations: function PDFPageProxy_getAnnotations(params) { - var intent = (params && params.intent) || null; - - if (!this.annotationsPromise || this.annotationsIntent !== intent) { - this.annotationsPromise = this.transport.getAnnotations(this.pageIndex, - intent); - this.annotationsIntent = intent; - } - return this.annotationsPromise; - }, - /** - * Begins the process of rendering a page to the desired context. - * @param {RenderParameters} params Page render parameters. - * @return {RenderTask} An object that contains the promise, which - * is resolved when the page finishes rendering. - */ - render: function PDFPageProxy_render(params) { - var stats = this.stats; - stats.time('Overall'); - - // If there was a pending destroy cancel it so no cleanup happens during - // this call to render. - this.pendingCleanup = false; - - var renderingIntent = (params.intent === 'print' ? 'print' : 'display'); - - if (!this.intentStates[renderingIntent]) { - this.intentStates[renderingIntent] = {}; - } - var intentState = this.intentStates[renderingIntent]; - - // If there's no displayReadyCapability yet, then the operatorList - // was never requested before. Make the request and create the promise. - if (!intentState.displayReadyCapability) { - intentState.receivingOperatorList = true; - intentState.displayReadyCapability = createPromiseCapability(); - intentState.operatorList = { - fnArray: [], - argsArray: [], - lastChunk: false - }; - - this.stats.time('Page Request'); - this.transport.messageHandler.send('RenderPageRequest', { - pageIndex: this.pageNumber - 1, - intent: renderingIntent - }); - } - - var internalRenderTask = new InternalRenderTask(complete, params, - this.objs, - this.commonObjs, - intentState.operatorList, - this.pageNumber); - internalRenderTask.useRequestAnimationFrame = renderingIntent !== 'print'; - if (!intentState.renderTasks) { - intentState.renderTasks = []; - } - intentState.renderTasks.push(internalRenderTask); - var renderTask = internalRenderTask.task; - - // Obsolete parameter support - if (params.continueCallback) { - deprecated('render is used with continueCallback parameter'); - renderTask.onContinue = params.continueCallback; - } - - var self = this; - intentState.displayReadyCapability.promise.then( - function pageDisplayReadyPromise(transparency) { - if (self.pendingCleanup) { - complete(); - return; - } - stats.time('Rendering'); - internalRenderTask.initalizeGraphics(transparency); - internalRenderTask.operatorListChanged(); - }, - function pageDisplayReadPromiseError(reason) { - complete(reason); - } - ); - - function complete(error) { - var i = intentState.renderTasks.indexOf(internalRenderTask); - if (i >= 0) { - intentState.renderTasks.splice(i, 1); - } - - if (self.cleanupAfterRender) { - self.pendingCleanup = true; - } - self._tryCleanup(); - - if (error) { - internalRenderTask.capability.reject(error); - } else { - internalRenderTask.capability.resolve(); - } - stats.timeEnd('Rendering'); - stats.timeEnd('Overall'); - } - - return renderTask; - }, - - /** - * @return {Promise} A promise resolved with an {@link PDFOperatorList} - * object that represents page's operator list. - */ - getOperatorList: function PDFPageProxy_getOperatorList() { - function operatorListChanged() { - if (intentState.operatorList.lastChunk) { - intentState.opListReadCapability.resolve(intentState.operatorList); - } - } - - var renderingIntent = 'oplist'; - if (!this.intentStates[renderingIntent]) { - this.intentStates[renderingIntent] = {}; - } - var intentState = this.intentStates[renderingIntent]; - - if (!intentState.opListReadCapability) { - var opListTask = {}; - opListTask.operatorListChanged = operatorListChanged; - intentState.receivingOperatorList = true; - intentState.opListReadCapability = createPromiseCapability(); - intentState.renderTasks = []; - intentState.renderTasks.push(opListTask); - intentState.operatorList = { - fnArray: [], - argsArray: [], - lastChunk: false - }; - - this.transport.messageHandler.send('RenderPageRequest', { - pageIndex: this.pageIndex, - intent: renderingIntent - }); - } - return intentState.opListReadCapability.promise; - }, - - /** - * @param {getTextContentParameters} params - getTextContent parameters. - * @return {Promise} That is resolved a {@link TextContent} - * object that represent the page text content. - */ - getTextContent: function PDFPageProxy_getTextContent(params) { - var normalizeWhitespace = (params && params.normalizeWhitespace) || false; - - return this.transport.messageHandler.sendWithPromise('GetTextContent', { - pageIndex: this.pageNumber - 1, - normalizeWhitespace: normalizeWhitespace, - }); - }, - - /** - * Destroys page object. - */ - _destroy: function PDFPageProxy_destroy() { - this.destroyed = true; - this.transport.pageCache[this.pageIndex] = null; - - var waitOn = []; - Object.keys(this.intentStates).forEach(function(intent) { - var intentState = this.intentStates[intent]; - intentState.renderTasks.forEach(function(renderTask) { - var renderCompleted = renderTask.capability.promise. - catch(function () {}); // ignoring failures - waitOn.push(renderCompleted); - renderTask.cancel(); - }); - }, this); - this.objs.clear(); - this.annotationsPromise = null; - this.pendingCleanup = false; - return Promise.all(waitOn); - }, - - /** - * Cleans up resources allocated by the page. (deprecated) - */ - destroy: function() { - deprecated('page destroy method, use cleanup() instead'); - this.cleanup(); - }, - - /** - * Cleans up resources allocated by the page. - */ - cleanup: function PDFPageProxy_cleanup() { - this.pendingCleanup = true; - this._tryCleanup(); - }, - /** - * For internal use only. Attempts to clean up if rendering is in a state - * where that's possible. - * @ignore - */ - _tryCleanup: function PDFPageProxy_tryCleanup() { - if (!this.pendingCleanup || - Object.keys(this.intentStates).some(function(intent) { - var intentState = this.intentStates[intent]; - return (intentState.renderTasks.length !== 0 || - intentState.receivingOperatorList); - }, this)) { - return; - } - - Object.keys(this.intentStates).forEach(function(intent) { - delete this.intentStates[intent]; - }, this); - this.objs.clear(); - this.annotationsPromise = null; - this.pendingCleanup = false; - }, - /** - * For internal use only. - * @ignore - */ - _startRenderPage: function PDFPageProxy_startRenderPage(transparency, - intent) { - var intentState = this.intentStates[intent]; - // TODO Refactor RenderPageRequest to separate rendering - // and operator list logic - if (intentState.displayReadyCapability) { - intentState.displayReadyCapability.resolve(transparency); - } - }, - /** - * For internal use only. - * @ignore - */ - _renderPageChunk: function PDFPageProxy_renderPageChunk(operatorListChunk, - intent) { - var intentState = this.intentStates[intent]; - var i, ii; - // Add the new chunk to the current operator list. - for (i = 0, ii = operatorListChunk.length; i < ii; i++) { - intentState.operatorList.fnArray.push(operatorListChunk.fnArray[i]); - intentState.operatorList.argsArray.push( - operatorListChunk.argsArray[i]); - } - intentState.operatorList.lastChunk = operatorListChunk.lastChunk; - - // Notify all the rendering tasks there are more operators to be consumed. - for (i = 0; i < intentState.renderTasks.length; i++) { - intentState.renderTasks[i].operatorListChanged(); - } - - if (operatorListChunk.lastChunk) { - intentState.receivingOperatorList = false; - this._tryCleanup(); - } - } - }; - return PDFPageProxy; -})(); - -/** - * PDF.js web worker abstraction, it controls instantiation of PDF documents and - * WorkerTransport for them. If creation of a web worker is not possible, - * a "fake" worker will be used instead. - * @class - */ -var PDFWorker = (function PDFWorkerClosure() { - var nextFakeWorkerId = 0; - - // Loads worker code into main thread. - function setupFakeWorkerGlobal() { - if (!PDFJS.fakeWorkerFilesLoadedCapability) { - PDFJS.fakeWorkerFilesLoadedCapability = createPromiseCapability(); - // In the developer build load worker_loader which in turn loads all the - // other files and resolves the promise. In production only the - // pdf.worker.js file is needed. - Util.loadScript(PDFJS.workerSrc, function() { - PDFJS.fakeWorkerFilesLoadedCapability.resolve(); - }); - } - return PDFJS.fakeWorkerFilesLoadedCapability.promise; - } - - function PDFWorker(name) { - this.name = name; - this.destroyed = false; - - this._readyCapability = createPromiseCapability(); - this._port = null; - this._webWorker = null; - this._messageHandler = null; - this._initialize(); - } - - PDFWorker.prototype = /** @lends PDFWorker.prototype */ { - get promise() { - return this._readyCapability.promise; - }, - - get port() { - return this._port; - }, - - get messageHandler() { - return this._messageHandler; - }, - - _initialize: function PDFWorker_initialize() { - // If worker support isn't disabled explicit and the browser has worker - // support, create a new web worker and test if it/the browser fullfills - // all requirements to run parts of pdf.js in a web worker. - // Right now, the requirement is, that an Uint8Array is still an - // Uint8Array as it arrives on the worker. (Chrome added this with v.15.) - if (!globalScope.PDFJS.disableWorker && typeof Worker !== 'undefined') { - var workerSrc = PDFJS.workerSrc; - if (!workerSrc) { - error('No PDFJS.workerSrc specified'); - } - - try { - // Some versions of FF can't create a worker on localhost, see: - // https://bugzilla.mozilla.org/show_bug.cgi?id=683280 - var worker = new Worker(workerSrc); - var messageHandler = new MessageHandler('main', 'worker', worker); - - messageHandler.on('test', function PDFWorker_test(data) { - if (this.destroyed) { - this._readyCapability.reject(new Error('Worker was destroyed')); - messageHandler.destroy(); - worker.terminate(); - return; // worker was destroyed - } - var supportTypedArray = data && data.supportTypedArray; - if (supportTypedArray) { - this._messageHandler = messageHandler; - this._port = worker; - this._webWorker = worker; - if (!data.supportTransfers) { - PDFJS.postMessageTransfers = false; - } - this._readyCapability.resolve(); - } else { - this._setupFakeWorker(); - messageHandler.destroy(); - worker.terminate(); - } - }.bind(this)); - - messageHandler.on('console_log', function (data) { - console.log.apply(console, data); - }); - messageHandler.on('console_error', function (data) { - console.error.apply(console, data); - }); - - var testObj = new Uint8Array([PDFJS.postMessageTransfers ? 255 : 0]); - // Some versions of Opera throw a DATA_CLONE_ERR on serializing the - // typed array. Also, checking if we can use transfers. - try { - messageHandler.send('test', testObj, [testObj.buffer]); - } catch (ex) { - info('Cannot use postMessage transfers'); - testObj[0] = 0; - messageHandler.send('test', testObj); - } - return; - } catch (e) { - info('The worker has been disabled.'); - } - } - // Either workers are disabled, not supported or have thrown an exception. - // Thus, we fallback to a faked worker. - this._setupFakeWorker(); - }, - - _setupFakeWorker: function PDFWorker_setupFakeWorker() { - warn('Setting up fake worker.'); - globalScope.PDFJS.disableWorker = true; - - setupFakeWorkerGlobal().then(function () { - if (this.destroyed) { - this._readyCapability.reject(new Error('Worker was destroyed')); - return; - } - - // If we don't use a worker, just post/sendMessage to the main thread. - var port = { - _listeners: [], - postMessage: function (obj) { - var e = {data: obj}; - this._listeners.forEach(function (listener) { - listener.call(this, e); - }, this); - }, - addEventListener: function (name, listener) { - this._listeners.push(listener); - }, - removeEventListener: function (name, listener) { - var i = this._listeners.indexOf(listener); - this._listeners.splice(i, 1); - }, - terminate: function () {} - }; - this._port = port; - - // All fake workers use the same port, making id unique. - var id = 'fake' + (nextFakeWorkerId++); - - // If the main thread is our worker, setup the handling for the - // messages -- the main thread sends to it self. - var workerHandler = new MessageHandler(id + '_worker', id, port); - PDFJS.WorkerMessageHandler.setup(workerHandler, port); - - var messageHandler = new MessageHandler(id, id + '_worker', port); - this._messageHandler = messageHandler; - this._readyCapability.resolve(); - }.bind(this)); - }, - - /** - * Destroys the worker instance. - */ - destroy: function PDFWorker_destroy() { - this.destroyed = true; - if (this._webWorker) { - // We need to terminate only web worker created resource. - this._webWorker.terminate(); - this._webWorker = null; - } - this._port = null; - if (this._messageHandler) { - this._messageHandler.destroy(); - this._messageHandler = null; - } - } - }; - - return PDFWorker; -})(); -PDFJS.PDFWorker = PDFWorker; - -/** - * For internal use only. - * @ignore - */ -var WorkerTransport = (function WorkerTransportClosure() { - function WorkerTransport(messageHandler, loadingTask, pdfDataRangeTransport) { - this.messageHandler = messageHandler; - this.loadingTask = loadingTask; - this.pdfDataRangeTransport = pdfDataRangeTransport; - this.commonObjs = new PDFObjects(); - this.fontLoader = new FontLoader(loadingTask.docId); - - this.destroyed = false; - this.destroyCapability = null; - - this.pageCache = []; - this.pagePromises = []; - this.downloadInfoCapability = createPromiseCapability(); - - this.setupMessageHandler(); - } - WorkerTransport.prototype = { - destroy: function WorkerTransport_destroy() { - if (this.destroyCapability) { - return this.destroyCapability.promise; - } - - this.destroyed = true; - this.destroyCapability = createPromiseCapability(); - - var waitOn = []; - // We need to wait for all renderings to be completed, e.g. - // timeout/rAF can take a long time. - this.pageCache.forEach(function (page) { - if (page) { - waitOn.push(page._destroy()); - } - }); - this.pageCache = []; - this.pagePromises = []; - var self = this; - // We also need to wait for the worker to finish its long running tasks. - var terminated = this.messageHandler.sendWithPromise('Terminate', null); - waitOn.push(terminated); - Promise.all(waitOn).then(function () { - self.fontLoader.clear(); - if (self.pdfDataRangeTransport) { - self.pdfDataRangeTransport.abort(); - self.pdfDataRangeTransport = null; - } - if (self.messageHandler) { - self.messageHandler.destroy(); - self.messageHandler = null; - } - self.destroyCapability.resolve(); - }, this.destroyCapability.reject); - return this.destroyCapability.promise; - }, - - setupMessageHandler: - function WorkerTransport_setupMessageHandler() { - var messageHandler = this.messageHandler; - - function updatePassword(password) { - messageHandler.send('UpdatePassword', password); - } - - var pdfDataRangeTransport = this.pdfDataRangeTransport; - if (pdfDataRangeTransport) { - pdfDataRangeTransport.addRangeListener(function(begin, chunk) { - messageHandler.send('OnDataRange', { - begin: begin, - chunk: chunk - }); - }); - - pdfDataRangeTransport.addProgressListener(function(loaded) { - messageHandler.send('OnDataProgress', { - loaded: loaded - }); - }); - - pdfDataRangeTransport.addProgressiveReadListener(function(chunk) { - messageHandler.send('OnDataRange', { - chunk: chunk - }); - }); - - messageHandler.on('RequestDataRange', - function transportDataRange(data) { - pdfDataRangeTransport.requestDataRange(data.begin, data.end); - }, this); - } - - messageHandler.on('GetDoc', function transportDoc(data) { - var pdfInfo = data.pdfInfo; - this.numPages = data.pdfInfo.numPages; - var loadingTask = this.loadingTask; - var pdfDocument = new PDFDocumentProxy(pdfInfo, this, loadingTask); - this.pdfDocument = pdfDocument; - loadingTask._capability.resolve(pdfDocument); - }, this); - - messageHandler.on('NeedPassword', - function transportNeedPassword(exception) { - var loadingTask = this.loadingTask; - if (loadingTask.onPassword) { - return loadingTask.onPassword(updatePassword, - PasswordResponses.NEED_PASSWORD); - } - loadingTask._capability.reject( - new PasswordException(exception.message, exception.code)); - }, this); - - messageHandler.on('IncorrectPassword', - function transportIncorrectPassword(exception) { - var loadingTask = this.loadingTask; - if (loadingTask.onPassword) { - return loadingTask.onPassword(updatePassword, - PasswordResponses.INCORRECT_PASSWORD); - } - loadingTask._capability.reject( - new PasswordException(exception.message, exception.code)); - }, this); - - messageHandler.on('InvalidPDF', function transportInvalidPDF(exception) { - this.loadingTask._capability.reject( - new InvalidPDFException(exception.message)); - }, this); - - messageHandler.on('MissingPDF', function transportMissingPDF(exception) { - this.loadingTask._capability.reject( - new MissingPDFException(exception.message)); - }, this); - - messageHandler.on('UnexpectedResponse', - function transportUnexpectedResponse(exception) { - this.loadingTask._capability.reject( - new UnexpectedResponseException(exception.message, exception.status)); - }, this); - - messageHandler.on('UnknownError', - function transportUnknownError(exception) { - this.loadingTask._capability.reject( - new UnknownErrorException(exception.message, exception.details)); - }, this); - - messageHandler.on('DataLoaded', function transportPage(data) { - this.downloadInfoCapability.resolve(data); - }, this); - - messageHandler.on('PDFManagerReady', function transportPage(data) { - if (this.pdfDataRangeTransport) { - this.pdfDataRangeTransport.transportReady(); - } - }, this); - - messageHandler.on('StartRenderPage', function transportRender(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - var page = this.pageCache[data.pageIndex]; - - page.stats.timeEnd('Page Request'); - page._startRenderPage(data.transparency, data.intent); - }, this); - - messageHandler.on('RenderPageChunk', function transportRender(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - var page = this.pageCache[data.pageIndex]; - - page._renderPageChunk(data.operatorList, data.intent); - }, this); - - messageHandler.on('commonobj', function transportObj(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - - var id = data[0]; - var type = data[1]; - if (this.commonObjs.hasData(id)) { - return; - } - - switch (type) { - case 'Font': - var exportedData = data[2]; - - var font; - if ('error' in exportedData) { - var error = exportedData.error; - warn('Error during font loading: ' + error); - this.commonObjs.resolve(id, error); - break; - } else { - font = new FontFaceObject(exportedData); - } - - this.fontLoader.bind( - [font], - function fontReady(fontObjs) { - this.commonObjs.resolve(id, font); - }.bind(this) - ); - break; - case 'FontPath': - this.commonObjs.resolve(id, data[2]); - break; - default: - error('Got unknown common object type ' + type); - } - }, this); - - messageHandler.on('obj', function transportObj(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - - var id = data[0]; - var pageIndex = data[1]; - var type = data[2]; - var pageProxy = this.pageCache[pageIndex]; - var imageData; - if (pageProxy.objs.hasData(id)) { - return; - } - - switch (type) { - case 'JpegStream': - imageData = data[3]; - loadJpegStream(id, imageData, pageProxy.objs); - break; - case 'Image': - imageData = data[3]; - pageProxy.objs.resolve(id, imageData); - - // heuristics that will allow not to store large data - var MAX_IMAGE_SIZE_TO_STORE = 8000000; - if (imageData && 'data' in imageData && - imageData.data.length > MAX_IMAGE_SIZE_TO_STORE) { - pageProxy.cleanupAfterRender = true; - } - break; - default: - error('Got unknown object type ' + type); - } - }, this); - - messageHandler.on('DocProgress', function transportDocProgress(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - - var loadingTask = this.loadingTask; - if (loadingTask.onProgress) { - loadingTask.onProgress({ - loaded: data.loaded, - total: data.total - }); - } - }, this); - - messageHandler.on('PageError', function transportError(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - - var page = this.pageCache[data.pageNum - 1]; - var intentState = page.intentStates[data.intent]; - if (intentState.displayReadyCapability) { - intentState.displayReadyCapability.reject(data.error); - } else { - error(data.error); - } - }, this); - - messageHandler.on('UnsupportedFeature', - function transportUnsupportedFeature(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - var featureId = data.featureId; - var loadingTask = this.loadingTask; - if (loadingTask.onUnsupportedFeature) { - loadingTask.onUnsupportedFeature(featureId); - } - PDFJS.UnsupportedManager.notify(featureId); - }, this); - - messageHandler.on('JpegDecode', function(data) { - if (this.destroyed) { - return Promise.reject('Worker was terminated'); - } - - var imageUrl = data[0]; - var components = data[1]; - if (components !== 3 && components !== 1) { - return Promise.reject( - new Error('Only 3 components or 1 component can be returned')); - } - - return new Promise(function (resolve, reject) { - var img = new Image(); - img.onload = function () { - var width = img.width; - var height = img.height; - var size = width * height; - var rgbaLength = size * 4; - var buf = new Uint8Array(size * components); - var tmpCanvas = createScratchCanvas(width, height); - var tmpCtx = tmpCanvas.getContext('2d'); - tmpCtx.drawImage(img, 0, 0); - var data = tmpCtx.getImageData(0, 0, width, height).data; - var i, j; - - if (components === 3) { - for (i = 0, j = 0; i < rgbaLength; i += 4, j += 3) { - buf[j] = data[i]; - buf[j + 1] = data[i + 1]; - buf[j + 2] = data[i + 2]; - } - } else if (components === 1) { - for (i = 0, j = 0; i < rgbaLength; i += 4, j++) { - buf[j] = data[i]; - } - } - resolve({ data: buf, width: width, height: height}); - }; - img.onerror = function () { - reject(new Error('JpegDecode failed to load image')); - }; - img.src = imageUrl; - }); - }, this); - }, - - getData: function WorkerTransport_getData() { - return this.messageHandler.sendWithPromise('GetData', null); - }, - - getPage: function WorkerTransport_getPage(pageNumber, capability) { - if (pageNumber <= 0 || pageNumber > this.numPages || - (pageNumber|0) !== pageNumber) { - return Promise.reject(new Error('Invalid page request')); - } - - var pageIndex = pageNumber - 1; - if (pageIndex in this.pagePromises) { - return this.pagePromises[pageIndex]; - } - var promise = this.messageHandler.sendWithPromise('GetPage', { - pageIndex: pageIndex - }).then(function (pageInfo) { - if (this.destroyed) { - throw new Error('Transport destroyed'); - } - var page = new PDFPageProxy(pageIndex, pageInfo, this); - this.pageCache[pageIndex] = page; - return page; - }.bind(this)); - this.pagePromises[pageIndex] = promise; - return promise; - }, - - getPageIndex: function WorkerTransport_getPageIndexByRef(ref) { - return this.messageHandler.sendWithPromise('GetPageIndex', { ref: ref }); - }, - - getAnnotations: function WorkerTransport_getAnnotations(pageIndex, intent) { - return this.messageHandler.sendWithPromise('GetAnnotations', { - pageIndex: pageIndex, - intent: intent, - }); - }, - - getDestinations: function WorkerTransport_getDestinations() { - return this.messageHandler.sendWithPromise('GetDestinations', null); - }, - - getDestination: function WorkerTransport_getDestination(id) { - return this.messageHandler.sendWithPromise('GetDestination', { id: id }); - }, - - getAttachments: function WorkerTransport_getAttachments() { - return this.messageHandler.sendWithPromise('GetAttachments', null); - }, - - getJavaScript: function WorkerTransport_getJavaScript() { - return this.messageHandler.sendWithPromise('GetJavaScript', null); - }, - - getOutline: function WorkerTransport_getOutline() { - return this.messageHandler.sendWithPromise('GetOutline', null); - }, - - getMetadata: function WorkerTransport_getMetadata() { - return this.messageHandler.sendWithPromise('GetMetadata', null). - then(function transportMetadata(results) { - return { - info: results[0], - metadata: (results[1] ? new PDFJS.Metadata(results[1]) : null) - }; - }); - }, - - getStats: function WorkerTransport_getStats() { - return this.messageHandler.sendWithPromise('GetStats', null); - }, - - startCleanup: function WorkerTransport_startCleanup() { - this.messageHandler.sendWithPromise('Cleanup', null). - then(function endCleanup() { - for (var i = 0, ii = this.pageCache.length; i < ii; i++) { - var page = this.pageCache[i]; - if (page) { - page.cleanup(); - } - } - this.commonObjs.clear(); - this.fontLoader.clear(); - }.bind(this)); - } - }; - return WorkerTransport; - -})(); - -/** - * A PDF document and page is built of many objects. E.g. there are objects - * for fonts, images, rendering code and such. These objects might get processed - * inside of a worker. The `PDFObjects` implements some basic functions to - * manage these objects. - * @ignore - */ -var PDFObjects = (function PDFObjectsClosure() { - function PDFObjects() { - this.objs = {}; - } - - PDFObjects.prototype = { - /** - * Internal function. - * Ensures there is an object defined for `objId`. - */ - ensureObj: function PDFObjects_ensureObj(objId) { - if (this.objs[objId]) { - return this.objs[objId]; - } - - var obj = { - capability: createPromiseCapability(), - data: null, - resolved: false - }; - this.objs[objId] = obj; - - return obj; - }, - - /** - * If called *without* callback, this returns the data of `objId` but the - * object needs to be resolved. If it isn't, this function throws. - * - * If called *with* a callback, the callback is called with the data of the - * object once the object is resolved. That means, if you call this - * function and the object is already resolved, the callback gets called - * right away. - */ - get: function PDFObjects_get(objId, callback) { - // If there is a callback, then the get can be async and the object is - // not required to be resolved right now - if (callback) { - this.ensureObj(objId).capability.promise.then(callback); - return null; - } - - // If there isn't a callback, the user expects to get the resolved data - // directly. - var obj = this.objs[objId]; - - // If there isn't an object yet or the object isn't resolved, then the - // data isn't ready yet! - if (!obj || !obj.resolved) { - error('Requesting object that isn\'t resolved yet ' + objId); - } - - return obj.data; - }, - - /** - * Resolves the object `objId` with optional `data`. - */ - resolve: function PDFObjects_resolve(objId, data) { - var obj = this.ensureObj(objId); - - obj.resolved = true; - obj.data = data; - obj.capability.resolve(data); - }, - - isResolved: function PDFObjects_isResolved(objId) { - var objs = this.objs; - - if (!objs[objId]) { - return false; - } else { - return objs[objId].resolved; - } - }, - - hasData: function PDFObjects_hasData(objId) { - return this.isResolved(objId); - }, - - /** - * Returns the data of `objId` if object exists, null otherwise. - */ - getData: function PDFObjects_getData(objId) { - var objs = this.objs; - if (!objs[objId] || !objs[objId].resolved) { - return null; - } else { - return objs[objId].data; - } - }, - - clear: function PDFObjects_clear() { - this.objs = {}; - } - }; - return PDFObjects; -})(); - -/** - * Allows controlling of the rendering tasks. - * @class - * @alias RenderTask - */ -var RenderTask = (function RenderTaskClosure() { - function RenderTask(internalRenderTask) { - this._internalRenderTask = internalRenderTask; - - /** - * Callback for incremental rendering -- a function that will be called - * each time the rendering is paused. To continue rendering call the - * function that is the first argument to the callback. - * @type {function} - */ - this.onContinue = null; - } - - RenderTask.prototype = /** @lends RenderTask.prototype */ { - /** - * Promise for rendering task completion. - * @return {Promise} - */ - get promise() { - return this._internalRenderTask.capability.promise; - }, - - /** - * Cancels the rendering task. If the task is currently rendering it will - * not be cancelled until graphics pauses with a timeout. The promise that - * this object extends will resolved when cancelled. - */ - cancel: function RenderTask_cancel() { - this._internalRenderTask.cancel(); - }, - - /** - * Registers callbacks to indicate the rendering task completion. - * - * @param {function} onFulfilled The callback for the rendering completion. - * @param {function} onRejected The callback for the rendering failure. - * @return {Promise} A promise that is resolved after the onFulfilled or - * onRejected callback. - */ - then: function RenderTask_then(onFulfilled, onRejected) { - return this.promise.then.apply(this.promise, arguments); - } - }; - - return RenderTask; -})(); - -/** - * For internal use only. - * @ignore - */ -var InternalRenderTask = (function InternalRenderTaskClosure() { - - function InternalRenderTask(callback, params, objs, commonObjs, operatorList, - pageNumber) { - this.callback = callback; - this.params = params; - this.objs = objs; - this.commonObjs = commonObjs; - this.operatorListIdx = null; - this.operatorList = operatorList; - this.pageNumber = pageNumber; - this.running = false; - this.graphicsReadyCallback = null; - this.graphicsReady = false; - this.useRequestAnimationFrame = false; - this.cancelled = false; - this.capability = createPromiseCapability(); - this.task = new RenderTask(this); - // caching this-bound methods - this._continueBound = this._continue.bind(this); - this._scheduleNextBound = this._scheduleNext.bind(this); - this._nextBound = this._next.bind(this); - } - - InternalRenderTask.prototype = { - - initalizeGraphics: - function InternalRenderTask_initalizeGraphics(transparency) { - - if (this.cancelled) { - return; - } - if (PDFJS.pdfBug && 'StepperManager' in globalScope && - globalScope.StepperManager.enabled) { - this.stepper = globalScope.StepperManager.create(this.pageNumber - 1); - this.stepper.init(this.operatorList); - this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint(); - } - - var params = this.params; - this.gfx = new CanvasGraphics(params.canvasContext, this.commonObjs, - this.objs, params.imageLayer); - - this.gfx.beginDrawing(params.transform, params.viewport, transparency); - this.operatorListIdx = 0; - this.graphicsReady = true; - if (this.graphicsReadyCallback) { - this.graphicsReadyCallback(); - } - }, - - cancel: function InternalRenderTask_cancel() { - this.running = false; - this.cancelled = true; - this.callback('cancelled'); - }, - - operatorListChanged: function InternalRenderTask_operatorListChanged() { - if (!this.graphicsReady) { - if (!this.graphicsReadyCallback) { - this.graphicsReadyCallback = this._continueBound; - } - return; - } - - if (this.stepper) { - this.stepper.updateOperatorList(this.operatorList); - } - - if (this.running) { - return; - } - this._continue(); - }, - - _continue: function InternalRenderTask__continue() { - this.running = true; - if (this.cancelled) { - return; - } - if (this.task.onContinue) { - this.task.onContinue.call(this.task, this._scheduleNextBound); - } else { - this._scheduleNext(); - } - }, - - _scheduleNext: function InternalRenderTask__scheduleNext() { - if (this.useRequestAnimationFrame) { - window.requestAnimationFrame(this._nextBound); - } else { - Promise.resolve(undefined).then(this._nextBound); - } - }, - - _next: function InternalRenderTask__next() { - if (this.cancelled) { - return; - } - this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, - this.operatorListIdx, - this._continueBound, - this.stepper); - if (this.operatorListIdx === this.operatorList.argsArray.length) { - this.running = false; - if (this.operatorList.lastChunk) { - this.gfx.endDrawing(); - this.callback(); - } - } - } - - }; - - return InternalRenderTask; -})(); - -/** - * (Deprecated) Global observer of unsupported feature usages. Use - * onUnsupportedFeature callback of the {PDFDocumentLoadingTask} instance. - */ -PDFJS.UnsupportedManager = (function UnsupportedManagerClosure() { - var listeners = []; - return { - listen: function (cb) { - deprecated('Global UnsupportedManager.listen is used: ' + - ' use PDFDocumentLoadingTask.onUnsupportedFeature instead'); - listeners.push(cb); - }, - notify: function (featureId) { - for (var i = 0, ii = listeners.length; i < ii; i++) { - listeners[i](featureId); - } - } - }; -})(); - - -var Metadata = PDFJS.Metadata = (function MetadataClosure() { - function fixMetadata(meta) { - return meta.replace(/>\\376\\377([^<]+)/g, function(all, codes) { - var bytes = codes.replace(/\\([0-3])([0-7])([0-7])/g, - function(code, d1, d2, d3) { - return String.fromCharCode(d1 * 64 + d2 * 8 + d3 * 1); - }); - var chars = ''; - for (var i = 0; i < bytes.length; i += 2) { - var code = bytes.charCodeAt(i) * 256 + bytes.charCodeAt(i + 1); - chars += code >= 32 && code < 127 && code !== 60 && code !== 62 && - code !== 38 && false ? String.fromCharCode(code) : - '&#x' + (0x10000 + code).toString(16).substring(1) + ';'; - } - return '>' + chars; - }); - } - - function Metadata(meta) { - if (typeof meta === 'string') { - // Ghostscript produces invalid metadata - meta = fixMetadata(meta); - - var parser = new DOMParser(); - meta = parser.parseFromString(meta, 'application/xml'); - } else if (!(meta instanceof Document)) { - error('Metadata: Invalid metadata object'); - } - - this.metaDocument = meta; - this.metadata = {}; - this.parse(); - } - - Metadata.prototype = { - parse: function Metadata_parse() { - var doc = this.metaDocument; - var rdf = doc.documentElement; - - if (rdf.nodeName.toLowerCase() !== 'rdf:rdf') { // Wrapped in - rdf = rdf.firstChild; - while (rdf && rdf.nodeName.toLowerCase() !== 'rdf:rdf') { - rdf = rdf.nextSibling; - } - } - - var nodeName = (rdf) ? rdf.nodeName.toLowerCase() : null; - if (!rdf || nodeName !== 'rdf:rdf' || !rdf.hasChildNodes()) { - return; - } - - var children = rdf.childNodes, desc, entry, name, i, ii, length, iLength; - for (i = 0, length = children.length; i < length; i++) { - desc = children[i]; - if (desc.nodeName.toLowerCase() !== 'rdf:description') { - continue; - } - - for (ii = 0, iLength = desc.childNodes.length; ii < iLength; ii++) { - if (desc.childNodes[ii].nodeName.toLowerCase() !== '#text') { - entry = desc.childNodes[ii]; - name = entry.nodeName.toLowerCase(); - this.metadata[name] = entry.textContent.trim(); - } - } - } - }, - - get: function Metadata_get(name) { - return this.metadata[name] || null; - }, - - has: function Metadata_has(name) { - return typeof this.metadata[name] !== 'undefined'; - } - }; - - return Metadata; -})(); - - -// contexts store most of the state we need natively. -// However, PDF needs a bit more state, which we store here. - -// Minimal font size that would be used during canvas fillText operations. -var MIN_FONT_SIZE = 16; -// Maximum font size that would be used during canvas fillText operations. -var MAX_FONT_SIZE = 100; -var MAX_GROUP_SIZE = 4096; - -// Heuristic value used when enforcing minimum line widths. -var MIN_WIDTH_FACTOR = 0.65; - -var COMPILE_TYPE3_GLYPHS = true; -var MAX_SIZE_TO_COMPILE = 1000; - -var FULL_CHUNK_HEIGHT = 16; - -function createScratchCanvas(width, height) { - var canvas = document.createElement('canvas'); - canvas.width = width; - canvas.height = height; - return canvas; -} - -function addContextCurrentTransform(ctx) { - // If the context doesn't expose a `mozCurrentTransform`, add a JS based one. - if (!ctx.mozCurrentTransform) { - ctx._originalSave = ctx.save; - ctx._originalRestore = ctx.restore; - ctx._originalRotate = ctx.rotate; - ctx._originalScale = ctx.scale; - ctx._originalTranslate = ctx.translate; - ctx._originalTransform = ctx.transform; - ctx._originalSetTransform = ctx.setTransform; - - ctx._transformMatrix = ctx._transformMatrix || [1, 0, 0, 1, 0, 0]; - ctx._transformStack = []; - - Object.defineProperty(ctx, 'mozCurrentTransform', { - get: function getCurrentTransform() { - return this._transformMatrix; - } - }); - - Object.defineProperty(ctx, 'mozCurrentTransformInverse', { - get: function getCurrentTransformInverse() { - // Calculation done using WolframAlpha: - // http://www.wolframalpha.com/input/? - // i=Inverse+{{a%2C+c%2C+e}%2C+{b%2C+d%2C+f}%2C+{0%2C+0%2C+1}} - - var m = this._transformMatrix; - var a = m[0], b = m[1], c = m[2], d = m[3], e = m[4], f = m[5]; - - var ad_bc = a * d - b * c; - var bc_ad = b * c - a * d; - - return [ - d / ad_bc, - b / bc_ad, - c / bc_ad, - a / ad_bc, - (d * e - c * f) / bc_ad, - (b * e - a * f) / ad_bc - ]; - } - }); - - ctx.save = function ctxSave() { - var old = this._transformMatrix; - this._transformStack.push(old); - this._transformMatrix = old.slice(0, 6); - - this._originalSave(); - }; - - ctx.restore = function ctxRestore() { - var prev = this._transformStack.pop(); - if (prev) { - this._transformMatrix = prev; - this._originalRestore(); - } - }; - - ctx.translate = function ctxTranslate(x, y) { - var m = this._transformMatrix; - m[4] = m[0] * x + m[2] * y + m[4]; - m[5] = m[1] * x + m[3] * y + m[5]; - - this._originalTranslate(x, y); - }; - - ctx.scale = function ctxScale(x, y) { - var m = this._transformMatrix; - m[0] = m[0] * x; - m[1] = m[1] * x; - m[2] = m[2] * y; - m[3] = m[3] * y; - - this._originalScale(x, y); - }; - - ctx.transform = function ctxTransform(a, b, c, d, e, f) { - var m = this._transformMatrix; - this._transformMatrix = [ - m[0] * a + m[2] * b, - m[1] * a + m[3] * b, - m[0] * c + m[2] * d, - m[1] * c + m[3] * d, - m[0] * e + m[2] * f + m[4], - m[1] * e + m[3] * f + m[5] - ]; - - ctx._originalTransform(a, b, c, d, e, f); - }; - - ctx.setTransform = function ctxSetTransform(a, b, c, d, e, f) { - this._transformMatrix = [a, b, c, d, e, f]; - - ctx._originalSetTransform(a, b, c, d, e, f); - }; - - ctx.rotate = function ctxRotate(angle) { - var cosValue = Math.cos(angle); - var sinValue = Math.sin(angle); - - var m = this._transformMatrix; - this._transformMatrix = [ - m[0] * cosValue + m[2] * sinValue, - m[1] * cosValue + m[3] * sinValue, - m[0] * (-sinValue) + m[2] * cosValue, - m[1] * (-sinValue) + m[3] * cosValue, - m[4], - m[5] - ]; - - this._originalRotate(angle); - }; - } -} - -var CachedCanvases = (function CachedCanvasesClosure() { - function CachedCanvases() { - this.cache = Object.create(null); - } - CachedCanvases.prototype = { - getCanvas: function CachedCanvases_getCanvas(id, width, height, - trackTransform) { - var canvasEntry; - if (this.cache[id] !== undefined) { - canvasEntry = this.cache[id]; - canvasEntry.canvas.width = width; - canvasEntry.canvas.height = height; - // reset canvas transform for emulated mozCurrentTransform, if needed - canvasEntry.context.setTransform(1, 0, 0, 1, 0, 0); - } else { - var canvas = createScratchCanvas(width, height); - var ctx = canvas.getContext('2d'); - if (trackTransform) { - addContextCurrentTransform(ctx); - } - this.cache[id] = canvasEntry = {canvas: canvas, context: ctx}; - } - return canvasEntry; - }, - clear: function () { - for (var id in this.cache) { - var canvasEntry = this.cache[id]; - // Zeroing the width and height causes Firefox to release graphics - // resources immediately, which can greatly reduce memory consumption. - canvasEntry.canvas.width = 0; - canvasEntry.canvas.height = 0; - delete this.cache[id]; - } - } - }; - return CachedCanvases; -})(); - -function compileType3Glyph(imgData) { - var POINT_TO_PROCESS_LIMIT = 1000; - - var width = imgData.width, height = imgData.height; - var i, j, j0, width1 = width + 1; - var points = new Uint8Array(width1 * (height + 1)); - var POINT_TYPES = - new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]); - - // decodes bit-packed mask data - var lineSize = (width + 7) & ~7, data0 = imgData.data; - var data = new Uint8Array(lineSize * height), pos = 0, ii; - for (i = 0, ii = data0.length; i < ii; i++) { - var mask = 128, elem = data0[i]; - while (mask > 0) { - data[pos++] = (elem & mask) ? 0 : 255; - mask >>= 1; - } - } - - // finding iteresting points: every point is located between mask pixels, - // so there will be points of the (width + 1)x(height + 1) grid. Every point - // will have flags assigned based on neighboring mask pixels: - // 4 | 8 - // --P-- - // 2 | 1 - // We are interested only in points with the flags: - // - outside corners: 1, 2, 4, 8; - // - inside corners: 7, 11, 13, 14; - // - and, intersections: 5, 10. - var count = 0; - pos = 0; - if (data[pos] !== 0) { - points[0] = 1; - ++count; - } - for (j = 1; j < width; j++) { - if (data[pos] !== data[pos + 1]) { - points[j] = data[pos] ? 2 : 1; - ++count; - } - pos++; - } - if (data[pos] !== 0) { - points[j] = 2; - ++count; - } - for (i = 1; i < height; i++) { - pos = i * lineSize; - j0 = i * width1; - if (data[pos - lineSize] !== data[pos]) { - points[j0] = data[pos] ? 1 : 8; - ++count; - } - // 'sum' is the position of the current pixel configuration in the 'TYPES' - // array (in order 8-1-2-4, so we can use '>>2' to shift the column). - var sum = (data[pos] ? 4 : 0) + (data[pos - lineSize] ? 8 : 0); - for (j = 1; j < width; j++) { - sum = (sum >> 2) + (data[pos + 1] ? 4 : 0) + - (data[pos - lineSize + 1] ? 8 : 0); - if (POINT_TYPES[sum]) { - points[j0 + j] = POINT_TYPES[sum]; - ++count; - } - pos++; - } - if (data[pos - lineSize] !== data[pos]) { - points[j0 + j] = data[pos] ? 2 : 4; - ++count; - } - - if (count > POINT_TO_PROCESS_LIMIT) { - return null; - } - } - - pos = lineSize * (height - 1); - j0 = i * width1; - if (data[pos] !== 0) { - points[j0] = 8; - ++count; - } - for (j = 1; j < width; j++) { - if (data[pos] !== data[pos + 1]) { - points[j0 + j] = data[pos] ? 4 : 8; - ++count; - } - pos++; - } - if (data[pos] !== 0) { - points[j0 + j] = 4; - ++count; - } - if (count > POINT_TO_PROCESS_LIMIT) { - return null; - } - - // building outlines - var steps = new Int32Array([0, width1, -1, 0, -width1, 0, 0, 0, 1]); - var outlines = []; - for (i = 0; count && i <= height; i++) { - var p = i * width1; - var end = p + width; - while (p < end && !points[p]) { - p++; - } - if (p === end) { - continue; - } - var coords = [p % width1, i]; - - var type = points[p], p0 = p, pp; - do { - var step = steps[type]; - do { - p += step; - } while (!points[p]); - - pp = points[p]; - if (pp !== 5 && pp !== 10) { - // set new direction - type = pp; - // delete mark - points[p] = 0; - } else { // type is 5 or 10, ie, a crossing - // set new direction - type = pp & ((0x33 * type) >> 4); - // set new type for "future hit" - points[p] &= (type >> 2 | type << 2); - } - - coords.push(p % width1); - coords.push((p / width1) | 0); - --count; - } while (p0 !== p); - outlines.push(coords); - --i; - } - - var drawOutline = function(c) { - c.save(); - // the path shall be painted in [0..1]x[0..1] space - c.scale(1 / width, -1 / height); - c.translate(0, -height); - c.beginPath(); - for (var i = 0, ii = outlines.length; i < ii; i++) { - var o = outlines[i]; - c.moveTo(o[0], o[1]); - for (var j = 2, jj = o.length; j < jj; j += 2) { - c.lineTo(o[j], o[j+1]); - } - } - c.fill(); - c.beginPath(); - c.restore(); - }; - - return drawOutline; -} - -var CanvasExtraState = (function CanvasExtraStateClosure() { - function CanvasExtraState(old) { - // Are soft masks and alpha values shapes or opacities? - this.alphaIsShape = false; - this.fontSize = 0; - this.fontSizeScale = 1; - this.textMatrix = IDENTITY_MATRIX; - this.textMatrixScale = 1; - this.fontMatrix = FONT_IDENTITY_MATRIX; - this.leading = 0; - // Current point (in user coordinates) - this.x = 0; - this.y = 0; - // Start of text line (in text coordinates) - this.lineX = 0; - this.lineY = 0; - // Character and word spacing - this.charSpacing = 0; - this.wordSpacing = 0; - this.textHScale = 1; - this.textRenderingMode = TextRenderingMode.FILL; - this.textRise = 0; - // Default fore and background colors - this.fillColor = '#000000'; - this.strokeColor = '#000000'; - this.patternFill = false; - // Note: fill alpha applies to all non-stroking operations - this.fillAlpha = 1; - this.strokeAlpha = 1; - this.lineWidth = 1; - this.activeSMask = null; // nonclonable field (see the save method below) - - this.old = old; - } - - CanvasExtraState.prototype = { - clone: function CanvasExtraState_clone() { - return Object.create(this); - }, - setCurrentPoint: function CanvasExtraState_setCurrentPoint(x, y) { - this.x = x; - this.y = y; - } - }; - return CanvasExtraState; -})(); - -var CanvasGraphics = (function CanvasGraphicsClosure() { - // Defines the time the executeOperatorList is going to be executing - // before it stops and shedules a continue of execution. - var EXECUTION_TIME = 15; - // Defines the number of steps before checking the execution time - var EXECUTION_STEPS = 10; - - function CanvasGraphics(canvasCtx, commonObjs, objs, imageLayer) { - this.ctx = canvasCtx; - this.current = new CanvasExtraState(); - this.stateStack = []; - this.pendingClip = null; - this.pendingEOFill = false; - this.res = null; - this.xobjs = null; - this.commonObjs = commonObjs; - this.objs = objs; - this.imageLayer = imageLayer; - this.groupStack = []; - this.processingType3 = null; - // Patterns are painted relative to the initial page/form transform, see pdf - // spec 8.7.2 NOTE 1. - this.baseTransform = null; - this.baseTransformStack = []; - this.groupLevel = 0; - this.smaskStack = []; - this.smaskCounter = 0; - this.tempSMask = null; - this.cachedCanvases = new CachedCanvases(); - if (canvasCtx) { - // NOTE: if mozCurrentTransform is polyfilled, then the current state of - // the transformation must already be set in canvasCtx._transformMatrix. - addContextCurrentTransform(canvasCtx); - } - this.cachedGetSinglePixelWidth = null; - } - - function putBinaryImageData(ctx, imgData) { - if (typeof ImageData !== 'undefined' && imgData instanceof ImageData) { - ctx.putImageData(imgData, 0, 0); - return; - } - - // Put the image data to the canvas in chunks, rather than putting the - // whole image at once. This saves JS memory, because the ImageData object - // is smaller. It also possibly saves C++ memory within the implementation - // of putImageData(). (E.g. in Firefox we make two short-lived copies of - // the data passed to putImageData()). |n| shouldn't be too small, however, - // because too many putImageData() calls will slow things down. - // - // Note: as written, if the last chunk is partial, the putImageData() call - // will (conceptually) put pixels past the bounds of the canvas. But - // that's ok; any such pixels are ignored. - - var height = imgData.height, width = imgData.width; - var partialChunkHeight = height % FULL_CHUNK_HEIGHT; - var fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT; - var totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1; - - var chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT); - var srcPos = 0, destPos; - var src = imgData.data; - var dest = chunkImgData.data; - var i, j, thisChunkHeight, elemsInThisChunk; - - // There are multiple forms in which the pixel data can be passed, and - // imgData.kind tells us which one this is. - if (imgData.kind === ImageKind.GRAYSCALE_1BPP) { - // Grayscale, 1 bit per pixel (i.e. black-and-white). - var srcLength = src.byteLength; - var dest32 = PDFJS.hasCanvasTypedArrays ? new Uint32Array(dest.buffer) : - new Uint32ArrayView(dest); - var dest32DataLength = dest32.length; - var fullSrcDiff = (width + 7) >> 3; - var white = 0xFFFFFFFF; - var black = (PDFJS.isLittleEndian || !PDFJS.hasCanvasTypedArrays) ? - 0xFF000000 : 0x000000FF; - for (i = 0; i < totalChunks; i++) { - thisChunkHeight = - (i < fullChunks) ? FULL_CHUNK_HEIGHT : partialChunkHeight; - destPos = 0; - for (j = 0; j < thisChunkHeight; j++) { - var srcDiff = srcLength - srcPos; - var k = 0; - var kEnd = (srcDiff > fullSrcDiff) ? width : srcDiff * 8 - 7; - var kEndUnrolled = kEnd & ~7; - var mask = 0; - var srcByte = 0; - for (; k < kEndUnrolled; k += 8) { - srcByte = src[srcPos++]; - dest32[destPos++] = (srcByte & 128) ? white : black; - dest32[destPos++] = (srcByte & 64) ? white : black; - dest32[destPos++] = (srcByte & 32) ? white : black; - dest32[destPos++] = (srcByte & 16) ? white : black; - dest32[destPos++] = (srcByte & 8) ? white : black; - dest32[destPos++] = (srcByte & 4) ? white : black; - dest32[destPos++] = (srcByte & 2) ? white : black; - dest32[destPos++] = (srcByte & 1) ? white : black; - } - for (; k < kEnd; k++) { - if (mask === 0) { - srcByte = src[srcPos++]; - mask = 128; - } - - dest32[destPos++] = (srcByte & mask) ? white : black; - mask >>= 1; - } - } - // We ran out of input. Make all remaining pixels transparent. - while (destPos < dest32DataLength) { - dest32[destPos++] = 0; - } - - ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); - } - } else if (imgData.kind === ImageKind.RGBA_32BPP) { - // RGBA, 32-bits per pixel. - - j = 0; - elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4; - for (i = 0; i < fullChunks; i++) { - dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); - srcPos += elemsInThisChunk; - - ctx.putImageData(chunkImgData, 0, j); - j += FULL_CHUNK_HEIGHT; - } - if (i < totalChunks) { - elemsInThisChunk = width * partialChunkHeight * 4; - dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); - ctx.putImageData(chunkImgData, 0, j); - } - - } else if (imgData.kind === ImageKind.RGB_24BPP) { - // RGB, 24-bits per pixel. - thisChunkHeight = FULL_CHUNK_HEIGHT; - elemsInThisChunk = width * thisChunkHeight; - for (i = 0; i < totalChunks; i++) { - if (i >= fullChunks) { - thisChunkHeight = partialChunkHeight; - elemsInThisChunk = width * thisChunkHeight; - } - - destPos = 0; - for (j = elemsInThisChunk; j--;) { - dest[destPos++] = src[srcPos++]; - dest[destPos++] = src[srcPos++]; - dest[destPos++] = src[srcPos++]; - dest[destPos++] = 255; - } - ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); - } - } else { - error('bad image kind: ' + imgData.kind); - } - } - - function putBinaryImageMask(ctx, imgData) { - var height = imgData.height, width = imgData.width; - var partialChunkHeight = height % FULL_CHUNK_HEIGHT; - var fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT; - var totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1; - - var chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT); - var srcPos = 0; - var src = imgData.data; - var dest = chunkImgData.data; - - for (var i = 0; i < totalChunks; i++) { - var thisChunkHeight = - (i < fullChunks) ? FULL_CHUNK_HEIGHT : partialChunkHeight; - - // Expand the mask so it can be used by the canvas. Any required - // inversion has already been handled. - var destPos = 3; // alpha component offset - for (var j = 0; j < thisChunkHeight; j++) { - var mask = 0; - for (var k = 0; k < width; k++) { - if (!mask) { - var elem = src[srcPos++]; - mask = 128; - } - dest[destPos] = (elem & mask) ? 0 : 255; - destPos += 4; - mask >>= 1; - } - } - ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); - } - } - - function copyCtxState(sourceCtx, destCtx) { - var properties = ['strokeStyle', 'fillStyle', 'fillRule', 'globalAlpha', - 'lineWidth', 'lineCap', 'lineJoin', 'miterLimit', - 'globalCompositeOperation', 'font']; - for (var i = 0, ii = properties.length; i < ii; i++) { - var property = properties[i]; - if (sourceCtx[property] !== undefined) { - destCtx[property] = sourceCtx[property]; - } - } - if (sourceCtx.setLineDash !== undefined) { - destCtx.setLineDash(sourceCtx.getLineDash()); - destCtx.lineDashOffset = sourceCtx.lineDashOffset; - } else if (sourceCtx.mozDashOffset !== undefined) { - destCtx.mozDash = sourceCtx.mozDash; - destCtx.mozDashOffset = sourceCtx.mozDashOffset; - } - } - - function composeSMaskBackdrop(bytes, r0, g0, b0) { - var length = bytes.length; - for (var i = 3; i < length; i += 4) { - var alpha = bytes[i]; - if (alpha === 0) { - bytes[i - 3] = r0; - bytes[i - 2] = g0; - bytes[i - 1] = b0; - } else if (alpha < 255) { - var alpha_ = 255 - alpha; - bytes[i - 3] = (bytes[i - 3] * alpha + r0 * alpha_) >> 8; - bytes[i - 2] = (bytes[i - 2] * alpha + g0 * alpha_) >> 8; - bytes[i - 1] = (bytes[i - 1] * alpha + b0 * alpha_) >> 8; - } - } - } - - function composeSMaskAlpha(maskData, layerData, transferMap) { - var length = maskData.length; - var scale = 1 / 255; - for (var i = 3; i < length; i += 4) { - var alpha = transferMap ? transferMap[maskData[i]] : maskData[i]; - layerData[i] = (layerData[i] * alpha * scale) | 0; - } - } - - function composeSMaskLuminosity(maskData, layerData, transferMap) { - var length = maskData.length; - for (var i = 3; i < length; i += 4) { - var y = (maskData[i - 3] * 77) + // * 0.3 / 255 * 0x10000 - (maskData[i - 2] * 152) + // * 0.59 .... - (maskData[i - 1] * 28); // * 0.11 .... - layerData[i] = transferMap ? - (layerData[i] * transferMap[y >> 8]) >> 8 : - (layerData[i] * y) >> 16; - } - } - - function genericComposeSMask(maskCtx, layerCtx, width, height, - subtype, backdrop, transferMap) { - var hasBackdrop = !!backdrop; - var r0 = hasBackdrop ? backdrop[0] : 0; - var g0 = hasBackdrop ? backdrop[1] : 0; - var b0 = hasBackdrop ? backdrop[2] : 0; - - var composeFn; - if (subtype === 'Luminosity') { - composeFn = composeSMaskLuminosity; - } else { - composeFn = composeSMaskAlpha; - } - - // processing image in chunks to save memory - var PIXELS_TO_PROCESS = 1048576; - var chunkSize = Math.min(height, Math.ceil(PIXELS_TO_PROCESS / width)); - for (var row = 0; row < height; row += chunkSize) { - var chunkHeight = Math.min(chunkSize, height - row); - var maskData = maskCtx.getImageData(0, row, width, chunkHeight); - var layerData = layerCtx.getImageData(0, row, width, chunkHeight); - - if (hasBackdrop) { - composeSMaskBackdrop(maskData.data, r0, g0, b0); - } - composeFn(maskData.data, layerData.data, transferMap); - - maskCtx.putImageData(layerData, 0, row); - } - } - - function composeSMask(ctx, smask, layerCtx) { - var mask = smask.canvas; - var maskCtx = smask.context; - - ctx.setTransform(smask.scaleX, 0, 0, smask.scaleY, - smask.offsetX, smask.offsetY); - - var backdrop = smask.backdrop || null; - if (!smask.transferMap && WebGLUtils.isEnabled) { - var composed = WebGLUtils.composeSMask(layerCtx.canvas, mask, - {subtype: smask.subtype, backdrop: backdrop}); - ctx.setTransform(1, 0, 0, 1, 0, 0); - ctx.drawImage(composed, smask.offsetX, smask.offsetY); - return; - } - genericComposeSMask(maskCtx, layerCtx, mask.width, mask.height, - smask.subtype, backdrop, smask.transferMap); - ctx.drawImage(mask, 0, 0); - } - - var LINE_CAP_STYLES = ['butt', 'round', 'square']; - var LINE_JOIN_STYLES = ['miter', 'round', 'bevel']; - var NORMAL_CLIP = {}; - var EO_CLIP = {}; - - CanvasGraphics.prototype = { - - beginDrawing: function CanvasGraphics_beginDrawing(transform, viewport, - transparency) { - // For pdfs that use blend modes we have to clear the canvas else certain - // blend modes can look wrong since we'd be blending with a white - // backdrop. The problem with a transparent backdrop though is we then - // don't get sub pixel anti aliasing on text, creating temporary - // transparent canvas when we have blend modes. - var width = this.ctx.canvas.width; - var height = this.ctx.canvas.height; - - this.ctx.save(); - this.ctx.fillStyle = 'rgb(255, 255, 255)'; - this.ctx.fillRect(0, 0, width, height); - this.ctx.restore(); - - if (transparency) { - var transparentCanvas = this.cachedCanvases.getCanvas( - 'transparent', width, height, true); - this.compositeCtx = this.ctx; - this.transparentCanvas = transparentCanvas.canvas; - this.ctx = transparentCanvas.context; - this.ctx.save(); - // The transform can be applied before rendering, transferring it to - // the new canvas. - this.ctx.transform.apply(this.ctx, - this.compositeCtx.mozCurrentTransform); - } - - this.ctx.save(); - if (transform) { - this.ctx.transform.apply(this.ctx, transform); - } - this.ctx.transform.apply(this.ctx, viewport.transform); - - this.baseTransform = this.ctx.mozCurrentTransform.slice(); - - if (this.imageLayer) { - this.imageLayer.beginLayout(); - } - }, - - executeOperatorList: function CanvasGraphics_executeOperatorList( - operatorList, - executionStartIdx, continueCallback, - stepper) { - var argsArray = operatorList.argsArray; - var fnArray = operatorList.fnArray; - var i = executionStartIdx || 0; - var argsArrayLen = argsArray.length; - - // Sometimes the OperatorList to execute is empty. - if (argsArrayLen === i) { - return i; - } - - var chunkOperations = (argsArrayLen - i > EXECUTION_STEPS && - typeof continueCallback === 'function'); - var endTime = chunkOperations ? Date.now() + EXECUTION_TIME : 0; - var steps = 0; - - var commonObjs = this.commonObjs; - var objs = this.objs; - var fnId; - - while (true) { - if (stepper !== undefined && i === stepper.nextBreakPoint) { - stepper.breakIt(i, continueCallback); - return i; - } - - fnId = fnArray[i]; - - if (fnId !== OPS.dependency) { - this[fnId].apply(this, argsArray[i]); - } else { - var deps = argsArray[i]; - for (var n = 0, nn = deps.length; n < nn; n++) { - var depObjId = deps[n]; - var common = depObjId[0] === 'g' && depObjId[1] === '_'; - var objsPool = common ? commonObjs : objs; - - // If the promise isn't resolved yet, add the continueCallback - // to the promise and bail out. - if (!objsPool.isResolved(depObjId)) { - objsPool.get(depObjId, continueCallback); - return i; - } - } - } - - i++; - - // If the entire operatorList was executed, stop as were done. - if (i === argsArrayLen) { - return i; - } - - // If the execution took longer then a certain amount of time and - // `continueCallback` is specified, interrupt the execution. - if (chunkOperations && ++steps > EXECUTION_STEPS) { - if (Date.now() > endTime) { - continueCallback(); - return i; - } - steps = 0; - } - - // If the operatorList isn't executed completely yet OR the execution - // time was short enough, do another execution round. - } - }, - - endDrawing: function CanvasGraphics_endDrawing() { - this.ctx.restore(); - - if (this.transparentCanvas) { - this.ctx = this.compositeCtx; - this.ctx.drawImage(this.transparentCanvas, 0, 0); - this.transparentCanvas = null; - } - - this.cachedCanvases.clear(); - WebGLUtils.clear(); - - if (this.imageLayer) { - this.imageLayer.endLayout(); - } - }, - - // Graphics state - setLineWidth: function CanvasGraphics_setLineWidth(width) { - this.current.lineWidth = width; - this.ctx.lineWidth = width; - }, - setLineCap: function CanvasGraphics_setLineCap(style) { - this.ctx.lineCap = LINE_CAP_STYLES[style]; - }, - setLineJoin: function CanvasGraphics_setLineJoin(style) { - this.ctx.lineJoin = LINE_JOIN_STYLES[style]; - }, - setMiterLimit: function CanvasGraphics_setMiterLimit(limit) { - this.ctx.miterLimit = limit; - }, - setDash: function CanvasGraphics_setDash(dashArray, dashPhase) { - var ctx = this.ctx; - if (ctx.setLineDash !== undefined) { - ctx.setLineDash(dashArray); - ctx.lineDashOffset = dashPhase; - } else { - ctx.mozDash = dashArray; - ctx.mozDashOffset = dashPhase; - } - }, - setRenderingIntent: function CanvasGraphics_setRenderingIntent(intent) { - // Maybe if we one day fully support color spaces this will be important - // for now we can ignore. - // TODO set rendering intent? - }, - setFlatness: function CanvasGraphics_setFlatness(flatness) { - // There's no way to control this with canvas, but we can safely ignore. - // TODO set flatness? - }, - setGState: function CanvasGraphics_setGState(states) { - for (var i = 0, ii = states.length; i < ii; i++) { - var state = states[i]; - var key = state[0]; - var value = state[1]; - - switch (key) { - case 'LW': - this.setLineWidth(value); - break; - case 'LC': - this.setLineCap(value); - break; - case 'LJ': - this.setLineJoin(value); - break; - case 'ML': - this.setMiterLimit(value); - break; - case 'D': - this.setDash(value[0], value[1]); - break; - case 'RI': - this.setRenderingIntent(value); - break; - case 'FL': - this.setFlatness(value); - break; - case 'Font': - this.setFont(value[0], value[1]); - break; - case 'CA': - this.current.strokeAlpha = state[1]; - break; - case 'ca': - this.current.fillAlpha = state[1]; - this.ctx.globalAlpha = state[1]; - break; - case 'BM': - if (value && value.name && (value.name !== 'Normal')) { - var mode = value.name.replace(/([A-Z])/g, - function(c) { - return '-' + c.toLowerCase(); - } - ).substring(1); - this.ctx.globalCompositeOperation = mode; - if (this.ctx.globalCompositeOperation !== mode) { - warn('globalCompositeOperation "' + mode + - '" is not supported'); - } - } else { - this.ctx.globalCompositeOperation = 'source-over'; - } - break; - case 'SMask': - if (this.current.activeSMask) { - this.endSMaskGroup(); - } - this.current.activeSMask = value ? this.tempSMask : null; - if (this.current.activeSMask) { - this.beginSMaskGroup(); - } - this.tempSMask = null; - break; - } - } - }, - beginSMaskGroup: function CanvasGraphics_beginSMaskGroup() { - - var activeSMask = this.current.activeSMask; - var drawnWidth = activeSMask.canvas.width; - var drawnHeight = activeSMask.canvas.height; - var cacheId = 'smaskGroupAt' + this.groupLevel; - var scratchCanvas = this.cachedCanvases.getCanvas( - cacheId, drawnWidth, drawnHeight, true); - - var currentCtx = this.ctx; - var currentTransform = currentCtx.mozCurrentTransform; - this.ctx.save(); - - var groupCtx = scratchCanvas.context; - groupCtx.scale(1 / activeSMask.scaleX, 1 / activeSMask.scaleY); - groupCtx.translate(-activeSMask.offsetX, -activeSMask.offsetY); - groupCtx.transform.apply(groupCtx, currentTransform); - - copyCtxState(currentCtx, groupCtx); - this.ctx = groupCtx; - this.setGState([ - ['BM', 'Normal'], - ['ca', 1], - ['CA', 1] - ]); - this.groupStack.push(currentCtx); - this.groupLevel++; - }, - endSMaskGroup: function CanvasGraphics_endSMaskGroup() { - var groupCtx = this.ctx; - this.groupLevel--; - this.ctx = this.groupStack.pop(); - - composeSMask(this.ctx, this.current.activeSMask, groupCtx); - this.ctx.restore(); - copyCtxState(groupCtx, this.ctx); - }, - save: function CanvasGraphics_save() { - this.ctx.save(); - var old = this.current; - this.stateStack.push(old); - this.current = old.clone(); - this.current.activeSMask = null; - }, - restore: function CanvasGraphics_restore() { - if (this.stateStack.length !== 0) { - if (this.current.activeSMask !== null) { - this.endSMaskGroup(); - } - - this.current = this.stateStack.pop(); - this.ctx.restore(); - - // Ensure that the clipping path is reset (fixes issue6413.pdf). - this.pendingClip = null; - - this.cachedGetSinglePixelWidth = null; - } - }, - transform: function CanvasGraphics_transform(a, b, c, d, e, f) { - this.ctx.transform(a, b, c, d, e, f); - - this.cachedGetSinglePixelWidth = null; - }, - - // Path - constructPath: function CanvasGraphics_constructPath(ops, args) { - var ctx = this.ctx; - var current = this.current; - var x = current.x, y = current.y; - for (var i = 0, j = 0, ii = ops.length; i < ii; i++) { - switch (ops[i] | 0) { - case OPS.rectangle: - x = args[j++]; - y = args[j++]; - var width = args[j++]; - var height = args[j++]; - if (width === 0) { - width = this.getSinglePixelWidth(); - } - if (height === 0) { - height = this.getSinglePixelWidth(); - } - var xw = x + width; - var yh = y + height; - this.ctx.moveTo(x, y); - this.ctx.lineTo(xw, y); - this.ctx.lineTo(xw, yh); - this.ctx.lineTo(x, yh); - this.ctx.lineTo(x, y); - this.ctx.closePath(); - break; - case OPS.moveTo: - x = args[j++]; - y = args[j++]; - ctx.moveTo(x, y); - break; - case OPS.lineTo: - x = args[j++]; - y = args[j++]; - ctx.lineTo(x, y); - break; - case OPS.curveTo: - x = args[j + 4]; - y = args[j + 5]; - ctx.bezierCurveTo(args[j], args[j + 1], args[j + 2], args[j + 3], - x, y); - j += 6; - break; - case OPS.curveTo2: - ctx.bezierCurveTo(x, y, args[j], args[j + 1], - args[j + 2], args[j + 3]); - x = args[j + 2]; - y = args[j + 3]; - j += 4; - break; - case OPS.curveTo3: - x = args[j + 2]; - y = args[j + 3]; - ctx.bezierCurveTo(args[j], args[j + 1], x, y, x, y); - j += 4; - break; - case OPS.closePath: - ctx.closePath(); - break; - } - } - current.setCurrentPoint(x, y); - }, - closePath: function CanvasGraphics_closePath() { - this.ctx.closePath(); - }, - stroke: function CanvasGraphics_stroke(consumePath) { - consumePath = typeof consumePath !== 'undefined' ? consumePath : true; - var ctx = this.ctx; - var strokeColor = this.current.strokeColor; - // Prevent drawing too thin lines by enforcing a minimum line width. - ctx.lineWidth = Math.max(this.getSinglePixelWidth() * MIN_WIDTH_FACTOR, - this.current.lineWidth); - // For stroke we want to temporarily change the global alpha to the - // stroking alpha. - ctx.globalAlpha = this.current.strokeAlpha; - if (strokeColor && strokeColor.hasOwnProperty('type') && - strokeColor.type === 'Pattern') { - // for patterns, we transform to pattern space, calculate - // the pattern, call stroke, and restore to user space - ctx.save(); - ctx.strokeStyle = strokeColor.getPattern(ctx, this); - ctx.stroke(); - ctx.restore(); - } else { - ctx.stroke(); - } - if (consumePath) { - this.consumePath(); - } - // Restore the global alpha to the fill alpha - ctx.globalAlpha = this.current.fillAlpha; - }, - closeStroke: function CanvasGraphics_closeStroke() { - this.closePath(); - this.stroke(); - }, - fill: function CanvasGraphics_fill(consumePath) { - consumePath = typeof consumePath !== 'undefined' ? consumePath : true; - var ctx = this.ctx; - var fillColor = this.current.fillColor; - var isPatternFill = this.current.patternFill; - var needRestore = false; - - if (isPatternFill) { - ctx.save(); - if (this.baseTransform) { - ctx.setTransform.apply(ctx, this.baseTransform); - } - ctx.fillStyle = fillColor.getPattern(ctx, this); - needRestore = true; - } - - if (this.pendingEOFill) { - if (ctx.mozFillRule !== undefined) { - ctx.mozFillRule = 'evenodd'; - ctx.fill(); - ctx.mozFillRule = 'nonzero'; - } else { - ctx.fill('evenodd'); - } - this.pendingEOFill = false; - } else { - ctx.fill(); - } - - if (needRestore) { - ctx.restore(); - } - if (consumePath) { - this.consumePath(); - } - }, - eoFill: function CanvasGraphics_eoFill() { - this.pendingEOFill = true; - this.fill(); - }, - fillStroke: function CanvasGraphics_fillStroke() { - this.fill(false); - this.stroke(false); - - this.consumePath(); - }, - eoFillStroke: function CanvasGraphics_eoFillStroke() { - this.pendingEOFill = true; - this.fillStroke(); - }, - closeFillStroke: function CanvasGraphics_closeFillStroke() { - this.closePath(); - this.fillStroke(); - }, - closeEOFillStroke: function CanvasGraphics_closeEOFillStroke() { - this.pendingEOFill = true; - this.closePath(); - this.fillStroke(); - }, - endPath: function CanvasGraphics_endPath() { - this.consumePath(); - }, - - // Clipping - clip: function CanvasGraphics_clip() { - this.pendingClip = NORMAL_CLIP; - }, - eoClip: function CanvasGraphics_eoClip() { - this.pendingClip = EO_CLIP; - }, - - // Text - beginText: function CanvasGraphics_beginText() { - this.current.textMatrix = IDENTITY_MATRIX; - this.current.textMatrixScale = 1; - this.current.x = this.current.lineX = 0; - this.current.y = this.current.lineY = 0; - }, - endText: function CanvasGraphics_endText() { - var paths = this.pendingTextPaths; - var ctx = this.ctx; - if (paths === undefined) { - ctx.beginPath(); - return; - } - - ctx.save(); - ctx.beginPath(); - for (var i = 0; i < paths.length; i++) { - var path = paths[i]; - ctx.setTransform.apply(ctx, path.transform); - ctx.translate(path.x, path.y); - path.addToPath(ctx, path.fontSize); - } - ctx.restore(); - ctx.clip(); - ctx.beginPath(); - delete this.pendingTextPaths; - }, - setCharSpacing: function CanvasGraphics_setCharSpacing(spacing) { - this.current.charSpacing = spacing; - }, - setWordSpacing: function CanvasGraphics_setWordSpacing(spacing) { - this.current.wordSpacing = spacing; - }, - setHScale: function CanvasGraphics_setHScale(scale) { - this.current.textHScale = scale / 100; - }, - setLeading: function CanvasGraphics_setLeading(leading) { - this.current.leading = -leading; - }, - setFont: function CanvasGraphics_setFont(fontRefName, size) { - var fontObj = this.commonObjs.get(fontRefName); - var current = this.current; - - if (!fontObj) { - error('Can\'t find font for ' + fontRefName); - } - - current.fontMatrix = (fontObj.fontMatrix ? - fontObj.fontMatrix : FONT_IDENTITY_MATRIX); - - // A valid matrix needs all main diagonal elements to be non-zero - // This also ensures we bypass FF bugzilla bug #719844. - if (current.fontMatrix[0] === 0 || - current.fontMatrix[3] === 0) { - warn('Invalid font matrix for font ' + fontRefName); - } - - // The spec for Tf (setFont) says that 'size' specifies the font 'scale', - // and in some docs this can be negative (inverted x-y axes). - if (size < 0) { - size = -size; - current.fontDirection = -1; - } else { - current.fontDirection = 1; - } - - this.current.font = fontObj; - this.current.fontSize = size; - - if (fontObj.isType3Font) { - return; // we don't need ctx.font for Type3 fonts - } - - var name = fontObj.loadedName || 'sans-serif'; - var bold = fontObj.black ? (fontObj.bold ? '900' : 'bold') : - (fontObj.bold ? 'bold' : 'normal'); - - var italic = fontObj.italic ? 'italic' : 'normal'; - var typeface = '"' + name + '", ' + fontObj.fallbackName; - - // Some font backends cannot handle fonts below certain size. - // Keeping the font at minimal size and using the fontSizeScale to change - // the current transformation matrix before the fillText/strokeText. - // See https://bugzilla.mozilla.org/show_bug.cgi?id=726227 - var browserFontSize = size < MIN_FONT_SIZE ? MIN_FONT_SIZE : - size > MAX_FONT_SIZE ? MAX_FONT_SIZE : size; - this.current.fontSizeScale = size / browserFontSize; - - var rule = italic + ' ' + bold + ' ' + browserFontSize + 'px ' + typeface; - this.ctx.font = rule; - }, - setTextRenderingMode: function CanvasGraphics_setTextRenderingMode(mode) { - this.current.textRenderingMode = mode; - }, - setTextRise: function CanvasGraphics_setTextRise(rise) { - this.current.textRise = rise; - }, - moveText: function CanvasGraphics_moveText(x, y) { - this.current.x = this.current.lineX += x; - this.current.y = this.current.lineY += y; - }, - setLeadingMoveText: function CanvasGraphics_setLeadingMoveText(x, y) { - this.setLeading(-y); - this.moveText(x, y); - }, - setTextMatrix: function CanvasGraphics_setTextMatrix(a, b, c, d, e, f) { - this.current.textMatrix = [a, b, c, d, e, f]; - this.current.textMatrixScale = Math.sqrt(a * a + b * b); - - this.current.x = this.current.lineX = 0; - this.current.y = this.current.lineY = 0; - }, - nextLine: function CanvasGraphics_nextLine() { - this.moveText(0, this.current.leading); - }, - - paintChar: function CanvasGraphics_paintChar(character, x, y) { - var ctx = this.ctx; - var current = this.current; - var font = current.font; - var textRenderingMode = current.textRenderingMode; - var fontSize = current.fontSize / current.fontSizeScale; - var fillStrokeMode = textRenderingMode & - TextRenderingMode.FILL_STROKE_MASK; - var isAddToPathSet = !!(textRenderingMode & - TextRenderingMode.ADD_TO_PATH_FLAG); - - var addToPath; - if (font.disableFontFace || isAddToPathSet) { - addToPath = font.getPathGenerator(this.commonObjs, character); - } - - if (font.disableFontFace) { - ctx.save(); - ctx.translate(x, y); - ctx.beginPath(); - addToPath(ctx, fontSize); - if (fillStrokeMode === TextRenderingMode.FILL || - fillStrokeMode === TextRenderingMode.FILL_STROKE) { - ctx.fill(); - } - if (fillStrokeMode === TextRenderingMode.STROKE || - fillStrokeMode === TextRenderingMode.FILL_STROKE) { - ctx.stroke(); - } - ctx.restore(); - } else { - if (fillStrokeMode === TextRenderingMode.FILL || - fillStrokeMode === TextRenderingMode.FILL_STROKE) { - ctx.fillText(character, x, y); - } - if (fillStrokeMode === TextRenderingMode.STROKE || - fillStrokeMode === TextRenderingMode.FILL_STROKE) { - ctx.strokeText(character, x, y); - } - } - - if (isAddToPathSet) { - var paths = this.pendingTextPaths || (this.pendingTextPaths = []); - paths.push({ - transform: ctx.mozCurrentTransform, - x: x, - y: y, - fontSize: fontSize, - addToPath: addToPath - }); - } - }, - - get isFontSubpixelAAEnabled() { - // Checks if anti-aliasing is enabled when scaled text is painted. - // On Windows GDI scaled fonts looks bad. - var ctx = document.createElement('canvas').getContext('2d'); - ctx.scale(1.5, 1); - ctx.fillText('I', 0, 10); - var data = ctx.getImageData(0, 0, 10, 10).data; - var enabled = false; - for (var i = 3; i < data.length; i += 4) { - if (data[i] > 0 && data[i] < 255) { - enabled = true; - break; - } - } - return shadow(this, 'isFontSubpixelAAEnabled', enabled); - }, - - showText: function CanvasGraphics_showText(glyphs) { - var current = this.current; - var font = current.font; - if (font.isType3Font) { - return this.showType3Text(glyphs); - } - - var fontSize = current.fontSize; - if (fontSize === 0) { - return; - } - - var ctx = this.ctx; - var fontSizeScale = current.fontSizeScale; - var charSpacing = current.charSpacing; - var wordSpacing = current.wordSpacing; - var fontDirection = current.fontDirection; - var textHScale = current.textHScale * fontDirection; - var glyphsLength = glyphs.length; - var vertical = font.vertical; - var spacingDir = vertical ? 1 : -1; - var defaultVMetrics = font.defaultVMetrics; - var widthAdvanceScale = fontSize * current.fontMatrix[0]; - - var simpleFillText = - current.textRenderingMode === TextRenderingMode.FILL && - !font.disableFontFace; - - ctx.save(); - ctx.transform.apply(ctx, current.textMatrix); - ctx.translate(current.x, current.y + current.textRise); - - if (fontDirection > 0) { - ctx.scale(textHScale, -1); - } else { - ctx.scale(textHScale, 1); - } - - var lineWidth = current.lineWidth; - var scale = current.textMatrixScale; - if (scale === 0 || lineWidth === 0) { - var fillStrokeMode = current.textRenderingMode & - TextRenderingMode.FILL_STROKE_MASK; - if (fillStrokeMode === TextRenderingMode.STROKE || - fillStrokeMode === TextRenderingMode.FILL_STROKE) { - this.cachedGetSinglePixelWidth = null; - lineWidth = this.getSinglePixelWidth() * MIN_WIDTH_FACTOR; - } - } else { - lineWidth /= scale; - } - - if (fontSizeScale !== 1.0) { - ctx.scale(fontSizeScale, fontSizeScale); - lineWidth /= fontSizeScale; - } - - ctx.lineWidth = lineWidth; - - var x = 0, i; - for (i = 0; i < glyphsLength; ++i) { - var glyph = glyphs[i]; - if (isNum(glyph)) { - x += spacingDir * glyph * fontSize / 1000; - continue; - } - - var restoreNeeded = false; - var spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; - var character = glyph.fontChar; - var accent = glyph.accent; - var scaledX, scaledY, scaledAccentX, scaledAccentY; - var width = glyph.width; - if (vertical) { - var vmetric, vx, vy; - vmetric = glyph.vmetric || defaultVMetrics; - vx = glyph.vmetric ? vmetric[1] : width * 0.5; - vx = -vx * widthAdvanceScale; - vy = vmetric[2] * widthAdvanceScale; - - width = vmetric ? -vmetric[0] : width; - scaledX = vx / fontSizeScale; - scaledY = (x + vy) / fontSizeScale; - } else { - scaledX = x / fontSizeScale; - scaledY = 0; - } - - if (font.remeasure && width > 0) { - // Some standard fonts may not have the exact width: rescale per - // character if measured width is greater than expected glyph width - // and subpixel-aa is enabled, otherwise just center the glyph. - var measuredWidth = ctx.measureText(character).width * 1000 / - fontSize * fontSizeScale; - if (width < measuredWidth && this.isFontSubpixelAAEnabled) { - var characterScaleX = width / measuredWidth; - restoreNeeded = true; - ctx.save(); - ctx.scale(characterScaleX, 1); - scaledX /= characterScaleX; - } else if (width !== measuredWidth) { - scaledX += (width - measuredWidth) / 2000 * - fontSize / fontSizeScale; - } - } - - if (simpleFillText && !accent) { - // common case - ctx.fillText(character, scaledX, scaledY); - } else { - this.paintChar(character, scaledX, scaledY); - if (accent) { - scaledAccentX = scaledX + accent.offset.x / fontSizeScale; - scaledAccentY = scaledY - accent.offset.y / fontSizeScale; - this.paintChar(accent.fontChar, scaledAccentX, scaledAccentY); - } - } - - var charWidth = width * widthAdvanceScale + spacing * fontDirection; - x += charWidth; - - if (restoreNeeded) { - ctx.restore(); - } - } - if (vertical) { - current.y -= x * textHScale; - } else { - current.x += x * textHScale; - } - ctx.restore(); - }, - - showType3Text: function CanvasGraphics_showType3Text(glyphs) { - // Type3 fonts - each glyph is a "mini-PDF" - var ctx = this.ctx; - var current = this.current; - var font = current.font; - var fontSize = current.fontSize; - var fontDirection = current.fontDirection; - var spacingDir = font.vertical ? 1 : -1; - var charSpacing = current.charSpacing; - var wordSpacing = current.wordSpacing; - var textHScale = current.textHScale * fontDirection; - var fontMatrix = current.fontMatrix || FONT_IDENTITY_MATRIX; - var glyphsLength = glyphs.length; - var isTextInvisible = - current.textRenderingMode === TextRenderingMode.INVISIBLE; - var i, glyph, width, spacingLength; - - if (isTextInvisible || fontSize === 0) { - return; - } - this.cachedGetSinglePixelWidth = null; - - ctx.save(); - ctx.transform.apply(ctx, current.textMatrix); - ctx.translate(current.x, current.y); - - ctx.scale(textHScale, fontDirection); - - for (i = 0; i < glyphsLength; ++i) { - glyph = glyphs[i]; - if (isNum(glyph)) { - spacingLength = spacingDir * glyph * fontSize / 1000; - this.ctx.translate(spacingLength, 0); - current.x += spacingLength * textHScale; - continue; - } - - var spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; - var operatorList = font.charProcOperatorList[glyph.operatorListId]; - if (!operatorList) { - warn('Type3 character \"' + glyph.operatorListId + - '\" is not available'); - continue; - } - this.processingType3 = glyph; - this.save(); - ctx.scale(fontSize, fontSize); - ctx.transform.apply(ctx, fontMatrix); - this.executeOperatorList(operatorList); - this.restore(); - - var transformed = Util.applyTransform([glyph.width, 0], fontMatrix); - width = transformed[0] * fontSize + spacing; - - ctx.translate(width, 0); - current.x += width * textHScale; - } - ctx.restore(); - this.processingType3 = null; - }, - - // Type3 fonts - setCharWidth: function CanvasGraphics_setCharWidth(xWidth, yWidth) { - // We can safely ignore this since the width should be the same - // as the width in the Widths array. - }, - setCharWidthAndBounds: function CanvasGraphics_setCharWidthAndBounds(xWidth, - yWidth, - llx, - lly, - urx, - ury) { - // TODO According to the spec we're also suppose to ignore any operators - // that set color or include images while processing this type3 font. - this.ctx.rect(llx, lly, urx - llx, ury - lly); - this.clip(); - this.endPath(); - }, - - // Color - getColorN_Pattern: function CanvasGraphics_getColorN_Pattern(IR) { - var pattern; - if (IR[0] === 'TilingPattern') { - var color = IR[1]; - var baseTransform = this.baseTransform || - this.ctx.mozCurrentTransform.slice(); - pattern = new TilingPattern(IR, color, this.ctx, this.objs, - this.commonObjs, baseTransform); - } else { - pattern = getShadingPatternFromIR(IR); - } - return pattern; - }, - setStrokeColorN: function CanvasGraphics_setStrokeColorN(/*...*/) { - this.current.strokeColor = this.getColorN_Pattern(arguments); - }, - setFillColorN: function CanvasGraphics_setFillColorN(/*...*/) { - this.current.fillColor = this.getColorN_Pattern(arguments); - this.current.patternFill = true; - }, - setStrokeRGBColor: function CanvasGraphics_setStrokeRGBColor(r, g, b) { - var color = Util.makeCssRgb(r, g, b); - this.ctx.strokeStyle = color; - this.current.strokeColor = color; - }, - setFillRGBColor: function CanvasGraphics_setFillRGBColor(r, g, b) { - var color = Util.makeCssRgb(r, g, b); - this.ctx.fillStyle = color; - this.current.fillColor = color; - this.current.patternFill = false; - }, - - shadingFill: function CanvasGraphics_shadingFill(patternIR) { - var ctx = this.ctx; - - this.save(); - var pattern = getShadingPatternFromIR(patternIR); - ctx.fillStyle = pattern.getPattern(ctx, this, true); - - var inv = ctx.mozCurrentTransformInverse; - if (inv) { - var canvas = ctx.canvas; - var width = canvas.width; - var height = canvas.height; - - var bl = Util.applyTransform([0, 0], inv); - var br = Util.applyTransform([0, height], inv); - var ul = Util.applyTransform([width, 0], inv); - var ur = Util.applyTransform([width, height], inv); - - var x0 = Math.min(bl[0], br[0], ul[0], ur[0]); - var y0 = Math.min(bl[1], br[1], ul[1], ur[1]); - var x1 = Math.max(bl[0], br[0], ul[0], ur[0]); - var y1 = Math.max(bl[1], br[1], ul[1], ur[1]); - - this.ctx.fillRect(x0, y0, x1 - x0, y1 - y0); - } else { - // HACK to draw the gradient onto an infinite rectangle. - // PDF gradients are drawn across the entire image while - // Canvas only allows gradients to be drawn in a rectangle - // The following bug should allow us to remove this. - // https://bugzilla.mozilla.org/show_bug.cgi?id=664884 - - this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10); - } - - this.restore(); - }, - - // Images - beginInlineImage: function CanvasGraphics_beginInlineImage() { - error('Should not call beginInlineImage'); - }, - beginImageData: function CanvasGraphics_beginImageData() { - error('Should not call beginImageData'); - }, - - paintFormXObjectBegin: function CanvasGraphics_paintFormXObjectBegin(matrix, - bbox) { - this.save(); - this.baseTransformStack.push(this.baseTransform); - - if (isArray(matrix) && 6 === matrix.length) { - this.transform.apply(this, matrix); - } - - this.baseTransform = this.ctx.mozCurrentTransform; - - if (isArray(bbox) && 4 === bbox.length) { - var width = bbox[2] - bbox[0]; - var height = bbox[3] - bbox[1]; - this.ctx.rect(bbox[0], bbox[1], width, height); - this.clip(); - this.endPath(); - } - }, - - paintFormXObjectEnd: function CanvasGraphics_paintFormXObjectEnd() { - this.restore(); - this.baseTransform = this.baseTransformStack.pop(); - }, - - beginGroup: function CanvasGraphics_beginGroup(group) { - this.save(); - var currentCtx = this.ctx; - // TODO non-isolated groups - according to Rik at adobe non-isolated - // group results aren't usually that different and they even have tools - // that ignore this setting. Notes from Rik on implmenting: - // - When you encounter an transparency group, create a new canvas with - // the dimensions of the bbox - // - copy the content from the previous canvas to the new canvas - // - draw as usual - // - remove the backdrop alpha: - // alphaNew = 1 - (1 - alpha)/(1 - alphaBackdrop) with 'alpha' the alpha - // value of your transparency group and 'alphaBackdrop' the alpha of the - // backdrop - // - remove background color: - // colorNew = color - alphaNew *colorBackdrop /(1 - alphaNew) - if (!group.isolated) { - info('TODO: Support non-isolated groups.'); - } - - // TODO knockout - supposedly possible with the clever use of compositing - // modes. - if (group.knockout) { - warn('Knockout groups not supported.'); - } - - var currentTransform = currentCtx.mozCurrentTransform; - if (group.matrix) { - currentCtx.transform.apply(currentCtx, group.matrix); - } - assert(group.bbox, 'Bounding box is required.'); - - // Based on the current transform figure out how big the bounding box - // will actually be. - var bounds = Util.getAxialAlignedBoundingBox( - group.bbox, - currentCtx.mozCurrentTransform); - // Clip the bounding box to the current canvas. - var canvasBounds = [0, - 0, - currentCtx.canvas.width, - currentCtx.canvas.height]; - bounds = Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0]; - // Use ceil in case we're between sizes so we don't create canvas that is - // too small and make the canvas at least 1x1 pixels. - var offsetX = Math.floor(bounds[0]); - var offsetY = Math.floor(bounds[1]); - var drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1); - var drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1); - var scaleX = 1, scaleY = 1; - if (drawnWidth > MAX_GROUP_SIZE) { - scaleX = drawnWidth / MAX_GROUP_SIZE; - drawnWidth = MAX_GROUP_SIZE; - } - if (drawnHeight > MAX_GROUP_SIZE) { - scaleY = drawnHeight / MAX_GROUP_SIZE; - drawnHeight = MAX_GROUP_SIZE; - } - - var cacheId = 'groupAt' + this.groupLevel; - if (group.smask) { - // Using two cache entries is case if masks are used one after another. - cacheId += '_smask_' + ((this.smaskCounter++) % 2); - } - var scratchCanvas = this.cachedCanvases.getCanvas( - cacheId, drawnWidth, drawnHeight, true); - var groupCtx = scratchCanvas.context; - - // Since we created a new canvas that is just the size of the bounding box - // we have to translate the group ctx. - groupCtx.scale(1 / scaleX, 1 / scaleY); - groupCtx.translate(-offsetX, -offsetY); - groupCtx.transform.apply(groupCtx, currentTransform); - - if (group.smask) { - // Saving state and cached mask to be used in setGState. - this.smaskStack.push({ - canvas: scratchCanvas.canvas, - context: groupCtx, - offsetX: offsetX, - offsetY: offsetY, - scaleX: scaleX, - scaleY: scaleY, - subtype: group.smask.subtype, - backdrop: group.smask.backdrop, - transferMap: group.smask.transferMap || null - }); - } else { - // Setup the current ctx so when the group is popped we draw it at the - // right location. - currentCtx.setTransform(1, 0, 0, 1, 0, 0); - currentCtx.translate(offsetX, offsetY); - currentCtx.scale(scaleX, scaleY); - } - // The transparency group inherits all off the current graphics state - // except the blend mode, soft mask, and alpha constants. - copyCtxState(currentCtx, groupCtx); - this.ctx = groupCtx; - this.setGState([ - ['BM', 'Normal'], - ['ca', 1], - ['CA', 1] - ]); - this.groupStack.push(currentCtx); - this.groupLevel++; - }, - - endGroup: function CanvasGraphics_endGroup(group) { - this.groupLevel--; - var groupCtx = this.ctx; - this.ctx = this.groupStack.pop(); - // Turn off image smoothing to avoid sub pixel interpolation which can - // look kind of blurry for some pdfs. - if (this.ctx.imageSmoothingEnabled !== undefined) { - this.ctx.imageSmoothingEnabled = false; - } else { - this.ctx.mozImageSmoothingEnabled = false; - } - if (group.smask) { - this.tempSMask = this.smaskStack.pop(); - } else { - this.ctx.drawImage(groupCtx.canvas, 0, 0); - } - this.restore(); - }, - - beginAnnotations: function CanvasGraphics_beginAnnotations() { - this.save(); - this.current = new CanvasExtraState(); - }, - - endAnnotations: function CanvasGraphics_endAnnotations() { - this.restore(); - }, - - beginAnnotation: function CanvasGraphics_beginAnnotation(rect, transform, - matrix) { - this.save(); - - if (isArray(rect) && 4 === rect.length) { - var width = rect[2] - rect[0]; - var height = rect[3] - rect[1]; - this.ctx.rect(rect[0], rect[1], width, height); - this.clip(); - this.endPath(); - } - - this.transform.apply(this, transform); - this.transform.apply(this, matrix); - }, - - endAnnotation: function CanvasGraphics_endAnnotation() { - this.restore(); - }, - - paintJpegXObject: function CanvasGraphics_paintJpegXObject(objId, w, h) { - var domImage = this.objs.get(objId); - if (!domImage) { - warn('Dependent image isn\'t ready yet'); - return; - } - - this.save(); - - var ctx = this.ctx; - // scale the image to the unit square - ctx.scale(1 / w, -1 / h); - - ctx.drawImage(domImage, 0, 0, domImage.width, domImage.height, - 0, -h, w, h); - if (this.imageLayer) { - var currentTransform = ctx.mozCurrentTransformInverse; - var position = this.getCanvasPosition(0, 0); - this.imageLayer.appendImage({ - objId: objId, - left: position[0], - top: position[1], - width: w / currentTransform[0], - height: h / currentTransform[3] - }); - } - this.restore(); - }, - - paintImageMaskXObject: function CanvasGraphics_paintImageMaskXObject(img) { - var ctx = this.ctx; - var width = img.width, height = img.height; - var fillColor = this.current.fillColor; - var isPatternFill = this.current.patternFill; - - var glyph = this.processingType3; - - if (COMPILE_TYPE3_GLYPHS && glyph && glyph.compiled === undefined) { - if (width <= MAX_SIZE_TO_COMPILE && height <= MAX_SIZE_TO_COMPILE) { - glyph.compiled = - compileType3Glyph({data: img.data, width: width, height: height}); - } else { - glyph.compiled = null; - } - } - - if (glyph && glyph.compiled) { - glyph.compiled(ctx); - return; - } - - var maskCanvas = this.cachedCanvases.getCanvas('maskCanvas', - width, height); - var maskCtx = maskCanvas.context; - maskCtx.save(); - - putBinaryImageMask(maskCtx, img); - - maskCtx.globalCompositeOperation = 'source-in'; - - maskCtx.fillStyle = isPatternFill ? - fillColor.getPattern(maskCtx, this) : fillColor; - maskCtx.fillRect(0, 0, width, height); - - maskCtx.restore(); - - this.paintInlineImageXObject(maskCanvas.canvas); - }, - - paintImageMaskXObjectRepeat: - function CanvasGraphics_paintImageMaskXObjectRepeat(imgData, scaleX, - scaleY, positions) { - var width = imgData.width; - var height = imgData.height; - var fillColor = this.current.fillColor; - var isPatternFill = this.current.patternFill; - - var maskCanvas = this.cachedCanvases.getCanvas('maskCanvas', - width, height); - var maskCtx = maskCanvas.context; - maskCtx.save(); - - putBinaryImageMask(maskCtx, imgData); - - maskCtx.globalCompositeOperation = 'source-in'; - - maskCtx.fillStyle = isPatternFill ? - fillColor.getPattern(maskCtx, this) : fillColor; - maskCtx.fillRect(0, 0, width, height); - - maskCtx.restore(); - - var ctx = this.ctx; - for (var i = 0, ii = positions.length; i < ii; i += 2) { - ctx.save(); - ctx.transform(scaleX, 0, 0, scaleY, positions[i], positions[i + 1]); - ctx.scale(1, -1); - ctx.drawImage(maskCanvas.canvas, 0, 0, width, height, - 0, -1, 1, 1); - ctx.restore(); - } - }, - - paintImageMaskXObjectGroup: - function CanvasGraphics_paintImageMaskXObjectGroup(images) { - var ctx = this.ctx; - - var fillColor = this.current.fillColor; - var isPatternFill = this.current.patternFill; - for (var i = 0, ii = images.length; i < ii; i++) { - var image = images[i]; - var width = image.width, height = image.height; - - var maskCanvas = this.cachedCanvases.getCanvas('maskCanvas', - width, height); - var maskCtx = maskCanvas.context; - maskCtx.save(); - - putBinaryImageMask(maskCtx, image); - - maskCtx.globalCompositeOperation = 'source-in'; - - maskCtx.fillStyle = isPatternFill ? - fillColor.getPattern(maskCtx, this) : fillColor; - maskCtx.fillRect(0, 0, width, height); - - maskCtx.restore(); - - ctx.save(); - ctx.transform.apply(ctx, image.transform); - ctx.scale(1, -1); - ctx.drawImage(maskCanvas.canvas, 0, 0, width, height, - 0, -1, 1, 1); - ctx.restore(); - } - }, - - paintImageXObject: function CanvasGraphics_paintImageXObject(objId) { - var imgData = this.objs.get(objId); - if (!imgData) { - warn('Dependent image isn\'t ready yet'); - return; - } - - this.paintInlineImageXObject(imgData); - }, - - paintImageXObjectRepeat: - function CanvasGraphics_paintImageXObjectRepeat(objId, scaleX, scaleY, - positions) { - var imgData = this.objs.get(objId); - if (!imgData) { - warn('Dependent image isn\'t ready yet'); - return; - } - - var width = imgData.width; - var height = imgData.height; - var map = []; - for (var i = 0, ii = positions.length; i < ii; i += 2) { - map.push({transform: [scaleX, 0, 0, scaleY, positions[i], - positions[i + 1]], x: 0, y: 0, w: width, h: height}); - } - this.paintInlineImageXObjectGroup(imgData, map); - }, - - paintInlineImageXObject: - function CanvasGraphics_paintInlineImageXObject(imgData) { - var width = imgData.width; - var height = imgData.height; - var ctx = this.ctx; - - this.save(); - // scale the image to the unit square - ctx.scale(1 / width, -1 / height); - - var currentTransform = ctx.mozCurrentTransformInverse; - var a = currentTransform[0], b = currentTransform[1]; - var widthScale = Math.max(Math.sqrt(a * a + b * b), 1); - var c = currentTransform[2], d = currentTransform[3]; - var heightScale = Math.max(Math.sqrt(c * c + d * d), 1); - - var imgToPaint, tmpCanvas; - // instanceof HTMLElement does not work in jsdom node.js module - if (imgData instanceof HTMLElement || !imgData.data) { - imgToPaint = imgData; - } else { - tmpCanvas = this.cachedCanvases.getCanvas('inlineImage', - width, height); - var tmpCtx = tmpCanvas.context; - putBinaryImageData(tmpCtx, imgData); - imgToPaint = tmpCanvas.canvas; - } - - var paintWidth = width, paintHeight = height; - var tmpCanvasId = 'prescale1'; - // Vertial or horizontal scaling shall not be more than 2 to not loose the - // pixels during drawImage operation, painting on the temporary canvas(es) - // that are twice smaller in size - while ((widthScale > 2 && paintWidth > 1) || - (heightScale > 2 && paintHeight > 1)) { - var newWidth = paintWidth, newHeight = paintHeight; - if (widthScale > 2 && paintWidth > 1) { - newWidth = Math.ceil(paintWidth / 2); - widthScale /= paintWidth / newWidth; - } - if (heightScale > 2 && paintHeight > 1) { - newHeight = Math.ceil(paintHeight / 2); - heightScale /= paintHeight / newHeight; - } - tmpCanvas = this.cachedCanvases.getCanvas(tmpCanvasId, - newWidth, newHeight); - tmpCtx = tmpCanvas.context; - tmpCtx.clearRect(0, 0, newWidth, newHeight); - tmpCtx.drawImage(imgToPaint, 0, 0, paintWidth, paintHeight, - 0, 0, newWidth, newHeight); - imgToPaint = tmpCanvas.canvas; - paintWidth = newWidth; - paintHeight = newHeight; - tmpCanvasId = tmpCanvasId === 'prescale1' ? 'prescale2' : 'prescale1'; - } - ctx.drawImage(imgToPaint, 0, 0, paintWidth, paintHeight, - 0, -height, width, height); - - if (this.imageLayer) { - var position = this.getCanvasPosition(0, -height); - this.imageLayer.appendImage({ - imgData: imgData, - left: position[0], - top: position[1], - width: width / currentTransform[0], - height: height / currentTransform[3] - }); - } - this.restore(); - }, - - paintInlineImageXObjectGroup: - function CanvasGraphics_paintInlineImageXObjectGroup(imgData, map) { - var ctx = this.ctx; - var w = imgData.width; - var h = imgData.height; - - var tmpCanvas = this.cachedCanvases.getCanvas('inlineImage', w, h); - var tmpCtx = tmpCanvas.context; - putBinaryImageData(tmpCtx, imgData); - - for (var i = 0, ii = map.length; i < ii; i++) { - var entry = map[i]; - ctx.save(); - ctx.transform.apply(ctx, entry.transform); - ctx.scale(1, -1); - ctx.drawImage(tmpCanvas.canvas, entry.x, entry.y, entry.w, entry.h, - 0, -1, 1, 1); - if (this.imageLayer) { - var position = this.getCanvasPosition(entry.x, entry.y); - this.imageLayer.appendImage({ - imgData: imgData, - left: position[0], - top: position[1], - width: w, - height: h - }); - } - ctx.restore(); - } - }, - - paintSolidColorImageMask: - function CanvasGraphics_paintSolidColorImageMask() { - this.ctx.fillRect(0, 0, 1, 1); - }, - - paintXObject: function CanvasGraphics_paintXObject() { - warn('Unsupported \'paintXObject\' command.'); - }, - - // Marked content - - markPoint: function CanvasGraphics_markPoint(tag) { - // TODO Marked content. - }, - markPointProps: function CanvasGraphics_markPointProps(tag, properties) { - // TODO Marked content. - }, - beginMarkedContent: function CanvasGraphics_beginMarkedContent(tag) { - // TODO Marked content. - }, - beginMarkedContentProps: function CanvasGraphics_beginMarkedContentProps( - tag, properties) { - // TODO Marked content. - }, - endMarkedContent: function CanvasGraphics_endMarkedContent() { - // TODO Marked content. - }, - - // Compatibility - - beginCompat: function CanvasGraphics_beginCompat() { - // TODO ignore undefined operators (should we do that anyway?) - }, - endCompat: function CanvasGraphics_endCompat() { - // TODO stop ignoring undefined operators - }, - - // Helper functions - - consumePath: function CanvasGraphics_consumePath() { - var ctx = this.ctx; - if (this.pendingClip) { - if (this.pendingClip === EO_CLIP) { - if (ctx.mozFillRule !== undefined) { - ctx.mozFillRule = 'evenodd'; - ctx.clip(); - ctx.mozFillRule = 'nonzero'; - } else { - ctx.clip('evenodd'); - } - } else { - ctx.clip(); - } - this.pendingClip = null; - } - ctx.beginPath(); - }, - getSinglePixelWidth: function CanvasGraphics_getSinglePixelWidth(scale) { - if (this.cachedGetSinglePixelWidth === null) { - var inverse = this.ctx.mozCurrentTransformInverse; - // max of the current horizontal and vertical scale - this.cachedGetSinglePixelWidth = Math.sqrt(Math.max( - (inverse[0] * inverse[0] + inverse[1] * inverse[1]), - (inverse[2] * inverse[2] + inverse[3] * inverse[3]))); - } - return this.cachedGetSinglePixelWidth; - }, - getCanvasPosition: function CanvasGraphics_getCanvasPosition(x, y) { - var transform = this.ctx.mozCurrentTransform; - return [ - transform[0] * x + transform[2] * y + transform[4], - transform[1] * x + transform[3] * y + transform[5] - ]; - } - }; - - for (var op in OPS) { - CanvasGraphics.prototype[OPS[op]] = CanvasGraphics.prototype[op]; - } - - return CanvasGraphics; -})(); - - -var WebGLUtils = (function WebGLUtilsClosure() { - function loadShader(gl, code, shaderType) { - var shader = gl.createShader(shaderType); - gl.shaderSource(shader, code); - gl.compileShader(shader); - var compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS); - if (!compiled) { - var errorMsg = gl.getShaderInfoLog(shader); - throw new Error('Error during shader compilation: ' + errorMsg); - } - return shader; - } - function createVertexShader(gl, code) { - return loadShader(gl, code, gl.VERTEX_SHADER); - } - function createFragmentShader(gl, code) { - return loadShader(gl, code, gl.FRAGMENT_SHADER); - } - function createProgram(gl, shaders) { - var program = gl.createProgram(); - for (var i = 0, ii = shaders.length; i < ii; ++i) { - gl.attachShader(program, shaders[i]); - } - gl.linkProgram(program); - var linked = gl.getProgramParameter(program, gl.LINK_STATUS); - if (!linked) { - var errorMsg = gl.getProgramInfoLog(program); - throw new Error('Error during program linking: ' + errorMsg); - } - return program; - } - function createTexture(gl, image, textureId) { - gl.activeTexture(textureId); - var texture = gl.createTexture(); - gl.bindTexture(gl.TEXTURE_2D, texture); - - // Set the parameters so we can render any size image. - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); - - // Upload the image into the texture. - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image); - return texture; - } - - var currentGL, currentCanvas; - function generateGL() { - if (currentGL) { - return; - } - currentCanvas = document.createElement('canvas'); - currentGL = currentCanvas.getContext('webgl', - { premultipliedalpha: false }); - } - - var smaskVertexShaderCode = '\ - attribute vec2 a_position; \ - attribute vec2 a_texCoord; \ - \ - uniform vec2 u_resolution; \ - \ - varying vec2 v_texCoord; \ - \ - void main() { \ - vec2 clipSpace = (a_position / u_resolution) * 2.0 - 1.0; \ - gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); \ - \ - v_texCoord = a_texCoord; \ - } '; - - var smaskFragmentShaderCode = '\ - precision mediump float; \ - \ - uniform vec4 u_backdrop; \ - uniform int u_subtype; \ - uniform sampler2D u_image; \ - uniform sampler2D u_mask; \ - \ - varying vec2 v_texCoord; \ - \ - void main() { \ - vec4 imageColor = texture2D(u_image, v_texCoord); \ - vec4 maskColor = texture2D(u_mask, v_texCoord); \ - if (u_backdrop.a > 0.0) { \ - maskColor.rgb = maskColor.rgb * maskColor.a + \ - u_backdrop.rgb * (1.0 - maskColor.a); \ - } \ - float lum; \ - if (u_subtype == 0) { \ - lum = maskColor.a; \ - } else { \ - lum = maskColor.r * 0.3 + maskColor.g * 0.59 + \ - maskColor.b * 0.11; \ - } \ - imageColor.a *= lum; \ - imageColor.rgb *= imageColor.a; \ - gl_FragColor = imageColor; \ - } '; - - var smaskCache = null; - - function initSmaskGL() { - var canvas, gl; - - generateGL(); - canvas = currentCanvas; - currentCanvas = null; - gl = currentGL; - currentGL = null; - - // setup a GLSL program - var vertexShader = createVertexShader(gl, smaskVertexShaderCode); - var fragmentShader = createFragmentShader(gl, smaskFragmentShaderCode); - var program = createProgram(gl, [vertexShader, fragmentShader]); - gl.useProgram(program); - - var cache = {}; - cache.gl = gl; - cache.canvas = canvas; - cache.resolutionLocation = gl.getUniformLocation(program, 'u_resolution'); - cache.positionLocation = gl.getAttribLocation(program, 'a_position'); - cache.backdropLocation = gl.getUniformLocation(program, 'u_backdrop'); - cache.subtypeLocation = gl.getUniformLocation(program, 'u_subtype'); - - var texCoordLocation = gl.getAttribLocation(program, 'a_texCoord'); - var texLayerLocation = gl.getUniformLocation(program, 'u_image'); - var texMaskLocation = gl.getUniformLocation(program, 'u_mask'); - - // provide texture coordinates for the rectangle. - var texCoordBuffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, texCoordBuffer); - gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ - 0.0, 0.0, - 1.0, 0.0, - 0.0, 1.0, - 0.0, 1.0, - 1.0, 0.0, - 1.0, 1.0]), gl.STATIC_DRAW); - gl.enableVertexAttribArray(texCoordLocation); - gl.vertexAttribPointer(texCoordLocation, 2, gl.FLOAT, false, 0, 0); - - gl.uniform1i(texLayerLocation, 0); - gl.uniform1i(texMaskLocation, 1); - - smaskCache = cache; - } - - function composeSMask(layer, mask, properties) { - var width = layer.width, height = layer.height; - - if (!smaskCache) { - initSmaskGL(); - } - var cache = smaskCache,canvas = cache.canvas, gl = cache.gl; - canvas.width = width; - canvas.height = height; - gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); - gl.uniform2f(cache.resolutionLocation, width, height); - - if (properties.backdrop) { - gl.uniform4f(cache.resolutionLocation, properties.backdrop[0], - properties.backdrop[1], properties.backdrop[2], 1); - } else { - gl.uniform4f(cache.resolutionLocation, 0, 0, 0, 0); - } - gl.uniform1i(cache.subtypeLocation, - properties.subtype === 'Luminosity' ? 1 : 0); - - // Create a textures - var texture = createTexture(gl, layer, gl.TEXTURE0); - var maskTexture = createTexture(gl, mask, gl.TEXTURE1); - - - // Create a buffer and put a single clipspace rectangle in - // it (2 triangles) - var buffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, buffer); - gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ - 0, 0, - width, 0, - 0, height, - 0, height, - width, 0, - width, height]), gl.STATIC_DRAW); - gl.enableVertexAttribArray(cache.positionLocation); - gl.vertexAttribPointer(cache.positionLocation, 2, gl.FLOAT, false, 0, 0); - - // draw - gl.clearColor(0, 0, 0, 0); - gl.enable(gl.BLEND); - gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); - gl.clear(gl.COLOR_BUFFER_BIT); - - gl.drawArrays(gl.TRIANGLES, 0, 6); - - gl.flush(); - - gl.deleteTexture(texture); - gl.deleteTexture(maskTexture); - gl.deleteBuffer(buffer); - - return canvas; - } - - var figuresVertexShaderCode = '\ - attribute vec2 a_position; \ - attribute vec3 a_color; \ - \ - uniform vec2 u_resolution; \ - uniform vec2 u_scale; \ - uniform vec2 u_offset; \ - \ - varying vec4 v_color; \ - \ - void main() { \ - vec2 position = (a_position + u_offset) * u_scale; \ - vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0; \ - gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); \ - \ - v_color = vec4(a_color / 255.0, 1.0); \ - } '; - - var figuresFragmentShaderCode = '\ - precision mediump float; \ - \ - varying vec4 v_color; \ - \ - void main() { \ - gl_FragColor = v_color; \ - } '; - - var figuresCache = null; - - function initFiguresGL() { - var canvas, gl; - - generateGL(); - canvas = currentCanvas; - currentCanvas = null; - gl = currentGL; - currentGL = null; - - // setup a GLSL program - var vertexShader = createVertexShader(gl, figuresVertexShaderCode); - var fragmentShader = createFragmentShader(gl, figuresFragmentShaderCode); - var program = createProgram(gl, [vertexShader, fragmentShader]); - gl.useProgram(program); - - var cache = {}; - cache.gl = gl; - cache.canvas = canvas; - cache.resolutionLocation = gl.getUniformLocation(program, 'u_resolution'); - cache.scaleLocation = gl.getUniformLocation(program, 'u_scale'); - cache.offsetLocation = gl.getUniformLocation(program, 'u_offset'); - cache.positionLocation = gl.getAttribLocation(program, 'a_position'); - cache.colorLocation = gl.getAttribLocation(program, 'a_color'); - - figuresCache = cache; - } - - function drawFigures(width, height, backgroundColor, figures, context) { - if (!figuresCache) { - initFiguresGL(); - } - var cache = figuresCache, canvas = cache.canvas, gl = cache.gl; - - canvas.width = width; - canvas.height = height; - gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); - gl.uniform2f(cache.resolutionLocation, width, height); - - // count triangle points - var count = 0; - var i, ii, rows; - for (i = 0, ii = figures.length; i < ii; i++) { - switch (figures[i].type) { - case 'lattice': - rows = (figures[i].coords.length / figures[i].verticesPerRow) | 0; - count += (rows - 1) * (figures[i].verticesPerRow - 1) * 6; - break; - case 'triangles': - count += figures[i].coords.length; - break; - } - } - // transfer data - var coords = new Float32Array(count * 2); - var colors = new Uint8Array(count * 3); - var coordsMap = context.coords, colorsMap = context.colors; - var pIndex = 0, cIndex = 0; - for (i = 0, ii = figures.length; i < ii; i++) { - var figure = figures[i], ps = figure.coords, cs = figure.colors; - switch (figure.type) { - case 'lattice': - var cols = figure.verticesPerRow; - rows = (ps.length / cols) | 0; - for (var row = 1; row < rows; row++) { - var offset = row * cols + 1; - for (var col = 1; col < cols; col++, offset++) { - coords[pIndex] = coordsMap[ps[offset - cols - 1]]; - coords[pIndex + 1] = coordsMap[ps[offset - cols - 1] + 1]; - coords[pIndex + 2] = coordsMap[ps[offset - cols]]; - coords[pIndex + 3] = coordsMap[ps[offset - cols] + 1]; - coords[pIndex + 4] = coordsMap[ps[offset - 1]]; - coords[pIndex + 5] = coordsMap[ps[offset - 1] + 1]; - colors[cIndex] = colorsMap[cs[offset - cols - 1]]; - colors[cIndex + 1] = colorsMap[cs[offset - cols - 1] + 1]; - colors[cIndex + 2] = colorsMap[cs[offset - cols - 1] + 2]; - colors[cIndex + 3] = colorsMap[cs[offset - cols]]; - colors[cIndex + 4] = colorsMap[cs[offset - cols] + 1]; - colors[cIndex + 5] = colorsMap[cs[offset - cols] + 2]; - colors[cIndex + 6] = colorsMap[cs[offset - 1]]; - colors[cIndex + 7] = colorsMap[cs[offset - 1] + 1]; - colors[cIndex + 8] = colorsMap[cs[offset - 1] + 2]; - - coords[pIndex + 6] = coords[pIndex + 2]; - coords[pIndex + 7] = coords[pIndex + 3]; - coords[pIndex + 8] = coords[pIndex + 4]; - coords[pIndex + 9] = coords[pIndex + 5]; - coords[pIndex + 10] = coordsMap[ps[offset]]; - coords[pIndex + 11] = coordsMap[ps[offset] + 1]; - colors[cIndex + 9] = colors[cIndex + 3]; - colors[cIndex + 10] = colors[cIndex + 4]; - colors[cIndex + 11] = colors[cIndex + 5]; - colors[cIndex + 12] = colors[cIndex + 6]; - colors[cIndex + 13] = colors[cIndex + 7]; - colors[cIndex + 14] = colors[cIndex + 8]; - colors[cIndex + 15] = colorsMap[cs[offset]]; - colors[cIndex + 16] = colorsMap[cs[offset] + 1]; - colors[cIndex + 17] = colorsMap[cs[offset] + 2]; - pIndex += 12; - cIndex += 18; - } - } - break; - case 'triangles': - for (var j = 0, jj = ps.length; j < jj; j++) { - coords[pIndex] = coordsMap[ps[j]]; - coords[pIndex + 1] = coordsMap[ps[j] + 1]; - colors[cIndex] = colorsMap[cs[j]]; - colors[cIndex + 1] = colorsMap[cs[j] + 1]; - colors[cIndex + 2] = colorsMap[cs[j] + 2]; - pIndex += 2; - cIndex += 3; - } - break; - } - } - - // draw - if (backgroundColor) { - gl.clearColor(backgroundColor[0] / 255, backgroundColor[1] / 255, - backgroundColor[2] / 255, 1.0); - } else { - gl.clearColor(0, 0, 0, 0); - } - gl.clear(gl.COLOR_BUFFER_BIT); - - var coordsBuffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, coordsBuffer); - gl.bufferData(gl.ARRAY_BUFFER, coords, gl.STATIC_DRAW); - gl.enableVertexAttribArray(cache.positionLocation); - gl.vertexAttribPointer(cache.positionLocation, 2, gl.FLOAT, false, 0, 0); - - var colorsBuffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, colorsBuffer); - gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW); - gl.enableVertexAttribArray(cache.colorLocation); - gl.vertexAttribPointer(cache.colorLocation, 3, gl.UNSIGNED_BYTE, false, - 0, 0); - - gl.uniform2f(cache.scaleLocation, context.scaleX, context.scaleY); - gl.uniform2f(cache.offsetLocation, context.offsetX, context.offsetY); - - gl.drawArrays(gl.TRIANGLES, 0, count); - - gl.flush(); - - gl.deleteBuffer(coordsBuffer); - gl.deleteBuffer(colorsBuffer); - - return canvas; - } - - function cleanup() { - if (smaskCache && smaskCache.canvas) { - smaskCache.canvas.width = 0; - smaskCache.canvas.height = 0; - } - if (figuresCache && figuresCache.canvas) { - figuresCache.canvas.width = 0; - figuresCache.canvas.height = 0; - } - smaskCache = null; - figuresCache = null; - } - - return { - get isEnabled() { - if (PDFJS.disableWebGL) { - return false; - } - var enabled = false; - try { - generateGL(); - enabled = !!currentGL; - } catch (e) { } - return shadow(this, 'isEnabled', enabled); - }, - composeSMask: composeSMask, - drawFigures: drawFigures, - clear: cleanup - }; -})(); - - -var ShadingIRs = {}; - -ShadingIRs.RadialAxial = { - fromIR: function RadialAxial_fromIR(raw) { - var type = raw[1]; - var colorStops = raw[2]; - var p0 = raw[3]; - var p1 = raw[4]; - var r0 = raw[5]; - var r1 = raw[6]; - return { - type: 'Pattern', - getPattern: function RadialAxial_getPattern(ctx) { - var grad; - if (type === 'axial') { - grad = ctx.createLinearGradient(p0[0], p0[1], p1[0], p1[1]); - } else if (type === 'radial') { - grad = ctx.createRadialGradient(p0[0], p0[1], r0, p1[0], p1[1], r1); - } - - for (var i = 0, ii = colorStops.length; i < ii; ++i) { - var c = colorStops[i]; - grad.addColorStop(c[0], c[1]); - } - return grad; - } - }; - } -}; - -var createMeshCanvas = (function createMeshCanvasClosure() { - function drawTriangle(data, context, p1, p2, p3, c1, c2, c3) { - // Very basic Gouraud-shaded triangle rasterization algorithm. - var coords = context.coords, colors = context.colors; - var bytes = data.data, rowSize = data.width * 4; - var tmp; - if (coords[p1 + 1] > coords[p2 + 1]) { - tmp = p1; p1 = p2; p2 = tmp; tmp = c1; c1 = c2; c2 = tmp; - } - if (coords[p2 + 1] > coords[p3 + 1]) { - tmp = p2; p2 = p3; p3 = tmp; tmp = c2; c2 = c3; c3 = tmp; - } - if (coords[p1 + 1] > coords[p2 + 1]) { - tmp = p1; p1 = p2; p2 = tmp; tmp = c1; c1 = c2; c2 = tmp; - } - var x1 = (coords[p1] + context.offsetX) * context.scaleX; - var y1 = (coords[p1 + 1] + context.offsetY) * context.scaleY; - var x2 = (coords[p2] + context.offsetX) * context.scaleX; - var y2 = (coords[p2 + 1] + context.offsetY) * context.scaleY; - var x3 = (coords[p3] + context.offsetX) * context.scaleX; - var y3 = (coords[p3 + 1] + context.offsetY) * context.scaleY; - if (y1 >= y3) { - return; - } - var c1r = colors[c1], c1g = colors[c1 + 1], c1b = colors[c1 + 2]; - var c2r = colors[c2], c2g = colors[c2 + 1], c2b = colors[c2 + 2]; - var c3r = colors[c3], c3g = colors[c3 + 1], c3b = colors[c3 + 2]; - - var minY = Math.round(y1), maxY = Math.round(y3); - var xa, car, cag, cab; - var xb, cbr, cbg, cbb; - var k; - for (var y = minY; y <= maxY; y++) { - if (y < y2) { - k = y < y1 ? 0 : y1 === y2 ? 1 : (y1 - y) / (y1 - y2); - xa = x1 - (x1 - x2) * k; - car = c1r - (c1r - c2r) * k; - cag = c1g - (c1g - c2g) * k; - cab = c1b - (c1b - c2b) * k; - } else { - k = y > y3 ? 1 : y2 === y3 ? 0 : (y2 - y) / (y2 - y3); - xa = x2 - (x2 - x3) * k; - car = c2r - (c2r - c3r) * k; - cag = c2g - (c2g - c3g) * k; - cab = c2b - (c2b - c3b) * k; - } - k = y < y1 ? 0 : y > y3 ? 1 : (y1 - y) / (y1 - y3); - xb = x1 - (x1 - x3) * k; - cbr = c1r - (c1r - c3r) * k; - cbg = c1g - (c1g - c3g) * k; - cbb = c1b - (c1b - c3b) * k; - var x1_ = Math.round(Math.min(xa, xb)); - var x2_ = Math.round(Math.max(xa, xb)); - var j = rowSize * y + x1_ * 4; - for (var x = x1_; x <= x2_; x++) { - k = (xa - x) / (xa - xb); - k = k < 0 ? 0 : k > 1 ? 1 : k; - bytes[j++] = (car - (car - cbr) * k) | 0; - bytes[j++] = (cag - (cag - cbg) * k) | 0; - bytes[j++] = (cab - (cab - cbb) * k) | 0; - bytes[j++] = 255; - } - } - } - - function drawFigure(data, figure, context) { - var ps = figure.coords; - var cs = figure.colors; - var i, ii; - switch (figure.type) { - case 'lattice': - var verticesPerRow = figure.verticesPerRow; - var rows = Math.floor(ps.length / verticesPerRow) - 1; - var cols = verticesPerRow - 1; - for (i = 0; i < rows; i++) { - var q = i * verticesPerRow; - for (var j = 0; j < cols; j++, q++) { - drawTriangle(data, context, - ps[q], ps[q + 1], ps[q + verticesPerRow], - cs[q], cs[q + 1], cs[q + verticesPerRow]); - drawTriangle(data, context, - ps[q + verticesPerRow + 1], ps[q + 1], ps[q + verticesPerRow], - cs[q + verticesPerRow + 1], cs[q + 1], cs[q + verticesPerRow]); - } - } - break; - case 'triangles': - for (i = 0, ii = ps.length; i < ii; i += 3) { - drawTriangle(data, context, - ps[i], ps[i + 1], ps[i + 2], - cs[i], cs[i + 1], cs[i + 2]); - } - break; - default: - error('illigal figure'); - break; - } - } - - function createMeshCanvas(bounds, combinesScale, coords, colors, figures, - backgroundColor, cachedCanvases) { - // we will increase scale on some weird factor to let antialiasing take - // care of "rough" edges - var EXPECTED_SCALE = 1.1; - // MAX_PATTERN_SIZE is used to avoid OOM situation. - var MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough - - var offsetX = Math.floor(bounds[0]); - var offsetY = Math.floor(bounds[1]); - var boundsWidth = Math.ceil(bounds[2]) - offsetX; - var boundsHeight = Math.ceil(bounds[3]) - offsetY; - - var width = Math.min(Math.ceil(Math.abs(boundsWidth * combinesScale[0] * - EXPECTED_SCALE)), MAX_PATTERN_SIZE); - var height = Math.min(Math.ceil(Math.abs(boundsHeight * combinesScale[1] * - EXPECTED_SCALE)), MAX_PATTERN_SIZE); - var scaleX = boundsWidth / width; - var scaleY = boundsHeight / height; - - var context = { - coords: coords, - colors: colors, - offsetX: -offsetX, - offsetY: -offsetY, - scaleX: 1 / scaleX, - scaleY: 1 / scaleY - }; - - var canvas, tmpCanvas, i, ii; - if (WebGLUtils.isEnabled) { - canvas = WebGLUtils.drawFigures(width, height, backgroundColor, - figures, context); - - // https://bugzilla.mozilla.org/show_bug.cgi?id=972126 - tmpCanvas = cachedCanvases.getCanvas('mesh', width, height, false); - tmpCanvas.context.drawImage(canvas, 0, 0); - canvas = tmpCanvas.canvas; - } else { - tmpCanvas = cachedCanvases.getCanvas('mesh', width, height, false); - var tmpCtx = tmpCanvas.context; - - var data = tmpCtx.createImageData(width, height); - if (backgroundColor) { - var bytes = data.data; - for (i = 0, ii = bytes.length; i < ii; i += 4) { - bytes[i] = backgroundColor[0]; - bytes[i + 1] = backgroundColor[1]; - bytes[i + 2] = backgroundColor[2]; - bytes[i + 3] = 255; - } - } - for (i = 0; i < figures.length; i++) { - drawFigure(data, figures[i], context); - } - tmpCtx.putImageData(data, 0, 0); - canvas = tmpCanvas.canvas; - } - - return {canvas: canvas, offsetX: offsetX, offsetY: offsetY, - scaleX: scaleX, scaleY: scaleY}; - } - return createMeshCanvas; -})(); - -ShadingIRs.Mesh = { - fromIR: function Mesh_fromIR(raw) { - //var type = raw[1]; - var coords = raw[2]; - var colors = raw[3]; - var figures = raw[4]; - var bounds = raw[5]; - var matrix = raw[6]; - //var bbox = raw[7]; - var background = raw[8]; - return { - type: 'Pattern', - getPattern: function Mesh_getPattern(ctx, owner, shadingFill) { - var scale; - if (shadingFill) { - scale = Util.singularValueDecompose2dScale(ctx.mozCurrentTransform); - } else { - // Obtain scale from matrix and current transformation matrix. - scale = Util.singularValueDecompose2dScale(owner.baseTransform); - if (matrix) { - var matrixScale = Util.singularValueDecompose2dScale(matrix); - scale = [scale[0] * matrixScale[0], - scale[1] * matrixScale[1]]; - } - } - - - // Rasterizing on the main thread since sending/queue large canvases - // might cause OOM. - var temporaryPatternCanvas = createMeshCanvas(bounds, scale, coords, - colors, figures, shadingFill ? null : background, - owner.cachedCanvases); - - if (!shadingFill) { - ctx.setTransform.apply(ctx, owner.baseTransform); - if (matrix) { - ctx.transform.apply(ctx, matrix); - } - } - - ctx.translate(temporaryPatternCanvas.offsetX, - temporaryPatternCanvas.offsetY); - ctx.scale(temporaryPatternCanvas.scaleX, - temporaryPatternCanvas.scaleY); - - return ctx.createPattern(temporaryPatternCanvas.canvas, 'no-repeat'); - } - }; - } -}; - -ShadingIRs.Dummy = { - fromIR: function Dummy_fromIR() { - return { - type: 'Pattern', - getPattern: function Dummy_fromIR_getPattern() { - return 'hotpink'; - } - }; - } -}; - -function getShadingPatternFromIR(raw) { - var shadingIR = ShadingIRs[raw[0]]; - if (!shadingIR) { - error('Unknown IR type: ' + raw[0]); - } - return shadingIR.fromIR(raw); -} - -var TilingPattern = (function TilingPatternClosure() { - var PaintType = { - COLORED: 1, - UNCOLORED: 2 - }; - - var MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough - - function TilingPattern(IR, color, ctx, objs, commonObjs, baseTransform) { - this.operatorList = IR[2]; - this.matrix = IR[3] || [1, 0, 0, 1, 0, 0]; - this.bbox = IR[4]; - this.xstep = IR[5]; - this.ystep = IR[6]; - this.paintType = IR[7]; - this.tilingType = IR[8]; - this.color = color; - this.objs = objs; - this.commonObjs = commonObjs; - this.baseTransform = baseTransform; - this.type = 'Pattern'; - this.ctx = ctx; - } - - TilingPattern.prototype = { - createPatternCanvas: function TilinPattern_createPatternCanvas(owner) { - var operatorList = this.operatorList; - var bbox = this.bbox; - var xstep = this.xstep; - var ystep = this.ystep; - var paintType = this.paintType; - var tilingType = this.tilingType; - var color = this.color; - var objs = this.objs; - var commonObjs = this.commonObjs; - - info('TilingType: ' + tilingType); - - var x0 = bbox[0], y0 = bbox[1], x1 = bbox[2], y1 = bbox[3]; - - var topLeft = [x0, y0]; - // we want the canvas to be as large as the step size - var botRight = [x0 + xstep, y0 + ystep]; - - var width = botRight[0] - topLeft[0]; - var height = botRight[1] - topLeft[1]; - - // Obtain scale from matrix and current transformation matrix. - var matrixScale = Util.singularValueDecompose2dScale(this.matrix); - var curMatrixScale = Util.singularValueDecompose2dScale( - this.baseTransform); - var combinedScale = [matrixScale[0] * curMatrixScale[0], - matrixScale[1] * curMatrixScale[1]]; - - // MAX_PATTERN_SIZE is used to avoid OOM situation. - // Use width and height values that are as close as possible to the end - // result when the pattern is used. Too low value makes the pattern look - // blurry. Too large value makes it look too crispy. - width = Math.min(Math.ceil(Math.abs(width * combinedScale[0])), - MAX_PATTERN_SIZE); - - height = Math.min(Math.ceil(Math.abs(height * combinedScale[1])), - MAX_PATTERN_SIZE); - - var tmpCanvas = owner.cachedCanvases.getCanvas('pattern', - width, height, true); - var tmpCtx = tmpCanvas.context; - var graphics = new CanvasGraphics(tmpCtx, commonObjs, objs); - graphics.groupLevel = owner.groupLevel; - - this.setFillAndStrokeStyleToContext(tmpCtx, paintType, color); - - this.setScale(width, height, xstep, ystep); - this.transformToScale(graphics); - - // transform coordinates to pattern space - var tmpTranslate = [1, 0, 0, 1, -topLeft[0], -topLeft[1]]; - graphics.transform.apply(graphics, tmpTranslate); - - this.clipBbox(graphics, bbox, x0, y0, x1, y1); - - graphics.executeOperatorList(operatorList); - return tmpCanvas.canvas; - }, - - setScale: function TilingPattern_setScale(width, height, xstep, ystep) { - this.scale = [width / xstep, height / ystep]; - }, - - transformToScale: function TilingPattern_transformToScale(graphics) { - var scale = this.scale; - var tmpScale = [scale[0], 0, 0, scale[1], 0, 0]; - graphics.transform.apply(graphics, tmpScale); - }, - - scaleToContext: function TilingPattern_scaleToContext() { - var scale = this.scale; - this.ctx.scale(1 / scale[0], 1 / scale[1]); - }, - - clipBbox: function clipBbox(graphics, bbox, x0, y0, x1, y1) { - if (bbox && isArray(bbox) && bbox.length === 4) { - var bboxWidth = x1 - x0; - var bboxHeight = y1 - y0; - graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight); - graphics.clip(); - graphics.endPath(); - } - }, - - setFillAndStrokeStyleToContext: - function setFillAndStrokeStyleToContext(context, paintType, color) { - switch (paintType) { - case PaintType.COLORED: - var ctx = this.ctx; - context.fillStyle = ctx.fillStyle; - context.strokeStyle = ctx.strokeStyle; - break; - case PaintType.UNCOLORED: - var cssColor = Util.makeCssRgb(color[0], color[1], color[2]); - context.fillStyle = cssColor; - context.strokeStyle = cssColor; - break; - default: - error('Unsupported paint type: ' + paintType); - } - }, - - getPattern: function TilingPattern_getPattern(ctx, owner) { - var temporaryPatternCanvas = this.createPatternCanvas(owner); - - ctx = this.ctx; - ctx.setTransform.apply(ctx, this.baseTransform); - ctx.transform.apply(ctx, this.matrix); - this.scaleToContext(); - - return ctx.createPattern(temporaryPatternCanvas, 'repeat'); - } - }; - - return TilingPattern; -})(); - - -function FontLoader(docId) { - this.docId = docId; - this.styleElement = null; - this.nativeFontFaces = []; - this.loadTestFontId = 0; - this.loadingContext = { - requests: [], - nextRequestId: 0 - }; -} -FontLoader.prototype = { - insertRule: function fontLoaderInsertRule(rule) { - var styleElement = this.styleElement; - if (!styleElement) { - styleElement = this.styleElement = document.createElement('style'); - styleElement.id = 'PDFJS_FONT_STYLE_TAG_' + this.docId; - document.documentElement.getElementsByTagName('head')[0].appendChild( - styleElement); - } - - var styleSheet = styleElement.sheet; - styleSheet.insertRule(rule, styleSheet.cssRules.length); - }, - - clear: function fontLoaderClear() { - var styleElement = this.styleElement; - if (styleElement) { - styleElement.parentNode.removeChild(styleElement); - styleElement = this.styleElement = null; - } - this.nativeFontFaces.forEach(function(nativeFontFace) { - document.fonts.delete(nativeFontFace); - }); - this.nativeFontFaces.length = 0; - }, - get loadTestFont() { - // This is a CFF font with 1 glyph for '.' that fills its entire width and - // height. - return shadow(this, 'loadTestFont', atob( - 'T1RU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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAA' + - 'AAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgc' + - 'A/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWF' + - 'hYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQA' + - 'AAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAg' + - 'ABAAAAAAAAAAAD6AAAAAAAAA==' - )); - }, - - addNativeFontFace: function fontLoader_addNativeFontFace(nativeFontFace) { - this.nativeFontFaces.push(nativeFontFace); - document.fonts.add(nativeFontFace); - }, - - bind: function fontLoaderBind(fonts, callback) { - assert(!isWorker, 'bind() shall be called from main thread'); - - var rules = []; - var fontsToLoad = []; - var fontLoadPromises = []; - var getNativeFontPromise = function(nativeFontFace) { - // Return a promise that is always fulfilled, even when the font fails to - // load. - return nativeFontFace.loaded.catch(function(e) { - warn('Failed to load font "' + nativeFontFace.family + '": ' + e); - }); - }; - for (var i = 0, ii = fonts.length; i < ii; i++) { - var font = fonts[i]; - - // Add the font to the DOM only once or skip if the font - // is already loaded. - if (font.attached || font.loading === false) { - continue; - } - font.attached = true; - - if (FontLoader.isFontLoadingAPISupported) { - var nativeFontFace = font.createNativeFontFace(); - if (nativeFontFace) { - this.addNativeFontFace(nativeFontFace); - fontLoadPromises.push(getNativeFontPromise(nativeFontFace)); - } - } else { - var rule = font.createFontFaceRule(); - if (rule) { - this.insertRule(rule); - rules.push(rule); - fontsToLoad.push(font); - } - } - } - - var request = this.queueLoadingCallback(callback); - if (FontLoader.isFontLoadingAPISupported) { - Promise.all(fontLoadPromises).then(function() { - request.complete(); - }); - } else if (rules.length > 0 && !FontLoader.isSyncFontLoadingSupported) { - this.prepareFontLoadEvent(rules, fontsToLoad, request); - } else { - request.complete(); - } - }, - - queueLoadingCallback: function FontLoader_queueLoadingCallback(callback) { - function LoadLoader_completeRequest() { - assert(!request.end, 'completeRequest() cannot be called twice'); - request.end = Date.now(); - - // sending all completed requests in order how they were queued - while (context.requests.length > 0 && context.requests[0].end) { - var otherRequest = context.requests.shift(); - setTimeout(otherRequest.callback, 0); - } - } - - var context = this.loadingContext; - var requestId = 'pdfjs-font-loading-' + (context.nextRequestId++); - var request = { - id: requestId, - complete: LoadLoader_completeRequest, - callback: callback, - started: Date.now() - }; - context.requests.push(request); - return request; - }, - - prepareFontLoadEvent: function fontLoaderPrepareFontLoadEvent(rules, - fonts, - request) { - /** Hack begin */ - // There's currently no event when a font has finished downloading so the - // following code is a dirty hack to 'guess' when a font is - // ready. It's assumed fonts are loaded in order, so add a known test - // font after the desired fonts and then test for the loading of that - // test font. - - function int32(data, offset) { - return (data.charCodeAt(offset) << 24) | - (data.charCodeAt(offset + 1) << 16) | - (data.charCodeAt(offset + 2) << 8) | - (data.charCodeAt(offset + 3) & 0xff); - } - - function spliceString(s, offset, remove, insert) { - var chunk1 = s.substr(0, offset); - var chunk2 = s.substr(offset + remove); - return chunk1 + insert + chunk2; - } - - var i, ii; - - var canvas = document.createElement('canvas'); - canvas.width = 1; - canvas.height = 1; - var ctx = canvas.getContext('2d'); - - var called = 0; - function isFontReady(name, callback) { - called++; - // With setTimeout clamping this gives the font ~100ms to load. - if(called > 30) { - warn('Load test font never loaded.'); - callback(); - return; - } - ctx.font = '30px ' + name; - ctx.fillText('.', 0, 20); - var imageData = ctx.getImageData(0, 0, 1, 1); - if (imageData.data[3] > 0) { - callback(); - return; - } - setTimeout(isFontReady.bind(null, name, callback)); - } - - var loadTestFontId = 'lt' + Date.now() + this.loadTestFontId++; - // Chromium seems to cache fonts based on a hash of the actual font data, - // so the font must be modified for each load test else it will appear to - // be loaded already. - // TODO: This could maybe be made faster by avoiding the btoa of the full - // font by splitting it in chunks before hand and padding the font id. - var data = this.loadTestFont; - var COMMENT_OFFSET = 976; // has to be on 4 byte boundary (for checksum) - data = spliceString(data, COMMENT_OFFSET, loadTestFontId.length, - loadTestFontId); - // CFF checksum is important for IE, adjusting it - var CFF_CHECKSUM_OFFSET = 16; - var XXXX_VALUE = 0x58585858; // the "comment" filled with 'X' - var checksum = int32(data, CFF_CHECKSUM_OFFSET); - for (i = 0, ii = loadTestFontId.length - 3; i < ii; i += 4) { - checksum = (checksum - XXXX_VALUE + int32(loadTestFontId, i)) | 0; - } - if (i < loadTestFontId.length) { // align to 4 bytes boundary - checksum = (checksum - XXXX_VALUE + - int32(loadTestFontId + 'XXX', i)) | 0; - } - data = spliceString(data, CFF_CHECKSUM_OFFSET, 4, string32(checksum)); - - var url = 'url(data:font/opentype;base64,' + btoa(data) + ');'; - var rule = '@font-face { font-family:"' + loadTestFontId + '";src:' + - url + '}'; - this.insertRule(rule); - - var names = []; - for (i = 0, ii = fonts.length; i < ii; i++) { - names.push(fonts[i].loadedName); - } - names.push(loadTestFontId); - - var div = document.createElement('div'); - div.setAttribute('style', - 'visibility: hidden;' + - 'width: 10px; height: 10px;' + - 'position: absolute; top: 0px; left: 0px;'); - for (i = 0, ii = names.length; i < ii; ++i) { - var span = document.createElement('span'); - span.textContent = 'Hi'; - span.style.fontFamily = names[i]; - div.appendChild(span); - } - document.body.appendChild(div); - - isFontReady(loadTestFontId, function() { - document.body.removeChild(div); - request.complete(); - }); - /** Hack end */ - } -}; -FontLoader.isFontLoadingAPISupported = (!isWorker && - typeof document !== 'undefined' && !!document.fonts); -Object.defineProperty(FontLoader, 'isSyncFontLoadingSupported', { - get: function () { - var supported = false; - - // User agent string sniffing is bad, but there is no reliable way to tell - // if font is fully loaded and ready to be used with canvas. - var userAgent = window.navigator.userAgent; - var m = /Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(userAgent); - if (m && m[1] >= 14) { - supported = true; - } - // TODO other browsers - if (userAgent === 'node') { - supported = true; - } - return shadow(FontLoader, 'isSyncFontLoadingSupported', supported); - }, - enumerable: true, - configurable: true -}); - -var FontFaceObject = (function FontFaceObjectClosure() { - function FontFaceObject(translatedData) { - this.compiledGlyphs = {}; - // importing translated data - for (var i in translatedData) { - this[i] = translatedData[i]; - } - } - Object.defineProperty(FontFaceObject, 'isEvalSupported', { - get: function () { - var evalSupport = false; - if (PDFJS.isEvalSupported) { - try { - /* jshint evil: true */ - new Function(''); - evalSupport = true; - } catch (e) {} - } - return shadow(this, 'isEvalSupported', evalSupport); - }, - enumerable: true, - configurable: true - }); - FontFaceObject.prototype = { - createNativeFontFace: function FontFaceObject_createNativeFontFace() { - if (!this.data) { - return null; - } - - if (PDFJS.disableFontFace) { - this.disableFontFace = true; - return null; - } - - var nativeFontFace = new FontFace(this.loadedName, this.data, {}); - - if (PDFJS.pdfBug && 'FontInspector' in globalScope && - globalScope['FontInspector'].enabled) { - globalScope['FontInspector'].fontAdded(this); - } - return nativeFontFace; - }, - - createFontFaceRule: function FontFaceObject_createFontFaceRule() { - if (!this.data) { - return null; - } - - if (PDFJS.disableFontFace) { - this.disableFontFace = true; - return null; - } - - var data = bytesToString(new Uint8Array(this.data)); - var fontName = this.loadedName; - - // Add the font-face rule to the document - var url = ('url(data:' + this.mimetype + ';base64,' + - window.btoa(data) + ');'); - var rule = '@font-face { font-family:"' + fontName + '";src:' + url + '}'; - - if (PDFJS.pdfBug && 'FontInspector' in globalScope && - globalScope['FontInspector'].enabled) { - globalScope['FontInspector'].fontAdded(this, url); - } - - return rule; - }, - - getPathGenerator: - function FontFaceObject_getPathGenerator(objs, character) { - if (!(character in this.compiledGlyphs)) { - var cmds = objs.get(this.loadedName + '_path_' + character); - var current, i, len; - - // If we can, compile cmds into JS for MAXIMUM SPEED - if (FontFaceObject.isEvalSupported) { - var args, js = ''; - for (i = 0, len = cmds.length; i < len; i++) { - current = cmds[i]; - - if (current.args !== undefined) { - args = current.args.join(','); - } else { - args = ''; - } - - js += 'c.' + current.cmd + '(' + args + ');\n'; - } - /* jshint -W054 */ - this.compiledGlyphs[character] = new Function('c', 'size', js); - } else { - // But fall back on using Function.prototype.apply() if we're - // blocked from using eval() for whatever reason (like CSP policies) - this.compiledGlyphs[character] = function(c, size) { - for (i = 0, len = cmds.length; i < len; i++) { - current = cmds[i]; - - if (current.cmd === 'scale') { - current.args = [size, -size]; - } - - c[current.cmd].apply(c, current.args); - } - }; - } - } - return this.compiledGlyphs[character]; - } - }; - return FontFaceObject; -})(); - - -/** - * Optimised CSS custom property getter/setter. - * @class - */ -var CustomStyle = (function CustomStyleClosure() { - - // As noted on: http://www.zachstronaut.com/posts/2009/02/17/ - // animate-css-transforms-firefox-webkit.html - // in some versions of IE9 it is critical that ms appear in this list - // before Moz - var prefixes = ['ms', 'Moz', 'Webkit', 'O']; - var _cache = {}; - - function CustomStyle() {} - - CustomStyle.getProp = function get(propName, element) { - // check cache only when no element is given - if (arguments.length === 1 && typeof _cache[propName] === 'string') { - return _cache[propName]; - } - - element = element || document.documentElement; - var style = element.style, prefixed, uPropName; - - // test standard property first - if (typeof style[propName] === 'string') { - return (_cache[propName] = propName); - } - - // capitalize - uPropName = propName.charAt(0).toUpperCase() + propName.slice(1); - - // test vendor specific properties - for (var i = 0, l = prefixes.length; i < l; i++) { - prefixed = prefixes[i] + uPropName; - if (typeof style[prefixed] === 'string') { - return (_cache[propName] = prefixed); - } - } - - //if all fails then set to undefined - return (_cache[propName] = 'undefined'); - }; - - CustomStyle.setProp = function set(propName, element, str) { - var prop = this.getProp(propName); - if (prop !== 'undefined') { - element.style[prop] = str; - } - }; - - return CustomStyle; -})(); - -PDFJS.CustomStyle = CustomStyle; - - -var ANNOT_MIN_SIZE = 10; // px - -var AnnotationLayer = (function AnnotationLayerClosure() { - // TODO(mack): This dupes some of the logic in CanvasGraphics.setFont() - function setTextStyles(element, item, fontObj) { - var style = element.style; - style.fontSize = item.fontSize + 'px'; - style.direction = item.fontDirection < 0 ? 'rtl': 'ltr'; - - if (!fontObj) { - return; - } - - style.fontWeight = fontObj.black ? - (fontObj.bold ? 'bolder' : 'bold') : - (fontObj.bold ? 'bold' : 'normal'); - style.fontStyle = fontObj.italic ? 'italic' : 'normal'; - - var fontName = fontObj.loadedName; - var fontFamily = fontName ? '"' + fontName + '", ' : ''; - // Use a reasonable default font if the font doesn't specify a fallback - var fallbackName = fontObj.fallbackName || 'Helvetica, sans-serif'; - style.fontFamily = fontFamily + fallbackName; - } - - function getContainer(data, page, viewport) { - var container = document.createElement('section'); - var width = data.rect[2] - data.rect[0]; - var height = data.rect[3] - data.rect[1]; - - container.setAttribute('data-annotation-id', data.id); - - data.rect = Util.normalizeRect([ - data.rect[0], - page.view[3] - data.rect[1] + page.view[1], - data.rect[2], - page.view[3] - data.rect[3] + page.view[1] - ]); - - CustomStyle.setProp('transform', container, - 'matrix(' + viewport.transform.join(',') + ')'); - CustomStyle.setProp('transformOrigin', container, - -data.rect[0] + 'px ' + -data.rect[1] + 'px'); - - if (data.borderStyle.width > 0) { - container.style.borderWidth = data.borderStyle.width + 'px'; - if (data.borderStyle.style !== AnnotationBorderStyleType.UNDERLINE) { - // Underline styles only have a bottom border, so we do not need - // to adjust for all borders. This yields a similar result as - // Adobe Acrobat/Reader. - width = width - 2 * data.borderStyle.width; - height = height - 2 * data.borderStyle.width; - } - - var horizontalRadius = data.borderStyle.horizontalCornerRadius; - var verticalRadius = data.borderStyle.verticalCornerRadius; - if (horizontalRadius > 0 || verticalRadius > 0) { - var radius = horizontalRadius + 'px / ' + verticalRadius + 'px'; - CustomStyle.setProp('borderRadius', container, radius); - } - - switch (data.borderStyle.style) { - case AnnotationBorderStyleType.SOLID: - container.style.borderStyle = 'solid'; - break; - - case AnnotationBorderStyleType.DASHED: - container.style.borderStyle = 'dashed'; - break; - - case AnnotationBorderStyleType.BEVELED: - warn('Unimplemented border style: beveled'); - break; - - case AnnotationBorderStyleType.INSET: - warn('Unimplemented border style: inset'); - break; - - case AnnotationBorderStyleType.UNDERLINE: - container.style.borderBottomStyle = 'solid'; - break; - - default: - break; - } - - if (data.color) { - container.style.borderColor = - Util.makeCssRgb(data.color[0] | 0, - data.color[1] | 0, - data.color[2] | 0); - } else { - // Transparent (invisible) border, so do not draw it at all. - container.style.borderWidth = 0; - } - } - - container.style.left = data.rect[0] + 'px'; - container.style.top = data.rect[1] + 'px'; - - container.style.width = width + 'px'; - container.style.height = height + 'px'; - - return container; - } - - function getHtmlElementForTextWidgetAnnotation(item, page) { - var element = document.createElement('div'); - var width = item.rect[2] - item.rect[0]; - var height = item.rect[3] - item.rect[1]; - element.style.width = width + 'px'; - element.style.height = height + 'px'; - element.style.display = 'table'; - - var content = document.createElement('div'); - content.textContent = item.fieldValue; - var textAlignment = item.textAlignment; - content.style.textAlign = ['left', 'center', 'right'][textAlignment]; - content.style.verticalAlign = 'middle'; - content.style.display = 'table-cell'; - - var fontObj = item.fontRefName ? - page.commonObjs.getData(item.fontRefName) : null; - setTextStyles(content, item, fontObj); - - element.appendChild(content); - - return element; - } - - function getHtmlElementForTextAnnotation(item, page, viewport) { - var rect = item.rect; - - // sanity check because of OOo-generated PDFs - if ((rect[3] - rect[1]) < ANNOT_MIN_SIZE) { - rect[3] = rect[1] + ANNOT_MIN_SIZE; - } - if ((rect[2] - rect[0]) < ANNOT_MIN_SIZE) { - rect[2] = rect[0] + (rect[3] - rect[1]); // make it square - } - - var container = getContainer(item, page, viewport); - container.className = 'annotText'; - - var image = document.createElement('img'); - image.style.height = container.style.height; - image.style.width = container.style.width; - var iconName = item.name; - image.src = PDFJS.imageResourcesPath + 'annotation-' + - iconName.toLowerCase() + '.svg'; - image.alt = '[{{type}} Annotation]'; - image.dataset.l10nId = 'text_annotation_type'; - image.dataset.l10nArgs = JSON.stringify({type: iconName}); - - var contentWrapper = document.createElement('div'); - contentWrapper.className = 'annotTextContentWrapper'; - contentWrapper.style.left = Math.floor(rect[2] - rect[0] + 5) + 'px'; - contentWrapper.style.top = '-10px'; - - var content = document.createElement('div'); - content.className = 'annotTextContent'; - content.setAttribute('hidden', true); - - var i, ii; - if (item.hasBgColor && item.color) { - var color = item.color; - - // Enlighten the color (70%) - var BACKGROUND_ENLIGHT = 0.7; - var r = BACKGROUND_ENLIGHT * (255 - color[0]) + color[0]; - var g = BACKGROUND_ENLIGHT * (255 - color[1]) + color[1]; - var b = BACKGROUND_ENLIGHT * (255 - color[2]) + color[2]; - content.style.backgroundColor = Util.makeCssRgb(r | 0, g | 0, b | 0); - } - - var title = document.createElement('h1'); - var text = document.createElement('p'); - title.textContent = item.title; - - if (!item.content && !item.title) { - content.setAttribute('hidden', true); - } else { - var e = document.createElement('span'); - var lines = item.content.split(/(?:\r\n?|\n)/); - for (i = 0, ii = lines.length; i < ii; ++i) { - var line = lines[i]; - e.appendChild(document.createTextNode(line)); - if (i < (ii - 1)) { - e.appendChild(document.createElement('br')); - } - } - text.appendChild(e); - - var pinned = false; - - var showAnnotation = function showAnnotation(pin) { - if (pin) { - pinned = true; - } - if (content.hasAttribute('hidden')) { - container.style.zIndex += 1; - content.removeAttribute('hidden'); - } - }; - - var hideAnnotation = function hideAnnotation(unpin) { - if (unpin) { - pinned = false; - } - if (!content.hasAttribute('hidden') && !pinned) { - container.style.zIndex -= 1; - content.setAttribute('hidden', true); - } - }; - - var toggleAnnotation = function toggleAnnotation() { - if (pinned) { - hideAnnotation(true); - } else { - showAnnotation(true); - } - }; - - image.addEventListener('click', function image_clickHandler() { - toggleAnnotation(); - }, false); - image.addEventListener('mouseover', function image_mouseOverHandler() { - showAnnotation(); - }, false); - image.addEventListener('mouseout', function image_mouseOutHandler() { - hideAnnotation(); - }, false); - - content.addEventListener('click', function content_clickHandler() { - hideAnnotation(true); - }, false); - } - - content.appendChild(title); - content.appendChild(text); - contentWrapper.appendChild(content); - container.appendChild(image); - container.appendChild(contentWrapper); - - return container; - } - - function getHtmlElementForLinkAnnotation(item, page, viewport, linkService) { - function bindLink(link, dest) { - link.href = linkService.getDestinationHash(dest); - link.onclick = function annotationsLayerBuilderLinksOnclick() { - if (dest) { - linkService.navigateTo(dest); - } - return false; - }; - if (dest) { - link.className = 'internalLink'; - } - } - - function bindNamedAction(link, action) { - link.href = linkService.getAnchorUrl(''); - link.onclick = function annotationsLayerBuilderNamedActionOnClick() { - linkService.executeNamedAction(action); - return false; - }; - link.className = 'internalLink'; - } - - var container = getContainer(item, page, viewport); - container.className = 'annotLink'; - - var link = document.createElement('a'); - link.href = link.title = item.url || ''; - - if (item.url && isExternalLinkTargetSet()) { - link.target = LinkTargetStringMap[PDFJS.externalLinkTarget]; - } - - if (!item.url) { - if (item.action) { - bindNamedAction(link, item.action); - } else { - bindLink(link, ('dest' in item) ? item.dest : null); - } - } - - container.appendChild(link); - - return container; - } - - function getHtmlElement(data, page, viewport, linkService) { - switch (data.annotationType) { - case AnnotationType.WIDGET: - return getHtmlElementForTextWidgetAnnotation(data, page); - case AnnotationType.TEXT: - return getHtmlElementForTextAnnotation(data, page, viewport); - case AnnotationType.LINK: - return getHtmlElementForLinkAnnotation(data, page, viewport, - linkService); - default: - throw new Error('Unsupported annotationType: ' + data.annotationType); - } - } - - function render(viewport, div, annotations, page, linkService) { - for (var i = 0, ii = annotations.length; i < ii; i++) { - var data = annotations[i]; - if (!data || !data.hasHtml) { - continue; - } - - var element = getHtmlElement(data, page, viewport, linkService); - div.appendChild(element); - } - } - - function update(viewport, div, annotations) { - for (var i = 0, ii = annotations.length; i < ii; i++) { - var data = annotations[i]; - var element = div.querySelector( - '[data-annotation-id="' + data.id + '"]'); - if (element) { - CustomStyle.setProp('transform', element, - 'matrix(' + viewport.transform.join(',') + ')'); - } - } - div.removeAttribute('hidden'); - } - - return { - render: render, - update: update - }; -})(); - -PDFJS.AnnotationLayer = AnnotationLayer; - - -/** - * Text layer render parameters. - * - * @typedef {Object} TextLayerRenderParameters - * @property {TextContent} textContent - Text content to render (the object is - * returned by the page's getTextContent() method). - * @property {HTMLElement} container - HTML element that will contain text runs. - * @property {PDFJS.PageViewport} viewport - The target viewport to properly - * layout the text runs. - * @property {Array} textDivs - (optional) HTML elements that are correspond - * the text items of the textContent input. This is output and shall be - * initially be set to empty array. - * @property {number} timeout - (optional) Delay in milliseconds before - * rendering of the text runs occurs. - */ -var renderTextLayer = (function renderTextLayerClosure() { - var MAX_TEXT_DIVS_TO_RENDER = 100000; - - var NonWhitespaceRegexp = /\S/; - - function isAllWhitespace(str) { - return !NonWhitespaceRegexp.test(str); - } - - function appendText(textDivs, viewport, geom, styles) { - var style = styles[geom.fontName]; - var textDiv = document.createElement('div'); - textDivs.push(textDiv); - if (isAllWhitespace(geom.str)) { - textDiv.dataset.isWhitespace = true; - return; - } - var tx = PDFJS.Util.transform(viewport.transform, geom.transform); - var angle = Math.atan2(tx[1], tx[0]); - if (style.vertical) { - angle += Math.PI / 2; - } - var fontHeight = Math.sqrt((tx[2] * tx[2]) + (tx[3] * tx[3])); - var fontAscent = fontHeight; - if (style.ascent) { - fontAscent = style.ascent * fontAscent; - } else if (style.descent) { - fontAscent = (1 + style.descent) * fontAscent; - } - - var left; - var top; - if (angle === 0) { - left = tx[4]; - top = tx[5] - fontAscent; - } else { - left = tx[4] + (fontAscent * Math.sin(angle)); - top = tx[5] - (fontAscent * Math.cos(angle)); - } - textDiv.style.left = left + 'px'; - textDiv.style.top = top + 'px'; - textDiv.style.fontSize = fontHeight + 'px'; - textDiv.style.fontFamily = style.fontFamily; - - textDiv.textContent = geom.str; - // |fontName| is only used by the Font Inspector. This test will succeed - // when e.g. the Font Inspector is off but the Stepper is on, but it's - // not worth the effort to do a more accurate test. - if (PDFJS.pdfBug) { - textDiv.dataset.fontName = geom.fontName; - } - // Storing into dataset will convert number into string. - if (angle !== 0) { - textDiv.dataset.angle = angle * (180 / Math.PI); - } - // We don't bother scaling single-char text divs, because it has very - // little effect on text highlighting. This makes scrolling on docs with - // lots of such divs a lot faster. - if (geom.str.length > 1) { - if (style.vertical) { - textDiv.dataset.canvasWidth = geom.height * viewport.scale; - } else { - textDiv.dataset.canvasWidth = geom.width * viewport.scale; - } - } - } - - function render(task) { - if (task._canceled) { - return; - } - var textLayerFrag = task._container; - var textDivs = task._textDivs; - var capability = task._capability; - var textDivsLength = textDivs.length; - - // No point in rendering many divs as it would make the browser - // unusable even after the divs are rendered. - if (textDivsLength > MAX_TEXT_DIVS_TO_RENDER) { - capability.resolve(); - return; - } - - var canvas = document.createElement('canvas'); - canvas.mozOpaque = true; - var ctx = canvas.getContext('2d', {alpha: false}); - - var lastFontSize; - var lastFontFamily; - for (var i = 0; i < textDivsLength; i++) { - var textDiv = textDivs[i]; - if (textDiv.dataset.isWhitespace !== undefined) { - continue; - } - - var fontSize = textDiv.style.fontSize; - var fontFamily = textDiv.style.fontFamily; - - // Only build font string and set to context if different from last. - if (fontSize !== lastFontSize || fontFamily !== lastFontFamily) { - ctx.font = fontSize + ' ' + fontFamily; - lastFontSize = fontSize; - lastFontFamily = fontFamily; - } - - var width = ctx.measureText(textDiv.textContent).width; - if (width > 0) { - textLayerFrag.appendChild(textDiv); - var transform; - if (textDiv.dataset.canvasWidth !== undefined) { - // Dataset values come of type string. - var textScale = textDiv.dataset.canvasWidth / width; - transform = 'scaleX(' + textScale + ')'; - } else { - transform = ''; - } - var rotation = textDiv.dataset.angle; - if (rotation) { - transform = 'rotate(' + rotation + 'deg) ' + transform; - } - if (transform) { - PDFJS.CustomStyle.setProp('transform' , textDiv, transform); - } - } - } - capability.resolve(); - } - - /** - * Text layer rendering task. - * - * @param {TextContent} textContent - * @param {HTMLElement} container - * @param {PDFJS.PageViewport} viewport - * @param {Array} textDivs - * @private - */ - function TextLayerRenderTask(textContent, container, viewport, textDivs) { - this._textContent = textContent; - this._container = container; - this._viewport = viewport; - textDivs = textDivs || []; - this._textDivs = textDivs; - this._canceled = false; - this._capability = createPromiseCapability(); - this._renderTimer = null; - } - TextLayerRenderTask.prototype = { - get promise() { - return this._capability.promise; - }, - - cancel: function TextLayer_cancel() { - this._canceled = true; - if (this._renderTimer !== null) { - clearTimeout(this._renderTimer); - this._renderTimer = null; - } - this._capability.reject('canceled'); - }, - - _render: function TextLayer_render(timeout) { - var textItems = this._textContent.items; - var styles = this._textContent.styles; - var textDivs = this._textDivs; - var viewport = this._viewport; - for (var i = 0, len = textItems.length; i < len; i++) { - appendText(textDivs, viewport, textItems[i], styles); - } - - if (!timeout) { // Render right away - render(this); - } else { // Schedule - var self = this; - this._renderTimer = setTimeout(function() { - render(self); - self._renderTimer = null; - }, timeout); - } - } - }; - - - /** - * Starts rendering of the text layer. - * - * @param {TextLayerRenderParameters} renderParameters - * @returns {TextLayerRenderTask} - */ - function renderTextLayer(renderParameters) { - var task = new TextLayerRenderTask(renderParameters.textContent, - renderParameters.container, - renderParameters.viewport, - renderParameters.textDivs); - task._render(renderParameters.timeout); - return task; - } - - return renderTextLayer; -})(); - -PDFJS.renderTextLayer = renderTextLayer; - - -var SVG_DEFAULTS = { - fontStyle: 'normal', - fontWeight: 'normal', - fillColor: '#000000' -}; - -var convertImgDataToPng = (function convertImgDataToPngClosure() { - var PNG_HEADER = - new Uint8Array([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]); - - var CHUNK_WRAPPER_SIZE = 12; - - var crcTable = new Int32Array(256); - for (var i = 0; i < 256; i++) { - var c = i; - for (var h = 0; h < 8; h++) { - if (c & 1) { - c = 0xedB88320 ^ ((c >> 1) & 0x7fffffff); - } else { - c = (c >> 1) & 0x7fffffff; - } - } - crcTable[i] = c; - } - - function crc32(data, start, end) { - var crc = -1; - for (var i = start; i < end; i++) { - var a = (crc ^ data[i]) & 0xff; - var b = crcTable[a]; - crc = (crc >>> 8) ^ b; - } - return crc ^ -1; - } - - function writePngChunk(type, body, data, offset) { - var p = offset; - var len = body.length; - - data[p] = len >> 24 & 0xff; - data[p + 1] = len >> 16 & 0xff; - data[p + 2] = len >> 8 & 0xff; - data[p + 3] = len & 0xff; - p += 4; - - data[p] = type.charCodeAt(0) & 0xff; - data[p + 1] = type.charCodeAt(1) & 0xff; - data[p + 2] = type.charCodeAt(2) & 0xff; - data[p + 3] = type.charCodeAt(3) & 0xff; - p += 4; - - data.set(body, p); - p += body.length; - - var crc = crc32(data, offset + 4, p); - - data[p] = crc >> 24 & 0xff; - data[p + 1] = crc >> 16 & 0xff; - data[p + 2] = crc >> 8 & 0xff; - data[p + 3] = crc & 0xff; - } - - function adler32(data, start, end) { - var a = 1; - var b = 0; - for (var i = start; i < end; ++i) { - a = (a + (data[i] & 0xff)) % 65521; - b = (b + a) % 65521; - } - return (b << 16) | a; - } - - function encode(imgData, kind) { - var width = imgData.width; - var height = imgData.height; - var bitDepth, colorType, lineSize; - var bytes = imgData.data; - - switch (kind) { - case ImageKind.GRAYSCALE_1BPP: - colorType = 0; - bitDepth = 1; - lineSize = (width + 7) >> 3; - break; - case ImageKind.RGB_24BPP: - colorType = 2; - bitDepth = 8; - lineSize = width * 3; - break; - case ImageKind.RGBA_32BPP: - colorType = 6; - bitDepth = 8; - lineSize = width * 4; - break; - default: - throw new Error('invalid format'); - } - - // prefix every row with predictor 0 - var literals = new Uint8Array((1 + lineSize) * height); - var offsetLiterals = 0, offsetBytes = 0; - var y, i; - for (y = 0; y < height; ++y) { - literals[offsetLiterals++] = 0; // no prediction - literals.set(bytes.subarray(offsetBytes, offsetBytes + lineSize), - offsetLiterals); - offsetBytes += lineSize; - offsetLiterals += lineSize; - } - - if (kind === ImageKind.GRAYSCALE_1BPP) { - // inverting for B/W - offsetLiterals = 0; - for (y = 0; y < height; y++) { - offsetLiterals++; // skipping predictor - for (i = 0; i < lineSize; i++) { - literals[offsetLiterals++] ^= 0xFF; - } - } - } - - var ihdr = new Uint8Array([ - width >> 24 & 0xff, - width >> 16 & 0xff, - width >> 8 & 0xff, - width & 0xff, - height >> 24 & 0xff, - height >> 16 & 0xff, - height >> 8 & 0xff, - height & 0xff, - bitDepth, // bit depth - colorType, // color type - 0x00, // compression method - 0x00, // filter method - 0x00 // interlace method - ]); - - var len = literals.length; - var maxBlockLength = 0xFFFF; - - var deflateBlocks = Math.ceil(len / maxBlockLength); - var idat = new Uint8Array(2 + len + deflateBlocks * 5 + 4); - var pi = 0; - idat[pi++] = 0x78; // compression method and flags - idat[pi++] = 0x9c; // flags - - var pos = 0; - while (len > maxBlockLength) { - // writing non-final DEFLATE blocks type 0 and length of 65535 - idat[pi++] = 0x00; - idat[pi++] = 0xff; - idat[pi++] = 0xff; - idat[pi++] = 0x00; - idat[pi++] = 0x00; - idat.set(literals.subarray(pos, pos + maxBlockLength), pi); - pi += maxBlockLength; - pos += maxBlockLength; - len -= maxBlockLength; - } - - // writing non-final DEFLATE blocks type 0 - idat[pi++] = 0x01; - idat[pi++] = len & 0xff; - idat[pi++] = len >> 8 & 0xff; - idat[pi++] = (~len & 0xffff) & 0xff; - idat[pi++] = (~len & 0xffff) >> 8 & 0xff; - idat.set(literals.subarray(pos), pi); - pi += literals.length - pos; - - var adler = adler32(literals, 0, literals.length); // checksum - idat[pi++] = adler >> 24 & 0xff; - idat[pi++] = adler >> 16 & 0xff; - idat[pi++] = adler >> 8 & 0xff; - idat[pi++] = adler & 0xff; - - // PNG will consists: header, IHDR+data, IDAT+data, and IEND. - var pngLength = PNG_HEADER.length + (CHUNK_WRAPPER_SIZE * 3) + - ihdr.length + idat.length; - var data = new Uint8Array(pngLength); - var offset = 0; - data.set(PNG_HEADER, offset); - offset += PNG_HEADER.length; - writePngChunk('IHDR', ihdr, data, offset); - offset += CHUNK_WRAPPER_SIZE + ihdr.length; - writePngChunk('IDATA', idat, data, offset); - offset += CHUNK_WRAPPER_SIZE + idat.length; - writePngChunk('IEND', new Uint8Array(0), data, offset); - - return PDFJS.createObjectURL(data, 'image/png'); - } - - return function convertImgDataToPng(imgData) { - var kind = (imgData.kind === undefined ? - ImageKind.GRAYSCALE_1BPP : imgData.kind); - return encode(imgData, kind); - }; -})(); - -var SVGExtraState = (function SVGExtraStateClosure() { - function SVGExtraState() { - this.fontSizeScale = 1; - this.fontWeight = SVG_DEFAULTS.fontWeight; - this.fontSize = 0; - - this.textMatrix = IDENTITY_MATRIX; - this.fontMatrix = FONT_IDENTITY_MATRIX; - this.leading = 0; - - // Current point (in user coordinates) - this.x = 0; - this.y = 0; - - // Start of text line (in text coordinates) - this.lineX = 0; - this.lineY = 0; - - // Character and word spacing - this.charSpacing = 0; - this.wordSpacing = 0; - this.textHScale = 1; - this.textRise = 0; - - // Default foreground and background colors - this.fillColor = SVG_DEFAULTS.fillColor; - this.strokeColor = '#000000'; - - this.fillAlpha = 1; - this.strokeAlpha = 1; - this.lineWidth = 1; - this.lineJoin = ''; - this.lineCap = ''; - this.miterLimit = 0; - - this.dashArray = []; - this.dashPhase = 0; - - this.dependencies = []; - - // Clipping - this.clipId = ''; - this.pendingClip = false; - - this.maskId = ''; - } - - SVGExtraState.prototype = { - clone: function SVGExtraState_clone() { - return Object.create(this); - }, - setCurrentPoint: function SVGExtraState_setCurrentPoint(x, y) { - this.x = x; - this.y = y; - } - }; - return SVGExtraState; -})(); - -var SVGGraphics = (function SVGGraphicsClosure() { - function createScratchSVG(width, height) { - var NS = 'http://www.w3.org/2000/svg'; - var svg = document.createElementNS(NS, 'svg:svg'); - svg.setAttributeNS(null, 'version', '1.1'); - svg.setAttributeNS(null, 'width', width + 'px'); - svg.setAttributeNS(null, 'height', height + 'px'); - svg.setAttributeNS(null, 'viewBox', '0 0 ' + width + ' ' + height); - return svg; - } - - function opListToTree(opList) { - var opTree = []; - var tmp = []; - var opListLen = opList.length; - - for (var x = 0; x < opListLen; x++) { - if (opList[x].fn === 'save') { - opTree.push({'fnId': 92, 'fn': 'group', 'items': []}); - tmp.push(opTree); - opTree = opTree[opTree.length - 1].items; - continue; - } - - if(opList[x].fn === 'restore') { - opTree = tmp.pop(); - } else { - opTree.push(opList[x]); - } - } - return opTree; - } - - /** - * Formats float number. - * @param value {number} number to format. - * @returns {string} - */ - function pf(value) { - if (value === (value | 0)) { // integer number - return value.toString(); - } - var s = value.toFixed(10); - var i = s.length - 1; - if (s[i] !== '0') { - return s; - } - // removing trailing zeros - do { - i--; - } while (s[i] === '0'); - return s.substr(0, s[i] === '.' ? i : i + 1); - } - - /** - * Formats transform matrix. The standard rotation, scale and translate - * matrices are replaced by their shorter forms, and for identity matrix - * returns empty string to save the memory. - * @param m {Array} matrix to format. - * @returns {string} - */ - function pm(m) { - if (m[4] === 0 && m[5] === 0) { - if (m[1] === 0 && m[2] === 0) { - if (m[0] === 1 && m[3] === 1) { - return ''; - } - return 'scale(' + pf(m[0]) + ' ' + pf(m[3]) + ')'; - } - if (m[0] === m[3] && m[1] === -m[2]) { - var a = Math.acos(m[0]) * 180 / Math.PI; - return 'rotate(' + pf(a) + ')'; - } - } else { - if (m[0] === 1 && m[1] === 0 && m[2] === 0 && m[3] === 1) { - return 'translate(' + pf(m[4]) + ' ' + pf(m[5]) + ')'; - } - } - return 'matrix(' + pf(m[0]) + ' ' + pf(m[1]) + ' ' + pf(m[2]) + ' ' + - pf(m[3]) + ' ' + pf(m[4]) + ' ' + pf(m[5]) + ')'; - } - - function SVGGraphics(commonObjs, objs) { - this.current = new SVGExtraState(); - this.transformMatrix = IDENTITY_MATRIX; // Graphics state matrix - this.transformStack = []; - this.extraStack = []; - this.commonObjs = commonObjs; - this.objs = objs; - this.pendingEOFill = false; - - this.embedFonts = false; - this.embeddedFonts = {}; - this.cssStyle = null; - } - - var NS = 'http://www.w3.org/2000/svg'; - var XML_NS = 'http://www.w3.org/XML/1998/namespace'; - var XLINK_NS = 'http://www.w3.org/1999/xlink'; - var LINE_CAP_STYLES = ['butt', 'round', 'square']; - var LINE_JOIN_STYLES = ['miter', 'round', 'bevel']; - var clipCount = 0; - var maskCount = 0; - - SVGGraphics.prototype = { - save: function SVGGraphics_save() { - this.transformStack.push(this.transformMatrix); - var old = this.current; - this.extraStack.push(old); - this.current = old.clone(); - }, - - restore: function SVGGraphics_restore() { - this.transformMatrix = this.transformStack.pop(); - this.current = this.extraStack.pop(); - - this.tgrp = document.createElementNS(NS, 'svg:g'); - this.tgrp.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - this.pgrp.appendChild(this.tgrp); - }, - - group: function SVGGraphics_group(items) { - this.save(); - this.executeOpTree(items); - this.restore(); - }, - - loadDependencies: function SVGGraphics_loadDependencies(operatorList) { - var fnArray = operatorList.fnArray; - var fnArrayLen = fnArray.length; - var argsArray = operatorList.argsArray; - - var self = this; - for (var i = 0; i < fnArrayLen; i++) { - if (OPS.dependency === fnArray[i]) { - var deps = argsArray[i]; - for (var n = 0, nn = deps.length; n < nn; n++) { - var obj = deps[n]; - var common = obj.substring(0, 2) === 'g_'; - var promise; - if (common) { - promise = new Promise(function(resolve) { - self.commonObjs.get(obj, resolve); - }); - } else { - promise = new Promise(function(resolve) { - self.objs.get(obj, resolve); - }); - } - this.current.dependencies.push(promise); - } - } - } - return Promise.all(this.current.dependencies); - }, - - transform: function SVGGraphics_transform(a, b, c, d, e, f) { - var transformMatrix = [a, b, c, d, e, f]; - this.transformMatrix = PDFJS.Util.transform(this.transformMatrix, - transformMatrix); - - this.tgrp = document.createElementNS(NS, 'svg:g'); - this.tgrp.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - }, - - getSVG: function SVGGraphics_getSVG(operatorList, viewport) { - this.svg = createScratchSVG(viewport.width, viewport.height); - this.viewport = viewport; - - return this.loadDependencies(operatorList).then(function () { - this.transformMatrix = IDENTITY_MATRIX; - this.pgrp = document.createElementNS(NS, 'svg:g'); // Parent group - this.pgrp.setAttributeNS(null, 'transform', pm(viewport.transform)); - this.tgrp = document.createElementNS(NS, 'svg:g'); // Transform group - this.tgrp.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - this.defs = document.createElementNS(NS, 'svg:defs'); - this.pgrp.appendChild(this.defs); - this.pgrp.appendChild(this.tgrp); - this.svg.appendChild(this.pgrp); - var opTree = this.convertOpList(operatorList); - this.executeOpTree(opTree); - return this.svg; - }.bind(this)); - }, - - convertOpList: function SVGGraphics_convertOpList(operatorList) { - var argsArray = operatorList.argsArray; - var fnArray = operatorList.fnArray; - var fnArrayLen = fnArray.length; - var REVOPS = []; - var opList = []; - - for (var op in OPS) { - REVOPS[OPS[op]] = op; - } - - for (var x = 0; x < fnArrayLen; x++) { - var fnId = fnArray[x]; - opList.push({'fnId' : fnId, 'fn': REVOPS[fnId], 'args': argsArray[x]}); - } - return opListToTree(opList); - }, - - executeOpTree: function SVGGraphics_executeOpTree(opTree) { - var opTreeLen = opTree.length; - for(var x = 0; x < opTreeLen; x++) { - var fn = opTree[x].fn; - var fnId = opTree[x].fnId; - var args = opTree[x].args; - - switch (fnId | 0) { - case OPS.beginText: - this.beginText(); - break; - case OPS.setLeading: - this.setLeading(args); - break; - case OPS.setLeadingMoveText: - this.setLeadingMoveText(args[0], args[1]); - break; - case OPS.setFont: - this.setFont(args); - break; - case OPS.showText: - this.showText(args[0]); - break; - case OPS.showSpacedText: - this.showText(args[0]); - break; - case OPS.endText: - this.endText(); - break; - case OPS.moveText: - this.moveText(args[0], args[1]); - break; - case OPS.setCharSpacing: - this.setCharSpacing(args[0]); - break; - case OPS.setWordSpacing: - this.setWordSpacing(args[0]); - break; - case OPS.setHScale: - this.setHScale(args[0]); - break; - case OPS.setTextMatrix: - this.setTextMatrix(args[0], args[1], args[2], - args[3], args[4], args[5]); - break; - case OPS.setLineWidth: - this.setLineWidth(args[0]); - break; - case OPS.setLineJoin: - this.setLineJoin(args[0]); - break; - case OPS.setLineCap: - this.setLineCap(args[0]); - break; - case OPS.setMiterLimit: - this.setMiterLimit(args[0]); - break; - case OPS.setFillRGBColor: - this.setFillRGBColor(args[0], args[1], args[2]); - break; - case OPS.setStrokeRGBColor: - this.setStrokeRGBColor(args[0], args[1], args[2]); - break; - case OPS.setDash: - this.setDash(args[0], args[1]); - break; - case OPS.setGState: - this.setGState(args[0]); - break; - case OPS.fill: - this.fill(); - break; - case OPS.eoFill: - this.eoFill(); - break; - case OPS.stroke: - this.stroke(); - break; - case OPS.fillStroke: - this.fillStroke(); - break; - case OPS.eoFillStroke: - this.eoFillStroke(); - break; - case OPS.clip: - this.clip('nonzero'); - break; - case OPS.eoClip: - this.clip('evenodd'); - break; - case OPS.paintSolidColorImageMask: - this.paintSolidColorImageMask(); - break; - case OPS.paintJpegXObject: - this.paintJpegXObject(args[0], args[1], args[2]); - break; - case OPS.paintImageXObject: - this.paintImageXObject(args[0]); - break; - case OPS.paintInlineImageXObject: - this.paintInlineImageXObject(args[0]); - break; - case OPS.paintImageMaskXObject: - this.paintImageMaskXObject(args[0]); - break; - case OPS.paintFormXObjectBegin: - this.paintFormXObjectBegin(args[0], args[1]); - break; - case OPS.paintFormXObjectEnd: - this.paintFormXObjectEnd(); - break; - case OPS.closePath: - this.closePath(); - break; - case OPS.closeStroke: - this.closeStroke(); - break; - case OPS.closeFillStroke: - this.closeFillStroke(); - break; - case OPS.nextLine: - this.nextLine(); - break; - case OPS.transform: - this.transform(args[0], args[1], args[2], args[3], - args[4], args[5]); - break; - case OPS.constructPath: - this.constructPath(args[0], args[1]); - break; - case OPS.endPath: - this.endPath(); - break; - case 92: - this.group(opTree[x].items); - break; - default: - warn('Unimplemented method '+ fn); - break; - } - } - }, - - setWordSpacing: function SVGGraphics_setWordSpacing(wordSpacing) { - this.current.wordSpacing = wordSpacing; - }, - - setCharSpacing: function SVGGraphics_setCharSpacing(charSpacing) { - this.current.charSpacing = charSpacing; - }, - - nextLine: function SVGGraphics_nextLine() { - this.moveText(0, this.current.leading); - }, - - setTextMatrix: function SVGGraphics_setTextMatrix(a, b, c, d, e, f) { - var current = this.current; - this.current.textMatrix = this.current.lineMatrix = [a, b, c, d, e, f]; - - this.current.x = this.current.lineX = 0; - this.current.y = this.current.lineY = 0; - - current.xcoords = []; - current.tspan = document.createElementNS(NS, 'svg:tspan'); - current.tspan.setAttributeNS(null, 'font-family', current.fontFamily); - current.tspan.setAttributeNS(null, 'font-size', - pf(current.fontSize) + 'px'); - current.tspan.setAttributeNS(null, 'y', pf(-current.y)); - - current.txtElement = document.createElementNS(NS, 'svg:text'); - current.txtElement.appendChild(current.tspan); - }, - - beginText: function SVGGraphics_beginText() { - this.current.x = this.current.lineX = 0; - this.current.y = this.current.lineY = 0; - this.current.textMatrix = IDENTITY_MATRIX; - this.current.lineMatrix = IDENTITY_MATRIX; - this.current.tspan = document.createElementNS(NS, 'svg:tspan'); - this.current.txtElement = document.createElementNS(NS, 'svg:text'); - this.current.txtgrp = document.createElementNS(NS, 'svg:g'); - this.current.xcoords = []; - }, - - moveText: function SVGGraphics_moveText(x, y) { - var current = this.current; - this.current.x = this.current.lineX += x; - this.current.y = this.current.lineY += y; - - current.xcoords = []; - current.tspan = document.createElementNS(NS, 'svg:tspan'); - current.tspan.setAttributeNS(null, 'font-family', current.fontFamily); - current.tspan.setAttributeNS(null, 'font-size', - pf(current.fontSize) + 'px'); - current.tspan.setAttributeNS(null, 'y', pf(-current.y)); - }, - - showText: function SVGGraphics_showText(glyphs) { - var current = this.current; - var font = current.font; - var fontSize = current.fontSize; - - if (fontSize === 0) { - return; - } - - var charSpacing = current.charSpacing; - var wordSpacing = current.wordSpacing; - var fontDirection = current.fontDirection; - var textHScale = current.textHScale * fontDirection; - var glyphsLength = glyphs.length; - var vertical = font.vertical; - var widthAdvanceScale = fontSize * current.fontMatrix[0]; - - var x = 0, i; - for (i = 0; i < glyphsLength; ++i) { - var glyph = glyphs[i]; - if (glyph === null) { - // word break - x += fontDirection * wordSpacing; - continue; - } else if (isNum(glyph)) { - x += -glyph * fontSize * 0.001; - continue; - } - current.xcoords.push(current.x + x * textHScale); - - var width = glyph.width; - var character = glyph.fontChar; - var charWidth = width * widthAdvanceScale + charSpacing * fontDirection; - x += charWidth; - - current.tspan.textContent += character; - } - if (vertical) { - current.y -= x * textHScale; - } else { - current.x += x * textHScale; - } - - current.tspan.setAttributeNS(null, 'x', - current.xcoords.map(pf).join(' ')); - current.tspan.setAttributeNS(null, 'y', pf(-current.y)); - current.tspan.setAttributeNS(null, 'font-family', current.fontFamily); - current.tspan.setAttributeNS(null, 'font-size', - pf(current.fontSize) + 'px'); - if (current.fontStyle !== SVG_DEFAULTS.fontStyle) { - current.tspan.setAttributeNS(null, 'font-style', current.fontStyle); - } - if (current.fontWeight !== SVG_DEFAULTS.fontWeight) { - current.tspan.setAttributeNS(null, 'font-weight', current.fontWeight); - } - if (current.fillColor !== SVG_DEFAULTS.fillColor) { - current.tspan.setAttributeNS(null, 'fill', current.fillColor); - } - - current.txtElement.setAttributeNS(null, 'transform', - pm(current.textMatrix) + - ' scale(1, -1)' ); - current.txtElement.setAttributeNS(XML_NS, 'xml:space', 'preserve'); - current.txtElement.appendChild(current.tspan); - current.txtgrp.appendChild(current.txtElement); - - this.tgrp.appendChild(current.txtElement); - - }, - - setLeadingMoveText: function SVGGraphics_setLeadingMoveText(x, y) { - this.setLeading(-y); - this.moveText(x, y); - }, - - addFontStyle: function SVGGraphics_addFontStyle(fontObj) { - if (!this.cssStyle) { - this.cssStyle = document.createElementNS(NS, 'svg:style'); - this.cssStyle.setAttributeNS(null, 'type', 'text/css'); - this.defs.appendChild(this.cssStyle); - } - - var url = PDFJS.createObjectURL(fontObj.data, fontObj.mimetype); - this.cssStyle.textContent += - '@font-face { font-family: "' + fontObj.loadedName + '";' + - ' src: url(' + url + '); }\n'; - }, - - setFont: function SVGGraphics_setFont(details) { - var current = this.current; - var fontObj = this.commonObjs.get(details[0]); - var size = details[1]; - this.current.font = fontObj; - - if (this.embedFonts && fontObj.data && - !this.embeddedFonts[fontObj.loadedName]) { - this.addFontStyle(fontObj); - this.embeddedFonts[fontObj.loadedName] = fontObj; - } - - current.fontMatrix = (fontObj.fontMatrix ? - fontObj.fontMatrix : FONT_IDENTITY_MATRIX); - - var bold = fontObj.black ? (fontObj.bold ? 'bolder' : 'bold') : - (fontObj.bold ? 'bold' : 'normal'); - var italic = fontObj.italic ? 'italic' : 'normal'; - - if (size < 0) { - size = -size; - current.fontDirection = -1; - } else { - current.fontDirection = 1; - } - current.fontSize = size; - current.fontFamily = fontObj.loadedName; - current.fontWeight = bold; - current.fontStyle = italic; - - current.tspan = document.createElementNS(NS, 'svg:tspan'); - current.tspan.setAttributeNS(null, 'y', pf(-current.y)); - current.xcoords = []; - }, - - endText: function SVGGraphics_endText() { - if (this.current.pendingClip) { - this.cgrp.appendChild(this.tgrp); - this.pgrp.appendChild(this.cgrp); - } else { - this.pgrp.appendChild(this.tgrp); - } - this.tgrp = document.createElementNS(NS, 'svg:g'); - this.tgrp.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - }, - - // Path properties - setLineWidth: function SVGGraphics_setLineWidth(width) { - this.current.lineWidth = width; - }, - setLineCap: function SVGGraphics_setLineCap(style) { - this.current.lineCap = LINE_CAP_STYLES[style]; - }, - setLineJoin: function SVGGraphics_setLineJoin(style) { - this.current.lineJoin = LINE_JOIN_STYLES[style]; - }, - setMiterLimit: function SVGGraphics_setMiterLimit(limit) { - this.current.miterLimit = limit; - }, - setStrokeRGBColor: function SVGGraphics_setStrokeRGBColor(r, g, b) { - var color = Util.makeCssRgb(r, g, b); - this.current.strokeColor = color; - }, - setFillRGBColor: function SVGGraphics_setFillRGBColor(r, g, b) { - var color = Util.makeCssRgb(r, g, b); - this.current.fillColor = color; - this.current.tspan = document.createElementNS(NS, 'svg:tspan'); - this.current.xcoords = []; - }, - setDash: function SVGGraphics_setDash(dashArray, dashPhase) { - this.current.dashArray = dashArray; - this.current.dashPhase = dashPhase; - }, - - constructPath: function SVGGraphics_constructPath(ops, args) { - var current = this.current; - var x = current.x, y = current.y; - current.path = document.createElementNS(NS, 'svg:path'); - var d = []; - var opLength = ops.length; - - for (var i = 0, j = 0; i < opLength; i++) { - switch (ops[i] | 0) { - case OPS.rectangle: - x = args[j++]; - y = args[j++]; - var width = args[j++]; - var height = args[j++]; - var xw = x + width; - var yh = y + height; - d.push('M', pf(x), pf(y), 'L', pf(xw) , pf(y), 'L', pf(xw), pf(yh), - 'L', pf(x), pf(yh), 'Z'); - break; - case OPS.moveTo: - x = args[j++]; - y = args[j++]; - d.push('M', pf(x), pf(y)); - break; - case OPS.lineTo: - x = args[j++]; - y = args[j++]; - d.push('L', pf(x) , pf(y)); - break; - case OPS.curveTo: - x = args[j + 4]; - y = args[j + 5]; - d.push('C', pf(args[j]), pf(args[j + 1]), pf(args[j + 2]), - pf(args[j + 3]), pf(x), pf(y)); - j += 6; - break; - case OPS.curveTo2: - x = args[j + 2]; - y = args[j + 3]; - d.push('C', pf(x), pf(y), pf(args[j]), pf(args[j + 1]), - pf(args[j + 2]), pf(args[j + 3])); - j += 4; - break; - case OPS.curveTo3: - x = args[j + 2]; - y = args[j + 3]; - d.push('C', pf(args[j]), pf(args[j + 1]), pf(x), pf(y), - pf(x), pf(y)); - j += 4; - break; - case OPS.closePath: - d.push('Z'); - break; - } - } - current.path.setAttributeNS(null, 'd', d.join(' ')); - current.path.setAttributeNS(null, 'stroke-miterlimit', - pf(current.miterLimit)); - current.path.setAttributeNS(null, 'stroke-linecap', current.lineCap); - current.path.setAttributeNS(null, 'stroke-linejoin', current.lineJoin); - current.path.setAttributeNS(null, 'stroke-width', - pf(current.lineWidth) + 'px'); - current.path.setAttributeNS(null, 'stroke-dasharray', - current.dashArray.map(pf).join(' ')); - current.path.setAttributeNS(null, 'stroke-dashoffset', - pf(current.dashPhase) + 'px'); - current.path.setAttributeNS(null, 'fill', 'none'); - - this.tgrp.appendChild(current.path); - if (current.pendingClip) { - this.cgrp.appendChild(this.tgrp); - this.pgrp.appendChild(this.cgrp); - } else { - this.pgrp.appendChild(this.tgrp); - } - // Saving a reference in current.element so that it can be addressed - // in 'fill' and 'stroke' - current.element = current.path; - current.setCurrentPoint(x, y); - }, - - endPath: function SVGGraphics_endPath() { - var current = this.current; - if (current.pendingClip) { - this.cgrp.appendChild(this.tgrp); - this.pgrp.appendChild(this.cgrp); - } else { - this.pgrp.appendChild(this.tgrp); - } - this.tgrp = document.createElementNS(NS, 'svg:g'); - this.tgrp.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - }, - - clip: function SVGGraphics_clip(type) { - var current = this.current; - // Add current path to clipping path - current.clipId = 'clippath' + clipCount; - clipCount++; - this.clippath = document.createElementNS(NS, 'svg:clipPath'); - this.clippath.setAttributeNS(null, 'id', current.clipId); - var clipElement = current.element.cloneNode(); - if (type === 'evenodd') { - clipElement.setAttributeNS(null, 'clip-rule', 'evenodd'); - } else { - clipElement.setAttributeNS(null, 'clip-rule', 'nonzero'); - } - this.clippath.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - this.clippath.appendChild(clipElement); - this.defs.appendChild(this.clippath); - - // Create a new group with that attribute - current.pendingClip = true; - this.cgrp = document.createElementNS(NS, 'svg:g'); - this.cgrp.setAttributeNS(null, 'clip-path', - 'url(#' + current.clipId + ')'); - this.pgrp.appendChild(this.cgrp); - }, - - closePath: function SVGGraphics_closePath() { - var current = this.current; - var d = current.path.getAttributeNS(null, 'd'); - d += 'Z'; - current.path.setAttributeNS(null, 'd', d); - }, - - setLeading: function SVGGraphics_setLeading(leading) { - this.current.leading = -leading; - }, - - setTextRise: function SVGGraphics_setTextRise(textRise) { - this.current.textRise = textRise; - }, - - setHScale: function SVGGraphics_setHScale(scale) { - this.current.textHScale = scale / 100; - }, - - setGState: function SVGGraphics_setGState(states) { - for (var i = 0, ii = states.length; i < ii; i++) { - var state = states[i]; - var key = state[0]; - var value = state[1]; - - switch (key) { - case 'LW': - this.setLineWidth(value); - break; - case 'LC': - this.setLineCap(value); - break; - case 'LJ': - this.setLineJoin(value); - break; - case 'ML': - this.setMiterLimit(value); - break; - case 'D': - this.setDash(value[0], value[1]); - break; - case 'RI': - break; - case 'FL': - break; - case 'Font': - this.setFont(value); - break; - case 'CA': - break; - case 'ca': - break; - case 'BM': - break; - case 'SMask': - break; - } - } - }, - - fill: function SVGGraphics_fill() { - var current = this.current; - current.element.setAttributeNS(null, 'fill', current.fillColor); - }, - - stroke: function SVGGraphics_stroke() { - var current = this.current; - current.element.setAttributeNS(null, 'stroke', current.strokeColor); - current.element.setAttributeNS(null, 'fill', 'none'); - }, - - eoFill: function SVGGraphics_eoFill() { - var current = this.current; - current.element.setAttributeNS(null, 'fill', current.fillColor); - current.element.setAttributeNS(null, 'fill-rule', 'evenodd'); - }, - - fillStroke: function SVGGraphics_fillStroke() { - // Order is important since stroke wants fill to be none. - // First stroke, then if fill needed, it will be overwritten. - this.stroke(); - this.fill(); - }, - - eoFillStroke: function SVGGraphics_eoFillStroke() { - this.current.element.setAttributeNS(null, 'fill-rule', 'evenodd'); - this.fillStroke(); - }, - - closeStroke: function SVGGraphics_closeStroke() { - this.closePath(); - this.stroke(); - }, - - closeFillStroke: function SVGGraphics_closeFillStroke() { - this.closePath(); - this.fillStroke(); - }, - - paintSolidColorImageMask: - function SVGGraphics_paintSolidColorImageMask() { - var current = this.current; - var rect = document.createElementNS(NS, 'svg:rect'); - rect.setAttributeNS(null, 'x', '0'); - rect.setAttributeNS(null, 'y', '0'); - rect.setAttributeNS(null, 'width', '1px'); - rect.setAttributeNS(null, 'height', '1px'); - rect.setAttributeNS(null, 'fill', current.fillColor); - this.tgrp.appendChild(rect); - }, - - paintJpegXObject: function SVGGraphics_paintJpegXObject(objId, w, h) { - var current = this.current; - var imgObj = this.objs.get(objId); - var imgEl = document.createElementNS(NS, 'svg:image'); - imgEl.setAttributeNS(XLINK_NS, 'xlink:href', imgObj.src); - imgEl.setAttributeNS(null, 'width', imgObj.width + 'px'); - imgEl.setAttributeNS(null, 'height', imgObj.height + 'px'); - imgEl.setAttributeNS(null, 'x', '0'); - imgEl.setAttributeNS(null, 'y', pf(-h)); - imgEl.setAttributeNS(null, 'transform', - 'scale(' + pf(1 / w) + ' ' + pf(-1 / h) + ')'); - - this.tgrp.appendChild(imgEl); - if (current.pendingClip) { - this.cgrp.appendChild(this.tgrp); - this.pgrp.appendChild(this.cgrp); - } else { - this.pgrp.appendChild(this.tgrp); - } - }, - - paintImageXObject: function SVGGraphics_paintImageXObject(objId) { - var imgData = this.objs.get(objId); - if (!imgData) { - warn('Dependent image isn\'t ready yet'); - return; - } - this.paintInlineImageXObject(imgData); - }, - - paintInlineImageXObject: - function SVGGraphics_paintInlineImageXObject(imgData, mask) { - var current = this.current; - var width = imgData.width; - var height = imgData.height; - - var imgSrc = convertImgDataToPng(imgData); - var cliprect = document.createElementNS(NS, 'svg:rect'); - cliprect.setAttributeNS(null, 'x', '0'); - cliprect.setAttributeNS(null, 'y', '0'); - cliprect.setAttributeNS(null, 'width', pf(width)); - cliprect.setAttributeNS(null, 'height', pf(height)); - current.element = cliprect; - this.clip('nonzero'); - var imgEl = document.createElementNS(NS, 'svg:image'); - imgEl.setAttributeNS(XLINK_NS, 'xlink:href', imgSrc); - imgEl.setAttributeNS(null, 'x', '0'); - imgEl.setAttributeNS(null, 'y', pf(-height)); - imgEl.setAttributeNS(null, 'width', pf(width) + 'px'); - imgEl.setAttributeNS(null, 'height', pf(height) + 'px'); - imgEl.setAttributeNS(null, 'transform', - 'scale(' + pf(1 / width) + ' ' + - pf(-1 / height) + ')'); - if (mask) { - mask.appendChild(imgEl); - } else { - this.tgrp.appendChild(imgEl); - } - if (current.pendingClip) { - this.cgrp.appendChild(this.tgrp); - this.pgrp.appendChild(this.cgrp); - } else { - this.pgrp.appendChild(this.tgrp); - } - }, - - paintImageMaskXObject: - function SVGGraphics_paintImageMaskXObject(imgData) { - var current = this.current; - var width = imgData.width; - var height = imgData.height; - var fillColor = current.fillColor; - - current.maskId = 'mask' + maskCount++; - var mask = document.createElementNS(NS, 'svg:mask'); - mask.setAttributeNS(null, 'id', current.maskId); - - var rect = document.createElementNS(NS, 'svg:rect'); - rect.setAttributeNS(null, 'x', '0'); - rect.setAttributeNS(null, 'y', '0'); - rect.setAttributeNS(null, 'width', pf(width)); - rect.setAttributeNS(null, 'height', pf(height)); - rect.setAttributeNS(null, 'fill', fillColor); - rect.setAttributeNS(null, 'mask', 'url(#' + current.maskId +')'); - this.defs.appendChild(mask); - this.tgrp.appendChild(rect); - - this.paintInlineImageXObject(imgData, mask); - }, - - paintFormXObjectBegin: - function SVGGraphics_paintFormXObjectBegin(matrix, bbox) { - this.save(); - - if (isArray(matrix) && matrix.length === 6) { - this.transform(matrix[0], matrix[1], matrix[2], - matrix[3], matrix[4], matrix[5]); - } - - if (isArray(bbox) && bbox.length === 4) { - var width = bbox[2] - bbox[0]; - var height = bbox[3] - bbox[1]; - - var cliprect = document.createElementNS(NS, 'svg:rect'); - cliprect.setAttributeNS(null, 'x', bbox[0]); - cliprect.setAttributeNS(null, 'y', bbox[1]); - cliprect.setAttributeNS(null, 'width', pf(width)); - cliprect.setAttributeNS(null, 'height', pf(height)); - this.current.element = cliprect; - this.clip('nonzero'); - this.endPath(); - } - }, - - paintFormXObjectEnd: - function SVGGraphics_paintFormXObjectEnd() { - this.restore(); - } - }; - return SVGGraphics; -})(); - -PDFJS.SVGGraphics = SVGGraphics; - - -}).call((typeof window === 'undefined') ? this : window); - -if (!PDFJS.workerSrc && typeof document !== 'undefined') { - // workerSrc is not set -- using last script url to define default location - PDFJS.workerSrc = (function () { - 'use strict'; - var pdfJsSrc = document.currentScript.src; - return pdfJsSrc && pdfJsSrc.replace(/\.js$/i, '.worker.js'); - })(); -} - - diff --git a/services/web/public/js/libs/pdfjs-1.3.91/pdf.worker.js b/services/web/public/js/libs/pdfjs-1.3.91/pdf.worker.js deleted file mode 100644 index 72a29334c6..0000000000 --- a/services/web/public/js/libs/pdfjs-1.3.91/pdf.worker.js +++ /dev/null @@ -1,40692 +0,0 @@ -/* Copyright 2012 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/*jshint globalstrict: false */ -/* globals PDFJS */ - -// Initializing PDFJS global object (if still undefined) -if (typeof PDFJS === 'undefined') { - (typeof window !== 'undefined' ? window : this).PDFJS = {}; -} - -PDFJS.version = '1.3.91'; -PDFJS.build = 'd1e83b5'; - -(function pdfjsWrapper() { - // Use strict in our context only - users might not want it - 'use strict'; - - - -var globalScope = (typeof window === 'undefined') ? this : window; - -var isWorker = (typeof window === 'undefined'); - -var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; - -var TextRenderingMode = { - FILL: 0, - STROKE: 1, - FILL_STROKE: 2, - INVISIBLE: 3, - FILL_ADD_TO_PATH: 4, - STROKE_ADD_TO_PATH: 5, - FILL_STROKE_ADD_TO_PATH: 6, - ADD_TO_PATH: 7, - FILL_STROKE_MASK: 3, - ADD_TO_PATH_FLAG: 4 -}; - -var ImageKind = { - GRAYSCALE_1BPP: 1, - RGB_24BPP: 2, - RGBA_32BPP: 3 -}; - -var AnnotationType = { - TEXT: 1, - LINK: 2, - FREETEXT: 3, - LINE: 4, - SQUARE: 5, - CIRCLE: 6, - POLYGON: 7, - POLYLINE: 8, - HIGHLIGHT: 9, - UNDERLINE: 10, - SQUIGGLY: 11, - STRIKEOUT: 12, - STAMP: 13, - CARET: 14, - INK: 15, - POPUP: 16, - FILEATTACHMENT: 17, - SOUND: 18, - MOVIE: 19, - WIDGET: 20, - SCREEN: 21, - PRINTERMARK: 22, - TRAPNET: 23, - WATERMARK: 24, - THREED: 25, - REDACT: 26 -}; - -var AnnotationFlag = { - INVISIBLE: 0x01, - HIDDEN: 0x02, - PRINT: 0x04, - NOZOOM: 0x08, - NOROTATE: 0x10, - NOVIEW: 0x20, - READONLY: 0x40, - LOCKED: 0x80, - TOGGLENOVIEW: 0x100, - LOCKEDCONTENTS: 0x200 -}; - -var AnnotationBorderStyleType = { - SOLID: 1, - DASHED: 2, - BEVELED: 3, - INSET: 4, - UNDERLINE: 5 -}; - -var StreamType = { - UNKNOWN: 0, - FLATE: 1, - LZW: 2, - DCT: 3, - JPX: 4, - JBIG: 5, - A85: 6, - AHX: 7, - CCF: 8, - RL: 9 -}; - -var FontType = { - UNKNOWN: 0, - TYPE1: 1, - TYPE1C: 2, - CIDFONTTYPE0: 3, - CIDFONTTYPE0C: 4, - TRUETYPE: 5, - CIDFONTTYPE2: 6, - TYPE3: 7, - OPENTYPE: 8, - TYPE0: 9, - MMTYPE1: 10 -}; - -// 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.PDFJS) { - globalScope.PDFJS = {}; -} - -globalScope.PDFJS.pdfBug = false; - -PDFJS.VERBOSITY_LEVELS = { - errors: 0, - warnings: 1, - infos: 5 -}; - -// All the possible operations for an operator list. -var OPS = PDFJS.OPS = { - // Intentionally start from 1 so it is easy to spot bad operators that will be - // 0's. - dependency: 1, - setLineWidth: 2, - setLineCap: 3, - setLineJoin: 4, - setMiterLimit: 5, - setDash: 6, - setRenderingIntent: 7, - setFlatness: 8, - setGState: 9, - save: 10, - restore: 11, - transform: 12, - moveTo: 13, - lineTo: 14, - curveTo: 15, - curveTo2: 16, - curveTo3: 17, - closePath: 18, - rectangle: 19, - stroke: 20, - closeStroke: 21, - fill: 22, - eoFill: 23, - fillStroke: 24, - eoFillStroke: 25, - closeFillStroke: 26, - closeEOFillStroke: 27, - endPath: 28, - clip: 29, - eoClip: 30, - beginText: 31, - endText: 32, - setCharSpacing: 33, - setWordSpacing: 34, - setHScale: 35, - setLeading: 36, - setFont: 37, - setTextRenderingMode: 38, - setTextRise: 39, - moveText: 40, - setLeadingMoveText: 41, - setTextMatrix: 42, - nextLine: 43, - showText: 44, - showSpacedText: 45, - nextLineShowText: 46, - nextLineSetSpacingShowText: 47, - setCharWidth: 48, - setCharWidthAndBounds: 49, - setStrokeColorSpace: 50, - setFillColorSpace: 51, - setStrokeColor: 52, - setStrokeColorN: 53, - setFillColor: 54, - setFillColorN: 55, - setStrokeGray: 56, - setFillGray: 57, - setStrokeRGBColor: 58, - setFillRGBColor: 59, - setStrokeCMYKColor: 60, - setFillCMYKColor: 61, - shadingFill: 62, - beginInlineImage: 63, - beginImageData: 64, - endInlineImage: 65, - paintXObject: 66, - markPoint: 67, - markPointProps: 68, - beginMarkedContent: 69, - beginMarkedContentProps: 70, - endMarkedContent: 71, - beginCompat: 72, - endCompat: 73, - paintFormXObjectBegin: 74, - paintFormXObjectEnd: 75, - beginGroup: 76, - endGroup: 77, - beginAnnotations: 78, - endAnnotations: 79, - beginAnnotation: 80, - endAnnotation: 81, - paintJpegXObject: 82, - paintImageMaskXObject: 83, - paintImageMaskXObjectGroup: 84, - paintImageXObject: 85, - paintInlineImageXObject: 86, - paintInlineImageXObjectGroup: 87, - paintImageXObjectRepeat: 88, - paintImageMaskXObjectRepeat: 89, - paintSolidColorImageMask: 90, - constructPath: 91 -}; - -// A notice for devs. These are good for things that are helpful to devs, such -// as warning that Workers were disabled, which is important to devs but not -// end users. -function info(msg) { - if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.infos) { - console.log('Info: ' + msg); - } -} - -// Non-fatal warnings. -function warn(msg) { - if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.warnings) { - console.log('Warning: ' + msg); - } -} - -// Deprecated API function -- treated as warnings. -function deprecated(details) { - warn('Deprecated API usage: ' + details); -} - -// Fatal errors that should trigger the fallback UI and halt execution by -// throwing an exception. -function error(msg) { - if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.errors) { - console.log('Error: ' + msg); - console.log(backtrace()); - } - throw new Error(msg); -} - -function backtrace() { - try { - throw new Error(); - } catch (e) { - return e.stack ? e.stack.split('\n').slice(2).join('\n') : ''; - } -} - -function assert(cond, msg) { - if (!cond) { - error(msg); - } -} - -var UNSUPPORTED_FEATURES = PDFJS.UNSUPPORTED_FEATURES = { - unknown: 'unknown', - forms: 'forms', - javaScript: 'javaScript', - smask: 'smask', - shadingPattern: 'shadingPattern', - font: 'font' -}; - -// Combines two URLs. The baseUrl shall be absolute URL. If the url is an -// absolute URL, it will be returned as is. -function combineUrl(baseUrl, url) { - if (!url) { - return baseUrl; - } - return new URL(url, baseUrl).href; -} - -// Validates if URL is safe and allowed, e.g. to avoid XSS. -function isValidUrl(url, allowRelative) { - if (!url) { - return false; - } - // RFC 3986 (http://tools.ietf.org/html/rfc3986#section-3.1) - // scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - var protocol = /^[a-z][a-z0-9+\-.]*(?=:)/i.exec(url); - if (!protocol) { - return allowRelative; - } - protocol = protocol[0].toLowerCase(); - switch (protocol) { - case 'http': - case 'https': - case 'ftp': - case 'mailto': - case 'tel': - return true; - default: - return false; - } -} -PDFJS.isValidUrl = isValidUrl; - -function shadow(obj, prop, value) { - Object.defineProperty(obj, prop, { value: value, - enumerable: true, - configurable: true, - writable: false }); - return value; -} -PDFJS.shadow = shadow; - -var LinkTarget = PDFJS.LinkTarget = { - NONE: 0, // Default value. - SELF: 1, - BLANK: 2, - PARENT: 3, - TOP: 4, -}; -var LinkTargetStringMap = [ - '', - '_self', - '_blank', - '_parent', - '_top' -]; - -function isExternalLinkTargetSet() { - if (PDFJS.openExternalLinksInNewWindow) { - deprecated('PDFJS.openExternalLinksInNewWindow, please use ' + - '"PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK" instead.'); - if (PDFJS.externalLinkTarget === LinkTarget.NONE) { - PDFJS.externalLinkTarget = LinkTarget.BLANK; - } - // Reset the deprecated parameter, to suppress further warnings. - PDFJS.openExternalLinksInNewWindow = false; - } - switch (PDFJS.externalLinkTarget) { - case LinkTarget.NONE: - return false; - case LinkTarget.SELF: - case LinkTarget.BLANK: - case LinkTarget.PARENT: - case LinkTarget.TOP: - return true; - } - warn('PDFJS.externalLinkTarget is invalid: ' + PDFJS.externalLinkTarget); - // Reset the external link target, to suppress further warnings. - PDFJS.externalLinkTarget = LinkTarget.NONE; - return false; -} -PDFJS.isExternalLinkTargetSet = isExternalLinkTargetSet; - -var PasswordResponses = PDFJS.PasswordResponses = { - NEED_PASSWORD: 1, - INCORRECT_PASSWORD: 2 -}; - -var PasswordException = (function PasswordExceptionClosure() { - function PasswordException(msg, code) { - this.name = 'PasswordException'; - this.message = msg; - this.code = code; - } - - PasswordException.prototype = new Error(); - PasswordException.constructor = PasswordException; - - return PasswordException; -})(); -PDFJS.PasswordException = PasswordException; - -var UnknownErrorException = (function UnknownErrorExceptionClosure() { - function UnknownErrorException(msg, details) { - this.name = 'UnknownErrorException'; - this.message = msg; - this.details = details; - } - - UnknownErrorException.prototype = new Error(); - UnknownErrorException.constructor = UnknownErrorException; - - return UnknownErrorException; -})(); -PDFJS.UnknownErrorException = UnknownErrorException; - -var InvalidPDFException = (function InvalidPDFExceptionClosure() { - function InvalidPDFException(msg) { - this.name = 'InvalidPDFException'; - this.message = msg; - } - - InvalidPDFException.prototype = new Error(); - InvalidPDFException.constructor = InvalidPDFException; - - return InvalidPDFException; -})(); -PDFJS.InvalidPDFException = InvalidPDFException; - -var MissingPDFException = (function MissingPDFExceptionClosure() { - function MissingPDFException(msg) { - this.name = 'MissingPDFException'; - this.message = msg; - } - - MissingPDFException.prototype = new Error(); - MissingPDFException.constructor = MissingPDFException; - - return MissingPDFException; -})(); -PDFJS.MissingPDFException = MissingPDFException; - -var UnexpectedResponseException = - (function UnexpectedResponseExceptionClosure() { - function UnexpectedResponseException(msg, status) { - this.name = 'UnexpectedResponseException'; - this.message = msg; - this.status = status; - } - - UnexpectedResponseException.prototype = new Error(); - UnexpectedResponseException.constructor = UnexpectedResponseException; - - return UnexpectedResponseException; -})(); -PDFJS.UnexpectedResponseException = UnexpectedResponseException; - -var NotImplementedException = (function NotImplementedExceptionClosure() { - function NotImplementedException(msg) { - this.message = msg; - } - - NotImplementedException.prototype = new Error(); - NotImplementedException.prototype.name = 'NotImplementedException'; - NotImplementedException.constructor = NotImplementedException; - - return NotImplementedException; -})(); - -var MissingDataException = (function MissingDataExceptionClosure() { - function MissingDataException(begin, end) { - this.begin = begin; - this.end = end; - this.message = 'Missing data [' + begin + ', ' + end + ')'; - } - - MissingDataException.prototype = new Error(); - MissingDataException.prototype.name = 'MissingDataException'; - MissingDataException.constructor = MissingDataException; - - return MissingDataException; -})(); - -var XRefParseException = (function XRefParseExceptionClosure() { - function XRefParseException(msg) { - this.message = msg; - } - - XRefParseException.prototype = new Error(); - XRefParseException.prototype.name = 'XRefParseException'; - XRefParseException.constructor = XRefParseException; - - return XRefParseException; -})(); - - -function bytesToString(bytes) { - assert(bytes !== null && typeof bytes === 'object' && - bytes.length !== undefined, 'Invalid argument for bytesToString'); - var length = bytes.length; - var MAX_ARGUMENT_COUNT = 8192; - if (length < MAX_ARGUMENT_COUNT) { - return String.fromCharCode.apply(null, bytes); - } - var strBuf = []; - for (var i = 0; i < length; i += MAX_ARGUMENT_COUNT) { - var chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); - var chunk = bytes.subarray(i, chunkEnd); - strBuf.push(String.fromCharCode.apply(null, chunk)); - } - return strBuf.join(''); -} - -function stringToBytes(str) { - assert(typeof str === 'string', 'Invalid argument for stringToBytes'); - var length = str.length; - var bytes = new Uint8Array(length); - for (var i = 0; i < length; ++i) { - bytes[i] = str.charCodeAt(i) & 0xFF; - } - return bytes; -} - -function string32(value) { - return String.fromCharCode((value >> 24) & 0xff, (value >> 16) & 0xff, - (value >> 8) & 0xff, value & 0xff); -} - -function log2(x) { - var n = 1, i = 0; - while (x > n) { - n <<= 1; - i++; - } - return i; -} - -function readInt8(data, start) { - return (data[start] << 24) >> 24; -} - -function readUint16(data, offset) { - return (data[offset] << 8) | data[offset + 1]; -} - -function readUint32(data, offset) { - return ((data[offset] << 24) | (data[offset + 1] << 16) | - (data[offset + 2] << 8) | data[offset + 3]) >>> 0; -} - -// Lazy test the endianness of the platform -// NOTE: This will be 'true' for simulated TypedArrays -function isLittleEndian() { - var buffer8 = new Uint8Array(2); - buffer8[0] = 1; - var buffer16 = new Uint16Array(buffer8.buffer); - return (buffer16[0] === 1); -} - -Object.defineProperty(PDFJS, 'isLittleEndian', { - configurable: true, - get: function PDFJS_isLittleEndian() { - return shadow(PDFJS, 'isLittleEndian', isLittleEndian()); - } -}); - - // Lazy test if the userAgent support CanvasTypedArrays -function hasCanvasTypedArrays() { - var canvas = document.createElement('canvas'); - canvas.width = canvas.height = 1; - var ctx = canvas.getContext('2d'); - var imageData = ctx.createImageData(1, 1); - return (typeof imageData.data.buffer !== 'undefined'); -} - -Object.defineProperty(PDFJS, 'hasCanvasTypedArrays', { - configurable: true, - get: function PDFJS_hasCanvasTypedArrays() { - return shadow(PDFJS, 'hasCanvasTypedArrays', hasCanvasTypedArrays()); - } -}); - -var Uint32ArrayView = (function Uint32ArrayViewClosure() { - - function Uint32ArrayView(buffer, length) { - this.buffer = buffer; - this.byteLength = buffer.length; - this.length = length === undefined ? (this.byteLength >> 2) : length; - ensureUint32ArrayViewProps(this.length); - } - Uint32ArrayView.prototype = Object.create(null); - - var uint32ArrayViewSetters = 0; - function createUint32ArrayProp(index) { - return { - get: function () { - var buffer = this.buffer, offset = index << 2; - return (buffer[offset] | (buffer[offset + 1] << 8) | - (buffer[offset + 2] << 16) | (buffer[offset + 3] << 24)) >>> 0; - }, - set: function (value) { - var buffer = this.buffer, offset = index << 2; - buffer[offset] = value & 255; - buffer[offset + 1] = (value >> 8) & 255; - buffer[offset + 2] = (value >> 16) & 255; - buffer[offset + 3] = (value >>> 24) & 255; - } - }; - } - - function ensureUint32ArrayViewProps(length) { - while (uint32ArrayViewSetters < length) { - Object.defineProperty(Uint32ArrayView.prototype, - uint32ArrayViewSetters, - createUint32ArrayProp(uint32ArrayViewSetters)); - uint32ArrayViewSetters++; - } - } - - return Uint32ArrayView; -})(); - -var IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; - -var Util = PDFJS.Util = (function UtilClosure() { - function Util() {} - - var rgbBuf = ['rgb(', 0, ',', 0, ',', 0, ')']; - - // makeCssRgb() can be called thousands of times. Using |rgbBuf| avoids - // creating many intermediate strings. - Util.makeCssRgb = function Util_makeCssRgb(r, g, b) { - rgbBuf[1] = r; - rgbBuf[3] = g; - rgbBuf[5] = b; - return rgbBuf.join(''); - }; - - // Concatenates two transformation matrices together and returns the result. - Util.transform = function Util_transform(m1, m2) { - return [ - m1[0] * m2[0] + m1[2] * m2[1], - m1[1] * m2[0] + m1[3] * m2[1], - m1[0] * m2[2] + m1[2] * m2[3], - m1[1] * m2[2] + m1[3] * m2[3], - m1[0] * m2[4] + m1[2] * m2[5] + m1[4], - m1[1] * m2[4] + m1[3] * m2[5] + m1[5] - ]; - }; - - // For 2d affine transforms - Util.applyTransform = function Util_applyTransform(p, m) { - var xt = p[0] * m[0] + p[1] * m[2] + m[4]; - var yt = p[0] * m[1] + p[1] * m[3] + m[5]; - return [xt, yt]; - }; - - Util.applyInverseTransform = function Util_applyInverseTransform(p, m) { - var d = m[0] * m[3] - m[1] * m[2]; - var xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; - var yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; - return [xt, yt]; - }; - - // Applies the transform to the rectangle and finds the minimum axially - // aligned bounding box. - Util.getAxialAlignedBoundingBox = - function Util_getAxialAlignedBoundingBox(r, m) { - - var p1 = Util.applyTransform(r, m); - var p2 = Util.applyTransform(r.slice(2, 4), m); - var p3 = Util.applyTransform([r[0], r[3]], m); - var p4 = Util.applyTransform([r[2], r[1]], m); - return [ - Math.min(p1[0], p2[0], p3[0], p4[0]), - Math.min(p1[1], p2[1], p3[1], p4[1]), - Math.max(p1[0], p2[0], p3[0], p4[0]), - Math.max(p1[1], p2[1], p3[1], p4[1]) - ]; - }; - - Util.inverseTransform = function Util_inverseTransform(m) { - var d = m[0] * m[3] - m[1] * m[2]; - return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, - (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d]; - }; - - // Apply a generic 3d matrix M on a 3-vector v: - // | a b c | | X | - // | d e f | x | Y | - // | g h i | | Z | - // M is assumed to be serialized as [a,b,c,d,e,f,g,h,i], - // with v as [X,Y,Z] - Util.apply3dTransform = function Util_apply3dTransform(m, v) { - return [ - m[0] * v[0] + m[1] * v[1] + m[2] * v[2], - m[3] * v[0] + m[4] * v[1] + m[5] * v[2], - m[6] * v[0] + m[7] * v[1] + m[8] * v[2] - ]; - }; - - // This calculation uses Singular Value Decomposition. - // The SVD can be represented with formula A = USV. We are interested in the - // matrix S here because it represents the scale values. - Util.singularValueDecompose2dScale = - function Util_singularValueDecompose2dScale(m) { - - var transpose = [m[0], m[2], m[1], m[3]]; - - // Multiply matrix m with its transpose. - var a = m[0] * transpose[0] + m[1] * transpose[2]; - var b = m[0] * transpose[1] + m[1] * transpose[3]; - var c = m[2] * transpose[0] + m[3] * transpose[2]; - var d = m[2] * transpose[1] + m[3] * transpose[3]; - - // Solve the second degree polynomial to get roots. - var first = (a + d) / 2; - var second = Math.sqrt((a + d) * (a + d) - 4 * (a * d - c * b)) / 2; - var sx = first + second || 1; - var sy = first - second || 1; - - // Scale values are the square roots of the eigenvalues. - return [Math.sqrt(sx), Math.sqrt(sy)]; - }; - - // Normalize rectangle rect=[x1, y1, x2, y2] so that (x1,y1) < (x2,y2) - // For coordinate systems whose origin lies in the bottom-left, this - // means normalization to (BL,TR) ordering. For systems with origin in the - // top-left, this means (TL,BR) ordering. - Util.normalizeRect = function Util_normalizeRect(rect) { - var r = rect.slice(0); // clone rect - if (rect[0] > rect[2]) { - r[0] = rect[2]; - r[2] = rect[0]; - } - if (rect[1] > rect[3]) { - r[1] = rect[3]; - r[3] = rect[1]; - } - return r; - }; - - // Returns a rectangle [x1, y1, x2, y2] corresponding to the - // intersection of rect1 and rect2. If no intersection, returns 'false' - // The rectangle coordinates of rect1, rect2 should be [x1, y1, x2, y2] - Util.intersect = function Util_intersect(rect1, rect2) { - function compare(a, b) { - return a - b; - } - - // Order points along the axes - var orderedX = [rect1[0], rect1[2], rect2[0], rect2[2]].sort(compare), - orderedY = [rect1[1], rect1[3], rect2[1], rect2[3]].sort(compare), - result = []; - - rect1 = Util.normalizeRect(rect1); - rect2 = Util.normalizeRect(rect2); - - // X: first and second points belong to different rectangles? - if ((orderedX[0] === rect1[0] && orderedX[1] === rect2[0]) || - (orderedX[0] === rect2[0] && orderedX[1] === rect1[0])) { - // Intersection must be between second and third points - result[0] = orderedX[1]; - result[2] = orderedX[2]; - } else { - return false; - } - - // Y: first and second points belong to different rectangles? - if ((orderedY[0] === rect1[1] && orderedY[1] === rect2[1]) || - (orderedY[0] === rect2[1] && orderedY[1] === rect1[1])) { - // Intersection must be between second and third points - result[1] = orderedY[1]; - result[3] = orderedY[2]; - } else { - return false; - } - - return result; - }; - - Util.sign = function Util_sign(num) { - return num < 0 ? -1 : 1; - }; - - Util.appendToArray = function Util_appendToArray(arr1, arr2) { - Array.prototype.push.apply(arr1, arr2); - }; - - Util.prependToArray = function Util_prependToArray(arr1, arr2) { - Array.prototype.unshift.apply(arr1, arr2); - }; - - Util.extendObj = function extendObj(obj1, obj2) { - for (var key in obj2) { - obj1[key] = obj2[key]; - } - }; - - Util.getInheritableProperty = function Util_getInheritableProperty(dict, - name) { - while (dict && !dict.has(name)) { - dict = dict.get('Parent'); - } - if (!dict) { - return null; - } - return dict.get(name); - }; - - Util.inherit = function Util_inherit(sub, base, prototype) { - sub.prototype = Object.create(base.prototype); - sub.prototype.constructor = sub; - for (var prop in prototype) { - sub.prototype[prop] = prototype[prop]; - } - }; - - Util.loadScript = function Util_loadScript(src, callback) { - var script = document.createElement('script'); - var loaded = false; - script.setAttribute('src', src); - if (callback) { - script.onload = function() { - if (!loaded) { - callback(); - } - loaded = true; - }; - } - document.getElementsByTagName('head')[0].appendChild(script); - }; - - return Util; -})(); - -/** - * PDF page viewport created based on scale, rotation and offset. - * @class - * @alias PDFJS.PageViewport - */ -var PageViewport = PDFJS.PageViewport = (function PageViewportClosure() { - /** - * @constructor - * @private - * @param viewBox {Array} xMin, yMin, xMax and yMax coordinates. - * @param scale {number} scale of the viewport. - * @param rotation {number} rotations of the viewport in degrees. - * @param offsetX {number} offset X - * @param offsetY {number} offset Y - * @param dontFlip {boolean} if true, axis Y will not be flipped. - */ - function PageViewport(viewBox, scale, rotation, offsetX, offsetY, dontFlip) { - this.viewBox = viewBox; - this.scale = scale; - this.rotation = rotation; - this.offsetX = offsetX; - this.offsetY = offsetY; - - // creating transform to convert pdf coordinate system to the normal - // canvas like coordinates taking in account scale and rotation - var centerX = (viewBox[2] + viewBox[0]) / 2; - var centerY = (viewBox[3] + viewBox[1]) / 2; - var rotateA, rotateB, rotateC, rotateD; - rotation = rotation % 360; - rotation = rotation < 0 ? rotation + 360 : rotation; - switch (rotation) { - case 180: - rotateA = -1; rotateB = 0; rotateC = 0; rotateD = 1; - break; - case 90: - rotateA = 0; rotateB = 1; rotateC = 1; rotateD = 0; - break; - case 270: - rotateA = 0; rotateB = -1; rotateC = -1; rotateD = 0; - break; - //case 0: - default: - rotateA = 1; rotateB = 0; rotateC = 0; rotateD = -1; - break; - } - - if (dontFlip) { - rotateC = -rotateC; rotateD = -rotateD; - } - - var offsetCanvasX, offsetCanvasY; - var width, height; - if (rotateA === 0) { - offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX; - offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY; - width = Math.abs(viewBox[3] - viewBox[1]) * scale; - height = Math.abs(viewBox[2] - viewBox[0]) * scale; - } else { - offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX; - offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY; - width = Math.abs(viewBox[2] - viewBox[0]) * scale; - height = Math.abs(viewBox[3] - viewBox[1]) * scale; - } - // creating transform for the following operations: - // translate(-centerX, -centerY), rotate and flip vertically, - // scale, and translate(offsetCanvasX, offsetCanvasY) - this.transform = [ - rotateA * scale, - rotateB * scale, - rotateC * scale, - rotateD * scale, - offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY, - offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY - ]; - - this.width = width; - this.height = height; - this.fontScale = scale; - } - PageViewport.prototype = /** @lends PDFJS.PageViewport.prototype */ { - /** - * Clones viewport with additional properties. - * @param args {Object} (optional) If specified, may contain the 'scale' or - * 'rotation' properties to override the corresponding properties in - * the cloned viewport. - * @returns {PDFJS.PageViewport} Cloned viewport. - */ - clone: function PageViewPort_clone(args) { - args = args || {}; - var scale = 'scale' in args ? args.scale : this.scale; - var rotation = 'rotation' in args ? args.rotation : this.rotation; - return new PageViewport(this.viewBox.slice(), scale, rotation, - this.offsetX, this.offsetY, args.dontFlip); - }, - /** - * Converts PDF point to the viewport coordinates. For examples, useful for - * converting PDF location into canvas pixel coordinates. - * @param x {number} X coordinate. - * @param y {number} Y coordinate. - * @returns {Object} Object that contains 'x' and 'y' properties of the - * point in the viewport coordinate space. - * @see {@link convertToPdfPoint} - * @see {@link convertToViewportRectangle} - */ - convertToViewportPoint: function PageViewport_convertToViewportPoint(x, y) { - return Util.applyTransform([x, y], this.transform); - }, - /** - * Converts PDF rectangle to the viewport coordinates. - * @param rect {Array} xMin, yMin, xMax and yMax coordinates. - * @returns {Array} Contains corresponding coordinates of the rectangle - * in the viewport coordinate space. - * @see {@link convertToViewportPoint} - */ - convertToViewportRectangle: - function PageViewport_convertToViewportRectangle(rect) { - var tl = Util.applyTransform([rect[0], rect[1]], this.transform); - var br = Util.applyTransform([rect[2], rect[3]], this.transform); - return [tl[0], tl[1], br[0], br[1]]; - }, - /** - * Converts viewport coordinates to the PDF location. For examples, useful - * for converting canvas pixel location into PDF one. - * @param x {number} X coordinate. - * @param y {number} Y coordinate. - * @returns {Object} Object that contains 'x' and 'y' properties of the - * point in the PDF coordinate space. - * @see {@link convertToViewportPoint} - */ - convertToPdfPoint: function PageViewport_convertToPdfPoint(x, y) { - return Util.applyInverseTransform([x, y], this.transform); - } - }; - return PageViewport; -})(); - -var PDFStringTranslateTable = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0x2D8, 0x2C7, 0x2C6, 0x2D9, 0x2DD, 0x2DB, 0x2DA, 0x2DC, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, - 0x2013, 0x192, 0x2044, 0x2039, 0x203A, 0x2212, 0x2030, 0x201E, 0x201C, - 0x201D, 0x2018, 0x2019, 0x201A, 0x2122, 0xFB01, 0xFB02, 0x141, 0x152, 0x160, - 0x178, 0x17D, 0x131, 0x142, 0x153, 0x161, 0x17E, 0, 0x20AC -]; - -function stringToPDFString(str) { - var i, n = str.length, strBuf = []; - if (str[0] === '\xFE' && str[1] === '\xFF') { - // UTF16BE BOM - for (i = 2; i < n; i += 2) { - strBuf.push(String.fromCharCode( - (str.charCodeAt(i) << 8) | str.charCodeAt(i + 1))); - } - } else { - for (i = 0; i < n; ++i) { - var code = PDFStringTranslateTable[str.charCodeAt(i)]; - strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); - } - } - return strBuf.join(''); -} - -function stringToUTF8String(str) { - return decodeURIComponent(escape(str)); -} - -function utf8StringToString(str) { - return unescape(encodeURIComponent(str)); -} - -function isEmptyObj(obj) { - for (var key in obj) { - return false; - } - return true; -} - -function isBool(v) { - return typeof v === 'boolean'; -} - -function isInt(v) { - return typeof v === 'number' && ((v | 0) === v); -} - -function isNum(v) { - return typeof v === 'number'; -} - -function isString(v) { - return typeof v === 'string'; -} - -function isName(v) { - return v instanceof Name; -} - -function isCmd(v, cmd) { - return v instanceof Cmd && (cmd === undefined || v.cmd === cmd); -} - -function isDict(v, type) { - if (!(v instanceof Dict)) { - return false; - } - if (!type) { - return true; - } - var dictType = v.get('Type'); - return isName(dictType) && dictType.name === type; -} - -function isArray(v) { - return v instanceof Array; -} - -function isStream(v) { - return typeof v === 'object' && v !== null && v.getBytes !== undefined; -} - -function isArrayBuffer(v) { - return typeof v === 'object' && v !== null && v.byteLength !== undefined; -} - -function isRef(v) { - return v instanceof Ref; -} - -/** - * Promise Capability object. - * - * @typedef {Object} PromiseCapability - * @property {Promise} promise - A promise object. - * @property {function} resolve - Fullfills the promise. - * @property {function} reject - Rejects the promise. - */ - -/** - * Creates a promise capability object. - * @alias PDFJS.createPromiseCapability - * - * @return {PromiseCapability} A capability object contains: - * - a Promise, resolve and reject methods. - */ -function createPromiseCapability() { - var capability = {}; - capability.promise = new Promise(function (resolve, reject) { - capability.resolve = resolve; - capability.reject = reject; - }); - return capability; -} - -PDFJS.createPromiseCapability = createPromiseCapability; - -/** - * Polyfill for Promises: - * The following promise implementation tries to generally implement the - * Promise/A+ spec. Some notable differences from other promise libaries are: - * - There currently isn't a seperate deferred and promise object. - * - Unhandled rejections eventually show an error if they aren't handled. - * - * Based off of the work in: - * https://bugzilla.mozilla.org/show_bug.cgi?id=810490 - */ -(function PromiseClosure() { - if (globalScope.Promise) { - // Promises existing in the DOM/Worker, checking presence of all/resolve - if (typeof globalScope.Promise.all !== 'function') { - globalScope.Promise.all = function (iterable) { - var count = 0, results = [], resolve, reject; - var promise = new globalScope.Promise(function (resolve_, reject_) { - resolve = resolve_; - reject = reject_; - }); - iterable.forEach(function (p, i) { - count++; - p.then(function (result) { - results[i] = result; - count--; - if (count === 0) { - resolve(results); - } - }, reject); - }); - if (count === 0) { - resolve(results); - } - return promise; - }; - } - if (typeof globalScope.Promise.resolve !== 'function') { - globalScope.Promise.resolve = function (value) { - return new globalScope.Promise(function (resolve) { resolve(value); }); - }; - } - if (typeof globalScope.Promise.reject !== 'function') { - globalScope.Promise.reject = function (reason) { - return new globalScope.Promise(function (resolve, reject) { - reject(reason); - }); - }; - } - if (typeof globalScope.Promise.prototype.catch !== 'function') { - globalScope.Promise.prototype.catch = function (onReject) { - return globalScope.Promise.prototype.then(undefined, onReject); - }; - } - return; - } - var STATUS_PENDING = 0; - var STATUS_RESOLVED = 1; - var STATUS_REJECTED = 2; - - // In an attempt to avoid silent exceptions, unhandled rejections are - // tracked and if they aren't handled in a certain amount of time an - // error is logged. - var REJECTION_TIMEOUT = 500; - - var HandlerManager = { - handlers: [], - running: false, - unhandledRejections: [], - pendingRejectionCheck: false, - - scheduleHandlers: function scheduleHandlers(promise) { - if (promise._status === STATUS_PENDING) { - return; - } - - this.handlers = this.handlers.concat(promise._handlers); - promise._handlers = []; - - if (this.running) { - return; - } - this.running = true; - - setTimeout(this.runHandlers.bind(this), 0); - }, - - runHandlers: function runHandlers() { - var RUN_TIMEOUT = 1; // ms - var timeoutAt = Date.now() + RUN_TIMEOUT; - while (this.handlers.length > 0) { - var handler = this.handlers.shift(); - - var nextStatus = handler.thisPromise._status; - var nextValue = handler.thisPromise._value; - - try { - if (nextStatus === STATUS_RESOLVED) { - if (typeof handler.onResolve === 'function') { - nextValue = handler.onResolve(nextValue); - } - } else if (typeof handler.onReject === 'function') { - nextValue = handler.onReject(nextValue); - nextStatus = STATUS_RESOLVED; - - if (handler.thisPromise._unhandledRejection) { - this.removeUnhandeledRejection(handler.thisPromise); - } - } - } catch (ex) { - nextStatus = STATUS_REJECTED; - nextValue = ex; - } - - handler.nextPromise._updateStatus(nextStatus, nextValue); - if (Date.now() >= timeoutAt) { - break; - } - } - - if (this.handlers.length > 0) { - setTimeout(this.runHandlers.bind(this), 0); - return; - } - - this.running = false; - }, - - addUnhandledRejection: function addUnhandledRejection(promise) { - this.unhandledRejections.push({ - promise: promise, - time: Date.now() - }); - this.scheduleRejectionCheck(); - }, - - removeUnhandeledRejection: function removeUnhandeledRejection(promise) { - promise._unhandledRejection = false; - for (var i = 0; i < this.unhandledRejections.length; i++) { - if (this.unhandledRejections[i].promise === promise) { - this.unhandledRejections.splice(i); - i--; - } - } - }, - - scheduleRejectionCheck: function scheduleRejectionCheck() { - if (this.pendingRejectionCheck) { - return; - } - this.pendingRejectionCheck = true; - setTimeout(function rejectionCheck() { - this.pendingRejectionCheck = false; - var now = Date.now(); - for (var i = 0; i < this.unhandledRejections.length; i++) { - if (now - this.unhandledRejections[i].time > REJECTION_TIMEOUT) { - var unhandled = this.unhandledRejections[i].promise._value; - var msg = 'Unhandled rejection: ' + unhandled; - if (unhandled.stack) { - msg += '\n' + unhandled.stack; - } - warn(msg); - this.unhandledRejections.splice(i); - i--; - } - } - if (this.unhandledRejections.length) { - this.scheduleRejectionCheck(); - } - }.bind(this), REJECTION_TIMEOUT); - } - }; - - function Promise(resolver) { - this._status = STATUS_PENDING; - this._handlers = []; - try { - resolver.call(this, this._resolve.bind(this), this._reject.bind(this)); - } catch (e) { - this._reject(e); - } - } - /** - * Builds a promise that is resolved when all the passed in promises are - * resolved. - * @param {array} array of data and/or promises to wait for. - * @return {Promise} New dependant promise. - */ - Promise.all = function Promise_all(promises) { - var resolveAll, rejectAll; - var deferred = new Promise(function (resolve, reject) { - resolveAll = resolve; - rejectAll = reject; - }); - var unresolved = promises.length; - var results = []; - if (unresolved === 0) { - resolveAll(results); - return deferred; - } - function reject(reason) { - if (deferred._status === STATUS_REJECTED) { - return; - } - results = []; - rejectAll(reason); - } - for (var i = 0, ii = promises.length; i < ii; ++i) { - var promise = promises[i]; - var resolve = (function(i) { - return function(value) { - if (deferred._status === STATUS_REJECTED) { - return; - } - results[i] = value; - unresolved--; - if (unresolved === 0) { - resolveAll(results); - } - }; - })(i); - if (Promise.isPromise(promise)) { - promise.then(resolve, reject); - } else { - resolve(promise); - } - } - return deferred; - }; - - /** - * Checks if the value is likely a promise (has a 'then' function). - * @return {boolean} true if value is thenable - */ - Promise.isPromise = function Promise_isPromise(value) { - return value && typeof value.then === 'function'; - }; - - /** - * Creates resolved promise - * @param value resolve value - * @returns {Promise} - */ - Promise.resolve = function Promise_resolve(value) { - return new Promise(function (resolve) { resolve(value); }); - }; - - /** - * Creates rejected promise - * @param reason rejection value - * @returns {Promise} - */ - Promise.reject = function Promise_reject(reason) { - return new Promise(function (resolve, reject) { reject(reason); }); - }; - - Promise.prototype = { - _status: null, - _value: null, - _handlers: null, - _unhandledRejection: null, - - _updateStatus: function Promise__updateStatus(status, value) { - if (this._status === STATUS_RESOLVED || - this._status === STATUS_REJECTED) { - return; - } - - if (status === STATUS_RESOLVED && - Promise.isPromise(value)) { - value.then(this._updateStatus.bind(this, STATUS_RESOLVED), - this._updateStatus.bind(this, STATUS_REJECTED)); - return; - } - - this._status = status; - this._value = value; - - if (status === STATUS_REJECTED && this._handlers.length === 0) { - this._unhandledRejection = true; - HandlerManager.addUnhandledRejection(this); - } - - HandlerManager.scheduleHandlers(this); - }, - - _resolve: function Promise_resolve(value) { - this._updateStatus(STATUS_RESOLVED, value); - }, - - _reject: function Promise_reject(reason) { - this._updateStatus(STATUS_REJECTED, reason); - }, - - then: function Promise_then(onResolve, onReject) { - var nextPromise = new Promise(function (resolve, reject) { - this.resolve = resolve; - this.reject = reject; - }); - this._handlers.push({ - thisPromise: this, - onResolve: onResolve, - onReject: onReject, - nextPromise: nextPromise - }); - HandlerManager.scheduleHandlers(this); - return nextPromise; - }, - - catch: function Promise_catch(onReject) { - return this.then(undefined, onReject); - } - }; - - globalScope.Promise = Promise; -})(); - -var StatTimer = (function StatTimerClosure() { - function rpad(str, pad, length) { - while (str.length < length) { - str += pad; - } - return str; - } - function StatTimer() { - this.started = {}; - this.times = []; - this.enabled = true; - } - StatTimer.prototype = { - time: function StatTimer_time(name) { - if (!this.enabled) { - return; - } - if (name in this.started) { - warn('Timer is already running for ' + name); - } - this.started[name] = Date.now(); - }, - timeEnd: function StatTimer_timeEnd(name) { - if (!this.enabled) { - return; - } - if (!(name in this.started)) { - warn('Timer has not been started for ' + name); - } - this.times.push({ - 'name': name, - 'start': this.started[name], - 'end': Date.now() - }); - // Remove timer from started so it can be called again. - delete this.started[name]; - }, - toString: function StatTimer_toString() { - var i, ii; - var times = this.times; - var out = ''; - // Find the longest name for padding purposes. - var longest = 0; - for (i = 0, ii = times.length; i < ii; ++i) { - var name = times[i]['name']; - if (name.length > longest) { - longest = name.length; - } - } - for (i = 0, ii = times.length; i < ii; ++i) { - var span = times[i]; - var duration = span.end - span.start; - out += rpad(span['name'], ' ', longest) + ' ' + duration + 'ms\n'; - } - return out; - } - }; - return StatTimer; -})(); - -PDFJS.createBlob = function createBlob(data, contentType) { - if (typeof Blob !== 'undefined') { - return new Blob([data], { type: contentType }); - } - // Blob builder is deprecated in FF14 and removed in FF18. - var bb = new MozBlobBuilder(); - bb.append(data); - return bb.getBlob(contentType); -}; - -PDFJS.createObjectURL = (function createObjectURLClosure() { - // Blob/createObjectURL is not available, falling back to data schema. - var digits = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - - return function createObjectURL(data, contentType) { - if (!PDFJS.disableCreateObjectURL && - typeof URL !== 'undefined' && URL.createObjectURL) { - var blob = PDFJS.createBlob(data, contentType); - return URL.createObjectURL(blob); - } - - var buffer = 'data:' + contentType + ';base64,'; - for (var i = 0, ii = data.length; i < ii; i += 3) { - var b1 = data[i] & 0xFF; - var b2 = data[i + 1] & 0xFF; - var b3 = data[i + 2] & 0xFF; - var d1 = b1 >> 2, d2 = ((b1 & 3) << 4) | (b2 >> 4); - var d3 = i + 1 < ii ? ((b2 & 0xF) << 2) | (b3 >> 6) : 64; - var d4 = i + 2 < ii ? (b3 & 0x3F) : 64; - buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4]; - } - return buffer; - }; -})(); - -function MessageHandler(sourceName, targetName, comObj) { - this.sourceName = sourceName; - this.targetName = targetName; - this.comObj = comObj; - this.callbackIndex = 1; - this.postMessageTransfers = true; - var callbacksCapabilities = this.callbacksCapabilities = {}; - var ah = this.actionHandler = {}; - - this._onComObjOnMessage = function messageHandlerComObjOnMessage(event) { - var data = event.data; - if (data.targetName !== this.sourceName) { - return; - } - if (data.isReply) { - var callbackId = data.callbackId; - if (data.callbackId in callbacksCapabilities) { - var callback = callbacksCapabilities[callbackId]; - delete callbacksCapabilities[callbackId]; - if ('error' in data) { - callback.reject(data.error); - } else { - callback.resolve(data.data); - } - } else { - error('Cannot resolve callback ' + callbackId); - } - } else if (data.action in ah) { - var action = ah[data.action]; - if (data.callbackId) { - var sourceName = this.sourceName; - var targetName = data.sourceName; - Promise.resolve().then(function () { - return action[0].call(action[1], data.data); - }).then(function (result) { - comObj.postMessage({ - sourceName: sourceName, - targetName: targetName, - isReply: true, - callbackId: data.callbackId, - data: result - }); - }, function (reason) { - if (reason instanceof Error) { - // Serialize error to avoid "DataCloneError" - reason = reason + ''; - } - comObj.postMessage({ - sourceName: sourceName, - targetName: targetName, - isReply: true, - callbackId: data.callbackId, - error: reason - }); - }); - } else { - action[0].call(action[1], data.data); - } - } else { - error('Unknown action from worker: ' + data.action); - } - }.bind(this); - comObj.addEventListener('message', this._onComObjOnMessage); -} - -MessageHandler.prototype = { - on: function messageHandlerOn(actionName, handler, scope) { - var ah = this.actionHandler; - if (ah[actionName]) { - error('There is already an actionName called "' + actionName + '"'); - } - ah[actionName] = [handler, scope]; - }, - /** - * Sends a message to the comObj to invoke the action with the supplied data. - * @param {String} actionName Action to call. - * @param {JSON} data JSON data to send. - * @param {Array} [transfers] Optional list of transfers/ArrayBuffers - */ - send: function messageHandlerSend(actionName, data, transfers) { - var message = { - sourceName: this.sourceName, - targetName: this.targetName, - action: actionName, - data: data - }; - this.postMessage(message, transfers); - }, - /** - * Sends a message to the comObj to invoke the action with the supplied data. - * Expects that other side will callback with the response. - * @param {String} actionName Action to call. - * @param {JSON} data JSON data to send. - * @param {Array} [transfers] Optional list of transfers/ArrayBuffers. - * @returns {Promise} Promise to be resolved with response data. - */ - sendWithPromise: - function messageHandlerSendWithPromise(actionName, data, transfers) { - var callbackId = this.callbackIndex++; - var message = { - sourceName: this.sourceName, - targetName: this.targetName, - action: actionName, - data: data, - callbackId: callbackId - }; - var capability = createPromiseCapability(); - this.callbacksCapabilities[callbackId] = capability; - try { - this.postMessage(message, transfers); - } catch (e) { - capability.reject(e); - } - return capability.promise; - }, - /** - * Sends raw message to the comObj. - * @private - * @param message {Object} Raw message. - * @param transfers List of transfers/ArrayBuffers, or undefined. - */ - postMessage: function (message, transfers) { - if (transfers && this.postMessageTransfers) { - this.comObj.postMessage(message, transfers); - } else { - this.comObj.postMessage(message); - } - }, - - destroy: function () { - this.comObj.removeEventListener('message', this._onComObjOnMessage); - } -}; - -function loadJpegStream(id, imageUrl, objs) { - var img = new Image(); - img.onload = (function loadJpegStream_onloadClosure() { - objs.resolve(id, img); - }); - img.onerror = (function loadJpegStream_onerrorClosure() { - objs.resolve(id, null); - warn('Error during JPEG image loading'); - }); - img.src = imageUrl; -} - - // Polyfill from https://github.com/Polymer/URL -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ -(function checkURLConstructor(scope) { - /* jshint ignore:start */ - - // feature detect for URL constructor - var hasWorkingUrl = false; - if (typeof URL === 'function' && ('origin' in URL.prototype)) { - try { - var u = new URL('b', 'http://a'); - u.pathname = 'c%20d'; - hasWorkingUrl = u.href === 'http://a/c%20d'; - } catch(e) {} - } - - if (hasWorkingUrl) - return; - - var relative = Object.create(null); - relative['ftp'] = 21; - relative['file'] = 0; - relative['gopher'] = 70; - relative['http'] = 80; - relative['https'] = 443; - relative['ws'] = 80; - relative['wss'] = 443; - - var relativePathDotMapping = Object.create(null); - relativePathDotMapping['%2e'] = '.'; - relativePathDotMapping['.%2e'] = '..'; - relativePathDotMapping['%2e.'] = '..'; - relativePathDotMapping['%2e%2e'] = '..'; - - function isRelativeScheme(scheme) { - return relative[scheme] !== undefined; - } - - function invalid() { - clear.call(this); - this._isInvalid = true; - } - - function IDNAToASCII(h) { - if ('' == h) { - invalid.call(this) - } - // XXX - return h.toLowerCase() - } - - function percentEscape(c) { - var unicode = c.charCodeAt(0); - if (unicode > 0x20 && - unicode < 0x7F && - // " # < > ? ` - [0x22, 0x23, 0x3C, 0x3E, 0x3F, 0x60].indexOf(unicode) == -1 - ) { - return c; - } - return encodeURIComponent(c); - } - - function percentEscapeQuery(c) { - // XXX This actually needs to encode c using encoding and then - // convert the bytes one-by-one. - - var unicode = c.charCodeAt(0); - if (unicode > 0x20 && - unicode < 0x7F && - // " # < > ` (do not escape '?') - [0x22, 0x23, 0x3C, 0x3E, 0x60].indexOf(unicode) == -1 - ) { - return c; - } - return encodeURIComponent(c); - } - - var EOF = undefined, - ALPHA = /[a-zA-Z]/, - ALPHANUMERIC = /[a-zA-Z0-9\+\-\.]/; - - function parse(input, stateOverride, base) { - function err(message) { - errors.push(message) - } - - var state = stateOverride || 'scheme start', - cursor = 0, - buffer = '', - seenAt = false, - seenBracket = false, - errors = []; - - loop: while ((input[cursor - 1] != EOF || cursor == 0) && !this._isInvalid) { - var c = input[cursor]; - switch (state) { - case 'scheme start': - if (c && ALPHA.test(c)) { - buffer += c.toLowerCase(); // ASCII-safe - state = 'scheme'; - } else if (!stateOverride) { - buffer = ''; - state = 'no scheme'; - continue; - } else { - err('Invalid scheme.'); - break loop; - } - break; - - case 'scheme': - if (c && ALPHANUMERIC.test(c)) { - buffer += c.toLowerCase(); // ASCII-safe - } else if (':' == c) { - this._scheme = buffer; - buffer = ''; - if (stateOverride) { - break loop; - } - if (isRelativeScheme(this._scheme)) { - this._isRelative = true; - } - if ('file' == this._scheme) { - state = 'relative'; - } else if (this._isRelative && base && base._scheme == this._scheme) { - state = 'relative or authority'; - } else if (this._isRelative) { - state = 'authority first slash'; - } else { - state = 'scheme data'; - } - } else if (!stateOverride) { - buffer = ''; - cursor = 0; - state = 'no scheme'; - continue; - } else if (EOF == c) { - break loop; - } else { - err('Code point not allowed in scheme: ' + c) - break loop; - } - break; - - case 'scheme data': - if ('?' == c) { - this._query = '?'; - state = 'query'; - } else if ('#' == c) { - this._fragment = '#'; - state = 'fragment'; - } else { - // XXX error handling - if (EOF != c && '\t' != c && '\n' != c && '\r' != c) { - this._schemeData += percentEscape(c); - } - } - break; - - case 'no scheme': - if (!base || !(isRelativeScheme(base._scheme))) { - err('Missing scheme.'); - invalid.call(this); - } else { - state = 'relative'; - continue; - } - break; - - case 'relative or authority': - if ('/' == c && '/' == input[cursor+1]) { - state = 'authority ignore slashes'; - } else { - err('Expected /, got: ' + c); - state = 'relative'; - continue - } - break; - - case 'relative': - this._isRelative = true; - if ('file' != this._scheme) - this._scheme = base._scheme; - if (EOF == c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = base._query; - this._username = base._username; - this._password = base._password; - break loop; - } else if ('/' == c || '\\' == c) { - if ('\\' == c) - err('\\ is an invalid code point.'); - state = 'relative slash'; - } else if ('?' == c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = '?'; - this._username = base._username; - this._password = base._password; - state = 'query'; - } else if ('#' == c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = base._query; - this._fragment = '#'; - this._username = base._username; - this._password = base._password; - state = 'fragment'; - } else { - var nextC = input[cursor+1] - var nextNextC = input[cursor+2] - if ( - 'file' != this._scheme || !ALPHA.test(c) || - (nextC != ':' && nextC != '|') || - (EOF != nextNextC && '/' != nextNextC && '\\' != nextNextC && '?' != nextNextC && '#' != nextNextC)) { - this._host = base._host; - this._port = base._port; - this._username = base._username; - this._password = base._password; - this._path = base._path.slice(); - this._path.pop(); - } - state = 'relative path'; - continue; - } - break; - - case 'relative slash': - if ('/' == c || '\\' == c) { - if ('\\' == c) { - err('\\ is an invalid code point.'); - } - if ('file' == this._scheme) { - state = 'file host'; - } else { - state = 'authority ignore slashes'; - } - } else { - if ('file' != this._scheme) { - this._host = base._host; - this._port = base._port; - this._username = base._username; - this._password = base._password; - } - state = 'relative path'; - continue; - } - break; - - case 'authority first slash': - if ('/' == c) { - state = 'authority second slash'; - } else { - err("Expected '/', got: " + c); - state = 'authority ignore slashes'; - continue; - } - break; - - case 'authority second slash': - state = 'authority ignore slashes'; - if ('/' != c) { - err("Expected '/', got: " + c); - continue; - } - break; - - case 'authority ignore slashes': - if ('/' != c && '\\' != c) { - state = 'authority'; - continue; - } else { - err('Expected authority, got: ' + c); - } - break; - - case 'authority': - if ('@' == c) { - if (seenAt) { - err('@ already seen.'); - buffer += '%40'; - } - seenAt = true; - for (var i = 0; i < buffer.length; i++) { - var cp = buffer[i]; - if ('\t' == cp || '\n' == cp || '\r' == cp) { - err('Invalid whitespace in authority.'); - continue; - } - // XXX check URL code points - if (':' == cp && null === this._password) { - this._password = ''; - continue; - } - var tempC = percentEscape(cp); - (null !== this._password) ? this._password += tempC : this._username += tempC; - } - buffer = ''; - } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) { - cursor -= buffer.length; - buffer = ''; - state = 'host'; - continue; - } else { - buffer += c; - } - break; - - case 'file host': - if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) { - if (buffer.length == 2 && ALPHA.test(buffer[0]) && (buffer[1] == ':' || buffer[1] == '|')) { - state = 'relative path'; - } else if (buffer.length == 0) { - state = 'relative path start'; - } else { - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'relative path start'; - } - continue; - } else if ('\t' == c || '\n' == c || '\r' == c) { - err('Invalid whitespace in file host.'); - } else { - buffer += c; - } - break; - - case 'host': - case 'hostname': - if (':' == c && !seenBracket) { - // XXX host parsing - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'port'; - if ('hostname' == stateOverride) { - break loop; - } - } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) { - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'relative path start'; - if (stateOverride) { - break loop; - } - continue; - } else if ('\t' != c && '\n' != c && '\r' != c) { - if ('[' == c) { - seenBracket = true; - } else if (']' == c) { - seenBracket = false; - } - buffer += c; - } else { - err('Invalid code point in host/hostname: ' + c); - } - break; - - case 'port': - if (/[0-9]/.test(c)) { - buffer += c; - } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c || stateOverride) { - if ('' != buffer) { - var temp = parseInt(buffer, 10); - if (temp != relative[this._scheme]) { - this._port = temp + ''; - } - buffer = ''; - } - if (stateOverride) { - break loop; - } - state = 'relative path start'; - continue; - } else if ('\t' == c || '\n' == c || '\r' == c) { - err('Invalid code point in port: ' + c); - } else { - invalid.call(this); - } - break; - - case 'relative path start': - if ('\\' == c) - err("'\\' not allowed in path."); - state = 'relative path'; - if ('/' != c && '\\' != c) { - continue; - } - break; - - case 'relative path': - if (EOF == c || '/' == c || '\\' == c || (!stateOverride && ('?' == c || '#' == c))) { - if ('\\' == c) { - err('\\ not allowed in relative path.'); - } - var tmp; - if (tmp = relativePathDotMapping[buffer.toLowerCase()]) { - buffer = tmp; - } - if ('..' == buffer) { - this._path.pop(); - if ('/' != c && '\\' != c) { - this._path.push(''); - } - } else if ('.' == buffer && '/' != c && '\\' != c) { - this._path.push(''); - } else if ('.' != buffer) { - if ('file' == this._scheme && this._path.length == 0 && buffer.length == 2 && ALPHA.test(buffer[0]) && buffer[1] == '|') { - buffer = buffer[0] + ':'; - } - this._path.push(buffer); - } - buffer = ''; - if ('?' == c) { - this._query = '?'; - state = 'query'; - } else if ('#' == c) { - this._fragment = '#'; - state = 'fragment'; - } - } else if ('\t' != c && '\n' != c && '\r' != c) { - buffer += percentEscape(c); - } - break; - - case 'query': - if (!stateOverride && '#' == c) { - this._fragment = '#'; - state = 'fragment'; - } else if (EOF != c && '\t' != c && '\n' != c && '\r' != c) { - this._query += percentEscapeQuery(c); - } - break; - - case 'fragment': - if (EOF != c && '\t' != c && '\n' != c && '\r' != c) { - this._fragment += c; - } - break; - } - - cursor++; - } - } - - function clear() { - this._scheme = ''; - this._schemeData = ''; - this._username = ''; - this._password = null; - this._host = ''; - this._port = ''; - this._path = []; - this._query = ''; - this._fragment = ''; - this._isInvalid = false; - this._isRelative = false; - } - - // Does not process domain names or IP addresses. - // Does not handle encoding for the query parameter. - function jURL(url, base /* , encoding */) { - if (base !== undefined && !(base instanceof jURL)) - base = new jURL(String(base)); - - this._url = url; - clear.call(this); - - var input = url.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, ''); - // encoding = encoding || 'utf-8' - - parse.call(this, input, null, base); - } - - jURL.prototype = { - toString: function() { - return this.href; - }, - get href() { - if (this._isInvalid) - return this._url; - - var authority = ''; - if ('' != this._username || null != this._password) { - authority = this._username + - (null != this._password ? ':' + this._password : '') + '@'; - } - - return this.protocol + - (this._isRelative ? '//' + authority + this.host : '') + - this.pathname + this._query + this._fragment; - }, - set href(href) { - clear.call(this); - parse.call(this, href); - }, - - get protocol() { - return this._scheme + ':'; - }, - set protocol(protocol) { - if (this._isInvalid) - return; - parse.call(this, protocol + ':', 'scheme start'); - }, - - get host() { - return this._isInvalid ? '' : this._port ? - this._host + ':' + this._port : this._host; - }, - set host(host) { - if (this._isInvalid || !this._isRelative) - return; - parse.call(this, host, 'host'); - }, - - get hostname() { - return this._host; - }, - set hostname(hostname) { - if (this._isInvalid || !this._isRelative) - return; - parse.call(this, hostname, 'hostname'); - }, - - get port() { - return this._port; - }, - set port(port) { - if (this._isInvalid || !this._isRelative) - return; - parse.call(this, port, 'port'); - }, - - get pathname() { - return this._isInvalid ? '' : this._isRelative ? - '/' + this._path.join('/') : this._schemeData; - }, - set pathname(pathname) { - if (this._isInvalid || !this._isRelative) - return; - this._path = []; - parse.call(this, pathname, 'relative path start'); - }, - - get search() { - return this._isInvalid || !this._query || '?' == this._query ? - '' : this._query; - }, - set search(search) { - if (this._isInvalid || !this._isRelative) - return; - this._query = '?'; - if ('?' == search[0]) - search = search.slice(1); - parse.call(this, search, 'query'); - }, - - get hash() { - return this._isInvalid || !this._fragment || '#' == this._fragment ? - '' : this._fragment; - }, - set hash(hash) { - if (this._isInvalid) - return; - this._fragment = '#'; - if ('#' == hash[0]) - hash = hash.slice(1); - parse.call(this, hash, 'fragment'); - }, - - get origin() { - var host; - if (this._isInvalid || !this._scheme) { - return ''; - } - // javascript: Gecko returns String(""), WebKit/Blink String("null") - // Gecko throws error for "data://" - // data: Gecko returns "", Blink returns "data://", WebKit returns "null" - // Gecko returns String("") for file: mailto: - // WebKit/Blink returns String("SCHEME://") for file: mailto: - switch (this._scheme) { - case 'data': - case 'file': - case 'javascript': - case 'mailto': - return 'null'; - } - host = this.host; - if (!host) { - return ''; - } - return this._scheme + '://' + host; - } - }; - - // Copy over the static methods - var OriginalURL = scope.URL; - if (OriginalURL) { - jURL.createObjectURL = function(blob) { - // IE extension allows a second optional options argument. - // http://msdn.microsoft.com/en-us/library/ie/hh772302(v=vs.85).aspx - return OriginalURL.createObjectURL.apply(OriginalURL, arguments); - }; - jURL.revokeObjectURL = function(url) { - OriginalURL.revokeObjectURL(url); - }; - } - - scope.URL = jURL; - /* jshint ignore:end */ -})(globalScope); - - - - -var NetworkManager = (function NetworkManagerClosure() { - - var OK_RESPONSE = 200; - var PARTIAL_CONTENT_RESPONSE = 206; - - function NetworkManager(url, args) { - this.url = url; - args = args || {}; - this.isHttp = /^https?:/i.test(url); - this.httpHeaders = (this.isHttp && args.httpHeaders) || {}; - this.withCredentials = args.withCredentials || false; - this.getXhr = args.getXhr || - function NetworkManager_getXhr() { - return new XMLHttpRequest(); - }; - - this.currXhrId = 0; - this.pendingRequests = {}; - this.loadedRequests = {}; - } - - function getArrayBuffer(xhr) { - var data = xhr.response; - if (typeof data !== 'string') { - return data; - } - var length = data.length; - var array = new Uint8Array(length); - for (var i = 0; i < length; i++) { - array[i] = data.charCodeAt(i) & 0xFF; - } - return array.buffer; - } - - var supportsMozChunked = (function supportsMozChunkedClosure() { - try { - var x = new XMLHttpRequest(); - // Firefox 37- required .open() to be called before setting responseType. - // https://bugzilla.mozilla.org/show_bug.cgi?id=707484 - // Even though the URL is not visited, .open() could fail if the URL is - // blocked, e.g. via the connect-src CSP directive or the NoScript addon. - // When this error occurs, this feature detection method will mistakenly - // report that moz-chunked-arraybuffer is not supported in Firefox 37-. - x.open('GET', 'https://example.com'); - x.responseType = 'moz-chunked-arraybuffer'; - return x.responseType === 'moz-chunked-arraybuffer'; - } catch (e) { - return false; - } - })(); - - NetworkManager.prototype = { - requestRange: function NetworkManager_requestRange(begin, end, listeners) { - var args = { - begin: begin, - end: end - }; - for (var prop in listeners) { - args[prop] = listeners[prop]; - } - return this.request(args); - }, - - requestFull: function NetworkManager_requestFull(listeners) { - return this.request(listeners); - }, - - request: function NetworkManager_request(args) { - var xhr = this.getXhr(); - var xhrId = this.currXhrId++; - var pendingRequest = this.pendingRequests[xhrId] = { - xhr: xhr - }; - - xhr.open('GET', this.url); - xhr.withCredentials = this.withCredentials; - for (var property in this.httpHeaders) { - var value = this.httpHeaders[property]; - if (typeof value === 'undefined') { - continue; - } - xhr.setRequestHeader(property, value); - } - if (this.isHttp && 'begin' in args && 'end' in args) { - var rangeStr = args.begin + '-' + (args.end - 1); - xhr.setRequestHeader('Range', 'bytes=' + rangeStr); - pendingRequest.expectedStatus = 206; - } else { - pendingRequest.expectedStatus = 200; - } - - var useMozChunkedLoading = supportsMozChunked && !!args.onProgressiveData; - if (useMozChunkedLoading) { - xhr.responseType = 'moz-chunked-arraybuffer'; - pendingRequest.onProgressiveData = args.onProgressiveData; - pendingRequest.mozChunked = true; - } else { - xhr.responseType = 'arraybuffer'; - } - - if (args.onError) { - xhr.onerror = function(evt) { - args.onError(xhr.status); - }; - } - xhr.onreadystatechange = this.onStateChange.bind(this, xhrId); - xhr.onprogress = this.onProgress.bind(this, xhrId); - - pendingRequest.onHeadersReceived = args.onHeadersReceived; - pendingRequest.onDone = args.onDone; - pendingRequest.onError = args.onError; - pendingRequest.onProgress = args.onProgress; - - xhr.send(null); - - return xhrId; - }, - - onProgress: function NetworkManager_onProgress(xhrId, evt) { - var pendingRequest = this.pendingRequests[xhrId]; - if (!pendingRequest) { - // Maybe abortRequest was called... - return; - } - - if (pendingRequest.mozChunked) { - var chunk = getArrayBuffer(pendingRequest.xhr); - pendingRequest.onProgressiveData(chunk); - } - - var onProgress = pendingRequest.onProgress; - if (onProgress) { - onProgress(evt); - } - }, - - onStateChange: function NetworkManager_onStateChange(xhrId, evt) { - var pendingRequest = this.pendingRequests[xhrId]; - if (!pendingRequest) { - // Maybe abortRequest was called... - return; - } - - var xhr = pendingRequest.xhr; - if (xhr.readyState >= 2 && pendingRequest.onHeadersReceived) { - pendingRequest.onHeadersReceived(); - delete pendingRequest.onHeadersReceived; - } - - if (xhr.readyState !== 4) { - return; - } - - if (!(xhrId in this.pendingRequests)) { - // The XHR request might have been aborted in onHeadersReceived() - // callback, in which case we should abort request - return; - } - - delete this.pendingRequests[xhrId]; - - // success status == 0 can be on ftp, file and other protocols - if (xhr.status === 0 && this.isHttp) { - if (pendingRequest.onError) { - pendingRequest.onError(xhr.status); - } - return; - } - var xhrStatus = xhr.status || OK_RESPONSE; - - // From http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.2: - // "A server MAY ignore the Range header". This means it's possible to - // get a 200 rather than a 206 response from a range request. - var ok_response_on_range_request = - xhrStatus === OK_RESPONSE && - pendingRequest.expectedStatus === PARTIAL_CONTENT_RESPONSE; - - if (!ok_response_on_range_request && - xhrStatus !== pendingRequest.expectedStatus) { - if (pendingRequest.onError) { - pendingRequest.onError(xhr.status); - } - return; - } - - this.loadedRequests[xhrId] = true; - - var chunk = getArrayBuffer(xhr); - if (xhrStatus === PARTIAL_CONTENT_RESPONSE) { - var rangeHeader = xhr.getResponseHeader('Content-Range'); - var matches = /bytes (\d+)-(\d+)\/(\d+)/.exec(rangeHeader); - var begin = parseInt(matches[1], 10); - pendingRequest.onDone({ - begin: begin, - chunk: chunk - }); - } else if (pendingRequest.onProgressiveData) { - pendingRequest.onDone(null); - } else if (chunk) { - pendingRequest.onDone({ - begin: 0, - chunk: chunk - }); - } else if (pendingRequest.onError) { - pendingRequest.onError(xhr.status); - } - }, - - hasPendingRequests: function NetworkManager_hasPendingRequests() { - for (var xhrId in this.pendingRequests) { - return true; - } - return false; - }, - - getRequestXhr: function NetworkManager_getXhr(xhrId) { - return this.pendingRequests[xhrId].xhr; - }, - - isStreamingRequest: function NetworkManager_isStreamingRequest(xhrId) { - return !!(this.pendingRequests[xhrId].onProgressiveData); - }, - - isPendingRequest: function NetworkManager_isPendingRequest(xhrId) { - return xhrId in this.pendingRequests; - }, - - isLoadedRequest: function NetworkManager_isLoadedRequest(xhrId) { - return xhrId in this.loadedRequests; - }, - - abortAllRequests: function NetworkManager_abortAllRequests() { - for (var xhrId in this.pendingRequests) { - this.abortRequest(xhrId | 0); - } - }, - - abortRequest: function NetworkManager_abortRequest(xhrId) { - var xhr = this.pendingRequests[xhrId].xhr; - delete this.pendingRequests[xhrId]; - xhr.abort(); - } - }; - - return NetworkManager; -})(); - - -var ChunkedStream = (function ChunkedStreamClosure() { - function ChunkedStream(length, chunkSize, manager) { - this.bytes = new Uint8Array(length); - this.start = 0; - this.pos = 0; - this.end = length; - this.chunkSize = chunkSize; - this.loadedChunks = []; - this.numChunksLoaded = 0; - this.numChunks = Math.ceil(length / chunkSize); - this.manager = manager; - this.progressiveDataLength = 0; - this.lastSuccessfulEnsureByteChunk = -1; // a single-entry cache - } - - // required methods for a stream. if a particular stream does not - // implement these, an error should be thrown - ChunkedStream.prototype = { - - getMissingChunks: function ChunkedStream_getMissingChunks() { - var chunks = []; - for (var chunk = 0, n = this.numChunks; chunk < n; ++chunk) { - if (!this.loadedChunks[chunk]) { - chunks.push(chunk); - } - } - return chunks; - }, - - getBaseStreams: function ChunkedStream_getBaseStreams() { - return [this]; - }, - - allChunksLoaded: function ChunkedStream_allChunksLoaded() { - return this.numChunksLoaded === this.numChunks; - }, - - onReceiveData: function ChunkedStream_onReceiveData(begin, chunk) { - var end = begin + chunk.byteLength; - - assert(begin % this.chunkSize === 0, 'Bad begin offset: ' + begin); - // Using this.length is inaccurate here since this.start can be moved - // See ChunkedStream.moveStart() - var length = this.bytes.length; - assert(end % this.chunkSize === 0 || end === length, - 'Bad end offset: ' + end); - - this.bytes.set(new Uint8Array(chunk), begin); - var chunkSize = this.chunkSize; - var beginChunk = Math.floor(begin / chunkSize); - var endChunk = Math.floor((end - 1) / chunkSize) + 1; - var curChunk; - - for (curChunk = beginChunk; curChunk < endChunk; ++curChunk) { - if (!this.loadedChunks[curChunk]) { - this.loadedChunks[curChunk] = true; - ++this.numChunksLoaded; - } - } - }, - - onReceiveProgressiveData: - function ChunkedStream_onReceiveProgressiveData(data) { - var position = this.progressiveDataLength; - var beginChunk = Math.floor(position / this.chunkSize); - - this.bytes.set(new Uint8Array(data), position); - position += data.byteLength; - this.progressiveDataLength = position; - var endChunk = position >= this.end ? this.numChunks : - Math.floor(position / this.chunkSize); - var curChunk; - for (curChunk = beginChunk; curChunk < endChunk; ++curChunk) { - if (!this.loadedChunks[curChunk]) { - this.loadedChunks[curChunk] = true; - ++this.numChunksLoaded; - } - } - }, - - ensureByte: function ChunkedStream_ensureByte(pos) { - var chunk = Math.floor(pos / this.chunkSize); - if (chunk === this.lastSuccessfulEnsureByteChunk) { - return; - } - - if (!this.loadedChunks[chunk]) { - throw new MissingDataException(pos, pos + 1); - } - this.lastSuccessfulEnsureByteChunk = chunk; - }, - - ensureRange: function ChunkedStream_ensureRange(begin, end) { - if (begin >= end) { - return; - } - - if (end <= this.progressiveDataLength) { - return; - } - - var chunkSize = this.chunkSize; - var beginChunk = Math.floor(begin / chunkSize); - var endChunk = Math.floor((end - 1) / chunkSize) + 1; - for (var chunk = beginChunk; chunk < endChunk; ++chunk) { - if (!this.loadedChunks[chunk]) { - throw new MissingDataException(begin, end); - } - } - }, - - nextEmptyChunk: function ChunkedStream_nextEmptyChunk(beginChunk) { - var chunk, numChunks = this.numChunks; - for (var i = 0; i < numChunks; ++i) { - chunk = (beginChunk + i) % numChunks; // Wrap around to beginning - if (!this.loadedChunks[chunk]) { - return chunk; - } - } - return null; - }, - - hasChunk: function ChunkedStream_hasChunk(chunk) { - return !!this.loadedChunks[chunk]; - }, - - get length() { - return this.end - this.start; - }, - - get isEmpty() { - return this.length === 0; - }, - - getByte: function ChunkedStream_getByte() { - var pos = this.pos; - if (pos >= this.end) { - return -1; - } - this.ensureByte(pos); - return this.bytes[this.pos++]; - }, - - getUint16: function ChunkedStream_getUint16() { - var b0 = this.getByte(); - var b1 = this.getByte(); - if (b0 === -1 || b1 === -1) { - return -1; - } - return (b0 << 8) + b1; - }, - - getInt32: function ChunkedStream_getInt32() { - var b0 = this.getByte(); - var b1 = this.getByte(); - var b2 = this.getByte(); - var b3 = this.getByte(); - return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; - }, - - // returns subarray of original buffer - // should only be read - getBytes: function ChunkedStream_getBytes(length) { - var bytes = this.bytes; - var pos = this.pos; - var strEnd = this.end; - - if (!length) { - this.ensureRange(pos, strEnd); - return bytes.subarray(pos, strEnd); - } - - var end = pos + length; - if (end > strEnd) { - end = strEnd; - } - this.ensureRange(pos, end); - - this.pos = end; - return bytes.subarray(pos, end); - }, - - peekByte: function ChunkedStream_peekByte() { - var peekedByte = this.getByte(); - this.pos--; - return peekedByte; - }, - - peekBytes: function ChunkedStream_peekBytes(length) { - var bytes = this.getBytes(length); - this.pos -= bytes.length; - return bytes; - }, - - getByteRange: function ChunkedStream_getBytes(begin, end) { - this.ensureRange(begin, end); - return this.bytes.subarray(begin, end); - }, - - skip: function ChunkedStream_skip(n) { - if (!n) { - n = 1; - } - this.pos += n; - }, - - reset: function ChunkedStream_reset() { - this.pos = this.start; - }, - - moveStart: function ChunkedStream_moveStart() { - this.start = this.pos; - }, - - makeSubStream: function ChunkedStream_makeSubStream(start, length, dict) { - this.ensureRange(start, start + length); - - function ChunkedStreamSubstream() {} - ChunkedStreamSubstream.prototype = Object.create(this); - ChunkedStreamSubstream.prototype.getMissingChunks = function() { - var chunkSize = this.chunkSize; - var beginChunk = Math.floor(this.start / chunkSize); - var endChunk = Math.floor((this.end - 1) / chunkSize) + 1; - var missingChunks = []; - for (var chunk = beginChunk; chunk < endChunk; ++chunk) { - if (!this.loadedChunks[chunk]) { - missingChunks.push(chunk); - } - } - return missingChunks; - }; - var subStream = new ChunkedStreamSubstream(); - subStream.pos = subStream.start = start; - subStream.end = start + length || this.end; - subStream.dict = dict; - return subStream; - }, - - isStream: true - }; - - return ChunkedStream; -})(); - -var ChunkedStreamManager = (function ChunkedStreamManagerClosure() { - - function ChunkedStreamManager(length, chunkSize, url, args) { - this.stream = new ChunkedStream(length, chunkSize, this); - this.length = length; - this.chunkSize = chunkSize; - this.url = url; - this.disableAutoFetch = args.disableAutoFetch; - var msgHandler = this.msgHandler = args.msgHandler; - - if (args.chunkedViewerLoading) { - msgHandler.on('OnDataRange', this.onReceiveData.bind(this)); - msgHandler.on('OnDataProgress', this.onProgress.bind(this)); - this.sendRequest = function ChunkedStreamManager_sendRequest(begin, end) { - msgHandler.send('RequestDataRange', { begin: begin, end: end }); - }; - } else { - - var getXhr = function getXhr() { - return new XMLHttpRequest(); - }; - this.networkManager = new NetworkManager(this.url, { - getXhr: getXhr, - httpHeaders: args.httpHeaders, - withCredentials: args.withCredentials - }); - this.sendRequest = function ChunkedStreamManager_sendRequest(begin, end) { - this.networkManager.requestRange(begin, end, { - onDone: this.onReceiveData.bind(this), - onProgress: this.onProgress.bind(this) - }); - }; - } - - this.currRequestId = 0; - - this.chunksNeededByRequest = {}; - this.requestsByChunk = {}; - this.promisesByRequest = {}; - this.progressiveDataLength = 0; - - this._loadedStreamCapability = createPromiseCapability(); - - if (args.initialData) { - this.onReceiveData({chunk: args.initialData}); - } - } - - ChunkedStreamManager.prototype = { - onLoadedStream: function ChunkedStreamManager_getLoadedStream() { - return this._loadedStreamCapability.promise; - }, - - // Get all the chunks that are not yet loaded and groups them into - // contiguous ranges to load in as few requests as possible - requestAllChunks: function ChunkedStreamManager_requestAllChunks() { - var missingChunks = this.stream.getMissingChunks(); - this._requestChunks(missingChunks); - return this._loadedStreamCapability.promise; - }, - - _requestChunks: function ChunkedStreamManager_requestChunks(chunks) { - var requestId = this.currRequestId++; - - var chunksNeeded; - var i, ii; - this.chunksNeededByRequest[requestId] = chunksNeeded = {}; - for (i = 0, ii = chunks.length; i < ii; i++) { - if (!this.stream.hasChunk(chunks[i])) { - chunksNeeded[chunks[i]] = true; - } - } - - if (isEmptyObj(chunksNeeded)) { - return Promise.resolve(); - } - - var capability = createPromiseCapability(); - this.promisesByRequest[requestId] = capability; - - var chunksToRequest = []; - for (var chunk in chunksNeeded) { - chunk = chunk | 0; - if (!(chunk in this.requestsByChunk)) { - this.requestsByChunk[chunk] = []; - chunksToRequest.push(chunk); - } - this.requestsByChunk[chunk].push(requestId); - } - - if (!chunksToRequest.length) { - return capability.promise; - } - - var groupedChunksToRequest = this.groupChunks(chunksToRequest); - - for (i = 0; i < groupedChunksToRequest.length; ++i) { - var groupedChunk = groupedChunksToRequest[i]; - var begin = groupedChunk.beginChunk * this.chunkSize; - var end = Math.min(groupedChunk.endChunk * this.chunkSize, this.length); - this.sendRequest(begin, end); - } - - return capability.promise; - }, - - getStream: function ChunkedStreamManager_getStream() { - return this.stream; - }, - - // Loads any chunks in the requested range that are not yet loaded - requestRange: function ChunkedStreamManager_requestRange(begin, end) { - - end = Math.min(end, this.length); - - var beginChunk = this.getBeginChunk(begin); - var endChunk = this.getEndChunk(end); - - var chunks = []; - for (var chunk = beginChunk; chunk < endChunk; ++chunk) { - chunks.push(chunk); - } - - return this._requestChunks(chunks); - }, - - requestRanges: function ChunkedStreamManager_requestRanges(ranges) { - ranges = ranges || []; - var chunksToRequest = []; - - for (var i = 0; i < ranges.length; i++) { - var beginChunk = this.getBeginChunk(ranges[i].begin); - var endChunk = this.getEndChunk(ranges[i].end); - for (var chunk = beginChunk; chunk < endChunk; ++chunk) { - if (chunksToRequest.indexOf(chunk) < 0) { - chunksToRequest.push(chunk); - } - } - } - - chunksToRequest.sort(function(a, b) { return a - b; }); - return this._requestChunks(chunksToRequest); - }, - - // Groups a sorted array of chunks into as few contiguous larger - // chunks as possible - groupChunks: function ChunkedStreamManager_groupChunks(chunks) { - var groupedChunks = []; - var beginChunk = -1; - var prevChunk = -1; - for (var i = 0; i < chunks.length; ++i) { - var chunk = chunks[i]; - - if (beginChunk < 0) { - beginChunk = chunk; - } - - if (prevChunk >= 0 && prevChunk + 1 !== chunk) { - groupedChunks.push({ beginChunk: beginChunk, - endChunk: prevChunk + 1 }); - beginChunk = chunk; - } - if (i + 1 === chunks.length) { - groupedChunks.push({ beginChunk: beginChunk, - endChunk: chunk + 1 }); - } - - prevChunk = chunk; - } - return groupedChunks; - }, - - onProgress: function ChunkedStreamManager_onProgress(args) { - var bytesLoaded = (this.stream.numChunksLoaded * this.chunkSize + - args.loaded); - this.msgHandler.send('DocProgress', { - loaded: bytesLoaded, - total: this.length - }); - }, - - onReceiveData: function ChunkedStreamManager_onReceiveData(args) { - var chunk = args.chunk; - var isProgressive = args.begin === undefined; - var begin = isProgressive ? this.progressiveDataLength : args.begin; - var end = begin + chunk.byteLength; - - var beginChunk = Math.floor(begin / this.chunkSize); - var endChunk = end < this.length ? Math.floor(end / this.chunkSize) : - Math.ceil(end / this.chunkSize); - - if (isProgressive) { - this.stream.onReceiveProgressiveData(chunk); - this.progressiveDataLength = end; - } else { - this.stream.onReceiveData(begin, chunk); - } - - if (this.stream.allChunksLoaded()) { - this._loadedStreamCapability.resolve(this.stream); - } - - var loadedRequests = []; - var i, requestId; - for (chunk = beginChunk; chunk < endChunk; ++chunk) { - // The server might return more chunks than requested - var requestIds = this.requestsByChunk[chunk] || []; - delete this.requestsByChunk[chunk]; - - for (i = 0; i < requestIds.length; ++i) { - requestId = requestIds[i]; - var chunksNeeded = this.chunksNeededByRequest[requestId]; - if (chunk in chunksNeeded) { - delete chunksNeeded[chunk]; - } - - if (!isEmptyObj(chunksNeeded)) { - continue; - } - - loadedRequests.push(requestId); - } - } - - // If there are no pending requests, automatically fetch the next - // unfetched chunk of the PDF - if (!this.disableAutoFetch && isEmptyObj(this.requestsByChunk)) { - var nextEmptyChunk; - if (this.stream.numChunksLoaded === 1) { - // This is a special optimization so that after fetching the first - // chunk, rather than fetching the second chunk, we fetch the last - // chunk. - var lastChunk = this.stream.numChunks - 1; - if (!this.stream.hasChunk(lastChunk)) { - nextEmptyChunk = lastChunk; - } - } else { - nextEmptyChunk = this.stream.nextEmptyChunk(endChunk); - } - if (isInt(nextEmptyChunk)) { - this._requestChunks([nextEmptyChunk]); - } - } - - for (i = 0; i < loadedRequests.length; ++i) { - requestId = loadedRequests[i]; - var capability = this.promisesByRequest[requestId]; - delete this.promisesByRequest[requestId]; - capability.resolve(); - } - - this.msgHandler.send('DocProgress', { - loaded: this.stream.numChunksLoaded * this.chunkSize, - total: this.length - }); - }, - - onError: function ChunkedStreamManager_onError(err) { - this._loadedStreamCapability.reject(err); - }, - - getBeginChunk: function ChunkedStreamManager_getBeginChunk(begin) { - var chunk = Math.floor(begin / this.chunkSize); - return chunk; - }, - - getEndChunk: function ChunkedStreamManager_getEndChunk(end) { - var chunk = Math.floor((end - 1) / this.chunkSize) + 1; - return chunk; - }, - - abort: function ChunkedStreamManager_abort() { - if (this.networkManager) { - this.networkManager.abortAllRequests(); - } - for(var requestId in this.promisesByRequest) { - var capability = this.promisesByRequest[requestId]; - capability.reject(new Error('Request was aborted')); - } - } - }; - - return ChunkedStreamManager; -})(); - - -var BasePdfManager = (function BasePdfManagerClosure() { - function BasePdfManager() { - throw new Error('Cannot initialize BaseManagerManager'); - } - - BasePdfManager.prototype = { - get docId() { - return this._docId; - }, - - onLoadedStream: function BasePdfManager_onLoadedStream() { - throw new NotImplementedException(); - }, - - ensureDoc: function BasePdfManager_ensureDoc(prop, args) { - return this.ensure(this.pdfDocument, prop, args); - }, - - ensureXRef: function BasePdfManager_ensureXRef(prop, args) { - return this.ensure(this.pdfDocument.xref, prop, args); - }, - - ensureCatalog: function BasePdfManager_ensureCatalog(prop, args) { - return this.ensure(this.pdfDocument.catalog, prop, args); - }, - - getPage: function BasePdfManager_getPage(pageIndex) { - return this.pdfDocument.getPage(pageIndex); - }, - - cleanup: function BasePdfManager_cleanup() { - return this.pdfDocument.cleanup(); - }, - - ensure: function BasePdfManager_ensure(obj, prop, args) { - return new NotImplementedException(); - }, - - requestRange: function BasePdfManager_requestRange(begin, end) { - return new NotImplementedException(); - }, - - requestLoadedStream: function BasePdfManager_requestLoadedStream() { - return new NotImplementedException(); - }, - - sendProgressiveData: function BasePdfManager_sendProgressiveData(chunk) { - return new NotImplementedException(); - }, - - updatePassword: function BasePdfManager_updatePassword(password) { - this.pdfDocument.xref.password = this.password = password; - if (this._passwordChangedCapability) { - this._passwordChangedCapability.resolve(); - } - }, - - passwordChanged: function BasePdfManager_passwordChanged() { - this._passwordChangedCapability = createPromiseCapability(); - return this._passwordChangedCapability.promise; - }, - - terminate: function BasePdfManager_terminate() { - return new NotImplementedException(); - } - }; - - return BasePdfManager; -})(); - -var LocalPdfManager = (function LocalPdfManagerClosure() { - function LocalPdfManager(docId, data, password) { - this._docId = docId; - var stream = new Stream(data); - this.pdfDocument = new PDFDocument(this, stream, password); - this._loadedStreamCapability = createPromiseCapability(); - this._loadedStreamCapability.resolve(stream); - } - - Util.inherit(LocalPdfManager, BasePdfManager, { - ensure: function LocalPdfManager_ensure(obj, prop, args) { - return new Promise(function (resolve, reject) { - try { - var value = obj[prop]; - var result; - if (typeof value === 'function') { - result = value.apply(obj, args); - } else { - result = value; - } - resolve(result); - } catch (e) { - reject(e); - } - }); - }, - - requestRange: function LocalPdfManager_requestRange(begin, end) { - return Promise.resolve(); - }, - - requestLoadedStream: function LocalPdfManager_requestLoadedStream() { - return; - }, - - onLoadedStream: function LocalPdfManager_onLoadedStream() { - return this._loadedStreamCapability.promise; - }, - - terminate: function LocalPdfManager_terminate() { - return; - } - }); - - return LocalPdfManager; -})(); - -var NetworkPdfManager = (function NetworkPdfManagerClosure() { - function NetworkPdfManager(docId, args, msgHandler) { - this._docId = docId; - this.msgHandler = msgHandler; - - var params = { - msgHandler: msgHandler, - httpHeaders: args.httpHeaders, - withCredentials: args.withCredentials, - chunkedViewerLoading: args.chunkedViewerLoading, - disableAutoFetch: args.disableAutoFetch, - initialData: args.initialData - }; - this.streamManager = new ChunkedStreamManager(args.length, - args.rangeChunkSize, - args.url, params); - this.pdfDocument = new PDFDocument(this, this.streamManager.getStream(), - args.password); - } - - Util.inherit(NetworkPdfManager, BasePdfManager, { - ensure: function NetworkPdfManager_ensure(obj, prop, args) { - var pdfManager = this; - - return new Promise(function (resolve, reject) { - function ensureHelper() { - try { - var result; - var value = obj[prop]; - if (typeof value === 'function') { - result = value.apply(obj, args); - } else { - result = value; - } - resolve(result); - } catch(e) { - if (!(e instanceof MissingDataException)) { - reject(e); - return; - } - pdfManager.streamManager.requestRange(e.begin, e.end). - then(ensureHelper, reject); - } - } - - ensureHelper(); - }); - }, - - requestRange: function NetworkPdfManager_requestRange(begin, end) { - return this.streamManager.requestRange(begin, end); - }, - - requestLoadedStream: function NetworkPdfManager_requestLoadedStream() { - this.streamManager.requestAllChunks(); - }, - - sendProgressiveData: - function NetworkPdfManager_sendProgressiveData(chunk) { - this.streamManager.onReceiveData({ chunk: chunk }); - }, - - onLoadedStream: function NetworkPdfManager_onLoadedStream() { - return this.streamManager.onLoadedStream(); - }, - - terminate: function NetworkPdfManager_terminate() { - this.streamManager.abort(); - } - }); - - return NetworkPdfManager; -})(); - - -var Page = (function PageClosure() { - - var LETTER_SIZE_MEDIABOX = [0, 0, 612, 792]; - - function Page(pdfManager, xref, pageIndex, pageDict, ref, fontCache) { - this.pdfManager = pdfManager; - this.pageIndex = pageIndex; - this.pageDict = pageDict; - this.xref = xref; - this.ref = ref; - this.fontCache = fontCache; - this.idCounters = { - obj: 0 - }; - this.resourcesPromise = null; - } - - Page.prototype = { - getPageProp: function Page_getPageProp(key) { - return this.pageDict.get(key); - }, - - getInheritedPageProp: function Page_getInheritedPageProp(key) { - var dict = this.pageDict, valueArray = null, loopCount = 0; - var MAX_LOOP_COUNT = 100; - // Always walk up the entire parent chain, to be able to find - // e.g. \Resources placed on multiple levels of the tree. - while (dict) { - var value = dict.get(key); - if (value) { - if (!valueArray) { - valueArray = []; - } - valueArray.push(value); - } - if (++loopCount > MAX_LOOP_COUNT) { - warn('Page_getInheritedPageProp: maximum loop count exceeded.'); - break; - } - dict = dict.get('Parent'); - } - if (!valueArray) { - return Dict.empty; - } - if (valueArray.length === 1 || !isDict(valueArray[0]) || - loopCount > MAX_LOOP_COUNT) { - return valueArray[0]; - } - return Dict.merge(this.xref, valueArray); - }, - - get content() { - return this.getPageProp('Contents'); - }, - - get resources() { - // For robustness: The spec states that a \Resources entry has to be - // present, but can be empty. Some document omit it still, in this case - // we return an empty dictionary. - return shadow(this, 'resources', this.getInheritedPageProp('Resources')); - }, - - get mediaBox() { - var obj = this.getInheritedPageProp('MediaBox'); - // Reset invalid media box to letter size. - if (!isArray(obj) || obj.length !== 4) { - obj = LETTER_SIZE_MEDIABOX; - } - return shadow(this, 'mediaBox', obj); - }, - - get view() { - var mediaBox = this.mediaBox; - var cropBox = this.getInheritedPageProp('CropBox'); - if (!isArray(cropBox) || cropBox.length !== 4) { - return shadow(this, 'view', mediaBox); - } - - // From the spec, 6th ed., p.963: - // "The crop, bleed, trim, and art boxes should not ordinarily - // extend beyond the boundaries of the media box. If they do, they are - // effectively reduced to their intersection with the media box." - cropBox = Util.intersect(cropBox, mediaBox); - if (!cropBox) { - return shadow(this, 'view', mediaBox); - } - return shadow(this, 'view', cropBox); - }, - - get rotate() { - var rotate = this.getInheritedPageProp('Rotate') || 0; - // Normalize rotation so it's a multiple of 90 and between 0 and 270 - if (rotate % 90 !== 0) { - rotate = 0; - } else if (rotate >= 360) { - rotate = rotate % 360; - } else if (rotate < 0) { - // The spec doesn't cover negatives, assume its counterclockwise - // rotation. The following is the other implementation of modulo. - rotate = ((rotate % 360) + 360) % 360; - } - return shadow(this, 'rotate', rotate); - }, - - getContentStream: function Page_getContentStream() { - var content = this.content; - var stream; - if (isArray(content)) { - // fetching items - var xref = this.xref; - var i, n = content.length; - var streams = []; - for (i = 0; i < n; ++i) { - streams.push(xref.fetchIfRef(content[i])); - } - stream = new StreamsSequenceStream(streams); - } else if (isStream(content)) { - stream = content; - } else { - // replacing non-existent page content with empty one - stream = new NullStream(); - } - return stream; - }, - - loadResources: function Page_loadResources(keys) { - if (!this.resourcesPromise) { - // TODO: add async getInheritedPageProp and remove this. - this.resourcesPromise = this.pdfManager.ensure(this, 'resources'); - } - return this.resourcesPromise.then(function resourceSuccess() { - var objectLoader = new ObjectLoader(this.resources.map, - keys, - this.xref); - return objectLoader.load(); - }.bind(this)); - }, - - getOperatorList: function Page_getOperatorList(handler, task, intent) { - var self = this; - - var pdfManager = this.pdfManager; - var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', - []); - var resourcesPromise = this.loadResources([ - 'ExtGState', - 'ColorSpace', - 'Pattern', - 'Shading', - 'XObject', - 'Font' - // ProcSet - // Properties - ]); - - var partialEvaluator = new PartialEvaluator(pdfManager, this.xref, - handler, this.pageIndex, - 'p' + this.pageIndex + '_', - this.idCounters, - this.fontCache); - - var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]); - var pageListPromise = dataPromises.then(function(data) { - var contentStream = data[0]; - var opList = new OperatorList(intent, handler, self.pageIndex); - - handler.send('StartRenderPage', { - transparency: partialEvaluator.hasBlendModes(self.resources), - pageIndex: self.pageIndex, - intent: intent - }); - return partialEvaluator.getOperatorList(contentStream, task, - self.resources, opList).then(function () { - return opList; - }); - }); - - var annotationsPromise = pdfManager.ensure(this, 'annotations'); - return Promise.all([pageListPromise, annotationsPromise]).then( - function(datas) { - var pageOpList = datas[0]; - var annotations = datas[1]; - - if (annotations.length === 0) { - pageOpList.flush(true); - return pageOpList; - } - - var annotationsReadyPromise = Annotation.appendToOperatorList( - annotations, pageOpList, partialEvaluator, task, intent); - return annotationsReadyPromise.then(function () { - pageOpList.flush(true); - return pageOpList; - }); - }); - }, - - extractTextContent: function Page_extractTextContent(task, - normalizeWhitespace) { - var handler = { - on: function nullHandlerOn() {}, - send: function nullHandlerSend() {} - }; - - var self = this; - - var pdfManager = this.pdfManager; - var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', - []); - - var resourcesPromise = this.loadResources([ - 'ExtGState', - 'XObject', - 'Font' - ]); - - var dataPromises = Promise.all([contentStreamPromise, - resourcesPromise]); - return dataPromises.then(function(data) { - var contentStream = data[0]; - var partialEvaluator = new PartialEvaluator(pdfManager, self.xref, - handler, self.pageIndex, - 'p' + self.pageIndex + '_', - self.idCounters, - self.fontCache); - - return partialEvaluator.getTextContent(contentStream, - task, - self.resources, - /* stateManager = */ null, - normalizeWhitespace); - }); - }, - - getAnnotationsData: function Page_getAnnotationsData(intent) { - var annotations = this.annotations; - var annotationsData = []; - for (var i = 0, n = annotations.length; i < n; ++i) { - if (intent) { - if (!(intent === 'display' && annotations[i].viewable) && - !(intent === 'print' && annotations[i].printable)) { - continue; - } - } - annotationsData.push(annotations[i].data); - } - return annotationsData; - }, - - get annotations() { - var annotations = []; - var annotationRefs = this.getInheritedPageProp('Annots') || []; - var annotationFactory = new AnnotationFactory(); - for (var i = 0, n = annotationRefs.length; i < n; ++i) { - var annotationRef = annotationRefs[i]; - var annotation = annotationFactory.create(this.xref, annotationRef); - if (annotation) { - annotations.push(annotation); - } - } - return shadow(this, 'annotations', annotations); - } - }; - - return Page; -})(); - -/** - * The `PDFDocument` holds all the data of the PDF file. Compared to the - * `PDFDoc`, this one doesn't have any job management code. - * Right now there exists one PDFDocument on the main thread + one object - * for each worker. If there is no worker support enabled, there are two - * `PDFDocument` objects on the main thread created. - */ -var PDFDocument = (function PDFDocumentClosure() { - var FINGERPRINT_FIRST_BYTES = 1024; - var EMPTY_FINGERPRINT = '\x00\x00\x00\x00\x00\x00\x00' + - '\x00\x00\x00\x00\x00\x00\x00\x00\x00'; - - function PDFDocument(pdfManager, arg, password) { - if (isStream(arg)) { - init.call(this, pdfManager, arg, password); - } else if (isArrayBuffer(arg)) { - init.call(this, pdfManager, new Stream(arg), password); - } else { - error('PDFDocument: Unknown argument type'); - } - } - - function init(pdfManager, stream, password) { - assert(stream.length > 0, 'stream must have data'); - this.pdfManager = pdfManager; - this.stream = stream; - var xref = new XRef(this.stream, password, pdfManager); - this.xref = xref; - } - - function find(stream, needle, limit, backwards) { - var pos = stream.pos; - var end = stream.end; - var strBuf = []; - if (pos + limit > end) { - limit = end - pos; - } - for (var n = 0; n < limit; ++n) { - strBuf.push(String.fromCharCode(stream.getByte())); - } - var str = strBuf.join(''); - stream.pos = pos; - var index = backwards ? str.lastIndexOf(needle) : str.indexOf(needle); - if (index === -1) { - return false; /* not found */ - } - stream.pos += index; - return true; /* found */ - } - - var DocumentInfoValidators = { - get entries() { - // Lazily build this since all the validation functions below are not - // defined until after this file loads. - return shadow(this, 'entries', { - Title: isString, - Author: isString, - Subject: isString, - Keywords: isString, - Creator: isString, - Producer: isString, - CreationDate: isString, - ModDate: isString, - Trapped: isName - }); - } - }; - - PDFDocument.prototype = { - parse: function PDFDocument_parse(recoveryMode) { - this.setup(recoveryMode); - var version = this.catalog.catDict.get('Version'); - if (isName(version)) { - this.pdfFormatVersion = version.name; - } - try { - // checking if AcroForm is present - this.acroForm = this.catalog.catDict.get('AcroForm'); - if (this.acroForm) { - this.xfa = this.acroForm.get('XFA'); - var fields = this.acroForm.get('Fields'); - if ((!fields || !isArray(fields) || fields.length === 0) && - !this.xfa) { - // no fields and no XFA -- not a form (?) - this.acroForm = null; - } - } - } catch (ex) { - info('Something wrong with AcroForm entry'); - this.acroForm = null; - } - }, - - get linearization() { - var linearization = null; - if (this.stream.length) { - try { - linearization = Linearization.create(this.stream); - } catch (err) { - if (err instanceof MissingDataException) { - throw err; - } - info(err); - } - } - // shadow the prototype getter with a data property - return shadow(this, 'linearization', linearization); - }, - get startXRef() { - var stream = this.stream; - var startXRef = 0; - var linearization = this.linearization; - if (linearization) { - // Find end of first obj. - stream.reset(); - if (find(stream, 'endobj', 1024)) { - startXRef = stream.pos + 6; - } - } else { - // Find startxref by jumping backward from the end of the file. - var step = 1024; - var found = false, pos = stream.end; - while (!found && pos > 0) { - pos -= step - 'startxref'.length; - if (pos < 0) { - pos = 0; - } - stream.pos = pos; - found = find(stream, 'startxref', step, true); - } - if (found) { - stream.skip(9); - var ch; - do { - ch = stream.getByte(); - } while (Lexer.isSpace(ch)); - var str = ''; - while (ch >= 0x20 && ch <= 0x39) { // < '9' - str += String.fromCharCode(ch); - ch = stream.getByte(); - } - startXRef = parseInt(str, 10); - if (isNaN(startXRef)) { - startXRef = 0; - } - } - } - // shadow the prototype getter with a data property - return shadow(this, 'startXRef', startXRef); - }, - get mainXRefEntriesOffset() { - var mainXRefEntriesOffset = 0; - var linearization = this.linearization; - if (linearization) { - mainXRefEntriesOffset = linearization.mainXRefEntriesOffset; - } - // shadow the prototype getter with a data property - return shadow(this, 'mainXRefEntriesOffset', mainXRefEntriesOffset); - }, - // Find the header, remove leading garbage and setup the stream - // starting from the header. - checkHeader: function PDFDocument_checkHeader() { - var stream = this.stream; - stream.reset(); - if (find(stream, '%PDF-', 1024)) { - // Found the header, trim off any garbage before it. - stream.moveStart(); - // Reading file format version - var MAX_VERSION_LENGTH = 12; - var version = '', ch; - while ((ch = stream.getByte()) > 0x20) { // SPACE - if (version.length >= MAX_VERSION_LENGTH) { - break; - } - version += String.fromCharCode(ch); - } - if (!this.pdfFormatVersion) { - // removing "%PDF-"-prefix - this.pdfFormatVersion = version.substring(5); - } - return; - } - // May not be a PDF file, continue anyway. - }, - parseStartXRef: function PDFDocument_parseStartXRef() { - var startXRef = this.startXRef; - this.xref.setStartXRef(startXRef); - }, - setup: function PDFDocument_setup(recoveryMode) { - this.xref.parse(recoveryMode); - this.catalog = new Catalog(this.pdfManager, this.xref); - }, - get numPages() { - var linearization = this.linearization; - var num = linearization ? linearization.numPages : this.catalog.numPages; - // shadow the prototype getter - return shadow(this, 'numPages', num); - }, - get documentInfo() { - var docInfo = { - PDFFormatVersion: this.pdfFormatVersion, - IsAcroFormPresent: !!this.acroForm, - IsXFAPresent: !!this.xfa - }; - var infoDict; - try { - infoDict = this.xref.trailer.get('Info'); - } catch (err) { - info('The document information dictionary is invalid.'); - } - if (infoDict) { - var validEntries = DocumentInfoValidators.entries; - // Only fill the document info with valid entries from the spec. - for (var key in validEntries) { - if (infoDict.has(key)) { - var value = infoDict.get(key); - // Make sure the value conforms to the spec. - if (validEntries[key](value)) { - docInfo[key] = (typeof value !== 'string' ? - value : stringToPDFString(value)); - } else { - info('Bad value in document info for "' + key + '"'); - } - } - } - } - return shadow(this, 'documentInfo', docInfo); - }, - get fingerprint() { - var xref = this.xref, hash, fileID = ''; - var idArray = xref.trailer.get('ID'); - - if (idArray && isArray(idArray) && idArray[0] && isString(idArray[0]) && - idArray[0] !== EMPTY_FINGERPRINT) { - hash = stringToBytes(idArray[0]); - } else { - if (this.stream.ensureRange) { - this.stream.ensureRange(0, - Math.min(FINGERPRINT_FIRST_BYTES, this.stream.end)); - } - hash = calculateMD5(this.stream.bytes.subarray(0, - FINGERPRINT_FIRST_BYTES), 0, FINGERPRINT_FIRST_BYTES); - } - - for (var i = 0, n = hash.length; i < n; i++) { - var hex = hash[i].toString(16); - fileID += hex.length === 1 ? '0' + hex : hex; - } - - return shadow(this, 'fingerprint', fileID); - }, - - getPage: function PDFDocument_getPage(pageIndex) { - return this.catalog.getPage(pageIndex); - }, - - cleanup: function PDFDocument_cleanup() { - return this.catalog.cleanup(); - } - }; - - return PDFDocument; -})(); - - -var Name = (function NameClosure() { - function Name(name) { - this.name = name; - } - - Name.prototype = {}; - - var nameCache = {}; - - Name.get = function Name_get(name) { - var nameValue = nameCache[name]; - return (nameValue ? nameValue : (nameCache[name] = new Name(name))); - }; - - return Name; -})(); - -var Cmd = (function CmdClosure() { - function Cmd(cmd) { - this.cmd = cmd; - } - - Cmd.prototype = {}; - - var cmdCache = {}; - - Cmd.get = function Cmd_get(cmd) { - var cmdValue = cmdCache[cmd]; - return (cmdValue ? cmdValue : (cmdCache[cmd] = new Cmd(cmd))); - }; - - return Cmd; -})(); - -var Dict = (function DictClosure() { - var nonSerializable = function nonSerializableClosure() { - return nonSerializable; // creating closure on some variable - }; - - var GETALL_DICTIONARY_TYPES_WHITELIST = { - 'Background': true, - 'ExtGState': true, - 'Halftone': true, - 'Layout': true, - 'Mask': true, - 'Pagination': true, - 'Printing': true - }; - - function isRecursionAllowedFor(dict) { - if (!isName(dict.Type)) { - return true; - } - var dictType = dict.Type.name; - return GETALL_DICTIONARY_TYPES_WHITELIST[dictType] === true; - } - - // xref is optional - function Dict(xref) { - // Map should only be used internally, use functions below to access. - this.map = Object.create(null); - this.xref = xref; - this.objId = null; - this.__nonSerializable__ = nonSerializable; // disable cloning of the Dict - } - - Dict.prototype = { - assignXref: function Dict_assignXref(newXref) { - this.xref = newXref; - }, - - // automatically dereferences Ref objects - get: function Dict_get(key1, key2, key3) { - var value; - var xref = this.xref; - if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map || - typeof key2 === 'undefined') { - return xref ? xref.fetchIfRef(value) : value; - } - if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map || - typeof key3 === 'undefined') { - return xref ? xref.fetchIfRef(value) : value; - } - value = this.map[key3] || null; - return xref ? xref.fetchIfRef(value) : value; - }, - - // Same as get(), but returns a promise and uses fetchIfRefAsync(). - getAsync: function Dict_getAsync(key1, key2, key3) { - var value; - var xref = this.xref; - if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map || - typeof key2 === 'undefined') { - if (xref) { - return xref.fetchIfRefAsync(value); - } - return Promise.resolve(value); - } - if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map || - typeof key3 === 'undefined') { - if (xref) { - return xref.fetchIfRefAsync(value); - } - return Promise.resolve(value); - } - value = this.map[key3] || null; - if (xref) { - return xref.fetchIfRefAsync(value); - } - return Promise.resolve(value); - }, - - // Same as get(), but dereferences all elements if the result is an Array. - getArray: function Dict_getArray(key1, key2, key3) { - var value = this.get(key1, key2, key3); - var xref = this.xref; - if (!isArray(value) || !xref) { - return value; - } - value = value.slice(); // Ensure that we don't modify the Dict data. - for (var i = 0, ii = value.length; i < ii; i++) { - if (!isRef(value[i])) { - continue; - } - value[i] = xref.fetch(value[i]); - } - return value; - }, - - // no dereferencing - getRaw: function Dict_getRaw(key) { - return this.map[key]; - }, - - // creates new map and dereferences all Refs - getAll: function Dict_getAll() { - var all = Object.create(null); - var queue = null; - var key, obj; - for (key in this.map) { - obj = this.get(key); - if (obj instanceof Dict) { - if (isRecursionAllowedFor(obj)) { - (queue || (queue = [])).push({target: all, key: key, obj: obj}); - } else { - all[key] = this.getRaw(key); - } - } else { - all[key] = obj; - } - } - if (!queue) { - return all; - } - - // trying to take cyclic references into the account - var processed = Object.create(null); - while (queue.length > 0) { - var item = queue.shift(); - var itemObj = item.obj; - var objId = itemObj.objId; - if (objId && objId in processed) { - item.target[item.key] = processed[objId]; - continue; - } - var dereferenced = Object.create(null); - for (key in itemObj.map) { - obj = itemObj.get(key); - if (obj instanceof Dict) { - if (isRecursionAllowedFor(obj)) { - queue.push({target: dereferenced, key: key, obj: obj}); - } else { - dereferenced[key] = itemObj.getRaw(key); - } - } else { - dereferenced[key] = obj; - } - } - if (objId) { - processed[objId] = dereferenced; - } - item.target[item.key] = dereferenced; - } - return all; - }, - - getKeys: function Dict_getKeys() { - return Object.keys(this.map); - }, - - set: function Dict_set(key, value) { - this.map[key] = value; - }, - - has: function Dict_has(key) { - return key in this.map; - }, - - forEach: function Dict_forEach(callback) { - for (var key in this.map) { - callback(key, this.get(key)); - } - } - }; - - Dict.empty = new Dict(null); - - Dict.merge = function Dict_merge(xref, dictArray) { - var mergedDict = new Dict(xref); - - for (var i = 0, ii = dictArray.length; i < ii; i++) { - var dict = dictArray[i]; - if (!isDict(dict)) { - continue; - } - for (var keyName in dict.map) { - if (mergedDict.map[keyName]) { - continue; - } - mergedDict.map[keyName] = dict.map[keyName]; - } - } - return mergedDict; - }; - - return Dict; -})(); - -var Ref = (function RefClosure() { - function Ref(num, gen) { - this.num = num; - this.gen = gen; - } - - Ref.prototype = { - toString: function Ref_toString() { - // This function is hot, so we make the string as compact as possible. - // |this.gen| is almost always zero, so we treat that case specially. - var str = this.num + 'R'; - if (this.gen !== 0) { - str += this.gen; - } - return str; - } - }; - - return Ref; -})(); - -// The reference is identified by number and generation. -// This structure stores only one instance of the reference. -var RefSet = (function RefSetClosure() { - function RefSet() { - this.dict = {}; - } - - RefSet.prototype = { - has: function RefSet_has(ref) { - return ref.toString() in this.dict; - }, - - put: function RefSet_put(ref) { - this.dict[ref.toString()] = true; - }, - - remove: function RefSet_remove(ref) { - delete this.dict[ref.toString()]; - } - }; - - return RefSet; -})(); - -var RefSetCache = (function RefSetCacheClosure() { - function RefSetCache() { - this.dict = Object.create(null); - } - - RefSetCache.prototype = { - get: function RefSetCache_get(ref) { - return this.dict[ref.toString()]; - }, - - has: function RefSetCache_has(ref) { - return ref.toString() in this.dict; - }, - - put: function RefSetCache_put(ref, obj) { - this.dict[ref.toString()] = obj; - }, - - putAlias: function RefSetCache_putAlias(ref, aliasRef) { - this.dict[ref.toString()] = this.get(aliasRef); - }, - - forEach: function RefSetCache_forEach(fn, thisArg) { - for (var i in this.dict) { - fn.call(thisArg, this.dict[i]); - } - }, - - clear: function RefSetCache_clear() { - this.dict = Object.create(null); - } - }; - - return RefSetCache; -})(); - -var Catalog = (function CatalogClosure() { - function Catalog(pdfManager, xref) { - this.pdfManager = pdfManager; - this.xref = xref; - this.catDict = xref.getCatalogObj(); - this.fontCache = new RefSetCache(); - assert(isDict(this.catDict), - 'catalog object is not a dictionary'); - - this.pagePromises = []; - } - - Catalog.prototype = { - get metadata() { - var streamRef = this.catDict.getRaw('Metadata'); - if (!isRef(streamRef)) { - return shadow(this, 'metadata', null); - } - - var encryptMetadata = (!this.xref.encrypt ? false : - this.xref.encrypt.encryptMetadata); - - var stream = this.xref.fetch(streamRef, !encryptMetadata); - var metadata; - if (stream && isDict(stream.dict)) { - var type = stream.dict.get('Type'); - var subtype = stream.dict.get('Subtype'); - - if (isName(type) && isName(subtype) && - type.name === 'Metadata' && subtype.name === 'XML') { - // XXX: This should examine the charset the XML document defines, - // however since there are currently no real means to decode - // arbitrary charsets, let's just hope that the author of the PDF - // was reasonable enough to stick with the XML default charset, - // which is UTF-8. - try { - metadata = stringToUTF8String(bytesToString(stream.getBytes())); - } catch (e) { - info('Skipping invalid metadata.'); - } - } - } - - return shadow(this, 'metadata', metadata); - }, - get toplevelPagesDict() { - var pagesObj = this.catDict.get('Pages'); - assert(isDict(pagesObj), 'invalid top-level pages dictionary'); - // shadow the prototype getter - return shadow(this, 'toplevelPagesDict', pagesObj); - }, - get documentOutline() { - var obj = null; - try { - obj = this.readDocumentOutline(); - } catch (ex) { - if (ex instanceof MissingDataException) { - throw ex; - } - warn('Unable to read document outline'); - } - return shadow(this, 'documentOutline', obj); - }, - readDocumentOutline: function Catalog_readDocumentOutline() { - var xref = this.xref; - var obj = this.catDict.get('Outlines'); - var root = { items: [] }; - if (isDict(obj)) { - obj = obj.getRaw('First'); - var processed = new RefSet(); - if (isRef(obj)) { - var queue = [{obj: obj, parent: root}]; - // to avoid recursion keeping track of the items - // in the processed dictionary - processed.put(obj); - while (queue.length > 0) { - var i = queue.shift(); - var outlineDict = xref.fetchIfRef(i.obj); - if (outlineDict === null) { - continue; - } - if (!outlineDict.has('Title')) { - error('Invalid outline item'); - } - var dest = outlineDict.get('A'); - if (dest) { - dest = dest.get('D'); - } else if (outlineDict.has('Dest')) { - dest = outlineDict.getRaw('Dest'); - if (isName(dest)) { - dest = dest.name; - } - } - var title = outlineDict.get('Title'); - var outlineItem = { - dest: dest, - title: stringToPDFString(title), - color: outlineDict.get('C') || [0, 0, 0], - count: outlineDict.get('Count'), - bold: !!(outlineDict.get('F') & 2), - italic: !!(outlineDict.get('F') & 1), - items: [] - }; - i.parent.items.push(outlineItem); - obj = outlineDict.getRaw('First'); - if (isRef(obj) && !processed.has(obj)) { - queue.push({obj: obj, parent: outlineItem}); - processed.put(obj); - } - obj = outlineDict.getRaw('Next'); - if (isRef(obj) && !processed.has(obj)) { - queue.push({obj: obj, parent: i.parent}); - processed.put(obj); - } - } - } - } - return (root.items.length > 0 ? root.items : null); - }, - get numPages() { - var obj = this.toplevelPagesDict.get('Count'); - assert( - isInt(obj), - 'page count in top level pages object is not an integer' - ); - // shadow the prototype getter - return shadow(this, 'num', obj); - }, - get destinations() { - function fetchDestination(dest) { - return isDict(dest) ? dest.get('D') : dest; - } - - var xref = this.xref; - var dests = {}, nameTreeRef, nameDictionaryRef; - var obj = this.catDict.get('Names'); - if (obj && obj.has('Dests')) { - nameTreeRef = obj.getRaw('Dests'); - } else if (this.catDict.has('Dests')) { - nameDictionaryRef = this.catDict.get('Dests'); - } - - if (nameDictionaryRef) { - // reading simple destination dictionary - obj = nameDictionaryRef; - obj.forEach(function catalogForEach(key, value) { - if (!value) { - return; - } - dests[key] = fetchDestination(value); - }); - } - if (nameTreeRef) { - var nameTree = new NameTree(nameTreeRef, xref); - var names = nameTree.getAll(); - for (var name in names) { - if (!names.hasOwnProperty(name)) { - continue; - } - dests[name] = fetchDestination(names[name]); - } - } - return shadow(this, 'destinations', dests); - }, - getDestination: function Catalog_getDestination(destinationId) { - function fetchDestination(dest) { - return isDict(dest) ? dest.get('D') : dest; - } - - var xref = this.xref; - var dest = null, nameTreeRef, nameDictionaryRef; - var obj = this.catDict.get('Names'); - if (obj && obj.has('Dests')) { - nameTreeRef = obj.getRaw('Dests'); - } else if (this.catDict.has('Dests')) { - nameDictionaryRef = this.catDict.get('Dests'); - } - - if (nameDictionaryRef) { // Simple destination dictionary. - var value = nameDictionaryRef.get(destinationId); - if (value) { - dest = fetchDestination(value); - } - } - if (nameTreeRef) { - var nameTree = new NameTree(nameTreeRef, xref); - dest = fetchDestination(nameTree.get(destinationId)); - } - return dest; - }, - get attachments() { - var xref = this.xref; - var attachments = null, nameTreeRef; - var obj = this.catDict.get('Names'); - if (obj) { - nameTreeRef = obj.getRaw('EmbeddedFiles'); - } - - if (nameTreeRef) { - var nameTree = new NameTree(nameTreeRef, xref); - var names = nameTree.getAll(); - for (var name in names) { - if (!names.hasOwnProperty(name)) { - continue; - } - var fs = new FileSpec(names[name], xref); - if (!attachments) { - attachments = {}; - } - attachments[stringToPDFString(name)] = fs.serializable; - } - } - return shadow(this, 'attachments', attachments); - }, - get javaScript() { - var xref = this.xref; - var obj = this.catDict.get('Names'); - - var javaScript = []; - function appendIfJavaScriptDict(jsDict) { - var type = jsDict.get('S'); - if (!isName(type) || type.name !== 'JavaScript') { - return; - } - var js = jsDict.get('JS'); - if (isStream(js)) { - js = bytesToString(js.getBytes()); - } else if (!isString(js)) { - return; - } - javaScript.push(stringToPDFString(js)); - } - if (obj && obj.has('JavaScript')) { - var nameTree = new NameTree(obj.getRaw('JavaScript'), xref); - var names = nameTree.getAll(); - for (var name in names) { - if (!names.hasOwnProperty(name)) { - continue; - } - // We don't really use the JavaScript right now. This code is - // defensive so we don't cause errors on document load. - var jsDict = names[name]; - if (isDict(jsDict)) { - appendIfJavaScriptDict(jsDict); - } - } - } - - // Append OpenAction actions to javaScript array - var openactionDict = this.catDict.get('OpenAction'); - if (isDict(openactionDict, 'Action')) { - var actionType = openactionDict.get('S'); - if (isName(actionType) && actionType.name === 'Named') { - // The named Print action is not a part of the PDF 1.7 specification, - // but is supported by many PDF readers/writers (including Adobe's). - var action = openactionDict.get('N'); - if (isName(action) && action.name === 'Print') { - javaScript.push('print({});'); - } - } else { - appendIfJavaScriptDict(openactionDict); - } - } - - return shadow(this, 'javaScript', javaScript); - }, - - cleanup: function Catalog_cleanup() { - var promises = []; - this.fontCache.forEach(function (promise) { - promises.push(promise); - }); - return Promise.all(promises).then(function (translatedFonts) { - for (var i = 0, ii = translatedFonts.length; i < ii; i++) { - var font = translatedFonts[i].dict; - delete font.translated; - } - this.fontCache.clear(); - }.bind(this)); - }, - - getPage: function Catalog_getPage(pageIndex) { - if (!(pageIndex in this.pagePromises)) { - this.pagePromises[pageIndex] = this.getPageDict(pageIndex).then( - function (a) { - var dict = a[0]; - var ref = a[1]; - return new Page(this.pdfManager, this.xref, pageIndex, dict, ref, - this.fontCache); - }.bind(this) - ); - } - return this.pagePromises[pageIndex]; - }, - - getPageDict: function Catalog_getPageDict(pageIndex) { - var capability = createPromiseCapability(); - var nodesToVisit = [this.catDict.getRaw('Pages')]; - var currentPageIndex = 0; - var xref = this.xref; - var checkAllKids = false; - - function next() { - while (nodesToVisit.length) { - var currentNode = nodesToVisit.pop(); - - if (isRef(currentNode)) { - xref.fetchAsync(currentNode).then(function (obj) { - if (isDict(obj, 'Page') || (isDict(obj) && !obj.has('Kids'))) { - if (pageIndex === currentPageIndex) { - capability.resolve([obj, currentNode]); - } else { - currentPageIndex++; - next(); - } - return; - } - nodesToVisit.push(obj); - next(); - }, capability.reject); - return; - } - - // Must be a child page dictionary. - assert( - isDict(currentNode), - 'page dictionary kid reference points to wrong type of object' - ); - var count = currentNode.get('Count'); - // If the current node doesn't have any children, avoid getting stuck - // in an empty node further down in the tree (see issue5644.pdf). - if (count === 0) { - checkAllKids = true; - } - // Skip nodes where the page can't be. - if (currentPageIndex + count <= pageIndex) { - currentPageIndex += count; - continue; - } - - var kids = currentNode.get('Kids'); - assert(isArray(kids), 'page dictionary kids object is not an array'); - if (!checkAllKids && count === kids.length) { - // Nodes that don't have the page have been skipped and this is the - // bottom of the tree which means the page requested must be a - // descendant of this pages node. Ideally we would just resolve the - // promise with the page ref here, but there is the case where more - // pages nodes could link to single a page (see issue 3666 pdf). To - // handle this push it back on the queue so if it is a pages node it - // will be descended into. - nodesToVisit = [kids[pageIndex - currentPageIndex]]; - currentPageIndex = pageIndex; - continue; - } else { - for (var last = kids.length - 1; last >= 0; last--) { - nodesToVisit.push(kids[last]); - } - } - } - capability.reject('Page index ' + pageIndex + ' not found.'); - } - next(); - return capability.promise; - }, - - getPageIndex: function Catalog_getPageIndex(ref) { - // The page tree nodes have the count of all the leaves below them. To get - // how many pages are before we just have to walk up the tree and keep - // adding the count of siblings to the left of the node. - var xref = this.xref; - function pagesBeforeRef(kidRef) { - var total = 0; - var parentRef; - return xref.fetchAsync(kidRef).then(function (node) { - if (!node) { - return null; - } - parentRef = node.getRaw('Parent'); - return node.getAsync('Parent'); - }).then(function (parent) { - if (!parent) { - return null; - } - return parent.getAsync('Kids'); - }).then(function (kids) { - if (!kids) { - return null; - } - var kidPromises = []; - var found = false; - for (var i = 0; i < kids.length; i++) { - var kid = kids[i]; - assert(isRef(kid), 'kids must be a ref'); - if (kid.num === kidRef.num) { - found = true; - break; - } - kidPromises.push(xref.fetchAsync(kid).then(function (kid) { - if (kid.has('Count')) { - var count = kid.get('Count'); - total += count; - } else { // page leaf node - total++; - } - })); - } - if (!found) { - error('kid ref not found in parents kids'); - } - return Promise.all(kidPromises).then(function () { - return [total, parentRef]; - }); - }); - } - - var total = 0; - function next(ref) { - return pagesBeforeRef(ref).then(function (args) { - if (!args) { - return total; - } - var count = args[0]; - var parentRef = args[1]; - total += count; - return next(parentRef); - }); - } - - return next(ref); - } - }; - - return Catalog; -})(); - -var XRef = (function XRefClosure() { - function XRef(stream, password) { - this.stream = stream; - this.entries = []; - this.xrefstms = {}; - // prepare the XRef cache - this.cache = []; - this.password = password; - this.stats = { - streamTypes: [], - fontTypes: [] - }; - } - - XRef.prototype = { - setStartXRef: function XRef_setStartXRef(startXRef) { - // Store the starting positions of xref tables as we process them - // so we can recover from missing data errors - this.startXRefQueue = [startXRef]; - }, - - parse: function XRef_parse(recoveryMode) { - var trailerDict; - if (!recoveryMode) { - trailerDict = this.readXRef(); - } else { - warn('Indexing all PDF objects'); - trailerDict = this.indexObjects(); - } - trailerDict.assignXref(this); - this.trailer = trailerDict; - var encrypt = trailerDict.get('Encrypt'); - if (encrypt) { - var ids = trailerDict.get('ID'); - var fileId = (ids && ids.length) ? ids[0] : ''; - this.encrypt = new CipherTransformFactory(encrypt, fileId, - this.password); - } - - // get the root dictionary (catalog) object - if (!(this.root = trailerDict.get('Root'))) { - error('Invalid root reference'); - } - }, - - processXRefTable: function XRef_processXRefTable(parser) { - if (!('tableState' in this)) { - // Stores state of the table as we process it so we can resume - // from middle of table in case of missing data error - this.tableState = { - entryNum: 0, - streamPos: parser.lexer.stream.pos, - parserBuf1: parser.buf1, - parserBuf2: parser.buf2 - }; - } - - var obj = this.readXRefTable(parser); - - // Sanity check - if (!isCmd(obj, 'trailer')) { - error('Invalid XRef table: could not find trailer dictionary'); - } - // Read trailer dictionary, e.g. - // trailer - // << /Size 22 - // /Root 20R - // /Info 10R - // /ID [ <81b14aafa313db63dbd6f981e49f94f4> ] - // >> - // The parser goes through the entire stream << ... >> and provides - // a getter interface for the key-value table - var dict = parser.getObj(); - - // The pdflib PDF generator can generate a nested trailer dictionary - if (!isDict(dict) && dict.dict) { - dict = dict.dict; - } - if (!isDict(dict)) { - error('Invalid XRef table: could not parse trailer dictionary'); - } - delete this.tableState; - - return dict; - }, - - readXRefTable: function XRef_readXRefTable(parser) { - // Example of cross-reference table: - // xref - // 0 1 <-- subsection header (first obj #, obj count) - // 0000000000 65535 f <-- actual object (offset, generation #, f/n) - // 23 2 <-- subsection header ... and so on ... - // 0000025518 00002 n - // 0000025635 00000 n - // trailer - // ... - - var stream = parser.lexer.stream; - var tableState = this.tableState; - stream.pos = tableState.streamPos; - parser.buf1 = tableState.parserBuf1; - parser.buf2 = tableState.parserBuf2; - - // Outer loop is over subsection headers - var obj; - - while (true) { - if (!('firstEntryNum' in tableState) || !('entryCount' in tableState)) { - if (isCmd(obj = parser.getObj(), 'trailer')) { - break; - } - tableState.firstEntryNum = obj; - tableState.entryCount = parser.getObj(); - } - - var first = tableState.firstEntryNum; - var count = tableState.entryCount; - if (!isInt(first) || !isInt(count)) { - error('Invalid XRef table: wrong types in subsection header'); - } - // Inner loop is over objects themselves - for (var i = tableState.entryNum; i < count; i++) { - tableState.streamPos = stream.pos; - tableState.entryNum = i; - tableState.parserBuf1 = parser.buf1; - tableState.parserBuf2 = parser.buf2; - - var entry = {}; - entry.offset = parser.getObj(); - entry.gen = parser.getObj(); - var type = parser.getObj(); - - if (isCmd(type, 'f')) { - entry.free = true; - } else if (isCmd(type, 'n')) { - entry.uncompressed = true; - } - - // Validate entry obj - if (!isInt(entry.offset) || !isInt(entry.gen) || - !(entry.free || entry.uncompressed)) { - error('Invalid entry in XRef subsection: ' + first + ', ' + count); - } - - if (!this.entries[i + first]) { - this.entries[i + first] = entry; - } - } - - tableState.entryNum = 0; - tableState.streamPos = stream.pos; - tableState.parserBuf1 = parser.buf1; - tableState.parserBuf2 = parser.buf2; - delete tableState.firstEntryNum; - delete tableState.entryCount; - } - - // Per issue 3248: hp scanners generate bad XRef - if (first === 1 && this.entries[1] && this.entries[1].free) { - // shifting the entries - this.entries.shift(); - } - - // Sanity check: as per spec, first object must be free - if (this.entries[0] && !this.entries[0].free) { - error('Invalid XRef table: unexpected first object'); - } - return obj; - }, - - processXRefStream: function XRef_processXRefStream(stream) { - if (!('streamState' in this)) { - // Stores state of the stream as we process it so we can resume - // from middle of stream in case of missing data error - var streamParameters = stream.dict; - var byteWidths = streamParameters.get('W'); - var range = streamParameters.get('Index'); - if (!range) { - range = [0, streamParameters.get('Size')]; - } - - this.streamState = { - entryRanges: range, - byteWidths: byteWidths, - entryNum: 0, - streamPos: stream.pos - }; - } - this.readXRefStream(stream); - delete this.streamState; - - return stream.dict; - }, - - readXRefStream: function XRef_readXRefStream(stream) { - var i, j; - var streamState = this.streamState; - stream.pos = streamState.streamPos; - - var byteWidths = streamState.byteWidths; - var typeFieldWidth = byteWidths[0]; - var offsetFieldWidth = byteWidths[1]; - var generationFieldWidth = byteWidths[2]; - - var entryRanges = streamState.entryRanges; - while (entryRanges.length > 0) { - var first = entryRanges[0]; - var n = entryRanges[1]; - - if (!isInt(first) || !isInt(n)) { - error('Invalid XRef range fields: ' + first + ', ' + n); - } - if (!isInt(typeFieldWidth) || !isInt(offsetFieldWidth) || - !isInt(generationFieldWidth)) { - error('Invalid XRef entry fields length: ' + first + ', ' + n); - } - for (i = streamState.entryNum; i < n; ++i) { - streamState.entryNum = i; - streamState.streamPos = stream.pos; - - var type = 0, offset = 0, generation = 0; - for (j = 0; j < typeFieldWidth; ++j) { - type = (type << 8) | stream.getByte(); - } - // if type field is absent, its default value is 1 - if (typeFieldWidth === 0) { - type = 1; - } - for (j = 0; j < offsetFieldWidth; ++j) { - offset = (offset << 8) | stream.getByte(); - } - for (j = 0; j < generationFieldWidth; ++j) { - generation = (generation << 8) | stream.getByte(); - } - var entry = {}; - entry.offset = offset; - entry.gen = generation; - switch (type) { - case 0: - entry.free = true; - break; - case 1: - entry.uncompressed = true; - break; - case 2: - break; - default: - error('Invalid XRef entry type: ' + type); - } - if (!this.entries[first + i]) { - this.entries[first + i] = entry; - } - } - - streamState.entryNum = 0; - streamState.streamPos = stream.pos; - entryRanges.splice(0, 2); - } - }, - - indexObjects: function XRef_indexObjects() { - // Simple scan through the PDF content to find objects, - // trailers and XRef streams. - var TAB = 0x9, LF = 0xA, CR = 0xD, SPACE = 0x20; - var PERCENT = 0x25, LT = 0x3C; - - function readToken(data, offset) { - var token = '', ch = data[offset]; - while (ch !== LF && ch !== CR && ch !== LT) { - if (++offset >= data.length) { - break; - } - token += String.fromCharCode(ch); - ch = data[offset]; - } - return token; - } - function skipUntil(data, offset, what) { - var length = what.length, dataLength = data.length; - var skipped = 0; - // finding byte sequence - while (offset < dataLength) { - var i = 0; - while (i < length && data[offset + i] === what[i]) { - ++i; - } - if (i >= length) { - break; // sequence found - } - offset++; - skipped++; - } - return skipped; - } - var objRegExp = /^(\d+)\s+(\d+)\s+obj\b/; - var trailerBytes = new Uint8Array([116, 114, 97, 105, 108, 101, 114]); - var startxrefBytes = new Uint8Array([115, 116, 97, 114, 116, 120, 114, - 101, 102]); - var endobjBytes = new Uint8Array([101, 110, 100, 111, 98, 106]); - var xrefBytes = new Uint8Array([47, 88, 82, 101, 102]); - - // Clear out any existing entries, since they may be bogus. - this.entries.length = 0; - - var stream = this.stream; - stream.pos = 0; - var buffer = stream.getBytes(); - var position = stream.start, length = buffer.length; - var trailers = [], xrefStms = []; - while (position < length) { - var ch = buffer[position]; - if (ch === TAB || ch === LF || ch === CR || ch === SPACE) { - ++position; - continue; - } - if (ch === PERCENT) { // %-comment - do { - ++position; - if (position >= length) { - break; - } - ch = buffer[position]; - } while (ch !== LF && ch !== CR); - continue; - } - var token = readToken(buffer, position); - var m; - if (token.indexOf('xref') === 0 && - (token.length === 4 || /\s/.test(token[4]))) { - position += skipUntil(buffer, position, trailerBytes); - trailers.push(position); - position += skipUntil(buffer, position, startxrefBytes); - } else if ((m = objRegExp.exec(token))) { - if (typeof this.entries[m[1]] === 'undefined') { - this.entries[m[1]] = { - offset: position - stream.start, - gen: m[2] | 0, - uncompressed: true - }; - } - var contentLength = skipUntil(buffer, position, endobjBytes) + 7; - var content = buffer.subarray(position, position + contentLength); - - // checking XRef stream suspect - // (it shall have '/XRef' and next char is not a letter) - var xrefTagOffset = skipUntil(content, 0, xrefBytes); - if (xrefTagOffset < contentLength && - content[xrefTagOffset + 5] < 64) { - xrefStms.push(position - stream.start); - this.xrefstms[position - stream.start] = 1; // Avoid recursion - } - - position += contentLength; - } else if (token.indexOf('trailer') === 0 && - (token.length === 7 || /\s/.test(token[7]))) { - trailers.push(position); - position += skipUntil(buffer, position, startxrefBytes); - } else { - position += token.length + 1; - } - } - // reading XRef streams - var i, ii; - for (i = 0, ii = xrefStms.length; i < ii; ++i) { - this.startXRefQueue.push(xrefStms[i]); - this.readXRef(/* recoveryMode */ true); - } - // finding main trailer - var dict; - for (i = 0, ii = trailers.length; i < ii; ++i) { - stream.pos = trailers[i]; - var parser = new Parser(new Lexer(stream), true, this); - var obj = parser.getObj(); - if (!isCmd(obj, 'trailer')) { - continue; - } - // read the trailer dictionary - if (!isDict(dict = parser.getObj())) { - continue; - } - // taking the first one with 'ID' - if (dict.has('ID')) { - return dict; - } - } - // no tailer with 'ID', taking last one (if exists) - if (dict) { - return dict; - } - // nothing helps - // calling error() would reject worker with an UnknownErrorException. - throw new InvalidPDFException('Invalid PDF structure'); - }, - - readXRef: function XRef_readXRef(recoveryMode) { - var stream = this.stream; - - try { - while (this.startXRefQueue.length) { - var startXRef = this.startXRefQueue[0]; - - stream.pos = startXRef + stream.start; - - var parser = new Parser(new Lexer(stream), true, this); - var obj = parser.getObj(); - var dict; - - // Get dictionary - if (isCmd(obj, 'xref')) { - // Parse end-of-file XRef - dict = this.processXRefTable(parser); - if (!this.topDict) { - this.topDict = dict; - } - - // Recursively get other XRefs 'XRefStm', if any - obj = dict.get('XRefStm'); - if (isInt(obj)) { - var pos = obj; - // ignore previously loaded xref streams - // (possible infinite recursion) - if (!(pos in this.xrefstms)) { - this.xrefstms[pos] = 1; - this.startXRefQueue.push(pos); - } - } - } else if (isInt(obj)) { - // Parse in-stream XRef - if (!isInt(parser.getObj()) || - !isCmd(parser.getObj(), 'obj') || - !isStream(obj = parser.getObj())) { - error('Invalid XRef stream'); - } - dict = this.processXRefStream(obj); - if (!this.topDict) { - this.topDict = dict; - } - if (!dict) { - error('Failed to read XRef stream'); - } - } else { - error('Invalid XRef stream header'); - } - - // Recursively get previous dictionary, if any - obj = dict.get('Prev'); - if (isInt(obj)) { - this.startXRefQueue.push(obj); - } else if (isRef(obj)) { - // The spec says Prev must not be a reference, i.e. "/Prev NNN" - // This is a fallback for non-compliant PDFs, i.e. "/Prev NNN 0 R" - this.startXRefQueue.push(obj.num); - } - - this.startXRefQueue.shift(); - } - - return this.topDict; - } catch (e) { - if (e instanceof MissingDataException) { - throw e; - } - info('(while reading XRef): ' + e); - } - - if (recoveryMode) { - return; - } - throw new XRefParseException(); - }, - - getEntry: function XRef_getEntry(i) { - var xrefEntry = this.entries[i]; - if (xrefEntry && !xrefEntry.free && xrefEntry.offset) { - return xrefEntry; - } - return null; - }, - - fetchIfRef: function XRef_fetchIfRef(obj) { - if (!isRef(obj)) { - return obj; - } - return this.fetch(obj); - }, - - fetch: function XRef_fetch(ref, suppressEncryption) { - assert(isRef(ref), 'ref object is not a reference'); - var num = ref.num; - if (num in this.cache) { - var cacheEntry = this.cache[num]; - return cacheEntry; - } - - var xrefEntry = this.getEntry(num); - - // the referenced entry can be free - if (xrefEntry === null) { - return (this.cache[num] = null); - } - - if (xrefEntry.uncompressed) { - xrefEntry = this.fetchUncompressed(ref, xrefEntry, suppressEncryption); - } else { - xrefEntry = this.fetchCompressed(xrefEntry, suppressEncryption); - } - if (isDict(xrefEntry)){ - xrefEntry.objId = ref.toString(); - } else if (isStream(xrefEntry)) { - xrefEntry.dict.objId = ref.toString(); - } - return xrefEntry; - }, - - fetchUncompressed: function XRef_fetchUncompressed(ref, xrefEntry, - suppressEncryption) { - var gen = ref.gen; - var num = ref.num; - if (xrefEntry.gen !== gen) { - error('inconsistent generation in XRef'); - } - var stream = this.stream.makeSubStream(xrefEntry.offset + - this.stream.start); - var parser = new Parser(new Lexer(stream), true, this); - var obj1 = parser.getObj(); - var obj2 = parser.getObj(); - var obj3 = parser.getObj(); - if (!isInt(obj1) || parseInt(obj1, 10) !== num || - !isInt(obj2) || parseInt(obj2, 10) !== gen || - !isCmd(obj3)) { - error('bad XRef entry'); - } - if (!isCmd(obj3, 'obj')) { - // some bad PDFs use "obj1234" and really mean 1234 - if (obj3.cmd.indexOf('obj') === 0) { - num = parseInt(obj3.cmd.substring(3), 10); - if (!isNaN(num)) { - return num; - } - } - error('bad XRef entry'); - } - if (this.encrypt && !suppressEncryption) { - xrefEntry = parser.getObj(this.encrypt.createCipherTransform(num, gen)); - } else { - xrefEntry = parser.getObj(); - } - if (!isStream(xrefEntry)) { - this.cache[num] = xrefEntry; - } - return xrefEntry; - }, - - fetchCompressed: function XRef_fetchCompressed(xrefEntry, - suppressEncryption) { - var tableOffset = xrefEntry.offset; - var stream = this.fetch(new Ref(tableOffset, 0)); - if (!isStream(stream)) { - error('bad ObjStm stream'); - } - var first = stream.dict.get('First'); - var n = stream.dict.get('N'); - if (!isInt(first) || !isInt(n)) { - error('invalid first and n parameters for ObjStm stream'); - } - var parser = new Parser(new Lexer(stream), false, this); - parser.allowStreams = true; - var i, entries = [], num, nums = []; - // read the object numbers to populate cache - for (i = 0; i < n; ++i) { - num = parser.getObj(); - if (!isInt(num)) { - error('invalid object number in the ObjStm stream: ' + num); - } - nums.push(num); - var offset = parser.getObj(); - if (!isInt(offset)) { - error('invalid object offset in the ObjStm stream: ' + offset); - } - } - // read stream objects for cache - for (i = 0; i < n; ++i) { - entries.push(parser.getObj()); - num = nums[i]; - var entry = this.entries[num]; - if (entry && entry.offset === tableOffset && entry.gen === i) { - this.cache[num] = entries[i]; - } - } - xrefEntry = entries[xrefEntry.gen]; - if (xrefEntry === undefined) { - error('bad XRef entry for compressed object'); - } - return xrefEntry; - }, - - fetchIfRefAsync: function XRef_fetchIfRefAsync(obj) { - if (!isRef(obj)) { - return Promise.resolve(obj); - } - return this.fetchAsync(obj); - }, - - fetchAsync: function XRef_fetchAsync(ref, suppressEncryption) { - var streamManager = this.stream.manager; - var xref = this; - return new Promise(function tryFetch(resolve, reject) { - try { - resolve(xref.fetch(ref, suppressEncryption)); - } catch (e) { - if (e instanceof MissingDataException) { - streamManager.requestRange(e.begin, e.end).then(function () { - tryFetch(resolve, reject); - }, reject); - return; - } - reject(e); - } - }); - }, - - getCatalogObj: function XRef_getCatalogObj() { - return this.root; - } - }; - - return XRef; -})(); - -/** - * A NameTree is like a Dict but has some advantageous properties, see the - * spec (7.9.6) for more details. - * TODO: implement all the Dict functions and make this more efficent. - */ -var NameTree = (function NameTreeClosure() { - function NameTree(root, xref) { - this.root = root; - this.xref = xref; - } - - NameTree.prototype = { - getAll: function NameTree_getAll() { - var dict = {}; - if (!this.root) { - return dict; - } - var xref = this.xref; - // reading name tree - var processed = new RefSet(); - processed.put(this.root); - var queue = [this.root]; - while (queue.length > 0) { - var i, n; - var obj = xref.fetchIfRef(queue.shift()); - if (!isDict(obj)) { - continue; - } - if (obj.has('Kids')) { - var kids = obj.get('Kids'); - for (i = 0, n = kids.length; i < n; i++) { - var kid = kids[i]; - if (processed.has(kid)) { - error('invalid destinations'); - } - queue.push(kid); - processed.put(kid); - } - continue; - } - var names = obj.get('Names'); - if (names) { - for (i = 0, n = names.length; i < n; i += 2) { - dict[xref.fetchIfRef(names[i])] = xref.fetchIfRef(names[i + 1]); - } - } - } - return dict; - }, - - get: function NameTree_get(destinationId) { - if (!this.root) { - return null; - } - - var xref = this.xref; - var kidsOrNames = xref.fetchIfRef(this.root); - var loopCount = 0; - var MAX_NAMES_LEVELS = 10; - var l, r, m; - - // Perform a binary search to quickly find the entry that - // contains the named destination we are looking for. - while (kidsOrNames.has('Kids')) { - loopCount++; - if (loopCount > MAX_NAMES_LEVELS) { - warn('Search depth limit for named destionations has been reached.'); - return null; - } - - var kids = kidsOrNames.get('Kids'); - if (!isArray(kids)) { - return null; - } - - l = 0; - r = kids.length - 1; - while (l <= r) { - m = (l + r) >> 1; - var kid = xref.fetchIfRef(kids[m]); - var limits = kid.get('Limits'); - - if (destinationId < xref.fetchIfRef(limits[0])) { - r = m - 1; - } else if (destinationId > xref.fetchIfRef(limits[1])) { - l = m + 1; - } else { - kidsOrNames = xref.fetchIfRef(kids[m]); - break; - } - } - if (l > r) { - return null; - } - } - - // If we get here, then we have found the right entry. Now - // go through the named destinations in the Named dictionary - // until we find the exact destination we're looking for. - var names = kidsOrNames.get('Names'); - if (isArray(names)) { - // Perform a binary search to reduce the lookup time. - l = 0; - r = names.length - 2; - while (l <= r) { - // Check only even indices (0, 2, 4, ...) because the - // odd indices contain the actual D array. - m = (l + r) & ~1; - if (destinationId < xref.fetchIfRef(names[m])) { - r = m - 2; - } else if (destinationId > xref.fetchIfRef(names[m])) { - l = m + 2; - } else { - return xref.fetchIfRef(names[m + 1]); - } - } - } - return null; - } - }; - return NameTree; -})(); - -/** - * "A PDF file can refer to the contents of another file by using a File - * Specification (PDF 1.1)", see the spec (7.11) for more details. - * NOTE: Only embedded files are supported (as part of the attachments support) - * TODO: support the 'URL' file system (with caching if !/V), portable - * collections attributes and related files (/RF) - */ -var FileSpec = (function FileSpecClosure() { - function FileSpec(root, xref) { - if (!root || !isDict(root)) { - return; - } - this.xref = xref; - this.root = root; - if (root.has('FS')) { - this.fs = root.get('FS'); - } - this.description = root.has('Desc') ? - stringToPDFString(root.get('Desc')) : - ''; - if (root.has('RF')) { - warn('Related file specifications are not supported'); - } - this.contentAvailable = true; - if (!root.has('EF')) { - this.contentAvailable = false; - warn('Non-embedded file specifications are not supported'); - } - } - - function pickPlatformItem(dict) { - // Look for the filename in this order: - // UF, F, Unix, Mac, DOS - if (dict.has('UF')) { - return dict.get('UF'); - } else if (dict.has('F')) { - return dict.get('F'); - } else if (dict.has('Unix')) { - return dict.get('Unix'); - } else if (dict.has('Mac')) { - return dict.get('Mac'); - } else if (dict.has('DOS')) { - return dict.get('DOS'); - } else { - return null; - } - } - - FileSpec.prototype = { - get filename() { - if (!this._filename && this.root) { - var filename = pickPlatformItem(this.root) || 'unnamed'; - this._filename = stringToPDFString(filename). - replace(/\\\\/g, '\\'). - replace(/\\\//g, '/'). - replace(/\\/g, '/'); - } - return this._filename; - }, - get content() { - if (!this.contentAvailable) { - return null; - } - if (!this.contentRef && this.root) { - this.contentRef = pickPlatformItem(this.root.get('EF')); - } - var content = null; - if (this.contentRef) { - var xref = this.xref; - var fileObj = xref.fetchIfRef(this.contentRef); - if (fileObj && isStream(fileObj)) { - content = fileObj.getBytes(); - } else { - warn('Embedded file specification points to non-existing/invalid ' + - 'content'); - } - } else { - warn('Embedded file specification does not have a content'); - } - return content; - }, - get serializable() { - return { - filename: this.filename, - content: this.content - }; - } - }; - return FileSpec; -})(); - -/** - * A helper for loading missing data in object graphs. It traverses the graph - * depth first and queues up any objects that have missing data. Once it has - * has traversed as many objects that are available it attempts to bundle the - * missing data requests and then resume from the nodes that weren't ready. - * - * NOTE: It provides protection from circular references by keeping track of - * of loaded references. However, you must be careful not to load any graphs - * that have references to the catalog or other pages since that will cause the - * entire PDF document object graph to be traversed. - */ -var ObjectLoader = (function() { - function mayHaveChildren(value) { - return isRef(value) || isDict(value) || isArray(value) || isStream(value); - } - - function addChildren(node, nodesToVisit) { - var value; - if (isDict(node) || isStream(node)) { - var map; - if (isDict(node)) { - map = node.map; - } else { - map = node.dict.map; - } - for (var key in map) { - value = map[key]; - if (mayHaveChildren(value)) { - nodesToVisit.push(value); - } - } - } else if (isArray(node)) { - for (var i = 0, ii = node.length; i < ii; i++) { - value = node[i]; - if (mayHaveChildren(value)) { - nodesToVisit.push(value); - } - } - } - } - - function ObjectLoader(obj, keys, xref) { - this.obj = obj; - this.keys = keys; - this.xref = xref; - this.refSet = null; - this.capability = null; - } - - ObjectLoader.prototype = { - load: function ObjectLoader_load() { - var keys = this.keys; - this.capability = createPromiseCapability(); - // Don't walk the graph if all the data is already loaded. - if (!(this.xref.stream instanceof ChunkedStream) || - this.xref.stream.getMissingChunks().length === 0) { - this.capability.resolve(); - return this.capability.promise; - } - - this.refSet = new RefSet(); - // Setup the initial nodes to visit. - var nodesToVisit = []; - for (var i = 0; i < keys.length; i++) { - nodesToVisit.push(this.obj[keys[i]]); - } - - this._walk(nodesToVisit); - return this.capability.promise; - }, - - _walk: function ObjectLoader_walk(nodesToVisit) { - var nodesToRevisit = []; - var pendingRequests = []; - // DFS walk of the object graph. - while (nodesToVisit.length) { - var currentNode = nodesToVisit.pop(); - - // Only references or chunked streams can cause missing data exceptions. - if (isRef(currentNode)) { - // Skip nodes that have already been visited. - if (this.refSet.has(currentNode)) { - continue; - } - try { - var ref = currentNode; - this.refSet.put(ref); - currentNode = this.xref.fetch(currentNode); - } catch (e) { - if (!(e instanceof MissingDataException)) { - throw e; - } - nodesToRevisit.push(currentNode); - pendingRequests.push({ begin: e.begin, end: e.end }); - } - } - if (currentNode && currentNode.getBaseStreams) { - var baseStreams = currentNode.getBaseStreams(); - var foundMissingData = false; - for (var i = 0; i < baseStreams.length; i++) { - var stream = baseStreams[i]; - if (stream.getMissingChunks && stream.getMissingChunks().length) { - foundMissingData = true; - pendingRequests.push({ - begin: stream.start, - end: stream.end - }); - } - } - if (foundMissingData) { - nodesToRevisit.push(currentNode); - } - } - - addChildren(currentNode, nodesToVisit); - } - - if (pendingRequests.length) { - this.xref.stream.manager.requestRanges(pendingRequests).then( - function pendingRequestCallback() { - nodesToVisit = nodesToRevisit; - for (var i = 0; i < nodesToRevisit.length; i++) { - var node = nodesToRevisit[i]; - // Remove any reference nodes from the currrent refset so they - // aren't skipped when we revist them. - if (isRef(node)) { - this.refSet.remove(node); - } - } - this._walk(nodesToVisit); - }.bind(this), this.capability.reject); - return; - } - // Everything is loaded. - this.refSet = null; - this.capability.resolve(); - } - }; - - return ObjectLoader; -})(); - - -var ISOAdobeCharset = [ - '.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', - 'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright', - 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', - 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', - 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', - 'at', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', - 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', - 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', - 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', - 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', - 'braceleft', 'bar', 'braceright', 'asciitilde', 'exclamdown', 'cent', - 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', - 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', - 'guilsinglright', 'fi', 'fl', 'endash', 'dagger', 'daggerdbl', - 'periodcentered', 'paragraph', 'bullet', 'quotesinglbase', - 'quotedblbase', 'quotedblright', 'guillemotright', 'ellipsis', - 'perthousand', 'questiondown', 'grave', 'acute', 'circumflex', 'tilde', - 'macron', 'breve', 'dotaccent', 'dieresis', 'ring', 'cedilla', - 'hungarumlaut', 'ogonek', 'caron', 'emdash', 'AE', 'ordfeminine', - 'Lslash', 'Oslash', 'OE', 'ordmasculine', 'ae', 'dotlessi', 'lslash', - 'oslash', 'oe', 'germandbls', 'onesuperior', 'logicalnot', 'mu', - 'trademark', 'Eth', 'onehalf', 'plusminus', 'Thorn', 'onequarter', - 'divide', 'brokenbar', 'degree', 'thorn', 'threequarters', 'twosuperior', - 'registered', 'minus', 'eth', 'multiply', 'threesuperior', 'copyright', - 'Aacute', 'Acircumflex', 'Adieresis', 'Agrave', 'Aring', 'Atilde', - 'Ccedilla', 'Eacute', 'Ecircumflex', 'Edieresis', 'Egrave', 'Iacute', - 'Icircumflex', 'Idieresis', 'Igrave', 'Ntilde', 'Oacute', 'Ocircumflex', - 'Odieresis', 'Ograve', 'Otilde', 'Scaron', 'Uacute', 'Ucircumflex', - 'Udieresis', 'Ugrave', 'Yacute', 'Ydieresis', 'Zcaron', 'aacute', - 'acircumflex', 'adieresis', 'agrave', 'aring', 'atilde', 'ccedilla', - 'eacute', 'ecircumflex', 'edieresis', 'egrave', 'iacute', 'icircumflex', - 'idieresis', 'igrave', 'ntilde', 'oacute', 'ocircumflex', 'odieresis', - 'ograve', 'otilde', 'scaron', 'uacute', 'ucircumflex', 'udieresis', - 'ugrave', 'yacute', 'ydieresis', 'zcaron' -]; - -var ExpertCharset = [ - '.notdef', 'space', 'exclamsmall', 'Hungarumlautsmall', 'dollaroldstyle', - 'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior', - 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', - 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', - 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', - 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', - 'colon', 'semicolon', 'commasuperior', 'threequartersemdash', - 'periodsuperior', 'questionsmall', 'asuperior', 'bsuperior', - 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', 'lsuperior', - 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', - 'tsuperior', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', - 'parenrightinferior', 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', - 'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', - 'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', - 'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', - 'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', - 'onefitted', 'rupiah', 'Tildesmall', 'exclamdownsmall', 'centoldstyle', - 'Lslashsmall', 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', - 'Brevesmall', 'Caronsmall', 'Dotaccentsmall', 'Macronsmall', - 'figuredash', 'hypheninferior', 'Ogoneksmall', 'Ringsmall', - 'Cedillasmall', 'onequarter', 'onehalf', 'threequarters', - 'questiondownsmall', 'oneeighth', 'threeeighths', 'fiveeighths', - 'seveneighths', 'onethird', 'twothirds', 'zerosuperior', 'onesuperior', - 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', - 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', - 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', - 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', - 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', - 'periodinferior', 'commainferior', 'Agravesmall', 'Aacutesmall', - 'Acircumflexsmall', 'Atildesmall', 'Adieresissmall', 'Aringsmall', - 'AEsmall', 'Ccedillasmall', 'Egravesmall', 'Eacutesmall', - 'Ecircumflexsmall', 'Edieresissmall', 'Igravesmall', 'Iacutesmall', - 'Icircumflexsmall', 'Idieresissmall', 'Ethsmall', 'Ntildesmall', - 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', 'Otildesmall', - 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', 'Uacutesmall', - 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', 'Thornsmall', - 'Ydieresissmall' -]; - -var ExpertSubsetCharset = [ - '.notdef', 'space', 'dollaroldstyle', 'dollarsuperior', - 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', - 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', - 'zerooldstyle', 'oneoldstyle', 'twooldstyle', 'threeoldstyle', - 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', - 'eightoldstyle', 'nineoldstyle', 'colon', 'semicolon', 'commasuperior', - 'threequartersemdash', 'periodsuperior', 'asuperior', 'bsuperior', - 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', 'lsuperior', - 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', - 'tsuperior', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', - 'parenrightinferior', 'hyphensuperior', 'colonmonetary', 'onefitted', - 'rupiah', 'centoldstyle', 'figuredash', 'hypheninferior', 'onequarter', - 'onehalf', 'threequarters', 'oneeighth', 'threeeighths', 'fiveeighths', - 'seveneighths', 'onethird', 'twothirds', 'zerosuperior', 'onesuperior', - 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', - 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', - 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', - 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', - 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', - 'periodinferior', 'commainferior' -]; - - -var DEFAULT_ICON_SIZE = 22; // px - -/** - * @class - * @alias AnnotationFactory - */ -function AnnotationFactory() {} -AnnotationFactory.prototype = /** @lends AnnotationFactory.prototype */ { - /** - * @param {XRef} xref - * @param {Object} ref - * @returns {Annotation} - */ - create: function AnnotationFactory_create(xref, ref) { - var dict = xref.fetchIfRef(ref); - if (!isDict(dict)) { - return; - } - - // Determine the annotation's subtype. - var subtype = dict.get('Subtype'); - subtype = isName(subtype) ? subtype.name : ''; - - // Return the right annotation object based on the subtype and field type. - var parameters = { - dict: dict, - ref: ref - }; - - switch (subtype) { - case 'Link': - return new LinkAnnotation(parameters); - - case 'Text': - return new TextAnnotation(parameters); - - case 'Widget': - var fieldType = Util.getInheritableProperty(dict, 'FT'); - if (isName(fieldType) && fieldType.name === 'Tx') { - return new TextWidgetAnnotation(parameters); - } - return new WidgetAnnotation(parameters); - - default: - warn('Unimplemented annotation type "' + subtype + '", ' + - 'falling back to base annotation'); - return new Annotation(parameters); - } - } -}; - -var Annotation = (function AnnotationClosure() { - // 12.5.5: Algorithm: Appearance streams - function getTransformMatrix(rect, bbox, matrix) { - var bounds = Util.getAxialAlignedBoundingBox(bbox, matrix); - var minX = bounds[0]; - var minY = bounds[1]; - var maxX = bounds[2]; - var maxY = bounds[3]; - - if (minX === maxX || minY === maxY) { - // From real-life file, bbox was [0, 0, 0, 0]. In this case, - // just apply the transform for rect - return [1, 0, 0, 1, rect[0], rect[1]]; - } - - var xRatio = (rect[2] - rect[0]) / (maxX - minX); - var yRatio = (rect[3] - rect[1]) / (maxY - minY); - return [ - xRatio, - 0, - 0, - yRatio, - rect[0] - minX * xRatio, - rect[1] - minY * yRatio - ]; - } - - function getDefaultAppearance(dict) { - var appearanceState = dict.get('AP'); - if (!isDict(appearanceState)) { - return; - } - - var appearance; - var appearances = appearanceState.get('N'); - if (isDict(appearances)) { - var as = dict.get('AS'); - if (as && appearances.has(as.name)) { - appearance = appearances.get(as.name); - } - } else { - appearance = appearances; - } - return appearance; - } - - function Annotation(params) { - var dict = params.dict; - - this.setFlags(dict.get('F')); - this.setRectangle(dict.get('Rect')); - this.setColor(dict.get('C')); - this.setBorderStyle(dict); - this.appearance = getDefaultAppearance(dict); - - // Expose public properties using a data object. - this.data = {}; - this.data.id = params.ref.num; - this.data.subtype = dict.get('Subtype').name; - this.data.annotationFlags = this.flags; - this.data.rect = this.rectangle; - this.data.color = this.color; - this.data.borderStyle = this.borderStyle; - this.data.hasAppearance = !!this.appearance; - } - - Annotation.prototype = { - /** - * @return {boolean} - */ - get viewable() { - if (this.flags) { - return !this.hasFlag(AnnotationFlag.INVISIBLE) && - !this.hasFlag(AnnotationFlag.HIDDEN) && - !this.hasFlag(AnnotationFlag.NOVIEW); - } - return true; - }, - - /** - * @return {boolean} - */ - get printable() { - if (this.flags) { - return this.hasFlag(AnnotationFlag.PRINT) && - !this.hasFlag(AnnotationFlag.INVISIBLE) && - !this.hasFlag(AnnotationFlag.HIDDEN); - } - return false; - }, - - /** - * Set the flags. - * - * @public - * @memberof Annotation - * @param {number} flags - Unsigned 32-bit integer specifying annotation - * characteristics - * @see {@link shared/util.js} - */ - setFlags: function Annotation_setFlags(flags) { - if (isInt(flags)) { - this.flags = flags; - } else { - this.flags = 0; - } - }, - - /** - * Check if a provided flag is set. - * - * @public - * @memberof Annotation - * @param {number} flag - Hexadecimal representation for an annotation - * characteristic - * @return {boolean} - * @see {@link shared/util.js} - */ - hasFlag: function Annotation_hasFlag(flag) { - if (this.flags) { - return (this.flags & flag) > 0; - } - return false; - }, - - /** - * Set the rectangle. - * - * @public - * @memberof Annotation - * @param {Array} rectangle - The rectangle array with exactly four entries - */ - setRectangle: function Annotation_setRectangle(rectangle) { - if (isArray(rectangle) && rectangle.length === 4) { - this.rectangle = Util.normalizeRect(rectangle); - } else { - this.rectangle = [0, 0, 0, 0]; - } - }, - - /** - * Set the color and take care of color space conversion. - * - * @public - * @memberof Annotation - * @param {Array} color - The color array containing either 0 - * (transparent), 1 (grayscale), 3 (RGB) or - * 4 (CMYK) elements - */ - setColor: function Annotation_setColor(color) { - var rgbColor = new Uint8Array(3); // Black in RGB color space (default) - if (!isArray(color)) { - this.color = rgbColor; - return; - } - - switch (color.length) { - case 0: // Transparent, which we indicate with a null value - this.color = null; - break; - - case 1: // Convert grayscale to RGB - ColorSpace.singletons.gray.getRgbItem(color, 0, rgbColor, 0); - this.color = rgbColor; - break; - - case 3: // Convert RGB percentages to RGB - ColorSpace.singletons.rgb.getRgbItem(color, 0, rgbColor, 0); - this.color = rgbColor; - break; - - case 4: // Convert CMYK to RGB - ColorSpace.singletons.cmyk.getRgbItem(color, 0, rgbColor, 0); - this.color = rgbColor; - break; - - default: - this.color = rgbColor; - break; - } - }, - - /** - * Set the border style (as AnnotationBorderStyle object). - * - * @public - * @memberof Annotation - * @param {Dict} borderStyle - The border style dictionary - */ - setBorderStyle: function Annotation_setBorderStyle(borderStyle) { - this.borderStyle = new AnnotationBorderStyle(); - if (!isDict(borderStyle)) { - return; - } - if (borderStyle.has('BS')) { - var dict = borderStyle.get('BS'); - var dictType; - - if (!dict.has('Type') || (isName(dictType = dict.get('Type')) && - dictType.name === 'Border')) { - this.borderStyle.setWidth(dict.get('W')); - this.borderStyle.setStyle(dict.get('S')); - this.borderStyle.setDashArray(dict.get('D')); - } - } else if (borderStyle.has('Border')) { - var array = borderStyle.get('Border'); - if (isArray(array) && array.length >= 3) { - this.borderStyle.setHorizontalCornerRadius(array[0]); - this.borderStyle.setVerticalCornerRadius(array[1]); - this.borderStyle.setWidth(array[2]); - - if (array.length === 4) { // Dash array available - this.borderStyle.setDashArray(array[3]); - } - } - } else { - // There are no border entries in the dictionary. According to the - // specification, we should draw a solid border of width 1 in that - // case, but Adobe Reader did not implement that part of the - // specification and instead draws no border at all, so we do the same. - // See also https://github.com/mozilla/pdf.js/issues/6179. - this.borderStyle.setWidth(0); - } - }, - - loadResources: function Annotation_loadResources(keys) { - return new Promise(function (resolve, reject) { - this.appearance.dict.getAsync('Resources').then(function (resources) { - if (!resources) { - resolve(); - return; - } - var objectLoader = new ObjectLoader(resources.map, - keys, - resources.xref); - objectLoader.load().then(function() { - resolve(resources); - }, reject); - }, reject); - }.bind(this)); - }, - - getOperatorList: function Annotation_getOperatorList(evaluator, task) { - if (!this.appearance) { - return Promise.resolve(new OperatorList()); - } - - var data = this.data; - var appearanceDict = this.appearance.dict; - var resourcesPromise = this.loadResources([ - 'ExtGState', - 'ColorSpace', - 'Pattern', - 'Shading', - 'XObject', - 'Font' - // ProcSet - // Properties - ]); - var bbox = appearanceDict.get('BBox') || [0, 0, 1, 1]; - var matrix = appearanceDict.get('Matrix') || [1, 0, 0, 1, 0 ,0]; - var transform = getTransformMatrix(data.rect, bbox, matrix); - var self = this; - - return resourcesPromise.then(function(resources) { - var opList = new OperatorList(); - opList.addOp(OPS.beginAnnotation, [data.rect, transform, matrix]); - return evaluator.getOperatorList(self.appearance, task, - resources, opList). - then(function () { - opList.addOp(OPS.endAnnotation, []); - self.appearance.reset(); - return opList; - }); - }); - } - }; - - Annotation.appendToOperatorList = function Annotation_appendToOperatorList( - annotations, opList, partialEvaluator, task, intent) { - var annotationPromises = []; - for (var i = 0, n = annotations.length; i < n; ++i) { - if ((intent === 'display' && annotations[i].viewable) || - (intent === 'print' && annotations[i].printable)) { - annotationPromises.push( - annotations[i].getOperatorList(partialEvaluator, task)); - } - } - return Promise.all(annotationPromises).then(function(operatorLists) { - opList.addOp(OPS.beginAnnotations, []); - for (var i = 0, n = operatorLists.length; i < n; ++i) { - opList.addOpList(operatorLists[i]); - } - opList.addOp(OPS.endAnnotations, []); - }); - }; - - return Annotation; -})(); - -/** - * Contains all data regarding an annotation's border style. - * - * @class - */ -var AnnotationBorderStyle = (function AnnotationBorderStyleClosure() { - /** - * @constructor - * @private - */ - function AnnotationBorderStyle() { - this.width = 1; - this.style = AnnotationBorderStyleType.SOLID; - this.dashArray = [3]; - this.horizontalCornerRadius = 0; - this.verticalCornerRadius = 0; - } - - AnnotationBorderStyle.prototype = { - /** - * Set the width. - * - * @public - * @memberof AnnotationBorderStyle - * @param {integer} width - The width - */ - setWidth: function AnnotationBorderStyle_setWidth(width) { - if (width === (width | 0)) { - this.width = width; - } - }, - - /** - * Set the style. - * - * @public - * @memberof AnnotationBorderStyle - * @param {Object} style - The style object - * @see {@link shared/util.js} - */ - setStyle: function AnnotationBorderStyle_setStyle(style) { - if (!style) { - return; - } - switch (style.name) { - case 'S': - this.style = AnnotationBorderStyleType.SOLID; - break; - - case 'D': - this.style = AnnotationBorderStyleType.DASHED; - break; - - case 'B': - this.style = AnnotationBorderStyleType.BEVELED; - break; - - case 'I': - this.style = AnnotationBorderStyleType.INSET; - break; - - case 'U': - this.style = AnnotationBorderStyleType.UNDERLINE; - break; - - default: - break; - } - }, - - /** - * Set the dash array. - * - * @public - * @memberof AnnotationBorderStyle - * @param {Array} dashArray - The dash array with at least one element - */ - setDashArray: function AnnotationBorderStyle_setDashArray(dashArray) { - // We validate the dash array, but we do not use it because CSS does not - // allow us to change spacing of dashes. For more information, visit - // http://www.w3.org/TR/css3-background/#the-border-style. - if (isArray(dashArray) && dashArray.length > 0) { - // According to the PDF specification: the elements in a dashArray - // shall be numbers that are nonnegative and not all equal to zero. - var isValid = true; - var allZeros = true; - for (var i = 0, len = dashArray.length; i < len; i++) { - var element = dashArray[i]; - var validNumber = (+element >= 0); - if (!validNumber) { - isValid = false; - break; - } else if (element > 0) { - allZeros = false; - } - } - if (isValid && !allZeros) { - this.dashArray = dashArray; - } else { - this.width = 0; // Adobe behavior when the array is invalid. - } - } else if (dashArray) { - this.width = 0; // Adobe behavior when the array is invalid. - } - }, - - /** - * Set the horizontal corner radius (from a Border dictionary). - * - * @public - * @memberof AnnotationBorderStyle - * @param {integer} radius - The horizontal corner radius - */ - setHorizontalCornerRadius: - function AnnotationBorderStyle_setHorizontalCornerRadius(radius) { - if (radius === (radius | 0)) { - this.horizontalCornerRadius = radius; - } - }, - - /** - * Set the vertical corner radius (from a Border dictionary). - * - * @public - * @memberof AnnotationBorderStyle - * @param {integer} radius - The vertical corner radius - */ - setVerticalCornerRadius: - function AnnotationBorderStyle_setVerticalCornerRadius(radius) { - if (radius === (radius | 0)) { - this.verticalCornerRadius = radius; - } - } - }; - - return AnnotationBorderStyle; -})(); - -var WidgetAnnotation = (function WidgetAnnotationClosure() { - function WidgetAnnotation(params) { - Annotation.call(this, params); - - var dict = params.dict; - var data = this.data; - - data.annotationType = AnnotationType.WIDGET; - data.fieldValue = stringToPDFString( - Util.getInheritableProperty(dict, 'V') || ''); - data.alternativeText = stringToPDFString(dict.get('TU') || ''); - data.defaultAppearance = Util.getInheritableProperty(dict, 'DA') || ''; - var fieldType = Util.getInheritableProperty(dict, 'FT'); - data.fieldType = isName(fieldType) ? fieldType.name : ''; - data.fieldFlags = Util.getInheritableProperty(dict, 'Ff') || 0; - this.fieldResources = Util.getInheritableProperty(dict, 'DR') || Dict.empty; - - // Hide unsupported Widget signatures. - if (data.fieldType === 'Sig') { - warn('unimplemented annotation type: Widget signature'); - this.setFlags(AnnotationFlag.HIDDEN); - } - - // Building the full field name by collecting the field and - // its ancestors 'T' data and joining them using '.'. - var fieldName = []; - var namedItem = dict; - var ref = params.ref; - while (namedItem) { - var parent = namedItem.get('Parent'); - var parentRef = namedItem.getRaw('Parent'); - var name = namedItem.get('T'); - if (name) { - fieldName.unshift(stringToPDFString(name)); - } else if (parent && ref) { - // The field name is absent, that means more than one field - // with the same name may exist. Replacing the empty name - // with the '`' plus index in the parent's 'Kids' array. - // This is not in the PDF spec but necessary to id the - // the input controls. - var kids = parent.get('Kids'); - var j, jj; - for (j = 0, jj = kids.length; j < jj; j++) { - var kidRef = kids[j]; - if (kidRef.num === ref.num && kidRef.gen === ref.gen) { - break; - } - } - fieldName.unshift('`' + j); - } - namedItem = parent; - ref = parentRef; - } - data.fullName = fieldName.join('.'); - } - - Util.inherit(WidgetAnnotation, Annotation, {}); - - return WidgetAnnotation; -})(); - -var TextWidgetAnnotation = (function TextWidgetAnnotationClosure() { - function TextWidgetAnnotation(params) { - WidgetAnnotation.call(this, params); - - this.data.textAlignment = Util.getInheritableProperty(params.dict, 'Q'); - this.data.hasHtml = !this.data.hasAppearance && !!this.data.fieldValue; - } - - Util.inherit(TextWidgetAnnotation, WidgetAnnotation, { - getOperatorList: function TextWidgetAnnotation_getOperatorList(evaluator, - task) { - if (this.appearance) { - return Annotation.prototype.getOperatorList.call(this, evaluator, task); - } - - var opList = new OperatorList(); - var data = this.data; - - // Even if there is an appearance stream, ignore it. This is the - // behaviour used by Adobe Reader. - if (!data.defaultAppearance) { - return Promise.resolve(opList); - } - - var stream = new Stream(stringToBytes(data.defaultAppearance)); - return evaluator.getOperatorList(stream, task, - this.fieldResources, opList). - then(function () { - return opList; - }); - } - }); - - return TextWidgetAnnotation; -})(); - -var TextAnnotation = (function TextAnnotationClosure() { - function TextAnnotation(params) { - Annotation.call(this, params); - - var dict = params.dict; - var data = this.data; - - var content = dict.get('Contents'); - var title = dict.get('T'); - data.annotationType = AnnotationType.TEXT; - data.content = stringToPDFString(content || ''); - data.title = stringToPDFString(title || ''); - data.hasHtml = true; - - if (data.hasAppearance) { - data.name = 'NoIcon'; - } else { - data.rect[1] = data.rect[3] - DEFAULT_ICON_SIZE; - data.rect[2] = data.rect[0] + DEFAULT_ICON_SIZE; - data.name = dict.has('Name') ? dict.get('Name').name : 'Note'; - } - - if (dict.has('C')) { - data.hasBgColor = true; - } - } - - Util.inherit(TextAnnotation, Annotation, {}); - - return TextAnnotation; -})(); - -var LinkAnnotation = (function LinkAnnotationClosure() { - function LinkAnnotation(params) { - Annotation.call(this, params); - - var dict = params.dict; - var data = this.data; - data.annotationType = AnnotationType.LINK; - data.hasHtml = true; - - var action = dict.get('A'); - if (action && isDict(action)) { - var linkType = action.get('S').name; - if (linkType === 'URI') { - var url = action.get('URI'); - if (isName(url)) { - // Some bad PDFs do not put parentheses around relative URLs. - url = '/' + url.name; - } else if (url) { - url = addDefaultProtocolToUrl(url); - } - // TODO: pdf spec mentions urls can be relative to a Base - // entry in the dictionary. - if (!isValidUrl(url, false)) { - url = ''; - } - // According to ISO 32000-1:2008, section 12.6.4.7, - // URI should to be encoded in 7-bit ASCII. - // Some bad PDFs may have URIs in UTF-8 encoding, see Bugzilla 1122280. - try { - data.url = stringToUTF8String(url); - } catch (e) { - // Fall back to a simple copy. - data.url = url; - } - } else if (linkType === 'GoTo') { - data.dest = action.get('D'); - } else if (linkType === 'GoToR') { - var urlDict = action.get('F'); - if (isDict(urlDict)) { - // We assume that the 'url' is a Filspec dictionary - // and fetch the url without checking any further - url = urlDict.get('F') || ''; - } - - // TODO: pdf reference says that GoToR - // can also have 'NewWindow' attribute - if (!isValidUrl(url, false)) { - url = ''; - } - data.url = url; - data.dest = action.get('D'); - } else if (linkType === 'Named') { - data.action = action.get('N').name; - } else { - warn('unrecognized link type: ' + linkType); - } - } else if (dict.has('Dest')) { - // simple destination link - var dest = dict.get('Dest'); - data.dest = isName(dest) ? dest.name : dest; - } - } - - // Lets URLs beginning with 'www.' default to using the 'http://' protocol. - function addDefaultProtocolToUrl(url) { - if (url && url.indexOf('www.') === 0) { - return ('http://' + url); - } - return url; - } - - Util.inherit(LinkAnnotation, Annotation, {}); - - return LinkAnnotation; -})(); - - -var PDFFunction = (function PDFFunctionClosure() { - var CONSTRUCT_SAMPLED = 0; - var CONSTRUCT_INTERPOLATED = 2; - var CONSTRUCT_STICHED = 3; - var CONSTRUCT_POSTSCRIPT = 4; - - return { - getSampleArray: function PDFFunction_getSampleArray(size, outputSize, bps, - str) { - var i, ii; - var length = 1; - for (i = 0, ii = size.length; i < ii; i++) { - length *= size[i]; - } - length *= outputSize; - - var array = new Array(length); - var codeSize = 0; - var codeBuf = 0; - // 32 is a valid bps so shifting won't work - var sampleMul = 1.0 / (Math.pow(2.0, bps) - 1); - - var strBytes = str.getBytes((length * bps + 7) / 8); - var strIdx = 0; - for (i = 0; i < length; i++) { - while (codeSize < bps) { - codeBuf <<= 8; - codeBuf |= strBytes[strIdx++]; - codeSize += 8; - } - codeSize -= bps; - array[i] = (codeBuf >> codeSize) * sampleMul; - codeBuf &= (1 << codeSize) - 1; - } - return array; - }, - - getIR: function PDFFunction_getIR(xref, fn) { - var dict = fn.dict; - if (!dict) { - dict = fn; - } - - var types = [this.constructSampled, - null, - this.constructInterpolated, - this.constructStiched, - this.constructPostScript]; - - var typeNum = dict.get('FunctionType'); - var typeFn = types[typeNum]; - if (!typeFn) { - error('Unknown type of function'); - } - - return typeFn.call(this, fn, dict, xref); - }, - - fromIR: function PDFFunction_fromIR(IR) { - var type = IR[0]; - switch (type) { - case CONSTRUCT_SAMPLED: - return this.constructSampledFromIR(IR); - case CONSTRUCT_INTERPOLATED: - return this.constructInterpolatedFromIR(IR); - case CONSTRUCT_STICHED: - return this.constructStichedFromIR(IR); - //case CONSTRUCT_POSTSCRIPT: - default: - return this.constructPostScriptFromIR(IR); - } - }, - - parse: function PDFFunction_parse(xref, fn) { - var IR = this.getIR(xref, fn); - return this.fromIR(IR); - }, - - parseArray: function PDFFunction_parseArray(xref, fnObj) { - if (!isArray(fnObj)) { - // not an array -- parsing as regular function - return this.parse(xref, fnObj); - } - - var fnArray = []; - for (var j = 0, jj = fnObj.length; j < jj; j++) { - var obj = xref.fetchIfRef(fnObj[j]); - fnArray.push(PDFFunction.parse(xref, obj)); - } - return function (src, srcOffset, dest, destOffset) { - for (var i = 0, ii = fnArray.length; i < ii; i++) { - fnArray[i](src, srcOffset, dest, destOffset + i); - } - }; - }, - - constructSampled: function PDFFunction_constructSampled(str, dict) { - function toMultiArray(arr) { - var inputLength = arr.length; - var out = []; - var index = 0; - for (var i = 0; i < inputLength; i += 2) { - out[index] = [arr[i], arr[i + 1]]; - ++index; - } - return out; - } - var domain = dict.get('Domain'); - var range = dict.get('Range'); - - if (!domain || !range) { - error('No domain or range'); - } - - var inputSize = domain.length / 2; - var outputSize = range.length / 2; - - domain = toMultiArray(domain); - range = toMultiArray(range); - - var size = dict.get('Size'); - var bps = dict.get('BitsPerSample'); - var order = dict.get('Order') || 1; - if (order !== 1) { - // No description how cubic spline interpolation works in PDF32000:2008 - // As in poppler, ignoring order, linear interpolation may work as good - info('No support for cubic spline interpolation: ' + order); - } - - var encode = dict.get('Encode'); - if (!encode) { - encode = []; - for (var i = 0; i < inputSize; ++i) { - encode.push(0); - encode.push(size[i] - 1); - } - } - encode = toMultiArray(encode); - - var decode = dict.get('Decode'); - if (!decode) { - decode = range; - } else { - decode = toMultiArray(decode); - } - - var samples = this.getSampleArray(size, outputSize, bps, str); - - return [ - CONSTRUCT_SAMPLED, inputSize, domain, encode, decode, samples, size, - outputSize, Math.pow(2, bps) - 1, range - ]; - }, - - constructSampledFromIR: function PDFFunction_constructSampledFromIR(IR) { - // See chapter 3, page 109 of the PDF reference - function interpolate(x, xmin, xmax, ymin, ymax) { - return ymin + ((x - xmin) * ((ymax - ymin) / (xmax - xmin))); - } - - return function constructSampledFromIRResult(src, srcOffset, - dest, destOffset) { - // See chapter 3, page 110 of the PDF reference. - var m = IR[1]; - var domain = IR[2]; - var encode = IR[3]; - var decode = IR[4]; - var samples = IR[5]; - var size = IR[6]; - var n = IR[7]; - //var mask = IR[8]; - var range = IR[9]; - - // Building the cube vertices: its part and sample index - // http://rjwagner49.com/Mathematics/Interpolation.pdf - var cubeVertices = 1 << m; - var cubeN = new Float64Array(cubeVertices); - var cubeVertex = new Uint32Array(cubeVertices); - var i, j; - for (j = 0; j < cubeVertices; j++) { - cubeN[j] = 1; - } - - var k = n, pos = 1; - // Map x_i to y_j for 0 <= i < m using the sampled function. - for (i = 0; i < m; ++i) { - // x_i' = min(max(x_i, Domain_2i), Domain_2i+1) - var domain_2i = domain[i][0]; - var domain_2i_1 = domain[i][1]; - var xi = Math.min(Math.max(src[srcOffset +i], domain_2i), - domain_2i_1); - - // e_i = Interpolate(x_i', Domain_2i, Domain_2i+1, - // Encode_2i, Encode_2i+1) - var e = interpolate(xi, domain_2i, domain_2i_1, - encode[i][0], encode[i][1]); - - // e_i' = min(max(e_i, 0), Size_i - 1) - var size_i = size[i]; - e = Math.min(Math.max(e, 0), size_i - 1); - - // Adjusting the cube: N and vertex sample index - var e0 = e < size_i - 1 ? Math.floor(e) : e - 1; // e1 = e0 + 1; - var n0 = e0 + 1 - e; // (e1 - e) / (e1 - e0); - var n1 = e - e0; // (e - e0) / (e1 - e0); - var offset0 = e0 * k; - var offset1 = offset0 + k; // e1 * k - for (j = 0; j < cubeVertices; j++) { - if (j & pos) { - cubeN[j] *= n1; - cubeVertex[j] += offset1; - } else { - cubeN[j] *= n0; - cubeVertex[j] += offset0; - } - } - - k *= size_i; - pos <<= 1; - } - - for (j = 0; j < n; ++j) { - // Sum all cube vertices' samples portions - var rj = 0; - for (i = 0; i < cubeVertices; i++) { - rj += samples[cubeVertex[i] + j] * cubeN[i]; - } - - // r_j' = Interpolate(r_j, 0, 2^BitsPerSample - 1, - // Decode_2j, Decode_2j+1) - rj = interpolate(rj, 0, 1, decode[j][0], decode[j][1]); - - // y_j = min(max(r_j, range_2j), range_2j+1) - dest[destOffset + j] = Math.min(Math.max(rj, range[j][0]), - range[j][1]); - } - }; - }, - - constructInterpolated: function PDFFunction_constructInterpolated(str, - dict) { - var c0 = dict.get('C0') || [0]; - var c1 = dict.get('C1') || [1]; - var n = dict.get('N'); - - if (!isArray(c0) || !isArray(c1)) { - error('Illegal dictionary for interpolated function'); - } - - var length = c0.length; - var diff = []; - for (var i = 0; i < length; ++i) { - diff.push(c1[i] - c0[i]); - } - - return [CONSTRUCT_INTERPOLATED, c0, diff, n]; - }, - - constructInterpolatedFromIR: - function PDFFunction_constructInterpolatedFromIR(IR) { - var c0 = IR[1]; - var diff = IR[2]; - var n = IR[3]; - - var length = diff.length; - - return function constructInterpolatedFromIRResult(src, srcOffset, - dest, destOffset) { - var x = n === 1 ? src[srcOffset] : Math.pow(src[srcOffset], n); - - for (var j = 0; j < length; ++j) { - dest[destOffset + j] = c0[j] + (x * diff[j]); - } - }; - }, - - constructStiched: function PDFFunction_constructStiched(fn, dict, xref) { - var domain = dict.get('Domain'); - - if (!domain) { - error('No domain'); - } - - var inputSize = domain.length / 2; - if (inputSize !== 1) { - error('Bad domain for stiched function'); - } - - var fnRefs = dict.get('Functions'); - var fns = []; - for (var i = 0, ii = fnRefs.length; i < ii; ++i) { - fns.push(PDFFunction.getIR(xref, xref.fetchIfRef(fnRefs[i]))); - } - - var bounds = dict.get('Bounds'); - var encode = dict.get('Encode'); - - return [CONSTRUCT_STICHED, domain, bounds, encode, fns]; - }, - - constructStichedFromIR: function PDFFunction_constructStichedFromIR(IR) { - var domain = IR[1]; - var bounds = IR[2]; - var encode = IR[3]; - var fnsIR = IR[4]; - var fns = []; - var tmpBuf = new Float32Array(1); - - for (var i = 0, ii = fnsIR.length; i < ii; i++) { - fns.push(PDFFunction.fromIR(fnsIR[i])); - } - - return function constructStichedFromIRResult(src, srcOffset, - dest, destOffset) { - var clip = function constructStichedFromIRClip(v, min, max) { - if (v > max) { - v = max; - } else if (v < min) { - v = min; - } - return v; - }; - - // clip to domain - var v = clip(src[srcOffset], domain[0], domain[1]); - // calulate which bound the value is in - for (var i = 0, ii = bounds.length; i < ii; ++i) { - if (v < bounds[i]) { - break; - } - } - - // encode value into domain of function - var dmin = domain[0]; - if (i > 0) { - dmin = bounds[i - 1]; - } - var dmax = domain[1]; - if (i < bounds.length) { - dmax = bounds[i]; - } - - var rmin = encode[2 * i]; - var rmax = encode[2 * i + 1]; - - // Prevent the value from becoming NaN as a result - // of division by zero (fixes issue6113.pdf). - tmpBuf[0] = dmin === dmax ? rmin : - rmin + (v - dmin) * (rmax - rmin) / (dmax - dmin); - - // call the appropriate function - fns[i](tmpBuf, 0, dest, destOffset); - }; - }, - - constructPostScript: function PDFFunction_constructPostScript(fn, dict, - xref) { - var domain = dict.get('Domain'); - var range = dict.get('Range'); - - if (!domain) { - error('No domain.'); - } - - if (!range) { - error('No range.'); - } - - var lexer = new PostScriptLexer(fn); - var parser = new PostScriptParser(lexer); - var code = parser.parse(); - - return [CONSTRUCT_POSTSCRIPT, domain, range, code]; - }, - - constructPostScriptFromIR: function PDFFunction_constructPostScriptFromIR( - IR) { - var domain = IR[1]; - var range = IR[2]; - var code = IR[3]; - - var compiled = (new PostScriptCompiler()).compile(code, domain, range); - if (compiled) { - // Compiled function consists of simple expressions such as addition, - // subtraction, Math.max, and also contains 'var' and 'return' - // statements. See the generation in the PostScriptCompiler below. - /*jshint -W054 */ - return new Function('src', 'srcOffset', 'dest', 'destOffset', compiled); - } - - info('Unable to compile PS function'); - - var numOutputs = range.length >> 1; - var numInputs = domain.length >> 1; - var evaluator = new PostScriptEvaluator(code); - // Cache the values for a big speed up, the cache size is limited though - // since the number of possible values can be huge from a PS function. - var cache = {}; - // The MAX_CACHE_SIZE is set to ~4x the maximum number of distinct values - // seen in our tests. - var MAX_CACHE_SIZE = 2048 * 4; - var cache_available = MAX_CACHE_SIZE; - var tmpBuf = new Float32Array(numInputs); - - return function constructPostScriptFromIRResult(src, srcOffset, - dest, destOffset) { - var i, value; - var key = ''; - var input = tmpBuf; - for (i = 0; i < numInputs; i++) { - value = src[srcOffset + i]; - input[i] = value; - key += value + '_'; - } - - var cachedValue = cache[key]; - if (cachedValue !== undefined) { - dest.set(cachedValue, destOffset); - return; - } - - var output = new Float32Array(numOutputs); - var stack = evaluator.execute(input); - var stackIndex = stack.length - numOutputs; - for (i = 0; i < numOutputs; i++) { - value = stack[stackIndex + i]; - var bound = range[i * 2]; - if (value < bound) { - value = bound; - } else { - bound = range[i * 2 +1]; - if (value > bound) { - value = bound; - } - } - output[i] = value; - } - if (cache_available > 0) { - cache_available--; - cache[key] = output; - } - dest.set(output, destOffset); - }; - } - }; -})(); - -function isPDFFunction(v) { - var fnDict; - if (typeof v !== 'object') { - return false; - } else if (isDict(v)) { - fnDict = v; - } else if (isStream(v)) { - fnDict = v.dict; - } else { - return false; - } - return fnDict.has('FunctionType'); -} - -var PostScriptStack = (function PostScriptStackClosure() { - var MAX_STACK_SIZE = 100; - function PostScriptStack(initialStack) { - this.stack = !initialStack ? [] : - Array.prototype.slice.call(initialStack, 0); - } - - PostScriptStack.prototype = { - push: function PostScriptStack_push(value) { - if (this.stack.length >= MAX_STACK_SIZE) { - error('PostScript function stack overflow.'); - } - this.stack.push(value); - }, - pop: function PostScriptStack_pop() { - if (this.stack.length <= 0) { - error('PostScript function stack underflow.'); - } - return this.stack.pop(); - }, - copy: function PostScriptStack_copy(n) { - if (this.stack.length + n >= MAX_STACK_SIZE) { - error('PostScript function stack overflow.'); - } - var stack = this.stack; - for (var i = stack.length - n, j = n - 1; j >= 0; j--, i++) { - stack.push(stack[i]); - } - }, - index: function PostScriptStack_index(n) { - this.push(this.stack[this.stack.length - n - 1]); - }, - // rotate the last n stack elements p times - roll: function PostScriptStack_roll(n, p) { - var stack = this.stack; - var l = stack.length - n; - var r = stack.length - 1, c = l + (p - Math.floor(p / n) * n), i, j, t; - for (i = l, j = r; i < j; i++, j--) { - t = stack[i]; stack[i] = stack[j]; stack[j] = t; - } - for (i = l, j = c - 1; i < j; i++, j--) { - t = stack[i]; stack[i] = stack[j]; stack[j] = t; - } - for (i = c, j = r; i < j; i++, j--) { - t = stack[i]; stack[i] = stack[j]; stack[j] = t; - } - } - }; - return PostScriptStack; -})(); -var PostScriptEvaluator = (function PostScriptEvaluatorClosure() { - function PostScriptEvaluator(operators) { - this.operators = operators; - } - PostScriptEvaluator.prototype = { - execute: function PostScriptEvaluator_execute(initialStack) { - var stack = new PostScriptStack(initialStack); - var counter = 0; - var operators = this.operators; - var length = operators.length; - var operator, a, b; - while (counter < length) { - operator = operators[counter++]; - if (typeof operator === 'number') { - // Operator is really an operand and should be pushed to the stack. - stack.push(operator); - continue; - } - switch (operator) { - // non standard ps operators - case 'jz': // jump if false - b = stack.pop(); - a = stack.pop(); - if (!a) { - counter = b; - } - break; - case 'j': // jump - a = stack.pop(); - counter = a; - break; - - // all ps operators in alphabetical order (excluding if/ifelse) - case 'abs': - a = stack.pop(); - stack.push(Math.abs(a)); - break; - case 'add': - b = stack.pop(); - a = stack.pop(); - stack.push(a + b); - break; - case 'and': - b = stack.pop(); - a = stack.pop(); - if (isBool(a) && isBool(b)) { - stack.push(a && b); - } else { - stack.push(a & b); - } - break; - case 'atan': - a = stack.pop(); - stack.push(Math.atan(a)); - break; - case 'bitshift': - b = stack.pop(); - a = stack.pop(); - if (a > 0) { - stack.push(a << b); - } else { - stack.push(a >> b); - } - break; - case 'ceiling': - a = stack.pop(); - stack.push(Math.ceil(a)); - break; - case 'copy': - a = stack.pop(); - stack.copy(a); - break; - case 'cos': - a = stack.pop(); - stack.push(Math.cos(a)); - break; - case 'cvi': - a = stack.pop() | 0; - stack.push(a); - break; - case 'cvr': - // noop - break; - case 'div': - b = stack.pop(); - a = stack.pop(); - stack.push(a / b); - break; - case 'dup': - stack.copy(1); - break; - case 'eq': - b = stack.pop(); - a = stack.pop(); - stack.push(a === b); - break; - case 'exch': - stack.roll(2, 1); - break; - case 'exp': - b = stack.pop(); - a = stack.pop(); - stack.push(Math.pow(a, b)); - break; - case 'false': - stack.push(false); - break; - case 'floor': - a = stack.pop(); - stack.push(Math.floor(a)); - break; - case 'ge': - b = stack.pop(); - a = stack.pop(); - stack.push(a >= b); - break; - case 'gt': - b = stack.pop(); - a = stack.pop(); - stack.push(a > b); - break; - case 'idiv': - b = stack.pop(); - a = stack.pop(); - stack.push((a / b) | 0); - break; - case 'index': - a = stack.pop(); - stack.index(a); - break; - case 'le': - b = stack.pop(); - a = stack.pop(); - stack.push(a <= b); - break; - case 'ln': - a = stack.pop(); - stack.push(Math.log(a)); - break; - case 'log': - a = stack.pop(); - stack.push(Math.log(a) / Math.LN10); - break; - case 'lt': - b = stack.pop(); - a = stack.pop(); - stack.push(a < b); - break; - case 'mod': - b = stack.pop(); - a = stack.pop(); - stack.push(a % b); - break; - case 'mul': - b = stack.pop(); - a = stack.pop(); - stack.push(a * b); - break; - case 'ne': - b = stack.pop(); - a = stack.pop(); - stack.push(a !== b); - break; - case 'neg': - a = stack.pop(); - stack.push(-a); - break; - case 'not': - a = stack.pop(); - if (isBool(a)) { - stack.push(!a); - } else { - stack.push(~a); - } - break; - case 'or': - b = stack.pop(); - a = stack.pop(); - if (isBool(a) && isBool(b)) { - stack.push(a || b); - } else { - stack.push(a | b); - } - break; - case 'pop': - stack.pop(); - break; - case 'roll': - b = stack.pop(); - a = stack.pop(); - stack.roll(a, b); - break; - case 'round': - a = stack.pop(); - stack.push(Math.round(a)); - break; - case 'sin': - a = stack.pop(); - stack.push(Math.sin(a)); - break; - case 'sqrt': - a = stack.pop(); - stack.push(Math.sqrt(a)); - break; - case 'sub': - b = stack.pop(); - a = stack.pop(); - stack.push(a - b); - break; - case 'true': - stack.push(true); - break; - case 'truncate': - a = stack.pop(); - a = a < 0 ? Math.ceil(a) : Math.floor(a); - stack.push(a); - break; - case 'xor': - b = stack.pop(); - a = stack.pop(); - if (isBool(a) && isBool(b)) { - stack.push(a !== b); - } else { - stack.push(a ^ b); - } - break; - default: - error('Unknown operator ' + operator); - break; - } - } - return stack.stack; - } - }; - return PostScriptEvaluator; -})(); - -// Most of the PDFs functions consist of simple operations such as: -// roll, exch, sub, cvr, pop, index, dup, mul, if, gt, add. -// -// We can compile most of such programs, and at the same moment, we can -// optimize some expressions using basic math properties. Keeping track of -// min/max values will allow us to avoid extra Math.min/Math.max calls. -var PostScriptCompiler = (function PostScriptCompilerClosure() { - function AstNode(type) { - this.type = type; - } - AstNode.prototype.visit = function (visitor) { - throw new Error('abstract method'); - }; - - function AstArgument(index, min, max) { - AstNode.call(this, 'args'); - this.index = index; - this.min = min; - this.max = max; - } - AstArgument.prototype = Object.create(AstNode.prototype); - AstArgument.prototype.visit = function (visitor) { - visitor.visitArgument(this); - }; - - function AstLiteral(number) { - AstNode.call(this, 'literal'); - this.number = number; - this.min = number; - this.max = number; - } - AstLiteral.prototype = Object.create(AstNode.prototype); - AstLiteral.prototype.visit = function (visitor) { - visitor.visitLiteral(this); - }; - - function AstBinaryOperation(op, arg1, arg2, min, max) { - AstNode.call(this, 'binary'); - this.op = op; - this.arg1 = arg1; - this.arg2 = arg2; - this.min = min; - this.max = max; - } - AstBinaryOperation.prototype = Object.create(AstNode.prototype); - AstBinaryOperation.prototype.visit = function (visitor) { - visitor.visitBinaryOperation(this); - }; - - function AstMin(arg, max) { - AstNode.call(this, 'max'); - this.arg = arg; - this.min = arg.min; - this.max = max; - } - AstMin.prototype = Object.create(AstNode.prototype); - AstMin.prototype.visit = function (visitor) { - visitor.visitMin(this); - }; - - function AstVariable(index, min, max) { - AstNode.call(this, 'var'); - this.index = index; - this.min = min; - this.max = max; - } - AstVariable.prototype = Object.create(AstNode.prototype); - AstVariable.prototype.visit = function (visitor) { - visitor.visitVariable(this); - }; - - function AstVariableDefinition(variable, arg) { - AstNode.call(this, 'definition'); - this.variable = variable; - this.arg = arg; - } - AstVariableDefinition.prototype = Object.create(AstNode.prototype); - AstVariableDefinition.prototype.visit = function (visitor) { - visitor.visitVariableDefinition(this); - }; - - function ExpressionBuilderVisitor() { - this.parts = []; - } - ExpressionBuilderVisitor.prototype = { - visitArgument: function (arg) { - this.parts.push('Math.max(', arg.min, ', Math.min(', - arg.max, ', src[srcOffset + ', arg.index, ']))'); - }, - visitVariable: function (variable) { - this.parts.push('v', variable.index); - }, - visitLiteral: function (literal) { - this.parts.push(literal.number); - }, - visitBinaryOperation: function (operation) { - this.parts.push('('); - operation.arg1.visit(this); - this.parts.push(' ', operation.op, ' '); - operation.arg2.visit(this); - this.parts.push(')'); - }, - visitVariableDefinition: function (definition) { - this.parts.push('var '); - definition.variable.visit(this); - this.parts.push(' = '); - definition.arg.visit(this); - this.parts.push(';'); - }, - visitMin: function (max) { - this.parts.push('Math.min('); - max.arg.visit(this); - this.parts.push(', ', max.max, ')'); - }, - toString: function () { - return this.parts.join(''); - } - }; - - function buildAddOperation(num1, num2) { - if (num2.type === 'literal' && num2.number === 0) { - // optimization: second operand is 0 - return num1; - } - if (num1.type === 'literal' && num1.number === 0) { - // optimization: first operand is 0 - return num2; - } - if (num2.type === 'literal' && num1.type === 'literal') { - // optimization: operands operand are literals - return new AstLiteral(num1.number + num2.number); - } - return new AstBinaryOperation('+', num1, num2, - num1.min + num2.min, num1.max + num2.max); - } - - function buildMulOperation(num1, num2) { - if (num2.type === 'literal') { - // optimization: second operands is a literal... - if (num2.number === 0) { - return new AstLiteral(0); // and it's 0 - } else if (num2.number === 1) { - return num1; // and it's 1 - } else if (num1.type === 'literal') { - // ... and first operands is a literal too - return new AstLiteral(num1.number * num2.number); - } - } - if (num1.type === 'literal') { - // optimization: first operands is a literal... - if (num1.number === 0) { - return new AstLiteral(0); // and it's 0 - } else if (num1.number === 1) { - return num2; // and it's 1 - } - } - var min = Math.min(num1.min * num2.min, num1.min * num2.max, - num1.max * num2.min, num1.max * num2.max); - var max = Math.max(num1.min * num2.min, num1.min * num2.max, - num1.max * num2.min, num1.max * num2.max); - return new AstBinaryOperation('*', num1, num2, min, max); - } - - function buildSubOperation(num1, num2) { - if (num2.type === 'literal') { - // optimization: second operands is a literal... - if (num2.number === 0) { - return num1; // ... and it's 0 - } else if (num1.type === 'literal') { - // ... and first operands is a literal too - return new AstLiteral(num1.number - num2.number); - } - } - if (num2.type === 'binary' && num2.op === '-' && - num1.type === 'literal' && num1.number === 1 && - num2.arg1.type === 'literal' && num2.arg1.number === 1) { - // optimization for case: 1 - (1 - x) - return num2.arg2; - } - return new AstBinaryOperation('-', num1, num2, - num1.min - num2.max, num1.max - num2.min); - } - - function buildMinOperation(num1, max) { - if (num1.min >= max) { - // optimization: num1 min value is not less than required max - return new AstLiteral(max); // just returning max - } else if (num1.max <= max) { - // optimization: num1 max value is not greater than required max - return num1; // just returning an argument - } - return new AstMin(num1, max); - } - - function PostScriptCompiler() {} - PostScriptCompiler.prototype = { - compile: function PostScriptCompiler_compile(code, domain, range) { - var stack = []; - var i, ii; - var instructions = []; - var inputSize = domain.length >> 1, outputSize = range.length >> 1; - var lastRegister = 0; - var n, j, min, max; - var num1, num2, ast1, ast2, tmpVar, item; - for (i = 0; i < inputSize; i++) { - stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1])); - } - - for (i = 0, ii = code.length; i < ii; i++) { - item = code[i]; - if (typeof item === 'number') { - stack.push(new AstLiteral(item)); - continue; - } - - switch (item) { - case 'add': - if (stack.length < 2) { - return null; - } - num2 = stack.pop(); - num1 = stack.pop(); - stack.push(buildAddOperation(num1, num2)); - break; - case 'cvr': - if (stack.length < 1) { - return null; - } - break; - case 'mul': - if (stack.length < 2) { - return null; - } - num2 = stack.pop(); - num1 = stack.pop(); - stack.push(buildMulOperation(num1, num2)); - break; - case 'sub': - if (stack.length < 2) { - return null; - } - num2 = stack.pop(); - num1 = stack.pop(); - stack.push(buildSubOperation(num1, num2)); - break; - case 'exch': - if (stack.length < 2) { - return null; - } - ast1 = stack.pop(); ast2 = stack.pop(); - stack.push(ast1, ast2); - break; - case 'pop': - if (stack.length < 1) { - return null; - } - stack.pop(); - break; - case 'index': - if (stack.length < 1) { - return null; - } - num1 = stack.pop(); - if (num1.type !== 'literal') { - return null; - } - n = num1.number; - if (n < 0 || (n|0) !== n || stack.length < n) { - return null; - } - ast1 = stack[stack.length - n - 1]; - if (ast1.type === 'literal' || ast1.type === 'var') { - stack.push(ast1); - break; - } - tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); - stack[stack.length - n - 1] = tmpVar; - stack.push(tmpVar); - instructions.push(new AstVariableDefinition(tmpVar, ast1)); - break; - case 'dup': - if (stack.length < 1) { - return null; - } - if (typeof code[i + 1] === 'number' && code[i + 2] === 'gt' && - code[i + 3] === i + 7 && code[i + 4] === 'jz' && - code[i + 5] === 'pop' && code[i + 6] === code[i + 1]) { - // special case of the commands sequence for the min operation - num1 = stack.pop(); - stack.push(buildMinOperation(num1, code[i + 1])); - i += 6; - break; - } - ast1 = stack[stack.length - 1]; - if (ast1.type === 'literal' || ast1.type === 'var') { - // we don't have to save into intermediate variable a literal or - // variable. - stack.push(ast1); - break; - } - tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); - stack[stack.length - 1] = tmpVar; - stack.push(tmpVar); - instructions.push(new AstVariableDefinition(tmpVar, ast1)); - break; - case 'roll': - if (stack.length < 2) { - return null; - } - num2 = stack.pop(); - num1 = stack.pop(); - if (num2.type !== 'literal' || num1.type !== 'literal') { - // both roll operands must be numbers - return null; - } - j = num2.number; - n = num1.number; - if (n <= 0 || (n|0) !== n || (j|0) !== j || stack.length < n) { - // ... and integers - return null; - } - j = ((j % n) + n) % n; - if (j === 0) { - break; // just skipping -- there are nothing to rotate - } - Array.prototype.push.apply(stack, - stack.splice(stack.length - n, n - j)); - break; - default: - return null; // unsupported operator - } - } - - if (stack.length !== outputSize) { - return null; - } - - var result = []; - instructions.forEach(function (instruction) { - var statementBuilder = new ExpressionBuilderVisitor(); - instruction.visit(statementBuilder); - result.push(statementBuilder.toString()); - }); - stack.forEach(function (expr, i) { - var statementBuilder = new ExpressionBuilderVisitor(); - expr.visit(statementBuilder); - var min = range[i * 2], max = range[i * 2 + 1]; - var out = [statementBuilder.toString()]; - if (min > expr.min) { - out.unshift('Math.max(', min, ', '); - out.push(')'); - } - if (max < expr.max) { - out.unshift('Math.min(', max, ', '); - out.push(')'); - } - out.unshift('dest[destOffset + ', i, '] = '); - out.push(';'); - result.push(out.join('')); - }); - return result.join('\n'); - } - }; - - return PostScriptCompiler; -})(); - - -var ColorSpace = (function ColorSpaceClosure() { - // Constructor should define this.numComps, this.defaultColor, this.name - function ColorSpace() { - error('should not call ColorSpace constructor'); - } - - ColorSpace.prototype = { - /** - * Converts the color value to the RGB color. The color components are - * located in the src array starting from the srcOffset. Returns the array - * of the rgb components, each value ranging from [0,255]. - */ - getRgb: function ColorSpace_getRgb(src, srcOffset) { - var rgb = new Uint8Array(3); - this.getRgbItem(src, srcOffset, rgb, 0); - return rgb; - }, - /** - * Converts the color value to the RGB color, similar to the getRgb method. - * The result placed into the dest array starting from the destOffset. - */ - getRgbItem: function ColorSpace_getRgbItem(src, srcOffset, - dest, destOffset) { - error('Should not call ColorSpace.getRgbItem'); - }, - /** - * Converts the specified number of the color values to the RGB colors. - * The colors are located in the src array starting from the srcOffset. - * The result is placed into the dest array starting from the destOffset. - * The src array items shall be in [0,2^bits) range, the dest array items - * will be in [0,255] range. alpha01 indicates how many alpha components - * there are in the dest array; it will be either 0 (RGB array) or 1 (RGBA - * array). - */ - getRgbBuffer: function ColorSpace_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - error('Should not call ColorSpace.getRgbBuffer'); - }, - /** - * Determines the number of bytes required to store the result of the - * conversion done by the getRgbBuffer method. As in getRgbBuffer, - * |alpha01| is either 0 (RGB output) or 1 (RGBA output). - */ - getOutputLength: function ColorSpace_getOutputLength(inputLength, - alpha01) { - error('Should not call ColorSpace.getOutputLength'); - }, - /** - * Returns true if source data will be equal the result/output data. - */ - isPassthrough: function ColorSpace_isPassthrough(bits) { - return false; - }, - /** - * Fills in the RGB colors in the destination buffer. alpha01 indicates - * how many alpha components there are in the dest array; it will be either - * 0 (RGB array) or 1 (RGBA array). - */ - fillRgb: function ColorSpace_fillRgb(dest, originalWidth, - originalHeight, width, height, - actualHeight, bpc, comps, alpha01) { - var count = originalWidth * originalHeight; - var rgbBuf = null; - var numComponentColors = 1 << bpc; - var needsResizing = originalHeight !== height || originalWidth !== width; - var i, ii; - - if (this.isPassthrough(bpc)) { - rgbBuf = comps; - } else if (this.numComps === 1 && count > numComponentColors && - this.name !== 'DeviceGray' && this.name !== 'DeviceRGB') { - // Optimization: create a color map when there is just one component and - // we are converting more colors than the size of the color map. We - // don't build the map if the colorspace is gray or rgb since those - // methods are faster than building a map. This mainly offers big speed - // ups for indexed and alternate colorspaces. - // - // TODO it may be worth while to cache the color map. While running - // testing I never hit a cache so I will leave that out for now (perhaps - // we are reparsing colorspaces too much?). - var allColors = bpc <= 8 ? new Uint8Array(numComponentColors) : - new Uint16Array(numComponentColors); - var key; - for (i = 0; i < numComponentColors; i++) { - allColors[i] = i; - } - var colorMap = new Uint8Array(numComponentColors * 3); - this.getRgbBuffer(allColors, 0, numComponentColors, colorMap, 0, bpc, - /* alpha01 = */ 0); - - var destPos, rgbPos; - if (!needsResizing) { - // Fill in the RGB values directly into |dest|. - destPos = 0; - for (i = 0; i < count; ++i) { - key = comps[i] * 3; - dest[destPos++] = colorMap[key]; - dest[destPos++] = colorMap[key + 1]; - dest[destPos++] = colorMap[key + 2]; - destPos += alpha01; - } - } else { - rgbBuf = new Uint8Array(count * 3); - rgbPos = 0; - for (i = 0; i < count; ++i) { - key = comps[i] * 3; - rgbBuf[rgbPos++] = colorMap[key]; - rgbBuf[rgbPos++] = colorMap[key + 1]; - rgbBuf[rgbPos++] = colorMap[key + 2]; - } - } - } else { - if (!needsResizing) { - // Fill in the RGB values directly into |dest|. - this.getRgbBuffer(comps, 0, width * actualHeight, dest, 0, bpc, - alpha01); - } else { - rgbBuf = new Uint8Array(count * 3); - this.getRgbBuffer(comps, 0, count, rgbBuf, 0, bpc, - /* alpha01 = */ 0); - } - } - - if (rgbBuf) { - if (needsResizing) { - PDFImage.resize(rgbBuf, bpc, 3, originalWidth, originalHeight, width, - height, dest, alpha01); - } else { - rgbPos = 0; - destPos = 0; - for (i = 0, ii = width * actualHeight; i < ii; i++) { - dest[destPos++] = rgbBuf[rgbPos++]; - dest[destPos++] = rgbBuf[rgbPos++]; - dest[destPos++] = rgbBuf[rgbPos++]; - destPos += alpha01; - } - } - } - }, - /** - * True if the colorspace has components in the default range of [0, 1]. - * This should be true for all colorspaces except for lab color spaces - * which are [0,100], [-128, 127], [-128, 127]. - */ - usesZeroToOneRange: true - }; - - ColorSpace.parse = function ColorSpace_parse(cs, xref, res) { - var IR = ColorSpace.parseToIR(cs, xref, res); - if (IR instanceof AlternateCS) { - return IR; - } - return ColorSpace.fromIR(IR); - }; - - ColorSpace.fromIR = function ColorSpace_fromIR(IR) { - var name = isArray(IR) ? IR[0] : IR; - var whitePoint, blackPoint, gamma; - - switch (name) { - case 'DeviceGrayCS': - return this.singletons.gray; - case 'DeviceRgbCS': - return this.singletons.rgb; - case 'DeviceCmykCS': - return this.singletons.cmyk; - case 'CalGrayCS': - whitePoint = IR[1].WhitePoint; - blackPoint = IR[1].BlackPoint; - gamma = IR[1].Gamma; - return new CalGrayCS(whitePoint, blackPoint, gamma); - case 'CalRGBCS': - whitePoint = IR[1].WhitePoint; - blackPoint = IR[1].BlackPoint; - gamma = IR[1].Gamma; - var matrix = IR[1].Matrix; - return new CalRGBCS(whitePoint, blackPoint, gamma, matrix); - case 'PatternCS': - var basePatternCS = IR[1]; - if (basePatternCS) { - basePatternCS = ColorSpace.fromIR(basePatternCS); - } - return new PatternCS(basePatternCS); - case 'IndexedCS': - var baseIndexedCS = IR[1]; - var hiVal = IR[2]; - var lookup = IR[3]; - return new IndexedCS(ColorSpace.fromIR(baseIndexedCS), hiVal, lookup); - case 'AlternateCS': - var numComps = IR[1]; - var alt = IR[2]; - var tintFnIR = IR[3]; - - return new AlternateCS(numComps, ColorSpace.fromIR(alt), - PDFFunction.fromIR(tintFnIR)); - case 'LabCS': - whitePoint = IR[1].WhitePoint; - blackPoint = IR[1].BlackPoint; - var range = IR[1].Range; - return new LabCS(whitePoint, blackPoint, range); - default: - error('Unknown name ' + name); - } - return null; - }; - - ColorSpace.parseToIR = function ColorSpace_parseToIR(cs, xref, res) { - if (isName(cs)) { - var colorSpaces = res.get('ColorSpace'); - if (isDict(colorSpaces)) { - var refcs = colorSpaces.get(cs.name); - if (refcs) { - cs = refcs; - } - } - } - - cs = xref.fetchIfRef(cs); - var mode; - - if (isName(cs)) { - mode = cs.name; - this.mode = mode; - - switch (mode) { - case 'DeviceGray': - case 'G': - return 'DeviceGrayCS'; - case 'DeviceRGB': - case 'RGB': - return 'DeviceRgbCS'; - case 'DeviceCMYK': - case 'CMYK': - return 'DeviceCmykCS'; - case 'Pattern': - return ['PatternCS', null]; - default: - error('unrecognized colorspace ' + mode); - } - } else if (isArray(cs)) { - mode = xref.fetchIfRef(cs[0]).name; - this.mode = mode; - var numComps, params, alt; - - switch (mode) { - case 'DeviceGray': - case 'G': - return 'DeviceGrayCS'; - case 'DeviceRGB': - case 'RGB': - return 'DeviceRgbCS'; - case 'DeviceCMYK': - case 'CMYK': - return 'DeviceCmykCS'; - case 'CalGray': - params = xref.fetchIfRef(cs[1]).getAll(); - return ['CalGrayCS', params]; - case 'CalRGB': - params = xref.fetchIfRef(cs[1]).getAll(); - return ['CalRGBCS', params]; - case 'ICCBased': - var stream = xref.fetchIfRef(cs[1]); - var dict = stream.dict; - numComps = dict.get('N'); - alt = dict.get('Alternate'); - if (alt) { - var altIR = ColorSpace.parseToIR(alt, xref, res); - // Parse the /Alternate CS to ensure that the number of components - // are correct, and also (indirectly) that it is not a PatternCS. - var altCS = ColorSpace.fromIR(altIR); - if (altCS.numComps === numComps) { - return altIR; - } - warn('ICCBased color space: Ignoring incorrect /Alternate entry.'); - } - if (numComps === 1) { - return 'DeviceGrayCS'; - } else if (numComps === 3) { - return 'DeviceRgbCS'; - } else if (numComps === 4) { - return 'DeviceCmykCS'; - } - break; - case 'Pattern': - var basePatternCS = cs[1] || null; - if (basePatternCS) { - basePatternCS = ColorSpace.parseToIR(basePatternCS, xref, res); - } - return ['PatternCS', basePatternCS]; - case 'Indexed': - case 'I': - var baseIndexedCS = ColorSpace.parseToIR(cs[1], xref, res); - var hiVal = xref.fetchIfRef(cs[2]) + 1; - var lookup = xref.fetchIfRef(cs[3]); - if (isStream(lookup)) { - lookup = lookup.getBytes(); - } - return ['IndexedCS', baseIndexedCS, hiVal, lookup]; - case 'Separation': - case 'DeviceN': - var name = xref.fetchIfRef(cs[1]); - numComps = 1; - if (isName(name)) { - numComps = 1; - } else if (isArray(name)) { - numComps = name.length; - } - alt = ColorSpace.parseToIR(cs[2], xref, res); - var tintFnIR = PDFFunction.getIR(xref, xref.fetchIfRef(cs[3])); - return ['AlternateCS', numComps, alt, tintFnIR]; - case 'Lab': - params = xref.fetchIfRef(cs[1]).getAll(); - return ['LabCS', params]; - default: - error('unimplemented color space object "' + mode + '"'); - } - } else { - error('unrecognized color space object: "' + cs + '"'); - } - return null; - }; - /** - * Checks if a decode map matches the default decode map for a color space. - * This handles the general decode maps where there are two values per - * component. e.g. [0, 1, 0, 1, 0, 1] for a RGB color. - * This does not handle Lab, Indexed, or Pattern decode maps since they are - * slightly different. - * @param {Array} decode Decode map (usually from an image). - * @param {Number} n Number of components the color space has. - */ - ColorSpace.isDefaultDecode = function ColorSpace_isDefaultDecode(decode, n) { - if (!isArray(decode)) { - return true; - } - - if (n * 2 !== decode.length) { - warn('The decode map is not the correct length'); - return true; - } - for (var i = 0, ii = decode.length; i < ii; i += 2) { - if (decode[i] !== 0 || decode[i + 1] !== 1) { - return false; - } - } - return true; - }; - - ColorSpace.singletons = { - get gray() { - return shadow(this, 'gray', new DeviceGrayCS()); - }, - get rgb() { - return shadow(this, 'rgb', new DeviceRgbCS()); - }, - get cmyk() { - return shadow(this, 'cmyk', new DeviceCmykCS()); - } - }; - - return ColorSpace; -})(); - -/** - * Alternate color space handles both Separation and DeviceN color spaces. A - * Separation color space is actually just a DeviceN with one color component. - * Both color spaces use a tinting function to convert colors to a base color - * space. - */ -var AlternateCS = (function AlternateCSClosure() { - function AlternateCS(numComps, base, tintFn) { - this.name = 'Alternate'; - this.numComps = numComps; - this.defaultColor = new Float32Array(numComps); - for (var i = 0; i < numComps; ++i) { - this.defaultColor[i] = 1; - } - this.base = base; - this.tintFn = tintFn; - this.tmpBuf = new Float32Array(base.numComps); - } - - AlternateCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function AlternateCS_getRgbItem(src, srcOffset, - dest, destOffset) { - var tmpBuf = this.tmpBuf; - this.tintFn(src, srcOffset, tmpBuf, 0); - this.base.getRgbItem(tmpBuf, 0, dest, destOffset); - }, - getRgbBuffer: function AlternateCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var tintFn = this.tintFn; - var base = this.base; - var scale = 1 / ((1 << bits) - 1); - var baseNumComps = base.numComps; - var usesZeroToOneRange = base.usesZeroToOneRange; - var isPassthrough = (base.isPassthrough(8) || !usesZeroToOneRange) && - alpha01 === 0; - var pos = isPassthrough ? destOffset : 0; - var baseBuf = isPassthrough ? dest : new Uint8Array(baseNumComps * count); - var numComps = this.numComps; - - var scaled = new Float32Array(numComps); - var tinted = new Float32Array(baseNumComps); - var i, j; - if (usesZeroToOneRange) { - for (i = 0; i < count; i++) { - for (j = 0; j < numComps; j++) { - scaled[j] = src[srcOffset++] * scale; - } - tintFn(scaled, 0, tinted, 0); - for (j = 0; j < baseNumComps; j++) { - baseBuf[pos++] = tinted[j] * 255; - } - } - } else { - for (i = 0; i < count; i++) { - for (j = 0; j < numComps; j++) { - scaled[j] = src[srcOffset++] * scale; - } - tintFn(scaled, 0, tinted, 0); - base.getRgbItem(tinted, 0, baseBuf, pos); - pos += baseNumComps; - } - } - if (!isPassthrough) { - base.getRgbBuffer(baseBuf, 0, count, dest, destOffset, 8, alpha01); - } - }, - getOutputLength: function AlternateCS_getOutputLength(inputLength, - alpha01) { - return this.base.getOutputLength(inputLength * - this.base.numComps / this.numComps, - alpha01); - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function AlternateCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - - return AlternateCS; -})(); - -var PatternCS = (function PatternCSClosure() { - function PatternCS(baseCS) { - this.name = 'Pattern'; - this.base = baseCS; - } - PatternCS.prototype = {}; - - return PatternCS; -})(); - -var IndexedCS = (function IndexedCSClosure() { - function IndexedCS(base, highVal, lookup) { - this.name = 'Indexed'; - this.numComps = 1; - this.defaultColor = new Uint8Array([0]); - this.base = base; - this.highVal = highVal; - - var baseNumComps = base.numComps; - var length = baseNumComps * highVal; - var lookupArray; - - if (isStream(lookup)) { - lookupArray = new Uint8Array(length); - var bytes = lookup.getBytes(length); - lookupArray.set(bytes); - } else if (isString(lookup)) { - lookupArray = new Uint8Array(length); - for (var i = 0; i < length; ++i) { - lookupArray[i] = lookup.charCodeAt(i); - } - } else if (lookup instanceof Uint8Array || lookup instanceof Array) { - lookupArray = lookup; - } else { - error('Unrecognized lookup table: ' + lookup); - } - this.lookup = lookupArray; - } - - IndexedCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function IndexedCS_getRgbItem(src, srcOffset, - dest, destOffset) { - var numComps = this.base.numComps; - var start = src[srcOffset] * numComps; - this.base.getRgbItem(this.lookup, start, dest, destOffset); - }, - getRgbBuffer: function IndexedCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var base = this.base; - var numComps = base.numComps; - var outputDelta = base.getOutputLength(numComps, alpha01); - var lookup = this.lookup; - - for (var i = 0; i < count; ++i) { - var lookupPos = src[srcOffset++] * numComps; - base.getRgbBuffer(lookup, lookupPos, 1, dest, destOffset, 8, alpha01); - destOffset += outputDelta; - } - }, - getOutputLength: function IndexedCS_getOutputLength(inputLength, alpha01) { - return this.base.getOutputLength(inputLength * this.base.numComps, - alpha01); - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function IndexedCS_isDefaultDecode(decodeMap) { - // indexed color maps shouldn't be changed - return true; - }, - usesZeroToOneRange: true - }; - return IndexedCS; -})(); - -var DeviceGrayCS = (function DeviceGrayCSClosure() { - function DeviceGrayCS() { - this.name = 'DeviceGray'; - this.numComps = 1; - this.defaultColor = new Float32Array([0]); - } - - DeviceGrayCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function DeviceGrayCS_getRgbItem(src, srcOffset, - dest, destOffset) { - var c = (src[srcOffset] * 255) | 0; - c = c < 0 ? 0 : c > 255 ? 255 : c; - dest[destOffset] = dest[destOffset + 1] = dest[destOffset + 2] = c; - }, - getRgbBuffer: function DeviceGrayCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var scale = 255 / ((1 << bits) - 1); - var j = srcOffset, q = destOffset; - for (var i = 0; i < count; ++i) { - var c = (scale * src[j++]) | 0; - dest[q++] = c; - dest[q++] = c; - dest[q++] = c; - q += alpha01; - } - }, - getOutputLength: function DeviceGrayCS_getOutputLength(inputLength, - alpha01) { - return inputLength * (3 + alpha01); - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function DeviceGrayCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - return DeviceGrayCS; -})(); - -var DeviceRgbCS = (function DeviceRgbCSClosure() { - function DeviceRgbCS() { - this.name = 'DeviceRGB'; - this.numComps = 3; - this.defaultColor = new Float32Array([0, 0, 0]); - } - DeviceRgbCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function DeviceRgbCS_getRgbItem(src, srcOffset, - dest, destOffset) { - var r = (src[srcOffset] * 255) | 0; - var g = (src[srcOffset + 1] * 255) | 0; - var b = (src[srcOffset + 2] * 255) | 0; - dest[destOffset] = r < 0 ? 0 : r > 255 ? 255 : r; - dest[destOffset + 1] = g < 0 ? 0 : g > 255 ? 255 : g; - dest[destOffset + 2] = b < 0 ? 0 : b > 255 ? 255 : b; - }, - getRgbBuffer: function DeviceRgbCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - if (bits === 8 && alpha01 === 0) { - dest.set(src.subarray(srcOffset, srcOffset + count * 3), destOffset); - return; - } - var scale = 255 / ((1 << bits) - 1); - var j = srcOffset, q = destOffset; - for (var i = 0; i < count; ++i) { - dest[q++] = (scale * src[j++]) | 0; - dest[q++] = (scale * src[j++]) | 0; - dest[q++] = (scale * src[j++]) | 0; - q += alpha01; - } - }, - getOutputLength: function DeviceRgbCS_getOutputLength(inputLength, - alpha01) { - return (inputLength * (3 + alpha01) / 3) | 0; - }, - isPassthrough: function DeviceRgbCS_isPassthrough(bits) { - return bits === 8; - }, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function DeviceRgbCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - return DeviceRgbCS; -})(); - -var DeviceCmykCS = (function DeviceCmykCSClosure() { - // The coefficients below was found using numerical analysis: the method of - // steepest descent for the sum((f_i - color_value_i)^2) for r/g/b colors, - // where color_value is the tabular value from the table of sampled RGB colors - // from CMYK US Web Coated (SWOP) colorspace, and f_i is the corresponding - // CMYK color conversion using the estimation below: - // f(A, B,.. N) = Acc+Bcm+Ccy+Dck+c+Fmm+Gmy+Hmk+Im+Jyy+Kyk+Ly+Mkk+Nk+255 - function convertToRgb(src, srcOffset, srcScale, dest, destOffset) { - var c = src[srcOffset + 0] * srcScale; - var m = src[srcOffset + 1] * srcScale; - var y = src[srcOffset + 2] * srcScale; - var k = src[srcOffset + 3] * srcScale; - - var r = - (c * (-4.387332384609988 * c + 54.48615194189176 * m + - 18.82290502165302 * y + 212.25662451639585 * k + - -285.2331026137004) + - m * (1.7149763477362134 * m - 5.6096736904047315 * y + - -17.873870861415444 * k - 5.497006427196366) + - y * (-2.5217340131683033 * y - 21.248923337353073 * k + - 17.5119270841813) + - k * (-21.86122147463605 * k - 189.48180835922747) + 255) | 0; - var g = - (c * (8.841041422036149 * c + 60.118027045597366 * m + - 6.871425592049007 * y + 31.159100130055922 * k + - -79.2970844816548) + - m * (-15.310361306967817 * m + 17.575251261109482 * y + - 131.35250912493976 * k - 190.9453302588951) + - y * (4.444339102852739 * y + 9.8632861493405 * k - 24.86741582555878) + - k * (-20.737325471181034 * k - 187.80453709719578) + 255) | 0; - var b = - (c * (0.8842522430003296 * c + 8.078677503112928 * m + - 30.89978309703729 * y - 0.23883238689178934 * k + - -14.183576799673286) + - m * (10.49593273432072 * m + 63.02378494754052 * y + - 50.606957656360734 * k - 112.23884253719248) + - y * (0.03296041114873217 * y + 115.60384449646641 * k + - -193.58209356861505) + - k * (-22.33816807309886 * k - 180.12613974708367) + 255) | 0; - - dest[destOffset] = r > 255 ? 255 : r < 0 ? 0 : r; - dest[destOffset + 1] = g > 255 ? 255 : g < 0 ? 0 : g; - dest[destOffset + 2] = b > 255 ? 255 : b < 0 ? 0 : b; - } - - function DeviceCmykCS() { - this.name = 'DeviceCMYK'; - this.numComps = 4; - this.defaultColor = new Float32Array([0, 0, 0, 1]); - } - DeviceCmykCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function DeviceCmykCS_getRgbItem(src, srcOffset, - dest, destOffset) { - convertToRgb(src, srcOffset, 1, dest, destOffset); - }, - getRgbBuffer: function DeviceCmykCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var scale = 1 / ((1 << bits) - 1); - for (var i = 0; i < count; i++) { - convertToRgb(src, srcOffset, scale, dest, destOffset); - srcOffset += 4; - destOffset += 3 + alpha01; - } - }, - getOutputLength: function DeviceCmykCS_getOutputLength(inputLength, - alpha01) { - return (inputLength / 4 * (3 + alpha01)) | 0; - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function DeviceCmykCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - - return DeviceCmykCS; -})(); - -// -// CalGrayCS: Based on "PDF Reference, Sixth Ed", p.245 -// -var CalGrayCS = (function CalGrayCSClosure() { - function CalGrayCS(whitePoint, blackPoint, gamma) { - this.name = 'CalGray'; - this.numComps = 1; - this.defaultColor = new Float32Array([0]); - - if (!whitePoint) { - error('WhitePoint missing - required for color space CalGray'); - } - blackPoint = blackPoint || [0, 0, 0]; - gamma = gamma || 1; - - // Translate arguments to spec variables. - this.XW = whitePoint[0]; - this.YW = whitePoint[1]; - this.ZW = whitePoint[2]; - - this.XB = blackPoint[0]; - this.YB = blackPoint[1]; - this.ZB = blackPoint[2]; - - this.G = gamma; - - // Validate variables as per spec. - if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { - error('Invalid WhitePoint components for ' + this.name + - ', no fallback available'); - } - - if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { - info('Invalid BlackPoint for ' + this.name + ', falling back to default'); - this.XB = this.YB = this.ZB = 0; - } - - if (this.XB !== 0 || this.YB !== 0 || this.ZB !== 0) { - warn(this.name + ', BlackPoint: XB: ' + this.XB + ', YB: ' + this.YB + - ', ZB: ' + this.ZB + ', only default values are supported.'); - } - - if (this.G < 1) { - info('Invalid Gamma: ' + this.G + ' for ' + this.name + - ', falling back to default'); - this.G = 1; - } - } - - function convertToRgb(cs, src, srcOffset, dest, destOffset, scale) { - // A represents a gray component of a calibrated gray space. - // A <---> AG in the spec - var A = src[srcOffset] * scale; - var AG = Math.pow(A, cs.G); - - // Computes L as per spec. ( = cs.YW * AG ) - // Except if other than default BlackPoint values are used. - var L = cs.YW * AG; - // http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html, Ch 4. - // Convert values to rgb range [0, 255]. - var val = Math.max(295.8 * Math.pow(L, 0.333333333333333333) - 40.8, 0) | 0; - dest[destOffset] = val; - dest[destOffset + 1] = val; - dest[destOffset + 2] = val; - } - - CalGrayCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function CalGrayCS_getRgbItem(src, srcOffset, - dest, destOffset) { - convertToRgb(this, src, srcOffset, dest, destOffset, 1); - }, - getRgbBuffer: function CalGrayCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var scale = 1 / ((1 << bits) - 1); - - for (var i = 0; i < count; ++i) { - convertToRgb(this, src, srcOffset, dest, destOffset, scale); - srcOffset += 1; - destOffset += 3 + alpha01; - } - }, - getOutputLength: function CalGrayCS_getOutputLength(inputLength, alpha01) { - return inputLength * (3 + alpha01); - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function CalGrayCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - return CalGrayCS; -})(); - -// -// CalRGBCS: Based on "PDF Reference, Sixth Ed", p.247 -// -var CalRGBCS = (function CalRGBCSClosure() { - - // See http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html for these - // matrices. - var BRADFORD_SCALE_MATRIX = new Float32Array([ - 0.8951, 0.2664, -0.1614, - -0.7502, 1.7135, 0.0367, - 0.0389, -0.0685, 1.0296]); - - var BRADFORD_SCALE_INVERSE_MATRIX = new Float32Array([ - 0.9869929, -0.1470543, 0.1599627, - 0.4323053, 0.5183603, 0.0492912, - -0.0085287, 0.0400428, 0.9684867]); - - // See http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html. - var SRGB_D65_XYZ_TO_RGB_MATRIX = new Float32Array([ - 3.2404542, -1.5371385, -0.4985314, - -0.9692660, 1.8760108, 0.0415560, - 0.0556434, -0.2040259, 1.0572252]); - - var FLAT_WHITEPOINT_MATRIX = new Float32Array([1, 1, 1]); - - var tempNormalizeMatrix = new Float32Array(3); - var tempConvertMatrix1 = new Float32Array(3); - var tempConvertMatrix2 = new Float32Array(3); - - var DECODE_L_CONSTANT = Math.pow(((8 + 16) / 116), 3) / 8.0; - - function CalRGBCS(whitePoint, blackPoint, gamma, matrix) { - this.name = 'CalRGB'; - this.numComps = 3; - this.defaultColor = new Float32Array(3); - - if (!whitePoint) { - error('WhitePoint missing - required for color space CalRGB'); - } - blackPoint = blackPoint || new Float32Array(3); - gamma = gamma || new Float32Array([1, 1, 1]); - matrix = matrix || new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]); - - // Translate arguments to spec variables. - var XW = whitePoint[0]; - var YW = whitePoint[1]; - var ZW = whitePoint[2]; - this.whitePoint = whitePoint; - - var XB = blackPoint[0]; - var YB = blackPoint[1]; - var ZB = blackPoint[2]; - this.blackPoint = blackPoint; - - this.GR = gamma[0]; - this.GG = gamma[1]; - this.GB = gamma[2]; - - this.MXA = matrix[0]; - this.MYA = matrix[1]; - this.MZA = matrix[2]; - this.MXB = matrix[3]; - this.MYB = matrix[4]; - this.MZB = matrix[5]; - this.MXC = matrix[6]; - this.MYC = matrix[7]; - this.MZC = matrix[8]; - - // Validate variables as per spec. - if (XW < 0 || ZW < 0 || YW !== 1) { - error('Invalid WhitePoint components for ' + this.name + - ', no fallback available'); - } - - if (XB < 0 || YB < 0 || ZB < 0) { - info('Invalid BlackPoint for ' + this.name + ' [' + XB + ', ' + YB + - ', ' + ZB + '], falling back to default'); - this.blackPoint = new Float32Array(3); - } - - if (this.GR < 0 || this.GG < 0 || this.GB < 0) { - info('Invalid Gamma [' + this.GR + ', ' + this.GG + ', ' + this.GB + - '] for ' + this.name + ', falling back to default'); - this.GR = this.GG = this.GB = 1; - } - - if (this.MXA < 0 || this.MYA < 0 || this.MZA < 0 || - this.MXB < 0 || this.MYB < 0 || this.MZB < 0 || - this.MXC < 0 || this.MYC < 0 || this.MZC < 0) { - info('Invalid Matrix for ' + this.name + ' [' + - this.MXA + ', ' + this.MYA + ', ' + this.MZA + - this.MXB + ', ' + this.MYB + ', ' + this.MZB + - this.MXC + ', ' + this.MYC + ', ' + this.MZC + - '], falling back to default'); - this.MXA = this.MYB = this.MZC = 1; - this.MXB = this.MYA = this.MZA = this.MXC = this.MYC = this.MZB = 0; - } - } - - function matrixProduct(a, b, result) { - result[0] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; - result[1] = a[3] * b[0] + a[4] * b[1] + a[5] * b[2]; - result[2] = a[6] * b[0] + a[7] * b[1] + a[8] * b[2]; - } - - function convertToFlat(sourceWhitePoint, LMS, result) { - result[0] = LMS[0] * 1 / sourceWhitePoint[0]; - result[1] = LMS[1] * 1 / sourceWhitePoint[1]; - result[2] = LMS[2] * 1 / sourceWhitePoint[2]; - } - - function convertToD65(sourceWhitePoint, LMS, result) { - var D65X = 0.95047; - var D65Y = 1; - var D65Z = 1.08883; - - result[0] = LMS[0] * D65X / sourceWhitePoint[0]; - result[1] = LMS[1] * D65Y / sourceWhitePoint[1]; - result[2] = LMS[2] * D65Z / sourceWhitePoint[2]; - } - - function sRGBTransferFunction(color) { - // See http://en.wikipedia.org/wiki/SRGB. - if (color <= 0.0031308){ - return adjustToRange(0, 1, 12.92 * color); - } - - return adjustToRange(0, 1, (1 + 0.055) * Math.pow(color, 1 / 2.4) - 0.055); - } - - function adjustToRange(min, max, value) { - return Math.max(min, Math.min(max, value)); - } - - function decodeL(L) { - if (L < 0) { - return -decodeL(-L); - } - - if (L > 8.0) { - return Math.pow(((L + 16) / 116), 3); - } - - return L * DECODE_L_CONSTANT; - } - - function compensateBlackPoint(sourceBlackPoint, XYZ_Flat, result) { - - // In case the blackPoint is already the default blackPoint then there is - // no need to do compensation. - if (sourceBlackPoint[0] === 0 && - sourceBlackPoint[1] === 0 && - sourceBlackPoint[2] === 0) { - result[0] = XYZ_Flat[0]; - result[1] = XYZ_Flat[1]; - result[2] = XYZ_Flat[2]; - return; - } - - // For the blackPoint calculation details, please see - // http://www.adobe.com/content/dam/Adobe/en/devnet/photoshop/sdk/ - // AdobeBPC.pdf. - // The destination blackPoint is the default blackPoint [0, 0, 0]. - var zeroDecodeL = decodeL(0); - - var X_DST = zeroDecodeL; - var X_SRC = decodeL(sourceBlackPoint[0]); - - var Y_DST = zeroDecodeL; - var Y_SRC = decodeL(sourceBlackPoint[1]); - - var Z_DST = zeroDecodeL; - var Z_SRC = decodeL(sourceBlackPoint[2]); - - var X_Scale = (1 - X_DST) / (1 - X_SRC); - var X_Offset = 1 - X_Scale; - - var Y_Scale = (1 - Y_DST) / (1 - Y_SRC); - var Y_Offset = 1 - Y_Scale; - - var Z_Scale = (1 - Z_DST) / (1 - Z_SRC); - var Z_Offset = 1 - Z_Scale; - - result[0] = XYZ_Flat[0] * X_Scale + X_Offset; - result[1] = XYZ_Flat[1] * Y_Scale + Y_Offset; - result[2] = XYZ_Flat[2] * Z_Scale + Z_Offset; - } - - function normalizeWhitePointToFlat(sourceWhitePoint, XYZ_In, result) { - - // In case the whitePoint is already flat then there is no need to do - // normalization. - if (sourceWhitePoint[0] === 1 && sourceWhitePoint[2] === 1) { - result[0] = XYZ_In[0]; - result[1] = XYZ_In[1]; - result[2] = XYZ_In[2]; - return; - } - - var LMS = result; - matrixProduct(BRADFORD_SCALE_MATRIX, XYZ_In, LMS); - - var LMS_Flat = tempNormalizeMatrix; - convertToFlat(sourceWhitePoint, LMS, LMS_Flat); - - matrixProduct(BRADFORD_SCALE_INVERSE_MATRIX, LMS_Flat, result); - } - - function normalizeWhitePointToD65(sourceWhitePoint, XYZ_In, result) { - - var LMS = result; - matrixProduct(BRADFORD_SCALE_MATRIX, XYZ_In, LMS); - - var LMS_D65 = tempNormalizeMatrix; - convertToD65(sourceWhitePoint, LMS, LMS_D65); - - matrixProduct(BRADFORD_SCALE_INVERSE_MATRIX, LMS_D65, result); - } - - function convertToRgb(cs, src, srcOffset, dest, destOffset, scale) { - // A, B and C represent a red, green and blue components of a calibrated - // rgb space. - var A = adjustToRange(0, 1, src[srcOffset] * scale); - var B = adjustToRange(0, 1, src[srcOffset + 1] * scale); - var C = adjustToRange(0, 1, src[srcOffset + 2] * scale); - - // A <---> AGR in the spec - // B <---> BGG in the spec - // C <---> CGB in the spec - var AGR = Math.pow(A, cs.GR); - var BGG = Math.pow(B, cs.GG); - var CGB = Math.pow(C, cs.GB); - - // Computes intermediate variables L, M, N as per spec. - // To decode X, Y, Z values map L, M, N directly to them. - var X = cs.MXA * AGR + cs.MXB * BGG + cs.MXC * CGB; - var Y = cs.MYA * AGR + cs.MYB * BGG + cs.MYC * CGB; - var Z = cs.MZA * AGR + cs.MZB * BGG + cs.MZC * CGB; - - // The following calculations are based on this document: - // http://www.adobe.com/content/dam/Adobe/en/devnet/photoshop/sdk/ - // AdobeBPC.pdf. - var XYZ = tempConvertMatrix1; - XYZ[0] = X; - XYZ[1] = Y; - XYZ[2] = Z; - var XYZ_Flat = tempConvertMatrix2; - - normalizeWhitePointToFlat(cs.whitePoint, XYZ, XYZ_Flat); - - var XYZ_Black = tempConvertMatrix1; - compensateBlackPoint(cs.blackPoint, XYZ_Flat, XYZ_Black); - - var XYZ_D65 = tempConvertMatrix2; - normalizeWhitePointToD65(FLAT_WHITEPOINT_MATRIX, XYZ_Black, XYZ_D65); - - var SRGB = tempConvertMatrix1; - matrixProduct(SRGB_D65_XYZ_TO_RGB_MATRIX, XYZ_D65, SRGB); - - var sR = sRGBTransferFunction(SRGB[0]); - var sG = sRGBTransferFunction(SRGB[1]); - var sB = sRGBTransferFunction(SRGB[2]); - - // Convert the values to rgb range [0, 255]. - dest[destOffset] = Math.round(sR * 255); - dest[destOffset + 1] = Math.round(sG * 255); - dest[destOffset + 2] = Math.round(sB * 255); - } - - CalRGBCS.prototype = { - getRgb: function CalRGBCS_getRgb(src, srcOffset) { - var rgb = new Uint8Array(3); - this.getRgbItem(src, srcOffset, rgb, 0); - return rgb; - }, - getRgbItem: function CalRGBCS_getRgbItem(src, srcOffset, - dest, destOffset) { - convertToRgb(this, src, srcOffset, dest, destOffset, 1); - }, - getRgbBuffer: function CalRGBCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var scale = 1 / ((1 << bits) - 1); - - for (var i = 0; i < count; ++i) { - convertToRgb(this, src, srcOffset, dest, destOffset, scale); - srcOffset += 3; - destOffset += 3 + alpha01; - } - }, - getOutputLength: function CalRGBCS_getOutputLength(inputLength, alpha01) { - return (inputLength * (3 + alpha01) / 3) | 0; - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function CalRGBCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - return CalRGBCS; -})(); - -// -// LabCS: Based on "PDF Reference, Sixth Ed", p.250 -// -var LabCS = (function LabCSClosure() { - function LabCS(whitePoint, blackPoint, range) { - this.name = 'Lab'; - this.numComps = 3; - this.defaultColor = new Float32Array([0, 0, 0]); - - if (!whitePoint) { - error('WhitePoint missing - required for color space Lab'); - } - blackPoint = blackPoint || [0, 0, 0]; - range = range || [-100, 100, -100, 100]; - - // Translate args to spec variables - this.XW = whitePoint[0]; - this.YW = whitePoint[1]; - this.ZW = whitePoint[2]; - this.amin = range[0]; - this.amax = range[1]; - this.bmin = range[2]; - this.bmax = range[3]; - - // These are here just for completeness - the spec doesn't offer any - // formulas that use BlackPoint in Lab - this.XB = blackPoint[0]; - this.YB = blackPoint[1]; - this.ZB = blackPoint[2]; - - // Validate vars as per spec - if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { - error('Invalid WhitePoint components, no fallback available'); - } - - if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { - info('Invalid BlackPoint, falling back to default'); - this.XB = this.YB = this.ZB = 0; - } - - if (this.amin > this.amax || this.bmin > this.bmax) { - info('Invalid Range, falling back to defaults'); - this.amin = -100; - this.amax = 100; - this.bmin = -100; - this.bmax = 100; - } - } - - // Function g(x) from spec - function fn_g(x) { - if (x >= 6 / 29) { - return x * x * x; - } else { - return (108 / 841) * (x - 4 / 29); - } - } - - function decode(value, high1, low2, high2) { - return low2 + (value) * (high2 - low2) / (high1); - } - - // If decoding is needed maxVal should be 2^bits per component - 1. - function convertToRgb(cs, src, srcOffset, maxVal, dest, destOffset) { - // XXX: Lab input is in the range of [0, 100], [amin, amax], [bmin, bmax] - // not the usual [0, 1]. If a command like setFillColor is used the src - // values will already be within the correct range. However, if we are - // converting an image we have to map the values to the correct range given - // above. - // Ls,as,bs <---> L*,a*,b* in the spec - var Ls = src[srcOffset]; - var as = src[srcOffset + 1]; - var bs = src[srcOffset + 2]; - if (maxVal !== false) { - Ls = decode(Ls, maxVal, 0, 100); - as = decode(as, maxVal, cs.amin, cs.amax); - bs = decode(bs, maxVal, cs.bmin, cs.bmax); - } - - // Adjust limits of 'as' and 'bs' - as = as > cs.amax ? cs.amax : as < cs.amin ? cs.amin : as; - bs = bs > cs.bmax ? cs.bmax : bs < cs.bmin ? cs.bmin : bs; - - // Computes intermediate variables X,Y,Z as per spec - var M = (Ls + 16) / 116; - var L = M + (as / 500); - var N = M - (bs / 200); - - var X = cs.XW * fn_g(L); - var Y = cs.YW * fn_g(M); - var Z = cs.ZW * fn_g(N); - - var r, g, b; - // Using different conversions for D50 and D65 white points, - // per http://www.color.org/srgb.pdf - if (cs.ZW < 1) { - // Assuming D50 (X=0.9642, Y=1.00, Z=0.8249) - r = X * 3.1339 + Y * -1.6170 + Z * -0.4906; - g = X * -0.9785 + Y * 1.9160 + Z * 0.0333; - b = X * 0.0720 + Y * -0.2290 + Z * 1.4057; - } else { - // Assuming D65 (X=0.9505, Y=1.00, Z=1.0888) - r = X * 3.2406 + Y * -1.5372 + Z * -0.4986; - g = X * -0.9689 + Y * 1.8758 + Z * 0.0415; - b = X * 0.0557 + Y * -0.2040 + Z * 1.0570; - } - // clamp color values to [0,1] range then convert to [0,255] range. - dest[destOffset] = r <= 0 ? 0 : r >= 1 ? 255 : Math.sqrt(r) * 255 | 0; - dest[destOffset + 1] = g <= 0 ? 0 : g >= 1 ? 255 : Math.sqrt(g) * 255 | 0; - dest[destOffset + 2] = b <= 0 ? 0 : b >= 1 ? 255 : Math.sqrt(b) * 255 | 0; - } - - LabCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function LabCS_getRgbItem(src, srcOffset, dest, destOffset) { - convertToRgb(this, src, srcOffset, false, dest, destOffset); - }, - getRgbBuffer: function LabCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var maxVal = (1 << bits) - 1; - for (var i = 0; i < count; i++) { - convertToRgb(this, src, srcOffset, maxVal, dest, destOffset); - srcOffset += 3; - destOffset += 3 + alpha01; - } - }, - getOutputLength: function LabCS_getOutputLength(inputLength, alpha01) { - return (inputLength * (3 + alpha01) / 3) | 0; - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function LabCS_isDefaultDecode(decodeMap) { - // XXX: Decoding is handled with the lab conversion because of the strange - // ranges that are used. - return true; - }, - usesZeroToOneRange: false - }; - return LabCS; -})(); - - -var ARCFourCipher = (function ARCFourCipherClosure() { - function ARCFourCipher(key) { - this.a = 0; - this.b = 0; - var s = new Uint8Array(256); - var i, j = 0, tmp, keyLength = key.length; - for (i = 0; i < 256; ++i) { - s[i] = i; - } - for (i = 0; i < 256; ++i) { - tmp = s[i]; - j = (j + tmp + key[i % keyLength]) & 0xFF; - s[i] = s[j]; - s[j] = tmp; - } - this.s = s; - } - - ARCFourCipher.prototype = { - encryptBlock: function ARCFourCipher_encryptBlock(data) { - var i, n = data.length, tmp, tmp2; - var a = this.a, b = this.b, s = this.s; - var output = new Uint8Array(n); - for (i = 0; i < n; ++i) { - a = (a + 1) & 0xFF; - tmp = s[a]; - b = (b + tmp) & 0xFF; - tmp2 = s[b]; - s[a] = tmp2; - s[b] = tmp; - output[i] = data[i] ^ s[(tmp + tmp2) & 0xFF]; - } - this.a = a; - this.b = b; - return output; - } - }; - ARCFourCipher.prototype.decryptBlock = ARCFourCipher.prototype.encryptBlock; - - return ARCFourCipher; -})(); - -var calculateMD5 = (function calculateMD5Closure() { - var r = new Uint8Array([ - 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, - 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, - 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, - 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21]); - - var k = new Int32Array([ - -680876936, -389564586, 606105819, -1044525330, -176418897, 1200080426, - -1473231341, -45705983, 1770035416, -1958414417, -42063, -1990404162, - 1804603682, -40341101, -1502002290, 1236535329, -165796510, -1069501632, - 643717713, -373897302, -701558691, 38016083, -660478335, -405537848, - 568446438, -1019803690, -187363961, 1163531501, -1444681467, -51403784, - 1735328473, -1926607734, -378558, -2022574463, 1839030562, -35309556, - -1530992060, 1272893353, -155497632, -1094730640, 681279174, -358537222, - -722521979, 76029189, -640364487, -421815835, 530742520, -995338651, - -198630844, 1126891415, -1416354905, -57434055, 1700485571, -1894986606, - -1051523, -2054922799, 1873313359, -30611744, -1560198380, 1309151649, - -145523070, -1120210379, 718787259, -343485551]); - - function hash(data, offset, length) { - var h0 = 1732584193, h1 = -271733879, h2 = -1732584194, h3 = 271733878; - // pre-processing - var paddedLength = (length + 72) & ~63; // data + 9 extra bytes - var padded = new Uint8Array(paddedLength); - var i, j, n; - for (i = 0; i < length; ++i) { - padded[i] = data[offset++]; - } - padded[i++] = 0x80; - n = paddedLength - 8; - while (i < n) { - padded[i++] = 0; - } - padded[i++] = (length << 3) & 0xFF; - padded[i++] = (length >> 5) & 0xFF; - padded[i++] = (length >> 13) & 0xFF; - padded[i++] = (length >> 21) & 0xFF; - padded[i++] = (length >>> 29) & 0xFF; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - var w = new Int32Array(16); - for (i = 0; i < paddedLength;) { - for (j = 0; j < 16; ++j, i += 4) { - w[j] = (padded[i] | (padded[i + 1] << 8) | - (padded[i + 2] << 16) | (padded[i + 3] << 24)); - } - var a = h0, b = h1, c = h2, d = h3, f, g; - for (j = 0; j < 64; ++j) { - if (j < 16) { - f = (b & c) | ((~b) & d); - g = j; - } else if (j < 32) { - f = (d & b) | ((~d) & c); - g = (5 * j + 1) & 15; - } else if (j < 48) { - f = b ^ c ^ d; - g = (3 * j + 5) & 15; - } else { - f = c ^ (b | (~d)); - g = (7 * j) & 15; - } - var tmp = d, rotateArg = (a + f + k[j] + w[g]) | 0, rotate = r[j]; - d = c; - c = b; - b = (b + ((rotateArg << rotate) | (rotateArg >>> (32 - rotate)))) | 0; - a = tmp; - } - h0 = (h0 + a) | 0; - h1 = (h1 + b) | 0; - h2 = (h2 + c) | 0; - h3 = (h3 + d) | 0; - } - return new Uint8Array([ - h0 & 0xFF, (h0 >> 8) & 0xFF, (h0 >> 16) & 0xFF, (h0 >>> 24) & 0xFF, - h1 & 0xFF, (h1 >> 8) & 0xFF, (h1 >> 16) & 0xFF, (h1 >>> 24) & 0xFF, - h2 & 0xFF, (h2 >> 8) & 0xFF, (h2 >> 16) & 0xFF, (h2 >>> 24) & 0xFF, - h3 & 0xFF, (h3 >> 8) & 0xFF, (h3 >> 16) & 0xFF, (h3 >>> 24) & 0xFF - ]); - } - - return hash; -})(); -var Word64 = (function Word64Closure() { - function Word64(highInteger, lowInteger) { - this.high = highInteger | 0; - this.low = lowInteger | 0; - } - Word64.prototype = { - and: function Word64_and(word) { - this.high &= word.high; - this.low &= word.low; - }, - xor: function Word64_xor(word) { - this.high ^= word.high; - this.low ^= word.low; - }, - - or: function Word64_or(word) { - this.high |= word.high; - this.low |= word.low; - }, - - shiftRight: function Word64_shiftRight(places) { - if (places >= 32) { - this.low = (this.high >>> (places - 32)) | 0; - this.high = 0; - } else { - this.low = (this.low >>> places) | (this.high << (32 - places)); - this.high = (this.high >>> places) | 0; - } - }, - - shiftLeft: function Word64_shiftLeft(places) { - if (places >= 32) { - this.high = this.low << (places - 32); - this.low = 0; - } else { - this.high = (this.high << places) | (this.low >>> (32 - places)); - this.low = this.low << places; - } - }, - - rotateRight: function Word64_rotateRight(places) { - var low, high; - if (places & 32) { - high = this.low; - low = this.high; - } else { - low = this.low; - high = this.high; - } - places &= 31; - this.low = (low >>> places) | (high << (32 - places)); - this.high = (high >>> places) | (low << (32 - places)); - }, - - not: function Word64_not() { - this.high = ~this.high; - this.low = ~this.low; - }, - - add: function Word64_add(word) { - var lowAdd = (this.low >>> 0) + (word.low >>> 0); - var highAdd = (this.high >>> 0) + (word.high >>> 0); - if (lowAdd > 0xFFFFFFFF) { - highAdd += 1; - } - this.low = lowAdd | 0; - this.high = highAdd | 0; - }, - - copyTo: function Word64_copyTo(bytes, offset) { - bytes[offset] = (this.high >>> 24) & 0xFF; - bytes[offset + 1] = (this.high >> 16) & 0xFF; - bytes[offset + 2] = (this.high >> 8) & 0xFF; - bytes[offset + 3] = this.high & 0xFF; - bytes[offset + 4] = (this.low >>> 24) & 0xFF; - bytes[offset + 5] = (this.low >> 16) & 0xFF; - bytes[offset + 6] = (this.low >> 8) & 0xFF; - bytes[offset + 7] = this.low & 0xFF; - }, - - assign: function Word64_assign(word) { - this.high = word.high; - this.low = word.low; - } - }; - return Word64; -})(); - -var calculateSHA256 = (function calculateSHA256Closure() { - function rotr(x, n) { - return (x >>> n) | (x << 32 - n); - } - - function ch(x, y, z) { - return (x & y) ^ (~x & z); - } - - function maj(x, y, z) { - return (x & y) ^ (x & z) ^ (y & z); - } - - function sigma(x) { - return rotr(x, 2) ^ rotr(x, 13) ^ rotr(x, 22); - } - - function sigmaPrime(x) { - return rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25); - } - - function littleSigma(x) { - return rotr(x, 7) ^ rotr(x, 18) ^ x >>> 3; - } - - function littleSigmaPrime(x) { - return rotr(x, 17) ^ rotr(x, 19) ^ x >>> 10; - } - - var k = [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, - 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, - 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, - 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, - 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, - 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, - 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, - 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, - 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2]; - - function hash(data, offset, length) { - // initial hash values - var h0 = 0x6a09e667, h1 = 0xbb67ae85, h2 = 0x3c6ef372, - h3 = 0xa54ff53a, h4 = 0x510e527f, h5 = 0x9b05688c, - h6 = 0x1f83d9ab, h7 = 0x5be0cd19; - // pre-processing - var paddedLength = Math.ceil((length + 9) / 64) * 64; - var padded = new Uint8Array(paddedLength); - var i, j, n; - for (i = 0; i < length; ++i) { - padded[i] = data[offset++]; - } - padded[i++] = 0x80; - n = paddedLength - 8; - while (i < n) { - padded[i++] = 0; - } - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = (length >>> 29) & 0xFF; - padded[i++] = (length >> 21) & 0xFF; - padded[i++] = (length >> 13) & 0xFF; - padded[i++] = (length >> 5) & 0xFF; - padded[i++] = (length << 3) & 0xFF; - var w = new Uint32Array(64); - // for each 512 bit block - for (i = 0; i < paddedLength;) { - for (j = 0; j < 16; ++j) { - w[j] = (padded[i] << 24 | (padded[i + 1] << 16) | - (padded[i + 2] << 8) | (padded[i + 3])); - i += 4; - } - - for (j = 16; j < 64; ++j) { - w[j] = littleSigmaPrime(w[j - 2]) + w[j - 7] + - littleSigma(w[j - 15]) + w[j - 16] | 0; - } - var a = h0, b = h1, c = h2, d = h3, e = h4, - f = h5, g = h6, h = h7, t1, t2; - for (j = 0; j < 64; ++j) { - t1 = h + sigmaPrime(e) + ch(e, f, g) + k[j] + w[j]; - t2 = sigma(a) + maj(a, b, c); - h = g; - g = f; - f = e; - e = (d + t1) | 0; - d = c; - c = b; - b = a; - a = (t1 + t2) | 0; - } - h0 = (h0 + a) | 0; - h1 = (h1 + b) | 0; - h2 = (h2 + c) | 0; - h3 = (h3 + d) | 0; - h4 = (h4 + e) | 0; - h5 = (h5 + f) | 0; - h6 = (h6 + g) | 0; - h7 = (h7 + h) | 0; - } - return new Uint8Array([ - (h0 >> 24) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 8) & 0xFF, (h0) & 0xFF, - (h1 >> 24) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 8) & 0xFF, (h1) & 0xFF, - (h2 >> 24) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 8) & 0xFF, (h2) & 0xFF, - (h3 >> 24) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 8) & 0xFF, (h3) & 0xFF, - (h4 >> 24) & 0xFF, (h4 >> 16) & 0xFF, (h4 >> 8) & 0xFF, (h4) & 0xFF, - (h5 >> 24) & 0xFF, (h5 >> 16) & 0xFF, (h5 >> 8) & 0xFF, (h5) & 0xFF, - (h6 >> 24) & 0xFF, (h6 >> 16) & 0xFF, (h6 >> 8) & 0xFF, (h6) & 0xFF, - (h7 >> 24) & 0xFF, (h7 >> 16) & 0xFF, (h7 >> 8) & 0xFF, (h7) & 0xFF - ]); - } - - return hash; -})(); - -var calculateSHA512 = (function calculateSHA512Closure() { - function ch(result, x, y, z, tmp) { - result.assign(x); - result.and(y); - tmp.assign(x); - tmp.not(); - tmp.and(z); - result.xor(tmp); - } - - function maj(result, x, y, z, tmp) { - result.assign(x); - result.and(y); - tmp.assign(x); - tmp.and(z); - result.xor(tmp); - tmp.assign(y); - tmp.and(z); - result.xor(tmp); - } - - function sigma(result, x, tmp) { - result.assign(x); - result.rotateRight(28); - tmp.assign(x); - tmp.rotateRight(34); - result.xor(tmp); - tmp.assign(x); - tmp.rotateRight(39); - result.xor(tmp); - } - - function sigmaPrime(result, x, tmp) { - result.assign(x); - result.rotateRight(14); - tmp.assign(x); - tmp.rotateRight(18); - result.xor(tmp); - tmp.assign(x); - tmp.rotateRight(41); - result.xor(tmp); - } - - function littleSigma(result, x, tmp) { - result.assign(x); - result.rotateRight(1); - tmp.assign(x); - tmp.rotateRight(8); - result.xor(tmp); - tmp.assign(x); - tmp.shiftRight(7); - result.xor(tmp); - } - - function littleSigmaPrime(result, x, tmp) { - result.assign(x); - result.rotateRight(19); - tmp.assign(x); - tmp.rotateRight(61); - result.xor(tmp); - tmp.assign(x); - tmp.shiftRight(6); - result.xor(tmp); - } - - var k = [ - new Word64(0x428a2f98, 0xd728ae22), new Word64(0x71374491, 0x23ef65cd), - new Word64(0xb5c0fbcf, 0xec4d3b2f), new Word64(0xe9b5dba5, 0x8189dbbc), - new Word64(0x3956c25b, 0xf348b538), new Word64(0x59f111f1, 0xb605d019), - new Word64(0x923f82a4, 0xaf194f9b), new Word64(0xab1c5ed5, 0xda6d8118), - new Word64(0xd807aa98, 0xa3030242), new Word64(0x12835b01, 0x45706fbe), - new Word64(0x243185be, 0x4ee4b28c), new Word64(0x550c7dc3, 0xd5ffb4e2), - new Word64(0x72be5d74, 0xf27b896f), new Word64(0x80deb1fe, 0x3b1696b1), - new Word64(0x9bdc06a7, 0x25c71235), new Word64(0xc19bf174, 0xcf692694), - new Word64(0xe49b69c1, 0x9ef14ad2), new Word64(0xefbe4786, 0x384f25e3), - new Word64(0x0fc19dc6, 0x8b8cd5b5), new Word64(0x240ca1cc, 0x77ac9c65), - new Word64(0x2de92c6f, 0x592b0275), new Word64(0x4a7484aa, 0x6ea6e483), - new Word64(0x5cb0a9dc, 0xbd41fbd4), new Word64(0x76f988da, 0x831153b5), - new Word64(0x983e5152, 0xee66dfab), new Word64(0xa831c66d, 0x2db43210), - new Word64(0xb00327c8, 0x98fb213f), new Word64(0xbf597fc7, 0xbeef0ee4), - new Word64(0xc6e00bf3, 0x3da88fc2), new Word64(0xd5a79147, 0x930aa725), - new Word64(0x06ca6351, 0xe003826f), new Word64(0x14292967, 0x0a0e6e70), - new Word64(0x27b70a85, 0x46d22ffc), new Word64(0x2e1b2138, 0x5c26c926), - new Word64(0x4d2c6dfc, 0x5ac42aed), new Word64(0x53380d13, 0x9d95b3df), - new Word64(0x650a7354, 0x8baf63de), new Word64(0x766a0abb, 0x3c77b2a8), - new Word64(0x81c2c92e, 0x47edaee6), new Word64(0x92722c85, 0x1482353b), - new Word64(0xa2bfe8a1, 0x4cf10364), new Word64(0xa81a664b, 0xbc423001), - new Word64(0xc24b8b70, 0xd0f89791), new Word64(0xc76c51a3, 0x0654be30), - new Word64(0xd192e819, 0xd6ef5218), new Word64(0xd6990624, 0x5565a910), - new Word64(0xf40e3585, 0x5771202a), new Word64(0x106aa070, 0x32bbd1b8), - new Word64(0x19a4c116, 0xb8d2d0c8), new Word64(0x1e376c08, 0x5141ab53), - new Word64(0x2748774c, 0xdf8eeb99), new Word64(0x34b0bcb5, 0xe19b48a8), - new Word64(0x391c0cb3, 0xc5c95a63), new Word64(0x4ed8aa4a, 0xe3418acb), - new Word64(0x5b9cca4f, 0x7763e373), new Word64(0x682e6ff3, 0xd6b2b8a3), - new Word64(0x748f82ee, 0x5defb2fc), new Word64(0x78a5636f, 0x43172f60), - new Word64(0x84c87814, 0xa1f0ab72), new Word64(0x8cc70208, 0x1a6439ec), - new Word64(0x90befffa, 0x23631e28), new Word64(0xa4506ceb, 0xde82bde9), - new Word64(0xbef9a3f7, 0xb2c67915), new Word64(0xc67178f2, 0xe372532b), - new Word64(0xca273ece, 0xea26619c), new Word64(0xd186b8c7, 0x21c0c207), - new Word64(0xeada7dd6, 0xcde0eb1e), new Word64(0xf57d4f7f, 0xee6ed178), - new Word64(0x06f067aa, 0x72176fba), new Word64(0x0a637dc5, 0xa2c898a6), - new Word64(0x113f9804, 0xbef90dae), new Word64(0x1b710b35, 0x131c471b), - new Word64(0x28db77f5, 0x23047d84), new Word64(0x32caab7b, 0x40c72493), - new Word64(0x3c9ebe0a, 0x15c9bebc), new Word64(0x431d67c4, 0x9c100d4c), - new Word64(0x4cc5d4be, 0xcb3e42b6), new Word64(0x597f299c, 0xfc657e2a), - new Word64(0x5fcb6fab, 0x3ad6faec), new Word64(0x6c44198c, 0x4a475817)]; - - function hash(data, offset, length, mode384) { - mode384 = !!mode384; - // initial hash values - var h0, h1, h2, h3, h4, h5, h6, h7; - if (!mode384) { - h0 = new Word64(0x6a09e667, 0xf3bcc908); - h1 = new Word64(0xbb67ae85, 0x84caa73b); - h2 = new Word64(0x3c6ef372, 0xfe94f82b); - h3 = new Word64(0xa54ff53a, 0x5f1d36f1); - h4 = new Word64(0x510e527f, 0xade682d1); - h5 = new Word64(0x9b05688c, 0x2b3e6c1f); - h6 = new Word64(0x1f83d9ab, 0xfb41bd6b); - h7 = new Word64(0x5be0cd19, 0x137e2179); - } - else { - // SHA384 is exactly the same - // except with different starting values and a trimmed result - h0 = new Word64(0xcbbb9d5d, 0xc1059ed8); - h1 = new Word64(0x629a292a, 0x367cd507); - h2 = new Word64(0x9159015a, 0x3070dd17); - h3 = new Word64(0x152fecd8, 0xf70e5939); - h4 = new Word64(0x67332667, 0xffc00b31); - h5 = new Word64(0x8eb44a87, 0x68581511); - h6 = new Word64(0xdb0c2e0d, 0x64f98fa7); - h7 = new Word64(0x47b5481d, 0xbefa4fa4); - } - - // pre-processing - var paddedLength = Math.ceil((length + 17) / 128) * 128; - var padded = new Uint8Array(paddedLength); - var i, j, n; - for (i = 0; i < length; ++i) { - padded[i] = data[offset++]; - } - padded[i++] = 0x80; - n = paddedLength - 16; - while (i < n) { - padded[i++] = 0; - } - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = (length >>> 29) & 0xFF; - padded[i++] = (length >> 21) & 0xFF; - padded[i++] = (length >> 13) & 0xFF; - padded[i++] = (length >> 5) & 0xFF; - padded[i++] = (length << 3) & 0xFF; - - var w = new Array(80); - for (i = 0; i < 80; i++) { - w[i] = new Word64(0, 0); - } - var a = new Word64(0, 0), b = new Word64(0, 0), c = new Word64(0, 0); - var d = new Word64(0, 0), e = new Word64(0, 0), f = new Word64(0, 0); - var g = new Word64(0, 0), h = new Word64(0, 0); - var t1 = new Word64(0, 0), t2 = new Word64(0, 0); - var tmp1 = new Word64(0, 0), tmp2 = new Word64(0, 0), tmp3; - - // for each 1024 bit block - for (i = 0; i < paddedLength;) { - for (j = 0; j < 16; ++j) { - w[j].high = (padded[i] << 24) | (padded[i + 1] << 16) | - (padded[i + 2] << 8) | (padded[i + 3]); - w[j].low = (padded[i + 4]) << 24 | (padded[i + 5]) << 16 | - (padded[i + 6]) << 8 | (padded[i + 7]); - i += 8; - } - for (j = 16; j < 80; ++j) { - tmp3 = w[j]; - littleSigmaPrime(tmp3, w[j - 2], tmp2); - tmp3.add(w[j - 7]); - littleSigma(tmp1, w[j - 15], tmp2); - tmp3.add(tmp1); - tmp3.add(w[j - 16]); - } - - a.assign(h0); b.assign(h1); c.assign(h2); d.assign(h3); - e.assign(h4); f.assign(h5); g.assign(h6); h.assign(h7); - for (j = 0; j < 80; ++j) { - t1.assign(h); - sigmaPrime(tmp1, e, tmp2); - t1.add(tmp1); - ch(tmp1, e, f, g, tmp2); - t1.add(tmp1); - t1.add(k[j]); - t1.add(w[j]); - - sigma(t2, a, tmp2); - maj(tmp1, a, b, c, tmp2); - t2.add(tmp1); - - tmp3 = h; - h = g; - g = f; - f = e; - d.add(t1); - e = d; - d = c; - c = b; - b = a; - tmp3.assign(t1); - tmp3.add(t2); - a = tmp3; - } - h0.add(a); - h1.add(b); - h2.add(c); - h3.add(d); - h4.add(e); - h5.add(f); - h6.add(g); - h7.add(h); - } - - var result; - if (!mode384) { - result = new Uint8Array(64); - h0.copyTo(result,0); - h1.copyTo(result,8); - h2.copyTo(result,16); - h3.copyTo(result,24); - h4.copyTo(result,32); - h5.copyTo(result,40); - h6.copyTo(result,48); - h7.copyTo(result,56); - } - else { - result = new Uint8Array(48); - h0.copyTo(result,0); - h1.copyTo(result,8); - h2.copyTo(result,16); - h3.copyTo(result,24); - h4.copyTo(result,32); - h5.copyTo(result,40); - } - return result; - } - - return hash; -})(); -var calculateSHA384 = (function calculateSHA384Closure() { - function hash(data, offset, length) { - return calculateSHA512(data, offset, length, true); - } - - return hash; -})(); -var NullCipher = (function NullCipherClosure() { - function NullCipher() { - } - - NullCipher.prototype = { - decryptBlock: function NullCipher_decryptBlock(data) { - return data; - } - }; - - return NullCipher; -})(); - -var AES128Cipher = (function AES128CipherClosure() { - var rcon = new Uint8Array([ - 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, - 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, - 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, - 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, - 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, - 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, - 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, - 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, - 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, - 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, - 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, - 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, - 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, - 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, - 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, - 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, - 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, - 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, - 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, - 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, - 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, - 0x74, 0xe8, 0xcb, 0x8d]); - - var s = new Uint8Array([ - 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, - 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, - 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, - 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, - 0x04, 0xc7, 0x23,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, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, - 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, - 0xb0, 0x54, 0xbb, 0x16]); - - var inv_s = new Uint8Array([ - 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, - 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, - 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, - 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, - 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, - 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, - 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, - 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, - 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, - 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, - 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, - 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, - 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, - 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, - 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, - 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, - 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, - 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, - 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, - 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, - 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, - 0x55, 0x21, 0x0c, 0x7d]); - var mixCol = new Uint8Array(256); - for (var i = 0; i < 256; i++) { - if (i < 128) { - mixCol[i] = i << 1; - } else { - mixCol[i] = (i << 1) ^ 0x1b; - } - } - var mix = new Uint32Array([ - 0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, - 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, - 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, - 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, - 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, - 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, - 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, - 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, - 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, - 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, - 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, - 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, - 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, - 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, - 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, - 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, - 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, - 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, - 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, - 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, - 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, - 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, - 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, - 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, - 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, - 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, - 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, - 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, - 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, - 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, - 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, - 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, - 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, - 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, - 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, - 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, - 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, - 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, - 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, - 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, - 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, - 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, - 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]); - - function expandKey128(cipherKey) { - var b = 176, result = new Uint8Array(b); - result.set(cipherKey); - for (var j = 16, i = 1; j < b; ++i) { - // RotWord - var t1 = result[j - 3], t2 = result[j - 2], - t3 = result[j - 1], t4 = result[j - 4]; - // SubWord - t1 = s[t1]; - t2 = s[t2]; - t3 = s[t3]; - t4 = s[t4]; - // Rcon - t1 = t1 ^ rcon[i]; - for (var n = 0; n < 4; ++n) { - result[j] = (t1 ^= result[j - 16]); - j++; - result[j] = (t2 ^= result[j - 16]); - j++; - result[j] = (t3 ^= result[j - 16]); - j++; - result[j] = (t4 ^= result[j - 16]); - j++; - } - } - return result; - } - - function decrypt128(input, key) { - var state = new Uint8Array(16); - state.set(input); - var i, j, k; - var t, u, v; - // AddRoundKey - for (j = 0, k = 160; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - for (i = 9; i >= 1; --i) { - // InvShiftRows - t = state[13]; - state[13] = state[9]; - state[9] = state[5]; - state[5] = state[1]; - state[1] = t; - t = state[14]; - u = state[10]; - state[14] = state[6]; - state[10] = state[2]; - state[6] = t; - state[2] = u; - t = state[15]; - u = state[11]; - v = state[7]; - state[15] = state[3]; - state[11] = t; - state[7] = u; - state[3] = v; - // InvSubBytes - for (j = 0; j < 16; ++j) { - state[j] = inv_s[state[j]]; - } - // AddRoundKey - for (j = 0, k = i * 16; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - // InvMixColumns - for (j = 0; j < 16; j += 4) { - var s0 = mix[state[j]], s1 = mix[state[j + 1]], - s2 = mix[state[j + 2]], s3 = mix[state[j + 3]]; - t = (s0 ^ (s1 >>> 8) ^ (s1 << 24) ^ (s2 >>> 16) ^ (s2 << 16) ^ - (s3 >>> 24) ^ (s3 << 8)); - state[j] = (t >>> 24) & 0xFF; - state[j + 1] = (t >> 16) & 0xFF; - state[j + 2] = (t >> 8) & 0xFF; - state[j + 3] = t & 0xFF; - } - } - // InvShiftRows - t = state[13]; - state[13] = state[9]; - state[9] = state[5]; - state[5] = state[1]; - state[1] = t; - t = state[14]; - u = state[10]; - state[14] = state[6]; - state[10] = state[2]; - state[6] = t; - state[2] = u; - t = state[15]; - u = state[11]; - v = state[7]; - state[15] = state[3]; - state[11] = t; - state[7] = u; - state[3] = v; - for (j = 0; j < 16; ++j) { - // InvSubBytes - state[j] = inv_s[state[j]]; - // AddRoundKey - state[j] ^= key[j]; - } - return state; - } - - function encrypt128(input, key) { - var t, u, v, k; - var state = new Uint8Array(16); - state.set(input); - for (j = 0; j < 16; ++j) { - // AddRoundKey - state[j] ^= key[j]; - } - - for (i = 1; i < 10; i++) { - //SubBytes - for (j = 0; j < 16; ++j) { - state[j] = s[state[j]]; - } - //ShiftRows - v = state[1]; - state[1] = state[5]; - state[5] = state[9]; - state[9] = state[13]; - state[13] = v; - v = state[2]; - u = state[6]; - state[2] = state[10]; - state[6] = state[14]; - state[10] = v; - state[14] = u; - v = state[3]; - u = state[7]; - t = state[11]; - state[3] = state[15]; - state[7] = v; - state[11] = u; - state[15] = t; - //MixColumns - for (var j = 0; j < 16; j += 4) { - var s0 = state[j + 0], s1 = state[j + 1]; - var s2 = state[j + 2], s3 = state[j + 3]; - t = s0 ^ s1 ^ s2 ^ s3; - state[j + 0] ^= t ^ mixCol[s0 ^ s1]; - state[j + 1] ^= t ^ mixCol[s1 ^ s2]; - state[j + 2] ^= t ^ mixCol[s2 ^ s3]; - state[j + 3] ^= t ^ mixCol[s3 ^ s0]; - } - //AddRoundKey - for (j = 0, k = i * 16; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - } - - //SubBytes - for (j = 0; j < 16; ++j) { - state[j] = s[state[j]]; - } - //ShiftRows - v = state[1]; - state[1] = state[5]; - state[5] = state[9]; - state[9] = state[13]; - state[13] = v; - v = state[2]; - u = state[6]; - state[2] = state[10]; - state[6] = state[14]; - state[10] = v; - state[14] = u; - v = state[3]; - u = state[7]; - t = state[11]; - state[3] = state[15]; - state[7] = v; - state[11] = u; - state[15] = t; - //AddRoundKey - for (j = 0, k = 160; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - return state; - } - - function AES128Cipher(key) { - this.key = expandKey128(key); - this.buffer = new Uint8Array(16); - this.bufferPosition = 0; - } - - function decryptBlock2(data, finalize) { - var i, j, ii, sourceLength = data.length, - buffer = this.buffer, bufferLength = this.bufferPosition, - result = [], iv = this.iv; - for (i = 0; i < sourceLength; ++i) { - buffer[bufferLength] = data[i]; - ++bufferLength; - if (bufferLength < 16) { - continue; - } - // buffer is full, decrypting - var plain = decrypt128(buffer, this.key); - // xor-ing the IV vector to get plain text - for (j = 0; j < 16; ++j) { - plain[j] ^= iv[j]; - } - iv = buffer; - result.push(plain); - buffer = new Uint8Array(16); - bufferLength = 0; - } - // saving incomplete buffer - this.buffer = buffer; - this.bufferLength = bufferLength; - this.iv = iv; - if (result.length === 0) { - return new Uint8Array([]); - } - // combining plain text blocks into one - var outputLength = 16 * result.length; - if (finalize) { - // undo a padding that is described in RFC 2898 - var lastBlock = result[result.length - 1]; - var psLen = lastBlock[15]; - if (psLen <= 16) { - for (i = 15, ii = 16 - psLen; i >= ii; --i) { - if (lastBlock[i] !== psLen) { - // Invalid padding, assume that the block has no padding. - psLen = 0; - break; - } - } - outputLength -= psLen; - result[result.length - 1] = lastBlock.subarray(0, 16 - psLen); - } - } - var output = new Uint8Array(outputLength); - for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { - output.set(result[i], j); - } - return output; - } - - AES128Cipher.prototype = { - decryptBlock: function AES128Cipher_decryptBlock(data, finalize) { - var i, sourceLength = data.length; - var buffer = this.buffer, bufferLength = this.bufferPosition; - // waiting for IV values -- they are at the start of the stream - for (i = 0; bufferLength < 16 && i < sourceLength; ++i, ++bufferLength) { - buffer[bufferLength] = data[i]; - } - if (bufferLength < 16) { - // need more data - this.bufferLength = bufferLength; - return new Uint8Array([]); - } - this.iv = buffer; - this.buffer = new Uint8Array(16); - this.bufferLength = 0; - // starting decryption - this.decryptBlock = decryptBlock2; - return this.decryptBlock(data.subarray(16), finalize); - }, - encrypt: function AES128Cipher_encrypt(data, iv) { - var i, j, ii, sourceLength = data.length, - buffer = this.buffer, bufferLength = this.bufferPosition, - result = []; - if (!iv) { - iv = new Uint8Array(16); - } - for (i = 0; i < sourceLength; ++i) { - buffer[bufferLength] = data[i]; - ++bufferLength; - if (bufferLength < 16) { - continue; - } - for (j = 0; j < 16; ++j) { - buffer[j] ^= iv[j]; - } - - // buffer is full, encrypting - var cipher = encrypt128(buffer, this.key); - iv = cipher; - result.push(cipher); - buffer = new Uint8Array(16); - bufferLength = 0; - } - // saving incomplete buffer - this.buffer = buffer; - this.bufferLength = bufferLength; - this.iv = iv; - if (result.length === 0) { - return new Uint8Array([]); - } - // combining plain text blocks into one - var outputLength = 16 * result.length; - var output = new Uint8Array(outputLength); - for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { - output.set(result[i], j); - } - return output; - } - }; - - return AES128Cipher; -})(); - -var AES256Cipher = (function AES256CipherClosure() { - var rcon = new Uint8Array([ - 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, - 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, - 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, - 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, - 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, - 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, - 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, - 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, - 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, - 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, - 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, - 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, - 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, - 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, - 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, - 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, - 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, - 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, - 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, - 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, - 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, - 0x74, 0xe8, 0xcb, 0x8d]); - - var s = new Uint8Array([ - 0x63, 0x7c, 0x77, 0x7b, 0xf2, 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 0xea, 0x65, 0x7a, 0xae, 0x08, - 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, - 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, - 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, - 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, - 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, - 0xb0, 0x54, 0xbb, 0x16]); - - var inv_s = new Uint8Array([ - 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, - 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, - 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, - 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, - 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, - 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, - 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, - 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, - 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, - 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, - 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, - 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, - 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, - 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, - 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, - 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, - 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, - 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, - 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, - 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, - 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, - 0x55, 0x21, 0x0c, 0x7d]); - - var mixCol = new Uint8Array(256); - for (var i = 0; i < 256; i++) { - if (i < 128) { - mixCol[i] = i << 1; - } else { - mixCol[i] = (i << 1) ^ 0x1b; - } - } - var mix = new Uint32Array([ - 0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, - 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, - 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, - 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, - 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, - 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, - 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, - 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, - 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, - 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, - 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, - 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, - 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, - 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, - 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, - 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, - 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, - 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, - 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, - 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, - 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, - 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, - 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, - 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, - 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, - 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, - 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, - 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, - 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, - 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, - 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, - 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, - 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, - 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, - 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, - 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, - 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, - 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, - 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, - 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, - 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, - 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, - 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]); - - function expandKey256(cipherKey) { - var b = 240, result = new Uint8Array(b); - var r = 1; - - result.set(cipherKey); - for (var j = 32, i = 1; j < b; ++i) { - if (j % 32 === 16) { - t1 = s[t1]; - t2 = s[t2]; - t3 = s[t3]; - t4 = s[t4]; - } else if (j % 32 === 0) { - // RotWord - var t1 = result[j - 3], t2 = result[j - 2], - t3 = result[j - 1], t4 = result[j - 4]; - // SubWord - t1 = s[t1]; - t2 = s[t2]; - t3 = s[t3]; - t4 = s[t4]; - // Rcon - t1 = t1 ^ r; - if ((r <<= 1) >= 256) { - r = (r ^ 0x1b) & 0xFF; - } - } - - for (var n = 0; n < 4; ++n) { - result[j] = (t1 ^= result[j - 32]); - j++; - result[j] = (t2 ^= result[j - 32]); - j++; - result[j] = (t3 ^= result[j - 32]); - j++; - result[j] = (t4 ^= result[j - 32]); - j++; - } - } - return result; - } - - function decrypt256(input, key) { - var state = new Uint8Array(16); - state.set(input); - var i, j, k; - var t, u, v; - // AddRoundKey - for (j = 0, k = 224; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - for (i = 13; i >= 1; --i) { - // InvShiftRows - t = state[13]; - state[13] = state[9]; - state[9] = state[5]; - state[5] = state[1]; - state[1] = t; - t = state[14]; - u = state[10]; - state[14] = state[6]; - state[10] = state[2]; - state[6] = t; - state[2] = u; - t = state[15]; - u = state[11]; - v = state[7]; - state[15] = state[3]; - state[11] = t; - state[7] = u; - state[3] = v; - // InvSubBytes - for (j = 0; j < 16; ++j) { - state[j] = inv_s[state[j]]; - } - // AddRoundKey - for (j = 0, k = i * 16; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - // InvMixColumns - for (j = 0; j < 16; j += 4) { - var s0 = mix[state[j]], s1 = mix[state[j + 1]], - s2 = mix[state[j + 2]], s3 = mix[state[j + 3]]; - t = (s0 ^ (s1 >>> 8) ^ (s1 << 24) ^ (s2 >>> 16) ^ (s2 << 16) ^ - (s3 >>> 24) ^ (s3 << 8)); - state[j] = (t >>> 24) & 0xFF; - state[j + 1] = (t >> 16) & 0xFF; - state[j + 2] = (t >> 8) & 0xFF; - state[j + 3] = t & 0xFF; - } - } - // InvShiftRows - t = state[13]; - state[13] = state[9]; - state[9] = state[5]; - state[5] = state[1]; - state[1] = t; - t = state[14]; - u = state[10]; - state[14] = state[6]; - state[10] = state[2]; - state[6] = t; - state[2] = u; - t = state[15]; - u = state[11]; - v = state[7]; - state[15] = state[3]; - state[11] = t; - state[7] = u; - state[3] = v; - for (j = 0; j < 16; ++j) { - // InvSubBytes - state[j] = inv_s[state[j]]; - // AddRoundKey - state[j] ^= key[j]; - } - return state; - } - - function encrypt256(input, key) { - var t, u, v, k; - var state = new Uint8Array(16); - state.set(input); - for (j = 0; j < 16; ++j) { - // AddRoundKey - state[j] ^= key[j]; - } - - for (i = 1; i < 14; i++) { - //SubBytes - for (j = 0; j < 16; ++j) { - state[j] = s[state[j]]; - } - //ShiftRows - v = state[1]; - state[1] = state[5]; - state[5] = state[9]; - state[9] = state[13]; - state[13] = v; - v = state[2]; - u = state[6]; - state[2] = state[10]; - state[6] = state[14]; - state[10] = v; - state[14] = u; - v = state[3]; - u = state[7]; - t = state[11]; - state[3] = state[15]; - state[7] = v; - state[11] = u; - state[15] = t; - //MixColumns - for (var j = 0; j < 16; j += 4) { - var s0 = state[j + 0], s1 = state[j + 1]; - var s2 = state[j + 2], s3 = state[j + 3]; - t = s0 ^ s1 ^ s2 ^ s3; - state[j + 0] ^= t ^ mixCol[s0 ^ s1]; - state[j + 1] ^= t ^ mixCol[s1 ^ s2]; - state[j + 2] ^= t ^ mixCol[s2 ^ s3]; - state[j + 3] ^= t ^ mixCol[s3 ^ s0]; - } - //AddRoundKey - for (j = 0, k = i * 16; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - } - - //SubBytes - for (j = 0; j < 16; ++j) { - state[j] = s[state[j]]; - } - //ShiftRows - v = state[1]; - state[1] = state[5]; - state[5] = state[9]; - state[9] = state[13]; - state[13] = v; - v = state[2]; - u = state[6]; - state[2] = state[10]; - state[6] = state[14]; - state[10] = v; - state[14] = u; - v = state[3]; - u = state[7]; - t = state[11]; - state[3] = state[15]; - state[7] = v; - state[11] = u; - state[15] = t; - //AddRoundKey - for (j = 0, k = 224; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - - return state; - - } - - function AES256Cipher(key) { - this.key = expandKey256(key); - this.buffer = new Uint8Array(16); - this.bufferPosition = 0; - } - - function decryptBlock2(data, finalize) { - var i, j, ii, sourceLength = data.length, - buffer = this.buffer, bufferLength = this.bufferPosition, - result = [], iv = this.iv; - - for (i = 0; i < sourceLength; ++i) { - buffer[bufferLength] = data[i]; - ++bufferLength; - if (bufferLength < 16) { - continue; - } - // buffer is full, decrypting - var plain = decrypt256(buffer, this.key); - // xor-ing the IV vector to get plain text - for (j = 0; j < 16; ++j) { - plain[j] ^= iv[j]; - } - iv = buffer; - result.push(plain); - buffer = new Uint8Array(16); - bufferLength = 0; - } - // saving incomplete buffer - this.buffer = buffer; - this.bufferLength = bufferLength; - this.iv = iv; - if (result.length === 0) { - return new Uint8Array([]); - } - // combining plain text blocks into one - var outputLength = 16 * result.length; - if (finalize) { - // undo a padding that is described in RFC 2898 - var lastBlock = result[result.length - 1]; - var psLen = lastBlock[15]; - if (psLen <= 16) { - for (i = 15, ii = 16 - psLen; i >= ii; --i) { - if (lastBlock[i] !== psLen) { - // Invalid padding, assume that the block has no padding. - psLen = 0; - break; - } - } - outputLength -= psLen; - result[result.length - 1] = lastBlock.subarray(0, 16 - psLen); - } - } - var output = new Uint8Array(outputLength); - for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { - output.set(result[i], j); - } - return output; - - } - - AES256Cipher.prototype = { - decryptBlock: function AES256Cipher_decryptBlock(data, finalize, iv) { - var i, sourceLength = data.length; - var buffer = this.buffer, bufferLength = this.bufferPosition; - // if not supplied an IV wait for IV values - // they are at the start of the stream - if (iv) { - this.iv = iv; - } else { - for (i = 0; bufferLength < 16 && - i < sourceLength; ++i, ++bufferLength) { - buffer[bufferLength] = data[i]; - } - if (bufferLength < 16) { - //need more data - this.bufferLength = bufferLength; - return new Uint8Array([]); - } - this.iv = buffer; - data = data.subarray(16); - } - this.buffer = new Uint8Array(16); - this.bufferLength = 0; - // starting decryption - this.decryptBlock = decryptBlock2; - return this.decryptBlock(data, finalize); - }, - encrypt: function AES256Cipher_encrypt(data, iv) { - var i, j, ii, sourceLength = data.length, - buffer = this.buffer, bufferLength = this.bufferPosition, - result = []; - if (!iv) { - iv = new Uint8Array(16); - } - for (i = 0; i < sourceLength; ++i) { - buffer[bufferLength] = data[i]; - ++bufferLength; - if (bufferLength < 16) { - continue; - } - for (j = 0; j < 16; ++j) { - buffer[j] ^= iv[j]; - } - - // buffer is full, encrypting - var cipher = encrypt256(buffer, this.key); - this.iv = cipher; - result.push(cipher); - buffer = new Uint8Array(16); - bufferLength = 0; - } - // saving incomplete buffer - this.buffer = buffer; - this.bufferLength = bufferLength; - this.iv = iv; - if (result.length === 0) { - return new Uint8Array([]); - } - // combining plain text blocks into one - var outputLength = 16 * result.length; - var output = new Uint8Array(outputLength); - for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { - output.set(result[i], j); - } - return output; - } - }; - - return AES256Cipher; -})(); - -var PDF17 = (function PDF17Closure() { - - function compareByteArrays(array1, array2) { - if (array1.length !== array2.length) { - return false; - } - for (var i = 0; i < array1.length; i++) { - if (array1[i] !== array2[i]) { - return false; - } - } - return true; - } - - function PDF17() { - } - - PDF17.prototype = { - checkOwnerPassword: function PDF17_checkOwnerPassword(password, - ownerValidationSalt, - userBytes, - ownerPassword) { - var hashData = new Uint8Array(password.length + 56); - hashData.set(password, 0); - hashData.set(ownerValidationSalt, password.length); - hashData.set(userBytes, password.length + ownerValidationSalt.length); - var result = calculateSHA256(hashData, 0, hashData.length); - return compareByteArrays(result, ownerPassword); - }, - checkUserPassword: function PDF17_checkUserPassword(password, - userValidationSalt, - userPassword) { - var hashData = new Uint8Array(password.length + 8); - hashData.set(password, 0); - hashData.set(userValidationSalt, password.length); - var result = calculateSHA256(hashData, 0, hashData.length); - return compareByteArrays(result, userPassword); - }, - getOwnerKey: function PDF17_getOwnerKey(password, ownerKeySalt, userBytes, - ownerEncryption) { - var hashData = new Uint8Array(password.length + 56); - hashData.set(password, 0); - hashData.set(ownerKeySalt, password.length); - hashData.set(userBytes, password.length + ownerKeySalt.length); - var key = calculateSHA256(hashData, 0, hashData.length); - var cipher = new AES256Cipher(key); - return cipher.decryptBlock(ownerEncryption, - false, - new Uint8Array(16)); - - }, - getUserKey: function PDF17_getUserKey(password, userKeySalt, - userEncryption) { - var hashData = new Uint8Array(password.length + 8); - hashData.set(password, 0); - hashData.set(userKeySalt, password.length); - //key is the decryption key for the UE string - var key = calculateSHA256(hashData, 0, hashData.length); - var cipher = new AES256Cipher(key); - return cipher.decryptBlock(userEncryption, - false, - new Uint8Array(16)); - } - }; - return PDF17; -})(); - -var PDF20 = (function PDF20Closure() { - - function concatArrays(array1, array2) { - var t = new Uint8Array(array1.length + array2.length); - t.set(array1, 0); - t.set(array2, array1.length); - return t; - } - - function calculatePDF20Hash(password, input, userBytes) { - //This refers to Algorithm 2.B as defined in ISO 32000-2 - var k = calculateSHA256(input, 0, input.length).subarray(0, 32); - var e = [0]; - var i = 0; - while (i < 64 || e[e.length - 1] > i - 32) { - var arrayLength = password.length + k.length + userBytes.length; - - var k1 = new Uint8Array(arrayLength * 64); - var array = concatArrays(password, k); - array = concatArrays(array, userBytes); - for (var j = 0, pos = 0; j < 64; j++, pos += arrayLength) { - k1.set(array, pos); - } - //AES128 CBC NO PADDING with - //first 16 bytes of k as the key and the second 16 as the iv. - var cipher = new AES128Cipher(k.subarray(0, 16)); - e = cipher.encrypt(k1, k.subarray(16, 32)); - //Now we have to take the first 16 bytes of an unsigned - //big endian integer... and compute the remainder - //modulo 3.... That is a fairly large number and - //JavaScript isn't going to handle that well... - //So we're using a trick that allows us to perform - //modulo math byte by byte - var remainder = 0; - for (var z = 0; z < 16; z++) { - remainder *= (256 % 3); - remainder %= 3; - remainder += ((e[z] >>> 0) % 3); - remainder %= 3; - } - if (remainder === 0) { - k = calculateSHA256(e, 0, e.length); - } - else if (remainder === 1) { - k = calculateSHA384(e, 0, e.length); - } - else if (remainder === 2) { - k = calculateSHA512(e, 0, e.length); - } - i++; - } - return k.subarray(0, 32); - } - - function PDF20() { - } - - function compareByteArrays(array1, array2) { - if (array1.length !== array2.length) { - return false; - } - for (var i = 0; i < array1.length; i++) { - if (array1[i] !== array2[i]) { - return false; - } - } - return true; - } - - PDF20.prototype = { - hash: function PDF20_hash(password, concatBytes, userBytes) { - return calculatePDF20Hash(password, concatBytes, userBytes); - }, - checkOwnerPassword: function PDF20_checkOwnerPassword(password, - ownerValidationSalt, - userBytes, - ownerPassword) { - var hashData = new Uint8Array(password.length + 56); - hashData.set(password, 0); - hashData.set(ownerValidationSalt, password.length); - hashData.set(userBytes, password.length + ownerValidationSalt.length); - var result = calculatePDF20Hash(password, hashData, userBytes); - return compareByteArrays(result, ownerPassword); - }, - checkUserPassword: function PDF20_checkUserPassword(password, - userValidationSalt, - userPassword) { - var hashData = new Uint8Array(password.length + 8); - hashData.set(password, 0); - hashData.set(userValidationSalt, password.length); - var result = calculatePDF20Hash(password, hashData, []); - return compareByteArrays(result, userPassword); - }, - getOwnerKey: function PDF20_getOwnerKey(password, ownerKeySalt, userBytes, - ownerEncryption) { - var hashData = new Uint8Array(password.length + 56); - hashData.set(password, 0); - hashData.set(ownerKeySalt, password.length); - hashData.set(userBytes, password.length + ownerKeySalt.length); - var key = calculatePDF20Hash(password, hashData, userBytes); - var cipher = new AES256Cipher(key); - return cipher.decryptBlock(ownerEncryption, - false, - new Uint8Array(16)); - - }, - getUserKey: function PDF20_getUserKey(password, userKeySalt, - userEncryption) { - var hashData = new Uint8Array(password.length + 8); - hashData.set(password, 0); - hashData.set(userKeySalt, password.length); - //key is the decryption key for the UE string - var key = calculatePDF20Hash(password, hashData, []); - var cipher = new AES256Cipher(key); - return cipher.decryptBlock(userEncryption, - false, - new Uint8Array(16)); - } - }; - return PDF20; -})(); - -var CipherTransform = (function CipherTransformClosure() { - function CipherTransform(stringCipherConstructor, streamCipherConstructor) { - this.stringCipherConstructor = stringCipherConstructor; - this.streamCipherConstructor = streamCipherConstructor; - } - - CipherTransform.prototype = { - createStream: function CipherTransform_createStream(stream, length) { - var cipher = new this.streamCipherConstructor(); - return new DecryptStream(stream, length, - function cipherTransformDecryptStream(data, finalize) { - return cipher.decryptBlock(data, finalize); - } - ); - }, - decryptString: function CipherTransform_decryptString(s) { - var cipher = new this.stringCipherConstructor(); - var data = stringToBytes(s); - data = cipher.decryptBlock(data, true); - return bytesToString(data); - } - }; - return CipherTransform; -})(); - -var CipherTransformFactory = (function CipherTransformFactoryClosure() { - var defaultPasswordBytes = new Uint8Array([ - 0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41, - 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08, - 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80, - 0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A]); - - function createEncryptionKey20(revision, password, ownerPassword, - ownerValidationSalt, ownerKeySalt, uBytes, - userPassword, userValidationSalt, userKeySalt, - ownerEncryption, userEncryption, perms) { - if (password) { - var passwordLength = Math.min(127, password.length); - password = password.subarray(0, passwordLength); - } else { - password = []; - } - var pdfAlgorithm; - if (revision === 6) { - pdfAlgorithm = new PDF20(); - } else { - pdfAlgorithm = new PDF17(); - } - - if (pdfAlgorithm) { - if (pdfAlgorithm.checkUserPassword(password, userValidationSalt, - userPassword)) { - return pdfAlgorithm.getUserKey(password, userKeySalt, userEncryption); - } else if (password.length && pdfAlgorithm.checkOwnerPassword(password, - ownerValidationSalt, - uBytes, - ownerPassword)) { - return pdfAlgorithm.getOwnerKey(password, ownerKeySalt, uBytes, - ownerEncryption); - } - } - - return null; - } - - function prepareKeyData(fileId, password, ownerPassword, userPassword, - flags, revision, keyLength, encryptMetadata) { - var hashDataSize = 40 + ownerPassword.length + fileId.length; - var hashData = new Uint8Array(hashDataSize), i = 0, j, n; - if (password) { - n = Math.min(32, password.length); - for (; i < n; ++i) { - hashData[i] = password[i]; - } - } - j = 0; - while (i < 32) { - hashData[i++] = defaultPasswordBytes[j++]; - } - // as now the padded password in the hashData[0..i] - for (j = 0, n = ownerPassword.length; j < n; ++j) { - hashData[i++] = ownerPassword[j]; - } - hashData[i++] = flags & 0xFF; - hashData[i++] = (flags >> 8) & 0xFF; - hashData[i++] = (flags >> 16) & 0xFF; - hashData[i++] = (flags >>> 24) & 0xFF; - for (j = 0, n = fileId.length; j < n; ++j) { - hashData[i++] = fileId[j]; - } - if (revision >= 4 && !encryptMetadata) { - hashData[i++] = 0xFF; - hashData[i++] = 0xFF; - hashData[i++] = 0xFF; - hashData[i++] = 0xFF; - } - var hash = calculateMD5(hashData, 0, i); - var keyLengthInBytes = keyLength >> 3; - if (revision >= 3) { - for (j = 0; j < 50; ++j) { - hash = calculateMD5(hash, 0, keyLengthInBytes); - } - } - var encryptionKey = hash.subarray(0, keyLengthInBytes); - var cipher, checkData; - - if (revision >= 3) { - for (i = 0; i < 32; ++i) { - hashData[i] = defaultPasswordBytes[i]; - } - for (j = 0, n = fileId.length; j < n; ++j) { - hashData[i++] = fileId[j]; - } - cipher = new ARCFourCipher(encryptionKey); - checkData = cipher.encryptBlock(calculateMD5(hashData, 0, i)); - n = encryptionKey.length; - var derivedKey = new Uint8Array(n), k; - for (j = 1; j <= 19; ++j) { - for (k = 0; k < n; ++k) { - derivedKey[k] = encryptionKey[k] ^ j; - } - cipher = new ARCFourCipher(derivedKey); - checkData = cipher.encryptBlock(checkData); - } - for (j = 0, n = checkData.length; j < n; ++j) { - if (userPassword[j] !== checkData[j]) { - return null; - } - } - } else { - cipher = new ARCFourCipher(encryptionKey); - checkData = cipher.encryptBlock(defaultPasswordBytes); - for (j = 0, n = checkData.length; j < n; ++j) { - if (userPassword[j] !== checkData[j]) { - return null; - } - } - } - return encryptionKey; - } - - function decodeUserPassword(password, ownerPassword, revision, keyLength) { - var hashData = new Uint8Array(32), i = 0, j, n; - n = Math.min(32, password.length); - for (; i < n; ++i) { - hashData[i] = password[i]; - } - j = 0; - while (i < 32) { - hashData[i++] = defaultPasswordBytes[j++]; - } - var hash = calculateMD5(hashData, 0, i); - var keyLengthInBytes = keyLength >> 3; - if (revision >= 3) { - for (j = 0; j < 50; ++j) { - hash = calculateMD5(hash, 0, hash.length); - } - } - - var cipher, userPassword; - if (revision >= 3) { - userPassword = ownerPassword; - var derivedKey = new Uint8Array(keyLengthInBytes), k; - for (j = 19; j >= 0; j--) { - for (k = 0; k < keyLengthInBytes; ++k) { - derivedKey[k] = hash[k] ^ j; - } - cipher = new ARCFourCipher(derivedKey); - userPassword = cipher.encryptBlock(userPassword); - } - } else { - cipher = new ARCFourCipher(hash.subarray(0, keyLengthInBytes)); - userPassword = cipher.encryptBlock(ownerPassword); - } - return userPassword; - } - - var identityName = Name.get('Identity'); - - function CipherTransformFactory(dict, fileId, password) { - var filter = dict.get('Filter'); - if (!isName(filter) || filter.name !== 'Standard') { - error('unknown encryption method'); - } - this.dict = dict; - var algorithm = dict.get('V'); - if (!isInt(algorithm) || - (algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && - algorithm !== 5)) { - error('unsupported encryption algorithm'); - } - this.algorithm = algorithm; - var keyLength = dict.get('Length') || 40; - if (!isInt(keyLength) || - keyLength < 40 || (keyLength % 8) !== 0) { - error('invalid key length'); - } - - // prepare keys - var ownerPassword = stringToBytes(dict.get('O')).subarray(0, 32); - var userPassword = stringToBytes(dict.get('U')).subarray(0, 32); - var flags = dict.get('P'); - var revision = dict.get('R'); - // meaningful when V is 4 or 5 - var encryptMetadata = ((algorithm === 4 || algorithm === 5) && - dict.get('EncryptMetadata') !== false); - this.encryptMetadata = encryptMetadata; - - var fileIdBytes = stringToBytes(fileId); - var passwordBytes; - if (password) { - if (revision === 6) { - try { - password = utf8StringToString(password); - } catch (ex) { - warn('CipherTransformFactory: ' + - 'Unable to convert UTF8 encoded password.'); - } - } - passwordBytes = stringToBytes(password); - } - - var encryptionKey; - if (algorithm !== 5) { - encryptionKey = prepareKeyData(fileIdBytes, passwordBytes, - ownerPassword, userPassword, flags, - revision, keyLength, encryptMetadata); - } - else { - var ownerValidationSalt = stringToBytes(dict.get('O')).subarray(32, 40); - var ownerKeySalt = stringToBytes(dict.get('O')).subarray(40, 48); - var uBytes = stringToBytes(dict.get('U')).subarray(0, 48); - var userValidationSalt = stringToBytes(dict.get('U')).subarray(32, 40); - var userKeySalt = stringToBytes(dict.get('U')).subarray(40, 48); - var ownerEncryption = stringToBytes(dict.get('OE')); - var userEncryption = stringToBytes(dict.get('UE')); - var perms = stringToBytes(dict.get('Perms')); - encryptionKey = - createEncryptionKey20(revision, passwordBytes, - ownerPassword, ownerValidationSalt, - ownerKeySalt, uBytes, - userPassword, userValidationSalt, - userKeySalt, ownerEncryption, - userEncryption, perms); - } - if (!encryptionKey && !password) { - throw new PasswordException('No password given', - PasswordResponses.NEED_PASSWORD); - } else if (!encryptionKey && password) { - // Attempting use the password as an owner password - var decodedPassword = decodeUserPassword(passwordBytes, ownerPassword, - revision, keyLength); - encryptionKey = prepareKeyData(fileIdBytes, decodedPassword, - ownerPassword, userPassword, flags, - revision, keyLength, encryptMetadata); - } - - if (!encryptionKey) { - throw new PasswordException('Incorrect Password', - PasswordResponses.INCORRECT_PASSWORD); - } - - this.encryptionKey = encryptionKey; - - if (algorithm >= 4) { - this.cf = dict.get('CF'); - this.stmf = dict.get('StmF') || identityName; - this.strf = dict.get('StrF') || identityName; - this.eff = dict.get('EFF') || this.stmf; - } - } - - function buildObjectKey(num, gen, encryptionKey, isAes) { - var key = new Uint8Array(encryptionKey.length + 9), i, n; - for (i = 0, n = encryptionKey.length; i < n; ++i) { - key[i] = encryptionKey[i]; - } - key[i++] = num & 0xFF; - key[i++] = (num >> 8) & 0xFF; - key[i++] = (num >> 16) & 0xFF; - key[i++] = gen & 0xFF; - key[i++] = (gen >> 8) & 0xFF; - if (isAes) { - key[i++] = 0x73; - key[i++] = 0x41; - key[i++] = 0x6C; - key[i++] = 0x54; - } - var hash = calculateMD5(key, 0, i); - return hash.subarray(0, Math.min(encryptionKey.length + 5, 16)); - } - - function buildCipherConstructor(cf, name, num, gen, key) { - var cryptFilter = cf.get(name.name); - var cfm; - if (cryptFilter !== null && cryptFilter !== undefined) { - cfm = cryptFilter.get('CFM'); - } - if (!cfm || cfm.name === 'None') { - return function cipherTransformFactoryBuildCipherConstructorNone() { - return new NullCipher(); - }; - } - if ('V2' === cfm.name) { - return function cipherTransformFactoryBuildCipherConstructorV2() { - return new ARCFourCipher(buildObjectKey(num, gen, key, false)); - }; - } - if ('AESV2' === cfm.name) { - return function cipherTransformFactoryBuildCipherConstructorAESV2() { - return new AES128Cipher(buildObjectKey(num, gen, key, true)); - }; - } - if ('AESV3' === cfm.name) { - return function cipherTransformFactoryBuildCipherConstructorAESV3() { - return new AES256Cipher(key); - }; - } - error('Unknown crypto method'); - } - - CipherTransformFactory.prototype = { - createCipherTransform: - function CipherTransformFactory_createCipherTransform(num, gen) { - if (this.algorithm === 4 || this.algorithm === 5) { - return new CipherTransform( - buildCipherConstructor(this.cf, this.stmf, - num, gen, this.encryptionKey), - buildCipherConstructor(this.cf, this.strf, - num, gen, this.encryptionKey)); - } - // algorithms 1 and 2 - var key = buildObjectKey(num, gen, this.encryptionKey, false); - var cipherConstructor = function buildCipherCipherConstructor() { - return new ARCFourCipher(key); - }; - return new CipherTransform(cipherConstructor, cipherConstructor); - } - }; - - return CipherTransformFactory; -})(); - - -var ShadingType = { - FUNCTION_BASED: 1, - AXIAL: 2, - RADIAL: 3, - FREE_FORM_MESH: 4, - LATTICE_FORM_MESH: 5, - COONS_PATCH_MESH: 6, - TENSOR_PATCH_MESH: 7 -}; - -var Pattern = (function PatternClosure() { - // Constructor should define this.getPattern - function Pattern() { - error('should not call Pattern constructor'); - } - - Pattern.prototype = { - // Input: current Canvas context - // Output: the appropriate fillStyle or strokeStyle - getPattern: function Pattern_getPattern(ctx) { - error('Should not call Pattern.getStyle: ' + ctx); - } - }; - - Pattern.parseShading = function Pattern_parseShading(shading, matrix, xref, - res, handler) { - - var dict = isStream(shading) ? shading.dict : shading; - var type = dict.get('ShadingType'); - - try { - switch (type) { - case ShadingType.AXIAL: - case ShadingType.RADIAL: - // Both radial and axial shadings are handled by RadialAxial shading. - return new Shadings.RadialAxial(dict, matrix, xref, res); - case ShadingType.FREE_FORM_MESH: - case ShadingType.LATTICE_FORM_MESH: - case ShadingType.COONS_PATCH_MESH: - case ShadingType.TENSOR_PATCH_MESH: - return new Shadings.Mesh(shading, matrix, xref, res); - default: - throw new Error('Unsupported ShadingType: ' + type); - } - } catch (ex) { - if (ex instanceof MissingDataException) { - throw ex; - } - handler.send('UnsupportedFeature', - {featureId: UNSUPPORTED_FEATURES.shadingPattern}); - warn(ex); - return new Shadings.Dummy(); - } - }; - return Pattern; -})(); - -var Shadings = {}; - -// A small number to offset the first/last color stops so we can insert ones to -// support extend. Number.MIN_VALUE appears to be too small and breaks the -// extend. 1e-7 works in FF but chrome seems to use an even smaller sized number -// internally so we have to go bigger. -Shadings.SMALL_NUMBER = 1e-2; - -// Radial and axial shading have very similar implementations -// If needed, the implementations can be broken into two classes -Shadings.RadialAxial = (function RadialAxialClosure() { - function RadialAxial(dict, matrix, xref, res) { - this.matrix = matrix; - this.coordsArr = dict.get('Coords'); - this.shadingType = dict.get('ShadingType'); - this.type = 'Pattern'; - var cs = dict.get('ColorSpace', 'CS'); - cs = ColorSpace.parse(cs, xref, res); - this.cs = cs; - - var t0 = 0.0, t1 = 1.0; - if (dict.has('Domain')) { - var domainArr = dict.get('Domain'); - t0 = domainArr[0]; - t1 = domainArr[1]; - } - - var extendStart = false, extendEnd = false; - if (dict.has('Extend')) { - var extendArr = dict.get('Extend'); - extendStart = extendArr[0]; - extendEnd = extendArr[1]; - } - - if (this.shadingType === ShadingType.RADIAL && - (!extendStart || !extendEnd)) { - // Radial gradient only currently works if either circle is fully within - // the other circle. - var x1 = this.coordsArr[0]; - var y1 = this.coordsArr[1]; - var r1 = this.coordsArr[2]; - var x2 = this.coordsArr[3]; - var y2 = this.coordsArr[4]; - var r2 = this.coordsArr[5]; - var distance = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); - if (r1 <= r2 + distance && - r2 <= r1 + distance) { - warn('Unsupported radial gradient.'); - } - } - - this.extendStart = extendStart; - this.extendEnd = extendEnd; - - var fnObj = dict.get('Function'); - var fn = PDFFunction.parseArray(xref, fnObj); - - // 10 samples seems good enough for now, but probably won't work - // if there are sharp color changes. Ideally, we would implement - // the spec faithfully and add lossless optimizations. - var diff = t1 - t0; - var step = diff / 10; - - var colorStops = this.colorStops = []; - - // Protect against bad domains so we don't end up in an infinte loop below. - if (t0 >= t1 || step <= 0) { - // Acrobat doesn't seem to handle these cases so we'll ignore for - // now. - info('Bad shading domain.'); - return; - } - - var color = new Float32Array(cs.numComps), ratio = new Float32Array(1); - var rgbColor; - for (var i = t0; i <= t1; i += step) { - ratio[0] = i; - fn(ratio, 0, color, 0); - rgbColor = cs.getRgb(color, 0); - var cssColor = Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]); - colorStops.push([(i - t0) / diff, cssColor]); - } - - var background = 'transparent'; - if (dict.has('Background')) { - rgbColor = cs.getRgb(dict.get('Background'), 0); - background = Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]); - } - - if (!extendStart) { - // Insert a color stop at the front and offset the first real color stop - // so it doesn't conflict with the one we insert. - colorStops.unshift([0, background]); - colorStops[1][0] += Shadings.SMALL_NUMBER; - } - if (!extendEnd) { - // Same idea as above in extendStart but for the end. - colorStops[colorStops.length - 1][0] -= Shadings.SMALL_NUMBER; - colorStops.push([1, background]); - } - - this.colorStops = colorStops; - } - - RadialAxial.prototype = { - getIR: function RadialAxial_getIR() { - var coordsArr = this.coordsArr; - var shadingType = this.shadingType; - var type, p0, p1, r0, r1; - if (shadingType === ShadingType.AXIAL) { - p0 = [coordsArr[0], coordsArr[1]]; - p1 = [coordsArr[2], coordsArr[3]]; - r0 = null; - r1 = null; - type = 'axial'; - } else if (shadingType === ShadingType.RADIAL) { - p0 = [coordsArr[0], coordsArr[1]]; - p1 = [coordsArr[3], coordsArr[4]]; - r0 = coordsArr[2]; - r1 = coordsArr[5]; - type = 'radial'; - } else { - error('getPattern type unknown: ' + shadingType); - } - - var matrix = this.matrix; - if (matrix) { - p0 = Util.applyTransform(p0, matrix); - p1 = Util.applyTransform(p1, matrix); - if (shadingType === ShadingType.RADIAL) { - var scale = Util.singularValueDecompose2dScale(matrix); - r0 *= scale[0]; - r1 *= scale[1]; - } - } - - return ['RadialAxial', type, this.colorStops, p0, p1, r0, r1]; - } - }; - - return RadialAxial; -})(); - -// All mesh shading. For now, they will be presented as set of the triangles -// to be drawn on the canvas and rgb color for each vertex. -Shadings.Mesh = (function MeshClosure() { - function MeshStreamReader(stream, context) { - this.stream = stream; - this.context = context; - this.buffer = 0; - this.bufferLength = 0; - - var numComps = context.numComps; - this.tmpCompsBuf = new Float32Array(numComps); - var csNumComps = context.colorSpace.numComps; - this.tmpCsCompsBuf = context.colorFn ? new Float32Array(csNumComps) : - this.tmpCompsBuf; - } - MeshStreamReader.prototype = { - get hasData() { - if (this.stream.end) { - return this.stream.pos < this.stream.end; - } - if (this.bufferLength > 0) { - return true; - } - var nextByte = this.stream.getByte(); - if (nextByte < 0) { - return false; - } - this.buffer = nextByte; - this.bufferLength = 8; - return true; - }, - readBits: function MeshStreamReader_readBits(n) { - var buffer = this.buffer; - var bufferLength = this.bufferLength; - if (n === 32) { - if (bufferLength === 0) { - return ((this.stream.getByte() << 24) | - (this.stream.getByte() << 16) | (this.stream.getByte() << 8) | - this.stream.getByte()) >>> 0; - } - buffer = (buffer << 24) | (this.stream.getByte() << 16) | - (this.stream.getByte() << 8) | this.stream.getByte(); - var nextByte = this.stream.getByte(); - this.buffer = nextByte & ((1 << bufferLength) - 1); - return ((buffer << (8 - bufferLength)) | - ((nextByte & 0xFF) >> bufferLength)) >>> 0; - } - if (n === 8 && bufferLength === 0) { - return this.stream.getByte(); - } - while (bufferLength < n) { - buffer = (buffer << 8) | this.stream.getByte(); - bufferLength += 8; - } - bufferLength -= n; - this.bufferLength = bufferLength; - this.buffer = buffer & ((1 << bufferLength) - 1); - return buffer >> bufferLength; - }, - align: function MeshStreamReader_align() { - this.buffer = 0; - this.bufferLength = 0; - }, - readFlag: function MeshStreamReader_readFlag() { - return this.readBits(this.context.bitsPerFlag); - }, - readCoordinate: function MeshStreamReader_readCoordinate() { - var bitsPerCoordinate = this.context.bitsPerCoordinate; - var xi = this.readBits(bitsPerCoordinate); - var yi = this.readBits(bitsPerCoordinate); - var decode = this.context.decode; - var scale = bitsPerCoordinate < 32 ? 1 / ((1 << bitsPerCoordinate) - 1) : - 2.3283064365386963e-10; // 2 ^ -32 - return [ - xi * scale * (decode[1] - decode[0]) + decode[0], - yi * scale * (decode[3] - decode[2]) + decode[2] - ]; - }, - readComponents: function MeshStreamReader_readComponents() { - var numComps = this.context.numComps; - var bitsPerComponent = this.context.bitsPerComponent; - var scale = bitsPerComponent < 32 ? 1 / ((1 << bitsPerComponent) - 1) : - 2.3283064365386963e-10; // 2 ^ -32 - var decode = this.context.decode; - var components = this.tmpCompsBuf; - for (var i = 0, j = 4; i < numComps; i++, j += 2) { - var ci = this.readBits(bitsPerComponent); - components[i] = ci * scale * (decode[j + 1] - decode[j]) + decode[j]; - } - var color = this.tmpCsCompsBuf; - if (this.context.colorFn) { - this.context.colorFn(components, 0, color, 0); - } - return this.context.colorSpace.getRgb(color, 0); - } - }; - - function decodeType4Shading(mesh, reader) { - var coords = mesh.coords; - var colors = mesh.colors; - var operators = []; - var ps = []; // not maintaining cs since that will match ps - var verticesLeft = 0; // assuming we have all data to start a new triangle - while (reader.hasData) { - var f = reader.readFlag(); - var coord = reader.readCoordinate(); - var color = reader.readComponents(); - if (verticesLeft === 0) { // ignoring flags if we started a triangle - assert(0 <= f && f <= 2, 'Unknown type4 flag'); - switch (f) { - case 0: - verticesLeft = 3; - break; - case 1: - ps.push(ps[ps.length - 2], ps[ps.length - 1]); - verticesLeft = 1; - break; - case 2: - ps.push(ps[ps.length - 3], ps[ps.length - 1]); - verticesLeft = 1; - break; - } - operators.push(f); - } - ps.push(coords.length); - coords.push(coord); - colors.push(color); - verticesLeft--; - - reader.align(); - } - mesh.figures.push({ - type: 'triangles', - coords: new Int32Array(ps), - colors: new Int32Array(ps), - }); - } - - function decodeType5Shading(mesh, reader, verticesPerRow) { - var coords = mesh.coords; - var colors = mesh.colors; - var ps = []; // not maintaining cs since that will match ps - while (reader.hasData) { - var coord = reader.readCoordinate(); - var color = reader.readComponents(); - ps.push(coords.length); - coords.push(coord); - colors.push(color); - } - mesh.figures.push({ - type: 'lattice', - coords: new Int32Array(ps), - colors: new Int32Array(ps), - verticesPerRow: verticesPerRow - }); - } - - var MIN_SPLIT_PATCH_CHUNKS_AMOUNT = 3; - var MAX_SPLIT_PATCH_CHUNKS_AMOUNT = 20; - - var TRIANGLE_DENSITY = 20; // count of triangles per entire mesh bounds - - var getB = (function getBClosure() { - function buildB(count) { - var lut = []; - for (var i = 0; i <= count; i++) { - var t = i / count, t_ = 1 - t; - lut.push(new Float32Array([t_ * t_ * t_, 3 * t * t_ * t_, - 3 * t * t * t_, t * t * t])); - } - return lut; - } - var cache = []; - return function getB(count) { - if (!cache[count]) { - cache[count] = buildB(count); - } - return cache[count]; - }; - })(); - - function buildFigureFromPatch(mesh, index) { - var figure = mesh.figures[index]; - assert(figure.type === 'patch', 'Unexpected patch mesh figure'); - - var coords = mesh.coords, colors = mesh.colors; - var pi = figure.coords; - var ci = figure.colors; - - var figureMinX = Math.min(coords[pi[0]][0], coords[pi[3]][0], - coords[pi[12]][0], coords[pi[15]][0]); - var figureMinY = Math.min(coords[pi[0]][1], coords[pi[3]][1], - coords[pi[12]][1], coords[pi[15]][1]); - var figureMaxX = Math.max(coords[pi[0]][0], coords[pi[3]][0], - coords[pi[12]][0], coords[pi[15]][0]); - var figureMaxY = Math.max(coords[pi[0]][1], coords[pi[3]][1], - coords[pi[12]][1], coords[pi[15]][1]); - var splitXBy = Math.ceil((figureMaxX - figureMinX) * TRIANGLE_DENSITY / - (mesh.bounds[2] - mesh.bounds[0])); - splitXBy = Math.max(MIN_SPLIT_PATCH_CHUNKS_AMOUNT, - Math.min(MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitXBy)); - var splitYBy = Math.ceil((figureMaxY - figureMinY) * TRIANGLE_DENSITY / - (mesh.bounds[3] - mesh.bounds[1])); - splitYBy = Math.max(MIN_SPLIT_PATCH_CHUNKS_AMOUNT, - Math.min(MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitYBy)); - - var verticesPerRow = splitXBy + 1; - var figureCoords = new Int32Array((splitYBy + 1) * verticesPerRow); - var figureColors = new Int32Array((splitYBy + 1) * verticesPerRow); - var k = 0; - var cl = new Uint8Array(3), cr = new Uint8Array(3); - var c0 = colors[ci[0]], c1 = colors[ci[1]], - c2 = colors[ci[2]], c3 = colors[ci[3]]; - var bRow = getB(splitYBy), bCol = getB(splitXBy); - for (var row = 0; row <= splitYBy; row++) { - cl[0] = ((c0[0] * (splitYBy - row) + c2[0] * row) / splitYBy) | 0; - cl[1] = ((c0[1] * (splitYBy - row) + c2[1] * row) / splitYBy) | 0; - cl[2] = ((c0[2] * (splitYBy - row) + c2[2] * row) / splitYBy) | 0; - - cr[0] = ((c1[0] * (splitYBy - row) + c3[0] * row) / splitYBy) | 0; - cr[1] = ((c1[1] * (splitYBy - row) + c3[1] * row) / splitYBy) | 0; - cr[2] = ((c1[2] * (splitYBy - row) + c3[2] * row) / splitYBy) | 0; - - for (var col = 0; col <= splitXBy; col++, k++) { - if ((row === 0 || row === splitYBy) && - (col === 0 || col === splitXBy)) { - continue; - } - var x = 0, y = 0; - var q = 0; - for (var i = 0; i <= 3; i++) { - for (var j = 0; j <= 3; j++, q++) { - var m = bRow[row][i] * bCol[col][j]; - x += coords[pi[q]][0] * m; - y += coords[pi[q]][1] * m; - } - } - figureCoords[k] = coords.length; - coords.push([x, y]); - figureColors[k] = colors.length; - var newColor = new Uint8Array(3); - newColor[0] = ((cl[0] * (splitXBy - col) + cr[0] * col) / splitXBy) | 0; - newColor[1] = ((cl[1] * (splitXBy - col) + cr[1] * col) / splitXBy) | 0; - newColor[2] = ((cl[2] * (splitXBy - col) + cr[2] * col) / splitXBy) | 0; - colors.push(newColor); - } - } - figureCoords[0] = pi[0]; - figureColors[0] = ci[0]; - figureCoords[splitXBy] = pi[3]; - figureColors[splitXBy] = ci[1]; - figureCoords[verticesPerRow * splitYBy] = pi[12]; - figureColors[verticesPerRow * splitYBy] = ci[2]; - figureCoords[verticesPerRow * splitYBy + splitXBy] = pi[15]; - figureColors[verticesPerRow * splitYBy + splitXBy] = ci[3]; - - mesh.figures[index] = { - type: 'lattice', - coords: figureCoords, - colors: figureColors, - verticesPerRow: verticesPerRow - }; - } - - function decodeType6Shading(mesh, reader) { - // A special case of Type 7. The p11, p12, p21, p22 automatically filled - var coords = mesh.coords; - var colors = mesh.colors; - var ps = new Int32Array(16); // p00, p10, ..., p30, p01, ..., p33 - var cs = new Int32Array(4); // c00, c30, c03, c33 - while (reader.hasData) { - var f = reader.readFlag(); - assert(0 <= f && f <= 3, 'Unknown type6 flag'); - var i, ii; - var pi = coords.length; - for (i = 0, ii = (f !== 0 ? 8 : 12); i < ii; i++) { - coords.push(reader.readCoordinate()); - } - var ci = colors.length; - for (i = 0, ii = (f !== 0 ? 2 : 4); i < ii; i++) { - colors.push(reader.readComponents()); - } - var tmp1, tmp2, tmp3, tmp4; - switch (f) { - case 0: - ps[12] = pi + 3; ps[13] = pi + 4; ps[14] = pi + 5; ps[15] = pi + 6; - ps[ 8] = pi + 2; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 7; - ps[ 4] = pi + 1; /* calculated below */ ps[ 7] = pi + 8; - ps[ 0] = pi; ps[ 1] = pi + 11; ps[ 2] = pi + 10; ps[ 3] = pi + 9; - cs[2] = ci + 1; cs[3] = ci + 2; - cs[0] = ci; cs[1] = ci + 3; - break; - case 1: - tmp1 = ps[12]; tmp2 = ps[13]; tmp3 = ps[14]; tmp4 = ps[15]; - ps[12] = tmp4; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = tmp3; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 3; - ps[ 4] = tmp2; /* calculated below */ ps[ 7] = pi + 4; - ps[ 0] = tmp1; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - tmp1 = cs[2]; tmp2 = cs[3]; - cs[2] = tmp2; cs[3] = ci; - cs[0] = tmp1; cs[1] = ci + 1; - break; - case 2: - tmp1 = ps[15]; - tmp2 = ps[11]; - ps[12] = ps[3]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = ps[7]; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 3; - ps[ 4] = tmp2; /* calculated below */ ps[ 7] = pi + 4; - ps[ 0] = tmp1; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - tmp1 = cs[3]; - cs[2] = cs[1]; cs[3] = ci; - cs[0] = tmp1; cs[1] = ci + 1; - break; - case 3: - ps[12] = ps[0]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = ps[1]; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 3; - ps[ 4] = ps[2]; /* calculated below */ ps[ 7] = pi + 4; - ps[ 0] = ps[3]; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - cs[2] = cs[0]; cs[3] = ci; - cs[0] = cs[1]; cs[1] = ci + 1; - break; - } - // set p11, p12, p21, p22 - ps[5] = coords.length; - coords.push([ - (-4 * coords[ps[0]][0] - coords[ps[15]][0] + - 6 * (coords[ps[4]][0] + coords[ps[1]][0]) - - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + - 3 * (coords[ps[13]][0] + coords[ps[7]][0])) / 9, - (-4 * coords[ps[0]][1] - coords[ps[15]][1] + - 6 * (coords[ps[4]][1] + coords[ps[1]][1]) - - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + - 3 * (coords[ps[13]][1] + coords[ps[7]][1])) / 9 - ]); - ps[6] = coords.length; - coords.push([ - (-4 * coords[ps[3]][0] - coords[ps[12]][0] + - 6 * (coords[ps[2]][0] + coords[ps[7]][0]) - - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + - 3 * (coords[ps[4]][0] + coords[ps[14]][0])) / 9, - (-4 * coords[ps[3]][1] - coords[ps[12]][1] + - 6 * (coords[ps[2]][1] + coords[ps[7]][1]) - - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + - 3 * (coords[ps[4]][1] + coords[ps[14]][1])) / 9 - ]); - ps[9] = coords.length; - coords.push([ - (-4 * coords[ps[12]][0] - coords[ps[3]][0] + - 6 * (coords[ps[8]][0] + coords[ps[13]][0]) - - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + - 3 * (coords[ps[11]][0] + coords[ps[1]][0])) / 9, - (-4 * coords[ps[12]][1] - coords[ps[3]][1] + - 6 * (coords[ps[8]][1] + coords[ps[13]][1]) - - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + - 3 * (coords[ps[11]][1] + coords[ps[1]][1])) / 9 - ]); - ps[10] = coords.length; - coords.push([ - (-4 * coords[ps[15]][0] - coords[ps[0]][0] + - 6 * (coords[ps[11]][0] + coords[ps[14]][0]) - - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + - 3 * (coords[ps[2]][0] + coords[ps[8]][0])) / 9, - (-4 * coords[ps[15]][1] - coords[ps[0]][1] + - 6 * (coords[ps[11]][1] + coords[ps[14]][1]) - - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + - 3 * (coords[ps[2]][1] + coords[ps[8]][1])) / 9 - ]); - mesh.figures.push({ - type: 'patch', - coords: new Int32Array(ps), // making copies of ps and cs - colors: new Int32Array(cs) - }); - } - } - - function decodeType7Shading(mesh, reader) { - var coords = mesh.coords; - var colors = mesh.colors; - var ps = new Int32Array(16); // p00, p10, ..., p30, p01, ..., p33 - var cs = new Int32Array(4); // c00, c30, c03, c33 - while (reader.hasData) { - var f = reader.readFlag(); - assert(0 <= f && f <= 3, 'Unknown type7 flag'); - var i, ii; - var pi = coords.length; - for (i = 0, ii = (f !== 0 ? 12 : 16); i < ii; i++) { - coords.push(reader.readCoordinate()); - } - var ci = colors.length; - for (i = 0, ii = (f !== 0 ? 2 : 4); i < ii; i++) { - colors.push(reader.readComponents()); - } - var tmp1, tmp2, tmp3, tmp4; - switch (f) { - case 0: - ps[12] = pi + 3; ps[13] = pi + 4; ps[14] = pi + 5; ps[15] = pi + 6; - ps[ 8] = pi + 2; ps[ 9] = pi + 13; ps[10] = pi + 14; ps[11] = pi + 7; - ps[ 4] = pi + 1; ps[ 5] = pi + 12; ps[ 6] = pi + 15; ps[ 7] = pi + 8; - ps[ 0] = pi; ps[ 1] = pi + 11; ps[ 2] = pi + 10; ps[ 3] = pi + 9; - cs[2] = ci + 1; cs[3] = ci + 2; - cs[0] = ci; cs[1] = ci + 3; - break; - case 1: - tmp1 = ps[12]; tmp2 = ps[13]; tmp3 = ps[14]; tmp4 = ps[15]; - ps[12] = tmp4; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = tmp3; ps[ 9] = pi + 9; ps[10] = pi + 10; ps[11] = pi + 3; - ps[ 4] = tmp2; ps[ 5] = pi + 8; ps[ 6] = pi + 11; ps[ 7] = pi + 4; - ps[ 0] = tmp1; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - tmp1 = cs[2]; tmp2 = cs[3]; - cs[2] = tmp2; cs[3] = ci; - cs[0] = tmp1; cs[1] = ci + 1; - break; - case 2: - tmp1 = ps[15]; - tmp2 = ps[11]; - ps[12] = ps[3]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = ps[7]; ps[ 9] = pi + 9; ps[10] = pi + 10; ps[11] = pi + 3; - ps[ 4] = tmp2; ps[ 5] = pi + 8; ps[ 6] = pi + 11; ps[ 7] = pi + 4; - ps[ 0] = tmp1; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - tmp1 = cs[3]; - cs[2] = cs[1]; cs[3] = ci; - cs[0] = tmp1; cs[1] = ci + 1; - break; - case 3: - ps[12] = ps[0]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = ps[1]; ps[ 9] = pi + 9; ps[10] = pi + 10; ps[11] = pi + 3; - ps[ 4] = ps[2]; ps[ 5] = pi + 8; ps[ 6] = pi + 11; ps[ 7] = pi + 4; - ps[ 0] = ps[3]; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - cs[2] = cs[0]; cs[3] = ci; - cs[0] = cs[1]; cs[1] = ci + 1; - break; - } - mesh.figures.push({ - type: 'patch', - coords: new Int32Array(ps), // making copies of ps and cs - colors: new Int32Array(cs) - }); - } - } - - function updateBounds(mesh) { - var minX = mesh.coords[0][0], minY = mesh.coords[0][1], - maxX = minX, maxY = minY; - for (var i = 1, ii = mesh.coords.length; i < ii; i++) { - var x = mesh.coords[i][0], y = mesh.coords[i][1]; - minX = minX > x ? x : minX; - minY = minY > y ? y : minY; - maxX = maxX < x ? x : maxX; - maxY = maxY < y ? y : maxY; - } - mesh.bounds = [minX, minY, maxX, maxY]; - } - - function packData(mesh) { - var i, ii, j, jj; - - var coords = mesh.coords; - var coordsPacked = new Float32Array(coords.length * 2); - for (i = 0, j = 0, ii = coords.length; i < ii; i++) { - var xy = coords[i]; - coordsPacked[j++] = xy[0]; - coordsPacked[j++] = xy[1]; - } - mesh.coords = coordsPacked; - - var colors = mesh.colors; - var colorsPacked = new Uint8Array(colors.length * 3); - for (i = 0, j = 0, ii = colors.length; i < ii; i++) { - var c = colors[i]; - colorsPacked[j++] = c[0]; - colorsPacked[j++] = c[1]; - colorsPacked[j++] = c[2]; - } - mesh.colors = colorsPacked; - - var figures = mesh.figures; - for (i = 0, ii = figures.length; i < ii; i++) { - var figure = figures[i], ps = figure.coords, cs = figure.colors; - for (j = 0, jj = ps.length; j < jj; j++) { - ps[j] *= 2; - cs[j] *= 3; - } - } - } - - function Mesh(stream, matrix, xref, res) { - assert(isStream(stream), 'Mesh data is not a stream'); - var dict = stream.dict; - this.matrix = matrix; - this.shadingType = dict.get('ShadingType'); - this.type = 'Pattern'; - this.bbox = dict.get('BBox'); - var cs = dict.get('ColorSpace', 'CS'); - cs = ColorSpace.parse(cs, xref, res); - this.cs = cs; - this.background = dict.has('Background') ? - cs.getRgb(dict.get('Background'), 0) : null; - - var fnObj = dict.get('Function'); - var fn = fnObj ? PDFFunction.parseArray(xref, fnObj) : null; - - this.coords = []; - this.colors = []; - this.figures = []; - - var decodeContext = { - bitsPerCoordinate: dict.get('BitsPerCoordinate'), - bitsPerComponent: dict.get('BitsPerComponent'), - bitsPerFlag: dict.get('BitsPerFlag'), - decode: dict.get('Decode'), - colorFn: fn, - colorSpace: cs, - numComps: fn ? 1 : cs.numComps - }; - var reader = new MeshStreamReader(stream, decodeContext); - - var patchMesh = false; - switch (this.shadingType) { - case ShadingType.FREE_FORM_MESH: - decodeType4Shading(this, reader); - break; - case ShadingType.LATTICE_FORM_MESH: - var verticesPerRow = dict.get('VerticesPerRow') | 0; - assert(verticesPerRow >= 2, 'Invalid VerticesPerRow'); - decodeType5Shading(this, reader, verticesPerRow); - break; - case ShadingType.COONS_PATCH_MESH: - decodeType6Shading(this, reader); - patchMesh = true; - break; - case ShadingType.TENSOR_PATCH_MESH: - decodeType7Shading(this, reader); - patchMesh = true; - break; - default: - error('Unsupported mesh type.'); - break; - } - - if (patchMesh) { - // dirty bounds calculation for determining, how dense shall be triangles - updateBounds(this); - for (var i = 0, ii = this.figures.length; i < ii; i++) { - buildFigureFromPatch(this, i); - } - } - // calculate bounds - updateBounds(this); - - packData(this); - } - - Mesh.prototype = { - getIR: function Mesh_getIR() { - return ['Mesh', this.shadingType, this.coords, this.colors, this.figures, - this.bounds, this.matrix, this.bbox, this.background]; - } - }; - - return Mesh; -})(); - -Shadings.Dummy = (function DummyClosure() { - function Dummy() { - this.type = 'Pattern'; - } - - Dummy.prototype = { - getIR: function Dummy_getIR() { - return ['Dummy']; - } - }; - return Dummy; -})(); - -function getTilingPatternIR(operatorList, dict, args) { - var matrix = dict.get('Matrix'); - var bbox = dict.get('BBox'); - var xstep = dict.get('XStep'); - var ystep = dict.get('YStep'); - var paintType = dict.get('PaintType'); - var tilingType = dict.get('TilingType'); - - return [ - 'TilingPattern', args, operatorList, matrix, bbox, xstep, ystep, - paintType, tilingType - ]; -} - - -var PartialEvaluator = (function PartialEvaluatorClosure() { - function PartialEvaluator(pdfManager, xref, handler, pageIndex, - uniquePrefix, idCounters, fontCache) { - this.pdfManager = pdfManager; - this.xref = xref; - this.handler = handler; - this.pageIndex = pageIndex; - this.uniquePrefix = uniquePrefix; - this.idCounters = idCounters; - this.fontCache = fontCache; - } - - // Trying to minimize Date.now() usage and check every 100 time - var TIME_SLOT_DURATION_MS = 20; - var CHECK_TIME_EVERY = 100; - function TimeSlotManager() { - this.reset(); - } - TimeSlotManager.prototype = { - check: function TimeSlotManager_check() { - if (++this.checked < CHECK_TIME_EVERY) { - return false; - } - this.checked = 0; - return this.endTime <= Date.now(); - }, - reset: function TimeSlotManager_reset() { - this.endTime = Date.now() + TIME_SLOT_DURATION_MS; - this.checked = 0; - } - }; - - var deferred = Promise.resolve(); - - var TILING_PATTERN = 1, SHADING_PATTERN = 2; - - PartialEvaluator.prototype = { - hasBlendModes: function PartialEvaluator_hasBlendModes(resources) { - if (!isDict(resources)) { - return false; - } - - var processed = Object.create(null); - if (resources.objId) { - processed[resources.objId] = true; - } - - var nodes = [resources]; - while (nodes.length) { - var key; - var node = nodes.shift(); - // First check the current resources for blend modes. - var graphicStates = node.get('ExtGState'); - if (isDict(graphicStates)) { - graphicStates = graphicStates.getAll(); - for (key in graphicStates) { - var graphicState = graphicStates[key]; - var bm = graphicState['BM']; - if (isName(bm) && bm.name !== 'Normal') { - return true; - } - } - } - // Descend into the XObjects to look for more resources and blend modes. - var xObjects = node.get('XObject'); - if (!isDict(xObjects)) { - continue; - } - xObjects = xObjects.getAll(); - for (key in xObjects) { - var xObject = xObjects[key]; - if (!isStream(xObject)) { - continue; - } - if (xObject.dict.objId) { - if (processed[xObject.dict.objId]) { - // stream has objId and is processed already - continue; - } - processed[xObject.dict.objId] = true; - } - var xResources = xObject.dict.get('Resources'); - // Checking objId to detect an infinite loop. - if (isDict(xResources) && - (!xResources.objId || !processed[xResources.objId])) { - nodes.push(xResources); - if (xResources.objId) { - processed[xResources.objId] = true; - } - } - } - } - return false; - }, - - buildFormXObject: function PartialEvaluator_buildFormXObject(resources, - xobj, smask, - operatorList, - task, - initialState) { - var matrix = xobj.dict.getArray('Matrix'); - var bbox = xobj.dict.getArray('BBox'); - var group = xobj.dict.get('Group'); - if (group) { - var groupOptions = { - matrix: matrix, - bbox: bbox, - smask: smask, - isolated: false, - knockout: false - }; - - var groupSubtype = group.get('S'); - var colorSpace; - if (isName(groupSubtype) && groupSubtype.name === 'Transparency') { - groupOptions.isolated = (group.get('I') || false); - groupOptions.knockout = (group.get('K') || false); - colorSpace = (group.has('CS') ? - ColorSpace.parse(group.get('CS'), this.xref, resources) : null); - } - - if (smask && smask.backdrop) { - colorSpace = colorSpace || ColorSpace.singletons.rgb; - smask.backdrop = colorSpace.getRgb(smask.backdrop, 0); - } - - operatorList.addOp(OPS.beginGroup, [groupOptions]); - } - - operatorList.addOp(OPS.paintFormXObjectBegin, [matrix, bbox]); - - return this.getOperatorList(xobj, task, - (xobj.dict.get('Resources') || resources), operatorList, initialState). - then(function () { - operatorList.addOp(OPS.paintFormXObjectEnd, []); - - if (group) { - operatorList.addOp(OPS.endGroup, [groupOptions]); - } - }); - }, - - buildPaintImageXObject: - function PartialEvaluator_buildPaintImageXObject(resources, image, - inline, operatorList, - cacheKey, imageCache) { - var self = this; - var dict = image.dict; - var w = dict.get('Width', 'W'); - var h = dict.get('Height', 'H'); - - if (!(w && isNum(w)) || !(h && isNum(h))) { - warn('Image dimensions are missing, or not numbers.'); - return; - } - if (PDFJS.maxImageSize !== -1 && w * h > PDFJS.maxImageSize) { - warn('Image exceeded maximum allowed size and was removed.'); - return; - } - - var imageMask = (dict.get('ImageMask', 'IM') || false); - var imgData, args; - if (imageMask) { - // This depends on a tmpCanvas being filled with the - // current fillStyle, such that processing the pixel - // data can't be done here. Instead of creating a - // complete PDFImage, only read the information needed - // for later. - - var width = dict.get('Width', 'W'); - var height = dict.get('Height', 'H'); - var bitStrideLength = (width + 7) >> 3; - var imgArray = image.getBytes(bitStrideLength * height); - var decode = dict.get('Decode', 'D'); - var inverseDecode = (!!decode && decode[0] > 0); - - imgData = PDFImage.createMask(imgArray, width, height, - image instanceof DecodeStream, - inverseDecode); - imgData.cached = true; - args = [imgData]; - operatorList.addOp(OPS.paintImageMaskXObject, args); - if (cacheKey) { - imageCache[cacheKey] = { - fn: OPS.paintImageMaskXObject, - args: args - }; - } - return; - } - - var softMask = (dict.get('SMask', 'SM') || false); - var mask = (dict.get('Mask') || false); - - var SMALL_IMAGE_DIMENSIONS = 200; - // Inlining small images into the queue as RGB data - if (inline && !softMask && !mask && !(image instanceof JpegStream) && - (w + h) < SMALL_IMAGE_DIMENSIONS) { - var imageObj = new PDFImage(this.xref, resources, image, - inline, null, null); - // We force the use of RGBA_32BPP images here, because we can't handle - // any other kind. - imgData = imageObj.createImageData(/* forceRGBA = */ true); - operatorList.addOp(OPS.paintInlineImageXObject, [imgData]); - return; - } - - // If there is no imageMask, create the PDFImage and a lot - // of image processing can be done here. - var uniquePrefix = (this.uniquePrefix || ''); - var objId = 'img_' + uniquePrefix + (++this.idCounters.obj); - operatorList.addDependency(objId); - args = [objId, w, h]; - - if (!softMask && !mask && image instanceof JpegStream && - image.isNativelySupported(this.xref, resources)) { - // These JPEGs don't need any more processing so we can just send it. - operatorList.addOp(OPS.paintJpegXObject, args); - this.handler.send('obj', - [objId, this.pageIndex, 'JpegStream', image.getIR()]); - return; - } - - PDFImage.buildImage(self.handler, self.xref, resources, image, inline). - then(function(imageObj) { - var imgData = imageObj.createImageData(/* forceRGBA = */ false); - self.handler.send('obj', [objId, self.pageIndex, 'Image', imgData], - [imgData.data.buffer]); - }).then(undefined, function (reason) { - warn('Unable to decode image: ' + reason); - self.handler.send('obj', [objId, self.pageIndex, 'Image', null]); - }); - - operatorList.addOp(OPS.paintImageXObject, args); - if (cacheKey) { - imageCache[cacheKey] = { - fn: OPS.paintImageXObject, - args: args - }; - } - }, - - handleSMask: function PartialEvaluator_handleSmask(smask, resources, - operatorList, task, - stateManager) { - var smaskContent = smask.get('G'); - var smaskOptions = { - subtype: smask.get('S').name, - backdrop: smask.get('BC') - }; - - // The SMask might have a alpha/luminosity value transfer function -- - // we will build a map of integer values in range 0..255 to be fast. - var transferObj = smask.get('TR'); - if (isPDFFunction(transferObj)) { - var transferFn = PDFFunction.parse(this.xref, transferObj); - var transferMap = new Uint8Array(256); - var tmp = new Float32Array(1); - for (var i = 0; i < 255; i++) { - tmp[0] = i / 255; - transferFn(tmp, 0, tmp, 0); - transferMap[i] = (tmp[0] * 255) | 0; - } - smaskOptions.transferMap = transferMap; - } - - return this.buildFormXObject(resources, smaskContent, smaskOptions, - operatorList, task, stateManager.state.clone()); - }, - - handleTilingType: - function PartialEvaluator_handleTilingType(fn, args, resources, - pattern, patternDict, - operatorList, task) { - // Create an IR of the pattern code. - var tilingOpList = new OperatorList(); - // Merge the available resources, to prevent issues when the patternDict - // is missing some /Resources entries (fixes issue6541.pdf). - var resourcesArray = [patternDict.get('Resources'), resources]; - var patternResources = Dict.merge(this.xref, resourcesArray); - - return this.getOperatorList(pattern, task, patternResources, - tilingOpList).then(function () { - // Add the dependencies to the parent operator list so they are - // resolved before sub operator list is executed synchronously. - operatorList.addDependencies(tilingOpList.dependencies); - operatorList.addOp(fn, getTilingPatternIR({ - fnArray: tilingOpList.fnArray, - argsArray: tilingOpList.argsArray - }, patternDict, args)); - }); - }, - - handleSetFont: - function PartialEvaluator_handleSetFont(resources, fontArgs, fontRef, - operatorList, task, state) { - // TODO(mack): Not needed? - var fontName; - if (fontArgs) { - fontArgs = fontArgs.slice(); - fontName = fontArgs[0].name; - } - - var self = this; - return this.loadFont(fontName, fontRef, this.xref, resources).then( - function (translated) { - if (!translated.font.isType3Font) { - return translated; - } - return translated.loadType3Data(self, resources, operatorList, task). - then(function () { - return translated; - }, function (reason) { - // Error in the font data -- sending unsupported feature notification. - self.handler.send('UnsupportedFeature', - {featureId: UNSUPPORTED_FEATURES.font}); - return new TranslatedFont('g_font_error', - new ErrorFont('Type3 font load error: ' + reason), translated.font); - }); - }).then(function (translated) { - state.font = translated.font; - translated.send(self.handler); - return translated.loadedName; - }); - }, - - handleText: function PartialEvaluator_handleText(chars, state) { - var font = state.font; - var glyphs = font.charsToGlyphs(chars); - var isAddToPathSet = !!(state.textRenderingMode & - TextRenderingMode.ADD_TO_PATH_FLAG); - if (font.data && (isAddToPathSet || PDFJS.disableFontFace)) { - var buildPath = function (fontChar) { - if (!font.renderer.hasBuiltPath(fontChar)) { - var path = font.renderer.getPathJs(fontChar); - this.handler.send('commonobj', [ - font.loadedName + '_path_' + fontChar, - 'FontPath', - path - ]); - } - }.bind(this); - - for (var i = 0, ii = glyphs.length; i < ii; i++) { - var glyph = glyphs[i]; - buildPath(glyph.fontChar); - - // If the glyph has an accent we need to build a path for its - // fontChar too, otherwise CanvasGraphics_paintChar will fail. - var accent = glyph.accent; - if (accent && accent.fontChar) { - buildPath(accent.fontChar); - } - } - } - - return glyphs; - }, - - setGState: function PartialEvaluator_setGState(resources, gState, - operatorList, task, - xref, stateManager) { - // This array holds the converted/processed state data. - var gStateObj = []; - var gStateMap = gState.map; - var self = this; - var promise = Promise.resolve(); - for (var key in gStateMap) { - var value = gStateMap[key]; - switch (key) { - case 'Type': - break; - case 'LW': - case 'LC': - case 'LJ': - case 'ML': - case 'D': - case 'RI': - case 'FL': - case 'CA': - case 'ca': - gStateObj.push([key, value]); - break; - case 'Font': - promise = promise.then(function () { - return self.handleSetFont(resources, null, value[0], operatorList, - task, stateManager.state). - then(function (loadedName) { - operatorList.addDependency(loadedName); - gStateObj.push([key, [loadedName, value[1]]]); - }); - }); - break; - case 'BM': - gStateObj.push([key, value]); - break; - case 'SMask': - if (isName(value) && value.name === 'None') { - gStateObj.push([key, false]); - break; - } - var dict = xref.fetchIfRef(value); - if (isDict(dict)) { - promise = promise.then(function () { - return self.handleSMask(dict, resources, operatorList, - task, stateManager); - }); - gStateObj.push([key, true]); - } else { - warn('Unsupported SMask type'); - } - - break; - // Only generate info log messages for the following since - // they are unlikely to have a big impact on the rendering. - case 'OP': - case 'op': - case 'OPM': - case 'BG': - case 'BG2': - case 'UCR': - case 'UCR2': - case 'TR': - case 'TR2': - case 'HT': - case 'SM': - case 'SA': - case 'AIS': - case 'TK': - // TODO implement these operators. - info('graphic state operator ' + key); - break; - default: - info('Unknown graphic state operator ' + key); - break; - } - } - return promise.then(function () { - if (gStateObj.length >= 0) { - operatorList.addOp(OPS.setGState, [gStateObj]); - } - }); - }, - - loadFont: function PartialEvaluator_loadFont(fontName, font, xref, - resources) { - - function errorFont() { - return Promise.resolve(new TranslatedFont('g_font_error', - new ErrorFont('Font ' + fontName + ' is not available'), font)); - } - var fontRef; - if (font) { // Loading by ref. - assert(isRef(font)); - fontRef = font; - } else { // Loading by name. - var fontRes = resources.get('Font'); - if (fontRes) { - fontRef = fontRes.getRaw(fontName); - } else { - warn('fontRes not available'); - return errorFont(); - } - } - if (!fontRef) { - warn('fontRef not available'); - return errorFont(); - } - - if (this.fontCache.has(fontRef)) { - return this.fontCache.get(fontRef); - } - - font = xref.fetchIfRef(fontRef); - if (!isDict(font)) { - return errorFont(); - } - - // We are holding font.translated references just for fontRef that are not - // dictionaries (Dict). See explanation below. - if (font.translated) { - return font.translated; - } - - var fontCapability = createPromiseCapability(); - - var preEvaluatedFont = this.preEvaluateFont(font, xref); - var descriptor = preEvaluatedFont.descriptor; - var fontID = fontRef.num + '_' + fontRef.gen; - if (isDict(descriptor)) { - if (!descriptor.fontAliases) { - descriptor.fontAliases = Object.create(null); - } - - var fontAliases = descriptor.fontAliases; - var hash = preEvaluatedFont.hash; - if (fontAliases[hash]) { - var aliasFontRef = fontAliases[hash].aliasRef; - if (aliasFontRef && this.fontCache.has(aliasFontRef)) { - this.fontCache.putAlias(fontRef, aliasFontRef); - return this.fontCache.get(fontRef); - } - } - - if (!fontAliases[hash]) { - fontAliases[hash] = { - fontID: Font.getFontID() - }; - } - - fontAliases[hash].aliasRef = fontRef; - fontID = fontAliases[hash].fontID; - } - - // Workaround for bad PDF generators that don't reference fonts - // properly, i.e. by not using an object identifier. - // Check if the fontRef is a Dict (as opposed to a standard object), - // in which case we don't cache the font and instead reference it by - // fontName in font.loadedName below. - var fontRefIsDict = isDict(fontRef); - if (!fontRefIsDict) { - this.fontCache.put(fontRef, fontCapability.promise); - } - - // Keep track of each font we translated so the caller can - // load them asynchronously before calling display on a page. - font.loadedName = 'g_' + this.pdfManager.docId + '_f' + (fontRefIsDict ? - fontName.replace(/\W/g, '') : fontID); - - font.translated = fontCapability.promise; - - // TODO move promises into translate font - var translatedPromise; - try { - translatedPromise = Promise.resolve( - this.translateFont(preEvaluatedFont, xref)); - } catch (e) { - translatedPromise = Promise.reject(e); - } - - var self = this; - translatedPromise.then(function (translatedFont) { - if (translatedFont.fontType !== undefined) { - var xrefFontStats = xref.stats.fontTypes; - xrefFontStats[translatedFont.fontType] = true; - } - - fontCapability.resolve(new TranslatedFont(font.loadedName, - translatedFont, font)); - }, function (reason) { - // TODO fontCapability.reject? - // Error in the font data -- sending unsupported feature notification. - self.handler.send('UnsupportedFeature', - {featureId: UNSUPPORTED_FEATURES.font}); - - try { - // error, but it's still nice to have font type reported - var descriptor = preEvaluatedFont.descriptor; - var fontFile3 = descriptor && descriptor.get('FontFile3'); - var subtype = fontFile3 && fontFile3.get('Subtype'); - var fontType = getFontType(preEvaluatedFont.type, - subtype && subtype.name); - var xrefFontStats = xref.stats.fontTypes; - xrefFontStats[fontType] = true; - } catch (ex) { } - - fontCapability.resolve(new TranslatedFont(font.loadedName, - new ErrorFont(reason instanceof Error ? reason.message : reason), - font)); - }); - return fontCapability.promise; - }, - - buildPath: function PartialEvaluator_buildPath(operatorList, fn, args) { - var lastIndex = operatorList.length - 1; - if (!args) { - args = []; - } - if (lastIndex < 0 || - operatorList.fnArray[lastIndex] !== OPS.constructPath) { - operatorList.addOp(OPS.constructPath, [[fn], args]); - } else { - var opArgs = operatorList.argsArray[lastIndex]; - opArgs[0].push(fn); - Array.prototype.push.apply(opArgs[1], args); - } - }, - - handleColorN: function PartialEvaluator_handleColorN(operatorList, fn, args, - cs, patterns, resources, task, xref) { - // compile tiling patterns - var patternName = args[args.length - 1]; - // SCN/scn applies patterns along with normal colors - var pattern; - if (isName(patternName) && - (pattern = patterns.get(patternName.name))) { - var dict = (isStream(pattern) ? pattern.dict : pattern); - var typeNum = dict.get('PatternType'); - - if (typeNum === TILING_PATTERN) { - var color = cs.base ? cs.base.getRgb(args, 0) : null; - return this.handleTilingType(fn, color, resources, pattern, - dict, operatorList, task); - } else if (typeNum === SHADING_PATTERN) { - var shading = dict.get('Shading'); - var matrix = dict.get('Matrix'); - pattern = Pattern.parseShading(shading, matrix, xref, resources, - this.handler); - operatorList.addOp(fn, pattern.getIR()); - return Promise.resolve(); - } else { - return Promise.reject('Unknown PatternType: ' + typeNum); - } - } - // TODO shall we fail here? - operatorList.addOp(fn, args); - return Promise.resolve(); - }, - - getOperatorList: function PartialEvaluator_getOperatorList(stream, - task, - resources, - operatorList, - initialState) { - - var self = this; - var xref = this.xref; - var imageCache = {}; - - assert(operatorList); - - resources = (resources || Dict.empty); - var xobjs = (resources.get('XObject') || Dict.empty); - var patterns = (resources.get('Pattern') || Dict.empty); - var stateManager = new StateManager(initialState || new EvalState()); - var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); - var timeSlotManager = new TimeSlotManager(); - - return new Promise(function next(resolve, reject) { - task.ensureNotTerminated(); - timeSlotManager.reset(); - var stop, operation = {}, i, ii, cs; - while (!(stop = timeSlotManager.check())) { - // The arguments parsed by read() are used beyond this loop, so we - // cannot reuse the same array on each iteration. Therefore we pass - // in |null| as the initial value (see the comment on - // EvaluatorPreprocessor_read() for why). - operation.args = null; - if (!(preprocessor.read(operation))) { - break; - } - var args = operation.args; - var fn = operation.fn; - - switch (fn | 0) { - case OPS.paintXObject: - if (args[0].code) { - break; - } - // eagerly compile XForm objects - var name = args[0].name; - if (!name) { - warn('XObject must be referred to by name.'); - continue; - } - if (imageCache[name] !== undefined) { - operatorList.addOp(imageCache[name].fn, imageCache[name].args); - args = null; - continue; - } - - var xobj = xobjs.get(name); - if (xobj) { - assert(isStream(xobj), 'XObject should be a stream'); - - var type = xobj.dict.get('Subtype'); - assert(isName(type), - 'XObject should have a Name subtype'); - - if (type.name === 'Form') { - stateManager.save(); - return self.buildFormXObject(resources, xobj, null, - operatorList, task, - stateManager.state.clone()). - then(function () { - stateManager.restore(); - next(resolve, reject); - }, reject); - } else if (type.name === 'Image') { - self.buildPaintImageXObject(resources, xobj, false, - operatorList, name, imageCache); - args = null; - continue; - } else if (type.name === 'PS') { - // PostScript XObjects are unused when viewing documents. - // See section 4.7.1 of Adobe's PDF reference. - info('Ignored XObject subtype PS'); - continue; - } else { - error('Unhandled XObject subtype ' + type.name); - } - } - break; - case OPS.setFont: - var fontSize = args[1]; - // eagerly collect all fonts - return self.handleSetFont(resources, args, null, operatorList, - task, stateManager.state). - then(function (loadedName) { - operatorList.addDependency(loadedName); - operatorList.addOp(OPS.setFont, [loadedName, fontSize]); - next(resolve, reject); - }, reject); - case OPS.endInlineImage: - var cacheKey = args[0].cacheKey; - if (cacheKey) { - var cacheEntry = imageCache[cacheKey]; - if (cacheEntry !== undefined) { - operatorList.addOp(cacheEntry.fn, cacheEntry.args); - args = null; - continue; - } - } - self.buildPaintImageXObject(resources, args[0], true, - operatorList, cacheKey, imageCache); - args = null; - continue; - case OPS.showText: - args[0] = self.handleText(args[0], stateManager.state); - break; - case OPS.showSpacedText: - var arr = args[0]; - var combinedGlyphs = []; - var arrLength = arr.length; - var state = stateManager.state; - for (i = 0; i < arrLength; ++i) { - var arrItem = arr[i]; - if (isString(arrItem)) { - Array.prototype.push.apply(combinedGlyphs, - self.handleText(arrItem, state)); - } else if (isNum(arrItem)) { - combinedGlyphs.push(arrItem); - } - } - args[0] = combinedGlyphs; - fn = OPS.showText; - break; - case OPS.nextLineShowText: - operatorList.addOp(OPS.nextLine); - args[0] = self.handleText(args[0], stateManager.state); - fn = OPS.showText; - break; - case OPS.nextLineSetSpacingShowText: - operatorList.addOp(OPS.nextLine); - operatorList.addOp(OPS.setWordSpacing, [args.shift()]); - operatorList.addOp(OPS.setCharSpacing, [args.shift()]); - args[0] = self.handleText(args[0], stateManager.state); - fn = OPS.showText; - break; - case OPS.setTextRenderingMode: - stateManager.state.textRenderingMode = args[0]; - break; - - case OPS.setFillColorSpace: - stateManager.state.fillColorSpace = - ColorSpace.parse(args[0], xref, resources); - continue; - case OPS.setStrokeColorSpace: - stateManager.state.strokeColorSpace = - ColorSpace.parse(args[0], xref, resources); - continue; - case OPS.setFillColor: - cs = stateManager.state.fillColorSpace; - args = cs.getRgb(args, 0); - fn = OPS.setFillRGBColor; - break; - case OPS.setStrokeColor: - cs = stateManager.state.strokeColorSpace; - args = cs.getRgb(args, 0); - fn = OPS.setStrokeRGBColor; - break; - case OPS.setFillGray: - stateManager.state.fillColorSpace = ColorSpace.singletons.gray; - args = ColorSpace.singletons.gray.getRgb(args, 0); - fn = OPS.setFillRGBColor; - break; - case OPS.setStrokeGray: - stateManager.state.strokeColorSpace = ColorSpace.singletons.gray; - args = ColorSpace.singletons.gray.getRgb(args, 0); - fn = OPS.setStrokeRGBColor; - break; - case OPS.setFillCMYKColor: - stateManager.state.fillColorSpace = ColorSpace.singletons.cmyk; - args = ColorSpace.singletons.cmyk.getRgb(args, 0); - fn = OPS.setFillRGBColor; - break; - case OPS.setStrokeCMYKColor: - stateManager.state.strokeColorSpace = ColorSpace.singletons.cmyk; - args = ColorSpace.singletons.cmyk.getRgb(args, 0); - fn = OPS.setStrokeRGBColor; - break; - case OPS.setFillRGBColor: - stateManager.state.fillColorSpace = ColorSpace.singletons.rgb; - args = ColorSpace.singletons.rgb.getRgb(args, 0); - break; - case OPS.setStrokeRGBColor: - stateManager.state.strokeColorSpace = ColorSpace.singletons.rgb; - args = ColorSpace.singletons.rgb.getRgb(args, 0); - break; - case OPS.setFillColorN: - cs = stateManager.state.fillColorSpace; - if (cs.name === 'Pattern') { - return self.handleColorN(operatorList, OPS.setFillColorN, - args, cs, patterns, resources, task, xref).then(function() { - next(resolve, reject); - }, reject); - } - args = cs.getRgb(args, 0); - fn = OPS.setFillRGBColor; - break; - case OPS.setStrokeColorN: - cs = stateManager.state.strokeColorSpace; - if (cs.name === 'Pattern') { - return self.handleColorN(operatorList, OPS.setStrokeColorN, - args, cs, patterns, resources, task, xref).then(function() { - next(resolve, reject); - }, reject); - } - args = cs.getRgb(args, 0); - fn = OPS.setStrokeRGBColor; - break; - - case OPS.shadingFill: - var shadingRes = resources.get('Shading'); - if (!shadingRes) { - error('No shading resource found'); - } - - var shading = shadingRes.get(args[0].name); - if (!shading) { - error('No shading object found'); - } - - var shadingFill = Pattern.parseShading(shading, null, xref, - resources, self.handler); - var patternIR = shadingFill.getIR(); - args = [patternIR]; - fn = OPS.shadingFill; - break; - case OPS.setGState: - var dictName = args[0]; - var extGState = resources.get('ExtGState'); - - if (!isDict(extGState) || !extGState.has(dictName.name)) { - break; - } - - var gState = extGState.get(dictName.name); - return self.setGState(resources, gState, operatorList, task, - xref, stateManager).then(function() { - next(resolve, reject); - }, reject); - case OPS.moveTo: - case OPS.lineTo: - case OPS.curveTo: - case OPS.curveTo2: - case OPS.curveTo3: - case OPS.closePath: - self.buildPath(operatorList, fn, args); - continue; - case OPS.rectangle: - self.buildPath(operatorList, fn, args); - continue; - case OPS.markPoint: - case OPS.markPointProps: - case OPS.beginMarkedContent: - case OPS.beginMarkedContentProps: - case OPS.endMarkedContent: - case OPS.beginCompat: - case OPS.endCompat: - // Ignore operators where the corresponding handlers are known to - // be no-op in CanvasGraphics (display/canvas.js). This prevents - // serialization errors and is also a bit more efficient. - // We could also try to serialize all objects in a general way, - // e.g. as done in https://github.com/mozilla/pdf.js/pull/6266, - // but doing so is meaningless without knowing the semantics. - continue; - default: - // Note: Let's hope that the ignored operator does not have any - // non-serializable arguments, otherwise postMessage will throw - // "An object could not be cloned.". - } - operatorList.addOp(fn, args); - } - if (stop) { - deferred.then(function () { - next(resolve, reject); - }, reject); - return; - } - // Some PDFs don't close all restores inside object/form. - // Closing those for them. - for (i = 0, ii = preprocessor.savedStatesDepth; i < ii; i++) { - operatorList.addOp(OPS.restore, []); - } - resolve(); - }); - }, - - getTextContent: - function PartialEvaluator_getTextContent(stream, task, resources, - stateManager, - normalizeWhitespace) { - - stateManager = (stateManager || new StateManager(new TextState())); - - var WhitespaceRegexp = /\s/g; - - var textContent = { - items: [], - styles: Object.create(null) - }; - var textContentItem = { - initialized: false, - str: [], - width: 0, - height: 0, - vertical: false, - lastAdvanceWidth: 0, - lastAdvanceHeight: 0, - textAdvanceScale: 0, - spaceWidth: 0, - fakeSpaceMin: Infinity, - fakeMultiSpaceMin: Infinity, - fakeMultiSpaceMax: -0, - textRunBreakAllowed: false, - transform: null, - fontName: null - }; - var SPACE_FACTOR = 0.3; - var MULTI_SPACE_FACTOR = 1.5; - var MULTI_SPACE_FACTOR_MAX = 4; - - var self = this; - var xref = this.xref; - - resources = (xref.fetchIfRef(resources) || Dict.empty); - - // The xobj is parsed iff it's needed, e.g. if there is a `DO` cmd. - var xobjs = null; - var xobjsCache = {}; - - var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); - - var textState; - - function ensureTextContentItem() { - if (textContentItem.initialized) { - return textContentItem; - } - var font = textState.font; - if (!(font.loadedName in textContent.styles)) { - textContent.styles[font.loadedName] = { - fontFamily: font.fallbackName, - ascent: font.ascent, - descent: font.descent, - vertical: font.vertical - }; - } - textContentItem.fontName = font.loadedName; - - // 9.4.4 Text Space Details - var tsm = [textState.fontSize * textState.textHScale, 0, - 0, textState.fontSize, - 0, textState.textRise]; - - if (font.isType3Font && - textState.fontMatrix !== FONT_IDENTITY_MATRIX && - textState.fontSize === 1) { - var glyphHeight = font.bbox[3] - font.bbox[1]; - if (glyphHeight > 0) { - glyphHeight = glyphHeight * textState.fontMatrix[3]; - tsm[3] *= glyphHeight; - } - } - - var trm = Util.transform(textState.ctm, - Util.transform(textState.textMatrix, tsm)); - textContentItem.transform = trm; - if (!font.vertical) { - textContentItem.width = 0; - textContentItem.height = Math.sqrt(trm[2] * trm[2] + trm[3] * trm[3]); - textContentItem.vertical = false; - } else { - textContentItem.width = Math.sqrt(trm[0] * trm[0] + trm[1] * trm[1]); - textContentItem.height = 0; - textContentItem.vertical = true; - } - - var a = textState.textLineMatrix[0]; - var b = textState.textLineMatrix[1]; - var scaleLineX = Math.sqrt(a * a + b * b); - a = textState.ctm[0]; - b = textState.ctm[1]; - var scaleCtmX = Math.sqrt(a * a + b * b); - textContentItem.textAdvanceScale = scaleCtmX * scaleLineX; - textContentItem.lastAdvanceWidth = 0; - textContentItem.lastAdvanceHeight = 0; - - var spaceWidth = font.spaceWidth / 1000 * textState.fontSize; - if (spaceWidth) { - textContentItem.spaceWidth = spaceWidth; - textContentItem.fakeSpaceMin = spaceWidth * SPACE_FACTOR; - textContentItem.fakeMultiSpaceMin = spaceWidth * MULTI_SPACE_FACTOR; - textContentItem.fakeMultiSpaceMax = - spaceWidth * MULTI_SPACE_FACTOR_MAX; - // It's okay for monospace fonts to fake as much space as needed. - textContentItem.textRunBreakAllowed = !font.isMonospace; - } else { - textContentItem.spaceWidth = 0; - textContentItem.fakeSpaceMin = Infinity; - textContentItem.fakeMultiSpaceMin = Infinity; - textContentItem.fakeMultiSpaceMax = 0; - textContentItem.textRunBreakAllowed = false; - } - - - textContentItem.initialized = true; - return textContentItem; - } - - function replaceWhitespace(str) { - // Replaces all whitespaces with standard spaces (0x20), to avoid - // alignment issues between the textLayer and the canvas if the text - // contains e.g. tabs (fixes issue6612.pdf). - var i = 0, ii = str.length, code; - while (i < ii && (code = str.charCodeAt(i)) >= 0x20 && code <= 0x7F) { - i++; - } - return (i < ii ? str.replace(WhitespaceRegexp, ' ') : str); - } - - function runBidiTransform(textChunk) { - var str = textChunk.str.join(''); - var bidiResult = PDFJS.bidi(str, -1, textChunk.vertical); - return { - str: (normalizeWhitespace ? replaceWhitespace(bidiResult.str) : - bidiResult.str), - dir: bidiResult.dir, - width: textChunk.width, - height: textChunk.height, - transform: textChunk.transform, - fontName: textChunk.fontName - }; - } - - function handleSetFont(fontName, fontRef) { - return self.loadFont(fontName, fontRef, xref, resources). - then(function (translated) { - textState.font = translated.font; - textState.fontMatrix = translated.font.fontMatrix || - FONT_IDENTITY_MATRIX; - }); - } - - function buildTextContentItem(chars) { - var font = textState.font; - var textChunk = ensureTextContentItem(); - var width = 0; - var height = 0; - var glyphs = font.charsToGlyphs(chars); - var defaultVMetrics = font.defaultVMetrics; - for (var i = 0; i < glyphs.length; i++) { - var glyph = glyphs[i]; - var vMetricX = null; - var vMetricY = null; - var glyphWidth = null; - if (font.vertical) { - if (glyph.vmetric) { - glyphWidth = glyph.vmetric[0]; - vMetricX = glyph.vmetric[1]; - vMetricY = glyph.vmetric[2]; - } else { - glyphWidth = glyph.width; - vMetricX = glyph.width * 0.5; - vMetricY = defaultVMetrics[2]; - } - } else { - glyphWidth = glyph.width; - } - - var glyphUnicode = glyph.unicode; - if (NormalizedUnicodes[glyphUnicode] !== undefined) { - glyphUnicode = NormalizedUnicodes[glyphUnicode]; - } - glyphUnicode = reverseIfRtl(glyphUnicode); - - // The following will calculate the x and y of the individual glyphs. - // if (font.vertical) { - // tsm[4] -= vMetricX * Math.abs(textState.fontSize) * - // textState.fontMatrix[0]; - // tsm[5] -= vMetricY * textState.fontSize * - // textState.fontMatrix[0]; - // } - // var trm = Util.transform(textState.textMatrix, tsm); - // var pt = Util.applyTransform([trm[4], trm[5]], textState.ctm); - // var x = pt[0]; - // var y = pt[1]; - - var charSpacing = textState.charSpacing; - if (glyph.isSpace) { - var wordSpacing = textState.wordSpacing; - charSpacing += wordSpacing; - if (wordSpacing > 0) { - addFakeSpaces(wordSpacing, textChunk.str); - } - } - - var tx = 0; - var ty = 0; - if (!font.vertical) { - var w0 = glyphWidth * textState.fontMatrix[0]; - tx = (w0 * textState.fontSize + charSpacing) * - textState.textHScale; - width += tx; - } else { - var w1 = glyphWidth * textState.fontMatrix[0]; - ty = w1 * textState.fontSize + charSpacing; - height += ty; - } - textState.translateTextMatrix(tx, ty); - - textChunk.str.push(glyphUnicode); - } - - if (!font.vertical) { - textChunk.lastAdvanceWidth = width; - textChunk.width += width * textChunk.textAdvanceScale; - } else { - textChunk.lastAdvanceHeight = height; - textChunk.height += Math.abs(height * textChunk.textAdvanceScale); - } - - return textChunk; - } - - function addFakeSpaces(width, strBuf) { - if (width < textContentItem.fakeSpaceMin) { - return; - } - if (width < textContentItem.fakeMultiSpaceMin) { - strBuf.push(' '); - return; - } - var fakeSpaces = Math.round(width / textContentItem.spaceWidth); - while (fakeSpaces-- > 0) { - strBuf.push(' '); - } - } - - function flushTextContentItem() { - if (!textContentItem.initialized) { - return; - } - textContent.items.push(runBidiTransform(textContentItem)); - - textContentItem.initialized = false; - textContentItem.str.length = 0; - } - - var timeSlotManager = new TimeSlotManager(); - - return new Promise(function next(resolve, reject) { - task.ensureNotTerminated(); - timeSlotManager.reset(); - var stop, operation = {}, args = []; - while (!(stop = timeSlotManager.check())) { - // The arguments parsed by read() are not used beyond this loop, so - // we can reuse the same array on every iteration, thus avoiding - // unnecessary allocations. - args.length = 0; - operation.args = args; - if (!(preprocessor.read(operation))) { - break; - } - textState = stateManager.state; - var fn = operation.fn; - args = operation.args; - var advance; - - switch (fn | 0) { - case OPS.setFont: - flushTextContentItem(); - textState.fontSize = args[1]; - return handleSetFont(args[0].name).then(function() { - next(resolve, reject); - }, reject); - case OPS.setTextRise: - flushTextContentItem(); - textState.textRise = args[0]; - break; - case OPS.setHScale: - flushTextContentItem(); - textState.textHScale = args[0] / 100; - break; - case OPS.setLeading: - flushTextContentItem(); - textState.leading = args[0]; - break; - case OPS.moveText: - // Optimization to treat same line movement as advance - var isSameTextLine = !textState.font ? false : - ((textState.font.vertical ? args[0] : args[1]) === 0); - advance = args[0] - args[1]; - if (isSameTextLine && textContentItem.initialized && - advance > 0 && - advance <= textContentItem.fakeMultiSpaceMax) { - textState.translateTextLineMatrix(args[0], args[1]); - textContentItem.width += - (args[0] - textContentItem.lastAdvanceWidth); - textContentItem.height += - (args[1] - textContentItem.lastAdvanceHeight); - var diff = (args[0] - textContentItem.lastAdvanceWidth) - - (args[1] - textContentItem.lastAdvanceHeight); - addFakeSpaces(diff, textContentItem.str); - break; - } - - flushTextContentItem(); - textState.translateTextLineMatrix(args[0], args[1]); - textState.textMatrix = textState.textLineMatrix.slice(); - break; - case OPS.setLeadingMoveText: - flushTextContentItem(); - textState.leading = -args[1]; - textState.translateTextLineMatrix(args[0], args[1]); - textState.textMatrix = textState.textLineMatrix.slice(); - break; - case OPS.nextLine: - flushTextContentItem(); - textState.carriageReturn(); - break; - case OPS.setTextMatrix: - flushTextContentItem(); - textState.setTextMatrix(args[0], args[1], args[2], args[3], - args[4], args[5]); - textState.setTextLineMatrix(args[0], args[1], args[2], args[3], - args[4], args[5]); - break; - case OPS.setCharSpacing: - textState.charSpacing = args[0]; - break; - case OPS.setWordSpacing: - textState.wordSpacing = args[0]; - break; - case OPS.beginText: - flushTextContentItem(); - textState.textMatrix = IDENTITY_MATRIX.slice(); - textState.textLineMatrix = IDENTITY_MATRIX.slice(); - break; - case OPS.showSpacedText: - var items = args[0]; - var offset; - for (var j = 0, jj = items.length; j < jj; j++) { - if (typeof items[j] === 'string') { - buildTextContentItem(items[j]); - } else { - ensureTextContentItem(); - - // PDF Specification 5.3.2 states: - // The number is expressed in thousandths of a unit of text - // space. - // This amount is subtracted from the current horizontal or - // vertical coordinate, depending on the writing mode. - // In the default coordinate system, a positive adjustment - // has the effect of moving the next glyph painted either to - // the left or down by the given amount. - advance = items[j] * textState.fontSize / 1000; - var breakTextRun = false; - if (textState.font.vertical) { - offset = advance * - (textState.textHScale * textState.textMatrix[2] + - textState.textMatrix[3]); - textState.translateTextMatrix(0, advance); - breakTextRun = textContentItem.textRunBreakAllowed && - advance > textContentItem.fakeMultiSpaceMax; - if (!breakTextRun) { - // Value needs to be added to height to paint down. - textContentItem.height += offset; - } - } else { - advance = -advance; - offset = advance * ( - textState.textHScale * textState.textMatrix[0] + - textState.textMatrix[1]); - textState.translateTextMatrix(advance, 0); - breakTextRun = textContentItem.textRunBreakAllowed && - advance > textContentItem.fakeMultiSpaceMax; - if (!breakTextRun) { - // Value needs to be subtracted from width to paint left. - textContentItem.width += offset; - } - } - if (breakTextRun) { - flushTextContentItem(); - } else if (advance > 0) { - addFakeSpaces(advance, textContentItem.str); - } - } - } - break; - case OPS.showText: - buildTextContentItem(args[0]); - break; - case OPS.nextLineShowText: - flushTextContentItem(); - textState.carriageReturn(); - buildTextContentItem(args[0]); - break; - case OPS.nextLineSetSpacingShowText: - flushTextContentItem(); - textState.wordSpacing = args[0]; - textState.charSpacing = args[1]; - textState.carriageReturn(); - buildTextContentItem(args[2]); - break; - case OPS.paintXObject: - flushTextContentItem(); - if (args[0].code) { - break; - } - - if (!xobjs) { - xobjs = (resources.get('XObject') || Dict.empty); - } - - var name = args[0].name; - if (xobjsCache.key === name) { - if (xobjsCache.texts) { - Util.appendToArray(textContent.items, xobjsCache.texts.items); - Util.extendObj(textContent.styles, xobjsCache.texts.styles); - } - break; - } - - var xobj = xobjs.get(name); - if (!xobj) { - break; - } - assert(isStream(xobj), 'XObject should be a stream'); - - var type = xobj.dict.get('Subtype'); - assert(isName(type), - 'XObject should have a Name subtype'); - - if ('Form' !== type.name) { - xobjsCache.key = name; - xobjsCache.texts = null; - break; - } - - stateManager.save(); - var matrix = xobj.dict.get('Matrix'); - if (isArray(matrix) && matrix.length === 6) { - stateManager.transform(matrix); - } - - return self.getTextContent(xobj, task, - xobj.dict.get('Resources') || resources, stateManager, - normalizeWhitespace).then(function (formTextContent) { - Util.appendToArray(textContent.items, formTextContent.items); - Util.extendObj(textContent.styles, formTextContent.styles); - stateManager.restore(); - - xobjsCache.key = name; - xobjsCache.texts = formTextContent; - - next(resolve, reject); - }, reject); - case OPS.setGState: - flushTextContentItem(); - var dictName = args[0]; - var extGState = resources.get('ExtGState'); - - if (!isDict(extGState) || !extGState.has(dictName.name)) { - break; - } - - var gsStateMap = extGState.get(dictName.name); - var gsStateFont = null; - for (var key in gsStateMap) { - if (key === 'Font') { - assert(!gsStateFont); - gsStateFont = gsStateMap[key]; - } - } - if (gsStateFont) { - textState.fontSize = gsStateFont[1]; - return handleSetFont(gsStateFont[0]).then(function() { - next(resolve, reject); - }, reject); - } - break; - } // switch - } // while - if (stop) { - deferred.then(function () { - next(resolve, reject); - }, reject); - return; - } - flushTextContentItem(); - resolve(textContent); - }); - }, - - extractDataStructures: function - partialEvaluatorExtractDataStructures(dict, baseDict, - xref, properties) { - // 9.10.2 - var toUnicode = (dict.get('ToUnicode') || baseDict.get('ToUnicode')); - if (toUnicode) { - properties.toUnicode = this.readToUnicode(toUnicode); - } - if (properties.composite) { - // CIDSystemInfo helps to match CID to glyphs - var cidSystemInfo = dict.get('CIDSystemInfo'); - if (isDict(cidSystemInfo)) { - properties.cidSystemInfo = { - registry: cidSystemInfo.get('Registry'), - ordering: cidSystemInfo.get('Ordering'), - supplement: cidSystemInfo.get('Supplement') - }; - } - - var cidToGidMap = dict.get('CIDToGIDMap'); - if (isStream(cidToGidMap)) { - properties.cidToGidMap = this.readCidToGidMap(cidToGidMap); - } - } - - // Based on 9.6.6 of the spec the encoding can come from multiple places - // and depends on the font type. The base encoding and differences are - // read here, but the encoding that is actually used is chosen during - // glyph mapping in the font. - // TODO: Loading the built in encoding in the font would allow the - // differences to be merged in here not require us to hold on to it. - var differences = []; - var baseEncodingName = null; - var encoding; - if (dict.has('Encoding')) { - encoding = dict.get('Encoding'); - if (isDict(encoding)) { - baseEncodingName = encoding.get('BaseEncoding'); - baseEncodingName = (isName(baseEncodingName) ? - baseEncodingName.name : null); - // Load the differences between the base and original - if (encoding.has('Differences')) { - var diffEncoding = encoding.get('Differences'); - var index = 0; - for (var j = 0, jj = diffEncoding.length; j < jj; j++) { - var data = diffEncoding[j]; - if (isNum(data)) { - index = data; - } else if (isName(data)) { - differences[index++] = data.name; - } else if (isRef(data)) { - diffEncoding[j--] = xref.fetch(data); - continue; - } else { - error('Invalid entry in \'Differences\' array: ' + data); - } - } - } - } else if (isName(encoding)) { - baseEncodingName = encoding.name; - } else { - error('Encoding is not a Name nor a Dict'); - } - // According to table 114 if the encoding is a named encoding it must be - // one of these predefined encodings. - if ((baseEncodingName !== 'MacRomanEncoding' && - baseEncodingName !== 'MacExpertEncoding' && - baseEncodingName !== 'WinAnsiEncoding')) { - baseEncodingName = null; - } - } - - if (baseEncodingName) { - properties.defaultEncoding = Encodings[baseEncodingName].slice(); - } else { - encoding = (properties.type === 'TrueType' ? - Encodings.WinAnsiEncoding : Encodings.StandardEncoding); - // The Symbolic attribute can be misused for regular fonts - // Heuristic: we have to check if the font is a standard one also - if (!!(properties.flags & FontFlags.Symbolic)) { - encoding = Encodings.MacRomanEncoding; - if (!properties.file) { - if (/Symbol/i.test(properties.name)) { - encoding = Encodings.SymbolSetEncoding; - } else if (/Dingbats/i.test(properties.name)) { - encoding = Encodings.ZapfDingbatsEncoding; - } - } - } - properties.defaultEncoding = encoding; - } - - properties.differences = differences; - properties.baseEncodingName = baseEncodingName; - properties.dict = dict; - }, - - readToUnicode: function PartialEvaluator_readToUnicode(toUnicode) { - var cmap, cmapObj = toUnicode; - if (isName(cmapObj)) { - cmap = CMapFactory.create(cmapObj, - { url: PDFJS.cMapUrl, packed: PDFJS.cMapPacked }, null); - if (cmap instanceof IdentityCMap) { - return new IdentityToUnicodeMap(0, 0xFFFF); - } - return new ToUnicodeMap(cmap.getMap()); - } else if (isStream(cmapObj)) { - cmap = CMapFactory.create(cmapObj, - { url: PDFJS.cMapUrl, packed: PDFJS.cMapPacked }, null); - if (cmap instanceof IdentityCMap) { - return new IdentityToUnicodeMap(0, 0xFFFF); - } - var map = new Array(cmap.length); - // Convert UTF-16BE - // NOTE: cmap can be a sparse array, so use forEach instead of for(;;) - // to iterate over all keys. - cmap.forEach(function(charCode, token) { - var str = []; - for (var k = 0; k < token.length; k += 2) { - var w1 = (token.charCodeAt(k) << 8) | token.charCodeAt(k + 1); - if ((w1 & 0xF800) !== 0xD800) { // w1 < 0xD800 || w1 > 0xDFFF - str.push(w1); - continue; - } - k += 2; - var w2 = (token.charCodeAt(k) << 8) | token.charCodeAt(k + 1); - str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000); - } - map[charCode] = String.fromCharCode.apply(String, str); - }); - return new ToUnicodeMap(map); - } - return null; - }, - - readCidToGidMap: function PartialEvaluator_readCidToGidMap(cidToGidStream) { - // Extract the encoding from the CIDToGIDMap - var glyphsData = cidToGidStream.getBytes(); - - // Set encoding 0 to later verify the font has an encoding - var result = []; - for (var j = 0, jj = glyphsData.length; j < jj; j++) { - var glyphID = (glyphsData[j++] << 8) | glyphsData[j]; - if (glyphID === 0) { - continue; - } - var code = j >> 1; - result[code] = glyphID; - } - return result; - }, - - extractWidths: function PartialEvaluator_extractWidths(dict, xref, - descriptor, - properties) { - var glyphsWidths = []; - var defaultWidth = 0; - var glyphsVMetrics = []; - var defaultVMetrics; - var i, ii, j, jj, start, code, widths; - if (properties.composite) { - defaultWidth = dict.get('DW') || 1000; - - widths = dict.get('W'); - if (widths) { - for (i = 0, ii = widths.length; i < ii; i++) { - start = widths[i++]; - code = xref.fetchIfRef(widths[i]); - if (isArray(code)) { - for (j = 0, jj = code.length; j < jj; j++) { - glyphsWidths[start++] = code[j]; - } - } else { - var width = widths[++i]; - for (j = start; j <= code; j++) { - glyphsWidths[j] = width; - } - } - } - } - - if (properties.vertical) { - var vmetrics = (dict.get('DW2') || [880, -1000]); - defaultVMetrics = [vmetrics[1], defaultWidth * 0.5, vmetrics[0]]; - vmetrics = dict.get('W2'); - if (vmetrics) { - for (i = 0, ii = vmetrics.length; i < ii; i++) { - start = vmetrics[i++]; - code = xref.fetchIfRef(vmetrics[i]); - if (isArray(code)) { - for (j = 0, jj = code.length; j < jj; j++) { - glyphsVMetrics[start++] = [code[j++], code[j++], code[j]]; - } - } else { - var vmetric = [vmetrics[++i], vmetrics[++i], vmetrics[++i]]; - for (j = start; j <= code; j++) { - glyphsVMetrics[j] = vmetric; - } - } - } - } - } - } else { - var firstChar = properties.firstChar; - widths = dict.get('Widths'); - if (widths) { - j = firstChar; - for (i = 0, ii = widths.length; i < ii; i++) { - glyphsWidths[j++] = widths[i]; - } - defaultWidth = (parseFloat(descriptor.get('MissingWidth')) || 0); - } else { - // Trying get the BaseFont metrics (see comment above). - var baseFontName = dict.get('BaseFont'); - if (isName(baseFontName)) { - var metrics = this.getBaseFontMetrics(baseFontName.name); - - glyphsWidths = this.buildCharCodeToWidth(metrics.widths, - properties); - defaultWidth = metrics.defaultWidth; - } - } - } - - // Heuristic: detection of monospace font by checking all non-zero widths - var isMonospace = true; - var firstWidth = defaultWidth; - for (var glyph in glyphsWidths) { - var glyphWidth = glyphsWidths[glyph]; - if (!glyphWidth) { - continue; - } - if (!firstWidth) { - firstWidth = glyphWidth; - continue; - } - if (firstWidth !== glyphWidth) { - isMonospace = false; - break; - } - } - if (isMonospace) { - properties.flags |= FontFlags.FixedPitch; - } - - properties.defaultWidth = defaultWidth; - properties.widths = glyphsWidths; - properties.defaultVMetrics = defaultVMetrics; - properties.vmetrics = glyphsVMetrics; - }, - - isSerifFont: function PartialEvaluator_isSerifFont(baseFontName) { - // Simulating descriptor flags attribute - var fontNameWoStyle = baseFontName.split('-')[0]; - return (fontNameWoStyle in serifFonts) || - (fontNameWoStyle.search(/serif/gi) !== -1); - }, - - getBaseFontMetrics: function PartialEvaluator_getBaseFontMetrics(name) { - var defaultWidth = 0; - var widths = []; - var monospace = false; - var lookupName = (stdFontMap[name] || name); - - if (!(lookupName in Metrics)) { - // Use default fonts for looking up font metrics if the passed - // font is not a base font - if (this.isSerifFont(name)) { - lookupName = 'Times-Roman'; - } else { - lookupName = 'Helvetica'; - } - } - var glyphWidths = Metrics[lookupName]; - - if (isNum(glyphWidths)) { - defaultWidth = glyphWidths; - monospace = true; - } else { - widths = glyphWidths; - } - - return { - defaultWidth: defaultWidth, - monospace: monospace, - widths: widths - }; - }, - - buildCharCodeToWidth: - function PartialEvaluator_bulildCharCodeToWidth(widthsByGlyphName, - properties) { - var widths = Object.create(null); - var differences = properties.differences; - var encoding = properties.defaultEncoding; - for (var charCode = 0; charCode < 256; charCode++) { - if (charCode in differences && - widthsByGlyphName[differences[charCode]]) { - widths[charCode] = widthsByGlyphName[differences[charCode]]; - continue; - } - if (charCode in encoding && widthsByGlyphName[encoding[charCode]]) { - widths[charCode] = widthsByGlyphName[encoding[charCode]]; - continue; - } - } - return widths; - }, - - preEvaluateFont: function PartialEvaluator_preEvaluateFont(dict, xref) { - var baseDict = dict; - var type = dict.get('Subtype'); - assert(isName(type), 'invalid font Subtype'); - - var composite = false; - var uint8array; - if (type.name === 'Type0') { - // If font is a composite - // - get the descendant font - // - set the type according to the descendant font - // - get the FontDescriptor from the descendant font - var df = dict.get('DescendantFonts'); - if (!df) { - error('Descendant fonts are not specified'); - } - dict = (isArray(df) ? xref.fetchIfRef(df[0]) : df); - - type = dict.get('Subtype'); - assert(isName(type), 'invalid font Subtype'); - composite = true; - } - - var descriptor = dict.get('FontDescriptor'); - if (descriptor) { - var hash = new MurmurHash3_64(); - var encoding = baseDict.getRaw('Encoding'); - if (isName(encoding)) { - hash.update(encoding.name); - } else if (isRef(encoding)) { - hash.update(encoding.num + '_' + encoding.gen); - } else if (isDict(encoding)) { - var keys = encoding.getKeys(); - for (var i = 0, ii = keys.length; i < ii; i++) { - var entry = encoding.getRaw(keys[i]); - if (isName(entry)) { - hash.update(entry.name); - } else if (isRef(entry)) { - hash.update(entry.num + '_' + entry.gen); - } else if (isArray(entry)) { // 'Differences' entry. - // Ideally we should check the contents of the array, but to avoid - // parsing it here and then again in |extractDataStructures|, - // we only use the array length for now (fixes bug1157493.pdf). - hash.update(entry.length.toString()); - } - } - } - - var toUnicode = dict.get('ToUnicode') || baseDict.get('ToUnicode'); - if (isStream(toUnicode)) { - var stream = toUnicode.str || toUnicode; - uint8array = stream.buffer ? - new Uint8Array(stream.buffer.buffer, 0, stream.bufferLength) : - new Uint8Array(stream.bytes.buffer, - stream.start, stream.end - stream.start); - hash.update(uint8array); - - } else if (isName(toUnicode)) { - hash.update(toUnicode.name); - } - - var widths = dict.get('Widths') || baseDict.get('Widths'); - if (widths) { - uint8array = new Uint8Array(new Uint32Array(widths).buffer); - hash.update(uint8array); - } - } - - return { - descriptor: descriptor, - dict: dict, - baseDict: baseDict, - composite: composite, - type: type.name, - hash: hash ? hash.hexdigest() : '' - }; - }, - - translateFont: function PartialEvaluator_translateFont(preEvaluatedFont, - xref) { - var baseDict = preEvaluatedFont.baseDict; - var dict = preEvaluatedFont.dict; - var composite = preEvaluatedFont.composite; - var descriptor = preEvaluatedFont.descriptor; - var type = preEvaluatedFont.type; - var maxCharIndex = (composite ? 0xFFFF : 0xFF); - var properties; - - if (!descriptor) { - if (type === 'Type3') { - // FontDescriptor is only required for Type3 fonts when the document - // is a tagged pdf. Create a barbebones one to get by. - descriptor = new Dict(null); - descriptor.set('FontName', Name.get(type)); - descriptor.set('FontBBox', dict.get('FontBBox')); - } else { - // Before PDF 1.5 if the font was one of the base 14 fonts, having a - // FontDescriptor was not required. - // This case is here for compatibility. - var baseFontName = dict.get('BaseFont'); - if (!isName(baseFontName)) { - error('Base font is not specified'); - } - - // Using base font name as a font name. - baseFontName = baseFontName.name.replace(/[,_]/g, '-'); - var metrics = this.getBaseFontMetrics(baseFontName); - - // Simulating descriptor flags attribute - var fontNameWoStyle = baseFontName.split('-')[0]; - var flags = - (this.isSerifFont(fontNameWoStyle) ? FontFlags.Serif : 0) | - (metrics.monospace ? FontFlags.FixedPitch : 0) | - (symbolsFonts[fontNameWoStyle] ? FontFlags.Symbolic : - FontFlags.Nonsymbolic); - - properties = { - type: type, - name: baseFontName, - widths: metrics.widths, - defaultWidth: metrics.defaultWidth, - flags: flags, - firstChar: 0, - lastChar: maxCharIndex - }; - this.extractDataStructures(dict, dict, xref, properties); - properties.widths = this.buildCharCodeToWidth(metrics.widths, - properties); - return new Font(baseFontName, null, properties); - } - } - - // According to the spec if 'FontDescriptor' is declared, 'FirstChar', - // 'LastChar' and 'Widths' should exist too, but some PDF encoders seem - // to ignore this rule when a variant of a standart font is used. - // TODO Fill the width array depending on which of the base font this is - // a variant. - var firstChar = (dict.get('FirstChar') || 0); - var lastChar = (dict.get('LastChar') || maxCharIndex); - - var fontName = descriptor.get('FontName'); - var baseFont = dict.get('BaseFont'); - // Some bad PDFs have a string as the font name. - if (isString(fontName)) { - fontName = Name.get(fontName); - } - if (isString(baseFont)) { - baseFont = Name.get(baseFont); - } - - if (type !== 'Type3') { - var fontNameStr = fontName && fontName.name; - var baseFontStr = baseFont && baseFont.name; - if (fontNameStr !== baseFontStr) { - info('The FontDescriptor\'s FontName is "' + fontNameStr + - '" but should be the same as the Font\'s BaseFont "' + - baseFontStr + '"'); - // Workaround for cases where e.g. fontNameStr = 'Arial' and - // baseFontStr = 'Arial,Bold' (needed when no font file is embedded). - if (fontNameStr && baseFontStr && - baseFontStr.indexOf(fontNameStr) === 0) { - fontName = baseFont; - } - } - } - fontName = (fontName || baseFont); - - assert(isName(fontName), 'invalid font name'); - - var fontFile = descriptor.get('FontFile', 'FontFile2', 'FontFile3'); - if (fontFile) { - if (fontFile.dict) { - var subtype = fontFile.dict.get('Subtype'); - if (subtype) { - subtype = subtype.name; - } - var length1 = fontFile.dict.get('Length1'); - var length2 = fontFile.dict.get('Length2'); - } - } - - properties = { - type: type, - name: fontName.name, - subtype: subtype, - file: fontFile, - length1: length1, - length2: length2, - loadedName: baseDict.loadedName, - composite: composite, - wideChars: composite, - fixedPitch: false, - fontMatrix: (dict.get('FontMatrix') || FONT_IDENTITY_MATRIX), - firstChar: firstChar || 0, - lastChar: (lastChar || maxCharIndex), - bbox: descriptor.get('FontBBox'), - ascent: descriptor.get('Ascent'), - descent: descriptor.get('Descent'), - xHeight: descriptor.get('XHeight'), - capHeight: descriptor.get('CapHeight'), - flags: descriptor.get('Flags'), - italicAngle: descriptor.get('ItalicAngle'), - coded: false - }; - - if (composite) { - var cidEncoding = baseDict.get('Encoding'); - if (isName(cidEncoding)) { - properties.cidEncoding = cidEncoding.name; - } - properties.cMap = CMapFactory.create(cidEncoding, - { url: PDFJS.cMapUrl, packed: PDFJS.cMapPacked }, null); - properties.vertical = properties.cMap.vertical; - } - this.extractDataStructures(dict, baseDict, xref, properties); - this.extractWidths(dict, xref, descriptor, properties); - - if (type === 'Type3') { - properties.isType3Font = true; - } - - return new Font(fontName.name, fontFile, properties); - } - }; - - return PartialEvaluator; -})(); - -var TranslatedFont = (function TranslatedFontClosure() { - function TranslatedFont(loadedName, font, dict) { - this.loadedName = loadedName; - this.font = font; - this.dict = dict; - this.type3Loaded = null; - this.sent = false; - } - TranslatedFont.prototype = { - send: function (handler) { - if (this.sent) { - return; - } - var fontData = this.font.exportData(); - handler.send('commonobj', [ - this.loadedName, - 'Font', - fontData - ]); - this.sent = true; - }, - loadType3Data: function (evaluator, resources, parentOperatorList, task) { - assert(this.font.isType3Font); - - if (this.type3Loaded) { - return this.type3Loaded; - } - - var translatedFont = this.font; - var loadCharProcsPromise = Promise.resolve(); - var charProcs = this.dict.get('CharProcs').getAll(); - var fontResources = this.dict.get('Resources') || resources; - var charProcKeys = Object.keys(charProcs); - var charProcOperatorList = {}; - for (var i = 0, n = charProcKeys.length; i < n; ++i) { - loadCharProcsPromise = loadCharProcsPromise.then(function (key) { - var glyphStream = charProcs[key]; - var operatorList = new OperatorList(); - return evaluator.getOperatorList(glyphStream, task, fontResources, - operatorList).then(function () { - charProcOperatorList[key] = operatorList.getIR(); - - // Add the dependencies to the parent operator list so they are - // resolved before sub operator list is executed synchronously. - parentOperatorList.addDependencies(operatorList.dependencies); - }, function (reason) { - warn('Type3 font resource \"' + key + '\" is not available'); - var operatorList = new OperatorList(); - charProcOperatorList[key] = operatorList.getIR(); - }); - }.bind(this, charProcKeys[i])); - } - this.type3Loaded = loadCharProcsPromise.then(function () { - translatedFont.charProcOperatorList = charProcOperatorList; - }); - return this.type3Loaded; - } - }; - return TranslatedFont; -})(); - -var OperatorList = (function OperatorListClosure() { - var CHUNK_SIZE = 1000; - var CHUNK_SIZE_ABOUT = CHUNK_SIZE - 5; // close to chunk size - - function getTransfers(queue) { - var transfers = []; - var fnArray = queue.fnArray, argsArray = queue.argsArray; - for (var i = 0, ii = queue.length; i < ii; i++) { - switch (fnArray[i]) { - case OPS.paintInlineImageXObject: - case OPS.paintInlineImageXObjectGroup: - case OPS.paintImageMaskXObject: - var arg = argsArray[i][0]; // first param in imgData - if (!arg.cached) { - transfers.push(arg.data.buffer); - } - break; - } - } - return transfers; - } - - function OperatorList(intent, messageHandler, pageIndex) { - this.messageHandler = messageHandler; - this.fnArray = []; - this.argsArray = []; - this.dependencies = {}; - this._totalLength = 0; - this.pageIndex = pageIndex; - this.intent = intent; - } - - OperatorList.prototype = { - get length() { - return this.argsArray.length; - }, - - /** - * @returns {number} The total length of the entire operator list, - * since `this.length === 0` after flushing. - */ - get totalLength() { - return (this._totalLength + this.length); - }, - - addOp: function(fn, args) { - this.fnArray.push(fn); - this.argsArray.push(args); - if (this.messageHandler) { - if (this.fnArray.length >= CHUNK_SIZE) { - this.flush(); - } else if (this.fnArray.length >= CHUNK_SIZE_ABOUT && - (fn === OPS.restore || fn === OPS.endText)) { - // heuristic to flush on boundary of restore or endText - this.flush(); - } - } - }, - - addDependency: function(dependency) { - if (dependency in this.dependencies) { - return; - } - this.dependencies[dependency] = true; - this.addOp(OPS.dependency, [dependency]); - }, - - addDependencies: function(dependencies) { - for (var key in dependencies) { - this.addDependency(key); - } - }, - - addOpList: function(opList) { - Util.extendObj(this.dependencies, opList.dependencies); - for (var i = 0, ii = opList.length; i < ii; i++) { - this.addOp(opList.fnArray[i], opList.argsArray[i]); - } - }, - - getIR: function() { - return { - fnArray: this.fnArray, - argsArray: this.argsArray, - length: this.length - }; - }, - - flush: function(lastChunk) { - if (this.intent !== 'oplist') { - new QueueOptimizer().optimize(this); - } - var transfers = getTransfers(this); - var length = this.length; - this._totalLength += length; - - this.messageHandler.send('RenderPageChunk', { - operatorList: { - fnArray: this.fnArray, - argsArray: this.argsArray, - lastChunk: lastChunk, - length: length - }, - pageIndex: this.pageIndex, - intent: this.intent - }, transfers); - this.dependencies = {}; - this.fnArray.length = 0; - this.argsArray.length = 0; - } - }; - - return OperatorList; -})(); - -var StateManager = (function StateManagerClosure() { - function StateManager(initialState) { - this.state = initialState; - this.stateStack = []; - } - StateManager.prototype = { - save: function () { - var old = this.state; - this.stateStack.push(this.state); - this.state = old.clone(); - }, - restore: function () { - var prev = this.stateStack.pop(); - if (prev) { - this.state = prev; - } - }, - transform: function (args) { - this.state.ctm = Util.transform(this.state.ctm, args); - } - }; - return StateManager; -})(); - -var TextState = (function TextStateClosure() { - function TextState() { - this.ctm = new Float32Array(IDENTITY_MATRIX); - this.fontSize = 0; - this.font = null; - this.fontMatrix = FONT_IDENTITY_MATRIX; - this.textMatrix = IDENTITY_MATRIX.slice(); - this.textLineMatrix = IDENTITY_MATRIX.slice(); - this.charSpacing = 0; - this.wordSpacing = 0; - this.leading = 0; - this.textHScale = 1; - this.textRise = 0; - } - - TextState.prototype = { - setTextMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) { - var m = this.textMatrix; - m[0] = a; m[1] = b; m[2] = c; m[3] = d; m[4] = e; m[5] = f; - }, - setTextLineMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) { - var m = this.textLineMatrix; - m[0] = a; m[1] = b; m[2] = c; m[3] = d; m[4] = e; m[5] = f; - }, - translateTextMatrix: function TextState_translateTextMatrix(x, y) { - var m = this.textMatrix; - m[4] = m[0] * x + m[2] * y + m[4]; - m[5] = m[1] * x + m[3] * y + m[5]; - }, - translateTextLineMatrix: function TextState_translateTextMatrix(x, y) { - var m = this.textLineMatrix; - m[4] = m[0] * x + m[2] * y + m[4]; - m[5] = m[1] * x + m[3] * y + m[5]; - }, - calcRenderMatrix: function TextState_calcRendeMatrix(ctm) { - // 9.4.4 Text Space Details - var tsm = [this.fontSize * this.textHScale, 0, - 0, this.fontSize, - 0, this.textRise]; - return Util.transform(ctm, Util.transform(this.textMatrix, tsm)); - }, - carriageReturn: function TextState_carriageReturn() { - this.translateTextLineMatrix(0, -this.leading); - this.textMatrix = this.textLineMatrix.slice(); - }, - clone: function TextState_clone() { - var clone = Object.create(this); - clone.textMatrix = this.textMatrix.slice(); - clone.textLineMatrix = this.textLineMatrix.slice(); - clone.fontMatrix = this.fontMatrix.slice(); - return clone; - } - }; - return TextState; -})(); - -var EvalState = (function EvalStateClosure() { - function EvalState() { - this.ctm = new Float32Array(IDENTITY_MATRIX); - this.font = null; - this.textRenderingMode = TextRenderingMode.FILL; - this.fillColorSpace = ColorSpace.singletons.gray; - this.strokeColorSpace = ColorSpace.singletons.gray; - } - EvalState.prototype = { - clone: function CanvasExtraState_clone() { - return Object.create(this); - }, - }; - return EvalState; -})(); - -var EvaluatorPreprocessor = (function EvaluatorPreprocessorClosure() { - // Specifies properties for each command - // - // If variableArgs === true: [0, `numArgs`] expected - // If variableArgs === false: exactly `numArgs` expected - var OP_MAP = { - // Graphic state - w: { id: OPS.setLineWidth, numArgs: 1, variableArgs: false }, - J: { id: OPS.setLineCap, numArgs: 1, variableArgs: false }, - j: { id: OPS.setLineJoin, numArgs: 1, variableArgs: false }, - M: { id: OPS.setMiterLimit, numArgs: 1, variableArgs: false }, - d: { id: OPS.setDash, numArgs: 2, variableArgs: false }, - ri: { id: OPS.setRenderingIntent, numArgs: 1, variableArgs: false }, - i: { id: OPS.setFlatness, numArgs: 1, variableArgs: false }, - gs: { id: OPS.setGState, numArgs: 1, variableArgs: false }, - q: { id: OPS.save, numArgs: 0, variableArgs: false }, - Q: { id: OPS.restore, numArgs: 0, variableArgs: false }, - cm: { id: OPS.transform, numArgs: 6, variableArgs: false }, - - // Path - m: { id: OPS.moveTo, numArgs: 2, variableArgs: false }, - l: { id: OPS.lineTo, numArgs: 2, variableArgs: false }, - c: { id: OPS.curveTo, numArgs: 6, variableArgs: false }, - v: { id: OPS.curveTo2, numArgs: 4, variableArgs: false }, - y: { id: OPS.curveTo3, numArgs: 4, variableArgs: false }, - h: { id: OPS.closePath, numArgs: 0, variableArgs: false }, - re: { id: OPS.rectangle, numArgs: 4, variableArgs: false }, - S: { id: OPS.stroke, numArgs: 0, variableArgs: false }, - s: { id: OPS.closeStroke, numArgs: 0, variableArgs: false }, - f: { id: OPS.fill, numArgs: 0, variableArgs: false }, - F: { id: OPS.fill, numArgs: 0, variableArgs: false }, - 'f*': { id: OPS.eoFill, numArgs: 0, variableArgs: false }, - B: { id: OPS.fillStroke, numArgs: 0, variableArgs: false }, - 'B*': { id: OPS.eoFillStroke, numArgs: 0, variableArgs: false }, - b: { id: OPS.closeFillStroke, numArgs: 0, variableArgs: false }, - 'b*': { id: OPS.closeEOFillStroke, numArgs: 0, variableArgs: false }, - n: { id: OPS.endPath, numArgs: 0, variableArgs: false }, - - // Clipping - W: { id: OPS.clip, numArgs: 0, variableArgs: false }, - 'W*': { id: OPS.eoClip, numArgs: 0, variableArgs: false }, - - // Text - BT: { id: OPS.beginText, numArgs: 0, variableArgs: false }, - ET: { id: OPS.endText, numArgs: 0, variableArgs: false }, - Tc: { id: OPS.setCharSpacing, numArgs: 1, variableArgs: false }, - Tw: { id: OPS.setWordSpacing, numArgs: 1, variableArgs: false }, - Tz: { id: OPS.setHScale, numArgs: 1, variableArgs: false }, - TL: { id: OPS.setLeading, numArgs: 1, variableArgs: false }, - Tf: { id: OPS.setFont, numArgs: 2, variableArgs: false }, - Tr: { id: OPS.setTextRenderingMode, numArgs: 1, variableArgs: false }, - Ts: { id: OPS.setTextRise, numArgs: 1, variableArgs: false }, - Td: { id: OPS.moveText, numArgs: 2, variableArgs: false }, - TD: { id: OPS.setLeadingMoveText, numArgs: 2, variableArgs: false }, - Tm: { id: OPS.setTextMatrix, numArgs: 6, variableArgs: false }, - 'T*': { id: OPS.nextLine, numArgs: 0, variableArgs: false }, - Tj: { id: OPS.showText, numArgs: 1, variableArgs: false }, - TJ: { id: OPS.showSpacedText, numArgs: 1, variableArgs: false }, - '\'': { id: OPS.nextLineShowText, numArgs: 1, variableArgs: false }, - '"': { id: OPS.nextLineSetSpacingShowText, numArgs: 3, - variableArgs: false }, - - // Type3 fonts - d0: { id: OPS.setCharWidth, numArgs: 2, variableArgs: false }, - d1: { id: OPS.setCharWidthAndBounds, numArgs: 6, variableArgs: false }, - - // Color - CS: { id: OPS.setStrokeColorSpace, numArgs: 1, variableArgs: false }, - cs: { id: OPS.setFillColorSpace, numArgs: 1, variableArgs: false }, - SC: { id: OPS.setStrokeColor, numArgs: 4, variableArgs: true }, - SCN: { id: OPS.setStrokeColorN, numArgs: 33, variableArgs: true }, - sc: { id: OPS.setFillColor, numArgs: 4, variableArgs: true }, - scn: { id: OPS.setFillColorN, numArgs: 33, variableArgs: true }, - G: { id: OPS.setStrokeGray, numArgs: 1, variableArgs: false }, - g: { id: OPS.setFillGray, numArgs: 1, variableArgs: false }, - RG: { id: OPS.setStrokeRGBColor, numArgs: 3, variableArgs: false }, - rg: { id: OPS.setFillRGBColor, numArgs: 3, variableArgs: false }, - K: { id: OPS.setStrokeCMYKColor, numArgs: 4, variableArgs: false }, - k: { id: OPS.setFillCMYKColor, numArgs: 4, variableArgs: false }, - - // Shading - sh: { id: OPS.shadingFill, numArgs: 1, variableArgs: false }, - - // Images - BI: { id: OPS.beginInlineImage, numArgs: 0, variableArgs: false }, - ID: { id: OPS.beginImageData, numArgs: 0, variableArgs: false }, - EI: { id: OPS.endInlineImage, numArgs: 1, variableArgs: false }, - - // XObjects - Do: { id: OPS.paintXObject, numArgs: 1, variableArgs: false }, - MP: { id: OPS.markPoint, numArgs: 1, variableArgs: false }, - DP: { id: OPS.markPointProps, numArgs: 2, variableArgs: false }, - BMC: { id: OPS.beginMarkedContent, numArgs: 1, variableArgs: false }, - BDC: { id: OPS.beginMarkedContentProps, numArgs: 2, - variableArgs: false }, - EMC: { id: OPS.endMarkedContent, numArgs: 0, variableArgs: false }, - - // Compatibility - BX: { id: OPS.beginCompat, numArgs: 0, variableArgs: false }, - EX: { id: OPS.endCompat, numArgs: 0, variableArgs: false }, - - // (reserved partial commands for the lexer) - BM: null, - BD: null, - 'true': null, - fa: null, - fal: null, - fals: null, - 'false': null, - nu: null, - nul: null, - 'null': null - }; - - function EvaluatorPreprocessor(stream, xref, stateManager) { - // TODO(mduan): pass array of knownCommands rather than OP_MAP - // dictionary - this.parser = new Parser(new Lexer(stream, OP_MAP), false, xref); - this.stateManager = stateManager; - this.nonProcessedArgs = []; - } - - EvaluatorPreprocessor.prototype = { - get savedStatesDepth() { - return this.stateManager.stateStack.length; - }, - - // |operation| is an object with two fields: - // - // - |fn| is an out param. - // - // - |args| is an inout param. On entry, it should have one of two values. - // - // - An empty array. This indicates that the caller is providing the - // array in which the args will be stored in. The caller should use - // this value if it can reuse a single array for each call to read(). - // - // - |null|. This indicates that the caller needs this function to create - // the array in which any args are stored in. If there are zero args, - // this function will leave |operation.args| as |null| (thus avoiding - // allocations that would occur if we used an empty array to represent - // zero arguments). Otherwise, it will replace |null| with a new array - // containing the arguments. The caller should use this value if it - // cannot reuse an array for each call to read(). - // - // These two modes are present because this function is very hot and so - // avoiding allocations where possible is worthwhile. - // - read: function EvaluatorPreprocessor_read(operation) { - var args = operation.args; - while (true) { - var obj = this.parser.getObj(); - if (isCmd(obj)) { - var cmd = obj.cmd; - // Check that the command is valid - var opSpec = OP_MAP[cmd]; - if (!opSpec) { - warn('Unknown command "' + cmd + '"'); - continue; - } - - var fn = opSpec.id; - var numArgs = opSpec.numArgs; - var argsLength = args !== null ? args.length : 0; - - if (!opSpec.variableArgs) { - // Postscript commands can be nested, e.g. /F2 /GS2 gs 5.711 Tf - if (argsLength !== numArgs) { - var nonProcessedArgs = this.nonProcessedArgs; - while (argsLength > numArgs) { - nonProcessedArgs.push(args.shift()); - argsLength--; - } - while (argsLength < numArgs && nonProcessedArgs.length !== 0) { - if (!args) { - args = []; - } - args.unshift(nonProcessedArgs.pop()); - argsLength++; - } - } - - if (argsLength < numArgs) { - // If we receive too few args, it's not possible to possible - // to execute the command, so skip the command - info('Command ' + fn + ': because expected ' + - numArgs + ' args, but received ' + argsLength + - ' args; skipping'); - args = null; - continue; - } - } else if (argsLength > numArgs) { - info('Command ' + fn + ': expected [0,' + numArgs + - '] args, but received ' + argsLength + ' args'); - } - - // TODO figure out how to type-check vararg functions - this.preprocessCommand(fn, args); - - operation.fn = fn; - operation.args = args; - return true; - } else { - if (isEOF(obj)) { - return false; // no more commands - } - // argument - if (obj !== null) { - if (!args) { - args = []; - } - args.push((obj instanceof Dict ? obj.getAll() : obj)); - assert(args.length <= 33, 'Too many arguments'); - } - } - } - }, - - preprocessCommand: - function EvaluatorPreprocessor_preprocessCommand(fn, args) { - switch (fn | 0) { - case OPS.save: - this.stateManager.save(); - break; - case OPS.restore: - this.stateManager.restore(); - break; - case OPS.transform: - this.stateManager.transform(args); - break; - } - } - }; - return EvaluatorPreprocessor; -})(); - -var QueueOptimizer = (function QueueOptimizerClosure() { - function addState(parentState, pattern, fn) { - var state = parentState; - for (var i = 0, ii = pattern.length - 1; i < ii; i++) { - var item = pattern[i]; - state = (state[item] || (state[item] = [])); - } - state[pattern[pattern.length - 1]] = fn; - } - - function handlePaintSolidColorImageMask(iFirstSave, count, fnArray, - argsArray) { - // Handles special case of mainly LaTeX documents which use image masks to - // draw lines with the current fill style. - // 'count' groups of (save, transform, paintImageMaskXObject, restore)+ - // have been found at iFirstSave. - var iFirstPIMXO = iFirstSave + 2; - for (var i = 0; i < count; i++) { - var arg = argsArray[iFirstPIMXO + 4 * i]; - var imageMask = arg.length === 1 && arg[0]; - if (imageMask && imageMask.width === 1 && imageMask.height === 1 && - (!imageMask.data.length || - (imageMask.data.length === 1 && imageMask.data[0] === 0))) { - fnArray[iFirstPIMXO + 4 * i] = OPS.paintSolidColorImageMask; - continue; - } - break; - } - return count - i; - } - - var InitialState = []; - - // This replaces (save, transform, paintInlineImageXObject, restore)+ - // sequences with one |paintInlineImageXObjectGroup| operation. - addState(InitialState, - [OPS.save, OPS.transform, OPS.paintInlineImageXObject, OPS.restore], - function foundInlineImageGroup(context) { - var MIN_IMAGES_IN_INLINE_IMAGES_BLOCK = 10; - var MAX_IMAGES_IN_INLINE_IMAGES_BLOCK = 200; - var MAX_WIDTH = 1000; - var IMAGE_PADDING = 1; - - var fnArray = context.fnArray, argsArray = context.argsArray; - var curr = context.iCurr; - var iFirstSave = curr - 3; - var iFirstTransform = curr - 2; - var iFirstPIIXO = curr - 1; - - // Look for the quartets. - var i = iFirstSave + 4; - var ii = fnArray.length; - while (i + 3 < ii) { - if (fnArray[i] !== OPS.save || - fnArray[i + 1] !== OPS.transform || - fnArray[i + 2] !== OPS.paintInlineImageXObject || - fnArray[i + 3] !== OPS.restore) { - break; // ops don't match - } - i += 4; - } - - // At this point, i is the index of the first op past the last valid - // quartet. - var count = Math.min((i - iFirstSave) / 4, - MAX_IMAGES_IN_INLINE_IMAGES_BLOCK); - if (count < MIN_IMAGES_IN_INLINE_IMAGES_BLOCK) { - return i; - } - - // assuming that heights of those image is too small (~1 pixel) - // packing as much as possible by lines - var maxX = 0; - var map = [], maxLineHeight = 0; - var currentX = IMAGE_PADDING, currentY = IMAGE_PADDING; - var q; - for (q = 0; q < count; q++) { - var transform = argsArray[iFirstTransform + (q << 2)]; - var img = argsArray[iFirstPIIXO + (q << 2)][0]; - if (currentX + img.width > MAX_WIDTH) { - // starting new line - maxX = Math.max(maxX, currentX); - currentY += maxLineHeight + 2 * IMAGE_PADDING; - currentX = 0; - maxLineHeight = 0; - } - map.push({ - transform: transform, - x: currentX, y: currentY, - w: img.width, h: img.height - }); - currentX += img.width + 2 * IMAGE_PADDING; - maxLineHeight = Math.max(maxLineHeight, img.height); - } - var imgWidth = Math.max(maxX, currentX) + IMAGE_PADDING; - var imgHeight = currentY + maxLineHeight + IMAGE_PADDING; - var imgData = new Uint8Array(imgWidth * imgHeight * 4); - var imgRowSize = imgWidth << 2; - for (q = 0; q < count; q++) { - var data = argsArray[iFirstPIIXO + (q << 2)][0].data; - // Copy image by lines and extends pixels into padding. - var rowSize = map[q].w << 2; - var dataOffset = 0; - var offset = (map[q].x + map[q].y * imgWidth) << 2; - imgData.set(data.subarray(0, rowSize), offset - imgRowSize); - for (var k = 0, kk = map[q].h; k < kk; k++) { - imgData.set(data.subarray(dataOffset, dataOffset + rowSize), offset); - dataOffset += rowSize; - offset += imgRowSize; - } - imgData.set(data.subarray(dataOffset - rowSize, dataOffset), offset); - while (offset >= 0) { - data[offset - 4] = data[offset]; - data[offset - 3] = data[offset + 1]; - data[offset - 2] = data[offset + 2]; - data[offset - 1] = data[offset + 3]; - data[offset + rowSize] = data[offset + rowSize - 4]; - data[offset + rowSize + 1] = data[offset + rowSize - 3]; - data[offset + rowSize + 2] = data[offset + rowSize - 2]; - data[offset + rowSize + 3] = data[offset + rowSize - 1]; - offset -= imgRowSize; - } - } - - // Replace queue items. - fnArray.splice(iFirstSave, count * 4, OPS.paintInlineImageXObjectGroup); - argsArray.splice(iFirstSave, count * 4, - [{ width: imgWidth, height: imgHeight, kind: ImageKind.RGBA_32BPP, - data: imgData }, map]); - - return iFirstSave + 1; - }); - - // This replaces (save, transform, paintImageMaskXObject, restore)+ - // sequences with one |paintImageMaskXObjectGroup| or one - // |paintImageMaskXObjectRepeat| operation. - addState(InitialState, - [OPS.save, OPS.transform, OPS.paintImageMaskXObject, OPS.restore], - function foundImageMaskGroup(context) { - var MIN_IMAGES_IN_MASKS_BLOCK = 10; - var MAX_IMAGES_IN_MASKS_BLOCK = 100; - var MAX_SAME_IMAGES_IN_MASKS_BLOCK = 1000; - - var fnArray = context.fnArray, argsArray = context.argsArray; - var curr = context.iCurr; - var iFirstSave = curr - 3; - var iFirstTransform = curr - 2; - var iFirstPIMXO = curr - 1; - - // Look for the quartets. - var i = iFirstSave + 4; - var ii = fnArray.length; - while (i + 3 < ii) { - if (fnArray[i] !== OPS.save || - fnArray[i + 1] !== OPS.transform || - fnArray[i + 2] !== OPS.paintImageMaskXObject || - fnArray[i + 3] !== OPS.restore) { - break; // ops don't match - } - i += 4; - } - - // At this point, i is the index of the first op past the last valid - // quartet. - var count = (i - iFirstSave) / 4; - count = handlePaintSolidColorImageMask(iFirstSave, count, fnArray, - argsArray); - if (count < MIN_IMAGES_IN_MASKS_BLOCK) { - return i; - } - - var q; - var isSameImage = false; - var iTransform, transformArgs; - var firstPIMXOArg0 = argsArray[iFirstPIMXO][0]; - if (argsArray[iFirstTransform][1] === 0 && - argsArray[iFirstTransform][2] === 0) { - isSameImage = true; - var firstTransformArg0 = argsArray[iFirstTransform][0]; - var firstTransformArg3 = argsArray[iFirstTransform][3]; - iTransform = iFirstTransform + 4; - var iPIMXO = iFirstPIMXO + 4; - for (q = 1; q < count; q++, iTransform += 4, iPIMXO += 4) { - transformArgs = argsArray[iTransform]; - if (argsArray[iPIMXO][0] !== firstPIMXOArg0 || - transformArgs[0] !== firstTransformArg0 || - transformArgs[1] !== 0 || - transformArgs[2] !== 0 || - transformArgs[3] !== firstTransformArg3) { - if (q < MIN_IMAGES_IN_MASKS_BLOCK) { - isSameImage = false; - } else { - count = q; - } - break; // different image or transform - } - } - } - - if (isSameImage) { - count = Math.min(count, MAX_SAME_IMAGES_IN_MASKS_BLOCK); - var positions = new Float32Array(count * 2); - iTransform = iFirstTransform; - for (q = 0; q < count; q++, iTransform += 4) { - transformArgs = argsArray[iTransform]; - positions[(q << 1)] = transformArgs[4]; - positions[(q << 1) + 1] = transformArgs[5]; - } - - // Replace queue items. - fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectRepeat); - argsArray.splice(iFirstSave, count * 4, - [firstPIMXOArg0, firstTransformArg0, firstTransformArg3, positions]); - } else { - count = Math.min(count, MAX_IMAGES_IN_MASKS_BLOCK); - var images = []; - for (q = 0; q < count; q++) { - transformArgs = argsArray[iFirstTransform + (q << 2)]; - var maskParams = argsArray[iFirstPIMXO + (q << 2)][0]; - images.push({ data: maskParams.data, width: maskParams.width, - height: maskParams.height, - transform: transformArgs }); - } - - // Replace queue items. - fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectGroup); - argsArray.splice(iFirstSave, count * 4, [images]); - } - - return iFirstSave + 1; - }); - - // This replaces (save, transform, paintImageXObject, restore)+ sequences - // with one paintImageXObjectRepeat operation, if the |transform| and - // |paintImageXObjectRepeat| ops are appropriate. - addState(InitialState, - [OPS.save, OPS.transform, OPS.paintImageXObject, OPS.restore], - function (context) { - var MIN_IMAGES_IN_BLOCK = 3; - var MAX_IMAGES_IN_BLOCK = 1000; - - var fnArray = context.fnArray, argsArray = context.argsArray; - var curr = context.iCurr; - var iFirstSave = curr - 3; - var iFirstTransform = curr - 2; - var iFirstPIXO = curr - 1; - var iFirstRestore = curr; - - if (argsArray[iFirstTransform][1] !== 0 || - argsArray[iFirstTransform][2] !== 0) { - return iFirstRestore + 1; // transform has the wrong form - } - - // Look for the quartets. - var firstPIXOArg0 = argsArray[iFirstPIXO][0]; - var firstTransformArg0 = argsArray[iFirstTransform][0]; - var firstTransformArg3 = argsArray[iFirstTransform][3]; - var i = iFirstSave + 4; - var ii = fnArray.length; - while (i + 3 < ii) { - if (fnArray[i] !== OPS.save || - fnArray[i + 1] !== OPS.transform || - fnArray[i + 2] !== OPS.paintImageXObject || - fnArray[i + 3] !== OPS.restore) { - break; // ops don't match - } - if (argsArray[i + 1][0] !== firstTransformArg0 || - argsArray[i + 1][1] !== 0 || - argsArray[i + 1][2] !== 0 || - argsArray[i + 1][3] !== firstTransformArg3) { - break; // transforms don't match - } - if (argsArray[i + 2][0] !== firstPIXOArg0) { - break; // images don't match - } - i += 4; - } - - // At this point, i is the index of the first op past the last valid - // quartet. - var count = Math.min((i - iFirstSave) / 4, MAX_IMAGES_IN_BLOCK); - if (count < MIN_IMAGES_IN_BLOCK) { - return i; - } - - // Extract the (x,y) positions from all of the matching transforms. - var positions = new Float32Array(count * 2); - var iTransform = iFirstTransform; - for (var q = 0; q < count; q++, iTransform += 4) { - var transformArgs = argsArray[iTransform]; - positions[(q << 1)] = transformArgs[4]; - positions[(q << 1) + 1] = transformArgs[5]; - } - - // Replace queue items. - var args = [firstPIXOArg0, firstTransformArg0, firstTransformArg3, - positions]; - fnArray.splice(iFirstSave, count * 4, OPS.paintImageXObjectRepeat); - argsArray.splice(iFirstSave, count * 4, args); - - return iFirstSave + 1; - }); - - // This replaces (beginText, setFont, setTextMatrix, showText, endText)+ - // sequences with (beginText, setFont, (setTextMatrix, showText)+, endText)+ - // sequences, if the font for each one is the same. - addState(InitialState, - [OPS.beginText, OPS.setFont, OPS.setTextMatrix, OPS.showText, OPS.endText], - function (context) { - var MIN_CHARS_IN_BLOCK = 3; - var MAX_CHARS_IN_BLOCK = 1000; - - var fnArray = context.fnArray, argsArray = context.argsArray; - var curr = context.iCurr; - var iFirstBeginText = curr - 4; - var iFirstSetFont = curr - 3; - var iFirstSetTextMatrix = curr - 2; - var iFirstShowText = curr - 1; - var iFirstEndText = curr; - - // Look for the quintets. - var firstSetFontArg0 = argsArray[iFirstSetFont][0]; - var firstSetFontArg1 = argsArray[iFirstSetFont][1]; - var i = iFirstBeginText + 5; - var ii = fnArray.length; - while (i + 4 < ii) { - if (fnArray[i] !== OPS.beginText || - fnArray[i + 1] !== OPS.setFont || - fnArray[i + 2] !== OPS.setTextMatrix || - fnArray[i + 3] !== OPS.showText || - fnArray[i + 4] !== OPS.endText) { - break; // ops don't match - } - if (argsArray[i + 1][0] !== firstSetFontArg0 || - argsArray[i + 1][1] !== firstSetFontArg1) { - break; // fonts don't match - } - i += 5; - } - - // At this point, i is the index of the first op past the last valid - // quintet. - var count = Math.min(((i - iFirstBeginText) / 5), MAX_CHARS_IN_BLOCK); - if (count < MIN_CHARS_IN_BLOCK) { - return i; - } - - // If the preceding quintet is (, setFont, setTextMatrix, - // showText, endText), include that as well. (E.g. might be - // |dependency|.) - var iFirst = iFirstBeginText; - if (iFirstBeginText >= 4 && - fnArray[iFirstBeginText - 4] === fnArray[iFirstSetFont] && - fnArray[iFirstBeginText - 3] === fnArray[iFirstSetTextMatrix] && - fnArray[iFirstBeginText - 2] === fnArray[iFirstShowText] && - fnArray[iFirstBeginText - 1] === fnArray[iFirstEndText] && - argsArray[iFirstBeginText - 4][0] === firstSetFontArg0 && - argsArray[iFirstBeginText - 4][1] === firstSetFontArg1) { - count++; - iFirst -= 5; - } - - // Remove (endText, beginText, setFont) trios. - var iEndText = iFirst + 4; - for (var q = 1; q < count; q++) { - fnArray.splice(iEndText, 3); - argsArray.splice(iEndText, 3); - iEndText += 2; - } - - return iEndText + 1; - }); - - function QueueOptimizer() {} - - QueueOptimizer.prototype = { - optimize: function QueueOptimizer_optimize(queue) { - var fnArray = queue.fnArray, argsArray = queue.argsArray; - var context = { - iCurr: 0, - fnArray: fnArray, - argsArray: argsArray - }; - var state; - var i = 0, ii = fnArray.length; - while (i < ii) { - state = (state || InitialState)[fnArray[i]]; - if (typeof state === 'function') { // we found some handler - context.iCurr = i; - // state() returns the index of the first non-matching op (if we - // didn't match) or the first op past the modified ops (if we did - // match and replace). - i = state(context); - state = undefined; // reset the state machine - ii = context.fnArray.length; - } else { - i++; - } - } - } - }; - return QueueOptimizer; -})(); - - -var BUILT_IN_CMAPS = [ -// << Start unicode maps. -'Adobe-GB1-UCS2', -'Adobe-CNS1-UCS2', -'Adobe-Japan1-UCS2', -'Adobe-Korea1-UCS2', -// >> End unicode maps. -'78-EUC-H', -'78-EUC-V', -'78-H', -'78-RKSJ-H', -'78-RKSJ-V', -'78-V', -'78ms-RKSJ-H', -'78ms-RKSJ-V', -'83pv-RKSJ-H', -'90ms-RKSJ-H', -'90ms-RKSJ-V', -'90msp-RKSJ-H', -'90msp-RKSJ-V', -'90pv-RKSJ-H', -'90pv-RKSJ-V', -'Add-H', -'Add-RKSJ-H', -'Add-RKSJ-V', -'Add-V', -'Adobe-CNS1-0', -'Adobe-CNS1-1', -'Adobe-CNS1-2', -'Adobe-CNS1-3', -'Adobe-CNS1-4', -'Adobe-CNS1-5', -'Adobe-CNS1-6', -'Adobe-GB1-0', -'Adobe-GB1-1', -'Adobe-GB1-2', -'Adobe-GB1-3', -'Adobe-GB1-4', -'Adobe-GB1-5', -'Adobe-Japan1-0', -'Adobe-Japan1-1', -'Adobe-Japan1-2', -'Adobe-Japan1-3', -'Adobe-Japan1-4', -'Adobe-Japan1-5', -'Adobe-Japan1-6', -'Adobe-Korea1-0', -'Adobe-Korea1-1', -'Adobe-Korea1-2', -'B5-H', -'B5-V', -'B5pc-H', -'B5pc-V', -'CNS-EUC-H', -'CNS-EUC-V', -'CNS1-H', -'CNS1-V', -'CNS2-H', -'CNS2-V', -'ETHK-B5-H', -'ETHK-B5-V', -'ETen-B5-H', -'ETen-B5-V', -'ETenms-B5-H', -'ETenms-B5-V', -'EUC-H', -'EUC-V', -'Ext-H', -'Ext-RKSJ-H', -'Ext-RKSJ-V', -'Ext-V', -'GB-EUC-H', -'GB-EUC-V', -'GB-H', -'GB-V', -'GBK-EUC-H', -'GBK-EUC-V', -'GBK2K-H', -'GBK2K-V', -'GBKp-EUC-H', -'GBKp-EUC-V', -'GBT-EUC-H', -'GBT-EUC-V', -'GBT-H', -'GBT-V', -'GBTpc-EUC-H', -'GBTpc-EUC-V', -'GBpc-EUC-H', -'GBpc-EUC-V', -'H', -'HKdla-B5-H', -'HKdla-B5-V', -'HKdlb-B5-H', -'HKdlb-B5-V', -'HKgccs-B5-H', -'HKgccs-B5-V', -'HKm314-B5-H', -'HKm314-B5-V', -'HKm471-B5-H', -'HKm471-B5-V', -'HKscs-B5-H', -'HKscs-B5-V', -'Hankaku', -'Hiragana', -'KSC-EUC-H', -'KSC-EUC-V', -'KSC-H', -'KSC-Johab-H', -'KSC-Johab-V', -'KSC-V', -'KSCms-UHC-H', -'KSCms-UHC-HW-H', -'KSCms-UHC-HW-V', -'KSCms-UHC-V', -'KSCpc-EUC-H', -'KSCpc-EUC-V', -'Katakana', -'NWP-H', -'NWP-V', -'RKSJ-H', -'RKSJ-V', -'Roman', -'UniCNS-UCS2-H', -'UniCNS-UCS2-V', -'UniCNS-UTF16-H', -'UniCNS-UTF16-V', -'UniCNS-UTF32-H', -'UniCNS-UTF32-V', -'UniCNS-UTF8-H', -'UniCNS-UTF8-V', -'UniGB-UCS2-H', -'UniGB-UCS2-V', -'UniGB-UTF16-H', -'UniGB-UTF16-V', -'UniGB-UTF32-H', -'UniGB-UTF32-V', -'UniGB-UTF8-H', -'UniGB-UTF8-V', -'UniJIS-UCS2-H', -'UniJIS-UCS2-HW-H', -'UniJIS-UCS2-HW-V', -'UniJIS-UCS2-V', -'UniJIS-UTF16-H', -'UniJIS-UTF16-V', -'UniJIS-UTF32-H', -'UniJIS-UTF32-V', -'UniJIS-UTF8-H', -'UniJIS-UTF8-V', -'UniJIS2004-UTF16-H', -'UniJIS2004-UTF16-V', -'UniJIS2004-UTF32-H', -'UniJIS2004-UTF32-V', -'UniJIS2004-UTF8-H', -'UniJIS2004-UTF8-V', -'UniJISPro-UCS2-HW-V', -'UniJISPro-UCS2-V', -'UniJISPro-UTF8-V', -'UniJISX0213-UTF32-H', -'UniJISX0213-UTF32-V', -'UniJISX02132004-UTF32-H', -'UniJISX02132004-UTF32-V', -'UniKS-UCS2-H', -'UniKS-UCS2-V', -'UniKS-UTF16-H', -'UniKS-UTF16-V', -'UniKS-UTF32-H', -'UniKS-UTF32-V', -'UniKS-UTF8-H', -'UniKS-UTF8-V', -'V', -'WP-Symbol']; - -// CMap, not to be confused with TrueType's cmap. -var CMap = (function CMapClosure() { - function CMap(builtInCMap) { - // Codespace ranges are stored as follows: - // [[1BytePairs], [2BytePairs], [3BytePairs], [4BytePairs]] - // where nBytePairs are ranges e.g. [low1, high1, low2, high2, ...] - this.codespaceRanges = [[], [], [], []]; - this.numCodespaceRanges = 0; - // Map entries have one of two forms. - // - cid chars are 16-bit unsigned integers, stored as integers. - // - bf chars are variable-length byte sequences, stored as strings, with - // one byte per character. - this._map = []; - this.name = ''; - this.vertical = false; - this.useCMap = null; - this.builtInCMap = builtInCMap; - } - CMap.prototype = { - addCodespaceRange: function(n, low, high) { - this.codespaceRanges[n - 1].push(low, high); - this.numCodespaceRanges++; - }, - - mapCidRange: function(low, high, dstLow) { - while (low <= high) { - this._map[low++] = dstLow++; - } - }, - - mapBfRange: function(low, high, dstLow) { - var lastByte = dstLow.length - 1; - while (low <= high) { - this._map[low++] = dstLow; - // Only the last byte has to be incremented. - dstLow = dstLow.substr(0, lastByte) + - String.fromCharCode(dstLow.charCodeAt(lastByte) + 1); - } - }, - - mapBfRangeToArray: function(low, high, array) { - var i = 0, ii = array.length; - while (low <= high && i < ii) { - this._map[low] = array[i++]; - ++low; - } - }, - - // This is used for both bf and cid chars. - mapOne: function(src, dst) { - this._map[src] = dst; - }, - - lookup: function(code) { - return this._map[code]; - }, - - contains: function(code) { - return this._map[code] !== undefined; - }, - - forEach: function(callback) { - // Most maps have fewer than 65536 entries, and for those we use normal - // array iteration. But really sparse tables are possible -- e.g. with - // indices in the *billions*. For such tables we use for..in, which isn't - // ideal because it stringifies the indices for all present elements, but - // it does avoid iterating over every undefined entry. - var map = this._map; - var length = map.length; - var i; - if (length <= 0x10000) { - for (i = 0; i < length; i++) { - if (map[i] !== undefined) { - callback(i, map[i]); - } - } - } else { - for (i in this._map) { - callback(i, map[i]); - } - } - }, - - charCodeOf: function(value) { - return this._map.indexOf(value); - }, - - getMap: function() { - return this._map; - }, - - readCharCode: function(str, offset, out) { - var c = 0; - var codespaceRanges = this.codespaceRanges; - var codespaceRangesLen = this.codespaceRanges.length; - // 9.7.6.2 CMap Mapping - // The code length is at most 4. - for (var n = 0; n < codespaceRangesLen; n++) { - c = ((c << 8) | str.charCodeAt(offset + n)) >>> 0; - // Check each codespace range to see if it falls within. - var codespaceRange = codespaceRanges[n]; - for (var k = 0, kk = codespaceRange.length; k < kk;) { - var low = codespaceRange[k++]; - var high = codespaceRange[k++]; - if (c >= low && c <= high) { - out.charcode = c; - out.length = n + 1; - return; - } - } - } - out.charcode = 0; - out.length = 1; - }, - - get length() { - return this._map.length; - }, - - get isIdentityCMap() { - if (!(this.name === 'Identity-H' || this.name === 'Identity-V')) { - return false; - } - if (this._map.length !== 0x10000) { - return false; - } - for (var i = 0; i < 0x10000; i++) { - if (this._map[i] !== i) { - return false; - } - } - return true; - } - }; - return CMap; -})(); - -// A special case of CMap, where the _map array implicitly has a length of -// 65536 and each element is equal to its index. -var IdentityCMap = (function IdentityCMapClosure() { - function IdentityCMap(vertical, n) { - CMap.call(this); - this.vertical = vertical; - this.addCodespaceRange(n, 0, 0xffff); - } - Util.inherit(IdentityCMap, CMap, {}); - - IdentityCMap.prototype = { - addCodespaceRange: CMap.prototype.addCodespaceRange, - - mapCidRange: function(low, high, dstLow) { - error('should not call mapCidRange'); - }, - - mapBfRange: function(low, high, dstLow) { - error('should not call mapBfRange'); - }, - - mapBfRangeToArray: function(low, high, array) { - error('should not call mapBfRangeToArray'); - }, - - mapOne: function(src, dst) { - error('should not call mapCidOne'); - }, - - lookup: function(code) { - return (isInt(code) && code <= 0xffff) ? code : undefined; - }, - - contains: function(code) { - return isInt(code) && code <= 0xffff; - }, - - forEach: function(callback) { - for (var i = 0; i <= 0xffff; i++) { - callback(i, i); - } - }, - - charCodeOf: function(value) { - return (isInt(value) && value <= 0xffff) ? value : -1; - }, - - getMap: function() { - // Sometimes identity maps must be instantiated, but it's rare. - var map = new Array(0x10000); - for (var i = 0; i <= 0xffff; i++) { - map[i] = i; - } - return map; - }, - - readCharCode: CMap.prototype.readCharCode, - - get length() { - return 0x10000; - }, - - get isIdentityCMap() { - error('should not access .isIdentityCMap'); - } - }; - - return IdentityCMap; -})(); - -var BinaryCMapReader = (function BinaryCMapReaderClosure() { - function fetchBinaryData(url) { - var nonBinaryRequest = PDFJS.disableWorker; - var request = new XMLHttpRequest(); - request.open('GET', url, false); - if (!nonBinaryRequest) { - try { - request.responseType = 'arraybuffer'; - nonBinaryRequest = request.responseType !== 'arraybuffer'; - } catch (e) { - nonBinaryRequest = true; - } - } - if (nonBinaryRequest && request.overrideMimeType) { - request.overrideMimeType('text/plain; charset=x-user-defined'); - } - request.send(null); - if (nonBinaryRequest ? !request.responseText : !request.response) { - error('Unable to get binary cMap at: ' + url); - } - if (nonBinaryRequest) { - var data = Array.prototype.map.call(request.responseText, function (ch) { - return ch.charCodeAt(0) & 255; - }); - return new Uint8Array(data); - } - return new Uint8Array(request.response); - } - - function hexToInt(a, size) { - var n = 0; - for (var i = 0; i <= size; i++) { - n = (n << 8) | a[i]; - } - return n >>> 0; - } - - function hexToStr(a, size) { - // This code is hot. Special-case some common values to avoid creating an - // object with subarray(). - if (size === 1) { - return String.fromCharCode(a[0], a[1]); - } - if (size === 3) { - return String.fromCharCode(a[0], a[1], a[2], a[3]); - } - return String.fromCharCode.apply(null, a.subarray(0, size + 1)); - } - - function addHex(a, b, size) { - var c = 0; - for (var i = size; i >= 0; i--) { - c += a[i] + b[i]; - a[i] = c & 255; - c >>= 8; - } - } - - function incHex(a, size) { - var c = 1; - for (var i = size; i >= 0 && c > 0; i--) { - c += a[i]; - a[i] = c & 255; - c >>= 8; - } - } - - var MAX_NUM_SIZE = 16; - var MAX_ENCODED_NUM_SIZE = 19; // ceil(MAX_NUM_SIZE * 7 / 8) - - function BinaryCMapStream(data) { - this.buffer = data; - this.pos = 0; - this.end = data.length; - this.tmpBuf = new Uint8Array(MAX_ENCODED_NUM_SIZE); - } - - BinaryCMapStream.prototype = { - readByte: function () { - if (this.pos >= this.end) { - return -1; - } - return this.buffer[this.pos++]; - }, - readNumber: function () { - var n = 0; - var last; - do { - var b = this.readByte(); - if (b < 0) { - error('unexpected EOF in bcmap'); - } - last = !(b & 0x80); - n = (n << 7) | (b & 0x7F); - } while (!last); - return n; - }, - readSigned: function () { - var n = this.readNumber(); - return (n & 1) ? ~(n >>> 1) : n >>> 1; - }, - readHex: function (num, size) { - num.set(this.buffer.subarray(this.pos, - this.pos + size + 1)); - this.pos += size + 1; - }, - readHexNumber: function (num, size) { - var last; - var stack = this.tmpBuf, sp = 0; - do { - var b = this.readByte(); - if (b < 0) { - error('unexpected EOF in bcmap'); - } - last = !(b & 0x80); - stack[sp++] = b & 0x7F; - } while (!last); - var i = size, buffer = 0, bufferSize = 0; - while (i >= 0) { - while (bufferSize < 8 && stack.length > 0) { - buffer = (stack[--sp] << bufferSize) | buffer; - bufferSize += 7; - } - num[i] = buffer & 255; - i--; - buffer >>= 8; - bufferSize -= 8; - } - }, - readHexSigned: function (num, size) { - this.readHexNumber(num, size); - var sign = num[size] & 1 ? 255 : 0; - var c = 0; - for (var i = 0; i <= size; i++) { - c = ((c & 1) << 8) | num[i]; - num[i] = (c >> 1) ^ sign; - } - }, - readString: function () { - var len = this.readNumber(); - var s = ''; - for (var i = 0; i < len; i++) { - s += String.fromCharCode(this.readNumber()); - } - return s; - } - }; - - function processBinaryCMap(url, cMap, extend) { - var data = fetchBinaryData(url); - var stream = new BinaryCMapStream(data); - - var header = stream.readByte(); - cMap.vertical = !!(header & 1); - - var useCMap = null; - var start = new Uint8Array(MAX_NUM_SIZE); - var end = new Uint8Array(MAX_NUM_SIZE); - var char = new Uint8Array(MAX_NUM_SIZE); - var charCode = new Uint8Array(MAX_NUM_SIZE); - var tmp = new Uint8Array(MAX_NUM_SIZE); - var code; - - var b; - while ((b = stream.readByte()) >= 0) { - var type = b >> 5; - if (type === 7) { // metadata, e.g. comment or usecmap - switch (b & 0x1F) { - case 0: - stream.readString(); // skipping comment - break; - case 1: - useCMap = stream.readString(); - break; - } - continue; - } - var sequence = !!(b & 0x10); - var dataSize = b & 15; - - assert(dataSize + 1 <= MAX_NUM_SIZE); - - var ucs2DataSize = 1; - var subitemsCount = stream.readNumber(); - var i; - switch (type) { - case 0: // codespacerange - stream.readHex(start, dataSize); - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), - hexToInt(end, dataSize)); - for (i = 1; i < subitemsCount; i++) { - incHex(end, dataSize); - stream.readHexNumber(start, dataSize); - addHex(start, end, dataSize); - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), - hexToInt(end, dataSize)); - } - break; - case 1: // notdefrange - stream.readHex(start, dataSize); - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - code = stream.readNumber(); - // undefined range, skipping - for (i = 1; i < subitemsCount; i++) { - incHex(end, dataSize); - stream.readHexNumber(start, dataSize); - addHex(start, end, dataSize); - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - code = stream.readNumber(); - // nop - } - break; - case 2: // cidchar - stream.readHex(char, dataSize); - code = stream.readNumber(); - cMap.mapOne(hexToInt(char, dataSize), code); - for (i = 1; i < subitemsCount; i++) { - incHex(char, dataSize); - if (!sequence) { - stream.readHexNumber(tmp, dataSize); - addHex(char, tmp, dataSize); - } - code = stream.readSigned() + (code + 1); - cMap.mapOne(hexToInt(char, dataSize), code); - } - break; - case 3: // cidrange - stream.readHex(start, dataSize); - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - code = stream.readNumber(); - cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), - code); - for (i = 1; i < subitemsCount; i++) { - incHex(end, dataSize); - if (!sequence) { - stream.readHexNumber(start, dataSize); - addHex(start, end, dataSize); - } else { - start.set(end); - } - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - code = stream.readNumber(); - cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), - code); - } - break; - case 4: // bfchar - stream.readHex(char, ucs2DataSize); - stream.readHex(charCode, dataSize); - cMap.mapOne(hexToInt(char, ucs2DataSize), - hexToStr(charCode, dataSize)); - for (i = 1; i < subitemsCount; i++) { - incHex(char, ucs2DataSize); - if (!sequence) { - stream.readHexNumber(tmp, ucs2DataSize); - addHex(char, tmp, ucs2DataSize); - } - incHex(charCode, dataSize); - stream.readHexSigned(tmp, dataSize); - addHex(charCode, tmp, dataSize); - cMap.mapOne(hexToInt(char, ucs2DataSize), - hexToStr(charCode, dataSize)); - } - break; - case 5: // bfrange - stream.readHex(start, ucs2DataSize); - stream.readHexNumber(end, ucs2DataSize); - addHex(end, start, ucs2DataSize); - stream.readHex(charCode, dataSize); - cMap.mapBfRange(hexToInt(start, ucs2DataSize), - hexToInt(end, ucs2DataSize), - hexToStr(charCode, dataSize)); - for (i = 1; i < subitemsCount; i++) { - incHex(end, ucs2DataSize); - if (!sequence) { - stream.readHexNumber(start, ucs2DataSize); - addHex(start, end, ucs2DataSize); - } else { - start.set(end); - } - stream.readHexNumber(end, ucs2DataSize); - addHex(end, start, ucs2DataSize); - stream.readHex(charCode, dataSize); - cMap.mapBfRange(hexToInt(start, ucs2DataSize), - hexToInt(end, ucs2DataSize), - hexToStr(charCode, dataSize)); - } - break; - default: - error('Unknown type: ' + type); - break; - } - } - - if (useCMap) { - extend(useCMap); - } - return cMap; - } - - function BinaryCMapReader() {} - - BinaryCMapReader.prototype = { - read: processBinaryCMap - }; - - return BinaryCMapReader; -})(); - -var CMapFactory = (function CMapFactoryClosure() { - function strToInt(str) { - var a = 0; - for (var i = 0; i < str.length; i++) { - a = (a << 8) | str.charCodeAt(i); - } - return a >>> 0; - } - - function expectString(obj) { - if (!isString(obj)) { - error('Malformed CMap: expected string.'); - } - } - - function expectInt(obj) { - if (!isInt(obj)) { - error('Malformed CMap: expected int.'); - } - } - - function parseBfChar(cMap, lexer) { - while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } - if (isCmd(obj, 'endbfchar')) { - return; - } - expectString(obj); - var src = strToInt(obj); - obj = lexer.getObj(); - // TODO are /dstName used? - expectString(obj); - var dst = obj; - cMap.mapOne(src, dst); - } - } - - function parseBfRange(cMap, lexer) { - while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } - if (isCmd(obj, 'endbfrange')) { - return; - } - expectString(obj); - var low = strToInt(obj); - obj = lexer.getObj(); - expectString(obj); - var high = strToInt(obj); - obj = lexer.getObj(); - if (isInt(obj) || isString(obj)) { - var dstLow = isInt(obj) ? String.fromCharCode(obj) : obj; - cMap.mapBfRange(low, high, dstLow); - } else if (isCmd(obj, '[')) { - obj = lexer.getObj(); - var array = []; - while (!isCmd(obj, ']') && !isEOF(obj)) { - array.push(obj); - obj = lexer.getObj(); - } - cMap.mapBfRangeToArray(low, high, array); - } else { - break; - } - } - error('Invalid bf range.'); - } - - function parseCidChar(cMap, lexer) { - while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } - if (isCmd(obj, 'endcidchar')) { - return; - } - expectString(obj); - var src = strToInt(obj); - obj = lexer.getObj(); - expectInt(obj); - var dst = obj; - cMap.mapOne(src, dst); - } - } - - function parseCidRange(cMap, lexer) { - while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } - if (isCmd(obj, 'endcidrange')) { - return; - } - expectString(obj); - var low = strToInt(obj); - obj = lexer.getObj(); - expectString(obj); - var high = strToInt(obj); - obj = lexer.getObj(); - expectInt(obj); - var dstLow = obj; - cMap.mapCidRange(low, high, dstLow); - } - } - - function parseCodespaceRange(cMap, lexer) { - while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } - if (isCmd(obj, 'endcodespacerange')) { - return; - } - if (!isString(obj)) { - break; - } - var low = strToInt(obj); - obj = lexer.getObj(); - if (!isString(obj)) { - break; - } - var high = strToInt(obj); - cMap.addCodespaceRange(obj.length, low, high); - } - error('Invalid codespace range.'); - } - - function parseWMode(cMap, lexer) { - var obj = lexer.getObj(); - if (isInt(obj)) { - cMap.vertical = !!obj; - } - } - - function parseCMapName(cMap, lexer) { - var obj = lexer.getObj(); - if (isName(obj) && isString(obj.name)) { - cMap.name = obj.name; - } - } - - function parseCMap(cMap, lexer, builtInCMapParams, useCMap) { - var previous; - var embededUseCMap; - objLoop: while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } else if (isName(obj)) { - if (obj.name === 'WMode') { - parseWMode(cMap, lexer); - } else if (obj.name === 'CMapName') { - parseCMapName(cMap, lexer); - } - previous = obj; - } else if (isCmd(obj)) { - switch (obj.cmd) { - case 'endcmap': - break objLoop; - case 'usecmap': - if (isName(previous)) { - embededUseCMap = previous.name; - } - break; - case 'begincodespacerange': - parseCodespaceRange(cMap, lexer); - break; - case 'beginbfchar': - parseBfChar(cMap, lexer); - break; - case 'begincidchar': - parseCidChar(cMap, lexer); - break; - case 'beginbfrange': - parseBfRange(cMap, lexer); - break; - case 'begincidrange': - parseCidRange(cMap, lexer); - break; - } - } - } - - if (!useCMap && embededUseCMap) { - // Load the usecmap definition from the file only if there wasn't one - // specified. - useCMap = embededUseCMap; - } - if (useCMap) { - extendCMap(cMap, builtInCMapParams, useCMap); - } - } - - function extendCMap(cMap, builtInCMapParams, useCMap) { - cMap.useCMap = createBuiltInCMap(useCMap, builtInCMapParams); - // If there aren't any code space ranges defined clone all the parent ones - // into this cMap. - if (cMap.numCodespaceRanges === 0) { - var useCodespaceRanges = cMap.useCMap.codespaceRanges; - for (var i = 0; i < useCodespaceRanges.length; i++) { - cMap.codespaceRanges[i] = useCodespaceRanges[i].slice(); - } - cMap.numCodespaceRanges = cMap.useCMap.numCodespaceRanges; - } - // Merge the map into the current one, making sure not to override - // any previously defined entries. - cMap.useCMap.forEach(function(key, value) { - if (!cMap.contains(key)) { - cMap.mapOne(key, cMap.useCMap.lookup(key)); - } - }); - } - - function parseBinaryCMap(name, builtInCMapParams) { - var url = builtInCMapParams.url + name + '.bcmap'; - var cMap = new CMap(true); - new BinaryCMapReader().read(url, cMap, function (useCMap) { - extendCMap(cMap, builtInCMapParams, useCMap); - }); - return cMap; - } - - function createBuiltInCMap(name, builtInCMapParams) { - if (name === 'Identity-H') { - return new IdentityCMap(false, 2); - } else if (name === 'Identity-V') { - return new IdentityCMap(true, 2); - } - if (BUILT_IN_CMAPS.indexOf(name) === -1) { - error('Unknown cMap name: ' + name); - } - assert(builtInCMapParams, 'built-in cMap parameters are not provided'); - - if (builtInCMapParams.packed) { - return parseBinaryCMap(name, builtInCMapParams); - } - - var request = new XMLHttpRequest(); - var url = builtInCMapParams.url + name; - request.open('GET', url, false); - request.send(null); - if (!request.responseText) { - error('Unable to get cMap at: ' + url); - } - var cMap = new CMap(true); - var lexer = new Lexer(new StringStream(request.responseText)); - parseCMap(cMap, lexer, builtInCMapParams, null); - return cMap; - } - - return { - create: function (encoding, builtInCMapParams, useCMap) { - if (isName(encoding)) { - return createBuiltInCMap(encoding.name, builtInCMapParams); - } else if (isStream(encoding)) { - var cMap = new CMap(); - var lexer = new Lexer(encoding); - try { - parseCMap(cMap, lexer, builtInCMapParams, useCMap); - } catch (e) { - warn('Invalid CMap data. ' + e); - } - if (cMap.isIdentityCMap) { - return createBuiltInCMap(cMap.name, builtInCMapParams); - } - return cMap; - } - error('Encoding required.'); - } - }; -})(); - - -// Unicode Private Use Area -var PRIVATE_USE_OFFSET_START = 0xE000; -var PRIVATE_USE_OFFSET_END = 0xF8FF; -var SKIP_PRIVATE_USE_RANGE_F000_TO_F01F = false; - -// PDF Glyph Space Units are one Thousandth of a TextSpace Unit -// except for Type 3 fonts -var PDF_GLYPH_SPACE_UNITS = 1000; - -// Hinting is currently disabled due to unknown problems on windows -// in tracemonkey and various other pdfs with type1 fonts. -var HINTING_ENABLED = false; - -// Accented charactars are not displayed properly on windows, using this flag -// to control analysis of seac charstrings. -var SEAC_ANALYSIS_ENABLED = false; - -var FontFlags = { - FixedPitch: 1, - Serif: 2, - Symbolic: 4, - Script: 8, - Nonsymbolic: 32, - Italic: 64, - AllCap: 65536, - SmallCap: 131072, - ForceBold: 262144 -}; - -var Encodings = { - ExpertEncoding: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclamsmall', 'Hungarumlautsmall', '', 'dollaroldstyle', - 'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior', - 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', - 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', - 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', - 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'colon', - 'semicolon', 'commasuperior', 'threequartersemdash', 'periodsuperior', - 'questionsmall', '', 'asuperior', 'bsuperior', 'centsuperior', 'dsuperior', - 'esuperior', '', '', 'isuperior', '', '', 'lsuperior', 'msuperior', - 'nsuperior', 'osuperior', '', '', 'rsuperior', 'ssuperior', 'tsuperior', - '', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', '', - 'parenrightinferior', 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', - 'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', - 'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', - 'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', - 'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', - 'onefitted', 'rupiah', 'Tildesmall', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', 'exclamdownsmall', 'centoldstyle', 'Lslashsmall', - '', '', 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', 'Brevesmall', - 'Caronsmall', '', 'Dotaccentsmall', '', '', 'Macronsmall', '', '', - 'figuredash', 'hypheninferior', '', '', 'Ogoneksmall', 'Ringsmall', - 'Cedillasmall', '', '', '', 'onequarter', 'onehalf', 'threequarters', - 'questiondownsmall', 'oneeighth', 'threeeighths', 'fiveeighths', - 'seveneighths', 'onethird', 'twothirds', '', '', 'zerosuperior', - 'onesuperior', 'twosuperior', 'threesuperior', 'foursuperior', - 'fivesuperior', 'sixsuperior', 'sevensuperior', 'eightsuperior', - 'ninesuperior', 'zeroinferior', 'oneinferior', 'twoinferior', - 'threeinferior', 'fourinferior', 'fiveinferior', 'sixinferior', - 'seveninferior', 'eightinferior', 'nineinferior', 'centinferior', - 'dollarinferior', 'periodinferior', 'commainferior', 'Agravesmall', - 'Aacutesmall', 'Acircumflexsmall', 'Atildesmall', 'Adieresissmall', - 'Aringsmall', 'AEsmall', 'Ccedillasmall', 'Egravesmall', 'Eacutesmall', - 'Ecircumflexsmall', 'Edieresissmall', 'Igravesmall', 'Iacutesmall', - 'Icircumflexsmall', 'Idieresissmall', 'Ethsmall', 'Ntildesmall', - 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', 'Otildesmall', - 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', 'Uacutesmall', - 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', 'Thornsmall', - 'Ydieresissmall'], - MacExpertEncoding: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclamsmall', 'Hungarumlautsmall', 'centoldstyle', - 'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', 'Acutesmall', - 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', - 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', 'zerooldstyle', - 'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle', - 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', - 'nineoldstyle', 'colon', 'semicolon', '', 'threequartersemdash', '', - 'questionsmall', '', '', '', '', 'Ethsmall', '', '', 'onequarter', - 'onehalf', 'threequarters', 'oneeighth', 'threeeighths', 'fiveeighths', - 'seveneighths', 'onethird', 'twothirds', '', '', '', '', '', '', 'ff', - 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', '', 'parenrightinferior', - 'Circumflexsmall', 'hypheninferior', 'Gravesmall', 'Asmall', 'Bsmall', - 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall', - 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall', - 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall', - 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah', - 'Tildesmall', '', '', 'asuperior', 'centsuperior', '', '', '', '', - 'Aacutesmall', 'Agravesmall', 'Acircumflexsmall', 'Adieresissmall', - 'Atildesmall', 'Aringsmall', 'Ccedillasmall', 'Eacutesmall', 'Egravesmall', - 'Ecircumflexsmall', 'Edieresissmall', 'Iacutesmall', 'Igravesmall', - 'Icircumflexsmall', 'Idieresissmall', 'Ntildesmall', 'Oacutesmall', - 'Ogravesmall', 'Ocircumflexsmall', 'Odieresissmall', 'Otildesmall', - 'Uacutesmall', 'Ugravesmall', 'Ucircumflexsmall', 'Udieresissmall', '', - 'eightsuperior', 'fourinferior', 'threeinferior', 'sixinferior', - 'eightinferior', 'seveninferior', 'Scaronsmall', '', 'centinferior', - 'twoinferior', '', 'Dieresissmall', '', 'Caronsmall', 'osuperior', - 'fiveinferior', '', 'commainferior', 'periodinferior', 'Yacutesmall', '', - 'dollarinferior', '', 'Thornsmall', '', 'nineinferior', 'zeroinferior', - 'Zcaronsmall', 'AEsmall', 'Oslashsmall', 'questiondownsmall', - 'oneinferior', 'Lslashsmall', '', '', '', '', '', '', 'Cedillasmall', '', - '', '', '', '', 'OEsmall', 'figuredash', 'hyphensuperior', '', '', '', '', - 'exclamdownsmall', '', 'Ydieresissmall', '', 'onesuperior', 'twosuperior', - 'threesuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', - 'sevensuperior', 'ninesuperior', 'zerosuperior', '', 'esuperior', - 'rsuperior', 'tsuperior', '', '', 'isuperior', 'ssuperior', 'dsuperior', - '', '', '', '', '', 'lsuperior', 'Ogoneksmall', 'Brevesmall', - 'Macronsmall', 'bsuperior', 'nsuperior', 'msuperior', 'commasuperior', - 'periodsuperior', 'Dotaccentsmall', 'Ringsmall'], - MacRomanEncoding: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', - 'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus', - 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', - 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', - 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', - 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', - 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', - 'asciicircum', 'underscore', 'grave', 'a', 'b', 'c', 'd', 'e', 'f', 'g', - 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', - 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', '', - 'Adieresis', 'Aring', 'Ccedilla', 'Eacute', 'Ntilde', 'Odieresis', - 'Udieresis', 'aacute', 'agrave', 'acircumflex', 'adieresis', 'atilde', - 'aring', 'ccedilla', 'eacute', 'egrave', 'ecircumflex', 'edieresis', - 'iacute', 'igrave', 'icircumflex', 'idieresis', 'ntilde', 'oacute', - 'ograve', 'ocircumflex', 'odieresis', 'otilde', 'uacute', 'ugrave', - 'ucircumflex', 'udieresis', 'dagger', 'degree', 'cent', 'sterling', - 'section', 'bullet', 'paragraph', 'germandbls', 'registered', 'copyright', - 'trademark', 'acute', 'dieresis', 'notequal', 'AE', 'Oslash', 'infinity', - 'plusminus', 'lessequal', 'greaterequal', 'yen', 'mu', 'partialdiff', - 'summation', 'product', 'pi', 'integral', 'ordfeminine', 'ordmasculine', - 'Omega', 'ae', 'oslash', 'questiondown', 'exclamdown', 'logicalnot', - 'radical', 'florin', 'approxequal', 'Delta', 'guillemotleft', - 'guillemotright', 'ellipsis', 'space', 'Agrave', 'Atilde', 'Otilde', 'OE', - 'oe', 'endash', 'emdash', 'quotedblleft', 'quotedblright', 'quoteleft', - 'quoteright', 'divide', 'lozenge', 'ydieresis', 'Ydieresis', 'fraction', - 'currency', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'daggerdbl', - 'periodcentered', 'quotesinglbase', 'quotedblbase', 'perthousand', - 'Acircumflex', 'Ecircumflex', 'Aacute', 'Edieresis', 'Egrave', 'Iacute', - 'Icircumflex', 'Idieresis', 'Igrave', 'Oacute', 'Ocircumflex', 'apple', - 'Ograve', 'Uacute', 'Ucircumflex', 'Ugrave', 'dotlessi', 'circumflex', - 'tilde', 'macron', 'breve', 'dotaccent', 'ring', 'cedilla', 'hungarumlaut', - 'ogonek', 'caron'], - StandardEncoding: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', - 'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus', - 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', - 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', - 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', - 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', - 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', - 'asciicircum', 'underscore', 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f', - 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', - 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'exclamdown', - 'cent', 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', - 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', - 'guilsinglright', 'fi', 'fl', '', 'endash', 'dagger', 'daggerdbl', - 'periodcentered', '', 'paragraph', 'bullet', 'quotesinglbase', - 'quotedblbase', 'quotedblright', 'guillemotright', 'ellipsis', - 'perthousand', '', 'questiondown', '', 'grave', 'acute', 'circumflex', - 'tilde', 'macron', 'breve', 'dotaccent', 'dieresis', '', 'ring', 'cedilla', - '', 'hungarumlaut', 'ogonek', 'caron', 'emdash', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', 'AE', '', 'ordfeminine', '', '', - '', '', 'Lslash', 'Oslash', 'OE', 'ordmasculine', '', '', '', '', '', 'ae', - '', '', '', 'dotlessi', '', '', 'lslash', 'oslash', 'oe', 'germandbls'], - WinAnsiEncoding: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', - 'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus', - 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', - 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', - 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', - 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', - 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', - 'asciicircum', 'underscore', 'grave', 'a', 'b', 'c', 'd', 'e', 'f', 'g', - 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', - 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', - 'bullet', 'Euro', 'bullet', 'quotesinglbase', 'florin', 'quotedblbase', - 'ellipsis', 'dagger', 'daggerdbl', 'circumflex', 'perthousand', 'Scaron', - 'guilsinglleft', 'OE', 'bullet', 'Zcaron', 'bullet', 'bullet', 'quoteleft', - 'quoteright', 'quotedblleft', 'quotedblright', 'bullet', 'endash', - 'emdash', 'tilde', 'trademark', 'scaron', 'guilsinglright', 'oe', 'bullet', - 'zcaron', 'Ydieresis', 'space', 'exclamdown', 'cent', 'sterling', - 'currency', 'yen', 'brokenbar', 'section', 'dieresis', 'copyright', - 'ordfeminine', 'guillemotleft', 'logicalnot', 'hyphen', 'registered', - 'macron', 'degree', 'plusminus', 'twosuperior', 'threesuperior', 'acute', - 'mu', 'paragraph', 'periodcentered', 'cedilla', 'onesuperior', - 'ordmasculine', 'guillemotright', 'onequarter', 'onehalf', 'threequarters', - 'questiondown', 'Agrave', 'Aacute', 'Acircumflex', 'Atilde', 'Adieresis', - 'Aring', 'AE', 'Ccedilla', 'Egrave', 'Eacute', 'Ecircumflex', 'Edieresis', - 'Igrave', 'Iacute', 'Icircumflex', 'Idieresis', 'Eth', 'Ntilde', 'Ograve', - 'Oacute', 'Ocircumflex', 'Otilde', 'Odieresis', 'multiply', 'Oslash', - 'Ugrave', 'Uacute', 'Ucircumflex', 'Udieresis', 'Yacute', 'Thorn', - 'germandbls', 'agrave', 'aacute', 'acircumflex', 'atilde', 'adieresis', - 'aring', 'ae', 'ccedilla', 'egrave', 'eacute', 'ecircumflex', 'edieresis', - 'igrave', 'iacute', 'icircumflex', 'idieresis', 'eth', 'ntilde', 'ograve', - 'oacute', 'ocircumflex', 'otilde', 'odieresis', 'divide', 'oslash', - 'ugrave', 'uacute', 'ucircumflex', 'udieresis', 'yacute', 'thorn', - 'ydieresis'], - SymbolSetEncoding: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclam', 'universal', 'numbersign', 'existential', 'percent', - 'ampersand', 'suchthat', 'parenleft', 'parenright', 'asteriskmath', 'plus', - 'comma', 'minus', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', - 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', - 'equal', 'greater', 'question', 'congruent', 'Alpha', 'Beta', 'Chi', - 'Delta', 'Epsilon', 'Phi', 'Gamma', 'Eta', 'Iota', 'theta1', 'Kappa', - 'Lambda', 'Mu', 'Nu', 'Omicron', 'Pi', 'Theta', 'Rho', 'Sigma', 'Tau', - 'Upsilon', 'sigma1', 'Omega', 'Xi', 'Psi', 'Zeta', 'bracketleft', - 'therefore', 'bracketright', 'perpendicular', 'underscore', 'radicalex', - 'alpha', 'beta', 'chi', 'delta', 'epsilon', 'phi', 'gamma', 'eta', 'iota', - 'phi1', 'kappa', 'lambda', 'mu', 'nu', 'omicron', 'pi', 'theta', 'rho', - 'sigma', 'tau', 'upsilon', 'omega1', 'omega', 'xi', 'psi', 'zeta', - 'braceleft', 'bar', 'braceright', 'similar', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', 'Euro', 'Upsilon1', 'minute', 'lessequal', - 'fraction', 'infinity', 'florin', 'club', 'diamond', 'heart', 'spade', - 'arrowboth', 'arrowleft', 'arrowup', 'arrowright', 'arrowdown', 'degree', - 'plusminus', 'second', 'greaterequal', 'multiply', 'proportional', - 'partialdiff', 'bullet', 'divide', 'notequal', 'equivalence', - 'approxequal', 'ellipsis', 'arrowvertex', 'arrowhorizex', 'carriagereturn', - 'aleph', 'Ifraktur', 'Rfraktur', 'weierstrass', 'circlemultiply', - 'circleplus', 'emptyset', 'intersection', 'union', 'propersuperset', - 'reflexsuperset', 'notsubset', 'propersubset', 'reflexsubset', 'element', - 'notelement', 'angle', 'gradient', 'registerserif', 'copyrightserif', - 'trademarkserif', 'product', 'radical', 'dotmath', 'logicalnot', - 'logicaland', 'logicalor', 'arrowdblboth', 'arrowdblleft', 'arrowdblup', - 'arrowdblright', 'arrowdbldown', 'lozenge', 'angleleft', 'registersans', - 'copyrightsans', 'trademarksans', 'summation', 'parenlefttp', - 'parenleftex', 'parenleftbt', 'bracketlefttp', 'bracketleftex', - 'bracketleftbt', 'bracelefttp', 'braceleftmid', 'braceleftbt', 'braceex', - '', 'angleright', 'integral', 'integraltp', 'integralex', 'integralbt', - 'parenrighttp', 'parenrightex', 'parenrightbt', 'bracketrighttp', - 'bracketrightex', 'bracketrightbt', 'bracerighttp', 'bracerightmid', - 'bracerightbt'], - ZapfDingbatsEncoding: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'a1', 'a2', 'a202', 'a3', 'a4', 'a5', 'a119', 'a118', 'a117', - 'a11', 'a12', 'a13', 'a14', 'a15', 'a16', 'a105', 'a17', 'a18', 'a19', - 'a20', 'a21', 'a22', 'a23', 'a24', 'a25', 'a26', 'a27', 'a28', 'a6', 'a7', - 'a8', 'a9', 'a10', 'a29', 'a30', 'a31', 'a32', 'a33', 'a34', 'a35', 'a36', - 'a37', 'a38', 'a39', 'a40', 'a41', 'a42', 'a43', 'a44', 'a45', 'a46', - 'a47', 'a48', 'a49', 'a50', 'a51', 'a52', 'a53', 'a54', 'a55', 'a56', - 'a57', 'a58', 'a59', 'a60', 'a61', 'a62', 'a63', 'a64', 'a65', 'a66', - 'a67', 'a68', 'a69', 'a70', 'a71', 'a72', 'a73', 'a74', 'a203', 'a75', - 'a204', 'a76', 'a77', 'a78', 'a79', 'a81', 'a82', 'a83', 'a84', 'a97', - 'a98', 'a99', 'a100', '', 'a89', 'a90', 'a93', 'a94', 'a91', 'a92', 'a205', - 'a85', 'a206', 'a86', 'a87', 'a88', 'a95', 'a96', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', 'a101', 'a102', 'a103', - 'a104', 'a106', 'a107', 'a108', 'a112', 'a111', 'a110', 'a109', 'a120', - 'a121', 'a122', 'a123', 'a124', 'a125', 'a126', 'a127', 'a128', 'a129', - 'a130', 'a131', 'a132', 'a133', 'a134', 'a135', 'a136', 'a137', 'a138', - 'a139', 'a140', 'a141', 'a142', 'a143', 'a144', 'a145', 'a146', 'a147', - 'a148', 'a149', 'a150', 'a151', 'a152', 'a153', 'a154', 'a155', 'a156', - 'a157', 'a158', 'a159', 'a160', 'a161', 'a163', 'a164', 'a196', 'a165', - 'a192', 'a166', 'a167', 'a168', 'a169', 'a170', 'a171', 'a172', 'a173', - 'a162', 'a174', 'a175', 'a176', 'a177', 'a178', 'a179', 'a193', 'a180', - 'a199', 'a181', 'a200', 'a182', '', 'a201', 'a183', 'a184', 'a197', 'a185', - 'a194', 'a198', 'a186', 'a195', 'a187', 'a188', 'a189', 'a190', 'a191'] -}; - -/** - * Hold a map of decoded fonts and of the standard fourteen Type1 - * fonts and their acronyms. - */ -var stdFontMap = { - 'ArialNarrow': 'Helvetica', - 'ArialNarrow-Bold': 'Helvetica-Bold', - 'ArialNarrow-BoldItalic': 'Helvetica-BoldOblique', - 'ArialNarrow-Italic': 'Helvetica-Oblique', - 'ArialBlack': 'Helvetica', - 'ArialBlack-Bold': 'Helvetica-Bold', - 'ArialBlack-BoldItalic': 'Helvetica-BoldOblique', - 'ArialBlack-Italic': 'Helvetica-Oblique', - 'Arial': 'Helvetica', - 'Arial-Bold': 'Helvetica-Bold', - 'Arial-BoldItalic': 'Helvetica-BoldOblique', - 'Arial-Italic': 'Helvetica-Oblique', - 'Arial-BoldItalicMT': 'Helvetica-BoldOblique', - 'Arial-BoldMT': 'Helvetica-Bold', - 'Arial-ItalicMT': 'Helvetica-Oblique', - 'ArialMT': 'Helvetica', - 'Courier-Bold': 'Courier-Bold', - 'Courier-BoldItalic': 'Courier-BoldOblique', - 'Courier-Italic': 'Courier-Oblique', - 'CourierNew': 'Courier', - 'CourierNew-Bold': 'Courier-Bold', - 'CourierNew-BoldItalic': 'Courier-BoldOblique', - 'CourierNew-Italic': 'Courier-Oblique', - 'CourierNewPS-BoldItalicMT': 'Courier-BoldOblique', - 'CourierNewPS-BoldMT': 'Courier-Bold', - 'CourierNewPS-ItalicMT': 'Courier-Oblique', - 'CourierNewPSMT': 'Courier', - 'Helvetica': 'Helvetica', - 'Helvetica-Bold': 'Helvetica-Bold', - 'Helvetica-BoldItalic': 'Helvetica-BoldOblique', - 'Helvetica-BoldOblique': 'Helvetica-BoldOblique', - 'Helvetica-Italic': 'Helvetica-Oblique', - 'Helvetica-Oblique':'Helvetica-Oblique', - 'Symbol-Bold': 'Symbol', - 'Symbol-BoldItalic': 'Symbol', - 'Symbol-Italic': 'Symbol', - 'TimesNewRoman': 'Times-Roman', - 'TimesNewRoman-Bold': 'Times-Bold', - 'TimesNewRoman-BoldItalic': 'Times-BoldItalic', - 'TimesNewRoman-Italic': 'Times-Italic', - 'TimesNewRomanPS': 'Times-Roman', - 'TimesNewRomanPS-Bold': 'Times-Bold', - 'TimesNewRomanPS-BoldItalic': 'Times-BoldItalic', - 'TimesNewRomanPS-BoldItalicMT': 'Times-BoldItalic', - 'TimesNewRomanPS-BoldMT': 'Times-Bold', - 'TimesNewRomanPS-Italic': 'Times-Italic', - 'TimesNewRomanPS-ItalicMT': 'Times-Italic', - 'TimesNewRomanPSMT': 'Times-Roman', - 'TimesNewRomanPSMT-Bold': 'Times-Bold', - 'TimesNewRomanPSMT-BoldItalic': 'Times-BoldItalic', - 'TimesNewRomanPSMT-Italic': 'Times-Italic' -}; - -/** - * Holds the map of the non-standard fonts that might be included as a standard - * fonts without glyph data. - */ -var nonStdFontMap = { - 'CenturyGothic': 'Helvetica', - 'CenturyGothic-Bold': 'Helvetica-Bold', - 'CenturyGothic-BoldItalic': 'Helvetica-BoldOblique', - 'CenturyGothic-Italic': 'Helvetica-Oblique', - 'ComicSansMS': 'Comic Sans MS', - 'ComicSansMS-Bold': 'Comic Sans MS-Bold', - 'ComicSansMS-BoldItalic': 'Comic Sans MS-BoldItalic', - 'ComicSansMS-Italic': 'Comic Sans MS-Italic', - 'LucidaConsole': 'Courier', - 'LucidaConsole-Bold': 'Courier-Bold', - 'LucidaConsole-BoldItalic': 'Courier-BoldOblique', - 'LucidaConsole-Italic': 'Courier-Oblique', - 'MS-Gothic': 'MS Gothic', - 'MS-Gothic-Bold': 'MS Gothic-Bold', - 'MS-Gothic-BoldItalic': 'MS Gothic-BoldItalic', - 'MS-Gothic-Italic': 'MS Gothic-Italic', - 'MS-Mincho': 'MS Mincho', - 'MS-Mincho-Bold': 'MS Mincho-Bold', - 'MS-Mincho-BoldItalic': 'MS Mincho-BoldItalic', - 'MS-Mincho-Italic': 'MS Mincho-Italic', - 'MS-PGothic': 'MS PGothic', - 'MS-PGothic-Bold': 'MS PGothic-Bold', - 'MS-PGothic-BoldItalic': 'MS PGothic-BoldItalic', - 'MS-PGothic-Italic': 'MS PGothic-Italic', - 'MS-PMincho': 'MS PMincho', - 'MS-PMincho-Bold': 'MS PMincho-Bold', - 'MS-PMincho-BoldItalic': 'MS PMincho-BoldItalic', - 'MS-PMincho-Italic': 'MS PMincho-Italic', - 'Wingdings': 'ZapfDingbats' -}; - -var serifFonts = { - 'Adobe Jenson': true, 'Adobe Text': true, 'Albertus': true, - 'Aldus': true, 'Alexandria': true, 'Algerian': true, - 'American Typewriter': true, 'Antiqua': true, 'Apex': true, - 'Arno': true, 'Aster': true, 'Aurora': true, - 'Baskerville': true, 'Bell': true, 'Bembo': true, - 'Bembo Schoolbook': true, 'Benguiat': true, 'Berkeley Old Style': true, - 'Bernhard Modern': true, 'Berthold City': true, 'Bodoni': true, - 'Bauer Bodoni': true, 'Book Antiqua': true, 'Bookman': true, - 'Bordeaux Roman': true, 'Californian FB': true, 'Calisto': true, - 'Calvert': true, 'Capitals': true, 'Cambria': true, - 'Cartier': true, 'Caslon': true, 'Catull': true, - 'Centaur': true, 'Century Old Style': true, 'Century Schoolbook': true, - 'Chaparral': true, 'Charis SIL': true, 'Cheltenham': true, - 'Cholla Slab': true, 'Clarendon': true, 'Clearface': true, - 'Cochin': true, 'Colonna': true, 'Computer Modern': true, - 'Concrete Roman': true, 'Constantia': true, 'Cooper Black': true, - 'Corona': true, 'Ecotype': true, 'Egyptienne': true, - 'Elephant': true, 'Excelsior': true, 'Fairfield': true, - 'FF Scala': true, 'Folkard': true, 'Footlight': true, - 'FreeSerif': true, 'Friz Quadrata': true, 'Garamond': true, - 'Gentium': true, 'Georgia': true, 'Gloucester': true, - 'Goudy Old Style': true, 'Goudy Schoolbook': true, 'Goudy Pro Font': true, - 'Granjon': true, 'Guardian Egyptian': true, 'Heather': true, - 'Hercules': true, 'High Tower Text': true, 'Hiroshige': true, - 'Hoefler Text': true, 'Humana Serif': true, 'Imprint': true, - 'Ionic No. 5': true, 'Janson': true, 'Joanna': true, - 'Korinna': true, 'Lexicon': true, 'Liberation Serif': true, - 'Linux Libertine': true, 'Literaturnaya': true, 'Lucida': true, - 'Lucida Bright': true, 'Melior': true, 'Memphis': true, - 'Miller': true, 'Minion': true, 'Modern': true, - 'Mona Lisa': true, 'Mrs Eaves': true, 'MS Serif': true, - 'Museo Slab': true, 'New York': true, 'Nimbus Roman': true, - 'NPS Rawlinson Roadway': true, 'Palatino': true, 'Perpetua': true, - 'Plantin': true, 'Plantin Schoolbook': true, 'Playbill': true, - 'Poor Richard': true, 'Rawlinson Roadway': true, 'Renault': true, - 'Requiem': true, 'Rockwell': true, 'Roman': true, - 'Rotis Serif': true, 'Sabon': true, 'Scala': true, - 'Seagull': true, 'Sistina': true, 'Souvenir': true, - 'STIX': true, 'Stone Informal': true, 'Stone Serif': true, - 'Sylfaen': true, 'Times': true, 'Trajan': true, - 'Trinité': true, 'Trump Mediaeval': true, 'Utopia': true, - 'Vale Type': true, 'Bitstream Vera': true, 'Vera Serif': true, - 'Versailles': true, 'Wanted': true, 'Weiss': true, - 'Wide Latin': true, 'Windsor': true, 'XITS': true -}; - -var symbolsFonts = { - 'Dingbats': true, 'Symbol': true, 'ZapfDingbats': true -}; - -// Glyph map for well-known standard fonts. Sometimes Ghostscript uses CID fonts -// but does not embed the CID to GID mapping. The mapping is incomplete for all -// glyphs, but common for some set of the standard fonts. -var GlyphMapForStandardFonts = { - '2': 10, '3': 32, '4': 33, '5': 34, '6': 35, '7': 36, '8': 37, '9': 38, - '10': 39, '11': 40, '12': 41, '13': 42, '14': 43, '15': 44, '16': 45, - '17': 46, '18': 47, '19': 48, '20': 49, '21': 50, '22': 51, '23': 52, - '24': 53, '25': 54, '26': 55, '27': 56, '28': 57, '29': 58, '30': 894, - '31': 60, '32': 61, '33': 62, '34': 63, '35': 64, '36': 65, '37': 66, - '38': 67, '39': 68, '40': 69, '41': 70, '42': 71, '43': 72, '44': 73, - '45': 74, '46': 75, '47': 76, '48': 77, '49': 78, '50': 79, '51': 80, - '52': 81, '53': 82, '54': 83, '55': 84, '56': 85, '57': 86, '58': 87, - '59': 88, '60': 89, '61': 90, '62': 91, '63': 92, '64': 93, '65': 94, - '66': 95, '67': 96, '68': 97, '69': 98, '70': 99, '71': 100, '72': 101, - '73': 102, '74': 103, '75': 104, '76': 105, '77': 106, '78': 107, '79': 108, - '80': 109, '81': 110, '82': 111, '83': 112, '84': 113, '85': 114, '86': 115, - '87': 116, '88': 117, '89': 118, '90': 119, '91': 120, '92': 121, '93': 122, - '94': 123, '95': 124, '96': 125, '97': 126, '98': 196, '99': 197, '100': 199, - '101': 201, '102': 209, '103': 214, '104': 220, '105': 225, '106': 224, - '107': 226, '108': 228, '109': 227, '110': 229, '111': 231, '112': 233, - '113': 232, '114': 234, '115': 235, '116': 237, '117': 236, '118': 238, - '119': 239, '120': 241, '121': 243, '122': 242, '123': 244, '124': 246, - '125': 245, '126': 250, '127': 249, '128': 251, '129': 252, '130': 8224, - '131': 176, '132': 162, '133': 163, '134': 167, '135': 8226, '136': 182, - '137': 223, '138': 174, '139': 169, '140': 8482, '141': 180, '142': 168, - '143': 8800, '144': 198, '145': 216, '146': 8734, '147': 177, '148': 8804, - '149': 8805, '150': 165, '151': 181, '152': 8706, '153': 8721, '154': 8719, - '156': 8747, '157': 170, '158': 186, '159': 8486, '160': 230, '161': 248, - '162': 191, '163': 161, '164': 172, '165': 8730, '166': 402, '167': 8776, - '168': 8710, '169': 171, '170': 187, '171': 8230, '210': 218, '223': 711, - '224': 321, '225': 322, '227': 353, '229': 382, '234': 253, '252': 263, - '253': 268, '254': 269, '258': 258, '260': 260, '261': 261, '265': 280, - '266': 281, '268': 283, '269': 313, '275': 323, '276': 324, '278': 328, - '284': 345, '285': 346, '286': 347, '292': 367, '295': 377, '296': 378, - '298': 380, '305': 963, - '306': 964, '307': 966, '308': 8215, '309': 8252, '310': 8319, '311': 8359, - '312': 8592, '313': 8593, '337': 9552, '493': 1039, '494': 1040, '705': 1524, - '706': 8362, '710': 64288, '711': 64298, '759': 1617, '761': 1776, - '763': 1778, '775': 1652, '777': 1764, '778': 1780, '779': 1781, '780': 1782, - '782': 771, '783': 64726, '786': 8363, '788': 8532, '790': 768, '791': 769, - '792': 768, '795': 803, '797': 64336, '798': 64337, '799': 64342, - '800': 64343, '801': 64344, '802': 64345, '803': 64362, '804': 64363, - '805': 64364, '2424': 7821, '2425': 7822, '2426': 7823, '2427': 7824, - '2428': 7825, '2429': 7826, '2430': 7827, '2433': 7682, '2678': 8045, - '2679': 8046, '2830': 1552, '2838': 686, '2840': 751, '2842': 753, - '2843': 754, '2844': 755, '2846': 757, '2856': 767, '2857': 848, '2858': 849, - '2862': 853, '2863': 854, '2864': 855, '2865': 861, '2866': 862, '2906': 7460, - '2908': 7462, '2909': 7463, '2910': 7464, '2912': 7466, '2913': 7467, - '2914': 7468, '2916': 7470, '2917': 7471, '2918': 7472, '2920': 7474, - '2921': 7475, '2922': 7476, '2924': 7478, '2925': 7479, '2926': 7480, - '2928': 7482, '2929': 7483, '2930': 7484, '2932': 7486, '2933': 7487, - '2934': 7488, '2936': 7490, '2937': 7491, '2938': 7492, '2940': 7494, - '2941': 7495, '2942': 7496, '2944': 7498, '2946': 7500, '2948': 7502, - '2950': 7504, '2951': 7505, '2952': 7506, '2954': 7508, '2955': 7509, - '2956': 7510, '2958': 7512, '2959': 7513, '2960': 7514, '2962': 7516, - '2963': 7517, '2964': 7518, '2966': 7520, '2967': 7521, '2968': 7522, - '2970': 7524, '2971': 7525, '2972': 7526, '2974': 7528, '2975': 7529, - '2976': 7530, '2978': 1537, '2979': 1538, '2980': 1539, '2982': 1549, - '2983': 1551, '2984': 1552, '2986': 1554, '2987': 1555, '2988': 1556, - '2990': 1623, '2991': 1624, '2995': 1775, '2999': 1791, '3002': 64290, - '3003': 64291, '3004': 64292, '3006': 64294, '3007': 64295, '3008': 64296, - '3011': 1900, '3014': 8223, '3015': 8244, '3017': 7532, '3018': 7533, - '3019': 7534, '3075': 7590, '3076': 7591, '3079': 7594, '3080': 7595, - '3083': 7598, '3084': 7599, '3087': 7602, '3088': 7603, '3091': 7606, - '3092': 7607, '3095': 7610, '3096': 7611, '3099': 7614, '3100': 7615, - '3103': 7618, '3104': 7619, '3107': 8337, '3108': 8338, '3116': 1884, - '3119': 1885, '3120': 1885, '3123': 1886, '3124': 1886, '3127': 1887, - '3128': 1887, '3131': 1888, '3132': 1888, '3135': 1889, '3136': 1889, - '3139': 1890, '3140': 1890, '3143': 1891, '3144': 1891, '3147': 1892, - '3148': 1892, '3153': 580, '3154': 581, '3157': 584, '3158': 585, '3161': 588, - '3162': 589, '3165': 891, '3166': 892, '3169': 1274, '3170': 1275, - '3173': 1278, '3174': 1279, '3181': 7622, '3182': 7623, '3282': 11799, - '3316': 578, '3379': 42785, '3393': 1159, '3416': 8377 -}; - -// The glyph map for ArialBlack differs slightly from the glyph map used for -// other well-known standard fonts. Hence we use this (incomplete) CID to GID -// mapping to adjust the glyph map for non-embedded ArialBlack fonts. -var SupplementalGlyphMapForArialBlack = { - '227': 322, '264': 261, '291': 346, -}; - -// Some characters, e.g. copyrightserif, are mapped to the private use area and -// might not be displayed using standard fonts. Mapping/hacking well-known chars -// to the similar equivalents in the normal characters range. -var SpecialPUASymbols = { - '63721': 0x00A9, // copyrightsans (0xF8E9) => copyright - '63193': 0x00A9, // copyrightserif (0xF6D9) => copyright - '63720': 0x00AE, // registersans (0xF8E8) => registered - '63194': 0x00AE, // registerserif (0xF6DA) => registered - '63722': 0x2122, // trademarksans (0xF8EA) => trademark - '63195': 0x2122, // trademarkserif (0xF6DB) => trademark - '63729': 0x23A7, // bracelefttp (0xF8F1) - '63730': 0x23A8, // braceleftmid (0xF8F2) - '63731': 0x23A9, // braceleftbt (0xF8F3) - '63740': 0x23AB, // bracerighttp (0xF8FC) - '63741': 0x23AC, // bracerightmid (0xF8FD) - '63742': 0x23AD, // bracerightbt (0xF8FE) - '63726': 0x23A1, // bracketlefttp (0xF8EE) - '63727': 0x23A2, // bracketleftex (0xF8EF) - '63728': 0x23A3, // bracketleftbt (0xF8F0) - '63737': 0x23A4, // bracketrighttp (0xF8F9) - '63738': 0x23A5, // bracketrightex (0xF8FA) - '63739': 0x23A6, // bracketrightbt (0xF8FB) - '63723': 0x239B, // parenlefttp (0xF8EB) - '63724': 0x239C, // parenleftex (0xF8EC) - '63725': 0x239D, // parenleftbt (0xF8ED) - '63734': 0x239E, // parenrighttp (0xF8F6) - '63735': 0x239F, // parenrightex (0xF8F7) - '63736': 0x23A0, // parenrightbt (0xF8F8) -}; -function mapSpecialUnicodeValues(code) { - if (code >= 0xFFF0 && code <= 0xFFFF) { // Specials unicode block. - return 0; - } else if (code >= 0xF600 && code <= 0xF8FF) { - return (SpecialPUASymbols[code] || code); - } - return code; -} - -var UnicodeRanges = [ - { 'begin': 0x0000, 'end': 0x007F }, // Basic Latin - { 'begin': 0x0080, 'end': 0x00FF }, // Latin-1 Supplement - { 'begin': 0x0100, 'end': 0x017F }, // Latin Extended-A - { 'begin': 0x0180, 'end': 0x024F }, // Latin Extended-B - { 'begin': 0x0250, 'end': 0x02AF }, // IPA Extensions - { 'begin': 0x02B0, 'end': 0x02FF }, // Spacing Modifier Letters - { 'begin': 0x0300, 'end': 0x036F }, // Combining Diacritical Marks - { 'begin': 0x0370, 'end': 0x03FF }, // Greek and Coptic - { 'begin': 0x2C80, 'end': 0x2CFF }, // Coptic - { 'begin': 0x0400, 'end': 0x04FF }, // Cyrillic - { 'begin': 0x0530, 'end': 0x058F }, // Armenian - { 'begin': 0x0590, 'end': 0x05FF }, // Hebrew - { 'begin': 0xA500, 'end': 0xA63F }, // Vai - { 'begin': 0x0600, 'end': 0x06FF }, // Arabic - { 'begin': 0x07C0, 'end': 0x07FF }, // NKo - { 'begin': 0x0900, 'end': 0x097F }, // Devanagari - { 'begin': 0x0980, 'end': 0x09FF }, // Bengali - { 'begin': 0x0A00, 'end': 0x0A7F }, // Gurmukhi - { 'begin': 0x0A80, 'end': 0x0AFF }, // Gujarati - { 'begin': 0x0B00, 'end': 0x0B7F }, // Oriya - { 'begin': 0x0B80, 'end': 0x0BFF }, // Tamil - { 'begin': 0x0C00, 'end': 0x0C7F }, // Telugu - { 'begin': 0x0C80, 'end': 0x0CFF }, // Kannada - { 'begin': 0x0D00, 'end': 0x0D7F }, // Malayalam - { 'begin': 0x0E00, 'end': 0x0E7F }, // Thai - { 'begin': 0x0E80, 'end': 0x0EFF }, // Lao - { 'begin': 0x10A0, 'end': 0x10FF }, // Georgian - { 'begin': 0x1B00, 'end': 0x1B7F }, // Balinese - { 'begin': 0x1100, 'end': 0x11FF }, // Hangul Jamo - { 'begin': 0x1E00, 'end': 0x1EFF }, // Latin Extended Additional - { 'begin': 0x1F00, 'end': 0x1FFF }, // Greek Extended - { 'begin': 0x2000, 'end': 0x206F }, // General Punctuation - { 'begin': 0x2070, 'end': 0x209F }, // Superscripts And Subscripts - { 'begin': 0x20A0, 'end': 0x20CF }, // Currency Symbol - { 'begin': 0x20D0, 'end': 0x20FF }, // Combining Diacritical Marks For Symbols - { 'begin': 0x2100, 'end': 0x214F }, // Letterlike Symbols - { 'begin': 0x2150, 'end': 0x218F }, // Number Forms - { 'begin': 0x2190, 'end': 0x21FF }, // Arrows - { 'begin': 0x2200, 'end': 0x22FF }, // Mathematical Operators - { 'begin': 0x2300, 'end': 0x23FF }, // Miscellaneous Technical - { 'begin': 0x2400, 'end': 0x243F }, // Control Pictures - { 'begin': 0x2440, 'end': 0x245F }, // Optical Character Recognition - { 'begin': 0x2460, 'end': 0x24FF }, // Enclosed Alphanumerics - { 'begin': 0x2500, 'end': 0x257F }, // Box Drawing - { 'begin': 0x2580, 'end': 0x259F }, // Block Elements - { 'begin': 0x25A0, 'end': 0x25FF }, // Geometric Shapes - { 'begin': 0x2600, 'end': 0x26FF }, // Miscellaneous Symbols - { 'begin': 0x2700, 'end': 0x27BF }, // Dingbats - { 'begin': 0x3000, 'end': 0x303F }, // CJK Symbols And Punctuation - { 'begin': 0x3040, 'end': 0x309F }, // Hiragana - { 'begin': 0x30A0, 'end': 0x30FF }, // Katakana - { 'begin': 0x3100, 'end': 0x312F }, // Bopomofo - { 'begin': 0x3130, 'end': 0x318F }, // Hangul Compatibility Jamo - { 'begin': 0xA840, 'end': 0xA87F }, // Phags-pa - { 'begin': 0x3200, 'end': 0x32FF }, // Enclosed CJK Letters And Months - { 'begin': 0x3300, 'end': 0x33FF }, // CJK Compatibility - { 'begin': 0xAC00, 'end': 0xD7AF }, // Hangul Syllables - { 'begin': 0xD800, 'end': 0xDFFF }, // Non-Plane 0 * - { 'begin': 0x10900, 'end': 0x1091F }, // Phoenicia - { 'begin': 0x4E00, 'end': 0x9FFF }, // CJK Unified Ideographs - { 'begin': 0xE000, 'end': 0xF8FF }, // Private Use Area (plane 0) - { 'begin': 0x31C0, 'end': 0x31EF }, // CJK Strokes - { 'begin': 0xFB00, 'end': 0xFB4F }, // Alphabetic Presentation Forms - { 'begin': 0xFB50, 'end': 0xFDFF }, // Arabic Presentation Forms-A - { 'begin': 0xFE20, 'end': 0xFE2F }, // Combining Half Marks - { 'begin': 0xFE10, 'end': 0xFE1F }, // Vertical Forms - { 'begin': 0xFE50, 'end': 0xFE6F }, // Small Form Variants - { 'begin': 0xFE70, 'end': 0xFEFF }, // Arabic Presentation Forms-B - { 'begin': 0xFF00, 'end': 0xFFEF }, // Halfwidth And Fullwidth Forms - { 'begin': 0xFFF0, 'end': 0xFFFF }, // Specials - { 'begin': 0x0F00, 'end': 0x0FFF }, // Tibetan - { 'begin': 0x0700, 'end': 0x074F }, // Syriac - { 'begin': 0x0780, 'end': 0x07BF }, // Thaana - { 'begin': 0x0D80, 'end': 0x0DFF }, // Sinhala - { 'begin': 0x1000, 'end': 0x109F }, // Myanmar - { 'begin': 0x1200, 'end': 0x137F }, // Ethiopic - { 'begin': 0x13A0, 'end': 0x13FF }, // Cherokee - { 'begin': 0x1400, 'end': 0x167F }, // Unified Canadian Aboriginal Syllabics - { 'begin': 0x1680, 'end': 0x169F }, // Ogham - { 'begin': 0x16A0, 'end': 0x16FF }, // Runic - { 'begin': 0x1780, 'end': 0x17FF }, // Khmer - { 'begin': 0x1800, 'end': 0x18AF }, // Mongolian - { 'begin': 0x2800, 'end': 0x28FF }, // Braille Patterns - { 'begin': 0xA000, 'end': 0xA48F }, // Yi Syllables - { 'begin': 0x1700, 'end': 0x171F }, // Tagalog - { 'begin': 0x10300, 'end': 0x1032F }, // Old Italic - { 'begin': 0x10330, 'end': 0x1034F }, // Gothic - { 'begin': 0x10400, 'end': 0x1044F }, // Deseret - { 'begin': 0x1D000, 'end': 0x1D0FF }, // Byzantine Musical Symbols - { 'begin': 0x1D400, 'end': 0x1D7FF }, // Mathematical Alphanumeric Symbols - { 'begin': 0xFF000, 'end': 0xFFFFD }, // Private Use (plane 15) - { 'begin': 0xFE00, 'end': 0xFE0F }, // Variation Selectors - { 'begin': 0xE0000, 'end': 0xE007F }, // Tags - { 'begin': 0x1900, 'end': 0x194F }, // Limbu - { 'begin': 0x1950, 'end': 0x197F }, // Tai Le - { 'begin': 0x1980, 'end': 0x19DF }, // New Tai Lue - { 'begin': 0x1A00, 'end': 0x1A1F }, // Buginese - { 'begin': 0x2C00, 'end': 0x2C5F }, // Glagolitic - { 'begin': 0x2D30, 'end': 0x2D7F }, // Tifinagh - { 'begin': 0x4DC0, 'end': 0x4DFF }, // Yijing Hexagram Symbols - { 'begin': 0xA800, 'end': 0xA82F }, // Syloti Nagri - { 'begin': 0x10000, 'end': 0x1007F }, // Linear B Syllabary - { 'begin': 0x10140, 'end': 0x1018F }, // Ancient Greek Numbers - { 'begin': 0x10380, 'end': 0x1039F }, // Ugaritic - { 'begin': 0x103A0, 'end': 0x103DF }, // Old Persian - { 'begin': 0x10450, 'end': 0x1047F }, // Shavian - { 'begin': 0x10480, 'end': 0x104AF }, // Osmanya - { 'begin': 0x10800, 'end': 0x1083F }, // Cypriot Syllabary - { 'begin': 0x10A00, 'end': 0x10A5F }, // Kharoshthi - { 'begin': 0x1D300, 'end': 0x1D35F }, // Tai Xuan Jing Symbols - { 'begin': 0x12000, 'end': 0x123FF }, // Cuneiform - { 'begin': 0x1D360, 'end': 0x1D37F }, // Counting Rod Numerals - { 'begin': 0x1B80, 'end': 0x1BBF }, // Sundanese - { 'begin': 0x1C00, 'end': 0x1C4F }, // Lepcha - { 'begin': 0x1C50, 'end': 0x1C7F }, // Ol Chiki - { 'begin': 0xA880, 'end': 0xA8DF }, // Saurashtra - { 'begin': 0xA900, 'end': 0xA92F }, // Kayah Li - { 'begin': 0xA930, 'end': 0xA95F }, // Rejang - { 'begin': 0xAA00, 'end': 0xAA5F }, // Cham - { 'begin': 0x10190, 'end': 0x101CF }, // Ancient Symbols - { 'begin': 0x101D0, 'end': 0x101FF }, // Phaistos Disc - { 'begin': 0x102A0, 'end': 0x102DF }, // Carian - { 'begin': 0x1F030, 'end': 0x1F09F } // Domino Tiles -]; - -var MacStandardGlyphOrdering = [ - '.notdef', '.null', 'nonmarkingreturn', 'space', 'exclam', 'quotedbl', - 'numbersign', 'dollar', 'percent', 'ampersand', 'quotesingle', 'parenleft', - 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', - 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', - 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', 'at', - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', - 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', - 'backslash', 'bracketright', 'asciicircum', 'underscore', 'grave', 'a', 'b', - 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', - 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', - 'asciitilde', 'Adieresis', 'Aring', 'Ccedilla', 'Eacute', 'Ntilde', - 'Odieresis', 'Udieresis', 'aacute', 'agrave', 'acircumflex', 'adieresis', - 'atilde', 'aring', 'ccedilla', 'eacute', 'egrave', 'ecircumflex', 'edieresis', - 'iacute', 'igrave', 'icircumflex', 'idieresis', 'ntilde', 'oacute', 'ograve', - 'ocircumflex', 'odieresis', 'otilde', 'uacute', 'ugrave', 'ucircumflex', - 'udieresis', 'dagger', 'degree', 'cent', 'sterling', 'section', 'bullet', - 'paragraph', 'germandbls', 'registered', 'copyright', 'trademark', 'acute', - 'dieresis', 'notequal', 'AE', 'Oslash', 'infinity', 'plusminus', 'lessequal', - 'greaterequal', 'yen', 'mu', 'partialdiff', 'summation', 'product', 'pi', - 'integral', 'ordfeminine', 'ordmasculine', 'Omega', 'ae', 'oslash', - 'questiondown', 'exclamdown', 'logicalnot', 'radical', 'florin', - 'approxequal', 'Delta', 'guillemotleft', 'guillemotright', 'ellipsis', - 'nonbreakingspace', 'Agrave', 'Atilde', 'Otilde', 'OE', 'oe', 'endash', - 'emdash', 'quotedblleft', 'quotedblright', 'quoteleft', 'quoteright', - 'divide', 'lozenge', 'ydieresis', 'Ydieresis', 'fraction', 'currency', - 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'daggerdbl', 'periodcentered', - 'quotesinglbase', 'quotedblbase', 'perthousand', 'Acircumflex', - 'Ecircumflex', 'Aacute', 'Edieresis', 'Egrave', 'Iacute', 'Icircumflex', - 'Idieresis', 'Igrave', 'Oacute', 'Ocircumflex', 'apple', 'Ograve', 'Uacute', - 'Ucircumflex', 'Ugrave', 'dotlessi', 'circumflex', 'tilde', 'macron', - 'breve', 'dotaccent', 'ring', 'cedilla', 'hungarumlaut', 'ogonek', 'caron', - 'Lslash', 'lslash', 'Scaron', 'scaron', 'Zcaron', 'zcaron', 'brokenbar', - 'Eth', 'eth', 'Yacute', 'yacute', 'Thorn', 'thorn', 'minus', 'multiply', - 'onesuperior', 'twosuperior', 'threesuperior', 'onehalf', 'onequarter', - 'threequarters', 'franc', 'Gbreve', 'gbreve', 'Idotaccent', 'Scedilla', - 'scedilla', 'Cacute', 'cacute', 'Ccaron', 'ccaron', 'dcroat']; - -function getUnicodeRangeFor(value) { - for (var i = 0, ii = UnicodeRanges.length; i < ii; i++) { - var range = UnicodeRanges[i]; - if (value >= range.begin && value < range.end) { - return i; - } - } - return -1; -} - -function isRTLRangeFor(value) { - var range = UnicodeRanges[13]; - if (value >= range.begin && value < range.end) { - return true; - } - range = UnicodeRanges[11]; - if (value >= range.begin && value < range.end) { - return true; - } - return false; -} - -// The normalization table is obtained by filtering the Unicode characters -// database with entries. -var NormalizedUnicodes = { - '\u00A8': '\u0020\u0308', - '\u00AF': '\u0020\u0304', - '\u00B4': '\u0020\u0301', - '\u00B5': '\u03BC', - '\u00B8': '\u0020\u0327', - '\u0132': '\u0049\u004A', - '\u0133': '\u0069\u006A', - '\u013F': '\u004C\u00B7', - '\u0140': '\u006C\u00B7', - '\u0149': '\u02BC\u006E', - '\u017F': '\u0073', - '\u01C4': '\u0044\u017D', - '\u01C5': '\u0044\u017E', - '\u01C6': '\u0064\u017E', - '\u01C7': '\u004C\u004A', - '\u01C8': '\u004C\u006A', - '\u01C9': '\u006C\u006A', - '\u01CA': '\u004E\u004A', - '\u01CB': '\u004E\u006A', - '\u01CC': '\u006E\u006A', - '\u01F1': '\u0044\u005A', - '\u01F2': '\u0044\u007A', - '\u01F3': '\u0064\u007A', - '\u02D8': '\u0020\u0306', - '\u02D9': '\u0020\u0307', - '\u02DA': '\u0020\u030A', - '\u02DB': '\u0020\u0328', - '\u02DC': '\u0020\u0303', - '\u02DD': '\u0020\u030B', - '\u037A': '\u0020\u0345', - '\u0384': '\u0020\u0301', - '\u03D0': '\u03B2', - '\u03D1': '\u03B8', - '\u03D2': '\u03A5', - '\u03D5': '\u03C6', - '\u03D6': '\u03C0', - '\u03F0': '\u03BA', - '\u03F1': '\u03C1', - '\u03F2': '\u03C2', - '\u03F4': '\u0398', - '\u03F5': '\u03B5', - '\u03F9': '\u03A3', - '\u0587': '\u0565\u0582', - '\u0675': '\u0627\u0674', - '\u0676': '\u0648\u0674', - '\u0677': '\u06C7\u0674', - '\u0678': '\u064A\u0674', - '\u0E33': '\u0E4D\u0E32', - '\u0EB3': '\u0ECD\u0EB2', - '\u0EDC': '\u0EAB\u0E99', - '\u0EDD': '\u0EAB\u0EA1', - '\u0F77': '\u0FB2\u0F81', - '\u0F79': '\u0FB3\u0F81', - '\u1E9A': '\u0061\u02BE', - '\u1FBD': '\u0020\u0313', - '\u1FBF': '\u0020\u0313', - '\u1FC0': '\u0020\u0342', - '\u1FFE': '\u0020\u0314', - '\u2002': '\u0020', - '\u2003': '\u0020', - '\u2004': '\u0020', - '\u2005': '\u0020', - '\u2006': '\u0020', - '\u2008': '\u0020', - '\u2009': '\u0020', - '\u200A': '\u0020', - '\u2017': '\u0020\u0333', - '\u2024': '\u002E', - '\u2025': '\u002E\u002E', - '\u2026': '\u002E\u002E\u002E', - '\u2033': '\u2032\u2032', - '\u2034': '\u2032\u2032\u2032', - '\u2036': '\u2035\u2035', - '\u2037': '\u2035\u2035\u2035', - '\u203C': '\u0021\u0021', - '\u203E': '\u0020\u0305', - '\u2047': '\u003F\u003F', - '\u2048': '\u003F\u0021', - '\u2049': '\u0021\u003F', - '\u2057': '\u2032\u2032\u2032\u2032', - '\u205F': '\u0020', - '\u20A8': '\u0052\u0073', - '\u2100': '\u0061\u002F\u0063', - '\u2101': '\u0061\u002F\u0073', - '\u2103': '\u00B0\u0043', - '\u2105': '\u0063\u002F\u006F', - '\u2106': '\u0063\u002F\u0075', - '\u2107': '\u0190', - '\u2109': '\u00B0\u0046', - '\u2116': '\u004E\u006F', - '\u2121': '\u0054\u0045\u004C', - '\u2135': '\u05D0', - '\u2136': '\u05D1', - '\u2137': '\u05D2', - '\u2138': '\u05D3', - '\u213B': '\u0046\u0041\u0058', - '\u2160': '\u0049', - '\u2161': '\u0049\u0049', - '\u2162': '\u0049\u0049\u0049', - '\u2163': '\u0049\u0056', - '\u2164': '\u0056', - '\u2165': '\u0056\u0049', - '\u2166': '\u0056\u0049\u0049', - '\u2167': '\u0056\u0049\u0049\u0049', - '\u2168': '\u0049\u0058', - '\u2169': '\u0058', - '\u216A': '\u0058\u0049', - '\u216B': '\u0058\u0049\u0049', - '\u216C': '\u004C', - '\u216D': '\u0043', - '\u216E': '\u0044', - '\u216F': '\u004D', - '\u2170': '\u0069', - '\u2171': '\u0069\u0069', - '\u2172': '\u0069\u0069\u0069', - '\u2173': '\u0069\u0076', - '\u2174': '\u0076', - '\u2175': '\u0076\u0069', - '\u2176': '\u0076\u0069\u0069', - '\u2177': '\u0076\u0069\u0069\u0069', - '\u2178': '\u0069\u0078', - '\u2179': '\u0078', - '\u217A': '\u0078\u0069', - '\u217B': '\u0078\u0069\u0069', - '\u217C': '\u006C', - '\u217D': '\u0063', - '\u217E': '\u0064', - '\u217F': '\u006D', - '\u222C': '\u222B\u222B', - '\u222D': '\u222B\u222B\u222B', - '\u222F': '\u222E\u222E', - '\u2230': '\u222E\u222E\u222E', - '\u2474': '\u0028\u0031\u0029', - '\u2475': '\u0028\u0032\u0029', - '\u2476': '\u0028\u0033\u0029', - '\u2477': '\u0028\u0034\u0029', - '\u2478': '\u0028\u0035\u0029', - '\u2479': '\u0028\u0036\u0029', - '\u247A': '\u0028\u0037\u0029', - '\u247B': '\u0028\u0038\u0029', - '\u247C': '\u0028\u0039\u0029', - '\u247D': '\u0028\u0031\u0030\u0029', - '\u247E': '\u0028\u0031\u0031\u0029', - '\u247F': '\u0028\u0031\u0032\u0029', - '\u2480': '\u0028\u0031\u0033\u0029', - '\u2481': '\u0028\u0031\u0034\u0029', - '\u2482': '\u0028\u0031\u0035\u0029', - '\u2483': '\u0028\u0031\u0036\u0029', - '\u2484': '\u0028\u0031\u0037\u0029', - '\u2485': '\u0028\u0031\u0038\u0029', - '\u2486': '\u0028\u0031\u0039\u0029', - '\u2487': '\u0028\u0032\u0030\u0029', - '\u2488': '\u0031\u002E', - '\u2489': '\u0032\u002E', - '\u248A': '\u0033\u002E', - '\u248B': '\u0034\u002E', - '\u248C': '\u0035\u002E', - '\u248D': '\u0036\u002E', - '\u248E': '\u0037\u002E', - '\u248F': '\u0038\u002E', - '\u2490': '\u0039\u002E', - '\u2491': '\u0031\u0030\u002E', - '\u2492': '\u0031\u0031\u002E', - '\u2493': '\u0031\u0032\u002E', - '\u2494': '\u0031\u0033\u002E', - '\u2495': '\u0031\u0034\u002E', - '\u2496': '\u0031\u0035\u002E', - '\u2497': '\u0031\u0036\u002E', - '\u2498': '\u0031\u0037\u002E', - '\u2499': '\u0031\u0038\u002E', - '\u249A': '\u0031\u0039\u002E', - '\u249B': '\u0032\u0030\u002E', - '\u249C': '\u0028\u0061\u0029', - '\u249D': '\u0028\u0062\u0029', - '\u249E': '\u0028\u0063\u0029', - '\u249F': '\u0028\u0064\u0029', - '\u24A0': '\u0028\u0065\u0029', - '\u24A1': '\u0028\u0066\u0029', - '\u24A2': '\u0028\u0067\u0029', - '\u24A3': '\u0028\u0068\u0029', - '\u24A4': '\u0028\u0069\u0029', - '\u24A5': '\u0028\u006A\u0029', - '\u24A6': '\u0028\u006B\u0029', - '\u24A7': '\u0028\u006C\u0029', - '\u24A8': '\u0028\u006D\u0029', - '\u24A9': '\u0028\u006E\u0029', - '\u24AA': '\u0028\u006F\u0029', - '\u24AB': '\u0028\u0070\u0029', - '\u24AC': '\u0028\u0071\u0029', - '\u24AD': '\u0028\u0072\u0029', - '\u24AE': '\u0028\u0073\u0029', - '\u24AF': '\u0028\u0074\u0029', - '\u24B0': '\u0028\u0075\u0029', - '\u24B1': '\u0028\u0076\u0029', - '\u24B2': '\u0028\u0077\u0029', - '\u24B3': '\u0028\u0078\u0029', - '\u24B4': '\u0028\u0079\u0029', - '\u24B5': '\u0028\u007A\u0029', - '\u2A0C': '\u222B\u222B\u222B\u222B', - '\u2A74': '\u003A\u003A\u003D', - '\u2A75': '\u003D\u003D', - '\u2A76': '\u003D\u003D\u003D', - '\u2E9F': '\u6BCD', - '\u2EF3': '\u9F9F', - '\u2F00': '\u4E00', - '\u2F01': '\u4E28', - '\u2F02': '\u4E36', - '\u2F03': '\u4E3F', - '\u2F04': '\u4E59', - '\u2F05': '\u4E85', - '\u2F06': '\u4E8C', - '\u2F07': '\u4EA0', - '\u2F08': '\u4EBA', - '\u2F09': '\u513F', - '\u2F0A': '\u5165', - '\u2F0B': '\u516B', - '\u2F0C': '\u5182', - '\u2F0D': '\u5196', - '\u2F0E': '\u51AB', - '\u2F0F': '\u51E0', - '\u2F10': '\u51F5', - '\u2F11': '\u5200', - '\u2F12': '\u529B', - '\u2F13': '\u52F9', - '\u2F14': '\u5315', - '\u2F15': '\u531A', - '\u2F16': '\u5338', - '\u2F17': '\u5341', - '\u2F18': '\u535C', - '\u2F19': '\u5369', - '\u2F1A': '\u5382', - '\u2F1B': '\u53B6', - '\u2F1C': '\u53C8', - '\u2F1D': '\u53E3', - '\u2F1E': '\u56D7', - '\u2F1F': '\u571F', - '\u2F20': '\u58EB', - '\u2F21': '\u5902', - '\u2F22': '\u590A', - '\u2F23': '\u5915', - '\u2F24': '\u5927', - '\u2F25': '\u5973', - '\u2F26': '\u5B50', - '\u2F27': '\u5B80', - '\u2F28': '\u5BF8', - '\u2F29': '\u5C0F', - '\u2F2A': '\u5C22', - '\u2F2B': '\u5C38', - '\u2F2C': '\u5C6E', - '\u2F2D': '\u5C71', - '\u2F2E': '\u5DDB', - '\u2F2F': '\u5DE5', - '\u2F30': '\u5DF1', - '\u2F31': '\u5DFE', - '\u2F32': '\u5E72', - '\u2F33': '\u5E7A', - '\u2F34': '\u5E7F', - '\u2F35': '\u5EF4', - '\u2F36': '\u5EFE', - '\u2F37': '\u5F0B', - '\u2F38': '\u5F13', - '\u2F39': '\u5F50', - '\u2F3A': '\u5F61', - '\u2F3B': '\u5F73', - '\u2F3C': '\u5FC3', - '\u2F3D': '\u6208', - '\u2F3E': '\u6236', - '\u2F3F': '\u624B', - '\u2F40': '\u652F', - '\u2F41': '\u6534', - '\u2F42': '\u6587', - '\u2F43': '\u6597', - '\u2F44': '\u65A4', - '\u2F45': '\u65B9', - '\u2F46': '\u65E0', - '\u2F47': '\u65E5', - '\u2F48': '\u66F0', - '\u2F49': '\u6708', - '\u2F4A': '\u6728', - '\u2F4B': '\u6B20', - '\u2F4C': '\u6B62', - '\u2F4D': '\u6B79', - '\u2F4E': '\u6BB3', - '\u2F4F': '\u6BCB', - '\u2F50': '\u6BD4', - '\u2F51': '\u6BDB', - '\u2F52': '\u6C0F', - '\u2F53': '\u6C14', - '\u2F54': '\u6C34', - '\u2F55': '\u706B', - '\u2F56': '\u722A', - '\u2F57': '\u7236', - '\u2F58': '\u723B', - '\u2F59': '\u723F', - '\u2F5A': '\u7247', - '\u2F5B': '\u7259', - '\u2F5C': '\u725B', - '\u2F5D': '\u72AC', - '\u2F5E': '\u7384', - '\u2F5F': '\u7389', - '\u2F60': '\u74DC', - '\u2F61': '\u74E6', - '\u2F62': '\u7518', - '\u2F63': '\u751F', - '\u2F64': '\u7528', - '\u2F65': '\u7530', - '\u2F66': '\u758B', - '\u2F67': '\u7592', - '\u2F68': '\u7676', - '\u2F69': '\u767D', - '\u2F6A': '\u76AE', - '\u2F6B': '\u76BF', - '\u2F6C': '\u76EE', - '\u2F6D': '\u77DB', - '\u2F6E': '\u77E2', - '\u2F6F': '\u77F3', - '\u2F70': '\u793A', - '\u2F71': '\u79B8', - '\u2F72': '\u79BE', - '\u2F73': '\u7A74', - '\u2F74': '\u7ACB', - '\u2F75': '\u7AF9', - '\u2F76': '\u7C73', - '\u2F77': '\u7CF8', - '\u2F78': '\u7F36', - '\u2F79': '\u7F51', - '\u2F7A': '\u7F8A', - '\u2F7B': '\u7FBD', - '\u2F7C': '\u8001', - '\u2F7D': '\u800C', - '\u2F7E': '\u8012', - '\u2F7F': '\u8033', - '\u2F80': '\u807F', - '\u2F81': '\u8089', - '\u2F82': '\u81E3', - '\u2F83': '\u81EA', - '\u2F84': '\u81F3', - '\u2F85': '\u81FC', - '\u2F86': '\u820C', - '\u2F87': '\u821B', - '\u2F88': '\u821F', - '\u2F89': '\u826E', - '\u2F8A': '\u8272', - '\u2F8B': '\u8278', - '\u2F8C': '\u864D', - '\u2F8D': '\u866B', - '\u2F8E': '\u8840', - '\u2F8F': '\u884C', - '\u2F90': '\u8863', - '\u2F91': '\u897E', - '\u2F92': '\u898B', - '\u2F93': '\u89D2', - '\u2F94': '\u8A00', - '\u2F95': '\u8C37', - '\u2F96': '\u8C46', - '\u2F97': '\u8C55', - '\u2F98': '\u8C78', - '\u2F99': '\u8C9D', - '\u2F9A': '\u8D64', - '\u2F9B': '\u8D70', - '\u2F9C': '\u8DB3', - '\u2F9D': '\u8EAB', - '\u2F9E': '\u8ECA', - '\u2F9F': '\u8F9B', - '\u2FA0': '\u8FB0', - '\u2FA1': '\u8FB5', - '\u2FA2': '\u9091', - '\u2FA3': '\u9149', - '\u2FA4': '\u91C6', - '\u2FA5': '\u91CC', - '\u2FA6': '\u91D1', - '\u2FA7': '\u9577', - '\u2FA8': '\u9580', - '\u2FA9': '\u961C', - '\u2FAA': '\u96B6', - '\u2FAB': '\u96B9', - '\u2FAC': '\u96E8', - '\u2FAD': '\u9751', - '\u2FAE': '\u975E', - '\u2FAF': '\u9762', - '\u2FB0': '\u9769', - '\u2FB1': '\u97CB', - '\u2FB2': '\u97ED', - '\u2FB3': '\u97F3', - '\u2FB4': '\u9801', - '\u2FB5': '\u98A8', - '\u2FB6': '\u98DB', - '\u2FB7': '\u98DF', - '\u2FB8': '\u9996', - '\u2FB9': '\u9999', - '\u2FBA': '\u99AC', - '\u2FBB': '\u9AA8', - '\u2FBC': '\u9AD8', - '\u2FBD': '\u9ADF', - '\u2FBE': '\u9B25', - '\u2FBF': '\u9B2F', - '\u2FC0': '\u9B32', - '\u2FC1': '\u9B3C', - '\u2FC2': '\u9B5A', - '\u2FC3': '\u9CE5', - '\u2FC4': '\u9E75', - '\u2FC5': '\u9E7F', - '\u2FC6': '\u9EA5', - '\u2FC7': '\u9EBB', - '\u2FC8': '\u9EC3', - '\u2FC9': '\u9ECD', - '\u2FCA': '\u9ED1', - '\u2FCB': '\u9EF9', - '\u2FCC': '\u9EFD', - '\u2FCD': '\u9F0E', - '\u2FCE': '\u9F13', - '\u2FCF': '\u9F20', - '\u2FD0': '\u9F3B', - '\u2FD1': '\u9F4A', - '\u2FD2': '\u9F52', - '\u2FD3': '\u9F8D', - '\u2FD4': '\u9F9C', - '\u2FD5': '\u9FA0', - '\u3036': '\u3012', - '\u3038': '\u5341', - '\u3039': '\u5344', - '\u303A': '\u5345', - '\u309B': '\u0020\u3099', - '\u309C': '\u0020\u309A', - '\u3131': '\u1100', - '\u3132': '\u1101', - '\u3133': '\u11AA', - '\u3134': '\u1102', - '\u3135': '\u11AC', - '\u3136': '\u11AD', - '\u3137': '\u1103', - '\u3138': '\u1104', - '\u3139': '\u1105', - '\u313A': '\u11B0', - '\u313B': '\u11B1', - '\u313C': '\u11B2', - '\u313D': '\u11B3', - '\u313E': '\u11B4', - '\u313F': '\u11B5', - '\u3140': '\u111A', - '\u3141': '\u1106', - '\u3142': '\u1107', - '\u3143': '\u1108', - '\u3144': '\u1121', - '\u3145': '\u1109', - '\u3146': '\u110A', - '\u3147': '\u110B', - '\u3148': '\u110C', - '\u3149': '\u110D', - '\u314A': '\u110E', - '\u314B': '\u110F', - '\u314C': '\u1110', - '\u314D': '\u1111', - '\u314E': '\u1112', - '\u314F': '\u1161', - '\u3150': '\u1162', - '\u3151': '\u1163', - '\u3152': '\u1164', - '\u3153': '\u1165', - '\u3154': '\u1166', - '\u3155': '\u1167', - '\u3156': '\u1168', - '\u3157': '\u1169', - '\u3158': '\u116A', - '\u3159': '\u116B', - '\u315A': '\u116C', - '\u315B': '\u116D', - '\u315C': '\u116E', - '\u315D': '\u116F', - '\u315E': '\u1170', - '\u315F': '\u1171', - '\u3160': '\u1172', - '\u3161': '\u1173', - '\u3162': '\u1174', - '\u3163': '\u1175', - '\u3164': '\u1160', - '\u3165': '\u1114', - '\u3166': '\u1115', - '\u3167': '\u11C7', - '\u3168': '\u11C8', - '\u3169': '\u11CC', - '\u316A': '\u11CE', - '\u316B': '\u11D3', - '\u316C': '\u11D7', - '\u316D': '\u11D9', - '\u316E': '\u111C', - '\u316F': '\u11DD', - '\u3170': '\u11DF', - '\u3171': '\u111D', - '\u3172': '\u111E', - '\u3173': '\u1120', - '\u3174': '\u1122', - '\u3175': '\u1123', - '\u3176': '\u1127', - '\u3177': '\u1129', - '\u3178': '\u112B', - '\u3179': '\u112C', - '\u317A': '\u112D', - '\u317B': '\u112E', - '\u317C': '\u112F', - '\u317D': '\u1132', - '\u317E': '\u1136', - '\u317F': '\u1140', - '\u3180': '\u1147', - '\u3181': '\u114C', - '\u3182': '\u11F1', - '\u3183': '\u11F2', - '\u3184': '\u1157', - '\u3185': '\u1158', - '\u3186': '\u1159', - '\u3187': '\u1184', - '\u3188': '\u1185', - '\u3189': '\u1188', - '\u318A': '\u1191', - '\u318B': '\u1192', - '\u318C': '\u1194', - '\u318D': '\u119E', - '\u318E': '\u11A1', - '\u3200': '\u0028\u1100\u0029', - '\u3201': '\u0028\u1102\u0029', - '\u3202': '\u0028\u1103\u0029', - '\u3203': '\u0028\u1105\u0029', - '\u3204': '\u0028\u1106\u0029', - '\u3205': '\u0028\u1107\u0029', - '\u3206': '\u0028\u1109\u0029', - '\u3207': '\u0028\u110B\u0029', - '\u3208': '\u0028\u110C\u0029', - '\u3209': '\u0028\u110E\u0029', - '\u320A': '\u0028\u110F\u0029', - '\u320B': '\u0028\u1110\u0029', - '\u320C': '\u0028\u1111\u0029', - '\u320D': '\u0028\u1112\u0029', - '\u320E': '\u0028\u1100\u1161\u0029', - '\u320F': '\u0028\u1102\u1161\u0029', - '\u3210': '\u0028\u1103\u1161\u0029', - '\u3211': '\u0028\u1105\u1161\u0029', - '\u3212': '\u0028\u1106\u1161\u0029', - '\u3213': '\u0028\u1107\u1161\u0029', - '\u3214': '\u0028\u1109\u1161\u0029', - '\u3215': '\u0028\u110B\u1161\u0029', - '\u3216': '\u0028\u110C\u1161\u0029', - '\u3217': '\u0028\u110E\u1161\u0029', - '\u3218': '\u0028\u110F\u1161\u0029', - '\u3219': '\u0028\u1110\u1161\u0029', - '\u321A': '\u0028\u1111\u1161\u0029', - '\u321B': '\u0028\u1112\u1161\u0029', - '\u321C': '\u0028\u110C\u116E\u0029', - '\u321D': '\u0028\u110B\u1169\u110C\u1165\u11AB\u0029', - '\u321E': '\u0028\u110B\u1169\u1112\u116E\u0029', - '\u3220': '\u0028\u4E00\u0029', - '\u3221': '\u0028\u4E8C\u0029', - '\u3222': '\u0028\u4E09\u0029', - '\u3223': '\u0028\u56DB\u0029', - '\u3224': '\u0028\u4E94\u0029', - '\u3225': '\u0028\u516D\u0029', - '\u3226': '\u0028\u4E03\u0029', - '\u3227': '\u0028\u516B\u0029', - '\u3228': '\u0028\u4E5D\u0029', - '\u3229': '\u0028\u5341\u0029', - '\u322A': '\u0028\u6708\u0029', - '\u322B': '\u0028\u706B\u0029', - '\u322C': '\u0028\u6C34\u0029', - '\u322D': '\u0028\u6728\u0029', - '\u322E': '\u0028\u91D1\u0029', - '\u322F': '\u0028\u571F\u0029', - '\u3230': '\u0028\u65E5\u0029', - '\u3231': '\u0028\u682A\u0029', - '\u3232': '\u0028\u6709\u0029', - '\u3233': '\u0028\u793E\u0029', - '\u3234': '\u0028\u540D\u0029', - '\u3235': '\u0028\u7279\u0029', - '\u3236': '\u0028\u8CA1\u0029', - '\u3237': '\u0028\u795D\u0029', - '\u3238': '\u0028\u52B4\u0029', - '\u3239': '\u0028\u4EE3\u0029', - '\u323A': '\u0028\u547C\u0029', - '\u323B': '\u0028\u5B66\u0029', - '\u323C': '\u0028\u76E3\u0029', - '\u323D': '\u0028\u4F01\u0029', - '\u323E': '\u0028\u8CC7\u0029', - '\u323F': '\u0028\u5354\u0029', - '\u3240': '\u0028\u796D\u0029', - '\u3241': '\u0028\u4F11\u0029', - '\u3242': '\u0028\u81EA\u0029', - '\u3243': '\u0028\u81F3\u0029', - '\u32C0': '\u0031\u6708', - '\u32C1': '\u0032\u6708', - '\u32C2': '\u0033\u6708', - '\u32C3': '\u0034\u6708', - '\u32C4': '\u0035\u6708', - '\u32C5': '\u0036\u6708', - '\u32C6': '\u0037\u6708', - '\u32C7': '\u0038\u6708', - '\u32C8': '\u0039\u6708', - '\u32C9': '\u0031\u0030\u6708', - '\u32CA': '\u0031\u0031\u6708', - '\u32CB': '\u0031\u0032\u6708', - '\u3358': '\u0030\u70B9', - '\u3359': '\u0031\u70B9', - '\u335A': '\u0032\u70B9', - '\u335B': '\u0033\u70B9', - '\u335C': '\u0034\u70B9', - '\u335D': '\u0035\u70B9', - '\u335E': '\u0036\u70B9', - '\u335F': '\u0037\u70B9', - '\u3360': '\u0038\u70B9', - '\u3361': '\u0039\u70B9', - '\u3362': '\u0031\u0030\u70B9', - '\u3363': '\u0031\u0031\u70B9', - '\u3364': '\u0031\u0032\u70B9', - '\u3365': '\u0031\u0033\u70B9', - '\u3366': '\u0031\u0034\u70B9', - '\u3367': '\u0031\u0035\u70B9', - '\u3368': '\u0031\u0036\u70B9', - '\u3369': '\u0031\u0037\u70B9', - '\u336A': '\u0031\u0038\u70B9', - '\u336B': '\u0031\u0039\u70B9', - '\u336C': '\u0032\u0030\u70B9', - '\u336D': '\u0032\u0031\u70B9', - '\u336E': '\u0032\u0032\u70B9', - '\u336F': '\u0032\u0033\u70B9', - '\u3370': '\u0032\u0034\u70B9', - '\u33E0': '\u0031\u65E5', - '\u33E1': '\u0032\u65E5', - '\u33E2': '\u0033\u65E5', - '\u33E3': '\u0034\u65E5', - '\u33E4': '\u0035\u65E5', - '\u33E5': '\u0036\u65E5', - '\u33E6': '\u0037\u65E5', - '\u33E7': '\u0038\u65E5', - '\u33E8': '\u0039\u65E5', - '\u33E9': '\u0031\u0030\u65E5', - '\u33EA': '\u0031\u0031\u65E5', - '\u33EB': '\u0031\u0032\u65E5', - '\u33EC': '\u0031\u0033\u65E5', - '\u33ED': '\u0031\u0034\u65E5', - '\u33EE': '\u0031\u0035\u65E5', - '\u33EF': '\u0031\u0036\u65E5', - '\u33F0': '\u0031\u0037\u65E5', - '\u33F1': '\u0031\u0038\u65E5', - '\u33F2': '\u0031\u0039\u65E5', - '\u33F3': '\u0032\u0030\u65E5', - '\u33F4': '\u0032\u0031\u65E5', - '\u33F5': '\u0032\u0032\u65E5', - '\u33F6': '\u0032\u0033\u65E5', - '\u33F7': '\u0032\u0034\u65E5', - '\u33F8': '\u0032\u0035\u65E5', - '\u33F9': '\u0032\u0036\u65E5', - '\u33FA': '\u0032\u0037\u65E5', - '\u33FB': '\u0032\u0038\u65E5', - '\u33FC': '\u0032\u0039\u65E5', - '\u33FD': '\u0033\u0030\u65E5', - '\u33FE': '\u0033\u0031\u65E5', - '\uFB00': '\u0066\u0066', - '\uFB01': '\u0066\u0069', - '\uFB02': '\u0066\u006C', - '\uFB03': '\u0066\u0066\u0069', - '\uFB04': '\u0066\u0066\u006C', - '\uFB05': '\u017F\u0074', - '\uFB06': '\u0073\u0074', - '\uFB13': '\u0574\u0576', - '\uFB14': '\u0574\u0565', - '\uFB15': '\u0574\u056B', - '\uFB16': '\u057E\u0576', - '\uFB17': '\u0574\u056D', - '\uFB4F': '\u05D0\u05DC', - '\uFB50': '\u0671', - '\uFB51': '\u0671', - '\uFB52': '\u067B', - '\uFB53': '\u067B', - '\uFB54': '\u067B', - '\uFB55': '\u067B', - '\uFB56': '\u067E', - '\uFB57': '\u067E', - '\uFB58': '\u067E', - '\uFB59': '\u067E', - '\uFB5A': '\u0680', - '\uFB5B': '\u0680', - '\uFB5C': '\u0680', - '\uFB5D': '\u0680', - '\uFB5E': '\u067A', - '\uFB5F': '\u067A', - '\uFB60': '\u067A', - '\uFB61': '\u067A', - '\uFB62': '\u067F', - '\uFB63': '\u067F', - '\uFB64': '\u067F', - '\uFB65': '\u067F', - '\uFB66': '\u0679', - '\uFB67': '\u0679', - '\uFB68': '\u0679', - '\uFB69': '\u0679', - '\uFB6A': '\u06A4', - '\uFB6B': '\u06A4', - '\uFB6C': '\u06A4', - '\uFB6D': '\u06A4', - '\uFB6E': '\u06A6', - '\uFB6F': '\u06A6', - '\uFB70': '\u06A6', - '\uFB71': '\u06A6', - '\uFB72': '\u0684', - '\uFB73': '\u0684', - '\uFB74': '\u0684', - '\uFB75': '\u0684', - '\uFB76': '\u0683', - '\uFB77': '\u0683', - '\uFB78': '\u0683', - '\uFB79': '\u0683', - '\uFB7A': '\u0686', - '\uFB7B': '\u0686', - '\uFB7C': '\u0686', - '\uFB7D': '\u0686', - '\uFB7E': '\u0687', - '\uFB7F': '\u0687', - '\uFB80': '\u0687', - '\uFB81': '\u0687', - '\uFB82': '\u068D', - '\uFB83': '\u068D', - '\uFB84': '\u068C', - '\uFB85': '\u068C', - '\uFB86': '\u068E', - '\uFB87': '\u068E', - '\uFB88': '\u0688', - '\uFB89': '\u0688', - '\uFB8A': '\u0698', - '\uFB8B': '\u0698', - '\uFB8C': '\u0691', - '\uFB8D': '\u0691', - '\uFB8E': '\u06A9', - '\uFB8F': '\u06A9', - '\uFB90': '\u06A9', - '\uFB91': '\u06A9', - '\uFB92': '\u06AF', - '\uFB93': '\u06AF', - '\uFB94': '\u06AF', - '\uFB95': '\u06AF', - '\uFB96': '\u06B3', - '\uFB97': '\u06B3', - '\uFB98': '\u06B3', - '\uFB99': '\u06B3', - '\uFB9A': '\u06B1', - '\uFB9B': '\u06B1', - '\uFB9C': '\u06B1', - '\uFB9D': '\u06B1', - '\uFB9E': '\u06BA', - '\uFB9F': '\u06BA', - '\uFBA0': '\u06BB', - '\uFBA1': '\u06BB', - '\uFBA2': '\u06BB', - '\uFBA3': '\u06BB', - '\uFBA4': '\u06C0', - '\uFBA5': '\u06C0', - '\uFBA6': '\u06C1', - '\uFBA7': '\u06C1', - '\uFBA8': '\u06C1', - '\uFBA9': '\u06C1', - '\uFBAA': '\u06BE', - '\uFBAB': '\u06BE', - '\uFBAC': '\u06BE', - '\uFBAD': '\u06BE', - '\uFBAE': '\u06D2', - '\uFBAF': '\u06D2', - '\uFBB0': '\u06D3', - '\uFBB1': '\u06D3', - '\uFBD3': '\u06AD', - '\uFBD4': '\u06AD', - '\uFBD5': '\u06AD', - '\uFBD6': '\u06AD', - '\uFBD7': '\u06C7', - '\uFBD8': '\u06C7', - '\uFBD9': '\u06C6', - '\uFBDA': '\u06C6', - '\uFBDB': '\u06C8', - '\uFBDC': '\u06C8', - '\uFBDD': '\u0677', - '\uFBDE': '\u06CB', - '\uFBDF': '\u06CB', - '\uFBE0': '\u06C5', - '\uFBE1': '\u06C5', - '\uFBE2': '\u06C9', - '\uFBE3': '\u06C9', - '\uFBE4': '\u06D0', - '\uFBE5': '\u06D0', - '\uFBE6': '\u06D0', - '\uFBE7': '\u06D0', - '\uFBE8': '\u0649', - '\uFBE9': '\u0649', - '\uFBEA': '\u0626\u0627', - '\uFBEB': '\u0626\u0627', - '\uFBEC': '\u0626\u06D5', - '\uFBED': '\u0626\u06D5', - '\uFBEE': '\u0626\u0648', - '\uFBEF': '\u0626\u0648', - '\uFBF0': '\u0626\u06C7', - '\uFBF1': '\u0626\u06C7', - '\uFBF2': '\u0626\u06C6', - '\uFBF3': '\u0626\u06C6', - '\uFBF4': '\u0626\u06C8', - '\uFBF5': '\u0626\u06C8', - '\uFBF6': '\u0626\u06D0', - '\uFBF7': '\u0626\u06D0', - '\uFBF8': '\u0626\u06D0', - '\uFBF9': '\u0626\u0649', - '\uFBFA': '\u0626\u0649', - '\uFBFB': '\u0626\u0649', - '\uFBFC': '\u06CC', - '\uFBFD': '\u06CC', - '\uFBFE': '\u06CC', - '\uFBFF': '\u06CC', - '\uFC00': '\u0626\u062C', - '\uFC01': '\u0626\u062D', - '\uFC02': '\u0626\u0645', - '\uFC03': '\u0626\u0649', - '\uFC04': '\u0626\u064A', - '\uFC05': '\u0628\u062C', - '\uFC06': '\u0628\u062D', - '\uFC07': '\u0628\u062E', - '\uFC08': '\u0628\u0645', - '\uFC09': '\u0628\u0649', - '\uFC0A': '\u0628\u064A', - '\uFC0B': '\u062A\u062C', - '\uFC0C': '\u062A\u062D', - '\uFC0D': '\u062A\u062E', - '\uFC0E': '\u062A\u0645', - '\uFC0F': '\u062A\u0649', - '\uFC10': '\u062A\u064A', - '\uFC11': '\u062B\u062C', - '\uFC12': '\u062B\u0645', - '\uFC13': '\u062B\u0649', - '\uFC14': '\u062B\u064A', - '\uFC15': '\u062C\u062D', - '\uFC16': '\u062C\u0645', - '\uFC17': '\u062D\u062C', - '\uFC18': '\u062D\u0645', - '\uFC19': '\u062E\u062C', - '\uFC1A': '\u062E\u062D', - '\uFC1B': '\u062E\u0645', - '\uFC1C': '\u0633\u062C', - '\uFC1D': '\u0633\u062D', - '\uFC1E': '\u0633\u062E', - '\uFC1F': '\u0633\u0645', - '\uFC20': '\u0635\u062D', - '\uFC21': '\u0635\u0645', - '\uFC22': '\u0636\u062C', - '\uFC23': '\u0636\u062D', - '\uFC24': '\u0636\u062E', - '\uFC25': '\u0636\u0645', - '\uFC26': '\u0637\u062D', - '\uFC27': '\u0637\u0645', - '\uFC28': '\u0638\u0645', - '\uFC29': '\u0639\u062C', - '\uFC2A': '\u0639\u0645', - '\uFC2B': '\u063A\u062C', - '\uFC2C': '\u063A\u0645', - '\uFC2D': '\u0641\u062C', - '\uFC2E': '\u0641\u062D', - '\uFC2F': '\u0641\u062E', - '\uFC30': '\u0641\u0645', - '\uFC31': '\u0641\u0649', - '\uFC32': '\u0641\u064A', - '\uFC33': '\u0642\u062D', - '\uFC34': '\u0642\u0645', - '\uFC35': '\u0642\u0649', - '\uFC36': '\u0642\u064A', - '\uFC37': '\u0643\u0627', - '\uFC38': '\u0643\u062C', - '\uFC39': '\u0643\u062D', - '\uFC3A': '\u0643\u062E', - '\uFC3B': '\u0643\u0644', - '\uFC3C': '\u0643\u0645', - '\uFC3D': '\u0643\u0649', - '\uFC3E': '\u0643\u064A', - '\uFC3F': '\u0644\u062C', - '\uFC40': '\u0644\u062D', - '\uFC41': '\u0644\u062E', - '\uFC42': '\u0644\u0645', - '\uFC43': '\u0644\u0649', - '\uFC44': '\u0644\u064A', - '\uFC45': '\u0645\u062C', - '\uFC46': '\u0645\u062D', - '\uFC47': '\u0645\u062E', - '\uFC48': '\u0645\u0645', - '\uFC49': '\u0645\u0649', - '\uFC4A': '\u0645\u064A', - '\uFC4B': '\u0646\u062C', - '\uFC4C': '\u0646\u062D', - '\uFC4D': '\u0646\u062E', - '\uFC4E': '\u0646\u0645', - '\uFC4F': '\u0646\u0649', - '\uFC50': '\u0646\u064A', - '\uFC51': '\u0647\u062C', - '\uFC52': '\u0647\u0645', - '\uFC53': '\u0647\u0649', - '\uFC54': '\u0647\u064A', - '\uFC55': '\u064A\u062C', - '\uFC56': '\u064A\u062D', - '\uFC57': '\u064A\u062E', - '\uFC58': '\u064A\u0645', - '\uFC59': '\u064A\u0649', - '\uFC5A': '\u064A\u064A', - '\uFC5B': '\u0630\u0670', - '\uFC5C': '\u0631\u0670', - '\uFC5D': '\u0649\u0670', - '\uFC5E': '\u0020\u064C\u0651', - '\uFC5F': '\u0020\u064D\u0651', - '\uFC60': '\u0020\u064E\u0651', - '\uFC61': '\u0020\u064F\u0651', - '\uFC62': '\u0020\u0650\u0651', - '\uFC63': '\u0020\u0651\u0670', - '\uFC64': '\u0626\u0631', - '\uFC65': '\u0626\u0632', - '\uFC66': '\u0626\u0645', - '\uFC67': '\u0626\u0646', - '\uFC68': '\u0626\u0649', - '\uFC69': '\u0626\u064A', - '\uFC6A': '\u0628\u0631', - '\uFC6B': '\u0628\u0632', - '\uFC6C': '\u0628\u0645', - '\uFC6D': '\u0628\u0646', - '\uFC6E': '\u0628\u0649', - '\uFC6F': '\u0628\u064A', - '\uFC70': '\u062A\u0631', - '\uFC71': '\u062A\u0632', - '\uFC72': '\u062A\u0645', - '\uFC73': '\u062A\u0646', - '\uFC74': '\u062A\u0649', - '\uFC75': '\u062A\u064A', - '\uFC76': '\u062B\u0631', - '\uFC77': '\u062B\u0632', - '\uFC78': '\u062B\u0645', - '\uFC79': '\u062B\u0646', - '\uFC7A': '\u062B\u0649', - '\uFC7B': '\u062B\u064A', - '\uFC7C': '\u0641\u0649', - '\uFC7D': '\u0641\u064A', - '\uFC7E': '\u0642\u0649', - '\uFC7F': '\u0642\u064A', - '\uFC80': '\u0643\u0627', - '\uFC81': '\u0643\u0644', - '\uFC82': '\u0643\u0645', - '\uFC83': '\u0643\u0649', - '\uFC84': '\u0643\u064A', - '\uFC85': '\u0644\u0645', - '\uFC86': '\u0644\u0649', - '\uFC87': '\u0644\u064A', - '\uFC88': '\u0645\u0627', - '\uFC89': '\u0645\u0645', - '\uFC8A': '\u0646\u0631', - '\uFC8B': '\u0646\u0632', - '\uFC8C': '\u0646\u0645', - '\uFC8D': '\u0646\u0646', - '\uFC8E': '\u0646\u0649', - '\uFC8F': '\u0646\u064A', - '\uFC90': '\u0649\u0670', - '\uFC91': '\u064A\u0631', - '\uFC92': '\u064A\u0632', - '\uFC93': '\u064A\u0645', - '\uFC94': '\u064A\u0646', - '\uFC95': '\u064A\u0649', - '\uFC96': '\u064A\u064A', - '\uFC97': '\u0626\u062C', - '\uFC98': '\u0626\u062D', - '\uFC99': '\u0626\u062E', - '\uFC9A': '\u0626\u0645', - '\uFC9B': '\u0626\u0647', - '\uFC9C': '\u0628\u062C', - '\uFC9D': '\u0628\u062D', - '\uFC9E': '\u0628\u062E', - '\uFC9F': '\u0628\u0645', - '\uFCA0': '\u0628\u0647', - '\uFCA1': '\u062A\u062C', - '\uFCA2': '\u062A\u062D', - '\uFCA3': '\u062A\u062E', - '\uFCA4': '\u062A\u0645', - '\uFCA5': '\u062A\u0647', - '\uFCA6': '\u062B\u0645', - '\uFCA7': '\u062C\u062D', - '\uFCA8': '\u062C\u0645', - '\uFCA9': '\u062D\u062C', - '\uFCAA': '\u062D\u0645', - '\uFCAB': '\u062E\u062C', - '\uFCAC': '\u062E\u0645', - '\uFCAD': '\u0633\u062C', - '\uFCAE': '\u0633\u062D', - '\uFCAF': '\u0633\u062E', - '\uFCB0': '\u0633\u0645', - '\uFCB1': '\u0635\u062D', - '\uFCB2': '\u0635\u062E', - '\uFCB3': '\u0635\u0645', - '\uFCB4': '\u0636\u062C', - '\uFCB5': '\u0636\u062D', - '\uFCB6': '\u0636\u062E', - '\uFCB7': '\u0636\u0645', - '\uFCB8': '\u0637\u062D', - '\uFCB9': '\u0638\u0645', - '\uFCBA': '\u0639\u062C', - '\uFCBB': '\u0639\u0645', - '\uFCBC': '\u063A\u062C', - '\uFCBD': '\u063A\u0645', - '\uFCBE': '\u0641\u062C', - '\uFCBF': '\u0641\u062D', - '\uFCC0': '\u0641\u062E', - '\uFCC1': '\u0641\u0645', - '\uFCC2': '\u0642\u062D', - '\uFCC3': '\u0642\u0645', - '\uFCC4': '\u0643\u062C', - '\uFCC5': '\u0643\u062D', - '\uFCC6': '\u0643\u062E', - '\uFCC7': '\u0643\u0644', - '\uFCC8': '\u0643\u0645', - '\uFCC9': '\u0644\u062C', - '\uFCCA': '\u0644\u062D', - '\uFCCB': '\u0644\u062E', - '\uFCCC': '\u0644\u0645', - '\uFCCD': '\u0644\u0647', - '\uFCCE': '\u0645\u062C', - '\uFCCF': '\u0645\u062D', - '\uFCD0': '\u0645\u062E', - '\uFCD1': '\u0645\u0645', - '\uFCD2': '\u0646\u062C', - '\uFCD3': '\u0646\u062D', - '\uFCD4': '\u0646\u062E', - '\uFCD5': '\u0646\u0645', - '\uFCD6': '\u0646\u0647', - '\uFCD7': '\u0647\u062C', - '\uFCD8': '\u0647\u0645', - '\uFCD9': '\u0647\u0670', - '\uFCDA': '\u064A\u062C', - '\uFCDB': '\u064A\u062D', - '\uFCDC': '\u064A\u062E', - '\uFCDD': '\u064A\u0645', - '\uFCDE': '\u064A\u0647', - '\uFCDF': '\u0626\u0645', - '\uFCE0': '\u0626\u0647', - '\uFCE1': '\u0628\u0645', - '\uFCE2': '\u0628\u0647', - '\uFCE3': '\u062A\u0645', - '\uFCE4': '\u062A\u0647', - '\uFCE5': '\u062B\u0645', - '\uFCE6': '\u062B\u0647', - '\uFCE7': '\u0633\u0645', - '\uFCE8': '\u0633\u0647', - '\uFCE9': '\u0634\u0645', - '\uFCEA': '\u0634\u0647', - '\uFCEB': '\u0643\u0644', - '\uFCEC': '\u0643\u0645', - '\uFCED': '\u0644\u0645', - '\uFCEE': '\u0646\u0645', - '\uFCEF': '\u0646\u0647', - '\uFCF0': '\u064A\u0645', - '\uFCF1': '\u064A\u0647', - '\uFCF2': '\u0640\u064E\u0651', - '\uFCF3': '\u0640\u064F\u0651', - '\uFCF4': '\u0640\u0650\u0651', - '\uFCF5': '\u0637\u0649', - '\uFCF6': '\u0637\u064A', - '\uFCF7': '\u0639\u0649', - '\uFCF8': '\u0639\u064A', - '\uFCF9': '\u063A\u0649', - '\uFCFA': '\u063A\u064A', - '\uFCFB': '\u0633\u0649', - '\uFCFC': '\u0633\u064A', - '\uFCFD': '\u0634\u0649', - '\uFCFE': '\u0634\u064A', - '\uFCFF': '\u062D\u0649', - '\uFD00': '\u062D\u064A', - '\uFD01': '\u062C\u0649', - '\uFD02': '\u062C\u064A', - '\uFD03': '\u062E\u0649', - '\uFD04': '\u062E\u064A', - '\uFD05': '\u0635\u0649', - '\uFD06': '\u0635\u064A', - '\uFD07': '\u0636\u0649', - '\uFD08': '\u0636\u064A', - '\uFD09': '\u0634\u062C', - '\uFD0A': '\u0634\u062D', - '\uFD0B': '\u0634\u062E', - '\uFD0C': '\u0634\u0645', - '\uFD0D': '\u0634\u0631', - '\uFD0E': '\u0633\u0631', - '\uFD0F': '\u0635\u0631', - '\uFD10': '\u0636\u0631', - '\uFD11': '\u0637\u0649', - '\uFD12': '\u0637\u064A', - '\uFD13': '\u0639\u0649', - '\uFD14': '\u0639\u064A', - '\uFD15': '\u063A\u0649', - '\uFD16': '\u063A\u064A', - '\uFD17': '\u0633\u0649', - '\uFD18': '\u0633\u064A', - '\uFD19': '\u0634\u0649', - '\uFD1A': '\u0634\u064A', - '\uFD1B': '\u062D\u0649', - '\uFD1C': '\u062D\u064A', - '\uFD1D': '\u062C\u0649', - '\uFD1E': '\u062C\u064A', - '\uFD1F': '\u062E\u0649', - '\uFD20': '\u062E\u064A', - '\uFD21': '\u0635\u0649', - '\uFD22': '\u0635\u064A', - '\uFD23': '\u0636\u0649', - '\uFD24': '\u0636\u064A', - '\uFD25': '\u0634\u062C', - '\uFD26': '\u0634\u062D', - '\uFD27': '\u0634\u062E', - '\uFD28': '\u0634\u0645', - '\uFD29': '\u0634\u0631', - '\uFD2A': '\u0633\u0631', - '\uFD2B': '\u0635\u0631', - '\uFD2C': '\u0636\u0631', - '\uFD2D': '\u0634\u062C', - '\uFD2E': '\u0634\u062D', - '\uFD2F': '\u0634\u062E', - '\uFD30': '\u0634\u0645', - '\uFD31': '\u0633\u0647', - '\uFD32': '\u0634\u0647', - '\uFD33': '\u0637\u0645', - '\uFD34': '\u0633\u062C', - '\uFD35': '\u0633\u062D', - '\uFD36': '\u0633\u062E', - '\uFD37': '\u0634\u062C', - '\uFD38': '\u0634\u062D', - '\uFD39': '\u0634\u062E', - '\uFD3A': '\u0637\u0645', - '\uFD3B': '\u0638\u0645', - '\uFD3C': '\u0627\u064B', - '\uFD3D': '\u0627\u064B', - '\uFD50': '\u062A\u062C\u0645', - '\uFD51': '\u062A\u062D\u062C', - '\uFD52': '\u062A\u062D\u062C', - '\uFD53': '\u062A\u062D\u0645', - '\uFD54': '\u062A\u062E\u0645', - '\uFD55': '\u062A\u0645\u062C', - '\uFD56': '\u062A\u0645\u062D', - '\uFD57': '\u062A\u0645\u062E', - '\uFD58': '\u062C\u0645\u062D', - '\uFD59': '\u062C\u0645\u062D', - '\uFD5A': '\u062D\u0645\u064A', - '\uFD5B': '\u062D\u0645\u0649', - '\uFD5C': '\u0633\u062D\u062C', - '\uFD5D': '\u0633\u062C\u062D', - '\uFD5E': '\u0633\u062C\u0649', - '\uFD5F': '\u0633\u0645\u062D', - '\uFD60': '\u0633\u0645\u062D', - '\uFD61': '\u0633\u0645\u062C', - '\uFD62': '\u0633\u0645\u0645', - '\uFD63': '\u0633\u0645\u0645', - '\uFD64': '\u0635\u062D\u062D', - '\uFD65': '\u0635\u062D\u062D', - '\uFD66': '\u0635\u0645\u0645', - '\uFD67': '\u0634\u062D\u0645', - '\uFD68': '\u0634\u062D\u0645', - '\uFD69': '\u0634\u062C\u064A', - '\uFD6A': '\u0634\u0645\u062E', - '\uFD6B': '\u0634\u0645\u062E', - '\uFD6C': '\u0634\u0645\u0645', - '\uFD6D': '\u0634\u0645\u0645', - '\uFD6E': '\u0636\u062D\u0649', - '\uFD6F': '\u0636\u062E\u0645', - '\uFD70': '\u0636\u062E\u0645', - '\uFD71': '\u0637\u0645\u062D', - '\uFD72': '\u0637\u0645\u062D', - '\uFD73': '\u0637\u0645\u0645', - '\uFD74': '\u0637\u0645\u064A', - '\uFD75': '\u0639\u062C\u0645', - '\uFD76': '\u0639\u0645\u0645', - '\uFD77': '\u0639\u0645\u0645', - '\uFD78': '\u0639\u0645\u0649', - '\uFD79': '\u063A\u0645\u0645', - '\uFD7A': '\u063A\u0645\u064A', - '\uFD7B': '\u063A\u0645\u0649', - '\uFD7C': '\u0641\u062E\u0645', - '\uFD7D': '\u0641\u062E\u0645', - '\uFD7E': '\u0642\u0645\u062D', - '\uFD7F': '\u0642\u0645\u0645', - '\uFD80': '\u0644\u062D\u0645', - '\uFD81': '\u0644\u062D\u064A', - '\uFD82': '\u0644\u062D\u0649', - '\uFD83': '\u0644\u062C\u062C', - '\uFD84': '\u0644\u062C\u062C', - '\uFD85': '\u0644\u062E\u0645', - '\uFD86': '\u0644\u062E\u0645', - '\uFD87': '\u0644\u0645\u062D', - '\uFD88': '\u0644\u0645\u062D', - '\uFD89': '\u0645\u062D\u062C', - '\uFD8A': '\u0645\u062D\u0645', - '\uFD8B': '\u0645\u062D\u064A', - '\uFD8C': '\u0645\u062C\u062D', - '\uFD8D': '\u0645\u062C\u0645', - '\uFD8E': '\u0645\u062E\u062C', - '\uFD8F': '\u0645\u062E\u0645', - '\uFD92': '\u0645\u062C\u062E', - '\uFD93': '\u0647\u0645\u062C', - '\uFD94': '\u0647\u0645\u0645', - '\uFD95': '\u0646\u062D\u0645', - '\uFD96': '\u0646\u062D\u0649', - '\uFD97': '\u0646\u062C\u0645', - '\uFD98': '\u0646\u062C\u0645', - '\uFD99': '\u0646\u062C\u0649', - '\uFD9A': '\u0646\u0645\u064A', - '\uFD9B': '\u0646\u0645\u0649', - '\uFD9C': '\u064A\u0645\u0645', - '\uFD9D': '\u064A\u0645\u0645', - '\uFD9E': '\u0628\u062E\u064A', - '\uFD9F': '\u062A\u062C\u064A', - '\uFDA0': '\u062A\u062C\u0649', - '\uFDA1': '\u062A\u062E\u064A', - '\uFDA2': '\u062A\u062E\u0649', - '\uFDA3': '\u062A\u0645\u064A', - '\uFDA4': '\u062A\u0645\u0649', - '\uFDA5': '\u062C\u0645\u064A', - '\uFDA6': '\u062C\u062D\u0649', - '\uFDA7': '\u062C\u0645\u0649', - '\uFDA8': '\u0633\u062E\u0649', - '\uFDA9': '\u0635\u062D\u064A', - '\uFDAA': '\u0634\u062D\u064A', - '\uFDAB': '\u0636\u062D\u064A', - '\uFDAC': '\u0644\u062C\u064A', - '\uFDAD': '\u0644\u0645\u064A', - '\uFDAE': '\u064A\u062D\u064A', - '\uFDAF': '\u064A\u062C\u064A', - '\uFDB0': '\u064A\u0645\u064A', - '\uFDB1': '\u0645\u0645\u064A', - '\uFDB2': '\u0642\u0645\u064A', - '\uFDB3': '\u0646\u062D\u064A', - '\uFDB4': '\u0642\u0645\u062D', - '\uFDB5': '\u0644\u062D\u0645', - '\uFDB6': '\u0639\u0645\u064A', - '\uFDB7': '\u0643\u0645\u064A', - '\uFDB8': '\u0646\u062C\u062D', - '\uFDB9': '\u0645\u062E\u064A', - '\uFDBA': '\u0644\u062C\u0645', - '\uFDBB': '\u0643\u0645\u0645', - '\uFDBC': '\u0644\u062C\u0645', - '\uFDBD': '\u0646\u062C\u062D', - '\uFDBE': '\u062C\u062D\u064A', - '\uFDBF': '\u062D\u062C\u064A', - '\uFDC0': '\u0645\u062C\u064A', - '\uFDC1': '\u0641\u0645\u064A', - '\uFDC2': '\u0628\u062D\u064A', - '\uFDC3': '\u0643\u0645\u0645', - '\uFDC4': '\u0639\u062C\u0645', - '\uFDC5': '\u0635\u0645\u0645', - '\uFDC6': '\u0633\u062E\u064A', - '\uFDC7': '\u0646\u062C\u064A', - '\uFE49': '\u203E', - '\uFE4A': '\u203E', - '\uFE4B': '\u203E', - '\uFE4C': '\u203E', - '\uFE4D': '\u005F', - '\uFE4E': '\u005F', - '\uFE4F': '\u005F', - '\uFE80': '\u0621', - '\uFE81': '\u0622', - '\uFE82': '\u0622', - '\uFE83': '\u0623', - '\uFE84': '\u0623', - '\uFE85': '\u0624', - '\uFE86': '\u0624', - '\uFE87': '\u0625', - '\uFE88': '\u0625', - '\uFE89': '\u0626', - '\uFE8A': '\u0626', - '\uFE8B': '\u0626', - '\uFE8C': '\u0626', - '\uFE8D': '\u0627', - '\uFE8E': '\u0627', - '\uFE8F': '\u0628', - '\uFE90': '\u0628', - '\uFE91': '\u0628', - '\uFE92': '\u0628', - '\uFE93': '\u0629', - '\uFE94': '\u0629', - '\uFE95': '\u062A', - '\uFE96': '\u062A', - '\uFE97': '\u062A', - '\uFE98': '\u062A', - '\uFE99': '\u062B', - '\uFE9A': '\u062B', - '\uFE9B': '\u062B', - '\uFE9C': '\u062B', - '\uFE9D': '\u062C', - '\uFE9E': '\u062C', - '\uFE9F': '\u062C', - '\uFEA0': '\u062C', - '\uFEA1': '\u062D', - '\uFEA2': '\u062D', - '\uFEA3': '\u062D', - '\uFEA4': '\u062D', - '\uFEA5': '\u062E', - '\uFEA6': '\u062E', - '\uFEA7': '\u062E', - '\uFEA8': '\u062E', - '\uFEA9': '\u062F', - '\uFEAA': '\u062F', - '\uFEAB': '\u0630', - '\uFEAC': '\u0630', - '\uFEAD': '\u0631', - '\uFEAE': '\u0631', - '\uFEAF': '\u0632', - '\uFEB0': '\u0632', - '\uFEB1': '\u0633', - '\uFEB2': '\u0633', - '\uFEB3': '\u0633', - '\uFEB4': '\u0633', - '\uFEB5': '\u0634', - '\uFEB6': '\u0634', - '\uFEB7': '\u0634', - '\uFEB8': '\u0634', - '\uFEB9': '\u0635', - '\uFEBA': '\u0635', - '\uFEBB': '\u0635', - '\uFEBC': '\u0635', - '\uFEBD': '\u0636', - '\uFEBE': '\u0636', - '\uFEBF': '\u0636', - '\uFEC0': '\u0636', - '\uFEC1': '\u0637', - '\uFEC2': '\u0637', - '\uFEC3': '\u0637', - '\uFEC4': '\u0637', - '\uFEC5': '\u0638', - '\uFEC6': '\u0638', - '\uFEC7': '\u0638', - '\uFEC8': '\u0638', - '\uFEC9': '\u0639', - '\uFECA': '\u0639', - '\uFECB': '\u0639', - '\uFECC': '\u0639', - '\uFECD': '\u063A', - '\uFECE': '\u063A', - '\uFECF': '\u063A', - '\uFED0': '\u063A', - '\uFED1': '\u0641', - '\uFED2': '\u0641', - '\uFED3': '\u0641', - '\uFED4': '\u0641', - '\uFED5': '\u0642', - '\uFED6': '\u0642', - '\uFED7': '\u0642', - '\uFED8': '\u0642', - '\uFED9': '\u0643', - '\uFEDA': '\u0643', - '\uFEDB': '\u0643', - '\uFEDC': '\u0643', - '\uFEDD': '\u0644', - '\uFEDE': '\u0644', - '\uFEDF': '\u0644', - '\uFEE0': '\u0644', - '\uFEE1': '\u0645', - '\uFEE2': '\u0645', - '\uFEE3': '\u0645', - '\uFEE4': '\u0645', - '\uFEE5': '\u0646', - '\uFEE6': '\u0646', - '\uFEE7': '\u0646', - '\uFEE8': '\u0646', - '\uFEE9': '\u0647', - '\uFEEA': '\u0647', - '\uFEEB': '\u0647', - '\uFEEC': '\u0647', - '\uFEED': '\u0648', - '\uFEEE': '\u0648', - '\uFEEF': '\u0649', - '\uFEF0': '\u0649', - '\uFEF1': '\u064A', - '\uFEF2': '\u064A', - '\uFEF3': '\u064A', - '\uFEF4': '\u064A', - '\uFEF5': '\u0644\u0622', - '\uFEF6': '\u0644\u0622', - '\uFEF7': '\u0644\u0623', - '\uFEF8': '\u0644\u0623', - '\uFEF9': '\u0644\u0625', - '\uFEFA': '\u0644\u0625', - '\uFEFB': '\u0644\u0627', - '\uFEFC': '\u0644\u0627' -}; - -function reverseIfRtl(chars) { - var charsLength = chars.length; - //reverse an arabic ligature - if (charsLength <= 1 || !isRTLRangeFor(chars.charCodeAt(0))) { - return chars; - } - var s = ''; - for (var ii = charsLength - 1; ii >= 0; ii--) { - s += chars[ii]; - } - return s; -} - -function adjustWidths(properties) { - if (!properties.fontMatrix) { - return; - } - if (properties.fontMatrix[0] === FONT_IDENTITY_MATRIX[0]) { - return; - } - // adjusting width to fontMatrix scale - var scale = 0.001 / properties.fontMatrix[0]; - var glyphsWidths = properties.widths; - for (var glyph in glyphsWidths) { - glyphsWidths[glyph] *= scale; - } - properties.defaultWidth *= scale; -} - -function getFontType(type, subtype) { - switch (type) { - case 'Type1': - return subtype === 'Type1C' ? FontType.TYPE1C : FontType.TYPE1; - case 'CIDFontType0': - return subtype === 'CIDFontType0C' ? FontType.CIDFONTTYPE0C : - FontType.CIDFONTTYPE0; - case 'OpenType': - return FontType.OPENTYPE; - case 'TrueType': - return FontType.TRUETYPE; - case 'CIDFontType2': - return FontType.CIDFONTTYPE2; - case 'MMType1': - return FontType.MMTYPE1; - case 'Type0': - return FontType.TYPE0; - default: - return FontType.UNKNOWN; - } -} - -var Glyph = (function GlyphClosure() { - function Glyph(fontChar, unicode, accent, width, vmetric, operatorListId, - isSpace) { - this.fontChar = fontChar; - this.unicode = unicode; - this.accent = accent; - this.width = width; - this.vmetric = vmetric; - this.operatorListId = operatorListId; - this.isSpace = isSpace; - } - - Glyph.prototype.matchesForCache = function(fontChar, unicode, accent, width, - vmetric, operatorListId, isSpace) { - return this.fontChar === fontChar && - this.unicode === unicode && - this.accent === accent && - this.width === width && - this.vmetric === vmetric && - this.operatorListId === operatorListId && - this.isSpace === isSpace; - }; - - return Glyph; -})(); - -var ToUnicodeMap = (function ToUnicodeMapClosure() { - function ToUnicodeMap(cmap) { - // The elements of this._map can be integers or strings, depending on how - // |cmap| was created. - this._map = cmap; - } - - ToUnicodeMap.prototype = { - get length() { - return this._map.length; - }, - - forEach: function(callback) { - for (var charCode in this._map) { - callback(charCode, this._map[charCode].charCodeAt(0)); - } - }, - - has: function(i) { - return this._map[i] !== undefined; - }, - - get: function(i) { - return this._map[i]; - }, - - charCodeOf: function(v) { - return this._map.indexOf(v); - } - }; - - return ToUnicodeMap; -})(); - -var IdentityToUnicodeMap = (function IdentityToUnicodeMapClosure() { - function IdentityToUnicodeMap(firstChar, lastChar) { - this.firstChar = firstChar; - this.lastChar = lastChar; - } - - IdentityToUnicodeMap.prototype = { - get length() { - return (this.lastChar + 1) - this.firstChar; - }, - - forEach: function (callback) { - for (var i = this.firstChar, ii = this.lastChar; i <= ii; i++) { - callback(i, i); - } - }, - - has: function (i) { - return this.firstChar <= i && i <= this.lastChar; - }, - - get: function (i) { - if (this.firstChar <= i && i <= this.lastChar) { - return String.fromCharCode(i); - } - return undefined; - }, - - charCodeOf: function (v) { - return (isInt(v) && v >= this.firstChar && v <= this.lastChar) ? v : -1; - } - }; - - return IdentityToUnicodeMap; -})(); - -var OpenTypeFileBuilder = (function OpenTypeFileBuilderClosure() { - function writeInt16(dest, offset, num) { - dest[offset] = (num >> 8) & 0xFF; - dest[offset + 1] = num & 0xFF; - } - - function writeInt32(dest, offset, num) { - dest[offset] = (num >> 24) & 0xFF; - dest[offset + 1] = (num >> 16) & 0xFF; - dest[offset + 2] = (num >> 8) & 0xFF; - dest[offset + 3] = num & 0xFF; - } - - function writeData(dest, offset, data) { - var i, ii; - if (data instanceof Uint8Array) { - dest.set(data, offset); - } else if (typeof data === 'string') { - for (i = 0, ii = data.length; i < ii; i++) { - dest[offset++] = data.charCodeAt(i) & 0xFF; - } - } else { - // treating everything else as array - for (i = 0, ii = data.length; i < ii; i++) { - dest[offset++] = data[i] & 0xFF; - } - } - } - - function OpenTypeFileBuilder(sfnt) { - this.sfnt = sfnt; - this.tables = Object.create(null); - } - - OpenTypeFileBuilder.getSearchParams = - function OpenTypeFileBuilder_getSearchParams(entriesCount, entrySize) { - var maxPower2 = 1, log2 = 0; - while ((maxPower2 ^ entriesCount) > maxPower2) { - maxPower2 <<= 1; - log2++; - } - var searchRange = maxPower2 * entrySize; - return { - range: searchRange, - entry: log2, - rangeShift: entrySize * entriesCount - searchRange - }; - }; - - var OTF_HEADER_SIZE = 12; - var OTF_TABLE_ENTRY_SIZE = 16; - - OpenTypeFileBuilder.prototype = { - toArray: function OpenTypeFileBuilder_toArray() { - var sfnt = this.sfnt; - - // Tables needs to be written by ascendant alphabetic order - var tables = this.tables; - var tablesNames = Object.keys(tables); - tablesNames.sort(); - var numTables = tablesNames.length; - - var i, j, jj, table, tableName; - // layout the tables data - var offset = OTF_HEADER_SIZE + numTables * OTF_TABLE_ENTRY_SIZE; - var tableOffsets = [offset]; - for (i = 0; i < numTables; i++) { - table = tables[tablesNames[i]]; - var paddedLength = ((table.length + 3) & ~3) >>> 0; - offset += paddedLength; - tableOffsets.push(offset); - } - - var file = new Uint8Array(offset); - // write the table data first (mostly for checksum) - for (i = 0; i < numTables; i++) { - table = tables[tablesNames[i]]; - writeData(file, tableOffsets[i], table); - } - - // sfnt version (4 bytes) - if (sfnt === 'true') { - // Windows hates the Mac TrueType sfnt version number - sfnt = string32(0x00010000); - } - file[0] = sfnt.charCodeAt(0) & 0xFF; - file[1] = sfnt.charCodeAt(1) & 0xFF; - file[2] = sfnt.charCodeAt(2) & 0xFF; - file[3] = sfnt.charCodeAt(3) & 0xFF; - - // numTables (2 bytes) - writeInt16(file, 4, numTables); - - var searchParams = OpenTypeFileBuilder.getSearchParams(numTables, 16); - - // searchRange (2 bytes) - writeInt16(file, 6, searchParams.range); - // entrySelector (2 bytes) - writeInt16(file, 8, searchParams.entry); - // rangeShift (2 bytes) - writeInt16(file, 10, searchParams.rangeShift); - - offset = OTF_HEADER_SIZE; - // writing table entries - for (i = 0; i < numTables; i++) { - tableName = tablesNames[i]; - file[offset] = tableName.charCodeAt(0) & 0xFF; - file[offset + 1] = tableName.charCodeAt(1) & 0xFF; - file[offset + 2] = tableName.charCodeAt(2) & 0xFF; - file[offset + 3] = tableName.charCodeAt(3) & 0xFF; - - // checksum - var checksum = 0; - for (j = tableOffsets[i], jj = tableOffsets[i + 1]; j < jj; j += 4) { - var quad = (file[j] << 24) + (file[j + 1] << 16) + - (file[j + 2] << 8) + file[j + 3]; - checksum = (checksum + quad) | 0; - } - writeInt32(file, offset + 4, checksum); - - // offset - writeInt32(file, offset + 8, tableOffsets[i]); - // length - writeInt32(file, offset + 12, tables[tableName].length); - - offset += OTF_TABLE_ENTRY_SIZE; - } - return file; - }, - - addTable: function OpenTypeFileBuilder_addTable(tag, data) { - if (tag in this.tables) { - throw new Error('Table ' + tag + ' already exists'); - } - this.tables[tag] = data; - } - }; - - return OpenTypeFileBuilder; -})(); - -// Problematic Unicode characters in the fonts that needs to be moved to avoid -// issues when they are painted on the canvas, e.g. complex-script shaping or -// control/whitespace characters. The ranges are listed in pairs: the first item -// is a code of the first problematic code, the second one is the next -// non-problematic code. The ranges must be in sorted order. -var ProblematicCharRanges = new Int32Array([ - // Control characters. - 0x0000, 0x0020, - 0x007F, 0x00A1, - 0x00AD, 0x00AE, - // Chars that is used in complex-script shaping. - 0x0600, 0x0780, - 0x08A0, 0x10A0, - 0x1780, 0x1800, - // General punctuation chars. - 0x2000, 0x2010, - 0x2011, 0x2012, - 0x2028, 0x2030, - 0x205F, 0x2070, - 0x25CC, 0x25CD, - // Chars that is used in complex-script shaping. - 0xAA60, 0xAA80, - // Specials Unicode block. - 0xFFF0, 0x10000 -]); - -/** - * 'Font' is the class the outside world should use, it encapsulate all the font - * decoding logics whatever type it is (assuming the font type is supported). - * - * For example to read a Type1 font and to attach it to the document: - * var type1Font = new Font("MyFontName", binaryFile, propertiesObject); - * type1Font.bind(); - */ -var Font = (function FontClosure() { - function Font(name, file, properties) { - var charCode, glyphName, fontChar; - - this.name = name; - this.loadedName = properties.loadedName; - this.isType3Font = properties.isType3Font; - this.sizes = []; - - this.glyphCache = {}; - - var names = name.split('+'); - names = names.length > 1 ? names[1] : names[0]; - names = names.split(/[-,_]/g)[0]; - this.isSerifFont = !!(properties.flags & FontFlags.Serif); - this.isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); - this.isMonospace = !!(properties.flags & FontFlags.FixedPitch); - - var type = properties.type; - var subtype = properties.subtype; - this.type = type; - - this.fallbackName = (this.isMonospace ? 'monospace' : - (this.isSerifFont ? 'serif' : 'sans-serif')); - - this.differences = properties.differences; - this.widths = properties.widths; - this.defaultWidth = properties.defaultWidth; - this.composite = properties.composite; - this.wideChars = properties.wideChars; - this.cMap = properties.cMap; - this.ascent = properties.ascent / PDF_GLYPH_SPACE_UNITS; - this.descent = properties.descent / PDF_GLYPH_SPACE_UNITS; - this.fontMatrix = properties.fontMatrix; - this.bbox = properties.bbox; - - this.toUnicode = properties.toUnicode = this.buildToUnicode(properties); - - this.toFontChar = []; - - if (properties.type === 'Type3') { - for (charCode = 0; charCode < 256; charCode++) { - this.toFontChar[charCode] = (this.differences[charCode] || - properties.defaultEncoding[charCode]); - } - this.fontType = FontType.TYPE3; - return; - } - - this.cidEncoding = properties.cidEncoding; - this.vertical = properties.vertical; - if (this.vertical) { - this.vmetrics = properties.vmetrics; - this.defaultVMetrics = properties.defaultVMetrics; - } - - if (!file || file.isEmpty) { - if (file) { - // Some bad PDF generators will include empty font files, - // attempting to recover by assuming that no file exists. - warn('Font file is empty in "' + name + '" (' + this.loadedName + ')'); - } - - this.missingFile = true; - // The file data is not specified. Trying to fix the font name - // to be used with the canvas.font. - var fontName = name.replace(/[,_]/g, '-'); - var isStandardFont = !!stdFontMap[fontName] || - !!(nonStdFontMap[fontName] && stdFontMap[nonStdFontMap[fontName]]); - fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName; - - this.bold = (fontName.search(/bold/gi) !== -1); - this.italic = ((fontName.search(/oblique/gi) !== -1) || - (fontName.search(/italic/gi) !== -1)); - - // Use 'name' instead of 'fontName' here because the original - // name ArialBlack for example will be replaced by Helvetica. - this.black = (name.search(/Black/g) !== -1); - - // if at least one width is present, remeasure all chars when exists - this.remeasure = Object.keys(this.widths).length > 0; - if (isStandardFont && type === 'CIDFontType2' && - properties.cidEncoding.indexOf('Identity-') === 0) { - // Standard fonts might be embedded as CID font without glyph mapping. - // Building one based on GlyphMapForStandardFonts. - var map = []; - for (charCode in GlyphMapForStandardFonts) { - map[+charCode] = GlyphMapForStandardFonts[charCode]; - } - if (/ArialBlack/i.test(name)) { - for (charCode in SupplementalGlyphMapForArialBlack) { - map[+charCode] = SupplementalGlyphMapForArialBlack[charCode]; - } - } - var isIdentityUnicode = this.toUnicode instanceof IdentityToUnicodeMap; - if (!isIdentityUnicode) { - this.toUnicode.forEach(function(charCode, unicodeCharCode) { - map[+charCode] = unicodeCharCode; - }); - } - this.toFontChar = map; - this.toUnicode = new ToUnicodeMap(map); - } else if (/Symbol/i.test(fontName)) { - var symbols = Encodings.SymbolSetEncoding; - for (charCode in symbols) { - fontChar = GlyphsUnicode[symbols[charCode]]; - if (!fontChar) { - continue; - } - this.toFontChar[charCode] = fontChar; - } - for (charCode in properties.differences) { - fontChar = GlyphsUnicode[properties.differences[charCode]]; - if (!fontChar) { - continue; - } - this.toFontChar[charCode] = fontChar; - } - } else if (/Dingbats/i.test(fontName)) { - if (/Wingdings/i.test(name)) { - warn('Wingdings font without embedded font file, ' + - 'falling back to the ZapfDingbats encoding.'); - } - var dingbats = Encodings.ZapfDingbatsEncoding; - for (charCode in dingbats) { - fontChar = DingbatsGlyphsUnicode[dingbats[charCode]]; - if (!fontChar) { - continue; - } - this.toFontChar[charCode] = fontChar; - } - for (charCode in properties.differences) { - fontChar = DingbatsGlyphsUnicode[properties.differences[charCode]]; - if (!fontChar) { - continue; - } - this.toFontChar[charCode] = fontChar; - } - } else if (isStandardFont) { - this.toFontChar = []; - for (charCode in properties.defaultEncoding) { - glyphName = (properties.differences[charCode] || - properties.defaultEncoding[charCode]); - this.toFontChar[charCode] = GlyphsUnicode[glyphName]; - } - } else { - var unicodeCharCode, notCidFont = (type.indexOf('CIDFontType') === -1); - this.toUnicode.forEach(function(charCode, unicodeCharCode) { - if (notCidFont) { - glyphName = (properties.differences[charCode] || - properties.defaultEncoding[charCode]); - unicodeCharCode = (GlyphsUnicode[glyphName] || unicodeCharCode); - } - this.toFontChar[charCode] = unicodeCharCode; - }.bind(this)); - } - this.loadedName = fontName.split('-')[0]; - this.loading = false; - this.fontType = getFontType(type, subtype); - return; - } - - // Some fonts might use wrong font types for Type1C or CIDFontType0C - if (subtype === 'Type1C' && (type !== 'Type1' && type !== 'MMType1')) { - // Some TrueType fonts by mistake claim Type1C - if (isTrueTypeFile(file)) { - subtype = 'TrueType'; - } else { - type = 'Type1'; - } - } - if (subtype === 'CIDFontType0C' && type !== 'CIDFontType0') { - type = 'CIDFontType0'; - } - if (subtype === 'OpenType') { - type = 'OpenType'; - } - // Some CIDFontType0C fonts by mistake claim CIDFontType0. - if (type === 'CIDFontType0') { - subtype = isType1File(file) ? 'CIDFontType0' : 'CIDFontType0C'; - } - - var data; - switch (type) { - case 'MMType1': - info('MMType1 font (' + name + '), falling back to Type1.'); - /* falls through */ - case 'Type1': - case 'CIDFontType0': - this.mimetype = 'font/opentype'; - - var cff = (subtype === 'Type1C' || subtype === 'CIDFontType0C') ? - new CFFFont(file, properties) : new Type1Font(name, file, properties); - - adjustWidths(properties); - - // Wrap the CFF data inside an OTF font file - data = this.convert(name, cff, properties); - break; - - case 'OpenType': - case 'TrueType': - case 'CIDFontType2': - this.mimetype = 'font/opentype'; - - // Repair the TrueType file. It is can be damaged in the point of - // view of the sanitizer - data = this.checkAndRepair(name, file, properties); - if (this.isOpenType) { - adjustWidths(properties); - - type = 'OpenType'; - } - break; - - default: - error('Font ' + type + ' is not supported'); - break; - } - - this.data = data; - this.fontType = getFontType(type, subtype); - - // Transfer some properties again that could change during font conversion - this.fontMatrix = properties.fontMatrix; - this.widths = properties.widths; - this.defaultWidth = properties.defaultWidth; - this.encoding = properties.baseEncoding; - this.seacMap = properties.seacMap; - - this.loading = true; - } - - Font.getFontID = (function () { - var ID = 1; - return function Font_getFontID() { - return String(ID++); - }; - })(); - - function int16(b0, b1) { - return (b0 << 8) + b1; - } - - function int32(b0, b1, b2, b3) { - return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; - } - - function string16(value) { - return String.fromCharCode((value >> 8) & 0xff, value & 0xff); - } - - function safeString16(value) { - // clamp value to the 16-bit int range - value = (value > 0x7FFF ? 0x7FFF : (value < -0x8000 ? -0x8000 : value)); - return String.fromCharCode((value >> 8) & 0xff, value & 0xff); - } - - function isTrueTypeFile(file) { - var header = file.peekBytes(4); - return readUint32(header, 0) === 0x00010000; - } - - function isType1File(file) { - var header = file.peekBytes(2); - // All Type1 font programs must begin with the comment '%!' (0x25 + 0x21). - if (header[0] === 0x25 && header[1] === 0x21) { - return true; - } - // ... obviously some fonts violate that part of the specification, - // please refer to the comment in |Type1Font| below. - if (header[0] === 0x80 && header[1] === 0x01) { // pfb file header. - return true; - } - return false; - } - - /** - * Helper function for |adjustMapping|. - * @return {boolean} - */ - function isProblematicUnicodeLocation(code) { - // Using binary search to find a range start. - var i = 0, j = ProblematicCharRanges.length - 1; - while (i < j) { - var c = (i + j + 1) >> 1; - if (code < ProblematicCharRanges[c]) { - j = c - 1; - } else { - i = c; - } - } - // Even index means code in problematic range. - return !(i & 1); - } - - /** - * Rebuilds the char code to glyph ID map by trying to replace the char codes - * with their unicode value. It also moves char codes that are in known - * problematic locations. - * @return {Object} Two properties: - * 'toFontChar' - maps original char codes(the value that will be read - * from commands such as show text) to the char codes that will be used in the - * font that we build - * 'charCodeToGlyphId' - maps the new font char codes to glyph ids - */ - function adjustMapping(charCodeToGlyphId, properties) { - var toUnicode = properties.toUnicode; - var isSymbolic = !!(properties.flags & FontFlags.Symbolic); - var isIdentityUnicode = - properties.toUnicode instanceof IdentityToUnicodeMap; - var newMap = Object.create(null); - var toFontChar = []; - var usedFontCharCodes = []; - var nextAvailableFontCharCode = PRIVATE_USE_OFFSET_START; - for (var originalCharCode in charCodeToGlyphId) { - originalCharCode |= 0; - var glyphId = charCodeToGlyphId[originalCharCode]; - var fontCharCode = originalCharCode; - // First try to map the value to a unicode position if a non identity map - // was created. - if (!isIdentityUnicode && toUnicode.has(originalCharCode)) { - var unicode = toUnicode.get(fontCharCode); - // TODO: Try to map ligatures to the correct spot. - if (unicode.length === 1) { - fontCharCode = unicode.charCodeAt(0); - } - } - // Try to move control characters, special characters and already mapped - // characters to the private use area since they will not be drawn by - // canvas if left in their current position. Also, move characters if the - // font was symbolic and there is only an identity unicode map since the - // characters probably aren't in the correct position (fixes an issue - // with firefox and thuluthfont). - if ((usedFontCharCodes[fontCharCode] !== undefined || - isProblematicUnicodeLocation(fontCharCode) || - (isSymbolic && isIdentityUnicode)) && - nextAvailableFontCharCode <= PRIVATE_USE_OFFSET_END) { // Room left. - // Loop to try and find a free spot in the private use area. - do { - fontCharCode = nextAvailableFontCharCode++; - - if (SKIP_PRIVATE_USE_RANGE_F000_TO_F01F && fontCharCode === 0xF000) { - fontCharCode = 0xF020; - nextAvailableFontCharCode = fontCharCode + 1; - } - - } while (usedFontCharCodes[fontCharCode] !== undefined && - nextAvailableFontCharCode <= PRIVATE_USE_OFFSET_END); - } - - newMap[fontCharCode] = glyphId; - toFontChar[originalCharCode] = fontCharCode; - usedFontCharCodes[fontCharCode] = true; - } - return { - toFontChar: toFontChar, - charCodeToGlyphId: newMap, - nextAvailableFontCharCode: nextAvailableFontCharCode - }; - } - - function getRanges(glyphs, numGlyphs) { - // Array.sort() sorts by characters, not numerically, so convert to an - // array of characters. - var codes = []; - for (var charCode in glyphs) { - // Remove an invalid glyph ID mappings to make OTS happy. - if (glyphs[charCode] >= numGlyphs) { - continue; - } - codes.push({ fontCharCode: charCode | 0, glyphId: glyphs[charCode] }); - } - codes.sort(function fontGetRangesSort(a, b) { - return a.fontCharCode - b.fontCharCode; - }); - - // Split the sorted codes into ranges. - var ranges = []; - var length = codes.length; - for (var n = 0; n < length; ) { - var start = codes[n].fontCharCode; - var codeIndices = [codes[n].glyphId]; - ++n; - var end = start; - while (n < length && end + 1 === codes[n].fontCharCode) { - codeIndices.push(codes[n].glyphId); - ++end; - ++n; - if (end === 0xFFFF) { - break; - } - } - ranges.push([start, end, codeIndices]); - } - - return ranges; - } - - function createCmapTable(glyphs, numGlyphs) { - var ranges = getRanges(glyphs, numGlyphs); - var numTables = ranges[ranges.length - 1][1] > 0xFFFF ? 2 : 1; - var cmap = '\x00\x00' + // version - string16(numTables) + // numTables - '\x00\x03' + // platformID - '\x00\x01' + // encodingID - string32(4 + numTables * 8); // start of the table record - - var i, ii, j, jj; - for (i = ranges.length - 1; i >= 0; --i) { - if (ranges[i][0] <= 0xFFFF) { break; } - } - var bmpLength = i + 1; - - if (ranges[i][0] < 0xFFFF && ranges[i][1] === 0xFFFF) { - ranges[i][1] = 0xFFFE; - } - var trailingRangesCount = ranges[i][1] < 0xFFFF ? 1 : 0; - var segCount = bmpLength + trailingRangesCount; - var searchParams = OpenTypeFileBuilder.getSearchParams(segCount, 2); - - // Fill up the 4 parallel arrays describing the segments. - var startCount = ''; - var endCount = ''; - var idDeltas = ''; - var idRangeOffsets = ''; - var glyphsIds = ''; - var bias = 0; - - var range, start, end, codes; - for (i = 0, ii = bmpLength; i < ii; i++) { - range = ranges[i]; - start = range[0]; - end = range[1]; - startCount += string16(start); - endCount += string16(end); - codes = range[2]; - var contiguous = true; - for (j = 1, jj = codes.length; j < jj; ++j) { - if (codes[j] !== codes[j - 1] + 1) { - contiguous = false; - break; - } - } - if (!contiguous) { - var offset = (segCount - i) * 2 + bias * 2; - bias += (end - start + 1); - - idDeltas += string16(0); - idRangeOffsets += string16(offset); - - for (j = 0, jj = codes.length; j < jj; ++j) { - glyphsIds += string16(codes[j]); - } - } else { - var startCode = codes[0]; - - idDeltas += string16((startCode - start) & 0xFFFF); - idRangeOffsets += string16(0); - } - } - - if (trailingRangesCount > 0) { - endCount += '\xFF\xFF'; - startCount += '\xFF\xFF'; - idDeltas += '\x00\x01'; - idRangeOffsets += '\x00\x00'; - } - - var format314 = '\x00\x00' + // language - string16(2 * segCount) + - string16(searchParams.range) + - string16(searchParams.entry) + - string16(searchParams.rangeShift) + - endCount + '\x00\x00' + startCount + - idDeltas + idRangeOffsets + glyphsIds; - - var format31012 = ''; - var header31012 = ''; - if (numTables > 1) { - cmap += '\x00\x03' + // platformID - '\x00\x0A' + // encodingID - string32(4 + numTables * 8 + - 4 + format314.length); // start of the table record - format31012 = ''; - for (i = 0, ii = ranges.length; i < ii; i++) { - range = ranges[i]; - start = range[0]; - codes = range[2]; - var code = codes[0]; - for (j = 1, jj = codes.length; j < jj; ++j) { - if (codes[j] !== codes[j - 1] + 1) { - end = range[0] + j - 1; - format31012 += string32(start) + // startCharCode - string32(end) + // endCharCode - string32(code); // startGlyphID - start = end + 1; - code = codes[j]; - } - } - format31012 += string32(start) + // startCharCode - string32(range[1]) + // endCharCode - string32(code); // startGlyphID - } - header31012 = '\x00\x0C' + // format - '\x00\x00' + // reserved - string32(format31012.length + 16) + // length - '\x00\x00\x00\x00' + // language - string32(format31012.length / 12); // nGroups - } - - return cmap + '\x00\x04' + // format - string16(format314.length + 4) + // length - format314 + header31012 + format31012; - } - - function validateOS2Table(os2) { - var stream = new Stream(os2.data); - var version = stream.getUint16(); - // TODO verify all OS/2 tables fields, but currently we validate only those - // that give us issues - stream.getBytes(60); // skipping type, misc sizes, panose, unicode ranges - var selection = stream.getUint16(); - if (version < 4 && (selection & 0x0300)) { - return false; - } - var firstChar = stream.getUint16(); - var lastChar = stream.getUint16(); - if (firstChar > lastChar) { - return false; - } - stream.getBytes(6); // skipping sTypoAscender/Descender/LineGap - var usWinAscent = stream.getUint16(); - if (usWinAscent === 0) { // makes font unreadable by windows - return false; - } - - // OS/2 appears to be valid, resetting some fields - os2.data[8] = os2.data[9] = 0; // IE rejects fonts if fsType != 0 - return true; - } - - function createOS2Table(properties, charstrings, override) { - override = override || { - unitsPerEm: 0, - yMax: 0, - yMin: 0, - ascent: 0, - descent: 0 - }; - - var ulUnicodeRange1 = 0; - var ulUnicodeRange2 = 0; - var ulUnicodeRange3 = 0; - var ulUnicodeRange4 = 0; - - var firstCharIndex = null; - var lastCharIndex = 0; - - if (charstrings) { - for (var code in charstrings) { - code |= 0; - if (firstCharIndex > code || !firstCharIndex) { - firstCharIndex = code; - } - if (lastCharIndex < code) { - lastCharIndex = code; - } - - var position = getUnicodeRangeFor(code); - if (position < 32) { - ulUnicodeRange1 |= 1 << position; - } else if (position < 64) { - ulUnicodeRange2 |= 1 << position - 32; - } else if (position < 96) { - ulUnicodeRange3 |= 1 << position - 64; - } else if (position < 123) { - ulUnicodeRange4 |= 1 << position - 96; - } else { - error('Unicode ranges Bits > 123 are reserved for internal usage'); - } - } - } else { - // TODO - firstCharIndex = 0; - lastCharIndex = 255; - } - - var bbox = properties.bbox || [0, 0, 0, 0]; - var unitsPerEm = (override.unitsPerEm || - 1 / (properties.fontMatrix || FONT_IDENTITY_MATRIX)[0]); - - // if the font units differ to the PDF glyph space units - // then scale up the values - var scale = (properties.ascentScaled ? 1.0 : - unitsPerEm / PDF_GLYPH_SPACE_UNITS); - - var typoAscent = (override.ascent || - Math.round(scale * (properties.ascent || bbox[3]))); - var typoDescent = (override.descent || - Math.round(scale * (properties.descent || bbox[1]))); - if (typoDescent > 0 && properties.descent > 0 && bbox[1] < 0) { - typoDescent = -typoDescent; // fixing incorrect descent - } - var winAscent = override.yMax || typoAscent; - var winDescent = -override.yMin || -typoDescent; - - return '\x00\x03' + // version - '\x02\x24' + // xAvgCharWidth - '\x01\xF4' + // usWeightClass - '\x00\x05' + // usWidthClass - '\x00\x00' + // fstype (0 to let the font loads via font-face on IE) - '\x02\x8A' + // ySubscriptXSize - '\x02\xBB' + // ySubscriptYSize - '\x00\x00' + // ySubscriptXOffset - '\x00\x8C' + // ySubscriptYOffset - '\x02\x8A' + // ySuperScriptXSize - '\x02\xBB' + // ySuperScriptYSize - '\x00\x00' + // ySuperScriptXOffset - '\x01\xDF' + // ySuperScriptYOffset - '\x00\x31' + // yStrikeOutSize - '\x01\x02' + // yStrikeOutPosition - '\x00\x00' + // sFamilyClass - '\x00\x00\x06' + - String.fromCharCode(properties.fixedPitch ? 0x09 : 0x00) + - '\x00\x00\x00\x00\x00\x00' + // Panose - string32(ulUnicodeRange1) + // ulUnicodeRange1 (Bits 0-31) - string32(ulUnicodeRange2) + // ulUnicodeRange2 (Bits 32-63) - string32(ulUnicodeRange3) + // ulUnicodeRange3 (Bits 64-95) - string32(ulUnicodeRange4) + // ulUnicodeRange4 (Bits 96-127) - '\x2A\x32\x31\x2A' + // achVendID - string16(properties.italicAngle ? 1 : 0) + // fsSelection - string16(firstCharIndex || - properties.firstChar) + // usFirstCharIndex - string16(lastCharIndex || properties.lastChar) + // usLastCharIndex - string16(typoAscent) + // sTypoAscender - string16(typoDescent) + // sTypoDescender - '\x00\x64' + // sTypoLineGap (7%-10% of the unitsPerEM value) - string16(winAscent) + // usWinAscent - string16(winDescent) + // usWinDescent - '\x00\x00\x00\x00' + // ulCodePageRange1 (Bits 0-31) - '\x00\x00\x00\x00' + // ulCodePageRange2 (Bits 32-63) - string16(properties.xHeight) + // sxHeight - string16(properties.capHeight) + // sCapHeight - string16(0) + // usDefaultChar - string16(firstCharIndex || properties.firstChar) + // usBreakChar - '\x00\x03'; // usMaxContext - } - - function createPostTable(properties) { - var angle = Math.floor(properties.italicAngle * (Math.pow(2, 16))); - return ('\x00\x03\x00\x00' + // Version number - string32(angle) + // italicAngle - '\x00\x00' + // underlinePosition - '\x00\x00' + // underlineThickness - string32(properties.fixedPitch) + // isFixedPitch - '\x00\x00\x00\x00' + // minMemType42 - '\x00\x00\x00\x00' + // maxMemType42 - '\x00\x00\x00\x00' + // minMemType1 - '\x00\x00\x00\x00'); // maxMemType1 - } - - function createNameTable(name, proto) { - if (!proto) { - proto = [[], []]; // no strings and unicode strings - } - - var strings = [ - proto[0][0] || 'Original licence', // 0.Copyright - proto[0][1] || name, // 1.Font family - proto[0][2] || 'Unknown', // 2.Font subfamily (font weight) - proto[0][3] || 'uniqueID', // 3.Unique ID - proto[0][4] || name, // 4.Full font name - proto[0][5] || 'Version 0.11', // 5.Version - proto[0][6] || '', // 6.Postscript name - proto[0][7] || 'Unknown', // 7.Trademark - proto[0][8] || 'Unknown', // 8.Manufacturer - proto[0][9] || 'Unknown' // 9.Designer - ]; - - // Mac want 1-byte per character strings while Windows want - // 2-bytes per character, so duplicate the names table - var stringsUnicode = []; - var i, ii, j, jj, str; - for (i = 0, ii = strings.length; i < ii; i++) { - str = proto[1][i] || strings[i]; - - var strBufUnicode = []; - for (j = 0, jj = str.length; j < jj; j++) { - strBufUnicode.push(string16(str.charCodeAt(j))); - } - stringsUnicode.push(strBufUnicode.join('')); - } - - var names = [strings, stringsUnicode]; - var platforms = ['\x00\x01', '\x00\x03']; - var encodings = ['\x00\x00', '\x00\x01']; - var languages = ['\x00\x00', '\x04\x09']; - - var namesRecordCount = strings.length * platforms.length; - var nameTable = - '\x00\x00' + // format - string16(namesRecordCount) + // Number of names Record - string16(namesRecordCount * 12 + 6); // Storage - - // Build the name records field - var strOffset = 0; - for (i = 0, ii = platforms.length; i < ii; i++) { - var strs = names[i]; - for (j = 0, jj = strs.length; j < jj; j++) { - str = strs[j]; - var nameRecord = - platforms[i] + // platform ID - encodings[i] + // encoding ID - languages[i] + // language ID - string16(j) + // name ID - string16(str.length) + - string16(strOffset); - nameTable += nameRecord; - strOffset += str.length; - } - } - - nameTable += strings.join('') + stringsUnicode.join(''); - return nameTable; - } - - Font.prototype = { - name: null, - font: null, - mimetype: null, - encoding: null, - get renderer() { - var renderer = FontRendererFactory.create(this); - return shadow(this, 'renderer', renderer); - }, - - exportData: function Font_exportData() { - var data = {}; - for (var i in this) { - if (this.hasOwnProperty(i)) { - data[i] = this[i]; - } - } - return data; - }, - - checkAndRepair: function Font_checkAndRepair(name, font, properties) { - function readTableEntry(file) { - var tag = bytesToString(file.getBytes(4)); - - var checksum = file.getInt32(); - var offset = file.getInt32() >>> 0; - var length = file.getInt32() >>> 0; - - // Read the table associated data - var previousPosition = file.pos; - file.pos = file.start ? file.start : 0; - file.skip(offset); - var data = file.getBytes(length); - file.pos = previousPosition; - - if (tag === 'head') { - // clearing checksum adjustment - data[8] = data[9] = data[10] = data[11] = 0; - data[17] |= 0x20; //Set font optimized for cleartype flag - } - - return { - tag: tag, - checksum: checksum, - length: length, - offset: offset, - data: data - }; - } - - function readOpenTypeHeader(ttf) { - return { - version: bytesToString(ttf.getBytes(4)), - numTables: ttf.getUint16(), - searchRange: ttf.getUint16(), - entrySelector: ttf.getUint16(), - rangeShift: ttf.getUint16() - }; - } - - /** - * Read the appropriate subtable from the cmap according to 9.6.6.4 from - * PDF spec - */ - function readCmapTable(cmap, font, isSymbolicFont, hasEncoding) { - if (!cmap) { - warn('No cmap table available.'); - return { - platformId: -1, - encodingId: -1, - mappings: [], - hasShortCmap: false - }; - } - var segment; - var start = (font.start ? font.start : 0) + cmap.offset; - font.pos = start; - - var version = font.getUint16(); - var numTables = font.getUint16(); - - var potentialTable; - var canBreak = false; - // There's an order of preference in terms of which cmap subtable to - // use: - // - non-symbolic fonts the preference is a 3,1 table then a 1,0 table - // - symbolic fonts the preference is a 3,0 table then a 1,0 table - // The following takes advantage of the fact that the tables are sorted - // to work. - for (var i = 0; i < numTables; i++) { - var platformId = font.getUint16(); - var encodingId = font.getUint16(); - var offset = font.getInt32() >>> 0; - var useTable = false; - - if (platformId === 0 && encodingId === 0) { - useTable = true; - // Continue the loop since there still may be a higher priority - // table. - } else if (platformId === 1 && encodingId === 0) { - useTable = true; - // Continue the loop since there still may be a higher priority - // table. - } else if (platformId === 3 && encodingId === 1 && - ((!isSymbolicFont && hasEncoding) || !potentialTable)) { - useTable = true; - if (!isSymbolicFont) { - canBreak = true; - } - } else if (isSymbolicFont && platformId === 3 && encodingId === 0) { - useTable = true; - canBreak = true; - } - - if (useTable) { - potentialTable = { - platformId: platformId, - encodingId: encodingId, - offset: offset - }; - } - if (canBreak) { - break; - } - } - - if (potentialTable) { - font.pos = start + potentialTable.offset; - } - if (!potentialTable || font.peekByte() === -1) { - warn('Could not find a preferred cmap table.'); - return { - platformId: -1, - encodingId: -1, - mappings: [], - hasShortCmap: false - }; - } - - var format = font.getUint16(); - var length = font.getUint16(); - var language = font.getUint16(); - - var hasShortCmap = false; - var mappings = []; - var j, glyphId; - - // TODO(mack): refactor this cmap subtable reading logic out - if (format === 0) { - for (j = 0; j < 256; j++) { - var index = font.getByte(); - if (!index) { - continue; - } - mappings.push({ - charCode: j, - glyphId: index - }); - } - hasShortCmap = true; - } else if (format === 4) { - // re-creating the table in format 4 since the encoding - // might be changed - var segCount = (font.getUint16() >> 1); - font.getBytes(6); // skipping range fields - var segIndex, segments = []; - for (segIndex = 0; segIndex < segCount; segIndex++) { - segments.push({ end: font.getUint16() }); - } - font.getUint16(); - for (segIndex = 0; segIndex < segCount; segIndex++) { - segments[segIndex].start = font.getUint16(); - } - - for (segIndex = 0; segIndex < segCount; segIndex++) { - segments[segIndex].delta = font.getUint16(); - } - - var offsetsCount = 0; - for (segIndex = 0; segIndex < segCount; segIndex++) { - segment = segments[segIndex]; - var rangeOffset = font.getUint16(); - if (!rangeOffset) { - segment.offsetIndex = -1; - continue; - } - - var offsetIndex = (rangeOffset >> 1) - (segCount - segIndex); - segment.offsetIndex = offsetIndex; - offsetsCount = Math.max(offsetsCount, offsetIndex + - segment.end - segment.start + 1); - } - - var offsets = []; - for (j = 0; j < offsetsCount; j++) { - offsets.push(font.getUint16()); - } - - for (segIndex = 0; segIndex < segCount; segIndex++) { - segment = segments[segIndex]; - start = segment.start; - var end = segment.end; - var delta = segment.delta; - offsetIndex = segment.offsetIndex; - - for (j = start; j <= end; j++) { - if (j === 0xFFFF) { - continue; - } - - glyphId = (offsetIndex < 0 ? - j : offsets[offsetIndex + j - start]); - glyphId = (glyphId + delta) & 0xFFFF; - if (glyphId === 0) { - continue; - } - mappings.push({ - charCode: j, - glyphId: glyphId - }); - } - } - } else if (format === 6) { - // Format 6 is a 2-bytes dense mapping, which means the font data - // lives glue together even if they are pretty far in the unicode - // table. (This looks weird, so I can have missed something), this - // works on Linux but seems to fails on Mac so let's rewrite the - // cmap table to a 3-1-4 style - var firstCode = font.getUint16(); - var entryCount = font.getUint16(); - - for (j = 0; j < entryCount; j++) { - glyphId = font.getUint16(); - var charCode = firstCode + j; - - mappings.push({ - charCode: charCode, - glyphId: glyphId - }); - } - } else { - warn('cmap table has unsupported format: ' + format); - return { - platformId: -1, - encodingId: -1, - mappings: [], - hasShortCmap: false - }; - } - - // removing duplicate entries - mappings.sort(function (a, b) { - return a.charCode - b.charCode; - }); - for (i = 1; i < mappings.length; i++) { - if (mappings[i - 1].charCode === mappings[i].charCode) { - mappings.splice(i, 1); - i--; - } - } - - return { - platformId: potentialTable.platformId, - encodingId: potentialTable.encodingId, - mappings: mappings, - hasShortCmap: hasShortCmap - }; - } - - function sanitizeMetrics(font, header, metrics, numGlyphs) { - if (!header) { - if (metrics) { - metrics.data = null; - } - return; - } - - font.pos = (font.start ? font.start : 0) + header.offset; - font.pos += header.length - 2; - var numOfMetrics = font.getUint16(); - - if (numOfMetrics > numGlyphs) { - info('The numOfMetrics (' + numOfMetrics + ') should not be ' + - 'greater than the numGlyphs (' + numGlyphs + ')'); - // Reduce numOfMetrics if it is greater than numGlyphs - numOfMetrics = numGlyphs; - header.data[34] = (numOfMetrics & 0xff00) >> 8; - header.data[35] = numOfMetrics & 0x00ff; - } - - var numOfSidebearings = numGlyphs - numOfMetrics; - var numMissing = numOfSidebearings - - ((metrics.length - numOfMetrics * 4) >> 1); - - if (numMissing > 0) { - // For each missing glyph, we set both the width and lsb to 0 (zero). - // Since we need to add two properties for each glyph, this explains - // the use of |numMissing * 2| when initializing the typed array. - var entries = new Uint8Array(metrics.length + numMissing * 2); - entries.set(metrics.data); - metrics.data = entries; - } - } - - function sanitizeGlyph(source, sourceStart, sourceEnd, dest, destStart, - hintsValid) { - if (sourceEnd - sourceStart <= 12) { - // glyph with data less than 12 is invalid one - return 0; - } - var glyf = source.subarray(sourceStart, sourceEnd); - var contoursCount = (glyf[0] << 8) | glyf[1]; - if (contoursCount & 0x8000) { - // complex glyph, writing as is - dest.set(glyf, destStart); - return glyf.length; - } - - var i, j = 10, flagsCount = 0; - for (i = 0; i < contoursCount; i++) { - var endPoint = (glyf[j] << 8) | glyf[j + 1]; - flagsCount = endPoint + 1; - j += 2; - } - // skipping instructions - var instructionsStart = j; - var instructionsLength = (glyf[j] << 8) | glyf[j + 1]; - j += 2 + instructionsLength; - var instructionsEnd = j; - // validating flags - var coordinatesLength = 0; - for (i = 0; i < flagsCount; i++) { - var flag = glyf[j++]; - if (flag & 0xC0) { - // reserved flags must be zero, cleaning up - glyf[j - 1] = flag & 0x3F; - } - var xyLength = ((flag & 2) ? 1 : (flag & 16) ? 0 : 2) + - ((flag & 4) ? 1 : (flag & 32) ? 0 : 2); - coordinatesLength += xyLength; - if (flag & 8) { - var repeat = glyf[j++]; - i += repeat; - coordinatesLength += repeat * xyLength; - } - } - // glyph without coordinates will be rejected - if (coordinatesLength === 0) { - return 0; - } - var glyphDataLength = j + coordinatesLength; - if (glyphDataLength > glyf.length) { - // not enough data for coordinates - return 0; - } - if (!hintsValid && instructionsLength > 0) { - dest.set(glyf.subarray(0, instructionsStart), destStart); - dest.set([0, 0], destStart + instructionsStart); - dest.set(glyf.subarray(instructionsEnd, glyphDataLength), - destStart + instructionsStart + 2); - glyphDataLength -= instructionsLength; - if (glyf.length - glyphDataLength > 3) { - glyphDataLength = (glyphDataLength + 3) & ~3; - } - return glyphDataLength; - } - if (glyf.length - glyphDataLength > 3) { - // truncating and aligning to 4 bytes the long glyph data - glyphDataLength = (glyphDataLength + 3) & ~3; - dest.set(glyf.subarray(0, glyphDataLength), destStart); - return glyphDataLength; - } - // glyph data is fine - dest.set(glyf, destStart); - return glyf.length; - } - - function sanitizeHead(head, numGlyphs, locaLength) { - var data = head.data; - - // Validate version: - // Should always be 0x00010000 - var version = int32(data[0], data[1], data[2], data[3]); - if (version >> 16 !== 1) { - info('Attempting to fix invalid version in head table: ' + version); - data[0] = 0; - data[1] = 1; - data[2] = 0; - data[3] = 0; - } - - var indexToLocFormat = int16(data[50], data[51]); - if (indexToLocFormat < 0 || indexToLocFormat > 1) { - info('Attempting to fix invalid indexToLocFormat in head table: ' + - indexToLocFormat); - - // The value of indexToLocFormat should be 0 if the loca table - // consists of short offsets, and should be 1 if the loca table - // consists of long offsets. - // - // The number of entries in the loca table should be numGlyphs + 1. - // - // Using this information, we can work backwards to deduce if the - // size of each offset in the loca table, and thus figure out the - // appropriate value for indexToLocFormat. - - var numGlyphsPlusOne = numGlyphs + 1; - if (locaLength === numGlyphsPlusOne << 1) { - // 0x0000 indicates the loca table consists of short offsets - data[50] = 0; - data[51] = 0; - } else if (locaLength === numGlyphsPlusOne << 2) { - // 0x0001 indicates the loca table consists of long offsets - data[50] = 0; - data[51] = 1; - } else { - warn('Could not fix indexToLocFormat: ' + indexToLocFormat); - } - } - } - - function sanitizeGlyphLocations(loca, glyf, numGlyphs, - isGlyphLocationsLong, hintsValid, - dupFirstEntry) { - var itemSize, itemDecode, itemEncode; - if (isGlyphLocationsLong) { - itemSize = 4; - itemDecode = function fontItemDecodeLong(data, offset) { - return (data[offset] << 24) | (data[offset + 1] << 16) | - (data[offset + 2] << 8) | data[offset + 3]; - }; - itemEncode = function fontItemEncodeLong(data, offset, value) { - data[offset] = (value >>> 24) & 0xFF; - data[offset + 1] = (value >> 16) & 0xFF; - data[offset + 2] = (value >> 8) & 0xFF; - data[offset + 3] = value & 0xFF; - }; - } else { - itemSize = 2; - itemDecode = function fontItemDecode(data, offset) { - return (data[offset] << 9) | (data[offset + 1] << 1); - }; - itemEncode = function fontItemEncode(data, offset, value) { - data[offset] = (value >> 9) & 0xFF; - data[offset + 1] = (value >> 1) & 0xFF; - }; - } - var locaData = loca.data; - var locaDataSize = itemSize * (1 + numGlyphs); - // is loca.data too short or long? - if (locaData.length !== locaDataSize) { - locaData = new Uint8Array(locaDataSize); - locaData.set(loca.data.subarray(0, locaDataSize)); - loca.data = locaData; - } - // removing the invalid glyphs - var oldGlyfData = glyf.data; - var oldGlyfDataLength = oldGlyfData.length; - var newGlyfData = new Uint8Array(oldGlyfDataLength); - var startOffset = itemDecode(locaData, 0); - var writeOffset = 0; - var missingGlyphData = {}; - itemEncode(locaData, 0, writeOffset); - var i, j; - for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) { - var endOffset = itemDecode(locaData, j); - if (endOffset > oldGlyfDataLength && - ((oldGlyfDataLength + 3) & ~3) === endOffset) { - // Aspose breaks fonts by aligning the glyphs to the qword, but not - // the glyf table size, which makes last glyph out of range. - endOffset = oldGlyfDataLength; - } - if (endOffset > oldGlyfDataLength) { - // glyph end offset points outside glyf data, rejecting the glyph - itemEncode(locaData, j, writeOffset); - startOffset = endOffset; - continue; - } - - if (startOffset === endOffset) { - missingGlyphData[i] = true; - } - - var newLength = sanitizeGlyph(oldGlyfData, startOffset, endOffset, - newGlyfData, writeOffset, hintsValid); - writeOffset += newLength; - itemEncode(locaData, j, writeOffset); - startOffset = endOffset; - } - - if (writeOffset === 0) { - // glyf table cannot be empty -- redoing the glyf and loca tables - // to have single glyph with one point - var simpleGlyph = new Uint8Array( - [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0]); - for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) { - itemEncode(locaData, j, simpleGlyph.length); - } - glyf.data = simpleGlyph; - return missingGlyphData; - } - - if (dupFirstEntry) { - var firstEntryLength = itemDecode(locaData, itemSize); - if (newGlyfData.length > firstEntryLength + writeOffset) { - glyf.data = newGlyfData.subarray(0, firstEntryLength + writeOffset); - } else { - glyf.data = new Uint8Array(firstEntryLength + writeOffset); - glyf.data.set(newGlyfData.subarray(0, writeOffset)); - } - glyf.data.set(newGlyfData.subarray(0, firstEntryLength), writeOffset); - itemEncode(loca.data, locaData.length - itemSize, - writeOffset + firstEntryLength); - } else { - glyf.data = newGlyfData.subarray(0, writeOffset); - } - return missingGlyphData; - } - - function readPostScriptTable(post, properties, maxpNumGlyphs) { - var start = (font.start ? font.start : 0) + post.offset; - font.pos = start; - - var length = post.length, end = start + length; - var version = font.getInt32(); - // skip rest to the tables - font.getBytes(28); - - var glyphNames; - var valid = true; - var i; - - switch (version) { - case 0x00010000: - glyphNames = MacStandardGlyphOrdering; - break; - case 0x00020000: - var numGlyphs = font.getUint16(); - if (numGlyphs !== maxpNumGlyphs) { - valid = false; - break; - } - var glyphNameIndexes = []; - for (i = 0; i < numGlyphs; ++i) { - var index = font.getUint16(); - if (index >= 32768) { - valid = false; - break; - } - glyphNameIndexes.push(index); - } - if (!valid) { - break; - } - var customNames = []; - var strBuf = []; - while (font.pos < end) { - var stringLength = font.getByte(); - strBuf.length = stringLength; - for (i = 0; i < stringLength; ++i) { - strBuf[i] = String.fromCharCode(font.getByte()); - } - customNames.push(strBuf.join('')); - } - glyphNames = []; - for (i = 0; i < numGlyphs; ++i) { - var j = glyphNameIndexes[i]; - if (j < 258) { - glyphNames.push(MacStandardGlyphOrdering[j]); - continue; - } - glyphNames.push(customNames[j - 258]); - } - break; - case 0x00030000: - break; - default: - warn('Unknown/unsupported post table version ' + version); - valid = false; - if (properties.defaultEncoding) { - glyphNames = properties.defaultEncoding; - } - break; - } - properties.glyphNames = glyphNames; - return valid; - } - - function readNameTable(nameTable) { - var start = (font.start ? font.start : 0) + nameTable.offset; - font.pos = start; - - var names = [[], []]; - var length = nameTable.length, end = start + length; - var format = font.getUint16(); - var FORMAT_0_HEADER_LENGTH = 6; - if (format !== 0 || length < FORMAT_0_HEADER_LENGTH) { - // unsupported name table format or table "too" small - return names; - } - var numRecords = font.getUint16(); - var stringsStart = font.getUint16(); - var records = []; - var NAME_RECORD_LENGTH = 12; - var i, ii; - - for (i = 0; i < numRecords && - font.pos + NAME_RECORD_LENGTH <= end; i++) { - var r = { - platform: font.getUint16(), - encoding: font.getUint16(), - language: font.getUint16(), - name: font.getUint16(), - length: font.getUint16(), - offset: font.getUint16() - }; - // using only Macintosh and Windows platform/encoding names - if ((r.platform === 1 && r.encoding === 0 && r.language === 0) || - (r.platform === 3 && r.encoding === 1 && r.language === 0x409)) { - records.push(r); - } - } - for (i = 0, ii = records.length; i < ii; i++) { - var record = records[i]; - var pos = start + stringsStart + record.offset; - if (pos + record.length > end) { - continue; // outside of name table, ignoring - } - font.pos = pos; - var nameIndex = record.name; - if (record.encoding) { - // unicode - var str = ''; - for (var j = 0, jj = record.length; j < jj; j += 2) { - str += String.fromCharCode(font.getUint16()); - } - names[1][nameIndex] = str; - } else { - names[0][nameIndex] = bytesToString(font.getBytes(record.length)); - } - } - return names; - } - - var TTOpsStackDeltas = [ - 0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, 0, 0, -2, -5, - -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, -1, -1, - 1, -1, -999, 0, 1, 0, -1, -2, 0, -1, -2, -1, -1, 0, -1, -1, - 0, 0, -999, -999, -1, -1, -1, -1, -2, -999, -2, -2, -999, 0, -2, -2, - 0, 0, -2, 0, -2, 0, 0, 0, -2, -1, -1, 1, 1, 0, 0, -1, - -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, 0, -999, -1, -1, - -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -2, -999, -999, -999, -999, -999, -1, -1, -2, -2, 0, 0, 0, 0, -1, -1, - -999, -2, -2, 0, 0, -1, -2, -2, 0, 0, 0, -1, -1, -1, -2]; - // 0xC0-DF == -1 and 0xE0-FF == -2 - - function sanitizeTTProgram(table, ttContext) { - var data = table.data; - var i = 0, j, n, b, funcId, pc, lastEndf = 0, lastDeff = 0; - var stack = []; - var callstack = []; - var functionsCalled = []; - var tooComplexToFollowFunctions = - ttContext.tooComplexToFollowFunctions; - var inFDEF = false, ifLevel = 0, inELSE = 0; - for (var ii = data.length; i < ii;) { - var op = data[i++]; - // The TrueType instruction set docs can be found at - // https://developer.apple.com/fonts/TTRefMan/RM05/Chap5.html - if (op === 0x40) { // NPUSHB - pushes n bytes - n = data[i++]; - if (inFDEF || inELSE) { - i += n; - } else { - for (j = 0; j < n; j++) { - stack.push(data[i++]); - } - } - } else if (op === 0x41) { // NPUSHW - pushes n words - n = data[i++]; - if (inFDEF || inELSE) { - i += n * 2; - } else { - for (j = 0; j < n; j++) { - b = data[i++]; - stack.push((b << 8) | data[i++]); - } - } - } else if ((op & 0xF8) === 0xB0) { // PUSHB - pushes bytes - n = op - 0xB0 + 1; - if (inFDEF || inELSE) { - i += n; - } else { - for (j = 0; j < n; j++) { - stack.push(data[i++]); - } - } - } else if ((op & 0xF8) === 0xB8) { // PUSHW - pushes words - n = op - 0xB8 + 1; - if (inFDEF || inELSE) { - i += n * 2; - } else { - for (j = 0; j < n; j++) { - b = data[i++]; - stack.push((b << 8) | data[i++]); - } - } - } else if (op === 0x2B && !tooComplexToFollowFunctions) { // CALL - if (!inFDEF && !inELSE) { - // collecting inforamtion about which functions are used - funcId = stack[stack.length - 1]; - ttContext.functionsUsed[funcId] = true; - if (funcId in ttContext.functionsStackDeltas) { - stack.length += ttContext.functionsStackDeltas[funcId]; - } else if (funcId in ttContext.functionsDefined && - functionsCalled.indexOf(funcId) < 0) { - callstack.push({data: data, i: i, stackTop: stack.length - 1}); - functionsCalled.push(funcId); - pc = ttContext.functionsDefined[funcId]; - if (!pc) { - warn('TT: CALL non-existent function'); - ttContext.hintsValid = false; - return; - } - data = pc.data; - i = pc.i; - } - } - } else if (op === 0x2C && !tooComplexToFollowFunctions) { // FDEF - if (inFDEF || inELSE) { - warn('TT: nested FDEFs not allowed'); - tooComplexToFollowFunctions = true; - } - inFDEF = true; - // collecting inforamtion about which functions are defined - lastDeff = i; - funcId = stack.pop(); - ttContext.functionsDefined[funcId] = {data: data, i: i}; - } else if (op === 0x2D) { // ENDF - end of function - if (inFDEF) { - inFDEF = false; - lastEndf = i; - } else { - pc = callstack.pop(); - if (!pc) { - warn('TT: ENDF bad stack'); - ttContext.hintsValid = false; - return; - } - funcId = functionsCalled.pop(); - data = pc.data; - i = pc.i; - ttContext.functionsStackDeltas[funcId] = - stack.length - pc.stackTop; - } - } else if (op === 0x89) { // IDEF - instruction definition - if (inFDEF || inELSE) { - warn('TT: nested IDEFs not allowed'); - tooComplexToFollowFunctions = true; - } - inFDEF = true; - // recording it as a function to track ENDF - lastDeff = i; - } else if (op === 0x58) { // IF - ++ifLevel; - } else if (op === 0x1B) { // ELSE - inELSE = ifLevel; - } else if (op === 0x59) { // EIF - if (inELSE === ifLevel) { - inELSE = 0; - } - --ifLevel; - } else if (op === 0x1C) { // JMPR - if (!inFDEF && !inELSE) { - var offset = stack[stack.length - 1]; - // only jumping forward to prevent infinite loop - if (offset > 0) { - i += offset - 1; - } - } - } - // Adjusting stack not extactly, but just enough to get function id - if (!inFDEF && !inELSE) { - var stackDelta = op <= 0x8E ? TTOpsStackDeltas[op] : - op >= 0xC0 && op <= 0xDF ? -1 : op >= 0xE0 ? -2 : 0; - if (op >= 0x71 && op <= 0x75) { - n = stack.pop(); - if (n === n) { - stackDelta = -n * 2; - } - } - while (stackDelta < 0 && stack.length > 0) { - stack.pop(); - stackDelta++; - } - while (stackDelta > 0) { - stack.push(NaN); // pushing any number into stack - stackDelta--; - } - } - } - ttContext.tooComplexToFollowFunctions = tooComplexToFollowFunctions; - var content = [data]; - if (i > data.length) { - content.push(new Uint8Array(i - data.length)); - } - if (lastDeff > lastEndf) { - warn('TT: complementing a missing function tail'); - // new function definition started, but not finished - // complete function by [CLEAR, ENDF] - content.push(new Uint8Array([0x22, 0x2D])); - } - foldTTTable(table, content); - } - - function checkInvalidFunctions(ttContext, maxFunctionDefs) { - if (ttContext.tooComplexToFollowFunctions) { - return; - } - if (ttContext.functionsDefined.length > maxFunctionDefs) { - warn('TT: more functions defined than expected'); - ttContext.hintsValid = false; - return; - } - for (var j = 0, jj = ttContext.functionsUsed.length; j < jj; j++) { - if (j > maxFunctionDefs) { - warn('TT: invalid function id: ' + j); - ttContext.hintsValid = false; - return; - } - if (ttContext.functionsUsed[j] && !ttContext.functionsDefined[j]) { - warn('TT: undefined function: ' + j); - ttContext.hintsValid = false; - return; - } - } - } - - function foldTTTable(table, content) { - if (content.length > 1) { - // concatenating the content items - var newLength = 0; - var j, jj; - for (j = 0, jj = content.length; j < jj; j++) { - newLength += content[j].length; - } - newLength = (newLength + 3) & ~3; - var result = new Uint8Array(newLength); - var pos = 0; - for (j = 0, jj = content.length; j < jj; j++) { - result.set(content[j], pos); - pos += content[j].length; - } - table.data = result; - table.length = newLength; - } - } - - function sanitizeTTPrograms(fpgm, prep, cvt) { - var ttContext = { - functionsDefined: [], - functionsUsed: [], - functionsStackDeltas: [], - tooComplexToFollowFunctions: false, - hintsValid: true - }; - if (fpgm) { - sanitizeTTProgram(fpgm, ttContext); - } - if (prep) { - sanitizeTTProgram(prep, ttContext); - } - if (fpgm) { - checkInvalidFunctions(ttContext, maxFunctionDefs); - } - if (cvt && (cvt.length & 1)) { - var cvtData = new Uint8Array(cvt.length + 1); - cvtData.set(cvt.data); - cvt.data = cvtData; - } - return ttContext.hintsValid; - } - - // The following steps modify the original font data, making copy - font = new Stream(new Uint8Array(font.getBytes())); - - var VALID_TABLES = ['OS/2', 'cmap', 'head', 'hhea', 'hmtx', 'maxp', - 'name', 'post', 'loca', 'glyf', 'fpgm', 'prep', 'cvt ', 'CFF ']; - - var header = readOpenTypeHeader(font); - var numTables = header.numTables; - var cff, cffFile; - - var tables = { 'OS/2': null, cmap: null, head: null, hhea: null, - hmtx: null, maxp: null, name: null, post: null }; - var table; - for (var i = 0; i < numTables; i++) { - table = readTableEntry(font); - if (VALID_TABLES.indexOf(table.tag) < 0) { - continue; // skipping table if it's not a required or optional table - } - if (table.length === 0) { - continue; // skipping empty tables - } - tables[table.tag] = table; - } - - var isTrueType = !tables['CFF ']; - if (!isTrueType) { - // OpenType font - if ((header.version === 'OTTO' && properties.type !== 'CIDFontType2') || - !tables.head || !tables.hhea || !tables.maxp || !tables.post) { - // no major tables: throwing everything at CFFFont - cffFile = new Stream(tables['CFF '].data); - cff = new CFFFont(cffFile, properties); - - adjustWidths(properties); - - return this.convert(name, cff, properties); - } - - delete tables.glyf; - delete tables.loca; - delete tables.fpgm; - delete tables.prep; - delete tables['cvt ']; - this.isOpenType = true; - } else { - if (!tables.glyf || !tables.loca) { - error('Required "glyf" or "loca" tables are not found'); - } - this.isOpenType = false; - } - - if (!tables.maxp) { - error('Required "maxp" table is not found'); - } - - font.pos = (font.start || 0) + tables.maxp.offset; - var version = font.getInt32(); - var numGlyphs = font.getUint16(); - var maxFunctionDefs = 0; - if (version >= 0x00010000 && tables.maxp.length >= 22) { - // maxZones can be invalid - font.pos += 8; - var maxZones = font.getUint16(); - if (maxZones > 2) { // reset to 2 if font has invalid maxZones - tables.maxp.data[14] = 0; - tables.maxp.data[15] = 2; - } - font.pos += 4; - maxFunctionDefs = font.getUint16(); - } - - var dupFirstEntry = false; - if (properties.type === 'CIDFontType2' && properties.toUnicode && - properties.toUnicode.get(0) > '\u0000') { - // oracle's defect (see 3427), duplicating first entry - dupFirstEntry = true; - numGlyphs++; - tables.maxp.data[4] = numGlyphs >> 8; - tables.maxp.data[5] = numGlyphs & 255; - } - - var hintsValid = sanitizeTTPrograms(tables.fpgm, tables.prep, - tables['cvt '], maxFunctionDefs); - if (!hintsValid) { - delete tables.fpgm; - delete tables.prep; - delete tables['cvt ']; - } - - // Ensure the hmtx table contains the advance width and - // sidebearings information for numGlyphs in the maxp table - sanitizeMetrics(font, tables.hhea, tables.hmtx, numGlyphs); - - if (!tables.head) { - error('Required "head" table is not found'); - } - - sanitizeHead(tables.head, numGlyphs, isTrueType ? tables.loca.length : 0); - - var missingGlyphs = {}; - if (isTrueType) { - var isGlyphLocationsLong = int16(tables.head.data[50], - tables.head.data[51]); - missingGlyphs = sanitizeGlyphLocations(tables.loca, tables.glyf, - numGlyphs, isGlyphLocationsLong, - hintsValid, dupFirstEntry); - } - - if (!tables.hhea) { - error('Required "hhea" table is not found'); - } - - // Sanitizer reduces the glyph advanceWidth to the maxAdvanceWidth - // Sometimes it's 0. That needs to be fixed - if (tables.hhea.data[10] === 0 && tables.hhea.data[11] === 0) { - tables.hhea.data[10] = 0xFF; - tables.hhea.data[11] = 0xFF; - } - - // Extract some more font properties from the OpenType head and - // hhea tables; yMin and descent value are always negative. - var metricsOverride = { - unitsPerEm: int16(tables.head.data[18], tables.head.data[19]), - yMax: int16(tables.head.data[42], tables.head.data[43]), - yMin: int16(tables.head.data[38], tables.head.data[39]) - 0x10000, - ascent: int16(tables.hhea.data[4], tables.hhea.data[5]), - descent: int16(tables.hhea.data[6], tables.hhea.data[7]) - 0x10000 - }; - - // PDF FontDescriptor metrics lie -- using data from actual font. - this.ascent = metricsOverride.ascent / metricsOverride.unitsPerEm; - this.descent = metricsOverride.descent / metricsOverride.unitsPerEm; - - // The 'post' table has glyphs names. - if (tables.post) { - var valid = readPostScriptTable(tables.post, properties, numGlyphs); - if (!valid) { - tables.post = null; - } - } - - var charCodeToGlyphId = [], charCode; - var toUnicode = properties.toUnicode, widths = properties.widths; - var skipToUnicode = (toUnicode instanceof IdentityToUnicodeMap || - toUnicode.length === 0x10000); - - // Helper function to try to skip mapping of empty glyphs. - // Note: In some cases, just relying on the glyph data doesn't work, - // hence we also use a few heuristics to fix various PDF files. - function hasGlyph(glyphId, charCode, widthCode) { - if (!missingGlyphs[glyphId]) { - return true; - } - if (!skipToUnicode && charCode >= 0 && toUnicode.has(charCode)) { - return true; - } - if (widths && widthCode >= 0 && isNum(widths[widthCode])) { - return true; - } - return false; - } - - if (properties.type === 'CIDFontType2') { - var cidToGidMap = properties.cidToGidMap || []; - var isCidToGidMapEmpty = cidToGidMap.length === 0; - - properties.cMap.forEach(function(charCode, cid) { - assert(cid <= 0xffff, 'Max size of CID is 65,535'); - var glyphId = -1; - if (isCidToGidMapEmpty) { - glyphId = charCode; - } else if (cidToGidMap[cid] !== undefined) { - glyphId = cidToGidMap[cid]; - } - - if (glyphId >= 0 && glyphId < numGlyphs && - hasGlyph(glyphId, charCode, cid)) { - charCodeToGlyphId[charCode] = glyphId; - } - }); - if (dupFirstEntry) { - charCodeToGlyphId[0] = numGlyphs - 1; - } - } else { - // Most of the following logic in this code branch is based on the - // 9.6.6.4 of the PDF spec. - var hasEncoding = - properties.differences.length > 0 || !!properties.baseEncodingName; - var cmapTable = - readCmapTable(tables.cmap, font, this.isSymbolicFont, hasEncoding); - var cmapPlatformId = cmapTable.platformId; - var cmapEncodingId = cmapTable.encodingId; - var cmapMappings = cmapTable.mappings; - var cmapMappingsLength = cmapMappings.length; - - // The spec seems to imply that if the font is symbolic the encoding - // should be ignored, this doesn't appear to work for 'preistabelle.pdf' - // where the the font is symbolic and it has an encoding. - if (hasEncoding && - (cmapPlatformId === 3 && cmapEncodingId === 1 || - cmapPlatformId === 1 && cmapEncodingId === 0) || - (cmapPlatformId === -1 && cmapEncodingId === -1 && // Temporary hack - !!Encodings[properties.baseEncodingName])) { // Temporary hack - // When no preferred cmap table was found and |baseEncodingName| is - // one of the predefined encodings, we seem to obtain a better - // |charCodeToGlyphId| map from the code below (fixes bug 1057544). - // TODO: Note that this is a hack which should be removed as soon as - // we have proper support for more exotic cmap tables. - - var baseEncoding = []; - if (properties.baseEncodingName === 'MacRomanEncoding' || - properties.baseEncodingName === 'WinAnsiEncoding') { - baseEncoding = Encodings[properties.baseEncodingName]; - } - for (charCode = 0; charCode < 256; charCode++) { - var glyphName; - if (this.differences && charCode in this.differences) { - glyphName = this.differences[charCode]; - } else if (charCode in baseEncoding && - baseEncoding[charCode] !== '') { - glyphName = baseEncoding[charCode]; - } else { - glyphName = Encodings.StandardEncoding[charCode]; - } - if (!glyphName) { - continue; - } - var unicodeOrCharCode, isUnicode = false; - if (cmapPlatformId === 3 && cmapEncodingId === 1) { - unicodeOrCharCode = GlyphsUnicode[glyphName]; - isUnicode = true; - } else if (cmapPlatformId === 1 && cmapEncodingId === 0) { - // TODO: the encoding needs to be updated with mac os table. - unicodeOrCharCode = Encodings.MacRomanEncoding.indexOf(glyphName); - } - - var found = false; - for (i = 0; i < cmapMappingsLength; ++i) { - if (cmapMappings[i].charCode !== unicodeOrCharCode) { - continue; - } - var code = isUnicode ? charCode : unicodeOrCharCode; - if (hasGlyph(cmapMappings[i].glyphId, code, -1)) { - charCodeToGlyphId[charCode] = cmapMappings[i].glyphId; - found = true; - break; - } - } - if (!found && properties.glyphNames) { - // Try to map using the post table. - var glyphId = properties.glyphNames.indexOf(glyphName); - if (glyphId > 0 && hasGlyph(glyphId, -1, -1)) { - charCodeToGlyphId[charCode] = glyphId; - } else { - charCodeToGlyphId[charCode] = 0; // notdef - } - } - } - } else if (cmapPlatformId === 0 && cmapEncodingId === 0) { - // Default Unicode semantics, use the charcodes as is. - for (i = 0; i < cmapMappingsLength; ++i) { - charCodeToGlyphId[cmapMappings[i].charCode] = - cmapMappings[i].glyphId; - } - } else { - // For (3, 0) cmap tables: - // The charcode key being stored in charCodeToGlyphId is the lower - // byte of the two-byte charcodes of the cmap table since according to - // the spec: 'each byte from the string shall be prepended with the - // high byte of the range [of charcodes in the cmap table], to form - // a two-byte character, which shall be used to select the - // associated glyph description from the subtable'. - // - // For (1, 0) cmap tables: - // 'single bytes from the string shall be used to look up the - // associated glyph descriptions from the subtable'. This means - // charcodes in the cmap will be single bytes, so no-op since - // glyph.charCode & 0xFF === glyph.charCode - for (i = 0; i < cmapMappingsLength; ++i) { - charCode = cmapMappings[i].charCode & 0xFF; - charCodeToGlyphId[charCode] = cmapMappings[i].glyphId; - } - } - } - - if (charCodeToGlyphId.length === 0) { - // defines at least one glyph - charCodeToGlyphId[0] = 0; - } - - // Converting glyphs and ids into font's cmap table - var newMapping = adjustMapping(charCodeToGlyphId, properties); - this.toFontChar = newMapping.toFontChar; - tables.cmap = { - tag: 'cmap', - data: createCmapTable(newMapping.charCodeToGlyphId, numGlyphs) - }; - - if (!tables['OS/2'] || !validateOS2Table(tables['OS/2'])) { - tables['OS/2'] = { - tag: 'OS/2', - data: createOS2Table(properties, newMapping.charCodeToGlyphId, - metricsOverride) - }; - } - - // Rewrite the 'post' table if needed - if (!tables.post) { - tables.post = { - tag: 'post', - data: createPostTable(properties) - }; - } - - if (!isTrueType) { - try { - // Trying to repair CFF file - cffFile = new Stream(tables['CFF '].data); - var parser = new CFFParser(cffFile, properties); - cff = parser.parse(); - var compiler = new CFFCompiler(cff); - tables['CFF '].data = compiler.compile(); - } catch (e) { - warn('Failed to compile font ' + properties.loadedName); - } - } - - // Re-creating 'name' table - if (!tables.name) { - tables.name = { - tag: 'name', - data: createNameTable(this.name) - }; - } else { - // ... using existing 'name' table as prototype - var namePrototype = readNameTable(tables.name); - tables.name.data = createNameTable(name, namePrototype); - } - - var builder = new OpenTypeFileBuilder(header.version); - for (var tableTag in tables) { - builder.addTable(tableTag, tables[tableTag].data); - } - return builder.toArray(); - }, - - convert: function Font_convert(fontName, font, properties) { - // TODO: Check the charstring widths to determine this. - properties.fixedPitch = false; - - var mapping = font.getGlyphMapping(properties); - var newMapping = adjustMapping(mapping, properties); - this.toFontChar = newMapping.toFontChar; - var numGlyphs = font.numGlyphs; - - function getCharCodes(charCodeToGlyphId, glyphId) { - var charCodes = null; - for (var charCode in charCodeToGlyphId) { - if (glyphId === charCodeToGlyphId[charCode]) { - if (!charCodes) { - charCodes = []; - } - charCodes.push(charCode | 0); - } - } - return charCodes; - } - - function createCharCode(charCodeToGlyphId, glyphId) { - for (var charCode in charCodeToGlyphId) { - if (glyphId === charCodeToGlyphId[charCode]) { - return charCode | 0; - } - } - newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode] = - glyphId; - return newMapping.nextAvailableFontCharCode++; - } - - var seacs = font.seacs; - if (SEAC_ANALYSIS_ENABLED && seacs && seacs.length) { - var matrix = properties.fontMatrix || FONT_IDENTITY_MATRIX; - var charset = font.getCharset(); - var seacMap = Object.create(null); - for (var glyphId in seacs) { - glyphId |= 0; - var seac = seacs[glyphId]; - var baseGlyphName = Encodings.StandardEncoding[seac[2]]; - var accentGlyphName = Encodings.StandardEncoding[seac[3]]; - var baseGlyphId = charset.indexOf(baseGlyphName); - var accentGlyphId = charset.indexOf(accentGlyphName); - if (baseGlyphId < 0 || accentGlyphId < 0) { - continue; - } - var accentOffset = { - x: seac[0] * matrix[0] + seac[1] * matrix[2] + matrix[4], - y: seac[0] * matrix[1] + seac[1] * matrix[3] + matrix[5] - }; - - var charCodes = getCharCodes(mapping, glyphId); - if (!charCodes) { - // There's no point in mapping it if the char code was never mapped - // to begin with. - continue; - } - for (var i = 0, ii = charCodes.length; i < ii; i++) { - var charCode = charCodes[i]; - // Find a fontCharCode that maps to the base and accent glyphs. - // If one doesn't exists, create it. - var charCodeToGlyphId = newMapping.charCodeToGlyphId; - var baseFontCharCode = createCharCode(charCodeToGlyphId, - baseGlyphId); - var accentFontCharCode = createCharCode(charCodeToGlyphId, - accentGlyphId); - seacMap[charCode] = { - baseFontCharCode: baseFontCharCode, - accentFontCharCode: accentFontCharCode, - accentOffset: accentOffset - }; - } - } - properties.seacMap = seacMap; - } - - var unitsPerEm = 1 / (properties.fontMatrix || FONT_IDENTITY_MATRIX)[0]; - - var builder = new OpenTypeFileBuilder('\x4F\x54\x54\x4F'); - // PostScript Font Program - builder.addTable('CFF ', font.data); - // OS/2 and Windows Specific metrics - builder.addTable('OS/2', createOS2Table(properties, - newMapping.charCodeToGlyphId)); - // Character to glyphs mapping - builder.addTable('cmap', createCmapTable(newMapping.charCodeToGlyphId, - numGlyphs)); - // Font header - builder.addTable('head', - '\x00\x01\x00\x00' + // Version number - '\x00\x00\x10\x00' + // fontRevision - '\x00\x00\x00\x00' + // checksumAdjustement - '\x5F\x0F\x3C\xF5' + // magicNumber - '\x00\x00' + // Flags - safeString16(unitsPerEm) + // unitsPerEM - '\x00\x00\x00\x00\x9e\x0b\x7e\x27' + // creation date - '\x00\x00\x00\x00\x9e\x0b\x7e\x27' + // modifification date - '\x00\x00' + // xMin - safeString16(properties.descent) + // yMin - '\x0F\xFF' + // xMax - safeString16(properties.ascent) + // yMax - string16(properties.italicAngle ? 2 : 0) + // macStyle - '\x00\x11' + // lowestRecPPEM - '\x00\x00' + // fontDirectionHint - '\x00\x00' + // indexToLocFormat - '\x00\x00'); // glyphDataFormat - - // Horizontal header - builder.addTable('hhea', - '\x00\x01\x00\x00' + // Version number - safeString16(properties.ascent) + // Typographic Ascent - safeString16(properties.descent) + // Typographic Descent - '\x00\x00' + // Line Gap - '\xFF\xFF' + // advanceWidthMax - '\x00\x00' + // minLeftSidebearing - '\x00\x00' + // minRightSidebearing - '\x00\x00' + // xMaxExtent - safeString16(properties.capHeight) + // caretSlopeRise - safeString16(Math.tan(properties.italicAngle) * - properties.xHeight) + // caretSlopeRun - '\x00\x00' + // caretOffset - '\x00\x00' + // -reserved- - '\x00\x00' + // -reserved- - '\x00\x00' + // -reserved- - '\x00\x00' + // -reserved- - '\x00\x00' + // metricDataFormat - string16(numGlyphs)); // Number of HMetrics - - // Horizontal metrics - builder.addTable('hmtx', (function fontFieldsHmtx() { - var charstrings = font.charstrings; - var cffWidths = font.cff ? font.cff.widths : null; - var hmtx = '\x00\x00\x00\x00'; // Fake .notdef - for (var i = 1, ii = numGlyphs; i < ii; i++) { - var width = 0; - if (charstrings) { - var charstring = charstrings[i - 1]; - width = 'width' in charstring ? charstring.width : 0; - } else if (cffWidths) { - width = Math.ceil(cffWidths[i] || 0); - } - hmtx += string16(width) + string16(0); - } - return hmtx; - })()); - - // Maximum profile - builder.addTable('maxp', - '\x00\x00\x50\x00' + // Version number - string16(numGlyphs)); // Num of glyphs - - // Naming tables - builder.addTable('name', createNameTable(fontName)); - - // PostScript informations - builder.addTable('post', createPostTable(properties)); - - return builder.toArray(); - }, - - /** - * Builds a char code to unicode map based on section 9.10 of the spec. - * @param {Object} properties Font properties object. - * @return {Object} A ToUnicodeMap object. - */ - buildToUnicode: function Font_buildToUnicode(properties) { - // Section 9.10.2 Mapping Character Codes to Unicode Values - if (properties.toUnicode && properties.toUnicode.length !== 0) { - return properties.toUnicode; - } - // According to the spec if the font is a simple font we should only map - // to unicode if the base encoding is MacRoman, MacExpert, or WinAnsi or - // the differences array only contains adobe standard or symbol set names, - // in pratice it seems better to always try to create a toUnicode - // map based of the default encoding. - var toUnicode, charcode; - if (!properties.composite /* is simple font */) { - toUnicode = []; - var encoding = properties.defaultEncoding.slice(); - var baseEncodingName = properties.baseEncodingName; - // Merge in the differences array. - var differences = properties.differences; - for (charcode in differences) { - encoding[charcode] = differences[charcode]; - } - for (charcode in encoding) { - // a) Map the character code to a character name. - var glyphName = encoding[charcode]; - // b) Look up the character name in the Adobe Glyph List (see the - // Bibliography) to obtain the corresponding Unicode value. - if (glyphName === '') { - continue; - } else if (GlyphsUnicode[glyphName] === undefined) { - // (undocumented) c) Few heuristics to recognize unknown glyphs - // NOTE: Adobe Reader does not do this step, but OSX Preview does - var code = 0; - switch (glyphName[0]) { - case 'G': // Gxx glyph - if (glyphName.length === 3) { - code = parseInt(glyphName.substr(1), 16); - } - break; - case 'g': // g00xx glyph - if (glyphName.length === 5) { - code = parseInt(glyphName.substr(1), 16); - } - break; - case 'C': // Cddd glyph - case 'c': // cddd glyph - if (glyphName.length >= 3) { - code = +glyphName.substr(1); - } - break; - } - if (code) { - // If |baseEncodingName| is one the predefined encodings, - // and |code| equals |charcode|, using the glyph defined in the - // baseEncoding seems to yield a better |toUnicode| mapping - // (fixes issue 5070). - if (baseEncodingName && code === +charcode) { - var baseEncoding = Encodings[baseEncodingName]; - if (baseEncoding && (glyphName = baseEncoding[charcode])) { - toUnicode[charcode] = - String.fromCharCode(GlyphsUnicode[glyphName]); - continue; - } - } - toUnicode[charcode] = String.fromCharCode(code); - } - continue; - } - toUnicode[charcode] = String.fromCharCode(GlyphsUnicode[glyphName]); - } - return new ToUnicodeMap(toUnicode); - } - // If the font is a composite font that uses one of the predefined CMaps - // listed in Table 118 (except Identity–H and Identity–V) or whose - // descendant CIDFont uses the Adobe-GB1, Adobe-CNS1, Adobe-Japan1, or - // Adobe-Korea1 character collection: - if (properties.composite && ( - (properties.cMap.builtInCMap && - !(properties.cMap instanceof IdentityCMap)) || - (properties.cidSystemInfo.registry === 'Adobe' && - (properties.cidSystemInfo.ordering === 'GB1' || - properties.cidSystemInfo.ordering === 'CNS1' || - properties.cidSystemInfo.ordering === 'Japan1' || - properties.cidSystemInfo.ordering === 'Korea1')))) { - // Then: - // a) Map the character code to a character identifier (CID) according - // to the font’s CMap. - // b) Obtain the registry and ordering of the character collection used - // by the font’s CMap (for example, Adobe and Japan1) from its - // CIDSystemInfo dictionary. - var registry = properties.cidSystemInfo.registry; - var ordering = properties.cidSystemInfo.ordering; - // c) Construct a second CMap name by concatenating the registry and - // ordering obtained in step (b) in the format registry–ordering–UCS2 - // (for example, Adobe–Japan1–UCS2). - var ucs2CMapName = new Name(registry + '-' + ordering + '-UCS2'); - // d) Obtain the CMap with the name constructed in step (c) (available - // from the ASN Web site; see the Bibliography). - var ucs2CMap = CMapFactory.create(ucs2CMapName, - { url: PDFJS.cMapUrl, packed: PDFJS.cMapPacked }, null); - var cMap = properties.cMap; - toUnicode = []; - cMap.forEach(function(charcode, cid) { - assert(cid <= 0xffff, 'Max size of CID is 65,535'); - // e) Map the CID obtained in step (a) according to the CMap obtained - // in step (d), producing a Unicode value. - var ucs2 = ucs2CMap.lookup(cid); - if (ucs2) { - toUnicode[charcode] = - String.fromCharCode((ucs2.charCodeAt(0) << 8) + - ucs2.charCodeAt(1)); - } - }); - return new ToUnicodeMap(toUnicode); - } - - // The viewer's choice, just use an identity map. - return new IdentityToUnicodeMap(properties.firstChar, - properties.lastChar); - }, - - get spaceWidth() { - if ('_shadowWidth' in this) { - return this._shadowWidth; - } - - // trying to estimate space character width - var possibleSpaceReplacements = ['space', 'minus', 'one', 'i']; - var width; - for (var i = 0, ii = possibleSpaceReplacements.length; i < ii; i++) { - var glyphName = possibleSpaceReplacements[i]; - // if possible, getting width by glyph name - if (glyphName in this.widths) { - width = this.widths[glyphName]; - break; - } - var glyphUnicode = GlyphsUnicode[glyphName]; - // finding the charcode via unicodeToCID map - var charcode = 0; - if (this.composite) { - if (this.cMap.contains(glyphUnicode)) { - charcode = this.cMap.lookup(glyphUnicode); - } - } - // ... via toUnicode map - if (!charcode && this.toUnicode) { - charcode = this.toUnicode.charCodeOf(glyphUnicode); - } - // setting it to unicode if negative or undefined - if (charcode <= 0) { - charcode = glyphUnicode; - } - // trying to get width via charcode - width = this.widths[charcode]; - if (width) { - break; // the non-zero width found - } - } - width = width || this.defaultWidth; - // Do not shadow the property here. See discussion: - // https://github.com/mozilla/pdf.js/pull/2127#discussion_r1662280 - this._shadowWidth = width; - return width; - }, - - charToGlyph: function Font_charToGlyph(charcode, isSpace) { - var fontCharCode, width, operatorListId; - - var widthCode = charcode; - if (this.cMap && this.cMap.contains(charcode)) { - widthCode = this.cMap.lookup(charcode); - } - width = this.widths[widthCode]; - width = isNum(width) ? width : this.defaultWidth; - var vmetric = this.vmetrics && this.vmetrics[widthCode]; - - var unicode = this.toUnicode.get(charcode) || charcode; - if (typeof unicode === 'number') { - unicode = String.fromCharCode(unicode); - } - - // First try the toFontChar map, if it's not there then try falling - // back to the char code. - fontCharCode = this.toFontChar[charcode] || charcode; - if (this.missingFile) { - fontCharCode = mapSpecialUnicodeValues(fontCharCode); - } - - if (this.isType3Font) { - // Font char code in this case is actually a glyph name. - operatorListId = fontCharCode; - } - - var accent = null; - if (this.seacMap && this.seacMap[charcode]) { - var seac = this.seacMap[charcode]; - fontCharCode = seac.baseFontCharCode; - accent = { - fontChar: String.fromCharCode(seac.accentFontCharCode), - offset: seac.accentOffset - }; - } - - var fontChar = String.fromCharCode(fontCharCode); - - var glyph = this.glyphCache[charcode]; - if (!glyph || - !glyph.matchesForCache(fontChar, unicode, accent, width, vmetric, - operatorListId, isSpace)) { - glyph = new Glyph(fontChar, unicode, accent, width, vmetric, - operatorListId, isSpace); - this.glyphCache[charcode] = glyph; - } - return glyph; - }, - - charsToGlyphs: function Font_charsToGlyphs(chars) { - var charsCache = this.charsCache; - var glyphs, glyph, charcode; - - // if we translated this string before, just grab it from the cache - if (charsCache) { - glyphs = charsCache[chars]; - if (glyphs) { - return glyphs; - } - } - - // lazily create the translation cache - if (!charsCache) { - charsCache = this.charsCache = Object.create(null); - } - - glyphs = []; - var charsCacheKey = chars; - var i = 0, ii; - - if (this.cMap) { - // composite fonts have multi-byte strings convert the string from - // single-byte to multi-byte - var c = {}; - while (i < chars.length) { - this.cMap.readCharCode(chars, i, c); - charcode = c.charcode; - var length = c.length; - i += length; - // Space is char with code 0x20 and length 1 in multiple-byte codes. - var isSpace = length === 1 && chars.charCodeAt(i - 1) === 0x20; - glyph = this.charToGlyph(charcode, isSpace); - glyphs.push(glyph); - } - } else { - for (i = 0, ii = chars.length; i < ii; ++i) { - charcode = chars.charCodeAt(i); - glyph = this.charToGlyph(charcode, charcode === 0x20); - glyphs.push(glyph); - } - } - - // Enter the translated string into the cache - return (charsCache[charsCacheKey] = glyphs); - } - }; - - return Font; -})(); - -var ErrorFont = (function ErrorFontClosure() { - function ErrorFont(error) { - this.error = error; - this.loadedName = 'g_font_error'; - this.loading = false; - } - - ErrorFont.prototype = { - charsToGlyphs: function ErrorFont_charsToGlyphs() { - return []; - }, - exportData: function ErrorFont_exportData() { - return {error: this.error}; - } - }; - - return ErrorFont; -})(); - -/** - * Shared logic for building a char code to glyph id mapping for Type1 and - * simple CFF fonts. See section 9.6.6.2 of the spec. - * @param {Object} properties Font properties object. - * @param {Object} builtInEncoding The encoding contained within the actual font - * data. - * @param {Array} Array of glyph names where the index is the glyph ID. - * @returns {Object} A char code to glyph ID map. - */ -function type1FontGlyphMapping(properties, builtInEncoding, glyphNames) { - var charCodeToGlyphId = Object.create(null); - var glyphId, charCode, baseEncoding; - - if (properties.baseEncodingName) { - // If a valid base encoding name was used, the mapping is initialized with - // that. - baseEncoding = Encodings[properties.baseEncodingName]; - for (charCode = 0; charCode < baseEncoding.length; charCode++) { - glyphId = glyphNames.indexOf(baseEncoding[charCode]); - if (glyphId >= 0) { - charCodeToGlyphId[charCode] = glyphId; - } else { - charCodeToGlyphId[charCode] = 0; // notdef - } - } - } else if (!!(properties.flags & FontFlags.Symbolic)) { - // For a symbolic font the encoding should be the fonts built-in - // encoding. - for (charCode in builtInEncoding) { - charCodeToGlyphId[charCode] = builtInEncoding[charCode]; - } - } else { - // For non-symbolic fonts that don't have a base encoding the standard - // encoding should be used. - baseEncoding = Encodings.StandardEncoding; - for (charCode = 0; charCode < baseEncoding.length; charCode++) { - glyphId = glyphNames.indexOf(baseEncoding[charCode]); - if (glyphId >= 0) { - charCodeToGlyphId[charCode] = glyphId; - } else { - charCodeToGlyphId[charCode] = 0; // notdef - } - } - } - - // Lastly, merge in the differences. - var differences = properties.differences; - if (differences) { - for (charCode in differences) { - var glyphName = differences[charCode]; - glyphId = glyphNames.indexOf(glyphName); - if (glyphId >= 0) { - charCodeToGlyphId[charCode] = glyphId; - } else { - charCodeToGlyphId[charCode] = 0; // notdef - } - } - } - return charCodeToGlyphId; -} - -/* - * CharStrings are encoded following the the CharString Encoding sequence - * describe in Chapter 6 of the "Adobe Type1 Font Format" specification. - * The value in a byte indicates a command, a number, or subsequent bytes - * that are to be interpreted in a special way. - * - * CharString Number Encoding: - * A CharString byte containing the values from 32 through 255 inclusive - * indicate an integer. These values are decoded in four ranges. - * - * 1. A CharString byte containing a value, v, between 32 and 246 inclusive, - * indicate the integer v - 139. Thus, the integer values from -107 through - * 107 inclusive may be encoded in single byte. - * - * 2. A CharString byte containing a value, v, between 247 and 250 inclusive, - * indicates an integer involving the next byte, w, according to the formula: - * [(v - 247) x 256] + w + 108 - * - * 3. A CharString byte containing a value, v, between 251 and 254 inclusive, - * indicates an integer involving the next byte, w, according to the formula: - * -[(v - 251) * 256] - w - 108 - * - * 4. A CharString containing the value 255 indicates that the next 4 bytes - * are a two complement signed integer. The first of these bytes contains the - * highest order bits, the second byte contains the next higher order bits - * and the fourth byte contain the lowest order bits. - * - * - * CharString Command Encoding: - * CharStrings commands are encoded in 1 or 2 bytes. - * - * Single byte commands are encoded in 1 byte that contains a value between - * 0 and 31 inclusive. - * If a command byte contains the value 12, then the value in the next byte - * indicates a command. This "escape" mechanism allows many extra commands - * to be encoded and this encoding technique helps to minimize the length of - * the charStrings. - */ -var Type1CharString = (function Type1CharStringClosure() { - var COMMAND_MAP = { - 'hstem': [1], - 'vstem': [3], - 'vmoveto': [4], - 'rlineto': [5], - 'hlineto': [6], - 'vlineto': [7], - 'rrcurveto': [8], - 'callsubr': [10], - 'flex': [12, 35], - 'drop' : [12, 18], - 'endchar': [14], - 'rmoveto': [21], - 'hmoveto': [22], - 'vhcurveto': [30], - 'hvcurveto': [31] - }; - - function Type1CharString() { - this.width = 0; - this.lsb = 0; - this.flexing = false; - this.output = []; - this.stack = []; - } - - Type1CharString.prototype = { - convert: function Type1CharString_convert(encoded, subrs) { - var count = encoded.length; - var error = false; - var wx, sbx, subrNumber; - for (var i = 0; i < count; i++) { - var value = encoded[i]; - if (value < 32) { - if (value === 12) { - value = (value << 8) + encoded[++i]; - } - switch (value) { - case 1: // hstem - if (!HINTING_ENABLED) { - this.stack = []; - break; - } - error = this.executeCommand(2, COMMAND_MAP.hstem); - break; - case 3: // vstem - if (!HINTING_ENABLED) { - this.stack = []; - break; - } - error = this.executeCommand(2, COMMAND_MAP.vstem); - break; - case 4: // vmoveto - if (this.flexing) { - if (this.stack.length < 1) { - error = true; - break; - } - // Add the dx for flex and but also swap the values so they are - // the right order. - var dy = this.stack.pop(); - this.stack.push(0, dy); - break; - } - error = this.executeCommand(1, COMMAND_MAP.vmoveto); - break; - case 5: // rlineto - error = this.executeCommand(2, COMMAND_MAP.rlineto); - break; - case 6: // hlineto - error = this.executeCommand(1, COMMAND_MAP.hlineto); - break; - case 7: // vlineto - error = this.executeCommand(1, COMMAND_MAP.vlineto); - break; - case 8: // rrcurveto - error = this.executeCommand(6, COMMAND_MAP.rrcurveto); - break; - case 9: // closepath - // closepath is a Type1 command that does not take argument and is - // useless in Type2 and it can simply be ignored. - this.stack = []; - break; - case 10: // callsubr - if (this.stack.length < 1) { - error = true; - break; - } - subrNumber = this.stack.pop(); - error = this.convert(subrs[subrNumber], subrs); - break; - case 11: // return - return error; - case 13: // hsbw - if (this.stack.length < 2) { - error = true; - break; - } - // To convert to type2 we have to move the width value to the - // first part of the charstring and then use hmoveto with lsb. - wx = this.stack.pop(); - sbx = this.stack.pop(); - this.lsb = sbx; - this.width = wx; - this.stack.push(wx, sbx); - error = this.executeCommand(2, COMMAND_MAP.hmoveto); - break; - case 14: // endchar - this.output.push(COMMAND_MAP.endchar[0]); - break; - case 21: // rmoveto - if (this.flexing) { - break; - } - error = this.executeCommand(2, COMMAND_MAP.rmoveto); - break; - case 22: // hmoveto - if (this.flexing) { - // Add the dy for flex. - this.stack.push(0); - break; - } - error = this.executeCommand(1, COMMAND_MAP.hmoveto); - break; - case 30: // vhcurveto - error = this.executeCommand(4, COMMAND_MAP.vhcurveto); - break; - case 31: // hvcurveto - error = this.executeCommand(4, COMMAND_MAP.hvcurveto); - break; - case (12 << 8) + 0: // dotsection - // dotsection is a Type1 command to specify some hinting feature - // for dots that do not take a parameter and it can safely be - // ignored for Type2. - this.stack = []; - break; - case (12 << 8) + 1: // vstem3 - if (!HINTING_ENABLED) { - this.stack = []; - break; - } - // [vh]stem3 are Type1 only and Type2 supports [vh]stem with - // multiple parameters, so instead of returning [vh]stem3 take a - // shortcut and return [vhstem] instead. - error = this.executeCommand(2, COMMAND_MAP.vstem); - break; - case (12 << 8) + 2: // hstem3 - if (!HINTING_ENABLED) { - this.stack = []; - break; - } - // See vstem3. - error = this.executeCommand(2, COMMAND_MAP.hstem); - break; - case (12 << 8) + 6: // seac - // seac is like type 2's special endchar but it doesn't use the - // first argument asb, so remove it. - if (SEAC_ANALYSIS_ENABLED) { - this.seac = this.stack.splice(-4, 4); - error = this.executeCommand(0, COMMAND_MAP.endchar); - } else { - error = this.executeCommand(4, COMMAND_MAP.endchar); - } - break; - case (12 << 8) + 7: // sbw - if (this.stack.length < 4) { - error = true; - break; - } - // To convert to type2 we have to move the width value to the - // first part of the charstring and then use rmoveto with - // (dx, dy). The height argument will not be used for vmtx and - // vhea tables reconstruction -- ignoring it. - var wy = this.stack.pop(); - wx = this.stack.pop(); - var sby = this.stack.pop(); - sbx = this.stack.pop(); - this.lsb = sbx; - this.width = wx; - this.stack.push(wx, sbx, sby); - error = this.executeCommand(3, COMMAND_MAP.rmoveto); - break; - case (12 << 8) + 12: // div - if (this.stack.length < 2) { - error = true; - break; - } - var num2 = this.stack.pop(); - var num1 = this.stack.pop(); - this.stack.push(num1 / num2); - break; - case (12 << 8) + 16: // callothersubr - if (this.stack.length < 2) { - error = true; - break; - } - subrNumber = this.stack.pop(); - var numArgs = this.stack.pop(); - if (subrNumber === 0 && numArgs === 3) { - var flexArgs = this.stack.splice(this.stack.length - 17, 17); - this.stack.push( - flexArgs[2] + flexArgs[0], // bcp1x + rpx - flexArgs[3] + flexArgs[1], // bcp1y + rpy - flexArgs[4], // bcp2x - flexArgs[5], // bcp2y - flexArgs[6], // p2x - flexArgs[7], // p2y - flexArgs[8], // bcp3x - flexArgs[9], // bcp3y - flexArgs[10], // bcp4x - flexArgs[11], // bcp4y - flexArgs[12], // p3x - flexArgs[13], // p3y - flexArgs[14] // flexDepth - // 15 = finalx unused by flex - // 16 = finaly unused by flex - ); - error = this.executeCommand(13, COMMAND_MAP.flex, true); - this.flexing = false; - this.stack.push(flexArgs[15], flexArgs[16]); - } else if (subrNumber === 1 && numArgs === 0) { - this.flexing = true; - } - break; - case (12 << 8) + 17: // pop - // Ignore this since it is only used with othersubr. - break; - case (12 << 8) + 33: // setcurrentpoint - // Ignore for now. - this.stack = []; - break; - default: - warn('Unknown type 1 charstring command of "' + value + '"'); - break; - } - if (error) { - break; - } - continue; - } else if (value <= 246) { - value = value - 139; - } else if (value <= 250) { - value = ((value - 247) * 256) + encoded[++i] + 108; - } else if (value <= 254) { - value = -((value - 251) * 256) - encoded[++i] - 108; - } else { - value = (encoded[++i] & 0xff) << 24 | (encoded[++i] & 0xff) << 16 | - (encoded[++i] & 0xff) << 8 | (encoded[++i] & 0xff) << 0; - } - this.stack.push(value); - } - return error; - }, - - executeCommand: function(howManyArgs, command, keepStack) { - var stackLength = this.stack.length; - if (howManyArgs > stackLength) { - return true; - } - var start = stackLength - howManyArgs; - for (var i = start; i < stackLength; i++) { - var value = this.stack[i]; - if (value === (value | 0)) { // int - this.output.push(28, (value >> 8) & 0xff, value & 0xff); - } else { // fixed point - value = (65536 * value) | 0; - this.output.push(255, - (value >> 24) & 0xFF, - (value >> 16) & 0xFF, - (value >> 8) & 0xFF, - value & 0xFF); - } - } - this.output.push.apply(this.output, command); - if (keepStack) { - this.stack.splice(start, howManyArgs); - } else { - this.stack.length = 0; - } - return false; - } - }; - - return Type1CharString; -})(); - -/* - * Type1Parser encapsulate the needed code for parsing a Type1 font - * program. Some of its logic depends on the Type2 charstrings - * structure. - * Note: this doesn't really parse the font since that would require evaluation - * of PostScript, but it is possible in most cases to extract what we need - * without a full parse. - */ -var Type1Parser = (function Type1ParserClosure() { - /* - * Decrypt a Sequence of Ciphertext Bytes to Produce the Original Sequence - * of Plaintext Bytes. The function took a key as a parameter which can be - * for decrypting the eexec block of for decoding charStrings. - */ - var EEXEC_ENCRYPT_KEY = 55665; - var CHAR_STRS_ENCRYPT_KEY = 4330; - - function isHexDigit(code) { - return code >= 48 && code <= 57 || // '0'-'9' - code >= 65 && code <= 70 || // 'A'-'F' - code >= 97 && code <= 102; // 'a'-'f' - } - - function decrypt(data, key, discardNumber) { - var r = key | 0, c1 = 52845, c2 = 22719; - var count = data.length; - var decrypted = new Uint8Array(count); - for (var i = 0; i < count; i++) { - var value = data[i]; - decrypted[i] = value ^ (r >> 8); - r = ((value + r) * c1 + c2) & ((1 << 16) - 1); - } - return Array.prototype.slice.call(decrypted, discardNumber); - } - - function decryptAscii(data, key, discardNumber) { - var r = key | 0, c1 = 52845, c2 = 22719; - var count = data.length, maybeLength = count >>> 1; - var decrypted = new Uint8Array(maybeLength); - var i, j; - for (i = 0, j = 0; i < count; i++) { - var digit1 = data[i]; - if (!isHexDigit(digit1)) { - continue; - } - i++; - var digit2; - while (i < count && !isHexDigit(digit2 = data[i])) { - i++; - } - if (i < count) { - var value = parseInt(String.fromCharCode(digit1, digit2), 16); - decrypted[j++] = value ^ (r >> 8); - r = ((value + r) * c1 + c2) & ((1 << 16) - 1); - } - } - return Array.prototype.slice.call(decrypted, discardNumber, j); - } - - function isSpecial(c) { - return c === 0x2F || // '/' - c === 0x5B || c === 0x5D || // '[', ']' - c === 0x7B || c === 0x7D || // '{', '}' - c === 0x28 || c === 0x29; // '(', ')' - } - - function Type1Parser(stream, encrypted) { - if (encrypted) { - var data = stream.getBytes(); - var isBinary = !(isHexDigit(data[0]) && isHexDigit(data[1]) && - isHexDigit(data[2]) && isHexDigit(data[3])); - stream = new Stream(isBinary ? decrypt(data, EEXEC_ENCRYPT_KEY, 4) : - decryptAscii(data, EEXEC_ENCRYPT_KEY, 4)); - } - this.stream = stream; - this.nextChar(); - } - - Type1Parser.prototype = { - readNumberArray: function Type1Parser_readNumberArray() { - this.getToken(); // read '[' or '{' (arrays can start with either) - var array = []; - while (true) { - var token = this.getToken(); - if (token === null || token === ']' || token === '}') { - break; - } - array.push(parseFloat(token || 0)); - } - return array; - }, - - readNumber: function Type1Parser_readNumber() { - var token = this.getToken(); - return parseFloat(token || 0); - }, - - readInt: function Type1Parser_readInt() { - // Use '| 0' to prevent setting a double into length such as the double - // does not flow into the loop variable. - var token = this.getToken(); - return parseInt(token || 0, 10) | 0; - }, - - readBoolean: function Type1Parser_readBoolean() { - var token = this.getToken(); - - // Use 1 and 0 since that's what type2 charstrings use. - return token === 'true' ? 1 : 0; - }, - - nextChar : function Type1_nextChar() { - return (this.currentChar = this.stream.getByte()); - }, - - getToken: function Type1Parser_getToken() { - // Eat whitespace and comments. - var comment = false; - var ch = this.currentChar; - while (true) { - if (ch === -1) { - return null; - } - - if (comment) { - if (ch === 0x0A || ch === 0x0D) { - comment = false; - } - } else if (ch === 0x25) { // '%' - comment = true; - } else if (!Lexer.isSpace(ch)) { - break; - } - ch = this.nextChar(); - } - if (isSpecial(ch)) { - this.nextChar(); - return String.fromCharCode(ch); - } - var token = ''; - do { - token += String.fromCharCode(ch); - ch = this.nextChar(); - } while (ch >= 0 && !Lexer.isSpace(ch) && !isSpecial(ch)); - return token; - }, - - /* - * Returns an object containing a Subrs array and a CharStrings - * array extracted from and eexec encrypted block of data - */ - extractFontProgram: function Type1Parser_extractFontProgram() { - var stream = this.stream; - - var subrs = [], charstrings = []; - var program = { - subrs: [], - charstrings: [], - properties: { - 'privateData': { - 'lenIV': 4 - } - } - }; - var token, length, data, lenIV, encoded; - while ((token = this.getToken()) !== null) { - if (token !== '/') { - continue; - } - token = this.getToken(); - switch (token) { - case 'CharStrings': - // The number immediately following CharStrings must be greater or - // equal to the number of CharStrings. - this.getToken(); - this.getToken(); // read in 'dict' - this.getToken(); // read in 'dup' - this.getToken(); // read in 'begin' - while(true) { - token = this.getToken(); - if (token === null || token === 'end') { - break; - } - - if (token !== '/') { - continue; - } - var glyph = this.getToken(); - length = this.readInt(); - this.getToken(); // read in 'RD' or '-|' - data = stream.makeSubStream(stream.pos, length); - lenIV = program.properties.privateData['lenIV']; - encoded = decrypt(data.getBytes(), CHAR_STRS_ENCRYPT_KEY, lenIV); - // Skip past the required space and binary data. - stream.skip(length); - this.nextChar(); - token = this.getToken(); // read in 'ND' or '|-' - if (token === 'noaccess') { - this.getToken(); // read in 'def' - } - charstrings.push({ - glyph: glyph, - encoded: encoded - }); - } - break; - case 'Subrs': - var num = this.readInt(); - this.getToken(); // read in 'array' - while ((token = this.getToken()) === 'dup') { - var index = this.readInt(); - length = this.readInt(); - this.getToken(); // read in 'RD' or '-|' - data = stream.makeSubStream(stream.pos, length); - lenIV = program.properties.privateData['lenIV']; - encoded = decrypt(data.getBytes(), CHAR_STRS_ENCRYPT_KEY, lenIV); - // Skip past the required space and binary data. - stream.skip(length); - this.nextChar(); - token = this.getToken(); // read in 'NP' or '|' - if (token === 'noaccess') { - this.getToken(); // read in 'put' - } - subrs[index] = encoded; - } - break; - case 'BlueValues': - case 'OtherBlues': - case 'FamilyBlues': - case 'FamilyOtherBlues': - var blueArray = this.readNumberArray(); - // *Blue* values may contain invalid data: disables reading of - // those values when hinting is disabled. - if (blueArray.length > 0 && (blueArray.length % 2) === 0 && - HINTING_ENABLED) { - program.properties.privateData[token] = blueArray; - } - break; - case 'StemSnapH': - case 'StemSnapV': - program.properties.privateData[token] = this.readNumberArray(); - break; - case 'StdHW': - case 'StdVW': - program.properties.privateData[token] = - this.readNumberArray()[0]; - break; - case 'BlueShift': - case 'lenIV': - case 'BlueFuzz': - case 'BlueScale': - case 'LanguageGroup': - case 'ExpansionFactor': - program.properties.privateData[token] = this.readNumber(); - break; - case 'ForceBold': - program.properties.privateData[token] = this.readBoolean(); - break; - } - } - - for (var i = 0; i < charstrings.length; i++) { - glyph = charstrings[i].glyph; - encoded = charstrings[i].encoded; - var charString = new Type1CharString(); - var error = charString.convert(encoded, subrs); - var output = charString.output; - if (error) { - // It seems when FreeType encounters an error while evaluating a glyph - // that it completely ignores the glyph so we'll mimic that behaviour - // here and put an endchar to make the validator happy. - output = [14]; - } - program.charstrings.push({ - glyphName: glyph, - charstring: output, - width: charString.width, - lsb: charString.lsb, - seac: charString.seac - }); - } - - return program; - }, - - extractFontHeader: function Type1Parser_extractFontHeader(properties) { - var token; - while ((token = this.getToken()) !== null) { - if (token !== '/') { - continue; - } - token = this.getToken(); - switch (token) { - case 'FontMatrix': - var matrix = this.readNumberArray(); - properties.fontMatrix = matrix; - break; - case 'Encoding': - var encodingArg = this.getToken(); - var encoding; - if (!/^\d+$/.test(encodingArg)) { - // encoding name is specified - encoding = Encodings[encodingArg]; - } else { - encoding = []; - var size = parseInt(encodingArg, 10) | 0; - this.getToken(); // read in 'array' - - for (var j = 0; j < size; j++) { - token = this.getToken(); - // skipping till first dup or def (e.g. ignoring for statement) - while (token !== 'dup' && token !== 'def') { - token = this.getToken(); - if (token === null) { - return; // invalid header - } - } - if (token === 'def') { - break; // read all array data - } - var index = this.readInt(); - this.getToken(); // read in '/' - var glyph = this.getToken(); - encoding[index] = glyph; - this.getToken(); // read the in 'put' - } - } - properties.builtInEncoding = encoding; - break; - case 'FontBBox': - var fontBBox = this.readNumberArray(); - // adjusting ascent/descent - properties.ascent = fontBBox[3]; - properties.descent = fontBBox[1]; - properties.ascentScaled = true; - break; - } - } - } - }; - - return Type1Parser; -})(); - -/** - * The CFF class takes a Type1 file and wrap it into a - * 'Compact Font Format' which itself embed Type2 charstrings. - */ -var CFFStandardStrings = [ - '.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', - 'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus', - 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', - 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', - 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', - 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', - 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', - 'underscore', 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', - 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', - 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', 'exclamdown', 'cent', - 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', - 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', - 'guilsinglright', 'fi', 'fl', 'endash', 'dagger', 'daggerdbl', - 'periodcentered', 'paragraph', 'bullet', 'quotesinglbase', 'quotedblbase', - 'quotedblright', 'guillemotright', 'ellipsis', 'perthousand', 'questiondown', - 'grave', 'acute', 'circumflex', 'tilde', 'macron', 'breve', 'dotaccent', - 'dieresis', 'ring', 'cedilla', 'hungarumlaut', 'ogonek', 'caron', 'emdash', - 'AE', 'ordfeminine', 'Lslash', 'Oslash', 'OE', 'ordmasculine', 'ae', - 'dotlessi', 'lslash', 'oslash', 'oe', 'germandbls', 'onesuperior', - 'logicalnot', 'mu', 'trademark', 'Eth', 'onehalf', 'plusminus', 'Thorn', - 'onequarter', 'divide', 'brokenbar', 'degree', 'thorn', 'threequarters', - 'twosuperior', 'registered', 'minus', 'eth', 'multiply', 'threesuperior', - 'copyright', 'Aacute', 'Acircumflex', 'Adieresis', 'Agrave', 'Aring', - 'Atilde', 'Ccedilla', 'Eacute', 'Ecircumflex', 'Edieresis', 'Egrave', - 'Iacute', 'Icircumflex', 'Idieresis', 'Igrave', 'Ntilde', 'Oacute', - 'Ocircumflex', 'Odieresis', 'Ograve', 'Otilde', 'Scaron', 'Uacute', - 'Ucircumflex', 'Udieresis', 'Ugrave', 'Yacute', 'Ydieresis', 'Zcaron', - 'aacute', 'acircumflex', 'adieresis', 'agrave', 'aring', 'atilde', - 'ccedilla', 'eacute', 'ecircumflex', 'edieresis', 'egrave', 'iacute', - 'icircumflex', 'idieresis', 'igrave', 'ntilde', 'oacute', 'ocircumflex', - 'odieresis', 'ograve', 'otilde', 'scaron', 'uacute', 'ucircumflex', - 'udieresis', 'ugrave', 'yacute', 'ydieresis', 'zcaron', 'exclamsmall', - 'Hungarumlautsmall', 'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', - 'Acutesmall', 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', - 'onedotenleader', 'zerooldstyle', 'oneoldstyle', 'twooldstyle', - 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', - 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'commasuperior', - 'threequartersemdash', 'periodsuperior', 'questionsmall', 'asuperior', - 'bsuperior', 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', - 'lsuperior', 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', - 'tsuperior', 'ff', 'ffi', 'ffl', 'parenleftinferior', 'parenrightinferior', - 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', 'Asmall', 'Bsmall', - 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall', - 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall', - 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall', - 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah', - 'Tildesmall', 'exclamdownsmall', 'centoldstyle', 'Lslashsmall', - 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', 'Brevesmall', 'Caronsmall', - 'Dotaccentsmall', 'Macronsmall', 'figuredash', 'hypheninferior', - 'Ogoneksmall', 'Ringsmall', 'Cedillasmall', 'questiondownsmall', 'oneeighth', - 'threeeighths', 'fiveeighths', 'seveneighths', 'onethird', 'twothirds', - 'zerosuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', - 'sevensuperior', 'eightsuperior', 'ninesuperior', 'zeroinferior', - 'oneinferior', 'twoinferior', 'threeinferior', 'fourinferior', - 'fiveinferior', 'sixinferior', 'seveninferior', 'eightinferior', - 'nineinferior', 'centinferior', 'dollarinferior', 'periodinferior', - 'commainferior', 'Agravesmall', 'Aacutesmall', 'Acircumflexsmall', - 'Atildesmall', 'Adieresissmall', 'Aringsmall', 'AEsmall', 'Ccedillasmall', - 'Egravesmall', 'Eacutesmall', 'Ecircumflexsmall', 'Edieresissmall', - 'Igravesmall', 'Iacutesmall', 'Icircumflexsmall', 'Idieresissmall', - 'Ethsmall', 'Ntildesmall', 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', - 'Otildesmall', 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', - 'Uacutesmall', 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', - 'Thornsmall', 'Ydieresissmall', '001.000', '001.001', '001.002', '001.003', - 'Black', 'Bold', 'Book', 'Light', 'Medium', 'Regular', 'Roman', 'Semibold' -]; - -// Type1Font is also a CIDFontType0. -var Type1Font = function Type1Font(name, file, properties) { - // Some bad generators embed pfb file as is, we have to strip 6-byte headers. - // Also, length1 and length2 might be off by 6 bytes as well. - // http://www.math.ubc.ca/~cass/piscript/type1.pdf - var PFB_HEADER_SIZE = 6; - var headerBlockLength = properties.length1; - var eexecBlockLength = properties.length2; - var pfbHeader = file.peekBytes(PFB_HEADER_SIZE); - var pfbHeaderPresent = pfbHeader[0] === 0x80 && pfbHeader[1] === 0x01; - if (pfbHeaderPresent) { - file.skip(PFB_HEADER_SIZE); - headerBlockLength = (pfbHeader[5] << 24) | (pfbHeader[4] << 16) | - (pfbHeader[3] << 8) | pfbHeader[2]; - } - - // Get the data block containing glyphs and subrs informations - var headerBlock = new Stream(file.getBytes(headerBlockLength)); - var headerBlockParser = new Type1Parser(headerBlock); - headerBlockParser.extractFontHeader(properties); - - if (pfbHeaderPresent) { - pfbHeader = file.getBytes(PFB_HEADER_SIZE); - eexecBlockLength = (pfbHeader[5] << 24) | (pfbHeader[4] << 16) | - (pfbHeader[3] << 8) | pfbHeader[2]; - } - - // Decrypt the data blocks and retrieve it's content - var eexecBlock = new Stream(file.getBytes(eexecBlockLength)); - var eexecBlockParser = new Type1Parser(eexecBlock, true); - var data = eexecBlockParser.extractFontProgram(); - for (var info in data.properties) { - properties[info] = data.properties[info]; - } - - var charstrings = data.charstrings; - var type2Charstrings = this.getType2Charstrings(charstrings); - var subrs = this.getType2Subrs(data.subrs); - - this.charstrings = charstrings; - this.data = this.wrap(name, type2Charstrings, this.charstrings, - subrs, properties); - this.seacs = this.getSeacs(data.charstrings); -}; - -Type1Font.prototype = { - get numGlyphs() { - return this.charstrings.length + 1; - }, - - getCharset: function Type1Font_getCharset() { - var charset = ['.notdef']; - var charstrings = this.charstrings; - for (var glyphId = 0; glyphId < charstrings.length; glyphId++) { - charset.push(charstrings[glyphId].glyphName); - } - return charset; - }, - - getGlyphMapping: function Type1Font_getGlyphMapping(properties) { - var charstrings = this.charstrings; - var glyphNames = ['.notdef'], glyphId; - for (glyphId = 0; glyphId < charstrings.length; glyphId++) { - glyphNames.push(charstrings[glyphId].glyphName); - } - var encoding = properties.builtInEncoding; - if (encoding) { - var builtInEncoding = {}; - for (var charCode in encoding) { - glyphId = glyphNames.indexOf(encoding[charCode]); - if (glyphId >= 0) { - builtInEncoding[charCode] = glyphId; - } - } - } - - return type1FontGlyphMapping(properties, builtInEncoding, glyphNames); - }, - - getSeacs: function Type1Font_getSeacs(charstrings) { - var i, ii; - var seacMap = []; - for (i = 0, ii = charstrings.length; i < ii; i++) { - var charstring = charstrings[i]; - if (charstring.seac) { - // Offset by 1 for .notdef - seacMap[i + 1] = charstring.seac; - } - } - return seacMap; - }, - - getType2Charstrings: function Type1Font_getType2Charstrings( - type1Charstrings) { - var type2Charstrings = []; - for (var i = 0, ii = type1Charstrings.length; i < ii; i++) { - type2Charstrings.push(type1Charstrings[i].charstring); - } - return type2Charstrings; - }, - - getType2Subrs: function Type1Font_getType2Subrs(type1Subrs) { - var bias = 0; - var count = type1Subrs.length; - if (count < 1133) { - bias = 107; - } else if (count < 33769) { - bias = 1131; - } else { - bias = 32768; - } - - // Add a bunch of empty subrs to deal with the Type2 bias - var type2Subrs = []; - var i; - for (i = 0; i < bias; i++) { - type2Subrs.push([0x0B]); - } - - for (i = 0; i < count; i++) { - type2Subrs.push(type1Subrs[i]); - } - - return type2Subrs; - }, - - wrap: function Type1Font_wrap(name, glyphs, charstrings, subrs, properties) { - var cff = new CFF(); - cff.header = new CFFHeader(1, 0, 4, 4); - - cff.names = [name]; - - var topDict = new CFFTopDict(); - // CFF strings IDs 0...390 are predefined names, so refering - // to entries in our own String INDEX starts at SID 391. - topDict.setByName('version', 391); - topDict.setByName('Notice', 392); - topDict.setByName('FullName', 393); - topDict.setByName('FamilyName', 394); - topDict.setByName('Weight', 395); - topDict.setByName('Encoding', null); // placeholder - topDict.setByName('FontMatrix', properties.fontMatrix); - topDict.setByName('FontBBox', properties.bbox); - topDict.setByName('charset', null); // placeholder - topDict.setByName('CharStrings', null); // placeholder - topDict.setByName('Private', null); // placeholder - cff.topDict = topDict; - - var strings = new CFFStrings(); - strings.add('Version 0.11'); // Version - strings.add('See original notice'); // Notice - strings.add(name); // FullName - strings.add(name); // FamilyName - strings.add('Medium'); // Weight - cff.strings = strings; - - cff.globalSubrIndex = new CFFIndex(); - - var count = glyphs.length; - var charsetArray = [0]; - var i, ii; - for (i = 0; i < count; i++) { - var index = CFFStandardStrings.indexOf(charstrings[i].glyphName); - // TODO: Insert the string and correctly map it. Previously it was - // thought mapping names that aren't in the standard strings to .notdef - // was fine, however in issue818 when mapping them all to .notdef the - // adieresis glyph no longer worked. - if (index === -1) { - index = 0; - } - charsetArray.push((index >> 8) & 0xff, index & 0xff); - } - cff.charset = new CFFCharset(false, 0, [], charsetArray); - - var charStringsIndex = new CFFIndex(); - charStringsIndex.add([0x8B, 0x0E]); // .notdef - for (i = 0; i < count; i++) { - charStringsIndex.add(glyphs[i]); - } - cff.charStrings = charStringsIndex; - - var privateDict = new CFFPrivateDict(); - privateDict.setByName('Subrs', null); // placeholder - var fields = [ - 'BlueValues', - 'OtherBlues', - 'FamilyBlues', - 'FamilyOtherBlues', - 'StemSnapH', - 'StemSnapV', - 'BlueShift', - 'BlueFuzz', - 'BlueScale', - 'LanguageGroup', - 'ExpansionFactor', - 'ForceBold', - 'StdHW', - 'StdVW' - ]; - for (i = 0, ii = fields.length; i < ii; i++) { - var field = fields[i]; - if (!properties.privateData.hasOwnProperty(field)) { - continue; - } - var value = properties.privateData[field]; - if (isArray(value)) { - // All of the private dictionary array data in CFF must be stored as - // "delta-encoded" numbers. - for (var j = value.length - 1; j > 0; j--) { - value[j] -= value[j - 1]; // ... difference from previous value - } - } - privateDict.setByName(field, value); - } - cff.topDict.privateDict = privateDict; - - var subrIndex = new CFFIndex(); - for (i = 0, ii = subrs.length; i < ii; i++) { - subrIndex.add(subrs[i]); - } - privateDict.subrsIndex = subrIndex; - - var compiler = new CFFCompiler(cff); - return compiler.compile(); - } -}; - -var CFFFont = (function CFFFontClosure() { - function CFFFont(file, properties) { - this.properties = properties; - - var parser = new CFFParser(file, properties); - this.cff = parser.parse(); - var compiler = new CFFCompiler(this.cff); - this.seacs = this.cff.seacs; - try { - this.data = compiler.compile(); - } catch (e) { - warn('Failed to compile font ' + properties.loadedName); - // There may have just been an issue with the compiler, set the data - // anyway and hope the font loaded. - this.data = file; - } - } - - CFFFont.prototype = { - get numGlyphs() { - return this.cff.charStrings.count; - }, - getCharset: function CFFFont_getCharset() { - return this.cff.charset.charset; - }, - getGlyphMapping: function CFFFont_getGlyphMapping() { - var cff = this.cff; - var properties = this.properties; - var charsets = cff.charset.charset; - var charCodeToGlyphId; - var glyphId; - - if (properties.composite) { - charCodeToGlyphId = Object.create(null); - if (cff.isCIDFont) { - // If the font is actually a CID font then we should use the charset - // to map CIDs to GIDs. - for (glyphId = 0; glyphId < charsets.length; glyphId++) { - var cid = charsets[glyphId]; - var charCode = properties.cMap.charCodeOf(cid); - charCodeToGlyphId[charCode] = glyphId; - } - } else { - // If it is NOT actually a CID font then CIDs should be mapped - // directly to GIDs. - for (glyphId = 0; glyphId < cff.charStrings.count; glyphId++) { - charCodeToGlyphId[glyphId] = glyphId; - } - } - return charCodeToGlyphId; - } - - var encoding = cff.encoding ? cff.encoding.encoding : null; - charCodeToGlyphId = type1FontGlyphMapping(properties, encoding, charsets); - return charCodeToGlyphId; - } - }; - - return CFFFont; -})(); - -var CFFParser = (function CFFParserClosure() { - var CharstringValidationData = [ - null, - { id: 'hstem', min: 2, stackClearing: true, stem: true }, - null, - { id: 'vstem', min: 2, stackClearing: true, stem: true }, - { id: 'vmoveto', min: 1, stackClearing: true }, - { id: 'rlineto', min: 2, resetStack: true }, - { id: 'hlineto', min: 1, resetStack: true }, - { id: 'vlineto', min: 1, resetStack: true }, - { id: 'rrcurveto', min: 6, resetStack: true }, - null, - { id: 'callsubr', min: 1, undefStack: true }, - { id: 'return', min: 0, undefStack: true }, - null, // 12 - null, - { id: 'endchar', min: 0, stackClearing: true }, - null, - null, - null, - { id: 'hstemhm', min: 2, stackClearing: true, stem: true }, - { id: 'hintmask', min: 0, stackClearing: true }, - { id: 'cntrmask', min: 0, stackClearing: true }, - { id: 'rmoveto', min: 2, stackClearing: true }, - { id: 'hmoveto', min: 1, stackClearing: true }, - { id: 'vstemhm', min: 2, stackClearing: true, stem: true }, - { id: 'rcurveline', min: 8, resetStack: true }, - { id: 'rlinecurve', min: 8, resetStack: true }, - { id: 'vvcurveto', min: 4, resetStack: true }, - { id: 'hhcurveto', min: 4, resetStack: true }, - null, // shortint - { id: 'callgsubr', min: 1, undefStack: true }, - { id: 'vhcurveto', min: 4, resetStack: true }, - { id: 'hvcurveto', min: 4, resetStack: true } - ]; - var CharstringValidationData12 = [ - null, - null, - null, - { id: 'and', min: 2, stackDelta: -1 }, - { id: 'or', min: 2, stackDelta: -1 }, - { id: 'not', min: 1, stackDelta: 0 }, - null, - null, - null, - { id: 'abs', min: 1, stackDelta: 0 }, - { id: 'add', min: 2, stackDelta: -1, - stackFn: function stack_div(stack, index) { - stack[index - 2] = stack[index - 2] + stack[index - 1]; - } - }, - { id: 'sub', min: 2, stackDelta: -1, - stackFn: function stack_div(stack, index) { - stack[index - 2] = stack[index - 2] - stack[index - 1]; - } - }, - { id: 'div', min: 2, stackDelta: -1, - stackFn: function stack_div(stack, index) { - stack[index - 2] = stack[index - 2] / stack[index - 1]; - } - }, - null, - { id: 'neg', min: 1, stackDelta: 0, - stackFn: function stack_div(stack, index) { - stack[index - 1] = -stack[index - 1]; - } - }, - { id: 'eq', min: 2, stackDelta: -1 }, - null, - null, - { id: 'drop', min: 1, stackDelta: -1 }, - null, - { id: 'put', min: 2, stackDelta: -2 }, - { id: 'get', min: 1, stackDelta: 0 }, - { id: 'ifelse', min: 4, stackDelta: -3 }, - { id: 'random', min: 0, stackDelta: 1 }, - { id: 'mul', min: 2, stackDelta: -1, - stackFn: function stack_div(stack, index) { - stack[index - 2] = stack[index - 2] * stack[index - 1]; - } - }, - null, - { id: 'sqrt', min: 1, stackDelta: 0 }, - { id: 'dup', min: 1, stackDelta: 1 }, - { id: 'exch', min: 2, stackDelta: 0 }, - { id: 'index', min: 2, stackDelta: 0 }, - { id: 'roll', min: 3, stackDelta: -2 }, - null, - null, - null, - { id: 'hflex', min: 7, resetStack: true }, - { id: 'flex', min: 13, resetStack: true }, - { id: 'hflex1', min: 9, resetStack: true }, - { id: 'flex1', min: 11, resetStack: true } - ]; - - function CFFParser(file, properties) { - this.bytes = file.getBytes(); - this.properties = properties; - } - CFFParser.prototype = { - parse: function CFFParser_parse() { - var properties = this.properties; - var cff = new CFF(); - this.cff = cff; - - // The first five sections must be in order, all the others are reached - // via offsets contained in one of the below. - var header = this.parseHeader(); - var nameIndex = this.parseIndex(header.endPos); - var topDictIndex = this.parseIndex(nameIndex.endPos); - var stringIndex = this.parseIndex(topDictIndex.endPos); - var globalSubrIndex = this.parseIndex(stringIndex.endPos); - - var topDictParsed = this.parseDict(topDictIndex.obj.get(0)); - var topDict = this.createDict(CFFTopDict, topDictParsed, cff.strings); - - cff.header = header.obj; - cff.names = this.parseNameIndex(nameIndex.obj); - cff.strings = this.parseStringIndex(stringIndex.obj); - cff.topDict = topDict; - cff.globalSubrIndex = globalSubrIndex.obj; - - this.parsePrivateDict(cff.topDict); - - cff.isCIDFont = topDict.hasName('ROS'); - - var charStringOffset = topDict.getByName('CharStrings'); - var charStringsAndSeacs = this.parseCharStrings(charStringOffset); - cff.charStrings = charStringsAndSeacs.charStrings; - cff.seacs = charStringsAndSeacs.seacs; - cff.widths = charStringsAndSeacs.widths; - - var fontMatrix = topDict.getByName('FontMatrix'); - if (fontMatrix) { - properties.fontMatrix = fontMatrix; - } - - var fontBBox = topDict.getByName('FontBBox'); - if (fontBBox) { - // adjusting ascent/descent - properties.ascent = fontBBox[3]; - properties.descent = fontBBox[1]; - properties.ascentScaled = true; - } - - var charset, encoding; - if (cff.isCIDFont) { - var fdArrayIndex = this.parseIndex(topDict.getByName('FDArray')).obj; - for (var i = 0, ii = fdArrayIndex.count; i < ii; ++i) { - var dictRaw = fdArrayIndex.get(i); - var fontDict = this.createDict(CFFTopDict, this.parseDict(dictRaw), - cff.strings); - this.parsePrivateDict(fontDict); - cff.fdArray.push(fontDict); - } - // cid fonts don't have an encoding - encoding = null; - charset = this.parseCharsets(topDict.getByName('charset'), - cff.charStrings.count, cff.strings, true); - cff.fdSelect = this.parseFDSelect(topDict.getByName('FDSelect'), - cff.charStrings.count); - } else { - charset = this.parseCharsets(topDict.getByName('charset'), - cff.charStrings.count, cff.strings, false); - encoding = this.parseEncoding(topDict.getByName('Encoding'), - properties, - cff.strings, charset.charset); - } - cff.charset = charset; - cff.encoding = encoding; - - return cff; - }, - parseHeader: function CFFParser_parseHeader() { - var bytes = this.bytes; - var bytesLength = bytes.length; - var offset = 0; - - // Prevent an infinite loop, by checking that the offset is within the - // bounds of the bytes array. Necessary in empty, or invalid, font files. - while (offset < bytesLength && bytes[offset] !== 1) { - ++offset; - } - if (offset >= bytesLength) { - error('Invalid CFF header'); - } else if (offset !== 0) { - info('cff data is shifted'); - bytes = bytes.subarray(offset); - this.bytes = bytes; - } - var major = bytes[0]; - var minor = bytes[1]; - var hdrSize = bytes[2]; - var offSize = bytes[3]; - var header = new CFFHeader(major, minor, hdrSize, offSize); - return { obj: header, endPos: hdrSize }; - }, - parseDict: function CFFParser_parseDict(dict) { - var pos = 0; - - function parseOperand() { - var value = dict[pos++]; - if (value === 30) { - return parseFloatOperand(pos); - } else if (value === 28) { - value = dict[pos++]; - value = ((value << 24) | (dict[pos++] << 16)) >> 16; - return value; - } else if (value === 29) { - value = dict[pos++]; - value = (value << 8) | dict[pos++]; - value = (value << 8) | dict[pos++]; - value = (value << 8) | dict[pos++]; - return value; - } else if (value >= 32 && value <= 246) { - return value - 139; - } else if (value >= 247 && value <= 250) { - return ((value - 247) * 256) + dict[pos++] + 108; - } else if (value >= 251 && value <= 254) { - return -((value - 251) * 256) - dict[pos++] - 108; - } else { - error('255 is not a valid DICT command'); - } - return -1; - } - - function parseFloatOperand() { - var str = ''; - var eof = 15; - var lookup = ['0', '1', '2', '3', '4', '5', '6', '7', '8', - '9', '.', 'E', 'E-', null, '-']; - var length = dict.length; - while (pos < length) { - var b = dict[pos++]; - var b1 = b >> 4; - var b2 = b & 15; - - if (b1 === eof) { - break; - } - str += lookup[b1]; - - if (b2 === eof) { - break; - } - str += lookup[b2]; - } - return parseFloat(str); - } - - var operands = []; - var entries = []; - - pos = 0; - var end = dict.length; - while (pos < end) { - var b = dict[pos]; - if (b <= 21) { - if (b === 12) { - b = (b << 8) | dict[++pos]; - } - entries.push([b, operands]); - operands = []; - ++pos; - } else { - operands.push(parseOperand()); - } - } - return entries; - }, - parseIndex: function CFFParser_parseIndex(pos) { - var cffIndex = new CFFIndex(); - var bytes = this.bytes; - var count = (bytes[pos++] << 8) | bytes[pos++]; - var offsets = []; - var end = pos; - var i, ii; - - if (count !== 0) { - var offsetSize = bytes[pos++]; - // add 1 for offset to determine size of last object - var startPos = pos + ((count + 1) * offsetSize) - 1; - - for (i = 0, ii = count + 1; i < ii; ++i) { - var offset = 0; - for (var j = 0; j < offsetSize; ++j) { - offset <<= 8; - offset += bytes[pos++]; - } - offsets.push(startPos + offset); - } - end = offsets[count]; - } - for (i = 0, ii = offsets.length - 1; i < ii; ++i) { - var offsetStart = offsets[i]; - var offsetEnd = offsets[i + 1]; - cffIndex.add(bytes.subarray(offsetStart, offsetEnd)); - } - return {obj: cffIndex, endPos: end}; - }, - parseNameIndex: function CFFParser_parseNameIndex(index) { - var names = []; - for (var i = 0, ii = index.count; i < ii; ++i) { - var name = index.get(i); - // OTS doesn't allow names to be over 127 characters. - var length = Math.min(name.length, 127); - var data = []; - // OTS also only permits certain characters in the name. - for (var j = 0; j < length; ++j) { - var c = name[j]; - if (j === 0 && c === 0) { - data[j] = c; - continue; - } - if ((c < 33 || c > 126) || c === 91 /* [ */ || c === 93 /* ] */ || - c === 40 /* ( */ || c === 41 /* ) */ || c === 123 /* { */ || - c === 125 /* } */ || c === 60 /* < */ || c === 62 /* > */ || - c === 47 /* / */ || c === 37 /* % */ || c === 35 /* # */) { - data[j] = 95; - continue; - } - data[j] = c; - } - names.push(bytesToString(data)); - } - return names; - }, - parseStringIndex: function CFFParser_parseStringIndex(index) { - var strings = new CFFStrings(); - for (var i = 0, ii = index.count; i < ii; ++i) { - var data = index.get(i); - strings.add(bytesToString(data)); - } - return strings; - }, - createDict: function CFFParser_createDict(Type, dict, strings) { - var cffDict = new Type(strings); - for (var i = 0, ii = dict.length; i < ii; ++i) { - var pair = dict[i]; - var key = pair[0]; - var value = pair[1]; - cffDict.setByKey(key, value); - } - return cffDict; - }, - parseCharStrings: function CFFParser_parseCharStrings(charStringOffset) { - var charStrings = this.parseIndex(charStringOffset).obj; - var seacs = []; - var widths = []; - var count = charStrings.count; - for (var i = 0; i < count; i++) { - var charstring = charStrings.get(i); - - var stackSize = 0; - var stack = []; - var undefStack = true; - var hints = 0; - var valid = true; - var data = charstring; - var length = data.length; - var firstStackClearing = true; - for (var j = 0; j < length;) { - var value = data[j++]; - var validationCommand = null; - if (value === 12) { - var q = data[j++]; - if (q === 0) { - // The CFF specification state that the 'dotsection' command - // (12, 0) is deprecated and treated as a no-op, but all Type2 - // charstrings processors should support them. Unfortunately - // the font sanitizer don't. As a workaround the sequence (12, 0) - // is replaced by a useless (0, hmoveto). - data[j - 2] = 139; - data[j - 1] = 22; - stackSize = 0; - } else { - validationCommand = CharstringValidationData12[q]; - } - } else if (value === 28) { // number (16 bit) - stack[stackSize] = ((data[j] << 24) | (data[j + 1] << 16)) >> 16; - j += 2; - stackSize++; - } else if (value === 14) { - if (stackSize >= 4) { - stackSize -= 4; - if (SEAC_ANALYSIS_ENABLED) { - seacs[i] = stack.slice(stackSize, stackSize + 4); - valid = false; - } - } - validationCommand = CharstringValidationData[value]; - } else if (value >= 32 && value <= 246) { // number - stack[stackSize] = value - 139; - stackSize++; - } else if (value >= 247 && value <= 254) { // number (+1 bytes) - stack[stackSize] = (value < 251 ? - ((value - 247) << 8) + data[j] + 108 : - -((value - 251) << 8) - data[j] - 108); - j++; - stackSize++; - } else if (value === 255) { // number (32 bit) - stack[stackSize] = ((data[j] << 24) | (data[j + 1] << 16) | - (data[j + 2] << 8) | data[j + 3]) / 65536; - j += 4; - stackSize++; - } else if (value === 19 || value === 20) { - hints += stackSize >> 1; - j += (hints + 7) >> 3; // skipping right amount of hints flag data - stackSize %= 2; - validationCommand = CharstringValidationData[value]; - } else { - validationCommand = CharstringValidationData[value]; - } - if (validationCommand) { - if (validationCommand.stem) { - hints += stackSize >> 1; - } - if ('min' in validationCommand) { - if (!undefStack && stackSize < validationCommand.min) { - warn('Not enough parameters for ' + validationCommand.id + - '; actual: ' + stackSize + - ', expected: ' + validationCommand.min); - valid = false; - break; - } - } - if (firstStackClearing && validationCommand.stackClearing) { - firstStackClearing = false; - // the optional character width can be found before the first - // stack-clearing command arguments - stackSize -= validationCommand.min; - if (stackSize >= 2 && validationCommand.stem) { - // there are even amount of arguments for stem commands - stackSize %= 2; - } else if (stackSize > 1) { - warn('Found too many parameters for stack-clearing command'); - } - if (stackSize > 0 && stack[stackSize - 1] >= 0) { - widths[i] = stack[stackSize - 1]; - } - } - if ('stackDelta' in validationCommand) { - if ('stackFn' in validationCommand) { - validationCommand.stackFn(stack, stackSize); - } - stackSize += validationCommand.stackDelta; - } else if (validationCommand.stackClearing) { - stackSize = 0; - } else if (validationCommand.resetStack) { - stackSize = 0; - undefStack = false; - } else if (validationCommand.undefStack) { - stackSize = 0; - undefStack = true; - firstStackClearing = false; - } - } - } - if (!valid) { - // resetting invalid charstring to single 'endchar' - charStrings.set(i, new Uint8Array([14])); - } - } - return { charStrings: charStrings, seacs: seacs, widths: widths }; - }, - emptyPrivateDictionary: - function CFFParser_emptyPrivateDictionary(parentDict) { - var privateDict = this.createDict(CFFPrivateDict, [], - parentDict.strings); - parentDict.setByKey(18, [0, 0]); - parentDict.privateDict = privateDict; - }, - parsePrivateDict: function CFFParser_parsePrivateDict(parentDict) { - // no private dict, do nothing - if (!parentDict.hasName('Private')) { - this.emptyPrivateDictionary(parentDict); - return; - } - var privateOffset = parentDict.getByName('Private'); - // make sure the params are formatted correctly - if (!isArray(privateOffset) || privateOffset.length !== 2) { - parentDict.removeByName('Private'); - return; - } - var size = privateOffset[0]; - var offset = privateOffset[1]; - // remove empty dicts or ones that refer to invalid location - if (size === 0 || offset >= this.bytes.length) { - this.emptyPrivateDictionary(parentDict); - return; - } - - var privateDictEnd = offset + size; - var dictData = this.bytes.subarray(offset, privateDictEnd); - var dict = this.parseDict(dictData); - var privateDict = this.createDict(CFFPrivateDict, dict, - parentDict.strings); - parentDict.privateDict = privateDict; - - // Parse the Subrs index also since it's relative to the private dict. - if (!privateDict.getByName('Subrs')) { - return; - } - var subrsOffset = privateDict.getByName('Subrs'); - var relativeOffset = offset + subrsOffset; - // Validate the offset. - if (subrsOffset === 0 || relativeOffset >= this.bytes.length) { - this.emptyPrivateDictionary(parentDict); - return; - } - var subrsIndex = this.parseIndex(relativeOffset); - privateDict.subrsIndex = subrsIndex.obj; - }, - parseCharsets: function CFFParser_parseCharsets(pos, length, strings, cid) { - if (pos === 0) { - return new CFFCharset(true, CFFCharsetPredefinedTypes.ISO_ADOBE, - ISOAdobeCharset); - } else if (pos === 1) { - return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT, - ExpertCharset); - } else if (pos === 2) { - return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT_SUBSET, - ExpertSubsetCharset); - } - - var bytes = this.bytes; - var start = pos; - var format = bytes[pos++]; - var charset = ['.notdef']; - var id, count, i; - - // subtract 1 for the .notdef glyph - length -= 1; - - switch (format) { - case 0: - for (i = 0; i < length; i++) { - id = (bytes[pos++] << 8) | bytes[pos++]; - charset.push(cid ? id : strings.get(id)); - } - break; - case 1: - while (charset.length <= length) { - id = (bytes[pos++] << 8) | bytes[pos++]; - count = bytes[pos++]; - for (i = 0; i <= count; i++) { - charset.push(cid ? id++ : strings.get(id++)); - } - } - break; - case 2: - while (charset.length <= length) { - id = (bytes[pos++] << 8) | bytes[pos++]; - count = (bytes[pos++] << 8) | bytes[pos++]; - for (i = 0; i <= count; i++) { - charset.push(cid ? id++ : strings.get(id++)); - } - } - break; - default: - error('Unknown charset format'); - } - // Raw won't be needed if we actually compile the charset. - var end = pos; - var raw = bytes.subarray(start, end); - - return new CFFCharset(false, format, charset, raw); - }, - parseEncoding: function CFFParser_parseEncoding(pos, - properties, - strings, - charset) { - var encoding = {}; - var bytes = this.bytes; - var predefined = false; - var hasSupplement = false; - var format, i, ii; - var raw = null; - - function readSupplement() { - var supplementsCount = bytes[pos++]; - for (i = 0; i < supplementsCount; i++) { - var code = bytes[pos++]; - var sid = (bytes[pos++] << 8) + (bytes[pos++] & 0xff); - encoding[code] = charset.indexOf(strings.get(sid)); - } - } - - if (pos === 0 || pos === 1) { - predefined = true; - format = pos; - var baseEncoding = pos ? Encodings.ExpertEncoding : - Encodings.StandardEncoding; - for (i = 0, ii = charset.length; i < ii; i++) { - var index = baseEncoding.indexOf(charset[i]); - if (index !== -1) { - encoding[index] = i; - } - } - } else { - var dataStart = pos; - format = bytes[pos++]; - switch (format & 0x7f) { - case 0: - var glyphsCount = bytes[pos++]; - for (i = 1; i <= glyphsCount; i++) { - encoding[bytes[pos++]] = i; - } - break; - - case 1: - var rangesCount = bytes[pos++]; - var gid = 1; - for (i = 0; i < rangesCount; i++) { - var start = bytes[pos++]; - var left = bytes[pos++]; - for (var j = start; j <= start + left; j++) { - encoding[j] = gid++; - } - } - break; - - default: - error('Unknow encoding format: ' + format + ' in CFF'); - break; - } - var dataEnd = pos; - if (format & 0x80) { - // The font sanitizer does not support CFF encoding with a - // supplement, since the encoding is not really used to map - // between gid to glyph, let's overwrite what is declared in - // the top dictionary to let the sanitizer think the font use - // StandardEncoding, that's a lie but that's ok. - bytes[dataStart] &= 0x7f; - readSupplement(); - hasSupplement = true; - } - raw = bytes.subarray(dataStart, dataEnd); - } - format = format & 0x7f; - return new CFFEncoding(predefined, format, encoding, raw); - }, - parseFDSelect: function CFFParser_parseFDSelect(pos, length) { - var start = pos; - var bytes = this.bytes; - var format = bytes[pos++]; - var fdSelect = []; - var i; - - switch (format) { - case 0: - for (i = 0; i < length; ++i) { - var id = bytes[pos++]; - fdSelect.push(id); - } - break; - case 3: - var rangesCount = (bytes[pos++] << 8) | bytes[pos++]; - for (i = 0; i < rangesCount; ++i) { - var first = (bytes[pos++] << 8) | bytes[pos++]; - var fdIndex = bytes[pos++]; - var next = (bytes[pos] << 8) | bytes[pos + 1]; - for (var j = first; j < next; ++j) { - fdSelect.push(fdIndex); - } - } - // Advance past the sentinel(next). - pos += 2; - break; - default: - error('Unknown fdselect format ' + format); - break; - } - var end = pos; - return new CFFFDSelect(fdSelect, bytes.subarray(start, end)); - } - }; - return CFFParser; -})(); - -// Compact Font Format -var CFF = (function CFFClosure() { - function CFF() { - this.header = null; - this.names = []; - this.topDict = null; - this.strings = new CFFStrings(); - this.globalSubrIndex = null; - - // The following could really be per font, but since we only have one font - // store them here. - this.encoding = null; - this.charset = null; - this.charStrings = null; - this.fdArray = []; - this.fdSelect = null; - - this.isCIDFont = false; - } - return CFF; -})(); - -var CFFHeader = (function CFFHeaderClosure() { - function CFFHeader(major, minor, hdrSize, offSize) { - this.major = major; - this.minor = minor; - this.hdrSize = hdrSize; - this.offSize = offSize; - } - return CFFHeader; -})(); - -var CFFStrings = (function CFFStringsClosure() { - function CFFStrings() { - this.strings = []; - } - CFFStrings.prototype = { - get: function CFFStrings_get(index) { - if (index >= 0 && index <= 390) { - return CFFStandardStrings[index]; - } - if (index - 391 <= this.strings.length) { - return this.strings[index - 391]; - } - return CFFStandardStrings[0]; - }, - add: function CFFStrings_add(value) { - this.strings.push(value); - }, - get count() { - return this.strings.length; - } - }; - return CFFStrings; -})(); - -var CFFIndex = (function CFFIndexClosure() { - function CFFIndex() { - this.objects = []; - this.length = 0; - } - CFFIndex.prototype = { - add: function CFFIndex_add(data) { - this.length += data.length; - this.objects.push(data); - }, - set: function CFFIndex_set(index, data) { - this.length += data.length - this.objects[index].length; - this.objects[index] = data; - }, - get: function CFFIndex_get(index) { - return this.objects[index]; - }, - get count() { - return this.objects.length; - } - }; - return CFFIndex; -})(); - -var CFFDict = (function CFFDictClosure() { - function CFFDict(tables, strings) { - this.keyToNameMap = tables.keyToNameMap; - this.nameToKeyMap = tables.nameToKeyMap; - this.defaults = tables.defaults; - this.types = tables.types; - this.opcodes = tables.opcodes; - this.order = tables.order; - this.strings = strings; - this.values = {}; - } - CFFDict.prototype = { - // value should always be an array - setByKey: function CFFDict_setByKey(key, value) { - if (!(key in this.keyToNameMap)) { - return false; - } - // ignore empty values - if (value.length === 0) { - return true; - } - var type = this.types[key]; - // remove the array wrapping these types of values - if (type === 'num' || type === 'sid' || type === 'offset') { - value = value[0]; - } - this.values[key] = value; - return true; - }, - setByName: function CFFDict_setByName(name, value) { - if (!(name in this.nameToKeyMap)) { - error('Invalid dictionary name "' + name + '"'); - } - this.values[this.nameToKeyMap[name]] = value; - }, - hasName: function CFFDict_hasName(name) { - return this.nameToKeyMap[name] in this.values; - }, - getByName: function CFFDict_getByName(name) { - if (!(name in this.nameToKeyMap)) { - error('Invalid dictionary name "' + name + '"'); - } - var key = this.nameToKeyMap[name]; - if (!(key in this.values)) { - return this.defaults[key]; - } - return this.values[key]; - }, - removeByName: function CFFDict_removeByName(name) { - delete this.values[this.nameToKeyMap[name]]; - } - }; - CFFDict.createTables = function CFFDict_createTables(layout) { - var tables = { - keyToNameMap: {}, - nameToKeyMap: {}, - defaults: {}, - types: {}, - opcodes: {}, - order: [] - }; - for (var i = 0, ii = layout.length; i < ii; ++i) { - var entry = layout[i]; - var key = isArray(entry[0]) ? (entry[0][0] << 8) + entry[0][1] : entry[0]; - tables.keyToNameMap[key] = entry[1]; - tables.nameToKeyMap[entry[1]] = key; - tables.types[key] = entry[2]; - tables.defaults[key] = entry[3]; - tables.opcodes[key] = isArray(entry[0]) ? entry[0] : [entry[0]]; - tables.order.push(key); - } - return tables; - }; - return CFFDict; -})(); - -var CFFTopDict = (function CFFTopDictClosure() { - var layout = [ - [[12, 30], 'ROS', ['sid', 'sid', 'num'], null], - [[12, 20], 'SyntheticBase', 'num', null], - [0, 'version', 'sid', null], - [1, 'Notice', 'sid', null], - [[12, 0], 'Copyright', 'sid', null], - [2, 'FullName', 'sid', null], - [3, 'FamilyName', 'sid', null], - [4, 'Weight', 'sid', null], - [[12, 1], 'isFixedPitch', 'num', 0], - [[12, 2], 'ItalicAngle', 'num', 0], - [[12, 3], 'UnderlinePosition', 'num', -100], - [[12, 4], 'UnderlineThickness', 'num', 50], - [[12, 5], 'PaintType', 'num', 0], - [[12, 6], 'CharstringType', 'num', 2], - [[12, 7], 'FontMatrix', ['num', 'num', 'num', 'num', 'num', 'num'], - [0.001, 0, 0, 0.001, 0, 0]], - [13, 'UniqueID', 'num', null], - [5, 'FontBBox', ['num', 'num', 'num', 'num'], [0, 0, 0, 0]], - [[12, 8], 'StrokeWidth', 'num', 0], - [14, 'XUID', 'array', null], - [15, 'charset', 'offset', 0], - [16, 'Encoding', 'offset', 0], - [17, 'CharStrings', 'offset', 0], - [18, 'Private', ['offset', 'offset'], null], - [[12, 21], 'PostScript', 'sid', null], - [[12, 22], 'BaseFontName', 'sid', null], - [[12, 23], 'BaseFontBlend', 'delta', null], - [[12, 31], 'CIDFontVersion', 'num', 0], - [[12, 32], 'CIDFontRevision', 'num', 0], - [[12, 33], 'CIDFontType', 'num', 0], - [[12, 34], 'CIDCount', 'num', 8720], - [[12, 35], 'UIDBase', 'num', null], - // XXX: CID Fonts on DirectWrite 6.1 only seem to work if FDSelect comes - // before FDArray. - [[12, 37], 'FDSelect', 'offset', null], - [[12, 36], 'FDArray', 'offset', null], - [[12, 38], 'FontName', 'sid', null] - ]; - var tables = null; - function CFFTopDict(strings) { - if (tables === null) { - tables = CFFDict.createTables(layout); - } - CFFDict.call(this, tables, strings); - this.privateDict = null; - } - CFFTopDict.prototype = Object.create(CFFDict.prototype); - return CFFTopDict; -})(); - -var CFFPrivateDict = (function CFFPrivateDictClosure() { - var layout = [ - [6, 'BlueValues', 'delta', null], - [7, 'OtherBlues', 'delta', null], - [8, 'FamilyBlues', 'delta', null], - [9, 'FamilyOtherBlues', 'delta', null], - [[12, 9], 'BlueScale', 'num', 0.039625], - [[12, 10], 'BlueShift', 'num', 7], - [[12, 11], 'BlueFuzz', 'num', 1], - [10, 'StdHW', 'num', null], - [11, 'StdVW', 'num', null], - [[12, 12], 'StemSnapH', 'delta', null], - [[12, 13], 'StemSnapV', 'delta', null], - [[12, 14], 'ForceBold', 'num', 0], - [[12, 17], 'LanguageGroup', 'num', 0], - [[12, 18], 'ExpansionFactor', 'num', 0.06], - [[12, 19], 'initialRandomSeed', 'num', 0], - [20, 'defaultWidthX', 'num', 0], - [21, 'nominalWidthX', 'num', 0], - [19, 'Subrs', 'offset', null] - ]; - var tables = null; - function CFFPrivateDict(strings) { - if (tables === null) { - tables = CFFDict.createTables(layout); - } - CFFDict.call(this, tables, strings); - this.subrsIndex = null; - } - CFFPrivateDict.prototype = Object.create(CFFDict.prototype); - return CFFPrivateDict; -})(); - -var CFFCharsetPredefinedTypes = { - ISO_ADOBE: 0, - EXPERT: 1, - EXPERT_SUBSET: 2 -}; -var CFFCharset = (function CFFCharsetClosure() { - function CFFCharset(predefined, format, charset, raw) { - this.predefined = predefined; - this.format = format; - this.charset = charset; - this.raw = raw; - } - return CFFCharset; -})(); - -var CFFEncoding = (function CFFEncodingClosure() { - function CFFEncoding(predefined, format, encoding, raw) { - this.predefined = predefined; - this.format = format; - this.encoding = encoding; - this.raw = raw; - } - return CFFEncoding; -})(); - -var CFFFDSelect = (function CFFFDSelectClosure() { - function CFFFDSelect(fdSelect, raw) { - this.fdSelect = fdSelect; - this.raw = raw; - } - return CFFFDSelect; -})(); - -// Helper class to keep track of where an offset is within the data and helps -// filling in that offset once it's known. -var CFFOffsetTracker = (function CFFOffsetTrackerClosure() { - function CFFOffsetTracker() { - this.offsets = {}; - } - CFFOffsetTracker.prototype = { - isTracking: function CFFOffsetTracker_isTracking(key) { - return key in this.offsets; - }, - track: function CFFOffsetTracker_track(key, location) { - if (key in this.offsets) { - error('Already tracking location of ' + key); - } - this.offsets[key] = location; - }, - offset: function CFFOffsetTracker_offset(value) { - for (var key in this.offsets) { - this.offsets[key] += value; - } - }, - setEntryLocation: function CFFOffsetTracker_setEntryLocation(key, - values, - output) { - if (!(key in this.offsets)) { - error('Not tracking location of ' + key); - } - var data = output.data; - var dataOffset = this.offsets[key]; - var size = 5; - for (var i = 0, ii = values.length; i < ii; ++i) { - var offset0 = i * size + dataOffset; - var offset1 = offset0 + 1; - var offset2 = offset0 + 2; - var offset3 = offset0 + 3; - var offset4 = offset0 + 4; - // It's easy to screw up offsets so perform this sanity check. - if (data[offset0] !== 0x1d || data[offset1] !== 0 || - data[offset2] !== 0 || data[offset3] !== 0 || data[offset4] !== 0) { - error('writing to an offset that is not empty'); - } - var value = values[i]; - data[offset0] = 0x1d; - data[offset1] = (value >> 24) & 0xFF; - data[offset2] = (value >> 16) & 0xFF; - data[offset3] = (value >> 8) & 0xFF; - data[offset4] = value & 0xFF; - } - } - }; - return CFFOffsetTracker; -})(); - -// Takes a CFF and converts it to the binary representation. -var CFFCompiler = (function CFFCompilerClosure() { - function CFFCompiler(cff) { - this.cff = cff; - } - CFFCompiler.prototype = { - compile: function CFFCompiler_compile() { - var cff = this.cff; - var output = { - data: [], - length: 0, - add: function CFFCompiler_add(data) { - this.data = this.data.concat(data); - this.length = this.data.length; - } - }; - - // Compile the five entries that must be in order. - var header = this.compileHeader(cff.header); - output.add(header); - - var nameIndex = this.compileNameIndex(cff.names); - output.add(nameIndex); - - if (cff.isCIDFont) { - // The spec is unclear on how font matrices should relate to each other - // when there is one in the main top dict and the sub top dicts. - // Windows handles this differently than linux and osx so we have to - // normalize to work on all. - // Rules based off of some mailing list discussions: - // - If main font has a matrix and subfont doesn't, use the main matrix. - // - If no main font matrix and there is a subfont matrix, use the - // subfont matrix. - // - If both have matrices, concat together. - // - If neither have matrices, use default. - // To make this work on all platforms we move the top matrix into each - // sub top dict and concat if necessary. - if (cff.topDict.hasName('FontMatrix')) { - var base = cff.topDict.getByName('FontMatrix'); - cff.topDict.removeByName('FontMatrix'); - for (var i = 0, ii = cff.fdArray.length; i < ii; i++) { - var subDict = cff.fdArray[i]; - var matrix = base.slice(0); - if (subDict.hasName('FontMatrix')) { - matrix = Util.transform(matrix, subDict.getByName('FontMatrix')); - } - subDict.setByName('FontMatrix', matrix); - } - } - } - - var compiled = this.compileTopDicts([cff.topDict], - output.length, - cff.isCIDFont); - output.add(compiled.output); - var topDictTracker = compiled.trackers[0]; - - var stringIndex = this.compileStringIndex(cff.strings.strings); - output.add(stringIndex); - - var globalSubrIndex = this.compileIndex(cff.globalSubrIndex); - output.add(globalSubrIndex); - - // Now start on the other entries that have no specfic order. - if (cff.encoding && cff.topDict.hasName('Encoding')) { - if (cff.encoding.predefined) { - topDictTracker.setEntryLocation('Encoding', [cff.encoding.format], - output); - } else { - var encoding = this.compileEncoding(cff.encoding); - topDictTracker.setEntryLocation('Encoding', [output.length], output); - output.add(encoding); - } - } - - if (cff.charset && cff.topDict.hasName('charset')) { - if (cff.charset.predefined) { - topDictTracker.setEntryLocation('charset', [cff.charset.format], - output); - } else { - var charset = this.compileCharset(cff.charset); - topDictTracker.setEntryLocation('charset', [output.length], output); - output.add(charset); - } - } - - var charStrings = this.compileCharStrings(cff.charStrings); - topDictTracker.setEntryLocation('CharStrings', [output.length], output); - output.add(charStrings); - - if (cff.isCIDFont) { - // For some reason FDSelect must be in front of FDArray on windows. OSX - // and linux don't seem to care. - topDictTracker.setEntryLocation('FDSelect', [output.length], output); - var fdSelect = this.compileFDSelect(cff.fdSelect.raw); - output.add(fdSelect); - // It is unclear if the sub font dictionary can have CID related - // dictionary keys, but the sanitizer doesn't like them so remove them. - compiled = this.compileTopDicts(cff.fdArray, output.length, true); - topDictTracker.setEntryLocation('FDArray', [output.length], output); - output.add(compiled.output); - var fontDictTrackers = compiled.trackers; - - this.compilePrivateDicts(cff.fdArray, fontDictTrackers, output); - } - - this.compilePrivateDicts([cff.topDict], [topDictTracker], output); - - // If the font data ends with INDEX whose object data is zero-length, - // the sanitizer will bail out. Add a dummy byte to avoid that. - output.add([0]); - - return output.data; - }, - encodeNumber: function CFFCompiler_encodeNumber(value) { - if (parseFloat(value) === parseInt(value, 10) && !isNaN(value)) { // isInt - return this.encodeInteger(value); - } else { - return this.encodeFloat(value); - } - }, - encodeFloat: function CFFCompiler_encodeFloat(num) { - var value = num.toString(); - - // rounding inaccurate doubles - var m = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(value); - if (m) { - var epsilon = parseFloat('1e' + ((m[2] ? +m[2] : 0) + m[1].length)); - value = (Math.round(num * epsilon) / epsilon).toString(); - } - - var nibbles = ''; - var i, ii; - for (i = 0, ii = value.length; i < ii; ++i) { - var a = value[i]; - if (a === 'e') { - nibbles += value[++i] === '-' ? 'c' : 'b'; - } else if (a === '.') { - nibbles += 'a'; - } else if (a === '-') { - nibbles += 'e'; - } else { - nibbles += a; - } - } - nibbles += (nibbles.length & 1) ? 'f' : 'ff'; - var out = [30]; - for (i = 0, ii = nibbles.length; i < ii; i += 2) { - out.push(parseInt(nibbles.substr(i, 2), 16)); - } - return out; - }, - encodeInteger: function CFFCompiler_encodeInteger(value) { - var code; - if (value >= -107 && value <= 107) { - code = [value + 139]; - } else if (value >= 108 && value <= 1131) { - value = [value - 108]; - code = [(value >> 8) + 247, value & 0xFF]; - } else if (value >= -1131 && value <= -108) { - value = -value - 108; - code = [(value >> 8) + 251, value & 0xFF]; - } else if (value >= -32768 && value <= 32767) { - code = [0x1c, (value >> 8) & 0xFF, value & 0xFF]; - } else { - code = [0x1d, - (value >> 24) & 0xFF, - (value >> 16) & 0xFF, - (value >> 8) & 0xFF, - value & 0xFF]; - } - return code; - }, - compileHeader: function CFFCompiler_compileHeader(header) { - return [ - header.major, - header.minor, - header.hdrSize, - header.offSize - ]; - }, - compileNameIndex: function CFFCompiler_compileNameIndex(names) { - var nameIndex = new CFFIndex(); - for (var i = 0, ii = names.length; i < ii; ++i) { - nameIndex.add(stringToBytes(names[i])); - } - return this.compileIndex(nameIndex); - }, - compileTopDicts: function CFFCompiler_compileTopDicts(dicts, - length, - removeCidKeys) { - var fontDictTrackers = []; - var fdArrayIndex = new CFFIndex(); - for (var i = 0, ii = dicts.length; i < ii; ++i) { - var fontDict = dicts[i]; - if (removeCidKeys) { - fontDict.removeByName('CIDFontVersion'); - fontDict.removeByName('CIDFontRevision'); - fontDict.removeByName('CIDFontType'); - fontDict.removeByName('CIDCount'); - fontDict.removeByName('UIDBase'); - } - var fontDictTracker = new CFFOffsetTracker(); - var fontDictData = this.compileDict(fontDict, fontDictTracker); - fontDictTrackers.push(fontDictTracker); - fdArrayIndex.add(fontDictData); - fontDictTracker.offset(length); - } - fdArrayIndex = this.compileIndex(fdArrayIndex, fontDictTrackers); - return { - trackers: fontDictTrackers, - output: fdArrayIndex - }; - }, - compilePrivateDicts: function CFFCompiler_compilePrivateDicts(dicts, - trackers, - output) { - for (var i = 0, ii = dicts.length; i < ii; ++i) { - var fontDict = dicts[i]; - assert(fontDict.privateDict && fontDict.hasName('Private'), - 'There must be an private dictionary.'); - var privateDict = fontDict.privateDict; - var privateDictTracker = new CFFOffsetTracker(); - var privateDictData = this.compileDict(privateDict, privateDictTracker); - - var outputLength = output.length; - privateDictTracker.offset(outputLength); - if (!privateDictData.length) { - // The private dictionary was empty, set the output length to zero to - // ensure the offset length isn't out of bounds in the eyes of the - // sanitizer. - outputLength = 0; - } - - trackers[i].setEntryLocation('Private', - [privateDictData.length, outputLength], - output); - output.add(privateDictData); - - if (privateDict.subrsIndex && privateDict.hasName('Subrs')) { - var subrs = this.compileIndex(privateDict.subrsIndex); - privateDictTracker.setEntryLocation('Subrs', [privateDictData.length], - output); - output.add(subrs); - } - } - }, - compileDict: function CFFCompiler_compileDict(dict, offsetTracker) { - var out = []; - // The dictionary keys must be in a certain order. - var order = dict.order; - for (var i = 0; i < order.length; ++i) { - var key = order[i]; - if (!(key in dict.values)) { - continue; - } - var values = dict.values[key]; - var types = dict.types[key]; - if (!isArray(types)) { - types = [types]; - } - if (!isArray(values)) { - values = [values]; - } - - // Remove any empty dict values. - if (values.length === 0) { - continue; - } - - for (var j = 0, jj = types.length; j < jj; ++j) { - var type = types[j]; - var value = values[j]; - switch (type) { - case 'num': - case 'sid': - out = out.concat(this.encodeNumber(value)); - break; - case 'offset': - // For offsets we just insert a 32bit integer so we don't have to - // deal with figuring out the length of the offset when it gets - // replaced later on by the compiler. - var name = dict.keyToNameMap[key]; - // Some offsets have the offset and the length, so just record the - // position of the first one. - if (!offsetTracker.isTracking(name)) { - offsetTracker.track(name, out.length); - } - out = out.concat([0x1d, 0, 0, 0, 0]); - break; - case 'array': - case 'delta': - out = out.concat(this.encodeNumber(value)); - for (var k = 1, kk = values.length; k < kk; ++k) { - out = out.concat(this.encodeNumber(values[k])); - } - break; - default: - error('Unknown data type of ' + type); - break; - } - } - out = out.concat(dict.opcodes[key]); - } - return out; - }, - compileStringIndex: function CFFCompiler_compileStringIndex(strings) { - var stringIndex = new CFFIndex(); - for (var i = 0, ii = strings.length; i < ii; ++i) { - stringIndex.add(stringToBytes(strings[i])); - } - return this.compileIndex(stringIndex); - }, - compileGlobalSubrIndex: function CFFCompiler_compileGlobalSubrIndex() { - var globalSubrIndex = this.cff.globalSubrIndex; - this.out.writeByteArray(this.compileIndex(globalSubrIndex)); - }, - compileCharStrings: function CFFCompiler_compileCharStrings(charStrings) { - return this.compileIndex(charStrings); - }, - compileCharset: function CFFCompiler_compileCharset(charset) { - return this.compileTypedArray(charset.raw); - }, - compileEncoding: function CFFCompiler_compileEncoding(encoding) { - return this.compileTypedArray(encoding.raw); - }, - compileFDSelect: function CFFCompiler_compileFDSelect(fdSelect) { - return this.compileTypedArray(fdSelect); - }, - compileTypedArray: function CFFCompiler_compileTypedArray(data) { - var out = []; - for (var i = 0, ii = data.length; i < ii; ++i) { - out[i] = data[i]; - } - return out; - }, - compileIndex: function CFFCompiler_compileIndex(index, trackers) { - trackers = trackers || []; - var objects = index.objects; - // First 2 bytes contains the number of objects contained into this index - var count = objects.length; - - // If there is no object, just create an index. This technically - // should just be [0, 0] but OTS has an issue with that. - if (count === 0) { - return [0, 0, 0]; - } - - var data = [(count >> 8) & 0xFF, count & 0xff]; - - var lastOffset = 1, i; - for (i = 0; i < count; ++i) { - lastOffset += objects[i].length; - } - - var offsetSize; - if (lastOffset < 0x100) { - offsetSize = 1; - } else if (lastOffset < 0x10000) { - offsetSize = 2; - } else if (lastOffset < 0x1000000) { - offsetSize = 3; - } else { - offsetSize = 4; - } - - // Next byte contains the offset size use to reference object in the file - data.push(offsetSize); - - // Add another offset after this one because we need a new offset - var relativeOffset = 1; - for (i = 0; i < count + 1; i++) { - if (offsetSize === 1) { - data.push(relativeOffset & 0xFF); - } else if (offsetSize === 2) { - data.push((relativeOffset >> 8) & 0xFF, - relativeOffset & 0xFF); - } else if (offsetSize === 3) { - data.push((relativeOffset >> 16) & 0xFF, - (relativeOffset >> 8) & 0xFF, - relativeOffset & 0xFF); - } else { - data.push((relativeOffset >>> 24) & 0xFF, - (relativeOffset >> 16) & 0xFF, - (relativeOffset >> 8) & 0xFF, - relativeOffset & 0xFF); - } - - if (objects[i]) { - relativeOffset += objects[i].length; - } - } - - for (i = 0; i < count; i++) { - // Notify the tracker where the object will be offset in the data. - if (trackers[i]) { - trackers[i].offset(data.length); - } - for (var j = 0, jj = objects[i].length; j < jj; j++) { - data.push(objects[i][j]); - } - } - return data; - } - }; - return CFFCompiler; -})(); - -// Workaround for seac on Windows. -(function checkSeacSupport() { - if (/Windows/.test(navigator.userAgent)) { - SEAC_ANALYSIS_ENABLED = true; - } -})(); - -// Workaround for Private Use Area characters in Chrome on Windows -// http://code.google.com/p/chromium/issues/detail?id=122465 -// https://github.com/mozilla/pdf.js/issues/1689 -(function checkChromeWindows() { - if (/Windows.*Chrome/.test(navigator.userAgent)) { - SKIP_PRIVATE_USE_RANGE_F000_TO_F01F = true; - } -})(); - - -var FontRendererFactory = (function FontRendererFactoryClosure() { - function getLong(data, offset) { - return (data[offset] << 24) | (data[offset + 1] << 16) | - (data[offset + 2] << 8) | data[offset + 3]; - } - - function getUshort(data, offset) { - return (data[offset] << 8) | data[offset + 1]; - } - - function parseCmap(data, start, end) { - var offset = (getUshort(data, start + 2) === 1 ? - getLong(data, start + 8) : getLong(data, start + 16)); - var format = getUshort(data, start + offset); - var length, ranges, p, i; - if (format === 4) { - length = getUshort(data, start + offset + 2); - var segCount = getUshort(data, start + offset + 6) >> 1; - p = start + offset + 14; - ranges = []; - for (i = 0; i < segCount; i++, p += 2) { - ranges[i] = {end: getUshort(data, p)}; - } - p += 2; - for (i = 0; i < segCount; i++, p += 2) { - ranges[i].start = getUshort(data, p); - } - for (i = 0; i < segCount; i++, p += 2) { - ranges[i].idDelta = getUshort(data, p); - } - for (i = 0; i < segCount; i++, p += 2) { - var idOffset = getUshort(data, p); - if (idOffset === 0) { - continue; - } - ranges[i].ids = []; - for (var j = 0, jj = ranges[i].end - ranges[i].start + 1; j < jj; j++) { - ranges[i].ids[j] = getUshort(data, p + idOffset); - idOffset += 2; - } - } - return ranges; - } else if (format === 12) { - length = getLong(data, start + offset + 4); - var groups = getLong(data, start + offset + 12); - p = start + offset + 16; - ranges = []; - for (i = 0; i < groups; i++) { - ranges.push({ - start: getLong(data, p), - end: getLong(data, p + 4), - idDelta: getLong(data, p + 8) - getLong(data, p) - }); - p += 12; - } - return ranges; - } - error('not supported cmap: ' + format); - } - - function parseCff(data, start, end) { - var properties = {}; - var parser = new CFFParser(new Stream(data, start, end - start), - properties); - var cff = parser.parse(); - return { - glyphs: cff.charStrings.objects, - subrs: (cff.topDict.privateDict && cff.topDict.privateDict.subrsIndex && - cff.topDict.privateDict.subrsIndex.objects), - gsubrs: cff.globalSubrIndex && cff.globalSubrIndex.objects - }; - } - - function parseGlyfTable(glyf, loca, isGlyphLocationsLong) { - var itemSize, itemDecode; - if (isGlyphLocationsLong) { - itemSize = 4; - itemDecode = function fontItemDecodeLong(data, offset) { - return (data[offset] << 24) | (data[offset + 1] << 16) | - (data[offset + 2] << 8) | data[offset + 3]; - }; - } else { - itemSize = 2; - itemDecode = function fontItemDecode(data, offset) { - return (data[offset] << 9) | (data[offset + 1] << 1); - }; - } - var glyphs = []; - var startOffset = itemDecode(loca, 0); - for (var j = itemSize; j < loca.length; j += itemSize) { - var endOffset = itemDecode(loca, j); - glyphs.push(glyf.subarray(startOffset, endOffset)); - startOffset = endOffset; - } - return glyphs; - } - - function lookupCmap(ranges, unicode) { - var code = unicode.charCodeAt(0); - var l = 0, r = ranges.length - 1; - while (l < r) { - var c = (l + r + 1) >> 1; - if (code < ranges[c].start) { - r = c - 1; - } else { - l = c; - } - } - if (ranges[l].start <= code && code <= ranges[l].end) { - return (ranges[l].idDelta + (ranges[l].ids ? - ranges[l].ids[code - ranges[l].start] : code)) & 0xFFFF; - } - return 0; - } - - function compileGlyf(code, cmds, font) { - function moveTo(x, y) { - cmds.push({cmd: 'moveTo', args: [x, y]}); - } - function lineTo(x, y) { - cmds.push({cmd: 'lineTo', args: [x, y]}); - } - function quadraticCurveTo(xa, ya, x, y) { - cmds.push({cmd: 'quadraticCurveTo', args: [xa, ya, x, y]}); - } - - var i = 0; - var numberOfContours = ((code[i] << 24) | (code[i + 1] << 16)) >> 16; - var flags; - var x = 0, y = 0; - i += 10; - if (numberOfContours < 0) { - // composite glyph - do { - flags = (code[i] << 8) | code[i + 1]; - var glyphIndex = (code[i + 2] << 8) | code[i + 3]; - i += 4; - var arg1, arg2; - if ((flags & 0x01)) { - arg1 = ((code[i] << 24) | (code[i + 1] << 16)) >> 16; - arg2 = ((code[i + 2] << 24) | (code[i + 3] << 16)) >> 16; - i += 4; - } else { - arg1 = code[i++]; arg2 = code[i++]; - } - if ((flags & 0x02)) { - x = arg1; - y = arg2; - } else { - x = 0; y = 0; // TODO "they are points" ? - } - var scaleX = 1, scaleY = 1, scale01 = 0, scale10 = 0; - if ((flags & 0x08)) { - scaleX = - scaleY = ((code[i] << 24) | (code[i + 1] << 16)) / 1073741824; - i += 2; - } else if ((flags & 0x40)) { - scaleX = ((code[i] << 24) | (code[i + 1] << 16)) / 1073741824; - scaleY = ((code[i + 2] << 24) | (code[i + 3] << 16)) / 1073741824; - i += 4; - } else if ((flags & 0x80)) { - scaleX = ((code[i] << 24) | (code[i + 1] << 16)) / 1073741824; - scale01 = ((code[i + 2] << 24) | (code[i + 3] << 16)) / 1073741824; - scale10 = ((code[i + 4] << 24) | (code[i + 5] << 16)) / 1073741824; - scaleY = ((code[i + 6] << 24) | (code[i + 7] << 16)) / 1073741824; - i += 8; - } - var subglyph = font.glyphs[glyphIndex]; - if (subglyph) { - cmds.push({cmd: 'save'}); - cmds.push({cmd: 'transform', - args: [scaleX, scale01, scale10, scaleY, x, y]}); - compileGlyf(subglyph, cmds, font); - cmds.push({cmd: 'restore'}); - } - } while ((flags & 0x20)); - } else { - // simple glyph - var endPtsOfContours = []; - var j, jj; - for (j = 0; j < numberOfContours; j++) { - endPtsOfContours.push((code[i] << 8) | code[i + 1]); - i += 2; - } - var instructionLength = (code[i] << 8) | code[i + 1]; - i += 2 + instructionLength; // skipping the instructions - var numberOfPoints = endPtsOfContours[endPtsOfContours.length - 1] + 1; - var points = []; - while (points.length < numberOfPoints) { - flags = code[i++]; - var repeat = 1; - if ((flags & 0x08)) { - repeat += code[i++]; - } - while (repeat-- > 0) { - points.push({flags: flags}); - } - } - for (j = 0; j < numberOfPoints; j++) { - switch (points[j].flags & 0x12) { - case 0x00: - x += ((code[i] << 24) | (code[i + 1] << 16)) >> 16; - i += 2; - break; - case 0x02: - x -= code[i++]; - break; - case 0x12: - x += code[i++]; - break; - } - points[j].x = x; - } - for (j = 0; j < numberOfPoints; j++) { - switch (points[j].flags & 0x24) { - case 0x00: - y += ((code[i] << 24) | (code[i + 1] << 16)) >> 16; - i += 2; - break; - case 0x04: - y -= code[i++]; - break; - case 0x24: - y += code[i++]; - break; - } - points[j].y = y; - } - - var startPoint = 0; - for (i = 0; i < numberOfContours; i++) { - var endPoint = endPtsOfContours[i]; - // contours might have implicit points, which is located in the middle - // between two neighboring off-curve points - var contour = points.slice(startPoint, endPoint + 1); - if ((contour[0].flags & 1)) { - contour.push(contour[0]); // using start point at the contour end - } else if ((contour[contour.length - 1].flags & 1)) { - // first is off-curve point, trying to use one from the end - contour.unshift(contour[contour.length - 1]); - } else { - // start and end are off-curve points, creating implicit one - var p = { - flags: 1, - x: (contour[0].x + contour[contour.length - 1].x) / 2, - y: (contour[0].y + contour[contour.length - 1].y) / 2 - }; - contour.unshift(p); - contour.push(p); - } - moveTo(contour[0].x, contour[0].y); - for (j = 1, jj = contour.length; j < jj; j++) { - if ((contour[j].flags & 1)) { - lineTo(contour[j].x, contour[j].y); - } else if ((contour[j + 1].flags & 1)){ - quadraticCurveTo(contour[j].x, contour[j].y, - contour[j + 1].x, contour[j + 1].y); - j++; - } else { - quadraticCurveTo(contour[j].x, contour[j].y, - (contour[j].x + contour[j + 1].x) / 2, - (contour[j].y + contour[j + 1].y) / 2); - } - } - startPoint = endPoint + 1; - } - } - } - - function compileCharString(code, cmds, font) { - var stack = []; - var x = 0, y = 0; - var stems = 0; - - function moveTo(x, y) { - cmds.push({cmd: 'moveTo', args: [x, y]}); - } - function lineTo(x, y) { - cmds.push({cmd: 'lineTo', args: [x, y]}); - } - function bezierCurveTo(x1, y1, x2, y2, x, y) { - cmds.push({cmd: 'bezierCurveTo', args: [x1, y1, x2, y2, x, y]}); - } - - function parse(code) { - var i = 0; - while (i < code.length) { - var stackClean = false; - var v = code[i++]; - var xa, xb, ya, yb, y1, y2, y3, n, subrCode; - switch (v) { - case 1: // hstem - stems += stack.length >> 1; - stackClean = true; - break; - case 3: // vstem - stems += stack.length >> 1; - stackClean = true; - break; - case 4: // vmoveto - y += stack.pop(); - moveTo(x, y); - stackClean = true; - break; - case 5: // rlineto - while (stack.length > 0) { - x += stack.shift(); - y += stack.shift(); - lineTo(x, y); - } - break; - case 6: // hlineto - while (stack.length > 0) { - x += stack.shift(); - lineTo(x, y); - if (stack.length === 0) { - break; - } - y += stack.shift(); - lineTo(x, y); - } - break; - case 7: // vlineto - while (stack.length > 0) { - y += stack.shift(); - lineTo(x, y); - if (stack.length === 0) { - break; - } - x += stack.shift(); - lineTo(x, y); - } - break; - case 8: // rrcurveto - while (stack.length > 0) { - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - } - break; - case 10: // callsubr - n = stack.pop() + font.subrsBias; - subrCode = font.subrs[n]; - if (subrCode) { - parse(subrCode); - } - break; - case 11: // return - return; - case 12: - v = code[i++]; - switch (v) { - case 34: // flex - xa = x + stack.shift(); - xb = xa + stack.shift(); y1 = y + stack.shift(); - x = xb + stack.shift(); - bezierCurveTo(xa, y, xb, y1, x, y1); - xa = x + stack.shift(); - xb = xa + stack.shift(); - x = xb + stack.shift(); - bezierCurveTo(xa, y1, xb, y, x, y); - break; - case 35: // flex - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - stack.pop(); // fd - break; - case 36: // hflex1 - xa = x + stack.shift(); y1 = y + stack.shift(); - xb = xa + stack.shift(); y2 = y1 + stack.shift(); - x = xb + stack.shift(); - bezierCurveTo(xa, y1, xb, y2, x, y2); - xa = x + stack.shift(); - xb = xa + stack.shift(); y3 = y2 + stack.shift(); - x = xb + stack.shift(); - bezierCurveTo(xa, y2, xb, y3, x, y); - break; - case 37: // flex1 - var x0 = x, y0 = y; - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb; y = yb; - if (Math.abs(x - x0) > Math.abs(y - y0)) { - x += stack.shift(); - } else { - y += stack.shift(); - } - bezierCurveTo(xa, ya, xb, yb, x, y); - break; - default: - error('unknown operator: 12 ' + v); - } - break; - case 14: // endchar - if (stack.length >= 4) { - var achar = stack.pop(); - var bchar = stack.pop(); - y = stack.pop(); - x = stack.pop(); - cmds.push({cmd: 'save'}); - cmds.push({cmd: 'translate', args: [x, y]}); - var gid = lookupCmap(font.cmap, String.fromCharCode( - font.glyphNameMap[Encodings.StandardEncoding[achar]])); - compileCharString(font.glyphs[gid], cmds, font); - cmds.push({cmd: 'restore'}); - - gid = lookupCmap(font.cmap, String.fromCharCode( - font.glyphNameMap[Encodings.StandardEncoding[bchar]])); - compileCharString(font.glyphs[gid], cmds, font); - } - return; - case 18: // hstemhm - stems += stack.length >> 1; - stackClean = true; - break; - case 19: // hintmask - stems += stack.length >> 1; - i += (stems + 7) >> 3; - stackClean = true; - break; - case 20: // cntrmask - stems += stack.length >> 1; - i += (stems + 7) >> 3; - stackClean = true; - break; - case 21: // rmoveto - y += stack.pop(); - x += stack.pop(); - moveTo(x, y); - stackClean = true; - break; - case 22: // hmoveto - x += stack.pop(); - moveTo(x, y); - stackClean = true; - break; - case 23: // vstemhm - stems += stack.length >> 1; - stackClean = true; - break; - case 24: // rcurveline - while (stack.length > 2) { - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - } - x += stack.shift(); - y += stack.shift(); - lineTo(x, y); - break; - case 25: // rlinecurve - while (stack.length > 6) { - x += stack.shift(); - y += stack.shift(); - lineTo(x, y); - } - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - break; - case 26: // vvcurveto - if (stack.length % 2) { - x += stack.shift(); - } - while (stack.length > 0) { - xa = x; ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb; y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - } - break; - case 27: // hhcurveto - if (stack.length % 2) { - y += stack.shift(); - } - while (stack.length > 0) { - xa = x + stack.shift(); ya = y; - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb; - bezierCurveTo(xa, ya, xb, yb, x, y); - } - break; - case 28: - stack.push(((code[i] << 24) | (code[i + 1] << 16)) >> 16); - i += 2; - break; - case 29: // callgsubr - n = stack.pop() + font.gsubrsBias; - subrCode = font.gsubrs[n]; - if (subrCode) { - parse(subrCode); - } - break; - case 30: // vhcurveto - while (stack.length > 0) { - xa = x; ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); - y = yb + (stack.length === 1 ? stack.shift() : 0); - bezierCurveTo(xa, ya, xb, yb, x, y); - if (stack.length === 0) { - break; - } - - xa = x + stack.shift(); ya = y; - xb = xa + stack.shift(); yb = ya + stack.shift(); - y = yb + stack.shift(); - x = xb + (stack.length === 1 ? stack.shift() : 0); - bezierCurveTo(xa, ya, xb, yb, x, y); - } - break; - case 31: // hvcurveto - while (stack.length > 0) { - xa = x + stack.shift(); ya = y; - xb = xa + stack.shift(); yb = ya + stack.shift(); - y = yb + stack.shift(); - x = xb + (stack.length === 1 ? stack.shift() : 0); - bezierCurveTo(xa, ya, xb, yb, x, y); - if (stack.length === 0) { - break; - } - - xa = x; ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); - y = yb + (stack.length === 1 ? stack.shift() : 0); - bezierCurveTo(xa, ya, xb, yb, x, y); - } - break; - default: - if (v < 32) { - error('unknown operator: ' + v); - } - if (v < 247) { - stack.push(v - 139); - } else if (v < 251) { - stack.push((v - 247) * 256 + code[i++] + 108); - } else if (v < 255) { - stack.push(-(v - 251) * 256 - code[i++] - 108); - } else { - stack.push(((code[i] << 24) | (code[i + 1] << 16) | - (code[i + 2] << 8) | code[i + 3]) / 65536); - i += 4; - } - break; - } - if (stackClean) { - stack.length = 0; - } - } - } - parse(code); - } - - var noop = ''; - - function CompiledFont(fontMatrix) { - this.compiledGlyphs = {}; - this.fontMatrix = fontMatrix; - } - CompiledFont.prototype = { - getPathJs: function (unicode) { - var gid = lookupCmap(this.cmap, unicode); - var fn = this.compiledGlyphs[gid]; - if (!fn) { - this.compiledGlyphs[gid] = fn = this.compileGlyph(this.glyphs[gid]); - } - return fn; - }, - - compileGlyph: function (code) { - if (!code || code.length === 0 || code[0] === 14) { - return noop; - } - - var cmds = []; - cmds.push({cmd: 'save'}); - cmds.push({cmd: 'transform', args: this.fontMatrix.slice()}); - cmds.push({cmd: 'scale', args: ['size', '-size']}); - - this.compileGlyphImpl(code, cmds); - - cmds.push({cmd: 'restore'}); - - return cmds; - }, - - compileGlyphImpl: function () { - error('Children classes should implement this.'); - }, - - hasBuiltPath: function (unicode) { - var gid = lookupCmap(this.cmap, unicode); - return gid in this.compiledGlyphs; - } - }; - - function TrueTypeCompiled(glyphs, cmap, fontMatrix) { - fontMatrix = fontMatrix || [0.000488, 0, 0, 0.000488, 0, 0]; - CompiledFont.call(this, fontMatrix); - - this.glyphs = glyphs; - this.cmap = cmap; - - this.compiledGlyphs = []; - } - - Util.inherit(TrueTypeCompiled, CompiledFont, { - compileGlyphImpl: function (code, cmds) { - compileGlyf(code, cmds, this); - } - }); - - function Type2Compiled(cffInfo, cmap, fontMatrix, glyphNameMap) { - fontMatrix = fontMatrix || [0.001, 0, 0, 0.001, 0, 0]; - CompiledFont.call(this, fontMatrix); - this.glyphs = cffInfo.glyphs; - this.gsubrs = cffInfo.gsubrs || []; - this.subrs = cffInfo.subrs || []; - this.cmap = cmap; - this.glyphNameMap = glyphNameMap || GlyphsUnicode; - - this.compiledGlyphs = []; - this.gsubrsBias = (this.gsubrs.length < 1240 ? - 107 : (this.gsubrs.length < 33900 ? 1131 : 32768)); - this.subrsBias = (this.subrs.length < 1240 ? - 107 : (this.subrs.length < 33900 ? 1131 : 32768)); - } - - Util.inherit(Type2Compiled, CompiledFont, { - compileGlyphImpl: function (code, cmds) { - compileCharString(code, cmds, this); - } - }); - - - return { - create: function FontRendererFactory_create(font) { - var data = new Uint8Array(font.data); - var cmap, glyf, loca, cff, indexToLocFormat, unitsPerEm; - var numTables = getUshort(data, 4); - for (var i = 0, p = 12; i < numTables; i++, p += 16) { - var tag = bytesToString(data.subarray(p, p + 4)); - var offset = getLong(data, p + 8); - var length = getLong(data, p + 12); - switch (tag) { - case 'cmap': - cmap = parseCmap(data, offset, offset + length); - break; - case 'glyf': - glyf = data.subarray(offset, offset + length); - break; - case 'loca': - loca = data.subarray(offset, offset + length); - break; - case 'head': - unitsPerEm = getUshort(data, offset + 18); - indexToLocFormat = getUshort(data, offset + 50); - break; - case 'CFF ': - cff = parseCff(data, offset, offset + length); - break; - } - } - - if (glyf) { - var fontMatrix = (!unitsPerEm ? font.fontMatrix : - [1 / unitsPerEm, 0, 0, 1 / unitsPerEm, 0, 0]); - return new TrueTypeCompiled( - parseGlyfTable(glyf, loca, indexToLocFormat), cmap, fontMatrix); - } else { - return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap); - } - } - }; -})(); - - -var GlyphsUnicode = { - A: 0x0041, - AE: 0x00C6, - AEacute: 0x01FC, - AEmacron: 0x01E2, - AEsmall: 0xF7E6, - Aacute: 0x00C1, - Aacutesmall: 0xF7E1, - Abreve: 0x0102, - Abreveacute: 0x1EAE, - Abrevecyrillic: 0x04D0, - Abrevedotbelow: 0x1EB6, - Abrevegrave: 0x1EB0, - Abrevehookabove: 0x1EB2, - Abrevetilde: 0x1EB4, - Acaron: 0x01CD, - Acircle: 0x24B6, - Acircumflex: 0x00C2, - Acircumflexacute: 0x1EA4, - Acircumflexdotbelow: 0x1EAC, - Acircumflexgrave: 0x1EA6, - Acircumflexhookabove: 0x1EA8, - Acircumflexsmall: 0xF7E2, - Acircumflextilde: 0x1EAA, - Acute: 0xF6C9, - Acutesmall: 0xF7B4, - Acyrillic: 0x0410, - Adblgrave: 0x0200, - Adieresis: 0x00C4, - Adieresiscyrillic: 0x04D2, - Adieresismacron: 0x01DE, - Adieresissmall: 0xF7E4, - Adotbelow: 0x1EA0, - Adotmacron: 0x01E0, - Agrave: 0x00C0, - Agravesmall: 0xF7E0, - Ahookabove: 0x1EA2, - Aiecyrillic: 0x04D4, - Ainvertedbreve: 0x0202, - Alpha: 0x0391, - Alphatonos: 0x0386, - Amacron: 0x0100, - Amonospace: 0xFF21, - Aogonek: 0x0104, - Aring: 0x00C5, - Aringacute: 0x01FA, - Aringbelow: 0x1E00, - Aringsmall: 0xF7E5, - Asmall: 0xF761, - Atilde: 0x00C3, - Atildesmall: 0xF7E3, - Aybarmenian: 0x0531, - B: 0x0042, - Bcircle: 0x24B7, - Bdotaccent: 0x1E02, - Bdotbelow: 0x1E04, - Becyrillic: 0x0411, - Benarmenian: 0x0532, - Beta: 0x0392, - Bhook: 0x0181, - Blinebelow: 0x1E06, - Bmonospace: 0xFF22, - Brevesmall: 0xF6F4, - Bsmall: 0xF762, - Btopbar: 0x0182, - C: 0x0043, - Caarmenian: 0x053E, - Cacute: 0x0106, - Caron: 0xF6CA, - Caronsmall: 0xF6F5, - Ccaron: 0x010C, - Ccedilla: 0x00C7, - Ccedillaacute: 0x1E08, - Ccedillasmall: 0xF7E7, - Ccircle: 0x24B8, - Ccircumflex: 0x0108, - Cdot: 0x010A, - Cdotaccent: 0x010A, - Cedillasmall: 0xF7B8, - Chaarmenian: 0x0549, - Cheabkhasiancyrillic: 0x04BC, - Checyrillic: 0x0427, - Chedescenderabkhasiancyrillic: 0x04BE, - Chedescendercyrillic: 0x04B6, - Chedieresiscyrillic: 0x04F4, - Cheharmenian: 0x0543, - Chekhakassiancyrillic: 0x04CB, - Cheverticalstrokecyrillic: 0x04B8, - Chi: 0x03A7, - Chook: 0x0187, - Circumflexsmall: 0xF6F6, - Cmonospace: 0xFF23, - Coarmenian: 0x0551, - Csmall: 0xF763, - D: 0x0044, - DZ: 0x01F1, - DZcaron: 0x01C4, - Daarmenian: 0x0534, - Dafrican: 0x0189, - Dcaron: 0x010E, - Dcedilla: 0x1E10, - Dcircle: 0x24B9, - Dcircumflexbelow: 0x1E12, - Dcroat: 0x0110, - Ddotaccent: 0x1E0A, - Ddotbelow: 0x1E0C, - Decyrillic: 0x0414, - Deicoptic: 0x03EE, - Delta: 0x2206, - Deltagreek: 0x0394, - Dhook: 0x018A, - Dieresis: 0xF6CB, - DieresisAcute: 0xF6CC, - DieresisGrave: 0xF6CD, - Dieresissmall: 0xF7A8, - Digammagreek: 0x03DC, - Djecyrillic: 0x0402, - Dlinebelow: 0x1E0E, - Dmonospace: 0xFF24, - Dotaccentsmall: 0xF6F7, - Dslash: 0x0110, - Dsmall: 0xF764, - Dtopbar: 0x018B, - Dz: 0x01F2, - Dzcaron: 0x01C5, - Dzeabkhasiancyrillic: 0x04E0, - Dzecyrillic: 0x0405, - Dzhecyrillic: 0x040F, - E: 0x0045, - Eacute: 0x00C9, - Eacutesmall: 0xF7E9, - Ebreve: 0x0114, - Ecaron: 0x011A, - Ecedillabreve: 0x1E1C, - Echarmenian: 0x0535, - Ecircle: 0x24BA, - Ecircumflex: 0x00CA, - Ecircumflexacute: 0x1EBE, - Ecircumflexbelow: 0x1E18, - Ecircumflexdotbelow: 0x1EC6, - Ecircumflexgrave: 0x1EC0, - Ecircumflexhookabove: 0x1EC2, - Ecircumflexsmall: 0xF7EA, - Ecircumflextilde: 0x1EC4, - Ecyrillic: 0x0404, - Edblgrave: 0x0204, - Edieresis: 0x00CB, - Edieresissmall: 0xF7EB, - Edot: 0x0116, - Edotaccent: 0x0116, - Edotbelow: 0x1EB8, - Efcyrillic: 0x0424, - Egrave: 0x00C8, - Egravesmall: 0xF7E8, - Eharmenian: 0x0537, - Ehookabove: 0x1EBA, - Eightroman: 0x2167, - Einvertedbreve: 0x0206, - Eiotifiedcyrillic: 0x0464, - Elcyrillic: 0x041B, - Elevenroman: 0x216A, - Emacron: 0x0112, - Emacronacute: 0x1E16, - Emacrongrave: 0x1E14, - Emcyrillic: 0x041C, - Emonospace: 0xFF25, - Encyrillic: 0x041D, - Endescendercyrillic: 0x04A2, - Eng: 0x014A, - Enghecyrillic: 0x04A4, - Enhookcyrillic: 0x04C7, - Eogonek: 0x0118, - Eopen: 0x0190, - Epsilon: 0x0395, - Epsilontonos: 0x0388, - Ercyrillic: 0x0420, - Ereversed: 0x018E, - Ereversedcyrillic: 0x042D, - Escyrillic: 0x0421, - Esdescendercyrillic: 0x04AA, - Esh: 0x01A9, - Esmall: 0xF765, - Eta: 0x0397, - Etarmenian: 0x0538, - Etatonos: 0x0389, - Eth: 0x00D0, - Ethsmall: 0xF7F0, - Etilde: 0x1EBC, - Etildebelow: 0x1E1A, - Euro: 0x20AC, - Ezh: 0x01B7, - Ezhcaron: 0x01EE, - Ezhreversed: 0x01B8, - F: 0x0046, - Fcircle: 0x24BB, - Fdotaccent: 0x1E1E, - Feharmenian: 0x0556, - Feicoptic: 0x03E4, - Fhook: 0x0191, - Fitacyrillic: 0x0472, - Fiveroman: 0x2164, - Fmonospace: 0xFF26, - Fourroman: 0x2163, - Fsmall: 0xF766, - G: 0x0047, - GBsquare: 0x3387, - Gacute: 0x01F4, - Gamma: 0x0393, - Gammaafrican: 0x0194, - Gangiacoptic: 0x03EA, - Gbreve: 0x011E, - Gcaron: 0x01E6, - Gcedilla: 0x0122, - Gcircle: 0x24BC, - Gcircumflex: 0x011C, - Gcommaaccent: 0x0122, - Gdot: 0x0120, - Gdotaccent: 0x0120, - Gecyrillic: 0x0413, - Ghadarmenian: 0x0542, - Ghemiddlehookcyrillic: 0x0494, - Ghestrokecyrillic: 0x0492, - Gheupturncyrillic: 0x0490, - Ghook: 0x0193, - Gimarmenian: 0x0533, - Gjecyrillic: 0x0403, - Gmacron: 0x1E20, - Gmonospace: 0xFF27, - Grave: 0xF6CE, - Gravesmall: 0xF760, - Gsmall: 0xF767, - Gsmallhook: 0x029B, - Gstroke: 0x01E4, - H: 0x0048, - H18533: 0x25CF, - H18543: 0x25AA, - H18551: 0x25AB, - H22073: 0x25A1, - HPsquare: 0x33CB, - Haabkhasiancyrillic: 0x04A8, - Hadescendercyrillic: 0x04B2, - Hardsigncyrillic: 0x042A, - Hbar: 0x0126, - Hbrevebelow: 0x1E2A, - Hcedilla: 0x1E28, - Hcircle: 0x24BD, - Hcircumflex: 0x0124, - Hdieresis: 0x1E26, - Hdotaccent: 0x1E22, - Hdotbelow: 0x1E24, - Hmonospace: 0xFF28, - Hoarmenian: 0x0540, - Horicoptic: 0x03E8, - Hsmall: 0xF768, - Hungarumlaut: 0xF6CF, - Hungarumlautsmall: 0xF6F8, - Hzsquare: 0x3390, - I: 0x0049, - IAcyrillic: 0x042F, - IJ: 0x0132, - IUcyrillic: 0x042E, - Iacute: 0x00CD, - Iacutesmall: 0xF7ED, - Ibreve: 0x012C, - Icaron: 0x01CF, - Icircle: 0x24BE, - Icircumflex: 0x00CE, - Icircumflexsmall: 0xF7EE, - Icyrillic: 0x0406, - Idblgrave: 0x0208, - Idieresis: 0x00CF, - Idieresisacute: 0x1E2E, - Idieresiscyrillic: 0x04E4, - Idieresissmall: 0xF7EF, - Idot: 0x0130, - Idotaccent: 0x0130, - Idotbelow: 0x1ECA, - Iebrevecyrillic: 0x04D6, - Iecyrillic: 0x0415, - Ifraktur: 0x2111, - Igrave: 0x00CC, - Igravesmall: 0xF7EC, - Ihookabove: 0x1EC8, - Iicyrillic: 0x0418, - Iinvertedbreve: 0x020A, - Iishortcyrillic: 0x0419, - Imacron: 0x012A, - Imacroncyrillic: 0x04E2, - Imonospace: 0xFF29, - Iniarmenian: 0x053B, - Iocyrillic: 0x0401, - Iogonek: 0x012E, - Iota: 0x0399, - Iotaafrican: 0x0196, - Iotadieresis: 0x03AA, - Iotatonos: 0x038A, - Ismall: 0xF769, - Istroke: 0x0197, - Itilde: 0x0128, - Itildebelow: 0x1E2C, - Izhitsacyrillic: 0x0474, - Izhitsadblgravecyrillic: 0x0476, - J: 0x004A, - Jaarmenian: 0x0541, - Jcircle: 0x24BF, - Jcircumflex: 0x0134, - Jecyrillic: 0x0408, - Jheharmenian: 0x054B, - Jmonospace: 0xFF2A, - Jsmall: 0xF76A, - K: 0x004B, - KBsquare: 0x3385, - KKsquare: 0x33CD, - Kabashkircyrillic: 0x04A0, - Kacute: 0x1E30, - Kacyrillic: 0x041A, - Kadescendercyrillic: 0x049A, - Kahookcyrillic: 0x04C3, - Kappa: 0x039A, - Kastrokecyrillic: 0x049E, - Kaverticalstrokecyrillic: 0x049C, - Kcaron: 0x01E8, - Kcedilla: 0x0136, - Kcircle: 0x24C0, - Kcommaaccent: 0x0136, - Kdotbelow: 0x1E32, - Keharmenian: 0x0554, - Kenarmenian: 0x053F, - Khacyrillic: 0x0425, - Kheicoptic: 0x03E6, - Khook: 0x0198, - Kjecyrillic: 0x040C, - Klinebelow: 0x1E34, - Kmonospace: 0xFF2B, - Koppacyrillic: 0x0480, - Koppagreek: 0x03DE, - Ksicyrillic: 0x046E, - Ksmall: 0xF76B, - L: 0x004C, - LJ: 0x01C7, - LL: 0xF6BF, - Lacute: 0x0139, - Lambda: 0x039B, - Lcaron: 0x013D, - Lcedilla: 0x013B, - Lcircle: 0x24C1, - Lcircumflexbelow: 0x1E3C, - Lcommaaccent: 0x013B, - Ldot: 0x013F, - Ldotaccent: 0x013F, - Ldotbelow: 0x1E36, - Ldotbelowmacron: 0x1E38, - Liwnarmenian: 0x053C, - Lj: 0x01C8, - Ljecyrillic: 0x0409, - Llinebelow: 0x1E3A, - Lmonospace: 0xFF2C, - Lslash: 0x0141, - Lslashsmall: 0xF6F9, - Lsmall: 0xF76C, - M: 0x004D, - MBsquare: 0x3386, - Macron: 0xF6D0, - Macronsmall: 0xF7AF, - Macute: 0x1E3E, - Mcircle: 0x24C2, - Mdotaccent: 0x1E40, - Mdotbelow: 0x1E42, - Menarmenian: 0x0544, - Mmonospace: 0xFF2D, - Msmall: 0xF76D, - Mturned: 0x019C, - Mu: 0x039C, - N: 0x004E, - NJ: 0x01CA, - Nacute: 0x0143, - Ncaron: 0x0147, - Ncedilla: 0x0145, - Ncircle: 0x24C3, - Ncircumflexbelow: 0x1E4A, - Ncommaaccent: 0x0145, - Ndotaccent: 0x1E44, - Ndotbelow: 0x1E46, - Nhookleft: 0x019D, - Nineroman: 0x2168, - Nj: 0x01CB, - Njecyrillic: 0x040A, - Nlinebelow: 0x1E48, - Nmonospace: 0xFF2E, - Nowarmenian: 0x0546, - Nsmall: 0xF76E, - Ntilde: 0x00D1, - Ntildesmall: 0xF7F1, - Nu: 0x039D, - O: 0x004F, - OE: 0x0152, - OEsmall: 0xF6FA, - Oacute: 0x00D3, - Oacutesmall: 0xF7F3, - Obarredcyrillic: 0x04E8, - Obarreddieresiscyrillic: 0x04EA, - Obreve: 0x014E, - Ocaron: 0x01D1, - Ocenteredtilde: 0x019F, - Ocircle: 0x24C4, - Ocircumflex: 0x00D4, - Ocircumflexacute: 0x1ED0, - Ocircumflexdotbelow: 0x1ED8, - Ocircumflexgrave: 0x1ED2, - Ocircumflexhookabove: 0x1ED4, - Ocircumflexsmall: 0xF7F4, - Ocircumflextilde: 0x1ED6, - Ocyrillic: 0x041E, - Odblacute: 0x0150, - Odblgrave: 0x020C, - Odieresis: 0x00D6, - Odieresiscyrillic: 0x04E6, - Odieresissmall: 0xF7F6, - Odotbelow: 0x1ECC, - Ogoneksmall: 0xF6FB, - Ograve: 0x00D2, - Ogravesmall: 0xF7F2, - Oharmenian: 0x0555, - Ohm: 0x2126, - Ohookabove: 0x1ECE, - Ohorn: 0x01A0, - Ohornacute: 0x1EDA, - Ohorndotbelow: 0x1EE2, - Ohorngrave: 0x1EDC, - Ohornhookabove: 0x1EDE, - Ohorntilde: 0x1EE0, - Ohungarumlaut: 0x0150, - Oi: 0x01A2, - Oinvertedbreve: 0x020E, - Omacron: 0x014C, - Omacronacute: 0x1E52, - Omacrongrave: 0x1E50, - Omega: 0x2126, - Omegacyrillic: 0x0460, - Omegagreek: 0x03A9, - Omegaroundcyrillic: 0x047A, - Omegatitlocyrillic: 0x047C, - Omegatonos: 0x038F, - Omicron: 0x039F, - Omicrontonos: 0x038C, - Omonospace: 0xFF2F, - Oneroman: 0x2160, - Oogonek: 0x01EA, - Oogonekmacron: 0x01EC, - Oopen: 0x0186, - Oslash: 0x00D8, - Oslashacute: 0x01FE, - Oslashsmall: 0xF7F8, - Osmall: 0xF76F, - Ostrokeacute: 0x01FE, - Otcyrillic: 0x047E, - Otilde: 0x00D5, - Otildeacute: 0x1E4C, - Otildedieresis: 0x1E4E, - Otildesmall: 0xF7F5, - P: 0x0050, - Pacute: 0x1E54, - Pcircle: 0x24C5, - Pdotaccent: 0x1E56, - Pecyrillic: 0x041F, - Peharmenian: 0x054A, - Pemiddlehookcyrillic: 0x04A6, - Phi: 0x03A6, - Phook: 0x01A4, - Pi: 0x03A0, - Piwrarmenian: 0x0553, - Pmonospace: 0xFF30, - Psi: 0x03A8, - Psicyrillic: 0x0470, - Psmall: 0xF770, - Q: 0x0051, - Qcircle: 0x24C6, - Qmonospace: 0xFF31, - Qsmall: 0xF771, - R: 0x0052, - Raarmenian: 0x054C, - Racute: 0x0154, - Rcaron: 0x0158, - Rcedilla: 0x0156, - Rcircle: 0x24C7, - Rcommaaccent: 0x0156, - Rdblgrave: 0x0210, - Rdotaccent: 0x1E58, - Rdotbelow: 0x1E5A, - Rdotbelowmacron: 0x1E5C, - Reharmenian: 0x0550, - Rfraktur: 0x211C, - Rho: 0x03A1, - Ringsmall: 0xF6FC, - Rinvertedbreve: 0x0212, - Rlinebelow: 0x1E5E, - Rmonospace: 0xFF32, - Rsmall: 0xF772, - Rsmallinverted: 0x0281, - Rsmallinvertedsuperior: 0x02B6, - S: 0x0053, - SF010000: 0x250C, - SF020000: 0x2514, - SF030000: 0x2510, - SF040000: 0x2518, - SF050000: 0x253C, - SF060000: 0x252C, - SF070000: 0x2534, - SF080000: 0x251C, - SF090000: 0x2524, - SF100000: 0x2500, - SF110000: 0x2502, - SF190000: 0x2561, - SF200000: 0x2562, - SF210000: 0x2556, - SF220000: 0x2555, - SF230000: 0x2563, - SF240000: 0x2551, - SF250000: 0x2557, - SF260000: 0x255D, - SF270000: 0x255C, - SF280000: 0x255B, - SF360000: 0x255E, - SF370000: 0x255F, - SF380000: 0x255A, - SF390000: 0x2554, - SF400000: 0x2569, - SF410000: 0x2566, - SF420000: 0x2560, - SF430000: 0x2550, - SF440000: 0x256C, - SF450000: 0x2567, - SF460000: 0x2568, - SF470000: 0x2564, - SF480000: 0x2565, - SF490000: 0x2559, - SF500000: 0x2558, - SF510000: 0x2552, - SF520000: 0x2553, - SF530000: 0x256B, - SF540000: 0x256A, - Sacute: 0x015A, - Sacutedotaccent: 0x1E64, - Sampigreek: 0x03E0, - Scaron: 0x0160, - Scarondotaccent: 0x1E66, - Scaronsmall: 0xF6FD, - Scedilla: 0x015E, - Schwa: 0x018F, - Schwacyrillic: 0x04D8, - Schwadieresiscyrillic: 0x04DA, - Scircle: 0x24C8, - Scircumflex: 0x015C, - Scommaaccent: 0x0218, - Sdotaccent: 0x1E60, - Sdotbelow: 0x1E62, - Sdotbelowdotaccent: 0x1E68, - Seharmenian: 0x054D, - Sevenroman: 0x2166, - Shaarmenian: 0x0547, - Shacyrillic: 0x0428, - Shchacyrillic: 0x0429, - Sheicoptic: 0x03E2, - Shhacyrillic: 0x04BA, - Shimacoptic: 0x03EC, - Sigma: 0x03A3, - Sixroman: 0x2165, - Smonospace: 0xFF33, - Softsigncyrillic: 0x042C, - Ssmall: 0xF773, - Stigmagreek: 0x03DA, - T: 0x0054, - Tau: 0x03A4, - Tbar: 0x0166, - Tcaron: 0x0164, - Tcedilla: 0x0162, - Tcircle: 0x24C9, - Tcircumflexbelow: 0x1E70, - Tcommaaccent: 0x0162, - Tdotaccent: 0x1E6A, - Tdotbelow: 0x1E6C, - Tecyrillic: 0x0422, - Tedescendercyrillic: 0x04AC, - Tenroman: 0x2169, - Tetsecyrillic: 0x04B4, - Theta: 0x0398, - Thook: 0x01AC, - Thorn: 0x00DE, - Thornsmall: 0xF7FE, - Threeroman: 0x2162, - Tildesmall: 0xF6FE, - Tiwnarmenian: 0x054F, - Tlinebelow: 0x1E6E, - Tmonospace: 0xFF34, - Toarmenian: 0x0539, - Tonefive: 0x01BC, - Tonesix: 0x0184, - Tonetwo: 0x01A7, - Tretroflexhook: 0x01AE, - Tsecyrillic: 0x0426, - Tshecyrillic: 0x040B, - Tsmall: 0xF774, - Twelveroman: 0x216B, - Tworoman: 0x2161, - U: 0x0055, - Uacute: 0x00DA, - Uacutesmall: 0xF7FA, - Ubreve: 0x016C, - Ucaron: 0x01D3, - Ucircle: 0x24CA, - Ucircumflex: 0x00DB, - Ucircumflexbelow: 0x1E76, - Ucircumflexsmall: 0xF7FB, - Ucyrillic: 0x0423, - Udblacute: 0x0170, - Udblgrave: 0x0214, - Udieresis: 0x00DC, - Udieresisacute: 0x01D7, - Udieresisbelow: 0x1E72, - Udieresiscaron: 0x01D9, - Udieresiscyrillic: 0x04F0, - Udieresisgrave: 0x01DB, - Udieresismacron: 0x01D5, - Udieresissmall: 0xF7FC, - Udotbelow: 0x1EE4, - Ugrave: 0x00D9, - Ugravesmall: 0xF7F9, - Uhookabove: 0x1EE6, - Uhorn: 0x01AF, - Uhornacute: 0x1EE8, - Uhorndotbelow: 0x1EF0, - Uhorngrave: 0x1EEA, - Uhornhookabove: 0x1EEC, - Uhorntilde: 0x1EEE, - Uhungarumlaut: 0x0170, - Uhungarumlautcyrillic: 0x04F2, - Uinvertedbreve: 0x0216, - Ukcyrillic: 0x0478, - Umacron: 0x016A, - Umacroncyrillic: 0x04EE, - Umacrondieresis: 0x1E7A, - Umonospace: 0xFF35, - Uogonek: 0x0172, - Upsilon: 0x03A5, - Upsilon1: 0x03D2, - Upsilonacutehooksymbolgreek: 0x03D3, - Upsilonafrican: 0x01B1, - Upsilondieresis: 0x03AB, - Upsilondieresishooksymbolgreek: 0x03D4, - Upsilonhooksymbol: 0x03D2, - Upsilontonos: 0x038E, - Uring: 0x016E, - Ushortcyrillic: 0x040E, - Usmall: 0xF775, - Ustraightcyrillic: 0x04AE, - Ustraightstrokecyrillic: 0x04B0, - Utilde: 0x0168, - Utildeacute: 0x1E78, - Utildebelow: 0x1E74, - V: 0x0056, - Vcircle: 0x24CB, - Vdotbelow: 0x1E7E, - Vecyrillic: 0x0412, - Vewarmenian: 0x054E, - Vhook: 0x01B2, - Vmonospace: 0xFF36, - Voarmenian: 0x0548, - Vsmall: 0xF776, - Vtilde: 0x1E7C, - W: 0x0057, - Wacute: 0x1E82, - Wcircle: 0x24CC, - Wcircumflex: 0x0174, - Wdieresis: 0x1E84, - Wdotaccent: 0x1E86, - Wdotbelow: 0x1E88, - Wgrave: 0x1E80, - Wmonospace: 0xFF37, - Wsmall: 0xF777, - X: 0x0058, - Xcircle: 0x24CD, - Xdieresis: 0x1E8C, - Xdotaccent: 0x1E8A, - Xeharmenian: 0x053D, - Xi: 0x039E, - Xmonospace: 0xFF38, - Xsmall: 0xF778, - Y: 0x0059, - Yacute: 0x00DD, - Yacutesmall: 0xF7FD, - Yatcyrillic: 0x0462, - Ycircle: 0x24CE, - Ycircumflex: 0x0176, - Ydieresis: 0x0178, - Ydieresissmall: 0xF7FF, - Ydotaccent: 0x1E8E, - Ydotbelow: 0x1EF4, - Yericyrillic: 0x042B, - Yerudieresiscyrillic: 0x04F8, - Ygrave: 0x1EF2, - Yhook: 0x01B3, - Yhookabove: 0x1EF6, - Yiarmenian: 0x0545, - Yicyrillic: 0x0407, - Yiwnarmenian: 0x0552, - Ymonospace: 0xFF39, - Ysmall: 0xF779, - Ytilde: 0x1EF8, - Yusbigcyrillic: 0x046A, - Yusbigiotifiedcyrillic: 0x046C, - Yuslittlecyrillic: 0x0466, - Yuslittleiotifiedcyrillic: 0x0468, - Z: 0x005A, - Zaarmenian: 0x0536, - Zacute: 0x0179, - Zcaron: 0x017D, - Zcaronsmall: 0xF6FF, - Zcircle: 0x24CF, - Zcircumflex: 0x1E90, - Zdot: 0x017B, - Zdotaccent: 0x017B, - Zdotbelow: 0x1E92, - Zecyrillic: 0x0417, - Zedescendercyrillic: 0x0498, - Zedieresiscyrillic: 0x04DE, - Zeta: 0x0396, - Zhearmenian: 0x053A, - Zhebrevecyrillic: 0x04C1, - Zhecyrillic: 0x0416, - Zhedescendercyrillic: 0x0496, - Zhedieresiscyrillic: 0x04DC, - Zlinebelow: 0x1E94, - Zmonospace: 0xFF3A, - Zsmall: 0xF77A, - Zstroke: 0x01B5, - a: 0x0061, - aabengali: 0x0986, - aacute: 0x00E1, - aadeva: 0x0906, - aagujarati: 0x0A86, - aagurmukhi: 0x0A06, - aamatragurmukhi: 0x0A3E, - aarusquare: 0x3303, - aavowelsignbengali: 0x09BE, - aavowelsigndeva: 0x093E, - aavowelsigngujarati: 0x0ABE, - abbreviationmarkarmenian: 0x055F, - abbreviationsigndeva: 0x0970, - abengali: 0x0985, - abopomofo: 0x311A, - abreve: 0x0103, - abreveacute: 0x1EAF, - abrevecyrillic: 0x04D1, - abrevedotbelow: 0x1EB7, - abrevegrave: 0x1EB1, - abrevehookabove: 0x1EB3, - abrevetilde: 0x1EB5, - acaron: 0x01CE, - acircle: 0x24D0, - acircumflex: 0x00E2, - acircumflexacute: 0x1EA5, - acircumflexdotbelow: 0x1EAD, - acircumflexgrave: 0x1EA7, - acircumflexhookabove: 0x1EA9, - acircumflextilde: 0x1EAB, - acute: 0x00B4, - acutebelowcmb: 0x0317, - acutecmb: 0x0301, - acutecomb: 0x0301, - acutedeva: 0x0954, - acutelowmod: 0x02CF, - acutetonecmb: 0x0341, - acyrillic: 0x0430, - adblgrave: 0x0201, - addakgurmukhi: 0x0A71, - adeva: 0x0905, - adieresis: 0x00E4, - adieresiscyrillic: 0x04D3, - adieresismacron: 0x01DF, - adotbelow: 0x1EA1, - adotmacron: 0x01E1, - ae: 0x00E6, - aeacute: 0x01FD, - aekorean: 0x3150, - aemacron: 0x01E3, - afii00208: 0x2015, - afii08941: 0x20A4, - afii10017: 0x0410, - afii10018: 0x0411, - afii10019: 0x0412, - afii10020: 0x0413, - afii10021: 0x0414, - afii10022: 0x0415, - afii10023: 0x0401, - afii10024: 0x0416, - afii10025: 0x0417, - afii10026: 0x0418, - afii10027: 0x0419, - afii10028: 0x041A, - afii10029: 0x041B, - afii10030: 0x041C, - afii10031: 0x041D, - afii10032: 0x041E, - afii10033: 0x041F, - afii10034: 0x0420, - afii10035: 0x0421, - afii10036: 0x0422, - afii10037: 0x0423, - afii10038: 0x0424, - afii10039: 0x0425, - afii10040: 0x0426, - afii10041: 0x0427, - afii10042: 0x0428, - afii10043: 0x0429, - afii10044: 0x042A, - afii10045: 0x042B, - afii10046: 0x042C, - afii10047: 0x042D, - afii10048: 0x042E, - afii10049: 0x042F, - afii10050: 0x0490, - afii10051: 0x0402, - afii10052: 0x0403, - afii10053: 0x0404, - afii10054: 0x0405, - afii10055: 0x0406, - afii10056: 0x0407, - afii10057: 0x0408, - afii10058: 0x0409, - afii10059: 0x040A, - afii10060: 0x040B, - afii10061: 0x040C, - afii10062: 0x040E, - afii10063: 0xF6C4, - afii10064: 0xF6C5, - afii10065: 0x0430, - afii10066: 0x0431, - afii10067: 0x0432, - afii10068: 0x0433, - afii10069: 0x0434, - afii10070: 0x0435, - afii10071: 0x0451, - afii10072: 0x0436, - afii10073: 0x0437, - afii10074: 0x0438, - afii10075: 0x0439, - afii10076: 0x043A, - afii10077: 0x043B, - afii10078: 0x043C, - afii10079: 0x043D, - afii10080: 0x043E, - afii10081: 0x043F, - afii10082: 0x0440, - afii10083: 0x0441, - afii10084: 0x0442, - afii10085: 0x0443, - afii10086: 0x0444, - afii10087: 0x0445, - afii10088: 0x0446, - afii10089: 0x0447, - afii10090: 0x0448, - afii10091: 0x0449, - afii10092: 0x044A, - afii10093: 0x044B, - afii10094: 0x044C, - afii10095: 0x044D, - afii10096: 0x044E, - afii10097: 0x044F, - afii10098: 0x0491, - afii10099: 0x0452, - afii10100: 0x0453, - afii10101: 0x0454, - afii10102: 0x0455, - afii10103: 0x0456, - afii10104: 0x0457, - afii10105: 0x0458, - afii10106: 0x0459, - afii10107: 0x045A, - afii10108: 0x045B, - afii10109: 0x045C, - afii10110: 0x045E, - afii10145: 0x040F, - afii10146: 0x0462, - afii10147: 0x0472, - afii10148: 0x0474, - afii10192: 0xF6C6, - afii10193: 0x045F, - afii10194: 0x0463, - afii10195: 0x0473, - afii10196: 0x0475, - afii10831: 0xF6C7, - afii10832: 0xF6C8, - afii10846: 0x04D9, - afii299: 0x200E, - afii300: 0x200F, - afii301: 0x200D, - afii57381: 0x066A, - afii57388: 0x060C, - afii57392: 0x0660, - afii57393: 0x0661, - afii57394: 0x0662, - afii57395: 0x0663, - afii57396: 0x0664, - afii57397: 0x0665, - afii57398: 0x0666, - afii57399: 0x0667, - afii57400: 0x0668, - afii57401: 0x0669, - afii57403: 0x061B, - afii57407: 0x061F, - afii57409: 0x0621, - afii57410: 0x0622, - afii57411: 0x0623, - afii57412: 0x0624, - afii57413: 0x0625, - afii57414: 0x0626, - afii57415: 0x0627, - afii57416: 0x0628, - afii57417: 0x0629, - afii57418: 0x062A, - afii57419: 0x062B, - afii57420: 0x062C, - afii57421: 0x062D, - afii57422: 0x062E, - afii57423: 0x062F, - afii57424: 0x0630, - afii57425: 0x0631, - afii57426: 0x0632, - afii57427: 0x0633, - afii57428: 0x0634, - afii57429: 0x0635, - afii57430: 0x0636, - afii57431: 0x0637, - afii57432: 0x0638, - afii57433: 0x0639, - afii57434: 0x063A, - afii57440: 0x0640, - afii57441: 0x0641, - afii57442: 0x0642, - afii57443: 0x0643, - afii57444: 0x0644, - afii57445: 0x0645, - afii57446: 0x0646, - afii57448: 0x0648, - afii57449: 0x0649, - afii57450: 0x064A, - afii57451: 0x064B, - afii57452: 0x064C, - afii57453: 0x064D, - afii57454: 0x064E, - afii57455: 0x064F, - afii57456: 0x0650, - afii57457: 0x0651, - afii57458: 0x0652, - afii57470: 0x0647, - afii57505: 0x06A4, - afii57506: 0x067E, - afii57507: 0x0686, - afii57508: 0x0698, - afii57509: 0x06AF, - afii57511: 0x0679, - afii57512: 0x0688, - afii57513: 0x0691, - afii57514: 0x06BA, - afii57519: 0x06D2, - afii57534: 0x06D5, - afii57636: 0x20AA, - afii57645: 0x05BE, - afii57658: 0x05C3, - afii57664: 0x05D0, - afii57665: 0x05D1, - afii57666: 0x05D2, - afii57667: 0x05D3, - afii57668: 0x05D4, - afii57669: 0x05D5, - afii57670: 0x05D6, - afii57671: 0x05D7, - afii57672: 0x05D8, - afii57673: 0x05D9, - afii57674: 0x05DA, - afii57675: 0x05DB, - afii57676: 0x05DC, - afii57677: 0x05DD, - afii57678: 0x05DE, - afii57679: 0x05DF, - afii57680: 0x05E0, - afii57681: 0x05E1, - afii57682: 0x05E2, - afii57683: 0x05E3, - afii57684: 0x05E4, - afii57685: 0x05E5, - afii57686: 0x05E6, - afii57687: 0x05E7, - afii57688: 0x05E8, - afii57689: 0x05E9, - afii57690: 0x05EA, - afii57694: 0xFB2A, - afii57695: 0xFB2B, - afii57700: 0xFB4B, - afii57705: 0xFB1F, - afii57716: 0x05F0, - afii57717: 0x05F1, - afii57718: 0x05F2, - afii57723: 0xFB35, - afii57793: 0x05B4, - afii57794: 0x05B5, - afii57795: 0x05B6, - afii57796: 0x05BB, - afii57797: 0x05B8, - afii57798: 0x05B7, - afii57799: 0x05B0, - afii57800: 0x05B2, - afii57801: 0x05B1, - afii57802: 0x05B3, - afii57803: 0x05C2, - afii57804: 0x05C1, - afii57806: 0x05B9, - afii57807: 0x05BC, - afii57839: 0x05BD, - afii57841: 0x05BF, - afii57842: 0x05C0, - afii57929: 0x02BC, - afii61248: 0x2105, - afii61289: 0x2113, - afii61352: 0x2116, - afii61573: 0x202C, - afii61574: 0x202D, - afii61575: 0x202E, - afii61664: 0x200C, - afii63167: 0x066D, - afii64937: 0x02BD, - agrave: 0x00E0, - agujarati: 0x0A85, - agurmukhi: 0x0A05, - ahiragana: 0x3042, - ahookabove: 0x1EA3, - aibengali: 0x0990, - aibopomofo: 0x311E, - aideva: 0x0910, - aiecyrillic: 0x04D5, - aigujarati: 0x0A90, - aigurmukhi: 0x0A10, - aimatragurmukhi: 0x0A48, - ainarabic: 0x0639, - ainfinalarabic: 0xFECA, - aininitialarabic: 0xFECB, - ainmedialarabic: 0xFECC, - ainvertedbreve: 0x0203, - aivowelsignbengali: 0x09C8, - aivowelsigndeva: 0x0948, - aivowelsigngujarati: 0x0AC8, - akatakana: 0x30A2, - akatakanahalfwidth: 0xFF71, - akorean: 0x314F, - alef: 0x05D0, - alefarabic: 0x0627, - alefdageshhebrew: 0xFB30, - aleffinalarabic: 0xFE8E, - alefhamzaabovearabic: 0x0623, - alefhamzaabovefinalarabic: 0xFE84, - alefhamzabelowarabic: 0x0625, - alefhamzabelowfinalarabic: 0xFE88, - alefhebrew: 0x05D0, - aleflamedhebrew: 0xFB4F, - alefmaddaabovearabic: 0x0622, - alefmaddaabovefinalarabic: 0xFE82, - alefmaksuraarabic: 0x0649, - alefmaksurafinalarabic: 0xFEF0, - alefmaksurainitialarabic: 0xFEF3, - alefmaksuramedialarabic: 0xFEF4, - alefpatahhebrew: 0xFB2E, - alefqamatshebrew: 0xFB2F, - aleph: 0x2135, - allequal: 0x224C, - alpha: 0x03B1, - alphatonos: 0x03AC, - amacron: 0x0101, - amonospace: 0xFF41, - ampersand: 0x0026, - ampersandmonospace: 0xFF06, - ampersandsmall: 0xF726, - amsquare: 0x33C2, - anbopomofo: 0x3122, - angbopomofo: 0x3124, - angbracketleft: 0x3008, // This glyph is missing from Adobe's original list. - angbracketright: 0x3009, // This glyph is missing from Adobe's original list. - angkhankhuthai: 0x0E5A, - angle: 0x2220, - anglebracketleft: 0x3008, - anglebracketleftvertical: 0xFE3F, - anglebracketright: 0x3009, - anglebracketrightvertical: 0xFE40, - angleleft: 0x2329, - angleright: 0x232A, - angstrom: 0x212B, - anoteleia: 0x0387, - anudattadeva: 0x0952, - anusvarabengali: 0x0982, - anusvaradeva: 0x0902, - anusvaragujarati: 0x0A82, - aogonek: 0x0105, - apaatosquare: 0x3300, - aparen: 0x249C, - apostrophearmenian: 0x055A, - apostrophemod: 0x02BC, - apple: 0xF8FF, - approaches: 0x2250, - approxequal: 0x2248, - approxequalorimage: 0x2252, - approximatelyequal: 0x2245, - araeaekorean: 0x318E, - araeakorean: 0x318D, - arc: 0x2312, - arighthalfring: 0x1E9A, - aring: 0x00E5, - aringacute: 0x01FB, - aringbelow: 0x1E01, - arrowboth: 0x2194, - arrowdashdown: 0x21E3, - arrowdashleft: 0x21E0, - arrowdashright: 0x21E2, - arrowdashup: 0x21E1, - arrowdblboth: 0x21D4, - arrowdbldown: 0x21D3, - arrowdblleft: 0x21D0, - arrowdblright: 0x21D2, - arrowdblup: 0x21D1, - arrowdown: 0x2193, - arrowdownleft: 0x2199, - arrowdownright: 0x2198, - arrowdownwhite: 0x21E9, - arrowheaddownmod: 0x02C5, - arrowheadleftmod: 0x02C2, - arrowheadrightmod: 0x02C3, - arrowheadupmod: 0x02C4, - arrowhorizex: 0xF8E7, - arrowleft: 0x2190, - arrowleftdbl: 0x21D0, - arrowleftdblstroke: 0x21CD, - arrowleftoverright: 0x21C6, - arrowleftwhite: 0x21E6, - arrowright: 0x2192, - arrowrightdblstroke: 0x21CF, - arrowrightheavy: 0x279E, - arrowrightoverleft: 0x21C4, - arrowrightwhite: 0x21E8, - arrowtableft: 0x21E4, - arrowtabright: 0x21E5, - arrowup: 0x2191, - arrowupdn: 0x2195, - arrowupdnbse: 0x21A8, - arrowupdownbase: 0x21A8, - arrowupleft: 0x2196, - arrowupleftofdown: 0x21C5, - arrowupright: 0x2197, - arrowupwhite: 0x21E7, - arrowvertex: 0xF8E6, - asciicircum: 0x005E, - asciicircummonospace: 0xFF3E, - asciitilde: 0x007E, - asciitildemonospace: 0xFF5E, - ascript: 0x0251, - ascriptturned: 0x0252, - asmallhiragana: 0x3041, - asmallkatakana: 0x30A1, - asmallkatakanahalfwidth: 0xFF67, - asterisk: 0x002A, - asteriskaltonearabic: 0x066D, - asteriskarabic: 0x066D, - asteriskmath: 0x2217, - asteriskmonospace: 0xFF0A, - asterisksmall: 0xFE61, - asterism: 0x2042, - asuperior: 0xF6E9, - asymptoticallyequal: 0x2243, - at: 0x0040, - atilde: 0x00E3, - atmonospace: 0xFF20, - atsmall: 0xFE6B, - aturned: 0x0250, - aubengali: 0x0994, - aubopomofo: 0x3120, - audeva: 0x0914, - augujarati: 0x0A94, - augurmukhi: 0x0A14, - aulengthmarkbengali: 0x09D7, - aumatragurmukhi: 0x0A4C, - auvowelsignbengali: 0x09CC, - auvowelsigndeva: 0x094C, - auvowelsigngujarati: 0x0ACC, - avagrahadeva: 0x093D, - aybarmenian: 0x0561, - ayin: 0x05E2, - ayinaltonehebrew: 0xFB20, - ayinhebrew: 0x05E2, - b: 0x0062, - babengali: 0x09AC, - backslash: 0x005C, - backslashmonospace: 0xFF3C, - badeva: 0x092C, - bagujarati: 0x0AAC, - bagurmukhi: 0x0A2C, - bahiragana: 0x3070, - bahtthai: 0x0E3F, - bakatakana: 0x30D0, - bar: 0x007C, - barmonospace: 0xFF5C, - bbopomofo: 0x3105, - bcircle: 0x24D1, - bdotaccent: 0x1E03, - bdotbelow: 0x1E05, - beamedsixteenthnotes: 0x266C, - because: 0x2235, - becyrillic: 0x0431, - beharabic: 0x0628, - behfinalarabic: 0xFE90, - behinitialarabic: 0xFE91, - behiragana: 0x3079, - behmedialarabic: 0xFE92, - behmeeminitialarabic: 0xFC9F, - behmeemisolatedarabic: 0xFC08, - behnoonfinalarabic: 0xFC6D, - bekatakana: 0x30D9, - benarmenian: 0x0562, - bet: 0x05D1, - beta: 0x03B2, - betasymbolgreek: 0x03D0, - betdagesh: 0xFB31, - betdageshhebrew: 0xFB31, - bethebrew: 0x05D1, - betrafehebrew: 0xFB4C, - bhabengali: 0x09AD, - bhadeva: 0x092D, - bhagujarati: 0x0AAD, - bhagurmukhi: 0x0A2D, - bhook: 0x0253, - bihiragana: 0x3073, - bikatakana: 0x30D3, - bilabialclick: 0x0298, - bindigurmukhi: 0x0A02, - birusquare: 0x3331, - blackcircle: 0x25CF, - blackdiamond: 0x25C6, - blackdownpointingtriangle: 0x25BC, - blackleftpointingpointer: 0x25C4, - blackleftpointingtriangle: 0x25C0, - blacklenticularbracketleft: 0x3010, - blacklenticularbracketleftvertical: 0xFE3B, - blacklenticularbracketright: 0x3011, - blacklenticularbracketrightvertical: 0xFE3C, - blacklowerlefttriangle: 0x25E3, - blacklowerrighttriangle: 0x25E2, - blackrectangle: 0x25AC, - blackrightpointingpointer: 0x25BA, - blackrightpointingtriangle: 0x25B6, - blacksmallsquare: 0x25AA, - blacksmilingface: 0x263B, - blacksquare: 0x25A0, - blackstar: 0x2605, - blackupperlefttriangle: 0x25E4, - blackupperrighttriangle: 0x25E5, - blackuppointingsmalltriangle: 0x25B4, - blackuppointingtriangle: 0x25B2, - blank: 0x2423, - blinebelow: 0x1E07, - block: 0x2588, - bmonospace: 0xFF42, - bobaimaithai: 0x0E1A, - bohiragana: 0x307C, - bokatakana: 0x30DC, - bparen: 0x249D, - bqsquare: 0x33C3, - braceex: 0xF8F4, - braceleft: 0x007B, - braceleftbt: 0xF8F3, - braceleftmid: 0xF8F2, - braceleftmonospace: 0xFF5B, - braceleftsmall: 0xFE5B, - bracelefttp: 0xF8F1, - braceleftvertical: 0xFE37, - braceright: 0x007D, - bracerightbt: 0xF8FE, - bracerightmid: 0xF8FD, - bracerightmonospace: 0xFF5D, - bracerightsmall: 0xFE5C, - bracerighttp: 0xF8FC, - bracerightvertical: 0xFE38, - bracketleft: 0x005B, - bracketleftbt: 0xF8F0, - bracketleftex: 0xF8EF, - bracketleftmonospace: 0xFF3B, - bracketlefttp: 0xF8EE, - bracketright: 0x005D, - bracketrightbt: 0xF8FB, - bracketrightex: 0xF8FA, - bracketrightmonospace: 0xFF3D, - bracketrighttp: 0xF8F9, - breve: 0x02D8, - brevebelowcmb: 0x032E, - brevecmb: 0x0306, - breveinvertedbelowcmb: 0x032F, - breveinvertedcmb: 0x0311, - breveinverteddoublecmb: 0x0361, - bridgebelowcmb: 0x032A, - bridgeinvertedbelowcmb: 0x033A, - brokenbar: 0x00A6, - bstroke: 0x0180, - bsuperior: 0xF6EA, - btopbar: 0x0183, - buhiragana: 0x3076, - bukatakana: 0x30D6, - bullet: 0x2022, - bulletinverse: 0x25D8, - bulletoperator: 0x2219, - bullseye: 0x25CE, - c: 0x0063, - caarmenian: 0x056E, - cabengali: 0x099A, - cacute: 0x0107, - cadeva: 0x091A, - cagujarati: 0x0A9A, - cagurmukhi: 0x0A1A, - calsquare: 0x3388, - candrabindubengali: 0x0981, - candrabinducmb: 0x0310, - candrabindudeva: 0x0901, - candrabindugujarati: 0x0A81, - capslock: 0x21EA, - careof: 0x2105, - caron: 0x02C7, - caronbelowcmb: 0x032C, - caroncmb: 0x030C, - carriagereturn: 0x21B5, - cbopomofo: 0x3118, - ccaron: 0x010D, - ccedilla: 0x00E7, - ccedillaacute: 0x1E09, - ccircle: 0x24D2, - ccircumflex: 0x0109, - ccurl: 0x0255, - cdot: 0x010B, - cdotaccent: 0x010B, - cdsquare: 0x33C5, - cedilla: 0x00B8, - cedillacmb: 0x0327, - cent: 0x00A2, - centigrade: 0x2103, - centinferior: 0xF6DF, - centmonospace: 0xFFE0, - centoldstyle: 0xF7A2, - centsuperior: 0xF6E0, - chaarmenian: 0x0579, - chabengali: 0x099B, - chadeva: 0x091B, - chagujarati: 0x0A9B, - chagurmukhi: 0x0A1B, - chbopomofo: 0x3114, - cheabkhasiancyrillic: 0x04BD, - checkmark: 0x2713, - checyrillic: 0x0447, - chedescenderabkhasiancyrillic: 0x04BF, - chedescendercyrillic: 0x04B7, - chedieresiscyrillic: 0x04F5, - cheharmenian: 0x0573, - chekhakassiancyrillic: 0x04CC, - cheverticalstrokecyrillic: 0x04B9, - chi: 0x03C7, - chieuchacirclekorean: 0x3277, - chieuchaparenkorean: 0x3217, - chieuchcirclekorean: 0x3269, - chieuchkorean: 0x314A, - chieuchparenkorean: 0x3209, - chochangthai: 0x0E0A, - chochanthai: 0x0E08, - chochingthai: 0x0E09, - chochoethai: 0x0E0C, - chook: 0x0188, - cieucacirclekorean: 0x3276, - cieucaparenkorean: 0x3216, - cieuccirclekorean: 0x3268, - cieuckorean: 0x3148, - cieucparenkorean: 0x3208, - cieucuparenkorean: 0x321C, - circle: 0x25CB, - circlecopyrt: 0x00A9, // This glyph is missing from Adobe's original list. - circlemultiply: 0x2297, - circleot: 0x2299, - circleplus: 0x2295, - circlepostalmark: 0x3036, - circlewithlefthalfblack: 0x25D0, - circlewithrighthalfblack: 0x25D1, - circumflex: 0x02C6, - circumflexbelowcmb: 0x032D, - circumflexcmb: 0x0302, - clear: 0x2327, - clickalveolar: 0x01C2, - clickdental: 0x01C0, - clicklateral: 0x01C1, - clickretroflex: 0x01C3, - club: 0x2663, - clubsuitblack: 0x2663, - clubsuitwhite: 0x2667, - cmcubedsquare: 0x33A4, - cmonospace: 0xFF43, - cmsquaredsquare: 0x33A0, - coarmenian: 0x0581, - colon: 0x003A, - colonmonetary: 0x20A1, - colonmonospace: 0xFF1A, - colonsign: 0x20A1, - colonsmall: 0xFE55, - colontriangularhalfmod: 0x02D1, - colontriangularmod: 0x02D0, - comma: 0x002C, - commaabovecmb: 0x0313, - commaaboverightcmb: 0x0315, - commaaccent: 0xF6C3, - commaarabic: 0x060C, - commaarmenian: 0x055D, - commainferior: 0xF6E1, - commamonospace: 0xFF0C, - commareversedabovecmb: 0x0314, - commareversedmod: 0x02BD, - commasmall: 0xFE50, - commasuperior: 0xF6E2, - commaturnedabovecmb: 0x0312, - commaturnedmod: 0x02BB, - compass: 0x263C, - congruent: 0x2245, - contourintegral: 0x222E, - control: 0x2303, - controlACK: 0x0006, - controlBEL: 0x0007, - controlBS: 0x0008, - controlCAN: 0x0018, - controlCR: 0x000D, - controlDC1: 0x0011, - controlDC2: 0x0012, - controlDC3: 0x0013, - controlDC4: 0x0014, - controlDEL: 0x007F, - controlDLE: 0x0010, - controlEM: 0x0019, - controlENQ: 0x0005, - controlEOT: 0x0004, - controlESC: 0x001B, - controlETB: 0x0017, - controlETX: 0x0003, - controlFF: 0x000C, - controlFS: 0x001C, - controlGS: 0x001D, - controlHT: 0x0009, - controlLF: 0x000A, - controlNAK: 0x0015, - controlRS: 0x001E, - controlSI: 0x000F, - controlSO: 0x000E, - controlSOT: 0x0002, - controlSTX: 0x0001, - controlSUB: 0x001A, - controlSYN: 0x0016, - controlUS: 0x001F, - controlVT: 0x000B, - copyright: 0x00A9, - copyrightsans: 0xF8E9, - copyrightserif: 0xF6D9, - cornerbracketleft: 0x300C, - cornerbracketlefthalfwidth: 0xFF62, - cornerbracketleftvertical: 0xFE41, - cornerbracketright: 0x300D, - cornerbracketrighthalfwidth: 0xFF63, - cornerbracketrightvertical: 0xFE42, - corporationsquare: 0x337F, - cosquare: 0x33C7, - coverkgsquare: 0x33C6, - cparen: 0x249E, - cruzeiro: 0x20A2, - cstretched: 0x0297, - curlyand: 0x22CF, - curlyor: 0x22CE, - currency: 0x00A4, - cyrBreve: 0xF6D1, - cyrFlex: 0xF6D2, - cyrbreve: 0xF6D4, - cyrflex: 0xF6D5, - d: 0x0064, - daarmenian: 0x0564, - dabengali: 0x09A6, - dadarabic: 0x0636, - dadeva: 0x0926, - dadfinalarabic: 0xFEBE, - dadinitialarabic: 0xFEBF, - dadmedialarabic: 0xFEC0, - dagesh: 0x05BC, - dageshhebrew: 0x05BC, - dagger: 0x2020, - daggerdbl: 0x2021, - dagujarati: 0x0AA6, - dagurmukhi: 0x0A26, - dahiragana: 0x3060, - dakatakana: 0x30C0, - dalarabic: 0x062F, - dalet: 0x05D3, - daletdagesh: 0xFB33, - daletdageshhebrew: 0xFB33, - dalethebrew: 0x05D3, - dalfinalarabic: 0xFEAA, - dammaarabic: 0x064F, - dammalowarabic: 0x064F, - dammatanaltonearabic: 0x064C, - dammatanarabic: 0x064C, - danda: 0x0964, - dargahebrew: 0x05A7, - dargalefthebrew: 0x05A7, - dasiapneumatacyrilliccmb: 0x0485, - dblGrave: 0xF6D3, - dblanglebracketleft: 0x300A, - dblanglebracketleftvertical: 0xFE3D, - dblanglebracketright: 0x300B, - dblanglebracketrightvertical: 0xFE3E, - dblarchinvertedbelowcmb: 0x032B, - dblarrowleft: 0x21D4, - dblarrowright: 0x21D2, - dbldanda: 0x0965, - dblgrave: 0xF6D6, - dblgravecmb: 0x030F, - dblintegral: 0x222C, - dbllowline: 0x2017, - dbllowlinecmb: 0x0333, - dbloverlinecmb: 0x033F, - dblprimemod: 0x02BA, - dblverticalbar: 0x2016, - dblverticallineabovecmb: 0x030E, - dbopomofo: 0x3109, - dbsquare: 0x33C8, - dcaron: 0x010F, - dcedilla: 0x1E11, - dcircle: 0x24D3, - dcircumflexbelow: 0x1E13, - dcroat: 0x0111, - ddabengali: 0x09A1, - ddadeva: 0x0921, - ddagujarati: 0x0AA1, - ddagurmukhi: 0x0A21, - ddalarabic: 0x0688, - ddalfinalarabic: 0xFB89, - dddhadeva: 0x095C, - ddhabengali: 0x09A2, - ddhadeva: 0x0922, - ddhagujarati: 0x0AA2, - ddhagurmukhi: 0x0A22, - ddotaccent: 0x1E0B, - ddotbelow: 0x1E0D, - decimalseparatorarabic: 0x066B, - decimalseparatorpersian: 0x066B, - decyrillic: 0x0434, - degree: 0x00B0, - dehihebrew: 0x05AD, - dehiragana: 0x3067, - deicoptic: 0x03EF, - dekatakana: 0x30C7, - deleteleft: 0x232B, - deleteright: 0x2326, - delta: 0x03B4, - deltaturned: 0x018D, - denominatorminusonenumeratorbengali: 0x09F8, - dezh: 0x02A4, - dhabengali: 0x09A7, - dhadeva: 0x0927, - dhagujarati: 0x0AA7, - dhagurmukhi: 0x0A27, - dhook: 0x0257, - dialytikatonos: 0x0385, - dialytikatonoscmb: 0x0344, - diamond: 0x2666, - diamondsuitwhite: 0x2662, - dieresis: 0x00A8, - dieresisacute: 0xF6D7, - dieresisbelowcmb: 0x0324, - dieresiscmb: 0x0308, - dieresisgrave: 0xF6D8, - dieresistonos: 0x0385, - dihiragana: 0x3062, - dikatakana: 0x30C2, - dittomark: 0x3003, - divide: 0x00F7, - divides: 0x2223, - divisionslash: 0x2215, - djecyrillic: 0x0452, - dkshade: 0x2593, - dlinebelow: 0x1E0F, - dlsquare: 0x3397, - dmacron: 0x0111, - dmonospace: 0xFF44, - dnblock: 0x2584, - dochadathai: 0x0E0E, - dodekthai: 0x0E14, - dohiragana: 0x3069, - dokatakana: 0x30C9, - dollar: 0x0024, - dollarinferior: 0xF6E3, - dollarmonospace: 0xFF04, - dollaroldstyle: 0xF724, - dollarsmall: 0xFE69, - dollarsuperior: 0xF6E4, - dong: 0x20AB, - dorusquare: 0x3326, - dotaccent: 0x02D9, - dotaccentcmb: 0x0307, - dotbelowcmb: 0x0323, - dotbelowcomb: 0x0323, - dotkatakana: 0x30FB, - dotlessi: 0x0131, - dotlessj: 0xF6BE, - dotlessjstrokehook: 0x0284, - dotmath: 0x22C5, - dottedcircle: 0x25CC, - doubleyodpatah: 0xFB1F, - doubleyodpatahhebrew: 0xFB1F, - downtackbelowcmb: 0x031E, - downtackmod: 0x02D5, - dparen: 0x249F, - dsuperior: 0xF6EB, - dtail: 0x0256, - dtopbar: 0x018C, - duhiragana: 0x3065, - dukatakana: 0x30C5, - dz: 0x01F3, - dzaltone: 0x02A3, - dzcaron: 0x01C6, - dzcurl: 0x02A5, - dzeabkhasiancyrillic: 0x04E1, - dzecyrillic: 0x0455, - dzhecyrillic: 0x045F, - e: 0x0065, - eacute: 0x00E9, - earth: 0x2641, - ebengali: 0x098F, - ebopomofo: 0x311C, - ebreve: 0x0115, - ecandradeva: 0x090D, - ecandragujarati: 0x0A8D, - ecandravowelsigndeva: 0x0945, - ecandravowelsigngujarati: 0x0AC5, - ecaron: 0x011B, - ecedillabreve: 0x1E1D, - echarmenian: 0x0565, - echyiwnarmenian: 0x0587, - ecircle: 0x24D4, - ecircumflex: 0x00EA, - ecircumflexacute: 0x1EBF, - ecircumflexbelow: 0x1E19, - ecircumflexdotbelow: 0x1EC7, - ecircumflexgrave: 0x1EC1, - ecircumflexhookabove: 0x1EC3, - ecircumflextilde: 0x1EC5, - ecyrillic: 0x0454, - edblgrave: 0x0205, - edeva: 0x090F, - edieresis: 0x00EB, - edot: 0x0117, - edotaccent: 0x0117, - edotbelow: 0x1EB9, - eegurmukhi: 0x0A0F, - eematragurmukhi: 0x0A47, - efcyrillic: 0x0444, - egrave: 0x00E8, - egujarati: 0x0A8F, - eharmenian: 0x0567, - ehbopomofo: 0x311D, - ehiragana: 0x3048, - ehookabove: 0x1EBB, - eibopomofo: 0x311F, - eight: 0x0038, - eightarabic: 0x0668, - eightbengali: 0x09EE, - eightcircle: 0x2467, - eightcircleinversesansserif: 0x2791, - eightdeva: 0x096E, - eighteencircle: 0x2471, - eighteenparen: 0x2485, - eighteenperiod: 0x2499, - eightgujarati: 0x0AEE, - eightgurmukhi: 0x0A6E, - eighthackarabic: 0x0668, - eighthangzhou: 0x3028, - eighthnotebeamed: 0x266B, - eightideographicparen: 0x3227, - eightinferior: 0x2088, - eightmonospace: 0xFF18, - eightoldstyle: 0xF738, - eightparen: 0x247B, - eightperiod: 0x248F, - eightpersian: 0x06F8, - eightroman: 0x2177, - eightsuperior: 0x2078, - eightthai: 0x0E58, - einvertedbreve: 0x0207, - eiotifiedcyrillic: 0x0465, - ekatakana: 0x30A8, - ekatakanahalfwidth: 0xFF74, - ekonkargurmukhi: 0x0A74, - ekorean: 0x3154, - elcyrillic: 0x043B, - element: 0x2208, - elevencircle: 0x246A, - elevenparen: 0x247E, - elevenperiod: 0x2492, - elevenroman: 0x217A, - ellipsis: 0x2026, - ellipsisvertical: 0x22EE, - emacron: 0x0113, - emacronacute: 0x1E17, - emacrongrave: 0x1E15, - emcyrillic: 0x043C, - emdash: 0x2014, - emdashvertical: 0xFE31, - emonospace: 0xFF45, - emphasismarkarmenian: 0x055B, - emptyset: 0x2205, - enbopomofo: 0x3123, - encyrillic: 0x043D, - endash: 0x2013, - endashvertical: 0xFE32, - endescendercyrillic: 0x04A3, - eng: 0x014B, - engbopomofo: 0x3125, - enghecyrillic: 0x04A5, - enhookcyrillic: 0x04C8, - enspace: 0x2002, - eogonek: 0x0119, - eokorean: 0x3153, - eopen: 0x025B, - eopenclosed: 0x029A, - eopenreversed: 0x025C, - eopenreversedclosed: 0x025E, - eopenreversedhook: 0x025D, - eparen: 0x24A0, - epsilon: 0x03B5, - epsilontonos: 0x03AD, - equal: 0x003D, - equalmonospace: 0xFF1D, - equalsmall: 0xFE66, - equalsuperior: 0x207C, - equivalence: 0x2261, - erbopomofo: 0x3126, - ercyrillic: 0x0440, - ereversed: 0x0258, - ereversedcyrillic: 0x044D, - escyrillic: 0x0441, - esdescendercyrillic: 0x04AB, - esh: 0x0283, - eshcurl: 0x0286, - eshortdeva: 0x090E, - eshortvowelsigndeva: 0x0946, - eshreversedloop: 0x01AA, - eshsquatreversed: 0x0285, - esmallhiragana: 0x3047, - esmallkatakana: 0x30A7, - esmallkatakanahalfwidth: 0xFF6A, - estimated: 0x212E, - esuperior: 0xF6EC, - eta: 0x03B7, - etarmenian: 0x0568, - etatonos: 0x03AE, - eth: 0x00F0, - etilde: 0x1EBD, - etildebelow: 0x1E1B, - etnahtafoukhhebrew: 0x0591, - etnahtafoukhlefthebrew: 0x0591, - etnahtahebrew: 0x0591, - etnahtalefthebrew: 0x0591, - eturned: 0x01DD, - eukorean: 0x3161, - euro: 0x20AC, - evowelsignbengali: 0x09C7, - evowelsigndeva: 0x0947, - evowelsigngujarati: 0x0AC7, - exclam: 0x0021, - exclamarmenian: 0x055C, - exclamdbl: 0x203C, - exclamdown: 0x00A1, - exclamdownsmall: 0xF7A1, - exclammonospace: 0xFF01, - exclamsmall: 0xF721, - existential: 0x2203, - ezh: 0x0292, - ezhcaron: 0x01EF, - ezhcurl: 0x0293, - ezhreversed: 0x01B9, - ezhtail: 0x01BA, - f: 0x0066, - fadeva: 0x095E, - fagurmukhi: 0x0A5E, - fahrenheit: 0x2109, - fathaarabic: 0x064E, - fathalowarabic: 0x064E, - fathatanarabic: 0x064B, - fbopomofo: 0x3108, - fcircle: 0x24D5, - fdotaccent: 0x1E1F, - feharabic: 0x0641, - feharmenian: 0x0586, - fehfinalarabic: 0xFED2, - fehinitialarabic: 0xFED3, - fehmedialarabic: 0xFED4, - feicoptic: 0x03E5, - female: 0x2640, - ff: 0xFB00, - ffi: 0xFB03, - ffl: 0xFB04, - fi: 0xFB01, - fifteencircle: 0x246E, - fifteenparen: 0x2482, - fifteenperiod: 0x2496, - figuredash: 0x2012, - filledbox: 0x25A0, - filledrect: 0x25AC, - finalkaf: 0x05DA, - finalkafdagesh: 0xFB3A, - finalkafdageshhebrew: 0xFB3A, - finalkafhebrew: 0x05DA, - finalmem: 0x05DD, - finalmemhebrew: 0x05DD, - finalnun: 0x05DF, - finalnunhebrew: 0x05DF, - finalpe: 0x05E3, - finalpehebrew: 0x05E3, - finaltsadi: 0x05E5, - finaltsadihebrew: 0x05E5, - firsttonechinese: 0x02C9, - fisheye: 0x25C9, - fitacyrillic: 0x0473, - five: 0x0035, - fivearabic: 0x0665, - fivebengali: 0x09EB, - fivecircle: 0x2464, - fivecircleinversesansserif: 0x278E, - fivedeva: 0x096B, - fiveeighths: 0x215D, - fivegujarati: 0x0AEB, - fivegurmukhi: 0x0A6B, - fivehackarabic: 0x0665, - fivehangzhou: 0x3025, - fiveideographicparen: 0x3224, - fiveinferior: 0x2085, - fivemonospace: 0xFF15, - fiveoldstyle: 0xF735, - fiveparen: 0x2478, - fiveperiod: 0x248C, - fivepersian: 0x06F5, - fiveroman: 0x2174, - fivesuperior: 0x2075, - fivethai: 0x0E55, - fl: 0xFB02, - florin: 0x0192, - fmonospace: 0xFF46, - fmsquare: 0x3399, - fofanthai: 0x0E1F, - fofathai: 0x0E1D, - fongmanthai: 0x0E4F, - forall: 0x2200, - four: 0x0034, - fourarabic: 0x0664, - fourbengali: 0x09EA, - fourcircle: 0x2463, - fourcircleinversesansserif: 0x278D, - fourdeva: 0x096A, - fourgujarati: 0x0AEA, - fourgurmukhi: 0x0A6A, - fourhackarabic: 0x0664, - fourhangzhou: 0x3024, - fourideographicparen: 0x3223, - fourinferior: 0x2084, - fourmonospace: 0xFF14, - fournumeratorbengali: 0x09F7, - fouroldstyle: 0xF734, - fourparen: 0x2477, - fourperiod: 0x248B, - fourpersian: 0x06F4, - fourroman: 0x2173, - foursuperior: 0x2074, - fourteencircle: 0x246D, - fourteenparen: 0x2481, - fourteenperiod: 0x2495, - fourthai: 0x0E54, - fourthtonechinese: 0x02CB, - fparen: 0x24A1, - fraction: 0x2044, - franc: 0x20A3, - g: 0x0067, - gabengali: 0x0997, - gacute: 0x01F5, - gadeva: 0x0917, - gafarabic: 0x06AF, - gaffinalarabic: 0xFB93, - gafinitialarabic: 0xFB94, - gafmedialarabic: 0xFB95, - gagujarati: 0x0A97, - gagurmukhi: 0x0A17, - gahiragana: 0x304C, - gakatakana: 0x30AC, - gamma: 0x03B3, - gammalatinsmall: 0x0263, - gammasuperior: 0x02E0, - gangiacoptic: 0x03EB, - gbopomofo: 0x310D, - gbreve: 0x011F, - gcaron: 0x01E7, - gcedilla: 0x0123, - gcircle: 0x24D6, - gcircumflex: 0x011D, - gcommaaccent: 0x0123, - gdot: 0x0121, - gdotaccent: 0x0121, - gecyrillic: 0x0433, - gehiragana: 0x3052, - gekatakana: 0x30B2, - geometricallyequal: 0x2251, - gereshaccenthebrew: 0x059C, - gereshhebrew: 0x05F3, - gereshmuqdamhebrew: 0x059D, - germandbls: 0x00DF, - gershayimaccenthebrew: 0x059E, - gershayimhebrew: 0x05F4, - getamark: 0x3013, - ghabengali: 0x0998, - ghadarmenian: 0x0572, - ghadeva: 0x0918, - ghagujarati: 0x0A98, - ghagurmukhi: 0x0A18, - ghainarabic: 0x063A, - ghainfinalarabic: 0xFECE, - ghaininitialarabic: 0xFECF, - ghainmedialarabic: 0xFED0, - ghemiddlehookcyrillic: 0x0495, - ghestrokecyrillic: 0x0493, - gheupturncyrillic: 0x0491, - ghhadeva: 0x095A, - ghhagurmukhi: 0x0A5A, - ghook: 0x0260, - ghzsquare: 0x3393, - gihiragana: 0x304E, - gikatakana: 0x30AE, - gimarmenian: 0x0563, - gimel: 0x05D2, - gimeldagesh: 0xFB32, - gimeldageshhebrew: 0xFB32, - gimelhebrew: 0x05D2, - gjecyrillic: 0x0453, - glottalinvertedstroke: 0x01BE, - glottalstop: 0x0294, - glottalstopinverted: 0x0296, - glottalstopmod: 0x02C0, - glottalstopreversed: 0x0295, - glottalstopreversedmod: 0x02C1, - glottalstopreversedsuperior: 0x02E4, - glottalstopstroke: 0x02A1, - glottalstopstrokereversed: 0x02A2, - gmacron: 0x1E21, - gmonospace: 0xFF47, - gohiragana: 0x3054, - gokatakana: 0x30B4, - gparen: 0x24A2, - gpasquare: 0x33AC, - gradient: 0x2207, - grave: 0x0060, - gravebelowcmb: 0x0316, - gravecmb: 0x0300, - gravecomb: 0x0300, - gravedeva: 0x0953, - gravelowmod: 0x02CE, - gravemonospace: 0xFF40, - gravetonecmb: 0x0340, - greater: 0x003E, - greaterequal: 0x2265, - greaterequalorless: 0x22DB, - greatermonospace: 0xFF1E, - greaterorequivalent: 0x2273, - greaterorless: 0x2277, - greateroverequal: 0x2267, - greatersmall: 0xFE65, - gscript: 0x0261, - gstroke: 0x01E5, - guhiragana: 0x3050, - guillemotleft: 0x00AB, - guillemotright: 0x00BB, - guilsinglleft: 0x2039, - guilsinglright: 0x203A, - gukatakana: 0x30B0, - guramusquare: 0x3318, - gysquare: 0x33C9, - h: 0x0068, - haabkhasiancyrillic: 0x04A9, - haaltonearabic: 0x06C1, - habengali: 0x09B9, - hadescendercyrillic: 0x04B3, - hadeva: 0x0939, - hagujarati: 0x0AB9, - hagurmukhi: 0x0A39, - haharabic: 0x062D, - hahfinalarabic: 0xFEA2, - hahinitialarabic: 0xFEA3, - hahiragana: 0x306F, - hahmedialarabic: 0xFEA4, - haitusquare: 0x332A, - hakatakana: 0x30CF, - hakatakanahalfwidth: 0xFF8A, - halantgurmukhi: 0x0A4D, - hamzaarabic: 0x0621, - hamzalowarabic: 0x0621, - hangulfiller: 0x3164, - hardsigncyrillic: 0x044A, - harpoonleftbarbup: 0x21BC, - harpoonrightbarbup: 0x21C0, - hasquare: 0x33CA, - hatafpatah: 0x05B2, - hatafpatah16: 0x05B2, - hatafpatah23: 0x05B2, - hatafpatah2f: 0x05B2, - hatafpatahhebrew: 0x05B2, - hatafpatahnarrowhebrew: 0x05B2, - hatafpatahquarterhebrew: 0x05B2, - hatafpatahwidehebrew: 0x05B2, - hatafqamats: 0x05B3, - hatafqamats1b: 0x05B3, - hatafqamats28: 0x05B3, - hatafqamats34: 0x05B3, - hatafqamatshebrew: 0x05B3, - hatafqamatsnarrowhebrew: 0x05B3, - hatafqamatsquarterhebrew: 0x05B3, - hatafqamatswidehebrew: 0x05B3, - hatafsegol: 0x05B1, - hatafsegol17: 0x05B1, - hatafsegol24: 0x05B1, - hatafsegol30: 0x05B1, - hatafsegolhebrew: 0x05B1, - hatafsegolnarrowhebrew: 0x05B1, - hatafsegolquarterhebrew: 0x05B1, - hatafsegolwidehebrew: 0x05B1, - hbar: 0x0127, - hbopomofo: 0x310F, - hbrevebelow: 0x1E2B, - hcedilla: 0x1E29, - hcircle: 0x24D7, - hcircumflex: 0x0125, - hdieresis: 0x1E27, - hdotaccent: 0x1E23, - hdotbelow: 0x1E25, - he: 0x05D4, - heart: 0x2665, - heartsuitblack: 0x2665, - heartsuitwhite: 0x2661, - hedagesh: 0xFB34, - hedageshhebrew: 0xFB34, - hehaltonearabic: 0x06C1, - heharabic: 0x0647, - hehebrew: 0x05D4, - hehfinalaltonearabic: 0xFBA7, - hehfinalalttwoarabic: 0xFEEA, - hehfinalarabic: 0xFEEA, - hehhamzaabovefinalarabic: 0xFBA5, - hehhamzaaboveisolatedarabic: 0xFBA4, - hehinitialaltonearabic: 0xFBA8, - hehinitialarabic: 0xFEEB, - hehiragana: 0x3078, - hehmedialaltonearabic: 0xFBA9, - hehmedialarabic: 0xFEEC, - heiseierasquare: 0x337B, - hekatakana: 0x30D8, - hekatakanahalfwidth: 0xFF8D, - hekutaarusquare: 0x3336, - henghook: 0x0267, - herutusquare: 0x3339, - het: 0x05D7, - hethebrew: 0x05D7, - hhook: 0x0266, - hhooksuperior: 0x02B1, - hieuhacirclekorean: 0x327B, - hieuhaparenkorean: 0x321B, - hieuhcirclekorean: 0x326D, - hieuhkorean: 0x314E, - hieuhparenkorean: 0x320D, - hihiragana: 0x3072, - hikatakana: 0x30D2, - hikatakanahalfwidth: 0xFF8B, - hiriq: 0x05B4, - hiriq14: 0x05B4, - hiriq21: 0x05B4, - hiriq2d: 0x05B4, - hiriqhebrew: 0x05B4, - hiriqnarrowhebrew: 0x05B4, - hiriqquarterhebrew: 0x05B4, - hiriqwidehebrew: 0x05B4, - hlinebelow: 0x1E96, - hmonospace: 0xFF48, - hoarmenian: 0x0570, - hohipthai: 0x0E2B, - hohiragana: 0x307B, - hokatakana: 0x30DB, - hokatakanahalfwidth: 0xFF8E, - holam: 0x05B9, - holam19: 0x05B9, - holam26: 0x05B9, - holam32: 0x05B9, - holamhebrew: 0x05B9, - holamnarrowhebrew: 0x05B9, - holamquarterhebrew: 0x05B9, - holamwidehebrew: 0x05B9, - honokhukthai: 0x0E2E, - hookabovecomb: 0x0309, - hookcmb: 0x0309, - hookpalatalizedbelowcmb: 0x0321, - hookretroflexbelowcmb: 0x0322, - hoonsquare: 0x3342, - horicoptic: 0x03E9, - horizontalbar: 0x2015, - horncmb: 0x031B, - hotsprings: 0x2668, - house: 0x2302, - hparen: 0x24A3, - hsuperior: 0x02B0, - hturned: 0x0265, - huhiragana: 0x3075, - huiitosquare: 0x3333, - hukatakana: 0x30D5, - hukatakanahalfwidth: 0xFF8C, - hungarumlaut: 0x02DD, - hungarumlautcmb: 0x030B, - hv: 0x0195, - hyphen: 0x002D, - hypheninferior: 0xF6E5, - hyphenmonospace: 0xFF0D, - hyphensmall: 0xFE63, - hyphensuperior: 0xF6E6, - hyphentwo: 0x2010, - i: 0x0069, - iacute: 0x00ED, - iacyrillic: 0x044F, - ibengali: 0x0987, - ibopomofo: 0x3127, - ibreve: 0x012D, - icaron: 0x01D0, - icircle: 0x24D8, - icircumflex: 0x00EE, - icyrillic: 0x0456, - idblgrave: 0x0209, - ideographearthcircle: 0x328F, - ideographfirecircle: 0x328B, - ideographicallianceparen: 0x323F, - ideographiccallparen: 0x323A, - ideographiccentrecircle: 0x32A5, - ideographicclose: 0x3006, - ideographiccomma: 0x3001, - ideographiccommaleft: 0xFF64, - ideographiccongratulationparen: 0x3237, - ideographiccorrectcircle: 0x32A3, - ideographicearthparen: 0x322F, - ideographicenterpriseparen: 0x323D, - ideographicexcellentcircle: 0x329D, - ideographicfestivalparen: 0x3240, - ideographicfinancialcircle: 0x3296, - ideographicfinancialparen: 0x3236, - ideographicfireparen: 0x322B, - ideographichaveparen: 0x3232, - ideographichighcircle: 0x32A4, - ideographiciterationmark: 0x3005, - ideographiclaborcircle: 0x3298, - ideographiclaborparen: 0x3238, - ideographicleftcircle: 0x32A7, - ideographiclowcircle: 0x32A6, - ideographicmedicinecircle: 0x32A9, - ideographicmetalparen: 0x322E, - ideographicmoonparen: 0x322A, - ideographicnameparen: 0x3234, - ideographicperiod: 0x3002, - ideographicprintcircle: 0x329E, - ideographicreachparen: 0x3243, - ideographicrepresentparen: 0x3239, - ideographicresourceparen: 0x323E, - ideographicrightcircle: 0x32A8, - ideographicsecretcircle: 0x3299, - ideographicselfparen: 0x3242, - ideographicsocietyparen: 0x3233, - ideographicspace: 0x3000, - ideographicspecialparen: 0x3235, - ideographicstockparen: 0x3231, - ideographicstudyparen: 0x323B, - ideographicsunparen: 0x3230, - ideographicsuperviseparen: 0x323C, - ideographicwaterparen: 0x322C, - ideographicwoodparen: 0x322D, - ideographiczero: 0x3007, - ideographmetalcircle: 0x328E, - ideographmooncircle: 0x328A, - ideographnamecircle: 0x3294, - ideographsuncircle: 0x3290, - ideographwatercircle: 0x328C, - ideographwoodcircle: 0x328D, - ideva: 0x0907, - idieresis: 0x00EF, - idieresisacute: 0x1E2F, - idieresiscyrillic: 0x04E5, - idotbelow: 0x1ECB, - iebrevecyrillic: 0x04D7, - iecyrillic: 0x0435, - ieungacirclekorean: 0x3275, - ieungaparenkorean: 0x3215, - ieungcirclekorean: 0x3267, - ieungkorean: 0x3147, - ieungparenkorean: 0x3207, - igrave: 0x00EC, - igujarati: 0x0A87, - igurmukhi: 0x0A07, - ihiragana: 0x3044, - ihookabove: 0x1EC9, - iibengali: 0x0988, - iicyrillic: 0x0438, - iideva: 0x0908, - iigujarati: 0x0A88, - iigurmukhi: 0x0A08, - iimatragurmukhi: 0x0A40, - iinvertedbreve: 0x020B, - iishortcyrillic: 0x0439, - iivowelsignbengali: 0x09C0, - iivowelsigndeva: 0x0940, - iivowelsigngujarati: 0x0AC0, - ij: 0x0133, - ikatakana: 0x30A4, - ikatakanahalfwidth: 0xFF72, - ikorean: 0x3163, - ilde: 0x02DC, - iluyhebrew: 0x05AC, - imacron: 0x012B, - imacroncyrillic: 0x04E3, - imageorapproximatelyequal: 0x2253, - imatragurmukhi: 0x0A3F, - imonospace: 0xFF49, - increment: 0x2206, - infinity: 0x221E, - iniarmenian: 0x056B, - integral: 0x222B, - integralbottom: 0x2321, - integralbt: 0x2321, - integralex: 0xF8F5, - integraltop: 0x2320, - integraltp: 0x2320, - intersection: 0x2229, - intisquare: 0x3305, - invbullet: 0x25D8, - invcircle: 0x25D9, - invsmileface: 0x263B, - iocyrillic: 0x0451, - iogonek: 0x012F, - iota: 0x03B9, - iotadieresis: 0x03CA, - iotadieresistonos: 0x0390, - iotalatin: 0x0269, - iotatonos: 0x03AF, - iparen: 0x24A4, - irigurmukhi: 0x0A72, - ismallhiragana: 0x3043, - ismallkatakana: 0x30A3, - ismallkatakanahalfwidth: 0xFF68, - issharbengali: 0x09FA, - istroke: 0x0268, - isuperior: 0xF6ED, - iterationhiragana: 0x309D, - iterationkatakana: 0x30FD, - itilde: 0x0129, - itildebelow: 0x1E2D, - iubopomofo: 0x3129, - iucyrillic: 0x044E, - ivowelsignbengali: 0x09BF, - ivowelsigndeva: 0x093F, - ivowelsigngujarati: 0x0ABF, - izhitsacyrillic: 0x0475, - izhitsadblgravecyrillic: 0x0477, - j: 0x006A, - jaarmenian: 0x0571, - jabengali: 0x099C, - jadeva: 0x091C, - jagujarati: 0x0A9C, - jagurmukhi: 0x0A1C, - jbopomofo: 0x3110, - jcaron: 0x01F0, - jcircle: 0x24D9, - jcircumflex: 0x0135, - jcrossedtail: 0x029D, - jdotlessstroke: 0x025F, - jecyrillic: 0x0458, - jeemarabic: 0x062C, - jeemfinalarabic: 0xFE9E, - jeeminitialarabic: 0xFE9F, - jeemmedialarabic: 0xFEA0, - jeharabic: 0x0698, - jehfinalarabic: 0xFB8B, - jhabengali: 0x099D, - jhadeva: 0x091D, - jhagujarati: 0x0A9D, - jhagurmukhi: 0x0A1D, - jheharmenian: 0x057B, - jis: 0x3004, - jmonospace: 0xFF4A, - jparen: 0x24A5, - jsuperior: 0x02B2, - k: 0x006B, - kabashkircyrillic: 0x04A1, - kabengali: 0x0995, - kacute: 0x1E31, - kacyrillic: 0x043A, - kadescendercyrillic: 0x049B, - kadeva: 0x0915, - kaf: 0x05DB, - kafarabic: 0x0643, - kafdagesh: 0xFB3B, - kafdageshhebrew: 0xFB3B, - kaffinalarabic: 0xFEDA, - kafhebrew: 0x05DB, - kafinitialarabic: 0xFEDB, - kafmedialarabic: 0xFEDC, - kafrafehebrew: 0xFB4D, - kagujarati: 0x0A95, - kagurmukhi: 0x0A15, - kahiragana: 0x304B, - kahookcyrillic: 0x04C4, - kakatakana: 0x30AB, - kakatakanahalfwidth: 0xFF76, - kappa: 0x03BA, - kappasymbolgreek: 0x03F0, - kapyeounmieumkorean: 0x3171, - kapyeounphieuphkorean: 0x3184, - kapyeounpieupkorean: 0x3178, - kapyeounssangpieupkorean: 0x3179, - karoriisquare: 0x330D, - kashidaautoarabic: 0x0640, - kashidaautonosidebearingarabic: 0x0640, - kasmallkatakana: 0x30F5, - kasquare: 0x3384, - kasraarabic: 0x0650, - kasratanarabic: 0x064D, - kastrokecyrillic: 0x049F, - katahiraprolongmarkhalfwidth: 0xFF70, - kaverticalstrokecyrillic: 0x049D, - kbopomofo: 0x310E, - kcalsquare: 0x3389, - kcaron: 0x01E9, - kcedilla: 0x0137, - kcircle: 0x24DA, - kcommaaccent: 0x0137, - kdotbelow: 0x1E33, - keharmenian: 0x0584, - kehiragana: 0x3051, - kekatakana: 0x30B1, - kekatakanahalfwidth: 0xFF79, - kenarmenian: 0x056F, - kesmallkatakana: 0x30F6, - kgreenlandic: 0x0138, - khabengali: 0x0996, - khacyrillic: 0x0445, - khadeva: 0x0916, - khagujarati: 0x0A96, - khagurmukhi: 0x0A16, - khaharabic: 0x062E, - khahfinalarabic: 0xFEA6, - khahinitialarabic: 0xFEA7, - khahmedialarabic: 0xFEA8, - kheicoptic: 0x03E7, - khhadeva: 0x0959, - khhagurmukhi: 0x0A59, - khieukhacirclekorean: 0x3278, - khieukhaparenkorean: 0x3218, - khieukhcirclekorean: 0x326A, - khieukhkorean: 0x314B, - khieukhparenkorean: 0x320A, - khokhaithai: 0x0E02, - khokhonthai: 0x0E05, - khokhuatthai: 0x0E03, - khokhwaithai: 0x0E04, - khomutthai: 0x0E5B, - khook: 0x0199, - khorakhangthai: 0x0E06, - khzsquare: 0x3391, - kihiragana: 0x304D, - kikatakana: 0x30AD, - kikatakanahalfwidth: 0xFF77, - kiroguramusquare: 0x3315, - kiromeetorusquare: 0x3316, - kirosquare: 0x3314, - kiyeokacirclekorean: 0x326E, - kiyeokaparenkorean: 0x320E, - kiyeokcirclekorean: 0x3260, - kiyeokkorean: 0x3131, - kiyeokparenkorean: 0x3200, - kiyeoksioskorean: 0x3133, - kjecyrillic: 0x045C, - klinebelow: 0x1E35, - klsquare: 0x3398, - kmcubedsquare: 0x33A6, - kmonospace: 0xFF4B, - kmsquaredsquare: 0x33A2, - kohiragana: 0x3053, - kohmsquare: 0x33C0, - kokaithai: 0x0E01, - kokatakana: 0x30B3, - kokatakanahalfwidth: 0xFF7A, - kooposquare: 0x331E, - koppacyrillic: 0x0481, - koreanstandardsymbol: 0x327F, - koroniscmb: 0x0343, - kparen: 0x24A6, - kpasquare: 0x33AA, - ksicyrillic: 0x046F, - ktsquare: 0x33CF, - kturned: 0x029E, - kuhiragana: 0x304F, - kukatakana: 0x30AF, - kukatakanahalfwidth: 0xFF78, - kvsquare: 0x33B8, - kwsquare: 0x33BE, - l: 0x006C, - labengali: 0x09B2, - lacute: 0x013A, - ladeva: 0x0932, - lagujarati: 0x0AB2, - lagurmukhi: 0x0A32, - lakkhangyaothai: 0x0E45, - lamaleffinalarabic: 0xFEFC, - lamalefhamzaabovefinalarabic: 0xFEF8, - lamalefhamzaaboveisolatedarabic: 0xFEF7, - lamalefhamzabelowfinalarabic: 0xFEFA, - lamalefhamzabelowisolatedarabic: 0xFEF9, - lamalefisolatedarabic: 0xFEFB, - lamalefmaddaabovefinalarabic: 0xFEF6, - lamalefmaddaaboveisolatedarabic: 0xFEF5, - lamarabic: 0x0644, - lambda: 0x03BB, - lambdastroke: 0x019B, - lamed: 0x05DC, - lameddagesh: 0xFB3C, - lameddageshhebrew: 0xFB3C, - lamedhebrew: 0x05DC, - lamfinalarabic: 0xFEDE, - lamhahinitialarabic: 0xFCCA, - laminitialarabic: 0xFEDF, - lamjeeminitialarabic: 0xFCC9, - lamkhahinitialarabic: 0xFCCB, - lamlamhehisolatedarabic: 0xFDF2, - lammedialarabic: 0xFEE0, - lammeemhahinitialarabic: 0xFD88, - lammeeminitialarabic: 0xFCCC, - largecircle: 0x25EF, - lbar: 0x019A, - lbelt: 0x026C, - lbopomofo: 0x310C, - lcaron: 0x013E, - lcedilla: 0x013C, - lcircle: 0x24DB, - lcircumflexbelow: 0x1E3D, - lcommaaccent: 0x013C, - ldot: 0x0140, - ldotaccent: 0x0140, - ldotbelow: 0x1E37, - ldotbelowmacron: 0x1E39, - leftangleabovecmb: 0x031A, - lefttackbelowcmb: 0x0318, - less: 0x003C, - lessequal: 0x2264, - lessequalorgreater: 0x22DA, - lessmonospace: 0xFF1C, - lessorequivalent: 0x2272, - lessorgreater: 0x2276, - lessoverequal: 0x2266, - lesssmall: 0xFE64, - lezh: 0x026E, - lfblock: 0x258C, - lhookretroflex: 0x026D, - lira: 0x20A4, - liwnarmenian: 0x056C, - lj: 0x01C9, - ljecyrillic: 0x0459, - ll: 0xF6C0, - lladeva: 0x0933, - llagujarati: 0x0AB3, - llinebelow: 0x1E3B, - llladeva: 0x0934, - llvocalicbengali: 0x09E1, - llvocalicdeva: 0x0961, - llvocalicvowelsignbengali: 0x09E3, - llvocalicvowelsigndeva: 0x0963, - lmiddletilde: 0x026B, - lmonospace: 0xFF4C, - lmsquare: 0x33D0, - lochulathai: 0x0E2C, - logicaland: 0x2227, - logicalnot: 0x00AC, - logicalnotreversed: 0x2310, - logicalor: 0x2228, - lolingthai: 0x0E25, - longs: 0x017F, - lowlinecenterline: 0xFE4E, - lowlinecmb: 0x0332, - lowlinedashed: 0xFE4D, - lozenge: 0x25CA, - lparen: 0x24A7, - lslash: 0x0142, - lsquare: 0x2113, - lsuperior: 0xF6EE, - ltshade: 0x2591, - luthai: 0x0E26, - lvocalicbengali: 0x098C, - lvocalicdeva: 0x090C, - lvocalicvowelsignbengali: 0x09E2, - lvocalicvowelsigndeva: 0x0962, - lxsquare: 0x33D3, - m: 0x006D, - mabengali: 0x09AE, - macron: 0x00AF, - macronbelowcmb: 0x0331, - macroncmb: 0x0304, - macronlowmod: 0x02CD, - macronmonospace: 0xFFE3, - macute: 0x1E3F, - madeva: 0x092E, - magujarati: 0x0AAE, - magurmukhi: 0x0A2E, - mahapakhhebrew: 0x05A4, - mahapakhlefthebrew: 0x05A4, - mahiragana: 0x307E, - maichattawalowleftthai: 0xF895, - maichattawalowrightthai: 0xF894, - maichattawathai: 0x0E4B, - maichattawaupperleftthai: 0xF893, - maieklowleftthai: 0xF88C, - maieklowrightthai: 0xF88B, - maiekthai: 0x0E48, - maiekupperleftthai: 0xF88A, - maihanakatleftthai: 0xF884, - maihanakatthai: 0x0E31, - maitaikhuleftthai: 0xF889, - maitaikhuthai: 0x0E47, - maitholowleftthai: 0xF88F, - maitholowrightthai: 0xF88E, - maithothai: 0x0E49, - maithoupperleftthai: 0xF88D, - maitrilowleftthai: 0xF892, - maitrilowrightthai: 0xF891, - maitrithai: 0x0E4A, - maitriupperleftthai: 0xF890, - maiyamokthai: 0x0E46, - makatakana: 0x30DE, - makatakanahalfwidth: 0xFF8F, - male: 0x2642, - mansyonsquare: 0x3347, - maqafhebrew: 0x05BE, - mars: 0x2642, - masoracirclehebrew: 0x05AF, - masquare: 0x3383, - mbopomofo: 0x3107, - mbsquare: 0x33D4, - mcircle: 0x24DC, - mcubedsquare: 0x33A5, - mdotaccent: 0x1E41, - mdotbelow: 0x1E43, - meemarabic: 0x0645, - meemfinalarabic: 0xFEE2, - meeminitialarabic: 0xFEE3, - meemmedialarabic: 0xFEE4, - meemmeeminitialarabic: 0xFCD1, - meemmeemisolatedarabic: 0xFC48, - meetorusquare: 0x334D, - mehiragana: 0x3081, - meizierasquare: 0x337E, - mekatakana: 0x30E1, - mekatakanahalfwidth: 0xFF92, - mem: 0x05DE, - memdagesh: 0xFB3E, - memdageshhebrew: 0xFB3E, - memhebrew: 0x05DE, - menarmenian: 0x0574, - merkhahebrew: 0x05A5, - merkhakefulahebrew: 0x05A6, - merkhakefulalefthebrew: 0x05A6, - merkhalefthebrew: 0x05A5, - mhook: 0x0271, - mhzsquare: 0x3392, - middledotkatakanahalfwidth: 0xFF65, - middot: 0x00B7, - mieumacirclekorean: 0x3272, - mieumaparenkorean: 0x3212, - mieumcirclekorean: 0x3264, - mieumkorean: 0x3141, - mieumpansioskorean: 0x3170, - mieumparenkorean: 0x3204, - mieumpieupkorean: 0x316E, - mieumsioskorean: 0x316F, - mihiragana: 0x307F, - mikatakana: 0x30DF, - mikatakanahalfwidth: 0xFF90, - minus: 0x2212, - minusbelowcmb: 0x0320, - minuscircle: 0x2296, - minusmod: 0x02D7, - minusplus: 0x2213, - minute: 0x2032, - miribaarusquare: 0x334A, - mirisquare: 0x3349, - mlonglegturned: 0x0270, - mlsquare: 0x3396, - mmcubedsquare: 0x33A3, - mmonospace: 0xFF4D, - mmsquaredsquare: 0x339F, - mohiragana: 0x3082, - mohmsquare: 0x33C1, - mokatakana: 0x30E2, - mokatakanahalfwidth: 0xFF93, - molsquare: 0x33D6, - momathai: 0x0E21, - moverssquare: 0x33A7, - moverssquaredsquare: 0x33A8, - mparen: 0x24A8, - mpasquare: 0x33AB, - mssquare: 0x33B3, - msuperior: 0xF6EF, - mturned: 0x026F, - mu: 0x00B5, - mu1: 0x00B5, - muasquare: 0x3382, - muchgreater: 0x226B, - muchless: 0x226A, - mufsquare: 0x338C, - mugreek: 0x03BC, - mugsquare: 0x338D, - muhiragana: 0x3080, - mukatakana: 0x30E0, - mukatakanahalfwidth: 0xFF91, - mulsquare: 0x3395, - multiply: 0x00D7, - mumsquare: 0x339B, - munahhebrew: 0x05A3, - munahlefthebrew: 0x05A3, - musicalnote: 0x266A, - musicalnotedbl: 0x266B, - musicflatsign: 0x266D, - musicsharpsign: 0x266F, - mussquare: 0x33B2, - muvsquare: 0x33B6, - muwsquare: 0x33BC, - mvmegasquare: 0x33B9, - mvsquare: 0x33B7, - mwmegasquare: 0x33BF, - mwsquare: 0x33BD, - n: 0x006E, - nabengali: 0x09A8, - nabla: 0x2207, - nacute: 0x0144, - nadeva: 0x0928, - nagujarati: 0x0AA8, - nagurmukhi: 0x0A28, - nahiragana: 0x306A, - nakatakana: 0x30CA, - nakatakanahalfwidth: 0xFF85, - napostrophe: 0x0149, - nasquare: 0x3381, - nbopomofo: 0x310B, - nbspace: 0x00A0, - ncaron: 0x0148, - ncedilla: 0x0146, - ncircle: 0x24DD, - ncircumflexbelow: 0x1E4B, - ncommaaccent: 0x0146, - ndotaccent: 0x1E45, - ndotbelow: 0x1E47, - nehiragana: 0x306D, - nekatakana: 0x30CD, - nekatakanahalfwidth: 0xFF88, - newsheqelsign: 0x20AA, - nfsquare: 0x338B, - ngabengali: 0x0999, - ngadeva: 0x0919, - ngagujarati: 0x0A99, - ngagurmukhi: 0x0A19, - ngonguthai: 0x0E07, - nhiragana: 0x3093, - nhookleft: 0x0272, - nhookretroflex: 0x0273, - nieunacirclekorean: 0x326F, - nieunaparenkorean: 0x320F, - nieuncieuckorean: 0x3135, - nieuncirclekorean: 0x3261, - nieunhieuhkorean: 0x3136, - nieunkorean: 0x3134, - nieunpansioskorean: 0x3168, - nieunparenkorean: 0x3201, - nieunsioskorean: 0x3167, - nieuntikeutkorean: 0x3166, - nihiragana: 0x306B, - nikatakana: 0x30CB, - nikatakanahalfwidth: 0xFF86, - nikhahitleftthai: 0xF899, - nikhahitthai: 0x0E4D, - nine: 0x0039, - ninearabic: 0x0669, - ninebengali: 0x09EF, - ninecircle: 0x2468, - ninecircleinversesansserif: 0x2792, - ninedeva: 0x096F, - ninegujarati: 0x0AEF, - ninegurmukhi: 0x0A6F, - ninehackarabic: 0x0669, - ninehangzhou: 0x3029, - nineideographicparen: 0x3228, - nineinferior: 0x2089, - ninemonospace: 0xFF19, - nineoldstyle: 0xF739, - nineparen: 0x247C, - nineperiod: 0x2490, - ninepersian: 0x06F9, - nineroman: 0x2178, - ninesuperior: 0x2079, - nineteencircle: 0x2472, - nineteenparen: 0x2486, - nineteenperiod: 0x249A, - ninethai: 0x0E59, - nj: 0x01CC, - njecyrillic: 0x045A, - nkatakana: 0x30F3, - nkatakanahalfwidth: 0xFF9D, - nlegrightlong: 0x019E, - nlinebelow: 0x1E49, - nmonospace: 0xFF4E, - nmsquare: 0x339A, - nnabengali: 0x09A3, - nnadeva: 0x0923, - nnagujarati: 0x0AA3, - nnagurmukhi: 0x0A23, - nnnadeva: 0x0929, - nohiragana: 0x306E, - nokatakana: 0x30CE, - nokatakanahalfwidth: 0xFF89, - nonbreakingspace: 0x00A0, - nonenthai: 0x0E13, - nonuthai: 0x0E19, - noonarabic: 0x0646, - noonfinalarabic: 0xFEE6, - noonghunnaarabic: 0x06BA, - noonghunnafinalarabic: 0xFB9F, - nooninitialarabic: 0xFEE7, - noonjeeminitialarabic: 0xFCD2, - noonjeemisolatedarabic: 0xFC4B, - noonmedialarabic: 0xFEE8, - noonmeeminitialarabic: 0xFCD5, - noonmeemisolatedarabic: 0xFC4E, - noonnoonfinalarabic: 0xFC8D, - notcontains: 0x220C, - notelement: 0x2209, - notelementof: 0x2209, - notequal: 0x2260, - notgreater: 0x226F, - notgreaternorequal: 0x2271, - notgreaternorless: 0x2279, - notidentical: 0x2262, - notless: 0x226E, - notlessnorequal: 0x2270, - notparallel: 0x2226, - notprecedes: 0x2280, - notsubset: 0x2284, - notsucceeds: 0x2281, - notsuperset: 0x2285, - nowarmenian: 0x0576, - nparen: 0x24A9, - nssquare: 0x33B1, - nsuperior: 0x207F, - ntilde: 0x00F1, - nu: 0x03BD, - nuhiragana: 0x306C, - nukatakana: 0x30CC, - nukatakanahalfwidth: 0xFF87, - nuktabengali: 0x09BC, - nuktadeva: 0x093C, - nuktagujarati: 0x0ABC, - nuktagurmukhi: 0x0A3C, - numbersign: 0x0023, - numbersignmonospace: 0xFF03, - numbersignsmall: 0xFE5F, - numeralsigngreek: 0x0374, - numeralsignlowergreek: 0x0375, - numero: 0x2116, - nun: 0x05E0, - nundagesh: 0xFB40, - nundageshhebrew: 0xFB40, - nunhebrew: 0x05E0, - nvsquare: 0x33B5, - nwsquare: 0x33BB, - nyabengali: 0x099E, - nyadeva: 0x091E, - nyagujarati: 0x0A9E, - nyagurmukhi: 0x0A1E, - o: 0x006F, - oacute: 0x00F3, - oangthai: 0x0E2D, - obarred: 0x0275, - obarredcyrillic: 0x04E9, - obarreddieresiscyrillic: 0x04EB, - obengali: 0x0993, - obopomofo: 0x311B, - obreve: 0x014F, - ocandradeva: 0x0911, - ocandragujarati: 0x0A91, - ocandravowelsigndeva: 0x0949, - ocandravowelsigngujarati: 0x0AC9, - ocaron: 0x01D2, - ocircle: 0x24DE, - ocircumflex: 0x00F4, - ocircumflexacute: 0x1ED1, - ocircumflexdotbelow: 0x1ED9, - ocircumflexgrave: 0x1ED3, - ocircumflexhookabove: 0x1ED5, - ocircumflextilde: 0x1ED7, - ocyrillic: 0x043E, - odblacute: 0x0151, - odblgrave: 0x020D, - odeva: 0x0913, - odieresis: 0x00F6, - odieresiscyrillic: 0x04E7, - odotbelow: 0x1ECD, - oe: 0x0153, - oekorean: 0x315A, - ogonek: 0x02DB, - ogonekcmb: 0x0328, - ograve: 0x00F2, - ogujarati: 0x0A93, - oharmenian: 0x0585, - ohiragana: 0x304A, - ohookabove: 0x1ECF, - ohorn: 0x01A1, - ohornacute: 0x1EDB, - ohorndotbelow: 0x1EE3, - ohorngrave: 0x1EDD, - ohornhookabove: 0x1EDF, - ohorntilde: 0x1EE1, - ohungarumlaut: 0x0151, - oi: 0x01A3, - oinvertedbreve: 0x020F, - okatakana: 0x30AA, - okatakanahalfwidth: 0xFF75, - okorean: 0x3157, - olehebrew: 0x05AB, - omacron: 0x014D, - omacronacute: 0x1E53, - omacrongrave: 0x1E51, - omdeva: 0x0950, - omega: 0x03C9, - omega1: 0x03D6, - omegacyrillic: 0x0461, - omegalatinclosed: 0x0277, - omegaroundcyrillic: 0x047B, - omegatitlocyrillic: 0x047D, - omegatonos: 0x03CE, - omgujarati: 0x0AD0, - omicron: 0x03BF, - omicrontonos: 0x03CC, - omonospace: 0xFF4F, - one: 0x0031, - onearabic: 0x0661, - onebengali: 0x09E7, - onecircle: 0x2460, - onecircleinversesansserif: 0x278A, - onedeva: 0x0967, - onedotenleader: 0x2024, - oneeighth: 0x215B, - onefitted: 0xF6DC, - onegujarati: 0x0AE7, - onegurmukhi: 0x0A67, - onehackarabic: 0x0661, - onehalf: 0x00BD, - onehangzhou: 0x3021, - oneideographicparen: 0x3220, - oneinferior: 0x2081, - onemonospace: 0xFF11, - onenumeratorbengali: 0x09F4, - oneoldstyle: 0xF731, - oneparen: 0x2474, - oneperiod: 0x2488, - onepersian: 0x06F1, - onequarter: 0x00BC, - oneroman: 0x2170, - onesuperior: 0x00B9, - onethai: 0x0E51, - onethird: 0x2153, - oogonek: 0x01EB, - oogonekmacron: 0x01ED, - oogurmukhi: 0x0A13, - oomatragurmukhi: 0x0A4B, - oopen: 0x0254, - oparen: 0x24AA, - openbullet: 0x25E6, - option: 0x2325, - ordfeminine: 0x00AA, - ordmasculine: 0x00BA, - orthogonal: 0x221F, - oshortdeva: 0x0912, - oshortvowelsigndeva: 0x094A, - oslash: 0x00F8, - oslashacute: 0x01FF, - osmallhiragana: 0x3049, - osmallkatakana: 0x30A9, - osmallkatakanahalfwidth: 0xFF6B, - ostrokeacute: 0x01FF, - osuperior: 0xF6F0, - otcyrillic: 0x047F, - otilde: 0x00F5, - otildeacute: 0x1E4D, - otildedieresis: 0x1E4F, - oubopomofo: 0x3121, - overline: 0x203E, - overlinecenterline: 0xFE4A, - overlinecmb: 0x0305, - overlinedashed: 0xFE49, - overlinedblwavy: 0xFE4C, - overlinewavy: 0xFE4B, - overscore: 0x00AF, - ovowelsignbengali: 0x09CB, - ovowelsigndeva: 0x094B, - ovowelsigngujarati: 0x0ACB, - p: 0x0070, - paampssquare: 0x3380, - paasentosquare: 0x332B, - pabengali: 0x09AA, - pacute: 0x1E55, - padeva: 0x092A, - pagedown: 0x21DF, - pageup: 0x21DE, - pagujarati: 0x0AAA, - pagurmukhi: 0x0A2A, - pahiragana: 0x3071, - paiyannoithai: 0x0E2F, - pakatakana: 0x30D1, - palatalizationcyrilliccmb: 0x0484, - palochkacyrillic: 0x04C0, - pansioskorean: 0x317F, - paragraph: 0x00B6, - parallel: 0x2225, - parenleft: 0x0028, - parenleftaltonearabic: 0xFD3E, - parenleftbt: 0xF8ED, - parenleftex: 0xF8EC, - parenleftinferior: 0x208D, - parenleftmonospace: 0xFF08, - parenleftsmall: 0xFE59, - parenleftsuperior: 0x207D, - parenlefttp: 0xF8EB, - parenleftvertical: 0xFE35, - parenright: 0x0029, - parenrightaltonearabic: 0xFD3F, - parenrightbt: 0xF8F8, - parenrightex: 0xF8F7, - parenrightinferior: 0x208E, - parenrightmonospace: 0xFF09, - parenrightsmall: 0xFE5A, - parenrightsuperior: 0x207E, - parenrighttp: 0xF8F6, - parenrightvertical: 0xFE36, - partialdiff: 0x2202, - paseqhebrew: 0x05C0, - pashtahebrew: 0x0599, - pasquare: 0x33A9, - patah: 0x05B7, - patah11: 0x05B7, - patah1d: 0x05B7, - patah2a: 0x05B7, - patahhebrew: 0x05B7, - patahnarrowhebrew: 0x05B7, - patahquarterhebrew: 0x05B7, - patahwidehebrew: 0x05B7, - pazerhebrew: 0x05A1, - pbopomofo: 0x3106, - pcircle: 0x24DF, - pdotaccent: 0x1E57, - pe: 0x05E4, - pecyrillic: 0x043F, - pedagesh: 0xFB44, - pedageshhebrew: 0xFB44, - peezisquare: 0x333B, - pefinaldageshhebrew: 0xFB43, - peharabic: 0x067E, - peharmenian: 0x057A, - pehebrew: 0x05E4, - pehfinalarabic: 0xFB57, - pehinitialarabic: 0xFB58, - pehiragana: 0x307A, - pehmedialarabic: 0xFB59, - pekatakana: 0x30DA, - pemiddlehookcyrillic: 0x04A7, - perafehebrew: 0xFB4E, - percent: 0x0025, - percentarabic: 0x066A, - percentmonospace: 0xFF05, - percentsmall: 0xFE6A, - period: 0x002E, - periodarmenian: 0x0589, - periodcentered: 0x00B7, - periodhalfwidth: 0xFF61, - periodinferior: 0xF6E7, - periodmonospace: 0xFF0E, - periodsmall: 0xFE52, - periodsuperior: 0xF6E8, - perispomenigreekcmb: 0x0342, - perpendicular: 0x22A5, - perthousand: 0x2030, - peseta: 0x20A7, - pfsquare: 0x338A, - phabengali: 0x09AB, - phadeva: 0x092B, - phagujarati: 0x0AAB, - phagurmukhi: 0x0A2B, - phi: 0x03C6, - phi1: 0x03D5, - phieuphacirclekorean: 0x327A, - phieuphaparenkorean: 0x321A, - phieuphcirclekorean: 0x326C, - phieuphkorean: 0x314D, - phieuphparenkorean: 0x320C, - philatin: 0x0278, - phinthuthai: 0x0E3A, - phisymbolgreek: 0x03D5, - phook: 0x01A5, - phophanthai: 0x0E1E, - phophungthai: 0x0E1C, - phosamphaothai: 0x0E20, - pi: 0x03C0, - pieupacirclekorean: 0x3273, - pieupaparenkorean: 0x3213, - pieupcieuckorean: 0x3176, - pieupcirclekorean: 0x3265, - pieupkiyeokkorean: 0x3172, - pieupkorean: 0x3142, - pieupparenkorean: 0x3205, - pieupsioskiyeokkorean: 0x3174, - pieupsioskorean: 0x3144, - pieupsiostikeutkorean: 0x3175, - pieupthieuthkorean: 0x3177, - pieuptikeutkorean: 0x3173, - pihiragana: 0x3074, - pikatakana: 0x30D4, - pisymbolgreek: 0x03D6, - piwrarmenian: 0x0583, - plus: 0x002B, - plusbelowcmb: 0x031F, - pluscircle: 0x2295, - plusminus: 0x00B1, - plusmod: 0x02D6, - plusmonospace: 0xFF0B, - plussmall: 0xFE62, - plussuperior: 0x207A, - pmonospace: 0xFF50, - pmsquare: 0x33D8, - pohiragana: 0x307D, - pointingindexdownwhite: 0x261F, - pointingindexleftwhite: 0x261C, - pointingindexrightwhite: 0x261E, - pointingindexupwhite: 0x261D, - pokatakana: 0x30DD, - poplathai: 0x0E1B, - postalmark: 0x3012, - postalmarkface: 0x3020, - pparen: 0x24AB, - precedes: 0x227A, - prescription: 0x211E, - primemod: 0x02B9, - primereversed: 0x2035, - product: 0x220F, - projective: 0x2305, - prolongedkana: 0x30FC, - propellor: 0x2318, - propersubset: 0x2282, - propersuperset: 0x2283, - proportion: 0x2237, - proportional: 0x221D, - psi: 0x03C8, - psicyrillic: 0x0471, - psilipneumatacyrilliccmb: 0x0486, - pssquare: 0x33B0, - puhiragana: 0x3077, - pukatakana: 0x30D7, - pvsquare: 0x33B4, - pwsquare: 0x33BA, - q: 0x0071, - qadeva: 0x0958, - qadmahebrew: 0x05A8, - qafarabic: 0x0642, - qaffinalarabic: 0xFED6, - qafinitialarabic: 0xFED7, - qafmedialarabic: 0xFED8, - qamats: 0x05B8, - qamats10: 0x05B8, - qamats1a: 0x05B8, - qamats1c: 0x05B8, - qamats27: 0x05B8, - qamats29: 0x05B8, - qamats33: 0x05B8, - qamatsde: 0x05B8, - qamatshebrew: 0x05B8, - qamatsnarrowhebrew: 0x05B8, - qamatsqatanhebrew: 0x05B8, - qamatsqatannarrowhebrew: 0x05B8, - qamatsqatanquarterhebrew: 0x05B8, - qamatsqatanwidehebrew: 0x05B8, - qamatsquarterhebrew: 0x05B8, - qamatswidehebrew: 0x05B8, - qarneyparahebrew: 0x059F, - qbopomofo: 0x3111, - qcircle: 0x24E0, - qhook: 0x02A0, - qmonospace: 0xFF51, - qof: 0x05E7, - qofdagesh: 0xFB47, - qofdageshhebrew: 0xFB47, - qofhebrew: 0x05E7, - qparen: 0x24AC, - quarternote: 0x2669, - qubuts: 0x05BB, - qubuts18: 0x05BB, - qubuts25: 0x05BB, - qubuts31: 0x05BB, - qubutshebrew: 0x05BB, - qubutsnarrowhebrew: 0x05BB, - qubutsquarterhebrew: 0x05BB, - qubutswidehebrew: 0x05BB, - question: 0x003F, - questionarabic: 0x061F, - questionarmenian: 0x055E, - questiondown: 0x00BF, - questiondownsmall: 0xF7BF, - questiongreek: 0x037E, - questionmonospace: 0xFF1F, - questionsmall: 0xF73F, - quotedbl: 0x0022, - quotedblbase: 0x201E, - quotedblleft: 0x201C, - quotedblmonospace: 0xFF02, - quotedblprime: 0x301E, - quotedblprimereversed: 0x301D, - quotedblright: 0x201D, - quoteleft: 0x2018, - quoteleftreversed: 0x201B, - quotereversed: 0x201B, - quoteright: 0x2019, - quoterightn: 0x0149, - quotesinglbase: 0x201A, - quotesingle: 0x0027, - quotesinglemonospace: 0xFF07, - r: 0x0072, - raarmenian: 0x057C, - rabengali: 0x09B0, - racute: 0x0155, - radeva: 0x0930, - radical: 0x221A, - radicalex: 0xF8E5, - radoverssquare: 0x33AE, - radoverssquaredsquare: 0x33AF, - radsquare: 0x33AD, - rafe: 0x05BF, - rafehebrew: 0x05BF, - ragujarati: 0x0AB0, - ragurmukhi: 0x0A30, - rahiragana: 0x3089, - rakatakana: 0x30E9, - rakatakanahalfwidth: 0xFF97, - ralowerdiagonalbengali: 0x09F1, - ramiddlediagonalbengali: 0x09F0, - ramshorn: 0x0264, - ratio: 0x2236, - rbopomofo: 0x3116, - rcaron: 0x0159, - rcedilla: 0x0157, - rcircle: 0x24E1, - rcommaaccent: 0x0157, - rdblgrave: 0x0211, - rdotaccent: 0x1E59, - rdotbelow: 0x1E5B, - rdotbelowmacron: 0x1E5D, - referencemark: 0x203B, - reflexsubset: 0x2286, - reflexsuperset: 0x2287, - registered: 0x00AE, - registersans: 0xF8E8, - registerserif: 0xF6DA, - reharabic: 0x0631, - reharmenian: 0x0580, - rehfinalarabic: 0xFEAE, - rehiragana: 0x308C, - rekatakana: 0x30EC, - rekatakanahalfwidth: 0xFF9A, - resh: 0x05E8, - reshdageshhebrew: 0xFB48, - reshhebrew: 0x05E8, - reversedtilde: 0x223D, - reviahebrew: 0x0597, - reviamugrashhebrew: 0x0597, - revlogicalnot: 0x2310, - rfishhook: 0x027E, - rfishhookreversed: 0x027F, - rhabengali: 0x09DD, - rhadeva: 0x095D, - rho: 0x03C1, - rhook: 0x027D, - rhookturned: 0x027B, - rhookturnedsuperior: 0x02B5, - rhosymbolgreek: 0x03F1, - rhotichookmod: 0x02DE, - rieulacirclekorean: 0x3271, - rieulaparenkorean: 0x3211, - rieulcirclekorean: 0x3263, - rieulhieuhkorean: 0x3140, - rieulkiyeokkorean: 0x313A, - rieulkiyeoksioskorean: 0x3169, - rieulkorean: 0x3139, - rieulmieumkorean: 0x313B, - rieulpansioskorean: 0x316C, - rieulparenkorean: 0x3203, - rieulphieuphkorean: 0x313F, - rieulpieupkorean: 0x313C, - rieulpieupsioskorean: 0x316B, - rieulsioskorean: 0x313D, - rieulthieuthkorean: 0x313E, - rieultikeutkorean: 0x316A, - rieulyeorinhieuhkorean: 0x316D, - rightangle: 0x221F, - righttackbelowcmb: 0x0319, - righttriangle: 0x22BF, - rihiragana: 0x308A, - rikatakana: 0x30EA, - rikatakanahalfwidth: 0xFF98, - ring: 0x02DA, - ringbelowcmb: 0x0325, - ringcmb: 0x030A, - ringhalfleft: 0x02BF, - ringhalfleftarmenian: 0x0559, - ringhalfleftbelowcmb: 0x031C, - ringhalfleftcentered: 0x02D3, - ringhalfright: 0x02BE, - ringhalfrightbelowcmb: 0x0339, - ringhalfrightcentered: 0x02D2, - rinvertedbreve: 0x0213, - rittorusquare: 0x3351, - rlinebelow: 0x1E5F, - rlongleg: 0x027C, - rlonglegturned: 0x027A, - rmonospace: 0xFF52, - rohiragana: 0x308D, - rokatakana: 0x30ED, - rokatakanahalfwidth: 0xFF9B, - roruathai: 0x0E23, - rparen: 0x24AD, - rrabengali: 0x09DC, - rradeva: 0x0931, - rragurmukhi: 0x0A5C, - rreharabic: 0x0691, - rrehfinalarabic: 0xFB8D, - rrvocalicbengali: 0x09E0, - rrvocalicdeva: 0x0960, - rrvocalicgujarati: 0x0AE0, - rrvocalicvowelsignbengali: 0x09C4, - rrvocalicvowelsigndeva: 0x0944, - rrvocalicvowelsigngujarati: 0x0AC4, - rsuperior: 0xF6F1, - rtblock: 0x2590, - rturned: 0x0279, - rturnedsuperior: 0x02B4, - ruhiragana: 0x308B, - rukatakana: 0x30EB, - rukatakanahalfwidth: 0xFF99, - rupeemarkbengali: 0x09F2, - rupeesignbengali: 0x09F3, - rupiah: 0xF6DD, - ruthai: 0x0E24, - rvocalicbengali: 0x098B, - rvocalicdeva: 0x090B, - rvocalicgujarati: 0x0A8B, - rvocalicvowelsignbengali: 0x09C3, - rvocalicvowelsigndeva: 0x0943, - rvocalicvowelsigngujarati: 0x0AC3, - s: 0x0073, - sabengali: 0x09B8, - sacute: 0x015B, - sacutedotaccent: 0x1E65, - sadarabic: 0x0635, - sadeva: 0x0938, - sadfinalarabic: 0xFEBA, - sadinitialarabic: 0xFEBB, - sadmedialarabic: 0xFEBC, - sagujarati: 0x0AB8, - sagurmukhi: 0x0A38, - sahiragana: 0x3055, - sakatakana: 0x30B5, - sakatakanahalfwidth: 0xFF7B, - sallallahoualayhewasallamarabic: 0xFDFA, - samekh: 0x05E1, - samekhdagesh: 0xFB41, - samekhdageshhebrew: 0xFB41, - samekhhebrew: 0x05E1, - saraaathai: 0x0E32, - saraaethai: 0x0E41, - saraaimaimalaithai: 0x0E44, - saraaimaimuanthai: 0x0E43, - saraamthai: 0x0E33, - saraathai: 0x0E30, - saraethai: 0x0E40, - saraiileftthai: 0xF886, - saraiithai: 0x0E35, - saraileftthai: 0xF885, - saraithai: 0x0E34, - saraothai: 0x0E42, - saraueeleftthai: 0xF888, - saraueethai: 0x0E37, - saraueleftthai: 0xF887, - sarauethai: 0x0E36, - sarauthai: 0x0E38, - sarauuthai: 0x0E39, - sbopomofo: 0x3119, - scaron: 0x0161, - scarondotaccent: 0x1E67, - scedilla: 0x015F, - schwa: 0x0259, - schwacyrillic: 0x04D9, - schwadieresiscyrillic: 0x04DB, - schwahook: 0x025A, - scircle: 0x24E2, - scircumflex: 0x015D, - scommaaccent: 0x0219, - sdotaccent: 0x1E61, - sdotbelow: 0x1E63, - sdotbelowdotaccent: 0x1E69, - seagullbelowcmb: 0x033C, - second: 0x2033, - secondtonechinese: 0x02CA, - section: 0x00A7, - seenarabic: 0x0633, - seenfinalarabic: 0xFEB2, - seeninitialarabic: 0xFEB3, - seenmedialarabic: 0xFEB4, - segol: 0x05B6, - segol13: 0x05B6, - segol1f: 0x05B6, - segol2c: 0x05B6, - segolhebrew: 0x05B6, - segolnarrowhebrew: 0x05B6, - segolquarterhebrew: 0x05B6, - segoltahebrew: 0x0592, - segolwidehebrew: 0x05B6, - seharmenian: 0x057D, - sehiragana: 0x305B, - sekatakana: 0x30BB, - sekatakanahalfwidth: 0xFF7E, - semicolon: 0x003B, - semicolonarabic: 0x061B, - semicolonmonospace: 0xFF1B, - semicolonsmall: 0xFE54, - semivoicedmarkkana: 0x309C, - semivoicedmarkkanahalfwidth: 0xFF9F, - sentisquare: 0x3322, - sentosquare: 0x3323, - seven: 0x0037, - sevenarabic: 0x0667, - sevenbengali: 0x09ED, - sevencircle: 0x2466, - sevencircleinversesansserif: 0x2790, - sevendeva: 0x096D, - seveneighths: 0x215E, - sevengujarati: 0x0AED, - sevengurmukhi: 0x0A6D, - sevenhackarabic: 0x0667, - sevenhangzhou: 0x3027, - sevenideographicparen: 0x3226, - seveninferior: 0x2087, - sevenmonospace: 0xFF17, - sevenoldstyle: 0xF737, - sevenparen: 0x247A, - sevenperiod: 0x248E, - sevenpersian: 0x06F7, - sevenroman: 0x2176, - sevensuperior: 0x2077, - seventeencircle: 0x2470, - seventeenparen: 0x2484, - seventeenperiod: 0x2498, - seventhai: 0x0E57, - sfthyphen: 0x00AD, - shaarmenian: 0x0577, - shabengali: 0x09B6, - shacyrillic: 0x0448, - shaddaarabic: 0x0651, - shaddadammaarabic: 0xFC61, - shaddadammatanarabic: 0xFC5E, - shaddafathaarabic: 0xFC60, - shaddakasraarabic: 0xFC62, - shaddakasratanarabic: 0xFC5F, - shade: 0x2592, - shadedark: 0x2593, - shadelight: 0x2591, - shademedium: 0x2592, - shadeva: 0x0936, - shagujarati: 0x0AB6, - shagurmukhi: 0x0A36, - shalshelethebrew: 0x0593, - shbopomofo: 0x3115, - shchacyrillic: 0x0449, - sheenarabic: 0x0634, - sheenfinalarabic: 0xFEB6, - sheeninitialarabic: 0xFEB7, - sheenmedialarabic: 0xFEB8, - sheicoptic: 0x03E3, - sheqel: 0x20AA, - sheqelhebrew: 0x20AA, - sheva: 0x05B0, - sheva115: 0x05B0, - sheva15: 0x05B0, - sheva22: 0x05B0, - sheva2e: 0x05B0, - shevahebrew: 0x05B0, - shevanarrowhebrew: 0x05B0, - shevaquarterhebrew: 0x05B0, - shevawidehebrew: 0x05B0, - shhacyrillic: 0x04BB, - shimacoptic: 0x03ED, - shin: 0x05E9, - shindagesh: 0xFB49, - shindageshhebrew: 0xFB49, - shindageshshindot: 0xFB2C, - shindageshshindothebrew: 0xFB2C, - shindageshsindot: 0xFB2D, - shindageshsindothebrew: 0xFB2D, - shindothebrew: 0x05C1, - shinhebrew: 0x05E9, - shinshindot: 0xFB2A, - shinshindothebrew: 0xFB2A, - shinsindot: 0xFB2B, - shinsindothebrew: 0xFB2B, - shook: 0x0282, - sigma: 0x03C3, - sigma1: 0x03C2, - sigmafinal: 0x03C2, - sigmalunatesymbolgreek: 0x03F2, - sihiragana: 0x3057, - sikatakana: 0x30B7, - sikatakanahalfwidth: 0xFF7C, - siluqhebrew: 0x05BD, - siluqlefthebrew: 0x05BD, - similar: 0x223C, - sindothebrew: 0x05C2, - siosacirclekorean: 0x3274, - siosaparenkorean: 0x3214, - sioscieuckorean: 0x317E, - sioscirclekorean: 0x3266, - sioskiyeokkorean: 0x317A, - sioskorean: 0x3145, - siosnieunkorean: 0x317B, - siosparenkorean: 0x3206, - siospieupkorean: 0x317D, - siostikeutkorean: 0x317C, - six: 0x0036, - sixarabic: 0x0666, - sixbengali: 0x09EC, - sixcircle: 0x2465, - sixcircleinversesansserif: 0x278F, - sixdeva: 0x096C, - sixgujarati: 0x0AEC, - sixgurmukhi: 0x0A6C, - sixhackarabic: 0x0666, - sixhangzhou: 0x3026, - sixideographicparen: 0x3225, - sixinferior: 0x2086, - sixmonospace: 0xFF16, - sixoldstyle: 0xF736, - sixparen: 0x2479, - sixperiod: 0x248D, - sixpersian: 0x06F6, - sixroman: 0x2175, - sixsuperior: 0x2076, - sixteencircle: 0x246F, - sixteencurrencydenominatorbengali: 0x09F9, - sixteenparen: 0x2483, - sixteenperiod: 0x2497, - sixthai: 0x0E56, - slash: 0x002F, - slashmonospace: 0xFF0F, - slong: 0x017F, - slongdotaccent: 0x1E9B, - smileface: 0x263A, - smonospace: 0xFF53, - sofpasuqhebrew: 0x05C3, - softhyphen: 0x00AD, - softsigncyrillic: 0x044C, - sohiragana: 0x305D, - sokatakana: 0x30BD, - sokatakanahalfwidth: 0xFF7F, - soliduslongoverlaycmb: 0x0338, - solidusshortoverlaycmb: 0x0337, - sorusithai: 0x0E29, - sosalathai: 0x0E28, - sosothai: 0x0E0B, - sosuathai: 0x0E2A, - space: 0x0020, - spacehackarabic: 0x0020, - spade: 0x2660, - spadesuitblack: 0x2660, - spadesuitwhite: 0x2664, - sparen: 0x24AE, - squarebelowcmb: 0x033B, - squarecc: 0x33C4, - squarecm: 0x339D, - squarediagonalcrosshatchfill: 0x25A9, - squarehorizontalfill: 0x25A4, - squarekg: 0x338F, - squarekm: 0x339E, - squarekmcapital: 0x33CE, - squareln: 0x33D1, - squarelog: 0x33D2, - squaremg: 0x338E, - squaremil: 0x33D5, - squaremm: 0x339C, - squaremsquared: 0x33A1, - squareorthogonalcrosshatchfill: 0x25A6, - squareupperlefttolowerrightfill: 0x25A7, - squareupperrighttolowerleftfill: 0x25A8, - squareverticalfill: 0x25A5, - squarewhitewithsmallblack: 0x25A3, - srsquare: 0x33DB, - ssabengali: 0x09B7, - ssadeva: 0x0937, - ssagujarati: 0x0AB7, - ssangcieuckorean: 0x3149, - ssanghieuhkorean: 0x3185, - ssangieungkorean: 0x3180, - ssangkiyeokkorean: 0x3132, - ssangnieunkorean: 0x3165, - ssangpieupkorean: 0x3143, - ssangsioskorean: 0x3146, - ssangtikeutkorean: 0x3138, - ssuperior: 0xF6F2, - sterling: 0x00A3, - sterlingmonospace: 0xFFE1, - strokelongoverlaycmb: 0x0336, - strokeshortoverlaycmb: 0x0335, - subset: 0x2282, - subsetnotequal: 0x228A, - subsetorequal: 0x2286, - succeeds: 0x227B, - suchthat: 0x220B, - suhiragana: 0x3059, - sukatakana: 0x30B9, - sukatakanahalfwidth: 0xFF7D, - sukunarabic: 0x0652, - summation: 0x2211, - sun: 0x263C, - superset: 0x2283, - supersetnotequal: 0x228B, - supersetorequal: 0x2287, - svsquare: 0x33DC, - syouwaerasquare: 0x337C, - t: 0x0074, - tabengali: 0x09A4, - tackdown: 0x22A4, - tackleft: 0x22A3, - tadeva: 0x0924, - tagujarati: 0x0AA4, - tagurmukhi: 0x0A24, - taharabic: 0x0637, - tahfinalarabic: 0xFEC2, - tahinitialarabic: 0xFEC3, - tahiragana: 0x305F, - tahmedialarabic: 0xFEC4, - taisyouerasquare: 0x337D, - takatakana: 0x30BF, - takatakanahalfwidth: 0xFF80, - tatweelarabic: 0x0640, - tau: 0x03C4, - tav: 0x05EA, - tavdages: 0xFB4A, - tavdagesh: 0xFB4A, - tavdageshhebrew: 0xFB4A, - tavhebrew: 0x05EA, - tbar: 0x0167, - tbopomofo: 0x310A, - tcaron: 0x0165, - tccurl: 0x02A8, - tcedilla: 0x0163, - tcheharabic: 0x0686, - tchehfinalarabic: 0xFB7B, - tchehinitialarabic: 0xFB7C, - tchehmedialarabic: 0xFB7D, - tcircle: 0x24E3, - tcircumflexbelow: 0x1E71, - tcommaaccent: 0x0163, - tdieresis: 0x1E97, - tdotaccent: 0x1E6B, - tdotbelow: 0x1E6D, - tecyrillic: 0x0442, - tedescendercyrillic: 0x04AD, - teharabic: 0x062A, - tehfinalarabic: 0xFE96, - tehhahinitialarabic: 0xFCA2, - tehhahisolatedarabic: 0xFC0C, - tehinitialarabic: 0xFE97, - tehiragana: 0x3066, - tehjeeminitialarabic: 0xFCA1, - tehjeemisolatedarabic: 0xFC0B, - tehmarbutaarabic: 0x0629, - tehmarbutafinalarabic: 0xFE94, - tehmedialarabic: 0xFE98, - tehmeeminitialarabic: 0xFCA4, - tehmeemisolatedarabic: 0xFC0E, - tehnoonfinalarabic: 0xFC73, - tekatakana: 0x30C6, - tekatakanahalfwidth: 0xFF83, - telephone: 0x2121, - telephoneblack: 0x260E, - telishagedolahebrew: 0x05A0, - telishaqetanahebrew: 0x05A9, - tencircle: 0x2469, - tenideographicparen: 0x3229, - tenparen: 0x247D, - tenperiod: 0x2491, - tenroman: 0x2179, - tesh: 0x02A7, - tet: 0x05D8, - tetdagesh: 0xFB38, - tetdageshhebrew: 0xFB38, - tethebrew: 0x05D8, - tetsecyrillic: 0x04B5, - tevirhebrew: 0x059B, - tevirlefthebrew: 0x059B, - thabengali: 0x09A5, - thadeva: 0x0925, - thagujarati: 0x0AA5, - thagurmukhi: 0x0A25, - thalarabic: 0x0630, - thalfinalarabic: 0xFEAC, - thanthakhatlowleftthai: 0xF898, - thanthakhatlowrightthai: 0xF897, - thanthakhatthai: 0x0E4C, - thanthakhatupperleftthai: 0xF896, - theharabic: 0x062B, - thehfinalarabic: 0xFE9A, - thehinitialarabic: 0xFE9B, - thehmedialarabic: 0xFE9C, - thereexists: 0x2203, - therefore: 0x2234, - theta: 0x03B8, - theta1: 0x03D1, - thetasymbolgreek: 0x03D1, - thieuthacirclekorean: 0x3279, - thieuthaparenkorean: 0x3219, - thieuthcirclekorean: 0x326B, - thieuthkorean: 0x314C, - thieuthparenkorean: 0x320B, - thirteencircle: 0x246C, - thirteenparen: 0x2480, - thirteenperiod: 0x2494, - thonangmonthothai: 0x0E11, - thook: 0x01AD, - thophuthaothai: 0x0E12, - thorn: 0x00FE, - thothahanthai: 0x0E17, - thothanthai: 0x0E10, - thothongthai: 0x0E18, - thothungthai: 0x0E16, - thousandcyrillic: 0x0482, - thousandsseparatorarabic: 0x066C, - thousandsseparatorpersian: 0x066C, - three: 0x0033, - threearabic: 0x0663, - threebengali: 0x09E9, - threecircle: 0x2462, - threecircleinversesansserif: 0x278C, - threedeva: 0x0969, - threeeighths: 0x215C, - threegujarati: 0x0AE9, - threegurmukhi: 0x0A69, - threehackarabic: 0x0663, - threehangzhou: 0x3023, - threeideographicparen: 0x3222, - threeinferior: 0x2083, - threemonospace: 0xFF13, - threenumeratorbengali: 0x09F6, - threeoldstyle: 0xF733, - threeparen: 0x2476, - threeperiod: 0x248A, - threepersian: 0x06F3, - threequarters: 0x00BE, - threequartersemdash: 0xF6DE, - threeroman: 0x2172, - threesuperior: 0x00B3, - threethai: 0x0E53, - thzsquare: 0x3394, - tihiragana: 0x3061, - tikatakana: 0x30C1, - tikatakanahalfwidth: 0xFF81, - tikeutacirclekorean: 0x3270, - tikeutaparenkorean: 0x3210, - tikeutcirclekorean: 0x3262, - tikeutkorean: 0x3137, - tikeutparenkorean: 0x3202, - tilde: 0x02DC, - tildebelowcmb: 0x0330, - tildecmb: 0x0303, - tildecomb: 0x0303, - tildedoublecmb: 0x0360, - tildeoperator: 0x223C, - tildeoverlaycmb: 0x0334, - tildeverticalcmb: 0x033E, - timescircle: 0x2297, - tipehahebrew: 0x0596, - tipehalefthebrew: 0x0596, - tippigurmukhi: 0x0A70, - titlocyrilliccmb: 0x0483, - tiwnarmenian: 0x057F, - tlinebelow: 0x1E6F, - tmonospace: 0xFF54, - toarmenian: 0x0569, - tohiragana: 0x3068, - tokatakana: 0x30C8, - tokatakanahalfwidth: 0xFF84, - tonebarextrahighmod: 0x02E5, - tonebarextralowmod: 0x02E9, - tonebarhighmod: 0x02E6, - tonebarlowmod: 0x02E8, - tonebarmidmod: 0x02E7, - tonefive: 0x01BD, - tonesix: 0x0185, - tonetwo: 0x01A8, - tonos: 0x0384, - tonsquare: 0x3327, - topatakthai: 0x0E0F, - tortoiseshellbracketleft: 0x3014, - tortoiseshellbracketleftsmall: 0xFE5D, - tortoiseshellbracketleftvertical: 0xFE39, - tortoiseshellbracketright: 0x3015, - tortoiseshellbracketrightsmall: 0xFE5E, - tortoiseshellbracketrightvertical: 0xFE3A, - totaothai: 0x0E15, - tpalatalhook: 0x01AB, - tparen: 0x24AF, - trademark: 0x2122, - trademarksans: 0xF8EA, - trademarkserif: 0xF6DB, - tretroflexhook: 0x0288, - triagdn: 0x25BC, - triaglf: 0x25C4, - triagrt: 0x25BA, - triagup: 0x25B2, - ts: 0x02A6, - tsadi: 0x05E6, - tsadidagesh: 0xFB46, - tsadidageshhebrew: 0xFB46, - tsadihebrew: 0x05E6, - tsecyrillic: 0x0446, - tsere: 0x05B5, - tsere12: 0x05B5, - tsere1e: 0x05B5, - tsere2b: 0x05B5, - tserehebrew: 0x05B5, - tserenarrowhebrew: 0x05B5, - tserequarterhebrew: 0x05B5, - tserewidehebrew: 0x05B5, - tshecyrillic: 0x045B, - tsuperior: 0xF6F3, - ttabengali: 0x099F, - ttadeva: 0x091F, - ttagujarati: 0x0A9F, - ttagurmukhi: 0x0A1F, - tteharabic: 0x0679, - ttehfinalarabic: 0xFB67, - ttehinitialarabic: 0xFB68, - ttehmedialarabic: 0xFB69, - tthabengali: 0x09A0, - tthadeva: 0x0920, - tthagujarati: 0x0AA0, - tthagurmukhi: 0x0A20, - tturned: 0x0287, - tuhiragana: 0x3064, - tukatakana: 0x30C4, - tukatakanahalfwidth: 0xFF82, - tusmallhiragana: 0x3063, - tusmallkatakana: 0x30C3, - tusmallkatakanahalfwidth: 0xFF6F, - twelvecircle: 0x246B, - twelveparen: 0x247F, - twelveperiod: 0x2493, - twelveroman: 0x217B, - twentycircle: 0x2473, - twentyhangzhou: 0x5344, - twentyparen: 0x2487, - twentyperiod: 0x249B, - two: 0x0032, - twoarabic: 0x0662, - twobengali: 0x09E8, - twocircle: 0x2461, - twocircleinversesansserif: 0x278B, - twodeva: 0x0968, - twodotenleader: 0x2025, - twodotleader: 0x2025, - twodotleadervertical: 0xFE30, - twogujarati: 0x0AE8, - twogurmukhi: 0x0A68, - twohackarabic: 0x0662, - twohangzhou: 0x3022, - twoideographicparen: 0x3221, - twoinferior: 0x2082, - twomonospace: 0xFF12, - twonumeratorbengali: 0x09F5, - twooldstyle: 0xF732, - twoparen: 0x2475, - twoperiod: 0x2489, - twopersian: 0x06F2, - tworoman: 0x2171, - twostroke: 0x01BB, - twosuperior: 0x00B2, - twothai: 0x0E52, - twothirds: 0x2154, - u: 0x0075, - uacute: 0x00FA, - ubar: 0x0289, - ubengali: 0x0989, - ubopomofo: 0x3128, - ubreve: 0x016D, - ucaron: 0x01D4, - ucircle: 0x24E4, - ucircumflex: 0x00FB, - ucircumflexbelow: 0x1E77, - ucyrillic: 0x0443, - udattadeva: 0x0951, - udblacute: 0x0171, - udblgrave: 0x0215, - udeva: 0x0909, - udieresis: 0x00FC, - udieresisacute: 0x01D8, - udieresisbelow: 0x1E73, - udieresiscaron: 0x01DA, - udieresiscyrillic: 0x04F1, - udieresisgrave: 0x01DC, - udieresismacron: 0x01D6, - udotbelow: 0x1EE5, - ugrave: 0x00F9, - ugujarati: 0x0A89, - ugurmukhi: 0x0A09, - uhiragana: 0x3046, - uhookabove: 0x1EE7, - uhorn: 0x01B0, - uhornacute: 0x1EE9, - uhorndotbelow: 0x1EF1, - uhorngrave: 0x1EEB, - uhornhookabove: 0x1EED, - uhorntilde: 0x1EEF, - uhungarumlaut: 0x0171, - uhungarumlautcyrillic: 0x04F3, - uinvertedbreve: 0x0217, - ukatakana: 0x30A6, - ukatakanahalfwidth: 0xFF73, - ukcyrillic: 0x0479, - ukorean: 0x315C, - umacron: 0x016B, - umacroncyrillic: 0x04EF, - umacrondieresis: 0x1E7B, - umatragurmukhi: 0x0A41, - umonospace: 0xFF55, - underscore: 0x005F, - underscoredbl: 0x2017, - underscoremonospace: 0xFF3F, - underscorevertical: 0xFE33, - underscorewavy: 0xFE4F, - union: 0x222A, - universal: 0x2200, - uogonek: 0x0173, - uparen: 0x24B0, - upblock: 0x2580, - upperdothebrew: 0x05C4, - upsilon: 0x03C5, - upsilondieresis: 0x03CB, - upsilondieresistonos: 0x03B0, - upsilonlatin: 0x028A, - upsilontonos: 0x03CD, - uptackbelowcmb: 0x031D, - uptackmod: 0x02D4, - uragurmukhi: 0x0A73, - uring: 0x016F, - ushortcyrillic: 0x045E, - usmallhiragana: 0x3045, - usmallkatakana: 0x30A5, - usmallkatakanahalfwidth: 0xFF69, - ustraightcyrillic: 0x04AF, - ustraightstrokecyrillic: 0x04B1, - utilde: 0x0169, - utildeacute: 0x1E79, - utildebelow: 0x1E75, - uubengali: 0x098A, - uudeva: 0x090A, - uugujarati: 0x0A8A, - uugurmukhi: 0x0A0A, - uumatragurmukhi: 0x0A42, - uuvowelsignbengali: 0x09C2, - uuvowelsigndeva: 0x0942, - uuvowelsigngujarati: 0x0AC2, - uvowelsignbengali: 0x09C1, - uvowelsigndeva: 0x0941, - uvowelsigngujarati: 0x0AC1, - v: 0x0076, - vadeva: 0x0935, - vagujarati: 0x0AB5, - vagurmukhi: 0x0A35, - vakatakana: 0x30F7, - vav: 0x05D5, - vavdagesh: 0xFB35, - vavdagesh65: 0xFB35, - vavdageshhebrew: 0xFB35, - vavhebrew: 0x05D5, - vavholam: 0xFB4B, - vavholamhebrew: 0xFB4B, - vavvavhebrew: 0x05F0, - vavyodhebrew: 0x05F1, - vcircle: 0x24E5, - vdotbelow: 0x1E7F, - vecyrillic: 0x0432, - veharabic: 0x06A4, - vehfinalarabic: 0xFB6B, - vehinitialarabic: 0xFB6C, - vehmedialarabic: 0xFB6D, - vekatakana: 0x30F9, - venus: 0x2640, - verticalbar: 0x007C, - verticallineabovecmb: 0x030D, - verticallinebelowcmb: 0x0329, - verticallinelowmod: 0x02CC, - verticallinemod: 0x02C8, - vewarmenian: 0x057E, - vhook: 0x028B, - vikatakana: 0x30F8, - viramabengali: 0x09CD, - viramadeva: 0x094D, - viramagujarati: 0x0ACD, - visargabengali: 0x0983, - visargadeva: 0x0903, - visargagujarati: 0x0A83, - vmonospace: 0xFF56, - voarmenian: 0x0578, - voicediterationhiragana: 0x309E, - voicediterationkatakana: 0x30FE, - voicedmarkkana: 0x309B, - voicedmarkkanahalfwidth: 0xFF9E, - vokatakana: 0x30FA, - vparen: 0x24B1, - vtilde: 0x1E7D, - vturned: 0x028C, - vuhiragana: 0x3094, - vukatakana: 0x30F4, - w: 0x0077, - wacute: 0x1E83, - waekorean: 0x3159, - wahiragana: 0x308F, - wakatakana: 0x30EF, - wakatakanahalfwidth: 0xFF9C, - wakorean: 0x3158, - wasmallhiragana: 0x308E, - wasmallkatakana: 0x30EE, - wattosquare: 0x3357, - wavedash: 0x301C, - wavyunderscorevertical: 0xFE34, - wawarabic: 0x0648, - wawfinalarabic: 0xFEEE, - wawhamzaabovearabic: 0x0624, - wawhamzaabovefinalarabic: 0xFE86, - wbsquare: 0x33DD, - wcircle: 0x24E6, - wcircumflex: 0x0175, - wdieresis: 0x1E85, - wdotaccent: 0x1E87, - wdotbelow: 0x1E89, - wehiragana: 0x3091, - weierstrass: 0x2118, - wekatakana: 0x30F1, - wekorean: 0x315E, - weokorean: 0x315D, - wgrave: 0x1E81, - whitebullet: 0x25E6, - whitecircle: 0x25CB, - whitecircleinverse: 0x25D9, - whitecornerbracketleft: 0x300E, - whitecornerbracketleftvertical: 0xFE43, - whitecornerbracketright: 0x300F, - whitecornerbracketrightvertical: 0xFE44, - whitediamond: 0x25C7, - whitediamondcontainingblacksmalldiamond: 0x25C8, - whitedownpointingsmalltriangle: 0x25BF, - whitedownpointingtriangle: 0x25BD, - whiteleftpointingsmalltriangle: 0x25C3, - whiteleftpointingtriangle: 0x25C1, - whitelenticularbracketleft: 0x3016, - whitelenticularbracketright: 0x3017, - whiterightpointingsmalltriangle: 0x25B9, - whiterightpointingtriangle: 0x25B7, - whitesmallsquare: 0x25AB, - whitesmilingface: 0x263A, - whitesquare: 0x25A1, - whitestar: 0x2606, - whitetelephone: 0x260F, - whitetortoiseshellbracketleft: 0x3018, - whitetortoiseshellbracketright: 0x3019, - whiteuppointingsmalltriangle: 0x25B5, - whiteuppointingtriangle: 0x25B3, - wihiragana: 0x3090, - wikatakana: 0x30F0, - wikorean: 0x315F, - wmonospace: 0xFF57, - wohiragana: 0x3092, - wokatakana: 0x30F2, - wokatakanahalfwidth: 0xFF66, - won: 0x20A9, - wonmonospace: 0xFFE6, - wowaenthai: 0x0E27, - wparen: 0x24B2, - wring: 0x1E98, - wsuperior: 0x02B7, - wturned: 0x028D, - wynn: 0x01BF, - x: 0x0078, - xabovecmb: 0x033D, - xbopomofo: 0x3112, - xcircle: 0x24E7, - xdieresis: 0x1E8D, - xdotaccent: 0x1E8B, - xeharmenian: 0x056D, - xi: 0x03BE, - xmonospace: 0xFF58, - xparen: 0x24B3, - xsuperior: 0x02E3, - y: 0x0079, - yaadosquare: 0x334E, - yabengali: 0x09AF, - yacute: 0x00FD, - yadeva: 0x092F, - yaekorean: 0x3152, - yagujarati: 0x0AAF, - yagurmukhi: 0x0A2F, - yahiragana: 0x3084, - yakatakana: 0x30E4, - yakatakanahalfwidth: 0xFF94, - yakorean: 0x3151, - yamakkanthai: 0x0E4E, - yasmallhiragana: 0x3083, - yasmallkatakana: 0x30E3, - yasmallkatakanahalfwidth: 0xFF6C, - yatcyrillic: 0x0463, - ycircle: 0x24E8, - ycircumflex: 0x0177, - ydieresis: 0x00FF, - ydotaccent: 0x1E8F, - ydotbelow: 0x1EF5, - yeharabic: 0x064A, - yehbarreearabic: 0x06D2, - yehbarreefinalarabic: 0xFBAF, - yehfinalarabic: 0xFEF2, - yehhamzaabovearabic: 0x0626, - yehhamzaabovefinalarabic: 0xFE8A, - yehhamzaaboveinitialarabic: 0xFE8B, - yehhamzaabovemedialarabic: 0xFE8C, - yehinitialarabic: 0xFEF3, - yehmedialarabic: 0xFEF4, - yehmeeminitialarabic: 0xFCDD, - yehmeemisolatedarabic: 0xFC58, - yehnoonfinalarabic: 0xFC94, - yehthreedotsbelowarabic: 0x06D1, - yekorean: 0x3156, - yen: 0x00A5, - yenmonospace: 0xFFE5, - yeokorean: 0x3155, - yeorinhieuhkorean: 0x3186, - yerahbenyomohebrew: 0x05AA, - yerahbenyomolefthebrew: 0x05AA, - yericyrillic: 0x044B, - yerudieresiscyrillic: 0x04F9, - yesieungkorean: 0x3181, - yesieungpansioskorean: 0x3183, - yesieungsioskorean: 0x3182, - yetivhebrew: 0x059A, - ygrave: 0x1EF3, - yhook: 0x01B4, - yhookabove: 0x1EF7, - yiarmenian: 0x0575, - yicyrillic: 0x0457, - yikorean: 0x3162, - yinyang: 0x262F, - yiwnarmenian: 0x0582, - ymonospace: 0xFF59, - yod: 0x05D9, - yoddagesh: 0xFB39, - yoddageshhebrew: 0xFB39, - yodhebrew: 0x05D9, - yodyodhebrew: 0x05F2, - yodyodpatahhebrew: 0xFB1F, - yohiragana: 0x3088, - yoikorean: 0x3189, - yokatakana: 0x30E8, - yokatakanahalfwidth: 0xFF96, - yokorean: 0x315B, - yosmallhiragana: 0x3087, - yosmallkatakana: 0x30E7, - yosmallkatakanahalfwidth: 0xFF6E, - yotgreek: 0x03F3, - yoyaekorean: 0x3188, - yoyakorean: 0x3187, - yoyakthai: 0x0E22, - yoyingthai: 0x0E0D, - yparen: 0x24B4, - ypogegrammeni: 0x037A, - ypogegrammenigreekcmb: 0x0345, - yr: 0x01A6, - yring: 0x1E99, - ysuperior: 0x02B8, - ytilde: 0x1EF9, - yturned: 0x028E, - yuhiragana: 0x3086, - yuikorean: 0x318C, - yukatakana: 0x30E6, - yukatakanahalfwidth: 0xFF95, - yukorean: 0x3160, - yusbigcyrillic: 0x046B, - yusbigiotifiedcyrillic: 0x046D, - yuslittlecyrillic: 0x0467, - yuslittleiotifiedcyrillic: 0x0469, - yusmallhiragana: 0x3085, - yusmallkatakana: 0x30E5, - yusmallkatakanahalfwidth: 0xFF6D, - yuyekorean: 0x318B, - yuyeokorean: 0x318A, - yyabengali: 0x09DF, - yyadeva: 0x095F, - z: 0x007A, - zaarmenian: 0x0566, - zacute: 0x017A, - zadeva: 0x095B, - zagurmukhi: 0x0A5B, - zaharabic: 0x0638, - zahfinalarabic: 0xFEC6, - zahinitialarabic: 0xFEC7, - zahiragana: 0x3056, - zahmedialarabic: 0xFEC8, - zainarabic: 0x0632, - zainfinalarabic: 0xFEB0, - zakatakana: 0x30B6, - zaqefgadolhebrew: 0x0595, - zaqefqatanhebrew: 0x0594, - zarqahebrew: 0x0598, - zayin: 0x05D6, - zayindagesh: 0xFB36, - zayindageshhebrew: 0xFB36, - zayinhebrew: 0x05D6, - zbopomofo: 0x3117, - zcaron: 0x017E, - zcircle: 0x24E9, - zcircumflex: 0x1E91, - zcurl: 0x0291, - zdot: 0x017C, - zdotaccent: 0x017C, - zdotbelow: 0x1E93, - zecyrillic: 0x0437, - zedescendercyrillic: 0x0499, - zedieresiscyrillic: 0x04DF, - zehiragana: 0x305C, - zekatakana: 0x30BC, - zero: 0x0030, - zeroarabic: 0x0660, - zerobengali: 0x09E6, - zerodeva: 0x0966, - zerogujarati: 0x0AE6, - zerogurmukhi: 0x0A66, - zerohackarabic: 0x0660, - zeroinferior: 0x2080, - zeromonospace: 0xFF10, - zerooldstyle: 0xF730, - zeropersian: 0x06F0, - zerosuperior: 0x2070, - zerothai: 0x0E50, - zerowidthjoiner: 0xFEFF, - zerowidthnonjoiner: 0x200C, - zerowidthspace: 0x200B, - zeta: 0x03B6, - zhbopomofo: 0x3113, - zhearmenian: 0x056A, - zhebrevecyrillic: 0x04C2, - zhecyrillic: 0x0436, - zhedescendercyrillic: 0x0497, - zhedieresiscyrillic: 0x04DD, - zihiragana: 0x3058, - zikatakana: 0x30B8, - zinorhebrew: 0x05AE, - zlinebelow: 0x1E95, - zmonospace: 0xFF5A, - zohiragana: 0x305E, - zokatakana: 0x30BE, - zparen: 0x24B5, - zretroflexhook: 0x0290, - zstroke: 0x01B6, - zuhiragana: 0x305A, - zukatakana: 0x30BA, - '.notdef': 0x0000 -}; - -var DingbatsGlyphsUnicode = { - space: 0x0020, - a1: 0x2701, - a2: 0x2702, - a202: 0x2703, - a3: 0x2704, - a4: 0x260E, - a5: 0x2706, - a119: 0x2707, - a118: 0x2708, - a117: 0x2709, - a11: 0x261B, - a12: 0x261E, - a13: 0x270C, - a14: 0x270D, - a15: 0x270E, - a16: 0x270F, - a105: 0x2710, - a17: 0x2711, - a18: 0x2712, - a19: 0x2713, - a20: 0x2714, - a21: 0x2715, - a22: 0x2716, - a23: 0x2717, - a24: 0x2718, - a25: 0x2719, - a26: 0x271A, - a27: 0x271B, - a28: 0x271C, - a6: 0x271D, - a7: 0x271E, - a8: 0x271F, - a9: 0x2720, - a10: 0x2721, - a29: 0x2722, - a30: 0x2723, - a31: 0x2724, - a32: 0x2725, - a33: 0x2726, - a34: 0x2727, - a35: 0x2605, - a36: 0x2729, - a37: 0x272A, - a38: 0x272B, - a39: 0x272C, - a40: 0x272D, - a41: 0x272E, - a42: 0x272F, - a43: 0x2730, - a44: 0x2731, - a45: 0x2732, - a46: 0x2733, - a47: 0x2734, - a48: 0x2735, - a49: 0x2736, - a50: 0x2737, - a51: 0x2738, - a52: 0x2739, - a53: 0x273A, - a54: 0x273B, - a55: 0x273C, - a56: 0x273D, - a57: 0x273E, - a58: 0x273F, - a59: 0x2740, - a60: 0x2741, - a61: 0x2742, - a62: 0x2743, - a63: 0x2744, - a64: 0x2745, - a65: 0x2746, - a66: 0x2747, - a67: 0x2748, - a68: 0x2749, - a69: 0x274A, - a70: 0x274B, - a71: 0x25CF, - a72: 0x274D, - a73: 0x25A0, - a74: 0x274F, - a203: 0x2750, - a75: 0x2751, - a204: 0x2752, - a76: 0x25B2, - a77: 0x25BC, - a78: 0x25C6, - a79: 0x2756, - a81: 0x25D7, - a82: 0x2758, - a83: 0x2759, - a84: 0x275A, - a97: 0x275B, - a98: 0x275C, - a99: 0x275D, - a100: 0x275E, - a101: 0x2761, - a102: 0x2762, - a103: 0x2763, - a104: 0x2764, - a106: 0x2765, - a107: 0x2766, - a108: 0x2767, - a112: 0x2663, - a111: 0x2666, - a110: 0x2665, - a109: 0x2660, - a120: 0x2460, - a121: 0x2461, - a122: 0x2462, - a123: 0x2463, - a124: 0x2464, - a125: 0x2465, - a126: 0x2466, - a127: 0x2467, - a128: 0x2468, - a129: 0x2469, - a130: 0x2776, - a131: 0x2777, - a132: 0x2778, - a133: 0x2779, - a134: 0x277A, - a135: 0x277B, - a136: 0x277C, - a137: 0x277D, - a138: 0x277E, - a139: 0x277F, - a140: 0x2780, - a141: 0x2781, - a142: 0x2782, - a143: 0x2783, - a144: 0x2784, - a145: 0x2785, - a146: 0x2786, - a147: 0x2787, - a148: 0x2788, - a149: 0x2789, - a150: 0x278A, - a151: 0x278B, - a152: 0x278C, - a153: 0x278D, - a154: 0x278E, - a155: 0x278F, - a156: 0x2790, - a157: 0x2791, - a158: 0x2792, - a159: 0x2793, - a160: 0x2794, - a161: 0x2192, - a163: 0x2194, - a164: 0x2195, - a196: 0x2798, - a165: 0x2799, - a192: 0x279A, - a166: 0x279B, - a167: 0x279C, - a168: 0x279D, - a169: 0x279E, - a170: 0x279F, - a171: 0x27A0, - a172: 0x27A1, - a173: 0x27A2, - a162: 0x27A3, - a174: 0x27A4, - a175: 0x27A5, - a176: 0x27A6, - a177: 0x27A7, - a178: 0x27A8, - a179: 0x27A9, - a193: 0x27AA, - a180: 0x27AB, - a199: 0x27AC, - a181: 0x27AD, - a200: 0x27AE, - a182: 0x27AF, - a201: 0x27B1, - a183: 0x27B2, - a184: 0x27B3, - a197: 0x27B4, - a185: 0x27B5, - a194: 0x27B6, - a198: 0x27B7, - a186: 0x27B8, - a195: 0x27B9, - a187: 0x27BA, - a188: 0x27BB, - a189: 0x27BC, - a190: 0x27BD, - a191: 0x27BE, - a89: 0x2768, // 0xF8D7 - a90: 0x2769, // 0xF8D8 - a93: 0x276A, // 0xF8D9 - a94: 0x276B, // 0xF8DA - a91: 0x276C, // 0xF8DB - a92: 0x276D, // 0xF8DC - a205: 0x276E, // 0xF8DD - a85: 0x276F, // 0xF8DE - a206: 0x2770, // 0xF8DF - a86: 0x2771, // 0xF8E0 - a87: 0x2772, // 0xF8E1 - a88: 0x2773, // 0xF8E2 - a95: 0x2774, // 0xF8E3 - a96: 0x2775, // 0xF8E4 - '.notdef': 0x0000 -}; - - -var PDFImage = (function PDFImageClosure() { - /** - * Decode the image in the main thread if it supported. Resovles the promise - * when the image data is ready. - */ - function handleImageData(handler, xref, res, image) { - if (image instanceof JpegStream && image.isNativelyDecodable(xref, res)) { - // For natively supported jpegs send them to the main thread for decoding. - var dict = image.dict; - var colorSpace = dict.get('ColorSpace', 'CS'); - colorSpace = ColorSpace.parse(colorSpace, xref, res); - var numComps = colorSpace.numComps; - var decodePromise = handler.sendWithPromise('JpegDecode', - [image.getIR(), numComps]); - return decodePromise.then(function (message) { - var data = message.data; - return new Stream(data, 0, data.length, image.dict); - }); - } else { - return Promise.resolve(image); - } - } - - /** - * Decode and clamp a value. The formula is different from the spec because we - * don't decode to float range [0,1], we decode it in the [0,max] range. - */ - function decodeAndClamp(value, addend, coefficient, max) { - value = addend + value * coefficient; - // Clamp the value to the range - return (value < 0 ? 0 : (value > max ? max : value)); - } - - function PDFImage(xref, res, image, inline, smask, mask, isMask) { - this.image = image; - var dict = image.dict; - if (dict.has('Filter')) { - var filter = dict.get('Filter').name; - if (filter === 'JPXDecode') { - var jpxImage = new JpxImage(); - jpxImage.parseImageProperties(image.stream); - image.stream.reset(); - image.bitsPerComponent = jpxImage.bitsPerComponent; - image.numComps = jpxImage.componentsCount; - } else if (filter === 'JBIG2Decode') { - image.bitsPerComponent = 1; - image.numComps = 1; - } - } - // TODO cache rendered images? - - this.width = dict.get('Width', 'W'); - this.height = dict.get('Height', 'H'); - - if (this.width < 1 || this.height < 1) { - error('Invalid image width: ' + this.width + ' or height: ' + - this.height); - } - - this.interpolate = dict.get('Interpolate', 'I') || false; - this.imageMask = dict.get('ImageMask', 'IM') || false; - this.matte = dict.get('Matte') || false; - - var bitsPerComponent = image.bitsPerComponent; - if (!bitsPerComponent) { - bitsPerComponent = dict.get('BitsPerComponent', 'BPC'); - if (!bitsPerComponent) { - if (this.imageMask) { - bitsPerComponent = 1; - } else { - error('Bits per component missing in image: ' + this.imageMask); - } - } - } - this.bpc = bitsPerComponent; - - if (!this.imageMask) { - var colorSpace = dict.get('ColorSpace', 'CS'); - if (!colorSpace) { - info('JPX images (which do not require color spaces)'); - switch (image.numComps) { - case 1: - colorSpace = Name.get('DeviceGray'); - break; - case 3: - colorSpace = Name.get('DeviceRGB'); - break; - case 4: - colorSpace = Name.get('DeviceCMYK'); - break; - default: - error('JPX images with ' + this.numComps + - ' color components not supported.'); - } - } - this.colorSpace = ColorSpace.parse(colorSpace, xref, res); - this.numComps = this.colorSpace.numComps; - } - - this.decode = dict.get('Decode', 'D'); - this.needsDecode = false; - if (this.decode && - ((this.colorSpace && !this.colorSpace.isDefaultDecode(this.decode)) || - (isMask && !ColorSpace.isDefaultDecode(this.decode, 1)))) { - this.needsDecode = true; - // Do some preprocessing to avoid more math. - var max = (1 << bitsPerComponent) - 1; - this.decodeCoefficients = []; - this.decodeAddends = []; - for (var i = 0, j = 0; i < this.decode.length; i += 2, ++j) { - var dmin = this.decode[i]; - var dmax = this.decode[i + 1]; - this.decodeCoefficients[j] = dmax - dmin; - this.decodeAddends[j] = max * dmin; - } - } - - if (smask) { - this.smask = new PDFImage(xref, res, smask, false); - } else if (mask) { - if (isStream(mask)) { - var maskDict = mask.dict, imageMask = maskDict.get('ImageMask', 'IM'); - if (!imageMask) { - warn('Ignoring /Mask in image without /ImageMask.'); - } else { - this.mask = new PDFImage(xref, res, mask, false, null, null, true); - } - } else { - // Color key mask (just an array). - this.mask = mask; - } - } - } - /** - * Handles processing of image data and returns the Promise that is resolved - * with a PDFImage when the image is ready to be used. - */ - PDFImage.buildImage = function PDFImage_buildImage(handler, xref, - res, image, inline) { - var imagePromise = handleImageData(handler, xref, res, image); - var smaskPromise; - var maskPromise; - - var smask = image.dict.get('SMask'); - var mask = image.dict.get('Mask'); - - if (smask) { - smaskPromise = handleImageData(handler, xref, res, smask); - maskPromise = Promise.resolve(null); - } else { - smaskPromise = Promise.resolve(null); - if (mask) { - if (isStream(mask)) { - maskPromise = handleImageData(handler, xref, res, mask); - } else if (isArray(mask)) { - maskPromise = Promise.resolve(mask); - } else { - warn('Unsupported mask format.'); - maskPromise = Promise.resolve(null); - } - } else { - maskPromise = Promise.resolve(null); - } - } - return Promise.all([imagePromise, smaskPromise, maskPromise]).then( - function(results) { - var imageData = results[0]; - var smaskData = results[1]; - var maskData = results[2]; - return new PDFImage(xref, res, imageData, inline, smaskData, maskData); - }); - }; - - /** - * Resize an image using the nearest neighbor algorithm. Currently only - * supports one and three component images. - * @param {TypedArray} pixels The original image with one component. - * @param {Number} bpc Number of bits per component. - * @param {Number} components Number of color components, 1 or 3 is supported. - * @param {Number} w1 Original width. - * @param {Number} h1 Original height. - * @param {Number} w2 New width. - * @param {Number} h2 New height. - * @param {TypedArray} dest (Optional) The destination buffer. - * @param {Number} alpha01 (Optional) Size reserved for the alpha channel. - * @return {TypedArray} Resized image data. - */ - PDFImage.resize = function PDFImage_resize(pixels, bpc, components, - w1, h1, w2, h2, dest, alpha01) { - - if (components !== 1 && components !== 3) { - error('Unsupported component count for resizing.'); - } - - var length = w2 * h2 * components; - var temp = dest ? dest : (bpc <= 8 ? new Uint8Array(length) : - (bpc <= 16 ? new Uint16Array(length) : new Uint32Array(length))); - var xRatio = w1 / w2; - var yRatio = h1 / h2; - var i, j, py, newIndex = 0, oldIndex; - var xScaled = new Uint16Array(w2); - var w1Scanline = w1 * components; - if (alpha01 !== 1) { - alpha01 = 0; - } - - for (j = 0; j < w2; j++) { - xScaled[j] = Math.floor(j * xRatio) * components; - } - - if (components === 1) { - for (i = 0; i < h2; i++) { - py = Math.floor(i * yRatio) * w1Scanline; - for (j = 0; j < w2; j++) { - oldIndex = py + xScaled[j]; - temp[newIndex++] = pixels[oldIndex]; - } - } - } else if (components === 3) { - for (i = 0; i < h2; i++) { - py = Math.floor(i * yRatio) * w1Scanline; - for (j = 0; j < w2; j++) { - oldIndex = py + xScaled[j]; - temp[newIndex++] = pixels[oldIndex++]; - temp[newIndex++] = pixels[oldIndex++]; - temp[newIndex++] = pixels[oldIndex++]; - newIndex += alpha01; - } - } - } - return temp; - }; - - PDFImage.createMask = - function PDFImage_createMask(imgArray, width, height, - imageIsFromDecodeStream, inverseDecode) { - - // |imgArray| might not contain full data for every pixel of the mask, so - // we need to distinguish between |computedLength| and |actualLength|. - // In particular, if inverseDecode is true, then the array we return must - // have a length of |computedLength|. - - var computedLength = ((width + 7) >> 3) * height; - var actualLength = imgArray.byteLength; - var haveFullData = computedLength === actualLength; - var data, i; - - if (imageIsFromDecodeStream && (!inverseDecode || haveFullData)) { - // imgArray came from a DecodeStream and its data is in an appropriate - // form, so we can just transfer it. - data = imgArray; - } else if (!inverseDecode) { - data = new Uint8Array(actualLength); - data.set(imgArray); - } else { - data = new Uint8Array(computedLength); - data.set(imgArray); - for (i = actualLength; i < computedLength; i++) { - data[i] = 0xff; - } - } - - // If necessary, invert the original mask data (but not any extra we might - // have added above). It's safe to modify the array -- whether it's the - // original or a copy, we're about to transfer it anyway, so nothing else - // in this thread can be relying on its contents. - if (inverseDecode) { - for (i = 0; i < actualLength; i++) { - data[i] = ~data[i]; - } - } - - return {data: data, width: width, height: height}; - }; - - PDFImage.prototype = { - get drawWidth() { - return Math.max(this.width, - this.smask && this.smask.width || 0, - this.mask && this.mask.width || 0); - }, - - get drawHeight() { - return Math.max(this.height, - this.smask && this.smask.height || 0, - this.mask && this.mask.height || 0); - }, - - decodeBuffer: function PDFImage_decodeBuffer(buffer) { - var bpc = this.bpc; - var numComps = this.numComps; - - var decodeAddends = this.decodeAddends; - var decodeCoefficients = this.decodeCoefficients; - var max = (1 << bpc) - 1; - var i, ii; - - if (bpc === 1) { - // If the buffer needed decode that means it just needs to be inverted. - for (i = 0, ii = buffer.length; i < ii; i++) { - buffer[i] = +!(buffer[i]); - } - return; - } - var index = 0; - for (i = 0, ii = this.width * this.height; i < ii; i++) { - for (var j = 0; j < numComps; j++) { - buffer[index] = decodeAndClamp(buffer[index], decodeAddends[j], - decodeCoefficients[j], max); - index++; - } - } - }, - - getComponents: function PDFImage_getComponents(buffer) { - var bpc = this.bpc; - - // This image doesn't require any extra work. - if (bpc === 8) { - return buffer; - } - - var width = this.width; - var height = this.height; - var numComps = this.numComps; - - var length = width * height * numComps; - var bufferPos = 0; - var output = (bpc <= 8 ? new Uint8Array(length) : - (bpc <= 16 ? new Uint16Array(length) : new Uint32Array(length))); - var rowComps = width * numComps; - - var max = (1 << bpc) - 1; - var i = 0, ii, buf; - - if (bpc === 1) { - // Optimization for reading 1 bpc images. - var mask, loop1End, loop2End; - for (var j = 0; j < height; j++) { - loop1End = i + (rowComps & ~7); - loop2End = i + rowComps; - - // unroll loop for all full bytes - while (i < loop1End) { - buf = buffer[bufferPos++]; - output[i] = (buf >> 7) & 1; - output[i + 1] = (buf >> 6) & 1; - output[i + 2] = (buf >> 5) & 1; - output[i + 3] = (buf >> 4) & 1; - output[i + 4] = (buf >> 3) & 1; - output[i + 5] = (buf >> 2) & 1; - output[i + 6] = (buf >> 1) & 1; - output[i + 7] = buf & 1; - i += 8; - } - - // handle remaing bits - if (i < loop2End) { - buf = buffer[bufferPos++]; - mask = 128; - while (i < loop2End) { - output[i++] = +!!(buf & mask); - mask >>= 1; - } - } - } - } else { - // The general case that handles all other bpc values. - var bits = 0; - buf = 0; - for (i = 0, ii = length; i < ii; ++i) { - if (i % rowComps === 0) { - buf = 0; - bits = 0; - } - - while (bits < bpc) { - buf = (buf << 8) | buffer[bufferPos++]; - bits += 8; - } - - var remainingBits = bits - bpc; - var value = buf >> remainingBits; - output[i] = (value < 0 ? 0 : (value > max ? max : value)); - buf = buf & ((1 << remainingBits) - 1); - bits = remainingBits; - } - } - return output; - }, - - fillOpacity: function PDFImage_fillOpacity(rgbaBuf, width, height, - actualHeight, image) { - var smask = this.smask; - var mask = this.mask; - var alphaBuf, sw, sh, i, ii, j; - - if (smask) { - sw = smask.width; - sh = smask.height; - alphaBuf = new Uint8Array(sw * sh); - smask.fillGrayBuffer(alphaBuf); - if (sw !== width || sh !== height) { - alphaBuf = PDFImage.resize(alphaBuf, smask.bpc, 1, sw, sh, width, - height); - } - } else if (mask) { - if (mask instanceof PDFImage) { - sw = mask.width; - sh = mask.height; - alphaBuf = new Uint8Array(sw * sh); - mask.numComps = 1; - mask.fillGrayBuffer(alphaBuf); - - // Need to invert values in rgbaBuf - for (i = 0, ii = sw * sh; i < ii; ++i) { - alphaBuf[i] = 255 - alphaBuf[i]; - } - - if (sw !== width || sh !== height) { - alphaBuf = PDFImage.resize(alphaBuf, mask.bpc, 1, sw, sh, width, - height); - } - } else if (isArray(mask)) { - // Color key mask: if any of the compontents are outside the range - // then they should be painted. - alphaBuf = new Uint8Array(width * height); - var numComps = this.numComps; - for (i = 0, ii = width * height; i < ii; ++i) { - var opacity = 0; - var imageOffset = i * numComps; - for (j = 0; j < numComps; ++j) { - var color = image[imageOffset + j]; - var maskOffset = j * 2; - if (color < mask[maskOffset] || color > mask[maskOffset + 1]) { - opacity = 255; - break; - } - } - alphaBuf[i] = opacity; - } - } else { - error('Unknown mask format.'); - } - } - - if (alphaBuf) { - for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { - rgbaBuf[j] = alphaBuf[i]; - } - } else { - // No mask. - for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { - rgbaBuf[j] = 255; - } - } - }, - - undoPreblend: function PDFImage_undoPreblend(buffer, width, height) { - var matte = this.smask && this.smask.matte; - if (!matte) { - return; - } - var matteRgb = this.colorSpace.getRgb(matte, 0); - var matteR = matteRgb[0]; - var matteG = matteRgb[1]; - var matteB = matteRgb[2]; - var length = width * height * 4; - var r, g, b; - for (var i = 0; i < length; i += 4) { - var alpha = buffer[i + 3]; - if (alpha === 0) { - // according formula we have to get Infinity in all components - // making it white (typical paper color) should be okay - buffer[i] = 255; - buffer[i + 1] = 255; - buffer[i + 2] = 255; - continue; - } - var k = 255 / alpha; - r = (buffer[i] - matteR) * k + matteR; - g = (buffer[i + 1] - matteG) * k + matteG; - b = (buffer[i + 2] - matteB) * k + matteB; - buffer[i] = r <= 0 ? 0 : r >= 255 ? 255 : r | 0; - buffer[i + 1] = g <= 0 ? 0 : g >= 255 ? 255 : g | 0; - buffer[i + 2] = b <= 0 ? 0 : b >= 255 ? 255 : b | 0; - } - }, - - createImageData: function PDFImage_createImageData(forceRGBA) { - var drawWidth = this.drawWidth; - var drawHeight = this.drawHeight; - var imgData = { // other fields are filled in below - width: drawWidth, - height: drawHeight - }; - - var numComps = this.numComps; - var originalWidth = this.width; - var originalHeight = this.height; - var bpc = this.bpc; - - // Rows start at byte boundary. - var rowBytes = (originalWidth * numComps * bpc + 7) >> 3; - var imgArray; - - if (!forceRGBA) { - // If it is a 1-bit-per-pixel grayscale (i.e. black-and-white) image - // without any complications, we pass a same-sized copy to the main - // thread rather than expanding by 32x to RGBA form. This saves *lots* - // of memory for many scanned documents. It's also much faster. - // - // Similarly, if it is a 24-bit-per pixel RGB image without any - // complications, we avoid expanding by 1.333x to RGBA form. - var kind; - if (this.colorSpace.name === 'DeviceGray' && bpc === 1) { - kind = ImageKind.GRAYSCALE_1BPP; - } else if (this.colorSpace.name === 'DeviceRGB' && bpc === 8 && - !this.needsDecode) { - kind = ImageKind.RGB_24BPP; - } - if (kind && !this.smask && !this.mask && - drawWidth === originalWidth && drawHeight === originalHeight) { - imgData.kind = kind; - - imgArray = this.getImageBytes(originalHeight * rowBytes); - // If imgArray came from a DecodeStream, we're safe to transfer it - // (and thus neuter it) because it will constitute the entire - // DecodeStream's data. But if it came from a Stream, we need to - // copy it because it'll only be a portion of the Stream's data, and - // the rest will be read later on. - if (this.image instanceof DecodeStream) { - imgData.data = imgArray; - } else { - var newArray = new Uint8Array(imgArray.length); - newArray.set(imgArray); - imgData.data = newArray; - } - if (this.needsDecode) { - // Invert the buffer (which must be grayscale if we reached here). - assert(kind === ImageKind.GRAYSCALE_1BPP); - var buffer = imgData.data; - for (var i = 0, ii = buffer.length; i < ii; i++) { - buffer[i] ^= 0xff; - } - } - return imgData; - } - if (this.image instanceof JpegStream && !this.smask && !this.mask && - (this.colorSpace.name === 'DeviceGray' || - this.colorSpace.name === 'DeviceRGB' || - this.colorSpace.name === 'DeviceCMYK')) { - imgData.kind = ImageKind.RGB_24BPP; - imgData.data = this.getImageBytes(originalHeight * rowBytes, - drawWidth, drawHeight, true); - return imgData; - } - } - - imgArray = this.getImageBytes(originalHeight * rowBytes); - // imgArray can be incomplete (e.g. after CCITT fax encoding). - var actualHeight = 0 | (imgArray.length / rowBytes * - drawHeight / originalHeight); - - var comps = this.getComponents(imgArray); - - // If opacity data is present, use RGBA_32BPP form. Otherwise, use the - // more compact RGB_24BPP form if allowable. - var alpha01, maybeUndoPreblend; - if (!forceRGBA && !this.smask && !this.mask) { - imgData.kind = ImageKind.RGB_24BPP; - imgData.data = new Uint8Array(drawWidth * drawHeight * 3); - alpha01 = 0; - maybeUndoPreblend = false; - } else { - imgData.kind = ImageKind.RGBA_32BPP; - imgData.data = new Uint8Array(drawWidth * drawHeight * 4); - alpha01 = 1; - maybeUndoPreblend = true; - - // Color key masking (opacity) must be performed before decoding. - this.fillOpacity(imgData.data, drawWidth, drawHeight, actualHeight, - comps); - } - - if (this.needsDecode) { - this.decodeBuffer(comps); - } - this.colorSpace.fillRgb(imgData.data, originalWidth, originalHeight, - drawWidth, drawHeight, actualHeight, bpc, comps, - alpha01); - if (maybeUndoPreblend) { - this.undoPreblend(imgData.data, drawWidth, actualHeight); - } - - return imgData; - }, - - fillGrayBuffer: function PDFImage_fillGrayBuffer(buffer) { - var numComps = this.numComps; - if (numComps !== 1) { - error('Reading gray scale from a color image: ' + numComps); - } - - var width = this.width; - var height = this.height; - var bpc = this.bpc; - - // rows start at byte boundary - var rowBytes = (width * numComps * bpc + 7) >> 3; - var imgArray = this.getImageBytes(height * rowBytes); - - var comps = this.getComponents(imgArray); - var i, length; - - if (bpc === 1) { - // inline decoding (= inversion) for 1 bpc images - length = width * height; - if (this.needsDecode) { - // invert and scale to {0, 255} - for (i = 0; i < length; ++i) { - buffer[i] = (comps[i] - 1) & 255; - } - } else { - // scale to {0, 255} - for (i = 0; i < length; ++i) { - buffer[i] = (-comps[i]) & 255; - } - } - return; - } - - if (this.needsDecode) { - this.decodeBuffer(comps); - } - length = width * height; - // we aren't using a colorspace so we need to scale the value - var scale = 255 / ((1 << bpc) - 1); - for (i = 0; i < length; ++i) { - buffer[i] = (scale * comps[i]) | 0; - } - }, - - getImageBytes: function PDFImage_getImageBytes(length, - drawWidth, drawHeight, - forceRGB) { - this.image.reset(); - this.image.drawWidth = drawWidth || this.width; - this.image.drawHeight = drawHeight || this.height; - this.image.forceRGB = !!forceRGB; - return this.image.getBytes(length); - } - }; - return PDFImage; -})(); - - -// The Metrics object contains glyph widths (in glyph space units). -// As per PDF spec, for most fonts (Type 3 being an exception) a glyph -// space unit corresponds to 1/1000th of text space unit. -var Metrics = { - 'Courier': 600, - 'Courier-Bold': 600, - 'Courier-BoldOblique': 600, - 'Courier-Oblique': 600, - 'Helvetica' : { - 'space': 278, - 'exclam': 278, - 'quotedbl': 355, - 'numbersign': 556, - 'dollar': 556, - 'percent': 889, - 'ampersand': 667, - 'quoteright': 222, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 389, - 'plus': 584, - 'comma': 278, - 'hyphen': 333, - 'period': 278, - 'slash': 278, - 'zero': 556, - 'one': 556, - 'two': 556, - 'three': 556, - 'four': 556, - 'five': 556, - 'six': 556, - 'seven': 556, - 'eight': 556, - 'nine': 556, - 'colon': 278, - 'semicolon': 278, - 'less': 584, - 'equal': 584, - 'greater': 584, - 'question': 556, - 'at': 1015, - 'A': 667, - 'B': 667, - 'C': 722, - 'D': 722, - 'E': 667, - 'F': 611, - 'G': 778, - 'H': 722, - 'I': 278, - 'J': 500, - 'K': 667, - 'L': 556, - 'M': 833, - 'N': 722, - 'O': 778, - 'P': 667, - 'Q': 778, - 'R': 722, - 'S': 667, - 'T': 611, - 'U': 722, - 'V': 667, - 'W': 944, - 'X': 667, - 'Y': 667, - 'Z': 611, - 'bracketleft': 278, - 'backslash': 278, - 'bracketright': 278, - 'asciicircum': 469, - 'underscore': 556, - 'quoteleft': 222, - 'a': 556, - 'b': 556, - 'c': 500, - 'd': 556, - 'e': 556, - 'f': 278, - 'g': 556, - 'h': 556, - 'i': 222, - 'j': 222, - 'k': 500, - 'l': 222, - 'm': 833, - 'n': 556, - 'o': 556, - 'p': 556, - 'q': 556, - 'r': 333, - 's': 500, - 't': 278, - 'u': 556, - 'v': 500, - 'w': 722, - 'x': 500, - 'y': 500, - 'z': 500, - 'braceleft': 334, - 'bar': 260, - 'braceright': 334, - 'asciitilde': 584, - 'exclamdown': 333, - 'cent': 556, - 'sterling': 556, - 'fraction': 167, - 'yen': 556, - 'florin': 556, - 'section': 556, - 'currency': 556, - 'quotesingle': 191, - 'quotedblleft': 333, - 'guillemotleft': 556, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 500, - 'fl': 500, - 'endash': 556, - 'dagger': 556, - 'daggerdbl': 556, - 'periodcentered': 278, - 'paragraph': 537, - 'bullet': 350, - 'quotesinglbase': 222, - 'quotedblbase': 333, - 'quotedblright': 333, - 'guillemotright': 556, - 'ellipsis': 1000, - 'perthousand': 1000, - 'questiondown': 611, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 1000, - 'AE': 1000, - 'ordfeminine': 370, - 'Lslash': 556, - 'Oslash': 778, - 'OE': 1000, - 'ordmasculine': 365, - 'ae': 889, - 'dotlessi': 278, - 'lslash': 222, - 'oslash': 611, - 'oe': 944, - 'germandbls': 611, - 'Idieresis': 278, - 'eacute': 556, - 'abreve': 556, - 'uhungarumlaut': 556, - 'ecaron': 556, - 'Ydieresis': 667, - 'divide': 584, - 'Yacute': 667, - 'Acircumflex': 667, - 'aacute': 556, - 'Ucircumflex': 722, - 'yacute': 500, - 'scommaaccent': 500, - 'ecircumflex': 556, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 556, - 'Uacute': 722, - 'uogonek': 556, - 'Edieresis': 667, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 737, - 'Emacron': 667, - 'ccaron': 500, - 'aring': 556, - 'Ncommaaccent': 722, - 'lacute': 222, - 'agrave': 556, - 'Tcommaaccent': 611, - 'Cacute': 722, - 'atilde': 556, - 'Edotaccent': 667, - 'scaron': 500, - 'scedilla': 500, - 'iacute': 278, - 'lozenge': 471, - 'Rcaron': 722, - 'Gcommaaccent': 778, - 'ucircumflex': 556, - 'acircumflex': 556, - 'Amacron': 667, - 'rcaron': 333, - 'ccedilla': 500, - 'Zdotaccent': 611, - 'Thorn': 667, - 'Omacron': 778, - 'Racute': 722, - 'Sacute': 667, - 'dcaron': 643, - 'Umacron': 722, - 'uring': 556, - 'threesuperior': 333, - 'Ograve': 778, - 'Agrave': 667, - 'Abreve': 667, - 'multiply': 584, - 'uacute': 556, - 'Tcaron': 611, - 'partialdiff': 476, - 'ydieresis': 500, - 'Nacute': 722, - 'icircumflex': 278, - 'Ecircumflex': 667, - 'adieresis': 556, - 'edieresis': 556, - 'cacute': 500, - 'nacute': 556, - 'umacron': 556, - 'Ncaron': 722, - 'Iacute': 278, - 'plusminus': 584, - 'brokenbar': 260, - 'registered': 737, - 'Gbreve': 778, - 'Idotaccent': 278, - 'summation': 600, - 'Egrave': 667, - 'racute': 333, - 'omacron': 556, - 'Zacute': 611, - 'Zcaron': 611, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 722, - 'lcommaaccent': 222, - 'tcaron': 317, - 'eogonek': 556, - 'Uogonek': 722, - 'Aacute': 667, - 'Adieresis': 667, - 'egrave': 556, - 'zacute': 500, - 'iogonek': 222, - 'Oacute': 778, - 'oacute': 556, - 'amacron': 556, - 'sacute': 500, - 'idieresis': 278, - 'Ocircumflex': 778, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 556, - 'twosuperior': 333, - 'Odieresis': 778, - 'mu': 556, - 'igrave': 278, - 'ohungarumlaut': 556, - 'Eogonek': 667, - 'dcroat': 556, - 'threequarters': 834, - 'Scedilla': 667, - 'lcaron': 299, - 'Kcommaaccent': 667, - 'Lacute': 556, - 'trademark': 1000, - 'edotaccent': 556, - 'Igrave': 278, - 'Imacron': 278, - 'Lcaron': 556, - 'onehalf': 834, - 'lessequal': 549, - 'ocircumflex': 556, - 'ntilde': 556, - 'Uhungarumlaut': 722, - 'Eacute': 667, - 'emacron': 556, - 'gbreve': 556, - 'onequarter': 834, - 'Scaron': 667, - 'Scommaaccent': 667, - 'Ohungarumlaut': 778, - 'degree': 400, - 'ograve': 556, - 'Ccaron': 722, - 'ugrave': 556, - 'radical': 453, - 'Dcaron': 722, - 'rcommaaccent': 333, - 'Ntilde': 722, - 'otilde': 556, - 'Rcommaaccent': 722, - 'Lcommaaccent': 556, - 'Atilde': 667, - 'Aogonek': 667, - 'Aring': 667, - 'Otilde': 778, - 'zdotaccent': 500, - 'Ecaron': 667, - 'Iogonek': 278, - 'kcommaaccent': 500, - 'minus': 584, - 'Icircumflex': 278, - 'ncaron': 556, - 'tcommaaccent': 278, - 'logicalnot': 584, - 'odieresis': 556, - 'udieresis': 556, - 'notequal': 549, - 'gcommaaccent': 556, - 'eth': 556, - 'zcaron': 500, - 'ncommaaccent': 556, - 'onesuperior': 333, - 'imacron': 278, - 'Euro': 556 - }, - 'Helvetica-Bold': { - 'space': 278, - 'exclam': 333, - 'quotedbl': 474, - 'numbersign': 556, - 'dollar': 556, - 'percent': 889, - 'ampersand': 722, - 'quoteright': 278, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 389, - 'plus': 584, - 'comma': 278, - 'hyphen': 333, - 'period': 278, - 'slash': 278, - 'zero': 556, - 'one': 556, - 'two': 556, - 'three': 556, - 'four': 556, - 'five': 556, - 'six': 556, - 'seven': 556, - 'eight': 556, - 'nine': 556, - 'colon': 333, - 'semicolon': 333, - 'less': 584, - 'equal': 584, - 'greater': 584, - 'question': 611, - 'at': 975, - 'A': 722, - 'B': 722, - 'C': 722, - 'D': 722, - 'E': 667, - 'F': 611, - 'G': 778, - 'H': 722, - 'I': 278, - 'J': 556, - 'K': 722, - 'L': 611, - 'M': 833, - 'N': 722, - 'O': 778, - 'P': 667, - 'Q': 778, - 'R': 722, - 'S': 667, - 'T': 611, - 'U': 722, - 'V': 667, - 'W': 944, - 'X': 667, - 'Y': 667, - 'Z': 611, - 'bracketleft': 333, - 'backslash': 278, - 'bracketright': 333, - 'asciicircum': 584, - 'underscore': 556, - 'quoteleft': 278, - 'a': 556, - 'b': 611, - 'c': 556, - 'd': 611, - 'e': 556, - 'f': 333, - 'g': 611, - 'h': 611, - 'i': 278, - 'j': 278, - 'k': 556, - 'l': 278, - 'm': 889, - 'n': 611, - 'o': 611, - 'p': 611, - 'q': 611, - 'r': 389, - 's': 556, - 't': 333, - 'u': 611, - 'v': 556, - 'w': 778, - 'x': 556, - 'y': 556, - 'z': 500, - 'braceleft': 389, - 'bar': 280, - 'braceright': 389, - 'asciitilde': 584, - 'exclamdown': 333, - 'cent': 556, - 'sterling': 556, - 'fraction': 167, - 'yen': 556, - 'florin': 556, - 'section': 556, - 'currency': 556, - 'quotesingle': 238, - 'quotedblleft': 500, - 'guillemotleft': 556, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 611, - 'fl': 611, - 'endash': 556, - 'dagger': 556, - 'daggerdbl': 556, - 'periodcentered': 278, - 'paragraph': 556, - 'bullet': 350, - 'quotesinglbase': 278, - 'quotedblbase': 500, - 'quotedblright': 500, - 'guillemotright': 556, - 'ellipsis': 1000, - 'perthousand': 1000, - 'questiondown': 611, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 1000, - 'AE': 1000, - 'ordfeminine': 370, - 'Lslash': 611, - 'Oslash': 778, - 'OE': 1000, - 'ordmasculine': 365, - 'ae': 889, - 'dotlessi': 278, - 'lslash': 278, - 'oslash': 611, - 'oe': 944, - 'germandbls': 611, - 'Idieresis': 278, - 'eacute': 556, - 'abreve': 556, - 'uhungarumlaut': 611, - 'ecaron': 556, - 'Ydieresis': 667, - 'divide': 584, - 'Yacute': 667, - 'Acircumflex': 722, - 'aacute': 556, - 'Ucircumflex': 722, - 'yacute': 556, - 'scommaaccent': 556, - 'ecircumflex': 556, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 556, - 'Uacute': 722, - 'uogonek': 611, - 'Edieresis': 667, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 737, - 'Emacron': 667, - 'ccaron': 556, - 'aring': 556, - 'Ncommaaccent': 722, - 'lacute': 278, - 'agrave': 556, - 'Tcommaaccent': 611, - 'Cacute': 722, - 'atilde': 556, - 'Edotaccent': 667, - 'scaron': 556, - 'scedilla': 556, - 'iacute': 278, - 'lozenge': 494, - 'Rcaron': 722, - 'Gcommaaccent': 778, - 'ucircumflex': 611, - 'acircumflex': 556, - 'Amacron': 722, - 'rcaron': 389, - 'ccedilla': 556, - 'Zdotaccent': 611, - 'Thorn': 667, - 'Omacron': 778, - 'Racute': 722, - 'Sacute': 667, - 'dcaron': 743, - 'Umacron': 722, - 'uring': 611, - 'threesuperior': 333, - 'Ograve': 778, - 'Agrave': 722, - 'Abreve': 722, - 'multiply': 584, - 'uacute': 611, - 'Tcaron': 611, - 'partialdiff': 494, - 'ydieresis': 556, - 'Nacute': 722, - 'icircumflex': 278, - 'Ecircumflex': 667, - 'adieresis': 556, - 'edieresis': 556, - 'cacute': 556, - 'nacute': 611, - 'umacron': 611, - 'Ncaron': 722, - 'Iacute': 278, - 'plusminus': 584, - 'brokenbar': 280, - 'registered': 737, - 'Gbreve': 778, - 'Idotaccent': 278, - 'summation': 600, - 'Egrave': 667, - 'racute': 389, - 'omacron': 611, - 'Zacute': 611, - 'Zcaron': 611, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 722, - 'lcommaaccent': 278, - 'tcaron': 389, - 'eogonek': 556, - 'Uogonek': 722, - 'Aacute': 722, - 'Adieresis': 722, - 'egrave': 556, - 'zacute': 500, - 'iogonek': 278, - 'Oacute': 778, - 'oacute': 611, - 'amacron': 556, - 'sacute': 556, - 'idieresis': 278, - 'Ocircumflex': 778, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 611, - 'twosuperior': 333, - 'Odieresis': 778, - 'mu': 611, - 'igrave': 278, - 'ohungarumlaut': 611, - 'Eogonek': 667, - 'dcroat': 611, - 'threequarters': 834, - 'Scedilla': 667, - 'lcaron': 400, - 'Kcommaaccent': 722, - 'Lacute': 611, - 'trademark': 1000, - 'edotaccent': 556, - 'Igrave': 278, - 'Imacron': 278, - 'Lcaron': 611, - 'onehalf': 834, - 'lessequal': 549, - 'ocircumflex': 611, - 'ntilde': 611, - 'Uhungarumlaut': 722, - 'Eacute': 667, - 'emacron': 556, - 'gbreve': 611, - 'onequarter': 834, - 'Scaron': 667, - 'Scommaaccent': 667, - 'Ohungarumlaut': 778, - 'degree': 400, - 'ograve': 611, - 'Ccaron': 722, - 'ugrave': 611, - 'radical': 549, - 'Dcaron': 722, - 'rcommaaccent': 389, - 'Ntilde': 722, - 'otilde': 611, - 'Rcommaaccent': 722, - 'Lcommaaccent': 611, - 'Atilde': 722, - 'Aogonek': 722, - 'Aring': 722, - 'Otilde': 778, - 'zdotaccent': 500, - 'Ecaron': 667, - 'Iogonek': 278, - 'kcommaaccent': 556, - 'minus': 584, - 'Icircumflex': 278, - 'ncaron': 611, - 'tcommaaccent': 333, - 'logicalnot': 584, - 'odieresis': 611, - 'udieresis': 611, - 'notequal': 549, - 'gcommaaccent': 611, - 'eth': 611, - 'zcaron': 500, - 'ncommaaccent': 611, - 'onesuperior': 333, - 'imacron': 278, - 'Euro': 556 - }, - 'Helvetica-BoldOblique': { - 'space': 278, - 'exclam': 333, - 'quotedbl': 474, - 'numbersign': 556, - 'dollar': 556, - 'percent': 889, - 'ampersand': 722, - 'quoteright': 278, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 389, - 'plus': 584, - 'comma': 278, - 'hyphen': 333, - 'period': 278, - 'slash': 278, - 'zero': 556, - 'one': 556, - 'two': 556, - 'three': 556, - 'four': 556, - 'five': 556, - 'six': 556, - 'seven': 556, - 'eight': 556, - 'nine': 556, - 'colon': 333, - 'semicolon': 333, - 'less': 584, - 'equal': 584, - 'greater': 584, - 'question': 611, - 'at': 975, - 'A': 722, - 'B': 722, - 'C': 722, - 'D': 722, - 'E': 667, - 'F': 611, - 'G': 778, - 'H': 722, - 'I': 278, - 'J': 556, - 'K': 722, - 'L': 611, - 'M': 833, - 'N': 722, - 'O': 778, - 'P': 667, - 'Q': 778, - 'R': 722, - 'S': 667, - 'T': 611, - 'U': 722, - 'V': 667, - 'W': 944, - 'X': 667, - 'Y': 667, - 'Z': 611, - 'bracketleft': 333, - 'backslash': 278, - 'bracketright': 333, - 'asciicircum': 584, - 'underscore': 556, - 'quoteleft': 278, - 'a': 556, - 'b': 611, - 'c': 556, - 'd': 611, - 'e': 556, - 'f': 333, - 'g': 611, - 'h': 611, - 'i': 278, - 'j': 278, - 'k': 556, - 'l': 278, - 'm': 889, - 'n': 611, - 'o': 611, - 'p': 611, - 'q': 611, - 'r': 389, - 's': 556, - 't': 333, - 'u': 611, - 'v': 556, - 'w': 778, - 'x': 556, - 'y': 556, - 'z': 500, - 'braceleft': 389, - 'bar': 280, - 'braceright': 389, - 'asciitilde': 584, - 'exclamdown': 333, - 'cent': 556, - 'sterling': 556, - 'fraction': 167, - 'yen': 556, - 'florin': 556, - 'section': 556, - 'currency': 556, - 'quotesingle': 238, - 'quotedblleft': 500, - 'guillemotleft': 556, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 611, - 'fl': 611, - 'endash': 556, - 'dagger': 556, - 'daggerdbl': 556, - 'periodcentered': 278, - 'paragraph': 556, - 'bullet': 350, - 'quotesinglbase': 278, - 'quotedblbase': 500, - 'quotedblright': 500, - 'guillemotright': 556, - 'ellipsis': 1000, - 'perthousand': 1000, - 'questiondown': 611, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 1000, - 'AE': 1000, - 'ordfeminine': 370, - 'Lslash': 611, - 'Oslash': 778, - 'OE': 1000, - 'ordmasculine': 365, - 'ae': 889, - 'dotlessi': 278, - 'lslash': 278, - 'oslash': 611, - 'oe': 944, - 'germandbls': 611, - 'Idieresis': 278, - 'eacute': 556, - 'abreve': 556, - 'uhungarumlaut': 611, - 'ecaron': 556, - 'Ydieresis': 667, - 'divide': 584, - 'Yacute': 667, - 'Acircumflex': 722, - 'aacute': 556, - 'Ucircumflex': 722, - 'yacute': 556, - 'scommaaccent': 556, - 'ecircumflex': 556, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 556, - 'Uacute': 722, - 'uogonek': 611, - 'Edieresis': 667, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 737, - 'Emacron': 667, - 'ccaron': 556, - 'aring': 556, - 'Ncommaaccent': 722, - 'lacute': 278, - 'agrave': 556, - 'Tcommaaccent': 611, - 'Cacute': 722, - 'atilde': 556, - 'Edotaccent': 667, - 'scaron': 556, - 'scedilla': 556, - 'iacute': 278, - 'lozenge': 494, - 'Rcaron': 722, - 'Gcommaaccent': 778, - 'ucircumflex': 611, - 'acircumflex': 556, - 'Amacron': 722, - 'rcaron': 389, - 'ccedilla': 556, - 'Zdotaccent': 611, - 'Thorn': 667, - 'Omacron': 778, - 'Racute': 722, - 'Sacute': 667, - 'dcaron': 743, - 'Umacron': 722, - 'uring': 611, - 'threesuperior': 333, - 'Ograve': 778, - 'Agrave': 722, - 'Abreve': 722, - 'multiply': 584, - 'uacute': 611, - 'Tcaron': 611, - 'partialdiff': 494, - 'ydieresis': 556, - 'Nacute': 722, - 'icircumflex': 278, - 'Ecircumflex': 667, - 'adieresis': 556, - 'edieresis': 556, - 'cacute': 556, - 'nacute': 611, - 'umacron': 611, - 'Ncaron': 722, - 'Iacute': 278, - 'plusminus': 584, - 'brokenbar': 280, - 'registered': 737, - 'Gbreve': 778, - 'Idotaccent': 278, - 'summation': 600, - 'Egrave': 667, - 'racute': 389, - 'omacron': 611, - 'Zacute': 611, - 'Zcaron': 611, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 722, - 'lcommaaccent': 278, - 'tcaron': 389, - 'eogonek': 556, - 'Uogonek': 722, - 'Aacute': 722, - 'Adieresis': 722, - 'egrave': 556, - 'zacute': 500, - 'iogonek': 278, - 'Oacute': 778, - 'oacute': 611, - 'amacron': 556, - 'sacute': 556, - 'idieresis': 278, - 'Ocircumflex': 778, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 611, - 'twosuperior': 333, - 'Odieresis': 778, - 'mu': 611, - 'igrave': 278, - 'ohungarumlaut': 611, - 'Eogonek': 667, - 'dcroat': 611, - 'threequarters': 834, - 'Scedilla': 667, - 'lcaron': 400, - 'Kcommaaccent': 722, - 'Lacute': 611, - 'trademark': 1000, - 'edotaccent': 556, - 'Igrave': 278, - 'Imacron': 278, - 'Lcaron': 611, - 'onehalf': 834, - 'lessequal': 549, - 'ocircumflex': 611, - 'ntilde': 611, - 'Uhungarumlaut': 722, - 'Eacute': 667, - 'emacron': 556, - 'gbreve': 611, - 'onequarter': 834, - 'Scaron': 667, - 'Scommaaccent': 667, - 'Ohungarumlaut': 778, - 'degree': 400, - 'ograve': 611, - 'Ccaron': 722, - 'ugrave': 611, - 'radical': 549, - 'Dcaron': 722, - 'rcommaaccent': 389, - 'Ntilde': 722, - 'otilde': 611, - 'Rcommaaccent': 722, - 'Lcommaaccent': 611, - 'Atilde': 722, - 'Aogonek': 722, - 'Aring': 722, - 'Otilde': 778, - 'zdotaccent': 500, - 'Ecaron': 667, - 'Iogonek': 278, - 'kcommaaccent': 556, - 'minus': 584, - 'Icircumflex': 278, - 'ncaron': 611, - 'tcommaaccent': 333, - 'logicalnot': 584, - 'odieresis': 611, - 'udieresis': 611, - 'notequal': 549, - 'gcommaaccent': 611, - 'eth': 611, - 'zcaron': 500, - 'ncommaaccent': 611, - 'onesuperior': 333, - 'imacron': 278, - 'Euro': 556 - }, - 'Helvetica-Oblique' : { - 'space': 278, - 'exclam': 278, - 'quotedbl': 355, - 'numbersign': 556, - 'dollar': 556, - 'percent': 889, - 'ampersand': 667, - 'quoteright': 222, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 389, - 'plus': 584, - 'comma': 278, - 'hyphen': 333, - 'period': 278, - 'slash': 278, - 'zero': 556, - 'one': 556, - 'two': 556, - 'three': 556, - 'four': 556, - 'five': 556, - 'six': 556, - 'seven': 556, - 'eight': 556, - 'nine': 556, - 'colon': 278, - 'semicolon': 278, - 'less': 584, - 'equal': 584, - 'greater': 584, - 'question': 556, - 'at': 1015, - 'A': 667, - 'B': 667, - 'C': 722, - 'D': 722, - 'E': 667, - 'F': 611, - 'G': 778, - 'H': 722, - 'I': 278, - 'J': 500, - 'K': 667, - 'L': 556, - 'M': 833, - 'N': 722, - 'O': 778, - 'P': 667, - 'Q': 778, - 'R': 722, - 'S': 667, - 'T': 611, - 'U': 722, - 'V': 667, - 'W': 944, - 'X': 667, - 'Y': 667, - 'Z': 611, - 'bracketleft': 278, - 'backslash': 278, - 'bracketright': 278, - 'asciicircum': 469, - 'underscore': 556, - 'quoteleft': 222, - 'a': 556, - 'b': 556, - 'c': 500, - 'd': 556, - 'e': 556, - 'f': 278, - 'g': 556, - 'h': 556, - 'i': 222, - 'j': 222, - 'k': 500, - 'l': 222, - 'm': 833, - 'n': 556, - 'o': 556, - 'p': 556, - 'q': 556, - 'r': 333, - 's': 500, - 't': 278, - 'u': 556, - 'v': 500, - 'w': 722, - 'x': 500, - 'y': 500, - 'z': 500, - 'braceleft': 334, - 'bar': 260, - 'braceright': 334, - 'asciitilde': 584, - 'exclamdown': 333, - 'cent': 556, - 'sterling': 556, - 'fraction': 167, - 'yen': 556, - 'florin': 556, - 'section': 556, - 'currency': 556, - 'quotesingle': 191, - 'quotedblleft': 333, - 'guillemotleft': 556, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 500, - 'fl': 500, - 'endash': 556, - 'dagger': 556, - 'daggerdbl': 556, - 'periodcentered': 278, - 'paragraph': 537, - 'bullet': 350, - 'quotesinglbase': 222, - 'quotedblbase': 333, - 'quotedblright': 333, - 'guillemotright': 556, - 'ellipsis': 1000, - 'perthousand': 1000, - 'questiondown': 611, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 1000, - 'AE': 1000, - 'ordfeminine': 370, - 'Lslash': 556, - 'Oslash': 778, - 'OE': 1000, - 'ordmasculine': 365, - 'ae': 889, - 'dotlessi': 278, - 'lslash': 222, - 'oslash': 611, - 'oe': 944, - 'germandbls': 611, - 'Idieresis': 278, - 'eacute': 556, - 'abreve': 556, - 'uhungarumlaut': 556, - 'ecaron': 556, - 'Ydieresis': 667, - 'divide': 584, - 'Yacute': 667, - 'Acircumflex': 667, - 'aacute': 556, - 'Ucircumflex': 722, - 'yacute': 500, - 'scommaaccent': 500, - 'ecircumflex': 556, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 556, - 'Uacute': 722, - 'uogonek': 556, - 'Edieresis': 667, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 737, - 'Emacron': 667, - 'ccaron': 500, - 'aring': 556, - 'Ncommaaccent': 722, - 'lacute': 222, - 'agrave': 556, - 'Tcommaaccent': 611, - 'Cacute': 722, - 'atilde': 556, - 'Edotaccent': 667, - 'scaron': 500, - 'scedilla': 500, - 'iacute': 278, - 'lozenge': 471, - 'Rcaron': 722, - 'Gcommaaccent': 778, - 'ucircumflex': 556, - 'acircumflex': 556, - 'Amacron': 667, - 'rcaron': 333, - 'ccedilla': 500, - 'Zdotaccent': 611, - 'Thorn': 667, - 'Omacron': 778, - 'Racute': 722, - 'Sacute': 667, - 'dcaron': 643, - 'Umacron': 722, - 'uring': 556, - 'threesuperior': 333, - 'Ograve': 778, - 'Agrave': 667, - 'Abreve': 667, - 'multiply': 584, - 'uacute': 556, - 'Tcaron': 611, - 'partialdiff': 476, - 'ydieresis': 500, - 'Nacute': 722, - 'icircumflex': 278, - 'Ecircumflex': 667, - 'adieresis': 556, - 'edieresis': 556, - 'cacute': 500, - 'nacute': 556, - 'umacron': 556, - 'Ncaron': 722, - 'Iacute': 278, - 'plusminus': 584, - 'brokenbar': 260, - 'registered': 737, - 'Gbreve': 778, - 'Idotaccent': 278, - 'summation': 600, - 'Egrave': 667, - 'racute': 333, - 'omacron': 556, - 'Zacute': 611, - 'Zcaron': 611, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 722, - 'lcommaaccent': 222, - 'tcaron': 317, - 'eogonek': 556, - 'Uogonek': 722, - 'Aacute': 667, - 'Adieresis': 667, - 'egrave': 556, - 'zacute': 500, - 'iogonek': 222, - 'Oacute': 778, - 'oacute': 556, - 'amacron': 556, - 'sacute': 500, - 'idieresis': 278, - 'Ocircumflex': 778, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 556, - 'twosuperior': 333, - 'Odieresis': 778, - 'mu': 556, - 'igrave': 278, - 'ohungarumlaut': 556, - 'Eogonek': 667, - 'dcroat': 556, - 'threequarters': 834, - 'Scedilla': 667, - 'lcaron': 299, - 'Kcommaaccent': 667, - 'Lacute': 556, - 'trademark': 1000, - 'edotaccent': 556, - 'Igrave': 278, - 'Imacron': 278, - 'Lcaron': 556, - 'onehalf': 834, - 'lessequal': 549, - 'ocircumflex': 556, - 'ntilde': 556, - 'Uhungarumlaut': 722, - 'Eacute': 667, - 'emacron': 556, - 'gbreve': 556, - 'onequarter': 834, - 'Scaron': 667, - 'Scommaaccent': 667, - 'Ohungarumlaut': 778, - 'degree': 400, - 'ograve': 556, - 'Ccaron': 722, - 'ugrave': 556, - 'radical': 453, - 'Dcaron': 722, - 'rcommaaccent': 333, - 'Ntilde': 722, - 'otilde': 556, - 'Rcommaaccent': 722, - 'Lcommaaccent': 556, - 'Atilde': 667, - 'Aogonek': 667, - 'Aring': 667, - 'Otilde': 778, - 'zdotaccent': 500, - 'Ecaron': 667, - 'Iogonek': 278, - 'kcommaaccent': 500, - 'minus': 584, - 'Icircumflex': 278, - 'ncaron': 556, - 'tcommaaccent': 278, - 'logicalnot': 584, - 'odieresis': 556, - 'udieresis': 556, - 'notequal': 549, - 'gcommaaccent': 556, - 'eth': 556, - 'zcaron': 500, - 'ncommaaccent': 556, - 'onesuperior': 333, - 'imacron': 278, - 'Euro': 556 - }, - 'Symbol': { - 'space': 250, - 'exclam': 333, - 'universal': 713, - 'numbersign': 500, - 'existential': 549, - 'percent': 833, - 'ampersand': 778, - 'suchthat': 439, - 'parenleft': 333, - 'parenright': 333, - 'asteriskmath': 500, - 'plus': 549, - 'comma': 250, - 'minus': 549, - 'period': 250, - 'slash': 278, - 'zero': 500, - 'one': 500, - 'two': 500, - 'three': 500, - 'four': 500, - 'five': 500, - 'six': 500, - 'seven': 500, - 'eight': 500, - 'nine': 500, - 'colon': 278, - 'semicolon': 278, - 'less': 549, - 'equal': 549, - 'greater': 549, - 'question': 444, - 'congruent': 549, - 'Alpha': 722, - 'Beta': 667, - 'Chi': 722, - 'Delta': 612, - 'Epsilon': 611, - 'Phi': 763, - 'Gamma': 603, - 'Eta': 722, - 'Iota': 333, - 'theta1': 631, - 'Kappa': 722, - 'Lambda': 686, - 'Mu': 889, - 'Nu': 722, - 'Omicron': 722, - 'Pi': 768, - 'Theta': 741, - 'Rho': 556, - 'Sigma': 592, - 'Tau': 611, - 'Upsilon': 690, - 'sigma1': 439, - 'Omega': 768, - 'Xi': 645, - 'Psi': 795, - 'Zeta': 611, - 'bracketleft': 333, - 'therefore': 863, - 'bracketright': 333, - 'perpendicular': 658, - 'underscore': 500, - 'radicalex': 500, - 'alpha': 631, - 'beta': 549, - 'chi': 549, - 'delta': 494, - 'epsilon': 439, - 'phi': 521, - 'gamma': 411, - 'eta': 603, - 'iota': 329, - 'phi1': 603, - 'kappa': 549, - 'lambda': 549, - 'mu': 576, - 'nu': 521, - 'omicron': 549, - 'pi': 549, - 'theta': 521, - 'rho': 549, - 'sigma': 603, - 'tau': 439, - 'upsilon': 576, - 'omega1': 713, - 'omega': 686, - 'xi': 493, - 'psi': 686, - 'zeta': 494, - 'braceleft': 480, - 'bar': 200, - 'braceright': 480, - 'similar': 549, - 'Euro': 750, - 'Upsilon1': 620, - 'minute': 247, - 'lessequal': 549, - 'fraction': 167, - 'infinity': 713, - 'florin': 500, - 'club': 753, - 'diamond': 753, - 'heart': 753, - 'spade': 753, - 'arrowboth': 1042, - 'arrowleft': 987, - 'arrowup': 603, - 'arrowright': 987, - 'arrowdown': 603, - 'degree': 400, - 'plusminus': 549, - 'second': 411, - 'greaterequal': 549, - 'multiply': 549, - 'proportional': 713, - 'partialdiff': 494, - 'bullet': 460, - 'divide': 549, - 'notequal': 549, - 'equivalence': 549, - 'approxequal': 549, - 'ellipsis': 1000, - 'arrowvertex': 603, - 'arrowhorizex': 1000, - 'carriagereturn': 658, - 'aleph': 823, - 'Ifraktur': 686, - 'Rfraktur': 795, - 'weierstrass': 987, - 'circlemultiply': 768, - 'circleplus': 768, - 'emptyset': 823, - 'intersection': 768, - 'union': 768, - 'propersuperset': 713, - 'reflexsuperset': 713, - 'notsubset': 713, - 'propersubset': 713, - 'reflexsubset': 713, - 'element': 713, - 'notelement': 713, - 'angle': 768, - 'gradient': 713, - 'registerserif': 790, - 'copyrightserif': 790, - 'trademarkserif': 890, - 'product': 823, - 'radical': 549, - 'dotmath': 250, - 'logicalnot': 713, - 'logicaland': 603, - 'logicalor': 603, - 'arrowdblboth': 1042, - 'arrowdblleft': 987, - 'arrowdblup': 603, - 'arrowdblright': 987, - 'arrowdbldown': 603, - 'lozenge': 494, - 'angleleft': 329, - 'registersans': 790, - 'copyrightsans': 790, - 'trademarksans': 786, - 'summation': 713, - 'parenlefttp': 384, - 'parenleftex': 384, - 'parenleftbt': 384, - 'bracketlefttp': 384, - 'bracketleftex': 384, - 'bracketleftbt': 384, - 'bracelefttp': 494, - 'braceleftmid': 494, - 'braceleftbt': 494, - 'braceex': 494, - 'angleright': 329, - 'integral': 274, - 'integraltp': 686, - 'integralex': 686, - 'integralbt': 686, - 'parenrighttp': 384, - 'parenrightex': 384, - 'parenrightbt': 384, - 'bracketrighttp': 384, - 'bracketrightex': 384, - 'bracketrightbt': 384, - 'bracerighttp': 494, - 'bracerightmid': 494, - 'bracerightbt': 494, - 'apple': 790 - }, - 'Times-Roman': { - 'space': 250, - 'exclam': 333, - 'quotedbl': 408, - 'numbersign': 500, - 'dollar': 500, - 'percent': 833, - 'ampersand': 778, - 'quoteright': 333, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 500, - 'plus': 564, - 'comma': 250, - 'hyphen': 333, - 'period': 250, - 'slash': 278, - 'zero': 500, - 'one': 500, - 'two': 500, - 'three': 500, - 'four': 500, - 'five': 500, - 'six': 500, - 'seven': 500, - 'eight': 500, - 'nine': 500, - 'colon': 278, - 'semicolon': 278, - 'less': 564, - 'equal': 564, - 'greater': 564, - 'question': 444, - 'at': 921, - 'A': 722, - 'B': 667, - 'C': 667, - 'D': 722, - 'E': 611, - 'F': 556, - 'G': 722, - 'H': 722, - 'I': 333, - 'J': 389, - 'K': 722, - 'L': 611, - 'M': 889, - 'N': 722, - 'O': 722, - 'P': 556, - 'Q': 722, - 'R': 667, - 'S': 556, - 'T': 611, - 'U': 722, - 'V': 722, - 'W': 944, - 'X': 722, - 'Y': 722, - 'Z': 611, - 'bracketleft': 333, - 'backslash': 278, - 'bracketright': 333, - 'asciicircum': 469, - 'underscore': 500, - 'quoteleft': 333, - 'a': 444, - 'b': 500, - 'c': 444, - 'd': 500, - 'e': 444, - 'f': 333, - 'g': 500, - 'h': 500, - 'i': 278, - 'j': 278, - 'k': 500, - 'l': 278, - 'm': 778, - 'n': 500, - 'o': 500, - 'p': 500, - 'q': 500, - 'r': 333, - 's': 389, - 't': 278, - 'u': 500, - 'v': 500, - 'w': 722, - 'x': 500, - 'y': 500, - 'z': 444, - 'braceleft': 480, - 'bar': 200, - 'braceright': 480, - 'asciitilde': 541, - 'exclamdown': 333, - 'cent': 500, - 'sterling': 500, - 'fraction': 167, - 'yen': 500, - 'florin': 500, - 'section': 500, - 'currency': 500, - 'quotesingle': 180, - 'quotedblleft': 444, - 'guillemotleft': 500, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 556, - 'fl': 556, - 'endash': 500, - 'dagger': 500, - 'daggerdbl': 500, - 'periodcentered': 250, - 'paragraph': 453, - 'bullet': 350, - 'quotesinglbase': 333, - 'quotedblbase': 444, - 'quotedblright': 444, - 'guillemotright': 500, - 'ellipsis': 1000, - 'perthousand': 1000, - 'questiondown': 444, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 1000, - 'AE': 889, - 'ordfeminine': 276, - 'Lslash': 611, - 'Oslash': 722, - 'OE': 889, - 'ordmasculine': 310, - 'ae': 667, - 'dotlessi': 278, - 'lslash': 278, - 'oslash': 500, - 'oe': 722, - 'germandbls': 500, - 'Idieresis': 333, - 'eacute': 444, - 'abreve': 444, - 'uhungarumlaut': 500, - 'ecaron': 444, - 'Ydieresis': 722, - 'divide': 564, - 'Yacute': 722, - 'Acircumflex': 722, - 'aacute': 444, - 'Ucircumflex': 722, - 'yacute': 500, - 'scommaaccent': 389, - 'ecircumflex': 444, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 444, - 'Uacute': 722, - 'uogonek': 500, - 'Edieresis': 611, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 760, - 'Emacron': 611, - 'ccaron': 444, - 'aring': 444, - 'Ncommaaccent': 722, - 'lacute': 278, - 'agrave': 444, - 'Tcommaaccent': 611, - 'Cacute': 667, - 'atilde': 444, - 'Edotaccent': 611, - 'scaron': 389, - 'scedilla': 389, - 'iacute': 278, - 'lozenge': 471, - 'Rcaron': 667, - 'Gcommaaccent': 722, - 'ucircumflex': 500, - 'acircumflex': 444, - 'Amacron': 722, - 'rcaron': 333, - 'ccedilla': 444, - 'Zdotaccent': 611, - 'Thorn': 556, - 'Omacron': 722, - 'Racute': 667, - 'Sacute': 556, - 'dcaron': 588, - 'Umacron': 722, - 'uring': 500, - 'threesuperior': 300, - 'Ograve': 722, - 'Agrave': 722, - 'Abreve': 722, - 'multiply': 564, - 'uacute': 500, - 'Tcaron': 611, - 'partialdiff': 476, - 'ydieresis': 500, - 'Nacute': 722, - 'icircumflex': 278, - 'Ecircumflex': 611, - 'adieresis': 444, - 'edieresis': 444, - 'cacute': 444, - 'nacute': 500, - 'umacron': 500, - 'Ncaron': 722, - 'Iacute': 333, - 'plusminus': 564, - 'brokenbar': 200, - 'registered': 760, - 'Gbreve': 722, - 'Idotaccent': 333, - 'summation': 600, - 'Egrave': 611, - 'racute': 333, - 'omacron': 500, - 'Zacute': 611, - 'Zcaron': 611, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 667, - 'lcommaaccent': 278, - 'tcaron': 326, - 'eogonek': 444, - 'Uogonek': 722, - 'Aacute': 722, - 'Adieresis': 722, - 'egrave': 444, - 'zacute': 444, - 'iogonek': 278, - 'Oacute': 722, - 'oacute': 500, - 'amacron': 444, - 'sacute': 389, - 'idieresis': 278, - 'Ocircumflex': 722, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 500, - 'twosuperior': 300, - 'Odieresis': 722, - 'mu': 500, - 'igrave': 278, - 'ohungarumlaut': 500, - 'Eogonek': 611, - 'dcroat': 500, - 'threequarters': 750, - 'Scedilla': 556, - 'lcaron': 344, - 'Kcommaaccent': 722, - 'Lacute': 611, - 'trademark': 980, - 'edotaccent': 444, - 'Igrave': 333, - 'Imacron': 333, - 'Lcaron': 611, - 'onehalf': 750, - 'lessequal': 549, - 'ocircumflex': 500, - 'ntilde': 500, - 'Uhungarumlaut': 722, - 'Eacute': 611, - 'emacron': 444, - 'gbreve': 500, - 'onequarter': 750, - 'Scaron': 556, - 'Scommaaccent': 556, - 'Ohungarumlaut': 722, - 'degree': 400, - 'ograve': 500, - 'Ccaron': 667, - 'ugrave': 500, - 'radical': 453, - 'Dcaron': 722, - 'rcommaaccent': 333, - 'Ntilde': 722, - 'otilde': 500, - 'Rcommaaccent': 667, - 'Lcommaaccent': 611, - 'Atilde': 722, - 'Aogonek': 722, - 'Aring': 722, - 'Otilde': 722, - 'zdotaccent': 444, - 'Ecaron': 611, - 'Iogonek': 333, - 'kcommaaccent': 500, - 'minus': 564, - 'Icircumflex': 333, - 'ncaron': 500, - 'tcommaaccent': 278, - 'logicalnot': 564, - 'odieresis': 500, - 'udieresis': 500, - 'notequal': 549, - 'gcommaaccent': 500, - 'eth': 500, - 'zcaron': 444, - 'ncommaaccent': 500, - 'onesuperior': 300, - 'imacron': 278, - 'Euro': 500 - }, - 'Times-Bold': { - 'space': 250, - 'exclam': 333, - 'quotedbl': 555, - 'numbersign': 500, - 'dollar': 500, - 'percent': 1000, - 'ampersand': 833, - 'quoteright': 333, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 500, - 'plus': 570, - 'comma': 250, - 'hyphen': 333, - 'period': 250, - 'slash': 278, - 'zero': 500, - 'one': 500, - 'two': 500, - 'three': 500, - 'four': 500, - 'five': 500, - 'six': 500, - 'seven': 500, - 'eight': 500, - 'nine': 500, - 'colon': 333, - 'semicolon': 333, - 'less': 570, - 'equal': 570, - 'greater': 570, - 'question': 500, - 'at': 930, - 'A': 722, - 'B': 667, - 'C': 722, - 'D': 722, - 'E': 667, - 'F': 611, - 'G': 778, - 'H': 778, - 'I': 389, - 'J': 500, - 'K': 778, - 'L': 667, - 'M': 944, - 'N': 722, - 'O': 778, - 'P': 611, - 'Q': 778, - 'R': 722, - 'S': 556, - 'T': 667, - 'U': 722, - 'V': 722, - 'W': 1000, - 'X': 722, - 'Y': 722, - 'Z': 667, - 'bracketleft': 333, - 'backslash': 278, - 'bracketright': 333, - 'asciicircum': 581, - 'underscore': 500, - 'quoteleft': 333, - 'a': 500, - 'b': 556, - 'c': 444, - 'd': 556, - 'e': 444, - 'f': 333, - 'g': 500, - 'h': 556, - 'i': 278, - 'j': 333, - 'k': 556, - 'l': 278, - 'm': 833, - 'n': 556, - 'o': 500, - 'p': 556, - 'q': 556, - 'r': 444, - 's': 389, - 't': 333, - 'u': 556, - 'v': 500, - 'w': 722, - 'x': 500, - 'y': 500, - 'z': 444, - 'braceleft': 394, - 'bar': 220, - 'braceright': 394, - 'asciitilde': 520, - 'exclamdown': 333, - 'cent': 500, - 'sterling': 500, - 'fraction': 167, - 'yen': 500, - 'florin': 500, - 'section': 500, - 'currency': 500, - 'quotesingle': 278, - 'quotedblleft': 500, - 'guillemotleft': 500, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 556, - 'fl': 556, - 'endash': 500, - 'dagger': 500, - 'daggerdbl': 500, - 'periodcentered': 250, - 'paragraph': 540, - 'bullet': 350, - 'quotesinglbase': 333, - 'quotedblbase': 500, - 'quotedblright': 500, - 'guillemotright': 500, - 'ellipsis': 1000, - 'perthousand': 1000, - 'questiondown': 500, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 1000, - 'AE': 1000, - 'ordfeminine': 300, - 'Lslash': 667, - 'Oslash': 778, - 'OE': 1000, - 'ordmasculine': 330, - 'ae': 722, - 'dotlessi': 278, - 'lslash': 278, - 'oslash': 500, - 'oe': 722, - 'germandbls': 556, - 'Idieresis': 389, - 'eacute': 444, - 'abreve': 500, - 'uhungarumlaut': 556, - 'ecaron': 444, - 'Ydieresis': 722, - 'divide': 570, - 'Yacute': 722, - 'Acircumflex': 722, - 'aacute': 500, - 'Ucircumflex': 722, - 'yacute': 500, - 'scommaaccent': 389, - 'ecircumflex': 444, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 500, - 'Uacute': 722, - 'uogonek': 556, - 'Edieresis': 667, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 747, - 'Emacron': 667, - 'ccaron': 444, - 'aring': 500, - 'Ncommaaccent': 722, - 'lacute': 278, - 'agrave': 500, - 'Tcommaaccent': 667, - 'Cacute': 722, - 'atilde': 500, - 'Edotaccent': 667, - 'scaron': 389, - 'scedilla': 389, - 'iacute': 278, - 'lozenge': 494, - 'Rcaron': 722, - 'Gcommaaccent': 778, - 'ucircumflex': 556, - 'acircumflex': 500, - 'Amacron': 722, - 'rcaron': 444, - 'ccedilla': 444, - 'Zdotaccent': 667, - 'Thorn': 611, - 'Omacron': 778, - 'Racute': 722, - 'Sacute': 556, - 'dcaron': 672, - 'Umacron': 722, - 'uring': 556, - 'threesuperior': 300, - 'Ograve': 778, - 'Agrave': 722, - 'Abreve': 722, - 'multiply': 570, - 'uacute': 556, - 'Tcaron': 667, - 'partialdiff': 494, - 'ydieresis': 500, - 'Nacute': 722, - 'icircumflex': 278, - 'Ecircumflex': 667, - 'adieresis': 500, - 'edieresis': 444, - 'cacute': 444, - 'nacute': 556, - 'umacron': 556, - 'Ncaron': 722, - 'Iacute': 389, - 'plusminus': 570, - 'brokenbar': 220, - 'registered': 747, - 'Gbreve': 778, - 'Idotaccent': 389, - 'summation': 600, - 'Egrave': 667, - 'racute': 444, - 'omacron': 500, - 'Zacute': 667, - 'Zcaron': 667, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 722, - 'lcommaaccent': 278, - 'tcaron': 416, - 'eogonek': 444, - 'Uogonek': 722, - 'Aacute': 722, - 'Adieresis': 722, - 'egrave': 444, - 'zacute': 444, - 'iogonek': 278, - 'Oacute': 778, - 'oacute': 500, - 'amacron': 500, - 'sacute': 389, - 'idieresis': 278, - 'Ocircumflex': 778, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 556, - 'twosuperior': 300, - 'Odieresis': 778, - 'mu': 556, - 'igrave': 278, - 'ohungarumlaut': 500, - 'Eogonek': 667, - 'dcroat': 556, - 'threequarters': 750, - 'Scedilla': 556, - 'lcaron': 394, - 'Kcommaaccent': 778, - 'Lacute': 667, - 'trademark': 1000, - 'edotaccent': 444, - 'Igrave': 389, - 'Imacron': 389, - 'Lcaron': 667, - 'onehalf': 750, - 'lessequal': 549, - 'ocircumflex': 500, - 'ntilde': 556, - 'Uhungarumlaut': 722, - 'Eacute': 667, - 'emacron': 444, - 'gbreve': 500, - 'onequarter': 750, - 'Scaron': 556, - 'Scommaaccent': 556, - 'Ohungarumlaut': 778, - 'degree': 400, - 'ograve': 500, - 'Ccaron': 722, - 'ugrave': 556, - 'radical': 549, - 'Dcaron': 722, - 'rcommaaccent': 444, - 'Ntilde': 722, - 'otilde': 500, - 'Rcommaaccent': 722, - 'Lcommaaccent': 667, - 'Atilde': 722, - 'Aogonek': 722, - 'Aring': 722, - 'Otilde': 778, - 'zdotaccent': 444, - 'Ecaron': 667, - 'Iogonek': 389, - 'kcommaaccent': 556, - 'minus': 570, - 'Icircumflex': 389, - 'ncaron': 556, - 'tcommaaccent': 333, - 'logicalnot': 570, - 'odieresis': 500, - 'udieresis': 556, - 'notequal': 549, - 'gcommaaccent': 500, - 'eth': 500, - 'zcaron': 444, - 'ncommaaccent': 556, - 'onesuperior': 300, - 'imacron': 278, - 'Euro': 500 - }, - 'Times-BoldItalic': { - 'space': 250, - 'exclam': 389, - 'quotedbl': 555, - 'numbersign': 500, - 'dollar': 500, - 'percent': 833, - 'ampersand': 778, - 'quoteright': 333, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 500, - 'plus': 570, - 'comma': 250, - 'hyphen': 333, - 'period': 250, - 'slash': 278, - 'zero': 500, - 'one': 500, - 'two': 500, - 'three': 500, - 'four': 500, - 'five': 500, - 'six': 500, - 'seven': 500, - 'eight': 500, - 'nine': 500, - 'colon': 333, - 'semicolon': 333, - 'less': 570, - 'equal': 570, - 'greater': 570, - 'question': 500, - 'at': 832, - 'A': 667, - 'B': 667, - 'C': 667, - 'D': 722, - 'E': 667, - 'F': 667, - 'G': 722, - 'H': 778, - 'I': 389, - 'J': 500, - 'K': 667, - 'L': 611, - 'M': 889, - 'N': 722, - 'O': 722, - 'P': 611, - 'Q': 722, - 'R': 667, - 'S': 556, - 'T': 611, - 'U': 722, - 'V': 667, - 'W': 889, - 'X': 667, - 'Y': 611, - 'Z': 611, - 'bracketleft': 333, - 'backslash': 278, - 'bracketright': 333, - 'asciicircum': 570, - 'underscore': 500, - 'quoteleft': 333, - 'a': 500, - 'b': 500, - 'c': 444, - 'd': 500, - 'e': 444, - 'f': 333, - 'g': 500, - 'h': 556, - 'i': 278, - 'j': 278, - 'k': 500, - 'l': 278, - 'm': 778, - 'n': 556, - 'o': 500, - 'p': 500, - 'q': 500, - 'r': 389, - 's': 389, - 't': 278, - 'u': 556, - 'v': 444, - 'w': 667, - 'x': 500, - 'y': 444, - 'z': 389, - 'braceleft': 348, - 'bar': 220, - 'braceright': 348, - 'asciitilde': 570, - 'exclamdown': 389, - 'cent': 500, - 'sterling': 500, - 'fraction': 167, - 'yen': 500, - 'florin': 500, - 'section': 500, - 'currency': 500, - 'quotesingle': 278, - 'quotedblleft': 500, - 'guillemotleft': 500, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 556, - 'fl': 556, - 'endash': 500, - 'dagger': 500, - 'daggerdbl': 500, - 'periodcentered': 250, - 'paragraph': 500, - 'bullet': 350, - 'quotesinglbase': 333, - 'quotedblbase': 500, - 'quotedblright': 500, - 'guillemotright': 500, - 'ellipsis': 1000, - 'perthousand': 1000, - 'questiondown': 500, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 1000, - 'AE': 944, - 'ordfeminine': 266, - 'Lslash': 611, - 'Oslash': 722, - 'OE': 944, - 'ordmasculine': 300, - 'ae': 722, - 'dotlessi': 278, - 'lslash': 278, - 'oslash': 500, - 'oe': 722, - 'germandbls': 500, - 'Idieresis': 389, - 'eacute': 444, - 'abreve': 500, - 'uhungarumlaut': 556, - 'ecaron': 444, - 'Ydieresis': 611, - 'divide': 570, - 'Yacute': 611, - 'Acircumflex': 667, - 'aacute': 500, - 'Ucircumflex': 722, - 'yacute': 444, - 'scommaaccent': 389, - 'ecircumflex': 444, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 500, - 'Uacute': 722, - 'uogonek': 556, - 'Edieresis': 667, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 747, - 'Emacron': 667, - 'ccaron': 444, - 'aring': 500, - 'Ncommaaccent': 722, - 'lacute': 278, - 'agrave': 500, - 'Tcommaaccent': 611, - 'Cacute': 667, - 'atilde': 500, - 'Edotaccent': 667, - 'scaron': 389, - 'scedilla': 389, - 'iacute': 278, - 'lozenge': 494, - 'Rcaron': 667, - 'Gcommaaccent': 722, - 'ucircumflex': 556, - 'acircumflex': 500, - 'Amacron': 667, - 'rcaron': 389, - 'ccedilla': 444, - 'Zdotaccent': 611, - 'Thorn': 611, - 'Omacron': 722, - 'Racute': 667, - 'Sacute': 556, - 'dcaron': 608, - 'Umacron': 722, - 'uring': 556, - 'threesuperior': 300, - 'Ograve': 722, - 'Agrave': 667, - 'Abreve': 667, - 'multiply': 570, - 'uacute': 556, - 'Tcaron': 611, - 'partialdiff': 494, - 'ydieresis': 444, - 'Nacute': 722, - 'icircumflex': 278, - 'Ecircumflex': 667, - 'adieresis': 500, - 'edieresis': 444, - 'cacute': 444, - 'nacute': 556, - 'umacron': 556, - 'Ncaron': 722, - 'Iacute': 389, - 'plusminus': 570, - 'brokenbar': 220, - 'registered': 747, - 'Gbreve': 722, - 'Idotaccent': 389, - 'summation': 600, - 'Egrave': 667, - 'racute': 389, - 'omacron': 500, - 'Zacute': 611, - 'Zcaron': 611, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 667, - 'lcommaaccent': 278, - 'tcaron': 366, - 'eogonek': 444, - 'Uogonek': 722, - 'Aacute': 667, - 'Adieresis': 667, - 'egrave': 444, - 'zacute': 389, - 'iogonek': 278, - 'Oacute': 722, - 'oacute': 500, - 'amacron': 500, - 'sacute': 389, - 'idieresis': 278, - 'Ocircumflex': 722, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 500, - 'twosuperior': 300, - 'Odieresis': 722, - 'mu': 576, - 'igrave': 278, - 'ohungarumlaut': 500, - 'Eogonek': 667, - 'dcroat': 500, - 'threequarters': 750, - 'Scedilla': 556, - 'lcaron': 382, - 'Kcommaaccent': 667, - 'Lacute': 611, - 'trademark': 1000, - 'edotaccent': 444, - 'Igrave': 389, - 'Imacron': 389, - 'Lcaron': 611, - 'onehalf': 750, - 'lessequal': 549, - 'ocircumflex': 500, - 'ntilde': 556, - 'Uhungarumlaut': 722, - 'Eacute': 667, - 'emacron': 444, - 'gbreve': 500, - 'onequarter': 750, - 'Scaron': 556, - 'Scommaaccent': 556, - 'Ohungarumlaut': 722, - 'degree': 400, - 'ograve': 500, - 'Ccaron': 667, - 'ugrave': 556, - 'radical': 549, - 'Dcaron': 722, - 'rcommaaccent': 389, - 'Ntilde': 722, - 'otilde': 500, - 'Rcommaaccent': 667, - 'Lcommaaccent': 611, - 'Atilde': 667, - 'Aogonek': 667, - 'Aring': 667, - 'Otilde': 722, - 'zdotaccent': 389, - 'Ecaron': 667, - 'Iogonek': 389, - 'kcommaaccent': 500, - 'minus': 606, - 'Icircumflex': 389, - 'ncaron': 556, - 'tcommaaccent': 278, - 'logicalnot': 606, - 'odieresis': 500, - 'udieresis': 556, - 'notequal': 549, - 'gcommaaccent': 500, - 'eth': 500, - 'zcaron': 389, - 'ncommaaccent': 556, - 'onesuperior': 300, - 'imacron': 278, - 'Euro': 500 - }, - 'Times-Italic': { - 'space': 250, - 'exclam': 333, - 'quotedbl': 420, - 'numbersign': 500, - 'dollar': 500, - 'percent': 833, - 'ampersand': 778, - 'quoteright': 333, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 500, - 'plus': 675, - 'comma': 250, - 'hyphen': 333, - 'period': 250, - 'slash': 278, - 'zero': 500, - 'one': 500, - 'two': 500, - 'three': 500, - 'four': 500, - 'five': 500, - 'six': 500, - 'seven': 500, - 'eight': 500, - 'nine': 500, - 'colon': 333, - 'semicolon': 333, - 'less': 675, - 'equal': 675, - 'greater': 675, - 'question': 500, - 'at': 920, - 'A': 611, - 'B': 611, - 'C': 667, - 'D': 722, - 'E': 611, - 'F': 611, - 'G': 722, - 'H': 722, - 'I': 333, - 'J': 444, - 'K': 667, - 'L': 556, - 'M': 833, - 'N': 667, - 'O': 722, - 'P': 611, - 'Q': 722, - 'R': 611, - 'S': 500, - 'T': 556, - 'U': 722, - 'V': 611, - 'W': 833, - 'X': 611, - 'Y': 556, - 'Z': 556, - 'bracketleft': 389, - 'backslash': 278, - 'bracketright': 389, - 'asciicircum': 422, - 'underscore': 500, - 'quoteleft': 333, - 'a': 500, - 'b': 500, - 'c': 444, - 'd': 500, - 'e': 444, - 'f': 278, - 'g': 500, - 'h': 500, - 'i': 278, - 'j': 278, - 'k': 444, - 'l': 278, - 'm': 722, - 'n': 500, - 'o': 500, - 'p': 500, - 'q': 500, - 'r': 389, - 's': 389, - 't': 278, - 'u': 500, - 'v': 444, - 'w': 667, - 'x': 444, - 'y': 444, - 'z': 389, - 'braceleft': 400, - 'bar': 275, - 'braceright': 400, - 'asciitilde': 541, - 'exclamdown': 389, - 'cent': 500, - 'sterling': 500, - 'fraction': 167, - 'yen': 500, - 'florin': 500, - 'section': 500, - 'currency': 500, - 'quotesingle': 214, - 'quotedblleft': 556, - 'guillemotleft': 500, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 500, - 'fl': 500, - 'endash': 500, - 'dagger': 500, - 'daggerdbl': 500, - 'periodcentered': 250, - 'paragraph': 523, - 'bullet': 350, - 'quotesinglbase': 333, - 'quotedblbase': 556, - 'quotedblright': 556, - 'guillemotright': 500, - 'ellipsis': 889, - 'perthousand': 1000, - 'questiondown': 500, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 889, - 'AE': 889, - 'ordfeminine': 276, - 'Lslash': 556, - 'Oslash': 722, - 'OE': 944, - 'ordmasculine': 310, - 'ae': 667, - 'dotlessi': 278, - 'lslash': 278, - 'oslash': 500, - 'oe': 667, - 'germandbls': 500, - 'Idieresis': 333, - 'eacute': 444, - 'abreve': 500, - 'uhungarumlaut': 500, - 'ecaron': 444, - 'Ydieresis': 556, - 'divide': 675, - 'Yacute': 556, - 'Acircumflex': 611, - 'aacute': 500, - 'Ucircumflex': 722, - 'yacute': 444, - 'scommaaccent': 389, - 'ecircumflex': 444, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 500, - 'Uacute': 722, - 'uogonek': 500, - 'Edieresis': 611, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 760, - 'Emacron': 611, - 'ccaron': 444, - 'aring': 500, - 'Ncommaaccent': 667, - 'lacute': 278, - 'agrave': 500, - 'Tcommaaccent': 556, - 'Cacute': 667, - 'atilde': 500, - 'Edotaccent': 611, - 'scaron': 389, - 'scedilla': 389, - 'iacute': 278, - 'lozenge': 471, - 'Rcaron': 611, - 'Gcommaaccent': 722, - 'ucircumflex': 500, - 'acircumflex': 500, - 'Amacron': 611, - 'rcaron': 389, - 'ccedilla': 444, - 'Zdotaccent': 556, - 'Thorn': 611, - 'Omacron': 722, - 'Racute': 611, - 'Sacute': 500, - 'dcaron': 544, - 'Umacron': 722, - 'uring': 500, - 'threesuperior': 300, - 'Ograve': 722, - 'Agrave': 611, - 'Abreve': 611, - 'multiply': 675, - 'uacute': 500, - 'Tcaron': 556, - 'partialdiff': 476, - 'ydieresis': 444, - 'Nacute': 667, - 'icircumflex': 278, - 'Ecircumflex': 611, - 'adieresis': 500, - 'edieresis': 444, - 'cacute': 444, - 'nacute': 500, - 'umacron': 500, - 'Ncaron': 667, - 'Iacute': 333, - 'plusminus': 675, - 'brokenbar': 275, - 'registered': 760, - 'Gbreve': 722, - 'Idotaccent': 333, - 'summation': 600, - 'Egrave': 611, - 'racute': 389, - 'omacron': 500, - 'Zacute': 556, - 'Zcaron': 556, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 667, - 'lcommaaccent': 278, - 'tcaron': 300, - 'eogonek': 444, - 'Uogonek': 722, - 'Aacute': 611, - 'Adieresis': 611, - 'egrave': 444, - 'zacute': 389, - 'iogonek': 278, - 'Oacute': 722, - 'oacute': 500, - 'amacron': 500, - 'sacute': 389, - 'idieresis': 278, - 'Ocircumflex': 722, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 500, - 'twosuperior': 300, - 'Odieresis': 722, - 'mu': 500, - 'igrave': 278, - 'ohungarumlaut': 500, - 'Eogonek': 611, - 'dcroat': 500, - 'threequarters': 750, - 'Scedilla': 500, - 'lcaron': 300, - 'Kcommaaccent': 667, - 'Lacute': 556, - 'trademark': 980, - 'edotaccent': 444, - 'Igrave': 333, - 'Imacron': 333, - 'Lcaron': 611, - 'onehalf': 750, - 'lessequal': 549, - 'ocircumflex': 500, - 'ntilde': 500, - 'Uhungarumlaut': 722, - 'Eacute': 611, - 'emacron': 444, - 'gbreve': 500, - 'onequarter': 750, - 'Scaron': 500, - 'Scommaaccent': 500, - 'Ohungarumlaut': 722, - 'degree': 400, - 'ograve': 500, - 'Ccaron': 667, - 'ugrave': 500, - 'radical': 453, - 'Dcaron': 722, - 'rcommaaccent': 389, - 'Ntilde': 667, - 'otilde': 500, - 'Rcommaaccent': 611, - 'Lcommaaccent': 556, - 'Atilde': 611, - 'Aogonek': 611, - 'Aring': 611, - 'Otilde': 722, - 'zdotaccent': 389, - 'Ecaron': 611, - 'Iogonek': 333, - 'kcommaaccent': 444, - 'minus': 675, - 'Icircumflex': 333, - 'ncaron': 500, - 'tcommaaccent': 278, - 'logicalnot': 675, - 'odieresis': 500, - 'udieresis': 500, - 'notequal': 549, - 'gcommaaccent': 500, - 'eth': 500, - 'zcaron': 389, - 'ncommaaccent': 500, - 'onesuperior': 300, - 'imacron': 278, - 'Euro': 500 - }, - 'ZapfDingbats': { - 'space': 278, - 'a1': 974, - 'a2': 961, - 'a202': 974, - 'a3': 980, - 'a4': 719, - 'a5': 789, - 'a119': 790, - 'a118': 791, - 'a117': 690, - 'a11': 960, - 'a12': 939, - 'a13': 549, - 'a14': 855, - 'a15': 911, - 'a16': 933, - 'a105': 911, - 'a17': 945, - 'a18': 974, - 'a19': 755, - 'a20': 846, - 'a21': 762, - 'a22': 761, - 'a23': 571, - 'a24': 677, - 'a25': 763, - 'a26': 760, - 'a27': 759, - 'a28': 754, - 'a6': 494, - 'a7': 552, - 'a8': 537, - 'a9': 577, - 'a10': 692, - 'a29': 786, - 'a30': 788, - 'a31': 788, - 'a32': 790, - 'a33': 793, - 'a34': 794, - 'a35': 816, - 'a36': 823, - 'a37': 789, - 'a38': 841, - 'a39': 823, - 'a40': 833, - 'a41': 816, - 'a42': 831, - 'a43': 923, - 'a44': 744, - 'a45': 723, - 'a46': 749, - 'a47': 790, - 'a48': 792, - 'a49': 695, - 'a50': 776, - 'a51': 768, - 'a52': 792, - 'a53': 759, - 'a54': 707, - 'a55': 708, - 'a56': 682, - 'a57': 701, - 'a58': 826, - 'a59': 815, - 'a60': 789, - 'a61': 789, - 'a62': 707, - 'a63': 687, - 'a64': 696, - 'a65': 689, - 'a66': 786, - 'a67': 787, - 'a68': 713, - 'a69': 791, - 'a70': 785, - 'a71': 791, - 'a72': 873, - 'a73': 761, - 'a74': 762, - 'a203': 762, - 'a75': 759, - 'a204': 759, - 'a76': 892, - 'a77': 892, - 'a78': 788, - 'a79': 784, - 'a81': 438, - 'a82': 138, - 'a83': 277, - 'a84': 415, - 'a97': 392, - 'a98': 392, - 'a99': 668, - 'a100': 668, - 'a89': 390, - 'a90': 390, - 'a93': 317, - 'a94': 317, - 'a91': 276, - 'a92': 276, - 'a205': 509, - 'a85': 509, - 'a206': 410, - 'a86': 410, - 'a87': 234, - 'a88': 234, - 'a95': 334, - 'a96': 334, - 'a101': 732, - 'a102': 544, - 'a103': 544, - 'a104': 910, - 'a106': 667, - 'a107': 760, - 'a108': 760, - 'a112': 776, - 'a111': 595, - 'a110': 694, - 'a109': 626, - 'a120': 788, - 'a121': 788, - 'a122': 788, - 'a123': 788, - 'a124': 788, - 'a125': 788, - 'a126': 788, - 'a127': 788, - 'a128': 788, - 'a129': 788, - 'a130': 788, - 'a131': 788, - 'a132': 788, - 'a133': 788, - 'a134': 788, - 'a135': 788, - 'a136': 788, - 'a137': 788, - 'a138': 788, - 'a139': 788, - 'a140': 788, - 'a141': 788, - 'a142': 788, - 'a143': 788, - 'a144': 788, - 'a145': 788, - 'a146': 788, - 'a147': 788, - 'a148': 788, - 'a149': 788, - 'a150': 788, - 'a151': 788, - 'a152': 788, - 'a153': 788, - 'a154': 788, - 'a155': 788, - 'a156': 788, - 'a157': 788, - 'a158': 788, - 'a159': 788, - 'a160': 894, - 'a161': 838, - 'a163': 1016, - 'a164': 458, - 'a196': 748, - 'a165': 924, - 'a192': 748, - 'a166': 918, - 'a167': 927, - 'a168': 928, - 'a169': 928, - 'a170': 834, - 'a171': 873, - 'a172': 828, - 'a173': 924, - 'a162': 924, - 'a174': 917, - 'a175': 930, - 'a176': 931, - 'a177': 463, - 'a178': 883, - 'a179': 836, - 'a193': 836, - 'a180': 867, - 'a199': 867, - 'a181': 696, - 'a200': 696, - 'a182': 874, - 'a201': 874, - 'a183': 760, - 'a184': 946, - 'a197': 771, - 'a185': 865, - 'a194': 771, - 'a198': 888, - 'a186': 967, - 'a195': 888, - 'a187': 831, - 'a188': 873, - 'a189': 927, - 'a190': 970, - 'a191': 918 - } -}; - - -var EOF = {}; - -function isEOF(v) { - return (v === EOF); -} - -var MAX_LENGTH_TO_CACHE = 1000; - -var Parser = (function ParserClosure() { - function Parser(lexer, allowStreams, xref) { - this.lexer = lexer; - this.allowStreams = allowStreams; - this.xref = xref; - this.imageCache = {}; - this.refill(); - } - - Parser.prototype = { - refill: function Parser_refill() { - this.buf1 = this.lexer.getObj(); - this.buf2 = this.lexer.getObj(); - }, - shift: function Parser_shift() { - if (isCmd(this.buf2, 'ID')) { - this.buf1 = this.buf2; - this.buf2 = null; - } else { - this.buf1 = this.buf2; - this.buf2 = this.lexer.getObj(); - } - }, - tryShift: function Parser_tryShift() { - try { - this.shift(); - return true; - } catch (e) { - if (e instanceof MissingDataException) { - throw e; - } - // Upon failure, the caller should reset this.lexer.pos to a known good - // state and call this.shift() twice to reset the buffers. - return false; - } - }, - getObj: function Parser_getObj(cipherTransform) { - var buf1 = this.buf1; - this.shift(); - - if (buf1 instanceof Cmd) { - switch (buf1.cmd) { - case 'BI': // inline image - return this.makeInlineImage(cipherTransform); - case '[': // array - var array = []; - while (!isCmd(this.buf1, ']') && !isEOF(this.buf1)) { - array.push(this.getObj(cipherTransform)); - } - if (isEOF(this.buf1)) { - error('End of file inside array'); - } - this.shift(); - return array; - case '<<': // dictionary or stream - var dict = new Dict(this.xref); - while (!isCmd(this.buf1, '>>') && !isEOF(this.buf1)) { - if (!isName(this.buf1)) { - info('Malformed dictionary: key must be a name object'); - this.shift(); - continue; - } - - var key = this.buf1.name; - this.shift(); - if (isEOF(this.buf1)) { - break; - } - dict.set(key, this.getObj(cipherTransform)); - } - if (isEOF(this.buf1)) { - error('End of file inside dictionary'); - } - - // Stream objects are not allowed inside content streams or - // object streams. - if (isCmd(this.buf2, 'stream')) { - return (this.allowStreams ? - this.makeStream(dict, cipherTransform) : dict); - } - this.shift(); - return dict; - default: // simple object - return buf1; - } - } - - if (isInt(buf1)) { // indirect reference or integer - var num = buf1; - if (isInt(this.buf1) && isCmd(this.buf2, 'R')) { - var ref = new Ref(num, this.buf1); - this.shift(); - this.shift(); - return ref; - } - return num; - } - - if (isString(buf1)) { // string - var str = buf1; - if (cipherTransform) { - str = cipherTransform.decryptString(str); - } - return str; - } - - // simple object - return buf1; - }, - /** - * Find the end of the stream by searching for the /EI\s/. - * @returns {number} The inline stream length. - */ - findDefaultInlineStreamEnd: - function Parser_findDefaultInlineStreamEnd(stream) { - var E = 0x45, I = 0x49, SPACE = 0x20, LF = 0xA, CR = 0xD; - var startPos = stream.pos, state = 0, ch, i, n, followingBytes; - while ((ch = stream.getByte()) !== -1) { - if (state === 0) { - state = (ch === E) ? 1 : 0; - } else if (state === 1) { - state = (ch === I) ? 2 : 0; - } else { - assert(state === 2); - if (ch === SPACE || ch === LF || ch === CR) { - // Let's check the next five bytes are ASCII... just be sure. - n = 5; - followingBytes = stream.peekBytes(n); - for (i = 0; i < n; i++) { - ch = followingBytes[i]; - if (ch !== LF && ch !== CR && (ch < SPACE || ch > 0x7F)) { - // Not a LF, CR, SPACE or any visible ASCII character, i.e. - // it's binary stuff. Resetting the state. - state = 0; - break; - } - } - if (state === 2) { - break; // Finished! - } - } else { - state = 0; - } - } - } - return ((stream.pos - 4) - startPos); - }, - /** - * Find the EOI (end-of-image) marker 0xFFD9 of the stream. - * @returns {number} The inline stream length. - */ - findDCTDecodeInlineStreamEnd: - function Parser_findDCTDecodeInlineStreamEnd(stream) { - var startPos = stream.pos, foundEOI = false, b, markerLength, length; - while ((b = stream.getByte()) !== -1) { - if (b !== 0xFF) { // Not a valid marker. - continue; - } - switch (stream.getByte()) { - case 0x00: // Byte stuffing. - // 0xFF00 appears to be a very common byte sequence in JPEG images. - break; - - case 0xFF: // Fill byte. - // Avoid skipping a valid marker, resetting the stream position. - stream.skip(-1); - break; - - case 0xD9: // EOI - foundEOI = true; - break; - - case 0xC0: // SOF0 - case 0xC1: // SOF1 - case 0xC2: // SOF2 - case 0xC3: // SOF3 - - case 0xC5: // SOF5 - case 0xC6: // SOF6 - case 0xC7: // SOF7 - - case 0xC9: // SOF9 - case 0xCA: // SOF10 - case 0xCB: // SOF11 - - case 0xCD: // SOF13 - case 0xCE: // SOF14 - case 0xCF: // SOF15 - - case 0xC4: // DHT - case 0xCC: // DAC - - case 0xDA: // SOS - case 0xDB: // DQT - case 0xDC: // DNL - case 0xDD: // DRI - case 0xDE: // DHP - case 0xDF: // EXP - - case 0xE0: // APP0 - case 0xE1: // APP1 - case 0xE2: // APP2 - case 0xE3: // APP3 - case 0xE4: // APP4 - case 0xE5: // APP5 - case 0xE6: // APP6 - case 0xE7: // APP7 - case 0xE8: // APP8 - case 0xE9: // APP9 - case 0xEA: // APP10 - case 0xEB: // APP11 - case 0xEC: // APP12 - case 0xED: // APP13 - case 0xEE: // APP14 - case 0xEF: // APP15 - - case 0xFE: // COM - // The marker should be followed by the length of the segment. - markerLength = stream.getUint16(); - if (markerLength > 2) { - // |markerLength| contains the byte length of the marker segment, - // including its own length (2 bytes) and excluding the marker. - stream.skip(markerLength - 2); // Jump to the next marker. - } else { - // The marker length is invalid, resetting the stream position. - stream.skip(-2); - } - break; - } - if (foundEOI) { - break; - } - } - length = stream.pos - startPos; - if (b === -1) { - warn('Inline DCTDecode image stream: ' + - 'EOI marker not found, searching for /EI/ instead.'); - stream.skip(-length); // Reset the stream position. - return this.findDefaultInlineStreamEnd(stream); - } - this.inlineStreamSkipEI(stream); - return length; - }, - /** - * Find the EOD (end-of-data) marker '~>' (i.e. TILDE + GT) of the stream. - * @returns {number} The inline stream length. - */ - findASCII85DecodeInlineStreamEnd: - function Parser_findASCII85DecodeInlineStreamEnd(stream) { - var TILDE = 0x7E, GT = 0x3E; - var startPos = stream.pos, ch, length; - while ((ch = stream.getByte()) !== -1) { - if (ch === TILDE && stream.peekByte() === GT) { - stream.skip(); - break; - } - } - length = stream.pos - startPos; - if (ch === -1) { - warn('Inline ASCII85Decode image stream: ' + - 'EOD marker not found, searching for /EI/ instead.'); - stream.skip(-length); // Reset the stream position. - return this.findDefaultInlineStreamEnd(stream); - } - this.inlineStreamSkipEI(stream); - return length; - }, - /** - * Find the EOD (end-of-data) marker '>' (i.e. GT) of the stream. - * @returns {number} The inline stream length. - */ - findASCIIHexDecodeInlineStreamEnd: - function Parser_findASCIIHexDecodeInlineStreamEnd(stream) { - var GT = 0x3E; - var startPos = stream.pos, ch, length; - while ((ch = stream.getByte()) !== -1) { - if (ch === GT) { - break; - } - } - length = stream.pos - startPos; - if (ch === -1) { - warn('Inline ASCIIHexDecode image stream: ' + - 'EOD marker not found, searching for /EI/ instead.'); - stream.skip(-length); // Reset the stream position. - return this.findDefaultInlineStreamEnd(stream); - } - this.inlineStreamSkipEI(stream); - return length; - }, - /** - * Skip over the /EI/ for streams where we search for an EOD marker. - */ - inlineStreamSkipEI: function Parser_inlineStreamSkipEI(stream) { - var E = 0x45, I = 0x49; - var state = 0, ch; - while ((ch = stream.getByte()) !== -1) { - if (state === 0) { - state = (ch === E) ? 1 : 0; - } else if (state === 1) { - state = (ch === I) ? 2 : 0; - } else if (state === 2) { - break; - } - } - }, - makeInlineImage: function Parser_makeInlineImage(cipherTransform) { - var lexer = this.lexer; - var stream = lexer.stream; - - // Parse dictionary. - var dict = new Dict(this.xref); - while (!isCmd(this.buf1, 'ID') && !isEOF(this.buf1)) { - if (!isName(this.buf1)) { - error('Dictionary key must be a name object'); - } - var key = this.buf1.name; - this.shift(); - if (isEOF(this.buf1)) { - break; - } - dict.set(key, this.getObj(cipherTransform)); - } - - // Extract the name of the first (i.e. the current) image filter. - var filter = dict.get('Filter', 'F'), filterName; - if (isName(filter)) { - filterName = filter.name; - } else if (isArray(filter) && isName(filter[0])) { - filterName = filter[0].name; - } - - // Parse image stream. - var startPos = stream.pos, length, i, ii; - if (filterName === 'DCTDecode' || filterName === 'DCT') { - length = this.findDCTDecodeInlineStreamEnd(stream); - } else if (filterName === 'ASCII85Decide' || filterName === 'A85') { - length = this.findASCII85DecodeInlineStreamEnd(stream); - } else if (filterName === 'ASCIIHexDecode' || filterName === 'AHx') { - length = this.findASCIIHexDecodeInlineStreamEnd(stream); - } else { - length = this.findDefaultInlineStreamEnd(stream); - } - var imageStream = stream.makeSubStream(startPos, length, dict); - - // Cache all images below the MAX_LENGTH_TO_CACHE threshold by their - // adler32 checksum. - var adler32; - if (length < MAX_LENGTH_TO_CACHE) { - var imageBytes = imageStream.getBytes(); - imageStream.reset(); - - var a = 1; - var b = 0; - for (i = 0, ii = imageBytes.length; i < ii; ++i) { - // No modulo required in the loop if imageBytes.length < 5552. - a += imageBytes[i] & 0xff; - b += a; - } - adler32 = ((b % 65521) << 16) | (a % 65521); - - if (this.imageCache.adler32 === adler32) { - this.buf2 = Cmd.get('EI'); - this.shift(); - - this.imageCache[adler32].reset(); - return this.imageCache[adler32]; - } - } - - if (cipherTransform) { - imageStream = cipherTransform.createStream(imageStream, length); - } - - imageStream = this.filter(imageStream, dict, length); - imageStream.dict = dict; - if (adler32 !== undefined) { - imageStream.cacheKey = 'inline_' + length + '_' + adler32; - this.imageCache[adler32] = imageStream; - } - - this.buf2 = Cmd.get('EI'); - this.shift(); - - return imageStream; - }, - makeStream: function Parser_makeStream(dict, cipherTransform) { - var lexer = this.lexer; - var stream = lexer.stream; - - // get stream start position - lexer.skipToNextLine(); - var pos = stream.pos - 1; - - // get length - var length = dict.get('Length'); - if (!isInt(length)) { - info('Bad ' + length + ' attribute in stream'); - length = 0; - } - - // skip over the stream data - stream.pos = pos + length; - lexer.nextChar(); - - // Shift '>>' and check whether the new object marks the end of the stream - if (this.tryShift() && isCmd(this.buf2, 'endstream')) { - this.shift(); // 'stream' - } else { - // bad stream length, scanning for endstream - stream.pos = pos; - var SCAN_BLOCK_SIZE = 2048; - var ENDSTREAM_SIGNATURE_LENGTH = 9; - var ENDSTREAM_SIGNATURE = [0x65, 0x6E, 0x64, 0x73, 0x74, 0x72, 0x65, - 0x61, 0x6D]; - var skipped = 0, found = false, i, j; - while (stream.pos < stream.end) { - var scanBytes = stream.peekBytes(SCAN_BLOCK_SIZE); - var scanLength = scanBytes.length - ENDSTREAM_SIGNATURE_LENGTH; - if (scanLength <= 0) { - break; - } - found = false; - for (i = 0, j = 0; i < scanLength; i++) { - var b = scanBytes[i]; - if (b !== ENDSTREAM_SIGNATURE[j]) { - i -= j; - j = 0; - } else { - j++; - if (j >= ENDSTREAM_SIGNATURE_LENGTH) { - i++; - found = true; - break; - } - } - } - if (found) { - skipped += i - ENDSTREAM_SIGNATURE_LENGTH; - stream.pos += i - ENDSTREAM_SIGNATURE_LENGTH; - break; - } - skipped += scanLength; - stream.pos += scanLength; - } - if (!found) { - error('Missing endstream'); - } - length = skipped; - - lexer.nextChar(); - this.shift(); - this.shift(); - } - this.shift(); // 'endstream' - - stream = stream.makeSubStream(pos, length, dict); - if (cipherTransform) { - stream = cipherTransform.createStream(stream, length); - } - stream = this.filter(stream, dict, length); - stream.dict = dict; - return stream; - }, - filter: function Parser_filter(stream, dict, length) { - var filter = dict.get('Filter', 'F'); - var params = dict.get('DecodeParms', 'DP'); - if (isName(filter)) { - return this.makeFilter(stream, filter.name, length, params); - } - - var maybeLength = length; - if (isArray(filter)) { - var filterArray = filter; - var paramsArray = params; - for (var i = 0, ii = filterArray.length; i < ii; ++i) { - filter = filterArray[i]; - if (!isName(filter)) { - error('Bad filter name: ' + filter); - } - - params = null; - if (isArray(paramsArray) && (i in paramsArray)) { - params = paramsArray[i]; - } - stream = this.makeFilter(stream, filter.name, maybeLength, params); - // after the first stream the length variable is invalid - maybeLength = null; - } - } - return stream; - }, - makeFilter: function Parser_makeFilter(stream, name, maybeLength, params) { - if (stream.dict.get('Length') === 0 && !maybeLength) { - warn('Empty "' + name + '" stream.'); - return new NullStream(stream); - } - try { - if (params && this.xref) { - params = this.xref.fetchIfRef(params); - } - var xrefStreamStats = this.xref.stats.streamTypes; - if (name === 'FlateDecode' || name === 'Fl') { - xrefStreamStats[StreamType.FLATE] = true; - if (params) { - return new PredictorStream(new FlateStream(stream, maybeLength), - maybeLength, params); - } - return new FlateStream(stream, maybeLength); - } - if (name === 'LZWDecode' || name === 'LZW') { - xrefStreamStats[StreamType.LZW] = true; - var earlyChange = 1; - if (params) { - if (params.has('EarlyChange')) { - earlyChange = params.get('EarlyChange'); - } - return new PredictorStream( - new LZWStream(stream, maybeLength, earlyChange), - maybeLength, params); - } - return new LZWStream(stream, maybeLength, earlyChange); - } - if (name === 'DCTDecode' || name === 'DCT') { - xrefStreamStats[StreamType.DCT] = true; - return new JpegStream(stream, maybeLength, stream.dict, this.xref); - } - if (name === 'JPXDecode' || name === 'JPX') { - xrefStreamStats[StreamType.JPX] = true; - return new JpxStream(stream, maybeLength, stream.dict); - } - if (name === 'ASCII85Decode' || name === 'A85') { - xrefStreamStats[StreamType.A85] = true; - return new Ascii85Stream(stream, maybeLength); - } - if (name === 'ASCIIHexDecode' || name === 'AHx') { - xrefStreamStats[StreamType.AHX] = true; - return new AsciiHexStream(stream, maybeLength); - } - if (name === 'CCITTFaxDecode' || name === 'CCF') { - xrefStreamStats[StreamType.CCF] = true; - return new CCITTFaxStream(stream, maybeLength, params); - } - if (name === 'RunLengthDecode' || name === 'RL') { - xrefStreamStats[StreamType.RL] = true; - return new RunLengthStream(stream, maybeLength); - } - if (name === 'JBIG2Decode') { - xrefStreamStats[StreamType.JBIG] = true; - return new Jbig2Stream(stream, maybeLength, stream.dict); - } - warn('filter "' + name + '" not supported yet'); - return stream; - } catch (ex) { - if (ex instanceof MissingDataException) { - throw ex; - } - warn('Invalid stream: \"' + ex + '\"'); - return new NullStream(stream); - } - } - }; - - return Parser; -})(); - -var Lexer = (function LexerClosure() { - function Lexer(stream, knownCommands) { - this.stream = stream; - this.nextChar(); - - // While lexing, we build up many strings one char at a time. Using += for - // this can result in lots of garbage strings. It's better to build an - // array of single-char strings and then join() them together at the end. - // And reusing a single array (i.e. |this.strBuf|) over and over for this - // purpose uses less memory than using a new array for each string. - this.strBuf = []; - - // The PDFs might have "glued" commands with other commands, operands or - // literals, e.g. "q1". The knownCommands is a dictionary of the valid - // commands and their prefixes. The prefixes are built the following way: - // if there a command that is a prefix of the other valid command or - // literal (e.g. 'f' and 'false') the following prefixes must be included, - // 'fa', 'fal', 'fals'. The prefixes are not needed, if the command has no - // other commands or literals as a prefix. The knowCommands is optional. - this.knownCommands = knownCommands; - } - - Lexer.isSpace = function Lexer_isSpace(ch) { - // Space is one of the following characters: SPACE, TAB, CR or LF. - return (ch === 0x20 || ch === 0x09 || ch === 0x0D || ch === 0x0A); - }; - - // A '1' in this array means the character is white space. A '1' or - // '2' means the character ends a name or command. - var specialChars = [ - 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, // 0x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1x - 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, // 2x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, // 3x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 4x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 5x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 6x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 7x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 8x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 9x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ax - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // bx - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // cx - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // dx - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ex - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // fx - ]; - - function toHexDigit(ch) { - if (ch >= 0x30 && ch <= 0x39) { // '0'-'9' - return ch & 0x0F; - } - if ((ch >= 0x41 && ch <= 0x46) || (ch >= 0x61 && ch <= 0x66)) { - // 'A'-'F', 'a'-'f' - return (ch & 0x0F) + 9; - } - return -1; - } - - Lexer.prototype = { - nextChar: function Lexer_nextChar() { - return (this.currentChar = this.stream.getByte()); - }, - peekChar: function Lexer_peekChar() { - return this.stream.peekByte(); - }, - getNumber: function Lexer_getNumber() { - var ch = this.currentChar; - var eNotation = false; - var divideBy = 0; // different from 0 if it's a floating point value - var sign = 1; - - if (ch === 0x2D) { // '-' - sign = -1; - ch = this.nextChar(); - - if (ch === 0x2D) { // '-' - // Ignore double negative (this is consistent with Adobe Reader). - ch = this.nextChar(); - } - } else if (ch === 0x2B) { // '+' - ch = this.nextChar(); - } - if (ch === 0x2E) { // '.' - divideBy = 10; - ch = this.nextChar(); - } - if (ch < 0x30 || ch > 0x39) { // '0' - '9' - error('Invalid number: ' + String.fromCharCode(ch)); - return 0; - } - - var baseValue = ch - 0x30; // '0' - var powerValue = 0; - var powerValueSign = 1; - - while ((ch = this.nextChar()) >= 0) { - if (0x30 <= ch && ch <= 0x39) { // '0' - '9' - var currentDigit = ch - 0x30; // '0' - if (eNotation) { // We are after an 'e' or 'E' - powerValue = powerValue * 10 + currentDigit; - } else { - if (divideBy !== 0) { // We are after a point - divideBy *= 10; - } - baseValue = baseValue * 10 + currentDigit; - } - } else if (ch === 0x2E) { // '.' - if (divideBy === 0) { - divideBy = 1; - } else { - // A number can have only one '.' - break; - } - } else if (ch === 0x2D) { // '-' - // ignore minus signs in the middle of numbers to match - // Adobe's behavior - warn('Badly formated number'); - } else if (ch === 0x45 || ch === 0x65) { // 'E', 'e' - // 'E' can be either a scientific notation or the beginning of a new - // operator - ch = this.peekChar(); - if (ch === 0x2B || ch === 0x2D) { // '+', '-' - powerValueSign = (ch === 0x2D) ? -1 : 1; - this.nextChar(); // Consume the sign character - } else if (ch < 0x30 || ch > 0x39) { // '0' - '9' - // The 'E' must be the beginning of a new operator - break; - } - eNotation = true; - } else { - // the last character doesn't belong to us - break; - } - } - - if (divideBy !== 0) { - baseValue /= divideBy; - } - if (eNotation) { - baseValue *= Math.pow(10, powerValueSign * powerValue); - } - return sign * baseValue; - }, - getString: function Lexer_getString() { - var numParen = 1; - var done = false; - var strBuf = this.strBuf; - strBuf.length = 0; - - var ch = this.nextChar(); - while (true) { - var charBuffered = false; - switch (ch | 0) { - case -1: - warn('Unterminated string'); - done = true; - break; - case 0x28: // '(' - ++numParen; - strBuf.push('('); - break; - case 0x29: // ')' - if (--numParen === 0) { - this.nextChar(); // consume strings ')' - done = true; - } else { - strBuf.push(')'); - } - break; - case 0x5C: // '\\' - ch = this.nextChar(); - switch (ch) { - case -1: - warn('Unterminated string'); - done = true; - break; - case 0x6E: // 'n' - strBuf.push('\n'); - break; - case 0x72: // 'r' - strBuf.push('\r'); - break; - case 0x74: // 't' - strBuf.push('\t'); - break; - case 0x62: // 'b' - strBuf.push('\b'); - break; - case 0x66: // 'f' - strBuf.push('\f'); - break; - case 0x5C: // '\' - case 0x28: // '(' - case 0x29: // ')' - strBuf.push(String.fromCharCode(ch)); - break; - case 0x30: case 0x31: case 0x32: case 0x33: // '0'-'3' - case 0x34: case 0x35: case 0x36: case 0x37: // '4'-'7' - var x = ch & 0x0F; - ch = this.nextChar(); - charBuffered = true; - if (ch >= 0x30 && ch <= 0x37) { // '0'-'7' - x = (x << 3) + (ch & 0x0F); - ch = this.nextChar(); - if (ch >= 0x30 && ch <= 0x37) { // '0'-'7' - charBuffered = false; - x = (x << 3) + (ch & 0x0F); - } - } - strBuf.push(String.fromCharCode(x)); - break; - case 0x0D: // CR - if (this.peekChar() === 0x0A) { // LF - this.nextChar(); - } - break; - case 0x0A: // LF - break; - default: - strBuf.push(String.fromCharCode(ch)); - break; - } - break; - default: - strBuf.push(String.fromCharCode(ch)); - break; - } - if (done) { - break; - } - if (!charBuffered) { - ch = this.nextChar(); - } - } - return strBuf.join(''); - }, - getName: function Lexer_getName() { - var ch, previousCh; - var strBuf = this.strBuf; - strBuf.length = 0; - while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { - if (ch === 0x23) { // '#' - ch = this.nextChar(); - if (specialChars[ch]) { - warn('Lexer_getName: ' + - 'NUMBER SIGN (#) should be followed by a hexadecimal number.'); - strBuf.push('#'); - break; - } - var x = toHexDigit(ch); - if (x !== -1) { - previousCh = ch; - ch = this.nextChar(); - var x2 = toHexDigit(ch); - if (x2 === -1) { - warn('Lexer_getName: Illegal digit (' + - String.fromCharCode(ch) +') in hexadecimal number.'); - strBuf.push('#', String.fromCharCode(previousCh)); - if (specialChars[ch]) { - break; - } - strBuf.push(String.fromCharCode(ch)); - continue; - } - strBuf.push(String.fromCharCode((x << 4) | x2)); - } else { - strBuf.push('#', String.fromCharCode(ch)); - } - } else { - strBuf.push(String.fromCharCode(ch)); - } - } - if (strBuf.length > 127) { - warn('name token is longer than allowed by the spec: ' + strBuf.length); - } - return Name.get(strBuf.join('')); - }, - getHexString: function Lexer_getHexString() { - var strBuf = this.strBuf; - strBuf.length = 0; - var ch = this.currentChar; - var isFirstHex = true; - var firstDigit; - var secondDigit; - while (true) { - if (ch < 0) { - warn('Unterminated hex string'); - break; - } else if (ch === 0x3E) { // '>' - this.nextChar(); - break; - } else if (specialChars[ch] === 1) { - ch = this.nextChar(); - continue; - } else { - if (isFirstHex) { - firstDigit = toHexDigit(ch); - if (firstDigit === -1) { - warn('Ignoring invalid character "' + ch + '" in hex string'); - ch = this.nextChar(); - continue; - } - } else { - secondDigit = toHexDigit(ch); - if (secondDigit === -1) { - warn('Ignoring invalid character "' + ch + '" in hex string'); - ch = this.nextChar(); - continue; - } - strBuf.push(String.fromCharCode((firstDigit << 4) | secondDigit)); - } - isFirstHex = !isFirstHex; - ch = this.nextChar(); - } - } - return strBuf.join(''); - }, - getObj: function Lexer_getObj() { - // skip whitespace and comments - var comment = false; - var ch = this.currentChar; - while (true) { - if (ch < 0) { - return EOF; - } - if (comment) { - if (ch === 0x0A || ch === 0x0D) { // LF, CR - comment = false; - } - } else if (ch === 0x25) { // '%' - comment = true; - } else if (specialChars[ch] !== 1) { - break; - } - ch = this.nextChar(); - } - - // start reading token - switch (ch | 0) { - case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: // '0'-'4' - case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: // '5'-'9' - case 0x2B: case 0x2D: case 0x2E: // '+', '-', '.' - return this.getNumber(); - case 0x28: // '(' - return this.getString(); - case 0x2F: // '/' - return this.getName(); - // array punctuation - case 0x5B: // '[' - this.nextChar(); - return Cmd.get('['); - case 0x5D: // ']' - this.nextChar(); - return Cmd.get(']'); - // hex string or dict punctuation - case 0x3C: // '<' - ch = this.nextChar(); - if (ch === 0x3C) { - // dict punctuation - this.nextChar(); - return Cmd.get('<<'); - } - return this.getHexString(); - // dict punctuation - case 0x3E: // '>' - ch = this.nextChar(); - if (ch === 0x3E) { - this.nextChar(); - return Cmd.get('>>'); - } - return Cmd.get('>'); - case 0x7B: // '{' - this.nextChar(); - return Cmd.get('{'); - case 0x7D: // '}' - this.nextChar(); - return Cmd.get('}'); - case 0x29: // ')' - error('Illegal character: ' + ch); - break; - } - - // command - var str = String.fromCharCode(ch); - var knownCommands = this.knownCommands; - var knownCommandFound = knownCommands && knownCommands[str] !== undefined; - while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { - // stop if known command is found and next character does not make - // the str a command - var possibleCommand = str + String.fromCharCode(ch); - if (knownCommandFound && knownCommands[possibleCommand] === undefined) { - break; - } - if (str.length === 128) { - error('Command token too long: ' + str.length); - } - str = possibleCommand; - knownCommandFound = knownCommands && knownCommands[str] !== undefined; - } - if (str === 'true') { - return true; - } - if (str === 'false') { - return false; - } - if (str === 'null') { - return null; - } - return Cmd.get(str); - }, - skipToNextLine: function Lexer_skipToNextLine() { - var ch = this.currentChar; - while (ch >= 0) { - if (ch === 0x0D) { // CR - ch = this.nextChar(); - if (ch === 0x0A) { // LF - this.nextChar(); - } - break; - } else if (ch === 0x0A) { // LF - this.nextChar(); - break; - } - ch = this.nextChar(); - } - } - }; - - return Lexer; -})(); - -var Linearization = { - create: function LinearizationCreate(stream) { - function getInt(name, allowZeroValue) { - var obj = linDict.get(name); - if (isInt(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) { - return obj; - } - throw new Error('The "' + name + '" parameter in the linearization ' + - 'dictionary is invalid.'); - } - function getHints() { - var hints = linDict.get('H'), hintsLength, item; - if (isArray(hints) && - ((hintsLength = hints.length) === 2 || hintsLength === 4)) { - for (var index = 0; index < hintsLength; index++) { - if (!(isInt(item = hints[index]) && item > 0)) { - throw new Error('Hint (' + index + - ') in the linearization dictionary is invalid.'); - } - } - return hints; - } - throw new Error('Hint array in the linearization dictionary is invalid.'); - } - var parser = new Parser(new Lexer(stream), false, null); - var obj1 = parser.getObj(); - var obj2 = parser.getObj(); - var obj3 = parser.getObj(); - var linDict = parser.getObj(); - var obj, length; - if (!(isInt(obj1) && isInt(obj2) && isCmd(obj3, 'obj') && isDict(linDict) && - isNum(obj = linDict.get('Linearized')) && obj > 0)) { - return null; // No valid linearization dictionary found. - } else if ((length = getInt('L')) !== stream.length) { - throw new Error('The "L" parameter in the linearization dictionary ' + - 'does not equal the stream length.'); - } - return { - length: length, - hints: getHints(), - objectNumberFirst: getInt('O'), - endFirst: getInt('E'), - numPages: getInt('N'), - mainXRefEntriesOffset: getInt('T'), - pageFirst: (linDict.has('P') ? getInt('P', true) : 0) - }; - } -}; - - -var PostScriptParser = (function PostScriptParserClosure() { - function PostScriptParser(lexer) { - this.lexer = lexer; - this.operators = []; - this.token = null; - this.prev = null; - } - PostScriptParser.prototype = { - nextToken: function PostScriptParser_nextToken() { - this.prev = this.token; - this.token = this.lexer.getToken(); - }, - accept: function PostScriptParser_accept(type) { - if (this.token.type === type) { - this.nextToken(); - return true; - } - return false; - }, - expect: function PostScriptParser_expect(type) { - if (this.accept(type)) { - return true; - } - error('Unexpected symbol: found ' + this.token.type + ' expected ' + - type + '.'); - }, - parse: function PostScriptParser_parse() { - this.nextToken(); - this.expect(PostScriptTokenTypes.LBRACE); - this.parseBlock(); - this.expect(PostScriptTokenTypes.RBRACE); - return this.operators; - }, - parseBlock: function PostScriptParser_parseBlock() { - while (true) { - if (this.accept(PostScriptTokenTypes.NUMBER)) { - this.operators.push(this.prev.value); - } else if (this.accept(PostScriptTokenTypes.OPERATOR)) { - this.operators.push(this.prev.value); - } else if (this.accept(PostScriptTokenTypes.LBRACE)) { - this.parseCondition(); - } else { - return; - } - } - }, - parseCondition: function PostScriptParser_parseCondition() { - // Add two place holders that will be updated later - var conditionLocation = this.operators.length; - this.operators.push(null, null); - - this.parseBlock(); - this.expect(PostScriptTokenTypes.RBRACE); - if (this.accept(PostScriptTokenTypes.IF)) { - // The true block is right after the 'if' so it just falls through on - // true else it jumps and skips the true block. - this.operators[conditionLocation] = this.operators.length; - this.operators[conditionLocation + 1] = 'jz'; - } else if (this.accept(PostScriptTokenTypes.LBRACE)) { - var jumpLocation = this.operators.length; - this.operators.push(null, null); - var endOfTrue = this.operators.length; - this.parseBlock(); - this.expect(PostScriptTokenTypes.RBRACE); - this.expect(PostScriptTokenTypes.IFELSE); - // The jump is added at the end of the true block to skip the false - // block. - this.operators[jumpLocation] = this.operators.length; - this.operators[jumpLocation + 1] = 'j'; - - this.operators[conditionLocation] = endOfTrue; - this.operators[conditionLocation + 1] = 'jz'; - } else { - error('PS Function: error parsing conditional.'); - } - } - }; - return PostScriptParser; -})(); - -var PostScriptTokenTypes = { - LBRACE: 0, - RBRACE: 1, - NUMBER: 2, - OPERATOR: 3, - IF: 4, - IFELSE: 5 -}; - -var PostScriptToken = (function PostScriptTokenClosure() { - function PostScriptToken(type, value) { - this.type = type; - this.value = value; - } - - var opCache = {}; - - PostScriptToken.getOperator = function PostScriptToken_getOperator(op) { - var opValue = opCache[op]; - if (opValue) { - return opValue; - } - return opCache[op] = new PostScriptToken(PostScriptTokenTypes.OPERATOR, op); - }; - - PostScriptToken.LBRACE = new PostScriptToken(PostScriptTokenTypes.LBRACE, - '{'); - PostScriptToken.RBRACE = new PostScriptToken(PostScriptTokenTypes.RBRACE, - '}'); - PostScriptToken.IF = new PostScriptToken(PostScriptTokenTypes.IF, 'IF'); - PostScriptToken.IFELSE = new PostScriptToken(PostScriptTokenTypes.IFELSE, - 'IFELSE'); - return PostScriptToken; -})(); - -var PostScriptLexer = (function PostScriptLexerClosure() { - function PostScriptLexer(stream) { - this.stream = stream; - this.nextChar(); - - this.strBuf = []; - } - PostScriptLexer.prototype = { - nextChar: function PostScriptLexer_nextChar() { - return (this.currentChar = this.stream.getByte()); - }, - getToken: function PostScriptLexer_getToken() { - var comment = false; - var ch = this.currentChar; - - // skip comments - while (true) { - if (ch < 0) { - return EOF; - } - - if (comment) { - if (ch === 0x0A || ch === 0x0D) { - comment = false; - } - } else if (ch === 0x25) { // '%' - comment = true; - } else if (!Lexer.isSpace(ch)) { - break; - } - ch = this.nextChar(); - } - switch (ch | 0) { - case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: // '0'-'4' - case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: // '5'-'9' - case 0x2B: case 0x2D: case 0x2E: // '+', '-', '.' - return new PostScriptToken(PostScriptTokenTypes.NUMBER, - this.getNumber()); - case 0x7B: // '{' - this.nextChar(); - return PostScriptToken.LBRACE; - case 0x7D: // '}' - this.nextChar(); - return PostScriptToken.RBRACE; - } - // operator - var strBuf = this.strBuf; - strBuf.length = 0; - strBuf[0] = String.fromCharCode(ch); - - while ((ch = this.nextChar()) >= 0 && // and 'A'-'Z', 'a'-'z' - ((ch >= 0x41 && ch <= 0x5A) || (ch >= 0x61 && ch <= 0x7A))) { - strBuf.push(String.fromCharCode(ch)); - } - var str = strBuf.join(''); - switch (str.toLowerCase()) { - case 'if': - return PostScriptToken.IF; - case 'ifelse': - return PostScriptToken.IFELSE; - default: - return PostScriptToken.getOperator(str); - } - }, - getNumber: function PostScriptLexer_getNumber() { - var ch = this.currentChar; - var strBuf = this.strBuf; - strBuf.length = 0; - strBuf[0] = String.fromCharCode(ch); - - while ((ch = this.nextChar()) >= 0) { - if ((ch >= 0x30 && ch <= 0x39) || // '0'-'9' - ch === 0x2D || ch === 0x2E) { // '-', '.' - strBuf.push(String.fromCharCode(ch)); - } else { - break; - } - } - var value = parseFloat(strBuf.join('')); - if (isNaN(value)) { - error('Invalid floating point number: ' + value); - } - return value; - } - }; - return PostScriptLexer; -})(); - - -var Stream = (function StreamClosure() { - function Stream(arrayBuffer, start, length, dict) { - this.bytes = (arrayBuffer instanceof Uint8Array ? - arrayBuffer : new Uint8Array(arrayBuffer)); - this.start = start || 0; - this.pos = this.start; - this.end = (start + length) || this.bytes.length; - this.dict = dict; - } - - // required methods for a stream. if a particular stream does not - // implement these, an error should be thrown - Stream.prototype = { - get length() { - return this.end - this.start; - }, - get isEmpty() { - return this.length === 0; - }, - getByte: function Stream_getByte() { - if (this.pos >= this.end) { - return -1; - } - return this.bytes[this.pos++]; - }, - getUint16: function Stream_getUint16() { - var b0 = this.getByte(); - var b1 = this.getByte(); - if (b0 === -1 || b1 === -1) { - return -1; - } - return (b0 << 8) + b1; - }, - getInt32: function Stream_getInt32() { - var b0 = this.getByte(); - var b1 = this.getByte(); - var b2 = this.getByte(); - var b3 = this.getByte(); - return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; - }, - // returns subarray of original buffer - // should only be read - getBytes: function Stream_getBytes(length) { - var bytes = this.bytes; - var pos = this.pos; - var strEnd = this.end; - - if (!length) { - return bytes.subarray(pos, strEnd); - } - var end = pos + length; - if (end > strEnd) { - end = strEnd; - } - this.pos = end; - return bytes.subarray(pos, end); - }, - peekByte: function Stream_peekByte() { - var peekedByte = this.getByte(); - this.pos--; - return peekedByte; - }, - peekBytes: function Stream_peekBytes(length) { - var bytes = this.getBytes(length); - this.pos -= bytes.length; - return bytes; - }, - skip: function Stream_skip(n) { - if (!n) { - n = 1; - } - this.pos += n; - }, - reset: function Stream_reset() { - this.pos = this.start; - }, - moveStart: function Stream_moveStart() { - this.start = this.pos; - }, - makeSubStream: function Stream_makeSubStream(start, length, dict) { - return new Stream(this.bytes.buffer, start, length, dict); - }, - isStream: true - }; - - return Stream; -})(); - -var StringStream = (function StringStreamClosure() { - function StringStream(str) { - var length = str.length; - var bytes = new Uint8Array(length); - for (var n = 0; n < length; ++n) { - bytes[n] = str.charCodeAt(n); - } - Stream.call(this, bytes); - } - - StringStream.prototype = Stream.prototype; - - return StringStream; -})(); - -// super class for the decoding streams -var DecodeStream = (function DecodeStreamClosure() { - // Lots of DecodeStreams are created whose buffers are never used. For these - // we share a single empty buffer. This is (a) space-efficient and (b) avoids - // having special cases that would be required if we used |null| for an empty - // buffer. - var emptyBuffer = new Uint8Array(0); - - function DecodeStream(maybeMinBufferLength) { - this.pos = 0; - this.bufferLength = 0; - this.eof = false; - this.buffer = emptyBuffer; - this.minBufferLength = 512; - if (maybeMinBufferLength) { - // Compute the first power of two that is as big as maybeMinBufferLength. - while (this.minBufferLength < maybeMinBufferLength) { - this.minBufferLength *= 2; - } - } - } - - DecodeStream.prototype = { - get isEmpty() { - while (!this.eof && this.bufferLength === 0) { - this.readBlock(); - } - return this.bufferLength === 0; - }, - ensureBuffer: function DecodeStream_ensureBuffer(requested) { - var buffer = this.buffer; - if (requested <= buffer.byteLength) { - return buffer; - } - var size = this.minBufferLength; - while (size < requested) { - size *= 2; - } - var buffer2 = new Uint8Array(size); - buffer2.set(buffer); - return (this.buffer = buffer2); - }, - getByte: function DecodeStream_getByte() { - var pos = this.pos; - while (this.bufferLength <= pos) { - if (this.eof) { - return -1; - } - this.readBlock(); - } - return this.buffer[this.pos++]; - }, - getUint16: function DecodeStream_getUint16() { - var b0 = this.getByte(); - var b1 = this.getByte(); - if (b0 === -1 || b1 === -1) { - return -1; - } - return (b0 << 8) + b1; - }, - getInt32: function DecodeStream_getInt32() { - var b0 = this.getByte(); - var b1 = this.getByte(); - var b2 = this.getByte(); - var b3 = this.getByte(); - return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; - }, - getBytes: function DecodeStream_getBytes(length) { - var end, pos = this.pos; - - if (length) { - this.ensureBuffer(pos + length); - end = pos + length; - - while (!this.eof && this.bufferLength < end) { - this.readBlock(); - } - var bufEnd = this.bufferLength; - if (end > bufEnd) { - end = bufEnd; - } - } else { - while (!this.eof) { - this.readBlock(); - } - end = this.bufferLength; - } - - this.pos = end; - return this.buffer.subarray(pos, end); - }, - peekByte: function DecodeStream_peekByte() { - var peekedByte = this.getByte(); - this.pos--; - return peekedByte; - }, - peekBytes: function DecodeStream_peekBytes(length) { - var bytes = this.getBytes(length); - this.pos -= bytes.length; - return bytes; - }, - makeSubStream: function DecodeStream_makeSubStream(start, length, dict) { - var end = start + length; - while (this.bufferLength <= end && !this.eof) { - this.readBlock(); - } - return new Stream(this.buffer, start, length, dict); - }, - skip: function DecodeStream_skip(n) { - if (!n) { - n = 1; - } - this.pos += n; - }, - reset: function DecodeStream_reset() { - this.pos = 0; - }, - getBaseStreams: function DecodeStream_getBaseStreams() { - if (this.str && this.str.getBaseStreams) { - return this.str.getBaseStreams(); - } - return []; - } - }; - - return DecodeStream; -})(); - -var StreamsSequenceStream = (function StreamsSequenceStreamClosure() { - function StreamsSequenceStream(streams) { - this.streams = streams; - DecodeStream.call(this, /* maybeLength = */ null); - } - - StreamsSequenceStream.prototype = Object.create(DecodeStream.prototype); - - StreamsSequenceStream.prototype.readBlock = - function streamSequenceStreamReadBlock() { - - var streams = this.streams; - if (streams.length === 0) { - this.eof = true; - return; - } - var stream = streams.shift(); - var chunk = stream.getBytes(); - var bufferLength = this.bufferLength; - var newLength = bufferLength + chunk.length; - var buffer = this.ensureBuffer(newLength); - buffer.set(chunk, bufferLength); - this.bufferLength = newLength; - }; - - StreamsSequenceStream.prototype.getBaseStreams = - function StreamsSequenceStream_getBaseStreams() { - - var baseStreams = []; - for (var i = 0, ii = this.streams.length; i < ii; i++) { - var stream = this.streams[i]; - if (stream.getBaseStreams) { - Util.appendToArray(baseStreams, stream.getBaseStreams()); - } - } - return baseStreams; - }; - - return StreamsSequenceStream; -})(); - -var FlateStream = (function FlateStreamClosure() { - var codeLenCodeMap = new Int32Array([ - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 - ]); - - var lengthDecode = new Int32Array([ - 0x00003, 0x00004, 0x00005, 0x00006, 0x00007, 0x00008, 0x00009, 0x0000a, - 0x1000b, 0x1000d, 0x1000f, 0x10011, 0x20013, 0x20017, 0x2001b, 0x2001f, - 0x30023, 0x3002b, 0x30033, 0x3003b, 0x40043, 0x40053, 0x40063, 0x40073, - 0x50083, 0x500a3, 0x500c3, 0x500e3, 0x00102, 0x00102, 0x00102 - ]); - - var distDecode = new Int32Array([ - 0x00001, 0x00002, 0x00003, 0x00004, 0x10005, 0x10007, 0x20009, 0x2000d, - 0x30011, 0x30019, 0x40021, 0x40031, 0x50041, 0x50061, 0x60081, 0x600c1, - 0x70101, 0x70181, 0x80201, 0x80301, 0x90401, 0x90601, 0xa0801, 0xa0c01, - 0xb1001, 0xb1801, 0xc2001, 0xc3001, 0xd4001, 0xd6001 - ]); - - var fixedLitCodeTab = [new Int32Array([ - 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c0, - 0x70108, 0x80060, 0x80020, 0x900a0, 0x80000, 0x80080, 0x80040, 0x900e0, - 0x70104, 0x80058, 0x80018, 0x90090, 0x70114, 0x80078, 0x80038, 0x900d0, - 0x7010c, 0x80068, 0x80028, 0x900b0, 0x80008, 0x80088, 0x80048, 0x900f0, - 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c8, - 0x7010a, 0x80064, 0x80024, 0x900a8, 0x80004, 0x80084, 0x80044, 0x900e8, - 0x70106, 0x8005c, 0x8001c, 0x90098, 0x70116, 0x8007c, 0x8003c, 0x900d8, - 0x7010e, 0x8006c, 0x8002c, 0x900b8, 0x8000c, 0x8008c, 0x8004c, 0x900f8, - 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c4, - 0x70109, 0x80062, 0x80022, 0x900a4, 0x80002, 0x80082, 0x80042, 0x900e4, - 0x70105, 0x8005a, 0x8001a, 0x90094, 0x70115, 0x8007a, 0x8003a, 0x900d4, - 0x7010d, 0x8006a, 0x8002a, 0x900b4, 0x8000a, 0x8008a, 0x8004a, 0x900f4, - 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cc, - 0x7010b, 0x80066, 0x80026, 0x900ac, 0x80006, 0x80086, 0x80046, 0x900ec, - 0x70107, 0x8005e, 0x8001e, 0x9009c, 0x70117, 0x8007e, 0x8003e, 0x900dc, - 0x7010f, 0x8006e, 0x8002e, 0x900bc, 0x8000e, 0x8008e, 0x8004e, 0x900fc, - 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c2, - 0x70108, 0x80061, 0x80021, 0x900a2, 0x80001, 0x80081, 0x80041, 0x900e2, - 0x70104, 0x80059, 0x80019, 0x90092, 0x70114, 0x80079, 0x80039, 0x900d2, - 0x7010c, 0x80069, 0x80029, 0x900b2, 0x80009, 0x80089, 0x80049, 0x900f2, - 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900ca, - 0x7010a, 0x80065, 0x80025, 0x900aa, 0x80005, 0x80085, 0x80045, 0x900ea, - 0x70106, 0x8005d, 0x8001d, 0x9009a, 0x70116, 0x8007d, 0x8003d, 0x900da, - 0x7010e, 0x8006d, 0x8002d, 0x900ba, 0x8000d, 0x8008d, 0x8004d, 0x900fa, - 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c6, - 0x70109, 0x80063, 0x80023, 0x900a6, 0x80003, 0x80083, 0x80043, 0x900e6, - 0x70105, 0x8005b, 0x8001b, 0x90096, 0x70115, 0x8007b, 0x8003b, 0x900d6, - 0x7010d, 0x8006b, 0x8002b, 0x900b6, 0x8000b, 0x8008b, 0x8004b, 0x900f6, - 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900ce, - 0x7010b, 0x80067, 0x80027, 0x900ae, 0x80007, 0x80087, 0x80047, 0x900ee, - 0x70107, 0x8005f, 0x8001f, 0x9009e, 0x70117, 0x8007f, 0x8003f, 0x900de, - 0x7010f, 0x8006f, 0x8002f, 0x900be, 0x8000f, 0x8008f, 0x8004f, 0x900fe, - 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c1, - 0x70108, 0x80060, 0x80020, 0x900a1, 0x80000, 0x80080, 0x80040, 0x900e1, - 0x70104, 0x80058, 0x80018, 0x90091, 0x70114, 0x80078, 0x80038, 0x900d1, - 0x7010c, 0x80068, 0x80028, 0x900b1, 0x80008, 0x80088, 0x80048, 0x900f1, - 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c9, - 0x7010a, 0x80064, 0x80024, 0x900a9, 0x80004, 0x80084, 0x80044, 0x900e9, - 0x70106, 0x8005c, 0x8001c, 0x90099, 0x70116, 0x8007c, 0x8003c, 0x900d9, - 0x7010e, 0x8006c, 0x8002c, 0x900b9, 0x8000c, 0x8008c, 0x8004c, 0x900f9, - 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c5, - 0x70109, 0x80062, 0x80022, 0x900a5, 0x80002, 0x80082, 0x80042, 0x900e5, - 0x70105, 0x8005a, 0x8001a, 0x90095, 0x70115, 0x8007a, 0x8003a, 0x900d5, - 0x7010d, 0x8006a, 0x8002a, 0x900b5, 0x8000a, 0x8008a, 0x8004a, 0x900f5, - 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cd, - 0x7010b, 0x80066, 0x80026, 0x900ad, 0x80006, 0x80086, 0x80046, 0x900ed, - 0x70107, 0x8005e, 0x8001e, 0x9009d, 0x70117, 0x8007e, 0x8003e, 0x900dd, - 0x7010f, 0x8006e, 0x8002e, 0x900bd, 0x8000e, 0x8008e, 0x8004e, 0x900fd, - 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c3, - 0x70108, 0x80061, 0x80021, 0x900a3, 0x80001, 0x80081, 0x80041, 0x900e3, - 0x70104, 0x80059, 0x80019, 0x90093, 0x70114, 0x80079, 0x80039, 0x900d3, - 0x7010c, 0x80069, 0x80029, 0x900b3, 0x80009, 0x80089, 0x80049, 0x900f3, - 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900cb, - 0x7010a, 0x80065, 0x80025, 0x900ab, 0x80005, 0x80085, 0x80045, 0x900eb, - 0x70106, 0x8005d, 0x8001d, 0x9009b, 0x70116, 0x8007d, 0x8003d, 0x900db, - 0x7010e, 0x8006d, 0x8002d, 0x900bb, 0x8000d, 0x8008d, 0x8004d, 0x900fb, - 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c7, - 0x70109, 0x80063, 0x80023, 0x900a7, 0x80003, 0x80083, 0x80043, 0x900e7, - 0x70105, 0x8005b, 0x8001b, 0x90097, 0x70115, 0x8007b, 0x8003b, 0x900d7, - 0x7010d, 0x8006b, 0x8002b, 0x900b7, 0x8000b, 0x8008b, 0x8004b, 0x900f7, - 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900cf, - 0x7010b, 0x80067, 0x80027, 0x900af, 0x80007, 0x80087, 0x80047, 0x900ef, - 0x70107, 0x8005f, 0x8001f, 0x9009f, 0x70117, 0x8007f, 0x8003f, 0x900df, - 0x7010f, 0x8006f, 0x8002f, 0x900bf, 0x8000f, 0x8008f, 0x8004f, 0x900ff - ]), 9]; - - var fixedDistCodeTab = [new Int32Array([ - 0x50000, 0x50010, 0x50008, 0x50018, 0x50004, 0x50014, 0x5000c, 0x5001c, - 0x50002, 0x50012, 0x5000a, 0x5001a, 0x50006, 0x50016, 0x5000e, 0x00000, - 0x50001, 0x50011, 0x50009, 0x50019, 0x50005, 0x50015, 0x5000d, 0x5001d, - 0x50003, 0x50013, 0x5000b, 0x5001b, 0x50007, 0x50017, 0x5000f, 0x00000 - ]), 5]; - - function FlateStream(str, maybeLength) { - this.str = str; - this.dict = str.dict; - - var cmf = str.getByte(); - var flg = str.getByte(); - if (cmf === -1 || flg === -1) { - error('Invalid header in flate stream: ' + cmf + ', ' + flg); - } - if ((cmf & 0x0f) !== 0x08) { - error('Unknown compression method in flate stream: ' + cmf + ', ' + flg); - } - if ((((cmf << 8) + flg) % 31) !== 0) { - error('Bad FCHECK in flate stream: ' + cmf + ', ' + flg); - } - if (flg & 0x20) { - error('FDICT bit set in flate stream: ' + cmf + ', ' + flg); - } - - this.codeSize = 0; - this.codeBuf = 0; - - DecodeStream.call(this, maybeLength); - } - - FlateStream.prototype = Object.create(DecodeStream.prototype); - - FlateStream.prototype.getBits = function FlateStream_getBits(bits) { - var str = this.str; - var codeSize = this.codeSize; - var codeBuf = this.codeBuf; - - var b; - while (codeSize < bits) { - if ((b = str.getByte()) === -1) { - error('Bad encoding in flate stream'); - } - codeBuf |= b << codeSize; - codeSize += 8; - } - b = codeBuf & ((1 << bits) - 1); - this.codeBuf = codeBuf >> bits; - this.codeSize = codeSize -= bits; - - return b; - }; - - FlateStream.prototype.getCode = function FlateStream_getCode(table) { - var str = this.str; - var codes = table[0]; - var maxLen = table[1]; - var codeSize = this.codeSize; - var codeBuf = this.codeBuf; - - var b; - while (codeSize < maxLen) { - if ((b = str.getByte()) === -1) { - // premature end of stream. code might however still be valid. - // codeSize < codeLen check below guards against incomplete codeVal. - break; - } - codeBuf |= (b << codeSize); - codeSize += 8; - } - var code = codes[codeBuf & ((1 << maxLen) - 1)]; - var codeLen = code >> 16; - var codeVal = code & 0xffff; - if (codeLen < 1 || codeSize < codeLen) { - error('Bad encoding in flate stream'); - } - this.codeBuf = (codeBuf >> codeLen); - this.codeSize = (codeSize - codeLen); - return codeVal; - }; - - FlateStream.prototype.generateHuffmanTable = - function flateStreamGenerateHuffmanTable(lengths) { - var n = lengths.length; - - // find max code length - var maxLen = 0; - var i; - for (i = 0; i < n; ++i) { - if (lengths[i] > maxLen) { - maxLen = lengths[i]; - } - } - - // build the table - var size = 1 << maxLen; - var codes = new Int32Array(size); - for (var len = 1, code = 0, skip = 2; - len <= maxLen; - ++len, code <<= 1, skip <<= 1) { - for (var val = 0; val < n; ++val) { - if (lengths[val] === len) { - // bit-reverse the code - var code2 = 0; - var t = code; - for (i = 0; i < len; ++i) { - code2 = (code2 << 1) | (t & 1); - t >>= 1; - } - - // fill the table entries - for (i = code2; i < size; i += skip) { - codes[i] = (len << 16) | val; - } - ++code; - } - } - } - - return [codes, maxLen]; - }; - - FlateStream.prototype.readBlock = function FlateStream_readBlock() { - var buffer, len; - var str = this.str; - // read block header - var hdr = this.getBits(3); - if (hdr & 1) { - this.eof = true; - } - hdr >>= 1; - - if (hdr === 0) { // uncompressed block - var b; - - if ((b = str.getByte()) === -1) { - error('Bad block header in flate stream'); - } - var blockLen = b; - if ((b = str.getByte()) === -1) { - error('Bad block header in flate stream'); - } - blockLen |= (b << 8); - if ((b = str.getByte()) === -1) { - error('Bad block header in flate stream'); - } - var check = b; - if ((b = str.getByte()) === -1) { - error('Bad block header in flate stream'); - } - check |= (b << 8); - if (check !== (~blockLen & 0xffff) && - (blockLen !== 0 || check !== 0)) { - // Ignoring error for bad "empty" block (see issue 1277) - error('Bad uncompressed block length in flate stream'); - } - - this.codeBuf = 0; - this.codeSize = 0; - - var bufferLength = this.bufferLength; - buffer = this.ensureBuffer(bufferLength + blockLen); - var end = bufferLength + blockLen; - this.bufferLength = end; - if (blockLen === 0) { - if (str.peekByte() === -1) { - this.eof = true; - } - } else { - for (var n = bufferLength; n < end; ++n) { - if ((b = str.getByte()) === -1) { - this.eof = true; - break; - } - buffer[n] = b; - } - } - return; - } - - var litCodeTable; - var distCodeTable; - if (hdr === 1) { // compressed block, fixed codes - litCodeTable = fixedLitCodeTab; - distCodeTable = fixedDistCodeTab; - } else if (hdr === 2) { // compressed block, dynamic codes - var numLitCodes = this.getBits(5) + 257; - var numDistCodes = this.getBits(5) + 1; - var numCodeLenCodes = this.getBits(4) + 4; - - // build the code lengths code table - var codeLenCodeLengths = new Uint8Array(codeLenCodeMap.length); - - var i; - for (i = 0; i < numCodeLenCodes; ++i) { - codeLenCodeLengths[codeLenCodeMap[i]] = this.getBits(3); - } - var codeLenCodeTab = this.generateHuffmanTable(codeLenCodeLengths); - - // build the literal and distance code tables - len = 0; - i = 0; - var codes = numLitCodes + numDistCodes; - var codeLengths = new Uint8Array(codes); - var bitsLength, bitsOffset, what; - while (i < codes) { - var code = this.getCode(codeLenCodeTab); - if (code === 16) { - bitsLength = 2; bitsOffset = 3; what = len; - } else if (code === 17) { - bitsLength = 3; bitsOffset = 3; what = (len = 0); - } else if (code === 18) { - bitsLength = 7; bitsOffset = 11; what = (len = 0); - } else { - codeLengths[i++] = len = code; - continue; - } - - var repeatLength = this.getBits(bitsLength) + bitsOffset; - while (repeatLength-- > 0) { - codeLengths[i++] = what; - } - } - - litCodeTable = - this.generateHuffmanTable(codeLengths.subarray(0, numLitCodes)); - distCodeTable = - this.generateHuffmanTable(codeLengths.subarray(numLitCodes, codes)); - } else { - error('Unknown block type in flate stream'); - } - - buffer = this.buffer; - var limit = buffer ? buffer.length : 0; - var pos = this.bufferLength; - while (true) { - var code1 = this.getCode(litCodeTable); - if (code1 < 256) { - if (pos + 1 >= limit) { - buffer = this.ensureBuffer(pos + 1); - limit = buffer.length; - } - buffer[pos++] = code1; - continue; - } - if (code1 === 256) { - this.bufferLength = pos; - return; - } - code1 -= 257; - code1 = lengthDecode[code1]; - var code2 = code1 >> 16; - if (code2 > 0) { - code2 = this.getBits(code2); - } - len = (code1 & 0xffff) + code2; - code1 = this.getCode(distCodeTable); - code1 = distDecode[code1]; - code2 = code1 >> 16; - if (code2 > 0) { - code2 = this.getBits(code2); - } - var dist = (code1 & 0xffff) + code2; - if (pos + len >= limit) { - buffer = this.ensureBuffer(pos + len); - limit = buffer.length; - } - for (var k = 0; k < len; ++k, ++pos) { - buffer[pos] = buffer[pos - dist]; - } - } - }; - - return FlateStream; -})(); - -var PredictorStream = (function PredictorStreamClosure() { - function PredictorStream(str, maybeLength, params) { - var predictor = this.predictor = params.get('Predictor') || 1; - - if (predictor <= 1) { - return str; // no prediction - } - if (predictor !== 2 && (predictor < 10 || predictor > 15)) { - error('Unsupported predictor: ' + predictor); - } - - if (predictor === 2) { - this.readBlock = this.readBlockTiff; - } else { - this.readBlock = this.readBlockPng; - } - - this.str = str; - this.dict = str.dict; - - var colors = this.colors = params.get('Colors') || 1; - var bits = this.bits = params.get('BitsPerComponent') || 8; - var columns = this.columns = params.get('Columns') || 1; - - this.pixBytes = (colors * bits + 7) >> 3; - this.rowBytes = (columns * colors * bits + 7) >> 3; - - DecodeStream.call(this, maybeLength); - return this; - } - - PredictorStream.prototype = Object.create(DecodeStream.prototype); - - PredictorStream.prototype.readBlockTiff = - function predictorStreamReadBlockTiff() { - var rowBytes = this.rowBytes; - - var bufferLength = this.bufferLength; - var buffer = this.ensureBuffer(bufferLength + rowBytes); - - var bits = this.bits; - var colors = this.colors; - - var rawBytes = this.str.getBytes(rowBytes); - this.eof = !rawBytes.length; - if (this.eof) { - return; - } - - var inbuf = 0, outbuf = 0; - var inbits = 0, outbits = 0; - var pos = bufferLength; - var i; - - if (bits === 1) { - for (i = 0; i < rowBytes; ++i) { - var c = rawBytes[i]; - inbuf = (inbuf << 8) | c; - // bitwise addition is exclusive or - // first shift inbuf and then add - buffer[pos++] = (c ^ (inbuf >> colors)) & 0xFF; - // truncate inbuf (assumes colors < 16) - inbuf &= 0xFFFF; - } - } else if (bits === 8) { - for (i = 0; i < colors; ++i) { - buffer[pos++] = rawBytes[i]; - } - for (; i < rowBytes; ++i) { - buffer[pos] = buffer[pos - colors] + rawBytes[i]; - pos++; - } - } else { - var compArray = new Uint8Array(colors + 1); - var bitMask = (1 << bits) - 1; - var j = 0, k = bufferLength; - var columns = this.columns; - for (i = 0; i < columns; ++i) { - for (var kk = 0; kk < colors; ++kk) { - if (inbits < bits) { - inbuf = (inbuf << 8) | (rawBytes[j++] & 0xFF); - inbits += 8; - } - compArray[kk] = (compArray[kk] + - (inbuf >> (inbits - bits))) & bitMask; - inbits -= bits; - outbuf = (outbuf << bits) | compArray[kk]; - outbits += bits; - if (outbits >= 8) { - buffer[k++] = (outbuf >> (outbits - 8)) & 0xFF; - outbits -= 8; - } - } - } - if (outbits > 0) { - buffer[k++] = (outbuf << (8 - outbits)) + - (inbuf & ((1 << (8 - outbits)) - 1)); - } - } - this.bufferLength += rowBytes; - }; - - PredictorStream.prototype.readBlockPng = - function predictorStreamReadBlockPng() { - - var rowBytes = this.rowBytes; - var pixBytes = this.pixBytes; - - var predictor = this.str.getByte(); - var rawBytes = this.str.getBytes(rowBytes); - this.eof = !rawBytes.length; - if (this.eof) { - return; - } - - var bufferLength = this.bufferLength; - var buffer = this.ensureBuffer(bufferLength + rowBytes); - - var prevRow = buffer.subarray(bufferLength - rowBytes, bufferLength); - if (prevRow.length === 0) { - prevRow = new Uint8Array(rowBytes); - } - - var i, j = bufferLength, up, c; - switch (predictor) { - case 0: - for (i = 0; i < rowBytes; ++i) { - buffer[j++] = rawBytes[i]; - } - break; - case 1: - for (i = 0; i < pixBytes; ++i) { - buffer[j++] = rawBytes[i]; - } - for (; i < rowBytes; ++i) { - buffer[j] = (buffer[j - pixBytes] + rawBytes[i]) & 0xFF; - j++; - } - break; - case 2: - for (i = 0; i < rowBytes; ++i) { - buffer[j++] = (prevRow[i] + rawBytes[i]) & 0xFF; - } - break; - case 3: - for (i = 0; i < pixBytes; ++i) { - buffer[j++] = (prevRow[i] >> 1) + rawBytes[i]; - } - for (; i < rowBytes; ++i) { - buffer[j] = (((prevRow[i] + buffer[j - pixBytes]) >> 1) + - rawBytes[i]) & 0xFF; - j++; - } - break; - case 4: - // we need to save the up left pixels values. the simplest way - // is to create a new buffer - for (i = 0; i < pixBytes; ++i) { - up = prevRow[i]; - c = rawBytes[i]; - buffer[j++] = up + c; - } - for (; i < rowBytes; ++i) { - up = prevRow[i]; - var upLeft = prevRow[i - pixBytes]; - var left = buffer[j - pixBytes]; - var p = left + up - upLeft; - - var pa = p - left; - if (pa < 0) { - pa = -pa; - } - var pb = p - up; - if (pb < 0) { - pb = -pb; - } - var pc = p - upLeft; - if (pc < 0) { - pc = -pc; - } - - c = rawBytes[i]; - if (pa <= pb && pa <= pc) { - buffer[j++] = left + c; - } else if (pb <= pc) { - buffer[j++] = up + c; - } else { - buffer[j++] = upLeft + c; - } - } - break; - default: - error('Unsupported predictor: ' + predictor); - } - this.bufferLength += rowBytes; - }; - - return PredictorStream; -})(); - -/** - * Depending on the type of JPEG a JpegStream is handled in different ways. For - * JPEG's that are supported natively such as DeviceGray and DeviceRGB the image - * data is stored and then loaded by the browser. For unsupported JPEG's we use - * a library to decode these images and the stream behaves like all the other - * DecodeStreams. - */ -var JpegStream = (function JpegStreamClosure() { - function JpegStream(stream, maybeLength, dict, xref) { - // Some images may contain 'junk' before the SOI (start-of-image) marker. - // Note: this seems to mainly affect inline images. - var ch; - while ((ch = stream.getByte()) !== -1) { - if (ch === 0xFF) { // Find the first byte of the SOI marker (0xFFD8). - stream.skip(-1); // Reset the stream position to the SOI. - break; - } - } - this.stream = stream; - this.maybeLength = maybeLength; - this.dict = dict; - - DecodeStream.call(this, maybeLength); - } - - JpegStream.prototype = Object.create(DecodeStream.prototype); - - Object.defineProperty(JpegStream.prototype, 'bytes', { - get: function JpegStream_bytes() { - // If this.maybeLength is null, we'll get the entire stream. - return shadow(this, 'bytes', this.stream.getBytes(this.maybeLength)); - }, - configurable: true - }); - - JpegStream.prototype.ensureBuffer = function JpegStream_ensureBuffer(req) { - if (this.bufferLength) { - return; - } - try { - var jpegImage = new JpegImage(); - - // checking if values needs to be transformed before conversion - if (this.forceRGB && this.dict && isArray(this.dict.get('Decode'))) { - var decodeArr = this.dict.get('Decode'); - var bitsPerComponent = this.dict.get('BitsPerComponent') || 8; - var decodeArrLength = decodeArr.length; - var transform = new Int32Array(decodeArrLength); - var transformNeeded = false; - var maxValue = (1 << bitsPerComponent) - 1; - for (var i = 0; i < decodeArrLength; i += 2) { - transform[i] = ((decodeArr[i + 1] - decodeArr[i]) * 256) | 0; - transform[i + 1] = (decodeArr[i] * maxValue) | 0; - if (transform[i] !== 256 || transform[i + 1] !== 0) { - transformNeeded = true; - } - } - if (transformNeeded) { - jpegImage.decodeTransform = transform; - } - } - - jpegImage.parse(this.bytes); - var data = jpegImage.getData(this.drawWidth, this.drawHeight, - this.forceRGB); - this.buffer = data; - this.bufferLength = data.length; - this.eof = true; - } catch (e) { - error('JPEG error: ' + e); - } - }; - - JpegStream.prototype.getBytes = function JpegStream_getBytes(length) { - this.ensureBuffer(); - return this.buffer; - }; - - JpegStream.prototype.getIR = function JpegStream_getIR() { - return PDFJS.createObjectURL(this.bytes, 'image/jpeg'); - }; - /** - * Checks if the image can be decoded and displayed by the browser without any - * further processing such as color space conversions. - */ - JpegStream.prototype.isNativelySupported = - function JpegStream_isNativelySupported(xref, res) { - var cs = ColorSpace.parse(this.dict.get('ColorSpace', 'CS'), xref, res); - return (cs.name === 'DeviceGray' || cs.name === 'DeviceRGB') && - cs.isDefaultDecode(this.dict.get('Decode', 'D')); - }; - /** - * Checks if the image can be decoded by the browser. - */ - JpegStream.prototype.isNativelyDecodable = - function JpegStream_isNativelyDecodable(xref, res) { - var cs = ColorSpace.parse(this.dict.get('ColorSpace', 'CS'), xref, res); - return (cs.numComps === 1 || cs.numComps === 3) && - cs.isDefaultDecode(this.dict.get('Decode', 'D')); - }; - - return JpegStream; -})(); - -/** - * For JPEG 2000's we use a library to decode these images and - * the stream behaves like all the other DecodeStreams. - */ -var JpxStream = (function JpxStreamClosure() { - function JpxStream(stream, maybeLength, dict) { - this.stream = stream; - this.maybeLength = maybeLength; - this.dict = dict; - - DecodeStream.call(this, maybeLength); - } - - JpxStream.prototype = Object.create(DecodeStream.prototype); - - Object.defineProperty(JpxStream.prototype, 'bytes', { - get: function JpxStream_bytes() { - // If this.maybeLength is null, we'll get the entire stream. - return shadow(this, 'bytes', this.stream.getBytes(this.maybeLength)); - }, - configurable: true - }); - - JpxStream.prototype.ensureBuffer = function JpxStream_ensureBuffer(req) { - if (this.bufferLength) { - return; - } - - var jpxImage = new JpxImage(); - jpxImage.parse(this.bytes); - - var width = jpxImage.width; - var height = jpxImage.height; - var componentsCount = jpxImage.componentsCount; - var tileCount = jpxImage.tiles.length; - if (tileCount === 1) { - this.buffer = jpxImage.tiles[0].items; - } else { - var data = new Uint8Array(width * height * componentsCount); - - for (var k = 0; k < tileCount; k++) { - var tileComponents = jpxImage.tiles[k]; - var tileWidth = tileComponents.width; - var tileHeight = tileComponents.height; - var tileLeft = tileComponents.left; - var tileTop = tileComponents.top; - - var src = tileComponents.items; - var srcPosition = 0; - var dataPosition = (width * tileTop + tileLeft) * componentsCount; - var imgRowSize = width * componentsCount; - var tileRowSize = tileWidth * componentsCount; - - for (var j = 0; j < tileHeight; j++) { - var rowBytes = src.subarray(srcPosition, srcPosition + tileRowSize); - data.set(rowBytes, dataPosition); - srcPosition += tileRowSize; - dataPosition += imgRowSize; - } - } - this.buffer = data; - } - this.bufferLength = this.buffer.length; - this.eof = true; - }; - - return JpxStream; -})(); - -/** - * For JBIG2's we use a library to decode these images and - * the stream behaves like all the other DecodeStreams. - */ -var Jbig2Stream = (function Jbig2StreamClosure() { - function Jbig2Stream(stream, maybeLength, dict) { - this.stream = stream; - this.maybeLength = maybeLength; - this.dict = dict; - - DecodeStream.call(this, maybeLength); - } - - Jbig2Stream.prototype = Object.create(DecodeStream.prototype); - - Object.defineProperty(Jbig2Stream.prototype, 'bytes', { - get: function Jbig2Stream_bytes() { - // If this.maybeLength is null, we'll get the entire stream. - return shadow(this, 'bytes', this.stream.getBytes(this.maybeLength)); - }, - configurable: true - }); - - Jbig2Stream.prototype.ensureBuffer = function Jbig2Stream_ensureBuffer(req) { - if (this.bufferLength) { - return; - } - - var jbig2Image = new Jbig2Image(); - - var chunks = [], xref = this.dict.xref; - var decodeParams = xref.fetchIfRef(this.dict.get('DecodeParms')); - - // According to the PDF specification, DecodeParms can be either - // a dictionary, or an array whose elements are dictionaries. - if (isArray(decodeParams)) { - if (decodeParams.length > 1) { - warn('JBIG2 - \'DecodeParms\' array with multiple elements ' + - 'not supported.'); - } - decodeParams = xref.fetchIfRef(decodeParams[0]); - } - if (decodeParams && decodeParams.has('JBIG2Globals')) { - var globalsStream = decodeParams.get('JBIG2Globals'); - var globals = globalsStream.getBytes(); - chunks.push({data: globals, start: 0, end: globals.length}); - } - chunks.push({data: this.bytes, start: 0, end: this.bytes.length}); - var data = jbig2Image.parseChunks(chunks); - var dataLength = data.length; - - // JBIG2 had black as 1 and white as 0, inverting the colors - for (var i = 0; i < dataLength; i++) { - data[i] ^= 0xFF; - } - - this.buffer = data; - this.bufferLength = dataLength; - this.eof = true; - }; - - return Jbig2Stream; -})(); - -var DecryptStream = (function DecryptStreamClosure() { - function DecryptStream(str, maybeLength, decrypt) { - this.str = str; - this.dict = str.dict; - this.decrypt = decrypt; - this.nextChunk = null; - this.initialized = false; - - DecodeStream.call(this, maybeLength); - } - - var chunkSize = 512; - - DecryptStream.prototype = Object.create(DecodeStream.prototype); - - DecryptStream.prototype.readBlock = function DecryptStream_readBlock() { - var chunk; - if (this.initialized) { - chunk = this.nextChunk; - } else { - chunk = this.str.getBytes(chunkSize); - this.initialized = true; - } - if (!chunk || chunk.length === 0) { - this.eof = true; - return; - } - this.nextChunk = this.str.getBytes(chunkSize); - var hasMoreData = this.nextChunk && this.nextChunk.length > 0; - - var decrypt = this.decrypt; - chunk = decrypt(chunk, !hasMoreData); - - var bufferLength = this.bufferLength; - var i, n = chunk.length; - var buffer = this.ensureBuffer(bufferLength + n); - for (i = 0; i < n; i++) { - buffer[bufferLength++] = chunk[i]; - } - this.bufferLength = bufferLength; - }; - - return DecryptStream; -})(); - -var Ascii85Stream = (function Ascii85StreamClosure() { - function Ascii85Stream(str, maybeLength) { - this.str = str; - this.dict = str.dict; - this.input = new Uint8Array(5); - - // Most streams increase in size when decoded, but Ascii85 streams - // typically shrink by ~20%. - if (maybeLength) { - maybeLength = 0.8 * maybeLength; - } - DecodeStream.call(this, maybeLength); - } - - Ascii85Stream.prototype = Object.create(DecodeStream.prototype); - - Ascii85Stream.prototype.readBlock = function Ascii85Stream_readBlock() { - var TILDA_CHAR = 0x7E; // '~' - var Z_LOWER_CHAR = 0x7A; // 'z' - var EOF = -1; - - var str = this.str; - - var c = str.getByte(); - while (Lexer.isSpace(c)) { - c = str.getByte(); - } - - if (c === EOF || c === TILDA_CHAR) { - this.eof = true; - return; - } - - var bufferLength = this.bufferLength, buffer; - var i; - - // special code for z - if (c === Z_LOWER_CHAR) { - buffer = this.ensureBuffer(bufferLength + 4); - for (i = 0; i < 4; ++i) { - buffer[bufferLength + i] = 0; - } - this.bufferLength += 4; - } else { - var input = this.input; - input[0] = c; - for (i = 1; i < 5; ++i) { - c = str.getByte(); - while (Lexer.isSpace(c)) { - c = str.getByte(); - } - - input[i] = c; - - if (c === EOF || c === TILDA_CHAR) { - break; - } - } - buffer = this.ensureBuffer(bufferLength + i - 1); - this.bufferLength += i - 1; - - // partial ending; - if (i < 5) { - for (; i < 5; ++i) { - input[i] = 0x21 + 84; - } - this.eof = true; - } - var t = 0; - for (i = 0; i < 5; ++i) { - t = t * 85 + (input[i] - 0x21); - } - - for (i = 3; i >= 0; --i) { - buffer[bufferLength + i] = t & 0xFF; - t >>= 8; - } - } - }; - - return Ascii85Stream; -})(); - -var AsciiHexStream = (function AsciiHexStreamClosure() { - function AsciiHexStream(str, maybeLength) { - this.str = str; - this.dict = str.dict; - - this.firstDigit = -1; - - // Most streams increase in size when decoded, but AsciiHex streams shrink - // by 50%. - if (maybeLength) { - maybeLength = 0.5 * maybeLength; - } - DecodeStream.call(this, maybeLength); - } - - AsciiHexStream.prototype = Object.create(DecodeStream.prototype); - - AsciiHexStream.prototype.readBlock = function AsciiHexStream_readBlock() { - var UPSTREAM_BLOCK_SIZE = 8000; - var bytes = this.str.getBytes(UPSTREAM_BLOCK_SIZE); - if (!bytes.length) { - this.eof = true; - return; - } - - var maxDecodeLength = (bytes.length + 1) >> 1; - var buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength); - var bufferLength = this.bufferLength; - - var firstDigit = this.firstDigit; - for (var i = 0, ii = bytes.length; i < ii; i++) { - var ch = bytes[i], digit; - if (ch >= 0x30 && ch <= 0x39) { // '0'-'9' - digit = ch & 0x0F; - } else if ((ch >= 0x41 && ch <= 0x46) || (ch >= 0x61 && ch <= 0x66)) { - // 'A'-'Z', 'a'-'z' - digit = (ch & 0x0F) + 9; - } else if (ch === 0x3E) { // '>' - this.eof = true; - break; - } else { // probably whitespace - continue; // ignoring - } - if (firstDigit < 0) { - firstDigit = digit; - } else { - buffer[bufferLength++] = (firstDigit << 4) | digit; - firstDigit = -1; - } - } - if (firstDigit >= 0 && this.eof) { - // incomplete byte - buffer[bufferLength++] = (firstDigit << 4); - firstDigit = -1; - } - this.firstDigit = firstDigit; - this.bufferLength = bufferLength; - }; - - return AsciiHexStream; -})(); - -var RunLengthStream = (function RunLengthStreamClosure() { - function RunLengthStream(str, maybeLength) { - this.str = str; - this.dict = str.dict; - - DecodeStream.call(this, maybeLength); - } - - RunLengthStream.prototype = Object.create(DecodeStream.prototype); - - RunLengthStream.prototype.readBlock = function RunLengthStream_readBlock() { - // The repeatHeader has following format. The first byte defines type of run - // and amount of bytes to repeat/copy: n = 0 through 127 - copy next n bytes - // (in addition to the second byte from the header), n = 129 through 255 - - // duplicate the second byte from the header (257 - n) times, n = 128 - end. - var repeatHeader = this.str.getBytes(2); - if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) { - this.eof = true; - return; - } - - var buffer; - var bufferLength = this.bufferLength; - var n = repeatHeader[0]; - if (n < 128) { - // copy n bytes - buffer = this.ensureBuffer(bufferLength + n + 1); - buffer[bufferLength++] = repeatHeader[1]; - if (n > 0) { - var source = this.str.getBytes(n); - buffer.set(source, bufferLength); - bufferLength += n; - } - } else { - n = 257 - n; - var b = repeatHeader[1]; - buffer = this.ensureBuffer(bufferLength + n + 1); - for (var i = 0; i < n; i++) { - buffer[bufferLength++] = b; - } - } - this.bufferLength = bufferLength; - }; - - return RunLengthStream; -})(); - -var CCITTFaxStream = (function CCITTFaxStreamClosure() { - - var ccittEOL = -2; - var twoDimPass = 0; - var twoDimHoriz = 1; - var twoDimVert0 = 2; - var twoDimVertR1 = 3; - var twoDimVertL1 = 4; - var twoDimVertR2 = 5; - var twoDimVertL2 = 6; - var twoDimVertR3 = 7; - var twoDimVertL3 = 8; - - var twoDimTable = [ - [-1, -1], [-1, -1], // 000000x - [7, twoDimVertL3], // 0000010 - [7, twoDimVertR3], // 0000011 - [6, twoDimVertL2], [6, twoDimVertL2], // 000010x - [6, twoDimVertR2], [6, twoDimVertR2], // 000011x - [4, twoDimPass], [4, twoDimPass], // 0001xxx - [4, twoDimPass], [4, twoDimPass], - [4, twoDimPass], [4, twoDimPass], - [4, twoDimPass], [4, twoDimPass], - [3, twoDimHoriz], [3, twoDimHoriz], // 001xxxx - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimVertL1], [3, twoDimVertL1], // 010xxxx - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertR1], [3, twoDimVertR1], // 011xxxx - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [1, twoDimVert0], [1, twoDimVert0], // 1xxxxxx - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0] - ]; - - var whiteTable1 = [ - [-1, -1], // 00000 - [12, ccittEOL], // 00001 - [-1, -1], [-1, -1], // 0001x - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 001xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 010xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 011xx - [11, 1792], [11, 1792], // 1000x - [12, 1984], // 10010 - [12, 2048], // 10011 - [12, 2112], // 10100 - [12, 2176], // 10101 - [12, 2240], // 10110 - [12, 2304], // 10111 - [11, 1856], [11, 1856], // 1100x - [11, 1920], [11, 1920], // 1101x - [12, 2368], // 11100 - [12, 2432], // 11101 - [12, 2496], // 11110 - [12, 2560] // 11111 - ]; - - var whiteTable2 = [ - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 0000000xx - [8, 29], [8, 29], // 00000010x - [8, 30], [8, 30], // 00000011x - [8, 45], [8, 45], // 00000100x - [8, 46], [8, 46], // 00000101x - [7, 22], [7, 22], [7, 22], [7, 22], // 0000011xx - [7, 23], [7, 23], [7, 23], [7, 23], // 0000100xx - [8, 47], [8, 47], // 00001010x - [8, 48], [8, 48], // 00001011x - [6, 13], [6, 13], [6, 13], [6, 13], // 000011xxx - [6, 13], [6, 13], [6, 13], [6, 13], - [7, 20], [7, 20], [7, 20], [7, 20], // 0001000xx - [8, 33], [8, 33], // 00010010x - [8, 34], [8, 34], // 00010011x - [8, 35], [8, 35], // 00010100x - [8, 36], [8, 36], // 00010101x - [8, 37], [8, 37], // 00010110x - [8, 38], [8, 38], // 00010111x - [7, 19], [7, 19], [7, 19], [7, 19], // 0001100xx - [8, 31], [8, 31], // 00011010x - [8, 32], [8, 32], // 00011011x - [6, 1], [6, 1], [6, 1], [6, 1], // 000111xxx - [6, 1], [6, 1], [6, 1], [6, 1], - [6, 12], [6, 12], [6, 12], [6, 12], // 001000xxx - [6, 12], [6, 12], [6, 12], [6, 12], - [8, 53], [8, 53], // 00100100x - [8, 54], [8, 54], // 00100101x - [7, 26], [7, 26], [7, 26], [7, 26], // 0010011xx - [8, 39], [8, 39], // 00101000x - [8, 40], [8, 40], // 00101001x - [8, 41], [8, 41], // 00101010x - [8, 42], [8, 42], // 00101011x - [8, 43], [8, 43], // 00101100x - [8, 44], [8, 44], // 00101101x - [7, 21], [7, 21], [7, 21], [7, 21], // 0010111xx - [7, 28], [7, 28], [7, 28], [7, 28], // 0011000xx - [8, 61], [8, 61], // 00110010x - [8, 62], [8, 62], // 00110011x - [8, 63], [8, 63], // 00110100x - [8, 0], [8, 0], // 00110101x - [8, 320], [8, 320], // 00110110x - [8, 384], [8, 384], // 00110111x - [5, 10], [5, 10], [5, 10], [5, 10], // 00111xxxx - [5, 10], [5, 10], [5, 10], [5, 10], - [5, 10], [5, 10], [5, 10], [5, 10], - [5, 10], [5, 10], [5, 10], [5, 10], - [5, 11], [5, 11], [5, 11], [5, 11], // 01000xxxx - [5, 11], [5, 11], [5, 11], [5, 11], - [5, 11], [5, 11], [5, 11], [5, 11], - [5, 11], [5, 11], [5, 11], [5, 11], - [7, 27], [7, 27], [7, 27], [7, 27], // 0100100xx - [8, 59], [8, 59], // 01001010x - [8, 60], [8, 60], // 01001011x - [9, 1472], // 010011000 - [9, 1536], // 010011001 - [9, 1600], // 010011010 - [9, 1728], // 010011011 - [7, 18], [7, 18], [7, 18], [7, 18], // 0100111xx - [7, 24], [7, 24], [7, 24], [7, 24], // 0101000xx - [8, 49], [8, 49], // 01010010x - [8, 50], [8, 50], // 01010011x - [8, 51], [8, 51], // 01010100x - [8, 52], [8, 52], // 01010101x - [7, 25], [7, 25], [7, 25], [7, 25], // 0101011xx - [8, 55], [8, 55], // 01011000x - [8, 56], [8, 56], // 01011001x - [8, 57], [8, 57], // 01011010x - [8, 58], [8, 58], // 01011011x - [6, 192], [6, 192], [6, 192], [6, 192], // 010111xxx - [6, 192], [6, 192], [6, 192], [6, 192], - [6, 1664], [6, 1664], [6, 1664], [6, 1664], // 011000xxx - [6, 1664], [6, 1664], [6, 1664], [6, 1664], - [8, 448], [8, 448], // 01100100x - [8, 512], [8, 512], // 01100101x - [9, 704], // 011001100 - [9, 768], // 011001101 - [8, 640], [8, 640], // 01100111x - [8, 576], [8, 576], // 01101000x - [9, 832], // 011010010 - [9, 896], // 011010011 - [9, 960], // 011010100 - [9, 1024], // 011010101 - [9, 1088], // 011010110 - [9, 1152], // 011010111 - [9, 1216], // 011011000 - [9, 1280], // 011011001 - [9, 1344], // 011011010 - [9, 1408], // 011011011 - [7, 256], [7, 256], [7, 256], [7, 256], // 0110111xx - [4, 2], [4, 2], [4, 2], [4, 2], // 0111xxxxx - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 3], [4, 3], [4, 3], [4, 3], // 1000xxxxx - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [5, 128], [5, 128], [5, 128], [5, 128], // 10010xxxx - [5, 128], [5, 128], [5, 128], [5, 128], - [5, 128], [5, 128], [5, 128], [5, 128], - [5, 128], [5, 128], [5, 128], [5, 128], - [5, 8], [5, 8], [5, 8], [5, 8], // 10011xxxx - [5, 8], [5, 8], [5, 8], [5, 8], - [5, 8], [5, 8], [5, 8], [5, 8], - [5, 8], [5, 8], [5, 8], [5, 8], - [5, 9], [5, 9], [5, 9], [5, 9], // 10100xxxx - [5, 9], [5, 9], [5, 9], [5, 9], - [5, 9], [5, 9], [5, 9], [5, 9], - [5, 9], [5, 9], [5, 9], [5, 9], - [6, 16], [6, 16], [6, 16], [6, 16], // 101010xxx - [6, 16], [6, 16], [6, 16], [6, 16], - [6, 17], [6, 17], [6, 17], [6, 17], // 101011xxx - [6, 17], [6, 17], [6, 17], [6, 17], - [4, 4], [4, 4], [4, 4], [4, 4], // 1011xxxxx - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 5], [4, 5], [4, 5], [4, 5], // 1100xxxxx - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [6, 14], [6, 14], [6, 14], [6, 14], // 110100xxx - [6, 14], [6, 14], [6, 14], [6, 14], - [6, 15], [6, 15], [6, 15], [6, 15], // 110101xxx - [6, 15], [6, 15], [6, 15], [6, 15], - [5, 64], [5, 64], [5, 64], [5, 64], // 11011xxxx - [5, 64], [5, 64], [5, 64], [5, 64], - [5, 64], [5, 64], [5, 64], [5, 64], - [5, 64], [5, 64], [5, 64], [5, 64], - [4, 6], [4, 6], [4, 6], [4, 6], // 1110xxxxx - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 7], [4, 7], [4, 7], [4, 7], // 1111xxxxx - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7] - ]; - - var blackTable1 = [ - [-1, -1], [-1, -1], // 000000000000x - [12, ccittEOL], [12, ccittEOL], // 000000000001x - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000001xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000010xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000011xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000100xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000101xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000110xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000111xx - [11, 1792], [11, 1792], [11, 1792], [11, 1792], // 00000001000xx - [12, 1984], [12, 1984], // 000000010010x - [12, 2048], [12, 2048], // 000000010011x - [12, 2112], [12, 2112], // 000000010100x - [12, 2176], [12, 2176], // 000000010101x - [12, 2240], [12, 2240], // 000000010110x - [12, 2304], [12, 2304], // 000000010111x - [11, 1856], [11, 1856], [11, 1856], [11, 1856], // 00000001100xx - [11, 1920], [11, 1920], [11, 1920], [11, 1920], // 00000001101xx - [12, 2368], [12, 2368], // 000000011100x - [12, 2432], [12, 2432], // 000000011101x - [12, 2496], [12, 2496], // 000000011110x - [12, 2560], [12, 2560], // 000000011111x - [10, 18], [10, 18], [10, 18], [10, 18], // 0000001000xxx - [10, 18], [10, 18], [10, 18], [10, 18], - [12, 52], [12, 52], // 000000100100x - [13, 640], // 0000001001010 - [13, 704], // 0000001001011 - [13, 768], // 0000001001100 - [13, 832], // 0000001001101 - [12, 55], [12, 55], // 000000100111x - [12, 56], [12, 56], // 000000101000x - [13, 1280], // 0000001010010 - [13, 1344], // 0000001010011 - [13, 1408], // 0000001010100 - [13, 1472], // 0000001010101 - [12, 59], [12, 59], // 000000101011x - [12, 60], [12, 60], // 000000101100x - [13, 1536], // 0000001011010 - [13, 1600], // 0000001011011 - [11, 24], [11, 24], [11, 24], [11, 24], // 00000010111xx - [11, 25], [11, 25], [11, 25], [11, 25], // 00000011000xx - [13, 1664], // 0000001100100 - [13, 1728], // 0000001100101 - [12, 320], [12, 320], // 000000110011x - [12, 384], [12, 384], // 000000110100x - [12, 448], [12, 448], // 000000110101x - [13, 512], // 0000001101100 - [13, 576], // 0000001101101 - [12, 53], [12, 53], // 000000110111x - [12, 54], [12, 54], // 000000111000x - [13, 896], // 0000001110010 - [13, 960], // 0000001110011 - [13, 1024], // 0000001110100 - [13, 1088], // 0000001110101 - [13, 1152], // 0000001110110 - [13, 1216], // 0000001110111 - [10, 64], [10, 64], [10, 64], [10, 64], // 0000001111xxx - [10, 64], [10, 64], [10, 64], [10, 64] - ]; - - var blackTable2 = [ - [8, 13], [8, 13], [8, 13], [8, 13], // 00000100xxxx - [8, 13], [8, 13], [8, 13], [8, 13], - [8, 13], [8, 13], [8, 13], [8, 13], - [8, 13], [8, 13], [8, 13], [8, 13], - [11, 23], [11, 23], // 00000101000x - [12, 50], // 000001010010 - [12, 51], // 000001010011 - [12, 44], // 000001010100 - [12, 45], // 000001010101 - [12, 46], // 000001010110 - [12, 47], // 000001010111 - [12, 57], // 000001011000 - [12, 58], // 000001011001 - [12, 61], // 000001011010 - [12, 256], // 000001011011 - [10, 16], [10, 16], [10, 16], [10, 16], // 0000010111xx - [10, 17], [10, 17], [10, 17], [10, 17], // 0000011000xx - [12, 48], // 000001100100 - [12, 49], // 000001100101 - [12, 62], // 000001100110 - [12, 63], // 000001100111 - [12, 30], // 000001101000 - [12, 31], // 000001101001 - [12, 32], // 000001101010 - [12, 33], // 000001101011 - [12, 40], // 000001101100 - [12, 41], // 000001101101 - [11, 22], [11, 22], // 00000110111x - [8, 14], [8, 14], [8, 14], [8, 14], // 00000111xxxx - [8, 14], [8, 14], [8, 14], [8, 14], - [8, 14], [8, 14], [8, 14], [8, 14], - [8, 14], [8, 14], [8, 14], [8, 14], - [7, 10], [7, 10], [7, 10], [7, 10], // 0000100xxxxx - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 11], [7, 11], [7, 11], [7, 11], // 0000101xxxxx - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [9, 15], [9, 15], [9, 15], [9, 15], // 000011000xxx - [9, 15], [9, 15], [9, 15], [9, 15], - [12, 128], // 000011001000 - [12, 192], // 000011001001 - [12, 26], // 000011001010 - [12, 27], // 000011001011 - [12, 28], // 000011001100 - [12, 29], // 000011001101 - [11, 19], [11, 19], // 00001100111x - [11, 20], [11, 20], // 00001101000x - [12, 34], // 000011010010 - [12, 35], // 000011010011 - [12, 36], // 000011010100 - [12, 37], // 000011010101 - [12, 38], // 000011010110 - [12, 39], // 000011010111 - [11, 21], [11, 21], // 00001101100x - [12, 42], // 000011011010 - [12, 43], // 000011011011 - [10, 0], [10, 0], [10, 0], [10, 0], // 0000110111xx - [7, 12], [7, 12], [7, 12], [7, 12], // 0000111xxxxx - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12] - ]; - - var blackTable3 = [ - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 0000xx - [6, 9], // 000100 - [6, 8], // 000101 - [5, 7], [5, 7], // 00011x - [4, 6], [4, 6], [4, 6], [4, 6], // 0010xx - [4, 5], [4, 5], [4, 5], [4, 5], // 0011xx - [3, 1], [3, 1], [3, 1], [3, 1], // 010xxx - [3, 1], [3, 1], [3, 1], [3, 1], - [3, 4], [3, 4], [3, 4], [3, 4], // 011xxx - [3, 4], [3, 4], [3, 4], [3, 4], - [2, 3], [2, 3], [2, 3], [2, 3], // 10xxxx - [2, 3], [2, 3], [2, 3], [2, 3], - [2, 3], [2, 3], [2, 3], [2, 3], - [2, 3], [2, 3], [2, 3], [2, 3], - [2, 2], [2, 2], [2, 2], [2, 2], // 11xxxx - [2, 2], [2, 2], [2, 2], [2, 2], - [2, 2], [2, 2], [2, 2], [2, 2], - [2, 2], [2, 2], [2, 2], [2, 2] - ]; - - function CCITTFaxStream(str, maybeLength, params) { - this.str = str; - this.dict = str.dict; - - params = params || Dict.empty; - - this.encoding = params.get('K') || 0; - this.eoline = params.get('EndOfLine') || false; - this.byteAlign = params.get('EncodedByteAlign') || false; - this.columns = params.get('Columns') || 1728; - this.rows = params.get('Rows') || 0; - var eoblock = params.get('EndOfBlock'); - if (eoblock === null || eoblock === undefined) { - eoblock = true; - } - this.eoblock = eoblock; - this.black = params.get('BlackIs1') || false; - - this.codingLine = new Uint32Array(this.columns + 1); - this.refLine = new Uint32Array(this.columns + 2); - - this.codingLine[0] = this.columns; - this.codingPos = 0; - - this.row = 0; - this.nextLine2D = this.encoding < 0; - this.inputBits = 0; - this.inputBuf = 0; - this.outputBits = 0; - - var code1; - while ((code1 = this.lookBits(12)) === 0) { - this.eatBits(1); - } - if (code1 === 1) { - this.eatBits(12); - } - if (this.encoding > 0) { - this.nextLine2D = !this.lookBits(1); - this.eatBits(1); - } - - DecodeStream.call(this, maybeLength); - } - - CCITTFaxStream.prototype = Object.create(DecodeStream.prototype); - - CCITTFaxStream.prototype.readBlock = function CCITTFaxStream_readBlock() { - while (!this.eof) { - var c = this.lookChar(); - this.ensureBuffer(this.bufferLength + 1); - this.buffer[this.bufferLength++] = c; - } - }; - - CCITTFaxStream.prototype.addPixels = - function ccittFaxStreamAddPixels(a1, blackPixels) { - var codingLine = this.codingLine; - var codingPos = this.codingPos; - - if (a1 > codingLine[codingPos]) { - if (a1 > this.columns) { - info('row is wrong length'); - this.err = true; - a1 = this.columns; - } - if ((codingPos & 1) ^ blackPixels) { - ++codingPos; - } - - codingLine[codingPos] = a1; - } - this.codingPos = codingPos; - }; - - CCITTFaxStream.prototype.addPixelsNeg = - function ccittFaxStreamAddPixelsNeg(a1, blackPixels) { - var codingLine = this.codingLine; - var codingPos = this.codingPos; - - if (a1 > codingLine[codingPos]) { - if (a1 > this.columns) { - info('row is wrong length'); - this.err = true; - a1 = this.columns; - } - if ((codingPos & 1) ^ blackPixels) { - ++codingPos; - } - - codingLine[codingPos] = a1; - } else if (a1 < codingLine[codingPos]) { - if (a1 < 0) { - info('invalid code'); - this.err = true; - a1 = 0; - } - while (codingPos > 0 && a1 < codingLine[codingPos - 1]) { - --codingPos; - } - codingLine[codingPos] = a1; - } - - this.codingPos = codingPos; - }; - - CCITTFaxStream.prototype.lookChar = function CCITTFaxStream_lookChar() { - var refLine = this.refLine; - var codingLine = this.codingLine; - var columns = this.columns; - - var refPos, blackPixels, bits, i; - - if (this.outputBits === 0) { - if (this.eof) { - return null; - } - this.err = false; - - var code1, code2, code3; - if (this.nextLine2D) { - for (i = 0; codingLine[i] < columns; ++i) { - refLine[i] = codingLine[i]; - } - refLine[i++] = columns; - refLine[i] = columns; - codingLine[0] = 0; - this.codingPos = 0; - refPos = 0; - blackPixels = 0; - - while (codingLine[this.codingPos] < columns) { - code1 = this.getTwoDimCode(); - switch (code1) { - case twoDimPass: - this.addPixels(refLine[refPos + 1], blackPixels); - if (refLine[refPos + 1] < columns) { - refPos += 2; - } - break; - case twoDimHoriz: - code1 = code2 = 0; - if (blackPixels) { - do { - code1 += (code3 = this.getBlackCode()); - } while (code3 >= 64); - do { - code2 += (code3 = this.getWhiteCode()); - } while (code3 >= 64); - } else { - do { - code1 += (code3 = this.getWhiteCode()); - } while (code3 >= 64); - do { - code2 += (code3 = this.getBlackCode()); - } while (code3 >= 64); - } - this.addPixels(codingLine[this.codingPos] + - code1, blackPixels); - if (codingLine[this.codingPos] < columns) { - this.addPixels(codingLine[this.codingPos] + code2, - blackPixels ^ 1); - } - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - break; - case twoDimVertR3: - this.addPixels(refLine[refPos] + 3, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - ++refPos; - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVertR2: - this.addPixels(refLine[refPos] + 2, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - ++refPos; - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVertR1: - this.addPixels(refLine[refPos] + 1, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - ++refPos; - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVert0: - this.addPixels(refLine[refPos], blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - ++refPos; - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVertL3: - this.addPixelsNeg(refLine[refPos] - 3, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - if (refPos > 0) { - --refPos; - } else { - ++refPos; - } - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVertL2: - this.addPixelsNeg(refLine[refPos] - 2, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - if (refPos > 0) { - --refPos; - } else { - ++refPos; - } - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVertL1: - this.addPixelsNeg(refLine[refPos] - 1, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - if (refPos > 0) { - --refPos; - } else { - ++refPos; - } - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case EOF: - this.addPixels(columns, 0); - this.eof = true; - break; - default: - info('bad 2d code'); - this.addPixels(columns, 0); - this.err = true; - } - } - } else { - codingLine[0] = 0; - this.codingPos = 0; - blackPixels = 0; - while (codingLine[this.codingPos] < columns) { - code1 = 0; - if (blackPixels) { - do { - code1 += (code3 = this.getBlackCode()); - } while (code3 >= 64); - } else { - do { - code1 += (code3 = this.getWhiteCode()); - } while (code3 >= 64); - } - this.addPixels(codingLine[this.codingPos] + code1, blackPixels); - blackPixels ^= 1; - } - } - - var gotEOL = false; - - if (this.byteAlign) { - this.inputBits &= ~7; - } - - if (!this.eoblock && this.row === this.rows - 1) { - this.eof = true; - } else { - code1 = this.lookBits(12); - if (this.eoline) { - while (code1 !== EOF && code1 !== 1) { - this.eatBits(1); - code1 = this.lookBits(12); - } - } else { - while (code1 === 0) { - this.eatBits(1); - code1 = this.lookBits(12); - } - } - if (code1 === 1) { - this.eatBits(12); - gotEOL = true; - } else if (code1 === EOF) { - this.eof = true; - } - } - - if (!this.eof && this.encoding > 0) { - this.nextLine2D = !this.lookBits(1); - this.eatBits(1); - } - - if (this.eoblock && gotEOL && this.byteAlign) { - code1 = this.lookBits(12); - if (code1 === 1) { - this.eatBits(12); - if (this.encoding > 0) { - this.lookBits(1); - this.eatBits(1); - } - if (this.encoding >= 0) { - for (i = 0; i < 4; ++i) { - code1 = this.lookBits(12); - if (code1 !== 1) { - info('bad rtc code: ' + code1); - } - this.eatBits(12); - if (this.encoding > 0) { - this.lookBits(1); - this.eatBits(1); - } - } - } - this.eof = true; - } - } else if (this.err && this.eoline) { - while (true) { - code1 = this.lookBits(13); - if (code1 === EOF) { - this.eof = true; - return null; - } - if ((code1 >> 1) === 1) { - break; - } - this.eatBits(1); - } - this.eatBits(12); - if (this.encoding > 0) { - this.eatBits(1); - this.nextLine2D = !(code1 & 1); - } - } - - if (codingLine[0] > 0) { - this.outputBits = codingLine[this.codingPos = 0]; - } else { - this.outputBits = codingLine[this.codingPos = 1]; - } - this.row++; - } - - var c; - if (this.outputBits >= 8) { - c = (this.codingPos & 1) ? 0 : 0xFF; - this.outputBits -= 8; - if (this.outputBits === 0 && codingLine[this.codingPos] < columns) { - this.codingPos++; - this.outputBits = (codingLine[this.codingPos] - - codingLine[this.codingPos - 1]); - } - } else { - bits = 8; - c = 0; - do { - if (this.outputBits > bits) { - c <<= bits; - if (!(this.codingPos & 1)) { - c |= 0xFF >> (8 - bits); - } - this.outputBits -= bits; - bits = 0; - } else { - c <<= this.outputBits; - if (!(this.codingPos & 1)) { - c |= 0xFF >> (8 - this.outputBits); - } - bits -= this.outputBits; - this.outputBits = 0; - if (codingLine[this.codingPos] < columns) { - this.codingPos++; - this.outputBits = (codingLine[this.codingPos] - - codingLine[this.codingPos - 1]); - } else if (bits > 0) { - c <<= bits; - bits = 0; - } - } - } while (bits); - } - if (this.black) { - c ^= 0xFF; - } - return c; - }; - - // This functions returns the code found from the table. - // The start and end parameters set the boundaries for searching the table. - // The limit parameter is optional. Function returns an array with three - // values. The first array element indicates whether a valid code is being - // returned. The second array element is the actual code. The third array - // element indicates whether EOF was reached. - CCITTFaxStream.prototype.findTableCode = - function ccittFaxStreamFindTableCode(start, end, table, limit) { - - var limitValue = limit || 0; - for (var i = start; i <= end; ++i) { - var code = this.lookBits(i); - if (code === EOF) { - return [true, 1, false]; - } - if (i < end) { - code <<= end - i; - } - if (!limitValue || code >= limitValue) { - var p = table[code - limitValue]; - if (p[0] === i) { - this.eatBits(i); - return [true, p[1], true]; - } - } - } - return [false, 0, false]; - }; - - CCITTFaxStream.prototype.getTwoDimCode = - function ccittFaxStreamGetTwoDimCode() { - - var code = 0; - var p; - if (this.eoblock) { - code = this.lookBits(7); - p = twoDimTable[code]; - if (p && p[0] > 0) { - this.eatBits(p[0]); - return p[1]; - } - } else { - var result = this.findTableCode(1, 7, twoDimTable); - if (result[0] && result[2]) { - return result[1]; - } - } - info('Bad two dim code'); - return EOF; - }; - - CCITTFaxStream.prototype.getWhiteCode = - function ccittFaxStreamGetWhiteCode() { - - var code = 0; - var p; - if (this.eoblock) { - code = this.lookBits(12); - if (code === EOF) { - return 1; - } - - if ((code >> 5) === 0) { - p = whiteTable1[code]; - } else { - p = whiteTable2[code >> 3]; - } - - if (p[0] > 0) { - this.eatBits(p[0]); - return p[1]; - } - } else { - var result = this.findTableCode(1, 9, whiteTable2); - if (result[0]) { - return result[1]; - } - - result = this.findTableCode(11, 12, whiteTable1); - if (result[0]) { - return result[1]; - } - } - info('bad white code'); - this.eatBits(1); - return 1; - }; - - CCITTFaxStream.prototype.getBlackCode = - function ccittFaxStreamGetBlackCode() { - - var code, p; - if (this.eoblock) { - code = this.lookBits(13); - if (code === EOF) { - return 1; - } - if ((code >> 7) === 0) { - p = blackTable1[code]; - } else if ((code >> 9) === 0 && (code >> 7) !== 0) { - p = blackTable2[(code >> 1) - 64]; - } else { - p = blackTable3[code >> 7]; - } - - if (p[0] > 0) { - this.eatBits(p[0]); - return p[1]; - } - } else { - var result = this.findTableCode(2, 6, blackTable3); - if (result[0]) { - return result[1]; - } - - result = this.findTableCode(7, 12, blackTable2, 64); - if (result[0]) { - return result[1]; - } - - result = this.findTableCode(10, 13, blackTable1); - if (result[0]) { - return result[1]; - } - } - info('bad black code'); - this.eatBits(1); - return 1; - }; - - CCITTFaxStream.prototype.lookBits = function CCITTFaxStream_lookBits(n) { - var c; - while (this.inputBits < n) { - if ((c = this.str.getByte()) === -1) { - if (this.inputBits === 0) { - return EOF; - } - return ((this.inputBuf << (n - this.inputBits)) & - (0xFFFF >> (16 - n))); - } - this.inputBuf = (this.inputBuf << 8) + c; - this.inputBits += 8; - } - return (this.inputBuf >> (this.inputBits - n)) & (0xFFFF >> (16 - n)); - }; - - CCITTFaxStream.prototype.eatBits = function CCITTFaxStream_eatBits(n) { - if ((this.inputBits -= n) < 0) { - this.inputBits = 0; - } - }; - - return CCITTFaxStream; -})(); - -var LZWStream = (function LZWStreamClosure() { - function LZWStream(str, maybeLength, earlyChange) { - this.str = str; - this.dict = str.dict; - this.cachedData = 0; - this.bitsCached = 0; - - var maxLzwDictionarySize = 4096; - var lzwState = { - earlyChange: earlyChange, - codeLength: 9, - nextCode: 258, - dictionaryValues: new Uint8Array(maxLzwDictionarySize), - dictionaryLengths: new Uint16Array(maxLzwDictionarySize), - dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize), - currentSequence: new Uint8Array(maxLzwDictionarySize), - currentSequenceLength: 0 - }; - for (var i = 0; i < 256; ++i) { - lzwState.dictionaryValues[i] = i; - lzwState.dictionaryLengths[i] = 1; - } - this.lzwState = lzwState; - - DecodeStream.call(this, maybeLength); - } - - LZWStream.prototype = Object.create(DecodeStream.prototype); - - LZWStream.prototype.readBits = function LZWStream_readBits(n) { - var bitsCached = this.bitsCached; - var cachedData = this.cachedData; - while (bitsCached < n) { - var c = this.str.getByte(); - if (c === -1) { - this.eof = true; - return null; - } - cachedData = (cachedData << 8) | c; - bitsCached += 8; - } - this.bitsCached = (bitsCached -= n); - this.cachedData = cachedData; - this.lastCode = null; - return (cachedData >>> bitsCached) & ((1 << n) - 1); - }; - - LZWStream.prototype.readBlock = function LZWStream_readBlock() { - var blockSize = 512; - var estimatedDecodedSize = blockSize * 2, decodedSizeDelta = blockSize; - var i, j, q; - - var lzwState = this.lzwState; - if (!lzwState) { - return; // eof was found - } - - var earlyChange = lzwState.earlyChange; - var nextCode = lzwState.nextCode; - var dictionaryValues = lzwState.dictionaryValues; - var dictionaryLengths = lzwState.dictionaryLengths; - var dictionaryPrevCodes = lzwState.dictionaryPrevCodes; - var codeLength = lzwState.codeLength; - var prevCode = lzwState.prevCode; - var currentSequence = lzwState.currentSequence; - var currentSequenceLength = lzwState.currentSequenceLength; - - var decodedLength = 0; - var currentBufferLength = this.bufferLength; - var buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); - - for (i = 0; i < blockSize; i++) { - var code = this.readBits(codeLength); - var hasPrev = currentSequenceLength > 0; - if (code < 256) { - currentSequence[0] = code; - currentSequenceLength = 1; - } else if (code >= 258) { - if (code < nextCode) { - currentSequenceLength = dictionaryLengths[code]; - for (j = currentSequenceLength - 1, q = code; j >= 0; j--) { - currentSequence[j] = dictionaryValues[q]; - q = dictionaryPrevCodes[q]; - } - } else { - currentSequence[currentSequenceLength++] = currentSequence[0]; - } - } else if (code === 256) { - codeLength = 9; - nextCode = 258; - currentSequenceLength = 0; - continue; - } else { - this.eof = true; - delete this.lzwState; - break; - } - - if (hasPrev) { - dictionaryPrevCodes[nextCode] = prevCode; - dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1; - dictionaryValues[nextCode] = currentSequence[0]; - nextCode++; - codeLength = (nextCode + earlyChange) & (nextCode + earlyChange - 1) ? - codeLength : Math.min(Math.log(nextCode + earlyChange) / - 0.6931471805599453 + 1, 12) | 0; - } - prevCode = code; - - decodedLength += currentSequenceLength; - if (estimatedDecodedSize < decodedLength) { - do { - estimatedDecodedSize += decodedSizeDelta; - } while (estimatedDecodedSize < decodedLength); - buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); - } - for (j = 0; j < currentSequenceLength; j++) { - buffer[currentBufferLength++] = currentSequence[j]; - } - } - lzwState.nextCode = nextCode; - lzwState.codeLength = codeLength; - lzwState.prevCode = prevCode; - lzwState.currentSequenceLength = currentSequenceLength; - - this.bufferLength = currentBufferLength; - }; - - return LZWStream; -})(); - -var NullStream = (function NullStreamClosure() { - function NullStream() { - Stream.call(this, new Uint8Array(0)); - } - - NullStream.prototype = Stream.prototype; - - return NullStream; -})(); - - -var WorkerTask = (function WorkerTaskClosure() { - function WorkerTask(name) { - this.name = name; - this.terminated = false; - this._capability = createPromiseCapability(); - } - - WorkerTask.prototype = { - get finished() { - return this._capability.promise; - }, - - finish: function () { - this._capability.resolve(); - }, - - terminate: function () { - this.terminated = true; - }, - - ensureNotTerminated: function () { - if (this.terminated) { - throw new Error('Worker task was terminated'); - } - } - }; - - return WorkerTask; -})(); - -var WorkerMessageHandler = PDFJS.WorkerMessageHandler = { - setup: function wphSetup(handler, port) { - handler.on('test', function wphSetupTest(data) { - // check if Uint8Array can be sent to worker - if (!(data instanceof Uint8Array)) { - handler.send('test', 'main', false); - return; - } - // making sure postMessage transfers are working - var supportTransfers = data[0] === 255; - handler.postMessageTransfers = supportTransfers; - // check if the response property is supported by xhr - var xhr = new XMLHttpRequest(); - var responseExists = 'response' in xhr; - // check if the property is actually implemented - try { - var dummy = xhr.responseType; - } catch (e) { - responseExists = false; - } - if (!responseExists) { - handler.send('test', false); - return; - } - handler.send('test', { - supportTypedArray: true, - supportTransfers: supportTransfers - }); - }); - - handler.on('GetDocRequest', function wphSetupDoc(data) { - return WorkerMessageHandler.createDocumentHandler(data, port); - }); - }, - createDocumentHandler: function wphCreateDocumentHandler(docParams, port) { - // This context is actually holds references on pdfManager and handler, - // until the latter is destroyed. - var pdfManager; - var terminated = false; - var cancelXHRs = null; - var WorkerTasks = []; - - var docId = docParams.docId; - var workerHandlerName = docParams.docId + '_worker'; - var handler = new MessageHandler(workerHandlerName, docId, port); - - function ensureNotTerminated() { - if (terminated) { - throw new Error('Worker was terminated'); - } - } - - function startWorkerTask(task) { - WorkerTasks.push(task); - } - - function finishWorkerTask(task) { - task.finish(); - var i = WorkerTasks.indexOf(task); - WorkerTasks.splice(i, 1); - } - - function loadDocument(recoveryMode) { - var loadDocumentCapability = createPromiseCapability(); - - var parseSuccess = function parseSuccess() { - var numPagesPromise = pdfManager.ensureDoc('numPages'); - var fingerprintPromise = pdfManager.ensureDoc('fingerprint'); - var encryptedPromise = pdfManager.ensureXRef('encrypt'); - Promise.all([numPagesPromise, fingerprintPromise, - encryptedPromise]).then(function onDocReady(results) { - var doc = { - numPages: results[0], - fingerprint: results[1], - encrypted: !!results[2], - }; - loadDocumentCapability.resolve(doc); - }, - parseFailure); - }; - - var parseFailure = function parseFailure(e) { - loadDocumentCapability.reject(e); - }; - - pdfManager.ensureDoc('checkHeader', []).then(function() { - pdfManager.ensureDoc('parseStartXRef', []).then(function() { - pdfManager.ensureDoc('parse', [recoveryMode]).then( - parseSuccess, parseFailure); - }, parseFailure); - }, parseFailure); - - return loadDocumentCapability.promise; - } - - function getPdfManager(data) { - var pdfManagerCapability = createPromiseCapability(); - var pdfManager; - - var source = data.source; - var disableRange = data.disableRange; - if (source.data) { - try { - pdfManager = new LocalPdfManager(docId, source.data, source.password); - pdfManagerCapability.resolve(pdfManager); - } catch (ex) { - pdfManagerCapability.reject(ex); - } - return pdfManagerCapability.promise; - } else if (source.chunkedViewerLoading) { - try { - pdfManager = new NetworkPdfManager(docId, source, handler); - pdfManagerCapability.resolve(pdfManager); - } catch (ex) { - pdfManagerCapability.reject(ex); - } - return pdfManagerCapability.promise; - } - - var networkManager = new NetworkManager(source.url, { - httpHeaders: source.httpHeaders, - withCredentials: source.withCredentials - }); - var cachedChunks = []; - var fullRequestXhrId = networkManager.requestFull({ - onHeadersReceived: function onHeadersReceived() { - if (disableRange) { - return; - } - - var fullRequestXhr = networkManager.getRequestXhr(fullRequestXhrId); - if (fullRequestXhr.getResponseHeader('Accept-Ranges') !== 'bytes') { - return; - } - - var contentEncoding = - fullRequestXhr.getResponseHeader('Content-Encoding') || 'identity'; - if (contentEncoding !== 'identity') { - return; - } - - var length = fullRequestXhr.getResponseHeader('Content-Length'); - length = parseInt(length, 10); - if (!isInt(length)) { - return; - } - source.length = length; - if (length <= 2 * source.rangeChunkSize) { - // The file size is smaller than the size of two chunks, so it does - // not make any sense to abort the request and retry with a range - // request. - return; - } - - if (networkManager.isStreamingRequest(fullRequestXhrId)) { - // We can continue fetching when progressive loading is enabled, - // and we don't need the autoFetch feature. - source.disableAutoFetch = true; - } else { - // NOTE: by cancelling the full request, and then issuing range - // requests, there will be an issue for sites where you can only - // request the pdf once. However, if this is the case, then the - // server should not be returning that it can support range - // requests. - networkManager.abortRequest(fullRequestXhrId); - } - - try { - pdfManager = new NetworkPdfManager(docId, source, handler); - pdfManagerCapability.resolve(pdfManager); - } catch (ex) { - pdfManagerCapability.reject(ex); - } - cancelXHRs = null; - }, - - onProgressiveData: source.disableStream ? null : - function onProgressiveData(chunk) { - if (!pdfManager) { - cachedChunks.push(chunk); - return; - } - pdfManager.sendProgressiveData(chunk); - }, - - onDone: function onDone(args) { - if (pdfManager) { - return; // already processed - } - - var pdfFile; - if (args === null) { - // TODO add some streaming manager, e.g. for unknown length files. - // The data was returned in the onProgressiveData, combining... - var pdfFileLength = 0, pos = 0; - cachedChunks.forEach(function (chunk) { - pdfFileLength += chunk.byteLength; - }); - if (source.length && pdfFileLength !== source.length) { - warn('reported HTTP length is different from actual'); - } - var pdfFileArray = new Uint8Array(pdfFileLength); - cachedChunks.forEach(function (chunk) { - pdfFileArray.set(new Uint8Array(chunk), pos); - pos += chunk.byteLength; - }); - pdfFile = pdfFileArray.buffer; - } else { - pdfFile = args.chunk; - } - - // the data is array, instantiating directly from it - try { - pdfManager = new LocalPdfManager(docId, pdfFile, source.password); - pdfManagerCapability.resolve(pdfManager); - } catch (ex) { - pdfManagerCapability.reject(ex); - } - cancelXHRs = null; - }, - - onError: function onError(status) { - var exception; - if (status === 404 || status === 0 && /^file:/.test(source.url)) { - exception = new MissingPDFException('Missing PDF "' + - source.url + '".'); - handler.send('MissingPDF', exception); - } else { - exception = new UnexpectedResponseException( - 'Unexpected server response (' + status + - ') while retrieving PDF "' + source.url + '".', status); - handler.send('UnexpectedResponse', exception); - } - cancelXHRs = null; - }, - - onProgress: function onProgress(evt) { - handler.send('DocProgress', { - loaded: evt.loaded, - total: evt.lengthComputable ? evt.total : source.length - }); - } - }); - - cancelXHRs = function () { - networkManager.abortRequest(fullRequestXhrId); - }; - - return pdfManagerCapability.promise; - } - - var setupDoc = function(data) { - var onSuccess = function(doc) { - ensureNotTerminated(); - handler.send('GetDoc', { pdfInfo: doc }); - }; - - var onFailure = function(e) { - if (e instanceof PasswordException) { - if (e.code === PasswordResponses.NEED_PASSWORD) { - handler.send('NeedPassword', e); - } else if (e.code === PasswordResponses.INCORRECT_PASSWORD) { - handler.send('IncorrectPassword', e); - } - } else if (e instanceof InvalidPDFException) { - handler.send('InvalidPDF', e); - } else if (e instanceof MissingPDFException) { - handler.send('MissingPDF', e); - } else if (e instanceof UnexpectedResponseException) { - handler.send('UnexpectedResponse', e); - } else { - handler.send('UnknownError', - new UnknownErrorException(e.message, e.toString())); - } - }; - - ensureNotTerminated(); - - PDFJS.maxImageSize = data.maxImageSize === undefined ? - -1 : data.maxImageSize; - PDFJS.disableFontFace = data.disableFontFace; - PDFJS.disableCreateObjectURL = data.disableCreateObjectURL; - PDFJS.verbosity = data.verbosity; - PDFJS.cMapUrl = data.cMapUrl === undefined ? - null : data.cMapUrl; - PDFJS.cMapPacked = data.cMapPacked === true; - - getPdfManager(data).then(function (newPdfManager) { - if (terminated) { - // We were in a process of setting up the manager, but it got - // terminated in the middle. - newPdfManager.terminate(); - throw new Error('Worker was terminated'); - } - - pdfManager = newPdfManager; - handler.send('PDFManagerReady', null); - pdfManager.onLoadedStream().then(function(stream) { - handler.send('DataLoaded', { length: stream.bytes.byteLength }); - }); - }).then(function pdfManagerReady() { - ensureNotTerminated(); - - loadDocument(false).then(onSuccess, function loadFailure(ex) { - ensureNotTerminated(); - - // Try again with recoveryMode == true - if (!(ex instanceof XRefParseException)) { - if (ex instanceof PasswordException) { - // after password exception prepare to receive a new password - // to repeat loading - pdfManager.passwordChanged().then(pdfManagerReady); - } - - onFailure(ex); - return; - } - - pdfManager.requestLoadedStream(); - pdfManager.onLoadedStream().then(function() { - ensureNotTerminated(); - - loadDocument(true).then(onSuccess, onFailure); - }); - }, onFailure); - }, onFailure); - }; - - handler.on('GetPage', function wphSetupGetPage(data) { - return pdfManager.getPage(data.pageIndex).then(function(page) { - var rotatePromise = pdfManager.ensure(page, 'rotate'); - var refPromise = pdfManager.ensure(page, 'ref'); - var viewPromise = pdfManager.ensure(page, 'view'); - - return Promise.all([rotatePromise, refPromise, viewPromise]).then( - function(results) { - return { - rotate: results[0], - ref: results[1], - view: results[2] - }; - }); - }); - }); - - handler.on('GetPageIndex', function wphSetupGetPageIndex(data) { - var ref = new Ref(data.ref.num, data.ref.gen); - var catalog = pdfManager.pdfDocument.catalog; - return catalog.getPageIndex(ref); - }); - - handler.on('GetDestinations', - function wphSetupGetDestinations(data) { - return pdfManager.ensureCatalog('destinations'); - } - ); - - handler.on('GetDestination', - function wphSetupGetDestination(data) { - return pdfManager.ensureCatalog('getDestination', [data.id]); - } - ); - - handler.on('GetAttachments', - function wphSetupGetAttachments(data) { - return pdfManager.ensureCatalog('attachments'); - } - ); - - handler.on('GetJavaScript', - function wphSetupGetJavaScript(data) { - return pdfManager.ensureCatalog('javaScript'); - } - ); - - handler.on('GetOutline', - function wphSetupGetOutline(data) { - return pdfManager.ensureCatalog('documentOutline'); - } - ); - - handler.on('GetMetadata', - function wphSetupGetMetadata(data) { - return Promise.all([pdfManager.ensureDoc('documentInfo'), - pdfManager.ensureCatalog('metadata')]); - } - ); - - handler.on('GetData', function wphSetupGetData(data) { - pdfManager.requestLoadedStream(); - return pdfManager.onLoadedStream().then(function(stream) { - return stream.bytes; - }); - }); - - handler.on('GetStats', - function wphSetupGetStats(data) { - return pdfManager.pdfDocument.xref.stats; - } - ); - - handler.on('UpdatePassword', function wphSetupUpdatePassword(data) { - pdfManager.updatePassword(data); - }); - - handler.on('GetAnnotations', function wphSetupGetAnnotations(data) { - return pdfManager.getPage(data.pageIndex).then(function(page) { - return pdfManager.ensure(page, 'getAnnotationsData', [data.intent]); - }); - }); - - handler.on('RenderPageRequest', function wphSetupRenderPage(data) { - var pageIndex = data.pageIndex; - pdfManager.getPage(pageIndex).then(function(page) { - var task = new WorkerTask('RenderPageRequest: page ' + pageIndex); - startWorkerTask(task); - - var pageNum = pageIndex + 1; - var start = Date.now(); - // Pre compile the pdf page and fetch the fonts/images. - page.getOperatorList(handler, task, data.intent).then( - function(operatorList) { - finishWorkerTask(task); - - info('page=' + pageNum + ' - getOperatorList: time=' + - (Date.now() - start) + 'ms, len=' + operatorList.totalLength); - }, function(e) { - finishWorkerTask(task); - if (task.terminated) { - return; // ignoring errors from the terminated thread - } - - // For compatibility with older behavior, generating unknown - // unsupported feature notification on errors. - handler.send('UnsupportedFeature', - {featureId: UNSUPPORTED_FEATURES.unknown}); - - var minimumStackMessage = - 'worker.js: while trying to getPage() and getOperatorList()'; - - var wrappedException; - - // Turn the error into an obj that can be serialized - if (typeof e === 'string') { - wrappedException = { - message: e, - stack: minimumStackMessage - }; - } else if (typeof e === 'object') { - wrappedException = { - message: e.message || e.toString(), - stack: e.stack || minimumStackMessage - }; - } else { - wrappedException = { - message: 'Unknown exception type: ' + (typeof e), - stack: minimumStackMessage - }; - } - - handler.send('PageError', { - pageNum: pageNum, - error: wrappedException, - intent: data.intent - }); - }); - }); - }, this); - - handler.on('GetTextContent', function wphExtractText(data) { - var pageIndex = data.pageIndex; - var normalizeWhitespace = data.normalizeWhitespace; - return pdfManager.getPage(pageIndex).then(function(page) { - var task = new WorkerTask('GetTextContent: page ' + pageIndex); - startWorkerTask(task); - var pageNum = pageIndex + 1; - var start = Date.now(); - return page.extractTextContent(task, normalizeWhitespace).then( - function(textContent) { - finishWorkerTask(task); - info('text indexing: page=' + pageNum + ' - time=' + - (Date.now() - start) + 'ms'); - return textContent; - }, function (reason) { - finishWorkerTask(task); - if (task.terminated) { - return; // ignoring errors from the terminated thread - } - throw reason; - }); - }); - }); - - handler.on('Cleanup', function wphCleanup(data) { - return pdfManager.cleanup(); - }); - - handler.on('Terminate', function wphTerminate(data) { - terminated = true; - if (pdfManager) { - pdfManager.terminate(); - pdfManager = null; - } - if (cancelXHRs) { - cancelXHRs(); - } - - var waitOn = []; - WorkerTasks.forEach(function (task) { - waitOn.push(task.finished); - task.terminate(); - }); - - return Promise.all(waitOn).then(function () { - // Notice that even if we destroying handler, resolved response promise - // must be sent back. - handler.destroy(); - handler = null; - }); - }); - - handler.on('Ready', function wphReady(data) { - setupDoc(docParams); - docParams = null; // we don't need docParams anymore -- saving memory. - }); - return workerHandlerName; - } -}; - -var consoleTimer = {}; - -var workerConsole = { - log: function log() { - var args = Array.prototype.slice.call(arguments); - globalScope.postMessage({ - targetName: 'main', - action: 'console_log', - data: args - }); - }, - - error: function error() { - var args = Array.prototype.slice.call(arguments); - globalScope.postMessage({ - targetName: 'main', - action: 'console_error', - data: args - }); - throw 'pdf.js execution error'; - }, - - time: function time(name) { - consoleTimer[name] = Date.now(); - }, - - timeEnd: function timeEnd(name) { - var time = consoleTimer[name]; - if (!time) { - error('Unknown timer name ' + name); - } - this.log('Timer:', name, Date.now() - time); - } -}; - - -// Worker thread? -if (typeof window === 'undefined') { - if (!('console' in globalScope)) { - globalScope.console = workerConsole; - } - - var handler = new MessageHandler('worker', 'main', this); - WorkerMessageHandler.setup(handler, this); -} - - -/* This class implements the QM Coder decoding as defined in - * JPEG 2000 Part I Final Committee Draft Version 1.0 - * Annex C.3 Arithmetic decoding procedure - * available at http://www.jpeg.org/public/fcd15444-1.pdf - * - * The arithmetic decoder is used in conjunction with context models to decode - * JPEG2000 and JBIG2 streams. - */ -var ArithmeticDecoder = (function ArithmeticDecoderClosure() { - // Table C-2 - var QeTable = [ - {qe: 0x5601, nmps: 1, nlps: 1, switchFlag: 1}, - {qe: 0x3401, nmps: 2, nlps: 6, switchFlag: 0}, - {qe: 0x1801, nmps: 3, nlps: 9, switchFlag: 0}, - {qe: 0x0AC1, nmps: 4, nlps: 12, switchFlag: 0}, - {qe: 0x0521, nmps: 5, nlps: 29, switchFlag: 0}, - {qe: 0x0221, nmps: 38, nlps: 33, switchFlag: 0}, - {qe: 0x5601, nmps: 7, nlps: 6, switchFlag: 1}, - {qe: 0x5401, nmps: 8, nlps: 14, switchFlag: 0}, - {qe: 0x4801, nmps: 9, nlps: 14, switchFlag: 0}, - {qe: 0x3801, nmps: 10, nlps: 14, switchFlag: 0}, - {qe: 0x3001, nmps: 11, nlps: 17, switchFlag: 0}, - {qe: 0x2401, nmps: 12, nlps: 18, switchFlag: 0}, - {qe: 0x1C01, nmps: 13, nlps: 20, switchFlag: 0}, - {qe: 0x1601, nmps: 29, nlps: 21, switchFlag: 0}, - {qe: 0x5601, nmps: 15, nlps: 14, switchFlag: 1}, - {qe: 0x5401, nmps: 16, nlps: 14, switchFlag: 0}, - {qe: 0x5101, nmps: 17, nlps: 15, switchFlag: 0}, - {qe: 0x4801, nmps: 18, nlps: 16, switchFlag: 0}, - {qe: 0x3801, nmps: 19, nlps: 17, switchFlag: 0}, - {qe: 0x3401, nmps: 20, nlps: 18, switchFlag: 0}, - {qe: 0x3001, nmps: 21, nlps: 19, switchFlag: 0}, - {qe: 0x2801, nmps: 22, nlps: 19, switchFlag: 0}, - {qe: 0x2401, nmps: 23, nlps: 20, switchFlag: 0}, - {qe: 0x2201, nmps: 24, nlps: 21, switchFlag: 0}, - {qe: 0x1C01, nmps: 25, nlps: 22, switchFlag: 0}, - {qe: 0x1801, nmps: 26, nlps: 23, switchFlag: 0}, - {qe: 0x1601, nmps: 27, nlps: 24, switchFlag: 0}, - {qe: 0x1401, nmps: 28, nlps: 25, switchFlag: 0}, - {qe: 0x1201, nmps: 29, nlps: 26, switchFlag: 0}, - {qe: 0x1101, nmps: 30, nlps: 27, switchFlag: 0}, - {qe: 0x0AC1, nmps: 31, nlps: 28, switchFlag: 0}, - {qe: 0x09C1, nmps: 32, nlps: 29, switchFlag: 0}, - {qe: 0x08A1, nmps: 33, nlps: 30, switchFlag: 0}, - {qe: 0x0521, nmps: 34, nlps: 31, switchFlag: 0}, - {qe: 0x0441, nmps: 35, nlps: 32, switchFlag: 0}, - {qe: 0x02A1, nmps: 36, nlps: 33, switchFlag: 0}, - {qe: 0x0221, nmps: 37, nlps: 34, switchFlag: 0}, - {qe: 0x0141, nmps: 38, nlps: 35, switchFlag: 0}, - {qe: 0x0111, nmps: 39, nlps: 36, switchFlag: 0}, - {qe: 0x0085, nmps: 40, nlps: 37, switchFlag: 0}, - {qe: 0x0049, nmps: 41, nlps: 38, switchFlag: 0}, - {qe: 0x0025, nmps: 42, nlps: 39, switchFlag: 0}, - {qe: 0x0015, nmps: 43, nlps: 40, switchFlag: 0}, - {qe: 0x0009, nmps: 44, nlps: 41, switchFlag: 0}, - {qe: 0x0005, nmps: 45, nlps: 42, switchFlag: 0}, - {qe: 0x0001, nmps: 45, nlps: 43, switchFlag: 0}, - {qe: 0x5601, nmps: 46, nlps: 46, switchFlag: 0} - ]; - - // C.3.5 Initialisation of the decoder (INITDEC) - function ArithmeticDecoder(data, start, end) { - this.data = data; - this.bp = start; - this.dataEnd = end; - - this.chigh = data[start]; - this.clow = 0; - - this.byteIn(); - - this.chigh = ((this.chigh << 7) & 0xFFFF) | ((this.clow >> 9) & 0x7F); - this.clow = (this.clow << 7) & 0xFFFF; - this.ct -= 7; - this.a = 0x8000; - } - - ArithmeticDecoder.prototype = { - // C.3.4 Compressed data input (BYTEIN) - byteIn: function ArithmeticDecoder_byteIn() { - var data = this.data; - var bp = this.bp; - if (data[bp] === 0xFF) { - var b1 = data[bp + 1]; - if (b1 > 0x8F) { - this.clow += 0xFF00; - this.ct = 8; - } else { - bp++; - this.clow += (data[bp] << 9); - this.ct = 7; - this.bp = bp; - } - } else { - bp++; - this.clow += bp < this.dataEnd ? (data[bp] << 8) : 0xFF00; - this.ct = 8; - this.bp = bp; - } - if (this.clow > 0xFFFF) { - this.chigh += (this.clow >> 16); - this.clow &= 0xFFFF; - } - }, - // C.3.2 Decoding a decision (DECODE) - readBit: function ArithmeticDecoder_readBit(contexts, pos) { - // contexts are packed into 1 byte: - // highest 7 bits carry cx.index, lowest bit carries cx.mps - var cx_index = contexts[pos] >> 1, cx_mps = contexts[pos] & 1; - var qeTableIcx = QeTable[cx_index]; - var qeIcx = qeTableIcx.qe; - var d; - var a = this.a - qeIcx; - - if (this.chigh < qeIcx) { - // exchangeLps - if (a < qeIcx) { - a = qeIcx; - d = cx_mps; - cx_index = qeTableIcx.nmps; - } else { - a = qeIcx; - d = 1 ^ cx_mps; - if (qeTableIcx.switchFlag === 1) { - cx_mps = d; - } - cx_index = qeTableIcx.nlps; - } - } else { - this.chigh -= qeIcx; - if ((a & 0x8000) !== 0) { - this.a = a; - return cx_mps; - } - // exchangeMps - if (a < qeIcx) { - d = 1 ^ cx_mps; - if (qeTableIcx.switchFlag === 1) { - cx_mps = d; - } - cx_index = qeTableIcx.nlps; - } else { - d = cx_mps; - cx_index = qeTableIcx.nmps; - } - } - // C.3.3 renormD; - do { - if (this.ct === 0) { - this.byteIn(); - } - - a <<= 1; - this.chigh = ((this.chigh << 1) & 0xFFFF) | ((this.clow >> 15) & 1); - this.clow = (this.clow << 1) & 0xFFFF; - this.ct--; - } while ((a & 0x8000) === 0); - this.a = a; - - contexts[pos] = cx_index << 1 | cx_mps; - return d; - } - }; - - return ArithmeticDecoder; -})(); - - - -var JpegImage = (function jpegImage() { - var dctZigZag = new Uint8Array([ - 0, - 1, 8, - 16, 9, 2, - 3, 10, 17, 24, - 32, 25, 18, 11, 4, - 5, 12, 19, 26, 33, 40, - 48, 41, 34, 27, 20, 13, 6, - 7, 14, 21, 28, 35, 42, 49, 56, - 57, 50, 43, 36, 29, 22, 15, - 23, 30, 37, 44, 51, 58, - 59, 52, 45, 38, 31, - 39, 46, 53, 60, - 61, 54, 47, - 55, 62, - 63 - ]); - - var dctCos1 = 4017; // cos(pi/16) - var dctSin1 = 799; // sin(pi/16) - var dctCos3 = 3406; // cos(3*pi/16) - var dctSin3 = 2276; // sin(3*pi/16) - var dctCos6 = 1567; // cos(6*pi/16) - var dctSin6 = 3784; // sin(6*pi/16) - var dctSqrt2 = 5793; // sqrt(2) - var dctSqrt1d2 = 2896; // sqrt(2) / 2 - - function constructor() { - } - - function buildHuffmanTable(codeLengths, values) { - var k = 0, code = [], i, j, length = 16; - while (length > 0 && !codeLengths[length - 1]) { - length--; - } - code.push({children: [], index: 0}); - var p = code[0], q; - for (i = 0; i < length; i++) { - for (j = 0; j < codeLengths[i]; j++) { - p = code.pop(); - p.children[p.index] = values[k]; - while (p.index > 0) { - p = code.pop(); - } - p.index++; - code.push(p); - while (code.length <= i) { - code.push(q = {children: [], index: 0}); - p.children[p.index] = q.children; - p = q; - } - k++; - } - if (i + 1 < length) { - // p here points to last code - code.push(q = {children: [], index: 0}); - p.children[p.index] = q.children; - p = q; - } - } - return code[0].children; - } - - function getBlockBufferOffset(component, row, col) { - return 64 * ((component.blocksPerLine + 1) * row + col); - } - - function decodeScan(data, offset, frame, components, resetInterval, - spectralStart, spectralEnd, successivePrev, successive) { - var precision = frame.precision; - var samplesPerLine = frame.samplesPerLine; - var scanLines = frame.scanLines; - var mcusPerLine = frame.mcusPerLine; - var progressive = frame.progressive; - var maxH = frame.maxH, maxV = frame.maxV; - - var startOffset = offset, bitsData = 0, bitsCount = 0; - - function readBit() { - if (bitsCount > 0) { - bitsCount--; - return (bitsData >> bitsCount) & 1; - } - bitsData = data[offset++]; - if (bitsData === 0xFF) { - var nextByte = data[offset++]; - if (nextByte) { - throw 'unexpected marker: ' + - ((bitsData << 8) | nextByte).toString(16); - } - // unstuff 0 - } - bitsCount = 7; - return bitsData >>> 7; - } - - function decodeHuffman(tree) { - var node = tree; - while (true) { - node = node[readBit()]; - if (typeof node === 'number') { - return node; - } - if (typeof node !== 'object') { - throw 'invalid huffman sequence'; - } - } - } - - function receive(length) { - var n = 0; - while (length > 0) { - n = (n << 1) | readBit(); - length--; - } - return n; - } - - function receiveAndExtend(length) { - if (length === 1) { - return readBit() === 1 ? 1 : -1; - } - var n = receive(length); - if (n >= 1 << (length - 1)) { - return n; - } - return n + (-1 << length) + 1; - } - - function decodeBaseline(component, offset) { - var t = decodeHuffman(component.huffmanTableDC); - var diff = t === 0 ? 0 : receiveAndExtend(t); - component.blockData[offset] = (component.pred += diff); - var k = 1; - while (k < 64) { - var rs = decodeHuffman(component.huffmanTableAC); - var s = rs & 15, r = rs >> 4; - if (s === 0) { - if (r < 15) { - break; - } - k += 16; - continue; - } - k += r; - var z = dctZigZag[k]; - component.blockData[offset + z] = receiveAndExtend(s); - k++; - } - } - - function decodeDCFirst(component, offset) { - var t = decodeHuffman(component.huffmanTableDC); - var diff = t === 0 ? 0 : (receiveAndExtend(t) << successive); - component.blockData[offset] = (component.pred += diff); - } - - function decodeDCSuccessive(component, offset) { - component.blockData[offset] |= readBit() << successive; - } - - var eobrun = 0; - function decodeACFirst(component, offset) { - if (eobrun > 0) { - eobrun--; - return; - } - var k = spectralStart, e = spectralEnd; - while (k <= e) { - var rs = decodeHuffman(component.huffmanTableAC); - var s = rs & 15, r = rs >> 4; - if (s === 0) { - if (r < 15) { - eobrun = receive(r) + (1 << r) - 1; - break; - } - k += 16; - continue; - } - k += r; - var z = dctZigZag[k]; - component.blockData[offset + z] = - receiveAndExtend(s) * (1 << successive); - k++; - } - } - - var successiveACState = 0, successiveACNextValue; - function decodeACSuccessive(component, offset) { - var k = spectralStart; - var e = spectralEnd; - var r = 0; - var s; - var rs; - while (k <= e) { - var z = dctZigZag[k]; - switch (successiveACState) { - case 0: // initial state - rs = decodeHuffman(component.huffmanTableAC); - s = rs & 15; - r = rs >> 4; - if (s === 0) { - if (r < 15) { - eobrun = receive(r) + (1 << r); - successiveACState = 4; - } else { - r = 16; - successiveACState = 1; - } - } else { - if (s !== 1) { - throw 'invalid ACn encoding'; - } - successiveACNextValue = receiveAndExtend(s); - successiveACState = r ? 2 : 3; - } - continue; - case 1: // skipping r zero items - case 2: - if (component.blockData[offset + z]) { - component.blockData[offset + z] += (readBit() << successive); - } else { - r--; - if (r === 0) { - successiveACState = successiveACState === 2 ? 3 : 0; - } - } - break; - case 3: // set value for a zero item - if (component.blockData[offset + z]) { - component.blockData[offset + z] += (readBit() << successive); - } else { - component.blockData[offset + z] = - successiveACNextValue << successive; - successiveACState = 0; - } - break; - case 4: // eob - if (component.blockData[offset + z]) { - component.blockData[offset + z] += (readBit() << successive); - } - break; - } - k++; - } - if (successiveACState === 4) { - eobrun--; - if (eobrun === 0) { - successiveACState = 0; - } - } - } - - function decodeMcu(component, decode, mcu, row, col) { - var mcuRow = (mcu / mcusPerLine) | 0; - var mcuCol = mcu % mcusPerLine; - var blockRow = mcuRow * component.v + row; - var blockCol = mcuCol * component.h + col; - var offset = getBlockBufferOffset(component, blockRow, blockCol); - decode(component, offset); - } - - function decodeBlock(component, decode, mcu) { - var blockRow = (mcu / component.blocksPerLine) | 0; - var blockCol = mcu % component.blocksPerLine; - var offset = getBlockBufferOffset(component, blockRow, blockCol); - decode(component, offset); - } - - var componentsLength = components.length; - var component, i, j, k, n; - var decodeFn; - if (progressive) { - if (spectralStart === 0) { - decodeFn = successivePrev === 0 ? decodeDCFirst : decodeDCSuccessive; - } else { - decodeFn = successivePrev === 0 ? decodeACFirst : decodeACSuccessive; - } - } else { - decodeFn = decodeBaseline; - } - - var mcu = 0, marker; - var mcuExpected; - if (componentsLength === 1) { - mcuExpected = components[0].blocksPerLine * components[0].blocksPerColumn; - } else { - mcuExpected = mcusPerLine * frame.mcusPerColumn; - } - if (!resetInterval) { - resetInterval = mcuExpected; - } - - var h, v; - while (mcu < mcuExpected) { - // reset interval stuff - for (i = 0; i < componentsLength; i++) { - components[i].pred = 0; - } - eobrun = 0; - - if (componentsLength === 1) { - component = components[0]; - for (n = 0; n < resetInterval; n++) { - decodeBlock(component, decodeFn, mcu); - mcu++; - } - } else { - for (n = 0; n < resetInterval; n++) { - for (i = 0; i < componentsLength; i++) { - component = components[i]; - h = component.h; - v = component.v; - for (j = 0; j < v; j++) { - for (k = 0; k < h; k++) { - decodeMcu(component, decodeFn, mcu, j, k); - } - } - } - mcu++; - } - } - - // find marker - bitsCount = 0; - marker = (data[offset] << 8) | data[offset + 1]; - if (marker <= 0xFF00) { - throw 'marker was not found'; - } - - if (marker >= 0xFFD0 && marker <= 0xFFD7) { // RSTx - offset += 2; - } else { - break; - } - } - - return offset - startOffset; - } - - // A port of poppler's IDCT method which in turn is taken from: - // Christoph Loeffler, Adriaan Ligtenberg, George S. Moschytz, - // 'Practical Fast 1-D DCT Algorithms with 11 Multiplications', - // IEEE Intl. Conf. on Acoustics, Speech & Signal Processing, 1989, - // 988-991. - function quantizeAndInverse(component, blockBufferOffset, p) { - var qt = component.quantizationTable, blockData = component.blockData; - var v0, v1, v2, v3, v4, v5, v6, v7; - var p0, p1, p2, p3, p4, p5, p6, p7; - var t; - - // inverse DCT on rows - for (var row = 0; row < 64; row += 8) { - // gather block data - p0 = blockData[blockBufferOffset + row]; - p1 = blockData[blockBufferOffset + row + 1]; - p2 = blockData[blockBufferOffset + row + 2]; - p3 = blockData[blockBufferOffset + row + 3]; - p4 = blockData[blockBufferOffset + row + 4]; - p5 = blockData[blockBufferOffset + row + 5]; - p6 = blockData[blockBufferOffset + row + 6]; - p7 = blockData[blockBufferOffset + row + 7]; - - // dequant p0 - p0 *= qt[row]; - - // check for all-zero AC coefficients - if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { - t = (dctSqrt2 * p0 + 512) >> 10; - p[row] = t; - p[row + 1] = t; - p[row + 2] = t; - p[row + 3] = t; - p[row + 4] = t; - p[row + 5] = t; - p[row + 6] = t; - p[row + 7] = t; - continue; - } - // dequant p1 ... p7 - p1 *= qt[row + 1]; - p2 *= qt[row + 2]; - p3 *= qt[row + 3]; - p4 *= qt[row + 4]; - p5 *= qt[row + 5]; - p6 *= qt[row + 6]; - p7 *= qt[row + 7]; - - // stage 4 - v0 = (dctSqrt2 * p0 + 128) >> 8; - v1 = (dctSqrt2 * p4 + 128) >> 8; - v2 = p2; - v3 = p6; - v4 = (dctSqrt1d2 * (p1 - p7) + 128) >> 8; - v7 = (dctSqrt1d2 * (p1 + p7) + 128) >> 8; - v5 = p3 << 4; - v6 = p5 << 4; - - // stage 3 - v0 = (v0 + v1 + 1) >> 1; - v1 = v0 - v1; - t = (v2 * dctSin6 + v3 * dctCos6 + 128) >> 8; - v2 = (v2 * dctCos6 - v3 * dctSin6 + 128) >> 8; - v3 = t; - v4 = (v4 + v6 + 1) >> 1; - v6 = v4 - v6; - v7 = (v7 + v5 + 1) >> 1; - v5 = v7 - v5; - - // stage 2 - v0 = (v0 + v3 + 1) >> 1; - v3 = v0 - v3; - v1 = (v1 + v2 + 1) >> 1; - v2 = v1 - v2; - t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12; - v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12; - v7 = t; - t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12; - v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12; - v6 = t; - - // stage 1 - p[row] = v0 + v7; - p[row + 7] = v0 - v7; - p[row + 1] = v1 + v6; - p[row + 6] = v1 - v6; - p[row + 2] = v2 + v5; - p[row + 5] = v2 - v5; - p[row + 3] = v3 + v4; - p[row + 4] = v3 - v4; - } - - // inverse DCT on columns - for (var col = 0; col < 8; ++col) { - p0 = p[col]; - p1 = p[col + 8]; - p2 = p[col + 16]; - p3 = p[col + 24]; - p4 = p[col + 32]; - p5 = p[col + 40]; - p6 = p[col + 48]; - p7 = p[col + 56]; - - // check for all-zero AC coefficients - if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { - t = (dctSqrt2 * p0 + 8192) >> 14; - // convert to 8 bit - t = (t < -2040) ? 0 : (t >= 2024) ? 255 : (t + 2056) >> 4; - blockData[blockBufferOffset + col] = t; - blockData[blockBufferOffset + col + 8] = t; - blockData[blockBufferOffset + col + 16] = t; - blockData[blockBufferOffset + col + 24] = t; - blockData[blockBufferOffset + col + 32] = t; - blockData[blockBufferOffset + col + 40] = t; - blockData[blockBufferOffset + col + 48] = t; - blockData[blockBufferOffset + col + 56] = t; - continue; - } - - // stage 4 - v0 = (dctSqrt2 * p0 + 2048) >> 12; - v1 = (dctSqrt2 * p4 + 2048) >> 12; - v2 = p2; - v3 = p6; - v4 = (dctSqrt1d2 * (p1 - p7) + 2048) >> 12; - v7 = (dctSqrt1d2 * (p1 + p7) + 2048) >> 12; - v5 = p3; - v6 = p5; - - // stage 3 - // Shift v0 by 128.5 << 5 here, so we don't need to shift p0...p7 when - // converting to UInt8 range later. - v0 = ((v0 + v1 + 1) >> 1) + 4112; - v1 = v0 - v1; - t = (v2 * dctSin6 + v3 * dctCos6 + 2048) >> 12; - v2 = (v2 * dctCos6 - v3 * dctSin6 + 2048) >> 12; - v3 = t; - v4 = (v4 + v6 + 1) >> 1; - v6 = v4 - v6; - v7 = (v7 + v5 + 1) >> 1; - v5 = v7 - v5; - - // stage 2 - v0 = (v0 + v3 + 1) >> 1; - v3 = v0 - v3; - v1 = (v1 + v2 + 1) >> 1; - v2 = v1 - v2; - t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12; - v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12; - v7 = t; - t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12; - v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12; - v6 = t; - - // stage 1 - p0 = v0 + v7; - p7 = v0 - v7; - p1 = v1 + v6; - p6 = v1 - v6; - p2 = v2 + v5; - p5 = v2 - v5; - p3 = v3 + v4; - p4 = v3 - v4; - - // convert to 8-bit integers - p0 = (p0 < 16) ? 0 : (p0 >= 4080) ? 255 : p0 >> 4; - p1 = (p1 < 16) ? 0 : (p1 >= 4080) ? 255 : p1 >> 4; - p2 = (p2 < 16) ? 0 : (p2 >= 4080) ? 255 : p2 >> 4; - p3 = (p3 < 16) ? 0 : (p3 >= 4080) ? 255 : p3 >> 4; - p4 = (p4 < 16) ? 0 : (p4 >= 4080) ? 255 : p4 >> 4; - p5 = (p5 < 16) ? 0 : (p5 >= 4080) ? 255 : p5 >> 4; - p6 = (p6 < 16) ? 0 : (p6 >= 4080) ? 255 : p6 >> 4; - p7 = (p7 < 16) ? 0 : (p7 >= 4080) ? 255 : p7 >> 4; - - // store block data - blockData[blockBufferOffset + col] = p0; - blockData[blockBufferOffset + col + 8] = p1; - blockData[blockBufferOffset + col + 16] = p2; - blockData[blockBufferOffset + col + 24] = p3; - blockData[blockBufferOffset + col + 32] = p4; - blockData[blockBufferOffset + col + 40] = p5; - blockData[blockBufferOffset + col + 48] = p6; - blockData[blockBufferOffset + col + 56] = p7; - } - } - - function buildComponentData(frame, component) { - var blocksPerLine = component.blocksPerLine; - var blocksPerColumn = component.blocksPerColumn; - var computationBuffer = new Int16Array(64); - - for (var blockRow = 0; blockRow < blocksPerColumn; blockRow++) { - for (var blockCol = 0; blockCol < blocksPerLine; blockCol++) { - var offset = getBlockBufferOffset(component, blockRow, blockCol); - quantizeAndInverse(component, offset, computationBuffer); - } - } - return component.blockData; - } - - function clamp0to255(a) { - return a <= 0 ? 0 : a >= 255 ? 255 : a; - } - - constructor.prototype = { - parse: function parse(data) { - - function readUint16() { - var value = (data[offset] << 8) | data[offset + 1]; - offset += 2; - return value; - } - - function readDataBlock() { - var length = readUint16(); - var array = data.subarray(offset, offset + length - 2); - offset += array.length; - return array; - } - - function prepareComponents(frame) { - var mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / frame.maxH); - var mcusPerColumn = Math.ceil(frame.scanLines / 8 / frame.maxV); - for (var i = 0; i < frame.components.length; i++) { - component = frame.components[i]; - var blocksPerLine = Math.ceil(Math.ceil(frame.samplesPerLine / 8) * - component.h / frame.maxH); - var blocksPerColumn = Math.ceil(Math.ceil(frame.scanLines / 8) * - component.v / frame.maxV); - var blocksPerLineForMcu = mcusPerLine * component.h; - var blocksPerColumnForMcu = mcusPerColumn * component.v; - - var blocksBufferSize = 64 * blocksPerColumnForMcu * - (blocksPerLineForMcu + 1); - component.blockData = new Int16Array(blocksBufferSize); - component.blocksPerLine = blocksPerLine; - component.blocksPerColumn = blocksPerColumn; - } - frame.mcusPerLine = mcusPerLine; - frame.mcusPerColumn = mcusPerColumn; - } - - var offset = 0, length = data.length; - var jfif = null; - var adobe = null; - var pixels = null; - var frame, resetInterval; - var quantizationTables = []; - var huffmanTablesAC = [], huffmanTablesDC = []; - var fileMarker = readUint16(); - if (fileMarker !== 0xFFD8) { // SOI (Start of Image) - throw 'SOI not found'; - } - - fileMarker = readUint16(); - while (fileMarker !== 0xFFD9) { // EOI (End of image) - var i, j, l; - switch(fileMarker) { - case 0xFFE0: // APP0 (Application Specific) - case 0xFFE1: // APP1 - case 0xFFE2: // APP2 - case 0xFFE3: // APP3 - case 0xFFE4: // APP4 - case 0xFFE5: // APP5 - case 0xFFE6: // APP6 - case 0xFFE7: // APP7 - case 0xFFE8: // APP8 - case 0xFFE9: // APP9 - case 0xFFEA: // APP10 - case 0xFFEB: // APP11 - case 0xFFEC: // APP12 - case 0xFFED: // APP13 - case 0xFFEE: // APP14 - case 0xFFEF: // APP15 - case 0xFFFE: // COM (Comment) - var appData = readDataBlock(); - - if (fileMarker === 0xFFE0) { - if (appData[0] === 0x4A && appData[1] === 0x46 && - appData[2] === 0x49 && appData[3] === 0x46 && - appData[4] === 0) { // 'JFIF\x00' - jfif = { - version: { major: appData[5], minor: appData[6] }, - densityUnits: appData[7], - xDensity: (appData[8] << 8) | appData[9], - yDensity: (appData[10] << 8) | appData[11], - thumbWidth: appData[12], - thumbHeight: appData[13], - thumbData: appData.subarray(14, 14 + - 3 * appData[12] * appData[13]) - }; - } - } - // TODO APP1 - Exif - if (fileMarker === 0xFFEE) { - if (appData[0] === 0x41 && appData[1] === 0x64 && - appData[2] === 0x6F && appData[3] === 0x62 && - appData[4] === 0x65) { // 'Adobe' - adobe = { - version: (appData[5] << 8) | appData[6], - flags0: (appData[7] << 8) | appData[8], - flags1: (appData[9] << 8) | appData[10], - transformCode: appData[11] - }; - } - } - break; - - case 0xFFDB: // DQT (Define Quantization Tables) - var quantizationTablesLength = readUint16(); - var quantizationTablesEnd = quantizationTablesLength + offset - 2; - var z; - while (offset < quantizationTablesEnd) { - var quantizationTableSpec = data[offset++]; - var tableData = new Uint16Array(64); - if ((quantizationTableSpec >> 4) === 0) { // 8 bit values - for (j = 0; j < 64; j++) { - z = dctZigZag[j]; - tableData[z] = data[offset++]; - } - } else if ((quantizationTableSpec >> 4) === 1) { //16 bit - for (j = 0; j < 64; j++) { - z = dctZigZag[j]; - tableData[z] = readUint16(); - } - } else { - throw 'DQT: invalid table spec'; - } - quantizationTables[quantizationTableSpec & 15] = tableData; - } - break; - - case 0xFFC0: // SOF0 (Start of Frame, Baseline DCT) - case 0xFFC1: // SOF1 (Start of Frame, Extended DCT) - case 0xFFC2: // SOF2 (Start of Frame, Progressive DCT) - if (frame) { - throw 'Only single frame JPEGs supported'; - } - readUint16(); // skip data length - frame = {}; - frame.extended = (fileMarker === 0xFFC1); - frame.progressive = (fileMarker === 0xFFC2); - frame.precision = data[offset++]; - frame.scanLines = readUint16(); - frame.samplesPerLine = readUint16(); - frame.components = []; - frame.componentIds = {}; - var componentsCount = data[offset++], componentId; - var maxH = 0, maxV = 0; - for (i = 0; i < componentsCount; i++) { - componentId = data[offset]; - var h = data[offset + 1] >> 4; - var v = data[offset + 1] & 15; - if (maxH < h) { - maxH = h; - } - if (maxV < v) { - maxV = v; - } - var qId = data[offset + 2]; - l = frame.components.push({ - h: h, - v: v, - quantizationTable: quantizationTables[qId] - }); - frame.componentIds[componentId] = l - 1; - offset += 3; - } - frame.maxH = maxH; - frame.maxV = maxV; - prepareComponents(frame); - break; - - case 0xFFC4: // DHT (Define Huffman Tables) - var huffmanLength = readUint16(); - for (i = 2; i < huffmanLength;) { - var huffmanTableSpec = data[offset++]; - var codeLengths = new Uint8Array(16); - var codeLengthSum = 0; - for (j = 0; j < 16; j++, offset++) { - codeLengthSum += (codeLengths[j] = data[offset]); - } - var huffmanValues = new Uint8Array(codeLengthSum); - for (j = 0; j < codeLengthSum; j++, offset++) { - huffmanValues[j] = data[offset]; - } - i += 17 + codeLengthSum; - - ((huffmanTableSpec >> 4) === 0 ? - huffmanTablesDC : huffmanTablesAC)[huffmanTableSpec & 15] = - buildHuffmanTable(codeLengths, huffmanValues); - } - break; - - case 0xFFDD: // DRI (Define Restart Interval) - readUint16(); // skip data length - resetInterval = readUint16(); - break; - - case 0xFFDA: // SOS (Start of Scan) - var scanLength = readUint16(); - var selectorsCount = data[offset++]; - var components = [], component; - for (i = 0; i < selectorsCount; i++) { - var componentIndex = frame.componentIds[data[offset++]]; - component = frame.components[componentIndex]; - var tableSpec = data[offset++]; - component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4]; - component.huffmanTableAC = huffmanTablesAC[tableSpec & 15]; - components.push(component); - } - var spectralStart = data[offset++]; - var spectralEnd = data[offset++]; - var successiveApproximation = data[offset++]; - var processed = decodeScan(data, offset, - frame, components, resetInterval, - spectralStart, spectralEnd, - successiveApproximation >> 4, successiveApproximation & 15); - offset += processed; - break; - - case 0xFFFF: // Fill bytes - if (data[offset] !== 0xFF) { // Avoid skipping a valid marker. - offset--; - } - break; - - default: - if (data[offset - 3] === 0xFF && - data[offset - 2] >= 0xC0 && data[offset - 2] <= 0xFE) { - // could be incorrect encoding -- last 0xFF byte of the previous - // block was eaten by the encoder - offset -= 3; - break; - } - throw 'unknown JPEG marker ' + fileMarker.toString(16); - } - fileMarker = readUint16(); - } - - this.width = frame.samplesPerLine; - this.height = frame.scanLines; - this.jfif = jfif; - this.adobe = adobe; - this.components = []; - for (i = 0; i < frame.components.length; i++) { - component = frame.components[i]; - this.components.push({ - output: buildComponentData(frame, component), - scaleX: component.h / frame.maxH, - scaleY: component.v / frame.maxV, - blocksPerLine: component.blocksPerLine, - blocksPerColumn: component.blocksPerColumn - }); - } - this.numComponents = this.components.length; - }, - - _getLinearizedBlockData: function getLinearizedBlockData(width, height) { - var scaleX = this.width / width, scaleY = this.height / height; - - var component, componentScaleX, componentScaleY, blocksPerScanline; - var x, y, i, j, k; - var index; - var offset = 0; - var output; - var numComponents = this.components.length; - var dataLength = width * height * numComponents; - var data = new Uint8Array(dataLength); - var xScaleBlockOffset = new Uint32Array(width); - var mask3LSB = 0xfffffff8; // used to clear the 3 LSBs - - for (i = 0; i < numComponents; i++) { - component = this.components[i]; - componentScaleX = component.scaleX * scaleX; - componentScaleY = component.scaleY * scaleY; - offset = i; - output = component.output; - blocksPerScanline = (component.blocksPerLine + 1) << 3; - // precalculate the xScaleBlockOffset - for (x = 0; x < width; x++) { - j = 0 | (x * componentScaleX); - xScaleBlockOffset[x] = ((j & mask3LSB) << 3) | (j & 7); - } - // linearize the blocks of the component - for (y = 0; y < height; y++) { - j = 0 | (y * componentScaleY); - index = blocksPerScanline * (j & mask3LSB) | ((j & 7) << 3); - for (x = 0; x < width; x++) { - data[offset] = output[index + xScaleBlockOffset[x]]; - offset += numComponents; - } - } - } - - // decodeTransform contains pairs of multiplier (-256..256) and additive - var transform = this.decodeTransform; - if (transform) { - for (i = 0; i < dataLength;) { - for (j = 0, k = 0; j < numComponents; j++, i++, k += 2) { - data[i] = ((data[i] * transform[k]) >> 8) + transform[k + 1]; - } - } - } - return data; - }, - - _isColorConversionNeeded: function isColorConversionNeeded() { - if (this.adobe && this.adobe.transformCode) { - // The adobe transform marker overrides any previous setting - return true; - } else if (this.numComponents === 3) { - return true; - } else { - return false; - } - }, - - _convertYccToRgb: function convertYccToRgb(data) { - var Y, Cb, Cr; - for (var i = 0, length = data.length; i < length; i += 3) { - Y = data[i ]; - Cb = data[i + 1]; - Cr = data[i + 2]; - data[i ] = clamp0to255(Y - 179.456 + 1.402 * Cr); - data[i + 1] = clamp0to255(Y + 135.459 - 0.344 * Cb - 0.714 * Cr); - data[i + 2] = clamp0to255(Y - 226.816 + 1.772 * Cb); - } - return data; - }, - - _convertYcckToRgb: function convertYcckToRgb(data) { - var Y, Cb, Cr, k; - var offset = 0; - for (var i = 0, length = data.length; i < length; i += 4) { - Y = data[i]; - Cb = data[i + 1]; - Cr = data[i + 2]; - k = data[i + 3]; - - var r = -122.67195406894 + - Cb * (-6.60635669420364e-5 * Cb + 0.000437130475926232 * Cr - - 5.4080610064599e-5 * Y + 0.00048449797120281 * k - - 0.154362151871126) + - Cr * (-0.000957964378445773 * Cr + 0.000817076911346625 * Y - - 0.00477271405408747 * k + 1.53380253221734) + - Y * (0.000961250184130688 * Y - 0.00266257332283933 * k + - 0.48357088451265) + - k * (-0.000336197177618394 * k + 0.484791561490776); - - var g = 107.268039397724 + - Cb * (2.19927104525741e-5 * Cb - 0.000640992018297945 * Cr + - 0.000659397001245577 * Y + 0.000426105652938837 * k - - 0.176491792462875) + - Cr * (-0.000778269941513683 * Cr + 0.00130872261408275 * Y + - 0.000770482631801132 * k - 0.151051492775562) + - Y * (0.00126935368114843 * Y - 0.00265090189010898 * k + - 0.25802910206845) + - k * (-0.000318913117588328 * k - 0.213742400323665); - - var b = -20.810012546947 + - Cb * (-0.000570115196973677 * Cb - 2.63409051004589e-5 * Cr + - 0.0020741088115012 * Y - 0.00288260236853442 * k + - 0.814272968359295) + - Cr * (-1.53496057440975e-5 * Cr - 0.000132689043961446 * Y + - 0.000560833691242812 * k - 0.195152027534049) + - Y * (0.00174418132927582 * Y - 0.00255243321439347 * k + - 0.116935020465145) + - k * (-0.000343531996510555 * k + 0.24165260232407); - - data[offset++] = clamp0to255(r); - data[offset++] = clamp0to255(g); - data[offset++] = clamp0to255(b); - } - return data; - }, - - _convertYcckToCmyk: function convertYcckToCmyk(data) { - var Y, Cb, Cr; - for (var i = 0, length = data.length; i < length; i += 4) { - Y = data[i]; - Cb = data[i + 1]; - Cr = data[i + 2]; - data[i ] = clamp0to255(434.456 - Y - 1.402 * Cr); - data[i + 1] = clamp0to255(119.541 - Y + 0.344 * Cb + 0.714 * Cr); - data[i + 2] = clamp0to255(481.816 - Y - 1.772 * Cb); - // K in data[i + 3] is unchanged - } - return data; - }, - - _convertCmykToRgb: function convertCmykToRgb(data) { - var c, m, y, k; - var offset = 0; - var min = -255 * 255 * 255; - var scale = 1 / 255 / 255; - for (var i = 0, length = data.length; i < length; i += 4) { - c = data[i]; - m = data[i + 1]; - y = data[i + 2]; - k = data[i + 3]; - - var r = - c * (-4.387332384609988 * c + 54.48615194189176 * m + - 18.82290502165302 * y + 212.25662451639585 * k - - 72734.4411664936) + - m * (1.7149763477362134 * m - 5.6096736904047315 * y - - 17.873870861415444 * k - 1401.7366389350734) + - y * (-2.5217340131683033 * y - 21.248923337353073 * k + - 4465.541406466231) - - k * (21.86122147463605 * k + 48317.86113160301); - var g = - c * (8.841041422036149 * c + 60.118027045597366 * m + - 6.871425592049007 * y + 31.159100130055922 * k - - 20220.756542821975) + - m * (-15.310361306967817 * m + 17.575251261109482 * y + - 131.35250912493976 * k - 48691.05921601825) + - y * (4.444339102852739 * y + 9.8632861493405 * k - - 6341.191035517494) - - k * (20.737325471181034 * k + 47890.15695978492); - var b = - c * (0.8842522430003296 * c + 8.078677503112928 * m + - 30.89978309703729 * y - 0.23883238689178934 * k - - 3616.812083916688) + - m * (10.49593273432072 * m + 63.02378494754052 * y + - 50.606957656360734 * k - 28620.90484698408) + - y * (0.03296041114873217 * y + 115.60384449646641 * k - - 49363.43385999684) - - k * (22.33816807309886 * k + 45932.16563550634); - - data[offset++] = r >= 0 ? 255 : r <= min ? 0 : 255 + r * scale | 0; - data[offset++] = g >= 0 ? 255 : g <= min ? 0 : 255 + g * scale | 0; - data[offset++] = b >= 0 ? 255 : b <= min ? 0 : 255 + b * scale | 0; - } - return data; - }, - - getData: function getData(width, height, forceRGBoutput) { - if (this.numComponents > 4) { - throw 'Unsupported color mode'; - } - // type of data: Uint8Array(width * height * numComponents) - var data = this._getLinearizedBlockData(width, height); - - if (this.numComponents === 3) { - return this._convertYccToRgb(data); - } else if (this.numComponents === 4) { - if (this._isColorConversionNeeded()) { - if (forceRGBoutput) { - return this._convertYcckToRgb(data); - } else { - return this._convertYcckToCmyk(data); - } - } else if (forceRGBoutput) { - return this._convertCmykToRgb(data); - } - } - return data; - } - }; - - return constructor; -})(); - - -var JpxImage = (function JpxImageClosure() { - // Table E.1 - var SubbandsGainLog2 = { - 'LL': 0, - 'LH': 1, - 'HL': 1, - 'HH': 2 - }; - function JpxImage() { - this.failOnCorruptedImage = false; - } - JpxImage.prototype = { - parse: function JpxImage_parse(data) { - - var head = readUint16(data, 0); - // No box header, immediate start of codestream (SOC) - if (head === 0xFF4F) { - this.parseCodestream(data, 0, data.length); - return; - } - - var position = 0, length = data.length; - while (position < length) { - var headerSize = 8; - var lbox = readUint32(data, position); - var tbox = readUint32(data, position + 4); - position += headerSize; - if (lbox === 1) { - // XLBox: read UInt64 according to spec. - // JavaScript's int precision of 53 bit should be sufficient here. - lbox = readUint32(data, position) * 4294967296 + - readUint32(data, position + 4); - position += 8; - headerSize += 8; - } - if (lbox === 0) { - lbox = length - position + headerSize; - } - if (lbox < headerSize) { - throw new Error('JPX Error: Invalid box field size'); - } - var dataLength = lbox - headerSize; - var jumpDataLength = true; - switch (tbox) { - case 0x6A703268: // 'jp2h' - jumpDataLength = false; // parsing child boxes - break; - case 0x636F6C72: // 'colr' - // Colorspaces are not used, the CS from the PDF is used. - var method = data[position]; - var precedence = data[position + 1]; - var approximation = data[position + 2]; - if (method === 1) { - // enumerated colorspace - var colorspace = readUint32(data, position + 3); - switch (colorspace) { - case 16: // this indicates a sRGB colorspace - case 17: // this indicates a grayscale colorspace - case 18: // this indicates a YUV colorspace - break; - default: - warn('Unknown colorspace ' + colorspace); - break; - } - } else if (method === 2) { - info('ICC profile not supported'); - } - break; - case 0x6A703263: // 'jp2c' - this.parseCodestream(data, position, position + dataLength); - break; - case 0x6A502020: // 'jP\024\024' - if (0x0d0a870a !== readUint32(data, position)) { - warn('Invalid JP2 signature'); - } - break; - // The following header types are valid but currently not used: - case 0x6A501A1A: // 'jP\032\032' - case 0x66747970: // 'ftyp' - case 0x72726571: // 'rreq' - case 0x72657320: // 'res ' - case 0x69686472: // 'ihdr' - break; - default: - var headerType = String.fromCharCode((tbox >> 24) & 0xFF, - (tbox >> 16) & 0xFF, - (tbox >> 8) & 0xFF, - tbox & 0xFF); - warn('Unsupported header type ' + tbox + ' (' + headerType + ')'); - break; - } - if (jumpDataLength) { - position += dataLength; - } - } - }, - parseImageProperties: function JpxImage_parseImageProperties(stream) { - var newByte = stream.getByte(); - while (newByte >= 0) { - var oldByte = newByte; - newByte = stream.getByte(); - var code = (oldByte << 8) | newByte; - // Image and tile size (SIZ) - if (code === 0xFF51) { - stream.skip(4); - var Xsiz = stream.getInt32() >>> 0; // Byte 4 - var Ysiz = stream.getInt32() >>> 0; // Byte 8 - var XOsiz = stream.getInt32() >>> 0; // Byte 12 - var YOsiz = stream.getInt32() >>> 0; // Byte 16 - stream.skip(16); - var Csiz = stream.getUint16(); // Byte 36 - this.width = Xsiz - XOsiz; - this.height = Ysiz - YOsiz; - this.componentsCount = Csiz; - // Results are always returned as Uint8Arrays - this.bitsPerComponent = 8; - return; - } - } - throw new Error('JPX Error: No size marker found in JPX stream'); - }, - parseCodestream: function JpxImage_parseCodestream(data, start, end) { - var context = {}; - try { - var doNotRecover = false; - var position = start; - while (position + 1 < end) { - var code = readUint16(data, position); - position += 2; - - var length = 0, j, sqcd, spqcds, spqcdSize, scalarExpounded, tile; - switch (code) { - case 0xFF4F: // Start of codestream (SOC) - context.mainHeader = true; - break; - case 0xFFD9: // End of codestream (EOC) - break; - case 0xFF51: // Image and tile size (SIZ) - length = readUint16(data, position); - var siz = {}; - siz.Xsiz = readUint32(data, position + 4); - siz.Ysiz = readUint32(data, position + 8); - siz.XOsiz = readUint32(data, position + 12); - siz.YOsiz = readUint32(data, position + 16); - siz.XTsiz = readUint32(data, position + 20); - siz.YTsiz = readUint32(data, position + 24); - siz.XTOsiz = readUint32(data, position + 28); - siz.YTOsiz = readUint32(data, position + 32); - var componentsCount = readUint16(data, position + 36); - siz.Csiz = componentsCount; - var components = []; - j = position + 38; - for (var i = 0; i < componentsCount; i++) { - var component = { - precision: (data[j] & 0x7F) + 1, - isSigned: !!(data[j] & 0x80), - XRsiz: data[j + 1], - YRsiz: data[j + 1] - }; - calculateComponentDimensions(component, siz); - components.push(component); - } - context.SIZ = siz; - context.components = components; - calculateTileGrids(context, components); - context.QCC = []; - context.COC = []; - break; - case 0xFF5C: // Quantization default (QCD) - length = readUint16(data, position); - var qcd = {}; - j = position + 2; - sqcd = data[j++]; - switch (sqcd & 0x1F) { - case 0: - spqcdSize = 8; - scalarExpounded = true; - break; - case 1: - spqcdSize = 16; - scalarExpounded = false; - break; - case 2: - spqcdSize = 16; - scalarExpounded = true; - break; - default: - throw new Error('JPX Error: Invalid SQcd value ' + sqcd); - } - qcd.noQuantization = (spqcdSize === 8); - qcd.scalarExpounded = scalarExpounded; - qcd.guardBits = sqcd >> 5; - spqcds = []; - while (j < length + position) { - var spqcd = {}; - if (spqcdSize === 8) { - spqcd.epsilon = data[j++] >> 3; - spqcd.mu = 0; - } else { - spqcd.epsilon = data[j] >> 3; - spqcd.mu = ((data[j] & 0x7) << 8) | data[j + 1]; - j += 2; - } - spqcds.push(spqcd); - } - qcd.SPqcds = spqcds; - if (context.mainHeader) { - context.QCD = qcd; - } else { - context.currentTile.QCD = qcd; - context.currentTile.QCC = []; - } - break; - case 0xFF5D: // Quantization component (QCC) - length = readUint16(data, position); - var qcc = {}; - j = position + 2; - var cqcc; - if (context.SIZ.Csiz < 257) { - cqcc = data[j++]; - } else { - cqcc = readUint16(data, j); - j += 2; - } - sqcd = data[j++]; - switch (sqcd & 0x1F) { - case 0: - spqcdSize = 8; - scalarExpounded = true; - break; - case 1: - spqcdSize = 16; - scalarExpounded = false; - break; - case 2: - spqcdSize = 16; - scalarExpounded = true; - break; - default: - throw new Error('JPX Error: Invalid SQcd value ' + sqcd); - } - qcc.noQuantization = (spqcdSize === 8); - qcc.scalarExpounded = scalarExpounded; - qcc.guardBits = sqcd >> 5; - spqcds = []; - while (j < (length + position)) { - spqcd = {}; - if (spqcdSize === 8) { - spqcd.epsilon = data[j++] >> 3; - spqcd.mu = 0; - } else { - spqcd.epsilon = data[j] >> 3; - spqcd.mu = ((data[j] & 0x7) << 8) | data[j + 1]; - j += 2; - } - spqcds.push(spqcd); - } - qcc.SPqcds = spqcds; - if (context.mainHeader) { - context.QCC[cqcc] = qcc; - } else { - context.currentTile.QCC[cqcc] = qcc; - } - break; - case 0xFF52: // Coding style default (COD) - length = readUint16(data, position); - var cod = {}; - j = position + 2; - var scod = data[j++]; - cod.entropyCoderWithCustomPrecincts = !!(scod & 1); - cod.sopMarkerUsed = !!(scod & 2); - cod.ephMarkerUsed = !!(scod & 4); - cod.progressionOrder = data[j++]; - cod.layersCount = readUint16(data, j); - j += 2; - cod.multipleComponentTransform = data[j++]; - - cod.decompositionLevelsCount = data[j++]; - cod.xcb = (data[j++] & 0xF) + 2; - cod.ycb = (data[j++] & 0xF) + 2; - var blockStyle = data[j++]; - cod.selectiveArithmeticCodingBypass = !!(blockStyle & 1); - cod.resetContextProbabilities = !!(blockStyle & 2); - cod.terminationOnEachCodingPass = !!(blockStyle & 4); - cod.verticalyStripe = !!(blockStyle & 8); - cod.predictableTermination = !!(blockStyle & 16); - cod.segmentationSymbolUsed = !!(blockStyle & 32); - cod.reversibleTransformation = data[j++]; - if (cod.entropyCoderWithCustomPrecincts) { - var precinctsSizes = []; - while (j < length + position) { - var precinctsSize = data[j++]; - precinctsSizes.push({ - PPx: precinctsSize & 0xF, - PPy: precinctsSize >> 4 - }); - } - cod.precinctsSizes = precinctsSizes; - } - var unsupported = []; - if (cod.selectiveArithmeticCodingBypass) { - unsupported.push('selectiveArithmeticCodingBypass'); - } - if (cod.resetContextProbabilities) { - unsupported.push('resetContextProbabilities'); - } - if (cod.terminationOnEachCodingPass) { - unsupported.push('terminationOnEachCodingPass'); - } - if (cod.verticalyStripe) { - unsupported.push('verticalyStripe'); - } - if (cod.predictableTermination) { - unsupported.push('predictableTermination'); - } - if (unsupported.length > 0) { - doNotRecover = true; - throw new Error('JPX Error: Unsupported COD options (' + - unsupported.join(', ') + ')'); - } - if (context.mainHeader) { - context.COD = cod; - } else { - context.currentTile.COD = cod; - context.currentTile.COC = []; - } - break; - case 0xFF90: // Start of tile-part (SOT) - length = readUint16(data, position); - tile = {}; - tile.index = readUint16(data, position + 2); - tile.length = readUint32(data, position + 4); - tile.dataEnd = tile.length + position - 2; - tile.partIndex = data[position + 8]; - tile.partsCount = data[position + 9]; - - context.mainHeader = false; - if (tile.partIndex === 0) { - // reset component specific settings - tile.COD = context.COD; - tile.COC = context.COC.slice(0); // clone of the global COC - tile.QCD = context.QCD; - tile.QCC = context.QCC.slice(0); // clone of the global COC - } - context.currentTile = tile; - break; - case 0xFF93: // Start of data (SOD) - tile = context.currentTile; - if (tile.partIndex === 0) { - initializeTile(context, tile.index); - buildPackets(context); - } - - // moving to the end of the data - length = tile.dataEnd - position; - parseTilePackets(context, data, position, length); - break; - case 0xFF55: // Tile-part lengths, main header (TLM) - case 0xFF57: // Packet length, main header (PLM) - case 0xFF58: // Packet length, tile-part header (PLT) - case 0xFF64: // Comment (COM) - length = readUint16(data, position); - // skipping content - break; - case 0xFF53: // Coding style component (COC) - throw new Error('JPX Error: Codestream code 0xFF53 (COC) is ' + - 'not implemented'); - default: - throw new Error('JPX Error: Unknown codestream code: ' + - code.toString(16)); - } - position += length; - } - } catch (e) { - if (doNotRecover || this.failOnCorruptedImage) { - throw e; - } else { - warn('Trying to recover from ' + e.message); - } - } - this.tiles = transformComponents(context); - this.width = context.SIZ.Xsiz - context.SIZ.XOsiz; - this.height = context.SIZ.Ysiz - context.SIZ.YOsiz; - this.componentsCount = context.SIZ.Csiz; - } - }; - function calculateComponentDimensions(component, siz) { - // Section B.2 Component mapping - component.x0 = Math.ceil(siz.XOsiz / component.XRsiz); - component.x1 = Math.ceil(siz.Xsiz / component.XRsiz); - component.y0 = Math.ceil(siz.YOsiz / component.YRsiz); - component.y1 = Math.ceil(siz.Ysiz / component.YRsiz); - component.width = component.x1 - component.x0; - component.height = component.y1 - component.y0; - } - function calculateTileGrids(context, components) { - var siz = context.SIZ; - // Section B.3 Division into tile and tile-components - var tile, tiles = []; - var numXtiles = Math.ceil((siz.Xsiz - siz.XTOsiz) / siz.XTsiz); - var numYtiles = Math.ceil((siz.Ysiz - siz.YTOsiz) / siz.YTsiz); - for (var q = 0; q < numYtiles; q++) { - for (var p = 0; p < numXtiles; p++) { - tile = {}; - tile.tx0 = Math.max(siz.XTOsiz + p * siz.XTsiz, siz.XOsiz); - tile.ty0 = Math.max(siz.YTOsiz + q * siz.YTsiz, siz.YOsiz); - tile.tx1 = Math.min(siz.XTOsiz + (p + 1) * siz.XTsiz, siz.Xsiz); - tile.ty1 = Math.min(siz.YTOsiz + (q + 1) * siz.YTsiz, siz.Ysiz); - tile.width = tile.tx1 - tile.tx0; - tile.height = tile.ty1 - tile.ty0; - tile.components = []; - tiles.push(tile); - } - } - context.tiles = tiles; - - var componentsCount = siz.Csiz; - for (var i = 0, ii = componentsCount; i < ii; i++) { - var component = components[i]; - for (var j = 0, jj = tiles.length; j < jj; j++) { - var tileComponent = {}; - tile = tiles[j]; - tileComponent.tcx0 = Math.ceil(tile.tx0 / component.XRsiz); - tileComponent.tcy0 = Math.ceil(tile.ty0 / component.YRsiz); - tileComponent.tcx1 = Math.ceil(tile.tx1 / component.XRsiz); - tileComponent.tcy1 = Math.ceil(tile.ty1 / component.YRsiz); - tileComponent.width = tileComponent.tcx1 - tileComponent.tcx0; - tileComponent.height = tileComponent.tcy1 - tileComponent.tcy0; - tile.components[i] = tileComponent; - } - } - } - function getBlocksDimensions(context, component, r) { - var codOrCoc = component.codingStyleParameters; - var result = {}; - if (!codOrCoc.entropyCoderWithCustomPrecincts) { - result.PPx = 15; - result.PPy = 15; - } else { - result.PPx = codOrCoc.precinctsSizes[r].PPx; - result.PPy = codOrCoc.precinctsSizes[r].PPy; - } - // calculate codeblock size as described in section B.7 - result.xcb_ = (r > 0 ? Math.min(codOrCoc.xcb, result.PPx - 1) : - Math.min(codOrCoc.xcb, result.PPx)); - result.ycb_ = (r > 0 ? Math.min(codOrCoc.ycb, result.PPy - 1) : - Math.min(codOrCoc.ycb, result.PPy)); - return result; - } - function buildPrecincts(context, resolution, dimensions) { - // Section B.6 Division resolution to precincts - var precinctWidth = 1 << dimensions.PPx; - var precinctHeight = 1 << dimensions.PPy; - // Jasper introduces codeblock groups for mapping each subband codeblocks - // to precincts. Precinct partition divides a resolution according to width - // and height parameters. The subband that belongs to the resolution level - // has a different size than the level, unless it is the zero resolution. - - // From Jasper documentation: jpeg2000.pdf, section K: Tier-2 coding: - // The precinct partitioning for a particular subband is derived from a - // partitioning of its parent LL band (i.e., the LL band at the next higher - // resolution level)... The LL band associated with each resolution level is - // divided into precincts... Each of the resulting precinct regions is then - // mapped into its child subbands (if any) at the next lower resolution - // level. This is accomplished by using the coordinate transformation - // (u, v) = (ceil(x/2), ceil(y/2)) where (x, y) and (u, v) are the - // coordinates of a point in the LL band and child subband, respectively. - var isZeroRes = resolution.resLevel === 0; - var precinctWidthInSubband = 1 << (dimensions.PPx + (isZeroRes ? 0 : -1)); - var precinctHeightInSubband = 1 << (dimensions.PPy + (isZeroRes ? 0 : -1)); - var numprecinctswide = (resolution.trx1 > resolution.trx0 ? - Math.ceil(resolution.trx1 / precinctWidth) - - Math.floor(resolution.trx0 / precinctWidth) : 0); - var numprecinctshigh = (resolution.try1 > resolution.try0 ? - Math.ceil(resolution.try1 / precinctHeight) - - Math.floor(resolution.try0 / precinctHeight) : 0); - var numprecincts = numprecinctswide * numprecinctshigh; - - resolution.precinctParameters = { - precinctWidth: precinctWidth, - precinctHeight: precinctHeight, - numprecinctswide: numprecinctswide, - numprecinctshigh: numprecinctshigh, - numprecincts: numprecincts, - precinctWidthInSubband: precinctWidthInSubband, - precinctHeightInSubband: precinctHeightInSubband - }; - } - function buildCodeblocks(context, subband, dimensions) { - // Section B.7 Division sub-band into code-blocks - var xcb_ = dimensions.xcb_; - var ycb_ = dimensions.ycb_; - var codeblockWidth = 1 << xcb_; - var codeblockHeight = 1 << ycb_; - var cbx0 = subband.tbx0 >> xcb_; - var cby0 = subband.tby0 >> ycb_; - var cbx1 = (subband.tbx1 + codeblockWidth - 1) >> xcb_; - var cby1 = (subband.tby1 + codeblockHeight - 1) >> ycb_; - var precinctParameters = subband.resolution.precinctParameters; - var codeblocks = []; - var precincts = []; - var i, j, codeblock, precinctNumber; - for (j = cby0; j < cby1; j++) { - for (i = cbx0; i < cbx1; i++) { - codeblock = { - cbx: i, - cby: j, - tbx0: codeblockWidth * i, - tby0: codeblockHeight * j, - tbx1: codeblockWidth * (i + 1), - tby1: codeblockHeight * (j + 1) - }; - - codeblock.tbx0_ = Math.max(subband.tbx0, codeblock.tbx0); - codeblock.tby0_ = Math.max(subband.tby0, codeblock.tby0); - codeblock.tbx1_ = Math.min(subband.tbx1, codeblock.tbx1); - codeblock.tby1_ = Math.min(subband.tby1, codeblock.tby1); - - // Calculate precinct number for this codeblock, codeblock position - // should be relative to its subband, use actual dimension and position - // See comment about codeblock group width and height - var pi = Math.floor((codeblock.tbx0_ - subband.tbx0) / - precinctParameters.precinctWidthInSubband); - var pj = Math.floor((codeblock.tby0_ - subband.tby0) / - precinctParameters.precinctHeightInSubband); - precinctNumber = pi + (pj * precinctParameters.numprecinctswide); - - codeblock.precinctNumber = precinctNumber; - codeblock.subbandType = subband.type; - codeblock.Lblock = 3; - - if (codeblock.tbx1_ <= codeblock.tbx0_ || - codeblock.tby1_ <= codeblock.tby0_) { - continue; - } - codeblocks.push(codeblock); - // building precinct for the sub-band - var precinct = precincts[precinctNumber]; - if (precinct !== undefined) { - if (i < precinct.cbxMin) { - precinct.cbxMin = i; - } else if (i > precinct.cbxMax) { - precinct.cbxMax = i; - } - if (j < precinct.cbyMin) { - precinct.cbxMin = j; - } else if (j > precinct.cbyMax) { - precinct.cbyMax = j; - } - } else { - precincts[precinctNumber] = precinct = { - cbxMin: i, - cbyMin: j, - cbxMax: i, - cbyMax: j - }; - } - codeblock.precinct = precinct; - } - } - subband.codeblockParameters = { - codeblockWidth: xcb_, - codeblockHeight: ycb_, - numcodeblockwide: cbx1 - cbx0 + 1, - numcodeblockhigh: cby1 - cby0 + 1 - }; - subband.codeblocks = codeblocks; - subband.precincts = precincts; - } - function createPacket(resolution, precinctNumber, layerNumber) { - var precinctCodeblocks = []; - // Section B.10.8 Order of info in packet - var subbands = resolution.subbands; - // sub-bands already ordered in 'LL', 'HL', 'LH', and 'HH' sequence - for (var i = 0, ii = subbands.length; i < ii; i++) { - var subband = subbands[i]; - var codeblocks = subband.codeblocks; - for (var j = 0, jj = codeblocks.length; j < jj; j++) { - var codeblock = codeblocks[j]; - if (codeblock.precinctNumber !== precinctNumber) { - continue; - } - precinctCodeblocks.push(codeblock); - } - } - return { - layerNumber: layerNumber, - codeblocks: precinctCodeblocks - }; - } - function LayerResolutionComponentPositionIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var maxDecompositionLevelsCount = 0; - for (var q = 0; q < componentsCount; q++) { - maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, - tile.components[q].codingStyleParameters.decompositionLevelsCount); - } - - var l = 0, r = 0, i = 0, k = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.1 Layer-resolution-component-position - for (; l < layersCount; l++) { - for (; r <= maxDecompositionLevelsCount; r++) { - for (; i < componentsCount; i++) { - var component = tile.components[i]; - if (r > component.codingStyleParameters.decompositionLevelsCount) { - continue; - } - - var resolution = component.resolutions[r]; - var numprecincts = resolution.precinctParameters.numprecincts; - for (; k < numprecincts;) { - var packet = createPacket(resolution, k, l); - k++; - return packet; - } - k = 0; - } - i = 0; - } - r = 0; - } - throw new Error('JPX Error: Out of packets'); - }; - } - function ResolutionLayerComponentPositionIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var maxDecompositionLevelsCount = 0; - for (var q = 0; q < componentsCount; q++) { - maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, - tile.components[q].codingStyleParameters.decompositionLevelsCount); - } - - var r = 0, l = 0, i = 0, k = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.2 Resolution-layer-component-position - for (; r <= maxDecompositionLevelsCount; r++) { - for (; l < layersCount; l++) { - for (; i < componentsCount; i++) { - var component = tile.components[i]; - if (r > component.codingStyleParameters.decompositionLevelsCount) { - continue; - } - - var resolution = component.resolutions[r]; - var numprecincts = resolution.precinctParameters.numprecincts; - for (; k < numprecincts;) { - var packet = createPacket(resolution, k, l); - k++; - return packet; - } - k = 0; - } - i = 0; - } - l = 0; - } - throw new Error('JPX Error: Out of packets'); - }; - } - function ResolutionPositionComponentLayerIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var l, r, c, p; - var maxDecompositionLevelsCount = 0; - for (c = 0; c < componentsCount; c++) { - var component = tile.components[c]; - maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, - component.codingStyleParameters.decompositionLevelsCount); - } - var maxNumPrecinctsInLevel = new Int32Array( - maxDecompositionLevelsCount + 1); - for (r = 0; r <= maxDecompositionLevelsCount; ++r) { - var maxNumPrecincts = 0; - for (c = 0; c < componentsCount; ++c) { - var resolutions = tile.components[c].resolutions; - if (r < resolutions.length) { - maxNumPrecincts = Math.max(maxNumPrecincts, - resolutions[r].precinctParameters.numprecincts); - } - } - maxNumPrecinctsInLevel[r] = maxNumPrecincts; - } - l = 0; - r = 0; - c = 0; - p = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.3 Resolution-position-component-layer - for (; r <= maxDecompositionLevelsCount; r++) { - for (; p < maxNumPrecinctsInLevel[r]; p++) { - for (; c < componentsCount; c++) { - var component = tile.components[c]; - if (r > component.codingStyleParameters.decompositionLevelsCount) { - continue; - } - var resolution = component.resolutions[r]; - var numprecincts = resolution.precinctParameters.numprecincts; - if (p >= numprecincts) { - continue; - } - for (; l < layersCount;) { - var packet = createPacket(resolution, p, l); - l++; - return packet; - } - l = 0; - } - c = 0; - } - p = 0; - } - throw new Error('JPX Error: Out of packets'); - }; - } - function PositionComponentResolutionLayerIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var precinctsSizes = getPrecinctSizesInImageScale(tile); - var precinctsIterationSizes = precinctsSizes; - var l = 0, r = 0, c = 0, px = 0, py = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.4 Position-component-resolution-layer - for (; py < precinctsIterationSizes.maxNumHigh; py++) { - for (; px < precinctsIterationSizes.maxNumWide; px++) { - for (; c < componentsCount; c++) { - var component = tile.components[c]; - var decompositionLevelsCount = - component.codingStyleParameters.decompositionLevelsCount; - for (; r <= decompositionLevelsCount; r++) { - var resolution = component.resolutions[r]; - var sizeInImageScale = - precinctsSizes.components[c].resolutions[r]; - var k = getPrecinctIndexIfExist( - px, - py, - sizeInImageScale, - precinctsIterationSizes, - resolution); - if (k === null) { - continue; - } - for (; l < layersCount;) { - var packet = createPacket(resolution, k, l); - l++; - return packet; - } - l = 0; - } - r = 0; - } - c = 0; - } - px = 0; - } - throw new Error('JPX Error: Out of packets'); - }; - } - function ComponentPositionResolutionLayerIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var precinctsSizes = getPrecinctSizesInImageScale(tile); - var l = 0, r = 0, c = 0, px = 0, py = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.5 Component-position-resolution-layer - for (; c < componentsCount; ++c) { - var component = tile.components[c]; - var precinctsIterationSizes = precinctsSizes.components[c]; - var decompositionLevelsCount = - component.codingStyleParameters.decompositionLevelsCount; - for (; py < precinctsIterationSizes.maxNumHigh; py++) { - for (; px < precinctsIterationSizes.maxNumWide; px++) { - for (; r <= decompositionLevelsCount; r++) { - var resolution = component.resolutions[r]; - var sizeInImageScale = precinctsIterationSizes.resolutions[r]; - var k = getPrecinctIndexIfExist( - px, - py, - sizeInImageScale, - precinctsIterationSizes, - resolution); - if (k === null) { - continue; - } - for (; l < layersCount;) { - var packet = createPacket(resolution, k, l); - l++; - return packet; - } - l = 0; - } - r = 0; - } - px = 0; - } - py = 0; - } - throw new Error('JPX Error: Out of packets'); - }; - } - function getPrecinctIndexIfExist( - pxIndex, pyIndex, sizeInImageScale, precinctIterationSizes, resolution) { - var posX = pxIndex * precinctIterationSizes.minWidth; - var posY = pyIndex * precinctIterationSizes.minHeight; - if (posX % sizeInImageScale.width !== 0 || - posY % sizeInImageScale.height !== 0) { - return null; - } - var startPrecinctRowIndex = - (posY / sizeInImageScale.width) * - resolution.precinctParameters.numprecinctswide; - return (posX / sizeInImageScale.height) + startPrecinctRowIndex; - } - function getPrecinctSizesInImageScale(tile) { - var componentsCount = tile.components.length; - var minWidth = Number.MAX_VALUE; - var minHeight = Number.MAX_VALUE; - var maxNumWide = 0; - var maxNumHigh = 0; - var sizePerComponent = new Array(componentsCount); - for (var c = 0; c < componentsCount; c++) { - var component = tile.components[c]; - var decompositionLevelsCount = - component.codingStyleParameters.decompositionLevelsCount; - var sizePerResolution = new Array(decompositionLevelsCount + 1); - var minWidthCurrentComponent = Number.MAX_VALUE; - var minHeightCurrentComponent = Number.MAX_VALUE; - var maxNumWideCurrentComponent = 0; - var maxNumHighCurrentComponent = 0; - var scale = 1; - for (var r = decompositionLevelsCount; r >= 0; --r) { - var resolution = component.resolutions[r]; - var widthCurrentResolution = - scale * resolution.precinctParameters.precinctWidth; - var heightCurrentResolution = - scale * resolution.precinctParameters.precinctHeight; - minWidthCurrentComponent = Math.min( - minWidthCurrentComponent, - widthCurrentResolution); - minHeightCurrentComponent = Math.min( - minHeightCurrentComponent, - heightCurrentResolution); - maxNumWideCurrentComponent = Math.max(maxNumWideCurrentComponent, - resolution.precinctParameters.numprecinctswide); - maxNumHighCurrentComponent = Math.max(maxNumHighCurrentComponent, - resolution.precinctParameters.numprecinctshigh); - sizePerResolution[r] = { - width: widthCurrentResolution, - height: heightCurrentResolution - }; - scale <<= 1; - } - minWidth = Math.min(minWidth, minWidthCurrentComponent); - minHeight = Math.min(minHeight, minHeightCurrentComponent); - maxNumWide = Math.max(maxNumWide, maxNumWideCurrentComponent); - maxNumHigh = Math.max(maxNumHigh, maxNumHighCurrentComponent); - sizePerComponent[c] = { - resolutions: sizePerResolution, - minWidth: minWidthCurrentComponent, - minHeight: minHeightCurrentComponent, - maxNumWide: maxNumWideCurrentComponent, - maxNumHigh: maxNumHighCurrentComponent - }; - } - return { - components: sizePerComponent, - minWidth: minWidth, - minHeight: minHeight, - maxNumWide: maxNumWide, - maxNumHigh: maxNumHigh - }; - } - function buildPackets(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var componentsCount = siz.Csiz; - // Creating resolutions and sub-bands for each component - for (var c = 0; c < componentsCount; c++) { - var component = tile.components[c]; - var decompositionLevelsCount = - component.codingStyleParameters.decompositionLevelsCount; - // Section B.5 Resolution levels and sub-bands - var resolutions = []; - var subbands = []; - for (var r = 0; r <= decompositionLevelsCount; r++) { - var blocksDimensions = getBlocksDimensions(context, component, r); - var resolution = {}; - var scale = 1 << (decompositionLevelsCount - r); - resolution.trx0 = Math.ceil(component.tcx0 / scale); - resolution.try0 = Math.ceil(component.tcy0 / scale); - resolution.trx1 = Math.ceil(component.tcx1 / scale); - resolution.try1 = Math.ceil(component.tcy1 / scale); - resolution.resLevel = r; - buildPrecincts(context, resolution, blocksDimensions); - resolutions.push(resolution); - - var subband; - if (r === 0) { - // one sub-band (LL) with last decomposition - subband = {}; - subband.type = 'LL'; - subband.tbx0 = Math.ceil(component.tcx0 / scale); - subband.tby0 = Math.ceil(component.tcy0 / scale); - subband.tbx1 = Math.ceil(component.tcx1 / scale); - subband.tby1 = Math.ceil(component.tcy1 / scale); - subband.resolution = resolution; - buildCodeblocks(context, subband, blocksDimensions); - subbands.push(subband); - resolution.subbands = [subband]; - } else { - var bscale = 1 << (decompositionLevelsCount - r + 1); - var resolutionSubbands = []; - // three sub-bands (HL, LH and HH) with rest of decompositions - subband = {}; - subband.type = 'HL'; - subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5); - subband.tby0 = Math.ceil(component.tcy0 / bscale); - subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5); - subband.tby1 = Math.ceil(component.tcy1 / bscale); - subband.resolution = resolution; - buildCodeblocks(context, subband, blocksDimensions); - subbands.push(subband); - resolutionSubbands.push(subband); - - subband = {}; - subband.type = 'LH'; - subband.tbx0 = Math.ceil(component.tcx0 / bscale); - subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5); - subband.tbx1 = Math.ceil(component.tcx1 / bscale); - subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5); - subband.resolution = resolution; - buildCodeblocks(context, subband, blocksDimensions); - subbands.push(subband); - resolutionSubbands.push(subband); - - subband = {}; - subband.type = 'HH'; - subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5); - subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5); - subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5); - subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5); - subband.resolution = resolution; - buildCodeblocks(context, subband, blocksDimensions); - subbands.push(subband); - resolutionSubbands.push(subband); - - resolution.subbands = resolutionSubbands; - } - } - component.resolutions = resolutions; - component.subbands = subbands; - } - // Generate the packets sequence - var progressionOrder = tile.codingStyleDefaultParameters.progressionOrder; - switch (progressionOrder) { - case 0: - tile.packetsIterator = - new LayerResolutionComponentPositionIterator(context); - break; - case 1: - tile.packetsIterator = - new ResolutionLayerComponentPositionIterator(context); - break; - case 2: - tile.packetsIterator = - new ResolutionPositionComponentLayerIterator(context); - break; - case 3: - tile.packetsIterator = - new PositionComponentResolutionLayerIterator(context); - break; - case 4: - tile.packetsIterator = - new ComponentPositionResolutionLayerIterator(context); - break; - default: - throw new Error('JPX Error: Unsupported progression order ' + - progressionOrder); - } - } - function parseTilePackets(context, data, offset, dataLength) { - var position = 0; - var buffer, bufferSize = 0, skipNextBit = false; - function readBits(count) { - while (bufferSize < count) { - var b = data[offset + position]; - position++; - if (skipNextBit) { - buffer = (buffer << 7) | b; - bufferSize += 7; - skipNextBit = false; - } else { - buffer = (buffer << 8) | b; - bufferSize += 8; - } - if (b === 0xFF) { - skipNextBit = true; - } - } - bufferSize -= count; - return (buffer >>> bufferSize) & ((1 << count) - 1); - } - function skipMarkerIfEqual(value) { - if (data[offset + position - 1] === 0xFF && - data[offset + position] === value) { - skipBytes(1); - return true; - } else if (data[offset + position] === 0xFF && - data[offset + position + 1] === value) { - skipBytes(2); - return true; - } - return false; - } - function skipBytes(count) { - position += count; - } - function alignToByte() { - bufferSize = 0; - if (skipNextBit) { - position++; - skipNextBit = false; - } - } - function readCodingpasses() { - if (readBits(1) === 0) { - return 1; - } - if (readBits(1) === 0) { - return 2; - } - var value = readBits(2); - if (value < 3) { - return value + 3; - } - value = readBits(5); - if (value < 31) { - return value + 6; - } - value = readBits(7); - return value + 37; - } - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var sopMarkerUsed = context.COD.sopMarkerUsed; - var ephMarkerUsed = context.COD.ephMarkerUsed; - var packetsIterator = tile.packetsIterator; - while (position < dataLength) { - alignToByte(); - if (sopMarkerUsed && skipMarkerIfEqual(0x91)) { - // Skip also marker segment length and packet sequence ID - skipBytes(4); - } - var packet = packetsIterator.nextPacket(); - if (!readBits(1)) { - continue; - } - var layerNumber = packet.layerNumber; - var queue = [], codeblock; - for (var i = 0, ii = packet.codeblocks.length; i < ii; i++) { - codeblock = packet.codeblocks[i]; - var precinct = codeblock.precinct; - var codeblockColumn = codeblock.cbx - precinct.cbxMin; - var codeblockRow = codeblock.cby - precinct.cbyMin; - var codeblockIncluded = false; - var firstTimeInclusion = false; - var valueReady; - if (codeblock['included'] !== undefined) { - codeblockIncluded = !!readBits(1); - } else { - // reading inclusion tree - precinct = codeblock.precinct; - var inclusionTree, zeroBitPlanesTree; - if (precinct['inclusionTree'] !== undefined) { - inclusionTree = precinct.inclusionTree; - } else { - // building inclusion and zero bit-planes trees - var width = precinct.cbxMax - precinct.cbxMin + 1; - var height = precinct.cbyMax - precinct.cbyMin + 1; - inclusionTree = new InclusionTree(width, height, layerNumber); - zeroBitPlanesTree = new TagTree(width, height); - precinct.inclusionTree = inclusionTree; - precinct.zeroBitPlanesTree = zeroBitPlanesTree; - } - - if (inclusionTree.reset(codeblockColumn, codeblockRow, layerNumber)) { - while (true) { - if (readBits(1)) { - valueReady = !inclusionTree.nextLevel(); - if (valueReady) { - codeblock.included = true; - codeblockIncluded = firstTimeInclusion = true; - break; - } - } else { - inclusionTree.incrementValue(layerNumber); - break; - } - } - } - } - if (!codeblockIncluded) { - continue; - } - if (firstTimeInclusion) { - zeroBitPlanesTree = precinct.zeroBitPlanesTree; - zeroBitPlanesTree.reset(codeblockColumn, codeblockRow); - while (true) { - if (readBits(1)) { - valueReady = !zeroBitPlanesTree.nextLevel(); - if (valueReady) { - break; - } - } else { - zeroBitPlanesTree.incrementValue(); - } - } - codeblock.zeroBitPlanes = zeroBitPlanesTree.value; - } - var codingpasses = readCodingpasses(); - while (readBits(1)) { - codeblock.Lblock++; - } - var codingpassesLog2 = log2(codingpasses); - // rounding down log2 - var bits = ((codingpasses < (1 << codingpassesLog2)) ? - codingpassesLog2 - 1 : codingpassesLog2) + codeblock.Lblock; - var codedDataLength = readBits(bits); - queue.push({ - codeblock: codeblock, - codingpasses: codingpasses, - dataLength: codedDataLength - }); - } - alignToByte(); - if (ephMarkerUsed) { - skipMarkerIfEqual(0x92); - } - while (queue.length > 0) { - var packetItem = queue.shift(); - codeblock = packetItem.codeblock; - if (codeblock['data'] === undefined) { - codeblock.data = []; - } - codeblock.data.push({ - data: data, - start: offset + position, - end: offset + position + packetItem.dataLength, - codingpasses: packetItem.codingpasses - }); - position += packetItem.dataLength; - } - } - return position; - } - function copyCoefficients(coefficients, levelWidth, levelHeight, subband, - delta, mb, reversible, segmentationSymbolUsed) { - var x0 = subband.tbx0; - var y0 = subband.tby0; - var width = subband.tbx1 - subband.tbx0; - var codeblocks = subband.codeblocks; - var right = subband.type.charAt(0) === 'H' ? 1 : 0; - var bottom = subband.type.charAt(1) === 'H' ? levelWidth : 0; - - for (var i = 0, ii = codeblocks.length; i < ii; ++i) { - var codeblock = codeblocks[i]; - var blockWidth = codeblock.tbx1_ - codeblock.tbx0_; - var blockHeight = codeblock.tby1_ - codeblock.tby0_; - if (blockWidth === 0 || blockHeight === 0) { - continue; - } - if (codeblock['data'] === undefined) { - continue; - } - - var bitModel, currentCodingpassType; - bitModel = new BitModel(blockWidth, blockHeight, codeblock.subbandType, - codeblock.zeroBitPlanes, mb); - currentCodingpassType = 2; // first bit plane starts from cleanup - - // collect data - var data = codeblock.data, totalLength = 0, codingpasses = 0; - var j, jj, dataItem; - for (j = 0, jj = data.length; j < jj; j++) { - dataItem = data[j]; - totalLength += dataItem.end - dataItem.start; - codingpasses += dataItem.codingpasses; - } - var encodedData = new Uint8Array(totalLength); - var position = 0; - for (j = 0, jj = data.length; j < jj; j++) { - dataItem = data[j]; - var chunk = dataItem.data.subarray(dataItem.start, dataItem.end); - encodedData.set(chunk, position); - position += chunk.length; - } - // decoding the item - var decoder = new ArithmeticDecoder(encodedData, 0, totalLength); - bitModel.setDecoder(decoder); - - for (j = 0; j < codingpasses; j++) { - switch (currentCodingpassType) { - case 0: - bitModel.runSignificancePropogationPass(); - break; - case 1: - bitModel.runMagnitudeRefinementPass(); - break; - case 2: - bitModel.runCleanupPass(); - if (segmentationSymbolUsed) { - bitModel.checkSegmentationSymbol(); - } - break; - } - currentCodingpassType = (currentCodingpassType + 1) % 3; - } - - var offset = (codeblock.tbx0_ - x0) + (codeblock.tby0_ - y0) * width; - var sign = bitModel.coefficentsSign; - var magnitude = bitModel.coefficentsMagnitude; - var bitsDecoded = bitModel.bitsDecoded; - var magnitudeCorrection = reversible ? 0 : 0.5; - var k, n, nb; - position = 0; - // Do the interleaving of Section F.3.3 here, so we do not need - // to copy later. LL level is not interleaved, just copied. - var interleave = (subband.type !== 'LL'); - for (j = 0; j < blockHeight; j++) { - var row = (offset / width) | 0; // row in the non-interleaved subband - var levelOffset = 2 * row * (levelWidth - width) + right + bottom; - for (k = 0; k < blockWidth; k++) { - n = magnitude[position]; - if (n !== 0) { - n = (n + magnitudeCorrection) * delta; - if (sign[position] !== 0) { - n = -n; - } - nb = bitsDecoded[position]; - var pos = interleave ? (levelOffset + (offset << 1)) : offset; - if (reversible && (nb >= mb)) { - coefficients[pos] = n; - } else { - coefficients[pos] = n * (1 << (mb - nb)); - } - } - offset++; - position++; - } - offset += width - blockWidth; - } - } - } - function transformTile(context, tile, c) { - var component = tile.components[c]; - var codingStyleParameters = component.codingStyleParameters; - var quantizationParameters = component.quantizationParameters; - var decompositionLevelsCount = - codingStyleParameters.decompositionLevelsCount; - var spqcds = quantizationParameters.SPqcds; - var scalarExpounded = quantizationParameters.scalarExpounded; - var guardBits = quantizationParameters.guardBits; - var segmentationSymbolUsed = codingStyleParameters.segmentationSymbolUsed; - var precision = context.components[c].precision; - - var reversible = codingStyleParameters.reversibleTransformation; - var transform = (reversible ? new ReversibleTransform() : - new IrreversibleTransform()); - - var subbandCoefficients = []; - var b = 0; - for (var i = 0; i <= decompositionLevelsCount; i++) { - var resolution = component.resolutions[i]; - - var width = resolution.trx1 - resolution.trx0; - var height = resolution.try1 - resolution.try0; - // Allocate space for the whole sublevel. - var coefficients = new Float32Array(width * height); - - for (var j = 0, jj = resolution.subbands.length; j < jj; j++) { - var mu, epsilon; - if (!scalarExpounded) { - // formula E-5 - mu = spqcds[0].mu; - epsilon = spqcds[0].epsilon + (i > 0 ? 1 - i : 0); - } else { - mu = spqcds[b].mu; - epsilon = spqcds[b].epsilon; - b++; - } - - var subband = resolution.subbands[j]; - var gainLog2 = SubbandsGainLog2[subband.type]; - - // calulate quantization coefficient (Section E.1.1.1) - var delta = (reversible ? 1 : - Math.pow(2, precision + gainLog2 - epsilon) * (1 + mu / 2048)); - var mb = (guardBits + epsilon - 1); - - // In the first resolution level, copyCoefficients will fill the - // whole array with coefficients. In the succeding passes, - // copyCoefficients will consecutively fill in the values that belong - // to the interleaved positions of the HL, LH, and HH coefficients. - // The LL coefficients will then be interleaved in Transform.iterate(). - copyCoefficients(coefficients, width, height, subband, delta, mb, - reversible, segmentationSymbolUsed); - } - subbandCoefficients.push({ - width: width, - height: height, - items: coefficients - }); - } - - var result = transform.calculate(subbandCoefficients, - component.tcx0, component.tcy0); - return { - left: component.tcx0, - top: component.tcy0, - width: result.width, - height: result.height, - items: result.items - }; - } - function transformComponents(context) { - var siz = context.SIZ; - var components = context.components; - var componentsCount = siz.Csiz; - var resultImages = []; - for (var i = 0, ii = context.tiles.length; i < ii; i++) { - var tile = context.tiles[i]; - var transformedTiles = []; - var c; - for (c = 0; c < componentsCount; c++) { - transformedTiles[c] = transformTile(context, tile, c); - } - var tile0 = transformedTiles[0]; - var out = new Uint8Array(tile0.items.length * componentsCount); - var result = { - left: tile0.left, - top: tile0.top, - width: tile0.width, - height: tile0.height, - items: out - }; - - // Section G.2.2 Inverse multi component transform - var shift, offset, max, min, maxK; - var pos = 0, j, jj, y0, y1, y2, r, g, b, k, val; - if (tile.codingStyleDefaultParameters.multipleComponentTransform) { - var fourComponents = componentsCount === 4; - var y0items = transformedTiles[0].items; - var y1items = transformedTiles[1].items; - var y2items = transformedTiles[2].items; - var y3items = fourComponents ? transformedTiles[3].items : null; - - // HACK: The multiple component transform formulas below assume that - // all components have the same precision. With this in mind, we - // compute shift and offset only once. - shift = components[0].precision - 8; - offset = (128 << shift) + 0.5; - max = 255 * (1 << shift); - maxK = max * 0.5; - min = -maxK; - - var component0 = tile.components[0]; - var alpha01 = componentsCount - 3; - jj = y0items.length; - if (!component0.codingStyleParameters.reversibleTransformation) { - // inverse irreversible multiple component transform - for (j = 0; j < jj; j++, pos += alpha01) { - y0 = y0items[j] + offset; - y1 = y1items[j]; - y2 = y2items[j]; - r = y0 + 1.402 * y2; - g = y0 - 0.34413 * y1 - 0.71414 * y2; - b = y0 + 1.772 * y1; - out[pos++] = r <= 0 ? 0 : r >= max ? 255 : r >> shift; - out[pos++] = g <= 0 ? 0 : g >= max ? 255 : g >> shift; - out[pos++] = b <= 0 ? 0 : b >= max ? 255 : b >> shift; - } - } else { - // inverse reversible multiple component transform - for (j = 0; j < jj; j++, pos += alpha01) { - y0 = y0items[j] + offset; - y1 = y1items[j]; - y2 = y2items[j]; - g = y0 - ((y2 + y1) >> 2); - r = g + y2; - b = g + y1; - out[pos++] = r <= 0 ? 0 : r >= max ? 255 : r >> shift; - out[pos++] = g <= 0 ? 0 : g >= max ? 255 : g >> shift; - out[pos++] = b <= 0 ? 0 : b >= max ? 255 : b >> shift; - } - } - if (fourComponents) { - for (j = 0, pos = 3; j < jj; j++, pos += 4) { - k = y3items[j]; - out[pos] = k <= min ? 0 : k >= maxK ? 255 : (k + offset) >> shift; - } - } - } else { // no multi-component transform - for (c = 0; c < componentsCount; c++) { - var items = transformedTiles[c].items; - shift = components[c].precision - 8; - offset = (128 << shift) + 0.5; - max = (127.5 * (1 << shift)); - min = -max; - for (pos = c, j = 0, jj = items.length; j < jj; j++) { - val = items[j]; - out[pos] = val <= min ? 0 : - val >= max ? 255 : (val + offset) >> shift; - pos += componentsCount; - } - } - } - resultImages.push(result); - } - return resultImages; - } - function initializeTile(context, tileIndex) { - var siz = context.SIZ; - var componentsCount = siz.Csiz; - var tile = context.tiles[tileIndex]; - for (var c = 0; c < componentsCount; c++) { - var component = tile.components[c]; - var qcdOrQcc = (context.currentTile.QCC[c] !== undefined ? - context.currentTile.QCC[c] : context.currentTile.QCD); - component.quantizationParameters = qcdOrQcc; - var codOrCoc = (context.currentTile.COC[c] !== undefined ? - context.currentTile.COC[c] : context.currentTile.COD); - component.codingStyleParameters = codOrCoc; - } - tile.codingStyleDefaultParameters = context.currentTile.COD; - } - - // Section B.10.2 Tag trees - var TagTree = (function TagTreeClosure() { - function TagTree(width, height) { - var levelsLength = log2(Math.max(width, height)) + 1; - this.levels = []; - for (var i = 0; i < levelsLength; i++) { - var level = { - width: width, - height: height, - items: [] - }; - this.levels.push(level); - width = Math.ceil(width / 2); - height = Math.ceil(height / 2); - } - } - TagTree.prototype = { - reset: function TagTree_reset(i, j) { - var currentLevel = 0, value = 0, level; - while (currentLevel < this.levels.length) { - level = this.levels[currentLevel]; - var index = i + j * level.width; - if (level.items[index] !== undefined) { - value = level.items[index]; - break; - } - level.index = index; - i >>= 1; - j >>= 1; - currentLevel++; - } - currentLevel--; - level = this.levels[currentLevel]; - level.items[level.index] = value; - this.currentLevel = currentLevel; - delete this.value; - }, - incrementValue: function TagTree_incrementValue() { - var level = this.levels[this.currentLevel]; - level.items[level.index]++; - }, - nextLevel: function TagTree_nextLevel() { - var currentLevel = this.currentLevel; - var level = this.levels[currentLevel]; - var value = level.items[level.index]; - currentLevel--; - if (currentLevel < 0) { - this.value = value; - return false; - } - - this.currentLevel = currentLevel; - level = this.levels[currentLevel]; - level.items[level.index] = value; - return true; - } - }; - return TagTree; - })(); - - var InclusionTree = (function InclusionTreeClosure() { - function InclusionTree(width, height, defaultValue) { - var levelsLength = log2(Math.max(width, height)) + 1; - this.levels = []; - for (var i = 0; i < levelsLength; i++) { - var items = new Uint8Array(width * height); - for (var j = 0, jj = items.length; j < jj; j++) { - items[j] = defaultValue; - } - - var level = { - width: width, - height: height, - items: items - }; - this.levels.push(level); - - width = Math.ceil(width / 2); - height = Math.ceil(height / 2); - } - } - InclusionTree.prototype = { - reset: function InclusionTree_reset(i, j, stopValue) { - var currentLevel = 0; - while (currentLevel < this.levels.length) { - var level = this.levels[currentLevel]; - var index = i + j * level.width; - level.index = index; - var value = level.items[index]; - - if (value === 0xFF) { - break; - } - - if (value > stopValue) { - this.currentLevel = currentLevel; - // already know about this one, propagating the value to top levels - this.propagateValues(); - return false; - } - - i >>= 1; - j >>= 1; - currentLevel++; - } - this.currentLevel = currentLevel - 1; - return true; - }, - incrementValue: function InclusionTree_incrementValue(stopValue) { - var level = this.levels[this.currentLevel]; - level.items[level.index] = stopValue + 1; - this.propagateValues(); - }, - propagateValues: function InclusionTree_propagateValues() { - var levelIndex = this.currentLevel; - var level = this.levels[levelIndex]; - var currentValue = level.items[level.index]; - while (--levelIndex >= 0) { - level = this.levels[levelIndex]; - level.items[level.index] = currentValue; - } - }, - nextLevel: function InclusionTree_nextLevel() { - var currentLevel = this.currentLevel; - var level = this.levels[currentLevel]; - var value = level.items[level.index]; - level.items[level.index] = 0xFF; - currentLevel--; - if (currentLevel < 0) { - return false; - } - - this.currentLevel = currentLevel; - level = this.levels[currentLevel]; - level.items[level.index] = value; - return true; - } - }; - return InclusionTree; - })(); - - // Section D. Coefficient bit modeling - var BitModel = (function BitModelClosure() { - var UNIFORM_CONTEXT = 17; - var RUNLENGTH_CONTEXT = 18; - // Table D-1 - // The index is binary presentation: 0dddvvhh, ddd - sum of Di (0..4), - // vv - sum of Vi (0..2), and hh - sum of Hi (0..2) - var LLAndLHContextsLabel = new Uint8Array([ - 0, 5, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 1, 6, 8, 0, 3, 7, 8, 0, 4, - 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6, - 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8 - ]); - var HLContextLabel = new Uint8Array([ - 0, 3, 4, 0, 5, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 1, 3, 4, 0, 6, 7, 7, 0, 8, - 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, - 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8 - ]); - var HHContextLabel = new Uint8Array([ - 0, 1, 2, 0, 1, 2, 2, 0, 2, 2, 2, 0, 0, 0, 0, 0, 3, 4, 5, 0, 4, 5, 5, 0, 5, - 5, 5, 0, 0, 0, 0, 0, 6, 7, 7, 0, 7, 7, 7, 0, 7, 7, 7, 0, 0, 0, 0, 0, 8, 8, - 8, 0, 8, 8, 8, 0, 8, 8, 8, 0, 0, 0, 0, 0, 8, 8, 8, 0, 8, 8, 8, 0, 8, 8, 8 - ]); - - function BitModel(width, height, subband, zeroBitPlanes, mb) { - this.width = width; - this.height = height; - - this.contextLabelTable = (subband === 'HH' ? HHContextLabel : - (subband === 'HL' ? HLContextLabel : LLAndLHContextsLabel)); - - var coefficientCount = width * height; - - // coefficients outside the encoding region treated as insignificant - // add border state cells for significanceState - this.neighborsSignificance = new Uint8Array(coefficientCount); - this.coefficentsSign = new Uint8Array(coefficientCount); - this.coefficentsMagnitude = mb > 14 ? new Uint32Array(coefficientCount) : - mb > 6 ? new Uint16Array(coefficientCount) : - new Uint8Array(coefficientCount); - this.processingFlags = new Uint8Array(coefficientCount); - - var bitsDecoded = new Uint8Array(coefficientCount); - if (zeroBitPlanes !== 0) { - for (var i = 0; i < coefficientCount; i++) { - bitsDecoded[i] = zeroBitPlanes; - } - } - this.bitsDecoded = bitsDecoded; - - this.reset(); - } - - BitModel.prototype = { - setDecoder: function BitModel_setDecoder(decoder) { - this.decoder = decoder; - }, - reset: function BitModel_reset() { - // We have 17 contexts that are accessed via context labels, - // plus the uniform and runlength context. - this.contexts = new Int8Array(19); - - // Contexts are packed into 1 byte: - // highest 7 bits carry the index, lowest bit carries mps - this.contexts[0] = (4 << 1) | 0; - this.contexts[UNIFORM_CONTEXT] = (46 << 1) | 0; - this.contexts[RUNLENGTH_CONTEXT] = (3 << 1) | 0; - }, - setNeighborsSignificance: - function BitModel_setNeighborsSignificance(row, column, index) { - var neighborsSignificance = this.neighborsSignificance; - var width = this.width, height = this.height; - var left = (column > 0); - var right = (column + 1 < width); - var i; - - if (row > 0) { - i = index - width; - if (left) { - neighborsSignificance[i - 1] += 0x10; - } - if (right) { - neighborsSignificance[i + 1] += 0x10; - } - neighborsSignificance[i] += 0x04; - } - - if (row + 1 < height) { - i = index + width; - if (left) { - neighborsSignificance[i - 1] += 0x10; - } - if (right) { - neighborsSignificance[i + 1] += 0x10; - } - neighborsSignificance[i] += 0x04; - } - - if (left) { - neighborsSignificance[index - 1] += 0x01; - } - if (right) { - neighborsSignificance[index + 1] += 0x01; - } - neighborsSignificance[index] |= 0x80; - }, - runSignificancePropogationPass: - function BitModel_runSignificancePropogationPass() { - var decoder = this.decoder; - var width = this.width, height = this.height; - var coefficentsMagnitude = this.coefficentsMagnitude; - var coefficentsSign = this.coefficentsSign; - var neighborsSignificance = this.neighborsSignificance; - var processingFlags = this.processingFlags; - var contexts = this.contexts; - var labels = this.contextLabelTable; - var bitsDecoded = this.bitsDecoded; - var processedInverseMask = ~1; - var processedMask = 1; - var firstMagnitudeBitMask = 2; - - for (var i0 = 0; i0 < height; i0 += 4) { - for (var j = 0; j < width; j++) { - var index = i0 * width + j; - for (var i1 = 0; i1 < 4; i1++, index += width) { - var i = i0 + i1; - if (i >= height) { - break; - } - // clear processed flag first - processingFlags[index] &= processedInverseMask; - - if (coefficentsMagnitude[index] || - !neighborsSignificance[index]) { - continue; - } - - var contextLabel = labels[neighborsSignificance[index]]; - var decision = decoder.readBit(contexts, contextLabel); - if (decision) { - var sign = this.decodeSignBit(i, j, index); - coefficentsSign[index] = sign; - coefficentsMagnitude[index] = 1; - this.setNeighborsSignificance(i, j, index); - processingFlags[index] |= firstMagnitudeBitMask; - } - bitsDecoded[index]++; - processingFlags[index] |= processedMask; - } - } - } - }, - decodeSignBit: function BitModel_decodeSignBit(row, column, index) { - var width = this.width, height = this.height; - var coefficentsMagnitude = this.coefficentsMagnitude; - var coefficentsSign = this.coefficentsSign; - var contribution, sign0, sign1, significance1; - var contextLabel, decoded; - - // calculate horizontal contribution - significance1 = (column > 0 && coefficentsMagnitude[index - 1] !== 0); - if (column + 1 < width && coefficentsMagnitude[index + 1] !== 0) { - sign1 = coefficentsSign[index + 1]; - if (significance1) { - sign0 = coefficentsSign[index - 1]; - contribution = 1 - sign1 - sign0; - } else { - contribution = 1 - sign1 - sign1; - } - } else if (significance1) { - sign0 = coefficentsSign[index - 1]; - contribution = 1 - sign0 - sign0; - } else { - contribution = 0; - } - var horizontalContribution = 3 * contribution; - - // calculate vertical contribution and combine with the horizontal - significance1 = (row > 0 && coefficentsMagnitude[index - width] !== 0); - if (row + 1 < height && coefficentsMagnitude[index + width] !== 0) { - sign1 = coefficentsSign[index + width]; - if (significance1) { - sign0 = coefficentsSign[index - width]; - contribution = 1 - sign1 - sign0 + horizontalContribution; - } else { - contribution = 1 - sign1 - sign1 + horizontalContribution; - } - } else if (significance1) { - sign0 = coefficentsSign[index - width]; - contribution = 1 - sign0 - sign0 + horizontalContribution; - } else { - contribution = horizontalContribution; - } - - if (contribution >= 0) { - contextLabel = 9 + contribution; - decoded = this.decoder.readBit(this.contexts, contextLabel); - } else { - contextLabel = 9 - contribution; - decoded = this.decoder.readBit(this.contexts, contextLabel) ^ 1; - } - return decoded; - }, - runMagnitudeRefinementPass: - function BitModel_runMagnitudeRefinementPass() { - var decoder = this.decoder; - var width = this.width, height = this.height; - var coefficentsMagnitude = this.coefficentsMagnitude; - var neighborsSignificance = this.neighborsSignificance; - var contexts = this.contexts; - var bitsDecoded = this.bitsDecoded; - var processingFlags = this.processingFlags; - var processedMask = 1; - var firstMagnitudeBitMask = 2; - var length = width * height; - var width4 = width * 4; - - for (var index0 = 0, indexNext; index0 < length; index0 = indexNext) { - indexNext = Math.min(length, index0 + width4); - for (var j = 0; j < width; j++) { - for (var index = index0 + j; index < indexNext; index += width) { - - // significant but not those that have just become - if (!coefficentsMagnitude[index] || - (processingFlags[index] & processedMask) !== 0) { - continue; - } - - var contextLabel = 16; - if ((processingFlags[index] & firstMagnitudeBitMask) !== 0) { - processingFlags[index] ^= firstMagnitudeBitMask; - // first refinement - var significance = neighborsSignificance[index] & 127; - contextLabel = significance === 0 ? 15 : 14; - } - - var bit = decoder.readBit(contexts, contextLabel); - coefficentsMagnitude[index] = - (coefficentsMagnitude[index] << 1) | bit; - bitsDecoded[index]++; - processingFlags[index] |= processedMask; - } - } - } - }, - runCleanupPass: function BitModel_runCleanupPass() { - var decoder = this.decoder; - var width = this.width, height = this.height; - var neighborsSignificance = this.neighborsSignificance; - var coefficentsMagnitude = this.coefficentsMagnitude; - var coefficentsSign = this.coefficentsSign; - var contexts = this.contexts; - var labels = this.contextLabelTable; - var bitsDecoded = this.bitsDecoded; - var processingFlags = this.processingFlags; - var processedMask = 1; - var firstMagnitudeBitMask = 2; - var oneRowDown = width; - var twoRowsDown = width * 2; - var threeRowsDown = width * 3; - var iNext; - for (var i0 = 0; i0 < height; i0 = iNext) { - iNext = Math.min(i0 + 4, height); - var indexBase = i0 * width; - var checkAllEmpty = i0 + 3 < height; - for (var j = 0; j < width; j++) { - var index0 = indexBase + j; - // using the property: labels[neighborsSignificance[index]] === 0 - // when neighborsSignificance[index] === 0 - var allEmpty = (checkAllEmpty && - processingFlags[index0] === 0 && - processingFlags[index0 + oneRowDown] === 0 && - processingFlags[index0 + twoRowsDown] === 0 && - processingFlags[index0 + threeRowsDown] === 0 && - neighborsSignificance[index0] === 0 && - neighborsSignificance[index0 + oneRowDown] === 0 && - neighborsSignificance[index0 + twoRowsDown] === 0 && - neighborsSignificance[index0 + threeRowsDown] === 0); - var i1 = 0, index = index0; - var i = i0, sign; - if (allEmpty) { - var hasSignificantCoefficent = - decoder.readBit(contexts, RUNLENGTH_CONTEXT); - if (!hasSignificantCoefficent) { - bitsDecoded[index0]++; - bitsDecoded[index0 + oneRowDown]++; - bitsDecoded[index0 + twoRowsDown]++; - bitsDecoded[index0 + threeRowsDown]++; - continue; // next column - } - i1 = (decoder.readBit(contexts, UNIFORM_CONTEXT) << 1) | - decoder.readBit(contexts, UNIFORM_CONTEXT); - if (i1 !== 0) { - i = i0 + i1; - index += i1 * width; - } - - sign = this.decodeSignBit(i, j, index); - coefficentsSign[index] = sign; - coefficentsMagnitude[index] = 1; - this.setNeighborsSignificance(i, j, index); - processingFlags[index] |= firstMagnitudeBitMask; - - index = index0; - for (var i2 = i0; i2 <= i; i2++, index += width) { - bitsDecoded[index]++; - } - - i1++; - } - for (i = i0 + i1; i < iNext; i++, index += width) { - if (coefficentsMagnitude[index] || - (processingFlags[index] & processedMask) !== 0) { - continue; - } - - var contextLabel = labels[neighborsSignificance[index]]; - var decision = decoder.readBit(contexts, contextLabel); - if (decision === 1) { - sign = this.decodeSignBit(i, j, index); - coefficentsSign[index] = sign; - coefficentsMagnitude[index] = 1; - this.setNeighborsSignificance(i, j, index); - processingFlags[index] |= firstMagnitudeBitMask; - } - bitsDecoded[index]++; - } - } - } - }, - checkSegmentationSymbol: function BitModel_checkSegmentationSymbol() { - var decoder = this.decoder; - var contexts = this.contexts; - var symbol = (decoder.readBit(contexts, UNIFORM_CONTEXT) << 3) | - (decoder.readBit(contexts, UNIFORM_CONTEXT) << 2) | - (decoder.readBit(contexts, UNIFORM_CONTEXT) << 1) | - decoder.readBit(contexts, UNIFORM_CONTEXT); - if (symbol !== 0xA) { - throw new Error('JPX Error: Invalid segmentation symbol'); - } - } - }; - - return BitModel; - })(); - - // Section F, Discrete wavelet transformation - var Transform = (function TransformClosure() { - function Transform() {} - - Transform.prototype.calculate = - function transformCalculate(subbands, u0, v0) { - var ll = subbands[0]; - for (var i = 1, ii = subbands.length; i < ii; i++) { - ll = this.iterate(ll, subbands[i], u0, v0); - } - return ll; - }; - Transform.prototype.extend = function extend(buffer, offset, size) { - // Section F.3.7 extending... using max extension of 4 - var i1 = offset - 1, j1 = offset + 1; - var i2 = offset + size - 2, j2 = offset + size; - buffer[i1--] = buffer[j1++]; - buffer[j2++] = buffer[i2--]; - buffer[i1--] = buffer[j1++]; - buffer[j2++] = buffer[i2--]; - buffer[i1--] = buffer[j1++]; - buffer[j2++] = buffer[i2--]; - buffer[i1] = buffer[j1]; - buffer[j2] = buffer[i2]; - }; - Transform.prototype.iterate = function Transform_iterate(ll, hl_lh_hh, - u0, v0) { - var llWidth = ll.width, llHeight = ll.height, llItems = ll.items; - var width = hl_lh_hh.width; - var height = hl_lh_hh.height; - var items = hl_lh_hh.items; - var i, j, k, l, u, v; - - // Interleave LL according to Section F.3.3 - for (k = 0, i = 0; i < llHeight; i++) { - l = i * 2 * width; - for (j = 0; j < llWidth; j++, k++, l += 2) { - items[l] = llItems[k]; - } - } - // The LL band is not needed anymore. - llItems = ll.items = null; - - var bufferPadding = 4; - var rowBuffer = new Float32Array(width + 2 * bufferPadding); - - // Section F.3.4 HOR_SR - if (width === 1) { - // if width = 1, when u0 even keep items as is, when odd divide by 2 - if ((u0 & 1) !== 0) { - for (v = 0, k = 0; v < height; v++, k += width) { - items[k] *= 0.5; - } - } - } else { - for (v = 0, k = 0; v < height; v++, k += width) { - rowBuffer.set(items.subarray(k, k + width), bufferPadding); - - this.extend(rowBuffer, bufferPadding, width); - this.filter(rowBuffer, bufferPadding, width); - - items.set( - rowBuffer.subarray(bufferPadding, bufferPadding + width), - k); - } - } - - // Accesses to the items array can take long, because it may not fit into - // CPU cache and has to be fetched from main memory. Since subsequent - // accesses to the items array are not local when reading columns, we - // have a cache miss every time. To reduce cache misses, get up to - // 'numBuffers' items at a time and store them into the individual - // buffers. The colBuffers should be small enough to fit into CPU cache. - var numBuffers = 16; - var colBuffers = []; - for (i = 0; i < numBuffers; i++) { - colBuffers.push(new Float32Array(height + 2 * bufferPadding)); - } - var b, currentBuffer = 0; - ll = bufferPadding + height; - - // Section F.3.5 VER_SR - if (height === 1) { - // if height = 1, when v0 even keep items as is, when odd divide by 2 - if ((v0 & 1) !== 0) { - for (u = 0; u < width; u++) { - items[u] *= 0.5; - } - } - } else { - for (u = 0; u < width; u++) { - // if we ran out of buffers, copy several image columns at once - if (currentBuffer === 0) { - numBuffers = Math.min(width - u, numBuffers); - for (k = u, l = bufferPadding; l < ll; k += width, l++) { - for (b = 0; b < numBuffers; b++) { - colBuffers[b][l] = items[k + b]; - } - } - currentBuffer = numBuffers; - } - - currentBuffer--; - var buffer = colBuffers[currentBuffer]; - this.extend(buffer, bufferPadding, height); - this.filter(buffer, bufferPadding, height); - - // If this is last buffer in this group of buffers, flush all buffers. - if (currentBuffer === 0) { - k = u - numBuffers + 1; - for (l = bufferPadding; l < ll; k += width, l++) { - for (b = 0; b < numBuffers; b++) { - items[k + b] = colBuffers[b][l]; - } - } - } - } - } - - return { - width: width, - height: height, - items: items - }; - }; - return Transform; - })(); - - // Section 3.8.2 Irreversible 9-7 filter - var IrreversibleTransform = (function IrreversibleTransformClosure() { - function IrreversibleTransform() { - Transform.call(this); - } - - IrreversibleTransform.prototype = Object.create(Transform.prototype); - IrreversibleTransform.prototype.filter = - function irreversibleTransformFilter(x, offset, length) { - var len = length >> 1; - offset = offset | 0; - var j, n, current, next; - - var alpha = -1.586134342059924; - var beta = -0.052980118572961; - var gamma = 0.882911075530934; - var delta = 0.443506852043971; - var K = 1.230174104914001; - var K_ = 1 / K; - - // step 1 is combined with step 3 - - // step 2 - j = offset - 3; - for (n = len + 4; n--; j += 2) { - x[j] *= K_; - } - - // step 1 & 3 - j = offset - 2; - current = delta * x[j -1]; - for (n = len + 3; n--; j += 2) { - next = delta * x[j + 1]; - x[j] = K * x[j] - current - next; - if (n--) { - j += 2; - current = delta * x[j + 1]; - x[j] = K * x[j] - current - next; - } else { - break; - } - } - - // step 4 - j = offset - 1; - current = gamma * x[j - 1]; - for (n = len + 2; n--; j += 2) { - next = gamma * x[j + 1]; - x[j] -= current + next; - if (n--) { - j += 2; - current = gamma * x[j + 1]; - x[j] -= current + next; - } else { - break; - } - } - - // step 5 - j = offset; - current = beta * x[j - 1]; - for (n = len + 1; n--; j += 2) { - next = beta * x[j + 1]; - x[j] -= current + next; - if (n--) { - j += 2; - current = beta * x[j + 1]; - x[j] -= current + next; - } else { - break; - } - } - - // step 6 - if (len !== 0) { - j = offset + 1; - current = alpha * x[j - 1]; - for (n = len; n--; j += 2) { - next = alpha * x[j + 1]; - x[j] -= current + next; - if (n--) { - j += 2; - current = alpha * x[j + 1]; - x[j] -= current + next; - } else { - break; - } - } - } - }; - - return IrreversibleTransform; - })(); - - // Section 3.8.1 Reversible 5-3 filter - var ReversibleTransform = (function ReversibleTransformClosure() { - function ReversibleTransform() { - Transform.call(this); - } - - ReversibleTransform.prototype = Object.create(Transform.prototype); - ReversibleTransform.prototype.filter = - function reversibleTransformFilter(x, offset, length) { - var len = length >> 1; - offset = offset | 0; - var j, n; - - for (j = offset, n = len + 1; n--; j += 2) { - x[j] -= (x[j - 1] + x[j + 1] + 2) >> 2; - } - - for (j = offset + 1, n = len; n--; j += 2) { - x[j] += (x[j - 1] + x[j + 1]) >> 1; - } - }; - - return ReversibleTransform; - })(); - - return JpxImage; -})(); - - -var Jbig2Image = (function Jbig2ImageClosure() { - // Utility data structures - function ContextCache() {} - - ContextCache.prototype = { - getContexts: function(id) { - if (id in this) { - return this[id]; - } - return (this[id] = new Int8Array(1 << 16)); - } - }; - - function DecodingContext(data, start, end) { - this.data = data; - this.start = start; - this.end = end; - } - - DecodingContext.prototype = { - get decoder() { - var decoder = new ArithmeticDecoder(this.data, this.start, this.end); - return shadow(this, 'decoder', decoder); - }, - get contextCache() { - var cache = new ContextCache(); - return shadow(this, 'contextCache', cache); - } - }; - - // Annex A. Arithmetic Integer Decoding Procedure - // A.2 Procedure for decoding values - function decodeInteger(contextCache, procedure, decoder) { - var contexts = contextCache.getContexts(procedure); - var prev = 1; - - function readBits(length) { - var v = 0; - for (var i = 0; i < length; i++) { - var bit = decoder.readBit(contexts, prev); - prev = (prev < 256 ? (prev << 1) | bit : - (((prev << 1) | bit) & 511) | 256); - v = (v << 1) | bit; - } - return v >>> 0; - } - - var sign = readBits(1); - var value = readBits(1) ? - (readBits(1) ? - (readBits(1) ? - (readBits(1) ? - (readBits(1) ? - (readBits(32) + 4436) : - readBits(12) + 340) : - readBits(8) + 84) : - readBits(6) + 20) : - readBits(4) + 4) : - readBits(2); - return (sign === 0 ? value : (value > 0 ? -value : null)); - } - - // A.3 The IAID decoding procedure - function decodeIAID(contextCache, decoder, codeLength) { - var contexts = contextCache.getContexts('IAID'); - - var prev = 1; - for (var i = 0; i < codeLength; i++) { - var bit = decoder.readBit(contexts, prev); - prev = (prev << 1) | bit; - } - if (codeLength < 31) { - return prev & ((1 << codeLength) - 1); - } - return prev & 0x7FFFFFFF; - } - - // 7.3 Segment types - var SegmentTypes = [ - 'SymbolDictionary', null, null, null, 'IntermediateTextRegion', null, - 'ImmediateTextRegion', 'ImmediateLosslessTextRegion', null, null, null, - null, null, null, null, null, 'patternDictionary', null, null, null, - 'IntermediateHalftoneRegion', null, 'ImmediateHalftoneRegion', - 'ImmediateLosslessHalftoneRegion', null, null, null, null, null, null, null, - null, null, null, null, null, 'IntermediateGenericRegion', null, - 'ImmediateGenericRegion', 'ImmediateLosslessGenericRegion', - 'IntermediateGenericRefinementRegion', null, - 'ImmediateGenericRefinementRegion', - 'ImmediateLosslessGenericRefinementRegion', null, null, null, null, - 'PageInformation', 'EndOfPage', 'EndOfStripe', 'EndOfFile', 'Profiles', - 'Tables', null, null, null, null, null, null, null, null, - 'Extension' - ]; - - var CodingTemplates = [ - [{x: -1, y: -2}, {x: 0, y: -2}, {x: 1, y: -2}, {x: -2, y: -1}, - {x: -1, y: -1}, {x: 0, y: -1}, {x: 1, y: -1}, {x: 2, y: -1}, - {x: -4, y: 0}, {x: -3, y: 0}, {x: -2, y: 0}, {x: -1, y: 0}], - [{x: -1, y: -2}, {x: 0, y: -2}, {x: 1, y: -2}, {x: 2, y: -2}, - {x: -2, y: -1}, {x: -1, y: -1}, {x: 0, y: -1}, {x: 1, y: -1}, - {x: 2, y: -1}, {x: -3, y: 0}, {x: -2, y: 0}, {x: -1, y: 0}], - [{x: -1, y: -2}, {x: 0, y: -2}, {x: 1, y: -2}, {x: -2, y: -1}, - {x: -1, y: -1}, {x: 0, y: -1}, {x: 1, y: -1}, {x: -2, y: 0}, - {x: -1, y: 0}], - [{x: -3, y: -1}, {x: -2, y: -1}, {x: -1, y: -1}, {x: 0, y: -1}, - {x: 1, y: -1}, {x: -4, y: 0}, {x: -3, y: 0}, {x: -2, y: 0}, {x: -1, y: 0}] - ]; - - var RefinementTemplates = [ - { - coding: [{x: 0, y: -1}, {x: 1, y: -1}, {x: -1, y: 0}], - reference: [{x: 0, y: -1}, {x: 1, y: -1}, {x: -1, y: 0}, {x: 0, y: 0}, - {x: 1, y: 0}, {x: -1, y: 1}, {x: 0, y: 1}, {x: 1, y: 1}] - }, - { - coding: [{x: -1, y: -1}, {x: 0, y: -1}, {x: 1, y: -1}, {x: -1, y: 0}], - reference: [{x: 0, y: -1}, {x: -1, y: 0}, {x: 0, y: 0}, {x: 1, y: 0}, - {x: 0, y: 1}, {x: 1, y: 1}] - } - ]; - - // See 6.2.5.7 Decoding the bitmap. - var ReusedContexts = [ - 0x9B25, // 10011 0110010 0101 - 0x0795, // 0011 110010 101 - 0x00E5, // 001 11001 01 - 0x0195 // 011001 0101 - ]; - - var RefinementReusedContexts = [ - 0x0020, // '000' + '0' (coding) + '00010000' + '0' (reference) - 0x0008 // '0000' + '001000' - ]; - - function decodeBitmapTemplate0(width, height, decodingContext) { - var decoder = decodingContext.decoder; - var contexts = decodingContext.contextCache.getContexts('GB'); - var contextLabel, i, j, pixel, row, row1, row2, bitmap = []; - - // ...ooooo.... - // ..ooooooo... Context template for current pixel (X) - // .ooooX...... (concatenate values of 'o'-pixels to get contextLabel) - var OLD_PIXEL_MASK = 0x7BF7; // 01111 0111111 0111 - - for (i = 0; i < height; i++) { - row = bitmap[i] = new Uint8Array(width); - row1 = (i < 1) ? row : bitmap[i - 1]; - row2 = (i < 2) ? row : bitmap[i - 2]; - - // At the beginning of each row: - // Fill contextLabel with pixels that are above/right of (X) - contextLabel = (row2[0] << 13) | (row2[1] << 12) | (row2[2] << 11) | - (row1[0] << 7) | (row1[1] << 6) | (row1[2] << 5) | - (row1[3] << 4); - - for (j = 0; j < width; j++) { - row[j] = pixel = decoder.readBit(contexts, contextLabel); - - // At each pixel: Clear contextLabel pixels that are shifted - // out of the context, then add new ones. - contextLabel = ((contextLabel & OLD_PIXEL_MASK) << 1) | - (j + 3 < width ? row2[j + 3] << 11 : 0) | - (j + 4 < width ? row1[j + 4] << 4 : 0) | pixel; - } - } - - return bitmap; - } - - // 6.2 Generic Region Decoding Procedure - function decodeBitmap(mmr, width, height, templateIndex, prediction, skip, at, - decodingContext) { - if (mmr) { - error('JBIG2 error: MMR encoding is not supported'); - } - - // Use optimized version for the most common case - if (templateIndex === 0 && !skip && !prediction && at.length === 4 && - at[0].x === 3 && at[0].y === -1 && at[1].x === -3 && at[1].y === -1 && - at[2].x === 2 && at[2].y === -2 && at[3].x === -2 && at[3].y === -2) { - return decodeBitmapTemplate0(width, height, decodingContext); - } - - var useskip = !!skip; - var template = CodingTemplates[templateIndex].concat(at); - - // Sorting is non-standard, and it is not required. But sorting increases - // the number of template bits that can be reused from the previous - // contextLabel in the main loop. - template.sort(function (a, b) { - return (a.y - b.y) || (a.x - b.x); - }); - - var templateLength = template.length; - var templateX = new Int8Array(templateLength); - var templateY = new Int8Array(templateLength); - var changingTemplateEntries = []; - var reuseMask = 0, minX = 0, maxX = 0, minY = 0; - var c, k; - - for (k = 0; k < templateLength; k++) { - templateX[k] = template[k].x; - templateY[k] = template[k].y; - minX = Math.min(minX, template[k].x); - maxX = Math.max(maxX, template[k].x); - minY = Math.min(minY, template[k].y); - // Check if the template pixel appears in two consecutive context labels, - // so it can be reused. Otherwise, we add it to the list of changing - // template entries. - if (k < templateLength - 1 && - template[k].y === template[k + 1].y && - template[k].x === template[k + 1].x - 1) { - reuseMask |= 1 << (templateLength - 1 - k); - } else { - changingTemplateEntries.push(k); - } - } - var changingEntriesLength = changingTemplateEntries.length; - - var changingTemplateX = new Int8Array(changingEntriesLength); - var changingTemplateY = new Int8Array(changingEntriesLength); - var changingTemplateBit = new Uint16Array(changingEntriesLength); - for (c = 0; c < changingEntriesLength; c++) { - k = changingTemplateEntries[c]; - changingTemplateX[c] = template[k].x; - changingTemplateY[c] = template[k].y; - changingTemplateBit[c] = 1 << (templateLength - 1 - k); - } - - // Get the safe bounding box edges from the width, height, minX, maxX, minY - var sbb_left = -minX; - var sbb_top = -minY; - var sbb_right = width - maxX; - - var pseudoPixelContext = ReusedContexts[templateIndex]; - var row = new Uint8Array(width); - var bitmap = []; - - var decoder = decodingContext.decoder; - var contexts = decodingContext.contextCache.getContexts('GB'); - - var ltp = 0, j, i0, j0, contextLabel = 0, bit, shift; - for (var i = 0; i < height; i++) { - if (prediction) { - var sltp = decoder.readBit(contexts, pseudoPixelContext); - ltp ^= sltp; - if (ltp) { - bitmap.push(row); // duplicate previous row - continue; - } - } - row = new Uint8Array(row); - bitmap.push(row); - for (j = 0; j < width; j++) { - if (useskip && skip[i][j]) { - row[j] = 0; - continue; - } - // Are we in the middle of a scanline, so we can reuse contextLabel - // bits? - if (j >= sbb_left && j < sbb_right && i >= sbb_top) { - // If yes, we can just shift the bits that are reusable and only - // fetch the remaining ones. - contextLabel = (contextLabel << 1) & reuseMask; - for (k = 0; k < changingEntriesLength; k++) { - i0 = i + changingTemplateY[k]; - j0 = j + changingTemplateX[k]; - bit = bitmap[i0][j0]; - if (bit) { - bit = changingTemplateBit[k]; - contextLabel |= bit; - } - } - } else { - // compute the contextLabel from scratch - contextLabel = 0; - shift = templateLength - 1; - for (k = 0; k < templateLength; k++, shift--) { - j0 = j + templateX[k]; - if (j0 >= 0 && j0 < width) { - i0 = i + templateY[k]; - if (i0 >= 0) { - bit = bitmap[i0][j0]; - if (bit) { - contextLabel |= bit << shift; - } - } - } - } - } - var pixel = decoder.readBit(contexts, contextLabel); - row[j] = pixel; - } - } - return bitmap; - } - - // 6.3.2 Generic Refinement Region Decoding Procedure - function decodeRefinement(width, height, templateIndex, referenceBitmap, - offsetX, offsetY, prediction, at, - decodingContext) { - var codingTemplate = RefinementTemplates[templateIndex].coding; - if (templateIndex === 0) { - codingTemplate = codingTemplate.concat([at[0]]); - } - var codingTemplateLength = codingTemplate.length; - var codingTemplateX = new Int32Array(codingTemplateLength); - var codingTemplateY = new Int32Array(codingTemplateLength); - var k; - for (k = 0; k < codingTemplateLength; k++) { - codingTemplateX[k] = codingTemplate[k].x; - codingTemplateY[k] = codingTemplate[k].y; - } - - var referenceTemplate = RefinementTemplates[templateIndex].reference; - if (templateIndex === 0) { - referenceTemplate = referenceTemplate.concat([at[1]]); - } - var referenceTemplateLength = referenceTemplate.length; - var referenceTemplateX = new Int32Array(referenceTemplateLength); - var referenceTemplateY = new Int32Array(referenceTemplateLength); - for (k = 0; k < referenceTemplateLength; k++) { - referenceTemplateX[k] = referenceTemplate[k].x; - referenceTemplateY[k] = referenceTemplate[k].y; - } - var referenceWidth = referenceBitmap[0].length; - var referenceHeight = referenceBitmap.length; - - var pseudoPixelContext = RefinementReusedContexts[templateIndex]; - var bitmap = []; - - var decoder = decodingContext.decoder; - var contexts = decodingContext.contextCache.getContexts('GR'); - - var ltp = 0; - for (var i = 0; i < height; i++) { - if (prediction) { - var sltp = decoder.readBit(contexts, pseudoPixelContext); - ltp ^= sltp; - if (ltp) { - error('JBIG2 error: prediction is not supported'); - } - } - var row = new Uint8Array(width); - bitmap.push(row); - for (var j = 0; j < width; j++) { - var i0, j0; - var contextLabel = 0; - for (k = 0; k < codingTemplateLength; k++) { - i0 = i + codingTemplateY[k]; - j0 = j + codingTemplateX[k]; - if (i0 < 0 || j0 < 0 || j0 >= width) { - contextLabel <<= 1; // out of bound pixel - } else { - contextLabel = (contextLabel << 1) | bitmap[i0][j0]; - } - } - for (k = 0; k < referenceTemplateLength; k++) { - i0 = i + referenceTemplateY[k] + offsetY; - j0 = j + referenceTemplateX[k] + offsetX; - if (i0 < 0 || i0 >= referenceHeight || j0 < 0 || - j0 >= referenceWidth) { - contextLabel <<= 1; // out of bound pixel - } else { - contextLabel = (contextLabel << 1) | referenceBitmap[i0][j0]; - } - } - var pixel = decoder.readBit(contexts, contextLabel); - row[j] = pixel; - } - } - - return bitmap; - } - - // 6.5.5 Decoding the symbol dictionary - function decodeSymbolDictionary(huffman, refinement, symbols, - numberOfNewSymbols, numberOfExportedSymbols, - huffmanTables, templateIndex, at, - refinementTemplateIndex, refinementAt, - decodingContext) { - if (huffman) { - error('JBIG2 error: huffman is not supported'); - } - - var newSymbols = []; - var currentHeight = 0; - var symbolCodeLength = log2(symbols.length + numberOfNewSymbols); - - var decoder = decodingContext.decoder; - var contextCache = decodingContext.contextCache; - - while (newSymbols.length < numberOfNewSymbols) { - var deltaHeight = decodeInteger(contextCache, 'IADH', decoder); // 6.5.6 - currentHeight += deltaHeight; - var currentWidth = 0; - var totalWidth = 0; - while (true) { - var deltaWidth = decodeInteger(contextCache, 'IADW', decoder); // 6.5.7 - if (deltaWidth === null) { - break; // OOB - } - currentWidth += deltaWidth; - totalWidth += currentWidth; - var bitmap; - if (refinement) { - // 6.5.8.2 Refinement/aggregate-coded symbol bitmap - var numberOfInstances = decodeInteger(contextCache, 'IAAI', decoder); - if (numberOfInstances > 1) { - bitmap = decodeTextRegion(huffman, refinement, - currentWidth, currentHeight, 0, - numberOfInstances, 1, //strip size - symbols.concat(newSymbols), - symbolCodeLength, - 0, //transposed - 0, //ds offset - 1, //top left 7.4.3.1.1 - 0, //OR operator - huffmanTables, - refinementTemplateIndex, refinementAt, - decodingContext); - } else { - var symbolId = decodeIAID(contextCache, decoder, symbolCodeLength); - var rdx = decodeInteger(contextCache, 'IARDX', decoder); // 6.4.11.3 - var rdy = decodeInteger(contextCache, 'IARDY', decoder); // 6.4.11.4 - var symbol = (symbolId < symbols.length ? symbols[symbolId] : - newSymbols[symbolId - symbols.length]); - bitmap = decodeRefinement(currentWidth, currentHeight, - refinementTemplateIndex, symbol, rdx, rdy, false, refinementAt, - decodingContext); - } - } else { - // 6.5.8.1 Direct-coded symbol bitmap - bitmap = decodeBitmap(false, currentWidth, currentHeight, - templateIndex, false, null, at, decodingContext); - } - newSymbols.push(bitmap); - } - } - // 6.5.10 Exported symbols - var exportedSymbols = []; - var flags = [], currentFlag = false; - var totalSymbolsLength = symbols.length + numberOfNewSymbols; - while (flags.length < totalSymbolsLength) { - var runLength = decodeInteger(contextCache, 'IAEX', decoder); - while (runLength--) { - flags.push(currentFlag); - } - currentFlag = !currentFlag; - } - for (var i = 0, ii = symbols.length; i < ii; i++) { - if (flags[i]) { - exportedSymbols.push(symbols[i]); - } - } - for (var j = 0; j < numberOfNewSymbols; i++, j++) { - if (flags[i]) { - exportedSymbols.push(newSymbols[j]); - } - } - return exportedSymbols; - } - - function decodeTextRegion(huffman, refinement, width, height, - defaultPixelValue, numberOfSymbolInstances, - stripSize, inputSymbols, symbolCodeLength, - transposed, dsOffset, referenceCorner, - combinationOperator, huffmanTables, - refinementTemplateIndex, refinementAt, - decodingContext) { - if (huffman) { - error('JBIG2 error: huffman is not supported'); - } - - // Prepare bitmap - var bitmap = []; - var i, row; - for (i = 0; i < height; i++) { - row = new Uint8Array(width); - if (defaultPixelValue) { - for (var j = 0; j < width; j++) { - row[j] = defaultPixelValue; - } - } - bitmap.push(row); - } - - var decoder = decodingContext.decoder; - var contextCache = decodingContext.contextCache; - var stripT = -decodeInteger(contextCache, 'IADT', decoder); // 6.4.6 - var firstS = 0; - i = 0; - while (i < numberOfSymbolInstances) { - var deltaT = decodeInteger(contextCache, 'IADT', decoder); // 6.4.6 - stripT += deltaT; - - var deltaFirstS = decodeInteger(contextCache, 'IAFS', decoder); // 6.4.7 - firstS += deltaFirstS; - var currentS = firstS; - do { - var currentT = (stripSize === 1 ? 0 : - decodeInteger(contextCache, 'IAIT', decoder)); // 6.4.9 - var t = stripSize * stripT + currentT; - var symbolId = decodeIAID(contextCache, decoder, symbolCodeLength); - var applyRefinement = (refinement && - decodeInteger(contextCache, 'IARI', decoder)); - var symbolBitmap = inputSymbols[symbolId]; - var symbolWidth = symbolBitmap[0].length; - var symbolHeight = symbolBitmap.length; - if (applyRefinement) { - var rdw = decodeInteger(contextCache, 'IARDW', decoder); // 6.4.11.1 - var rdh = decodeInteger(contextCache, 'IARDH', decoder); // 6.4.11.2 - var rdx = decodeInteger(contextCache, 'IARDX', decoder); // 6.4.11.3 - var rdy = decodeInteger(contextCache, 'IARDY', decoder); // 6.4.11.4 - symbolWidth += rdw; - symbolHeight += rdh; - symbolBitmap = decodeRefinement(symbolWidth, symbolHeight, - refinementTemplateIndex, symbolBitmap, (rdw >> 1) + rdx, - (rdh >> 1) + rdy, false, refinementAt, - decodingContext); - } - var offsetT = t - ((referenceCorner & 1) ? 0 : symbolHeight); - var offsetS = currentS - ((referenceCorner & 2) ? symbolWidth : 0); - var s2, t2, symbolRow; - if (transposed) { - // Place Symbol Bitmap from T1,S1 - for (s2 = 0; s2 < symbolHeight; s2++) { - row = bitmap[offsetS + s2]; - if (!row) { - continue; - } - symbolRow = symbolBitmap[s2]; - // To ignore Parts of Symbol bitmap which goes - // outside bitmap region - var maxWidth = Math.min(width - offsetT, symbolWidth); - switch (combinationOperator) { - case 0: // OR - for (t2 = 0; t2 < maxWidth; t2++) { - row[offsetT + t2] |= symbolRow[t2]; - } - break; - case 2: // XOR - for (t2 = 0; t2 < maxWidth; t2++) { - row[offsetT + t2] ^= symbolRow[t2]; - } - break; - default: - error('JBIG2 error: operator ' + combinationOperator + - ' is not supported'); - } - } - currentS += symbolHeight - 1; - } else { - for (t2 = 0; t2 < symbolHeight; t2++) { - row = bitmap[offsetT + t2]; - if (!row) { - continue; - } - symbolRow = symbolBitmap[t2]; - switch (combinationOperator) { - case 0: // OR - for (s2 = 0; s2 < symbolWidth; s2++) { - row[offsetS + s2] |= symbolRow[s2]; - } - break; - case 2: // XOR - for (s2 = 0; s2 < symbolWidth; s2++) { - row[offsetS + s2] ^= symbolRow[s2]; - } - break; - default: - error('JBIG2 error: operator ' + combinationOperator + - ' is not supported'); - } - } - currentS += symbolWidth - 1; - } - i++; - var deltaS = decodeInteger(contextCache, 'IADS', decoder); // 6.4.8 - if (deltaS === null) { - break; // OOB - } - currentS += deltaS + dsOffset; - } while (true); - } - return bitmap; - } - - function readSegmentHeader(data, start) { - var segmentHeader = {}; - segmentHeader.number = readUint32(data, start); - var flags = data[start + 4]; - var segmentType = flags & 0x3F; - if (!SegmentTypes[segmentType]) { - error('JBIG2 error: invalid segment type: ' + segmentType); - } - segmentHeader.type = segmentType; - segmentHeader.typeName = SegmentTypes[segmentType]; - segmentHeader.deferredNonRetain = !!(flags & 0x80); - - var pageAssociationFieldSize = !!(flags & 0x40); - var referredFlags = data[start + 5]; - var referredToCount = (referredFlags >> 5) & 7; - var retainBits = [referredFlags & 31]; - var position = start + 6; - if (referredFlags === 7) { - referredToCount = readUint32(data, position - 1) & 0x1FFFFFFF; - position += 3; - var bytes = (referredToCount + 7) >> 3; - retainBits[0] = data[position++]; - while (--bytes > 0) { - retainBits.push(data[position++]); - } - } else if (referredFlags === 5 || referredFlags === 6) { - error('JBIG2 error: invalid referred-to flags'); - } - - segmentHeader.retainBits = retainBits; - var referredToSegmentNumberSize = (segmentHeader.number <= 256 ? 1 : - (segmentHeader.number <= 65536 ? 2 : 4)); - var referredTo = []; - var i, ii; - for (i = 0; i < referredToCount; i++) { - var number = (referredToSegmentNumberSize === 1 ? data[position] : - (referredToSegmentNumberSize === 2 ? readUint16(data, position) : - readUint32(data, position))); - referredTo.push(number); - position += referredToSegmentNumberSize; - } - segmentHeader.referredTo = referredTo; - if (!pageAssociationFieldSize) { - segmentHeader.pageAssociation = data[position++]; - } else { - segmentHeader.pageAssociation = readUint32(data, position); - position += 4; - } - segmentHeader.length = readUint32(data, position); - position += 4; - - if (segmentHeader.length === 0xFFFFFFFF) { - // 7.2.7 Segment data length, unknown segment length - if (segmentType === 38) { // ImmediateGenericRegion - var genericRegionInfo = readRegionSegmentInformation(data, position); - var genericRegionSegmentFlags = data[position + - RegionSegmentInformationFieldLength]; - var genericRegionMmr = !!(genericRegionSegmentFlags & 1); - // searching for the segment end - var searchPatternLength = 6; - var searchPattern = new Uint8Array(searchPatternLength); - if (!genericRegionMmr) { - searchPattern[0] = 0xFF; - searchPattern[1] = 0xAC; - } - searchPattern[2] = (genericRegionInfo.height >>> 24) & 0xFF; - searchPattern[3] = (genericRegionInfo.height >> 16) & 0xFF; - searchPattern[4] = (genericRegionInfo.height >> 8) & 0xFF; - searchPattern[5] = genericRegionInfo.height & 0xFF; - for (i = position, ii = data.length; i < ii; i++) { - var j = 0; - while (j < searchPatternLength && searchPattern[j] === data[i + j]) { - j++; - } - if (j === searchPatternLength) { - segmentHeader.length = i + searchPatternLength; - break; - } - } - if (segmentHeader.length === 0xFFFFFFFF) { - error('JBIG2 error: segment end was not found'); - } - } else { - error('JBIG2 error: invalid unknown segment length'); - } - } - segmentHeader.headerEnd = position; - return segmentHeader; - } - - function readSegments(header, data, start, end) { - var segments = []; - var position = start; - while (position < end) { - var segmentHeader = readSegmentHeader(data, position); - position = segmentHeader.headerEnd; - var segment = { - header: segmentHeader, - data: data - }; - if (!header.randomAccess) { - segment.start = position; - position += segmentHeader.length; - segment.end = position; - } - segments.push(segment); - if (segmentHeader.type === 51) { - break; // end of file is found - } - } - if (header.randomAccess) { - for (var i = 0, ii = segments.length; i < ii; i++) { - segments[i].start = position; - position += segments[i].header.length; - segments[i].end = position; - } - } - return segments; - } - - // 7.4.1 Region segment information field - function readRegionSegmentInformation(data, start) { - return { - width: readUint32(data, start), - height: readUint32(data, start + 4), - x: readUint32(data, start + 8), - y: readUint32(data, start + 12), - combinationOperator: data[start + 16] & 7 - }; - } - var RegionSegmentInformationFieldLength = 17; - - function processSegment(segment, visitor) { - var header = segment.header; - - var data = segment.data, position = segment.start, end = segment.end; - var args, at, i, atLength; - switch (header.type) { - case 0: // SymbolDictionary - // 7.4.2 Symbol dictionary segment syntax - var dictionary = {}; - var dictionaryFlags = readUint16(data, position); // 7.4.2.1.1 - dictionary.huffman = !!(dictionaryFlags & 1); - dictionary.refinement = !!(dictionaryFlags & 2); - dictionary.huffmanDHSelector = (dictionaryFlags >> 2) & 3; - dictionary.huffmanDWSelector = (dictionaryFlags >> 4) & 3; - dictionary.bitmapSizeSelector = (dictionaryFlags >> 6) & 1; - dictionary.aggregationInstancesSelector = (dictionaryFlags >> 7) & 1; - dictionary.bitmapCodingContextUsed = !!(dictionaryFlags & 256); - dictionary.bitmapCodingContextRetained = !!(dictionaryFlags & 512); - dictionary.template = (dictionaryFlags >> 10) & 3; - dictionary.refinementTemplate = (dictionaryFlags >> 12) & 1; - position += 2; - if (!dictionary.huffman) { - atLength = dictionary.template === 0 ? 4 : 1; - at = []; - for (i = 0; i < atLength; i++) { - at.push({ - x: readInt8(data, position), - y: readInt8(data, position + 1) - }); - position += 2; - } - dictionary.at = at; - } - if (dictionary.refinement && !dictionary.refinementTemplate) { - at = []; - for (i = 0; i < 2; i++) { - at.push({ - x: readInt8(data, position), - y: readInt8(data, position + 1) - }); - position += 2; - } - dictionary.refinementAt = at; - } - dictionary.numberOfExportedSymbols = readUint32(data, position); - position += 4; - dictionary.numberOfNewSymbols = readUint32(data, position); - position += 4; - args = [dictionary, header.number, header.referredTo, - data, position, end]; - break; - case 6: // ImmediateTextRegion - case 7: // ImmediateLosslessTextRegion - var textRegion = {}; - textRegion.info = readRegionSegmentInformation(data, position); - position += RegionSegmentInformationFieldLength; - var textRegionSegmentFlags = readUint16(data, position); - position += 2; - textRegion.huffman = !!(textRegionSegmentFlags & 1); - textRegion.refinement = !!(textRegionSegmentFlags & 2); - textRegion.stripSize = 1 << ((textRegionSegmentFlags >> 2) & 3); - textRegion.referenceCorner = (textRegionSegmentFlags >> 4) & 3; - textRegion.transposed = !!(textRegionSegmentFlags & 64); - textRegion.combinationOperator = (textRegionSegmentFlags >> 7) & 3; - textRegion.defaultPixelValue = (textRegionSegmentFlags >> 9) & 1; - textRegion.dsOffset = (textRegionSegmentFlags << 17) >> 27; - textRegion.refinementTemplate = (textRegionSegmentFlags >> 15) & 1; - if (textRegion.huffman) { - var textRegionHuffmanFlags = readUint16(data, position); - position += 2; - textRegion.huffmanFS = (textRegionHuffmanFlags) & 3; - textRegion.huffmanDS = (textRegionHuffmanFlags >> 2) & 3; - textRegion.huffmanDT = (textRegionHuffmanFlags >> 4) & 3; - textRegion.huffmanRefinementDW = (textRegionHuffmanFlags >> 6) & 3; - textRegion.huffmanRefinementDH = (textRegionHuffmanFlags >> 8) & 3; - textRegion.huffmanRefinementDX = (textRegionHuffmanFlags >> 10) & 3; - textRegion.huffmanRefinementDY = (textRegionHuffmanFlags >> 12) & 3; - textRegion.huffmanRefinementSizeSelector = - !!(textRegionHuffmanFlags & 14); - } - if (textRegion.refinement && !textRegion.refinementTemplate) { - at = []; - for (i = 0; i < 2; i++) { - at.push({ - x: readInt8(data, position), - y: readInt8(data, position + 1) - }); - position += 2; - } - textRegion.refinementAt = at; - } - textRegion.numberOfSymbolInstances = readUint32(data, position); - position += 4; - // TODO 7.4.3.1.7 Symbol ID Huffman table decoding - if (textRegion.huffman) { - error('JBIG2 error: huffman is not supported'); - } - args = [textRegion, header.referredTo, data, position, end]; - break; - case 38: // ImmediateGenericRegion - case 39: // ImmediateLosslessGenericRegion - var genericRegion = {}; - genericRegion.info = readRegionSegmentInformation(data, position); - position += RegionSegmentInformationFieldLength; - var genericRegionSegmentFlags = data[position++]; - genericRegion.mmr = !!(genericRegionSegmentFlags & 1); - genericRegion.template = (genericRegionSegmentFlags >> 1) & 3; - genericRegion.prediction = !!(genericRegionSegmentFlags & 8); - if (!genericRegion.mmr) { - atLength = genericRegion.template === 0 ? 4 : 1; - at = []; - for (i = 0; i < atLength; i++) { - at.push({ - x: readInt8(data, position), - y: readInt8(data, position + 1) - }); - position += 2; - } - genericRegion.at = at; - } - args = [genericRegion, data, position, end]; - break; - case 48: // PageInformation - var pageInfo = { - width: readUint32(data, position), - height: readUint32(data, position + 4), - resolutionX: readUint32(data, position + 8), - resolutionY: readUint32(data, position + 12) - }; - if (pageInfo.height === 0xFFFFFFFF) { - delete pageInfo.height; - } - var pageSegmentFlags = data[position + 16]; - var pageStripingInformatiom = readUint16(data, position + 17); - pageInfo.lossless = !!(pageSegmentFlags & 1); - pageInfo.refinement = !!(pageSegmentFlags & 2); - pageInfo.defaultPixelValue = (pageSegmentFlags >> 2) & 1; - pageInfo.combinationOperator = (pageSegmentFlags >> 3) & 3; - pageInfo.requiresBuffer = !!(pageSegmentFlags & 32); - pageInfo.combinationOperatorOverride = !!(pageSegmentFlags & 64); - args = [pageInfo]; - break; - case 49: // EndOfPage - break; - case 50: // EndOfStripe - break; - case 51: // EndOfFile - break; - case 62: // 7.4.15 defines 2 extension types which - // are comments and can be ignored. - break; - default: - error('JBIG2 error: segment type ' + header.typeName + '(' + - header.type + ') is not implemented'); - } - var callbackName = 'on' + header.typeName; - if (callbackName in visitor) { - visitor[callbackName].apply(visitor, args); - } - } - - function processSegments(segments, visitor) { - for (var i = 0, ii = segments.length; i < ii; i++) { - processSegment(segments[i], visitor); - } - } - - function parseJbig2(data, start, end) { - var position = start; - if (data[position] !== 0x97 || data[position + 1] !== 0x4A || - data[position + 2] !== 0x42 || data[position + 3] !== 0x32 || - data[position + 4] !== 0x0D || data[position + 5] !== 0x0A || - data[position + 6] !== 0x1A || data[position + 7] !== 0x0A) { - error('JBIG2 error: invalid header'); - } - var header = {}; - position += 8; - var flags = data[position++]; - header.randomAccess = !(flags & 1); - if (!(flags & 2)) { - header.numberOfPages = readUint32(data, position); - position += 4; - } - var segments = readSegments(header, data, position, end); - error('Not implemented'); - // processSegments(segments, new SimpleSegmentVisitor()); - } - - function parseJbig2Chunks(chunks) { - var visitor = new SimpleSegmentVisitor(); - for (var i = 0, ii = chunks.length; i < ii; i++) { - var chunk = chunks[i]; - var segments = readSegments({}, chunk.data, chunk.start, chunk.end); - processSegments(segments, visitor); - } - return visitor.buffer; - } - - function SimpleSegmentVisitor() {} - - SimpleSegmentVisitor.prototype = { - onPageInformation: function SimpleSegmentVisitor_onPageInformation(info) { - this.currentPageInfo = info; - var rowSize = (info.width + 7) >> 3; - var buffer = new Uint8Array(rowSize * info.height); - // The contents of ArrayBuffers are initialized to 0. - // Fill the buffer with 0xFF only if info.defaultPixelValue is set - if (info.defaultPixelValue) { - for (var i = 0, ii = buffer.length; i < ii; i++) { - buffer[i] = 0xFF; - } - } - this.buffer = buffer; - }, - drawBitmap: function SimpleSegmentVisitor_drawBitmap(regionInfo, bitmap) { - var pageInfo = this.currentPageInfo; - var width = regionInfo.width, height = regionInfo.height; - var rowSize = (pageInfo.width + 7) >> 3; - var combinationOperator = pageInfo.combinationOperatorOverride ? - regionInfo.combinationOperator : pageInfo.combinationOperator; - var buffer = this.buffer; - var mask0 = 128 >> (regionInfo.x & 7); - var offset0 = regionInfo.y * rowSize + (regionInfo.x >> 3); - var i, j, mask, offset; - switch (combinationOperator) { - case 0: // OR - for (i = 0; i < height; i++) { - mask = mask0; - offset = offset0; - for (j = 0; j < width; j++) { - if (bitmap[i][j]) { - buffer[offset] |= mask; - } - mask >>= 1; - if (!mask) { - mask = 128; - offset++; - } - } - offset0 += rowSize; - } - break; - case 2: // XOR - for (i = 0; i < height; i++) { - mask = mask0; - offset = offset0; - for (j = 0; j < width; j++) { - if (bitmap[i][j]) { - buffer[offset] ^= mask; - } - mask >>= 1; - if (!mask) { - mask = 128; - offset++; - } - } - offset0 += rowSize; - } - break; - default: - error('JBIG2 error: operator ' + combinationOperator + - ' is not supported'); - } - }, - onImmediateGenericRegion: - function SimpleSegmentVisitor_onImmediateGenericRegion(region, data, - start, end) { - var regionInfo = region.info; - var decodingContext = new DecodingContext(data, start, end); - var bitmap = decodeBitmap(region.mmr, regionInfo.width, regionInfo.height, - region.template, region.prediction, null, - region.at, decodingContext); - this.drawBitmap(regionInfo, bitmap); - }, - onImmediateLosslessGenericRegion: - function SimpleSegmentVisitor_onImmediateLosslessGenericRegion() { - this.onImmediateGenericRegion.apply(this, arguments); - }, - onSymbolDictionary: - function SimpleSegmentVisitor_onSymbolDictionary(dictionary, - currentSegment, - referredSegments, - data, start, end) { - var huffmanTables; - if (dictionary.huffman) { - error('JBIG2 error: huffman is not supported'); - } - - // Combines exported symbols from all referred segments - var symbols = this.symbols; - if (!symbols) { - this.symbols = symbols = {}; - } - - var inputSymbols = []; - for (var i = 0, ii = referredSegments.length; i < ii; i++) { - inputSymbols = inputSymbols.concat(symbols[referredSegments[i]]); - } - - var decodingContext = new DecodingContext(data, start, end); - symbols[currentSegment] = decodeSymbolDictionary(dictionary.huffman, - dictionary.refinement, inputSymbols, dictionary.numberOfNewSymbols, - dictionary.numberOfExportedSymbols, huffmanTables, - dictionary.template, dictionary.at, - dictionary.refinementTemplate, dictionary.refinementAt, - decodingContext); - }, - onImmediateTextRegion: - function SimpleSegmentVisitor_onImmediateTextRegion(region, - referredSegments, - data, start, end) { - var regionInfo = region.info; - var huffmanTables; - - // Combines exported symbols from all referred segments - var symbols = this.symbols; - var inputSymbols = []; - for (var i = 0, ii = referredSegments.length; i < ii; i++) { - inputSymbols = inputSymbols.concat(symbols[referredSegments[i]]); - } - var symbolCodeLength = log2(inputSymbols.length); - - var decodingContext = new DecodingContext(data, start, end); - var bitmap = decodeTextRegion(region.huffman, region.refinement, - regionInfo.width, regionInfo.height, region.defaultPixelValue, - region.numberOfSymbolInstances, region.stripSize, inputSymbols, - symbolCodeLength, region.transposed, region.dsOffset, - region.referenceCorner, region.combinationOperator, huffmanTables, - region.refinementTemplate, region.refinementAt, decodingContext); - this.drawBitmap(regionInfo, bitmap); - }, - onImmediateLosslessTextRegion: - function SimpleSegmentVisitor_onImmediateLosslessTextRegion() { - this.onImmediateTextRegion.apply(this, arguments); - } - }; - - function Jbig2Image() {} - - Jbig2Image.prototype = { - parseChunks: function Jbig2Image_parseChunks(chunks) { - return parseJbig2Chunks(chunks); - } - }; - - return Jbig2Image; -})(); - - -var bidi = PDFJS.bidi = (function bidiClosure() { - // Character types for symbols from 0000 to 00FF. - var baseTypes = [ - 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'S', 'B', 'S', 'WS', - 'B', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', - 'BN', 'BN', 'B', 'B', 'B', 'S', 'WS', 'ON', 'ON', 'ET', 'ET', 'ET', 'ON', - 'ON', 'ON', 'ON', 'ON', 'ON', 'CS', 'ON', 'CS', 'ON', 'EN', 'EN', 'EN', - 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'ON', 'ON', 'ON', 'ON', 'ON', - 'ON', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'ON', 'ON', - 'ON', 'ON', 'ON', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'ON', 'ON', 'ON', 'ON', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'B', 'BN', - 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', - 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', - 'BN', 'CS', 'ON', 'ET', 'ET', 'ET', 'ET', 'ON', 'ON', 'ON', 'ON', 'L', 'ON', - 'ON', 'ON', 'ON', 'ON', 'ET', 'ET', 'EN', 'EN', 'ON', 'L', 'ON', 'ON', 'ON', - 'EN', 'L', 'ON', 'ON', 'ON', 'ON', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'L', 'L', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L' - ]; - - // Character types for symbols from 0600 to 06FF - var arabicTypes = [ - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'CS', 'AL', 'ON', 'ON', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', - 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', - 'AN', 'ET', 'AN', 'AN', 'AL', 'AL', 'AL', 'NSM', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', - 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'ON', 'NSM', - 'NSM', 'NSM', 'NSM', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL' - ]; - - function isOdd(i) { - return (i & 1) !== 0; - } - - function isEven(i) { - return (i & 1) === 0; - } - - function findUnequal(arr, start, value) { - for (var j = start, jj = arr.length; j < jj; ++j) { - if (arr[j] !== value) { - return j; - } - } - return j; - } - - function setValues(arr, start, end, value) { - for (var j = start; j < end; ++j) { - arr[j] = value; - } - } - - function reverseValues(arr, start, end) { - for (var i = start, j = end - 1; i < j; ++i, --j) { - var temp = arr[i]; - arr[i] = arr[j]; - arr[j] = temp; - } - } - - function createBidiText(str, isLTR, vertical) { - return { - str: str, - dir: (vertical ? 'ttb' : (isLTR ? 'ltr' : 'rtl')) - }; - } - - // These are used in bidi(), which is called frequently. We re-use them on - // each call to avoid unnecessary allocations. - var chars = []; - var types = []; - - function bidi(str, startLevel, vertical) { - var isLTR = true; - var strLength = str.length; - if (strLength === 0 || vertical) { - return createBidiText(str, isLTR, vertical); - } - - // Get types and fill arrays - chars.length = strLength; - types.length = strLength; - var numBidi = 0; - - var i, ii; - for (i = 0; i < strLength; ++i) { - chars[i] = str.charAt(i); - - var charCode = str.charCodeAt(i); - var charType = 'L'; - if (charCode <= 0x00ff) { - charType = baseTypes[charCode]; - } else if (0x0590 <= charCode && charCode <= 0x05f4) { - charType = 'R'; - } else if (0x0600 <= charCode && charCode <= 0x06ff) { - charType = arabicTypes[charCode & 0xff]; - } else if (0x0700 <= charCode && charCode <= 0x08AC) { - charType = 'AL'; - } - if (charType === 'R' || charType === 'AL' || charType === 'AN') { - numBidi++; - } - types[i] = charType; - } - - // Detect the bidi method - // - If there are no rtl characters then no bidi needed - // - If less than 30% chars are rtl then string is primarily ltr - // - If more than 30% chars are rtl then string is primarily rtl - if (numBidi === 0) { - isLTR = true; - return createBidiText(str, isLTR); - } - - if (startLevel === -1) { - if ((strLength / numBidi) < 0.3) { - isLTR = true; - startLevel = 0; - } else { - isLTR = false; - startLevel = 1; - } - } - - var levels = []; - for (i = 0; i < strLength; ++i) { - levels[i] = startLevel; - } - - /* - X1-X10: skip most of this, since we are NOT doing the embeddings. - */ - var e = (isOdd(startLevel) ? 'R' : 'L'); - var sor = e; - var eor = sor; - - /* - W1. Examine each non-spacing mark (NSM) in the level run, and change the - type of the NSM to the type of the previous character. If the NSM is at the - start of the level run, it will get the type of sor. - */ - var lastType = sor; - for (i = 0; i < strLength; ++i) { - if (types[i] === 'NSM') { - types[i] = lastType; - } else { - lastType = types[i]; - } - } - - /* - W2. Search backwards from each instance of a European number until the - first strong type (R, L, AL, or sor) is found. If an AL is found, change - the type of the European number to Arabic number. - */ - lastType = sor; - var t; - for (i = 0; i < strLength; ++i) { - t = types[i]; - if (t === 'EN') { - types[i] = (lastType === 'AL') ? 'AN' : 'EN'; - } else if (t === 'R' || t === 'L' || t === 'AL') { - lastType = t; - } - } - - /* - W3. Change all ALs to R. - */ - for (i = 0; i < strLength; ++i) { - t = types[i]; - if (t === 'AL') { - types[i] = 'R'; - } - } - - /* - W4. A single European separator between two European numbers changes to a - European number. A single common separator between two numbers of the same - type changes to that type: - */ - for (i = 1; i < strLength - 1; ++i) { - if (types[i] === 'ES' && types[i - 1] === 'EN' && types[i + 1] === 'EN') { - types[i] = 'EN'; - } - if (types[i] === 'CS' && - (types[i - 1] === 'EN' || types[i - 1] === 'AN') && - types[i + 1] === types[i - 1]) { - types[i] = types[i - 1]; - } - } - - /* - W5. A sequence of European terminators adjacent to European numbers changes - to all European numbers: - */ - for (i = 0; i < strLength; ++i) { - if (types[i] === 'EN') { - // do before - var j; - for (j = i - 1; j >= 0; --j) { - if (types[j] !== 'ET') { - break; - } - types[j] = 'EN'; - } - // do after - for (j = i + 1; j < strLength; --j) { - if (types[j] !== 'ET') { - break; - } - types[j] = 'EN'; - } - } - } - - /* - W6. Otherwise, separators and terminators change to Other Neutral: - */ - for (i = 0; i < strLength; ++i) { - t = types[i]; - if (t === 'WS' || t === 'ES' || t === 'ET' || t === 'CS') { - types[i] = 'ON'; - } - } - - /* - W7. Search backwards from each instance of a European number until the - first strong type (R, L, or sor) is found. If an L is found, then change - the type of the European number to L. - */ - lastType = sor; - for (i = 0; i < strLength; ++i) { - t = types[i]; - if (t === 'EN') { - types[i] = ((lastType === 'L') ? 'L' : 'EN'); - } else if (t === 'R' || t === 'L') { - lastType = t; - } - } - - /* - N1. A sequence of neutrals takes the direction of the surrounding strong - text if the text on both sides has the same direction. European and Arabic - numbers are treated as though they were R. Start-of-level-run (sor) and - end-of-level-run (eor) are used at level run boundaries. - */ - for (i = 0; i < strLength; ++i) { - if (types[i] === 'ON') { - var end = findUnequal(types, i + 1, 'ON'); - var before = sor; - if (i > 0) { - before = types[i - 1]; - } - - var after = eor; - if (end + 1 < strLength) { - after = types[end + 1]; - } - if (before !== 'L') { - before = 'R'; - } - if (after !== 'L') { - after = 'R'; - } - if (before === after) { - setValues(types, i, end, before); - } - i = end - 1; // reset to end (-1 so next iteration is ok) - } - } - - /* - N2. Any remaining neutrals take the embedding direction. - */ - for (i = 0; i < strLength; ++i) { - if (types[i] === 'ON') { - types[i] = e; - } - } - - /* - I1. For all characters with an even (left-to-right) embedding direction, - those of type R go up one level and those of type AN or EN go up two - levels. - I2. For all characters with an odd (right-to-left) embedding direction, - those of type L, EN or AN go up one level. - */ - for (i = 0; i < strLength; ++i) { - t = types[i]; - if (isEven(levels[i])) { - if (t === 'R') { - levels[i] += 1; - } else if (t === 'AN' || t === 'EN') { - levels[i] += 2; - } - } else { // isOdd - if (t === 'L' || t === 'AN' || t === 'EN') { - levels[i] += 1; - } - } - } - - /* - L1. On each line, reset the embedding level of the following characters to - the paragraph embedding level: - - segment separators, - paragraph separators, - any sequence of whitespace characters preceding a segment separator or - paragraph separator, and any sequence of white space characters at the end - of the line. - */ - - // don't bother as text is only single line - - /* - L2. From the highest level found in the text to the lowest odd level on - each line, reverse any contiguous sequence of characters that are at that - level or higher. - */ - - // find highest level & lowest odd level - var highestLevel = -1; - var lowestOddLevel = 99; - var level; - for (i = 0, ii = levels.length; i < ii; ++i) { - level = levels[i]; - if (highestLevel < level) { - highestLevel = level; - } - if (lowestOddLevel > level && isOdd(level)) { - lowestOddLevel = level; - } - } - - // now reverse between those limits - for (level = highestLevel; level >= lowestOddLevel; --level) { - // find segments to reverse - var start = -1; - for (i = 0, ii = levels.length; i < ii; ++i) { - if (levels[i] < level) { - if (start >= 0) { - reverseValues(chars, start, i); - start = -1; - } - } else if (start < 0) { - start = i; - } - } - if (start >= 0) { - reverseValues(chars, start, levels.length); - } - } - - /* - L3. Combining marks applied to a right-to-left base character will at this - point precede their base character. If the rendering engine expects them to - follow the base characters in the final display process, then the ordering - of the marks and the base character must be reversed. - */ - - // don't bother for now - - /* - L4. A character that possesses the mirrored property as specified by - Section 4.7, Mirrored, must be depicted by a mirrored glyph if the resolved - directionality of that character is R. - */ - - // don't mirror as characters are already mirrored in the pdf - - // Finally, return string - for (i = 0, ii = chars.length; i < ii; ++i) { - var ch = chars[i]; - if (ch === '<' || ch === '>') { - chars[i] = ''; - } - } - return createBidiText(chars.join(''), isLTR); - } - - return bidi; -})(); - - - -var MurmurHash3_64 = (function MurmurHash3_64Closure (seed) { - // Workaround for missing math precison in JS. - var MASK_HIGH = 0xffff0000; - var MASK_LOW = 0xffff; - - function MurmurHash3_64 (seed) { - var SEED = 0xc3d2e1f0; - this.h1 = seed ? seed & 0xffffffff : SEED; - this.h2 = seed ? seed & 0xffffffff : SEED; - } - - var alwaysUseUint32ArrayView = false; - // old webkits have issues with non-aligned arrays - try { - new Uint32Array(new Uint8Array(5).buffer, 0, 1); - } catch (e) { - alwaysUseUint32ArrayView = true; - } - - MurmurHash3_64.prototype = { - update: function MurmurHash3_64_update(input) { - var useUint32ArrayView = alwaysUseUint32ArrayView; - var i; - if (typeof input === 'string') { - var data = new Uint8Array(input.length * 2); - var length = 0; - for (i = 0; i < input.length; i++) { - var code = input.charCodeAt(i); - if (code <= 0xff) { - data[length++] = code; - } - else { - data[length++] = code >>> 8; - data[length++] = code & 0xff; - } - } - } else if (input instanceof Uint8Array) { - data = input; - length = data.length; - } else if (typeof input === 'object' && ('length' in input)) { - // processing regular arrays as well, e.g. for IE9 - data = input; - length = data.length; - useUint32ArrayView = true; - } else { - throw new Error('Wrong data format in MurmurHash3_64_update. ' + - 'Input must be a string or array.'); - } - - var blockCounts = length >> 2; - var tailLength = length - blockCounts * 4; - // we don't care about endianness here - var dataUint32 = useUint32ArrayView ? - new Uint32ArrayView(data, blockCounts) : - new Uint32Array(data.buffer, 0, blockCounts); - var k1 = 0; - var k2 = 0; - var h1 = this.h1; - var h2 = this.h2; - var C1 = 0xcc9e2d51; - var C2 = 0x1b873593; - var C1_LOW = C1 & MASK_LOW; - var C2_LOW = C2 & MASK_LOW; - - for (i = 0; i < blockCounts; i++) { - if (i & 1) { - k1 = dataUint32[i]; - k1 = (k1 * C1 & MASK_HIGH) | (k1 * C1_LOW & MASK_LOW); - k1 = k1 << 15 | k1 >>> 17; - k1 = (k1 * C2 & MASK_HIGH) | (k1 * C2_LOW & MASK_LOW); - h1 ^= k1; - h1 = h1 << 13 | h1 >>> 19; - h1 = h1 * 5 + 0xe6546b64; - } else { - k2 = dataUint32[i]; - k2 = (k2 * C1 & MASK_HIGH) | (k2 * C1_LOW & MASK_LOW); - k2 = k2 << 15 | k2 >>> 17; - k2 = (k2 * C2 & MASK_HIGH) | (k2 * C2_LOW & MASK_LOW); - h2 ^= k2; - h2 = h2 << 13 | h2 >>> 19; - h2 = h2 * 5 + 0xe6546b64; - } - } - - k1 = 0; - - switch (tailLength) { - case 3: - k1 ^= data[blockCounts * 4 + 2] << 16; - /* falls through */ - case 2: - k1 ^= data[blockCounts * 4 + 1] << 8; - /* falls through */ - case 1: - k1 ^= data[blockCounts * 4]; - /* falls through */ - k1 = (k1 * C1 & MASK_HIGH) | (k1 * C1_LOW & MASK_LOW); - k1 = k1 << 15 | k1 >>> 17; - k1 = (k1 * C2 & MASK_HIGH) | (k1 * C2_LOW & MASK_LOW); - if (blockCounts & 1) { - h1 ^= k1; - } else { - h2 ^= k1; - } - } - - this.h1 = h1; - this.h2 = h2; - return this; - }, - - hexdigest: function MurmurHash3_64_hexdigest () { - var h1 = this.h1; - var h2 = this.h2; - - h1 ^= h2 >>> 1; - h1 = (h1 * 0xed558ccd & MASK_HIGH) | (h1 * 0x8ccd & MASK_LOW); - h2 = (h2 * 0xff51afd7 & MASK_HIGH) | - (((h2 << 16 | h1 >>> 16) * 0xafd7ed55 & MASK_HIGH) >>> 16); - h1 ^= h2 >>> 1; - h1 = (h1 * 0x1a85ec53 & MASK_HIGH) | (h1 * 0xec53 & MASK_LOW); - h2 = (h2 * 0xc4ceb9fe & MASK_HIGH) | - (((h2 << 16 | h1 >>> 16) * 0xb9fe1a85 & MASK_HIGH) >>> 16); - h1 ^= h2 >>> 1; - - for (var i = 0, arr = [h1, h2], str = ''; i < arr.length; i++) { - var hex = (arr[i] >>> 0).toString(16); - while (hex.length < 8) { - hex = '0' + hex; - } - str += hex; - } - - return str; - } - }; - - return MurmurHash3_64; -})(); - - -}).call((typeof window === 'undefined') ? this : window); - -if (!PDFJS.workerSrc && typeof document !== 'undefined') { - // workerSrc is not set -- using last script url to define default location - PDFJS.workerSrc = (function () { - 'use strict'; - var pdfJsSrc = document.currentScript.src; - return pdfJsSrc && pdfJsSrc.replace(/\.js$/i, '.worker.js'); - })(); -} - - From 6cf847146a8448238ef1ea5e061146148d8c3c78 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 2 Mar 2017 09:33:08 +0000 Subject: [PATCH 2/3] delete pdfjs-1.3.91p1 --- .../js/libs/pdfjs-1.3.91p1/compatibility.js | 593 - .../web/public/js/libs/pdfjs-1.3.91p1/pdf.js | 9534 ---- .../js/libs/pdfjs-1.3.91p1/pdf.worker.js | 40698 ---------------- 3 files changed, 50825 deletions(-) delete mode 100644 services/web/public/js/libs/pdfjs-1.3.91p1/compatibility.js delete mode 100644 services/web/public/js/libs/pdfjs-1.3.91p1/pdf.js delete mode 100644 services/web/public/js/libs/pdfjs-1.3.91p1/pdf.worker.js diff --git a/services/web/public/js/libs/pdfjs-1.3.91p1/compatibility.js b/services/web/public/js/libs/pdfjs-1.3.91p1/compatibility.js deleted file mode 100644 index 1119a2742a..0000000000 --- a/services/web/public/js/libs/pdfjs-1.3.91p1/compatibility.js +++ /dev/null @@ -1,593 +0,0 @@ -/* Copyright 2012 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* globals VBArray, PDFJS */ - -'use strict'; - -// Initializing PDFJS global object here, it case if we need to change/disable -// some PDF.js features, e.g. range requests -if (typeof PDFJS === 'undefined') { - (typeof window !== 'undefined' ? window : this).PDFJS = {}; -} - -// Checking if the typed arrays are supported -// Support: iOS<6.0 (subarray), IE<10, Android<4.0 -(function checkTypedArrayCompatibility() { - if (typeof Uint8Array !== 'undefined') { - // Support: iOS<6.0 - if (typeof Uint8Array.prototype.subarray === 'undefined') { - Uint8Array.prototype.subarray = function subarray(start, end) { - return new Uint8Array(this.slice(start, end)); - }; - Float32Array.prototype.subarray = function subarray(start, end) { - return new Float32Array(this.slice(start, end)); - }; - } - - // Support: Android<4.1 - if (typeof Float64Array === 'undefined') { - window.Float64Array = Float32Array; - } - return; - } - - function subarray(start, end) { - return new TypedArray(this.slice(start, end)); - } - - function setArrayOffset(array, offset) { - if (arguments.length < 2) { - offset = 0; - } - for (var i = 0, n = array.length; i < n; ++i, ++offset) { - this[offset] = array[i] & 0xFF; - } - } - - function TypedArray(arg1) { - var result, i, n; - if (typeof arg1 === 'number') { - result = []; - for (i = 0; i < arg1; ++i) { - result[i] = 0; - } - } else if ('slice' in arg1) { - result = arg1.slice(0); - } else { - result = []; - for (i = 0, n = arg1.length; i < n; ++i) { - result[i] = arg1[i]; - } - } - - result.subarray = subarray; - result.buffer = result; - result.byteLength = result.length; - result.set = setArrayOffset; - - if (typeof arg1 === 'object' && arg1.buffer) { - result.buffer = arg1.buffer; - } - return result; - } - - window.Uint8Array = TypedArray; - window.Int8Array = TypedArray; - - // we don't need support for set, byteLength for 32-bit array - // so we can use the TypedArray as well - window.Uint32Array = TypedArray; - window.Int32Array = TypedArray; - window.Uint16Array = TypedArray; - window.Float32Array = TypedArray; - window.Float64Array = TypedArray; -})(); - -// URL = URL || webkitURL -// Support: Safari<7, Android 4.2+ -(function normalizeURLObject() { - if (!window.URL) { - window.URL = window.webkitURL; - } -})(); - -// Object.defineProperty()? -// Support: Android<4.0, Safari<5.1 -(function checkObjectDefinePropertyCompatibility() { - if (typeof Object.defineProperty !== 'undefined') { - var definePropertyPossible = true; - try { - // some browsers (e.g. safari) cannot use defineProperty() on DOM objects - // and thus the native version is not sufficient - Object.defineProperty(new Image(), 'id', { value: 'test' }); - // ... another test for android gb browser for non-DOM objects - var Test = function Test() {}; - Test.prototype = { get id() { } }; - Object.defineProperty(new Test(), 'id', - { value: '', configurable: true, enumerable: true, writable: false }); - } catch (e) { - definePropertyPossible = false; - } - if (definePropertyPossible) { - return; - } - } - - Object.defineProperty = function objectDefineProperty(obj, name, def) { - delete obj[name]; - if ('get' in def) { - obj.__defineGetter__(name, def['get']); - } - if ('set' in def) { - obj.__defineSetter__(name, def['set']); - } - if ('value' in def) { - obj.__defineSetter__(name, function objectDefinePropertySetter(value) { - this.__defineGetter__(name, function objectDefinePropertyGetter() { - return value; - }); - return value; - }); - obj[name] = def.value; - } - }; -})(); - - -// No XMLHttpRequest#response? -// Support: IE<11, Android <4.0 -(function checkXMLHttpRequestResponseCompatibility() { - var xhrPrototype = XMLHttpRequest.prototype; - var xhr = new XMLHttpRequest(); - if (!('overrideMimeType' in xhr)) { - // IE10 might have response, but not overrideMimeType - // Support: IE10 - Object.defineProperty(xhrPrototype, 'overrideMimeType', { - value: function xmlHttpRequestOverrideMimeType(mimeType) {} - }); - } - if ('responseType' in xhr) { - return; - } - - // The worker will be using XHR, so we can save time and disable worker. - PDFJS.disableWorker = true; - - Object.defineProperty(xhrPrototype, 'responseType', { - get: function xmlHttpRequestGetResponseType() { - return this._responseType || 'text'; - }, - set: function xmlHttpRequestSetResponseType(value) { - if (value === 'text' || value === 'arraybuffer') { - this._responseType = value; - if (value === 'arraybuffer' && - typeof this.overrideMimeType === 'function') { - this.overrideMimeType('text/plain; charset=x-user-defined'); - } - } - } - }); - - // Support: IE9 - if (typeof VBArray !== 'undefined') { - Object.defineProperty(xhrPrototype, 'response', { - get: function xmlHttpRequestResponseGet() { - if (this.responseType === 'arraybuffer') { - return new Uint8Array(new VBArray(this.responseBody).toArray()); - } else { - return this.responseText; - } - } - }); - return; - } - - Object.defineProperty(xhrPrototype, 'response', { - get: function xmlHttpRequestResponseGet() { - if (this.responseType !== 'arraybuffer') { - return this.responseText; - } - var text = this.responseText; - var i, n = text.length; - var result = new Uint8Array(n); - for (i = 0; i < n; ++i) { - result[i] = text.charCodeAt(i) & 0xFF; - } - return result.buffer; - } - }); -})(); - -// window.btoa (base64 encode function) ? -// Support: IE<10 -(function checkWindowBtoaCompatibility() { - if ('btoa' in window) { - return; - } - - var digits = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - - window.btoa = function windowBtoa(chars) { - var buffer = ''; - var i, n; - for (i = 0, n = chars.length; i < n; i += 3) { - var b1 = chars.charCodeAt(i) & 0xFF; - var b2 = chars.charCodeAt(i + 1) & 0xFF; - var b3 = chars.charCodeAt(i + 2) & 0xFF; - var d1 = b1 >> 2, d2 = ((b1 & 3) << 4) | (b2 >> 4); - var d3 = i + 1 < n ? ((b2 & 0xF) << 2) | (b3 >> 6) : 64; - var d4 = i + 2 < n ? (b3 & 0x3F) : 64; - buffer += (digits.charAt(d1) + digits.charAt(d2) + - digits.charAt(d3) + digits.charAt(d4)); - } - return buffer; - }; -})(); - -// window.atob (base64 encode function)? -// Support: IE<10 -(function checkWindowAtobCompatibility() { - if ('atob' in window) { - return; - } - - // https://github.com/davidchambers/Base64.js - var digits = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - window.atob = function (input) { - input = input.replace(/=+$/, ''); - if (input.length % 4 === 1) { - throw new Error('bad atob input'); - } - for ( - // initialize result and counters - var bc = 0, bs, buffer, idx = 0, output = ''; - // get next character - buffer = input.charAt(idx++); - // character found in table? - // initialize bit storage and add its ascii value - ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, - // and if not first of each 4 characters, - // convert the first 8 bits to one ascii character - bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 - ) { - // try to find character in table (0-63, not found => -1) - buffer = digits.indexOf(buffer); - } - return output; - }; -})(); - -// Function.prototype.bind? -// Support: Android<4.0, iOS<6.0 -(function checkFunctionPrototypeBindCompatibility() { - if (typeof Function.prototype.bind !== 'undefined') { - return; - } - - Function.prototype.bind = function functionPrototypeBind(obj) { - var fn = this, headArgs = Array.prototype.slice.call(arguments, 1); - var bound = function functionPrototypeBindBound() { - var args = headArgs.concat(Array.prototype.slice.call(arguments)); - return fn.apply(obj, args); - }; - return bound; - }; -})(); - -// HTMLElement dataset property -// Support: IE<11, Safari<5.1, Android<4.0 -(function checkDatasetProperty() { - var div = document.createElement('div'); - if ('dataset' in div) { - return; // dataset property exists - } - - Object.defineProperty(HTMLElement.prototype, 'dataset', { - get: function() { - if (this._dataset) { - return this._dataset; - } - - var dataset = {}; - for (var j = 0, jj = this.attributes.length; j < jj; j++) { - var attribute = this.attributes[j]; - if (attribute.name.substring(0, 5) !== 'data-') { - continue; - } - var key = attribute.name.substring(5).replace(/\-([a-z])/g, - function(all, ch) { - return ch.toUpperCase(); - }); - dataset[key] = attribute.value; - } - - Object.defineProperty(this, '_dataset', { - value: dataset, - writable: false, - enumerable: false - }); - return dataset; - }, - enumerable: true - }); -})(); - -// HTMLElement classList property -// Support: IE<10, Android<4.0, iOS<5.0 -(function checkClassListProperty() { - var div = document.createElement('div'); - if ('classList' in div) { - return; // classList property exists - } - - function changeList(element, itemName, add, remove) { - var s = element.className || ''; - var list = s.split(/\s+/g); - if (list[0] === '') { - list.shift(); - } - var index = list.indexOf(itemName); - if (index < 0 && add) { - list.push(itemName); - } - if (index >= 0 && remove) { - list.splice(index, 1); - } - element.className = list.join(' '); - return (index >= 0); - } - - var classListPrototype = { - add: function(name) { - changeList(this.element, name, true, false); - }, - contains: function(name) { - return changeList(this.element, name, false, false); - }, - remove: function(name) { - changeList(this.element, name, false, true); - }, - toggle: function(name) { - changeList(this.element, name, true, true); - } - }; - - Object.defineProperty(HTMLElement.prototype, 'classList', { - get: function() { - if (this._classList) { - return this._classList; - } - - var classList = Object.create(classListPrototype, { - element: { - value: this, - writable: false, - enumerable: true - } - }); - Object.defineProperty(this, '_classList', { - value: classList, - writable: false, - enumerable: false - }); - return classList; - }, - enumerable: true - }); -})(); - -// Check console compatibility -// In older IE versions the console object is not available -// unless console is open. -// Support: IE<10 -(function checkConsoleCompatibility() { - if (!('console' in window)) { - window.console = { - log: function() {}, - error: function() {}, - warn: function() {} - }; - } else if (!('bind' in console.log)) { - // native functions in IE9 might not have bind - console.log = (function(fn) { - return function(msg) { return fn(msg); }; - })(console.log); - console.error = (function(fn) { - return function(msg) { return fn(msg); }; - })(console.error); - console.warn = (function(fn) { - return function(msg) { return fn(msg); }; - })(console.warn); - } -})(); - -// Check onclick compatibility in Opera -// Support: Opera<15 -(function checkOnClickCompatibility() { - // workaround for reported Opera bug DSK-354448: - // onclick fires on disabled buttons with opaque content - function ignoreIfTargetDisabled(event) { - if (isDisabled(event.target)) { - event.stopPropagation(); - } - } - function isDisabled(node) { - return node.disabled || (node.parentNode && isDisabled(node.parentNode)); - } - if (navigator.userAgent.indexOf('Opera') !== -1) { - // use browser detection since we cannot feature-check this bug - document.addEventListener('click', ignoreIfTargetDisabled, true); - } -})(); - -// Checks if possible to use URL.createObjectURL() -// Support: IE -(function checkOnBlobSupport() { - // sometimes IE loosing the data created with createObjectURL(), see #3977 - if (navigator.userAgent.indexOf('Trident') >= 0) { - PDFJS.disableCreateObjectURL = true; - } -})(); - -// Checks if navigator.language is supported -(function checkNavigatorLanguage() { - if ('language' in navigator) { - return; - } - PDFJS.locale = navigator.userLanguage || 'en-US'; -})(); - -(function checkRangeRequests() { - // Safari has issues with cached range requests see: - // https://github.com/mozilla/pdf.js/issues/3260 - // Last tested with version 6.0.4. - // Support: Safari 6.0+ - var isSafari = Object.prototype.toString.call( - window.HTMLElement).indexOf('Constructor') > 0; - - // Older versions of Android (pre 3.0) has issues with range requests, see: - // https://github.com/mozilla/pdf.js/issues/3381. - // Make sure that we only match webkit-based Android browsers, - // since Firefox/Fennec works as expected. - // Support: Android<3.0 - var regex = /Android\s[0-2][^\d]/; - var isOldAndroid = regex.test(navigator.userAgent); - - // Range requests are broken in Chrome 39 and 40, https://crbug.com/442318 - var isChromeWithRangeBug = /Chrome\/(39|40)\./.test(navigator.userAgent); - - if (isSafari || isOldAndroid || isChromeWithRangeBug) { - PDFJS.disableRange = true; - PDFJS.disableStream = true; - } -})(); - -// Check if the browser supports manipulation of the history. -// Support: IE<10, Android<4.2 -(function checkHistoryManipulation() { - // Android 2.x has so buggy pushState support that it was removed in - // Android 3.0 and restored as late as in Android 4.2. - // Support: Android 2.x - if (!history.pushState || navigator.userAgent.indexOf('Android 2.') >= 0) { - PDFJS.disableHistory = true; - } -})(); - -// Support: IE<11, Chrome<21, Android<4.4, Safari<6 -(function checkSetPresenceInImageData() { - // IE < 11 will use window.CanvasPixelArray which lacks set function. - if (window.CanvasPixelArray) { - if (typeof window.CanvasPixelArray.prototype.set !== 'function') { - window.CanvasPixelArray.prototype.set = function(arr) { - for (var i = 0, ii = this.length; i < ii; i++) { - this[i] = arr[i]; - } - }; - } - } else { - // Old Chrome and Android use an inaccessible CanvasPixelArray prototype. - // Because we cannot feature detect it, we rely on user agent parsing. - var polyfill = false, versionMatch; - if (navigator.userAgent.indexOf('Chrom') >= 0) { - versionMatch = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./); - // Chrome < 21 lacks the set function. - polyfill = versionMatch && parseInt(versionMatch[2]) < 21; - } else if (navigator.userAgent.indexOf('Android') >= 0) { - // Android < 4.4 lacks the set function. - // Android >= 4.4 will contain Chrome in the user agent, - // thus pass the Chrome check above and not reach this block. - polyfill = /Android\s[0-4][^\d]/g.test(navigator.userAgent); - } else if (navigator.userAgent.indexOf('Safari') >= 0) { - versionMatch = navigator.userAgent. - match(/Version\/([0-9]+)\.([0-9]+)\.([0-9]+) Safari\//); - // Safari < 6 lacks the set function. - polyfill = versionMatch && parseInt(versionMatch[1]) < 6; - } - - if (polyfill) { - var contextPrototype = window.CanvasRenderingContext2D.prototype; - var createImageData = contextPrototype.createImageData; - contextPrototype.createImageData = function(w, h) { - var imageData = createImageData.call(this, w, h); - imageData.data.set = function(arr) { - for (var i = 0, ii = this.length; i < ii; i++) { - this[i] = arr[i]; - } - }; - return imageData; - }; - // this closure will be kept referenced, so clear its vars - contextPrototype = null; - } - } -})(); - -// Support: IE<10, Android<4.0, iOS -(function checkRequestAnimationFrame() { - function fakeRequestAnimationFrame(callback) { - window.setTimeout(callback, 20); - } - - var isIOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent); - if (isIOS) { - // requestAnimationFrame on iOS is broken, replacing with fake one. - window.requestAnimationFrame = fakeRequestAnimationFrame; - return; - } - if ('requestAnimationFrame' in window) { - return; - } - window.requestAnimationFrame = - window.mozRequestAnimationFrame || - window.webkitRequestAnimationFrame || - fakeRequestAnimationFrame; -})(); - -(function checkCanvasSizeLimitation() { - var isIOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent); - var isAndroid = /Android/g.test(navigator.userAgent); - if (isIOS || isAndroid) { - // 5MP - PDFJS.maxCanvasPixels = 5242880; - } -})(); - -// Disable fullscreen support for certain problematic configurations. -// Support: IE11+ (when embedded). -(function checkFullscreenSupport() { - var isEmbeddedIE = (navigator.userAgent.indexOf('Trident') >= 0 && - window.parent !== window); - if (isEmbeddedIE) { - PDFJS.disableFullscreen = true; - } -})(); - -// Provides document.currentScript support -// Support: IE, Chrome<29. -(function checkCurrentScript() { - if ('currentScript' in document) { - return; - } - Object.defineProperty(document, 'currentScript', { - get: function () { - var scripts = document.getElementsByTagName('script'); - return scripts[scripts.length - 1]; - }, - enumerable: true, - configurable: true - }); -})(); diff --git a/services/web/public/js/libs/pdfjs-1.3.91p1/pdf.js b/services/web/public/js/libs/pdfjs-1.3.91p1/pdf.js deleted file mode 100644 index 5079c5dcbf..0000000000 --- a/services/web/public/js/libs/pdfjs-1.3.91p1/pdf.js +++ /dev/null @@ -1,9534 +0,0 @@ -/* Copyright 2012 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/*jshint globalstrict: false */ -/* globals PDFJS */ - -// Initializing PDFJS global object (if still undefined) -if (typeof PDFJS === 'undefined') { - (typeof window !== 'undefined' ? window : this).PDFJS = {}; -} - -PDFJS.version = '1.3.91'; -PDFJS.build = 'd1e83b5'; - -(function pdfjsWrapper() { - // Use strict in our context only - users might not want it - 'use strict'; - - - -var globalScope = (typeof window === 'undefined') ? this : window; - -var isWorker = (typeof window === 'undefined'); - -var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; - -var TextRenderingMode = { - FILL: 0, - STROKE: 1, - FILL_STROKE: 2, - INVISIBLE: 3, - FILL_ADD_TO_PATH: 4, - STROKE_ADD_TO_PATH: 5, - FILL_STROKE_ADD_TO_PATH: 6, - ADD_TO_PATH: 7, - FILL_STROKE_MASK: 3, - ADD_TO_PATH_FLAG: 4 -}; - -var ImageKind = { - GRAYSCALE_1BPP: 1, - RGB_24BPP: 2, - RGBA_32BPP: 3 -}; - -var AnnotationType = { - TEXT: 1, - LINK: 2, - FREETEXT: 3, - LINE: 4, - SQUARE: 5, - CIRCLE: 6, - POLYGON: 7, - POLYLINE: 8, - HIGHLIGHT: 9, - UNDERLINE: 10, - SQUIGGLY: 11, - STRIKEOUT: 12, - STAMP: 13, - CARET: 14, - INK: 15, - POPUP: 16, - FILEATTACHMENT: 17, - SOUND: 18, - MOVIE: 19, - WIDGET: 20, - SCREEN: 21, - PRINTERMARK: 22, - TRAPNET: 23, - WATERMARK: 24, - THREED: 25, - REDACT: 26 -}; - -var AnnotationFlag = { - INVISIBLE: 0x01, - HIDDEN: 0x02, - PRINT: 0x04, - NOZOOM: 0x08, - NOROTATE: 0x10, - NOVIEW: 0x20, - READONLY: 0x40, - LOCKED: 0x80, - TOGGLENOVIEW: 0x100, - LOCKEDCONTENTS: 0x200 -}; - -var AnnotationBorderStyleType = { - SOLID: 1, - DASHED: 2, - BEVELED: 3, - INSET: 4, - UNDERLINE: 5 -}; - -var StreamType = { - UNKNOWN: 0, - FLATE: 1, - LZW: 2, - DCT: 3, - JPX: 4, - JBIG: 5, - A85: 6, - AHX: 7, - CCF: 8, - RL: 9 -}; - -var FontType = { - UNKNOWN: 0, - TYPE1: 1, - TYPE1C: 2, - CIDFONTTYPE0: 3, - CIDFONTTYPE0C: 4, - TRUETYPE: 5, - CIDFONTTYPE2: 6, - TYPE3: 7, - OPENTYPE: 8, - TYPE0: 9, - MMTYPE1: 10 -}; - -// 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.PDFJS) { - globalScope.PDFJS = {}; -} - -globalScope.PDFJS.pdfBug = false; - -PDFJS.VERBOSITY_LEVELS = { - errors: 0, - warnings: 1, - infos: 5 -}; - -// All the possible operations for an operator list. -var OPS = PDFJS.OPS = { - // Intentionally start from 1 so it is easy to spot bad operators that will be - // 0's. - dependency: 1, - setLineWidth: 2, - setLineCap: 3, - setLineJoin: 4, - setMiterLimit: 5, - setDash: 6, - setRenderingIntent: 7, - setFlatness: 8, - setGState: 9, - save: 10, - restore: 11, - transform: 12, - moveTo: 13, - lineTo: 14, - curveTo: 15, - curveTo2: 16, - curveTo3: 17, - closePath: 18, - rectangle: 19, - stroke: 20, - closeStroke: 21, - fill: 22, - eoFill: 23, - fillStroke: 24, - eoFillStroke: 25, - closeFillStroke: 26, - closeEOFillStroke: 27, - endPath: 28, - clip: 29, - eoClip: 30, - beginText: 31, - endText: 32, - setCharSpacing: 33, - setWordSpacing: 34, - setHScale: 35, - setLeading: 36, - setFont: 37, - setTextRenderingMode: 38, - setTextRise: 39, - moveText: 40, - setLeadingMoveText: 41, - setTextMatrix: 42, - nextLine: 43, - showText: 44, - showSpacedText: 45, - nextLineShowText: 46, - nextLineSetSpacingShowText: 47, - setCharWidth: 48, - setCharWidthAndBounds: 49, - setStrokeColorSpace: 50, - setFillColorSpace: 51, - setStrokeColor: 52, - setStrokeColorN: 53, - setFillColor: 54, - setFillColorN: 55, - setStrokeGray: 56, - setFillGray: 57, - setStrokeRGBColor: 58, - setFillRGBColor: 59, - setStrokeCMYKColor: 60, - setFillCMYKColor: 61, - shadingFill: 62, - beginInlineImage: 63, - beginImageData: 64, - endInlineImage: 65, - paintXObject: 66, - markPoint: 67, - markPointProps: 68, - beginMarkedContent: 69, - beginMarkedContentProps: 70, - endMarkedContent: 71, - beginCompat: 72, - endCompat: 73, - paintFormXObjectBegin: 74, - paintFormXObjectEnd: 75, - beginGroup: 76, - endGroup: 77, - beginAnnotations: 78, - endAnnotations: 79, - beginAnnotation: 80, - endAnnotation: 81, - paintJpegXObject: 82, - paintImageMaskXObject: 83, - paintImageMaskXObjectGroup: 84, - paintImageXObject: 85, - paintInlineImageXObject: 86, - paintInlineImageXObjectGroup: 87, - paintImageXObjectRepeat: 88, - paintImageMaskXObjectRepeat: 89, - paintSolidColorImageMask: 90, - constructPath: 91 -}; - -// A notice for devs. These are good for things that are helpful to devs, such -// as warning that Workers were disabled, which is important to devs but not -// end users. -function info(msg) { - if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.infos) { - console.log('Info: ' + msg); - } -} - -// Non-fatal warnings. -function warn(msg) { - if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.warnings) { - console.log('Warning: ' + msg); - } -} - -// Deprecated API function -- treated as warnings. -function deprecated(details) { - warn('Deprecated API usage: ' + details); -} - -// Fatal errors that should trigger the fallback UI and halt execution by -// throwing an exception. -function error(msg) { - if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.errors) { - console.log('Error: ' + msg); - console.log(backtrace()); - } - throw new Error(msg); -} - -function backtrace() { - try { - throw new Error(); - } catch (e) { - return e.stack ? e.stack.split('\n').slice(2).join('\n') : ''; - } -} - -function assert(cond, msg) { - if (!cond) { - error(msg); - } -} - -var UNSUPPORTED_FEATURES = PDFJS.UNSUPPORTED_FEATURES = { - unknown: 'unknown', - forms: 'forms', - javaScript: 'javaScript', - smask: 'smask', - shadingPattern: 'shadingPattern', - font: 'font' -}; - -// Combines two URLs. The baseUrl shall be absolute URL. If the url is an -// absolute URL, it will be returned as is. -function combineUrl(baseUrl, url) { - if (!url) { - return baseUrl; - } - return new URL(url, baseUrl).href; -} - -// Validates if URL is safe and allowed, e.g. to avoid XSS. -function isValidUrl(url, allowRelative) { - if (!url) { - return false; - } - // RFC 3986 (http://tools.ietf.org/html/rfc3986#section-3.1) - // scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - var protocol = /^[a-z][a-z0-9+\-.]*(?=:)/i.exec(url); - if (!protocol) { - return allowRelative; - } - protocol = protocol[0].toLowerCase(); - switch (protocol) { - case 'http': - case 'https': - case 'ftp': - case 'mailto': - case 'tel': - return true; - default: - return false; - } -} -PDFJS.isValidUrl = isValidUrl; - -function shadow(obj, prop, value) { - Object.defineProperty(obj, prop, { value: value, - enumerable: true, - configurable: true, - writable: false }); - return value; -} -PDFJS.shadow = shadow; - -var LinkTarget = PDFJS.LinkTarget = { - NONE: 0, // Default value. - SELF: 1, - BLANK: 2, - PARENT: 3, - TOP: 4, -}; -var LinkTargetStringMap = [ - '', - '_self', - '_blank', - '_parent', - '_top' -]; - -function isExternalLinkTargetSet() { - if (PDFJS.openExternalLinksInNewWindow) { - deprecated('PDFJS.openExternalLinksInNewWindow, please use ' + - '"PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK" instead.'); - if (PDFJS.externalLinkTarget === LinkTarget.NONE) { - PDFJS.externalLinkTarget = LinkTarget.BLANK; - } - // Reset the deprecated parameter, to suppress further warnings. - PDFJS.openExternalLinksInNewWindow = false; - } - switch (PDFJS.externalLinkTarget) { - case LinkTarget.NONE: - return false; - case LinkTarget.SELF: - case LinkTarget.BLANK: - case LinkTarget.PARENT: - case LinkTarget.TOP: - return true; - } - warn('PDFJS.externalLinkTarget is invalid: ' + PDFJS.externalLinkTarget); - // Reset the external link target, to suppress further warnings. - PDFJS.externalLinkTarget = LinkTarget.NONE; - return false; -} -PDFJS.isExternalLinkTargetSet = isExternalLinkTargetSet; - -var PasswordResponses = PDFJS.PasswordResponses = { - NEED_PASSWORD: 1, - INCORRECT_PASSWORD: 2 -}; - -var PasswordException = (function PasswordExceptionClosure() { - function PasswordException(msg, code) { - this.name = 'PasswordException'; - this.message = msg; - this.code = code; - } - - PasswordException.prototype = new Error(); - PasswordException.constructor = PasswordException; - - return PasswordException; -})(); -PDFJS.PasswordException = PasswordException; - -var UnknownErrorException = (function UnknownErrorExceptionClosure() { - function UnknownErrorException(msg, details) { - this.name = 'UnknownErrorException'; - this.message = msg; - this.details = details; - } - - UnknownErrorException.prototype = new Error(); - UnknownErrorException.constructor = UnknownErrorException; - - return UnknownErrorException; -})(); -PDFJS.UnknownErrorException = UnknownErrorException; - -var InvalidPDFException = (function InvalidPDFExceptionClosure() { - function InvalidPDFException(msg) { - this.name = 'InvalidPDFException'; - this.message = msg; - } - - InvalidPDFException.prototype = new Error(); - InvalidPDFException.constructor = InvalidPDFException; - - return InvalidPDFException; -})(); -PDFJS.InvalidPDFException = InvalidPDFException; - -var MissingPDFException = (function MissingPDFExceptionClosure() { - function MissingPDFException(msg) { - this.name = 'MissingPDFException'; - this.message = msg; - } - - MissingPDFException.prototype = new Error(); - MissingPDFException.constructor = MissingPDFException; - - return MissingPDFException; -})(); -PDFJS.MissingPDFException = MissingPDFException; - -var UnexpectedResponseException = - (function UnexpectedResponseExceptionClosure() { - function UnexpectedResponseException(msg, status) { - this.name = 'UnexpectedResponseException'; - this.message = msg; - this.status = status; - } - - UnexpectedResponseException.prototype = new Error(); - UnexpectedResponseException.constructor = UnexpectedResponseException; - - return UnexpectedResponseException; -})(); -PDFJS.UnexpectedResponseException = UnexpectedResponseException; - -var NotImplementedException = (function NotImplementedExceptionClosure() { - function NotImplementedException(msg) { - this.message = msg; - } - - NotImplementedException.prototype = new Error(); - NotImplementedException.prototype.name = 'NotImplementedException'; - NotImplementedException.constructor = NotImplementedException; - - return NotImplementedException; -})(); - -var MissingDataException = (function MissingDataExceptionClosure() { - function MissingDataException(begin, end) { - this.begin = begin; - this.end = end; - this.message = 'Missing data [' + begin + ', ' + end + ')'; - } - - MissingDataException.prototype = new Error(); - MissingDataException.prototype.name = 'MissingDataException'; - MissingDataException.constructor = MissingDataException; - - return MissingDataException; -})(); - -var XRefParseException = (function XRefParseExceptionClosure() { - function XRefParseException(msg) { - this.message = msg; - } - - XRefParseException.prototype = new Error(); - XRefParseException.prototype.name = 'XRefParseException'; - XRefParseException.constructor = XRefParseException; - - return XRefParseException; -})(); - - -function bytesToString(bytes) { - assert(bytes !== null && typeof bytes === 'object' && - bytes.length !== undefined, 'Invalid argument for bytesToString'); - var length = bytes.length; - var MAX_ARGUMENT_COUNT = 8192; - if (length < MAX_ARGUMENT_COUNT) { - return String.fromCharCode.apply(null, bytes); - } - var strBuf = []; - for (var i = 0; i < length; i += MAX_ARGUMENT_COUNT) { - var chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); - var chunk = bytes.subarray(i, chunkEnd); - strBuf.push(String.fromCharCode.apply(null, chunk)); - } - return strBuf.join(''); -} - -function stringToBytes(str) { - assert(typeof str === 'string', 'Invalid argument for stringToBytes'); - var length = str.length; - var bytes = new Uint8Array(length); - for (var i = 0; i < length; ++i) { - bytes[i] = str.charCodeAt(i) & 0xFF; - } - return bytes; -} - -function string32(value) { - return String.fromCharCode((value >> 24) & 0xff, (value >> 16) & 0xff, - (value >> 8) & 0xff, value & 0xff); -} - -function log2(x) { - var n = 1, i = 0; - while (x > n) { - n <<= 1; - i++; - } - return i; -} - -function readInt8(data, start) { - return (data[start] << 24) >> 24; -} - -function readUint16(data, offset) { - return (data[offset] << 8) | data[offset + 1]; -} - -function readUint32(data, offset) { - return ((data[offset] << 24) | (data[offset + 1] << 16) | - (data[offset + 2] << 8) | data[offset + 3]) >>> 0; -} - -// Lazy test the endianness of the platform -// NOTE: This will be 'true' for simulated TypedArrays -function isLittleEndian() { - var buffer8 = new Uint8Array(2); - buffer8[0] = 1; - var buffer16 = new Uint16Array(buffer8.buffer); - return (buffer16[0] === 1); -} - -Object.defineProperty(PDFJS, 'isLittleEndian', { - configurable: true, - get: function PDFJS_isLittleEndian() { - return shadow(PDFJS, 'isLittleEndian', isLittleEndian()); - } -}); - - // Lazy test if the userAgent support CanvasTypedArrays -function hasCanvasTypedArrays() { - var canvas = document.createElement('canvas'); - canvas.width = canvas.height = 1; - var ctx = canvas.getContext('2d'); - var imageData = ctx.createImageData(1, 1); - return (typeof imageData.data.buffer !== 'undefined'); -} - -Object.defineProperty(PDFJS, 'hasCanvasTypedArrays', { - configurable: true, - get: function PDFJS_hasCanvasTypedArrays() { - return shadow(PDFJS, 'hasCanvasTypedArrays', hasCanvasTypedArrays()); - } -}); - -var Uint32ArrayView = (function Uint32ArrayViewClosure() { - - function Uint32ArrayView(buffer, length) { - this.buffer = buffer; - this.byteLength = buffer.length; - this.length = length === undefined ? (this.byteLength >> 2) : length; - ensureUint32ArrayViewProps(this.length); - } - Uint32ArrayView.prototype = Object.create(null); - - var uint32ArrayViewSetters = 0; - function createUint32ArrayProp(index) { - return { - get: function () { - var buffer = this.buffer, offset = index << 2; - return (buffer[offset] | (buffer[offset + 1] << 8) | - (buffer[offset + 2] << 16) | (buffer[offset + 3] << 24)) >>> 0; - }, - set: function (value) { - var buffer = this.buffer, offset = index << 2; - buffer[offset] = value & 255; - buffer[offset + 1] = (value >> 8) & 255; - buffer[offset + 2] = (value >> 16) & 255; - buffer[offset + 3] = (value >>> 24) & 255; - } - }; - } - - function ensureUint32ArrayViewProps(length) { - while (uint32ArrayViewSetters < length) { - Object.defineProperty(Uint32ArrayView.prototype, - uint32ArrayViewSetters, - createUint32ArrayProp(uint32ArrayViewSetters)); - uint32ArrayViewSetters++; - } - } - - return Uint32ArrayView; -})(); - -var IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; - -var Util = PDFJS.Util = (function UtilClosure() { - function Util() {} - - var rgbBuf = ['rgb(', 0, ',', 0, ',', 0, ')']; - - // makeCssRgb() can be called thousands of times. Using |rgbBuf| avoids - // creating many intermediate strings. - Util.makeCssRgb = function Util_makeCssRgb(r, g, b) { - rgbBuf[1] = r; - rgbBuf[3] = g; - rgbBuf[5] = b; - return rgbBuf.join(''); - }; - - // Concatenates two transformation matrices together and returns the result. - Util.transform = function Util_transform(m1, m2) { - return [ - m1[0] * m2[0] + m1[2] * m2[1], - m1[1] * m2[0] + m1[3] * m2[1], - m1[0] * m2[2] + m1[2] * m2[3], - m1[1] * m2[2] + m1[3] * m2[3], - m1[0] * m2[4] + m1[2] * m2[5] + m1[4], - m1[1] * m2[4] + m1[3] * m2[5] + m1[5] - ]; - }; - - // For 2d affine transforms - Util.applyTransform = function Util_applyTransform(p, m) { - var xt = p[0] * m[0] + p[1] * m[2] + m[4]; - var yt = p[0] * m[1] + p[1] * m[3] + m[5]; - return [xt, yt]; - }; - - Util.applyInverseTransform = function Util_applyInverseTransform(p, m) { - var d = m[0] * m[3] - m[1] * m[2]; - var xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; - var yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; - return [xt, yt]; - }; - - // Applies the transform to the rectangle and finds the minimum axially - // aligned bounding box. - Util.getAxialAlignedBoundingBox = - function Util_getAxialAlignedBoundingBox(r, m) { - - var p1 = Util.applyTransform(r, m); - var p2 = Util.applyTransform(r.slice(2, 4), m); - var p3 = Util.applyTransform([r[0], r[3]], m); - var p4 = Util.applyTransform([r[2], r[1]], m); - return [ - Math.min(p1[0], p2[0], p3[0], p4[0]), - Math.min(p1[1], p2[1], p3[1], p4[1]), - Math.max(p1[0], p2[0], p3[0], p4[0]), - Math.max(p1[1], p2[1], p3[1], p4[1]) - ]; - }; - - Util.inverseTransform = function Util_inverseTransform(m) { - var d = m[0] * m[3] - m[1] * m[2]; - return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, - (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d]; - }; - - // Apply a generic 3d matrix M on a 3-vector v: - // | a b c | | X | - // | d e f | x | Y | - // | g h i | | Z | - // M is assumed to be serialized as [a,b,c,d,e,f,g,h,i], - // with v as [X,Y,Z] - Util.apply3dTransform = function Util_apply3dTransform(m, v) { - return [ - m[0] * v[0] + m[1] * v[1] + m[2] * v[2], - m[3] * v[0] + m[4] * v[1] + m[5] * v[2], - m[6] * v[0] + m[7] * v[1] + m[8] * v[2] - ]; - }; - - // This calculation uses Singular Value Decomposition. - // The SVD can be represented with formula A = USV. We are interested in the - // matrix S here because it represents the scale values. - Util.singularValueDecompose2dScale = - function Util_singularValueDecompose2dScale(m) { - - var transpose = [m[0], m[2], m[1], m[3]]; - - // Multiply matrix m with its transpose. - var a = m[0] * transpose[0] + m[1] * transpose[2]; - var b = m[0] * transpose[1] + m[1] * transpose[3]; - var c = m[2] * transpose[0] + m[3] * transpose[2]; - var d = m[2] * transpose[1] + m[3] * transpose[3]; - - // Solve the second degree polynomial to get roots. - var first = (a + d) / 2; - var second = Math.sqrt((a + d) * (a + d) - 4 * (a * d - c * b)) / 2; - var sx = first + second || 1; - var sy = first - second || 1; - - // Scale values are the square roots of the eigenvalues. - return [Math.sqrt(sx), Math.sqrt(sy)]; - }; - - // Normalize rectangle rect=[x1, y1, x2, y2] so that (x1,y1) < (x2,y2) - // For coordinate systems whose origin lies in the bottom-left, this - // means normalization to (BL,TR) ordering. For systems with origin in the - // top-left, this means (TL,BR) ordering. - Util.normalizeRect = function Util_normalizeRect(rect) { - var r = rect.slice(0); // clone rect - if (rect[0] > rect[2]) { - r[0] = rect[2]; - r[2] = rect[0]; - } - if (rect[1] > rect[3]) { - r[1] = rect[3]; - r[3] = rect[1]; - } - return r; - }; - - // Returns a rectangle [x1, y1, x2, y2] corresponding to the - // intersection of rect1 and rect2. If no intersection, returns 'false' - // The rectangle coordinates of rect1, rect2 should be [x1, y1, x2, y2] - Util.intersect = function Util_intersect(rect1, rect2) { - function compare(a, b) { - return a - b; - } - - // Order points along the axes - var orderedX = [rect1[0], rect1[2], rect2[0], rect2[2]].sort(compare), - orderedY = [rect1[1], rect1[3], rect2[1], rect2[3]].sort(compare), - result = []; - - rect1 = Util.normalizeRect(rect1); - rect2 = Util.normalizeRect(rect2); - - // X: first and second points belong to different rectangles? - if ((orderedX[0] === rect1[0] && orderedX[1] === rect2[0]) || - (orderedX[0] === rect2[0] && orderedX[1] === rect1[0])) { - // Intersection must be between second and third points - result[0] = orderedX[1]; - result[2] = orderedX[2]; - } else { - return false; - } - - // Y: first and second points belong to different rectangles? - if ((orderedY[0] === rect1[1] && orderedY[1] === rect2[1]) || - (orderedY[0] === rect2[1] && orderedY[1] === rect1[1])) { - // Intersection must be between second and third points - result[1] = orderedY[1]; - result[3] = orderedY[2]; - } else { - return false; - } - - return result; - }; - - Util.sign = function Util_sign(num) { - return num < 0 ? -1 : 1; - }; - - Util.appendToArray = function Util_appendToArray(arr1, arr2) { - Array.prototype.push.apply(arr1, arr2); - }; - - Util.prependToArray = function Util_prependToArray(arr1, arr2) { - Array.prototype.unshift.apply(arr1, arr2); - }; - - Util.extendObj = function extendObj(obj1, obj2) { - for (var key in obj2) { - obj1[key] = obj2[key]; - } - }; - - Util.getInheritableProperty = function Util_getInheritableProperty(dict, - name) { - while (dict && !dict.has(name)) { - dict = dict.get('Parent'); - } - if (!dict) { - return null; - } - return dict.get(name); - }; - - Util.inherit = function Util_inherit(sub, base, prototype) { - sub.prototype = Object.create(base.prototype); - sub.prototype.constructor = sub; - for (var prop in prototype) { - sub.prototype[prop] = prototype[prop]; - } - }; - - Util.loadScript = function Util_loadScript(src, callback) { - var script = document.createElement('script'); - var loaded = false; - script.setAttribute('src', src); - if (callback) { - script.onload = function() { - if (!loaded) { - callback(); - } - loaded = true; - }; - } - document.getElementsByTagName('head')[0].appendChild(script); - }; - - return Util; -})(); - -/** - * PDF page viewport created based on scale, rotation and offset. - * @class - * @alias PDFJS.PageViewport - */ -var PageViewport = PDFJS.PageViewport = (function PageViewportClosure() { - /** - * @constructor - * @private - * @param viewBox {Array} xMin, yMin, xMax and yMax coordinates. - * @param scale {number} scale of the viewport. - * @param rotation {number} rotations of the viewport in degrees. - * @param offsetX {number} offset X - * @param offsetY {number} offset Y - * @param dontFlip {boolean} if true, axis Y will not be flipped. - */ - function PageViewport(viewBox, scale, rotation, offsetX, offsetY, dontFlip) { - this.viewBox = viewBox; - this.scale = scale; - this.rotation = rotation; - this.offsetX = offsetX; - this.offsetY = offsetY; - - // creating transform to convert pdf coordinate system to the normal - // canvas like coordinates taking in account scale and rotation - var centerX = (viewBox[2] + viewBox[0]) / 2; - var centerY = (viewBox[3] + viewBox[1]) / 2; - var rotateA, rotateB, rotateC, rotateD; - rotation = rotation % 360; - rotation = rotation < 0 ? rotation + 360 : rotation; - switch (rotation) { - case 180: - rotateA = -1; rotateB = 0; rotateC = 0; rotateD = 1; - break; - case 90: - rotateA = 0; rotateB = 1; rotateC = 1; rotateD = 0; - break; - case 270: - rotateA = 0; rotateB = -1; rotateC = -1; rotateD = 0; - break; - //case 0: - default: - rotateA = 1; rotateB = 0; rotateC = 0; rotateD = -1; - break; - } - - if (dontFlip) { - rotateC = -rotateC; rotateD = -rotateD; - } - - var offsetCanvasX, offsetCanvasY; - var width, height; - if (rotateA === 0) { - offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX; - offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY; - width = Math.abs(viewBox[3] - viewBox[1]) * scale; - height = Math.abs(viewBox[2] - viewBox[0]) * scale; - } else { - offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX; - offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY; - width = Math.abs(viewBox[2] - viewBox[0]) * scale; - height = Math.abs(viewBox[3] - viewBox[1]) * scale; - } - // creating transform for the following operations: - // translate(-centerX, -centerY), rotate and flip vertically, - // scale, and translate(offsetCanvasX, offsetCanvasY) - this.transform = [ - rotateA * scale, - rotateB * scale, - rotateC * scale, - rotateD * scale, - offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY, - offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY - ]; - - this.width = width; - this.height = height; - this.fontScale = scale; - } - PageViewport.prototype = /** @lends PDFJS.PageViewport.prototype */ { - /** - * Clones viewport with additional properties. - * @param args {Object} (optional) If specified, may contain the 'scale' or - * 'rotation' properties to override the corresponding properties in - * the cloned viewport. - * @returns {PDFJS.PageViewport} Cloned viewport. - */ - clone: function PageViewPort_clone(args) { - args = args || {}; - var scale = 'scale' in args ? args.scale : this.scale; - var rotation = 'rotation' in args ? args.rotation : this.rotation; - return new PageViewport(this.viewBox.slice(), scale, rotation, - this.offsetX, this.offsetY, args.dontFlip); - }, - /** - * Converts PDF point to the viewport coordinates. For examples, useful for - * converting PDF location into canvas pixel coordinates. - * @param x {number} X coordinate. - * @param y {number} Y coordinate. - * @returns {Object} Object that contains 'x' and 'y' properties of the - * point in the viewport coordinate space. - * @see {@link convertToPdfPoint} - * @see {@link convertToViewportRectangle} - */ - convertToViewportPoint: function PageViewport_convertToViewportPoint(x, y) { - return Util.applyTransform([x, y], this.transform); - }, - /** - * Converts PDF rectangle to the viewport coordinates. - * @param rect {Array} xMin, yMin, xMax and yMax coordinates. - * @returns {Array} Contains corresponding coordinates of the rectangle - * in the viewport coordinate space. - * @see {@link convertToViewportPoint} - */ - convertToViewportRectangle: - function PageViewport_convertToViewportRectangle(rect) { - var tl = Util.applyTransform([rect[0], rect[1]], this.transform); - var br = Util.applyTransform([rect[2], rect[3]], this.transform); - return [tl[0], tl[1], br[0], br[1]]; - }, - /** - * Converts viewport coordinates to the PDF location. For examples, useful - * for converting canvas pixel location into PDF one. - * @param x {number} X coordinate. - * @param y {number} Y coordinate. - * @returns {Object} Object that contains 'x' and 'y' properties of the - * point in the PDF coordinate space. - * @see {@link convertToViewportPoint} - */ - convertToPdfPoint: function PageViewport_convertToPdfPoint(x, y) { - return Util.applyInverseTransform([x, y], this.transform); - } - }; - return PageViewport; -})(); - -var PDFStringTranslateTable = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0x2D8, 0x2C7, 0x2C6, 0x2D9, 0x2DD, 0x2DB, 0x2DA, 0x2DC, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, - 0x2013, 0x192, 0x2044, 0x2039, 0x203A, 0x2212, 0x2030, 0x201E, 0x201C, - 0x201D, 0x2018, 0x2019, 0x201A, 0x2122, 0xFB01, 0xFB02, 0x141, 0x152, 0x160, - 0x178, 0x17D, 0x131, 0x142, 0x153, 0x161, 0x17E, 0, 0x20AC -]; - -function stringToPDFString(str) { - var i, n = str.length, strBuf = []; - if (str[0] === '\xFE' && str[1] === '\xFF') { - // UTF16BE BOM - for (i = 2; i < n; i += 2) { - strBuf.push(String.fromCharCode( - (str.charCodeAt(i) << 8) | str.charCodeAt(i + 1))); - } - } else { - for (i = 0; i < n; ++i) { - var code = PDFStringTranslateTable[str.charCodeAt(i)]; - strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); - } - } - return strBuf.join(''); -} - -function stringToUTF8String(str) { - return decodeURIComponent(escape(str)); -} - -function utf8StringToString(str) { - return unescape(encodeURIComponent(str)); -} - -function isEmptyObj(obj) { - for (var key in obj) { - return false; - } - return true; -} - -function isBool(v) { - return typeof v === 'boolean'; -} - -function isInt(v) { - return typeof v === 'number' && ((v | 0) === v); -} - -function isNum(v) { - return typeof v === 'number'; -} - -function isString(v) { - return typeof v === 'string'; -} - -function isName(v) { - return v instanceof Name; -} - -function isCmd(v, cmd) { - return v instanceof Cmd && (cmd === undefined || v.cmd === cmd); -} - -function isDict(v, type) { - if (!(v instanceof Dict)) { - return false; - } - if (!type) { - return true; - } - var dictType = v.get('Type'); - return isName(dictType) && dictType.name === type; -} - -function isArray(v) { - return v instanceof Array; -} - -function isStream(v) { - return typeof v === 'object' && v !== null && v.getBytes !== undefined; -} - -function isArrayBuffer(v) { - return typeof v === 'object' && v !== null && v.byteLength !== undefined; -} - -function isRef(v) { - return v instanceof Ref; -} - -/** - * Promise Capability object. - * - * @typedef {Object} PromiseCapability - * @property {Promise} promise - A promise object. - * @property {function} resolve - Fullfills the promise. - * @property {function} reject - Rejects the promise. - */ - -/** - * Creates a promise capability object. - * @alias PDFJS.createPromiseCapability - * - * @return {PromiseCapability} A capability object contains: - * - a Promise, resolve and reject methods. - */ -function createPromiseCapability() { - var capability = {}; - capability.promise = new Promise(function (resolve, reject) { - capability.resolve = resolve; - capability.reject = reject; - }); - return capability; -} - -PDFJS.createPromiseCapability = createPromiseCapability; - -/** - * Polyfill for Promises: - * The following promise implementation tries to generally implement the - * Promise/A+ spec. Some notable differences from other promise libaries are: - * - There currently isn't a seperate deferred and promise object. - * - Unhandled rejections eventually show an error if they aren't handled. - * - * Based off of the work in: - * https://bugzilla.mozilla.org/show_bug.cgi?id=810490 - */ -(function PromiseClosure() { - if (globalScope.Promise) { - // Promises existing in the DOM/Worker, checking presence of all/resolve - if (typeof globalScope.Promise.all !== 'function') { - globalScope.Promise.all = function (iterable) { - var count = 0, results = [], resolve, reject; - var promise = new globalScope.Promise(function (resolve_, reject_) { - resolve = resolve_; - reject = reject_; - }); - iterable.forEach(function (p, i) { - count++; - p.then(function (result) { - results[i] = result; - count--; - if (count === 0) { - resolve(results); - } - }, reject); - }); - if (count === 0) { - resolve(results); - } - return promise; - }; - } - if (typeof globalScope.Promise.resolve !== 'function') { - globalScope.Promise.resolve = function (value) { - return new globalScope.Promise(function (resolve) { resolve(value); }); - }; - } - if (typeof globalScope.Promise.reject !== 'function') { - globalScope.Promise.reject = function (reason) { - return new globalScope.Promise(function (resolve, reject) { - reject(reason); - }); - }; - } - if (typeof globalScope.Promise.prototype.catch !== 'function') { - globalScope.Promise.prototype.catch = function (onReject) { - return globalScope.Promise.prototype.then(undefined, onReject); - }; - } - return; - } - var STATUS_PENDING = 0; - var STATUS_RESOLVED = 1; - var STATUS_REJECTED = 2; - - // In an attempt to avoid silent exceptions, unhandled rejections are - // tracked and if they aren't handled in a certain amount of time an - // error is logged. - var REJECTION_TIMEOUT = 500; - - var HandlerManager = { - handlers: [], - running: false, - unhandledRejections: [], - pendingRejectionCheck: false, - - scheduleHandlers: function scheduleHandlers(promise) { - if (promise._status === STATUS_PENDING) { - return; - } - - this.handlers = this.handlers.concat(promise._handlers); - promise._handlers = []; - - if (this.running) { - return; - } - this.running = true; - - setTimeout(this.runHandlers.bind(this), 0); - }, - - runHandlers: function runHandlers() { - var RUN_TIMEOUT = 1; // ms - var timeoutAt = Date.now() + RUN_TIMEOUT; - while (this.handlers.length > 0) { - var handler = this.handlers.shift(); - - var nextStatus = handler.thisPromise._status; - var nextValue = handler.thisPromise._value; - - try { - if (nextStatus === STATUS_RESOLVED) { - if (typeof handler.onResolve === 'function') { - nextValue = handler.onResolve(nextValue); - } - } else if (typeof handler.onReject === 'function') { - nextValue = handler.onReject(nextValue); - nextStatus = STATUS_RESOLVED; - - if (handler.thisPromise._unhandledRejection) { - this.removeUnhandeledRejection(handler.thisPromise); - } - } - } catch (ex) { - nextStatus = STATUS_REJECTED; - nextValue = ex; - } - - handler.nextPromise._updateStatus(nextStatus, nextValue); - if (Date.now() >= timeoutAt) { - break; - } - } - - if (this.handlers.length > 0) { - setTimeout(this.runHandlers.bind(this), 0); - return; - } - - this.running = false; - }, - - addUnhandledRejection: function addUnhandledRejection(promise) { - this.unhandledRejections.push({ - promise: promise, - time: Date.now() - }); - this.scheduleRejectionCheck(); - }, - - removeUnhandeledRejection: function removeUnhandeledRejection(promise) { - promise._unhandledRejection = false; - for (var i = 0; i < this.unhandledRejections.length; i++) { - if (this.unhandledRejections[i].promise === promise) { - this.unhandledRejections.splice(i); - i--; - } - } - }, - - scheduleRejectionCheck: function scheduleRejectionCheck() { - if (this.pendingRejectionCheck) { - return; - } - this.pendingRejectionCheck = true; - setTimeout(function rejectionCheck() { - this.pendingRejectionCheck = false; - var now = Date.now(); - for (var i = 0; i < this.unhandledRejections.length; i++) { - if (now - this.unhandledRejections[i].time > REJECTION_TIMEOUT) { - var unhandled = this.unhandledRejections[i].promise._value; - var msg = 'Unhandled rejection: ' + unhandled; - if (unhandled.stack) { - msg += '\n' + unhandled.stack; - } - warn(msg); - this.unhandledRejections.splice(i); - i--; - } - } - if (this.unhandledRejections.length) { - this.scheduleRejectionCheck(); - } - }.bind(this), REJECTION_TIMEOUT); - } - }; - - function Promise(resolver) { - this._status = STATUS_PENDING; - this._handlers = []; - try { - resolver.call(this, this._resolve.bind(this), this._reject.bind(this)); - } catch (e) { - this._reject(e); - } - } - /** - * Builds a promise that is resolved when all the passed in promises are - * resolved. - * @param {array} array of data and/or promises to wait for. - * @return {Promise} New dependant promise. - */ - Promise.all = function Promise_all(promises) { - var resolveAll, rejectAll; - var deferred = new Promise(function (resolve, reject) { - resolveAll = resolve; - rejectAll = reject; - }); - var unresolved = promises.length; - var results = []; - if (unresolved === 0) { - resolveAll(results); - return deferred; - } - function reject(reason) { - if (deferred._status === STATUS_REJECTED) { - return; - } - results = []; - rejectAll(reason); - } - for (var i = 0, ii = promises.length; i < ii; ++i) { - var promise = promises[i]; - var resolve = (function(i) { - return function(value) { - if (deferred._status === STATUS_REJECTED) { - return; - } - results[i] = value; - unresolved--; - if (unresolved === 0) { - resolveAll(results); - } - }; - })(i); - if (Promise.isPromise(promise)) { - promise.then(resolve, reject); - } else { - resolve(promise); - } - } - return deferred; - }; - - /** - * Checks if the value is likely a promise (has a 'then' function). - * @return {boolean} true if value is thenable - */ - Promise.isPromise = function Promise_isPromise(value) { - return value && typeof value.then === 'function'; - }; - - /** - * Creates resolved promise - * @param value resolve value - * @returns {Promise} - */ - Promise.resolve = function Promise_resolve(value) { - return new Promise(function (resolve) { resolve(value); }); - }; - - /** - * Creates rejected promise - * @param reason rejection value - * @returns {Promise} - */ - Promise.reject = function Promise_reject(reason) { - return new Promise(function (resolve, reject) { reject(reason); }); - }; - - Promise.prototype = { - _status: null, - _value: null, - _handlers: null, - _unhandledRejection: null, - - _updateStatus: function Promise__updateStatus(status, value) { - if (this._status === STATUS_RESOLVED || - this._status === STATUS_REJECTED) { - return; - } - - if (status === STATUS_RESOLVED && - Promise.isPromise(value)) { - value.then(this._updateStatus.bind(this, STATUS_RESOLVED), - this._updateStatus.bind(this, STATUS_REJECTED)); - return; - } - - this._status = status; - this._value = value; - - if (status === STATUS_REJECTED && this._handlers.length === 0) { - this._unhandledRejection = true; - HandlerManager.addUnhandledRejection(this); - } - - HandlerManager.scheduleHandlers(this); - }, - - _resolve: function Promise_resolve(value) { - this._updateStatus(STATUS_RESOLVED, value); - }, - - _reject: function Promise_reject(reason) { - this._updateStatus(STATUS_REJECTED, reason); - }, - - then: function Promise_then(onResolve, onReject) { - var nextPromise = new Promise(function (resolve, reject) { - this.resolve = resolve; - this.reject = reject; - }); - this._handlers.push({ - thisPromise: this, - onResolve: onResolve, - onReject: onReject, - nextPromise: nextPromise - }); - HandlerManager.scheduleHandlers(this); - return nextPromise; - }, - - catch: function Promise_catch(onReject) { - return this.then(undefined, onReject); - } - }; - - globalScope.Promise = Promise; -})(); - -var StatTimer = (function StatTimerClosure() { - function rpad(str, pad, length) { - while (str.length < length) { - str += pad; - } - return str; - } - function StatTimer() { - this.started = {}; - this.times = []; - this.enabled = true; - } - StatTimer.prototype = { - time: function StatTimer_time(name) { - if (!this.enabled) { - return; - } - if (name in this.started) { - warn('Timer is already running for ' + name); - } - this.started[name] = Date.now(); - }, - timeEnd: function StatTimer_timeEnd(name) { - if (!this.enabled) { - return; - } - if (!(name in this.started)) { - warn('Timer has not been started for ' + name); - } - this.times.push({ - 'name': name, - 'start': this.started[name], - 'end': Date.now() - }); - // Remove timer from started so it can be called again. - delete this.started[name]; - }, - toString: function StatTimer_toString() { - var i, ii; - var times = this.times; - var out = ''; - // Find the longest name for padding purposes. - var longest = 0; - for (i = 0, ii = times.length; i < ii; ++i) { - var name = times[i]['name']; - if (name.length > longest) { - longest = name.length; - } - } - for (i = 0, ii = times.length; i < ii; ++i) { - var span = times[i]; - var duration = span.end - span.start; - out += rpad(span['name'], ' ', longest) + ' ' + duration + 'ms\n'; - } - return out; - } - }; - return StatTimer; -})(); - -PDFJS.createBlob = function createBlob(data, contentType) { - if (typeof Blob !== 'undefined') { - return new Blob([data], { type: contentType }); - } - // Blob builder is deprecated in FF14 and removed in FF18. - var bb = new MozBlobBuilder(); - bb.append(data); - return bb.getBlob(contentType); -}; - -PDFJS.createObjectURL = (function createObjectURLClosure() { - // Blob/createObjectURL is not available, falling back to data schema. - var digits = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - - return function createObjectURL(data, contentType) { - if (!PDFJS.disableCreateObjectURL && - typeof URL !== 'undefined' && URL.createObjectURL) { - var blob = PDFJS.createBlob(data, contentType); - return URL.createObjectURL(blob); - } - - var buffer = 'data:' + contentType + ';base64,'; - for (var i = 0, ii = data.length; i < ii; i += 3) { - var b1 = data[i] & 0xFF; - var b2 = data[i + 1] & 0xFF; - var b3 = data[i + 2] & 0xFF; - var d1 = b1 >> 2, d2 = ((b1 & 3) << 4) | (b2 >> 4); - var d3 = i + 1 < ii ? ((b2 & 0xF) << 2) | (b3 >> 6) : 64; - var d4 = i + 2 < ii ? (b3 & 0x3F) : 64; - buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4]; - } - return buffer; - }; -})(); - -function MessageHandler(sourceName, targetName, comObj) { - this.sourceName = sourceName; - this.targetName = targetName; - this.comObj = comObj; - this.callbackIndex = 1; - this.postMessageTransfers = true; - var callbacksCapabilities = this.callbacksCapabilities = {}; - var ah = this.actionHandler = {}; - - this._onComObjOnMessage = function messageHandlerComObjOnMessage(event) { - var data = event.data; - if (data.targetName !== this.sourceName) { - return; - } - if (data.isReply) { - var callbackId = data.callbackId; - if (data.callbackId in callbacksCapabilities) { - var callback = callbacksCapabilities[callbackId]; - delete callbacksCapabilities[callbackId]; - if ('error' in data) { - callback.reject(data.error); - } else { - callback.resolve(data.data); - } - } else { - error('Cannot resolve callback ' + callbackId); - } - } else if (data.action in ah) { - var action = ah[data.action]; - if (data.callbackId) { - var sourceName = this.sourceName; - var targetName = data.sourceName; - Promise.resolve().then(function () { - return action[0].call(action[1], data.data); - }).then(function (result) { - comObj.postMessage({ - sourceName: sourceName, - targetName: targetName, - isReply: true, - callbackId: data.callbackId, - data: result - }); - }, function (reason) { - if (reason instanceof Error) { - // Serialize error to avoid "DataCloneError" - reason = reason + ''; - } - comObj.postMessage({ - sourceName: sourceName, - targetName: targetName, - isReply: true, - callbackId: data.callbackId, - error: reason - }); - }); - } else { - action[0].call(action[1], data.data); - } - } else { - error('Unknown action from worker: ' + data.action); - } - }.bind(this); - comObj.addEventListener('message', this._onComObjOnMessage); -} - -MessageHandler.prototype = { - on: function messageHandlerOn(actionName, handler, scope) { - var ah = this.actionHandler; - if (ah[actionName]) { - error('There is already an actionName called "' + actionName + '"'); - } - ah[actionName] = [handler, scope]; - }, - /** - * Sends a message to the comObj to invoke the action with the supplied data. - * @param {String} actionName Action to call. - * @param {JSON} data JSON data to send. - * @param {Array} [transfers] Optional list of transfers/ArrayBuffers - */ - send: function messageHandlerSend(actionName, data, transfers) { - var message = { - sourceName: this.sourceName, - targetName: this.targetName, - action: actionName, - data: data - }; - this.postMessage(message, transfers); - }, - /** - * Sends a message to the comObj to invoke the action with the supplied data. - * Expects that other side will callback with the response. - * @param {String} actionName Action to call. - * @param {JSON} data JSON data to send. - * @param {Array} [transfers] Optional list of transfers/ArrayBuffers. - * @returns {Promise} Promise to be resolved with response data. - */ - sendWithPromise: - function messageHandlerSendWithPromise(actionName, data, transfers) { - var callbackId = this.callbackIndex++; - var message = { - sourceName: this.sourceName, - targetName: this.targetName, - action: actionName, - data: data, - callbackId: callbackId - }; - var capability = createPromiseCapability(); - this.callbacksCapabilities[callbackId] = capability; - try { - this.postMessage(message, transfers); - } catch (e) { - capability.reject(e); - } - return capability.promise; - }, - /** - * Sends raw message to the comObj. - * @private - * @param message {Object} Raw message. - * @param transfers List of transfers/ArrayBuffers, or undefined. - */ - postMessage: function (message, transfers) { - if (transfers && this.postMessageTransfers) { - this.comObj.postMessage(message, transfers); - } else { - this.comObj.postMessage(message); - } - }, - - destroy: function () { - this.comObj.removeEventListener('message', this._onComObjOnMessage); - } -}; - -function loadJpegStream(id, imageUrl, objs) { - var img = new Image(); - img.onload = (function loadJpegStream_onloadClosure() { - objs.resolve(id, img); - }); - img.onerror = (function loadJpegStream_onerrorClosure() { - objs.resolve(id, null); - warn('Error during JPEG image loading'); - }); - img.src = imageUrl; -} - - // Polyfill from https://github.com/Polymer/URL -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ -(function checkURLConstructor(scope) { - /* jshint ignore:start */ - - // feature detect for URL constructor - var hasWorkingUrl = false; - if (typeof URL === 'function' && ('origin' in URL.prototype)) { - try { - var u = new URL('b', 'http://a'); - u.pathname = 'c%20d'; - hasWorkingUrl = u.href === 'http://a/c%20d'; - } catch(e) {} - } - - if (hasWorkingUrl) - return; - - var relative = Object.create(null); - relative['ftp'] = 21; - relative['file'] = 0; - relative['gopher'] = 70; - relative['http'] = 80; - relative['https'] = 443; - relative['ws'] = 80; - relative['wss'] = 443; - - var relativePathDotMapping = Object.create(null); - relativePathDotMapping['%2e'] = '.'; - relativePathDotMapping['.%2e'] = '..'; - relativePathDotMapping['%2e.'] = '..'; - relativePathDotMapping['%2e%2e'] = '..'; - - function isRelativeScheme(scheme) { - return relative[scheme] !== undefined; - } - - function invalid() { - clear.call(this); - this._isInvalid = true; - } - - function IDNAToASCII(h) { - if ('' == h) { - invalid.call(this) - } - // XXX - return h.toLowerCase() - } - - function percentEscape(c) { - var unicode = c.charCodeAt(0); - if (unicode > 0x20 && - unicode < 0x7F && - // " # < > ? ` - [0x22, 0x23, 0x3C, 0x3E, 0x3F, 0x60].indexOf(unicode) == -1 - ) { - return c; - } - return encodeURIComponent(c); - } - - function percentEscapeQuery(c) { - // XXX This actually needs to encode c using encoding and then - // convert the bytes one-by-one. - - var unicode = c.charCodeAt(0); - if (unicode > 0x20 && - unicode < 0x7F && - // " # < > ` (do not escape '?') - [0x22, 0x23, 0x3C, 0x3E, 0x60].indexOf(unicode) == -1 - ) { - return c; - } - return encodeURIComponent(c); - } - - var EOF = undefined, - ALPHA = /[a-zA-Z]/, - ALPHANUMERIC = /[a-zA-Z0-9\+\-\.]/; - - function parse(input, stateOverride, base) { - function err(message) { - errors.push(message) - } - - var state = stateOverride || 'scheme start', - cursor = 0, - buffer = '', - seenAt = false, - seenBracket = false, - errors = []; - - loop: while ((input[cursor - 1] != EOF || cursor == 0) && !this._isInvalid) { - var c = input[cursor]; - switch (state) { - case 'scheme start': - if (c && ALPHA.test(c)) { - buffer += c.toLowerCase(); // ASCII-safe - state = 'scheme'; - } else if (!stateOverride) { - buffer = ''; - state = 'no scheme'; - continue; - } else { - err('Invalid scheme.'); - break loop; - } - break; - - case 'scheme': - if (c && ALPHANUMERIC.test(c)) { - buffer += c.toLowerCase(); // ASCII-safe - } else if (':' == c) { - this._scheme = buffer; - buffer = ''; - if (stateOverride) { - break loop; - } - if (isRelativeScheme(this._scheme)) { - this._isRelative = true; - } - if ('file' == this._scheme) { - state = 'relative'; - } else if (this._isRelative && base && base._scheme == this._scheme) { - state = 'relative or authority'; - } else if (this._isRelative) { - state = 'authority first slash'; - } else { - state = 'scheme data'; - } - } else if (!stateOverride) { - buffer = ''; - cursor = 0; - state = 'no scheme'; - continue; - } else if (EOF == c) { - break loop; - } else { - err('Code point not allowed in scheme: ' + c) - break loop; - } - break; - - case 'scheme data': - if ('?' == c) { - this._query = '?'; - state = 'query'; - } else if ('#' == c) { - this._fragment = '#'; - state = 'fragment'; - } else { - // XXX error handling - if (EOF != c && '\t' != c && '\n' != c && '\r' != c) { - this._schemeData += percentEscape(c); - } - } - break; - - case 'no scheme': - if (!base || !(isRelativeScheme(base._scheme))) { - err('Missing scheme.'); - invalid.call(this); - } else { - state = 'relative'; - continue; - } - break; - - case 'relative or authority': - if ('/' == c && '/' == input[cursor+1]) { - state = 'authority ignore slashes'; - } else { - err('Expected /, got: ' + c); - state = 'relative'; - continue - } - break; - - case 'relative': - this._isRelative = true; - if ('file' != this._scheme) - this._scheme = base._scheme; - if (EOF == c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = base._query; - this._username = base._username; - this._password = base._password; - break loop; - } else if ('/' == c || '\\' == c) { - if ('\\' == c) - err('\\ is an invalid code point.'); - state = 'relative slash'; - } else if ('?' == c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = '?'; - this._username = base._username; - this._password = base._password; - state = 'query'; - } else if ('#' == c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = base._query; - this._fragment = '#'; - this._username = base._username; - this._password = base._password; - state = 'fragment'; - } else { - var nextC = input[cursor+1] - var nextNextC = input[cursor+2] - if ( - 'file' != this._scheme || !ALPHA.test(c) || - (nextC != ':' && nextC != '|') || - (EOF != nextNextC && '/' != nextNextC && '\\' != nextNextC && '?' != nextNextC && '#' != nextNextC)) { - this._host = base._host; - this._port = base._port; - this._username = base._username; - this._password = base._password; - this._path = base._path.slice(); - this._path.pop(); - } - state = 'relative path'; - continue; - } - break; - - case 'relative slash': - if ('/' == c || '\\' == c) { - if ('\\' == c) { - err('\\ is an invalid code point.'); - } - if ('file' == this._scheme) { - state = 'file host'; - } else { - state = 'authority ignore slashes'; - } - } else { - if ('file' != this._scheme) { - this._host = base._host; - this._port = base._port; - this._username = base._username; - this._password = base._password; - } - state = 'relative path'; - continue; - } - break; - - case 'authority first slash': - if ('/' == c) { - state = 'authority second slash'; - } else { - err("Expected '/', got: " + c); - state = 'authority ignore slashes'; - continue; - } - break; - - case 'authority second slash': - state = 'authority ignore slashes'; - if ('/' != c) { - err("Expected '/', got: " + c); - continue; - } - break; - - case 'authority ignore slashes': - if ('/' != c && '\\' != c) { - state = 'authority'; - continue; - } else { - err('Expected authority, got: ' + c); - } - break; - - case 'authority': - if ('@' == c) { - if (seenAt) { - err('@ already seen.'); - buffer += '%40'; - } - seenAt = true; - for (var i = 0; i < buffer.length; i++) { - var cp = buffer[i]; - if ('\t' == cp || '\n' == cp || '\r' == cp) { - err('Invalid whitespace in authority.'); - continue; - } - // XXX check URL code points - if (':' == cp && null === this._password) { - this._password = ''; - continue; - } - var tempC = percentEscape(cp); - (null !== this._password) ? this._password += tempC : this._username += tempC; - } - buffer = ''; - } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) { - cursor -= buffer.length; - buffer = ''; - state = 'host'; - continue; - } else { - buffer += c; - } - break; - - case 'file host': - if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) { - if (buffer.length == 2 && ALPHA.test(buffer[0]) && (buffer[1] == ':' || buffer[1] == '|')) { - state = 'relative path'; - } else if (buffer.length == 0) { - state = 'relative path start'; - } else { - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'relative path start'; - } - continue; - } else if ('\t' == c || '\n' == c || '\r' == c) { - err('Invalid whitespace in file host.'); - } else { - buffer += c; - } - break; - - case 'host': - case 'hostname': - if (':' == c && !seenBracket) { - // XXX host parsing - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'port'; - if ('hostname' == stateOverride) { - break loop; - } - } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) { - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'relative path start'; - if (stateOverride) { - break loop; - } - continue; - } else if ('\t' != c && '\n' != c && '\r' != c) { - if ('[' == c) { - seenBracket = true; - } else if (']' == c) { - seenBracket = false; - } - buffer += c; - } else { - err('Invalid code point in host/hostname: ' + c); - } - break; - - case 'port': - if (/[0-9]/.test(c)) { - buffer += c; - } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c || stateOverride) { - if ('' != buffer) { - var temp = parseInt(buffer, 10); - if (temp != relative[this._scheme]) { - this._port = temp + ''; - } - buffer = ''; - } - if (stateOverride) { - break loop; - } - state = 'relative path start'; - continue; - } else if ('\t' == c || '\n' == c || '\r' == c) { - err('Invalid code point in port: ' + c); - } else { - invalid.call(this); - } - break; - - case 'relative path start': - if ('\\' == c) - err("'\\' not allowed in path."); - state = 'relative path'; - if ('/' != c && '\\' != c) { - continue; - } - break; - - case 'relative path': - if (EOF == c || '/' == c || '\\' == c || (!stateOverride && ('?' == c || '#' == c))) { - if ('\\' == c) { - err('\\ not allowed in relative path.'); - } - var tmp; - if (tmp = relativePathDotMapping[buffer.toLowerCase()]) { - buffer = tmp; - } - if ('..' == buffer) { - this._path.pop(); - if ('/' != c && '\\' != c) { - this._path.push(''); - } - } else if ('.' == buffer && '/' != c && '\\' != c) { - this._path.push(''); - } else if ('.' != buffer) { - if ('file' == this._scheme && this._path.length == 0 && buffer.length == 2 && ALPHA.test(buffer[0]) && buffer[1] == '|') { - buffer = buffer[0] + ':'; - } - this._path.push(buffer); - } - buffer = ''; - if ('?' == c) { - this._query = '?'; - state = 'query'; - } else if ('#' == c) { - this._fragment = '#'; - state = 'fragment'; - } - } else if ('\t' != c && '\n' != c && '\r' != c) { - buffer += percentEscape(c); - } - break; - - case 'query': - if (!stateOverride && '#' == c) { - this._fragment = '#'; - state = 'fragment'; - } else if (EOF != c && '\t' != c && '\n' != c && '\r' != c) { - this._query += percentEscapeQuery(c); - } - break; - - case 'fragment': - if (EOF != c && '\t' != c && '\n' != c && '\r' != c) { - this._fragment += c; - } - break; - } - - cursor++; - } - } - - function clear() { - this._scheme = ''; - this._schemeData = ''; - this._username = ''; - this._password = null; - this._host = ''; - this._port = ''; - this._path = []; - this._query = ''; - this._fragment = ''; - this._isInvalid = false; - this._isRelative = false; - } - - // Does not process domain names or IP addresses. - // Does not handle encoding for the query parameter. - function jURL(url, base /* , encoding */) { - if (base !== undefined && !(base instanceof jURL)) - base = new jURL(String(base)); - - this._url = url; - clear.call(this); - - var input = url.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, ''); - // encoding = encoding || 'utf-8' - - parse.call(this, input, null, base); - } - - jURL.prototype = { - toString: function() { - return this.href; - }, - get href() { - if (this._isInvalid) - return this._url; - - var authority = ''; - if ('' != this._username || null != this._password) { - authority = this._username + - (null != this._password ? ':' + this._password : '') + '@'; - } - - return this.protocol + - (this._isRelative ? '//' + authority + this.host : '') + - this.pathname + this._query + this._fragment; - }, - set href(href) { - clear.call(this); - parse.call(this, href); - }, - - get protocol() { - return this._scheme + ':'; - }, - set protocol(protocol) { - if (this._isInvalid) - return; - parse.call(this, protocol + ':', 'scheme start'); - }, - - get host() { - return this._isInvalid ? '' : this._port ? - this._host + ':' + this._port : this._host; - }, - set host(host) { - if (this._isInvalid || !this._isRelative) - return; - parse.call(this, host, 'host'); - }, - - get hostname() { - return this._host; - }, - set hostname(hostname) { - if (this._isInvalid || !this._isRelative) - return; - parse.call(this, hostname, 'hostname'); - }, - - get port() { - return this._port; - }, - set port(port) { - if (this._isInvalid || !this._isRelative) - return; - parse.call(this, port, 'port'); - }, - - get pathname() { - return this._isInvalid ? '' : this._isRelative ? - '/' + this._path.join('/') : this._schemeData; - }, - set pathname(pathname) { - if (this._isInvalid || !this._isRelative) - return; - this._path = []; - parse.call(this, pathname, 'relative path start'); - }, - - get search() { - return this._isInvalid || !this._query || '?' == this._query ? - '' : this._query; - }, - set search(search) { - if (this._isInvalid || !this._isRelative) - return; - this._query = '?'; - if ('?' == search[0]) - search = search.slice(1); - parse.call(this, search, 'query'); - }, - - get hash() { - return this._isInvalid || !this._fragment || '#' == this._fragment ? - '' : this._fragment; - }, - set hash(hash) { - if (this._isInvalid) - return; - this._fragment = '#'; - if ('#' == hash[0]) - hash = hash.slice(1); - parse.call(this, hash, 'fragment'); - }, - - get origin() { - var host; - if (this._isInvalid || !this._scheme) { - return ''; - } - // javascript: Gecko returns String(""), WebKit/Blink String("null") - // Gecko throws error for "data://" - // data: Gecko returns "", Blink returns "data://", WebKit returns "null" - // Gecko returns String("") for file: mailto: - // WebKit/Blink returns String("SCHEME://") for file: mailto: - switch (this._scheme) { - case 'data': - case 'file': - case 'javascript': - case 'mailto': - return 'null'; - } - host = this.host; - if (!host) { - return ''; - } - return this._scheme + '://' + host; - } - }; - - // Copy over the static methods - var OriginalURL = scope.URL; - if (OriginalURL) { - jURL.createObjectURL = function(blob) { - // IE extension allows a second optional options argument. - // http://msdn.microsoft.com/en-us/library/ie/hh772302(v=vs.85).aspx - return OriginalURL.createObjectURL.apply(OriginalURL, arguments); - }; - jURL.revokeObjectURL = function(url) { - OriginalURL.revokeObjectURL(url); - }; - } - - scope.URL = jURL; - /* jshint ignore:end */ -})(globalScope); - - -var DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536 - -/** - * The maximum allowed image size in total pixels e.g. width * height. Images - * above this value will not be drawn. Use -1 for no limit. - * @var {number} - */ -PDFJS.maxImageSize = (PDFJS.maxImageSize === undefined ? - -1 : PDFJS.maxImageSize); - -/** - * The url of where the predefined Adobe CMaps are located. Include trailing - * slash. - * @var {string} - */ -PDFJS.cMapUrl = (PDFJS.cMapUrl === undefined ? null : PDFJS.cMapUrl); - -/** - * Specifies if CMaps are binary packed. - * @var {boolean} - */ -PDFJS.cMapPacked = PDFJS.cMapPacked === undefined ? false : PDFJS.cMapPacked; - -/** - * By default fonts are converted to OpenType fonts and loaded via font face - * rules. If disabled, the font will be rendered using a built in font renderer - * that constructs the glyphs with primitive path commands. - * @var {boolean} - */ -PDFJS.disableFontFace = (PDFJS.disableFontFace === undefined ? - false : PDFJS.disableFontFace); - -/** - * Path for image resources, mainly for annotation icons. Include trailing - * slash. - * @var {string} - */ -PDFJS.imageResourcesPath = (PDFJS.imageResourcesPath === undefined ? - '' : PDFJS.imageResourcesPath); - -/** - * Disable the web worker and run all code on the main thread. This will happen - * automatically if the browser doesn't support workers or sending typed arrays - * to workers. - * @var {boolean} - */ -PDFJS.disableWorker = (PDFJS.disableWorker === undefined ? - false : PDFJS.disableWorker); - -/** - * Path and filename of the worker file. Required when the worker is enabled in - * development mode. If unspecified in the production build, the worker will be - * loaded based on the location of the pdf.js file. It is recommended that - * the workerSrc is set in a custom application to prevent issues caused by - * third-party frameworks and libraries. - * @var {string} - */ -PDFJS.workerSrc = (PDFJS.workerSrc === undefined ? null : PDFJS.workerSrc); - -/** - * Disable range request loading of PDF files. When enabled and if the server - * supports partial content requests then the PDF will be fetched in chunks. - * Enabled (false) by default. - * @var {boolean} - */ -PDFJS.disableRange = (PDFJS.disableRange === undefined ? - false : PDFJS.disableRange); - -/** - * Disable streaming of PDF file data. By default PDF.js attempts to load PDF - * in chunks. This default behavior can be disabled. - * @var {boolean} - */ -PDFJS.disableStream = (PDFJS.disableStream === undefined ? - false : PDFJS.disableStream); - -/** - * Disable pre-fetching of PDF file data. When range requests are enabled PDF.js - * will automatically keep fetching more data even if it isn't needed to display - * the current page. This default behavior can be disabled. - * - * NOTE: It is also necessary to disable streaming, see above, - * in order for disabling of pre-fetching to work correctly. - * @var {boolean} - */ -PDFJS.disableAutoFetch = (PDFJS.disableAutoFetch === undefined ? - false : PDFJS.disableAutoFetch); - -/** - * Enables special hooks for debugging PDF.js. - * @var {boolean} - */ -PDFJS.pdfBug = (PDFJS.pdfBug === undefined ? false : PDFJS.pdfBug); - -/** - * Enables transfer usage in postMessage for ArrayBuffers. - * @var {boolean} - */ -PDFJS.postMessageTransfers = (PDFJS.postMessageTransfers === undefined ? - true : PDFJS.postMessageTransfers); - -/** - * Disables URL.createObjectURL usage. - * @var {boolean} - */ -PDFJS.disableCreateObjectURL = (PDFJS.disableCreateObjectURL === undefined ? - false : PDFJS.disableCreateObjectURL); - -/** - * Disables WebGL usage. - * @var {boolean} - */ -PDFJS.disableWebGL = (PDFJS.disableWebGL === undefined ? - true : PDFJS.disableWebGL); - -/** - * Disables fullscreen support, and by extension Presentation Mode, - * in browsers which support the fullscreen API. - * @var {boolean} - */ -PDFJS.disableFullscreen = (PDFJS.disableFullscreen === undefined ? - false : PDFJS.disableFullscreen); - -/** - * Enables CSS only zooming. - * @var {boolean} - */ -PDFJS.useOnlyCssZoom = (PDFJS.useOnlyCssZoom === undefined ? - false : PDFJS.useOnlyCssZoom); - -/** - * Controls the logging level. - * The constants from PDFJS.VERBOSITY_LEVELS should be used: - * - errors - * - warnings [default] - * - infos - * @var {number} - */ -PDFJS.verbosity = (PDFJS.verbosity === undefined ? - PDFJS.VERBOSITY_LEVELS.warnings : PDFJS.verbosity); - -/** - * The maximum supported canvas size in total pixels e.g. width * height. - * The default value is 4096 * 4096. Use -1 for no limit. - * @var {number} - */ -PDFJS.maxCanvasPixels = (PDFJS.maxCanvasPixels === undefined ? - 16777216 : PDFJS.maxCanvasPixels); - -/** - * (Deprecated) Opens external links in a new window if enabled. - * The default behavior opens external links in the PDF.js window. - * - * NOTE: This property has been deprecated, please use - * `PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK` instead. - * @var {boolean} - */ -PDFJS.openExternalLinksInNewWindow = ( - PDFJS.openExternalLinksInNewWindow === undefined ? - false : PDFJS.openExternalLinksInNewWindow); - -/** - * Specifies the |target| attribute for external links. - * The constants from PDFJS.LinkTarget should be used: - * - NONE [default] - * - SELF - * - BLANK - * - PARENT - * - TOP - * @var {number} - */ -PDFJS.externalLinkTarget = (PDFJS.externalLinkTarget === undefined ? - PDFJS.LinkTarget.NONE : PDFJS.externalLinkTarget); - -/** - * Determines if we can eval strings as JS. Primarily used to improve - * performance for font rendering. - * @var {boolean} - */ -PDFJS.isEvalSupported = (PDFJS.isEvalSupported === undefined ? - true : PDFJS.isEvalSupported); - -/** - * Document initialization / loading parameters object. - * - * @typedef {Object} DocumentInitParameters - * @property {string} url - The URL of the PDF. - * @property {TypedArray|Array|string} data - Binary PDF data. Use typed arrays - * (Uint8Array) to improve the memory usage. If PDF data is BASE64-encoded, - * use atob() to convert it to a binary string first. - * @property {Object} httpHeaders - Basic authentication headers. - * @property {boolean} withCredentials - Indicates whether or not cross-site - * Access-Control requests should be made using credentials such as cookies - * or authorization headers. The default is false. - * @property {string} password - For decrypting password-protected PDFs. - * @property {TypedArray} initialData - A typed array with the first portion or - * all of the pdf data. Used by the extension since some data is already - * loaded before the switch to range requests. - * @property {number} length - The PDF file length. It's used for progress - * reports and range requests operations. - * @property {PDFDataRangeTransport} range - * @property {number} rangeChunkSize - Optional parameter to specify - * maximum number of bytes fetched per range request. The default value is - * 2^16 = 65536. - * @property {PDFWorker} worker - The worker that will be used for the loading - * and parsing of the PDF data. - */ - -/** - * @typedef {Object} PDFDocumentStats - * @property {Array} streamTypes - Used stream types in the document (an item - * is set to true if specific stream ID was used in the document). - * @property {Array} fontTypes - Used font type in the document (an item is set - * to true if specific font ID was used in the document). - */ - -/** - * This is the main entry point for loading a PDF and interacting with it. - * NOTE: If a URL is used to fetch the PDF data a standard XMLHttpRequest(XHR) - * is used, which means it must follow the same origin rules that any XHR does - * e.g. No cross domain requests without CORS. - * - * @param {string|TypedArray|DocumentInitParameters|PDFDataRangeTransport} src - * Can be a url to where a PDF is located, a typed array (Uint8Array) - * already populated with data or parameter object. - * - * @param {PDFDataRangeTransport} pdfDataRangeTransport (deprecated) It is used - * if you want to manually serve range requests for data in the PDF. - * - * @param {function} passwordCallback (deprecated) It is used to request a - * password if wrong or no password was provided. The callback receives two - * parameters: function that needs to be called with new password and reason - * (see {PasswordResponses}). - * - * @param {function} progressCallback (deprecated) It is used to be able to - * monitor the loading progress of the PDF file (necessary to implement e.g. - * a loading bar). The callback receives an {Object} with the properties: - * {number} loaded and {number} total. - * - * @return {PDFDocumentLoadingTask} - */ -PDFJS.getDocument = function getDocument(src, - pdfDataRangeTransport, - passwordCallback, - progressCallback) { - var task = new PDFDocumentLoadingTask(); - - // Support of the obsolete arguments (for compatibility with API v1.0) - if (arguments.length > 1) { - deprecated('getDocument is called with pdfDataRangeTransport, ' + - 'passwordCallback or progressCallback argument'); - } - if (pdfDataRangeTransport) { - if (!(pdfDataRangeTransport instanceof PDFDataRangeTransport)) { - // Not a PDFDataRangeTransport instance, trying to add missing properties. - pdfDataRangeTransport = Object.create(pdfDataRangeTransport); - pdfDataRangeTransport.length = src.length; - pdfDataRangeTransport.initialData = src.initialData; - if (!pdfDataRangeTransport.abort) { - pdfDataRangeTransport.abort = function () {}; - } - } - src = Object.create(src); - src.range = pdfDataRangeTransport; - } - task.onPassword = passwordCallback || null; - task.onProgress = progressCallback || null; - - var source; - if (typeof src === 'string') { - source = { url: src }; - } else if (isArrayBuffer(src)) { - source = { data: src }; - } else if (src instanceof PDFDataRangeTransport) { - source = { range: src }; - } else { - if (typeof src !== 'object') { - error('Invalid parameter in getDocument, need either Uint8Array, ' + - 'string or a parameter object'); - } - if (!src.url && !src.data && !src.range) { - error('Invalid parameter object: need either .data, .range or .url'); - } - - source = src; - } - - var params = {}; - var rangeTransport = null; - var worker = null; - for (var key in source) { - if (key === 'url' && typeof window !== 'undefined') { - // The full path is required in the 'url' field. - params[key] = combineUrl(window.location.href, source[key]); - continue; - } else if (key === 'range') { - rangeTransport = source[key]; - continue; - } else if (key === 'worker') { - worker = source[key]; - continue; - } else if (key === 'data' && !(source[key] instanceof Uint8Array)) { - // Converting string or array-like data to Uint8Array. - var pdfBytes = source[key]; - if (typeof pdfBytes === 'string') { - params[key] = stringToBytes(pdfBytes); - } else if (typeof pdfBytes === 'object' && pdfBytes !== null && - !isNaN(pdfBytes.length)) { - params[key] = new Uint8Array(pdfBytes); - } else if (isArrayBuffer(pdfBytes)) { - params[key] = new Uint8Array(pdfBytes); - } else { - error('Invalid PDF binary data: either typed array, string or ' + - 'array-like object is expected in the data property.'); - } - continue; - } - params[key] = source[key]; - } - - params.rangeChunkSize = params.rangeChunkSize || DEFAULT_RANGE_CHUNK_SIZE; - - if (!worker) { - // Worker was not provided -- creating and owning our own. - worker = new PDFWorker(); - task._worker = worker; - } - var docId = task.docId; - worker.promise.then(function () { - if (task.destroyed) { - throw new Error('Loading aborted'); - } - return _fetchDocument(worker, params, rangeTransport, docId).then( - function (workerId) { - if (task.destroyed) { - throw new Error('Loading aborted'); - } - var messageHandler = new MessageHandler(docId, workerId, worker.port); - messageHandler.send('Ready', null); - var transport = new WorkerTransport(messageHandler, task, rangeTransport); - task._transport = transport; - }); - }, task._capability.reject); - - return task; -}; - -/** - * Starts fetching of specified PDF document/data. - * @param {PDFWorker} worker - * @param {Object} source - * @param {PDFDataRangeTransport} pdfDataRangeTransport - * @param {string} docId Unique document id, used as MessageHandler id. - * @returns {Promise} The promise, which is resolved when worker id of - * MessageHandler is known. - * @private - */ -function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { - if (worker.destroyed) { - return Promise.reject(new Error('Worker was destroyed')); - } - - source.disableAutoFetch = PDFJS.disableAutoFetch; - source.disableStream = PDFJS.disableStream; - source.chunkedViewerLoading = !!pdfDataRangeTransport; - if (pdfDataRangeTransport) { - source.length = pdfDataRangeTransport.length; - source.initialData = pdfDataRangeTransport.initialData; - } - return worker.messageHandler.sendWithPromise('GetDocRequest', { - docId: docId, - source: source, - disableRange: PDFJS.disableRange, - maxImageSize: PDFJS.maxImageSize, - cMapUrl: PDFJS.cMapUrl, - cMapPacked: PDFJS.cMapPacked, - disableFontFace: PDFJS.disableFontFace, - disableCreateObjectURL: PDFJS.disableCreateObjectURL, - verbosity: PDFJS.verbosity - }).then(function (workerId) { - if (worker.destroyed) { - throw new Error('Worker was destroyed'); - } - return workerId; - }); -} - -/** - * PDF document loading operation. - * @class - * @alias PDFDocumentLoadingTask - */ -var PDFDocumentLoadingTask = (function PDFDocumentLoadingTaskClosure() { - var nextDocumentId = 0; - - /** @constructs PDFDocumentLoadingTask */ - function PDFDocumentLoadingTask() { - this._capability = createPromiseCapability(); - this._transport = null; - this._worker = null; - - /** - * Unique document loading task id -- used in MessageHandlers. - * @type {string} - */ - this.docId = 'd' + (nextDocumentId++); - - /** - * Shows if loading task is destroyed. - * @type {boolean} - */ - this.destroyed = false; - - /** - * Callback to request a password if wrong or no password was provided. - * The callback receives two parameters: function that needs to be called - * with new password and reason (see {PasswordResponses}). - */ - this.onPassword = null; - - /** - * Callback to be able to monitor the loading progress of the PDF file - * (necessary to implement e.g. a loading bar). The callback receives - * an {Object} with the properties: {number} loaded and {number} total. - */ - this.onProgress = null; - - /** - * Callback to when unsupported feature is used. The callback receives - * an {PDFJS.UNSUPPORTED_FEATURES} argument. - */ - this.onUnsupportedFeature = null; - } - - PDFDocumentLoadingTask.prototype = - /** @lends PDFDocumentLoadingTask.prototype */ { - /** - * @return {Promise} - */ - get promise() { - return this._capability.promise; - }, - - /** - * Aborts all network requests and destroys worker. - * @return {Promise} A promise that is resolved after destruction activity - * is completed. - */ - destroy: function () { - this.destroyed = true; - - var transportDestroyed = !this._transport ? Promise.resolve() : - this._transport.destroy(); - return transportDestroyed.then(function () { - this._transport = null; - if (this._worker) { - this._worker.destroy(); - this._worker = null; - } - }.bind(this)); - }, - - /** - * Registers callbacks to indicate the document loading completion. - * - * @param {function} onFulfilled The callback for the loading completion. - * @param {function} onRejected The callback for the loading failure. - * @return {Promise} A promise that is resolved after the onFulfilled or - * onRejected callback. - */ - then: function PDFDocumentLoadingTask_then(onFulfilled, onRejected) { - return this.promise.then.apply(this.promise, arguments); - } - }; - - return PDFDocumentLoadingTask; -})(); - -/** - * Abstract class to support range requests file loading. - * @class - * @alias PDFJS.PDFDataRangeTransport - * @param {number} length - * @param {Uint8Array} initialData - */ -var PDFDataRangeTransport = (function pdfDataRangeTransportClosure() { - function PDFDataRangeTransport(length, initialData) { - this.length = length; - this.initialData = initialData; - - this._rangeListeners = []; - this._progressListeners = []; - this._progressiveReadListeners = []; - this._readyCapability = createPromiseCapability(); - } - PDFDataRangeTransport.prototype = - /** @lends PDFDataRangeTransport.prototype */ { - addRangeListener: - function PDFDataRangeTransport_addRangeListener(listener) { - this._rangeListeners.push(listener); - }, - - addProgressListener: - function PDFDataRangeTransport_addProgressListener(listener) { - this._progressListeners.push(listener); - }, - - addProgressiveReadListener: - function PDFDataRangeTransport_addProgressiveReadListener(listener) { - this._progressiveReadListeners.push(listener); - }, - - onDataRange: function PDFDataRangeTransport_onDataRange(begin, chunk) { - var listeners = this._rangeListeners; - for (var i = 0, n = listeners.length; i < n; ++i) { - listeners[i](begin, chunk); - } - }, - - onDataProgress: function PDFDataRangeTransport_onDataProgress(loaded) { - this._readyCapability.promise.then(function () { - var listeners = this._progressListeners; - for (var i = 0, n = listeners.length; i < n; ++i) { - listeners[i](loaded); - } - }.bind(this)); - }, - - onDataProgressiveRead: - function PDFDataRangeTransport_onDataProgress(chunk) { - this._readyCapability.promise.then(function () { - var listeners = this._progressiveReadListeners; - for (var i = 0, n = listeners.length; i < n; ++i) { - listeners[i](chunk); - } - }.bind(this)); - }, - - transportReady: function PDFDataRangeTransport_transportReady() { - this._readyCapability.resolve(); - }, - - requestDataRange: - function PDFDataRangeTransport_requestDataRange(begin, end) { - throw new Error('Abstract method PDFDataRangeTransport.requestDataRange'); - }, - - abort: function PDFDataRangeTransport_abort() { - } - }; - return PDFDataRangeTransport; -})(); - -PDFJS.PDFDataRangeTransport = PDFDataRangeTransport; - -/** - * Proxy to a PDFDocument in the worker thread. Also, contains commonly used - * properties that can be read synchronously. - * @class - * @alias PDFDocumentProxy - */ -var PDFDocumentProxy = (function PDFDocumentProxyClosure() { - function PDFDocumentProxy(pdfInfo, transport, loadingTask) { - this.pdfInfo = pdfInfo; - this.transport = transport; - this.loadingTask = loadingTask; - } - PDFDocumentProxy.prototype = /** @lends PDFDocumentProxy.prototype */ { - /** - * @return {number} Total number of pages the PDF contains. - */ - get numPages() { - return this.pdfInfo.numPages; - }, - /** - * @return {string} A unique ID to identify a PDF. Not guaranteed to be - * unique. - */ - get fingerprint() { - return this.pdfInfo.fingerprint; - }, - /** - * @param {number} pageNumber The page number to get. The first page is 1. - * @return {Promise} A promise that is resolved with a {@link PDFPageProxy} - * object. - */ - getPage: function PDFDocumentProxy_getPage(pageNumber) { - return this.transport.getPage(pageNumber); - }, - /** - * @param {{num: number, gen: number}} ref The page reference. Must have - * the 'num' and 'gen' properties. - * @return {Promise} A promise that is resolved with the page index that is - * associated with the reference. - */ - getPageIndex: function PDFDocumentProxy_getPageIndex(ref) { - return this.transport.getPageIndex(ref); - }, - /** - * @return {Promise} A promise that is resolved with a lookup table for - * mapping named destinations to reference numbers. - * - * This can be slow for large documents: use getDestination instead - */ - getDestinations: function PDFDocumentProxy_getDestinations() { - return this.transport.getDestinations(); - }, - /** - * @param {string} id The named destination to get. - * @return {Promise} A promise that is resolved with all information - * of the given named destination. - */ - getDestination: function PDFDocumentProxy_getDestination(id) { - return this.transport.getDestination(id); - }, - /** - * @return {Promise} A promise that is resolved with a lookup table for - * mapping named attachments to their content. - */ - getAttachments: function PDFDocumentProxy_getAttachments() { - return this.transport.getAttachments(); - }, - /** - * @return {Promise} A promise that is resolved with an array of all the - * JavaScript strings in the name tree. - */ - getJavaScript: function PDFDocumentProxy_getJavaScript() { - return this.transport.getJavaScript(); - }, - /** - * @return {Promise} A promise that is resolved with an {Array} that is a - * tree outline (if it has one) of the PDF. The tree is in the format of: - * [ - * { - * title: string, - * bold: boolean, - * italic: boolean, - * color: rgb array, - * dest: dest obj, - * items: array of more items like this - * }, - * ... - * ]. - */ - getOutline: function PDFDocumentProxy_getOutline() { - return this.transport.getOutline(); - }, - /** - * @return {Promise} A promise that is resolved with an {Object} that has - * info and metadata properties. Info is an {Object} filled with anything - * available in the information dictionary and similarly metadata is a - * {Metadata} object with information from the metadata section of the PDF. - */ - getMetadata: function PDFDocumentProxy_getMetadata() { - return this.transport.getMetadata(); - }, - /** - * @return {Promise} A promise that is resolved with a TypedArray that has - * the raw data from the PDF. - */ - getData: function PDFDocumentProxy_getData() { - return this.transport.getData(); - }, - /** - * @return {Promise} A promise that is resolved when the document's data - * is loaded. It is resolved with an {Object} that contains the length - * property that indicates size of the PDF data in bytes. - */ - getDownloadInfo: function PDFDocumentProxy_getDownloadInfo() { - return this.transport.downloadInfoCapability.promise; - }, - /** - * @return {Promise} A promise this is resolved with current stats about - * document structures (see {@link PDFDocumentStats}). - */ - getStats: function PDFDocumentProxy_getStats() { - return this.transport.getStats(); - }, - /** - * Cleans up resources allocated by the document, e.g. created @font-face. - */ - cleanup: function PDFDocumentProxy_cleanup() { - this.transport.startCleanup(); - }, - /** - * Destroys current document instance and terminates worker. - */ - destroy: function PDFDocumentProxy_destroy() { - return this.loadingTask.destroy(); - } - }; - return PDFDocumentProxy; -})(); - -/** - * Page getTextContent parameters. - * - * @typedef {Object} getTextContentParameters - * @param {boolean} normalizeWhitespace - replaces all occurrences of - * whitespace with standard spaces (0x20). The default value is `false`. - */ - -/** - * Page text content. - * - * @typedef {Object} TextContent - * @property {array} items - array of {@link TextItem} - * @property {Object} styles - {@link TextStyles} objects, indexed by font - * name. - */ - -/** - * Page text content part. - * - * @typedef {Object} TextItem - * @property {string} str - text content. - * @property {string} dir - text direction: 'ttb', 'ltr' or 'rtl'. - * @property {array} transform - transformation matrix. - * @property {number} width - width in device space. - * @property {number} height - height in device space. - * @property {string} fontName - font name used by pdf.js for converted font. - */ - -/** - * Text style. - * - * @typedef {Object} TextStyle - * @property {number} ascent - font ascent. - * @property {number} descent - font descent. - * @property {boolean} vertical - text is in vertical mode. - * @property {string} fontFamily - possible font family - */ - -/** - * Page annotation parameters. - * - * @typedef {Object} GetAnnotationsParameters - * @param {string} intent - Determines the annotations that will be fetched, - * can be either 'display' (viewable annotations) or 'print' - * (printable annotations). - * If the parameter is omitted, all annotations are fetched. - */ - -/** - * Page render parameters. - * - * @typedef {Object} RenderParameters - * @property {Object} canvasContext - A 2D context of a DOM Canvas object. - * @property {PDFJS.PageViewport} viewport - Rendering viewport obtained by - * calling of PDFPage.getViewport method. - * @property {string} intent - Rendering intent, can be 'display' or 'print' - * (default value is 'display'). - * @property {Array} transform - (optional) Additional transform, applied - * just before viewport transform. - * @property {Object} imageLayer - (optional) An object that has beginLayout, - * endLayout and appendImage functions. - * @property {function} continueCallback - (deprecated) A function that will be - * called each time the rendering is paused. To continue - * rendering call the function that is the first argument - * to the callback. - */ - -/** - * PDF page operator list. - * - * @typedef {Object} PDFOperatorList - * @property {Array} fnArray - Array containing the operator functions. - * @property {Array} argsArray - Array containing the arguments of the - * functions. - */ - -/** - * Proxy to a PDFPage in the worker thread. - * @class - * @alias PDFPageProxy - */ -var PDFPageProxy = (function PDFPageProxyClosure() { - function PDFPageProxy(pageIndex, pageInfo, transport) { - this.pageIndex = pageIndex; - this.pageInfo = pageInfo; - this.transport = transport; - this.stats = new StatTimer(); - this.stats.enabled = !!globalScope.PDFJS.enableStats; - this.commonObjs = transport.commonObjs; - this.objs = new PDFObjects(); - this.cleanupAfterRender = false; - this.pendingCleanup = false; - this.intentStates = {}; - this.destroyed = false; - } - PDFPageProxy.prototype = /** @lends PDFPageProxy.prototype */ { - /** - * @return {number} Page number of the page. First page is 1. - */ - get pageNumber() { - return this.pageIndex + 1; - }, - /** - * @return {number} The number of degrees the page is rotated clockwise. - */ - get rotate() { - return this.pageInfo.rotate; - }, - /** - * @return {Object} The reference that points to this page. It has 'num' and - * 'gen' properties. - */ - get ref() { - return this.pageInfo.ref; - }, - /** - * @return {Array} An array of the visible portion of the PDF page in the - * user space units - [x1, y1, x2, y2]. - */ - get view() { - return this.pageInfo.view; - }, - /** - * @param {number} scale The desired scale of the viewport. - * @param {number} rotate Degrees to rotate the viewport. If omitted this - * defaults to the page rotation. - * @return {PDFJS.PageViewport} Contains 'width' and 'height' properties - * along with transforms required for rendering. - */ - getViewport: function PDFPageProxy_getViewport(scale, rotate) { - if (arguments.length < 2) { - rotate = this.rotate; - } - return new PDFJS.PageViewport(this.view, scale, rotate, 0, 0); - }, - /** - * @param {GetAnnotationsParameters} params - Annotation parameters. - * @return {Promise} A promise that is resolved with an {Array} of the - * annotation objects. - */ - getAnnotations: function PDFPageProxy_getAnnotations(params) { - var intent = (params && params.intent) || null; - - if (!this.annotationsPromise || this.annotationsIntent !== intent) { - this.annotationsPromise = this.transport.getAnnotations(this.pageIndex, - intent); - this.annotationsIntent = intent; - } - return this.annotationsPromise; - }, - /** - * Begins the process of rendering a page to the desired context. - * @param {RenderParameters} params Page render parameters. - * @return {RenderTask} An object that contains the promise, which - * is resolved when the page finishes rendering. - */ - render: function PDFPageProxy_render(params) { - var stats = this.stats; - stats.time('Overall'); - - // If there was a pending destroy cancel it so no cleanup happens during - // this call to render. - this.pendingCleanup = false; - - var renderingIntent = (params.intent === 'print' ? 'print' : 'display'); - - if (!this.intentStates[renderingIntent]) { - this.intentStates[renderingIntent] = {}; - } - var intentState = this.intentStates[renderingIntent]; - - // If there's no displayReadyCapability yet, then the operatorList - // was never requested before. Make the request and create the promise. - if (!intentState.displayReadyCapability) { - intentState.receivingOperatorList = true; - intentState.displayReadyCapability = createPromiseCapability(); - intentState.operatorList = { - fnArray: [], - argsArray: [], - lastChunk: false - }; - - this.stats.time('Page Request'); - this.transport.messageHandler.send('RenderPageRequest', { - pageIndex: this.pageNumber - 1, - intent: renderingIntent - }); - } - - var internalRenderTask = new InternalRenderTask(complete, params, - this.objs, - this.commonObjs, - intentState.operatorList, - this.pageNumber); - internalRenderTask.useRequestAnimationFrame = renderingIntent !== 'print'; - if (!intentState.renderTasks) { - intentState.renderTasks = []; - } - intentState.renderTasks.push(internalRenderTask); - var renderTask = internalRenderTask.task; - - // Obsolete parameter support - if (params.continueCallback) { - deprecated('render is used with continueCallback parameter'); - renderTask.onContinue = params.continueCallback; - } - - var self = this; - intentState.displayReadyCapability.promise.then( - function pageDisplayReadyPromise(transparency) { - if (self.pendingCleanup) { - complete(); - return; - } - stats.time('Rendering'); - internalRenderTask.initalizeGraphics(transparency); - internalRenderTask.operatorListChanged(); - }, - function pageDisplayReadPromiseError(reason) { - complete(reason); - } - ); - - function complete(error) { - var i = intentState.renderTasks.indexOf(internalRenderTask); - if (i >= 0) { - intentState.renderTasks.splice(i, 1); - } - - if (self.cleanupAfterRender) { - self.pendingCleanup = true; - } - self._tryCleanup(); - - if (error) { - internalRenderTask.capability.reject(error); - } else { - internalRenderTask.capability.resolve(); - } - stats.timeEnd('Rendering'); - stats.timeEnd('Overall'); - } - - return renderTask; - }, - - /** - * @return {Promise} A promise resolved with an {@link PDFOperatorList} - * object that represents page's operator list. - */ - getOperatorList: function PDFPageProxy_getOperatorList() { - function operatorListChanged() { - if (intentState.operatorList.lastChunk) { - intentState.opListReadCapability.resolve(intentState.operatorList); - } - } - - var renderingIntent = 'oplist'; - if (!this.intentStates[renderingIntent]) { - this.intentStates[renderingIntent] = {}; - } - var intentState = this.intentStates[renderingIntent]; - - if (!intentState.opListReadCapability) { - var opListTask = {}; - opListTask.operatorListChanged = operatorListChanged; - intentState.receivingOperatorList = true; - intentState.opListReadCapability = createPromiseCapability(); - intentState.renderTasks = []; - intentState.renderTasks.push(opListTask); - intentState.operatorList = { - fnArray: [], - argsArray: [], - lastChunk: false - }; - - this.transport.messageHandler.send('RenderPageRequest', { - pageIndex: this.pageIndex, - intent: renderingIntent - }); - } - return intentState.opListReadCapability.promise; - }, - - /** - * @param {getTextContentParameters} params - getTextContent parameters. - * @return {Promise} That is resolved a {@link TextContent} - * object that represent the page text content. - */ - getTextContent: function PDFPageProxy_getTextContent(params) { - var normalizeWhitespace = (params && params.normalizeWhitespace) || false; - - return this.transport.messageHandler.sendWithPromise('GetTextContent', { - pageIndex: this.pageNumber - 1, - normalizeWhitespace: normalizeWhitespace, - }); - }, - - /** - * Destroys page object. - */ - _destroy: function PDFPageProxy_destroy() { - this.destroyed = true; - this.transport.pageCache[this.pageIndex] = null; - - var waitOn = []; - Object.keys(this.intentStates).forEach(function(intent) { - var intentState = this.intentStates[intent]; - intentState.renderTasks.forEach(function(renderTask) { - var renderCompleted = renderTask.capability.promise. - catch(function () {}); // ignoring failures - waitOn.push(renderCompleted); - renderTask.cancel(); - }); - }, this); - this.objs.clear(); - this.annotationsPromise = null; - this.pendingCleanup = false; - return Promise.all(waitOn); - }, - - /** - * Cleans up resources allocated by the page. (deprecated) - */ - destroy: function() { - deprecated('page destroy method, use cleanup() instead'); - this.cleanup(); - }, - - /** - * Cleans up resources allocated by the page. - */ - cleanup: function PDFPageProxy_cleanup() { - this.pendingCleanup = true; - this._tryCleanup(); - }, - /** - * For internal use only. Attempts to clean up if rendering is in a state - * where that's possible. - * @ignore - */ - _tryCleanup: function PDFPageProxy_tryCleanup() { - if (!this.pendingCleanup || - Object.keys(this.intentStates).some(function(intent) { - var intentState = this.intentStates[intent]; - return (intentState.renderTasks.length !== 0 || - intentState.receivingOperatorList); - }, this)) { - return; - } - - Object.keys(this.intentStates).forEach(function(intent) { - delete this.intentStates[intent]; - }, this); - this.objs.clear(); - this.annotationsPromise = null; - this.pendingCleanup = false; - }, - /** - * For internal use only. - * @ignore - */ - _startRenderPage: function PDFPageProxy_startRenderPage(transparency, - intent) { - var intentState = this.intentStates[intent]; - // TODO Refactor RenderPageRequest to separate rendering - // and operator list logic - if (intentState.displayReadyCapability) { - intentState.displayReadyCapability.resolve(transparency); - } - }, - /** - * For internal use only. - * @ignore - */ - _renderPageChunk: function PDFPageProxy_renderPageChunk(operatorListChunk, - intent) { - var intentState = this.intentStates[intent]; - var i, ii; - // Add the new chunk to the current operator list. - for (i = 0, ii = operatorListChunk.length; i < ii; i++) { - intentState.operatorList.fnArray.push(operatorListChunk.fnArray[i]); - intentState.operatorList.argsArray.push( - operatorListChunk.argsArray[i]); - } - intentState.operatorList.lastChunk = operatorListChunk.lastChunk; - - // Notify all the rendering tasks there are more operators to be consumed. - for (i = 0; i < intentState.renderTasks.length; i++) { - intentState.renderTasks[i].operatorListChanged(); - } - - if (operatorListChunk.lastChunk) { - intentState.receivingOperatorList = false; - this._tryCleanup(); - } - } - }; - return PDFPageProxy; -})(); - -/** - * PDF.js web worker abstraction, it controls instantiation of PDF documents and - * WorkerTransport for them. If creation of a web worker is not possible, - * a "fake" worker will be used instead. - * @class - */ -var PDFWorker = (function PDFWorkerClosure() { - var nextFakeWorkerId = 0; - - // Loads worker code into main thread. - function setupFakeWorkerGlobal() { - if (!PDFJS.fakeWorkerFilesLoadedCapability) { - PDFJS.fakeWorkerFilesLoadedCapability = createPromiseCapability(); - // In the developer build load worker_loader which in turn loads all the - // other files and resolves the promise. In production only the - // pdf.worker.js file is needed. - Util.loadScript(PDFJS.workerSrc, function() { - PDFJS.fakeWorkerFilesLoadedCapability.resolve(); - }); - } - return PDFJS.fakeWorkerFilesLoadedCapability.promise; - } - - function PDFWorker(name) { - this.name = name; - this.destroyed = false; - - this._readyCapability = createPromiseCapability(); - this._port = null; - this._webWorker = null; - this._messageHandler = null; - this._initialize(); - } - - PDFWorker.prototype = /** @lends PDFWorker.prototype */ { - get promise() { - return this._readyCapability.promise; - }, - - get port() { - return this._port; - }, - - get messageHandler() { - return this._messageHandler; - }, - - _initialize: function PDFWorker_initialize() { - // If worker support isn't disabled explicit and the browser has worker - // support, create a new web worker and test if it/the browser fullfills - // all requirements to run parts of pdf.js in a web worker. - // Right now, the requirement is, that an Uint8Array is still an - // Uint8Array as it arrives on the worker. (Chrome added this with v.15.) - if (!globalScope.PDFJS.disableWorker && typeof Worker !== 'undefined') { - var workerSrc = PDFJS.workerSrc; - if (!workerSrc) { - error('No PDFJS.workerSrc specified'); - } - - try { - // Some versions of FF can't create a worker on localhost, see: - // https://bugzilla.mozilla.org/show_bug.cgi?id=683280 - var worker = new Worker(workerSrc); - var messageHandler = new MessageHandler('main', 'worker', worker); - - messageHandler.on('test', function PDFWorker_test(data) { - if (this.destroyed) { - this._readyCapability.reject(new Error('Worker was destroyed')); - messageHandler.destroy(); - worker.terminate(); - return; // worker was destroyed - } - var supportTypedArray = data && data.supportTypedArray; - if (supportTypedArray) { - this._messageHandler = messageHandler; - this._port = worker; - this._webWorker = worker; - if (!data.supportTransfers) { - PDFJS.postMessageTransfers = false; - } - this._readyCapability.resolve(); - } else { - this._setupFakeWorker(); - messageHandler.destroy(); - worker.terminate(); - } - }.bind(this)); - - messageHandler.on('console_log', function (data) { - console.log.apply(console, data); - }); - messageHandler.on('console_error', function (data) { - console.error.apply(console, data); - }); - - var testObj = new Uint8Array([PDFJS.postMessageTransfers ? 255 : 0]); - // Some versions of Opera throw a DATA_CLONE_ERR on serializing the - // typed array. Also, checking if we can use transfers. - try { - messageHandler.send('test', testObj, [testObj.buffer]); - } catch (ex) { - info('Cannot use postMessage transfers'); - testObj[0] = 0; - messageHandler.send('test', testObj); - } - return; - } catch (e) { - info('The worker has been disabled.'); - } - } - // Either workers are disabled, not supported or have thrown an exception. - // Thus, we fallback to a faked worker. - this._setupFakeWorker(); - }, - - _setupFakeWorker: function PDFWorker_setupFakeWorker() { - warn('Setting up fake worker.'); - globalScope.PDFJS.disableWorker = true; - - setupFakeWorkerGlobal().then(function () { - if (this.destroyed) { - this._readyCapability.reject(new Error('Worker was destroyed')); - return; - } - - // If we don't use a worker, just post/sendMessage to the main thread. - var port = { - _listeners: [], - postMessage: function (obj) { - var e = {data: obj}; - this._listeners.forEach(function (listener) { - listener.call(this, e); - }, this); - }, - addEventListener: function (name, listener) { - this._listeners.push(listener); - }, - removeEventListener: function (name, listener) { - var i = this._listeners.indexOf(listener); - this._listeners.splice(i, 1); - }, - terminate: function () {} - }; - this._port = port; - - // All fake workers use the same port, making id unique. - var id = 'fake' + (nextFakeWorkerId++); - - // If the main thread is our worker, setup the handling for the - // messages -- the main thread sends to it self. - var workerHandler = new MessageHandler(id + '_worker', id, port); - PDFJS.WorkerMessageHandler.setup(workerHandler, port); - - var messageHandler = new MessageHandler(id, id + '_worker', port); - this._messageHandler = messageHandler; - this._readyCapability.resolve(); - }.bind(this)); - }, - - /** - * Destroys the worker instance. - */ - destroy: function PDFWorker_destroy() { - this.destroyed = true; - if (this._webWorker) { - // We need to terminate only web worker created resource. - this._webWorker.terminate(); - this._webWorker = null; - } - this._port = null; - if (this._messageHandler) { - this._messageHandler.destroy(); - this._messageHandler = null; - } - } - }; - - return PDFWorker; -})(); -PDFJS.PDFWorker = PDFWorker; - -/** - * For internal use only. - * @ignore - */ -var WorkerTransport = (function WorkerTransportClosure() { - function WorkerTransport(messageHandler, loadingTask, pdfDataRangeTransport) { - this.messageHandler = messageHandler; - this.loadingTask = loadingTask; - this.pdfDataRangeTransport = pdfDataRangeTransport; - this.commonObjs = new PDFObjects(); - this.fontLoader = new FontLoader(loadingTask.docId); - - this.destroyed = false; - this.destroyCapability = null; - - this.pageCache = []; - this.pagePromises = []; - this.downloadInfoCapability = createPromiseCapability(); - - this.setupMessageHandler(); - } - WorkerTransport.prototype = { - destroy: function WorkerTransport_destroy() { - if (this.destroyCapability) { - return this.destroyCapability.promise; - } - - this.destroyed = true; - this.destroyCapability = createPromiseCapability(); - - var waitOn = []; - // We need to wait for all renderings to be completed, e.g. - // timeout/rAF can take a long time. - this.pageCache.forEach(function (page) { - if (page) { - waitOn.push(page._destroy()); - } - }); - this.pageCache = []; - this.pagePromises = []; - var self = this; - // We also need to wait for the worker to finish its long running tasks. - var terminated = this.messageHandler.sendWithPromise('Terminate', null); - waitOn.push(terminated); - Promise.all(waitOn).then(function () { - self.fontLoader.clear(); - if (self.pdfDataRangeTransport) { - self.pdfDataRangeTransport.abort(); - self.pdfDataRangeTransport = null; - } - if (self.messageHandler) { - self.messageHandler.destroy(); - self.messageHandler = null; - } - self.destroyCapability.resolve(); - }, this.destroyCapability.reject); - return this.destroyCapability.promise; - }, - - setupMessageHandler: - function WorkerTransport_setupMessageHandler() { - var messageHandler = this.messageHandler; - - function updatePassword(password) { - messageHandler.send('UpdatePassword', password); - } - - var pdfDataRangeTransport = this.pdfDataRangeTransport; - if (pdfDataRangeTransport) { - pdfDataRangeTransport.addRangeListener(function(begin, chunk) { - messageHandler.send('OnDataRange', { - begin: begin, - chunk: chunk - }); - }); - - pdfDataRangeTransport.addProgressListener(function(loaded) { - messageHandler.send('OnDataProgress', { - loaded: loaded - }); - }); - - pdfDataRangeTransport.addProgressiveReadListener(function(chunk) { - messageHandler.send('OnDataRange', { - chunk: chunk - }); - }); - - messageHandler.on('RequestDataRange', - function transportDataRange(data) { - pdfDataRangeTransport.requestDataRange(data.begin, data.end); - }, this); - } - - messageHandler.on('GetDoc', function transportDoc(data) { - var pdfInfo = data.pdfInfo; - this.numPages = data.pdfInfo.numPages; - var loadingTask = this.loadingTask; - var pdfDocument = new PDFDocumentProxy(pdfInfo, this, loadingTask); - this.pdfDocument = pdfDocument; - loadingTask._capability.resolve(pdfDocument); - }, this); - - messageHandler.on('NeedPassword', - function transportNeedPassword(exception) { - var loadingTask = this.loadingTask; - if (loadingTask.onPassword) { - return loadingTask.onPassword(updatePassword, - PasswordResponses.NEED_PASSWORD); - } - loadingTask._capability.reject( - new PasswordException(exception.message, exception.code)); - }, this); - - messageHandler.on('IncorrectPassword', - function transportIncorrectPassword(exception) { - var loadingTask = this.loadingTask; - if (loadingTask.onPassword) { - return loadingTask.onPassword(updatePassword, - PasswordResponses.INCORRECT_PASSWORD); - } - loadingTask._capability.reject( - new PasswordException(exception.message, exception.code)); - }, this); - - messageHandler.on('InvalidPDF', function transportInvalidPDF(exception) { - this.loadingTask._capability.reject( - new InvalidPDFException(exception.message)); - }, this); - - messageHandler.on('MissingPDF', function transportMissingPDF(exception) { - this.loadingTask._capability.reject( - new MissingPDFException(exception.message)); - }, this); - - messageHandler.on('UnexpectedResponse', - function transportUnexpectedResponse(exception) { - this.loadingTask._capability.reject( - new UnexpectedResponseException(exception.message, exception.status)); - }, this); - - messageHandler.on('UnknownError', - function transportUnknownError(exception) { - this.loadingTask._capability.reject( - new UnknownErrorException(exception.message, exception.details)); - }, this); - - messageHandler.on('DataLoaded', function transportPage(data) { - this.downloadInfoCapability.resolve(data); - }, this); - - messageHandler.on('PDFManagerReady', function transportPage(data) { - if (this.pdfDataRangeTransport) { - this.pdfDataRangeTransport.transportReady(); - } - }, this); - - messageHandler.on('StartRenderPage', function transportRender(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - var page = this.pageCache[data.pageIndex]; - - page.stats.timeEnd('Page Request'); - page._startRenderPage(data.transparency, data.intent); - }, this); - - messageHandler.on('RenderPageChunk', function transportRender(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - var page = this.pageCache[data.pageIndex]; - - page._renderPageChunk(data.operatorList, data.intent); - }, this); - - messageHandler.on('commonobj', function transportObj(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - - var id = data[0]; - var type = data[1]; - if (this.commonObjs.hasData(id)) { - return; - } - - switch (type) { - case 'Font': - var exportedData = data[2]; - - var font; - if ('error' in exportedData) { - var error = exportedData.error; - warn('Error during font loading: ' + error); - this.commonObjs.resolve(id, error); - break; - } else { - font = new FontFaceObject(exportedData); - } - - this.fontLoader.bind( - [font], - function fontReady(fontObjs) { - this.commonObjs.resolve(id, font); - }.bind(this) - ); - break; - case 'FontPath': - this.commonObjs.resolve(id, data[2]); - break; - default: - error('Got unknown common object type ' + type); - } - }, this); - - messageHandler.on('obj', function transportObj(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - - var id = data[0]; - var pageIndex = data[1]; - var type = data[2]; - var pageProxy = this.pageCache[pageIndex]; - var imageData; - if (pageProxy.objs.hasData(id)) { - return; - } - - switch (type) { - case 'JpegStream': - imageData = data[3]; - loadJpegStream(id, imageData, pageProxy.objs); - break; - case 'Image': - imageData = data[3]; - pageProxy.objs.resolve(id, imageData); - - // heuristics that will allow not to store large data - var MAX_IMAGE_SIZE_TO_STORE = 8000000; - if (imageData && 'data' in imageData && - imageData.data.length > MAX_IMAGE_SIZE_TO_STORE) { - pageProxy.cleanupAfterRender = true; - } - break; - default: - error('Got unknown object type ' + type); - } - }, this); - - messageHandler.on('DocProgress', function transportDocProgress(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - - var loadingTask = this.loadingTask; - if (loadingTask.onProgress) { - loadingTask.onProgress({ - loaded: data.loaded, - total: data.total - }); - } - }, this); - - messageHandler.on('PageError', function transportError(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - - var page = this.pageCache[data.pageNum - 1]; - var intentState = page.intentStates[data.intent]; - if (intentState.displayReadyCapability) { - intentState.displayReadyCapability.reject(data.error); - } else { - error(data.error); - } - }, this); - - messageHandler.on('UnsupportedFeature', - function transportUnsupportedFeature(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - var featureId = data.featureId; - var loadingTask = this.loadingTask; - if (loadingTask.onUnsupportedFeature) { - loadingTask.onUnsupportedFeature(featureId); - } - PDFJS.UnsupportedManager.notify(featureId); - }, this); - - messageHandler.on('JpegDecode', function(data) { - if (this.destroyed) { - return Promise.reject('Worker was terminated'); - } - - var imageUrl = data[0]; - var components = data[1]; - if (components !== 3 && components !== 1) { - return Promise.reject( - new Error('Only 3 components or 1 component can be returned')); - } - - return new Promise(function (resolve, reject) { - var img = new Image(); - img.onload = function () { - var width = img.width; - var height = img.height; - var size = width * height; - var rgbaLength = size * 4; - var buf = new Uint8Array(size * components); - var tmpCanvas = createScratchCanvas(width, height); - var tmpCtx = tmpCanvas.getContext('2d'); - tmpCtx.drawImage(img, 0, 0); - var data = tmpCtx.getImageData(0, 0, width, height).data; - var i, j; - - if (components === 3) { - for (i = 0, j = 0; i < rgbaLength; i += 4, j += 3) { - buf[j] = data[i]; - buf[j + 1] = data[i + 1]; - buf[j + 2] = data[i + 2]; - } - } else if (components === 1) { - for (i = 0, j = 0; i < rgbaLength; i += 4, j++) { - buf[j] = data[i]; - } - } - resolve({ data: buf, width: width, height: height}); - }; - img.onerror = function () { - reject(new Error('JpegDecode failed to load image')); - }; - img.src = imageUrl; - }); - }, this); - }, - - getData: function WorkerTransport_getData() { - return this.messageHandler.sendWithPromise('GetData', null); - }, - - getPage: function WorkerTransport_getPage(pageNumber, capability) { - if (pageNumber <= 0 || pageNumber > this.numPages || - (pageNumber|0) !== pageNumber) { - return Promise.reject(new Error('Invalid page request')); - } - - var pageIndex = pageNumber - 1; - if (pageIndex in this.pagePromises) { - return this.pagePromises[pageIndex]; - } - var promise = this.messageHandler.sendWithPromise('GetPage', { - pageIndex: pageIndex - }).then(function (pageInfo) { - if (this.destroyed) { - throw new Error('Transport destroyed'); - } - var page = new PDFPageProxy(pageIndex, pageInfo, this); - this.pageCache[pageIndex] = page; - return page; - }.bind(this)); - this.pagePromises[pageIndex] = promise; - return promise; - }, - - getPageIndex: function WorkerTransport_getPageIndexByRef(ref) { - return this.messageHandler.sendWithPromise('GetPageIndex', { ref: ref }); - }, - - getAnnotations: function WorkerTransport_getAnnotations(pageIndex, intent) { - return this.messageHandler.sendWithPromise('GetAnnotations', { - pageIndex: pageIndex, - intent: intent, - }); - }, - - getDestinations: function WorkerTransport_getDestinations() { - return this.messageHandler.sendWithPromise('GetDestinations', null); - }, - - getDestination: function WorkerTransport_getDestination(id) { - return this.messageHandler.sendWithPromise('GetDestination', { id: id }); - }, - - getAttachments: function WorkerTransport_getAttachments() { - return this.messageHandler.sendWithPromise('GetAttachments', null); - }, - - getJavaScript: function WorkerTransport_getJavaScript() { - return this.messageHandler.sendWithPromise('GetJavaScript', null); - }, - - getOutline: function WorkerTransport_getOutline() { - return this.messageHandler.sendWithPromise('GetOutline', null); - }, - - getMetadata: function WorkerTransport_getMetadata() { - return this.messageHandler.sendWithPromise('GetMetadata', null). - then(function transportMetadata(results) { - return { - info: results[0], - metadata: (results[1] ? new PDFJS.Metadata(results[1]) : null) - }; - }); - }, - - getStats: function WorkerTransport_getStats() { - return this.messageHandler.sendWithPromise('GetStats', null); - }, - - startCleanup: function WorkerTransport_startCleanup() { - this.messageHandler.sendWithPromise('Cleanup', null). - then(function endCleanup() { - for (var i = 0, ii = this.pageCache.length; i < ii; i++) { - var page = this.pageCache[i]; - if (page) { - page.cleanup(); - } - } - this.commonObjs.clear(); - this.fontLoader.clear(); - }.bind(this)); - } - }; - return WorkerTransport; - -})(); - -/** - * A PDF document and page is built of many objects. E.g. there are objects - * for fonts, images, rendering code and such. These objects might get processed - * inside of a worker. The `PDFObjects` implements some basic functions to - * manage these objects. - * @ignore - */ -var PDFObjects = (function PDFObjectsClosure() { - function PDFObjects() { - this.objs = {}; - } - - PDFObjects.prototype = { - /** - * Internal function. - * Ensures there is an object defined for `objId`. - */ - ensureObj: function PDFObjects_ensureObj(objId) { - if (this.objs[objId]) { - return this.objs[objId]; - } - - var obj = { - capability: createPromiseCapability(), - data: null, - resolved: false - }; - this.objs[objId] = obj; - - return obj; - }, - - /** - * If called *without* callback, this returns the data of `objId` but the - * object needs to be resolved. If it isn't, this function throws. - * - * If called *with* a callback, the callback is called with the data of the - * object once the object is resolved. That means, if you call this - * function and the object is already resolved, the callback gets called - * right away. - */ - get: function PDFObjects_get(objId, callback) { - // If there is a callback, then the get can be async and the object is - // not required to be resolved right now - if (callback) { - this.ensureObj(objId).capability.promise.then(callback); - return null; - } - - // If there isn't a callback, the user expects to get the resolved data - // directly. - var obj = this.objs[objId]; - - // If there isn't an object yet or the object isn't resolved, then the - // data isn't ready yet! - if (!obj || !obj.resolved) { - error('Requesting object that isn\'t resolved yet ' + objId); - } - - return obj.data; - }, - - /** - * Resolves the object `objId` with optional `data`. - */ - resolve: function PDFObjects_resolve(objId, data) { - var obj = this.ensureObj(objId); - - obj.resolved = true; - obj.data = data; - obj.capability.resolve(data); - }, - - isResolved: function PDFObjects_isResolved(objId) { - var objs = this.objs; - - if (!objs[objId]) { - return false; - } else { - return objs[objId].resolved; - } - }, - - hasData: function PDFObjects_hasData(objId) { - return this.isResolved(objId); - }, - - /** - * Returns the data of `objId` if object exists, null otherwise. - */ - getData: function PDFObjects_getData(objId) { - var objs = this.objs; - if (!objs[objId] || !objs[objId].resolved) { - return null; - } else { - return objs[objId].data; - } - }, - - clear: function PDFObjects_clear() { - this.objs = {}; - } - }; - return PDFObjects; -})(); - -/** - * Allows controlling of the rendering tasks. - * @class - * @alias RenderTask - */ -var RenderTask = (function RenderTaskClosure() { - function RenderTask(internalRenderTask) { - this._internalRenderTask = internalRenderTask; - - /** - * Callback for incremental rendering -- a function that will be called - * each time the rendering is paused. To continue rendering call the - * function that is the first argument to the callback. - * @type {function} - */ - this.onContinue = null; - } - - RenderTask.prototype = /** @lends RenderTask.prototype */ { - /** - * Promise for rendering task completion. - * @return {Promise} - */ - get promise() { - return this._internalRenderTask.capability.promise; - }, - - /** - * Cancels the rendering task. If the task is currently rendering it will - * not be cancelled until graphics pauses with a timeout. The promise that - * this object extends will resolved when cancelled. - */ - cancel: function RenderTask_cancel() { - this._internalRenderTask.cancel(); - }, - - /** - * Registers callbacks to indicate the rendering task completion. - * - * @param {function} onFulfilled The callback for the rendering completion. - * @param {function} onRejected The callback for the rendering failure. - * @return {Promise} A promise that is resolved after the onFulfilled or - * onRejected callback. - */ - then: function RenderTask_then(onFulfilled, onRejected) { - return this.promise.then.apply(this.promise, arguments); - } - }; - - return RenderTask; -})(); - -/** - * For internal use only. - * @ignore - */ -var InternalRenderTask = (function InternalRenderTaskClosure() { - - function InternalRenderTask(callback, params, objs, commonObjs, operatorList, - pageNumber) { - this.callback = callback; - this.params = params; - this.objs = objs; - this.commonObjs = commonObjs; - this.operatorListIdx = null; - this.operatorList = operatorList; - this.pageNumber = pageNumber; - this.running = false; - this.graphicsReadyCallback = null; - this.graphicsReady = false; - this.useRequestAnimationFrame = false; - this.cancelled = false; - this.capability = createPromiseCapability(); - this.task = new RenderTask(this); - // caching this-bound methods - this._continueBound = this._continue.bind(this); - this._scheduleNextBound = this._scheduleNext.bind(this); - this._nextBound = this._next.bind(this); - } - - InternalRenderTask.prototype = { - - initalizeGraphics: - function InternalRenderTask_initalizeGraphics(transparency) { - - if (this.cancelled) { - return; - } - if (PDFJS.pdfBug && 'StepperManager' in globalScope && - globalScope.StepperManager.enabled) { - this.stepper = globalScope.StepperManager.create(this.pageNumber - 1); - this.stepper.init(this.operatorList); - this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint(); - } - - var params = this.params; - this.gfx = new CanvasGraphics(params.canvasContext, this.commonObjs, - this.objs, params.imageLayer); - - this.gfx.beginDrawing(params.transform, params.viewport, transparency); - this.operatorListIdx = 0; - this.graphicsReady = true; - if (this.graphicsReadyCallback) { - this.graphicsReadyCallback(); - } - }, - - cancel: function InternalRenderTask_cancel() { - this.running = false; - this.cancelled = true; - this.callback('cancelled'); - }, - - operatorListChanged: function InternalRenderTask_operatorListChanged() { - if (!this.graphicsReady) { - if (!this.graphicsReadyCallback) { - this.graphicsReadyCallback = this._continueBound; - } - return; - } - - if (this.stepper) { - this.stepper.updateOperatorList(this.operatorList); - } - - if (this.running) { - return; - } - this._continue(); - }, - - _continue: function InternalRenderTask__continue() { - this.running = true; - if (this.cancelled) { - return; - } - if (this.task.onContinue) { - this.task.onContinue.call(this.task, this._scheduleNextBound); - } else { - this._scheduleNext(); - } - }, - - _scheduleNext: function InternalRenderTask__scheduleNext() { - if (this.useRequestAnimationFrame) { - window.requestAnimationFrame(this._nextBound); - } else { - Promise.resolve(undefined).then(this._nextBound); - } - }, - - _next: function InternalRenderTask__next() { - if (this.cancelled) { - return; - } - this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, - this.operatorListIdx, - this._continueBound, - this.stepper); - if (this.operatorListIdx === this.operatorList.argsArray.length) { - this.running = false; - if (this.operatorList.lastChunk) { - this.gfx.endDrawing(); - this.callback(); - } - } - } - - }; - - return InternalRenderTask; -})(); - -/** - * (Deprecated) Global observer of unsupported feature usages. Use - * onUnsupportedFeature callback of the {PDFDocumentLoadingTask} instance. - */ -PDFJS.UnsupportedManager = (function UnsupportedManagerClosure() { - var listeners = []; - return { - listen: function (cb) { - deprecated('Global UnsupportedManager.listen is used: ' + - ' use PDFDocumentLoadingTask.onUnsupportedFeature instead'); - listeners.push(cb); - }, - notify: function (featureId) { - for (var i = 0, ii = listeners.length; i < ii; i++) { - listeners[i](featureId); - } - } - }; -})(); - - -var Metadata = PDFJS.Metadata = (function MetadataClosure() { - function fixMetadata(meta) { - return meta.replace(/>\\376\\377([^<]+)/g, function(all, codes) { - var bytes = codes.replace(/\\([0-3])([0-7])([0-7])/g, - function(code, d1, d2, d3) { - return String.fromCharCode(d1 * 64 + d2 * 8 + d3 * 1); - }); - var chars = ''; - for (var i = 0; i < bytes.length; i += 2) { - var code = bytes.charCodeAt(i) * 256 + bytes.charCodeAt(i + 1); - chars += code >= 32 && code < 127 && code !== 60 && code !== 62 && - code !== 38 && false ? String.fromCharCode(code) : - '&#x' + (0x10000 + code).toString(16).substring(1) + ';'; - } - return '>' + chars; - }); - } - - function Metadata(meta) { - if (typeof meta === 'string') { - // Ghostscript produces invalid metadata - meta = fixMetadata(meta); - - var parser = new DOMParser(); - meta = parser.parseFromString(meta, 'application/xml'); - } else if (!(meta instanceof Document)) { - error('Metadata: Invalid metadata object'); - } - - this.metaDocument = meta; - this.metadata = {}; - this.parse(); - } - - Metadata.prototype = { - parse: function Metadata_parse() { - var doc = this.metaDocument; - var rdf = doc.documentElement; - - if (rdf.nodeName.toLowerCase() !== 'rdf:rdf') { // Wrapped in - rdf = rdf.firstChild; - while (rdf && rdf.nodeName.toLowerCase() !== 'rdf:rdf') { - rdf = rdf.nextSibling; - } - } - - var nodeName = (rdf) ? rdf.nodeName.toLowerCase() : null; - if (!rdf || nodeName !== 'rdf:rdf' || !rdf.hasChildNodes()) { - return; - } - - var children = rdf.childNodes, desc, entry, name, i, ii, length, iLength; - for (i = 0, length = children.length; i < length; i++) { - desc = children[i]; - if (desc.nodeName.toLowerCase() !== 'rdf:description') { - continue; - } - - for (ii = 0, iLength = desc.childNodes.length; ii < iLength; ii++) { - if (desc.childNodes[ii].nodeName.toLowerCase() !== '#text') { - entry = desc.childNodes[ii]; - name = entry.nodeName.toLowerCase(); - this.metadata[name] = entry.textContent.trim(); - } - } - } - }, - - get: function Metadata_get(name) { - return this.metadata[name] || null; - }, - - has: function Metadata_has(name) { - return typeof this.metadata[name] !== 'undefined'; - } - }; - - return Metadata; -})(); - - -// contexts store most of the state we need natively. -// However, PDF needs a bit more state, which we store here. - -// Minimal font size that would be used during canvas fillText operations. -var MIN_FONT_SIZE = 16; -// Maximum font size that would be used during canvas fillText operations. -var MAX_FONT_SIZE = 100; -var MAX_GROUP_SIZE = 4096; - -// Heuristic value used when enforcing minimum line widths. -var MIN_WIDTH_FACTOR = 0.65; - -var COMPILE_TYPE3_GLYPHS = true; -var MAX_SIZE_TO_COMPILE = 1000; - -var FULL_CHUNK_HEIGHT = 16; - -function createScratchCanvas(width, height) { - var canvas = document.createElement('canvas'); - canvas.width = width; - canvas.height = height; - return canvas; -} - -function addContextCurrentTransform(ctx) { - // If the context doesn't expose a `mozCurrentTransform`, add a JS based one. - if (!ctx.mozCurrentTransform) { - ctx._originalSave = ctx.save; - ctx._originalRestore = ctx.restore; - ctx._originalRotate = ctx.rotate; - ctx._originalScale = ctx.scale; - ctx._originalTranslate = ctx.translate; - ctx._originalTransform = ctx.transform; - ctx._originalSetTransform = ctx.setTransform; - - ctx._transformMatrix = ctx._transformMatrix || [1, 0, 0, 1, 0, 0]; - ctx._transformStack = []; - - Object.defineProperty(ctx, 'mozCurrentTransform', { - get: function getCurrentTransform() { - return this._transformMatrix; - } - }); - - Object.defineProperty(ctx, 'mozCurrentTransformInverse', { - get: function getCurrentTransformInverse() { - // Calculation done using WolframAlpha: - // http://www.wolframalpha.com/input/? - // i=Inverse+{{a%2C+c%2C+e}%2C+{b%2C+d%2C+f}%2C+{0%2C+0%2C+1}} - - var m = this._transformMatrix; - var a = m[0], b = m[1], c = m[2], d = m[3], e = m[4], f = m[5]; - - var ad_bc = a * d - b * c; - var bc_ad = b * c - a * d; - - return [ - d / ad_bc, - b / bc_ad, - c / bc_ad, - a / ad_bc, - (d * e - c * f) / bc_ad, - (b * e - a * f) / ad_bc - ]; - } - }); - - ctx.save = function ctxSave() { - var old = this._transformMatrix; - this._transformStack.push(old); - this._transformMatrix = old.slice(0, 6); - - this._originalSave(); - }; - - ctx.restore = function ctxRestore() { - var prev = this._transformStack.pop(); - if (prev) { - this._transformMatrix = prev; - this._originalRestore(); - } - }; - - ctx.translate = function ctxTranslate(x, y) { - var m = this._transformMatrix; - m[4] = m[0] * x + m[2] * y + m[4]; - m[5] = m[1] * x + m[3] * y + m[5]; - - this._originalTranslate(x, y); - }; - - ctx.scale = function ctxScale(x, y) { - var m = this._transformMatrix; - m[0] = m[0] * x; - m[1] = m[1] * x; - m[2] = m[2] * y; - m[3] = m[3] * y; - - this._originalScale(x, y); - }; - - ctx.transform = function ctxTransform(a, b, c, d, e, f) { - var m = this._transformMatrix; - this._transformMatrix = [ - m[0] * a + m[2] * b, - m[1] * a + m[3] * b, - m[0] * c + m[2] * d, - m[1] * c + m[3] * d, - m[0] * e + m[2] * f + m[4], - m[1] * e + m[3] * f + m[5] - ]; - - ctx._originalTransform(a, b, c, d, e, f); - }; - - ctx.setTransform = function ctxSetTransform(a, b, c, d, e, f) { - this._transformMatrix = [a, b, c, d, e, f]; - - ctx._originalSetTransform(a, b, c, d, e, f); - }; - - ctx.rotate = function ctxRotate(angle) { - var cosValue = Math.cos(angle); - var sinValue = Math.sin(angle); - - var m = this._transformMatrix; - this._transformMatrix = [ - m[0] * cosValue + m[2] * sinValue, - m[1] * cosValue + m[3] * sinValue, - m[0] * (-sinValue) + m[2] * cosValue, - m[1] * (-sinValue) + m[3] * cosValue, - m[4], - m[5] - ]; - - this._originalRotate(angle); - }; - } -} - -var CachedCanvases = (function CachedCanvasesClosure() { - function CachedCanvases() { - this.cache = Object.create(null); - } - CachedCanvases.prototype = { - getCanvas: function CachedCanvases_getCanvas(id, width, height, - trackTransform) { - var canvasEntry; - if (this.cache[id] !== undefined) { - canvasEntry = this.cache[id]; - canvasEntry.canvas.width = width; - canvasEntry.canvas.height = height; - // reset canvas transform for emulated mozCurrentTransform, if needed - canvasEntry.context.setTransform(1, 0, 0, 1, 0, 0); - } else { - var canvas = createScratchCanvas(width, height); - var ctx = canvas.getContext('2d'); - if (trackTransform) { - addContextCurrentTransform(ctx); - } - this.cache[id] = canvasEntry = {canvas: canvas, context: ctx}; - } - return canvasEntry; - }, - clear: function () { - for (var id in this.cache) { - var canvasEntry = this.cache[id]; - // Zeroing the width and height causes Firefox to release graphics - // resources immediately, which can greatly reduce memory consumption. - canvasEntry.canvas.width = 0; - canvasEntry.canvas.height = 0; - delete this.cache[id]; - } - } - }; - return CachedCanvases; -})(); - -function compileType3Glyph(imgData) { - var POINT_TO_PROCESS_LIMIT = 1000; - - var width = imgData.width, height = imgData.height; - var i, j, j0, width1 = width + 1; - var points = new Uint8Array(width1 * (height + 1)); - var POINT_TYPES = - new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]); - - // decodes bit-packed mask data - var lineSize = (width + 7) & ~7, data0 = imgData.data; - var data = new Uint8Array(lineSize * height), pos = 0, ii; - for (i = 0, ii = data0.length; i < ii; i++) { - var mask = 128, elem = data0[i]; - while (mask > 0) { - data[pos++] = (elem & mask) ? 0 : 255; - mask >>= 1; - } - } - - // finding iteresting points: every point is located between mask pixels, - // so there will be points of the (width + 1)x(height + 1) grid. Every point - // will have flags assigned based on neighboring mask pixels: - // 4 | 8 - // --P-- - // 2 | 1 - // We are interested only in points with the flags: - // - outside corners: 1, 2, 4, 8; - // - inside corners: 7, 11, 13, 14; - // - and, intersections: 5, 10. - var count = 0; - pos = 0; - if (data[pos] !== 0) { - points[0] = 1; - ++count; - } - for (j = 1; j < width; j++) { - if (data[pos] !== data[pos + 1]) { - points[j] = data[pos] ? 2 : 1; - ++count; - } - pos++; - } - if (data[pos] !== 0) { - points[j] = 2; - ++count; - } - for (i = 1; i < height; i++) { - pos = i * lineSize; - j0 = i * width1; - if (data[pos - lineSize] !== data[pos]) { - points[j0] = data[pos] ? 1 : 8; - ++count; - } - // 'sum' is the position of the current pixel configuration in the 'TYPES' - // array (in order 8-1-2-4, so we can use '>>2' to shift the column). - var sum = (data[pos] ? 4 : 0) + (data[pos - lineSize] ? 8 : 0); - for (j = 1; j < width; j++) { - sum = (sum >> 2) + (data[pos + 1] ? 4 : 0) + - (data[pos - lineSize + 1] ? 8 : 0); - if (POINT_TYPES[sum]) { - points[j0 + j] = POINT_TYPES[sum]; - ++count; - } - pos++; - } - if (data[pos - lineSize] !== data[pos]) { - points[j0 + j] = data[pos] ? 2 : 4; - ++count; - } - - if (count > POINT_TO_PROCESS_LIMIT) { - return null; - } - } - - pos = lineSize * (height - 1); - j0 = i * width1; - if (data[pos] !== 0) { - points[j0] = 8; - ++count; - } - for (j = 1; j < width; j++) { - if (data[pos] !== data[pos + 1]) { - points[j0 + j] = data[pos] ? 4 : 8; - ++count; - } - pos++; - } - if (data[pos] !== 0) { - points[j0 + j] = 4; - ++count; - } - if (count > POINT_TO_PROCESS_LIMIT) { - return null; - } - - // building outlines - var steps = new Int32Array([0, width1, -1, 0, -width1, 0, 0, 0, 1]); - var outlines = []; - for (i = 0; count && i <= height; i++) { - var p = i * width1; - var end = p + width; - while (p < end && !points[p]) { - p++; - } - if (p === end) { - continue; - } - var coords = [p % width1, i]; - - var type = points[p], p0 = p, pp; - do { - var step = steps[type]; - do { - p += step; - } while (!points[p]); - - pp = points[p]; - if (pp !== 5 && pp !== 10) { - // set new direction - type = pp; - // delete mark - points[p] = 0; - } else { // type is 5 or 10, ie, a crossing - // set new direction - type = pp & ((0x33 * type) >> 4); - // set new type for "future hit" - points[p] &= (type >> 2 | type << 2); - } - - coords.push(p % width1); - coords.push((p / width1) | 0); - --count; - } while (p0 !== p); - outlines.push(coords); - --i; - } - - var drawOutline = function(c) { - c.save(); - // the path shall be painted in [0..1]x[0..1] space - c.scale(1 / width, -1 / height); - c.translate(0, -height); - c.beginPath(); - for (var i = 0, ii = outlines.length; i < ii; i++) { - var o = outlines[i]; - c.moveTo(o[0], o[1]); - for (var j = 2, jj = o.length; j < jj; j += 2) { - c.lineTo(o[j], o[j+1]); - } - } - c.fill(); - c.beginPath(); - c.restore(); - }; - - return drawOutline; -} - -var CanvasExtraState = (function CanvasExtraStateClosure() { - function CanvasExtraState(old) { - // Are soft masks and alpha values shapes or opacities? - this.alphaIsShape = false; - this.fontSize = 0; - this.fontSizeScale = 1; - this.textMatrix = IDENTITY_MATRIX; - this.textMatrixScale = 1; - this.fontMatrix = FONT_IDENTITY_MATRIX; - this.leading = 0; - // Current point (in user coordinates) - this.x = 0; - this.y = 0; - // Start of text line (in text coordinates) - this.lineX = 0; - this.lineY = 0; - // Character and word spacing - this.charSpacing = 0; - this.wordSpacing = 0; - this.textHScale = 1; - this.textRenderingMode = TextRenderingMode.FILL; - this.textRise = 0; - // Default fore and background colors - this.fillColor = '#000000'; - this.strokeColor = '#000000'; - this.patternFill = false; - // Note: fill alpha applies to all non-stroking operations - this.fillAlpha = 1; - this.strokeAlpha = 1; - this.lineWidth = 1; - this.activeSMask = null; // nonclonable field (see the save method below) - - this.old = old; - } - - CanvasExtraState.prototype = { - clone: function CanvasExtraState_clone() { - return Object.create(this); - }, - setCurrentPoint: function CanvasExtraState_setCurrentPoint(x, y) { - this.x = x; - this.y = y; - } - }; - return CanvasExtraState; -})(); - -var CanvasGraphics = (function CanvasGraphicsClosure() { - // Defines the time the executeOperatorList is going to be executing - // before it stops and shedules a continue of execution. - var EXECUTION_TIME = 15; - // Defines the number of steps before checking the execution time - var EXECUTION_STEPS = 10; - - function CanvasGraphics(canvasCtx, commonObjs, objs, imageLayer) { - this.ctx = canvasCtx; - this.current = new CanvasExtraState(); - this.stateStack = []; - this.pendingClip = null; - this.pendingEOFill = false; - this.res = null; - this.xobjs = null; - this.commonObjs = commonObjs; - this.objs = objs; - this.imageLayer = imageLayer; - this.groupStack = []; - this.processingType3 = null; - // Patterns are painted relative to the initial page/form transform, see pdf - // spec 8.7.2 NOTE 1. - this.baseTransform = null; - this.baseTransformStack = []; - this.groupLevel = 0; - this.smaskStack = []; - this.smaskCounter = 0; - this.tempSMask = null; - this.cachedCanvases = new CachedCanvases(); - if (canvasCtx) { - // NOTE: if mozCurrentTransform is polyfilled, then the current state of - // the transformation must already be set in canvasCtx._transformMatrix. - addContextCurrentTransform(canvasCtx); - } - this.cachedGetSinglePixelWidth = null; - } - - function putBinaryImageData(ctx, imgData) { - if (typeof ImageData !== 'undefined' && imgData instanceof ImageData) { - ctx.putImageData(imgData, 0, 0); - return; - } - - // Put the image data to the canvas in chunks, rather than putting the - // whole image at once. This saves JS memory, because the ImageData object - // is smaller. It also possibly saves C++ memory within the implementation - // of putImageData(). (E.g. in Firefox we make two short-lived copies of - // the data passed to putImageData()). |n| shouldn't be too small, however, - // because too many putImageData() calls will slow things down. - // - // Note: as written, if the last chunk is partial, the putImageData() call - // will (conceptually) put pixels past the bounds of the canvas. But - // that's ok; any such pixels are ignored. - - var height = imgData.height, width = imgData.width; - var partialChunkHeight = height % FULL_CHUNK_HEIGHT; - var fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT; - var totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1; - - var chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT); - var srcPos = 0, destPos; - var src = imgData.data; - var dest = chunkImgData.data; - var i, j, thisChunkHeight, elemsInThisChunk; - - // There are multiple forms in which the pixel data can be passed, and - // imgData.kind tells us which one this is. - if (imgData.kind === ImageKind.GRAYSCALE_1BPP) { - // Grayscale, 1 bit per pixel (i.e. black-and-white). - var srcLength = src.byteLength; - var dest32 = PDFJS.hasCanvasTypedArrays ? new Uint32Array(dest.buffer) : - new Uint32ArrayView(dest); - var dest32DataLength = dest32.length; - var fullSrcDiff = (width + 7) >> 3; - var white = 0xFFFFFFFF; - var black = (PDFJS.isLittleEndian || !PDFJS.hasCanvasTypedArrays) ? - 0xFF000000 : 0x000000FF; - for (i = 0; i < totalChunks; i++) { - thisChunkHeight = - (i < fullChunks) ? FULL_CHUNK_HEIGHT : partialChunkHeight; - destPos = 0; - for (j = 0; j < thisChunkHeight; j++) { - var srcDiff = srcLength - srcPos; - var k = 0; - var kEnd = (srcDiff > fullSrcDiff) ? width : srcDiff * 8 - 7; - var kEndUnrolled = kEnd & ~7; - var mask = 0; - var srcByte = 0; - for (; k < kEndUnrolled; k += 8) { - srcByte = src[srcPos++]; - dest32[destPos++] = (srcByte & 128) ? white : black; - dest32[destPos++] = (srcByte & 64) ? white : black; - dest32[destPos++] = (srcByte & 32) ? white : black; - dest32[destPos++] = (srcByte & 16) ? white : black; - dest32[destPos++] = (srcByte & 8) ? white : black; - dest32[destPos++] = (srcByte & 4) ? white : black; - dest32[destPos++] = (srcByte & 2) ? white : black; - dest32[destPos++] = (srcByte & 1) ? white : black; - } - for (; k < kEnd; k++) { - if (mask === 0) { - srcByte = src[srcPos++]; - mask = 128; - } - - dest32[destPos++] = (srcByte & mask) ? white : black; - mask >>= 1; - } - } - // We ran out of input. Make all remaining pixels transparent. - while (destPos < dest32DataLength) { - dest32[destPos++] = 0; - } - - ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); - } - } else if (imgData.kind === ImageKind.RGBA_32BPP) { - // RGBA, 32-bits per pixel. - - j = 0; - elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4; - for (i = 0; i < fullChunks; i++) { - dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); - srcPos += elemsInThisChunk; - - ctx.putImageData(chunkImgData, 0, j); - j += FULL_CHUNK_HEIGHT; - } - if (i < totalChunks) { - elemsInThisChunk = width * partialChunkHeight * 4; - dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); - ctx.putImageData(chunkImgData, 0, j); - } - - } else if (imgData.kind === ImageKind.RGB_24BPP) { - // RGB, 24-bits per pixel. - thisChunkHeight = FULL_CHUNK_HEIGHT; - elemsInThisChunk = width * thisChunkHeight; - for (i = 0; i < totalChunks; i++) { - if (i >= fullChunks) { - thisChunkHeight = partialChunkHeight; - elemsInThisChunk = width * thisChunkHeight; - } - - destPos = 0; - for (j = elemsInThisChunk; j--;) { - dest[destPos++] = src[srcPos++]; - dest[destPos++] = src[srcPos++]; - dest[destPos++] = src[srcPos++]; - dest[destPos++] = 255; - } - ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); - } - } else { - error('bad image kind: ' + imgData.kind); - } - } - - function putBinaryImageMask(ctx, imgData) { - var height = imgData.height, width = imgData.width; - var partialChunkHeight = height % FULL_CHUNK_HEIGHT; - var fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT; - var totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1; - - var chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT); - var srcPos = 0; - var src = imgData.data; - var dest = chunkImgData.data; - - for (var i = 0; i < totalChunks; i++) { - var thisChunkHeight = - (i < fullChunks) ? FULL_CHUNK_HEIGHT : partialChunkHeight; - - // Expand the mask so it can be used by the canvas. Any required - // inversion has already been handled. - var destPos = 3; // alpha component offset - for (var j = 0; j < thisChunkHeight; j++) { - var mask = 0; - for (var k = 0; k < width; k++) { - if (!mask) { - var elem = src[srcPos++]; - mask = 128; - } - dest[destPos] = (elem & mask) ? 0 : 255; - destPos += 4; - mask >>= 1; - } - } - ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); - } - } - - function copyCtxState(sourceCtx, destCtx) { - var properties = ['strokeStyle', 'fillStyle', 'fillRule', 'globalAlpha', - 'lineWidth', 'lineCap', 'lineJoin', 'miterLimit', - 'globalCompositeOperation', 'font']; - for (var i = 0, ii = properties.length; i < ii; i++) { - var property = properties[i]; - if (sourceCtx[property] !== undefined) { - destCtx[property] = sourceCtx[property]; - } - } - if (sourceCtx.setLineDash !== undefined) { - destCtx.setLineDash(sourceCtx.getLineDash()); - destCtx.lineDashOffset = sourceCtx.lineDashOffset; - } else if (sourceCtx.mozDashOffset !== undefined) { - destCtx.mozDash = sourceCtx.mozDash; - destCtx.mozDashOffset = sourceCtx.mozDashOffset; - } - } - - function composeSMaskBackdrop(bytes, r0, g0, b0) { - var length = bytes.length; - for (var i = 3; i < length; i += 4) { - var alpha = bytes[i]; - if (alpha === 0) { - bytes[i - 3] = r0; - bytes[i - 2] = g0; - bytes[i - 1] = b0; - } else if (alpha < 255) { - var alpha_ = 255 - alpha; - bytes[i - 3] = (bytes[i - 3] * alpha + r0 * alpha_) >> 8; - bytes[i - 2] = (bytes[i - 2] * alpha + g0 * alpha_) >> 8; - bytes[i - 1] = (bytes[i - 1] * alpha + b0 * alpha_) >> 8; - } - } - } - - function composeSMaskAlpha(maskData, layerData, transferMap) { - var length = maskData.length; - var scale = 1 / 255; - for (var i = 3; i < length; i += 4) { - var alpha = transferMap ? transferMap[maskData[i]] : maskData[i]; - layerData[i] = (layerData[i] * alpha * scale) | 0; - } - } - - function composeSMaskLuminosity(maskData, layerData, transferMap) { - var length = maskData.length; - for (var i = 3; i < length; i += 4) { - var y = (maskData[i - 3] * 77) + // * 0.3 / 255 * 0x10000 - (maskData[i - 2] * 152) + // * 0.59 .... - (maskData[i - 1] * 28); // * 0.11 .... - layerData[i] = transferMap ? - (layerData[i] * transferMap[y >> 8]) >> 8 : - (layerData[i] * y) >> 16; - } - } - - function genericComposeSMask(maskCtx, layerCtx, width, height, - subtype, backdrop, transferMap) { - var hasBackdrop = !!backdrop; - var r0 = hasBackdrop ? backdrop[0] : 0; - var g0 = hasBackdrop ? backdrop[1] : 0; - var b0 = hasBackdrop ? backdrop[2] : 0; - - var composeFn; - if (subtype === 'Luminosity') { - composeFn = composeSMaskLuminosity; - } else { - composeFn = composeSMaskAlpha; - } - - // processing image in chunks to save memory - var PIXELS_TO_PROCESS = 1048576; - var chunkSize = Math.min(height, Math.ceil(PIXELS_TO_PROCESS / width)); - for (var row = 0; row < height; row += chunkSize) { - var chunkHeight = Math.min(chunkSize, height - row); - var maskData = maskCtx.getImageData(0, row, width, chunkHeight); - var layerData = layerCtx.getImageData(0, row, width, chunkHeight); - - if (hasBackdrop) { - composeSMaskBackdrop(maskData.data, r0, g0, b0); - } - composeFn(maskData.data, layerData.data, transferMap); - - maskCtx.putImageData(layerData, 0, row); - } - } - - function composeSMask(ctx, smask, layerCtx) { - var mask = smask.canvas; - var maskCtx = smask.context; - - ctx.setTransform(smask.scaleX, 0, 0, smask.scaleY, - smask.offsetX, smask.offsetY); - - var backdrop = smask.backdrop || null; - if (!smask.transferMap && WebGLUtils.isEnabled) { - var composed = WebGLUtils.composeSMask(layerCtx.canvas, mask, - {subtype: smask.subtype, backdrop: backdrop}); - ctx.setTransform(1, 0, 0, 1, 0, 0); - ctx.drawImage(composed, smask.offsetX, smask.offsetY); - return; - } - genericComposeSMask(maskCtx, layerCtx, mask.width, mask.height, - smask.subtype, backdrop, smask.transferMap); - ctx.drawImage(mask, 0, 0); - } - - var LINE_CAP_STYLES = ['butt', 'round', 'square']; - var LINE_JOIN_STYLES = ['miter', 'round', 'bevel']; - var NORMAL_CLIP = {}; - var EO_CLIP = {}; - - CanvasGraphics.prototype = { - - beginDrawing: function CanvasGraphics_beginDrawing(transform, viewport, - transparency) { - // For pdfs that use blend modes we have to clear the canvas else certain - // blend modes can look wrong since we'd be blending with a white - // backdrop. The problem with a transparent backdrop though is we then - // don't get sub pixel anti aliasing on text, creating temporary - // transparent canvas when we have blend modes. - var width = this.ctx.canvas.width; - var height = this.ctx.canvas.height; - - this.ctx.save(); - this.ctx.fillStyle = 'rgb(255, 255, 255)'; - this.ctx.fillRect(0, 0, width, height); - this.ctx.restore(); - - if (transparency) { - var transparentCanvas = this.cachedCanvases.getCanvas( - 'transparent', width, height, true); - this.compositeCtx = this.ctx; - this.transparentCanvas = transparentCanvas.canvas; - this.ctx = transparentCanvas.context; - this.ctx.save(); - // The transform can be applied before rendering, transferring it to - // the new canvas. - this.ctx.transform.apply(this.ctx, - this.compositeCtx.mozCurrentTransform); - } - - this.ctx.save(); - if (transform) { - this.ctx.transform.apply(this.ctx, transform); - } - this.ctx.transform.apply(this.ctx, viewport.transform); - - this.baseTransform = this.ctx.mozCurrentTransform.slice(); - - if (this.imageLayer) { - this.imageLayer.beginLayout(); - } - }, - - executeOperatorList: function CanvasGraphics_executeOperatorList( - operatorList, - executionStartIdx, continueCallback, - stepper) { - var argsArray = operatorList.argsArray; - var fnArray = operatorList.fnArray; - var i = executionStartIdx || 0; - var argsArrayLen = argsArray.length; - - // Sometimes the OperatorList to execute is empty. - if (argsArrayLen === i) { - return i; - } - - var chunkOperations = (argsArrayLen - i > EXECUTION_STEPS && - typeof continueCallback === 'function'); - var endTime = chunkOperations ? Date.now() + EXECUTION_TIME : 0; - var steps = 0; - - var commonObjs = this.commonObjs; - var objs = this.objs; - var fnId; - - while (true) { - if (stepper !== undefined && i === stepper.nextBreakPoint) { - stepper.breakIt(i, continueCallback); - return i; - } - - fnId = fnArray[i]; - - if (fnId !== OPS.dependency) { - this[fnId].apply(this, argsArray[i]); - } else { - var deps = argsArray[i]; - for (var n = 0, nn = deps.length; n < nn; n++) { - var depObjId = deps[n]; - var common = depObjId[0] === 'g' && depObjId[1] === '_'; - var objsPool = common ? commonObjs : objs; - - // If the promise isn't resolved yet, add the continueCallback - // to the promise and bail out. - if (!objsPool.isResolved(depObjId)) { - objsPool.get(depObjId, continueCallback); - return i; - } - } - } - - i++; - - // If the entire operatorList was executed, stop as were done. - if (i === argsArrayLen) { - return i; - } - - // If the execution took longer then a certain amount of time and - // `continueCallback` is specified, interrupt the execution. - if (chunkOperations && ++steps > EXECUTION_STEPS) { - if (Date.now() > endTime) { - continueCallback(); - return i; - } - steps = 0; - } - - // If the operatorList isn't executed completely yet OR the execution - // time was short enough, do another execution round. - } - }, - - endDrawing: function CanvasGraphics_endDrawing() { - this.ctx.restore(); - - if (this.transparentCanvas) { - this.ctx = this.compositeCtx; - this.ctx.drawImage(this.transparentCanvas, 0, 0); - this.transparentCanvas = null; - } - - this.cachedCanvases.clear(); - WebGLUtils.clear(); - - if (this.imageLayer) { - this.imageLayer.endLayout(); - } - }, - - // Graphics state - setLineWidth: function CanvasGraphics_setLineWidth(width) { - this.current.lineWidth = width; - this.ctx.lineWidth = width; - }, - setLineCap: function CanvasGraphics_setLineCap(style) { - this.ctx.lineCap = LINE_CAP_STYLES[style]; - }, - setLineJoin: function CanvasGraphics_setLineJoin(style) { - this.ctx.lineJoin = LINE_JOIN_STYLES[style]; - }, - setMiterLimit: function CanvasGraphics_setMiterLimit(limit) { - this.ctx.miterLimit = limit; - }, - setDash: function CanvasGraphics_setDash(dashArray, dashPhase) { - var ctx = this.ctx; - if (ctx.setLineDash !== undefined) { - ctx.setLineDash(dashArray); - ctx.lineDashOffset = dashPhase; - } else { - ctx.mozDash = dashArray; - ctx.mozDashOffset = dashPhase; - } - }, - setRenderingIntent: function CanvasGraphics_setRenderingIntent(intent) { - // Maybe if we one day fully support color spaces this will be important - // for now we can ignore. - // TODO set rendering intent? - }, - setFlatness: function CanvasGraphics_setFlatness(flatness) { - // There's no way to control this with canvas, but we can safely ignore. - // TODO set flatness? - }, - setGState: function CanvasGraphics_setGState(states) { - for (var i = 0, ii = states.length; i < ii; i++) { - var state = states[i]; - var key = state[0]; - var value = state[1]; - - switch (key) { - case 'LW': - this.setLineWidth(value); - break; - case 'LC': - this.setLineCap(value); - break; - case 'LJ': - this.setLineJoin(value); - break; - case 'ML': - this.setMiterLimit(value); - break; - case 'D': - this.setDash(value[0], value[1]); - break; - case 'RI': - this.setRenderingIntent(value); - break; - case 'FL': - this.setFlatness(value); - break; - case 'Font': - this.setFont(value[0], value[1]); - break; - case 'CA': - this.current.strokeAlpha = state[1]; - break; - case 'ca': - this.current.fillAlpha = state[1]; - this.ctx.globalAlpha = state[1]; - break; - case 'BM': - if (value && value.name && (value.name !== 'Normal')) { - var mode = value.name.replace(/([A-Z])/g, - function(c) { - return '-' + c.toLowerCase(); - } - ).substring(1); - this.ctx.globalCompositeOperation = mode; - if (this.ctx.globalCompositeOperation !== mode) { - warn('globalCompositeOperation "' + mode + - '" is not supported'); - } - } else { - this.ctx.globalCompositeOperation = 'source-over'; - } - break; - case 'SMask': - if (this.current.activeSMask) { - this.endSMaskGroup(); - } - this.current.activeSMask = value ? this.tempSMask : null; - if (this.current.activeSMask) { - this.beginSMaskGroup(); - } - this.tempSMask = null; - break; - } - } - }, - beginSMaskGroup: function CanvasGraphics_beginSMaskGroup() { - - var activeSMask = this.current.activeSMask; - var drawnWidth = activeSMask.canvas.width; - var drawnHeight = activeSMask.canvas.height; - var cacheId = 'smaskGroupAt' + this.groupLevel; - var scratchCanvas = this.cachedCanvases.getCanvas( - cacheId, drawnWidth, drawnHeight, true); - - var currentCtx = this.ctx; - var currentTransform = currentCtx.mozCurrentTransform; - this.ctx.save(); - - var groupCtx = scratchCanvas.context; - groupCtx.scale(1 / activeSMask.scaleX, 1 / activeSMask.scaleY); - groupCtx.translate(-activeSMask.offsetX, -activeSMask.offsetY); - groupCtx.transform.apply(groupCtx, currentTransform); - - copyCtxState(currentCtx, groupCtx); - this.ctx = groupCtx; - this.setGState([ - ['BM', 'Normal'], - ['ca', 1], - ['CA', 1] - ]); - this.groupStack.push(currentCtx); - this.groupLevel++; - }, - endSMaskGroup: function CanvasGraphics_endSMaskGroup() { - var groupCtx = this.ctx; - this.groupLevel--; - this.ctx = this.groupStack.pop(); - - composeSMask(this.ctx, this.current.activeSMask, groupCtx); - this.ctx.restore(); - copyCtxState(groupCtx, this.ctx); - }, - save: function CanvasGraphics_save() { - this.ctx.save(); - var old = this.current; - this.stateStack.push(old); - this.current = old.clone(); - this.current.activeSMask = null; - }, - restore: function CanvasGraphics_restore() { - if (this.stateStack.length !== 0) { - if (this.current.activeSMask !== null) { - this.endSMaskGroup(); - } - - this.current = this.stateStack.pop(); - this.ctx.restore(); - - // Ensure that the clipping path is reset (fixes issue6413.pdf). - this.pendingClip = null; - - this.cachedGetSinglePixelWidth = null; - } - }, - transform: function CanvasGraphics_transform(a, b, c, d, e, f) { - this.ctx.transform(a, b, c, d, e, f); - - this.cachedGetSinglePixelWidth = null; - }, - - // Path - constructPath: function CanvasGraphics_constructPath(ops, args) { - var ctx = this.ctx; - var current = this.current; - var x = current.x, y = current.y; - for (var i = 0, j = 0, ii = ops.length; i < ii; i++) { - switch (ops[i] | 0) { - case OPS.rectangle: - x = args[j++]; - y = args[j++]; - var width = args[j++]; - var height = args[j++]; - if (width === 0) { - width = this.getSinglePixelWidth(); - } - if (height === 0) { - height = this.getSinglePixelWidth(); - } - var xw = x + width; - var yh = y + height; - this.ctx.moveTo(x, y); - this.ctx.lineTo(xw, y); - this.ctx.lineTo(xw, yh); - this.ctx.lineTo(x, yh); - this.ctx.lineTo(x, y); - this.ctx.closePath(); - break; - case OPS.moveTo: - x = args[j++]; - y = args[j++]; - ctx.moveTo(x, y); - break; - case OPS.lineTo: - x = args[j++]; - y = args[j++]; - ctx.lineTo(x, y); - break; - case OPS.curveTo: - x = args[j + 4]; - y = args[j + 5]; - ctx.bezierCurveTo(args[j], args[j + 1], args[j + 2], args[j + 3], - x, y); - j += 6; - break; - case OPS.curveTo2: - ctx.bezierCurveTo(x, y, args[j], args[j + 1], - args[j + 2], args[j + 3]); - x = args[j + 2]; - y = args[j + 3]; - j += 4; - break; - case OPS.curveTo3: - x = args[j + 2]; - y = args[j + 3]; - ctx.bezierCurveTo(args[j], args[j + 1], x, y, x, y); - j += 4; - break; - case OPS.closePath: - ctx.closePath(); - break; - } - } - current.setCurrentPoint(x, y); - }, - closePath: function CanvasGraphics_closePath() { - this.ctx.closePath(); - }, - stroke: function CanvasGraphics_stroke(consumePath) { - consumePath = typeof consumePath !== 'undefined' ? consumePath : true; - var ctx = this.ctx; - var strokeColor = this.current.strokeColor; - // Prevent drawing too thin lines by enforcing a minimum line width. - ctx.lineWidth = Math.max(this.getSinglePixelWidth() * MIN_WIDTH_FACTOR, - this.current.lineWidth); - // For stroke we want to temporarily change the global alpha to the - // stroking alpha. - ctx.globalAlpha = this.current.strokeAlpha; - if (strokeColor && strokeColor.hasOwnProperty('type') && - strokeColor.type === 'Pattern') { - // for patterns, we transform to pattern space, calculate - // the pattern, call stroke, and restore to user space - ctx.save(); - ctx.strokeStyle = strokeColor.getPattern(ctx, this); - ctx.stroke(); - ctx.restore(); - } else { - ctx.stroke(); - } - if (consumePath) { - this.consumePath(); - } - // Restore the global alpha to the fill alpha - ctx.globalAlpha = this.current.fillAlpha; - }, - closeStroke: function CanvasGraphics_closeStroke() { - this.closePath(); - this.stroke(); - }, - fill: function CanvasGraphics_fill(consumePath) { - consumePath = typeof consumePath !== 'undefined' ? consumePath : true; - var ctx = this.ctx; - var fillColor = this.current.fillColor; - var isPatternFill = this.current.patternFill; - var needRestore = false; - - if (isPatternFill) { - ctx.save(); - if (this.baseTransform) { - ctx.setTransform.apply(ctx, this.baseTransform); - } - ctx.fillStyle = fillColor.getPattern(ctx, this); - needRestore = true; - } - - if (this.pendingEOFill) { - if (ctx.mozFillRule !== undefined) { - ctx.mozFillRule = 'evenodd'; - ctx.fill(); - ctx.mozFillRule = 'nonzero'; - } else { - ctx.fill('evenodd'); - } - this.pendingEOFill = false; - } else { - ctx.fill(); - } - - if (needRestore) { - ctx.restore(); - } - if (consumePath) { - this.consumePath(); - } - }, - eoFill: function CanvasGraphics_eoFill() { - this.pendingEOFill = true; - this.fill(); - }, - fillStroke: function CanvasGraphics_fillStroke() { - this.fill(false); - this.stroke(false); - - this.consumePath(); - }, - eoFillStroke: function CanvasGraphics_eoFillStroke() { - this.pendingEOFill = true; - this.fillStroke(); - }, - closeFillStroke: function CanvasGraphics_closeFillStroke() { - this.closePath(); - this.fillStroke(); - }, - closeEOFillStroke: function CanvasGraphics_closeEOFillStroke() { - this.pendingEOFill = true; - this.closePath(); - this.fillStroke(); - }, - endPath: function CanvasGraphics_endPath() { - this.consumePath(); - }, - - // Clipping - clip: function CanvasGraphics_clip() { - this.pendingClip = NORMAL_CLIP; - }, - eoClip: function CanvasGraphics_eoClip() { - this.pendingClip = EO_CLIP; - }, - - // Text - beginText: function CanvasGraphics_beginText() { - this.current.textMatrix = IDENTITY_MATRIX; - this.current.textMatrixScale = 1; - this.current.x = this.current.lineX = 0; - this.current.y = this.current.lineY = 0; - }, - endText: function CanvasGraphics_endText() { - var paths = this.pendingTextPaths; - var ctx = this.ctx; - if (paths === undefined) { - ctx.beginPath(); - return; - } - - ctx.save(); - ctx.beginPath(); - for (var i = 0; i < paths.length; i++) { - var path = paths[i]; - ctx.setTransform.apply(ctx, path.transform); - ctx.translate(path.x, path.y); - path.addToPath(ctx, path.fontSize); - } - ctx.restore(); - ctx.clip(); - ctx.beginPath(); - delete this.pendingTextPaths; - }, - setCharSpacing: function CanvasGraphics_setCharSpacing(spacing) { - this.current.charSpacing = spacing; - }, - setWordSpacing: function CanvasGraphics_setWordSpacing(spacing) { - this.current.wordSpacing = spacing; - }, - setHScale: function CanvasGraphics_setHScale(scale) { - this.current.textHScale = scale / 100; - }, - setLeading: function CanvasGraphics_setLeading(leading) { - this.current.leading = -leading; - }, - setFont: function CanvasGraphics_setFont(fontRefName, size) { - var fontObj = this.commonObjs.get(fontRefName); - var current = this.current; - - if (!fontObj) { - error('Can\'t find font for ' + fontRefName); - } - - current.fontMatrix = (fontObj.fontMatrix ? - fontObj.fontMatrix : FONT_IDENTITY_MATRIX); - - // A valid matrix needs all main diagonal elements to be non-zero - // This also ensures we bypass FF bugzilla bug #719844. - if (current.fontMatrix[0] === 0 || - current.fontMatrix[3] === 0) { - warn('Invalid font matrix for font ' + fontRefName); - } - - // The spec for Tf (setFont) says that 'size' specifies the font 'scale', - // and in some docs this can be negative (inverted x-y axes). - if (size < 0) { - size = -size; - current.fontDirection = -1; - } else { - current.fontDirection = 1; - } - - this.current.font = fontObj; - this.current.fontSize = size; - - if (fontObj.isType3Font) { - return; // we don't need ctx.font for Type3 fonts - } - - var name = fontObj.loadedName || 'sans-serif'; - var bold = fontObj.black ? (fontObj.bold ? '900' : 'bold') : - (fontObj.bold ? 'bold' : 'normal'); - - var italic = fontObj.italic ? 'italic' : 'normal'; - var typeface = '"' + name + '", ' + fontObj.fallbackName; - - // Some font backends cannot handle fonts below certain size. - // Keeping the font at minimal size and using the fontSizeScale to change - // the current transformation matrix before the fillText/strokeText. - // See https://bugzilla.mozilla.org/show_bug.cgi?id=726227 - var browserFontSize = size < MIN_FONT_SIZE ? MIN_FONT_SIZE : - size > MAX_FONT_SIZE ? MAX_FONT_SIZE : size; - this.current.fontSizeScale = size / browserFontSize; - - var rule = italic + ' ' + bold + ' ' + browserFontSize + 'px ' + typeface; - this.ctx.font = rule; - }, - setTextRenderingMode: function CanvasGraphics_setTextRenderingMode(mode) { - this.current.textRenderingMode = mode; - }, - setTextRise: function CanvasGraphics_setTextRise(rise) { - this.current.textRise = rise; - }, - moveText: function CanvasGraphics_moveText(x, y) { - this.current.x = this.current.lineX += x; - this.current.y = this.current.lineY += y; - }, - setLeadingMoveText: function CanvasGraphics_setLeadingMoveText(x, y) { - this.setLeading(-y); - this.moveText(x, y); - }, - setTextMatrix: function CanvasGraphics_setTextMatrix(a, b, c, d, e, f) { - this.current.textMatrix = [a, b, c, d, e, f]; - this.current.textMatrixScale = Math.sqrt(a * a + b * b); - - this.current.x = this.current.lineX = 0; - this.current.y = this.current.lineY = 0; - }, - nextLine: function CanvasGraphics_nextLine() { - this.moveText(0, this.current.leading); - }, - - paintChar: function CanvasGraphics_paintChar(character, x, y) { - var ctx = this.ctx; - var current = this.current; - var font = current.font; - var textRenderingMode = current.textRenderingMode; - var fontSize = current.fontSize / current.fontSizeScale; - var fillStrokeMode = textRenderingMode & - TextRenderingMode.FILL_STROKE_MASK; - var isAddToPathSet = !!(textRenderingMode & - TextRenderingMode.ADD_TO_PATH_FLAG); - - var addToPath; - if (font.disableFontFace || isAddToPathSet) { - addToPath = font.getPathGenerator(this.commonObjs, character); - } - - if (font.disableFontFace) { - ctx.save(); - ctx.translate(x, y); - ctx.beginPath(); - addToPath(ctx, fontSize); - if (fillStrokeMode === TextRenderingMode.FILL || - fillStrokeMode === TextRenderingMode.FILL_STROKE) { - ctx.fill(); - } - if (fillStrokeMode === TextRenderingMode.STROKE || - fillStrokeMode === TextRenderingMode.FILL_STROKE) { - ctx.stroke(); - } - ctx.restore(); - } else { - if (fillStrokeMode === TextRenderingMode.FILL || - fillStrokeMode === TextRenderingMode.FILL_STROKE) { - ctx.fillText(character, x, y); - } - if (fillStrokeMode === TextRenderingMode.STROKE || - fillStrokeMode === TextRenderingMode.FILL_STROKE) { - ctx.strokeText(character, x, y); - } - } - - if (isAddToPathSet) { - var paths = this.pendingTextPaths || (this.pendingTextPaths = []); - paths.push({ - transform: ctx.mozCurrentTransform, - x: x, - y: y, - fontSize: fontSize, - addToPath: addToPath - }); - } - }, - - get isFontSubpixelAAEnabled() { - // Checks if anti-aliasing is enabled when scaled text is painted. - // On Windows GDI scaled fonts looks bad. - var ctx = document.createElement('canvas').getContext('2d'); - ctx.scale(1.5, 1); - ctx.fillText('I', 0, 10); - var data = ctx.getImageData(0, 0, 10, 10).data; - var enabled = false; - for (var i = 3; i < data.length; i += 4) { - if (data[i] > 0 && data[i] < 255) { - enabled = true; - break; - } - } - return shadow(this, 'isFontSubpixelAAEnabled', enabled); - }, - - showText: function CanvasGraphics_showText(glyphs) { - var current = this.current; - var font = current.font; - if (font.isType3Font) { - return this.showType3Text(glyphs); - } - - var fontSize = current.fontSize; - if (fontSize === 0) { - return; - } - - var ctx = this.ctx; - var fontSizeScale = current.fontSizeScale; - var charSpacing = current.charSpacing; - var wordSpacing = current.wordSpacing; - var fontDirection = current.fontDirection; - var textHScale = current.textHScale * fontDirection; - var glyphsLength = glyphs.length; - var vertical = font.vertical; - var spacingDir = vertical ? 1 : -1; - var defaultVMetrics = font.defaultVMetrics; - var widthAdvanceScale = fontSize * current.fontMatrix[0]; - - var simpleFillText = - current.textRenderingMode === TextRenderingMode.FILL && - !font.disableFontFace; - - ctx.save(); - ctx.transform.apply(ctx, current.textMatrix); - ctx.translate(current.x, current.y + current.textRise); - - if (fontDirection > 0) { - ctx.scale(textHScale, -1); - } else { - ctx.scale(textHScale, 1); - } - - var lineWidth = current.lineWidth; - var scale = current.textMatrixScale; - if (scale === 0 || lineWidth === 0) { - var fillStrokeMode = current.textRenderingMode & - TextRenderingMode.FILL_STROKE_MASK; - if (fillStrokeMode === TextRenderingMode.STROKE || - fillStrokeMode === TextRenderingMode.FILL_STROKE) { - this.cachedGetSinglePixelWidth = null; - lineWidth = this.getSinglePixelWidth() * MIN_WIDTH_FACTOR; - } - } else { - lineWidth /= scale; - } - - if (fontSizeScale !== 1.0) { - ctx.scale(fontSizeScale, fontSizeScale); - lineWidth /= fontSizeScale; - } - - ctx.lineWidth = lineWidth; - - var x = 0, i; - for (i = 0; i < glyphsLength; ++i) { - var glyph = glyphs[i]; - if (isNum(glyph)) { - x += spacingDir * glyph * fontSize / 1000; - continue; - } - - var restoreNeeded = false; - var spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; - var character = glyph.fontChar; - var accent = glyph.accent; - var scaledX, scaledY, scaledAccentX, scaledAccentY; - var width = glyph.width; - if (vertical) { - var vmetric, vx, vy; - vmetric = glyph.vmetric || defaultVMetrics; - vx = glyph.vmetric ? vmetric[1] : width * 0.5; - vx = -vx * widthAdvanceScale; - vy = vmetric[2] * widthAdvanceScale; - - width = vmetric ? -vmetric[0] : width; - scaledX = vx / fontSizeScale; - scaledY = (x + vy) / fontSizeScale; - } else { - scaledX = x / fontSizeScale; - scaledY = 0; - } - - if (font.remeasure && width > 0) { - // Some standard fonts may not have the exact width: rescale per - // character if measured width is greater than expected glyph width - // and subpixel-aa is enabled, otherwise just center the glyph. - var measuredWidth = ctx.measureText(character).width * 1000 / - fontSize * fontSizeScale; - if (width < measuredWidth && this.isFontSubpixelAAEnabled) { - var characterScaleX = width / measuredWidth; - restoreNeeded = true; - ctx.save(); - ctx.scale(characterScaleX, 1); - scaledX /= characterScaleX; - } else if (width !== measuredWidth) { - scaledX += (width - measuredWidth) / 2000 * - fontSize / fontSizeScale; - } - } - - if (simpleFillText && !accent) { - // common case - ctx.fillText(character, scaledX, scaledY); - } else { - this.paintChar(character, scaledX, scaledY); - if (accent) { - scaledAccentX = scaledX + accent.offset.x / fontSizeScale; - scaledAccentY = scaledY - accent.offset.y / fontSizeScale; - this.paintChar(accent.fontChar, scaledAccentX, scaledAccentY); - } - } - - var charWidth = width * widthAdvanceScale + spacing * fontDirection; - x += charWidth; - - if (restoreNeeded) { - ctx.restore(); - } - } - if (vertical) { - current.y -= x * textHScale; - } else { - current.x += x * textHScale; - } - ctx.restore(); - }, - - showType3Text: function CanvasGraphics_showType3Text(glyphs) { - // Type3 fonts - each glyph is a "mini-PDF" - var ctx = this.ctx; - var current = this.current; - var font = current.font; - var fontSize = current.fontSize; - var fontDirection = current.fontDirection; - var spacingDir = font.vertical ? 1 : -1; - var charSpacing = current.charSpacing; - var wordSpacing = current.wordSpacing; - var textHScale = current.textHScale * fontDirection; - var fontMatrix = current.fontMatrix || FONT_IDENTITY_MATRIX; - var glyphsLength = glyphs.length; - var isTextInvisible = - current.textRenderingMode === TextRenderingMode.INVISIBLE; - var i, glyph, width, spacingLength; - - if (isTextInvisible || fontSize === 0) { - return; - } - this.cachedGetSinglePixelWidth = null; - - ctx.save(); - ctx.transform.apply(ctx, current.textMatrix); - ctx.translate(current.x, current.y); - - ctx.scale(textHScale, fontDirection); - - for (i = 0; i < glyphsLength; ++i) { - glyph = glyphs[i]; - if (isNum(glyph)) { - spacingLength = spacingDir * glyph * fontSize / 1000; - this.ctx.translate(spacingLength, 0); - current.x += spacingLength * textHScale; - continue; - } - - var spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; - var operatorList = font.charProcOperatorList[glyph.operatorListId]; - if (!operatorList) { - warn('Type3 character \"' + glyph.operatorListId + - '\" is not available'); - continue; - } - this.processingType3 = glyph; - this.save(); - ctx.scale(fontSize, fontSize); - ctx.transform.apply(ctx, fontMatrix); - this.executeOperatorList(operatorList); - this.restore(); - - var transformed = Util.applyTransform([glyph.width, 0], fontMatrix); - width = transformed[0] * fontSize + spacing; - - ctx.translate(width, 0); - current.x += width * textHScale; - } - ctx.restore(); - this.processingType3 = null; - }, - - // Type3 fonts - setCharWidth: function CanvasGraphics_setCharWidth(xWidth, yWidth) { - // We can safely ignore this since the width should be the same - // as the width in the Widths array. - }, - setCharWidthAndBounds: function CanvasGraphics_setCharWidthAndBounds(xWidth, - yWidth, - llx, - lly, - urx, - ury) { - // TODO According to the spec we're also suppose to ignore any operators - // that set color or include images while processing this type3 font. - this.ctx.rect(llx, lly, urx - llx, ury - lly); - this.clip(); - this.endPath(); - }, - - // Color - getColorN_Pattern: function CanvasGraphics_getColorN_Pattern(IR) { - var pattern; - if (IR[0] === 'TilingPattern') { - var color = IR[1]; - var baseTransform = this.baseTransform || - this.ctx.mozCurrentTransform.slice(); - pattern = new TilingPattern(IR, color, this.ctx, this.objs, - this.commonObjs, baseTransform); - } else { - pattern = getShadingPatternFromIR(IR); - } - return pattern; - }, - setStrokeColorN: function CanvasGraphics_setStrokeColorN(/*...*/) { - this.current.strokeColor = this.getColorN_Pattern(arguments); - }, - setFillColorN: function CanvasGraphics_setFillColorN(/*...*/) { - this.current.fillColor = this.getColorN_Pattern(arguments); - this.current.patternFill = true; - }, - setStrokeRGBColor: function CanvasGraphics_setStrokeRGBColor(r, g, b) { - var color = Util.makeCssRgb(r, g, b); - this.ctx.strokeStyle = color; - this.current.strokeColor = color; - }, - setFillRGBColor: function CanvasGraphics_setFillRGBColor(r, g, b) { - var color = Util.makeCssRgb(r, g, b); - this.ctx.fillStyle = color; - this.current.fillColor = color; - this.current.patternFill = false; - }, - - shadingFill: function CanvasGraphics_shadingFill(patternIR) { - var ctx = this.ctx; - - this.save(); - var pattern = getShadingPatternFromIR(patternIR); - ctx.fillStyle = pattern.getPattern(ctx, this, true); - - var inv = ctx.mozCurrentTransformInverse; - if (inv) { - var canvas = ctx.canvas; - var width = canvas.width; - var height = canvas.height; - - var bl = Util.applyTransform([0, 0], inv); - var br = Util.applyTransform([0, height], inv); - var ul = Util.applyTransform([width, 0], inv); - var ur = Util.applyTransform([width, height], inv); - - var x0 = Math.min(bl[0], br[0], ul[0], ur[0]); - var y0 = Math.min(bl[1], br[1], ul[1], ur[1]); - var x1 = Math.max(bl[0], br[0], ul[0], ur[0]); - var y1 = Math.max(bl[1], br[1], ul[1], ur[1]); - - this.ctx.fillRect(x0, y0, x1 - x0, y1 - y0); - } else { - // HACK to draw the gradient onto an infinite rectangle. - // PDF gradients are drawn across the entire image while - // Canvas only allows gradients to be drawn in a rectangle - // The following bug should allow us to remove this. - // https://bugzilla.mozilla.org/show_bug.cgi?id=664884 - - this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10); - } - - this.restore(); - }, - - // Images - beginInlineImage: function CanvasGraphics_beginInlineImage() { - error('Should not call beginInlineImage'); - }, - beginImageData: function CanvasGraphics_beginImageData() { - error('Should not call beginImageData'); - }, - - paintFormXObjectBegin: function CanvasGraphics_paintFormXObjectBegin(matrix, - bbox) { - this.save(); - this.baseTransformStack.push(this.baseTransform); - - if (isArray(matrix) && 6 === matrix.length) { - this.transform.apply(this, matrix); - } - - this.baseTransform = this.ctx.mozCurrentTransform; - - if (isArray(bbox) && 4 === bbox.length) { - var width = bbox[2] - bbox[0]; - var height = bbox[3] - bbox[1]; - this.ctx.rect(bbox[0], bbox[1], width, height); - this.clip(); - this.endPath(); - } - }, - - paintFormXObjectEnd: function CanvasGraphics_paintFormXObjectEnd() { - this.restore(); - this.baseTransform = this.baseTransformStack.pop(); - }, - - beginGroup: function CanvasGraphics_beginGroup(group) { - this.save(); - var currentCtx = this.ctx; - // TODO non-isolated groups - according to Rik at adobe non-isolated - // group results aren't usually that different and they even have tools - // that ignore this setting. Notes from Rik on implmenting: - // - When you encounter an transparency group, create a new canvas with - // the dimensions of the bbox - // - copy the content from the previous canvas to the new canvas - // - draw as usual - // - remove the backdrop alpha: - // alphaNew = 1 - (1 - alpha)/(1 - alphaBackdrop) with 'alpha' the alpha - // value of your transparency group and 'alphaBackdrop' the alpha of the - // backdrop - // - remove background color: - // colorNew = color - alphaNew *colorBackdrop /(1 - alphaNew) - if (!group.isolated) { - info('TODO: Support non-isolated groups.'); - } - - // TODO knockout - supposedly possible with the clever use of compositing - // modes. - if (group.knockout) { - warn('Knockout groups not supported.'); - } - - var currentTransform = currentCtx.mozCurrentTransform; - if (group.matrix) { - currentCtx.transform.apply(currentCtx, group.matrix); - } - assert(group.bbox, 'Bounding box is required.'); - - // Based on the current transform figure out how big the bounding box - // will actually be. - var bounds = Util.getAxialAlignedBoundingBox( - group.bbox, - currentCtx.mozCurrentTransform); - // Clip the bounding box to the current canvas. - var canvasBounds = [0, - 0, - currentCtx.canvas.width, - currentCtx.canvas.height]; - bounds = Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0]; - // Use ceil in case we're between sizes so we don't create canvas that is - // too small and make the canvas at least 1x1 pixels. - var offsetX = Math.floor(bounds[0]); - var offsetY = Math.floor(bounds[1]); - var drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1); - var drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1); - var scaleX = 1, scaleY = 1; - if (drawnWidth > MAX_GROUP_SIZE) { - scaleX = drawnWidth / MAX_GROUP_SIZE; - drawnWidth = MAX_GROUP_SIZE; - } - if (drawnHeight > MAX_GROUP_SIZE) { - scaleY = drawnHeight / MAX_GROUP_SIZE; - drawnHeight = MAX_GROUP_SIZE; - } - - var cacheId = 'groupAt' + this.groupLevel; - if (group.smask) { - // Using two cache entries is case if masks are used one after another. - cacheId += '_smask_' + ((this.smaskCounter++) % 2); - } - var scratchCanvas = this.cachedCanvases.getCanvas( - cacheId, drawnWidth, drawnHeight, true); - var groupCtx = scratchCanvas.context; - - // Since we created a new canvas that is just the size of the bounding box - // we have to translate the group ctx. - groupCtx.scale(1 / scaleX, 1 / scaleY); - groupCtx.translate(-offsetX, -offsetY); - groupCtx.transform.apply(groupCtx, currentTransform); - - if (group.smask) { - // Saving state and cached mask to be used in setGState. - this.smaskStack.push({ - canvas: scratchCanvas.canvas, - context: groupCtx, - offsetX: offsetX, - offsetY: offsetY, - scaleX: scaleX, - scaleY: scaleY, - subtype: group.smask.subtype, - backdrop: group.smask.backdrop, - transferMap: group.smask.transferMap || null - }); - } else { - // Setup the current ctx so when the group is popped we draw it at the - // right location. - currentCtx.setTransform(1, 0, 0, 1, 0, 0); - currentCtx.translate(offsetX, offsetY); - currentCtx.scale(scaleX, scaleY); - } - // The transparency group inherits all off the current graphics state - // except the blend mode, soft mask, and alpha constants. - copyCtxState(currentCtx, groupCtx); - this.ctx = groupCtx; - this.setGState([ - ['BM', 'Normal'], - ['ca', 1], - ['CA', 1] - ]); - this.groupStack.push(currentCtx); - this.groupLevel++; - }, - - endGroup: function CanvasGraphics_endGroup(group) { - this.groupLevel--; - var groupCtx = this.ctx; - this.ctx = this.groupStack.pop(); - // Turn off image smoothing to avoid sub pixel interpolation which can - // look kind of blurry for some pdfs. - if (this.ctx.imageSmoothingEnabled !== undefined) { - this.ctx.imageSmoothingEnabled = false; - } else { - this.ctx.mozImageSmoothingEnabled = false; - } - if (group.smask) { - this.tempSMask = this.smaskStack.pop(); - } else { - this.ctx.drawImage(groupCtx.canvas, 0, 0); - } - this.restore(); - }, - - beginAnnotations: function CanvasGraphics_beginAnnotations() { - this.save(); - this.current = new CanvasExtraState(); - }, - - endAnnotations: function CanvasGraphics_endAnnotations() { - this.restore(); - }, - - beginAnnotation: function CanvasGraphics_beginAnnotation(rect, transform, - matrix) { - this.save(); - - if (isArray(rect) && 4 === rect.length) { - var width = rect[2] - rect[0]; - var height = rect[3] - rect[1]; - this.ctx.rect(rect[0], rect[1], width, height); - this.clip(); - this.endPath(); - } - - this.transform.apply(this, transform); - this.transform.apply(this, matrix); - }, - - endAnnotation: function CanvasGraphics_endAnnotation() { - this.restore(); - }, - - paintJpegXObject: function CanvasGraphics_paintJpegXObject(objId, w, h) { - var domImage = this.objs.get(objId); - if (!domImage) { - warn('Dependent image isn\'t ready yet'); - return; - } - - this.save(); - - var ctx = this.ctx; - // scale the image to the unit square - ctx.scale(1 / w, -1 / h); - - ctx.drawImage(domImage, 0, 0, domImage.width, domImage.height, - 0, -h, w, h); - if (this.imageLayer) { - var currentTransform = ctx.mozCurrentTransformInverse; - var position = this.getCanvasPosition(0, 0); - this.imageLayer.appendImage({ - objId: objId, - left: position[0], - top: position[1], - width: w / currentTransform[0], - height: h / currentTransform[3] - }); - } - this.restore(); - }, - - paintImageMaskXObject: function CanvasGraphics_paintImageMaskXObject(img) { - var ctx = this.ctx; - var width = img.width, height = img.height; - var fillColor = this.current.fillColor; - var isPatternFill = this.current.patternFill; - - var glyph = this.processingType3; - - if (COMPILE_TYPE3_GLYPHS && glyph && glyph.compiled === undefined) { - if (width <= MAX_SIZE_TO_COMPILE && height <= MAX_SIZE_TO_COMPILE) { - glyph.compiled = - compileType3Glyph({data: img.data, width: width, height: height}); - } else { - glyph.compiled = null; - } - } - - if (glyph && glyph.compiled) { - glyph.compiled(ctx); - return; - } - - var maskCanvas = this.cachedCanvases.getCanvas('maskCanvas', - width, height); - var maskCtx = maskCanvas.context; - maskCtx.save(); - - putBinaryImageMask(maskCtx, img); - - maskCtx.globalCompositeOperation = 'source-in'; - - maskCtx.fillStyle = isPatternFill ? - fillColor.getPattern(maskCtx, this) : fillColor; - maskCtx.fillRect(0, 0, width, height); - - maskCtx.restore(); - - this.paintInlineImageXObject(maskCanvas.canvas); - }, - - paintImageMaskXObjectRepeat: - function CanvasGraphics_paintImageMaskXObjectRepeat(imgData, scaleX, - scaleY, positions) { - var width = imgData.width; - var height = imgData.height; - var fillColor = this.current.fillColor; - var isPatternFill = this.current.patternFill; - - var maskCanvas = this.cachedCanvases.getCanvas('maskCanvas', - width, height); - var maskCtx = maskCanvas.context; - maskCtx.save(); - - putBinaryImageMask(maskCtx, imgData); - - maskCtx.globalCompositeOperation = 'source-in'; - - maskCtx.fillStyle = isPatternFill ? - fillColor.getPattern(maskCtx, this) : fillColor; - maskCtx.fillRect(0, 0, width, height); - - maskCtx.restore(); - - var ctx = this.ctx; - for (var i = 0, ii = positions.length; i < ii; i += 2) { - ctx.save(); - ctx.transform(scaleX, 0, 0, scaleY, positions[i], positions[i + 1]); - ctx.scale(1, -1); - ctx.drawImage(maskCanvas.canvas, 0, 0, width, height, - 0, -1, 1, 1); - ctx.restore(); - } - }, - - paintImageMaskXObjectGroup: - function CanvasGraphics_paintImageMaskXObjectGroup(images) { - var ctx = this.ctx; - - var fillColor = this.current.fillColor; - var isPatternFill = this.current.patternFill; - for (var i = 0, ii = images.length; i < ii; i++) { - var image = images[i]; - var width = image.width, height = image.height; - - var maskCanvas = this.cachedCanvases.getCanvas('maskCanvas', - width, height); - var maskCtx = maskCanvas.context; - maskCtx.save(); - - putBinaryImageMask(maskCtx, image); - - maskCtx.globalCompositeOperation = 'source-in'; - - maskCtx.fillStyle = isPatternFill ? - fillColor.getPattern(maskCtx, this) : fillColor; - maskCtx.fillRect(0, 0, width, height); - - maskCtx.restore(); - - ctx.save(); - ctx.transform.apply(ctx, image.transform); - ctx.scale(1, -1); - ctx.drawImage(maskCanvas.canvas, 0, 0, width, height, - 0, -1, 1, 1); - ctx.restore(); - } - }, - - paintImageXObject: function CanvasGraphics_paintImageXObject(objId) { - var imgData = this.objs.get(objId); - if (!imgData) { - warn('Dependent image isn\'t ready yet'); - return; - } - - this.paintInlineImageXObject(imgData); - }, - - paintImageXObjectRepeat: - function CanvasGraphics_paintImageXObjectRepeat(objId, scaleX, scaleY, - positions) { - var imgData = this.objs.get(objId); - if (!imgData) { - warn('Dependent image isn\'t ready yet'); - return; - } - - var width = imgData.width; - var height = imgData.height; - var map = []; - for (var i = 0, ii = positions.length; i < ii; i += 2) { - map.push({transform: [scaleX, 0, 0, scaleY, positions[i], - positions[i + 1]], x: 0, y: 0, w: width, h: height}); - } - this.paintInlineImageXObjectGroup(imgData, map); - }, - - paintInlineImageXObject: - function CanvasGraphics_paintInlineImageXObject(imgData) { - var width = imgData.width; - var height = imgData.height; - var ctx = this.ctx; - - this.save(); - // scale the image to the unit square - ctx.scale(1 / width, -1 / height); - - var currentTransform = ctx.mozCurrentTransformInverse; - var a = currentTransform[0], b = currentTransform[1]; - var widthScale = Math.max(Math.sqrt(a * a + b * b), 1); - var c = currentTransform[2], d = currentTransform[3]; - var heightScale = Math.max(Math.sqrt(c * c + d * d), 1); - - var imgToPaint, tmpCanvas; - // instanceof HTMLElement does not work in jsdom node.js module - if (imgData instanceof HTMLElement || !imgData.data) { - imgToPaint = imgData; - } else { - tmpCanvas = this.cachedCanvases.getCanvas('inlineImage', - width, height); - var tmpCtx = tmpCanvas.context; - putBinaryImageData(tmpCtx, imgData); - imgToPaint = tmpCanvas.canvas; - } - - var paintWidth = width, paintHeight = height; - var tmpCanvasId = 'prescale1'; - // Vertial or horizontal scaling shall not be more than 2 to not loose the - // pixels during drawImage operation, painting on the temporary canvas(es) - // that are twice smaller in size - while ((widthScale > 2 && paintWidth > 1) || - (heightScale > 2 && paintHeight > 1)) { - var newWidth = paintWidth, newHeight = paintHeight; - if (widthScale > 2 && paintWidth > 1) { - newWidth = Math.ceil(paintWidth / 2); - widthScale /= paintWidth / newWidth; - } - if (heightScale > 2 && paintHeight > 1) { - newHeight = Math.ceil(paintHeight / 2); - heightScale /= paintHeight / newHeight; - } - tmpCanvas = this.cachedCanvases.getCanvas(tmpCanvasId, - newWidth, newHeight); - tmpCtx = tmpCanvas.context; - tmpCtx.clearRect(0, 0, newWidth, newHeight); - tmpCtx.drawImage(imgToPaint, 0, 0, paintWidth, paintHeight, - 0, 0, newWidth, newHeight); - imgToPaint = tmpCanvas.canvas; - paintWidth = newWidth; - paintHeight = newHeight; - tmpCanvasId = tmpCanvasId === 'prescale1' ? 'prescale2' : 'prescale1'; - } - ctx.drawImage(imgToPaint, 0, 0, paintWidth, paintHeight, - 0, -height, width, height); - - if (this.imageLayer) { - var position = this.getCanvasPosition(0, -height); - this.imageLayer.appendImage({ - imgData: imgData, - left: position[0], - top: position[1], - width: width / currentTransform[0], - height: height / currentTransform[3] - }); - } - this.restore(); - }, - - paintInlineImageXObjectGroup: - function CanvasGraphics_paintInlineImageXObjectGroup(imgData, map) { - var ctx = this.ctx; - var w = imgData.width; - var h = imgData.height; - - var tmpCanvas = this.cachedCanvases.getCanvas('inlineImage', w, h); - var tmpCtx = tmpCanvas.context; - putBinaryImageData(tmpCtx, imgData); - - for (var i = 0, ii = map.length; i < ii; i++) { - var entry = map[i]; - ctx.save(); - ctx.transform.apply(ctx, entry.transform); - ctx.scale(1, -1); - ctx.drawImage(tmpCanvas.canvas, entry.x, entry.y, entry.w, entry.h, - 0, -1, 1, 1); - if (this.imageLayer) { - var position = this.getCanvasPosition(entry.x, entry.y); - this.imageLayer.appendImage({ - imgData: imgData, - left: position[0], - top: position[1], - width: w, - height: h - }); - } - ctx.restore(); - } - }, - - paintSolidColorImageMask: - function CanvasGraphics_paintSolidColorImageMask() { - this.ctx.fillRect(0, 0, 1, 1); - }, - - paintXObject: function CanvasGraphics_paintXObject() { - warn('Unsupported \'paintXObject\' command.'); - }, - - // Marked content - - markPoint: function CanvasGraphics_markPoint(tag) { - // TODO Marked content. - }, - markPointProps: function CanvasGraphics_markPointProps(tag, properties) { - // TODO Marked content. - }, - beginMarkedContent: function CanvasGraphics_beginMarkedContent(tag) { - // TODO Marked content. - }, - beginMarkedContentProps: function CanvasGraphics_beginMarkedContentProps( - tag, properties) { - // TODO Marked content. - }, - endMarkedContent: function CanvasGraphics_endMarkedContent() { - // TODO Marked content. - }, - - // Compatibility - - beginCompat: function CanvasGraphics_beginCompat() { - // TODO ignore undefined operators (should we do that anyway?) - }, - endCompat: function CanvasGraphics_endCompat() { - // TODO stop ignoring undefined operators - }, - - // Helper functions - - consumePath: function CanvasGraphics_consumePath() { - var ctx = this.ctx; - if (this.pendingClip) { - if (this.pendingClip === EO_CLIP) { - if (ctx.mozFillRule !== undefined) { - ctx.mozFillRule = 'evenodd'; - ctx.clip(); - ctx.mozFillRule = 'nonzero'; - } else { - ctx.clip('evenodd'); - } - } else { - ctx.clip(); - } - this.pendingClip = null; - } - ctx.beginPath(); - }, - getSinglePixelWidth: function CanvasGraphics_getSinglePixelWidth(scale) { - if (this.cachedGetSinglePixelWidth === null) { - var inverse = this.ctx.mozCurrentTransformInverse; - // max of the current horizontal and vertical scale - this.cachedGetSinglePixelWidth = Math.sqrt(Math.max( - (inverse[0] * inverse[0] + inverse[1] * inverse[1]), - (inverse[2] * inverse[2] + inverse[3] * inverse[3]))); - } - return this.cachedGetSinglePixelWidth; - }, - getCanvasPosition: function CanvasGraphics_getCanvasPosition(x, y) { - var transform = this.ctx.mozCurrentTransform; - return [ - transform[0] * x + transform[2] * y + transform[4], - transform[1] * x + transform[3] * y + transform[5] - ]; - } - }; - - for (var op in OPS) { - CanvasGraphics.prototype[OPS[op]] = CanvasGraphics.prototype[op]; - } - - return CanvasGraphics; -})(); - - -var WebGLUtils = (function WebGLUtilsClosure() { - function loadShader(gl, code, shaderType) { - var shader = gl.createShader(shaderType); - gl.shaderSource(shader, code); - gl.compileShader(shader); - var compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS); - if (!compiled) { - var errorMsg = gl.getShaderInfoLog(shader); - throw new Error('Error during shader compilation: ' + errorMsg); - } - return shader; - } - function createVertexShader(gl, code) { - return loadShader(gl, code, gl.VERTEX_SHADER); - } - function createFragmentShader(gl, code) { - return loadShader(gl, code, gl.FRAGMENT_SHADER); - } - function createProgram(gl, shaders) { - var program = gl.createProgram(); - for (var i = 0, ii = shaders.length; i < ii; ++i) { - gl.attachShader(program, shaders[i]); - } - gl.linkProgram(program); - var linked = gl.getProgramParameter(program, gl.LINK_STATUS); - if (!linked) { - var errorMsg = gl.getProgramInfoLog(program); - throw new Error('Error during program linking: ' + errorMsg); - } - return program; - } - function createTexture(gl, image, textureId) { - gl.activeTexture(textureId); - var texture = gl.createTexture(); - gl.bindTexture(gl.TEXTURE_2D, texture); - - // Set the parameters so we can render any size image. - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); - - // Upload the image into the texture. - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image); - return texture; - } - - var currentGL, currentCanvas; - function generateGL() { - if (currentGL) { - return; - } - currentCanvas = document.createElement('canvas'); - currentGL = currentCanvas.getContext('webgl', - { premultipliedalpha: false }); - } - - var smaskVertexShaderCode = '\ - attribute vec2 a_position; \ - attribute vec2 a_texCoord; \ - \ - uniform vec2 u_resolution; \ - \ - varying vec2 v_texCoord; \ - \ - void main() { \ - vec2 clipSpace = (a_position / u_resolution) * 2.0 - 1.0; \ - gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); \ - \ - v_texCoord = a_texCoord; \ - } '; - - var smaskFragmentShaderCode = '\ - precision mediump float; \ - \ - uniform vec4 u_backdrop; \ - uniform int u_subtype; \ - uniform sampler2D u_image; \ - uniform sampler2D u_mask; \ - \ - varying vec2 v_texCoord; \ - \ - void main() { \ - vec4 imageColor = texture2D(u_image, v_texCoord); \ - vec4 maskColor = texture2D(u_mask, v_texCoord); \ - if (u_backdrop.a > 0.0) { \ - maskColor.rgb = maskColor.rgb * maskColor.a + \ - u_backdrop.rgb * (1.0 - maskColor.a); \ - } \ - float lum; \ - if (u_subtype == 0) { \ - lum = maskColor.a; \ - } else { \ - lum = maskColor.r * 0.3 + maskColor.g * 0.59 + \ - maskColor.b * 0.11; \ - } \ - imageColor.a *= lum; \ - imageColor.rgb *= imageColor.a; \ - gl_FragColor = imageColor; \ - } '; - - var smaskCache = null; - - function initSmaskGL() { - var canvas, gl; - - generateGL(); - canvas = currentCanvas; - currentCanvas = null; - gl = currentGL; - currentGL = null; - - // setup a GLSL program - var vertexShader = createVertexShader(gl, smaskVertexShaderCode); - var fragmentShader = createFragmentShader(gl, smaskFragmentShaderCode); - var program = createProgram(gl, [vertexShader, fragmentShader]); - gl.useProgram(program); - - var cache = {}; - cache.gl = gl; - cache.canvas = canvas; - cache.resolutionLocation = gl.getUniformLocation(program, 'u_resolution'); - cache.positionLocation = gl.getAttribLocation(program, 'a_position'); - cache.backdropLocation = gl.getUniformLocation(program, 'u_backdrop'); - cache.subtypeLocation = gl.getUniformLocation(program, 'u_subtype'); - - var texCoordLocation = gl.getAttribLocation(program, 'a_texCoord'); - var texLayerLocation = gl.getUniformLocation(program, 'u_image'); - var texMaskLocation = gl.getUniformLocation(program, 'u_mask'); - - // provide texture coordinates for the rectangle. - var texCoordBuffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, texCoordBuffer); - gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ - 0.0, 0.0, - 1.0, 0.0, - 0.0, 1.0, - 0.0, 1.0, - 1.0, 0.0, - 1.0, 1.0]), gl.STATIC_DRAW); - gl.enableVertexAttribArray(texCoordLocation); - gl.vertexAttribPointer(texCoordLocation, 2, gl.FLOAT, false, 0, 0); - - gl.uniform1i(texLayerLocation, 0); - gl.uniform1i(texMaskLocation, 1); - - smaskCache = cache; - } - - function composeSMask(layer, mask, properties) { - var width = layer.width, height = layer.height; - - if (!smaskCache) { - initSmaskGL(); - } - var cache = smaskCache,canvas = cache.canvas, gl = cache.gl; - canvas.width = width; - canvas.height = height; - gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); - gl.uniform2f(cache.resolutionLocation, width, height); - - if (properties.backdrop) { - gl.uniform4f(cache.resolutionLocation, properties.backdrop[0], - properties.backdrop[1], properties.backdrop[2], 1); - } else { - gl.uniform4f(cache.resolutionLocation, 0, 0, 0, 0); - } - gl.uniform1i(cache.subtypeLocation, - properties.subtype === 'Luminosity' ? 1 : 0); - - // Create a textures - var texture = createTexture(gl, layer, gl.TEXTURE0); - var maskTexture = createTexture(gl, mask, gl.TEXTURE1); - - - // Create a buffer and put a single clipspace rectangle in - // it (2 triangles) - var buffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, buffer); - gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ - 0, 0, - width, 0, - 0, height, - 0, height, - width, 0, - width, height]), gl.STATIC_DRAW); - gl.enableVertexAttribArray(cache.positionLocation); - gl.vertexAttribPointer(cache.positionLocation, 2, gl.FLOAT, false, 0, 0); - - // draw - gl.clearColor(0, 0, 0, 0); - gl.enable(gl.BLEND); - gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); - gl.clear(gl.COLOR_BUFFER_BIT); - - gl.drawArrays(gl.TRIANGLES, 0, 6); - - gl.flush(); - - gl.deleteTexture(texture); - gl.deleteTexture(maskTexture); - gl.deleteBuffer(buffer); - - return canvas; - } - - var figuresVertexShaderCode = '\ - attribute vec2 a_position; \ - attribute vec3 a_color; \ - \ - uniform vec2 u_resolution; \ - uniform vec2 u_scale; \ - uniform vec2 u_offset; \ - \ - varying vec4 v_color; \ - \ - void main() { \ - vec2 position = (a_position + u_offset) * u_scale; \ - vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0; \ - gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); \ - \ - v_color = vec4(a_color / 255.0, 1.0); \ - } '; - - var figuresFragmentShaderCode = '\ - precision mediump float; \ - \ - varying vec4 v_color; \ - \ - void main() { \ - gl_FragColor = v_color; \ - } '; - - var figuresCache = null; - - function initFiguresGL() { - var canvas, gl; - - generateGL(); - canvas = currentCanvas; - currentCanvas = null; - gl = currentGL; - currentGL = null; - - // setup a GLSL program - var vertexShader = createVertexShader(gl, figuresVertexShaderCode); - var fragmentShader = createFragmentShader(gl, figuresFragmentShaderCode); - var program = createProgram(gl, [vertexShader, fragmentShader]); - gl.useProgram(program); - - var cache = {}; - cache.gl = gl; - cache.canvas = canvas; - cache.resolutionLocation = gl.getUniformLocation(program, 'u_resolution'); - cache.scaleLocation = gl.getUniformLocation(program, 'u_scale'); - cache.offsetLocation = gl.getUniformLocation(program, 'u_offset'); - cache.positionLocation = gl.getAttribLocation(program, 'a_position'); - cache.colorLocation = gl.getAttribLocation(program, 'a_color'); - - figuresCache = cache; - } - - function drawFigures(width, height, backgroundColor, figures, context) { - if (!figuresCache) { - initFiguresGL(); - } - var cache = figuresCache, canvas = cache.canvas, gl = cache.gl; - - canvas.width = width; - canvas.height = height; - gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); - gl.uniform2f(cache.resolutionLocation, width, height); - - // count triangle points - var count = 0; - var i, ii, rows; - for (i = 0, ii = figures.length; i < ii; i++) { - switch (figures[i].type) { - case 'lattice': - rows = (figures[i].coords.length / figures[i].verticesPerRow) | 0; - count += (rows - 1) * (figures[i].verticesPerRow - 1) * 6; - break; - case 'triangles': - count += figures[i].coords.length; - break; - } - } - // transfer data - var coords = new Float32Array(count * 2); - var colors = new Uint8Array(count * 3); - var coordsMap = context.coords, colorsMap = context.colors; - var pIndex = 0, cIndex = 0; - for (i = 0, ii = figures.length; i < ii; i++) { - var figure = figures[i], ps = figure.coords, cs = figure.colors; - switch (figure.type) { - case 'lattice': - var cols = figure.verticesPerRow; - rows = (ps.length / cols) | 0; - for (var row = 1; row < rows; row++) { - var offset = row * cols + 1; - for (var col = 1; col < cols; col++, offset++) { - coords[pIndex] = coordsMap[ps[offset - cols - 1]]; - coords[pIndex + 1] = coordsMap[ps[offset - cols - 1] + 1]; - coords[pIndex + 2] = coordsMap[ps[offset - cols]]; - coords[pIndex + 3] = coordsMap[ps[offset - cols] + 1]; - coords[pIndex + 4] = coordsMap[ps[offset - 1]]; - coords[pIndex + 5] = coordsMap[ps[offset - 1] + 1]; - colors[cIndex] = colorsMap[cs[offset - cols - 1]]; - colors[cIndex + 1] = colorsMap[cs[offset - cols - 1] + 1]; - colors[cIndex + 2] = colorsMap[cs[offset - cols - 1] + 2]; - colors[cIndex + 3] = colorsMap[cs[offset - cols]]; - colors[cIndex + 4] = colorsMap[cs[offset - cols] + 1]; - colors[cIndex + 5] = colorsMap[cs[offset - cols] + 2]; - colors[cIndex + 6] = colorsMap[cs[offset - 1]]; - colors[cIndex + 7] = colorsMap[cs[offset - 1] + 1]; - colors[cIndex + 8] = colorsMap[cs[offset - 1] + 2]; - - coords[pIndex + 6] = coords[pIndex + 2]; - coords[pIndex + 7] = coords[pIndex + 3]; - coords[pIndex + 8] = coords[pIndex + 4]; - coords[pIndex + 9] = coords[pIndex + 5]; - coords[pIndex + 10] = coordsMap[ps[offset]]; - coords[pIndex + 11] = coordsMap[ps[offset] + 1]; - colors[cIndex + 9] = colors[cIndex + 3]; - colors[cIndex + 10] = colors[cIndex + 4]; - colors[cIndex + 11] = colors[cIndex + 5]; - colors[cIndex + 12] = colors[cIndex + 6]; - colors[cIndex + 13] = colors[cIndex + 7]; - colors[cIndex + 14] = colors[cIndex + 8]; - colors[cIndex + 15] = colorsMap[cs[offset]]; - colors[cIndex + 16] = colorsMap[cs[offset] + 1]; - colors[cIndex + 17] = colorsMap[cs[offset] + 2]; - pIndex += 12; - cIndex += 18; - } - } - break; - case 'triangles': - for (var j = 0, jj = ps.length; j < jj; j++) { - coords[pIndex] = coordsMap[ps[j]]; - coords[pIndex + 1] = coordsMap[ps[j] + 1]; - colors[cIndex] = colorsMap[cs[j]]; - colors[cIndex + 1] = colorsMap[cs[j] + 1]; - colors[cIndex + 2] = colorsMap[cs[j] + 2]; - pIndex += 2; - cIndex += 3; - } - break; - } - } - - // draw - if (backgroundColor) { - gl.clearColor(backgroundColor[0] / 255, backgroundColor[1] / 255, - backgroundColor[2] / 255, 1.0); - } else { - gl.clearColor(0, 0, 0, 0); - } - gl.clear(gl.COLOR_BUFFER_BIT); - - var coordsBuffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, coordsBuffer); - gl.bufferData(gl.ARRAY_BUFFER, coords, gl.STATIC_DRAW); - gl.enableVertexAttribArray(cache.positionLocation); - gl.vertexAttribPointer(cache.positionLocation, 2, gl.FLOAT, false, 0, 0); - - var colorsBuffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, colorsBuffer); - gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW); - gl.enableVertexAttribArray(cache.colorLocation); - gl.vertexAttribPointer(cache.colorLocation, 3, gl.UNSIGNED_BYTE, false, - 0, 0); - - gl.uniform2f(cache.scaleLocation, context.scaleX, context.scaleY); - gl.uniform2f(cache.offsetLocation, context.offsetX, context.offsetY); - - gl.drawArrays(gl.TRIANGLES, 0, count); - - gl.flush(); - - gl.deleteBuffer(coordsBuffer); - gl.deleteBuffer(colorsBuffer); - - return canvas; - } - - function cleanup() { - if (smaskCache && smaskCache.canvas) { - smaskCache.canvas.width = 0; - smaskCache.canvas.height = 0; - } - if (figuresCache && figuresCache.canvas) { - figuresCache.canvas.width = 0; - figuresCache.canvas.height = 0; - } - smaskCache = null; - figuresCache = null; - } - - return { - get isEnabled() { - if (PDFJS.disableWebGL) { - return false; - } - var enabled = false; - try { - generateGL(); - enabled = !!currentGL; - } catch (e) { } - return shadow(this, 'isEnabled', enabled); - }, - composeSMask: composeSMask, - drawFigures: drawFigures, - clear: cleanup - }; -})(); - - -var ShadingIRs = {}; - -ShadingIRs.RadialAxial = { - fromIR: function RadialAxial_fromIR(raw) { - var type = raw[1]; - var colorStops = raw[2]; - var p0 = raw[3]; - var p1 = raw[4]; - var r0 = raw[5]; - var r1 = raw[6]; - return { - type: 'Pattern', - getPattern: function RadialAxial_getPattern(ctx) { - var grad; - if (type === 'axial') { - grad = ctx.createLinearGradient(p0[0], p0[1], p1[0], p1[1]); - } else if (type === 'radial') { - grad = ctx.createRadialGradient(p0[0], p0[1], r0, p1[0], p1[1], r1); - } - - for (var i = 0, ii = colorStops.length; i < ii; ++i) { - var c = colorStops[i]; - grad.addColorStop(c[0], c[1]); - } - return grad; - } - }; - } -}; - -var createMeshCanvas = (function createMeshCanvasClosure() { - function drawTriangle(data, context, p1, p2, p3, c1, c2, c3) { - // Very basic Gouraud-shaded triangle rasterization algorithm. - var coords = context.coords, colors = context.colors; - var bytes = data.data, rowSize = data.width * 4; - var tmp; - if (coords[p1 + 1] > coords[p2 + 1]) { - tmp = p1; p1 = p2; p2 = tmp; tmp = c1; c1 = c2; c2 = tmp; - } - if (coords[p2 + 1] > coords[p3 + 1]) { - tmp = p2; p2 = p3; p3 = tmp; tmp = c2; c2 = c3; c3 = tmp; - } - if (coords[p1 + 1] > coords[p2 + 1]) { - tmp = p1; p1 = p2; p2 = tmp; tmp = c1; c1 = c2; c2 = tmp; - } - var x1 = (coords[p1] + context.offsetX) * context.scaleX; - var y1 = (coords[p1 + 1] + context.offsetY) * context.scaleY; - var x2 = (coords[p2] + context.offsetX) * context.scaleX; - var y2 = (coords[p2 + 1] + context.offsetY) * context.scaleY; - var x3 = (coords[p3] + context.offsetX) * context.scaleX; - var y3 = (coords[p3 + 1] + context.offsetY) * context.scaleY; - if (y1 >= y3) { - return; - } - var c1r = colors[c1], c1g = colors[c1 + 1], c1b = colors[c1 + 2]; - var c2r = colors[c2], c2g = colors[c2 + 1], c2b = colors[c2 + 2]; - var c3r = colors[c3], c3g = colors[c3 + 1], c3b = colors[c3 + 2]; - - var minY = Math.round(y1), maxY = Math.round(y3); - var xa, car, cag, cab; - var xb, cbr, cbg, cbb; - var k; - for (var y = minY; y <= maxY; y++) { - if (y < y2) { - k = y < y1 ? 0 : y1 === y2 ? 1 : (y1 - y) / (y1 - y2); - xa = x1 - (x1 - x2) * k; - car = c1r - (c1r - c2r) * k; - cag = c1g - (c1g - c2g) * k; - cab = c1b - (c1b - c2b) * k; - } else { - k = y > y3 ? 1 : y2 === y3 ? 0 : (y2 - y) / (y2 - y3); - xa = x2 - (x2 - x3) * k; - car = c2r - (c2r - c3r) * k; - cag = c2g - (c2g - c3g) * k; - cab = c2b - (c2b - c3b) * k; - } - k = y < y1 ? 0 : y > y3 ? 1 : (y1 - y) / (y1 - y3); - xb = x1 - (x1 - x3) * k; - cbr = c1r - (c1r - c3r) * k; - cbg = c1g - (c1g - c3g) * k; - cbb = c1b - (c1b - c3b) * k; - var x1_ = Math.round(Math.min(xa, xb)); - var x2_ = Math.round(Math.max(xa, xb)); - var j = rowSize * y + x1_ * 4; - for (var x = x1_; x <= x2_; x++) { - k = (xa - x) / (xa - xb); - k = k < 0 ? 0 : k > 1 ? 1 : k; - bytes[j++] = (car - (car - cbr) * k) | 0; - bytes[j++] = (cag - (cag - cbg) * k) | 0; - bytes[j++] = (cab - (cab - cbb) * k) | 0; - bytes[j++] = 255; - } - } - } - - function drawFigure(data, figure, context) { - var ps = figure.coords; - var cs = figure.colors; - var i, ii; - switch (figure.type) { - case 'lattice': - var verticesPerRow = figure.verticesPerRow; - var rows = Math.floor(ps.length / verticesPerRow) - 1; - var cols = verticesPerRow - 1; - for (i = 0; i < rows; i++) { - var q = i * verticesPerRow; - for (var j = 0; j < cols; j++, q++) { - drawTriangle(data, context, - ps[q], ps[q + 1], ps[q + verticesPerRow], - cs[q], cs[q + 1], cs[q + verticesPerRow]); - drawTriangle(data, context, - ps[q + verticesPerRow + 1], ps[q + 1], ps[q + verticesPerRow], - cs[q + verticesPerRow + 1], cs[q + 1], cs[q + verticesPerRow]); - } - } - break; - case 'triangles': - for (i = 0, ii = ps.length; i < ii; i += 3) { - drawTriangle(data, context, - ps[i], ps[i + 1], ps[i + 2], - cs[i], cs[i + 1], cs[i + 2]); - } - break; - default: - error('illigal figure'); - break; - } - } - - function createMeshCanvas(bounds, combinesScale, coords, colors, figures, - backgroundColor, cachedCanvases) { - // we will increase scale on some weird factor to let antialiasing take - // care of "rough" edges - var EXPECTED_SCALE = 1.1; - // MAX_PATTERN_SIZE is used to avoid OOM situation. - var MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough - - var offsetX = Math.floor(bounds[0]); - var offsetY = Math.floor(bounds[1]); - var boundsWidth = Math.ceil(bounds[2]) - offsetX; - var boundsHeight = Math.ceil(bounds[3]) - offsetY; - - var width = Math.min(Math.ceil(Math.abs(boundsWidth * combinesScale[0] * - EXPECTED_SCALE)), MAX_PATTERN_SIZE); - var height = Math.min(Math.ceil(Math.abs(boundsHeight * combinesScale[1] * - EXPECTED_SCALE)), MAX_PATTERN_SIZE); - var scaleX = boundsWidth / width; - var scaleY = boundsHeight / height; - - var context = { - coords: coords, - colors: colors, - offsetX: -offsetX, - offsetY: -offsetY, - scaleX: 1 / scaleX, - scaleY: 1 / scaleY - }; - - var canvas, tmpCanvas, i, ii; - if (WebGLUtils.isEnabled) { - canvas = WebGLUtils.drawFigures(width, height, backgroundColor, - figures, context); - - // https://bugzilla.mozilla.org/show_bug.cgi?id=972126 - tmpCanvas = cachedCanvases.getCanvas('mesh', width, height, false); - tmpCanvas.context.drawImage(canvas, 0, 0); - canvas = tmpCanvas.canvas; - } else { - tmpCanvas = cachedCanvases.getCanvas('mesh', width, height, false); - var tmpCtx = tmpCanvas.context; - - var data = tmpCtx.createImageData(width, height); - if (backgroundColor) { - var bytes = data.data; - for (i = 0, ii = bytes.length; i < ii; i += 4) { - bytes[i] = backgroundColor[0]; - bytes[i + 1] = backgroundColor[1]; - bytes[i + 2] = backgroundColor[2]; - bytes[i + 3] = 255; - } - } - for (i = 0; i < figures.length; i++) { - drawFigure(data, figures[i], context); - } - tmpCtx.putImageData(data, 0, 0); - canvas = tmpCanvas.canvas; - } - - return {canvas: canvas, offsetX: offsetX, offsetY: offsetY, - scaleX: scaleX, scaleY: scaleY}; - } - return createMeshCanvas; -})(); - -ShadingIRs.Mesh = { - fromIR: function Mesh_fromIR(raw) { - //var type = raw[1]; - var coords = raw[2]; - var colors = raw[3]; - var figures = raw[4]; - var bounds = raw[5]; - var matrix = raw[6]; - //var bbox = raw[7]; - var background = raw[8]; - return { - type: 'Pattern', - getPattern: function Mesh_getPattern(ctx, owner, shadingFill) { - var scale; - if (shadingFill) { - scale = Util.singularValueDecompose2dScale(ctx.mozCurrentTransform); - } else { - // Obtain scale from matrix and current transformation matrix. - scale = Util.singularValueDecompose2dScale(owner.baseTransform); - if (matrix) { - var matrixScale = Util.singularValueDecompose2dScale(matrix); - scale = [scale[0] * matrixScale[0], - scale[1] * matrixScale[1]]; - } - } - - - // Rasterizing on the main thread since sending/queue large canvases - // might cause OOM. - var temporaryPatternCanvas = createMeshCanvas(bounds, scale, coords, - colors, figures, shadingFill ? null : background, - owner.cachedCanvases); - - if (!shadingFill) { - ctx.setTransform.apply(ctx, owner.baseTransform); - if (matrix) { - ctx.transform.apply(ctx, matrix); - } - } - - ctx.translate(temporaryPatternCanvas.offsetX, - temporaryPatternCanvas.offsetY); - ctx.scale(temporaryPatternCanvas.scaleX, - temporaryPatternCanvas.scaleY); - - return ctx.createPattern(temporaryPatternCanvas.canvas, 'no-repeat'); - } - }; - } -}; - -ShadingIRs.Dummy = { - fromIR: function Dummy_fromIR() { - return { - type: 'Pattern', - getPattern: function Dummy_fromIR_getPattern() { - return 'hotpink'; - } - }; - } -}; - -function getShadingPatternFromIR(raw) { - var shadingIR = ShadingIRs[raw[0]]; - if (!shadingIR) { - error('Unknown IR type: ' + raw[0]); - } - return shadingIR.fromIR(raw); -} - -var TilingPattern = (function TilingPatternClosure() { - var PaintType = { - COLORED: 1, - UNCOLORED: 2 - }; - - var MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough - - function TilingPattern(IR, color, ctx, objs, commonObjs, baseTransform) { - this.operatorList = IR[2]; - this.matrix = IR[3] || [1, 0, 0, 1, 0, 0]; - this.bbox = IR[4]; - this.xstep = IR[5]; - this.ystep = IR[6]; - this.paintType = IR[7]; - this.tilingType = IR[8]; - this.color = color; - this.objs = objs; - this.commonObjs = commonObjs; - this.baseTransform = baseTransform; - this.type = 'Pattern'; - this.ctx = ctx; - } - - TilingPattern.prototype = { - createPatternCanvas: function TilinPattern_createPatternCanvas(owner) { - var operatorList = this.operatorList; - var bbox = this.bbox; - var xstep = this.xstep; - var ystep = this.ystep; - var paintType = this.paintType; - var tilingType = this.tilingType; - var color = this.color; - var objs = this.objs; - var commonObjs = this.commonObjs; - - info('TilingType: ' + tilingType); - - var x0 = bbox[0], y0 = bbox[1], x1 = bbox[2], y1 = bbox[3]; - - var topLeft = [x0, y0]; - // we want the canvas to be as large as the step size - var botRight = [x0 + xstep, y0 + ystep]; - - var width = botRight[0] - topLeft[0]; - var height = botRight[1] - topLeft[1]; - - // Obtain scale from matrix and current transformation matrix. - var matrixScale = Util.singularValueDecompose2dScale(this.matrix); - var curMatrixScale = Util.singularValueDecompose2dScale( - this.baseTransform); - var combinedScale = [matrixScale[0] * curMatrixScale[0], - matrixScale[1] * curMatrixScale[1]]; - - // MAX_PATTERN_SIZE is used to avoid OOM situation. - // Use width and height values that are as close as possible to the end - // result when the pattern is used. Too low value makes the pattern look - // blurry. Too large value makes it look too crispy. - width = Math.min(Math.ceil(Math.abs(width * combinedScale[0])), - MAX_PATTERN_SIZE); - - height = Math.min(Math.ceil(Math.abs(height * combinedScale[1])), - MAX_PATTERN_SIZE); - - var tmpCanvas = owner.cachedCanvases.getCanvas('pattern', - width, height, true); - var tmpCtx = tmpCanvas.context; - var graphics = new CanvasGraphics(tmpCtx, commonObjs, objs); - graphics.groupLevel = owner.groupLevel; - - this.setFillAndStrokeStyleToContext(tmpCtx, paintType, color); - - this.setScale(width, height, xstep, ystep); - this.transformToScale(graphics); - - // transform coordinates to pattern space - var tmpTranslate = [1, 0, 0, 1, -topLeft[0], -topLeft[1]]; - graphics.transform.apply(graphics, tmpTranslate); - - this.clipBbox(graphics, bbox, x0, y0, x1, y1); - - graphics.executeOperatorList(operatorList); - return tmpCanvas.canvas; - }, - - setScale: function TilingPattern_setScale(width, height, xstep, ystep) { - this.scale = [width / xstep, height / ystep]; - }, - - transformToScale: function TilingPattern_transformToScale(graphics) { - var scale = this.scale; - var tmpScale = [scale[0], 0, 0, scale[1], 0, 0]; - graphics.transform.apply(graphics, tmpScale); - }, - - scaleToContext: function TilingPattern_scaleToContext() { - var scale = this.scale; - this.ctx.scale(1 / scale[0], 1 / scale[1]); - }, - - clipBbox: function clipBbox(graphics, bbox, x0, y0, x1, y1) { - if (bbox && isArray(bbox) && bbox.length === 4) { - var bboxWidth = x1 - x0; - var bboxHeight = y1 - y0; - graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight); - graphics.clip(); - graphics.endPath(); - } - }, - - setFillAndStrokeStyleToContext: - function setFillAndStrokeStyleToContext(context, paintType, color) { - switch (paintType) { - case PaintType.COLORED: - var ctx = this.ctx; - context.fillStyle = ctx.fillStyle; - context.strokeStyle = ctx.strokeStyle; - break; - case PaintType.UNCOLORED: - var cssColor = Util.makeCssRgb(color[0], color[1], color[2]); - context.fillStyle = cssColor; - context.strokeStyle = cssColor; - break; - default: - error('Unsupported paint type: ' + paintType); - } - }, - - getPattern: function TilingPattern_getPattern(ctx, owner) { - var temporaryPatternCanvas = this.createPatternCanvas(owner); - - ctx = this.ctx; - ctx.setTransform.apply(ctx, this.baseTransform); - ctx.transform.apply(ctx, this.matrix); - this.scaleToContext(); - - return ctx.createPattern(temporaryPatternCanvas, 'repeat'); - } - }; - - return TilingPattern; -})(); - - -function FontLoader(docId) { - this.docId = docId; - this.styleElement = null; - this.nativeFontFaces = []; - this.loadTestFontId = 0; - this.loadingContext = { - requests: [], - nextRequestId: 0 - }; -} -FontLoader.prototype = { - insertRule: function fontLoaderInsertRule(rule) { - var styleElement = this.styleElement; - if (!styleElement) { - styleElement = this.styleElement = document.createElement('style'); - styleElement.id = 'PDFJS_FONT_STYLE_TAG_' + this.docId; - document.documentElement.getElementsByTagName('head')[0].appendChild( - styleElement); - } - - var styleSheet = styleElement.sheet; - styleSheet.insertRule(rule, styleSheet.cssRules.length); - }, - - clear: function fontLoaderClear() { - var styleElement = this.styleElement; - if (styleElement) { - styleElement.parentNode.removeChild(styleElement); - styleElement = this.styleElement = null; - } - this.nativeFontFaces.forEach(function(nativeFontFace) { - document.fonts.delete(nativeFontFace); - }); - this.nativeFontFaces.length = 0; - }, - get loadTestFont() { - // This is a CFF font with 1 glyph for '.' that fills its entire width and - // height. - return shadow(this, 'loadTestFont', atob( - 'T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQ' + - 'AABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwA' + - 'AAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbm' + - 'FtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAA' + - 'AADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6A' + - 'ABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAA' + - 'MQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAA' + - 'AAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAA' + - 'AAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQ' + - 'AAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMA' + - 'AQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAA' + - 'EAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAA' + - 'AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAA' + - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAA' + - 'AAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgc' + - 'A/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWF' + - 'hYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQA' + - 'AAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAg' + - 'ABAAAAAAAAAAAD6AAAAAAAAA==' - )); - }, - - addNativeFontFace: function fontLoader_addNativeFontFace(nativeFontFace) { - this.nativeFontFaces.push(nativeFontFace); - document.fonts.add(nativeFontFace); - }, - - bind: function fontLoaderBind(fonts, callback) { - assert(!isWorker, 'bind() shall be called from main thread'); - - var rules = []; - var fontsToLoad = []; - var fontLoadPromises = []; - var getNativeFontPromise = function(nativeFontFace) { - // Return a promise that is always fulfilled, even when the font fails to - // load. - return nativeFontFace.loaded.catch(function(e) { - warn('Failed to load font "' + nativeFontFace.family + '": ' + e); - }); - }; - for (var i = 0, ii = fonts.length; i < ii; i++) { - var font = fonts[i]; - - // Add the font to the DOM only once or skip if the font - // is already loaded. - if (font.attached || font.loading === false) { - continue; - } - font.attached = true; - - if (FontLoader.isFontLoadingAPISupported) { - var nativeFontFace = font.createNativeFontFace(); - if (nativeFontFace) { - this.addNativeFontFace(nativeFontFace); - fontLoadPromises.push(getNativeFontPromise(nativeFontFace)); - } - } else { - var rule = font.createFontFaceRule(); - if (rule) { - this.insertRule(rule); - rules.push(rule); - fontsToLoad.push(font); - } - } - } - - var request = this.queueLoadingCallback(callback); - if (FontLoader.isFontLoadingAPISupported) { - Promise.all(fontLoadPromises).then(function() { - request.complete(); - }); - } else if (rules.length > 0 && !FontLoader.isSyncFontLoadingSupported) { - this.prepareFontLoadEvent(rules, fontsToLoad, request); - } else { - request.complete(); - } - }, - - queueLoadingCallback: function FontLoader_queueLoadingCallback(callback) { - function LoadLoader_completeRequest() { - assert(!request.end, 'completeRequest() cannot be called twice'); - request.end = Date.now(); - - // sending all completed requests in order how they were queued - while (context.requests.length > 0 && context.requests[0].end) { - var otherRequest = context.requests.shift(); - setTimeout(otherRequest.callback, 0); - } - } - - var context = this.loadingContext; - var requestId = 'pdfjs-font-loading-' + (context.nextRequestId++); - var request = { - id: requestId, - complete: LoadLoader_completeRequest, - callback: callback, - started: Date.now() - }; - context.requests.push(request); - return request; - }, - - prepareFontLoadEvent: function fontLoaderPrepareFontLoadEvent(rules, - fonts, - request) { - /** Hack begin */ - // There's currently no event when a font has finished downloading so the - // following code is a dirty hack to 'guess' when a font is - // ready. It's assumed fonts are loaded in order, so add a known test - // font after the desired fonts and then test for the loading of that - // test font. - - function int32(data, offset) { - return (data.charCodeAt(offset) << 24) | - (data.charCodeAt(offset + 1) << 16) | - (data.charCodeAt(offset + 2) << 8) | - (data.charCodeAt(offset + 3) & 0xff); - } - - function spliceString(s, offset, remove, insert) { - var chunk1 = s.substr(0, offset); - var chunk2 = s.substr(offset + remove); - return chunk1 + insert + chunk2; - } - - var i, ii; - - var canvas = document.createElement('canvas'); - canvas.width = 1; - canvas.height = 1; - var ctx = canvas.getContext('2d'); - - var called = 0; - function isFontReady(name, callback) { - called++; - // With setTimeout clamping this gives the font ~100ms to load. - if(called > 30) { - warn('Load test font never loaded.'); - callback(); - return; - } - ctx.font = '30px ' + name; - ctx.fillText('.', 0, 20); - var imageData = ctx.getImageData(0, 0, 1, 1); - if (imageData.data[3] > 0) { - callback(); - return; - } - setTimeout(isFontReady.bind(null, name, callback)); - } - - var loadTestFontId = 'lt' + Date.now() + this.loadTestFontId++; - // Chromium seems to cache fonts based on a hash of the actual font data, - // so the font must be modified for each load test else it will appear to - // be loaded already. - // TODO: This could maybe be made faster by avoiding the btoa of the full - // font by splitting it in chunks before hand and padding the font id. - var data = this.loadTestFont; - var COMMENT_OFFSET = 976; // has to be on 4 byte boundary (for checksum) - data = spliceString(data, COMMENT_OFFSET, loadTestFontId.length, - loadTestFontId); - // CFF checksum is important for IE, adjusting it - var CFF_CHECKSUM_OFFSET = 16; - var XXXX_VALUE = 0x58585858; // the "comment" filled with 'X' - var checksum = int32(data, CFF_CHECKSUM_OFFSET); - for (i = 0, ii = loadTestFontId.length - 3; i < ii; i += 4) { - checksum = (checksum - XXXX_VALUE + int32(loadTestFontId, i)) | 0; - } - if (i < loadTestFontId.length) { // align to 4 bytes boundary - checksum = (checksum - XXXX_VALUE + - int32(loadTestFontId + 'XXX', i)) | 0; - } - data = spliceString(data, CFF_CHECKSUM_OFFSET, 4, string32(checksum)); - - var url = 'url(data:font/opentype;base64,' + btoa(data) + ');'; - var rule = '@font-face { font-family:"' + loadTestFontId + '";src:' + - url + '}'; - this.insertRule(rule); - - var names = []; - for (i = 0, ii = fonts.length; i < ii; i++) { - names.push(fonts[i].loadedName); - } - names.push(loadTestFontId); - - var div = document.createElement('div'); - div.setAttribute('style', - 'visibility: hidden;' + - 'width: 10px; height: 10px;' + - 'position: absolute; top: 0px; left: 0px;'); - for (i = 0, ii = names.length; i < ii; ++i) { - var span = document.createElement('span'); - span.textContent = 'Hi'; - span.style.fontFamily = names[i]; - div.appendChild(span); - } - document.body.appendChild(div); - - isFontReady(loadTestFontId, function() { - document.body.removeChild(div); - request.complete(); - }); - /** Hack end */ - } -}; -FontLoader.isFontLoadingAPISupported = (!isWorker && - typeof document !== 'undefined' && !!document.fonts); -Object.defineProperty(FontLoader, 'isSyncFontLoadingSupported', { - get: function () { - var supported = false; - - // User agent string sniffing is bad, but there is no reliable way to tell - // if font is fully loaded and ready to be used with canvas. - var userAgent = window.navigator.userAgent; - var m = /Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(userAgent); - if (m && m[1] >= 14) { - supported = true; - } - // TODO other browsers - if (userAgent === 'node') { - supported = true; - } - return shadow(FontLoader, 'isSyncFontLoadingSupported', supported); - }, - enumerable: true, - configurable: true -}); - -var FontFaceObject = (function FontFaceObjectClosure() { - function FontFaceObject(translatedData) { - this.compiledGlyphs = {}; - // importing translated data - for (var i in translatedData) { - this[i] = translatedData[i]; - } - } - Object.defineProperty(FontFaceObject, 'isEvalSupported', { - get: function () { - var evalSupport = false; - if (PDFJS.isEvalSupported) { - try { - /* jshint evil: true */ - new Function(''); - evalSupport = true; - } catch (e) {} - } - return shadow(this, 'isEvalSupported', evalSupport); - }, - enumerable: true, - configurable: true - }); - FontFaceObject.prototype = { - createNativeFontFace: function FontFaceObject_createNativeFontFace() { - if (!this.data) { - return null; - } - - if (PDFJS.disableFontFace) { - this.disableFontFace = true; - return null; - } - - var nativeFontFace = new FontFace(this.loadedName, this.data, {}); - - if (PDFJS.pdfBug && 'FontInspector' in globalScope && - globalScope['FontInspector'].enabled) { - globalScope['FontInspector'].fontAdded(this); - } - return nativeFontFace; - }, - - createFontFaceRule: function FontFaceObject_createFontFaceRule() { - if (!this.data) { - return null; - } - - if (PDFJS.disableFontFace) { - this.disableFontFace = true; - return null; - } - - var data = bytesToString(new Uint8Array(this.data)); - var fontName = this.loadedName; - - // Add the font-face rule to the document - var url = ('url(data:' + this.mimetype + ';base64,' + - window.btoa(data) + ');'); - var rule = '@font-face { font-family:"' + fontName + '";src:' + url + '}'; - - if (PDFJS.pdfBug && 'FontInspector' in globalScope && - globalScope['FontInspector'].enabled) { - globalScope['FontInspector'].fontAdded(this, url); - } - - return rule; - }, - - getPathGenerator: - function FontFaceObject_getPathGenerator(objs, character) { - if (!(character in this.compiledGlyphs)) { - var cmds = objs.get(this.loadedName + '_path_' + character); - var current, i, len; - - // If we can, compile cmds into JS for MAXIMUM SPEED - if (FontFaceObject.isEvalSupported) { - var args, js = ''; - for (i = 0, len = cmds.length; i < len; i++) { - current = cmds[i]; - - if (current.args !== undefined) { - args = current.args.join(','); - } else { - args = ''; - } - - js += 'c.' + current.cmd + '(' + args + ');\n'; - } - /* jshint -W054 */ - this.compiledGlyphs[character] = new Function('c', 'size', js); - } else { - // But fall back on using Function.prototype.apply() if we're - // blocked from using eval() for whatever reason (like CSP policies) - this.compiledGlyphs[character] = function(c, size) { - for (i = 0, len = cmds.length; i < len; i++) { - current = cmds[i]; - - if (current.cmd === 'scale') { - current.args = [size, -size]; - } - - c[current.cmd].apply(c, current.args); - } - }; - } - } - return this.compiledGlyphs[character]; - } - }; - return FontFaceObject; -})(); - - -/** - * Optimised CSS custom property getter/setter. - * @class - */ -var CustomStyle = (function CustomStyleClosure() { - - // As noted on: http://www.zachstronaut.com/posts/2009/02/17/ - // animate-css-transforms-firefox-webkit.html - // in some versions of IE9 it is critical that ms appear in this list - // before Moz - var prefixes = ['ms', 'Moz', 'Webkit', 'O']; - var _cache = {}; - - function CustomStyle() {} - - CustomStyle.getProp = function get(propName, element) { - // check cache only when no element is given - if (arguments.length === 1 && typeof _cache[propName] === 'string') { - return _cache[propName]; - } - - element = element || document.documentElement; - var style = element.style, prefixed, uPropName; - - // test standard property first - if (typeof style[propName] === 'string') { - return (_cache[propName] = propName); - } - - // capitalize - uPropName = propName.charAt(0).toUpperCase() + propName.slice(1); - - // test vendor specific properties - for (var i = 0, l = prefixes.length; i < l; i++) { - prefixed = prefixes[i] + uPropName; - if (typeof style[prefixed] === 'string') { - return (_cache[propName] = prefixed); - } - } - - //if all fails then set to undefined - return (_cache[propName] = 'undefined'); - }; - - CustomStyle.setProp = function set(propName, element, str) { - var prop = this.getProp(propName); - if (prop !== 'undefined') { - element.style[prop] = str; - } - }; - - return CustomStyle; -})(); - -PDFJS.CustomStyle = CustomStyle; - - -var ANNOT_MIN_SIZE = 10; // px - -var AnnotationLayer = (function AnnotationLayerClosure() { - // TODO(mack): This dupes some of the logic in CanvasGraphics.setFont() - function setTextStyles(element, item, fontObj) { - var style = element.style; - style.fontSize = item.fontSize + 'px'; - style.direction = item.fontDirection < 0 ? 'rtl': 'ltr'; - - if (!fontObj) { - return; - } - - style.fontWeight = fontObj.black ? - (fontObj.bold ? 'bolder' : 'bold') : - (fontObj.bold ? 'bold' : 'normal'); - style.fontStyle = fontObj.italic ? 'italic' : 'normal'; - - var fontName = fontObj.loadedName; - var fontFamily = fontName ? '"' + fontName + '", ' : ''; - // Use a reasonable default font if the font doesn't specify a fallback - var fallbackName = fontObj.fallbackName || 'Helvetica, sans-serif'; - style.fontFamily = fontFamily + fallbackName; - } - - function getContainer(data, page, viewport) { - var container = document.createElement('section'); - var width = data.rect[2] - data.rect[0]; - var height = data.rect[3] - data.rect[1]; - - container.setAttribute('data-annotation-id', data.id); - - data.rect = Util.normalizeRect([ - data.rect[0], - page.view[3] - data.rect[1] + page.view[1], - data.rect[2], - page.view[3] - data.rect[3] + page.view[1] - ]); - - CustomStyle.setProp('transform', container, - 'matrix(' + viewport.transform.join(',') + ')'); - CustomStyle.setProp('transformOrigin', container, - -data.rect[0] + 'px ' + -data.rect[1] + 'px'); - - if (data.borderStyle.width > 0) { - container.style.borderWidth = data.borderStyle.width + 'px'; - if (data.borderStyle.style !== AnnotationBorderStyleType.UNDERLINE) { - // Underline styles only have a bottom border, so we do not need - // to adjust for all borders. This yields a similar result as - // Adobe Acrobat/Reader. - width = width - 2 * data.borderStyle.width; - height = height - 2 * data.borderStyle.width; - } - - var horizontalRadius = data.borderStyle.horizontalCornerRadius; - var verticalRadius = data.borderStyle.verticalCornerRadius; - if (horizontalRadius > 0 || verticalRadius > 0) { - var radius = horizontalRadius + 'px / ' + verticalRadius + 'px'; - CustomStyle.setProp('borderRadius', container, radius); - } - - switch (data.borderStyle.style) { - case AnnotationBorderStyleType.SOLID: - container.style.borderStyle = 'solid'; - break; - - case AnnotationBorderStyleType.DASHED: - container.style.borderStyle = 'dashed'; - break; - - case AnnotationBorderStyleType.BEVELED: - warn('Unimplemented border style: beveled'); - break; - - case AnnotationBorderStyleType.INSET: - warn('Unimplemented border style: inset'); - break; - - case AnnotationBorderStyleType.UNDERLINE: - container.style.borderBottomStyle = 'solid'; - break; - - default: - break; - } - - if (data.color) { - container.style.borderColor = - Util.makeCssRgb(data.color[0] | 0, - data.color[1] | 0, - data.color[2] | 0); - } else { - // Transparent (invisible) border, so do not draw it at all. - container.style.borderWidth = 0; - } - } - - container.style.left = data.rect[0] + 'px'; - container.style.top = data.rect[1] + 'px'; - - container.style.width = width + 'px'; - container.style.height = height + 'px'; - - return container; - } - - function getHtmlElementForTextWidgetAnnotation(item, page) { - var element = document.createElement('div'); - var width = item.rect[2] - item.rect[0]; - var height = item.rect[3] - item.rect[1]; - element.style.width = width + 'px'; - element.style.height = height + 'px'; - element.style.display = 'table'; - - var content = document.createElement('div'); - content.textContent = item.fieldValue; - var textAlignment = item.textAlignment; - content.style.textAlign = ['left', 'center', 'right'][textAlignment]; - content.style.verticalAlign = 'middle'; - content.style.display = 'table-cell'; - - var fontObj = item.fontRefName ? - page.commonObjs.getData(item.fontRefName) : null; - setTextStyles(content, item, fontObj); - - element.appendChild(content); - - return element; - } - - function getHtmlElementForTextAnnotation(item, page, viewport) { - var rect = item.rect; - - // sanity check because of OOo-generated PDFs - if ((rect[3] - rect[1]) < ANNOT_MIN_SIZE) { - rect[3] = rect[1] + ANNOT_MIN_SIZE; - } - if ((rect[2] - rect[0]) < ANNOT_MIN_SIZE) { - rect[2] = rect[0] + (rect[3] - rect[1]); // make it square - } - - var container = getContainer(item, page, viewport); - container.className = 'annotText'; - - var image = document.createElement('img'); - image.style.height = container.style.height; - image.style.width = container.style.width; - var iconName = item.name; - image.src = PDFJS.imageResourcesPath + 'annotation-' + - iconName.toLowerCase() + '.svg'; - image.alt = '[{{type}} Annotation]'; - image.dataset.l10nId = 'text_annotation_type'; - image.dataset.l10nArgs = JSON.stringify({type: iconName}); - - var contentWrapper = document.createElement('div'); - contentWrapper.className = 'annotTextContentWrapper'; - contentWrapper.style.left = Math.floor(rect[2] - rect[0] + 5) + 'px'; - contentWrapper.style.top = '-10px'; - - var content = document.createElement('div'); - content.className = 'annotTextContent'; - content.setAttribute('hidden', true); - - var i, ii; - if (item.hasBgColor && item.color) { - var color = item.color; - - // Enlighten the color (70%) - var BACKGROUND_ENLIGHT = 0.7; - var r = BACKGROUND_ENLIGHT * (255 - color[0]) + color[0]; - var g = BACKGROUND_ENLIGHT * (255 - color[1]) + color[1]; - var b = BACKGROUND_ENLIGHT * (255 - color[2]) + color[2]; - content.style.backgroundColor = Util.makeCssRgb(r | 0, g | 0, b | 0); - } - - var title = document.createElement('h1'); - var text = document.createElement('p'); - title.textContent = item.title; - - if (!item.content && !item.title) { - content.setAttribute('hidden', true); - } else { - var e = document.createElement('span'); - var lines = item.content.split(/(?:\r\n?|\n)/); - for (i = 0, ii = lines.length; i < ii; ++i) { - var line = lines[i]; - e.appendChild(document.createTextNode(line)); - if (i < (ii - 1)) { - e.appendChild(document.createElement('br')); - } - } - text.appendChild(e); - - var pinned = false; - - var showAnnotation = function showAnnotation(pin) { - if (pin) { - pinned = true; - } - if (content.hasAttribute('hidden')) { - container.style.zIndex += 1; - content.removeAttribute('hidden'); - } - }; - - var hideAnnotation = function hideAnnotation(unpin) { - if (unpin) { - pinned = false; - } - if (!content.hasAttribute('hidden') && !pinned) { - container.style.zIndex -= 1; - content.setAttribute('hidden', true); - } - }; - - var toggleAnnotation = function toggleAnnotation() { - if (pinned) { - hideAnnotation(true); - } else { - showAnnotation(true); - } - }; - - image.addEventListener('click', function image_clickHandler() { - toggleAnnotation(); - }, false); - image.addEventListener('mouseover', function image_mouseOverHandler() { - showAnnotation(); - }, false); - image.addEventListener('mouseout', function image_mouseOutHandler() { - hideAnnotation(); - }, false); - - content.addEventListener('click', function content_clickHandler() { - hideAnnotation(true); - }, false); - } - - content.appendChild(title); - content.appendChild(text); - contentWrapper.appendChild(content); - container.appendChild(image); - container.appendChild(contentWrapper); - - return container; - } - - function getHtmlElementForLinkAnnotation(item, page, viewport, linkService) { - function bindLink(link, dest) { - link.href = linkService.getDestinationHash(dest); - link.onclick = function annotationsLayerBuilderLinksOnclick() { - if (dest) { - linkService.navigateTo(dest); - } - return false; - }; - if (dest) { - link.className = 'internalLink'; - } - } - - function bindNamedAction(link, action) { - link.href = linkService.getAnchorUrl(''); - link.onclick = function annotationsLayerBuilderNamedActionOnClick() { - linkService.executeNamedAction(action); - return false; - }; - link.className = 'internalLink'; - } - - var container = getContainer(item, page, viewport); - container.className = 'annotLink'; - - var link = document.createElement('a'); - link.href = link.title = item.url || ''; - - if (item.url && isExternalLinkTargetSet()) { - link.target = LinkTargetStringMap[PDFJS.externalLinkTarget]; - } - - if (!item.url) { - if (item.action) { - bindNamedAction(link, item.action); - } else { - bindLink(link, ('dest' in item) ? item.dest : null); - } - } - - container.appendChild(link); - - return container; - } - - function getHtmlElement(data, page, viewport, linkService) { - switch (data.annotationType) { - case AnnotationType.WIDGET: - return getHtmlElementForTextWidgetAnnotation(data, page); - case AnnotationType.TEXT: - return getHtmlElementForTextAnnotation(data, page, viewport); - case AnnotationType.LINK: - return getHtmlElementForLinkAnnotation(data, page, viewport, - linkService); - default: - throw new Error('Unsupported annotationType: ' + data.annotationType); - } - } - - function render(viewport, div, annotations, page, linkService) { - for (var i = 0, ii = annotations.length; i < ii; i++) { - var data = annotations[i]; - if (!data || !data.hasHtml) { - continue; - } - - var element = getHtmlElement(data, page, viewport, linkService); - div.appendChild(element); - } - } - - function update(viewport, div, annotations) { - for (var i = 0, ii = annotations.length; i < ii; i++) { - var data = annotations[i]; - var element = div.querySelector( - '[data-annotation-id="' + data.id + '"]'); - if (element) { - CustomStyle.setProp('transform', element, - 'matrix(' + viewport.transform.join(',') + ')'); - } - } - div.removeAttribute('hidden'); - } - - return { - render: render, - update: update - }; -})(); - -PDFJS.AnnotationLayer = AnnotationLayer; - - -/** - * Text layer render parameters. - * - * @typedef {Object} TextLayerRenderParameters - * @property {TextContent} textContent - Text content to render (the object is - * returned by the page's getTextContent() method). - * @property {HTMLElement} container - HTML element that will contain text runs. - * @property {PDFJS.PageViewport} viewport - The target viewport to properly - * layout the text runs. - * @property {Array} textDivs - (optional) HTML elements that are correspond - * the text items of the textContent input. This is output and shall be - * initially be set to empty array. - * @property {number} timeout - (optional) Delay in milliseconds before - * rendering of the text runs occurs. - */ -var renderTextLayer = (function renderTextLayerClosure() { - var MAX_TEXT_DIVS_TO_RENDER = 100000; - - var NonWhitespaceRegexp = /\S/; - - function isAllWhitespace(str) { - return !NonWhitespaceRegexp.test(str); - } - - function appendText(textDivs, viewport, geom, styles) { - var style = styles[geom.fontName]; - var textDiv = document.createElement('div'); - textDivs.push(textDiv); - if (isAllWhitespace(geom.str)) { - textDiv.dataset.isWhitespace = true; - return; - } - var tx = PDFJS.Util.transform(viewport.transform, geom.transform); - var angle = Math.atan2(tx[1], tx[0]); - if (style.vertical) { - angle += Math.PI / 2; - } - var fontHeight = Math.sqrt((tx[2] * tx[2]) + (tx[3] * tx[3])); - var fontAscent = fontHeight; - if (style.ascent) { - fontAscent = style.ascent * fontAscent; - } else if (style.descent) { - fontAscent = (1 + style.descent) * fontAscent; - } - - var left; - var top; - if (angle === 0) { - left = tx[4]; - top = tx[5] - fontAscent; - } else { - left = tx[4] + (fontAscent * Math.sin(angle)); - top = tx[5] - (fontAscent * Math.cos(angle)); - } - textDiv.style.left = left + 'px'; - textDiv.style.top = top + 'px'; - textDiv.style.fontSize = fontHeight + 'px'; - textDiv.style.fontFamily = style.fontFamily; - - textDiv.textContent = geom.str; - // |fontName| is only used by the Font Inspector. This test will succeed - // when e.g. the Font Inspector is off but the Stepper is on, but it's - // not worth the effort to do a more accurate test. - if (PDFJS.pdfBug) { - textDiv.dataset.fontName = geom.fontName; - } - // Storing into dataset will convert number into string. - if (angle !== 0) { - textDiv.dataset.angle = angle * (180 / Math.PI); - } - // We don't bother scaling single-char text divs, because it has very - // little effect on text highlighting. This makes scrolling on docs with - // lots of such divs a lot faster. - if (geom.str.length > 1) { - if (style.vertical) { - textDiv.dataset.canvasWidth = geom.height * viewport.scale; - } else { - textDiv.dataset.canvasWidth = geom.width * viewport.scale; - } - } - } - - function render(task) { - if (task._canceled) { - return; - } - var textLayerFrag = task._container; - var textDivs = task._textDivs; - var capability = task._capability; - var textDivsLength = textDivs.length; - - // No point in rendering many divs as it would make the browser - // unusable even after the divs are rendered. - if (textDivsLength > MAX_TEXT_DIVS_TO_RENDER) { - capability.resolve(); - return; - } - - var canvas = document.createElement('canvas'); - canvas.mozOpaque = true; - var ctx = canvas.getContext('2d', {alpha: false}); - - var lastFontSize; - var lastFontFamily; - for (var i = 0; i < textDivsLength; i++) { - var textDiv = textDivs[i]; - if (textDiv.dataset.isWhitespace !== undefined) { - continue; - } - - var fontSize = textDiv.style.fontSize; - var fontFamily = textDiv.style.fontFamily; - - // Only build font string and set to context if different from last. - if (fontSize !== lastFontSize || fontFamily !== lastFontFamily) { - ctx.font = fontSize + ' ' + fontFamily; - lastFontSize = fontSize; - lastFontFamily = fontFamily; - } - - var width = ctx.measureText(textDiv.textContent).width; - if (width > 0) { - textLayerFrag.appendChild(textDiv); - var transform; - if (textDiv.dataset.canvasWidth !== undefined) { - // Dataset values come of type string. - var textScale = textDiv.dataset.canvasWidth / width; - transform = 'scaleX(' + textScale + ')'; - } else { - transform = ''; - } - var rotation = textDiv.dataset.angle; - if (rotation) { - transform = 'rotate(' + rotation + 'deg) ' + transform; - } - if (transform) { - PDFJS.CustomStyle.setProp('transform' , textDiv, transform); - } - } - } - capability.resolve(); - } - - /** - * Text layer rendering task. - * - * @param {TextContent} textContent - * @param {HTMLElement} container - * @param {PDFJS.PageViewport} viewport - * @param {Array} textDivs - * @private - */ - function TextLayerRenderTask(textContent, container, viewport, textDivs) { - this._textContent = textContent; - this._container = container; - this._viewport = viewport; - textDivs = textDivs || []; - this._textDivs = textDivs; - this._canceled = false; - this._capability = createPromiseCapability(); - this._renderTimer = null; - } - TextLayerRenderTask.prototype = { - get promise() { - return this._capability.promise; - }, - - cancel: function TextLayer_cancel() { - this._canceled = true; - if (this._renderTimer !== null) { - clearTimeout(this._renderTimer); - this._renderTimer = null; - } - this._capability.reject('canceled'); - }, - - _render: function TextLayer_render(timeout) { - var textItems = this._textContent.items; - var styles = this._textContent.styles; - var textDivs = this._textDivs; - var viewport = this._viewport; - for (var i = 0, len = textItems.length; i < len; i++) { - appendText(textDivs, viewport, textItems[i], styles); - } - - if (!timeout) { // Render right away - render(this); - } else { // Schedule - var self = this; - this._renderTimer = setTimeout(function() { - render(self); - self._renderTimer = null; - }, timeout); - } - } - }; - - - /** - * Starts rendering of the text layer. - * - * @param {TextLayerRenderParameters} renderParameters - * @returns {TextLayerRenderTask} - */ - function renderTextLayer(renderParameters) { - var task = new TextLayerRenderTask(renderParameters.textContent, - renderParameters.container, - renderParameters.viewport, - renderParameters.textDivs); - task._render(renderParameters.timeout); - return task; - } - - return renderTextLayer; -})(); - -PDFJS.renderTextLayer = renderTextLayer; - - -var SVG_DEFAULTS = { - fontStyle: 'normal', - fontWeight: 'normal', - fillColor: '#000000' -}; - -var convertImgDataToPng = (function convertImgDataToPngClosure() { - var PNG_HEADER = - new Uint8Array([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]); - - var CHUNK_WRAPPER_SIZE = 12; - - var crcTable = new Int32Array(256); - for (var i = 0; i < 256; i++) { - var c = i; - for (var h = 0; h < 8; h++) { - if (c & 1) { - c = 0xedB88320 ^ ((c >> 1) & 0x7fffffff); - } else { - c = (c >> 1) & 0x7fffffff; - } - } - crcTable[i] = c; - } - - function crc32(data, start, end) { - var crc = -1; - for (var i = start; i < end; i++) { - var a = (crc ^ data[i]) & 0xff; - var b = crcTable[a]; - crc = (crc >>> 8) ^ b; - } - return crc ^ -1; - } - - function writePngChunk(type, body, data, offset) { - var p = offset; - var len = body.length; - - data[p] = len >> 24 & 0xff; - data[p + 1] = len >> 16 & 0xff; - data[p + 2] = len >> 8 & 0xff; - data[p + 3] = len & 0xff; - p += 4; - - data[p] = type.charCodeAt(0) & 0xff; - data[p + 1] = type.charCodeAt(1) & 0xff; - data[p + 2] = type.charCodeAt(2) & 0xff; - data[p + 3] = type.charCodeAt(3) & 0xff; - p += 4; - - data.set(body, p); - p += body.length; - - var crc = crc32(data, offset + 4, p); - - data[p] = crc >> 24 & 0xff; - data[p + 1] = crc >> 16 & 0xff; - data[p + 2] = crc >> 8 & 0xff; - data[p + 3] = crc & 0xff; - } - - function adler32(data, start, end) { - var a = 1; - var b = 0; - for (var i = start; i < end; ++i) { - a = (a + (data[i] & 0xff)) % 65521; - b = (b + a) % 65521; - } - return (b << 16) | a; - } - - function encode(imgData, kind) { - var width = imgData.width; - var height = imgData.height; - var bitDepth, colorType, lineSize; - var bytes = imgData.data; - - switch (kind) { - case ImageKind.GRAYSCALE_1BPP: - colorType = 0; - bitDepth = 1; - lineSize = (width + 7) >> 3; - break; - case ImageKind.RGB_24BPP: - colorType = 2; - bitDepth = 8; - lineSize = width * 3; - break; - case ImageKind.RGBA_32BPP: - colorType = 6; - bitDepth = 8; - lineSize = width * 4; - break; - default: - throw new Error('invalid format'); - } - - // prefix every row with predictor 0 - var literals = new Uint8Array((1 + lineSize) * height); - var offsetLiterals = 0, offsetBytes = 0; - var y, i; - for (y = 0; y < height; ++y) { - literals[offsetLiterals++] = 0; // no prediction - literals.set(bytes.subarray(offsetBytes, offsetBytes + lineSize), - offsetLiterals); - offsetBytes += lineSize; - offsetLiterals += lineSize; - } - - if (kind === ImageKind.GRAYSCALE_1BPP) { - // inverting for B/W - offsetLiterals = 0; - for (y = 0; y < height; y++) { - offsetLiterals++; // skipping predictor - for (i = 0; i < lineSize; i++) { - literals[offsetLiterals++] ^= 0xFF; - } - } - } - - var ihdr = new Uint8Array([ - width >> 24 & 0xff, - width >> 16 & 0xff, - width >> 8 & 0xff, - width & 0xff, - height >> 24 & 0xff, - height >> 16 & 0xff, - height >> 8 & 0xff, - height & 0xff, - bitDepth, // bit depth - colorType, // color type - 0x00, // compression method - 0x00, // filter method - 0x00 // interlace method - ]); - - var len = literals.length; - var maxBlockLength = 0xFFFF; - - var deflateBlocks = Math.ceil(len / maxBlockLength); - var idat = new Uint8Array(2 + len + deflateBlocks * 5 + 4); - var pi = 0; - idat[pi++] = 0x78; // compression method and flags - idat[pi++] = 0x9c; // flags - - var pos = 0; - while (len > maxBlockLength) { - // writing non-final DEFLATE blocks type 0 and length of 65535 - idat[pi++] = 0x00; - idat[pi++] = 0xff; - idat[pi++] = 0xff; - idat[pi++] = 0x00; - idat[pi++] = 0x00; - idat.set(literals.subarray(pos, pos + maxBlockLength), pi); - pi += maxBlockLength; - pos += maxBlockLength; - len -= maxBlockLength; - } - - // writing non-final DEFLATE blocks type 0 - idat[pi++] = 0x01; - idat[pi++] = len & 0xff; - idat[pi++] = len >> 8 & 0xff; - idat[pi++] = (~len & 0xffff) & 0xff; - idat[pi++] = (~len & 0xffff) >> 8 & 0xff; - idat.set(literals.subarray(pos), pi); - pi += literals.length - pos; - - var adler = adler32(literals, 0, literals.length); // checksum - idat[pi++] = adler >> 24 & 0xff; - idat[pi++] = adler >> 16 & 0xff; - idat[pi++] = adler >> 8 & 0xff; - idat[pi++] = adler & 0xff; - - // PNG will consists: header, IHDR+data, IDAT+data, and IEND. - var pngLength = PNG_HEADER.length + (CHUNK_WRAPPER_SIZE * 3) + - ihdr.length + idat.length; - var data = new Uint8Array(pngLength); - var offset = 0; - data.set(PNG_HEADER, offset); - offset += PNG_HEADER.length; - writePngChunk('IHDR', ihdr, data, offset); - offset += CHUNK_WRAPPER_SIZE + ihdr.length; - writePngChunk('IDATA', idat, data, offset); - offset += CHUNK_WRAPPER_SIZE + idat.length; - writePngChunk('IEND', new Uint8Array(0), data, offset); - - return PDFJS.createObjectURL(data, 'image/png'); - } - - return function convertImgDataToPng(imgData) { - var kind = (imgData.kind === undefined ? - ImageKind.GRAYSCALE_1BPP : imgData.kind); - return encode(imgData, kind); - }; -})(); - -var SVGExtraState = (function SVGExtraStateClosure() { - function SVGExtraState() { - this.fontSizeScale = 1; - this.fontWeight = SVG_DEFAULTS.fontWeight; - this.fontSize = 0; - - this.textMatrix = IDENTITY_MATRIX; - this.fontMatrix = FONT_IDENTITY_MATRIX; - this.leading = 0; - - // Current point (in user coordinates) - this.x = 0; - this.y = 0; - - // Start of text line (in text coordinates) - this.lineX = 0; - this.lineY = 0; - - // Character and word spacing - this.charSpacing = 0; - this.wordSpacing = 0; - this.textHScale = 1; - this.textRise = 0; - - // Default foreground and background colors - this.fillColor = SVG_DEFAULTS.fillColor; - this.strokeColor = '#000000'; - - this.fillAlpha = 1; - this.strokeAlpha = 1; - this.lineWidth = 1; - this.lineJoin = ''; - this.lineCap = ''; - this.miterLimit = 0; - - this.dashArray = []; - this.dashPhase = 0; - - this.dependencies = []; - - // Clipping - this.clipId = ''; - this.pendingClip = false; - - this.maskId = ''; - } - - SVGExtraState.prototype = { - clone: function SVGExtraState_clone() { - return Object.create(this); - }, - setCurrentPoint: function SVGExtraState_setCurrentPoint(x, y) { - this.x = x; - this.y = y; - } - }; - return SVGExtraState; -})(); - -var SVGGraphics = (function SVGGraphicsClosure() { - function createScratchSVG(width, height) { - var NS = 'http://www.w3.org/2000/svg'; - var svg = document.createElementNS(NS, 'svg:svg'); - svg.setAttributeNS(null, 'version', '1.1'); - svg.setAttributeNS(null, 'width', width + 'px'); - svg.setAttributeNS(null, 'height', height + 'px'); - svg.setAttributeNS(null, 'viewBox', '0 0 ' + width + ' ' + height); - return svg; - } - - function opListToTree(opList) { - var opTree = []; - var tmp = []; - var opListLen = opList.length; - - for (var x = 0; x < opListLen; x++) { - if (opList[x].fn === 'save') { - opTree.push({'fnId': 92, 'fn': 'group', 'items': []}); - tmp.push(opTree); - opTree = opTree[opTree.length - 1].items; - continue; - } - - if(opList[x].fn === 'restore') { - opTree = tmp.pop(); - } else { - opTree.push(opList[x]); - } - } - return opTree; - } - - /** - * Formats float number. - * @param value {number} number to format. - * @returns {string} - */ - function pf(value) { - if (value === (value | 0)) { // integer number - return value.toString(); - } - var s = value.toFixed(10); - var i = s.length - 1; - if (s[i] !== '0') { - return s; - } - // removing trailing zeros - do { - i--; - } while (s[i] === '0'); - return s.substr(0, s[i] === '.' ? i : i + 1); - } - - /** - * Formats transform matrix. The standard rotation, scale and translate - * matrices are replaced by their shorter forms, and for identity matrix - * returns empty string to save the memory. - * @param m {Array} matrix to format. - * @returns {string} - */ - function pm(m) { - if (m[4] === 0 && m[5] === 0) { - if (m[1] === 0 && m[2] === 0) { - if (m[0] === 1 && m[3] === 1) { - return ''; - } - return 'scale(' + pf(m[0]) + ' ' + pf(m[3]) + ')'; - } - if (m[0] === m[3] && m[1] === -m[2]) { - var a = Math.acos(m[0]) * 180 / Math.PI; - return 'rotate(' + pf(a) + ')'; - } - } else { - if (m[0] === 1 && m[1] === 0 && m[2] === 0 && m[3] === 1) { - return 'translate(' + pf(m[4]) + ' ' + pf(m[5]) + ')'; - } - } - return 'matrix(' + pf(m[0]) + ' ' + pf(m[1]) + ' ' + pf(m[2]) + ' ' + - pf(m[3]) + ' ' + pf(m[4]) + ' ' + pf(m[5]) + ')'; - } - - function SVGGraphics(commonObjs, objs) { - this.current = new SVGExtraState(); - this.transformMatrix = IDENTITY_MATRIX; // Graphics state matrix - this.transformStack = []; - this.extraStack = []; - this.commonObjs = commonObjs; - this.objs = objs; - this.pendingEOFill = false; - - this.embedFonts = false; - this.embeddedFonts = {}; - this.cssStyle = null; - } - - var NS = 'http://www.w3.org/2000/svg'; - var XML_NS = 'http://www.w3.org/XML/1998/namespace'; - var XLINK_NS = 'http://www.w3.org/1999/xlink'; - var LINE_CAP_STYLES = ['butt', 'round', 'square']; - var LINE_JOIN_STYLES = ['miter', 'round', 'bevel']; - var clipCount = 0; - var maskCount = 0; - - SVGGraphics.prototype = { - save: function SVGGraphics_save() { - this.transformStack.push(this.transformMatrix); - var old = this.current; - this.extraStack.push(old); - this.current = old.clone(); - }, - - restore: function SVGGraphics_restore() { - this.transformMatrix = this.transformStack.pop(); - this.current = this.extraStack.pop(); - - this.tgrp = document.createElementNS(NS, 'svg:g'); - this.tgrp.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - this.pgrp.appendChild(this.tgrp); - }, - - group: function SVGGraphics_group(items) { - this.save(); - this.executeOpTree(items); - this.restore(); - }, - - loadDependencies: function SVGGraphics_loadDependencies(operatorList) { - var fnArray = operatorList.fnArray; - var fnArrayLen = fnArray.length; - var argsArray = operatorList.argsArray; - - var self = this; - for (var i = 0; i < fnArrayLen; i++) { - if (OPS.dependency === fnArray[i]) { - var deps = argsArray[i]; - for (var n = 0, nn = deps.length; n < nn; n++) { - var obj = deps[n]; - var common = obj.substring(0, 2) === 'g_'; - var promise; - if (common) { - promise = new Promise(function(resolve) { - self.commonObjs.get(obj, resolve); - }); - } else { - promise = new Promise(function(resolve) { - self.objs.get(obj, resolve); - }); - } - this.current.dependencies.push(promise); - } - } - } - return Promise.all(this.current.dependencies); - }, - - transform: function SVGGraphics_transform(a, b, c, d, e, f) { - var transformMatrix = [a, b, c, d, e, f]; - this.transformMatrix = PDFJS.Util.transform(this.transformMatrix, - transformMatrix); - - this.tgrp = document.createElementNS(NS, 'svg:g'); - this.tgrp.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - }, - - getSVG: function SVGGraphics_getSVG(operatorList, viewport) { - this.svg = createScratchSVG(viewport.width, viewport.height); - this.viewport = viewport; - - return this.loadDependencies(operatorList).then(function () { - this.transformMatrix = IDENTITY_MATRIX; - this.pgrp = document.createElementNS(NS, 'svg:g'); // Parent group - this.pgrp.setAttributeNS(null, 'transform', pm(viewport.transform)); - this.tgrp = document.createElementNS(NS, 'svg:g'); // Transform group - this.tgrp.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - this.defs = document.createElementNS(NS, 'svg:defs'); - this.pgrp.appendChild(this.defs); - this.pgrp.appendChild(this.tgrp); - this.svg.appendChild(this.pgrp); - var opTree = this.convertOpList(operatorList); - this.executeOpTree(opTree); - return this.svg; - }.bind(this)); - }, - - convertOpList: function SVGGraphics_convertOpList(operatorList) { - var argsArray = operatorList.argsArray; - var fnArray = operatorList.fnArray; - var fnArrayLen = fnArray.length; - var REVOPS = []; - var opList = []; - - for (var op in OPS) { - REVOPS[OPS[op]] = op; - } - - for (var x = 0; x < fnArrayLen; x++) { - var fnId = fnArray[x]; - opList.push({'fnId' : fnId, 'fn': REVOPS[fnId], 'args': argsArray[x]}); - } - return opListToTree(opList); - }, - - executeOpTree: function SVGGraphics_executeOpTree(opTree) { - var opTreeLen = opTree.length; - for(var x = 0; x < opTreeLen; x++) { - var fn = opTree[x].fn; - var fnId = opTree[x].fnId; - var args = opTree[x].args; - - switch (fnId | 0) { - case OPS.beginText: - this.beginText(); - break; - case OPS.setLeading: - this.setLeading(args); - break; - case OPS.setLeadingMoveText: - this.setLeadingMoveText(args[0], args[1]); - break; - case OPS.setFont: - this.setFont(args); - break; - case OPS.showText: - this.showText(args[0]); - break; - case OPS.showSpacedText: - this.showText(args[0]); - break; - case OPS.endText: - this.endText(); - break; - case OPS.moveText: - this.moveText(args[0], args[1]); - break; - case OPS.setCharSpacing: - this.setCharSpacing(args[0]); - break; - case OPS.setWordSpacing: - this.setWordSpacing(args[0]); - break; - case OPS.setHScale: - this.setHScale(args[0]); - break; - case OPS.setTextMatrix: - this.setTextMatrix(args[0], args[1], args[2], - args[3], args[4], args[5]); - break; - case OPS.setLineWidth: - this.setLineWidth(args[0]); - break; - case OPS.setLineJoin: - this.setLineJoin(args[0]); - break; - case OPS.setLineCap: - this.setLineCap(args[0]); - break; - case OPS.setMiterLimit: - this.setMiterLimit(args[0]); - break; - case OPS.setFillRGBColor: - this.setFillRGBColor(args[0], args[1], args[2]); - break; - case OPS.setStrokeRGBColor: - this.setStrokeRGBColor(args[0], args[1], args[2]); - break; - case OPS.setDash: - this.setDash(args[0], args[1]); - break; - case OPS.setGState: - this.setGState(args[0]); - break; - case OPS.fill: - this.fill(); - break; - case OPS.eoFill: - this.eoFill(); - break; - case OPS.stroke: - this.stroke(); - break; - case OPS.fillStroke: - this.fillStroke(); - break; - case OPS.eoFillStroke: - this.eoFillStroke(); - break; - case OPS.clip: - this.clip('nonzero'); - break; - case OPS.eoClip: - this.clip('evenodd'); - break; - case OPS.paintSolidColorImageMask: - this.paintSolidColorImageMask(); - break; - case OPS.paintJpegXObject: - this.paintJpegXObject(args[0], args[1], args[2]); - break; - case OPS.paintImageXObject: - this.paintImageXObject(args[0]); - break; - case OPS.paintInlineImageXObject: - this.paintInlineImageXObject(args[0]); - break; - case OPS.paintImageMaskXObject: - this.paintImageMaskXObject(args[0]); - break; - case OPS.paintFormXObjectBegin: - this.paintFormXObjectBegin(args[0], args[1]); - break; - case OPS.paintFormXObjectEnd: - this.paintFormXObjectEnd(); - break; - case OPS.closePath: - this.closePath(); - break; - case OPS.closeStroke: - this.closeStroke(); - break; - case OPS.closeFillStroke: - this.closeFillStroke(); - break; - case OPS.nextLine: - this.nextLine(); - break; - case OPS.transform: - this.transform(args[0], args[1], args[2], args[3], - args[4], args[5]); - break; - case OPS.constructPath: - this.constructPath(args[0], args[1]); - break; - case OPS.endPath: - this.endPath(); - break; - case 92: - this.group(opTree[x].items); - break; - default: - warn('Unimplemented method '+ fn); - break; - } - } - }, - - setWordSpacing: function SVGGraphics_setWordSpacing(wordSpacing) { - this.current.wordSpacing = wordSpacing; - }, - - setCharSpacing: function SVGGraphics_setCharSpacing(charSpacing) { - this.current.charSpacing = charSpacing; - }, - - nextLine: function SVGGraphics_nextLine() { - this.moveText(0, this.current.leading); - }, - - setTextMatrix: function SVGGraphics_setTextMatrix(a, b, c, d, e, f) { - var current = this.current; - this.current.textMatrix = this.current.lineMatrix = [a, b, c, d, e, f]; - - this.current.x = this.current.lineX = 0; - this.current.y = this.current.lineY = 0; - - current.xcoords = []; - current.tspan = document.createElementNS(NS, 'svg:tspan'); - current.tspan.setAttributeNS(null, 'font-family', current.fontFamily); - current.tspan.setAttributeNS(null, 'font-size', - pf(current.fontSize) + 'px'); - current.tspan.setAttributeNS(null, 'y', pf(-current.y)); - - current.txtElement = document.createElementNS(NS, 'svg:text'); - current.txtElement.appendChild(current.tspan); - }, - - beginText: function SVGGraphics_beginText() { - this.current.x = this.current.lineX = 0; - this.current.y = this.current.lineY = 0; - this.current.textMatrix = IDENTITY_MATRIX; - this.current.lineMatrix = IDENTITY_MATRIX; - this.current.tspan = document.createElementNS(NS, 'svg:tspan'); - this.current.txtElement = document.createElementNS(NS, 'svg:text'); - this.current.txtgrp = document.createElementNS(NS, 'svg:g'); - this.current.xcoords = []; - }, - - moveText: function SVGGraphics_moveText(x, y) { - var current = this.current; - this.current.x = this.current.lineX += x; - this.current.y = this.current.lineY += y; - - current.xcoords = []; - current.tspan = document.createElementNS(NS, 'svg:tspan'); - current.tspan.setAttributeNS(null, 'font-family', current.fontFamily); - current.tspan.setAttributeNS(null, 'font-size', - pf(current.fontSize) + 'px'); - current.tspan.setAttributeNS(null, 'y', pf(-current.y)); - }, - - showText: function SVGGraphics_showText(glyphs) { - var current = this.current; - var font = current.font; - var fontSize = current.fontSize; - - if (fontSize === 0) { - return; - } - - var charSpacing = current.charSpacing; - var wordSpacing = current.wordSpacing; - var fontDirection = current.fontDirection; - var textHScale = current.textHScale * fontDirection; - var glyphsLength = glyphs.length; - var vertical = font.vertical; - var widthAdvanceScale = fontSize * current.fontMatrix[0]; - - var x = 0, i; - for (i = 0; i < glyphsLength; ++i) { - var glyph = glyphs[i]; - if (glyph === null) { - // word break - x += fontDirection * wordSpacing; - continue; - } else if (isNum(glyph)) { - x += -glyph * fontSize * 0.001; - continue; - } - current.xcoords.push(current.x + x * textHScale); - - var width = glyph.width; - var character = glyph.fontChar; - var charWidth = width * widthAdvanceScale + charSpacing * fontDirection; - x += charWidth; - - current.tspan.textContent += character; - } - if (vertical) { - current.y -= x * textHScale; - } else { - current.x += x * textHScale; - } - - current.tspan.setAttributeNS(null, 'x', - current.xcoords.map(pf).join(' ')); - current.tspan.setAttributeNS(null, 'y', pf(-current.y)); - current.tspan.setAttributeNS(null, 'font-family', current.fontFamily); - current.tspan.setAttributeNS(null, 'font-size', - pf(current.fontSize) + 'px'); - if (current.fontStyle !== SVG_DEFAULTS.fontStyle) { - current.tspan.setAttributeNS(null, 'font-style', current.fontStyle); - } - if (current.fontWeight !== SVG_DEFAULTS.fontWeight) { - current.tspan.setAttributeNS(null, 'font-weight', current.fontWeight); - } - if (current.fillColor !== SVG_DEFAULTS.fillColor) { - current.tspan.setAttributeNS(null, 'fill', current.fillColor); - } - - current.txtElement.setAttributeNS(null, 'transform', - pm(current.textMatrix) + - ' scale(1, -1)' ); - current.txtElement.setAttributeNS(XML_NS, 'xml:space', 'preserve'); - current.txtElement.appendChild(current.tspan); - current.txtgrp.appendChild(current.txtElement); - - this.tgrp.appendChild(current.txtElement); - - }, - - setLeadingMoveText: function SVGGraphics_setLeadingMoveText(x, y) { - this.setLeading(-y); - this.moveText(x, y); - }, - - addFontStyle: function SVGGraphics_addFontStyle(fontObj) { - if (!this.cssStyle) { - this.cssStyle = document.createElementNS(NS, 'svg:style'); - this.cssStyle.setAttributeNS(null, 'type', 'text/css'); - this.defs.appendChild(this.cssStyle); - } - - var url = PDFJS.createObjectURL(fontObj.data, fontObj.mimetype); - this.cssStyle.textContent += - '@font-face { font-family: "' + fontObj.loadedName + '";' + - ' src: url(' + url + '); }\n'; - }, - - setFont: function SVGGraphics_setFont(details) { - var current = this.current; - var fontObj = this.commonObjs.get(details[0]); - var size = details[1]; - this.current.font = fontObj; - - if (this.embedFonts && fontObj.data && - !this.embeddedFonts[fontObj.loadedName]) { - this.addFontStyle(fontObj); - this.embeddedFonts[fontObj.loadedName] = fontObj; - } - - current.fontMatrix = (fontObj.fontMatrix ? - fontObj.fontMatrix : FONT_IDENTITY_MATRIX); - - var bold = fontObj.black ? (fontObj.bold ? 'bolder' : 'bold') : - (fontObj.bold ? 'bold' : 'normal'); - var italic = fontObj.italic ? 'italic' : 'normal'; - - if (size < 0) { - size = -size; - current.fontDirection = -1; - } else { - current.fontDirection = 1; - } - current.fontSize = size; - current.fontFamily = fontObj.loadedName; - current.fontWeight = bold; - current.fontStyle = italic; - - current.tspan = document.createElementNS(NS, 'svg:tspan'); - current.tspan.setAttributeNS(null, 'y', pf(-current.y)); - current.xcoords = []; - }, - - endText: function SVGGraphics_endText() { - if (this.current.pendingClip) { - this.cgrp.appendChild(this.tgrp); - this.pgrp.appendChild(this.cgrp); - } else { - this.pgrp.appendChild(this.tgrp); - } - this.tgrp = document.createElementNS(NS, 'svg:g'); - this.tgrp.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - }, - - // Path properties - setLineWidth: function SVGGraphics_setLineWidth(width) { - this.current.lineWidth = width; - }, - setLineCap: function SVGGraphics_setLineCap(style) { - this.current.lineCap = LINE_CAP_STYLES[style]; - }, - setLineJoin: function SVGGraphics_setLineJoin(style) { - this.current.lineJoin = LINE_JOIN_STYLES[style]; - }, - setMiterLimit: function SVGGraphics_setMiterLimit(limit) { - this.current.miterLimit = limit; - }, - setStrokeRGBColor: function SVGGraphics_setStrokeRGBColor(r, g, b) { - var color = Util.makeCssRgb(r, g, b); - this.current.strokeColor = color; - }, - setFillRGBColor: function SVGGraphics_setFillRGBColor(r, g, b) { - var color = Util.makeCssRgb(r, g, b); - this.current.fillColor = color; - this.current.tspan = document.createElementNS(NS, 'svg:tspan'); - this.current.xcoords = []; - }, - setDash: function SVGGraphics_setDash(dashArray, dashPhase) { - this.current.dashArray = dashArray; - this.current.dashPhase = dashPhase; - }, - - constructPath: function SVGGraphics_constructPath(ops, args) { - var current = this.current; - var x = current.x, y = current.y; - current.path = document.createElementNS(NS, 'svg:path'); - var d = []; - var opLength = ops.length; - - for (var i = 0, j = 0; i < opLength; i++) { - switch (ops[i] | 0) { - case OPS.rectangle: - x = args[j++]; - y = args[j++]; - var width = args[j++]; - var height = args[j++]; - var xw = x + width; - var yh = y + height; - d.push('M', pf(x), pf(y), 'L', pf(xw) , pf(y), 'L', pf(xw), pf(yh), - 'L', pf(x), pf(yh), 'Z'); - break; - case OPS.moveTo: - x = args[j++]; - y = args[j++]; - d.push('M', pf(x), pf(y)); - break; - case OPS.lineTo: - x = args[j++]; - y = args[j++]; - d.push('L', pf(x) , pf(y)); - break; - case OPS.curveTo: - x = args[j + 4]; - y = args[j + 5]; - d.push('C', pf(args[j]), pf(args[j + 1]), pf(args[j + 2]), - pf(args[j + 3]), pf(x), pf(y)); - j += 6; - break; - case OPS.curveTo2: - x = args[j + 2]; - y = args[j + 3]; - d.push('C', pf(x), pf(y), pf(args[j]), pf(args[j + 1]), - pf(args[j + 2]), pf(args[j + 3])); - j += 4; - break; - case OPS.curveTo3: - x = args[j + 2]; - y = args[j + 3]; - d.push('C', pf(args[j]), pf(args[j + 1]), pf(x), pf(y), - pf(x), pf(y)); - j += 4; - break; - case OPS.closePath: - d.push('Z'); - break; - } - } - current.path.setAttributeNS(null, 'd', d.join(' ')); - current.path.setAttributeNS(null, 'stroke-miterlimit', - pf(current.miterLimit)); - current.path.setAttributeNS(null, 'stroke-linecap', current.lineCap); - current.path.setAttributeNS(null, 'stroke-linejoin', current.lineJoin); - current.path.setAttributeNS(null, 'stroke-width', - pf(current.lineWidth) + 'px'); - current.path.setAttributeNS(null, 'stroke-dasharray', - current.dashArray.map(pf).join(' ')); - current.path.setAttributeNS(null, 'stroke-dashoffset', - pf(current.dashPhase) + 'px'); - current.path.setAttributeNS(null, 'fill', 'none'); - - this.tgrp.appendChild(current.path); - if (current.pendingClip) { - this.cgrp.appendChild(this.tgrp); - this.pgrp.appendChild(this.cgrp); - } else { - this.pgrp.appendChild(this.tgrp); - } - // Saving a reference in current.element so that it can be addressed - // in 'fill' and 'stroke' - current.element = current.path; - current.setCurrentPoint(x, y); - }, - - endPath: function SVGGraphics_endPath() { - var current = this.current; - if (current.pendingClip) { - this.cgrp.appendChild(this.tgrp); - this.pgrp.appendChild(this.cgrp); - } else { - this.pgrp.appendChild(this.tgrp); - } - this.tgrp = document.createElementNS(NS, 'svg:g'); - this.tgrp.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - }, - - clip: function SVGGraphics_clip(type) { - var current = this.current; - // Add current path to clipping path - current.clipId = 'clippath' + clipCount; - clipCount++; - this.clippath = document.createElementNS(NS, 'svg:clipPath'); - this.clippath.setAttributeNS(null, 'id', current.clipId); - var clipElement = current.element.cloneNode(); - if (type === 'evenodd') { - clipElement.setAttributeNS(null, 'clip-rule', 'evenodd'); - } else { - clipElement.setAttributeNS(null, 'clip-rule', 'nonzero'); - } - this.clippath.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - this.clippath.appendChild(clipElement); - this.defs.appendChild(this.clippath); - - // Create a new group with that attribute - current.pendingClip = true; - this.cgrp = document.createElementNS(NS, 'svg:g'); - this.cgrp.setAttributeNS(null, 'clip-path', - 'url(#' + current.clipId + ')'); - this.pgrp.appendChild(this.cgrp); - }, - - closePath: function SVGGraphics_closePath() { - var current = this.current; - var d = current.path.getAttributeNS(null, 'd'); - d += 'Z'; - current.path.setAttributeNS(null, 'd', d); - }, - - setLeading: function SVGGraphics_setLeading(leading) { - this.current.leading = -leading; - }, - - setTextRise: function SVGGraphics_setTextRise(textRise) { - this.current.textRise = textRise; - }, - - setHScale: function SVGGraphics_setHScale(scale) { - this.current.textHScale = scale / 100; - }, - - setGState: function SVGGraphics_setGState(states) { - for (var i = 0, ii = states.length; i < ii; i++) { - var state = states[i]; - var key = state[0]; - var value = state[1]; - - switch (key) { - case 'LW': - this.setLineWidth(value); - break; - case 'LC': - this.setLineCap(value); - break; - case 'LJ': - this.setLineJoin(value); - break; - case 'ML': - this.setMiterLimit(value); - break; - case 'D': - this.setDash(value[0], value[1]); - break; - case 'RI': - break; - case 'FL': - break; - case 'Font': - this.setFont(value); - break; - case 'CA': - break; - case 'ca': - break; - case 'BM': - break; - case 'SMask': - break; - } - } - }, - - fill: function SVGGraphics_fill() { - var current = this.current; - current.element.setAttributeNS(null, 'fill', current.fillColor); - }, - - stroke: function SVGGraphics_stroke() { - var current = this.current; - current.element.setAttributeNS(null, 'stroke', current.strokeColor); - current.element.setAttributeNS(null, 'fill', 'none'); - }, - - eoFill: function SVGGraphics_eoFill() { - var current = this.current; - current.element.setAttributeNS(null, 'fill', current.fillColor); - current.element.setAttributeNS(null, 'fill-rule', 'evenodd'); - }, - - fillStroke: function SVGGraphics_fillStroke() { - // Order is important since stroke wants fill to be none. - // First stroke, then if fill needed, it will be overwritten. - this.stroke(); - this.fill(); - }, - - eoFillStroke: function SVGGraphics_eoFillStroke() { - this.current.element.setAttributeNS(null, 'fill-rule', 'evenodd'); - this.fillStroke(); - }, - - closeStroke: function SVGGraphics_closeStroke() { - this.closePath(); - this.stroke(); - }, - - closeFillStroke: function SVGGraphics_closeFillStroke() { - this.closePath(); - this.fillStroke(); - }, - - paintSolidColorImageMask: - function SVGGraphics_paintSolidColorImageMask() { - var current = this.current; - var rect = document.createElementNS(NS, 'svg:rect'); - rect.setAttributeNS(null, 'x', '0'); - rect.setAttributeNS(null, 'y', '0'); - rect.setAttributeNS(null, 'width', '1px'); - rect.setAttributeNS(null, 'height', '1px'); - rect.setAttributeNS(null, 'fill', current.fillColor); - this.tgrp.appendChild(rect); - }, - - paintJpegXObject: function SVGGraphics_paintJpegXObject(objId, w, h) { - var current = this.current; - var imgObj = this.objs.get(objId); - var imgEl = document.createElementNS(NS, 'svg:image'); - imgEl.setAttributeNS(XLINK_NS, 'xlink:href', imgObj.src); - imgEl.setAttributeNS(null, 'width', imgObj.width + 'px'); - imgEl.setAttributeNS(null, 'height', imgObj.height + 'px'); - imgEl.setAttributeNS(null, 'x', '0'); - imgEl.setAttributeNS(null, 'y', pf(-h)); - imgEl.setAttributeNS(null, 'transform', - 'scale(' + pf(1 / w) + ' ' + pf(-1 / h) + ')'); - - this.tgrp.appendChild(imgEl); - if (current.pendingClip) { - this.cgrp.appendChild(this.tgrp); - this.pgrp.appendChild(this.cgrp); - } else { - this.pgrp.appendChild(this.tgrp); - } - }, - - paintImageXObject: function SVGGraphics_paintImageXObject(objId) { - var imgData = this.objs.get(objId); - if (!imgData) { - warn('Dependent image isn\'t ready yet'); - return; - } - this.paintInlineImageXObject(imgData); - }, - - paintInlineImageXObject: - function SVGGraphics_paintInlineImageXObject(imgData, mask) { - var current = this.current; - var width = imgData.width; - var height = imgData.height; - - var imgSrc = convertImgDataToPng(imgData); - var cliprect = document.createElementNS(NS, 'svg:rect'); - cliprect.setAttributeNS(null, 'x', '0'); - cliprect.setAttributeNS(null, 'y', '0'); - cliprect.setAttributeNS(null, 'width', pf(width)); - cliprect.setAttributeNS(null, 'height', pf(height)); - current.element = cliprect; - this.clip('nonzero'); - var imgEl = document.createElementNS(NS, 'svg:image'); - imgEl.setAttributeNS(XLINK_NS, 'xlink:href', imgSrc); - imgEl.setAttributeNS(null, 'x', '0'); - imgEl.setAttributeNS(null, 'y', pf(-height)); - imgEl.setAttributeNS(null, 'width', pf(width) + 'px'); - imgEl.setAttributeNS(null, 'height', pf(height) + 'px'); - imgEl.setAttributeNS(null, 'transform', - 'scale(' + pf(1 / width) + ' ' + - pf(-1 / height) + ')'); - if (mask) { - mask.appendChild(imgEl); - } else { - this.tgrp.appendChild(imgEl); - } - if (current.pendingClip) { - this.cgrp.appendChild(this.tgrp); - this.pgrp.appendChild(this.cgrp); - } else { - this.pgrp.appendChild(this.tgrp); - } - }, - - paintImageMaskXObject: - function SVGGraphics_paintImageMaskXObject(imgData) { - var current = this.current; - var width = imgData.width; - var height = imgData.height; - var fillColor = current.fillColor; - - current.maskId = 'mask' + maskCount++; - var mask = document.createElementNS(NS, 'svg:mask'); - mask.setAttributeNS(null, 'id', current.maskId); - - var rect = document.createElementNS(NS, 'svg:rect'); - rect.setAttributeNS(null, 'x', '0'); - rect.setAttributeNS(null, 'y', '0'); - rect.setAttributeNS(null, 'width', pf(width)); - rect.setAttributeNS(null, 'height', pf(height)); - rect.setAttributeNS(null, 'fill', fillColor); - rect.setAttributeNS(null, 'mask', 'url(#' + current.maskId +')'); - this.defs.appendChild(mask); - this.tgrp.appendChild(rect); - - this.paintInlineImageXObject(imgData, mask); - }, - - paintFormXObjectBegin: - function SVGGraphics_paintFormXObjectBegin(matrix, bbox) { - this.save(); - - if (isArray(matrix) && matrix.length === 6) { - this.transform(matrix[0], matrix[1], matrix[2], - matrix[3], matrix[4], matrix[5]); - } - - if (isArray(bbox) && bbox.length === 4) { - var width = bbox[2] - bbox[0]; - var height = bbox[3] - bbox[1]; - - var cliprect = document.createElementNS(NS, 'svg:rect'); - cliprect.setAttributeNS(null, 'x', bbox[0]); - cliprect.setAttributeNS(null, 'y', bbox[1]); - cliprect.setAttributeNS(null, 'width', pf(width)); - cliprect.setAttributeNS(null, 'height', pf(height)); - this.current.element = cliprect; - this.clip('nonzero'); - this.endPath(); - } - }, - - paintFormXObjectEnd: - function SVGGraphics_paintFormXObjectEnd() { - this.restore(); - } - }; - return SVGGraphics; -})(); - -PDFJS.SVGGraphics = SVGGraphics; - - -}).call((typeof window === 'undefined') ? this : window); - -if (!PDFJS.workerSrc && typeof document !== 'undefined') { - // workerSrc is not set -- using last script url to define default location - PDFJS.workerSrc = (function () { - 'use strict'; - var pdfJsSrc = document.currentScript.src; - return pdfJsSrc && pdfJsSrc.replace(/\.js$/i, '.worker.js'); - })(); -} - - diff --git a/services/web/public/js/libs/pdfjs-1.3.91p1/pdf.worker.js b/services/web/public/js/libs/pdfjs-1.3.91p1/pdf.worker.js deleted file mode 100644 index 6ea741047f..0000000000 --- a/services/web/public/js/libs/pdfjs-1.3.91p1/pdf.worker.js +++ /dev/null @@ -1,40698 +0,0 @@ -/* Copyright 2012 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/*jshint globalstrict: false */ -/* globals PDFJS */ - -// Initializing PDFJS global object (if still undefined) -if (typeof PDFJS === 'undefined') { - (typeof window !== 'undefined' ? window : this).PDFJS = {}; -} - -PDFJS.version = '1.3.91'; -PDFJS.build = 'd1e83b5'; - -(function pdfjsWrapper() { - // Use strict in our context only - users might not want it - 'use strict'; - - - -var globalScope = (typeof window === 'undefined') ? this : window; - -var isWorker = (typeof window === 'undefined'); - -var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; - -var TextRenderingMode = { - FILL: 0, - STROKE: 1, - FILL_STROKE: 2, - INVISIBLE: 3, - FILL_ADD_TO_PATH: 4, - STROKE_ADD_TO_PATH: 5, - FILL_STROKE_ADD_TO_PATH: 6, - ADD_TO_PATH: 7, - FILL_STROKE_MASK: 3, - ADD_TO_PATH_FLAG: 4 -}; - -var ImageKind = { - GRAYSCALE_1BPP: 1, - RGB_24BPP: 2, - RGBA_32BPP: 3 -}; - -var AnnotationType = { - TEXT: 1, - LINK: 2, - FREETEXT: 3, - LINE: 4, - SQUARE: 5, - CIRCLE: 6, - POLYGON: 7, - POLYLINE: 8, - HIGHLIGHT: 9, - UNDERLINE: 10, - SQUIGGLY: 11, - STRIKEOUT: 12, - STAMP: 13, - CARET: 14, - INK: 15, - POPUP: 16, - FILEATTACHMENT: 17, - SOUND: 18, - MOVIE: 19, - WIDGET: 20, - SCREEN: 21, - PRINTERMARK: 22, - TRAPNET: 23, - WATERMARK: 24, - THREED: 25, - REDACT: 26 -}; - -var AnnotationFlag = { - INVISIBLE: 0x01, - HIDDEN: 0x02, - PRINT: 0x04, - NOZOOM: 0x08, - NOROTATE: 0x10, - NOVIEW: 0x20, - READONLY: 0x40, - LOCKED: 0x80, - TOGGLENOVIEW: 0x100, - LOCKEDCONTENTS: 0x200 -}; - -var AnnotationBorderStyleType = { - SOLID: 1, - DASHED: 2, - BEVELED: 3, - INSET: 4, - UNDERLINE: 5 -}; - -var StreamType = { - UNKNOWN: 0, - FLATE: 1, - LZW: 2, - DCT: 3, - JPX: 4, - JBIG: 5, - A85: 6, - AHX: 7, - CCF: 8, - RL: 9 -}; - -var FontType = { - UNKNOWN: 0, - TYPE1: 1, - TYPE1C: 2, - CIDFONTTYPE0: 3, - CIDFONTTYPE0C: 4, - TRUETYPE: 5, - CIDFONTTYPE2: 6, - TYPE3: 7, - OPENTYPE: 8, - TYPE0: 9, - MMTYPE1: 10 -}; - -// 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.PDFJS) { - globalScope.PDFJS = {}; -} - -globalScope.PDFJS.pdfBug = false; - -PDFJS.VERBOSITY_LEVELS = { - errors: 0, - warnings: 1, - infos: 5 -}; - -// All the possible operations for an operator list. -var OPS = PDFJS.OPS = { - // Intentionally start from 1 so it is easy to spot bad operators that will be - // 0's. - dependency: 1, - setLineWidth: 2, - setLineCap: 3, - setLineJoin: 4, - setMiterLimit: 5, - setDash: 6, - setRenderingIntent: 7, - setFlatness: 8, - setGState: 9, - save: 10, - restore: 11, - transform: 12, - moveTo: 13, - lineTo: 14, - curveTo: 15, - curveTo2: 16, - curveTo3: 17, - closePath: 18, - rectangle: 19, - stroke: 20, - closeStroke: 21, - fill: 22, - eoFill: 23, - fillStroke: 24, - eoFillStroke: 25, - closeFillStroke: 26, - closeEOFillStroke: 27, - endPath: 28, - clip: 29, - eoClip: 30, - beginText: 31, - endText: 32, - setCharSpacing: 33, - setWordSpacing: 34, - setHScale: 35, - setLeading: 36, - setFont: 37, - setTextRenderingMode: 38, - setTextRise: 39, - moveText: 40, - setLeadingMoveText: 41, - setTextMatrix: 42, - nextLine: 43, - showText: 44, - showSpacedText: 45, - nextLineShowText: 46, - nextLineSetSpacingShowText: 47, - setCharWidth: 48, - setCharWidthAndBounds: 49, - setStrokeColorSpace: 50, - setFillColorSpace: 51, - setStrokeColor: 52, - setStrokeColorN: 53, - setFillColor: 54, - setFillColorN: 55, - setStrokeGray: 56, - setFillGray: 57, - setStrokeRGBColor: 58, - setFillRGBColor: 59, - setStrokeCMYKColor: 60, - setFillCMYKColor: 61, - shadingFill: 62, - beginInlineImage: 63, - beginImageData: 64, - endInlineImage: 65, - paintXObject: 66, - markPoint: 67, - markPointProps: 68, - beginMarkedContent: 69, - beginMarkedContentProps: 70, - endMarkedContent: 71, - beginCompat: 72, - endCompat: 73, - paintFormXObjectBegin: 74, - paintFormXObjectEnd: 75, - beginGroup: 76, - endGroup: 77, - beginAnnotations: 78, - endAnnotations: 79, - beginAnnotation: 80, - endAnnotation: 81, - paintJpegXObject: 82, - paintImageMaskXObject: 83, - paintImageMaskXObjectGroup: 84, - paintImageXObject: 85, - paintInlineImageXObject: 86, - paintInlineImageXObjectGroup: 87, - paintImageXObjectRepeat: 88, - paintImageMaskXObjectRepeat: 89, - paintSolidColorImageMask: 90, - constructPath: 91 -}; - -// A notice for devs. These are good for things that are helpful to devs, such -// as warning that Workers were disabled, which is important to devs but not -// end users. -function info(msg) { - if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.infos) { - console.log('Info: ' + msg); - } -} - -// Non-fatal warnings. -function warn(msg) { - if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.warnings) { - console.log('Warning: ' + msg); - } -} - -// Deprecated API function -- treated as warnings. -function deprecated(details) { - warn('Deprecated API usage: ' + details); -} - -// Fatal errors that should trigger the fallback UI and halt execution by -// throwing an exception. -function error(msg) { - if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.errors) { - console.log('Error: ' + msg); - console.log(backtrace()); - } - throw new Error(msg); -} - -function backtrace() { - try { - throw new Error(); - } catch (e) { - return e.stack ? e.stack.split('\n').slice(2).join('\n') : ''; - } -} - -function assert(cond, msg) { - if (!cond) { - error(msg); - } -} - -var UNSUPPORTED_FEATURES = PDFJS.UNSUPPORTED_FEATURES = { - unknown: 'unknown', - forms: 'forms', - javaScript: 'javaScript', - smask: 'smask', - shadingPattern: 'shadingPattern', - font: 'font' -}; - -// Combines two URLs. The baseUrl shall be absolute URL. If the url is an -// absolute URL, it will be returned as is. -function combineUrl(baseUrl, url) { - if (!url) { - return baseUrl; - } - return new URL(url, baseUrl).href; -} - -// Validates if URL is safe and allowed, e.g. to avoid XSS. -function isValidUrl(url, allowRelative) { - if (!url) { - return false; - } - // RFC 3986 (http://tools.ietf.org/html/rfc3986#section-3.1) - // scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - var protocol = /^[a-z][a-z0-9+\-.]*(?=:)/i.exec(url); - if (!protocol) { - return allowRelative; - } - protocol = protocol[0].toLowerCase(); - switch (protocol) { - case 'http': - case 'https': - case 'ftp': - case 'mailto': - case 'tel': - return true; - default: - return false; - } -} -PDFJS.isValidUrl = isValidUrl; - -function shadow(obj, prop, value) { - Object.defineProperty(obj, prop, { value: value, - enumerable: true, - configurable: true, - writable: false }); - return value; -} -PDFJS.shadow = shadow; - -var LinkTarget = PDFJS.LinkTarget = { - NONE: 0, // Default value. - SELF: 1, - BLANK: 2, - PARENT: 3, - TOP: 4, -}; -var LinkTargetStringMap = [ - '', - '_self', - '_blank', - '_parent', - '_top' -]; - -function isExternalLinkTargetSet() { - if (PDFJS.openExternalLinksInNewWindow) { - deprecated('PDFJS.openExternalLinksInNewWindow, please use ' + - '"PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK" instead.'); - if (PDFJS.externalLinkTarget === LinkTarget.NONE) { - PDFJS.externalLinkTarget = LinkTarget.BLANK; - } - // Reset the deprecated parameter, to suppress further warnings. - PDFJS.openExternalLinksInNewWindow = false; - } - switch (PDFJS.externalLinkTarget) { - case LinkTarget.NONE: - return false; - case LinkTarget.SELF: - case LinkTarget.BLANK: - case LinkTarget.PARENT: - case LinkTarget.TOP: - return true; - } - warn('PDFJS.externalLinkTarget is invalid: ' + PDFJS.externalLinkTarget); - // Reset the external link target, to suppress further warnings. - PDFJS.externalLinkTarget = LinkTarget.NONE; - return false; -} -PDFJS.isExternalLinkTargetSet = isExternalLinkTargetSet; - -var PasswordResponses = PDFJS.PasswordResponses = { - NEED_PASSWORD: 1, - INCORRECT_PASSWORD: 2 -}; - -var PasswordException = (function PasswordExceptionClosure() { - function PasswordException(msg, code) { - this.name = 'PasswordException'; - this.message = msg; - this.code = code; - } - - PasswordException.prototype = new Error(); - PasswordException.constructor = PasswordException; - - return PasswordException; -})(); -PDFJS.PasswordException = PasswordException; - -var UnknownErrorException = (function UnknownErrorExceptionClosure() { - function UnknownErrorException(msg, details) { - this.name = 'UnknownErrorException'; - this.message = msg; - this.details = details; - } - - UnknownErrorException.prototype = new Error(); - UnknownErrorException.constructor = UnknownErrorException; - - return UnknownErrorException; -})(); -PDFJS.UnknownErrorException = UnknownErrorException; - -var InvalidPDFException = (function InvalidPDFExceptionClosure() { - function InvalidPDFException(msg) { - this.name = 'InvalidPDFException'; - this.message = msg; - } - - InvalidPDFException.prototype = new Error(); - InvalidPDFException.constructor = InvalidPDFException; - - return InvalidPDFException; -})(); -PDFJS.InvalidPDFException = InvalidPDFException; - -var MissingPDFException = (function MissingPDFExceptionClosure() { - function MissingPDFException(msg) { - this.name = 'MissingPDFException'; - this.message = msg; - } - - MissingPDFException.prototype = new Error(); - MissingPDFException.constructor = MissingPDFException; - - return MissingPDFException; -})(); -PDFJS.MissingPDFException = MissingPDFException; - -var UnexpectedResponseException = - (function UnexpectedResponseExceptionClosure() { - function UnexpectedResponseException(msg, status) { - this.name = 'UnexpectedResponseException'; - this.message = msg; - this.status = status; - } - - UnexpectedResponseException.prototype = new Error(); - UnexpectedResponseException.constructor = UnexpectedResponseException; - - return UnexpectedResponseException; -})(); -PDFJS.UnexpectedResponseException = UnexpectedResponseException; - -var NotImplementedException = (function NotImplementedExceptionClosure() { - function NotImplementedException(msg) { - this.message = msg; - } - - NotImplementedException.prototype = new Error(); - NotImplementedException.prototype.name = 'NotImplementedException'; - NotImplementedException.constructor = NotImplementedException; - - return NotImplementedException; -})(); - -var MissingDataException = (function MissingDataExceptionClosure() { - function MissingDataException(begin, end) { - this.begin = begin; - this.end = end; - this.message = 'Missing data [' + begin + ', ' + end + ')'; - } - - MissingDataException.prototype = new Error(); - MissingDataException.prototype.name = 'MissingDataException'; - MissingDataException.constructor = MissingDataException; - - return MissingDataException; -})(); - -var XRefParseException = (function XRefParseExceptionClosure() { - function XRefParseException(msg) { - this.message = msg; - } - - XRefParseException.prototype = new Error(); - XRefParseException.prototype.name = 'XRefParseException'; - XRefParseException.constructor = XRefParseException; - - return XRefParseException; -})(); - - -function bytesToString(bytes) { - assert(bytes !== null && typeof bytes === 'object' && - bytes.length !== undefined, 'Invalid argument for bytesToString'); - var length = bytes.length; - var MAX_ARGUMENT_COUNT = 8192; - if (length < MAX_ARGUMENT_COUNT) { - return String.fromCharCode.apply(null, bytes); - } - var strBuf = []; - for (var i = 0; i < length; i += MAX_ARGUMENT_COUNT) { - var chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); - var chunk = bytes.subarray(i, chunkEnd); - strBuf.push(String.fromCharCode.apply(null, chunk)); - } - return strBuf.join(''); -} - -function stringToBytes(str) { - assert(typeof str === 'string', 'Invalid argument for stringToBytes'); - var length = str.length; - var bytes = new Uint8Array(length); - for (var i = 0; i < length; ++i) { - bytes[i] = str.charCodeAt(i) & 0xFF; - } - return bytes; -} - -function string32(value) { - return String.fromCharCode((value >> 24) & 0xff, (value >> 16) & 0xff, - (value >> 8) & 0xff, value & 0xff); -} - -function log2(x) { - var n = 1, i = 0; - while (x > n) { - n <<= 1; - i++; - } - return i; -} - -function readInt8(data, start) { - return (data[start] << 24) >> 24; -} - -function readUint16(data, offset) { - return (data[offset] << 8) | data[offset + 1]; -} - -function readUint32(data, offset) { - return ((data[offset] << 24) | (data[offset + 1] << 16) | - (data[offset + 2] << 8) | data[offset + 3]) >>> 0; -} - -// Lazy test the endianness of the platform -// NOTE: This will be 'true' for simulated TypedArrays -function isLittleEndian() { - var buffer8 = new Uint8Array(2); - buffer8[0] = 1; - var buffer16 = new Uint16Array(buffer8.buffer); - return (buffer16[0] === 1); -} - -Object.defineProperty(PDFJS, 'isLittleEndian', { - configurable: true, - get: function PDFJS_isLittleEndian() { - return shadow(PDFJS, 'isLittleEndian', isLittleEndian()); - } -}); - - // Lazy test if the userAgent support CanvasTypedArrays -function hasCanvasTypedArrays() { - var canvas = document.createElement('canvas'); - canvas.width = canvas.height = 1; - var ctx = canvas.getContext('2d'); - var imageData = ctx.createImageData(1, 1); - return (typeof imageData.data.buffer !== 'undefined'); -} - -Object.defineProperty(PDFJS, 'hasCanvasTypedArrays', { - configurable: true, - get: function PDFJS_hasCanvasTypedArrays() { - return shadow(PDFJS, 'hasCanvasTypedArrays', hasCanvasTypedArrays()); - } -}); - -var Uint32ArrayView = (function Uint32ArrayViewClosure() { - - function Uint32ArrayView(buffer, length) { - this.buffer = buffer; - this.byteLength = buffer.length; - this.length = length === undefined ? (this.byteLength >> 2) : length; - ensureUint32ArrayViewProps(this.length); - } - Uint32ArrayView.prototype = Object.create(null); - - var uint32ArrayViewSetters = 0; - function createUint32ArrayProp(index) { - return { - get: function () { - var buffer = this.buffer, offset = index << 2; - return (buffer[offset] | (buffer[offset + 1] << 8) | - (buffer[offset + 2] << 16) | (buffer[offset + 3] << 24)) >>> 0; - }, - set: function (value) { - var buffer = this.buffer, offset = index << 2; - buffer[offset] = value & 255; - buffer[offset + 1] = (value >> 8) & 255; - buffer[offset + 2] = (value >> 16) & 255; - buffer[offset + 3] = (value >>> 24) & 255; - } - }; - } - - function ensureUint32ArrayViewProps(length) { - while (uint32ArrayViewSetters < length) { - Object.defineProperty(Uint32ArrayView.prototype, - uint32ArrayViewSetters, - createUint32ArrayProp(uint32ArrayViewSetters)); - uint32ArrayViewSetters++; - } - } - - return Uint32ArrayView; -})(); - -var IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; - -var Util = PDFJS.Util = (function UtilClosure() { - function Util() {} - - var rgbBuf = ['rgb(', 0, ',', 0, ',', 0, ')']; - - // makeCssRgb() can be called thousands of times. Using |rgbBuf| avoids - // creating many intermediate strings. - Util.makeCssRgb = function Util_makeCssRgb(r, g, b) { - rgbBuf[1] = r; - rgbBuf[3] = g; - rgbBuf[5] = b; - return rgbBuf.join(''); - }; - - // Concatenates two transformation matrices together and returns the result. - Util.transform = function Util_transform(m1, m2) { - return [ - m1[0] * m2[0] + m1[2] * m2[1], - m1[1] * m2[0] + m1[3] * m2[1], - m1[0] * m2[2] + m1[2] * m2[3], - m1[1] * m2[2] + m1[3] * m2[3], - m1[0] * m2[4] + m1[2] * m2[5] + m1[4], - m1[1] * m2[4] + m1[3] * m2[5] + m1[5] - ]; - }; - - // For 2d affine transforms - Util.applyTransform = function Util_applyTransform(p, m) { - var xt = p[0] * m[0] + p[1] * m[2] + m[4]; - var yt = p[0] * m[1] + p[1] * m[3] + m[5]; - return [xt, yt]; - }; - - Util.applyInverseTransform = function Util_applyInverseTransform(p, m) { - var d = m[0] * m[3] - m[1] * m[2]; - var xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; - var yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; - return [xt, yt]; - }; - - // Applies the transform to the rectangle and finds the minimum axially - // aligned bounding box. - Util.getAxialAlignedBoundingBox = - function Util_getAxialAlignedBoundingBox(r, m) { - - var p1 = Util.applyTransform(r, m); - var p2 = Util.applyTransform(r.slice(2, 4), m); - var p3 = Util.applyTransform([r[0], r[3]], m); - var p4 = Util.applyTransform([r[2], r[1]], m); - return [ - Math.min(p1[0], p2[0], p3[0], p4[0]), - Math.min(p1[1], p2[1], p3[1], p4[1]), - Math.max(p1[0], p2[0], p3[0], p4[0]), - Math.max(p1[1], p2[1], p3[1], p4[1]) - ]; - }; - - Util.inverseTransform = function Util_inverseTransform(m) { - var d = m[0] * m[3] - m[1] * m[2]; - return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, - (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d]; - }; - - // Apply a generic 3d matrix M on a 3-vector v: - // | a b c | | X | - // | d e f | x | Y | - // | g h i | | Z | - // M is assumed to be serialized as [a,b,c,d,e,f,g,h,i], - // with v as [X,Y,Z] - Util.apply3dTransform = function Util_apply3dTransform(m, v) { - return [ - m[0] * v[0] + m[1] * v[1] + m[2] * v[2], - m[3] * v[0] + m[4] * v[1] + m[5] * v[2], - m[6] * v[0] + m[7] * v[1] + m[8] * v[2] - ]; - }; - - // This calculation uses Singular Value Decomposition. - // The SVD can be represented with formula A = USV. We are interested in the - // matrix S here because it represents the scale values. - Util.singularValueDecompose2dScale = - function Util_singularValueDecompose2dScale(m) { - - var transpose = [m[0], m[2], m[1], m[3]]; - - // Multiply matrix m with its transpose. - var a = m[0] * transpose[0] + m[1] * transpose[2]; - var b = m[0] * transpose[1] + m[1] * transpose[3]; - var c = m[2] * transpose[0] + m[3] * transpose[2]; - var d = m[2] * transpose[1] + m[3] * transpose[3]; - - // Solve the second degree polynomial to get roots. - var first = (a + d) / 2; - var second = Math.sqrt((a + d) * (a + d) - 4 * (a * d - c * b)) / 2; - var sx = first + second || 1; - var sy = first - second || 1; - - // Scale values are the square roots of the eigenvalues. - return [Math.sqrt(sx), Math.sqrt(sy)]; - }; - - // Normalize rectangle rect=[x1, y1, x2, y2] so that (x1,y1) < (x2,y2) - // For coordinate systems whose origin lies in the bottom-left, this - // means normalization to (BL,TR) ordering. For systems with origin in the - // top-left, this means (TL,BR) ordering. - Util.normalizeRect = function Util_normalizeRect(rect) { - var r = rect.slice(0); // clone rect - if (rect[0] > rect[2]) { - r[0] = rect[2]; - r[2] = rect[0]; - } - if (rect[1] > rect[3]) { - r[1] = rect[3]; - r[3] = rect[1]; - } - return r; - }; - - // Returns a rectangle [x1, y1, x2, y2] corresponding to the - // intersection of rect1 and rect2. If no intersection, returns 'false' - // The rectangle coordinates of rect1, rect2 should be [x1, y1, x2, y2] - Util.intersect = function Util_intersect(rect1, rect2) { - function compare(a, b) { - return a - b; - } - - // Order points along the axes - var orderedX = [rect1[0], rect1[2], rect2[0], rect2[2]].sort(compare), - orderedY = [rect1[1], rect1[3], rect2[1], rect2[3]].sort(compare), - result = []; - - rect1 = Util.normalizeRect(rect1); - rect2 = Util.normalizeRect(rect2); - - // X: first and second points belong to different rectangles? - if ((orderedX[0] === rect1[0] && orderedX[1] === rect2[0]) || - (orderedX[0] === rect2[0] && orderedX[1] === rect1[0])) { - // Intersection must be between second and third points - result[0] = orderedX[1]; - result[2] = orderedX[2]; - } else { - return false; - } - - // Y: first and second points belong to different rectangles? - if ((orderedY[0] === rect1[1] && orderedY[1] === rect2[1]) || - (orderedY[0] === rect2[1] && orderedY[1] === rect1[1])) { - // Intersection must be between second and third points - result[1] = orderedY[1]; - result[3] = orderedY[2]; - } else { - return false; - } - - return result; - }; - - Util.sign = function Util_sign(num) { - return num < 0 ? -1 : 1; - }; - - Util.appendToArray = function Util_appendToArray(arr1, arr2) { - Array.prototype.push.apply(arr1, arr2); - }; - - Util.prependToArray = function Util_prependToArray(arr1, arr2) { - Array.prototype.unshift.apply(arr1, arr2); - }; - - Util.extendObj = function extendObj(obj1, obj2) { - for (var key in obj2) { - obj1[key] = obj2[key]; - } - }; - - Util.getInheritableProperty = function Util_getInheritableProperty(dict, - name) { - while (dict && !dict.has(name)) { - dict = dict.get('Parent'); - } - if (!dict) { - return null; - } - return dict.get(name); - }; - - Util.inherit = function Util_inherit(sub, base, prototype) { - sub.prototype = Object.create(base.prototype); - sub.prototype.constructor = sub; - for (var prop in prototype) { - sub.prototype[prop] = prototype[prop]; - } - }; - - Util.loadScript = function Util_loadScript(src, callback) { - var script = document.createElement('script'); - var loaded = false; - script.setAttribute('src', src); - if (callback) { - script.onload = function() { - if (!loaded) { - callback(); - } - loaded = true; - }; - } - document.getElementsByTagName('head')[0].appendChild(script); - }; - - return Util; -})(); - -/** - * PDF page viewport created based on scale, rotation and offset. - * @class - * @alias PDFJS.PageViewport - */ -var PageViewport = PDFJS.PageViewport = (function PageViewportClosure() { - /** - * @constructor - * @private - * @param viewBox {Array} xMin, yMin, xMax and yMax coordinates. - * @param scale {number} scale of the viewport. - * @param rotation {number} rotations of the viewport in degrees. - * @param offsetX {number} offset X - * @param offsetY {number} offset Y - * @param dontFlip {boolean} if true, axis Y will not be flipped. - */ - function PageViewport(viewBox, scale, rotation, offsetX, offsetY, dontFlip) { - this.viewBox = viewBox; - this.scale = scale; - this.rotation = rotation; - this.offsetX = offsetX; - this.offsetY = offsetY; - - // creating transform to convert pdf coordinate system to the normal - // canvas like coordinates taking in account scale and rotation - var centerX = (viewBox[2] + viewBox[0]) / 2; - var centerY = (viewBox[3] + viewBox[1]) / 2; - var rotateA, rotateB, rotateC, rotateD; - rotation = rotation % 360; - rotation = rotation < 0 ? rotation + 360 : rotation; - switch (rotation) { - case 180: - rotateA = -1; rotateB = 0; rotateC = 0; rotateD = 1; - break; - case 90: - rotateA = 0; rotateB = 1; rotateC = 1; rotateD = 0; - break; - case 270: - rotateA = 0; rotateB = -1; rotateC = -1; rotateD = 0; - break; - //case 0: - default: - rotateA = 1; rotateB = 0; rotateC = 0; rotateD = -1; - break; - } - - if (dontFlip) { - rotateC = -rotateC; rotateD = -rotateD; - } - - var offsetCanvasX, offsetCanvasY; - var width, height; - if (rotateA === 0) { - offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX; - offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY; - width = Math.abs(viewBox[3] - viewBox[1]) * scale; - height = Math.abs(viewBox[2] - viewBox[0]) * scale; - } else { - offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX; - offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY; - width = Math.abs(viewBox[2] - viewBox[0]) * scale; - height = Math.abs(viewBox[3] - viewBox[1]) * scale; - } - // creating transform for the following operations: - // translate(-centerX, -centerY), rotate and flip vertically, - // scale, and translate(offsetCanvasX, offsetCanvasY) - this.transform = [ - rotateA * scale, - rotateB * scale, - rotateC * scale, - rotateD * scale, - offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY, - offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY - ]; - - this.width = width; - this.height = height; - this.fontScale = scale; - } - PageViewport.prototype = /** @lends PDFJS.PageViewport.prototype */ { - /** - * Clones viewport with additional properties. - * @param args {Object} (optional) If specified, may contain the 'scale' or - * 'rotation' properties to override the corresponding properties in - * the cloned viewport. - * @returns {PDFJS.PageViewport} Cloned viewport. - */ - clone: function PageViewPort_clone(args) { - args = args || {}; - var scale = 'scale' in args ? args.scale : this.scale; - var rotation = 'rotation' in args ? args.rotation : this.rotation; - return new PageViewport(this.viewBox.slice(), scale, rotation, - this.offsetX, this.offsetY, args.dontFlip); - }, - /** - * Converts PDF point to the viewport coordinates. For examples, useful for - * converting PDF location into canvas pixel coordinates. - * @param x {number} X coordinate. - * @param y {number} Y coordinate. - * @returns {Object} Object that contains 'x' and 'y' properties of the - * point in the viewport coordinate space. - * @see {@link convertToPdfPoint} - * @see {@link convertToViewportRectangle} - */ - convertToViewportPoint: function PageViewport_convertToViewportPoint(x, y) { - return Util.applyTransform([x, y], this.transform); - }, - /** - * Converts PDF rectangle to the viewport coordinates. - * @param rect {Array} xMin, yMin, xMax and yMax coordinates. - * @returns {Array} Contains corresponding coordinates of the rectangle - * in the viewport coordinate space. - * @see {@link convertToViewportPoint} - */ - convertToViewportRectangle: - function PageViewport_convertToViewportRectangle(rect) { - var tl = Util.applyTransform([rect[0], rect[1]], this.transform); - var br = Util.applyTransform([rect[2], rect[3]], this.transform); - return [tl[0], tl[1], br[0], br[1]]; - }, - /** - * Converts viewport coordinates to the PDF location. For examples, useful - * for converting canvas pixel location into PDF one. - * @param x {number} X coordinate. - * @param y {number} Y coordinate. - * @returns {Object} Object that contains 'x' and 'y' properties of the - * point in the PDF coordinate space. - * @see {@link convertToViewportPoint} - */ - convertToPdfPoint: function PageViewport_convertToPdfPoint(x, y) { - return Util.applyInverseTransform([x, y], this.transform); - } - }; - return PageViewport; -})(); - -var PDFStringTranslateTable = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0x2D8, 0x2C7, 0x2C6, 0x2D9, 0x2DD, 0x2DB, 0x2DA, 0x2DC, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, - 0x2013, 0x192, 0x2044, 0x2039, 0x203A, 0x2212, 0x2030, 0x201E, 0x201C, - 0x201D, 0x2018, 0x2019, 0x201A, 0x2122, 0xFB01, 0xFB02, 0x141, 0x152, 0x160, - 0x178, 0x17D, 0x131, 0x142, 0x153, 0x161, 0x17E, 0, 0x20AC -]; - -function stringToPDFString(str) { - var i, n = str.length, strBuf = []; - if (str[0] === '\xFE' && str[1] === '\xFF') { - // UTF16BE BOM - for (i = 2; i < n; i += 2) { - strBuf.push(String.fromCharCode( - (str.charCodeAt(i) << 8) | str.charCodeAt(i + 1))); - } - } else { - for (i = 0; i < n; ++i) { - var code = PDFStringTranslateTable[str.charCodeAt(i)]; - strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); - } - } - return strBuf.join(''); -} - -function stringToUTF8String(str) { - return decodeURIComponent(escape(str)); -} - -function utf8StringToString(str) { - return unescape(encodeURIComponent(str)); -} - -function isEmptyObj(obj) { - for (var key in obj) { - return false; - } - return true; -} - -function isBool(v) { - return typeof v === 'boolean'; -} - -function isInt(v) { - return typeof v === 'number' && ((v | 0) === v); -} - -function isNum(v) { - return typeof v === 'number'; -} - -function isString(v) { - return typeof v === 'string'; -} - -function isName(v) { - return v instanceof Name; -} - -function isCmd(v, cmd) { - return v instanceof Cmd && (cmd === undefined || v.cmd === cmd); -} - -function isDict(v, type) { - if (!(v instanceof Dict)) { - return false; - } - if (!type) { - return true; - } - var dictType = v.get('Type'); - return isName(dictType) && dictType.name === type; -} - -function isArray(v) { - return v instanceof Array; -} - -function isStream(v) { - return typeof v === 'object' && v !== null && v.getBytes !== undefined; -} - -function isArrayBuffer(v) { - return typeof v === 'object' && v !== null && v.byteLength !== undefined; -} - -function isRef(v) { - return v instanceof Ref; -} - -/** - * Promise Capability object. - * - * @typedef {Object} PromiseCapability - * @property {Promise} promise - A promise object. - * @property {function} resolve - Fullfills the promise. - * @property {function} reject - Rejects the promise. - */ - -/** - * Creates a promise capability object. - * @alias PDFJS.createPromiseCapability - * - * @return {PromiseCapability} A capability object contains: - * - a Promise, resolve and reject methods. - */ -function createPromiseCapability() { - var capability = {}; - capability.promise = new Promise(function (resolve, reject) { - capability.resolve = resolve; - capability.reject = reject; - }); - return capability; -} - -PDFJS.createPromiseCapability = createPromiseCapability; - -/** - * Polyfill for Promises: - * The following promise implementation tries to generally implement the - * Promise/A+ spec. Some notable differences from other promise libaries are: - * - There currently isn't a seperate deferred and promise object. - * - Unhandled rejections eventually show an error if they aren't handled. - * - * Based off of the work in: - * https://bugzilla.mozilla.org/show_bug.cgi?id=810490 - */ -(function PromiseClosure() { - if (globalScope.Promise) { - // Promises existing in the DOM/Worker, checking presence of all/resolve - if (typeof globalScope.Promise.all !== 'function') { - globalScope.Promise.all = function (iterable) { - var count = 0, results = [], resolve, reject; - var promise = new globalScope.Promise(function (resolve_, reject_) { - resolve = resolve_; - reject = reject_; - }); - iterable.forEach(function (p, i) { - count++; - p.then(function (result) { - results[i] = result; - count--; - if (count === 0) { - resolve(results); - } - }, reject); - }); - if (count === 0) { - resolve(results); - } - return promise; - }; - } - if (typeof globalScope.Promise.resolve !== 'function') { - globalScope.Promise.resolve = function (value) { - return new globalScope.Promise(function (resolve) { resolve(value); }); - }; - } - if (typeof globalScope.Promise.reject !== 'function') { - globalScope.Promise.reject = function (reason) { - return new globalScope.Promise(function (resolve, reject) { - reject(reason); - }); - }; - } - if (typeof globalScope.Promise.prototype.catch !== 'function') { - globalScope.Promise.prototype.catch = function (onReject) { - return globalScope.Promise.prototype.then(undefined, onReject); - }; - } - return; - } - var STATUS_PENDING = 0; - var STATUS_RESOLVED = 1; - var STATUS_REJECTED = 2; - - // In an attempt to avoid silent exceptions, unhandled rejections are - // tracked and if they aren't handled in a certain amount of time an - // error is logged. - var REJECTION_TIMEOUT = 500; - - var HandlerManager = { - handlers: [], - running: false, - unhandledRejections: [], - pendingRejectionCheck: false, - - scheduleHandlers: function scheduleHandlers(promise) { - if (promise._status === STATUS_PENDING) { - return; - } - - this.handlers = this.handlers.concat(promise._handlers); - promise._handlers = []; - - if (this.running) { - return; - } - this.running = true; - - setTimeout(this.runHandlers.bind(this), 0); - }, - - runHandlers: function runHandlers() { - var RUN_TIMEOUT = 1; // ms - var timeoutAt = Date.now() + RUN_TIMEOUT; - while (this.handlers.length > 0) { - var handler = this.handlers.shift(); - - var nextStatus = handler.thisPromise._status; - var nextValue = handler.thisPromise._value; - - try { - if (nextStatus === STATUS_RESOLVED) { - if (typeof handler.onResolve === 'function') { - nextValue = handler.onResolve(nextValue); - } - } else if (typeof handler.onReject === 'function') { - nextValue = handler.onReject(nextValue); - nextStatus = STATUS_RESOLVED; - - if (handler.thisPromise._unhandledRejection) { - this.removeUnhandeledRejection(handler.thisPromise); - } - } - } catch (ex) { - nextStatus = STATUS_REJECTED; - nextValue = ex; - } - - handler.nextPromise._updateStatus(nextStatus, nextValue); - if (Date.now() >= timeoutAt) { - break; - } - } - - if (this.handlers.length > 0) { - setTimeout(this.runHandlers.bind(this), 0); - return; - } - - this.running = false; - }, - - addUnhandledRejection: function addUnhandledRejection(promise) { - this.unhandledRejections.push({ - promise: promise, - time: Date.now() - }); - this.scheduleRejectionCheck(); - }, - - removeUnhandeledRejection: function removeUnhandeledRejection(promise) { - promise._unhandledRejection = false; - for (var i = 0; i < this.unhandledRejections.length; i++) { - if (this.unhandledRejections[i].promise === promise) { - this.unhandledRejections.splice(i); - i--; - } - } - }, - - scheduleRejectionCheck: function scheduleRejectionCheck() { - if (this.pendingRejectionCheck) { - return; - } - this.pendingRejectionCheck = true; - setTimeout(function rejectionCheck() { - this.pendingRejectionCheck = false; - var now = Date.now(); - for (var i = 0; i < this.unhandledRejections.length; i++) { - if (now - this.unhandledRejections[i].time > REJECTION_TIMEOUT) { - var unhandled = this.unhandledRejections[i].promise._value; - var msg = 'Unhandled rejection: ' + unhandled; - if (unhandled.stack) { - msg += '\n' + unhandled.stack; - } - warn(msg); - this.unhandledRejections.splice(i); - i--; - } - } - if (this.unhandledRejections.length) { - this.scheduleRejectionCheck(); - } - }.bind(this), REJECTION_TIMEOUT); - } - }; - - function Promise(resolver) { - this._status = STATUS_PENDING; - this._handlers = []; - try { - resolver.call(this, this._resolve.bind(this), this._reject.bind(this)); - } catch (e) { - this._reject(e); - } - } - /** - * Builds a promise that is resolved when all the passed in promises are - * resolved. - * @param {array} array of data and/or promises to wait for. - * @return {Promise} New dependant promise. - */ - Promise.all = function Promise_all(promises) { - var resolveAll, rejectAll; - var deferred = new Promise(function (resolve, reject) { - resolveAll = resolve; - rejectAll = reject; - }); - var unresolved = promises.length; - var results = []; - if (unresolved === 0) { - resolveAll(results); - return deferred; - } - function reject(reason) { - if (deferred._status === STATUS_REJECTED) { - return; - } - results = []; - rejectAll(reason); - } - for (var i = 0, ii = promises.length; i < ii; ++i) { - var promise = promises[i]; - var resolve = (function(i) { - return function(value) { - if (deferred._status === STATUS_REJECTED) { - return; - } - results[i] = value; - unresolved--; - if (unresolved === 0) { - resolveAll(results); - } - }; - })(i); - if (Promise.isPromise(promise)) { - promise.then(resolve, reject); - } else { - resolve(promise); - } - } - return deferred; - }; - - /** - * Checks if the value is likely a promise (has a 'then' function). - * @return {boolean} true if value is thenable - */ - Promise.isPromise = function Promise_isPromise(value) { - return value && typeof value.then === 'function'; - }; - - /** - * Creates resolved promise - * @param value resolve value - * @returns {Promise} - */ - Promise.resolve = function Promise_resolve(value) { - return new Promise(function (resolve) { resolve(value); }); - }; - - /** - * Creates rejected promise - * @param reason rejection value - * @returns {Promise} - */ - Promise.reject = function Promise_reject(reason) { - return new Promise(function (resolve, reject) { reject(reason); }); - }; - - Promise.prototype = { - _status: null, - _value: null, - _handlers: null, - _unhandledRejection: null, - - _updateStatus: function Promise__updateStatus(status, value) { - if (this._status === STATUS_RESOLVED || - this._status === STATUS_REJECTED) { - return; - } - - if (status === STATUS_RESOLVED && - Promise.isPromise(value)) { - value.then(this._updateStatus.bind(this, STATUS_RESOLVED), - this._updateStatus.bind(this, STATUS_REJECTED)); - return; - } - - this._status = status; - this._value = value; - - if (status === STATUS_REJECTED && this._handlers.length === 0) { - this._unhandledRejection = true; - HandlerManager.addUnhandledRejection(this); - } - - HandlerManager.scheduleHandlers(this); - }, - - _resolve: function Promise_resolve(value) { - this._updateStatus(STATUS_RESOLVED, value); - }, - - _reject: function Promise_reject(reason) { - this._updateStatus(STATUS_REJECTED, reason); - }, - - then: function Promise_then(onResolve, onReject) { - var nextPromise = new Promise(function (resolve, reject) { - this.resolve = resolve; - this.reject = reject; - }); - this._handlers.push({ - thisPromise: this, - onResolve: onResolve, - onReject: onReject, - nextPromise: nextPromise - }); - HandlerManager.scheduleHandlers(this); - return nextPromise; - }, - - catch: function Promise_catch(onReject) { - return this.then(undefined, onReject); - } - }; - - globalScope.Promise = Promise; -})(); - -var StatTimer = (function StatTimerClosure() { - function rpad(str, pad, length) { - while (str.length < length) { - str += pad; - } - return str; - } - function StatTimer() { - this.started = {}; - this.times = []; - this.enabled = true; - } - StatTimer.prototype = { - time: function StatTimer_time(name) { - if (!this.enabled) { - return; - } - if (name in this.started) { - warn('Timer is already running for ' + name); - } - this.started[name] = Date.now(); - }, - timeEnd: function StatTimer_timeEnd(name) { - if (!this.enabled) { - return; - } - if (!(name in this.started)) { - warn('Timer has not been started for ' + name); - } - this.times.push({ - 'name': name, - 'start': this.started[name], - 'end': Date.now() - }); - // Remove timer from started so it can be called again. - delete this.started[name]; - }, - toString: function StatTimer_toString() { - var i, ii; - var times = this.times; - var out = ''; - // Find the longest name for padding purposes. - var longest = 0; - for (i = 0, ii = times.length; i < ii; ++i) { - var name = times[i]['name']; - if (name.length > longest) { - longest = name.length; - } - } - for (i = 0, ii = times.length; i < ii; ++i) { - var span = times[i]; - var duration = span.end - span.start; - out += rpad(span['name'], ' ', longest) + ' ' + duration + 'ms\n'; - } - return out; - } - }; - return StatTimer; -})(); - -PDFJS.createBlob = function createBlob(data, contentType) { - if (typeof Blob !== 'undefined') { - return new Blob([data], { type: contentType }); - } - // Blob builder is deprecated in FF14 and removed in FF18. - var bb = new MozBlobBuilder(); - bb.append(data); - return bb.getBlob(contentType); -}; - -PDFJS.createObjectURL = (function createObjectURLClosure() { - // Blob/createObjectURL is not available, falling back to data schema. - var digits = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - - return function createObjectURL(data, contentType) { - if (!PDFJS.disableCreateObjectURL && - typeof URL !== 'undefined' && URL.createObjectURL) { - var blob = PDFJS.createBlob(data, contentType); - return URL.createObjectURL(blob); - } - - var buffer = 'data:' + contentType + ';base64,'; - for (var i = 0, ii = data.length; i < ii; i += 3) { - var b1 = data[i] & 0xFF; - var b2 = data[i + 1] & 0xFF; - var b3 = data[i + 2] & 0xFF; - var d1 = b1 >> 2, d2 = ((b1 & 3) << 4) | (b2 >> 4); - var d3 = i + 1 < ii ? ((b2 & 0xF) << 2) | (b3 >> 6) : 64; - var d4 = i + 2 < ii ? (b3 & 0x3F) : 64; - buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4]; - } - return buffer; - }; -})(); - -function MessageHandler(sourceName, targetName, comObj) { - this.sourceName = sourceName; - this.targetName = targetName; - this.comObj = comObj; - this.callbackIndex = 1; - this.postMessageTransfers = true; - var callbacksCapabilities = this.callbacksCapabilities = {}; - var ah = this.actionHandler = {}; - - this._onComObjOnMessage = function messageHandlerComObjOnMessage(event) { - var data = event.data; - if (data.targetName !== this.sourceName) { - return; - } - if (data.isReply) { - var callbackId = data.callbackId; - if (data.callbackId in callbacksCapabilities) { - var callback = callbacksCapabilities[callbackId]; - delete callbacksCapabilities[callbackId]; - if ('error' in data) { - callback.reject(data.error); - } else { - callback.resolve(data.data); - } - } else { - error('Cannot resolve callback ' + callbackId); - } - } else if (data.action in ah) { - var action = ah[data.action]; - if (data.callbackId) { - var sourceName = this.sourceName; - var targetName = data.sourceName; - Promise.resolve().then(function () { - return action[0].call(action[1], data.data); - }).then(function (result) { - comObj.postMessage({ - sourceName: sourceName, - targetName: targetName, - isReply: true, - callbackId: data.callbackId, - data: result - }); - }, function (reason) { - if (reason instanceof Error) { - // Serialize error to avoid "DataCloneError" - reason = reason + ''; - } - comObj.postMessage({ - sourceName: sourceName, - targetName: targetName, - isReply: true, - callbackId: data.callbackId, - error: reason - }); - }); - } else { - action[0].call(action[1], data.data); - } - } else { - error('Unknown action from worker: ' + data.action); - } - }.bind(this); - comObj.addEventListener('message', this._onComObjOnMessage); -} - -MessageHandler.prototype = { - on: function messageHandlerOn(actionName, handler, scope) { - var ah = this.actionHandler; - if (ah[actionName]) { - error('There is already an actionName called "' + actionName + '"'); - } - ah[actionName] = [handler, scope]; - }, - /** - * Sends a message to the comObj to invoke the action with the supplied data. - * @param {String} actionName Action to call. - * @param {JSON} data JSON data to send. - * @param {Array} [transfers] Optional list of transfers/ArrayBuffers - */ - send: function messageHandlerSend(actionName, data, transfers) { - var message = { - sourceName: this.sourceName, - targetName: this.targetName, - action: actionName, - data: data - }; - this.postMessage(message, transfers); - }, - /** - * Sends a message to the comObj to invoke the action with the supplied data. - * Expects that other side will callback with the response. - * @param {String} actionName Action to call. - * @param {JSON} data JSON data to send. - * @param {Array} [transfers] Optional list of transfers/ArrayBuffers. - * @returns {Promise} Promise to be resolved with response data. - */ - sendWithPromise: - function messageHandlerSendWithPromise(actionName, data, transfers) { - var callbackId = this.callbackIndex++; - var message = { - sourceName: this.sourceName, - targetName: this.targetName, - action: actionName, - data: data, - callbackId: callbackId - }; - var capability = createPromiseCapability(); - this.callbacksCapabilities[callbackId] = capability; - try { - this.postMessage(message, transfers); - } catch (e) { - capability.reject(e); - } - return capability.promise; - }, - /** - * Sends raw message to the comObj. - * @private - * @param message {Object} Raw message. - * @param transfers List of transfers/ArrayBuffers, or undefined. - */ - postMessage: function (message, transfers) { - if (transfers && this.postMessageTransfers) { - this.comObj.postMessage(message, transfers); - } else { - this.comObj.postMessage(message); - } - }, - - destroy: function () { - this.comObj.removeEventListener('message', this._onComObjOnMessage); - } -}; - -function loadJpegStream(id, imageUrl, objs) { - var img = new Image(); - img.onload = (function loadJpegStream_onloadClosure() { - objs.resolve(id, img); - }); - img.onerror = (function loadJpegStream_onerrorClosure() { - objs.resolve(id, null); - warn('Error during JPEG image loading'); - }); - img.src = imageUrl; -} - - // Polyfill from https://github.com/Polymer/URL -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ -(function checkURLConstructor(scope) { - /* jshint ignore:start */ - - // feature detect for URL constructor - var hasWorkingUrl = false; - if (typeof URL === 'function' && ('origin' in URL.prototype)) { - try { - var u = new URL('b', 'http://a'); - u.pathname = 'c%20d'; - hasWorkingUrl = u.href === 'http://a/c%20d'; - } catch(e) {} - } - - if (hasWorkingUrl) - return; - - var relative = Object.create(null); - relative['ftp'] = 21; - relative['file'] = 0; - relative['gopher'] = 70; - relative['http'] = 80; - relative['https'] = 443; - relative['ws'] = 80; - relative['wss'] = 443; - - var relativePathDotMapping = Object.create(null); - relativePathDotMapping['%2e'] = '.'; - relativePathDotMapping['.%2e'] = '..'; - relativePathDotMapping['%2e.'] = '..'; - relativePathDotMapping['%2e%2e'] = '..'; - - function isRelativeScheme(scheme) { - return relative[scheme] !== undefined; - } - - function invalid() { - clear.call(this); - this._isInvalid = true; - } - - function IDNAToASCII(h) { - if ('' == h) { - invalid.call(this) - } - // XXX - return h.toLowerCase() - } - - function percentEscape(c) { - var unicode = c.charCodeAt(0); - if (unicode > 0x20 && - unicode < 0x7F && - // " # < > ? ` - [0x22, 0x23, 0x3C, 0x3E, 0x3F, 0x60].indexOf(unicode) == -1 - ) { - return c; - } - return encodeURIComponent(c); - } - - function percentEscapeQuery(c) { - // XXX This actually needs to encode c using encoding and then - // convert the bytes one-by-one. - - var unicode = c.charCodeAt(0); - if (unicode > 0x20 && - unicode < 0x7F && - // " # < > ` (do not escape '?') - [0x22, 0x23, 0x3C, 0x3E, 0x60].indexOf(unicode) == -1 - ) { - return c; - } - return encodeURIComponent(c); - } - - var EOF = undefined, - ALPHA = /[a-zA-Z]/, - ALPHANUMERIC = /[a-zA-Z0-9\+\-\.]/; - - function parse(input, stateOverride, base) { - function err(message) { - errors.push(message) - } - - var state = stateOverride || 'scheme start', - cursor = 0, - buffer = '', - seenAt = false, - seenBracket = false, - errors = []; - - loop: while ((input[cursor - 1] != EOF || cursor == 0) && !this._isInvalid) { - var c = input[cursor]; - switch (state) { - case 'scheme start': - if (c && ALPHA.test(c)) { - buffer += c.toLowerCase(); // ASCII-safe - state = 'scheme'; - } else if (!stateOverride) { - buffer = ''; - state = 'no scheme'; - continue; - } else { - err('Invalid scheme.'); - break loop; - } - break; - - case 'scheme': - if (c && ALPHANUMERIC.test(c)) { - buffer += c.toLowerCase(); // ASCII-safe - } else if (':' == c) { - this._scheme = buffer; - buffer = ''; - if (stateOverride) { - break loop; - } - if (isRelativeScheme(this._scheme)) { - this._isRelative = true; - } - if ('file' == this._scheme) { - state = 'relative'; - } else if (this._isRelative && base && base._scheme == this._scheme) { - state = 'relative or authority'; - } else if (this._isRelative) { - state = 'authority first slash'; - } else { - state = 'scheme data'; - } - } else if (!stateOverride) { - buffer = ''; - cursor = 0; - state = 'no scheme'; - continue; - } else if (EOF == c) { - break loop; - } else { - err('Code point not allowed in scheme: ' + c) - break loop; - } - break; - - case 'scheme data': - if ('?' == c) { - this._query = '?'; - state = 'query'; - } else if ('#' == c) { - this._fragment = '#'; - state = 'fragment'; - } else { - // XXX error handling - if (EOF != c && '\t' != c && '\n' != c && '\r' != c) { - this._schemeData += percentEscape(c); - } - } - break; - - case 'no scheme': - if (!base || !(isRelativeScheme(base._scheme))) { - err('Missing scheme.'); - invalid.call(this); - } else { - state = 'relative'; - continue; - } - break; - - case 'relative or authority': - if ('/' == c && '/' == input[cursor+1]) { - state = 'authority ignore slashes'; - } else { - err('Expected /, got: ' + c); - state = 'relative'; - continue - } - break; - - case 'relative': - this._isRelative = true; - if ('file' != this._scheme) - this._scheme = base._scheme; - if (EOF == c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = base._query; - this._username = base._username; - this._password = base._password; - break loop; - } else if ('/' == c || '\\' == c) { - if ('\\' == c) - err('\\ is an invalid code point.'); - state = 'relative slash'; - } else if ('?' == c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = '?'; - this._username = base._username; - this._password = base._password; - state = 'query'; - } else if ('#' == c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = base._query; - this._fragment = '#'; - this._username = base._username; - this._password = base._password; - state = 'fragment'; - } else { - var nextC = input[cursor+1] - var nextNextC = input[cursor+2] - if ( - 'file' != this._scheme || !ALPHA.test(c) || - (nextC != ':' && nextC != '|') || - (EOF != nextNextC && '/' != nextNextC && '\\' != nextNextC && '?' != nextNextC && '#' != nextNextC)) { - this._host = base._host; - this._port = base._port; - this._username = base._username; - this._password = base._password; - this._path = base._path.slice(); - this._path.pop(); - } - state = 'relative path'; - continue; - } - break; - - case 'relative slash': - if ('/' == c || '\\' == c) { - if ('\\' == c) { - err('\\ is an invalid code point.'); - } - if ('file' == this._scheme) { - state = 'file host'; - } else { - state = 'authority ignore slashes'; - } - } else { - if ('file' != this._scheme) { - this._host = base._host; - this._port = base._port; - this._username = base._username; - this._password = base._password; - } - state = 'relative path'; - continue; - } - break; - - case 'authority first slash': - if ('/' == c) { - state = 'authority second slash'; - } else { - err("Expected '/', got: " + c); - state = 'authority ignore slashes'; - continue; - } - break; - - case 'authority second slash': - state = 'authority ignore slashes'; - if ('/' != c) { - err("Expected '/', got: " + c); - continue; - } - break; - - case 'authority ignore slashes': - if ('/' != c && '\\' != c) { - state = 'authority'; - continue; - } else { - err('Expected authority, got: ' + c); - } - break; - - case 'authority': - if ('@' == c) { - if (seenAt) { - err('@ already seen.'); - buffer += '%40'; - } - seenAt = true; - for (var i = 0; i < buffer.length; i++) { - var cp = buffer[i]; - if ('\t' == cp || '\n' == cp || '\r' == cp) { - err('Invalid whitespace in authority.'); - continue; - } - // XXX check URL code points - if (':' == cp && null === this._password) { - this._password = ''; - continue; - } - var tempC = percentEscape(cp); - (null !== this._password) ? this._password += tempC : this._username += tempC; - } - buffer = ''; - } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) { - cursor -= buffer.length; - buffer = ''; - state = 'host'; - continue; - } else { - buffer += c; - } - break; - - case 'file host': - if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) { - if (buffer.length == 2 && ALPHA.test(buffer[0]) && (buffer[1] == ':' || buffer[1] == '|')) { - state = 'relative path'; - } else if (buffer.length == 0) { - state = 'relative path start'; - } else { - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'relative path start'; - } - continue; - } else if ('\t' == c || '\n' == c || '\r' == c) { - err('Invalid whitespace in file host.'); - } else { - buffer += c; - } - break; - - case 'host': - case 'hostname': - if (':' == c && !seenBracket) { - // XXX host parsing - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'port'; - if ('hostname' == stateOverride) { - break loop; - } - } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) { - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'relative path start'; - if (stateOverride) { - break loop; - } - continue; - } else if ('\t' != c && '\n' != c && '\r' != c) { - if ('[' == c) { - seenBracket = true; - } else if (']' == c) { - seenBracket = false; - } - buffer += c; - } else { - err('Invalid code point in host/hostname: ' + c); - } - break; - - case 'port': - if (/[0-9]/.test(c)) { - buffer += c; - } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c || stateOverride) { - if ('' != buffer) { - var temp = parseInt(buffer, 10); - if (temp != relative[this._scheme]) { - this._port = temp + ''; - } - buffer = ''; - } - if (stateOverride) { - break loop; - } - state = 'relative path start'; - continue; - } else if ('\t' == c || '\n' == c || '\r' == c) { - err('Invalid code point in port: ' + c); - } else { - invalid.call(this); - } - break; - - case 'relative path start': - if ('\\' == c) - err("'\\' not allowed in path."); - state = 'relative path'; - if ('/' != c && '\\' != c) { - continue; - } - break; - - case 'relative path': - if (EOF == c || '/' == c || '\\' == c || (!stateOverride && ('?' == c || '#' == c))) { - if ('\\' == c) { - err('\\ not allowed in relative path.'); - } - var tmp; - if (tmp = relativePathDotMapping[buffer.toLowerCase()]) { - buffer = tmp; - } - if ('..' == buffer) { - this._path.pop(); - if ('/' != c && '\\' != c) { - this._path.push(''); - } - } else if ('.' == buffer && '/' != c && '\\' != c) { - this._path.push(''); - } else if ('.' != buffer) { - if ('file' == this._scheme && this._path.length == 0 && buffer.length == 2 && ALPHA.test(buffer[0]) && buffer[1] == '|') { - buffer = buffer[0] + ':'; - } - this._path.push(buffer); - } - buffer = ''; - if ('?' == c) { - this._query = '?'; - state = 'query'; - } else if ('#' == c) { - this._fragment = '#'; - state = 'fragment'; - } - } else if ('\t' != c && '\n' != c && '\r' != c) { - buffer += percentEscape(c); - } - break; - - case 'query': - if (!stateOverride && '#' == c) { - this._fragment = '#'; - state = 'fragment'; - } else if (EOF != c && '\t' != c && '\n' != c && '\r' != c) { - this._query += percentEscapeQuery(c); - } - break; - - case 'fragment': - if (EOF != c && '\t' != c && '\n' != c && '\r' != c) { - this._fragment += c; - } - break; - } - - cursor++; - } - } - - function clear() { - this._scheme = ''; - this._schemeData = ''; - this._username = ''; - this._password = null; - this._host = ''; - this._port = ''; - this._path = []; - this._query = ''; - this._fragment = ''; - this._isInvalid = false; - this._isRelative = false; - } - - // Does not process domain names or IP addresses. - // Does not handle encoding for the query parameter. - function jURL(url, base /* , encoding */) { - if (base !== undefined && !(base instanceof jURL)) - base = new jURL(String(base)); - - this._url = url; - clear.call(this); - - var input = url.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, ''); - // encoding = encoding || 'utf-8' - - parse.call(this, input, null, base); - } - - jURL.prototype = { - toString: function() { - return this.href; - }, - get href() { - if (this._isInvalid) - return this._url; - - var authority = ''; - if ('' != this._username || null != this._password) { - authority = this._username + - (null != this._password ? ':' + this._password : '') + '@'; - } - - return this.protocol + - (this._isRelative ? '//' + authority + this.host : '') + - this.pathname + this._query + this._fragment; - }, - set href(href) { - clear.call(this); - parse.call(this, href); - }, - - get protocol() { - return this._scheme + ':'; - }, - set protocol(protocol) { - if (this._isInvalid) - return; - parse.call(this, protocol + ':', 'scheme start'); - }, - - get host() { - return this._isInvalid ? '' : this._port ? - this._host + ':' + this._port : this._host; - }, - set host(host) { - if (this._isInvalid || !this._isRelative) - return; - parse.call(this, host, 'host'); - }, - - get hostname() { - return this._host; - }, - set hostname(hostname) { - if (this._isInvalid || !this._isRelative) - return; - parse.call(this, hostname, 'hostname'); - }, - - get port() { - return this._port; - }, - set port(port) { - if (this._isInvalid || !this._isRelative) - return; - parse.call(this, port, 'port'); - }, - - get pathname() { - return this._isInvalid ? '' : this._isRelative ? - '/' + this._path.join('/') : this._schemeData; - }, - set pathname(pathname) { - if (this._isInvalid || !this._isRelative) - return; - this._path = []; - parse.call(this, pathname, 'relative path start'); - }, - - get search() { - return this._isInvalid || !this._query || '?' == this._query ? - '' : this._query; - }, - set search(search) { - if (this._isInvalid || !this._isRelative) - return; - this._query = '?'; - if ('?' == search[0]) - search = search.slice(1); - parse.call(this, search, 'query'); - }, - - get hash() { - return this._isInvalid || !this._fragment || '#' == this._fragment ? - '' : this._fragment; - }, - set hash(hash) { - if (this._isInvalid) - return; - this._fragment = '#'; - if ('#' == hash[0]) - hash = hash.slice(1); - parse.call(this, hash, 'fragment'); - }, - - get origin() { - var host; - if (this._isInvalid || !this._scheme) { - return ''; - } - // javascript: Gecko returns String(""), WebKit/Blink String("null") - // Gecko throws error for "data://" - // data: Gecko returns "", Blink returns "data://", WebKit returns "null" - // Gecko returns String("") for file: mailto: - // WebKit/Blink returns String("SCHEME://") for file: mailto: - switch (this._scheme) { - case 'data': - case 'file': - case 'javascript': - case 'mailto': - return 'null'; - } - host = this.host; - if (!host) { - return ''; - } - return this._scheme + '://' + host; - } - }; - - // Copy over the static methods - var OriginalURL = scope.URL; - if (OriginalURL) { - jURL.createObjectURL = function(blob) { - // IE extension allows a second optional options argument. - // http://msdn.microsoft.com/en-us/library/ie/hh772302(v=vs.85).aspx - return OriginalURL.createObjectURL.apply(OriginalURL, arguments); - }; - jURL.revokeObjectURL = function(url) { - OriginalURL.revokeObjectURL(url); - }; - } - - scope.URL = jURL; - /* jshint ignore:end */ -})(globalScope); - - - - -var NetworkManager = (function NetworkManagerClosure() { - - var OK_RESPONSE = 200; - var PARTIAL_CONTENT_RESPONSE = 206; - - function NetworkManager(url, args) { - this.url = url; - args = args || {}; - this.isHttp = /^https?:/i.test(url); - this.httpHeaders = (this.isHttp && args.httpHeaders) || {}; - this.withCredentials = args.withCredentials || false; - this.getXhr = args.getXhr || - function NetworkManager_getXhr() { - return new XMLHttpRequest(); - }; - - this.currXhrId = 0; - this.pendingRequests = {}; - this.loadedRequests = {}; - } - - function getArrayBuffer(xhr) { - var data = xhr.response; - if (typeof data !== 'string') { - return data; - } - var length = data.length; - var array = new Uint8Array(length); - for (var i = 0; i < length; i++) { - array[i] = data.charCodeAt(i) & 0xFF; - } - return array.buffer; - } - - var supportsMozChunked = (function supportsMozChunkedClosure() { - try { - var x = new XMLHttpRequest(); - // Firefox 37- required .open() to be called before setting responseType. - // https://bugzilla.mozilla.org/show_bug.cgi?id=707484 - // Even though the URL is not visited, .open() could fail if the URL is - // blocked, e.g. via the connect-src CSP directive or the NoScript addon. - // When this error occurs, this feature detection method will mistakenly - // report that moz-chunked-arraybuffer is not supported in Firefox 37-. - x.open('GET', 'https://example.com'); - x.responseType = 'moz-chunked-arraybuffer'; - return x.responseType === 'moz-chunked-arraybuffer'; - } catch (e) { - return false; - } - })(); - - NetworkManager.prototype = { - requestRange: function NetworkManager_requestRange(begin, end, listeners) { - var args = { - begin: begin, - end: end - }; - for (var prop in listeners) { - args[prop] = listeners[prop]; - } - return this.request(args); - }, - - requestFull: function NetworkManager_requestFull(listeners) { - return this.request(listeners); - }, - - request: function NetworkManager_request(args) { - var xhr = this.getXhr(); - var xhrId = this.currXhrId++; - var pendingRequest = this.pendingRequests[xhrId] = { - xhr: xhr - }; - - xhr.open('GET', this.url); - xhr.withCredentials = this.withCredentials; - for (var property in this.httpHeaders) { - var value = this.httpHeaders[property]; - if (typeof value === 'undefined') { - continue; - } - xhr.setRequestHeader(property, value); - } - if (this.isHttp && 'begin' in args && 'end' in args) { - var rangeStr = args.begin + '-' + (args.end - 1); - xhr.setRequestHeader('Range', 'bytes=' + rangeStr); - pendingRequest.expectedStatus = 206; - } else { - pendingRequest.expectedStatus = 200; - } - - var useMozChunkedLoading = supportsMozChunked && !!args.onProgressiveData; - if (useMozChunkedLoading) { - xhr.responseType = 'moz-chunked-arraybuffer'; - pendingRequest.onProgressiveData = args.onProgressiveData; - pendingRequest.mozChunked = true; - } else { - xhr.responseType = 'arraybuffer'; - } - - if (args.onError) { - xhr.onerror = function(evt) { - args.onError(xhr.status); - }; - } - xhr.onreadystatechange = this.onStateChange.bind(this, xhrId); - xhr.onprogress = this.onProgress.bind(this, xhrId); - - pendingRequest.onHeadersReceived = args.onHeadersReceived; - pendingRequest.onDone = args.onDone; - pendingRequest.onError = args.onError; - pendingRequest.onProgress = args.onProgress; - - xhr.send(null); - - return xhrId; - }, - - onProgress: function NetworkManager_onProgress(xhrId, evt) { - var pendingRequest = this.pendingRequests[xhrId]; - if (!pendingRequest) { - // Maybe abortRequest was called... - return; - } - - if (pendingRequest.mozChunked) { - var chunk = getArrayBuffer(pendingRequest.xhr); - pendingRequest.onProgressiveData(chunk); - } - - var onProgress = pendingRequest.onProgress; - if (onProgress) { - onProgress(evt); - } - }, - - onStateChange: function NetworkManager_onStateChange(xhrId, evt) { - var pendingRequest = this.pendingRequests[xhrId]; - if (!pendingRequest) { - // Maybe abortRequest was called... - return; - } - - var xhr = pendingRequest.xhr; - if (xhr.readyState >= 2 && pendingRequest.onHeadersReceived) { - pendingRequest.onHeadersReceived(); - delete pendingRequest.onHeadersReceived; - } - - if (xhr.readyState !== 4) { - return; - } - - if (!(xhrId in this.pendingRequests)) { - // The XHR request might have been aborted in onHeadersReceived() - // callback, in which case we should abort request - return; - } - - delete this.pendingRequests[xhrId]; - - // success status == 0 can be on ftp, file and other protocols - if (xhr.status === 0 && this.isHttp) { - if (pendingRequest.onError) { - pendingRequest.onError(xhr.status); - } - return; - } - var xhrStatus = xhr.status || OK_RESPONSE; - - // From http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.2: - // "A server MAY ignore the Range header". This means it's possible to - // get a 200 rather than a 206 response from a range request. - var ok_response_on_range_request = - xhrStatus === OK_RESPONSE && - pendingRequest.expectedStatus === PARTIAL_CONTENT_RESPONSE; - - if (!ok_response_on_range_request && - xhrStatus !== pendingRequest.expectedStatus) { - if (pendingRequest.onError) { - pendingRequest.onError(xhr.status); - } - return; - } - - this.loadedRequests[xhrId] = true; - - var chunk = getArrayBuffer(xhr); - if (xhrStatus === PARTIAL_CONTENT_RESPONSE) { - var rangeHeader = xhr.getResponseHeader('Content-Range'); - var matches = /bytes (\d+)-(\d+)\/(\d+)/.exec(rangeHeader); - var begin = parseInt(matches[1], 10); - pendingRequest.onDone({ - begin: begin, - chunk: chunk - }); - } else if (pendingRequest.onProgressiveData) { - pendingRequest.onDone(null); - } else if (chunk) { - pendingRequest.onDone({ - begin: 0, - chunk: chunk - }); - } else if (pendingRequest.onError) { - pendingRequest.onError(xhr.status); - } - }, - - hasPendingRequests: function NetworkManager_hasPendingRequests() { - for (var xhrId in this.pendingRequests) { - return true; - } - return false; - }, - - getRequestXhr: function NetworkManager_getXhr(xhrId) { - return this.pendingRequests[xhrId].xhr; - }, - - isStreamingRequest: function NetworkManager_isStreamingRequest(xhrId) { - return !!(this.pendingRequests[xhrId].onProgressiveData); - }, - - isPendingRequest: function NetworkManager_isPendingRequest(xhrId) { - return xhrId in this.pendingRequests; - }, - - isLoadedRequest: function NetworkManager_isLoadedRequest(xhrId) { - return xhrId in this.loadedRequests; - }, - - abortAllRequests: function NetworkManager_abortAllRequests() { - for (var xhrId in this.pendingRequests) { - this.abortRequest(xhrId | 0); - } - }, - - abortRequest: function NetworkManager_abortRequest(xhrId) { - var xhr = this.pendingRequests[xhrId].xhr; - delete this.pendingRequests[xhrId]; - xhr.abort(); - } - }; - - return NetworkManager; -})(); - - -var ChunkedStream = (function ChunkedStreamClosure() { - function ChunkedStream(length, chunkSize, manager) { - this.bytes = new Uint8Array(length); - this.start = 0; - this.pos = 0; - this.end = length; - this.chunkSize = chunkSize; - this.loadedChunks = []; - this.numChunksLoaded = 0; - this.numChunks = Math.ceil(length / chunkSize); - this.manager = manager; - this.progressiveDataLength = 0; - this.lastSuccessfulEnsureByteChunk = -1; // a single-entry cache - } - - // required methods for a stream. if a particular stream does not - // implement these, an error should be thrown - ChunkedStream.prototype = { - - getMissingChunks: function ChunkedStream_getMissingChunks() { - var chunks = []; - for (var chunk = 0, n = this.numChunks; chunk < n; ++chunk) { - if (!this.loadedChunks[chunk]) { - chunks.push(chunk); - } - } - return chunks; - }, - - getBaseStreams: function ChunkedStream_getBaseStreams() { - return [this]; - }, - - allChunksLoaded: function ChunkedStream_allChunksLoaded() { - return this.numChunksLoaded === this.numChunks; - }, - - onReceiveData: function ChunkedStream_onReceiveData(begin, chunk) { - var end = begin + chunk.byteLength; - - assert(begin % this.chunkSize === 0, 'Bad begin offset: ' + begin); - // Using this.length is inaccurate here since this.start can be moved - // See ChunkedStream.moveStart() - var length = this.bytes.length; - assert(end % this.chunkSize === 0 || end === length, - 'Bad end offset: ' + end); - - this.bytes.set(new Uint8Array(chunk), begin); - var chunkSize = this.chunkSize; - var beginChunk = Math.floor(begin / chunkSize); - var endChunk = Math.floor((end - 1) / chunkSize) + 1; - var curChunk; - - for (curChunk = beginChunk; curChunk < endChunk; ++curChunk) { - if (!this.loadedChunks[curChunk]) { - this.loadedChunks[curChunk] = true; - ++this.numChunksLoaded; - } - } - }, - - onReceiveProgressiveData: - function ChunkedStream_onReceiveProgressiveData(data) { - var position = this.progressiveDataLength; - var beginChunk = Math.floor(position / this.chunkSize); - - this.bytes.set(new Uint8Array(data), position); - position += data.byteLength; - this.progressiveDataLength = position; - var endChunk = position >= this.end ? this.numChunks : - Math.floor(position / this.chunkSize); - var curChunk; - for (curChunk = beginChunk; curChunk < endChunk; ++curChunk) { - if (!this.loadedChunks[curChunk]) { - this.loadedChunks[curChunk] = true; - ++this.numChunksLoaded; - } - } - }, - - ensureByte: function ChunkedStream_ensureByte(pos) { - var chunk = Math.floor(pos / this.chunkSize); - if (chunk === this.lastSuccessfulEnsureByteChunk) { - return; - } - - if (!this.loadedChunks[chunk]) { - throw new MissingDataException(pos, pos + 1); - } - this.lastSuccessfulEnsureByteChunk = chunk; - }, - - ensureRange: function ChunkedStream_ensureRange(begin, end) { - if (begin >= end) { - return; - } - - if (end <= this.progressiveDataLength) { - return; - } - - var chunkSize = this.chunkSize; - var beginChunk = Math.floor(begin / chunkSize); - var endChunk = Math.floor((end - 1) / chunkSize) + 1; - for (var chunk = beginChunk; chunk < endChunk; ++chunk) { - if (!this.loadedChunks[chunk]) { - throw new MissingDataException(begin, end); - } - } - }, - - nextEmptyChunk: function ChunkedStream_nextEmptyChunk(beginChunk) { - var chunk, numChunks = this.numChunks; - for (var i = 0; i < numChunks; ++i) { - chunk = (beginChunk + i) % numChunks; // Wrap around to beginning - if (!this.loadedChunks[chunk]) { - return chunk; - } - } - return null; - }, - - hasChunk: function ChunkedStream_hasChunk(chunk) { - return !!this.loadedChunks[chunk]; - }, - - get length() { - return this.end - this.start; - }, - - get isEmpty() { - return this.length === 0; - }, - - getByte: function ChunkedStream_getByte() { - var pos = this.pos; - if (pos >= this.end) { - return -1; - } - this.ensureByte(pos); - return this.bytes[this.pos++]; - }, - - getUint16: function ChunkedStream_getUint16() { - var b0 = this.getByte(); - var b1 = this.getByte(); - if (b0 === -1 || b1 === -1) { - return -1; - } - return (b0 << 8) + b1; - }, - - getInt32: function ChunkedStream_getInt32() { - var b0 = this.getByte(); - var b1 = this.getByte(); - var b2 = this.getByte(); - var b3 = this.getByte(); - return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; - }, - - // returns subarray of original buffer - // should only be read - getBytes: function ChunkedStream_getBytes(length) { - var bytes = this.bytes; - var pos = this.pos; - var strEnd = this.end; - - if (!length) { - this.ensureRange(pos, strEnd); - return bytes.subarray(pos, strEnd); - } - - var end = pos + length; - if (end > strEnd) { - end = strEnd; - } - this.ensureRange(pos, end); - - this.pos = end; - return bytes.subarray(pos, end); - }, - - peekByte: function ChunkedStream_peekByte() { - var peekedByte = this.getByte(); - this.pos--; - return peekedByte; - }, - - peekBytes: function ChunkedStream_peekBytes(length) { - var bytes = this.getBytes(length); - this.pos -= bytes.length; - return bytes; - }, - - getByteRange: function ChunkedStream_getBytes(begin, end) { - this.ensureRange(begin, end); - return this.bytes.subarray(begin, end); - }, - - skip: function ChunkedStream_skip(n) { - if (!n) { - n = 1; - } - this.pos += n; - }, - - reset: function ChunkedStream_reset() { - this.pos = this.start; - }, - - moveStart: function ChunkedStream_moveStart() { - this.start = this.pos; - }, - - makeSubStream: function ChunkedStream_makeSubStream(start, length, dict) { - this.ensureRange(start, start + length); - - function ChunkedStreamSubstream() {} - ChunkedStreamSubstream.prototype = Object.create(this); - ChunkedStreamSubstream.prototype.getMissingChunks = function() { - var chunkSize = this.chunkSize; - var beginChunk = Math.floor(this.start / chunkSize); - var endChunk = Math.floor((this.end - 1) / chunkSize) + 1; - var missingChunks = []; - for (var chunk = beginChunk; chunk < endChunk; ++chunk) { - if (!this.loadedChunks[chunk]) { - missingChunks.push(chunk); - } - } - return missingChunks; - }; - var subStream = new ChunkedStreamSubstream(); - subStream.pos = subStream.start = start; - subStream.end = start + length || this.end; - subStream.dict = dict; - return subStream; - }, - - isStream: true - }; - - return ChunkedStream; -})(); - -var ChunkedStreamManager = (function ChunkedStreamManagerClosure() { - - function ChunkedStreamManager(length, chunkSize, url, args) { - this.stream = new ChunkedStream(length, chunkSize, this); - this.length = length; - this.chunkSize = chunkSize; - this.url = url; - this.disableAutoFetch = args.disableAutoFetch; - var msgHandler = this.msgHandler = args.msgHandler; - - if (args.chunkedViewerLoading) { - msgHandler.on('OnDataRange', this.onReceiveData.bind(this)); - msgHandler.on('OnDataProgress', this.onProgress.bind(this)); - this.sendRequest = function ChunkedStreamManager_sendRequest(begin, end) { - msgHandler.send('RequestDataRange', { begin: begin, end: end }); - }; - } else { - - var getXhr = function getXhr() { - return new XMLHttpRequest(); - }; - this.networkManager = new NetworkManager(this.url, { - getXhr: getXhr, - httpHeaders: args.httpHeaders, - withCredentials: args.withCredentials - }); - this.sendRequest = function ChunkedStreamManager_sendRequest(begin, end) { - this.networkManager.requestRange(begin, end, { - onDone: this.onReceiveData.bind(this), - onProgress: this.onProgress.bind(this) - }); - }; - } - - this.currRequestId = 0; - - this.chunksNeededByRequest = {}; - this.requestsByChunk = {}; - this.promisesByRequest = {}; - this.progressiveDataLength = 0; - - this._loadedStreamCapability = createPromiseCapability(); - - if (args.initialData) { - this.onReceiveData({chunk: args.initialData}); - } - } - - ChunkedStreamManager.prototype = { - onLoadedStream: function ChunkedStreamManager_getLoadedStream() { - return this._loadedStreamCapability.promise; - }, - - // Get all the chunks that are not yet loaded and groups them into - // contiguous ranges to load in as few requests as possible - requestAllChunks: function ChunkedStreamManager_requestAllChunks() { - var missingChunks = this.stream.getMissingChunks(); - this._requestChunks(missingChunks); - return this._loadedStreamCapability.promise; - }, - - _requestChunks: function ChunkedStreamManager_requestChunks(chunks) { - var requestId = this.currRequestId++; - - var chunksNeeded; - var i, ii; - this.chunksNeededByRequest[requestId] = chunksNeeded = {}; - for (i = 0, ii = chunks.length; i < ii; i++) { - if (!this.stream.hasChunk(chunks[i])) { - chunksNeeded[chunks[i]] = true; - } - } - - if (isEmptyObj(chunksNeeded)) { - return Promise.resolve(); - } - - var capability = createPromiseCapability(); - this.promisesByRequest[requestId] = capability; - - var chunksToRequest = []; - for (var chunk in chunksNeeded) { - chunk = chunk | 0; - if (!(chunk in this.requestsByChunk)) { - this.requestsByChunk[chunk] = []; - chunksToRequest.push(chunk); - } - this.requestsByChunk[chunk].push(requestId); - } - - if (!chunksToRequest.length) { - return capability.promise; - } - - var groupedChunksToRequest = this.groupChunks(chunksToRequest); - - for (i = 0; i < groupedChunksToRequest.length; ++i) { - var groupedChunk = groupedChunksToRequest[i]; - var begin = groupedChunk.beginChunk * this.chunkSize; - var end = Math.min(groupedChunk.endChunk * this.chunkSize, this.length); - this.sendRequest(begin, end); - } - - return capability.promise; - }, - - getStream: function ChunkedStreamManager_getStream() { - return this.stream; - }, - - // Loads any chunks in the requested range that are not yet loaded - requestRange: function ChunkedStreamManager_requestRange(begin, end) { - - end = Math.min(end, this.length); - - var beginChunk = this.getBeginChunk(begin); - var endChunk = this.getEndChunk(end); - - var chunks = []; - for (var chunk = beginChunk; chunk < endChunk; ++chunk) { - chunks.push(chunk); - } - - return this._requestChunks(chunks); - }, - - requestRanges: function ChunkedStreamManager_requestRanges(ranges) { - ranges = ranges || []; - var chunksToRequest = []; - - for (var i = 0; i < ranges.length; i++) { - var beginChunk = this.getBeginChunk(ranges[i].begin); - var endChunk = this.getEndChunk(ranges[i].end); - for (var chunk = beginChunk; chunk < endChunk; ++chunk) { - if (chunksToRequest.indexOf(chunk) < 0) { - chunksToRequest.push(chunk); - } - } - } - - chunksToRequest.sort(function(a, b) { return a - b; }); - return this._requestChunks(chunksToRequest); - }, - - // Groups a sorted array of chunks into as few contiguous larger - // chunks as possible - groupChunks: function ChunkedStreamManager_groupChunks(chunks) { - var groupedChunks = []; - var beginChunk = -1; - var prevChunk = -1; - for (var i = 0; i < chunks.length; ++i) { - var chunk = chunks[i]; - - if (beginChunk < 0) { - beginChunk = chunk; - } - - if (prevChunk >= 0 && prevChunk + 1 !== chunk) { - groupedChunks.push({ beginChunk: beginChunk, - endChunk: prevChunk + 1 }); - beginChunk = chunk; - } - if (i + 1 === chunks.length) { - groupedChunks.push({ beginChunk: beginChunk, - endChunk: chunk + 1 }); - } - - prevChunk = chunk; - } - return groupedChunks; - }, - - onProgress: function ChunkedStreamManager_onProgress(args) { - var bytesLoaded = (this.stream.numChunksLoaded * this.chunkSize + - args.loaded); - this.msgHandler.send('DocProgress', { - loaded: bytesLoaded, - total: this.length - }); - }, - - onReceiveData: function ChunkedStreamManager_onReceiveData(args) { - var chunk = args.chunk; - var isProgressive = args.begin === undefined; - var begin = isProgressive ? this.progressiveDataLength : args.begin; - var end = begin + chunk.byteLength; - - var beginChunk = Math.floor(begin / this.chunkSize); - var endChunk = end < this.length ? Math.floor(end / this.chunkSize) : - Math.ceil(end / this.chunkSize); - - if (isProgressive) { - this.stream.onReceiveProgressiveData(chunk); - this.progressiveDataLength = end; - } else { - this.stream.onReceiveData(begin, chunk); - } - - if (this.stream.allChunksLoaded()) { - this._loadedStreamCapability.resolve(this.stream); - } - - var loadedRequests = []; - var i, requestId; - for (chunk = beginChunk; chunk < endChunk; ++chunk) { - // The server might return more chunks than requested - var requestIds = this.requestsByChunk[chunk] || []; - delete this.requestsByChunk[chunk]; - - for (i = 0; i < requestIds.length; ++i) { - requestId = requestIds[i]; - var chunksNeeded = this.chunksNeededByRequest[requestId]; - if (chunk in chunksNeeded) { - delete chunksNeeded[chunk]; - } - - if (!isEmptyObj(chunksNeeded)) { - continue; - } - - loadedRequests.push(requestId); - } - } - - // If there are no pending requests, automatically fetch the next - // unfetched chunk of the PDF - if (!this.disableAutoFetch && isEmptyObj(this.requestsByChunk)) { - var nextEmptyChunk; - if (this.stream.numChunksLoaded === 1) { - // This is a special optimization so that after fetching the first - // chunk, rather than fetching the second chunk, we fetch the last - // chunk. - var lastChunk = this.stream.numChunks - 1; - if (!this.stream.hasChunk(lastChunk)) { - nextEmptyChunk = lastChunk; - } - } else { - nextEmptyChunk = this.stream.nextEmptyChunk(endChunk); - } - if (isInt(nextEmptyChunk)) { - this._requestChunks([nextEmptyChunk]); - } - } - - for (i = 0; i < loadedRequests.length; ++i) { - requestId = loadedRequests[i]; - var capability = this.promisesByRequest[requestId]; - delete this.promisesByRequest[requestId]; - capability.resolve(); - } - - this.msgHandler.send('DocProgress', { - loaded: this.stream.numChunksLoaded * this.chunkSize, - total: this.length - }); - }, - - onError: function ChunkedStreamManager_onError(err) { - this._loadedStreamCapability.reject(err); - }, - - getBeginChunk: function ChunkedStreamManager_getBeginChunk(begin) { - var chunk = Math.floor(begin / this.chunkSize); - return chunk; - }, - - getEndChunk: function ChunkedStreamManager_getEndChunk(end) { - var chunk = Math.floor((end - 1) / this.chunkSize) + 1; - return chunk; - }, - - abort: function ChunkedStreamManager_abort() { - if (this.networkManager) { - this.networkManager.abortAllRequests(); - } - for(var requestId in this.promisesByRequest) { - var capability = this.promisesByRequest[requestId]; - capability.reject(new Error('Request was aborted')); - } - } - }; - - return ChunkedStreamManager; -})(); - - -var BasePdfManager = (function BasePdfManagerClosure() { - function BasePdfManager() { - throw new Error('Cannot initialize BaseManagerManager'); - } - - BasePdfManager.prototype = { - get docId() { - return this._docId; - }, - - onLoadedStream: function BasePdfManager_onLoadedStream() { - throw new NotImplementedException(); - }, - - ensureDoc: function BasePdfManager_ensureDoc(prop, args) { - return this.ensure(this.pdfDocument, prop, args); - }, - - ensureXRef: function BasePdfManager_ensureXRef(prop, args) { - return this.ensure(this.pdfDocument.xref, prop, args); - }, - - ensureCatalog: function BasePdfManager_ensureCatalog(prop, args) { - return this.ensure(this.pdfDocument.catalog, prop, args); - }, - - getPage: function BasePdfManager_getPage(pageIndex) { - return this.pdfDocument.getPage(pageIndex); - }, - - cleanup: function BasePdfManager_cleanup() { - return this.pdfDocument.cleanup(); - }, - - ensure: function BasePdfManager_ensure(obj, prop, args) { - return new NotImplementedException(); - }, - - requestRange: function BasePdfManager_requestRange(begin, end) { - return new NotImplementedException(); - }, - - requestLoadedStream: function BasePdfManager_requestLoadedStream() { - return new NotImplementedException(); - }, - - sendProgressiveData: function BasePdfManager_sendProgressiveData(chunk) { - return new NotImplementedException(); - }, - - updatePassword: function BasePdfManager_updatePassword(password) { - this.pdfDocument.xref.password = this.password = password; - if (this._passwordChangedCapability) { - this._passwordChangedCapability.resolve(); - } - }, - - passwordChanged: function BasePdfManager_passwordChanged() { - this._passwordChangedCapability = createPromiseCapability(); - return this._passwordChangedCapability.promise; - }, - - terminate: function BasePdfManager_terminate() { - return new NotImplementedException(); - } - }; - - return BasePdfManager; -})(); - -var LocalPdfManager = (function LocalPdfManagerClosure() { - function LocalPdfManager(docId, data, password) { - this._docId = docId; - var stream = new Stream(data); - this.pdfDocument = new PDFDocument(this, stream, password); - this._loadedStreamCapability = createPromiseCapability(); - this._loadedStreamCapability.resolve(stream); - } - - Util.inherit(LocalPdfManager, BasePdfManager, { - ensure: function LocalPdfManager_ensure(obj, prop, args) { - return new Promise(function (resolve, reject) { - try { - var value = obj[prop]; - var result; - if (typeof value === 'function') { - result = value.apply(obj, args); - } else { - result = value; - } - resolve(result); - } catch (e) { - reject(e); - } - }); - }, - - requestRange: function LocalPdfManager_requestRange(begin, end) { - return Promise.resolve(); - }, - - requestLoadedStream: function LocalPdfManager_requestLoadedStream() { - return; - }, - - onLoadedStream: function LocalPdfManager_onLoadedStream() { - return this._loadedStreamCapability.promise; - }, - - terminate: function LocalPdfManager_terminate() { - return; - } - }); - - return LocalPdfManager; -})(); - -var NetworkPdfManager = (function NetworkPdfManagerClosure() { - function NetworkPdfManager(docId, args, msgHandler) { - this._docId = docId; - this.msgHandler = msgHandler; - - var params = { - msgHandler: msgHandler, - httpHeaders: args.httpHeaders, - withCredentials: args.withCredentials, - chunkedViewerLoading: args.chunkedViewerLoading, - disableAutoFetch: args.disableAutoFetch, - initialData: args.initialData - }; - this.streamManager = new ChunkedStreamManager(args.length, - args.rangeChunkSize, - args.url, params); - this.pdfDocument = new PDFDocument(this, this.streamManager.getStream(), - args.password); - } - - Util.inherit(NetworkPdfManager, BasePdfManager, { - ensure: function NetworkPdfManager_ensure(obj, prop, args) { - var pdfManager = this; - - return new Promise(function (resolve, reject) { - function ensureHelper() { - try { - var result; - var value = obj[prop]; - if (typeof value === 'function') { - result = value.apply(obj, args); - } else { - result = value; - } - resolve(result); - } catch(e) { - if (!(e instanceof MissingDataException)) { - reject(e); - return; - } - pdfManager.streamManager.requestRange(e.begin, e.end). - then(ensureHelper, reject); - } - } - - ensureHelper(); - }); - }, - - requestRange: function NetworkPdfManager_requestRange(begin, end) { - return this.streamManager.requestRange(begin, end); - }, - - requestLoadedStream: function NetworkPdfManager_requestLoadedStream() { - this.streamManager.requestAllChunks(); - }, - - sendProgressiveData: - function NetworkPdfManager_sendProgressiveData(chunk) { - this.streamManager.onReceiveData({ chunk: chunk }); - }, - - onLoadedStream: function NetworkPdfManager_onLoadedStream() { - return this.streamManager.onLoadedStream(); - }, - - terminate: function NetworkPdfManager_terminate() { - this.streamManager.abort(); - } - }); - - return NetworkPdfManager; -})(); - - -var Page = (function PageClosure() { - - var LETTER_SIZE_MEDIABOX = [0, 0, 612, 792]; - - function Page(pdfManager, xref, pageIndex, pageDict, ref, fontCache) { - this.pdfManager = pdfManager; - this.pageIndex = pageIndex; - this.pageDict = pageDict; - this.xref = xref; - this.ref = ref; - this.fontCache = fontCache; - this.idCounters = { - obj: 0 - }; - this.resourcesPromise = null; - } - - Page.prototype = { - getPageProp: function Page_getPageProp(key) { - return this.pageDict.get(key); - }, - - getInheritedPageProp: function Page_getInheritedPageProp(key) { - var dict = this.pageDict, valueArray = null, loopCount = 0; - var MAX_LOOP_COUNT = 100; - // Always walk up the entire parent chain, to be able to find - // e.g. \Resources placed on multiple levels of the tree. - while (dict) { - var value = dict.get(key); - if (value) { - if (!valueArray) { - valueArray = []; - } - valueArray.push(value); - } - if (++loopCount > MAX_LOOP_COUNT) { - warn('Page_getInheritedPageProp: maximum loop count exceeded.'); - break; - } - dict = dict.get('Parent'); - } - if (!valueArray) { - return Dict.empty; - } - if (valueArray.length === 1 || !isDict(valueArray[0]) || - loopCount > MAX_LOOP_COUNT) { - return valueArray[0]; - } - return Dict.merge(this.xref, valueArray); - }, - - get content() { - return this.getPageProp('Contents'); - }, - - get resources() { - // For robustness: The spec states that a \Resources entry has to be - // present, but can be empty. Some document omit it still, in this case - // we return an empty dictionary. - return shadow(this, 'resources', this.getInheritedPageProp('Resources')); - }, - - get mediaBox() { - var obj = this.getInheritedPageProp('MediaBox'); - // Reset invalid media box to letter size. - if (!isArray(obj) || obj.length !== 4) { - obj = LETTER_SIZE_MEDIABOX; - } - return shadow(this, 'mediaBox', obj); - }, - - get view() { - var mediaBox = this.mediaBox; - var cropBox = this.getInheritedPageProp('CropBox'); - if (!isArray(cropBox) || cropBox.length !== 4) { - return shadow(this, 'view', mediaBox); - } - - // From the spec, 6th ed., p.963: - // "The crop, bleed, trim, and art boxes should not ordinarily - // extend beyond the boundaries of the media box. If they do, they are - // effectively reduced to their intersection with the media box." - cropBox = Util.intersect(cropBox, mediaBox); - if (!cropBox) { - return shadow(this, 'view', mediaBox); - } - return shadow(this, 'view', cropBox); - }, - - get rotate() { - var rotate = this.getInheritedPageProp('Rotate') || 0; - // Normalize rotation so it's a multiple of 90 and between 0 and 270 - if (rotate % 90 !== 0) { - rotate = 0; - } else if (rotate >= 360) { - rotate = rotate % 360; - } else if (rotate < 0) { - // The spec doesn't cover negatives, assume its counterclockwise - // rotation. The following is the other implementation of modulo. - rotate = ((rotate % 360) + 360) % 360; - } - return shadow(this, 'rotate', rotate); - }, - - getContentStream: function Page_getContentStream() { - var content = this.content; - var stream; - if (isArray(content)) { - // fetching items - var xref = this.xref; - var i, n = content.length; - var streams = []; - for (i = 0; i < n; ++i) { - streams.push(xref.fetchIfRef(content[i])); - } - stream = new StreamsSequenceStream(streams); - } else if (isStream(content)) { - stream = content; - } else { - // replacing non-existent page content with empty one - stream = new NullStream(); - } - return stream; - }, - - loadResources: function Page_loadResources(keys) { - if (!this.resourcesPromise) { - // TODO: add async getInheritedPageProp and remove this. - this.resourcesPromise = this.pdfManager.ensure(this, 'resources'); - } - return this.resourcesPromise.then(function resourceSuccess() { - var objectLoader = new ObjectLoader(this.resources.map, - keys, - this.xref); - return objectLoader.load(); - }.bind(this)); - }, - - getOperatorList: function Page_getOperatorList(handler, task, intent) { - var self = this; - - var pdfManager = this.pdfManager; - var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', - []); - var resourcesPromise = this.loadResources([ - 'ExtGState', - 'ColorSpace', - 'Pattern', - 'Shading', - 'XObject', - 'Font' - // ProcSet - // Properties - ]); - - var partialEvaluator = new PartialEvaluator(pdfManager, this.xref, - handler, this.pageIndex, - 'p' + this.pageIndex + '_', - this.idCounters, - this.fontCache); - - var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]); - var pageListPromise = dataPromises.then(function(data) { - var contentStream = data[0]; - var opList = new OperatorList(intent, handler, self.pageIndex); - - handler.send('StartRenderPage', { - transparency: partialEvaluator.hasBlendModes(self.resources), - pageIndex: self.pageIndex, - intent: intent - }); - return partialEvaluator.getOperatorList(contentStream, task, - self.resources, opList).then(function () { - return opList; - }); - }); - - var annotationsPromise = pdfManager.ensure(this, 'annotations'); - return Promise.all([pageListPromise, annotationsPromise]).then( - function(datas) { - var pageOpList = datas[0]; - var annotations = datas[1]; - - if (annotations.length === 0) { - pageOpList.flush(true); - return pageOpList; - } - - var annotationsReadyPromise = Annotation.appendToOperatorList( - annotations, pageOpList, partialEvaluator, task, intent); - return annotationsReadyPromise.then(function () { - pageOpList.flush(true); - return pageOpList; - }); - }); - }, - - extractTextContent: function Page_extractTextContent(task, - normalizeWhitespace) { - var handler = { - on: function nullHandlerOn() {}, - send: function nullHandlerSend() {} - }; - - var self = this; - - var pdfManager = this.pdfManager; - var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', - []); - - var resourcesPromise = this.loadResources([ - 'ExtGState', - 'XObject', - 'Font' - ]); - - var dataPromises = Promise.all([contentStreamPromise, - resourcesPromise]); - return dataPromises.then(function(data) { - var contentStream = data[0]; - var partialEvaluator = new PartialEvaluator(pdfManager, self.xref, - handler, self.pageIndex, - 'p' + self.pageIndex + '_', - self.idCounters, - self.fontCache); - - return partialEvaluator.getTextContent(contentStream, - task, - self.resources, - /* stateManager = */ null, - normalizeWhitespace); - }); - }, - - getAnnotationsData: function Page_getAnnotationsData(intent) { - var annotations = this.annotations; - var annotationsData = []; - for (var i = 0, n = annotations.length; i < n; ++i) { - if (intent) { - if (!(intent === 'display' && annotations[i].viewable) && - !(intent === 'print' && annotations[i].printable)) { - continue; - } - } - annotationsData.push(annotations[i].data); - } - return annotationsData; - }, - - get annotations() { - var annotations = []; - var annotationRefs = this.getInheritedPageProp('Annots') || []; - var annotationFactory = new AnnotationFactory(); - for (var i = 0, n = annotationRefs.length; i < n; ++i) { - var annotationRef = annotationRefs[i]; - var annotation = annotationFactory.create(this.xref, annotationRef); - if (annotation) { - annotations.push(annotation); - } - } - return shadow(this, 'annotations', annotations); - } - }; - - return Page; -})(); - -/** - * The `PDFDocument` holds all the data of the PDF file. Compared to the - * `PDFDoc`, this one doesn't have any job management code. - * Right now there exists one PDFDocument on the main thread + one object - * for each worker. If there is no worker support enabled, there are two - * `PDFDocument` objects on the main thread created. - */ -var PDFDocument = (function PDFDocumentClosure() { - var FINGERPRINT_FIRST_BYTES = 1024; - var EMPTY_FINGERPRINT = '\x00\x00\x00\x00\x00\x00\x00' + - '\x00\x00\x00\x00\x00\x00\x00\x00\x00'; - - function PDFDocument(pdfManager, arg, password) { - if (isStream(arg)) { - init.call(this, pdfManager, arg, password); - } else if (isArrayBuffer(arg)) { - init.call(this, pdfManager, new Stream(arg), password); - } else { - error('PDFDocument: Unknown argument type'); - } - } - - function init(pdfManager, stream, password) { - assert(stream.length > 0, 'stream must have data'); - this.pdfManager = pdfManager; - this.stream = stream; - var xref = new XRef(this.stream, password, pdfManager); - this.xref = xref; - } - - function find(stream, needle, limit, backwards) { - var pos = stream.pos; - var end = stream.end; - var strBuf = []; - if (pos + limit > end) { - limit = end - pos; - } - for (var n = 0; n < limit; ++n) { - strBuf.push(String.fromCharCode(stream.getByte())); - } - var str = strBuf.join(''); - stream.pos = pos; - var index = backwards ? str.lastIndexOf(needle) : str.indexOf(needle); - if (index === -1) { - return false; /* not found */ - } - stream.pos += index; - return true; /* found */ - } - - var DocumentInfoValidators = { - get entries() { - // Lazily build this since all the validation functions below are not - // defined until after this file loads. - return shadow(this, 'entries', { - Title: isString, - Author: isString, - Subject: isString, - Keywords: isString, - Creator: isString, - Producer: isString, - CreationDate: isString, - ModDate: isString, - Trapped: isName - }); - } - }; - - PDFDocument.prototype = { - parse: function PDFDocument_parse(recoveryMode) { - this.setup(recoveryMode); - var version = this.catalog.catDict.get('Version'); - if (isName(version)) { - this.pdfFormatVersion = version.name; - } - try { - // checking if AcroForm is present - this.acroForm = this.catalog.catDict.get('AcroForm'); - if (this.acroForm) { - this.xfa = this.acroForm.get('XFA'); - var fields = this.acroForm.get('Fields'); - if ((!fields || !isArray(fields) || fields.length === 0) && - !this.xfa) { - // no fields and no XFA -- not a form (?) - this.acroForm = null; - } - } - } catch (ex) { - info('Something wrong with AcroForm entry'); - this.acroForm = null; - } - }, - - get linearization() { - var linearization = null; - if (this.stream.length) { - try { - linearization = Linearization.create(this.stream); - } catch (err) { - if (err instanceof MissingDataException) { - throw err; - } - info(err); - } - } - // shadow the prototype getter with a data property - return shadow(this, 'linearization', linearization); - }, - get startXRef() { - var stream = this.stream; - var startXRef = 0; - var linearization = this.linearization; - if (linearization) { - // Find end of first obj. - stream.reset(); - if (find(stream, 'endobj', 1024)) { - startXRef = stream.pos + 6; - } - } else { - // Find startxref by jumping backward from the end of the file. - var step = 1024; - var found = false, pos = stream.end; - while (!found && pos > 0) { - pos -= step - 'startxref'.length; - if (pos < 0) { - pos = 0; - } - stream.pos = pos; - found = find(stream, 'startxref', step, true); - } - if (found) { - stream.skip(9); - var ch; - do { - ch = stream.getByte(); - } while (Lexer.isSpace(ch)); - var str = ''; - while (ch >= 0x20 && ch <= 0x39) { // < '9' - str += String.fromCharCode(ch); - ch = stream.getByte(); - } - startXRef = parseInt(str, 10); - if (isNaN(startXRef)) { - startXRef = 0; - } - } - } - // shadow the prototype getter with a data property - return shadow(this, 'startXRef', startXRef); - }, - get mainXRefEntriesOffset() { - var mainXRefEntriesOffset = 0; - var linearization = this.linearization; - if (linearization) { - mainXRefEntriesOffset = linearization.mainXRefEntriesOffset; - } - // shadow the prototype getter with a data property - return shadow(this, 'mainXRefEntriesOffset', mainXRefEntriesOffset); - }, - // Find the header, remove leading garbage and setup the stream - // starting from the header. - checkHeader: function PDFDocument_checkHeader() { - var stream = this.stream; - stream.reset(); - if (find(stream, '%PDF-', 1024)) { - // Found the header, trim off any garbage before it. - stream.moveStart(); - // Reading file format version - var MAX_VERSION_LENGTH = 12; - var version = '', ch; - while ((ch = stream.getByte()) > 0x20) { // SPACE - if (version.length >= MAX_VERSION_LENGTH) { - break; - } - version += String.fromCharCode(ch); - } - if (!this.pdfFormatVersion) { - // removing "%PDF-"-prefix - this.pdfFormatVersion = version.substring(5); - } - return; - } - // May not be a PDF file, continue anyway. - }, - parseStartXRef: function PDFDocument_parseStartXRef() { - var startXRef = this.startXRef; - this.xref.setStartXRef(startXRef); - }, - setup: function PDFDocument_setup(recoveryMode) { - this.xref.parse(recoveryMode); - this.catalog = new Catalog(this.pdfManager, this.xref); - }, - get numPages() { - var linearization = this.linearization; - var num = linearization ? linearization.numPages : this.catalog.numPages; - // shadow the prototype getter - return shadow(this, 'numPages', num); - }, - get documentInfo() { - var docInfo = { - PDFFormatVersion: this.pdfFormatVersion, - IsAcroFormPresent: !!this.acroForm, - IsXFAPresent: !!this.xfa - }; - var infoDict; - try { - infoDict = this.xref.trailer.get('Info'); - } catch (err) { - info('The document information dictionary is invalid.'); - } - if (infoDict) { - var validEntries = DocumentInfoValidators.entries; - // Only fill the document info with valid entries from the spec. - for (var key in validEntries) { - if (infoDict.has(key)) { - var value = infoDict.get(key); - // Make sure the value conforms to the spec. - if (validEntries[key](value)) { - docInfo[key] = (typeof value !== 'string' ? - value : stringToPDFString(value)); - } else { - info('Bad value in document info for "' + key + '"'); - } - } - } - } - return shadow(this, 'documentInfo', docInfo); - }, - get fingerprint() { - var xref = this.xref, hash, fileID = ''; - var idArray = xref.trailer.get('ID'); - - if (idArray && isArray(idArray) && idArray[0] && isString(idArray[0]) && - idArray[0] !== EMPTY_FINGERPRINT) { - hash = stringToBytes(idArray[0]); - } else { - if (this.stream.ensureRange) { - this.stream.ensureRange(0, - Math.min(FINGERPRINT_FIRST_BYTES, this.stream.end)); - } - hash = calculateMD5(this.stream.bytes.subarray(0, - FINGERPRINT_FIRST_BYTES), 0, FINGERPRINT_FIRST_BYTES); - } - - for (var i = 0, n = hash.length; i < n; i++) { - var hex = hash[i].toString(16); - fileID += hex.length === 1 ? '0' + hex : hex; - } - - return shadow(this, 'fingerprint', fileID); - }, - - getPage: function PDFDocument_getPage(pageIndex) { - return this.catalog.getPage(pageIndex); - }, - - cleanup: function PDFDocument_cleanup() { - return this.catalog.cleanup(); - } - }; - - return PDFDocument; -})(); - - -var Name = (function NameClosure() { - function Name(name) { - this.name = name; - } - - Name.prototype = {}; - - var nameCache = {}; - - Name.get = function Name_get(name) { - var nameValue = nameCache[name]; - return (nameValue ? nameValue : (nameCache[name] = new Name(name))); - }; - - return Name; -})(); - -var Cmd = (function CmdClosure() { - function Cmd(cmd) { - this.cmd = cmd; - } - - Cmd.prototype = {}; - - var cmdCache = {}; - - Cmd.get = function Cmd_get(cmd) { - var cmdValue = cmdCache[cmd]; - return (cmdValue ? cmdValue : (cmdCache[cmd] = new Cmd(cmd))); - }; - - return Cmd; -})(); - -var Dict = (function DictClosure() { - var nonSerializable = function nonSerializableClosure() { - return nonSerializable; // creating closure on some variable - }; - - var GETALL_DICTIONARY_TYPES_WHITELIST = { - 'Background': true, - 'ExtGState': true, - 'Halftone': true, - 'Layout': true, - 'Mask': true, - 'Pagination': true, - 'Printing': true - }; - - function isRecursionAllowedFor(dict) { - if (!isName(dict.Type)) { - return true; - } - var dictType = dict.Type.name; - return GETALL_DICTIONARY_TYPES_WHITELIST[dictType] === true; - } - - // xref is optional - function Dict(xref) { - // Map should only be used internally, use functions below to access. - this.map = Object.create(null); - this.xref = xref; - this.objId = null; - this.__nonSerializable__ = nonSerializable; // disable cloning of the Dict - } - - Dict.prototype = { - assignXref: function Dict_assignXref(newXref) { - this.xref = newXref; - }, - - // automatically dereferences Ref objects - get: function Dict_get(key1, key2, key3) { - var value; - var xref = this.xref; - if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map || - typeof key2 === 'undefined') { - return xref ? xref.fetchIfRef(value) : value; - } - if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map || - typeof key3 === 'undefined') { - return xref ? xref.fetchIfRef(value) : value; - } - value = this.map[key3] || null; - return xref ? xref.fetchIfRef(value) : value; - }, - - // Same as get(), but returns a promise and uses fetchIfRefAsync(). - getAsync: function Dict_getAsync(key1, key2, key3) { - var value; - var xref = this.xref; - if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map || - typeof key2 === 'undefined') { - if (xref) { - return xref.fetchIfRefAsync(value); - } - return Promise.resolve(value); - } - if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map || - typeof key3 === 'undefined') { - if (xref) { - return xref.fetchIfRefAsync(value); - } - return Promise.resolve(value); - } - value = this.map[key3] || null; - if (xref) { - return xref.fetchIfRefAsync(value); - } - return Promise.resolve(value); - }, - - // Same as get(), but dereferences all elements if the result is an Array. - getArray: function Dict_getArray(key1, key2, key3) { - var value = this.get(key1, key2, key3); - var xref = this.xref; - if (!isArray(value) || !xref) { - return value; - } - value = value.slice(); // Ensure that we don't modify the Dict data. - for (var i = 0, ii = value.length; i < ii; i++) { - if (!isRef(value[i])) { - continue; - } - value[i] = xref.fetch(value[i]); - } - return value; - }, - - // no dereferencing - getRaw: function Dict_getRaw(key) { - return this.map[key]; - }, - - // creates new map and dereferences all Refs - getAll: function Dict_getAll() { - var all = Object.create(null); - var queue = null; - var key, obj; - for (key in this.map) { - obj = this.get(key); - if (obj instanceof Dict) { - if (isRecursionAllowedFor(obj)) { - (queue || (queue = [])).push({target: all, key: key, obj: obj}); - } else { - all[key] = this.getRaw(key); - } - } else { - all[key] = obj; - } - } - if (!queue) { - return all; - } - - // trying to take cyclic references into the account - var processed = Object.create(null); - while (queue.length > 0) { - var item = queue.shift(); - var itemObj = item.obj; - var objId = itemObj.objId; - if (objId && objId in processed) { - item.target[item.key] = processed[objId]; - continue; - } - var dereferenced = Object.create(null); - for (key in itemObj.map) { - obj = itemObj.get(key); - if (obj instanceof Dict) { - if (isRecursionAllowedFor(obj)) { - queue.push({target: dereferenced, key: key, obj: obj}); - } else { - dereferenced[key] = itemObj.getRaw(key); - } - } else { - dereferenced[key] = obj; - } - } - if (objId) { - processed[objId] = dereferenced; - } - item.target[item.key] = dereferenced; - } - return all; - }, - - getKeys: function Dict_getKeys() { - return Object.keys(this.map); - }, - - set: function Dict_set(key, value) { - this.map[key] = value; - }, - - has: function Dict_has(key) { - return key in this.map; - }, - - forEach: function Dict_forEach(callback) { - for (var key in this.map) { - callback(key, this.get(key)); - } - } - }; - - Dict.empty = new Dict(null); - - Dict.merge = function Dict_merge(xref, dictArray) { - var mergedDict = new Dict(xref); - - for (var i = 0, ii = dictArray.length; i < ii; i++) { - var dict = dictArray[i]; - if (!isDict(dict)) { - continue; - } - for (var keyName in dict.map) { - if (mergedDict.map[keyName]) { - continue; - } - mergedDict.map[keyName] = dict.map[keyName]; - } - } - return mergedDict; - }; - - return Dict; -})(); - -var Ref = (function RefClosure() { - function Ref(num, gen) { - this.num = num; - this.gen = gen; - } - - Ref.prototype = { - toString: function Ref_toString() { - // This function is hot, so we make the string as compact as possible. - // |this.gen| is almost always zero, so we treat that case specially. - var str = this.num + 'R'; - if (this.gen !== 0) { - str += this.gen; - } - return str; - } - }; - - return Ref; -})(); - -// The reference is identified by number and generation. -// This structure stores only one instance of the reference. -var RefSet = (function RefSetClosure() { - function RefSet() { - this.dict = {}; - } - - RefSet.prototype = { - has: function RefSet_has(ref) { - return ref.toString() in this.dict; - }, - - put: function RefSet_put(ref) { - this.dict[ref.toString()] = true; - }, - - remove: function RefSet_remove(ref) { - delete this.dict[ref.toString()]; - } - }; - - return RefSet; -})(); - -var RefSetCache = (function RefSetCacheClosure() { - function RefSetCache() { - this.dict = Object.create(null); - } - - RefSetCache.prototype = { - get: function RefSetCache_get(ref) { - return this.dict[ref.toString()]; - }, - - has: function RefSetCache_has(ref) { - return ref.toString() in this.dict; - }, - - put: function RefSetCache_put(ref, obj) { - this.dict[ref.toString()] = obj; - }, - - putAlias: function RefSetCache_putAlias(ref, aliasRef) { - this.dict[ref.toString()] = this.get(aliasRef); - }, - - forEach: function RefSetCache_forEach(fn, thisArg) { - for (var i in this.dict) { - fn.call(thisArg, this.dict[i]); - } - }, - - clear: function RefSetCache_clear() { - this.dict = Object.create(null); - } - }; - - return RefSetCache; -})(); - -var Catalog = (function CatalogClosure() { - function Catalog(pdfManager, xref) { - this.pdfManager = pdfManager; - this.xref = xref; - this.catDict = xref.getCatalogObj(); - this.fontCache = new RefSetCache(); - assert(isDict(this.catDict), - 'catalog object is not a dictionary'); - - this.pagePromises = []; - } - - Catalog.prototype = { - get metadata() { - var streamRef = this.catDict.getRaw('Metadata'); - if (!isRef(streamRef)) { - return shadow(this, 'metadata', null); - } - - var encryptMetadata = (!this.xref.encrypt ? false : - this.xref.encrypt.encryptMetadata); - - var stream = this.xref.fetch(streamRef, !encryptMetadata); - var metadata; - if (stream && isDict(stream.dict)) { - var type = stream.dict.get('Type'); - var subtype = stream.dict.get('Subtype'); - - if (isName(type) && isName(subtype) && - type.name === 'Metadata' && subtype.name === 'XML') { - // XXX: This should examine the charset the XML document defines, - // however since there are currently no real means to decode - // arbitrary charsets, let's just hope that the author of the PDF - // was reasonable enough to stick with the XML default charset, - // which is UTF-8. - try { - metadata = stringToUTF8String(bytesToString(stream.getBytes())); - } catch (e) { - info('Skipping invalid metadata.'); - } - } - } - - return shadow(this, 'metadata', metadata); - }, - get toplevelPagesDict() { - var pagesObj = this.catDict.get('Pages'); - assert(isDict(pagesObj), 'invalid top-level pages dictionary'); - // shadow the prototype getter - return shadow(this, 'toplevelPagesDict', pagesObj); - }, - get documentOutline() { - var obj = null; - try { - obj = this.readDocumentOutline(); - } catch (ex) { - if (ex instanceof MissingDataException) { - throw ex; - } - warn('Unable to read document outline'); - } - return shadow(this, 'documentOutline', obj); - }, - readDocumentOutline: function Catalog_readDocumentOutline() { - var xref = this.xref; - var obj = this.catDict.get('Outlines'); - var root = { items: [] }; - if (isDict(obj)) { - obj = obj.getRaw('First'); - var processed = new RefSet(); - if (isRef(obj)) { - var queue = [{obj: obj, parent: root}]; - // to avoid recursion keeping track of the items - // in the processed dictionary - processed.put(obj); - while (queue.length > 0) { - var i = queue.shift(); - var outlineDict = xref.fetchIfRef(i.obj); - if (outlineDict === null) { - continue; - } - if (!outlineDict.has('Title')) { - error('Invalid outline item'); - } - var dest = outlineDict.get('A'); - if (dest) { - dest = dest.get('D'); - } else if (outlineDict.has('Dest')) { - dest = outlineDict.getRaw('Dest'); - if (isName(dest)) { - dest = dest.name; - } - } - var title = outlineDict.get('Title'); - var outlineItem = { - dest: dest, - title: stringToPDFString(title), - color: outlineDict.get('C') || [0, 0, 0], - count: outlineDict.get('Count'), - bold: !!(outlineDict.get('F') & 2), - italic: !!(outlineDict.get('F') & 1), - items: [] - }; - i.parent.items.push(outlineItem); - obj = outlineDict.getRaw('First'); - if (isRef(obj) && !processed.has(obj)) { - queue.push({obj: obj, parent: outlineItem}); - processed.put(obj); - } - obj = outlineDict.getRaw('Next'); - if (isRef(obj) && !processed.has(obj)) { - queue.push({obj: obj, parent: i.parent}); - processed.put(obj); - } - } - } - } - return (root.items.length > 0 ? root.items : null); - }, - get numPages() { - var obj = this.toplevelPagesDict.get('Count'); - assert( - isInt(obj), - 'page count in top level pages object is not an integer' - ); - // shadow the prototype getter - return shadow(this, 'num', obj); - }, - get destinations() { - function fetchDestination(dest) { - return isDict(dest) ? dest.get('D') : dest; - } - - var xref = this.xref; - var dests = {}, nameTreeRef, nameDictionaryRef; - var obj = this.catDict.get('Names'); - if (obj && obj.has('Dests')) { - nameTreeRef = obj.getRaw('Dests'); - } else if (this.catDict.has('Dests')) { - nameDictionaryRef = this.catDict.get('Dests'); - } - - if (nameDictionaryRef) { - // reading simple destination dictionary - obj = nameDictionaryRef; - obj.forEach(function catalogForEach(key, value) { - if (!value) { - return; - } - dests[key] = fetchDestination(value); - }); - } - if (nameTreeRef) { - var nameTree = new NameTree(nameTreeRef, xref); - var names = nameTree.getAll(); - for (var name in names) { - if (!names.hasOwnProperty(name)) { - continue; - } - dests[name] = fetchDestination(names[name]); - } - } - return shadow(this, 'destinations', dests); - }, - getDestination: function Catalog_getDestination(destinationId) { - function fetchDestination(dest) { - return isDict(dest) ? dest.get('D') : dest; - } - - var xref = this.xref; - var dest = null, nameTreeRef, nameDictionaryRef; - var obj = this.catDict.get('Names'); - if (obj && obj.has('Dests')) { - nameTreeRef = obj.getRaw('Dests'); - } else if (this.catDict.has('Dests')) { - nameDictionaryRef = this.catDict.get('Dests'); - } - - if (nameDictionaryRef) { // Simple destination dictionary. - var value = nameDictionaryRef.get(destinationId); - if (value) { - dest = fetchDestination(value); - } - } - if (nameTreeRef) { - var nameTree = new NameTree(nameTreeRef, xref); - dest = fetchDestination(nameTree.get(destinationId)); - } - return dest; - }, - get attachments() { - var xref = this.xref; - var attachments = null, nameTreeRef; - var obj = this.catDict.get('Names'); - if (obj) { - nameTreeRef = obj.getRaw('EmbeddedFiles'); - } - - if (nameTreeRef) { - var nameTree = new NameTree(nameTreeRef, xref); - var names = nameTree.getAll(); - for (var name in names) { - if (!names.hasOwnProperty(name)) { - continue; - } - var fs = new FileSpec(names[name], xref); - if (!attachments) { - attachments = {}; - } - attachments[stringToPDFString(name)] = fs.serializable; - } - } - return shadow(this, 'attachments', attachments); - }, - get javaScript() { - var xref = this.xref; - var obj = this.catDict.get('Names'); - - var javaScript = []; - function appendIfJavaScriptDict(jsDict) { - var type = jsDict.get('S'); - if (!isName(type) || type.name !== 'JavaScript') { - return; - } - var js = jsDict.get('JS'); - if (isStream(js)) { - js = bytesToString(js.getBytes()); - } else if (!isString(js)) { - return; - } - javaScript.push(stringToPDFString(js)); - } - if (obj && obj.has('JavaScript')) { - var nameTree = new NameTree(obj.getRaw('JavaScript'), xref); - var names = nameTree.getAll(); - for (var name in names) { - if (!names.hasOwnProperty(name)) { - continue; - } - // We don't really use the JavaScript right now. This code is - // defensive so we don't cause errors on document load. - var jsDict = names[name]; - if (isDict(jsDict)) { - appendIfJavaScriptDict(jsDict); - } - } - } - - // Append OpenAction actions to javaScript array - var openactionDict = this.catDict.get('OpenAction'); - if (isDict(openactionDict, 'Action')) { - var actionType = openactionDict.get('S'); - if (isName(actionType) && actionType.name === 'Named') { - // The named Print action is not a part of the PDF 1.7 specification, - // but is supported by many PDF readers/writers (including Adobe's). - var action = openactionDict.get('N'); - if (isName(action) && action.name === 'Print') { - javaScript.push('print({});'); - } - } else { - appendIfJavaScriptDict(openactionDict); - } - } - - return shadow(this, 'javaScript', javaScript); - }, - - cleanup: function Catalog_cleanup() { - var promises = []; - this.fontCache.forEach(function (promise) { - promises.push(promise); - }); - return Promise.all(promises).then(function (translatedFonts) { - for (var i = 0, ii = translatedFonts.length; i < ii; i++) { - var font = translatedFonts[i].dict; - delete font.translated; - } - this.fontCache.clear(); - }.bind(this)); - }, - - getPage: function Catalog_getPage(pageIndex) { - if (!(pageIndex in this.pagePromises)) { - this.pagePromises[pageIndex] = this.getPageDict(pageIndex).then( - function (a) { - var dict = a[0]; - var ref = a[1]; - return new Page(this.pdfManager, this.xref, pageIndex, dict, ref, - this.fontCache); - }.bind(this) - ); - } - return this.pagePromises[pageIndex]; - }, - - getPageDict: function Catalog_getPageDict(pageIndex) { - var capability = createPromiseCapability(); - var nodesToVisit = [this.catDict.getRaw('Pages')]; - var currentPageIndex = 0; - var xref = this.xref; - var checkAllKids = false; - - function next() { - while (nodesToVisit.length) { - var currentNode = nodesToVisit.pop(); - - if (isRef(currentNode)) { - xref.fetchAsync(currentNode).then(function (obj) { - if (isDict(obj, 'Page') || (isDict(obj) && !obj.has('Kids'))) { - if (pageIndex === currentPageIndex) { - capability.resolve([obj, currentNode]); - } else { - currentPageIndex++; - next(); - } - return; - } - nodesToVisit.push(obj); - next(); - }, capability.reject); - return; - } - - // Must be a child page dictionary. - assert( - isDict(currentNode), - 'page dictionary kid reference points to wrong type of object' - ); - var count = currentNode.get('Count'); - // If the current node doesn't have any children, avoid getting stuck - // in an empty node further down in the tree (see issue5644.pdf). - if (count === 0) { - checkAllKids = true; - } - // Skip nodes where the page can't be. - if (currentPageIndex + count <= pageIndex) { - currentPageIndex += count; - continue; - } - - var kids = currentNode.get('Kids'); - assert(isArray(kids), 'page dictionary kids object is not an array'); - if (!checkAllKids && count === kids.length) { - // Nodes that don't have the page have been skipped and this is the - // bottom of the tree which means the page requested must be a - // descendant of this pages node. Ideally we would just resolve the - // promise with the page ref here, but there is the case where more - // pages nodes could link to single a page (see issue 3666 pdf). To - // handle this push it back on the queue so if it is a pages node it - // will be descended into. - nodesToVisit = [kids[pageIndex - currentPageIndex]]; - currentPageIndex = pageIndex; - continue; - } else { - for (var last = kids.length - 1; last >= 0; last--) { - nodesToVisit.push(kids[last]); - } - } - } - capability.reject('Page index ' + pageIndex + ' not found.'); - } - next(); - return capability.promise; - }, - - getPageIndex: function Catalog_getPageIndex(ref) { - // The page tree nodes have the count of all the leaves below them. To get - // how many pages are before we just have to walk up the tree and keep - // adding the count of siblings to the left of the node. - var xref = this.xref; - function pagesBeforeRef(kidRef) { - var total = 0; - var parentRef; - return xref.fetchAsync(kidRef).then(function (node) { - if (!node) { - return null; - } - parentRef = node.getRaw('Parent'); - return node.getAsync('Parent'); - }).then(function (parent) { - if (!parent) { - return null; - } - return parent.getAsync('Kids'); - }).then(function (kids) { - if (!kids) { - return null; - } - var kidPromises = []; - var found = false; - for (var i = 0; i < kids.length; i++) { - var kid = kids[i]; - assert(isRef(kid), 'kids must be a ref'); - if (kid.num === kidRef.num) { - found = true; - break; - } - kidPromises.push(xref.fetchAsync(kid).then(function (kid) { - if (kid.has('Count')) { - var count = kid.get('Count'); - total += count; - } else { // page leaf node - total++; - } - })); - } - if (!found) { - error('kid ref not found in parents kids'); - } - return Promise.all(kidPromises).then(function () { - return [total, parentRef]; - }); - }); - } - - var total = 0; - function next(ref) { - return pagesBeforeRef(ref).then(function (args) { - if (!args) { - return total; - } - var count = args[0]; - var parentRef = args[1]; - total += count; - return next(parentRef); - }); - } - - return next(ref); - } - }; - - return Catalog; -})(); - -var XRef = (function XRefClosure() { - function XRef(stream, password) { - this.stream = stream; - this.entries = []; - this.xrefstms = {}; - // prepare the XRef cache - this.cache = []; - this.password = password; - this.stats = { - streamTypes: [], - fontTypes: [] - }; - } - - XRef.prototype = { - setStartXRef: function XRef_setStartXRef(startXRef) { - // Store the starting positions of xref tables as we process them - // so we can recover from missing data errors - this.startXRefQueue = [startXRef]; - }, - - parse: function XRef_parse(recoveryMode) { - var trailerDict; - if (!recoveryMode) { - trailerDict = this.readXRef(); - } else { - warn('Indexing all PDF objects'); - trailerDict = this.indexObjects(); - } - trailerDict.assignXref(this); - this.trailer = trailerDict; - var encrypt = trailerDict.get('Encrypt'); - if (encrypt) { - var ids = trailerDict.get('ID'); - var fileId = (ids && ids.length) ? ids[0] : ''; - this.encrypt = new CipherTransformFactory(encrypt, fileId, - this.password); - } - - // get the root dictionary (catalog) object - if (!(this.root = trailerDict.get('Root'))) { - error('Invalid root reference'); - } - }, - - processXRefTable: function XRef_processXRefTable(parser) { - if (!('tableState' in this)) { - // Stores state of the table as we process it so we can resume - // from middle of table in case of missing data error - this.tableState = { - entryNum: 0, - streamPos: parser.lexer.stream.pos, - parserBuf1: parser.buf1, - parserBuf2: parser.buf2 - }; - } - - var obj = this.readXRefTable(parser); - - // Sanity check - if (!isCmd(obj, 'trailer')) { - error('Invalid XRef table: could not find trailer dictionary'); - } - // Read trailer dictionary, e.g. - // trailer - // << /Size 22 - // /Root 20R - // /Info 10R - // /ID [ <81b14aafa313db63dbd6f981e49f94f4> ] - // >> - // The parser goes through the entire stream << ... >> and provides - // a getter interface for the key-value table - var dict = parser.getObj(); - - // The pdflib PDF generator can generate a nested trailer dictionary - if (!isDict(dict) && dict.dict) { - dict = dict.dict; - } - if (!isDict(dict)) { - error('Invalid XRef table: could not parse trailer dictionary'); - } - delete this.tableState; - - return dict; - }, - - readXRefTable: function XRef_readXRefTable(parser) { - // Example of cross-reference table: - // xref - // 0 1 <-- subsection header (first obj #, obj count) - // 0000000000 65535 f <-- actual object (offset, generation #, f/n) - // 23 2 <-- subsection header ... and so on ... - // 0000025518 00002 n - // 0000025635 00000 n - // trailer - // ... - - var stream = parser.lexer.stream; - var tableState = this.tableState; - stream.pos = tableState.streamPos; - parser.buf1 = tableState.parserBuf1; - parser.buf2 = tableState.parserBuf2; - - // Outer loop is over subsection headers - var obj; - - while (true) { - if (!('firstEntryNum' in tableState) || !('entryCount' in tableState)) { - if (isCmd(obj = parser.getObj(), 'trailer')) { - break; - } - tableState.firstEntryNum = obj; - tableState.entryCount = parser.getObj(); - } - - var first = tableState.firstEntryNum; - var count = tableState.entryCount; - if (!isInt(first) || !isInt(count)) { - error('Invalid XRef table: wrong types in subsection header'); - } - // Inner loop is over objects themselves - for (var i = tableState.entryNum; i < count; i++) { - tableState.streamPos = stream.pos; - tableState.entryNum = i; - tableState.parserBuf1 = parser.buf1; - tableState.parserBuf2 = parser.buf2; - - var entry = {}; - entry.offset = parser.getObj(); - entry.gen = parser.getObj(); - var type = parser.getObj(); - - if (isCmd(type, 'f')) { - entry.free = true; - } else if (isCmd(type, 'n')) { - entry.uncompressed = true; - } - - // Validate entry obj - if (!isInt(entry.offset) || !isInt(entry.gen) || - !(entry.free || entry.uncompressed)) { - error('Invalid entry in XRef subsection: ' + first + ', ' + count); - } - - if (!this.entries[i + first]) { - this.entries[i + first] = entry; - } - } - - tableState.entryNum = 0; - tableState.streamPos = stream.pos; - tableState.parserBuf1 = parser.buf1; - tableState.parserBuf2 = parser.buf2; - delete tableState.firstEntryNum; - delete tableState.entryCount; - } - - // Per issue 3248: hp scanners generate bad XRef - if (first === 1 && this.entries[1] && this.entries[1].free) { - // shifting the entries - this.entries.shift(); - } - - // Sanity check: as per spec, first object must be free - if (this.entries[0] && !this.entries[0].free) { - error('Invalid XRef table: unexpected first object'); - } - return obj; - }, - - processXRefStream: function XRef_processXRefStream(stream) { - if (!('streamState' in this)) { - // Stores state of the stream as we process it so we can resume - // from middle of stream in case of missing data error - var streamParameters = stream.dict; - var byteWidths = streamParameters.get('W'); - var range = streamParameters.get('Index'); - if (!range) { - range = [0, streamParameters.get('Size')]; - } - - this.streamState = { - entryRanges: range, - byteWidths: byteWidths, - entryNum: 0, - streamPos: stream.pos - }; - } - this.readXRefStream(stream); - delete this.streamState; - - return stream.dict; - }, - - readXRefStream: function XRef_readXRefStream(stream) { - var i, j; - var streamState = this.streamState; - stream.pos = streamState.streamPos; - - var byteWidths = streamState.byteWidths; - var typeFieldWidth = byteWidths[0]; - var offsetFieldWidth = byteWidths[1]; - var generationFieldWidth = byteWidths[2]; - - var entryRanges = streamState.entryRanges; - while (entryRanges.length > 0) { - var first = entryRanges[0]; - var n = entryRanges[1]; - - if (!isInt(first) || !isInt(n)) { - error('Invalid XRef range fields: ' + first + ', ' + n); - } - if (!isInt(typeFieldWidth) || !isInt(offsetFieldWidth) || - !isInt(generationFieldWidth)) { - error('Invalid XRef entry fields length: ' + first + ', ' + n); - } - for (i = streamState.entryNum; i < n; ++i) { - streamState.entryNum = i; - streamState.streamPos = stream.pos; - - var type = 0, offset = 0, generation = 0; - for (j = 0; j < typeFieldWidth; ++j) { - type = (type << 8) | stream.getByte(); - } - // if type field is absent, its default value is 1 - if (typeFieldWidth === 0) { - type = 1; - } - for (j = 0; j < offsetFieldWidth; ++j) { - offset = (offset << 8) | stream.getByte(); - } - for (j = 0; j < generationFieldWidth; ++j) { - generation = (generation << 8) | stream.getByte(); - } - var entry = {}; - entry.offset = offset; - entry.gen = generation; - switch (type) { - case 0: - entry.free = true; - break; - case 1: - entry.uncompressed = true; - break; - case 2: - break; - default: - error('Invalid XRef entry type: ' + type); - } - if (!this.entries[first + i]) { - this.entries[first + i] = entry; - } - } - - streamState.entryNum = 0; - streamState.streamPos = stream.pos; - entryRanges.splice(0, 2); - } - }, - - indexObjects: function XRef_indexObjects() { - // Simple scan through the PDF content to find objects, - // trailers and XRef streams. - var TAB = 0x9, LF = 0xA, CR = 0xD, SPACE = 0x20; - var PERCENT = 0x25, LT = 0x3C; - - function readToken(data, offset) { - var token = '', ch = data[offset]; - while (ch !== LF && ch !== CR && ch !== LT) { - if (++offset >= data.length) { - break; - } - token += String.fromCharCode(ch); - ch = data[offset]; - } - return token; - } - function skipUntil(data, offset, what) { - var length = what.length, dataLength = data.length; - var skipped = 0; - // finding byte sequence - while (offset < dataLength) { - var i = 0; - while (i < length && data[offset + i] === what[i]) { - ++i; - } - if (i >= length) { - break; // sequence found - } - offset++; - skipped++; - } - return skipped; - } - var objRegExp = /^(\d+)\s+(\d+)\s+obj\b/; - var trailerBytes = new Uint8Array([116, 114, 97, 105, 108, 101, 114]); - var startxrefBytes = new Uint8Array([115, 116, 97, 114, 116, 120, 114, - 101, 102]); - var endobjBytes = new Uint8Array([101, 110, 100, 111, 98, 106]); - var xrefBytes = new Uint8Array([47, 88, 82, 101, 102]); - - // Clear out any existing entries, since they may be bogus. - this.entries.length = 0; - - var stream = this.stream; - stream.pos = 0; - var buffer = stream.getBytes(); - var position = stream.start, length = buffer.length; - var trailers = [], xrefStms = []; - while (position < length) { - var ch = buffer[position]; - if (ch === TAB || ch === LF || ch === CR || ch === SPACE) { - ++position; - continue; - } - if (ch === PERCENT) { // %-comment - do { - ++position; - if (position >= length) { - break; - } - ch = buffer[position]; - } while (ch !== LF && ch !== CR); - continue; - } - var token = readToken(buffer, position); - var m; - if (token.indexOf('xref') === 0 && - (token.length === 4 || /\s/.test(token[4]))) { - position += skipUntil(buffer, position, trailerBytes); - trailers.push(position); - position += skipUntil(buffer, position, startxrefBytes); - } else if ((m = objRegExp.exec(token))) { - if (typeof this.entries[m[1]] === 'undefined') { - this.entries[m[1]] = { - offset: position - stream.start, - gen: m[2] | 0, - uncompressed: true - }; - } - var contentLength = skipUntil(buffer, position, endobjBytes) + 7; - var content = buffer.subarray(position, position + contentLength); - - // checking XRef stream suspect - // (it shall have '/XRef' and next char is not a letter) - var xrefTagOffset = skipUntil(content, 0, xrefBytes); - if (xrefTagOffset < contentLength && - content[xrefTagOffset + 5] < 64) { - xrefStms.push(position - stream.start); - this.xrefstms[position - stream.start] = 1; // Avoid recursion - } - - position += contentLength; - } else if (token.indexOf('trailer') === 0 && - (token.length === 7 || /\s/.test(token[7]))) { - trailers.push(position); - position += skipUntil(buffer, position, startxrefBytes); - } else { - position += token.length + 1; - } - } - // reading XRef streams - var i, ii; - for (i = 0, ii = xrefStms.length; i < ii; ++i) { - this.startXRefQueue.push(xrefStms[i]); - this.readXRef(/* recoveryMode */ true); - } - // finding main trailer - var dict; - for (i = 0, ii = trailers.length; i < ii; ++i) { - stream.pos = trailers[i]; - var parser = new Parser(new Lexer(stream), true, this); - var obj = parser.getObj(); - if (!isCmd(obj, 'trailer')) { - continue; - } - // read the trailer dictionary - if (!isDict(dict = parser.getObj())) { - continue; - } - // taking the first one with 'ID' - if (dict.has('ID')) { - return dict; - } - } - // no tailer with 'ID', taking last one (if exists) - if (dict) { - return dict; - } - // nothing helps - // calling error() would reject worker with an UnknownErrorException. - throw new InvalidPDFException('Invalid PDF structure'); - }, - - readXRef: function XRef_readXRef(recoveryMode) { - var stream = this.stream; - - try { - while (this.startXRefQueue.length) { - var startXRef = this.startXRefQueue[0]; - - stream.pos = startXRef + stream.start; - - var parser = new Parser(new Lexer(stream), true, this); - var obj = parser.getObj(); - var dict; - - // Get dictionary - if (isCmd(obj, 'xref')) { - // Parse end-of-file XRef - dict = this.processXRefTable(parser); - if (!this.topDict) { - this.topDict = dict; - } - - // Recursively get other XRefs 'XRefStm', if any - obj = dict.get('XRefStm'); - if (isInt(obj)) { - var pos = obj; - // ignore previously loaded xref streams - // (possible infinite recursion) - if (!(pos in this.xrefstms)) { - this.xrefstms[pos] = 1; - this.startXRefQueue.push(pos); - } - } - } else if (isInt(obj)) { - // Parse in-stream XRef - if (!isInt(parser.getObj()) || - !isCmd(parser.getObj(), 'obj') || - !isStream(obj = parser.getObj())) { - error('Invalid XRef stream'); - } - dict = this.processXRefStream(obj); - if (!this.topDict) { - this.topDict = dict; - } - if (!dict) { - error('Failed to read XRef stream'); - } - } else { - error('Invalid XRef stream header'); - } - - // Recursively get previous dictionary, if any - obj = dict.get('Prev'); - if (isInt(obj)) { - this.startXRefQueue.push(obj); - } else if (isRef(obj)) { - // The spec says Prev must not be a reference, i.e. "/Prev NNN" - // This is a fallback for non-compliant PDFs, i.e. "/Prev NNN 0 R" - this.startXRefQueue.push(obj.num); - } - - this.startXRefQueue.shift(); - } - - return this.topDict; - } catch (e) { - if (e instanceof MissingDataException) { - throw e; - } - info('(while reading XRef): ' + e); - } - - if (recoveryMode) { - return; - } - throw new XRefParseException(); - }, - - getEntry: function XRef_getEntry(i) { - var xrefEntry = this.entries[i]; - if (xrefEntry && !xrefEntry.free && xrefEntry.offset) { - return xrefEntry; - } - return null; - }, - - fetchIfRef: function XRef_fetchIfRef(obj) { - if (!isRef(obj)) { - return obj; - } - return this.fetch(obj); - }, - - fetch: function XRef_fetch(ref, suppressEncryption) { - assert(isRef(ref), 'ref object is not a reference'); - var num = ref.num; - if (num in this.cache) { - var cacheEntry = this.cache[num]; - return cacheEntry; - } - - var xrefEntry = this.getEntry(num); - - // the referenced entry can be free - if (xrefEntry === null) { - return (this.cache[num] = null); - } - - if (xrefEntry.uncompressed) { - xrefEntry = this.fetchUncompressed(ref, xrefEntry, suppressEncryption); - } else { - xrefEntry = this.fetchCompressed(xrefEntry, suppressEncryption); - } - if (isDict(xrefEntry)){ - xrefEntry.objId = ref.toString(); - } else if (isStream(xrefEntry)) { - xrefEntry.dict.objId = ref.toString(); - } - return xrefEntry; - }, - - fetchUncompressed: function XRef_fetchUncompressed(ref, xrefEntry, - suppressEncryption) { - var gen = ref.gen; - var num = ref.num; - if (xrefEntry.gen !== gen) { - error('inconsistent generation in XRef'); - } - var stream = this.stream.makeSubStream(xrefEntry.offset + - this.stream.start); - var parser = new Parser(new Lexer(stream), true, this); - var obj1 = parser.getObj(); - var obj2 = parser.getObj(); - var obj3 = parser.getObj(); - if (!isInt(obj1) || parseInt(obj1, 10) !== num || - !isInt(obj2) || parseInt(obj2, 10) !== gen || - !isCmd(obj3)) { - error('bad XRef entry'); - } - if (!isCmd(obj3, 'obj')) { - // some bad PDFs use "obj1234" and really mean 1234 - if (obj3.cmd.indexOf('obj') === 0) { - num = parseInt(obj3.cmd.substring(3), 10); - if (!isNaN(num)) { - return num; - } - } - error('bad XRef entry'); - } - if (this.encrypt && !suppressEncryption) { - xrefEntry = parser.getObj(this.encrypt.createCipherTransform(num, gen)); - } else { - xrefEntry = parser.getObj(); - } - if (!isStream(xrefEntry)) { - this.cache[num] = xrefEntry; - } - return xrefEntry; - }, - - fetchCompressed: function XRef_fetchCompressed(xrefEntry, - suppressEncryption) { - var tableOffset = xrefEntry.offset; - var stream = this.fetch(new Ref(tableOffset, 0)); - if (!isStream(stream)) { - error('bad ObjStm stream'); - } - var first = stream.dict.get('First'); - var n = stream.dict.get('N'); - if (!isInt(first) || !isInt(n)) { - error('invalid first and n parameters for ObjStm stream'); - } - var parser = new Parser(new Lexer(stream), false, this); - parser.allowStreams = true; - var i, entries = [], num, nums = []; - // read the object numbers to populate cache - for (i = 0; i < n; ++i) { - num = parser.getObj(); - if (!isInt(num)) { - error('invalid object number in the ObjStm stream: ' + num); - } - nums.push(num); - var offset = parser.getObj(); - if (!isInt(offset)) { - error('invalid object offset in the ObjStm stream: ' + offset); - } - } - // read stream objects for cache - for (i = 0; i < n; ++i) { - entries.push(parser.getObj()); - num = nums[i]; - var entry = this.entries[num]; - if (entry && entry.offset === tableOffset && entry.gen === i) { - this.cache[num] = entries[i]; - } - } - xrefEntry = entries[xrefEntry.gen]; - if (xrefEntry === undefined) { - error('bad XRef entry for compressed object'); - } - return xrefEntry; - }, - - fetchIfRefAsync: function XRef_fetchIfRefAsync(obj) { - if (!isRef(obj)) { - return Promise.resolve(obj); - } - return this.fetchAsync(obj); - }, - - fetchAsync: function XRef_fetchAsync(ref, suppressEncryption) { - var streamManager = this.stream.manager; - var xref = this; - return new Promise(function tryFetch(resolve, reject) { - try { - resolve(xref.fetch(ref, suppressEncryption)); - } catch (e) { - if (e instanceof MissingDataException) { - streamManager.requestRange(e.begin, e.end).then(function () { - tryFetch(resolve, reject); - }, reject); - return; - } - reject(e); - } - }); - }, - - getCatalogObj: function XRef_getCatalogObj() { - return this.root; - } - }; - - return XRef; -})(); - -/** - * A NameTree is like a Dict but has some advantageous properties, see the - * spec (7.9.6) for more details. - * TODO: implement all the Dict functions and make this more efficent. - */ -var NameTree = (function NameTreeClosure() { - function NameTree(root, xref) { - this.root = root; - this.xref = xref; - } - - NameTree.prototype = { - getAll: function NameTree_getAll() { - var dict = {}; - if (!this.root) { - return dict; - } - var xref = this.xref; - // reading name tree - var processed = new RefSet(); - processed.put(this.root); - var queue = [this.root]; - while (queue.length > 0) { - var i, n; - var obj = xref.fetchIfRef(queue.shift()); - if (!isDict(obj)) { - continue; - } - if (obj.has('Kids')) { - var kids = obj.get('Kids'); - for (i = 0, n = kids.length; i < n; i++) { - var kid = kids[i]; - if (processed.has(kid)) { - error('invalid destinations'); - } - queue.push(kid); - processed.put(kid); - } - continue; - } - var names = obj.get('Names'); - if (names) { - for (i = 0, n = names.length; i < n; i += 2) { - dict[xref.fetchIfRef(names[i])] = xref.fetchIfRef(names[i + 1]); - } - } - } - return dict; - }, - - get: function NameTree_get(destinationId) { - if (!this.root) { - return null; - } - - var xref = this.xref; - var kidsOrNames = xref.fetchIfRef(this.root); - var loopCount = 0; - var MAX_NAMES_LEVELS = 10; - var l, r, m; - - // Perform a binary search to quickly find the entry that - // contains the named destination we are looking for. - while (kidsOrNames.has('Kids')) { - loopCount++; - if (loopCount > MAX_NAMES_LEVELS) { - warn('Search depth limit for named destionations has been reached.'); - return null; - } - - var kids = kidsOrNames.get('Kids'); - if (!isArray(kids)) { - return null; - } - - l = 0; - r = kids.length - 1; - while (l <= r) { - m = (l + r) >> 1; - var kid = xref.fetchIfRef(kids[m]); - var limits = kid.get('Limits'); - - if (destinationId < xref.fetchIfRef(limits[0])) { - r = m - 1; - } else if (destinationId > xref.fetchIfRef(limits[1])) { - l = m + 1; - } else { - kidsOrNames = xref.fetchIfRef(kids[m]); - break; - } - } - if (l > r) { - return null; - } - } - - // If we get here, then we have found the right entry. Now - // go through the named destinations in the Named dictionary - // until we find the exact destination we're looking for. - var names = kidsOrNames.get('Names'); - if (isArray(names)) { - // Perform a binary search to reduce the lookup time. - l = 0; - r = names.length - 2; - while (l <= r) { - // Check only even indices (0, 2, 4, ...) because the - // odd indices contain the actual D array. - m = (l + r) & ~1; - if (destinationId < xref.fetchIfRef(names[m])) { - r = m - 2; - } else if (destinationId > xref.fetchIfRef(names[m])) { - l = m + 2; - } else { - return xref.fetchIfRef(names[m + 1]); - } - } - } - return null; - } - }; - return NameTree; -})(); - -/** - * "A PDF file can refer to the contents of another file by using a File - * Specification (PDF 1.1)", see the spec (7.11) for more details. - * NOTE: Only embedded files are supported (as part of the attachments support) - * TODO: support the 'URL' file system (with caching if !/V), portable - * collections attributes and related files (/RF) - */ -var FileSpec = (function FileSpecClosure() { - function FileSpec(root, xref) { - if (!root || !isDict(root)) { - return; - } - this.xref = xref; - this.root = root; - if (root.has('FS')) { - this.fs = root.get('FS'); - } - this.description = root.has('Desc') ? - stringToPDFString(root.get('Desc')) : - ''; - if (root.has('RF')) { - warn('Related file specifications are not supported'); - } - this.contentAvailable = true; - if (!root.has('EF')) { - this.contentAvailable = false; - warn('Non-embedded file specifications are not supported'); - } - } - - function pickPlatformItem(dict) { - // Look for the filename in this order: - // UF, F, Unix, Mac, DOS - if (dict.has('UF')) { - return dict.get('UF'); - } else if (dict.has('F')) { - return dict.get('F'); - } else if (dict.has('Unix')) { - return dict.get('Unix'); - } else if (dict.has('Mac')) { - return dict.get('Mac'); - } else if (dict.has('DOS')) { - return dict.get('DOS'); - } else { - return null; - } - } - - FileSpec.prototype = { - get filename() { - if (!this._filename && this.root) { - var filename = pickPlatformItem(this.root) || 'unnamed'; - this._filename = stringToPDFString(filename). - replace(/\\\\/g, '\\'). - replace(/\\\//g, '/'). - replace(/\\/g, '/'); - } - return this._filename; - }, - get content() { - if (!this.contentAvailable) { - return null; - } - if (!this.contentRef && this.root) { - this.contentRef = pickPlatformItem(this.root.get('EF')); - } - var content = null; - if (this.contentRef) { - var xref = this.xref; - var fileObj = xref.fetchIfRef(this.contentRef); - if (fileObj && isStream(fileObj)) { - content = fileObj.getBytes(); - } else { - warn('Embedded file specification points to non-existing/invalid ' + - 'content'); - } - } else { - warn('Embedded file specification does not have a content'); - } - return content; - }, - get serializable() { - return { - filename: this.filename, - content: this.content - }; - } - }; - return FileSpec; -})(); - -/** - * A helper for loading missing data in object graphs. It traverses the graph - * depth first and queues up any objects that have missing data. Once it has - * has traversed as many objects that are available it attempts to bundle the - * missing data requests and then resume from the nodes that weren't ready. - * - * NOTE: It provides protection from circular references by keeping track of - * of loaded references. However, you must be careful not to load any graphs - * that have references to the catalog or other pages since that will cause the - * entire PDF document object graph to be traversed. - */ -var ObjectLoader = (function() { - function mayHaveChildren(value) { - return isRef(value) || isDict(value) || isArray(value) || isStream(value); - } - - function addChildren(node, nodesToVisit) { - var value; - if (isDict(node) || isStream(node)) { - var map; - if (isDict(node)) { - map = node.map; - } else { - map = node.dict.map; - } - for (var key in map) { - value = map[key]; - if (mayHaveChildren(value)) { - nodesToVisit.push(value); - } - } - } else if (isArray(node)) { - for (var i = 0, ii = node.length; i < ii; i++) { - value = node[i]; - if (mayHaveChildren(value)) { - nodesToVisit.push(value); - } - } - } - } - - function ObjectLoader(obj, keys, xref) { - this.obj = obj; - this.keys = keys; - this.xref = xref; - this.refSet = null; - this.capability = null; - } - - ObjectLoader.prototype = { - load: function ObjectLoader_load() { - var keys = this.keys; - this.capability = createPromiseCapability(); - // Don't walk the graph if all the data is already loaded. - if (!(this.xref.stream instanceof ChunkedStream) || - this.xref.stream.getMissingChunks().length === 0) { - this.capability.resolve(); - return this.capability.promise; - } - - this.refSet = new RefSet(); - // Setup the initial nodes to visit. - var nodesToVisit = []; - for (var i = 0; i < keys.length; i++) { - nodesToVisit.push(this.obj[keys[i]]); - } - - this._walk(nodesToVisit); - return this.capability.promise; - }, - - _walk: function ObjectLoader_walk(nodesToVisit) { - var nodesToRevisit = []; - var pendingRequests = []; - // DFS walk of the object graph. - while (nodesToVisit.length) { - var currentNode = nodesToVisit.pop(); - - // Only references or chunked streams can cause missing data exceptions. - if (isRef(currentNode)) { - // Skip nodes that have already been visited. - if (this.refSet.has(currentNode)) { - continue; - } - try { - var ref = currentNode; - this.refSet.put(ref); - currentNode = this.xref.fetch(currentNode); - } catch (e) { - if (!(e instanceof MissingDataException)) { - throw e; - } - nodesToRevisit.push(currentNode); - pendingRequests.push({ begin: e.begin, end: e.end }); - } - } - if (currentNode && currentNode.getBaseStreams) { - var baseStreams = currentNode.getBaseStreams(); - var foundMissingData = false; - for (var i = 0; i < baseStreams.length; i++) { - var stream = baseStreams[i]; - if (stream.getMissingChunks && stream.getMissingChunks().length) { - foundMissingData = true; - pendingRequests.push({ - begin: stream.start, - end: stream.end - }); - } - } - if (foundMissingData) { - nodesToRevisit.push(currentNode); - } - } - - addChildren(currentNode, nodesToVisit); - } - - if (pendingRequests.length) { - this.xref.stream.manager.requestRanges(pendingRequests).then( - function pendingRequestCallback() { - nodesToVisit = nodesToRevisit; - for (var i = 0; i < nodesToRevisit.length; i++) { - var node = nodesToRevisit[i]; - // Remove any reference nodes from the currrent refset so they - // aren't skipped when we revist them. - if (isRef(node)) { - this.refSet.remove(node); - } - } - this._walk(nodesToVisit); - }.bind(this), this.capability.reject); - return; - } - // Everything is loaded. - this.refSet = null; - this.capability.resolve(); - } - }; - - return ObjectLoader; -})(); - - -var ISOAdobeCharset = [ - '.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', - 'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright', - 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', - 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', - 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', - 'at', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', - 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', - 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', - 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', - 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', - 'braceleft', 'bar', 'braceright', 'asciitilde', 'exclamdown', 'cent', - 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', - 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', - 'guilsinglright', 'fi', 'fl', 'endash', 'dagger', 'daggerdbl', - 'periodcentered', 'paragraph', 'bullet', 'quotesinglbase', - 'quotedblbase', 'quotedblright', 'guillemotright', 'ellipsis', - 'perthousand', 'questiondown', 'grave', 'acute', 'circumflex', 'tilde', - 'macron', 'breve', 'dotaccent', 'dieresis', 'ring', 'cedilla', - 'hungarumlaut', 'ogonek', 'caron', 'emdash', 'AE', 'ordfeminine', - 'Lslash', 'Oslash', 'OE', 'ordmasculine', 'ae', 'dotlessi', 'lslash', - 'oslash', 'oe', 'germandbls', 'onesuperior', 'logicalnot', 'mu', - 'trademark', 'Eth', 'onehalf', 'plusminus', 'Thorn', 'onequarter', - 'divide', 'brokenbar', 'degree', 'thorn', 'threequarters', 'twosuperior', - 'registered', 'minus', 'eth', 'multiply', 'threesuperior', 'copyright', - 'Aacute', 'Acircumflex', 'Adieresis', 'Agrave', 'Aring', 'Atilde', - 'Ccedilla', 'Eacute', 'Ecircumflex', 'Edieresis', 'Egrave', 'Iacute', - 'Icircumflex', 'Idieresis', 'Igrave', 'Ntilde', 'Oacute', 'Ocircumflex', - 'Odieresis', 'Ograve', 'Otilde', 'Scaron', 'Uacute', 'Ucircumflex', - 'Udieresis', 'Ugrave', 'Yacute', 'Ydieresis', 'Zcaron', 'aacute', - 'acircumflex', 'adieresis', 'agrave', 'aring', 'atilde', 'ccedilla', - 'eacute', 'ecircumflex', 'edieresis', 'egrave', 'iacute', 'icircumflex', - 'idieresis', 'igrave', 'ntilde', 'oacute', 'ocircumflex', 'odieresis', - 'ograve', 'otilde', 'scaron', 'uacute', 'ucircumflex', 'udieresis', - 'ugrave', 'yacute', 'ydieresis', 'zcaron' -]; - -var ExpertCharset = [ - '.notdef', 'space', 'exclamsmall', 'Hungarumlautsmall', 'dollaroldstyle', - 'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior', - 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', - 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', - 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', - 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', - 'colon', 'semicolon', 'commasuperior', 'threequartersemdash', - 'periodsuperior', 'questionsmall', 'asuperior', 'bsuperior', - 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', 'lsuperior', - 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', - 'tsuperior', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', - 'parenrightinferior', 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', - 'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', - 'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', - 'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', - 'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', - 'onefitted', 'rupiah', 'Tildesmall', 'exclamdownsmall', 'centoldstyle', - 'Lslashsmall', 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', - 'Brevesmall', 'Caronsmall', 'Dotaccentsmall', 'Macronsmall', - 'figuredash', 'hypheninferior', 'Ogoneksmall', 'Ringsmall', - 'Cedillasmall', 'onequarter', 'onehalf', 'threequarters', - 'questiondownsmall', 'oneeighth', 'threeeighths', 'fiveeighths', - 'seveneighths', 'onethird', 'twothirds', 'zerosuperior', 'onesuperior', - 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', - 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', - 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', - 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', - 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', - 'periodinferior', 'commainferior', 'Agravesmall', 'Aacutesmall', - 'Acircumflexsmall', 'Atildesmall', 'Adieresissmall', 'Aringsmall', - 'AEsmall', 'Ccedillasmall', 'Egravesmall', 'Eacutesmall', - 'Ecircumflexsmall', 'Edieresissmall', 'Igravesmall', 'Iacutesmall', - 'Icircumflexsmall', 'Idieresissmall', 'Ethsmall', 'Ntildesmall', - 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', 'Otildesmall', - 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', 'Uacutesmall', - 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', 'Thornsmall', - 'Ydieresissmall' -]; - -var ExpertSubsetCharset = [ - '.notdef', 'space', 'dollaroldstyle', 'dollarsuperior', - 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', - 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', - 'zerooldstyle', 'oneoldstyle', 'twooldstyle', 'threeoldstyle', - 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', - 'eightoldstyle', 'nineoldstyle', 'colon', 'semicolon', 'commasuperior', - 'threequartersemdash', 'periodsuperior', 'asuperior', 'bsuperior', - 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', 'lsuperior', - 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', - 'tsuperior', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', - 'parenrightinferior', 'hyphensuperior', 'colonmonetary', 'onefitted', - 'rupiah', 'centoldstyle', 'figuredash', 'hypheninferior', 'onequarter', - 'onehalf', 'threequarters', 'oneeighth', 'threeeighths', 'fiveeighths', - 'seveneighths', 'onethird', 'twothirds', 'zerosuperior', 'onesuperior', - 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', - 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', - 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', - 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', - 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', - 'periodinferior', 'commainferior' -]; - - -var DEFAULT_ICON_SIZE = 22; // px - -/** - * @class - * @alias AnnotationFactory - */ -function AnnotationFactory() {} -AnnotationFactory.prototype = /** @lends AnnotationFactory.prototype */ { - /** - * @param {XRef} xref - * @param {Object} ref - * @returns {Annotation} - */ - create: function AnnotationFactory_create(xref, ref) { - var dict = xref.fetchIfRef(ref); - if (!isDict(dict)) { - return; - } - - // Determine the annotation's subtype. - var subtype = dict.get('Subtype'); - subtype = isName(subtype) ? subtype.name : ''; - - // Return the right annotation object based on the subtype and field type. - var parameters = { - dict: dict, - ref: ref - }; - - switch (subtype) { - case 'Link': - return new LinkAnnotation(parameters); - - case 'Text': - return new TextAnnotation(parameters); - - case 'Widget': - var fieldType = Util.getInheritableProperty(dict, 'FT'); - if (isName(fieldType) && fieldType.name === 'Tx') { - return new TextWidgetAnnotation(parameters); - } - return new WidgetAnnotation(parameters); - - default: - warn('Unimplemented annotation type "' + subtype + '", ' + - 'falling back to base annotation'); - return new Annotation(parameters); - } - } -}; - -var Annotation = (function AnnotationClosure() { - // 12.5.5: Algorithm: Appearance streams - function getTransformMatrix(rect, bbox, matrix) { - var bounds = Util.getAxialAlignedBoundingBox(bbox, matrix); - var minX = bounds[0]; - var minY = bounds[1]; - var maxX = bounds[2]; - var maxY = bounds[3]; - - if (minX === maxX || minY === maxY) { - // From real-life file, bbox was [0, 0, 0, 0]. In this case, - // just apply the transform for rect - return [1, 0, 0, 1, rect[0], rect[1]]; - } - - var xRatio = (rect[2] - rect[0]) / (maxX - minX); - var yRatio = (rect[3] - rect[1]) / (maxY - minY); - return [ - xRatio, - 0, - 0, - yRatio, - rect[0] - minX * xRatio, - rect[1] - minY * yRatio - ]; - } - - function getDefaultAppearance(dict) { - var appearanceState = dict.get('AP'); - if (!isDict(appearanceState)) { - return; - } - - var appearance; - var appearances = appearanceState.get('N'); - if (isDict(appearances)) { - var as = dict.get('AS'); - if (as && appearances.has(as.name)) { - appearance = appearances.get(as.name); - } - } else { - appearance = appearances; - } - return appearance; - } - - function Annotation(params) { - var dict = params.dict; - - this.setFlags(dict.get('F')); - this.setRectangle(dict.get('Rect')); - this.setColor(dict.get('C')); - this.setBorderStyle(dict); - this.appearance = getDefaultAppearance(dict); - - // Expose public properties using a data object. - this.data = {}; - this.data.id = params.ref.num; - this.data.subtype = dict.get('Subtype').name; - this.data.annotationFlags = this.flags; - this.data.rect = this.rectangle; - this.data.color = this.color; - this.data.borderStyle = this.borderStyle; - this.data.hasAppearance = !!this.appearance; - } - - Annotation.prototype = { - /** - * @return {boolean} - */ - get viewable() { - if (this.flags) { - return !this.hasFlag(AnnotationFlag.INVISIBLE) && - !this.hasFlag(AnnotationFlag.HIDDEN) && - !this.hasFlag(AnnotationFlag.NOVIEW); - } - return true; - }, - - /** - * @return {boolean} - */ - get printable() { - if (this.flags) { - return this.hasFlag(AnnotationFlag.PRINT) && - !this.hasFlag(AnnotationFlag.INVISIBLE) && - !this.hasFlag(AnnotationFlag.HIDDEN); - } - return false; - }, - - /** - * Set the flags. - * - * @public - * @memberof Annotation - * @param {number} flags - Unsigned 32-bit integer specifying annotation - * characteristics - * @see {@link shared/util.js} - */ - setFlags: function Annotation_setFlags(flags) { - if (isInt(flags)) { - this.flags = flags; - } else { - this.flags = 0; - } - }, - - /** - * Check if a provided flag is set. - * - * @public - * @memberof Annotation - * @param {number} flag - Hexadecimal representation for an annotation - * characteristic - * @return {boolean} - * @see {@link shared/util.js} - */ - hasFlag: function Annotation_hasFlag(flag) { - if (this.flags) { - return (this.flags & flag) > 0; - } - return false; - }, - - /** - * Set the rectangle. - * - * @public - * @memberof Annotation - * @param {Array} rectangle - The rectangle array with exactly four entries - */ - setRectangle: function Annotation_setRectangle(rectangle) { - if (isArray(rectangle) && rectangle.length === 4) { - this.rectangle = Util.normalizeRect(rectangle); - } else { - this.rectangle = [0, 0, 0, 0]; - } - }, - - /** - * Set the color and take care of color space conversion. - * - * @public - * @memberof Annotation - * @param {Array} color - The color array containing either 0 - * (transparent), 1 (grayscale), 3 (RGB) or - * 4 (CMYK) elements - */ - setColor: function Annotation_setColor(color) { - var rgbColor = new Uint8Array(3); // Black in RGB color space (default) - if (!isArray(color)) { - this.color = rgbColor; - return; - } - - switch (color.length) { - case 0: // Transparent, which we indicate with a null value - this.color = null; - break; - - case 1: // Convert grayscale to RGB - ColorSpace.singletons.gray.getRgbItem(color, 0, rgbColor, 0); - this.color = rgbColor; - break; - - case 3: // Convert RGB percentages to RGB - ColorSpace.singletons.rgb.getRgbItem(color, 0, rgbColor, 0); - this.color = rgbColor; - break; - - case 4: // Convert CMYK to RGB - ColorSpace.singletons.cmyk.getRgbItem(color, 0, rgbColor, 0); - this.color = rgbColor; - break; - - default: - this.color = rgbColor; - break; - } - }, - - /** - * Set the border style (as AnnotationBorderStyle object). - * - * @public - * @memberof Annotation - * @param {Dict} borderStyle - The border style dictionary - */ - setBorderStyle: function Annotation_setBorderStyle(borderStyle) { - this.borderStyle = new AnnotationBorderStyle(); - if (!isDict(borderStyle)) { - return; - } - if (borderStyle.has('BS')) { - var dict = borderStyle.get('BS'); - var dictType; - - if (!dict.has('Type') || (isName(dictType = dict.get('Type')) && - dictType.name === 'Border')) { - this.borderStyle.setWidth(dict.get('W')); - this.borderStyle.setStyle(dict.get('S')); - this.borderStyle.setDashArray(dict.get('D')); - } - } else if (borderStyle.has('Border')) { - var array = borderStyle.get('Border'); - if (isArray(array) && array.length >= 3) { - this.borderStyle.setHorizontalCornerRadius(array[0]); - this.borderStyle.setVerticalCornerRadius(array[1]); - this.borderStyle.setWidth(array[2]); - - if (array.length === 4) { // Dash array available - this.borderStyle.setDashArray(array[3]); - } - } - } else { - // There are no border entries in the dictionary. According to the - // specification, we should draw a solid border of width 1 in that - // case, but Adobe Reader did not implement that part of the - // specification and instead draws no border at all, so we do the same. - // See also https://github.com/mozilla/pdf.js/issues/6179. - this.borderStyle.setWidth(0); - } - }, - - loadResources: function Annotation_loadResources(keys) { - return new Promise(function (resolve, reject) { - this.appearance.dict.getAsync('Resources').then(function (resources) { - if (!resources) { - resolve(); - return; - } - var objectLoader = new ObjectLoader(resources.map, - keys, - resources.xref); - objectLoader.load().then(function() { - resolve(resources); - }, reject); - }, reject); - }.bind(this)); - }, - - getOperatorList: function Annotation_getOperatorList(evaluator, task) { - if (!this.appearance) { - return Promise.resolve(new OperatorList()); - } - - var data = this.data; - var appearanceDict = this.appearance.dict; - var resourcesPromise = this.loadResources([ - 'ExtGState', - 'ColorSpace', - 'Pattern', - 'Shading', - 'XObject', - 'Font' - // ProcSet - // Properties - ]); - var bbox = appearanceDict.get('BBox') || [0, 0, 1, 1]; - var matrix = appearanceDict.get('Matrix') || [1, 0, 0, 1, 0 ,0]; - var transform = getTransformMatrix(data.rect, bbox, matrix); - var self = this; - - return resourcesPromise.then(function(resources) { - var opList = new OperatorList(); - opList.addOp(OPS.beginAnnotation, [data.rect, transform, matrix]); - return evaluator.getOperatorList(self.appearance, task, - resources, opList). - then(function () { - opList.addOp(OPS.endAnnotation, []); - self.appearance.reset(); - return opList; - }); - }); - } - }; - - Annotation.appendToOperatorList = function Annotation_appendToOperatorList( - annotations, opList, partialEvaluator, task, intent) { - var annotationPromises = []; - for (var i = 0, n = annotations.length; i < n; ++i) { - if ((intent === 'display' && annotations[i].viewable) || - (intent === 'print' && annotations[i].printable)) { - annotationPromises.push( - annotations[i].getOperatorList(partialEvaluator, task)); - } - } - return Promise.all(annotationPromises).then(function(operatorLists) { - opList.addOp(OPS.beginAnnotations, []); - for (var i = 0, n = operatorLists.length; i < n; ++i) { - opList.addOpList(operatorLists[i]); - } - opList.addOp(OPS.endAnnotations, []); - }); - }; - - return Annotation; -})(); - -/** - * Contains all data regarding an annotation's border style. - * - * @class - */ -var AnnotationBorderStyle = (function AnnotationBorderStyleClosure() { - /** - * @constructor - * @private - */ - function AnnotationBorderStyle() { - this.width = 1; - this.style = AnnotationBorderStyleType.SOLID; - this.dashArray = [3]; - this.horizontalCornerRadius = 0; - this.verticalCornerRadius = 0; - } - - AnnotationBorderStyle.prototype = { - /** - * Set the width. - * - * @public - * @memberof AnnotationBorderStyle - * @param {integer} width - The width - */ - setWidth: function AnnotationBorderStyle_setWidth(width) { - if (width === (width | 0)) { - this.width = width; - } - }, - - /** - * Set the style. - * - * @public - * @memberof AnnotationBorderStyle - * @param {Object} style - The style object - * @see {@link shared/util.js} - */ - setStyle: function AnnotationBorderStyle_setStyle(style) { - if (!style) { - return; - } - switch (style.name) { - case 'S': - this.style = AnnotationBorderStyleType.SOLID; - break; - - case 'D': - this.style = AnnotationBorderStyleType.DASHED; - break; - - case 'B': - this.style = AnnotationBorderStyleType.BEVELED; - break; - - case 'I': - this.style = AnnotationBorderStyleType.INSET; - break; - - case 'U': - this.style = AnnotationBorderStyleType.UNDERLINE; - break; - - default: - break; - } - }, - - /** - * Set the dash array. - * - * @public - * @memberof AnnotationBorderStyle - * @param {Array} dashArray - The dash array with at least one element - */ - setDashArray: function AnnotationBorderStyle_setDashArray(dashArray) { - // We validate the dash array, but we do not use it because CSS does not - // allow us to change spacing of dashes. For more information, visit - // http://www.w3.org/TR/css3-background/#the-border-style. - if (isArray(dashArray) && dashArray.length > 0) { - // According to the PDF specification: the elements in a dashArray - // shall be numbers that are nonnegative and not all equal to zero. - var isValid = true; - var allZeros = true; - for (var i = 0, len = dashArray.length; i < len; i++) { - var element = dashArray[i]; - var validNumber = (+element >= 0); - if (!validNumber) { - isValid = false; - break; - } else if (element > 0) { - allZeros = false; - } - } - if (isValid && !allZeros) { - this.dashArray = dashArray; - } else { - this.width = 0; // Adobe behavior when the array is invalid. - } - } else if (dashArray) { - this.width = 0; // Adobe behavior when the array is invalid. - } - }, - - /** - * Set the horizontal corner radius (from a Border dictionary). - * - * @public - * @memberof AnnotationBorderStyle - * @param {integer} radius - The horizontal corner radius - */ - setHorizontalCornerRadius: - function AnnotationBorderStyle_setHorizontalCornerRadius(radius) { - if (radius === (radius | 0)) { - this.horizontalCornerRadius = radius; - } - }, - - /** - * Set the vertical corner radius (from a Border dictionary). - * - * @public - * @memberof AnnotationBorderStyle - * @param {integer} radius - The vertical corner radius - */ - setVerticalCornerRadius: - function AnnotationBorderStyle_setVerticalCornerRadius(radius) { - if (radius === (radius | 0)) { - this.verticalCornerRadius = radius; - } - } - }; - - return AnnotationBorderStyle; -})(); - -var WidgetAnnotation = (function WidgetAnnotationClosure() { - function WidgetAnnotation(params) { - Annotation.call(this, params); - - var dict = params.dict; - var data = this.data; - - data.annotationType = AnnotationType.WIDGET; - data.fieldValue = stringToPDFString( - Util.getInheritableProperty(dict, 'V') || ''); - data.alternativeText = stringToPDFString(dict.get('TU') || ''); - data.defaultAppearance = Util.getInheritableProperty(dict, 'DA') || ''; - var fieldType = Util.getInheritableProperty(dict, 'FT'); - data.fieldType = isName(fieldType) ? fieldType.name : ''; - data.fieldFlags = Util.getInheritableProperty(dict, 'Ff') || 0; - this.fieldResources = Util.getInheritableProperty(dict, 'DR') || Dict.empty; - - // Hide unsupported Widget signatures. - if (data.fieldType === 'Sig') { - warn('unimplemented annotation type: Widget signature'); - this.setFlags(AnnotationFlag.HIDDEN); - } - - // Building the full field name by collecting the field and - // its ancestors 'T' data and joining them using '.'. - var fieldName = []; - var namedItem = dict; - var ref = params.ref; - while (namedItem) { - var parent = namedItem.get('Parent'); - var parentRef = namedItem.getRaw('Parent'); - var name = namedItem.get('T'); - if (name) { - fieldName.unshift(stringToPDFString(name)); - } else if (parent && ref) { - // The field name is absent, that means more than one field - // with the same name may exist. Replacing the empty name - // with the '`' plus index in the parent's 'Kids' array. - // This is not in the PDF spec but necessary to id the - // the input controls. - var kids = parent.get('Kids'); - var j, jj; - for (j = 0, jj = kids.length; j < jj; j++) { - var kidRef = kids[j]; - if (kidRef.num === ref.num && kidRef.gen === ref.gen) { - break; - } - } - fieldName.unshift('`' + j); - } - namedItem = parent; - ref = parentRef; - } - data.fullName = fieldName.join('.'); - } - - Util.inherit(WidgetAnnotation, Annotation, {}); - - return WidgetAnnotation; -})(); - -var TextWidgetAnnotation = (function TextWidgetAnnotationClosure() { - function TextWidgetAnnotation(params) { - WidgetAnnotation.call(this, params); - - this.data.textAlignment = Util.getInheritableProperty(params.dict, 'Q'); - this.data.hasHtml = !this.data.hasAppearance && !!this.data.fieldValue; - } - - Util.inherit(TextWidgetAnnotation, WidgetAnnotation, { - getOperatorList: function TextWidgetAnnotation_getOperatorList(evaluator, - task) { - if (this.appearance) { - return Annotation.prototype.getOperatorList.call(this, evaluator, task); - } - - var opList = new OperatorList(); - var data = this.data; - - // Even if there is an appearance stream, ignore it. This is the - // behaviour used by Adobe Reader. - if (!data.defaultAppearance) { - return Promise.resolve(opList); - } - - var stream = new Stream(stringToBytes(data.defaultAppearance)); - return evaluator.getOperatorList(stream, task, - this.fieldResources, opList). - then(function () { - return opList; - }); - } - }); - - return TextWidgetAnnotation; -})(); - -var TextAnnotation = (function TextAnnotationClosure() { - function TextAnnotation(params) { - Annotation.call(this, params); - - var dict = params.dict; - var data = this.data; - - var content = dict.get('Contents'); - var title = dict.get('T'); - data.annotationType = AnnotationType.TEXT; - data.content = stringToPDFString(content || ''); - data.title = stringToPDFString(title || ''); - data.hasHtml = true; - - if (data.hasAppearance) { - data.name = 'NoIcon'; - } else { - data.rect[1] = data.rect[3] - DEFAULT_ICON_SIZE; - data.rect[2] = data.rect[0] + DEFAULT_ICON_SIZE; - data.name = dict.has('Name') ? dict.get('Name').name : 'Note'; - } - - if (dict.has('C')) { - data.hasBgColor = true; - } - } - - Util.inherit(TextAnnotation, Annotation, {}); - - return TextAnnotation; -})(); - -var LinkAnnotation = (function LinkAnnotationClosure() { - function LinkAnnotation(params) { - Annotation.call(this, params); - - var dict = params.dict; - var data = this.data; - data.annotationType = AnnotationType.LINK; - data.hasHtml = true; - - var action = dict.get('A'); - if (action && isDict(action)) { - var linkType = action.get('S').name; - if (linkType === 'URI') { - var url = action.get('URI'); - if (isName(url)) { - // Some bad PDFs do not put parentheses around relative URLs. - url = '/' + url.name; - } else if (url) { - url = addDefaultProtocolToUrl(url); - } - // TODO: pdf spec mentions urls can be relative to a Base - // entry in the dictionary. - if (!isValidUrl(url, false)) { - url = ''; - } - // According to ISO 32000-1:2008, section 12.6.4.7, - // URI should to be encoded in 7-bit ASCII. - // Some bad PDFs may have URIs in UTF-8 encoding, see Bugzilla 1122280. - try { - data.url = stringToUTF8String(url); - } catch (e) { - // Fall back to a simple copy. - data.url = url; - } - } else if (linkType === 'GoTo') { - data.dest = action.get('D'); - } else if (linkType === 'GoToR') { - var urlDict = action.get('F'); - if (isDict(urlDict)) { - // We assume that the 'url' is a Filspec dictionary - // and fetch the url without checking any further - url = urlDict.get('F') || ''; - } - - // TODO: pdf reference says that GoToR - // can also have 'NewWindow' attribute - if (!isValidUrl(url, false)) { - url = ''; - } - data.url = url; - data.dest = action.get('D'); - } else if (linkType === 'Named') { - data.action = action.get('N').name; - } else { - warn('unrecognized link type: ' + linkType); - } - } else if (dict.has('Dest')) { - // simple destination link - var dest = dict.get('Dest'); - data.dest = isName(dest) ? dest.name : dest; - } - } - - // Lets URLs beginning with 'www.' default to using the 'http://' protocol. - function addDefaultProtocolToUrl(url) { - if (url && url.indexOf('www.') === 0) { - return ('http://' + url); - } - return url; - } - - Util.inherit(LinkAnnotation, Annotation, {}); - - return LinkAnnotation; -})(); - - -var PDFFunction = (function PDFFunctionClosure() { - var CONSTRUCT_SAMPLED = 0; - var CONSTRUCT_INTERPOLATED = 2; - var CONSTRUCT_STICHED = 3; - var CONSTRUCT_POSTSCRIPT = 4; - - return { - getSampleArray: function PDFFunction_getSampleArray(size, outputSize, bps, - str) { - var i, ii; - var length = 1; - for (i = 0, ii = size.length; i < ii; i++) { - length *= size[i]; - } - length *= outputSize; - - var array = new Array(length); - var codeSize = 0; - var codeBuf = 0; - // 32 is a valid bps so shifting won't work - var sampleMul = 1.0 / (Math.pow(2.0, bps) - 1); - - var strBytes = str.getBytes((length * bps + 7) / 8); - var strIdx = 0; - for (i = 0; i < length; i++) { - while (codeSize < bps) { - codeBuf <<= 8; - codeBuf |= strBytes[strIdx++]; - codeSize += 8; - } - codeSize -= bps; - array[i] = (codeBuf >> codeSize) * sampleMul; - codeBuf &= (1 << codeSize) - 1; - } - return array; - }, - - getIR: function PDFFunction_getIR(xref, fn) { - var dict = fn.dict; - if (!dict) { - dict = fn; - } - - var types = [this.constructSampled, - null, - this.constructInterpolated, - this.constructStiched, - this.constructPostScript]; - - var typeNum = dict.get('FunctionType'); - var typeFn = types[typeNum]; - if (!typeFn) { - error('Unknown type of function'); - } - - return typeFn.call(this, fn, dict, xref); - }, - - fromIR: function PDFFunction_fromIR(IR) { - var type = IR[0]; - switch (type) { - case CONSTRUCT_SAMPLED: - return this.constructSampledFromIR(IR); - case CONSTRUCT_INTERPOLATED: - return this.constructInterpolatedFromIR(IR); - case CONSTRUCT_STICHED: - return this.constructStichedFromIR(IR); - //case CONSTRUCT_POSTSCRIPT: - default: - return this.constructPostScriptFromIR(IR); - } - }, - - parse: function PDFFunction_parse(xref, fn) { - var IR = this.getIR(xref, fn); - return this.fromIR(IR); - }, - - parseArray: function PDFFunction_parseArray(xref, fnObj) { - if (!isArray(fnObj)) { - // not an array -- parsing as regular function - return this.parse(xref, fnObj); - } - - var fnArray = []; - for (var j = 0, jj = fnObj.length; j < jj; j++) { - var obj = xref.fetchIfRef(fnObj[j]); - fnArray.push(PDFFunction.parse(xref, obj)); - } - return function (src, srcOffset, dest, destOffset) { - for (var i = 0, ii = fnArray.length; i < ii; i++) { - fnArray[i](src, srcOffset, dest, destOffset + i); - } - }; - }, - - constructSampled: function PDFFunction_constructSampled(str, dict) { - function toMultiArray(arr) { - var inputLength = arr.length; - var out = []; - var index = 0; - for (var i = 0; i < inputLength; i += 2) { - out[index] = [arr[i], arr[i + 1]]; - ++index; - } - return out; - } - var domain = dict.get('Domain'); - var range = dict.get('Range'); - - if (!domain || !range) { - error('No domain or range'); - } - - var inputSize = domain.length / 2; - var outputSize = range.length / 2; - - domain = toMultiArray(domain); - range = toMultiArray(range); - - var size = dict.get('Size'); - var bps = dict.get('BitsPerSample'); - var order = dict.get('Order') || 1; - if (order !== 1) { - // No description how cubic spline interpolation works in PDF32000:2008 - // As in poppler, ignoring order, linear interpolation may work as good - info('No support for cubic spline interpolation: ' + order); - } - - var encode = dict.get('Encode'); - if (!encode) { - encode = []; - for (var i = 0; i < inputSize; ++i) { - encode.push(0); - encode.push(size[i] - 1); - } - } - encode = toMultiArray(encode); - - var decode = dict.get('Decode'); - if (!decode) { - decode = range; - } else { - decode = toMultiArray(decode); - } - - var samples = this.getSampleArray(size, outputSize, bps, str); - - return [ - CONSTRUCT_SAMPLED, inputSize, domain, encode, decode, samples, size, - outputSize, Math.pow(2, bps) - 1, range - ]; - }, - - constructSampledFromIR: function PDFFunction_constructSampledFromIR(IR) { - // See chapter 3, page 109 of the PDF reference - function interpolate(x, xmin, xmax, ymin, ymax) { - return ymin + ((x - xmin) * ((ymax - ymin) / (xmax - xmin))); - } - - return function constructSampledFromIRResult(src, srcOffset, - dest, destOffset) { - // See chapter 3, page 110 of the PDF reference. - var m = IR[1]; - var domain = IR[2]; - var encode = IR[3]; - var decode = IR[4]; - var samples = IR[5]; - var size = IR[6]; - var n = IR[7]; - //var mask = IR[8]; - var range = IR[9]; - - // Building the cube vertices: its part and sample index - // http://rjwagner49.com/Mathematics/Interpolation.pdf - var cubeVertices = 1 << m; - var cubeN = new Float64Array(cubeVertices); - var cubeVertex = new Uint32Array(cubeVertices); - var i, j; - for (j = 0; j < cubeVertices; j++) { - cubeN[j] = 1; - } - - var k = n, pos = 1; - // Map x_i to y_j for 0 <= i < m using the sampled function. - for (i = 0; i < m; ++i) { - // x_i' = min(max(x_i, Domain_2i), Domain_2i+1) - var domain_2i = domain[i][0]; - var domain_2i_1 = domain[i][1]; - var xi = Math.min(Math.max(src[srcOffset +i], domain_2i), - domain_2i_1); - - // e_i = Interpolate(x_i', Domain_2i, Domain_2i+1, - // Encode_2i, Encode_2i+1) - var e = interpolate(xi, domain_2i, domain_2i_1, - encode[i][0], encode[i][1]); - - // e_i' = min(max(e_i, 0), Size_i - 1) - var size_i = size[i]; - e = Math.min(Math.max(e, 0), size_i - 1); - - // Adjusting the cube: N and vertex sample index - var e0 = e < size_i - 1 ? Math.floor(e) : e - 1; // e1 = e0 + 1; - var n0 = e0 + 1 - e; // (e1 - e) / (e1 - e0); - var n1 = e - e0; // (e - e0) / (e1 - e0); - var offset0 = e0 * k; - var offset1 = offset0 + k; // e1 * k - for (j = 0; j < cubeVertices; j++) { - if (j & pos) { - cubeN[j] *= n1; - cubeVertex[j] += offset1; - } else { - cubeN[j] *= n0; - cubeVertex[j] += offset0; - } - } - - k *= size_i; - pos <<= 1; - } - - for (j = 0; j < n; ++j) { - // Sum all cube vertices' samples portions - var rj = 0; - for (i = 0; i < cubeVertices; i++) { - rj += samples[cubeVertex[i] + j] * cubeN[i]; - } - - // r_j' = Interpolate(r_j, 0, 2^BitsPerSample - 1, - // Decode_2j, Decode_2j+1) - rj = interpolate(rj, 0, 1, decode[j][0], decode[j][1]); - - // y_j = min(max(r_j, range_2j), range_2j+1) - dest[destOffset + j] = Math.min(Math.max(rj, range[j][0]), - range[j][1]); - } - }; - }, - - constructInterpolated: function PDFFunction_constructInterpolated(str, - dict) { - var c0 = dict.get('C0') || [0]; - var c1 = dict.get('C1') || [1]; - var n = dict.get('N'); - - if (!isArray(c0) || !isArray(c1)) { - error('Illegal dictionary for interpolated function'); - } - - var length = c0.length; - var diff = []; - for (var i = 0; i < length; ++i) { - diff.push(c1[i] - c0[i]); - } - - return [CONSTRUCT_INTERPOLATED, c0, diff, n]; - }, - - constructInterpolatedFromIR: - function PDFFunction_constructInterpolatedFromIR(IR) { - var c0 = IR[1]; - var diff = IR[2]; - var n = IR[3]; - - var length = diff.length; - - return function constructInterpolatedFromIRResult(src, srcOffset, - dest, destOffset) { - var x = n === 1 ? src[srcOffset] : Math.pow(src[srcOffset], n); - - for (var j = 0; j < length; ++j) { - dest[destOffset + j] = c0[j] + (x * diff[j]); - } - }; - }, - - constructStiched: function PDFFunction_constructStiched(fn, dict, xref) { - var domain = dict.get('Domain'); - - if (!domain) { - error('No domain'); - } - - var inputSize = domain.length / 2; - if (inputSize !== 1) { - error('Bad domain for stiched function'); - } - - var fnRefs = dict.get('Functions'); - var fns = []; - for (var i = 0, ii = fnRefs.length; i < ii; ++i) { - fns.push(PDFFunction.getIR(xref, xref.fetchIfRef(fnRefs[i]))); - } - - var bounds = dict.get('Bounds'); - var encode = dict.get('Encode'); - - return [CONSTRUCT_STICHED, domain, bounds, encode, fns]; - }, - - constructStichedFromIR: function PDFFunction_constructStichedFromIR(IR) { - var domain = IR[1]; - var bounds = IR[2]; - var encode = IR[3]; - var fnsIR = IR[4]; - var fns = []; - var tmpBuf = new Float32Array(1); - - for (var i = 0, ii = fnsIR.length; i < ii; i++) { - fns.push(PDFFunction.fromIR(fnsIR[i])); - } - - return function constructStichedFromIRResult(src, srcOffset, - dest, destOffset) { - var clip = function constructStichedFromIRClip(v, min, max) { - if (v > max) { - v = max; - } else if (v < min) { - v = min; - } - return v; - }; - - // clip to domain - var v = clip(src[srcOffset], domain[0], domain[1]); - // calulate which bound the value is in - for (var i = 0, ii = bounds.length; i < ii; ++i) { - if (v < bounds[i]) { - break; - } - } - - // encode value into domain of function - var dmin = domain[0]; - if (i > 0) { - dmin = bounds[i - 1]; - } - var dmax = domain[1]; - if (i < bounds.length) { - dmax = bounds[i]; - } - - var rmin = encode[2 * i]; - var rmax = encode[2 * i + 1]; - - // Prevent the value from becoming NaN as a result - // of division by zero (fixes issue6113.pdf). - tmpBuf[0] = dmin === dmax ? rmin : - rmin + (v - dmin) * (rmax - rmin) / (dmax - dmin); - - // call the appropriate function - fns[i](tmpBuf, 0, dest, destOffset); - }; - }, - - constructPostScript: function PDFFunction_constructPostScript(fn, dict, - xref) { - var domain = dict.get('Domain'); - var range = dict.get('Range'); - - if (!domain) { - error('No domain.'); - } - - if (!range) { - error('No range.'); - } - - var lexer = new PostScriptLexer(fn); - var parser = new PostScriptParser(lexer); - var code = parser.parse(); - - return [CONSTRUCT_POSTSCRIPT, domain, range, code]; - }, - - constructPostScriptFromIR: function PDFFunction_constructPostScriptFromIR( - IR) { - var domain = IR[1]; - var range = IR[2]; - var code = IR[3]; - - var compiled = (new PostScriptCompiler()).compile(code, domain, range); - if (compiled) { - // Compiled function consists of simple expressions such as addition, - // subtraction, Math.max, and also contains 'var' and 'return' - // statements. See the generation in the PostScriptCompiler below. - /*jshint -W054 */ - return new Function('src', 'srcOffset', 'dest', 'destOffset', compiled); - } - - info('Unable to compile PS function'); - - var numOutputs = range.length >> 1; - var numInputs = domain.length >> 1; - var evaluator = new PostScriptEvaluator(code); - // Cache the values for a big speed up, the cache size is limited though - // since the number of possible values can be huge from a PS function. - var cache = {}; - // The MAX_CACHE_SIZE is set to ~4x the maximum number of distinct values - // seen in our tests. - var MAX_CACHE_SIZE = 2048 * 4; - var cache_available = MAX_CACHE_SIZE; - var tmpBuf = new Float32Array(numInputs); - - return function constructPostScriptFromIRResult(src, srcOffset, - dest, destOffset) { - var i, value; - var key = ''; - var input = tmpBuf; - for (i = 0; i < numInputs; i++) { - value = src[srcOffset + i]; - input[i] = value; - key += value + '_'; - } - - var cachedValue = cache[key]; - if (cachedValue !== undefined) { - dest.set(cachedValue, destOffset); - return; - } - - var output = new Float32Array(numOutputs); - var stack = evaluator.execute(input); - var stackIndex = stack.length - numOutputs; - for (i = 0; i < numOutputs; i++) { - value = stack[stackIndex + i]; - var bound = range[i * 2]; - if (value < bound) { - value = bound; - } else { - bound = range[i * 2 +1]; - if (value > bound) { - value = bound; - } - } - output[i] = value; - } - if (cache_available > 0) { - cache_available--; - cache[key] = output; - } - dest.set(output, destOffset); - }; - } - }; -})(); - -function isPDFFunction(v) { - var fnDict; - if (typeof v !== 'object') { - return false; - } else if (isDict(v)) { - fnDict = v; - } else if (isStream(v)) { - fnDict = v.dict; - } else { - return false; - } - return fnDict.has('FunctionType'); -} - -var PostScriptStack = (function PostScriptStackClosure() { - var MAX_STACK_SIZE = 100; - function PostScriptStack(initialStack) { - this.stack = !initialStack ? [] : - Array.prototype.slice.call(initialStack, 0); - } - - PostScriptStack.prototype = { - push: function PostScriptStack_push(value) { - if (this.stack.length >= MAX_STACK_SIZE) { - error('PostScript function stack overflow.'); - } - this.stack.push(value); - }, - pop: function PostScriptStack_pop() { - if (this.stack.length <= 0) { - error('PostScript function stack underflow.'); - } - return this.stack.pop(); - }, - copy: function PostScriptStack_copy(n) { - if (this.stack.length + n >= MAX_STACK_SIZE) { - error('PostScript function stack overflow.'); - } - var stack = this.stack; - for (var i = stack.length - n, j = n - 1; j >= 0; j--, i++) { - stack.push(stack[i]); - } - }, - index: function PostScriptStack_index(n) { - this.push(this.stack[this.stack.length - n - 1]); - }, - // rotate the last n stack elements p times - roll: function PostScriptStack_roll(n, p) { - var stack = this.stack; - var l = stack.length - n; - var r = stack.length - 1, c = l + (p - Math.floor(p / n) * n), i, j, t; - for (i = l, j = r; i < j; i++, j--) { - t = stack[i]; stack[i] = stack[j]; stack[j] = t; - } - for (i = l, j = c - 1; i < j; i++, j--) { - t = stack[i]; stack[i] = stack[j]; stack[j] = t; - } - for (i = c, j = r; i < j; i++, j--) { - t = stack[i]; stack[i] = stack[j]; stack[j] = t; - } - } - }; - return PostScriptStack; -})(); -var PostScriptEvaluator = (function PostScriptEvaluatorClosure() { - function PostScriptEvaluator(operators) { - this.operators = operators; - } - PostScriptEvaluator.prototype = { - execute: function PostScriptEvaluator_execute(initialStack) { - var stack = new PostScriptStack(initialStack); - var counter = 0; - var operators = this.operators; - var length = operators.length; - var operator, a, b; - while (counter < length) { - operator = operators[counter++]; - if (typeof operator === 'number') { - // Operator is really an operand and should be pushed to the stack. - stack.push(operator); - continue; - } - switch (operator) { - // non standard ps operators - case 'jz': // jump if false - b = stack.pop(); - a = stack.pop(); - if (!a) { - counter = b; - } - break; - case 'j': // jump - a = stack.pop(); - counter = a; - break; - - // all ps operators in alphabetical order (excluding if/ifelse) - case 'abs': - a = stack.pop(); - stack.push(Math.abs(a)); - break; - case 'add': - b = stack.pop(); - a = stack.pop(); - stack.push(a + b); - break; - case 'and': - b = stack.pop(); - a = stack.pop(); - if (isBool(a) && isBool(b)) { - stack.push(a && b); - } else { - stack.push(a & b); - } - break; - case 'atan': - a = stack.pop(); - stack.push(Math.atan(a)); - break; - case 'bitshift': - b = stack.pop(); - a = stack.pop(); - if (a > 0) { - stack.push(a << b); - } else { - stack.push(a >> b); - } - break; - case 'ceiling': - a = stack.pop(); - stack.push(Math.ceil(a)); - break; - case 'copy': - a = stack.pop(); - stack.copy(a); - break; - case 'cos': - a = stack.pop(); - stack.push(Math.cos(a)); - break; - case 'cvi': - a = stack.pop() | 0; - stack.push(a); - break; - case 'cvr': - // noop - break; - case 'div': - b = stack.pop(); - a = stack.pop(); - stack.push(a / b); - break; - case 'dup': - stack.copy(1); - break; - case 'eq': - b = stack.pop(); - a = stack.pop(); - stack.push(a === b); - break; - case 'exch': - stack.roll(2, 1); - break; - case 'exp': - b = stack.pop(); - a = stack.pop(); - stack.push(Math.pow(a, b)); - break; - case 'false': - stack.push(false); - break; - case 'floor': - a = stack.pop(); - stack.push(Math.floor(a)); - break; - case 'ge': - b = stack.pop(); - a = stack.pop(); - stack.push(a >= b); - break; - case 'gt': - b = stack.pop(); - a = stack.pop(); - stack.push(a > b); - break; - case 'idiv': - b = stack.pop(); - a = stack.pop(); - stack.push((a / b) | 0); - break; - case 'index': - a = stack.pop(); - stack.index(a); - break; - case 'le': - b = stack.pop(); - a = stack.pop(); - stack.push(a <= b); - break; - case 'ln': - a = stack.pop(); - stack.push(Math.log(a)); - break; - case 'log': - a = stack.pop(); - stack.push(Math.log(a) / Math.LN10); - break; - case 'lt': - b = stack.pop(); - a = stack.pop(); - stack.push(a < b); - break; - case 'mod': - b = stack.pop(); - a = stack.pop(); - stack.push(a % b); - break; - case 'mul': - b = stack.pop(); - a = stack.pop(); - stack.push(a * b); - break; - case 'ne': - b = stack.pop(); - a = stack.pop(); - stack.push(a !== b); - break; - case 'neg': - a = stack.pop(); - stack.push(-a); - break; - case 'not': - a = stack.pop(); - if (isBool(a)) { - stack.push(!a); - } else { - stack.push(~a); - } - break; - case 'or': - b = stack.pop(); - a = stack.pop(); - if (isBool(a) && isBool(b)) { - stack.push(a || b); - } else { - stack.push(a | b); - } - break; - case 'pop': - stack.pop(); - break; - case 'roll': - b = stack.pop(); - a = stack.pop(); - stack.roll(a, b); - break; - case 'round': - a = stack.pop(); - stack.push(Math.round(a)); - break; - case 'sin': - a = stack.pop(); - stack.push(Math.sin(a)); - break; - case 'sqrt': - a = stack.pop(); - stack.push(Math.sqrt(a)); - break; - case 'sub': - b = stack.pop(); - a = stack.pop(); - stack.push(a - b); - break; - case 'true': - stack.push(true); - break; - case 'truncate': - a = stack.pop(); - a = a < 0 ? Math.ceil(a) : Math.floor(a); - stack.push(a); - break; - case 'xor': - b = stack.pop(); - a = stack.pop(); - if (isBool(a) && isBool(b)) { - stack.push(a !== b); - } else { - stack.push(a ^ b); - } - break; - default: - error('Unknown operator ' + operator); - break; - } - } - return stack.stack; - } - }; - return PostScriptEvaluator; -})(); - -// Most of the PDFs functions consist of simple operations such as: -// roll, exch, sub, cvr, pop, index, dup, mul, if, gt, add. -// -// We can compile most of such programs, and at the same moment, we can -// optimize some expressions using basic math properties. Keeping track of -// min/max values will allow us to avoid extra Math.min/Math.max calls. -var PostScriptCompiler = (function PostScriptCompilerClosure() { - function AstNode(type) { - this.type = type; - } - AstNode.prototype.visit = function (visitor) { - throw new Error('abstract method'); - }; - - function AstArgument(index, min, max) { - AstNode.call(this, 'args'); - this.index = index; - this.min = min; - this.max = max; - } - AstArgument.prototype = Object.create(AstNode.prototype); - AstArgument.prototype.visit = function (visitor) { - visitor.visitArgument(this); - }; - - function AstLiteral(number) { - AstNode.call(this, 'literal'); - this.number = number; - this.min = number; - this.max = number; - } - AstLiteral.prototype = Object.create(AstNode.prototype); - AstLiteral.prototype.visit = function (visitor) { - visitor.visitLiteral(this); - }; - - function AstBinaryOperation(op, arg1, arg2, min, max) { - AstNode.call(this, 'binary'); - this.op = op; - this.arg1 = arg1; - this.arg2 = arg2; - this.min = min; - this.max = max; - } - AstBinaryOperation.prototype = Object.create(AstNode.prototype); - AstBinaryOperation.prototype.visit = function (visitor) { - visitor.visitBinaryOperation(this); - }; - - function AstMin(arg, max) { - AstNode.call(this, 'max'); - this.arg = arg; - this.min = arg.min; - this.max = max; - } - AstMin.prototype = Object.create(AstNode.prototype); - AstMin.prototype.visit = function (visitor) { - visitor.visitMin(this); - }; - - function AstVariable(index, min, max) { - AstNode.call(this, 'var'); - this.index = index; - this.min = min; - this.max = max; - } - AstVariable.prototype = Object.create(AstNode.prototype); - AstVariable.prototype.visit = function (visitor) { - visitor.visitVariable(this); - }; - - function AstVariableDefinition(variable, arg) { - AstNode.call(this, 'definition'); - this.variable = variable; - this.arg = arg; - } - AstVariableDefinition.prototype = Object.create(AstNode.prototype); - AstVariableDefinition.prototype.visit = function (visitor) { - visitor.visitVariableDefinition(this); - }; - - function ExpressionBuilderVisitor() { - this.parts = []; - } - ExpressionBuilderVisitor.prototype = { - visitArgument: function (arg) { - this.parts.push('Math.max(', arg.min, ', Math.min(', - arg.max, ', src[srcOffset + ', arg.index, ']))'); - }, - visitVariable: function (variable) { - this.parts.push('v', variable.index); - }, - visitLiteral: function (literal) { - this.parts.push(literal.number); - }, - visitBinaryOperation: function (operation) { - this.parts.push('('); - operation.arg1.visit(this); - this.parts.push(' ', operation.op, ' '); - operation.arg2.visit(this); - this.parts.push(')'); - }, - visitVariableDefinition: function (definition) { - this.parts.push('var '); - definition.variable.visit(this); - this.parts.push(' = '); - definition.arg.visit(this); - this.parts.push(';'); - }, - visitMin: function (max) { - this.parts.push('Math.min('); - max.arg.visit(this); - this.parts.push(', ', max.max, ')'); - }, - toString: function () { - return this.parts.join(''); - } - }; - - function buildAddOperation(num1, num2) { - if (num2.type === 'literal' && num2.number === 0) { - // optimization: second operand is 0 - return num1; - } - if (num1.type === 'literal' && num1.number === 0) { - // optimization: first operand is 0 - return num2; - } - if (num2.type === 'literal' && num1.type === 'literal') { - // optimization: operands operand are literals - return new AstLiteral(num1.number + num2.number); - } - return new AstBinaryOperation('+', num1, num2, - num1.min + num2.min, num1.max + num2.max); - } - - function buildMulOperation(num1, num2) { - if (num2.type === 'literal') { - // optimization: second operands is a literal... - if (num2.number === 0) { - return new AstLiteral(0); // and it's 0 - } else if (num2.number === 1) { - return num1; // and it's 1 - } else if (num1.type === 'literal') { - // ... and first operands is a literal too - return new AstLiteral(num1.number * num2.number); - } - } - if (num1.type === 'literal') { - // optimization: first operands is a literal... - if (num1.number === 0) { - return new AstLiteral(0); // and it's 0 - } else if (num1.number === 1) { - return num2; // and it's 1 - } - } - var min = Math.min(num1.min * num2.min, num1.min * num2.max, - num1.max * num2.min, num1.max * num2.max); - var max = Math.max(num1.min * num2.min, num1.min * num2.max, - num1.max * num2.min, num1.max * num2.max); - return new AstBinaryOperation('*', num1, num2, min, max); - } - - function buildSubOperation(num1, num2) { - if (num2.type === 'literal') { - // optimization: second operands is a literal... - if (num2.number === 0) { - return num1; // ... and it's 0 - } else if (num1.type === 'literal') { - // ... and first operands is a literal too - return new AstLiteral(num1.number - num2.number); - } - } - if (num2.type === 'binary' && num2.op === '-' && - num1.type === 'literal' && num1.number === 1 && - num2.arg1.type === 'literal' && num2.arg1.number === 1) { - // optimization for case: 1 - (1 - x) - return num2.arg2; - } - return new AstBinaryOperation('-', num1, num2, - num1.min - num2.max, num1.max - num2.min); - } - - function buildMinOperation(num1, max) { - if (num1.min >= max) { - // optimization: num1 min value is not less than required max - return new AstLiteral(max); // just returning max - } else if (num1.max <= max) { - // optimization: num1 max value is not greater than required max - return num1; // just returning an argument - } - return new AstMin(num1, max); - } - - function PostScriptCompiler() {} - PostScriptCompiler.prototype = { - compile: function PostScriptCompiler_compile(code, domain, range) { - var stack = []; - var i, ii; - var instructions = []; - var inputSize = domain.length >> 1, outputSize = range.length >> 1; - var lastRegister = 0; - var n, j, min, max; - var num1, num2, ast1, ast2, tmpVar, item; - for (i = 0; i < inputSize; i++) { - stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1])); - } - - for (i = 0, ii = code.length; i < ii; i++) { - item = code[i]; - if (typeof item === 'number') { - stack.push(new AstLiteral(item)); - continue; - } - - switch (item) { - case 'add': - if (stack.length < 2) { - return null; - } - num2 = stack.pop(); - num1 = stack.pop(); - stack.push(buildAddOperation(num1, num2)); - break; - case 'cvr': - if (stack.length < 1) { - return null; - } - break; - case 'mul': - if (stack.length < 2) { - return null; - } - num2 = stack.pop(); - num1 = stack.pop(); - stack.push(buildMulOperation(num1, num2)); - break; - case 'sub': - if (stack.length < 2) { - return null; - } - num2 = stack.pop(); - num1 = stack.pop(); - stack.push(buildSubOperation(num1, num2)); - break; - case 'exch': - if (stack.length < 2) { - return null; - } - ast1 = stack.pop(); ast2 = stack.pop(); - stack.push(ast1, ast2); - break; - case 'pop': - if (stack.length < 1) { - return null; - } - stack.pop(); - break; - case 'index': - if (stack.length < 1) { - return null; - } - num1 = stack.pop(); - if (num1.type !== 'literal') { - return null; - } - n = num1.number; - if (n < 0 || (n|0) !== n || stack.length < n) { - return null; - } - ast1 = stack[stack.length - n - 1]; - if (ast1.type === 'literal' || ast1.type === 'var') { - stack.push(ast1); - break; - } - tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); - stack[stack.length - n - 1] = tmpVar; - stack.push(tmpVar); - instructions.push(new AstVariableDefinition(tmpVar, ast1)); - break; - case 'dup': - if (stack.length < 1) { - return null; - } - if (typeof code[i + 1] === 'number' && code[i + 2] === 'gt' && - code[i + 3] === i + 7 && code[i + 4] === 'jz' && - code[i + 5] === 'pop' && code[i + 6] === code[i + 1]) { - // special case of the commands sequence for the min operation - num1 = stack.pop(); - stack.push(buildMinOperation(num1, code[i + 1])); - i += 6; - break; - } - ast1 = stack[stack.length - 1]; - if (ast1.type === 'literal' || ast1.type === 'var') { - // we don't have to save into intermediate variable a literal or - // variable. - stack.push(ast1); - break; - } - tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); - stack[stack.length - 1] = tmpVar; - stack.push(tmpVar); - instructions.push(new AstVariableDefinition(tmpVar, ast1)); - break; - case 'roll': - if (stack.length < 2) { - return null; - } - num2 = stack.pop(); - num1 = stack.pop(); - if (num2.type !== 'literal' || num1.type !== 'literal') { - // both roll operands must be numbers - return null; - } - j = num2.number; - n = num1.number; - if (n <= 0 || (n|0) !== n || (j|0) !== j || stack.length < n) { - // ... and integers - return null; - } - j = ((j % n) + n) % n; - if (j === 0) { - break; // just skipping -- there are nothing to rotate - } - Array.prototype.push.apply(stack, - stack.splice(stack.length - n, n - j)); - break; - default: - return null; // unsupported operator - } - } - - if (stack.length !== outputSize) { - return null; - } - - var result = []; - instructions.forEach(function (instruction) { - var statementBuilder = new ExpressionBuilderVisitor(); - instruction.visit(statementBuilder); - result.push(statementBuilder.toString()); - }); - stack.forEach(function (expr, i) { - var statementBuilder = new ExpressionBuilderVisitor(); - expr.visit(statementBuilder); - var min = range[i * 2], max = range[i * 2 + 1]; - var out = [statementBuilder.toString()]; - if (min > expr.min) { - out.unshift('Math.max(', min, ', '); - out.push(')'); - } - if (max < expr.max) { - out.unshift('Math.min(', max, ', '); - out.push(')'); - } - out.unshift('dest[destOffset + ', i, '] = '); - out.push(';'); - result.push(out.join('')); - }); - return result.join('\n'); - } - }; - - return PostScriptCompiler; -})(); - - -var ColorSpace = (function ColorSpaceClosure() { - // Constructor should define this.numComps, this.defaultColor, this.name - function ColorSpace() { - error('should not call ColorSpace constructor'); - } - - ColorSpace.prototype = { - /** - * Converts the color value to the RGB color. The color components are - * located in the src array starting from the srcOffset. Returns the array - * of the rgb components, each value ranging from [0,255]. - */ - getRgb: function ColorSpace_getRgb(src, srcOffset) { - var rgb = new Uint8Array(3); - this.getRgbItem(src, srcOffset, rgb, 0); - return rgb; - }, - /** - * Converts the color value to the RGB color, similar to the getRgb method. - * The result placed into the dest array starting from the destOffset. - */ - getRgbItem: function ColorSpace_getRgbItem(src, srcOffset, - dest, destOffset) { - error('Should not call ColorSpace.getRgbItem'); - }, - /** - * Converts the specified number of the color values to the RGB colors. - * The colors are located in the src array starting from the srcOffset. - * The result is placed into the dest array starting from the destOffset. - * The src array items shall be in [0,2^bits) range, the dest array items - * will be in [0,255] range. alpha01 indicates how many alpha components - * there are in the dest array; it will be either 0 (RGB array) or 1 (RGBA - * array). - */ - getRgbBuffer: function ColorSpace_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - error('Should not call ColorSpace.getRgbBuffer'); - }, - /** - * Determines the number of bytes required to store the result of the - * conversion done by the getRgbBuffer method. As in getRgbBuffer, - * |alpha01| is either 0 (RGB output) or 1 (RGBA output). - */ - getOutputLength: function ColorSpace_getOutputLength(inputLength, - alpha01) { - error('Should not call ColorSpace.getOutputLength'); - }, - /** - * Returns true if source data will be equal the result/output data. - */ - isPassthrough: function ColorSpace_isPassthrough(bits) { - return false; - }, - /** - * Fills in the RGB colors in the destination buffer. alpha01 indicates - * how many alpha components there are in the dest array; it will be either - * 0 (RGB array) or 1 (RGBA array). - */ - fillRgb: function ColorSpace_fillRgb(dest, originalWidth, - originalHeight, width, height, - actualHeight, bpc, comps, alpha01) { - var count = originalWidth * originalHeight; - var rgbBuf = null; - var numComponentColors = 1 << bpc; - var needsResizing = originalHeight !== height || originalWidth !== width; - var i, ii; - - if (this.isPassthrough(bpc)) { - rgbBuf = comps; - } else if (this.numComps === 1 && count > numComponentColors && - this.name !== 'DeviceGray' && this.name !== 'DeviceRGB') { - // Optimization: create a color map when there is just one component and - // we are converting more colors than the size of the color map. We - // don't build the map if the colorspace is gray or rgb since those - // methods are faster than building a map. This mainly offers big speed - // ups for indexed and alternate colorspaces. - // - // TODO it may be worth while to cache the color map. While running - // testing I never hit a cache so I will leave that out for now (perhaps - // we are reparsing colorspaces too much?). - var allColors = bpc <= 8 ? new Uint8Array(numComponentColors) : - new Uint16Array(numComponentColors); - var key; - for (i = 0; i < numComponentColors; i++) { - allColors[i] = i; - } - var colorMap = new Uint8Array(numComponentColors * 3); - this.getRgbBuffer(allColors, 0, numComponentColors, colorMap, 0, bpc, - /* alpha01 = */ 0); - - var destPos, rgbPos; - if (!needsResizing) { - // Fill in the RGB values directly into |dest|. - destPos = 0; - for (i = 0; i < count; ++i) { - key = comps[i] * 3; - dest[destPos++] = colorMap[key]; - dest[destPos++] = colorMap[key + 1]; - dest[destPos++] = colorMap[key + 2]; - destPos += alpha01; - } - } else { - rgbBuf = new Uint8Array(count * 3); - rgbPos = 0; - for (i = 0; i < count; ++i) { - key = comps[i] * 3; - rgbBuf[rgbPos++] = colorMap[key]; - rgbBuf[rgbPos++] = colorMap[key + 1]; - rgbBuf[rgbPos++] = colorMap[key + 2]; - } - } - } else { - if (!needsResizing) { - // Fill in the RGB values directly into |dest|. - this.getRgbBuffer(comps, 0, width * actualHeight, dest, 0, bpc, - alpha01); - } else { - rgbBuf = new Uint8Array(count * 3); - this.getRgbBuffer(comps, 0, count, rgbBuf, 0, bpc, - /* alpha01 = */ 0); - } - } - - if (rgbBuf) { - if (needsResizing) { - PDFImage.resize(rgbBuf, bpc, 3, originalWidth, originalHeight, width, - height, dest, alpha01); - } else { - rgbPos = 0; - destPos = 0; - for (i = 0, ii = width * actualHeight; i < ii; i++) { - dest[destPos++] = rgbBuf[rgbPos++]; - dest[destPos++] = rgbBuf[rgbPos++]; - dest[destPos++] = rgbBuf[rgbPos++]; - destPos += alpha01; - } - } - } - }, - /** - * True if the colorspace has components in the default range of [0, 1]. - * This should be true for all colorspaces except for lab color spaces - * which are [0,100], [-128, 127], [-128, 127]. - */ - usesZeroToOneRange: true - }; - - ColorSpace.parse = function ColorSpace_parse(cs, xref, res) { - var IR = ColorSpace.parseToIR(cs, xref, res); - if (IR instanceof AlternateCS) { - return IR; - } - return ColorSpace.fromIR(IR); - }; - - ColorSpace.fromIR = function ColorSpace_fromIR(IR) { - var name = isArray(IR) ? IR[0] : IR; - var whitePoint, blackPoint, gamma; - - switch (name) { - case 'DeviceGrayCS': - return this.singletons.gray; - case 'DeviceRgbCS': - return this.singletons.rgb; - case 'DeviceCmykCS': - return this.singletons.cmyk; - case 'CalGrayCS': - whitePoint = IR[1].WhitePoint; - blackPoint = IR[1].BlackPoint; - gamma = IR[1].Gamma; - return new CalGrayCS(whitePoint, blackPoint, gamma); - case 'CalRGBCS': - whitePoint = IR[1].WhitePoint; - blackPoint = IR[1].BlackPoint; - gamma = IR[1].Gamma; - var matrix = IR[1].Matrix; - return new CalRGBCS(whitePoint, blackPoint, gamma, matrix); - case 'PatternCS': - var basePatternCS = IR[1]; - if (basePatternCS) { - basePatternCS = ColorSpace.fromIR(basePatternCS); - } - return new PatternCS(basePatternCS); - case 'IndexedCS': - var baseIndexedCS = IR[1]; - var hiVal = IR[2]; - var lookup = IR[3]; - return new IndexedCS(ColorSpace.fromIR(baseIndexedCS), hiVal, lookup); - case 'AlternateCS': - var numComps = IR[1]; - var alt = IR[2]; - var tintFnIR = IR[3]; - - return new AlternateCS(numComps, ColorSpace.fromIR(alt), - PDFFunction.fromIR(tintFnIR)); - case 'LabCS': - whitePoint = IR[1].WhitePoint; - blackPoint = IR[1].BlackPoint; - var range = IR[1].Range; - return new LabCS(whitePoint, blackPoint, range); - default: - error('Unknown name ' + name); - } - return null; - }; - - ColorSpace.parseToIR = function ColorSpace_parseToIR(cs, xref, res) { - if (isName(cs)) { - var colorSpaces = res.get('ColorSpace'); - if (isDict(colorSpaces)) { - var refcs = colorSpaces.get(cs.name); - if (refcs) { - cs = refcs; - } - } - } - - cs = xref.fetchIfRef(cs); - var mode; - - if (isName(cs)) { - mode = cs.name; - this.mode = mode; - - switch (mode) { - case 'DeviceGray': - case 'G': - return 'DeviceGrayCS'; - case 'DeviceRGB': - case 'RGB': - return 'DeviceRgbCS'; - case 'DeviceCMYK': - case 'CMYK': - return 'DeviceCmykCS'; - case 'Pattern': - return ['PatternCS', null]; - default: - error('unrecognized colorspace ' + mode); - } - } else if (isArray(cs)) { - mode = xref.fetchIfRef(cs[0]).name; - this.mode = mode; - var numComps, params, alt; - - switch (mode) { - case 'DeviceGray': - case 'G': - return 'DeviceGrayCS'; - case 'DeviceRGB': - case 'RGB': - return 'DeviceRgbCS'; - case 'DeviceCMYK': - case 'CMYK': - return 'DeviceCmykCS'; - case 'CalGray': - params = xref.fetchIfRef(cs[1]).getAll(); - return ['CalGrayCS', params]; - case 'CalRGB': - params = xref.fetchIfRef(cs[1]).getAll(); - return ['CalRGBCS', params]; - case 'ICCBased': - var stream = xref.fetchIfRef(cs[1]); - var dict = stream.dict; - numComps = dict.get('N'); - alt = dict.get('Alternate'); - if (alt) { - var altIR = ColorSpace.parseToIR(alt, xref, res); - // Parse the /Alternate CS to ensure that the number of components - // are correct, and also (indirectly) that it is not a PatternCS. - var altCS = ColorSpace.fromIR(altIR); - if (altCS.numComps === numComps) { - return altIR; - } - warn('ICCBased color space: Ignoring incorrect /Alternate entry.'); - } - if (numComps === 1) { - return 'DeviceGrayCS'; - } else if (numComps === 3) { - return 'DeviceRgbCS'; - } else if (numComps === 4) { - return 'DeviceCmykCS'; - } - break; - case 'Pattern': - var basePatternCS = cs[1] || null; - if (basePatternCS) { - basePatternCS = ColorSpace.parseToIR(basePatternCS, xref, res); - } - return ['PatternCS', basePatternCS]; - case 'Indexed': - case 'I': - var baseIndexedCS = ColorSpace.parseToIR(cs[1], xref, res); - var hiVal = xref.fetchIfRef(cs[2]) + 1; - var lookup = xref.fetchIfRef(cs[3]); - if (isStream(lookup)) { - lookup = lookup.getBytes(); - } - return ['IndexedCS', baseIndexedCS, hiVal, lookup]; - case 'Separation': - case 'DeviceN': - var name = xref.fetchIfRef(cs[1]); - numComps = 1; - if (isName(name)) { - numComps = 1; - } else if (isArray(name)) { - numComps = name.length; - } - alt = ColorSpace.parseToIR(cs[2], xref, res); - var tintFnIR = PDFFunction.getIR(xref, xref.fetchIfRef(cs[3])); - return ['AlternateCS', numComps, alt, tintFnIR]; - case 'Lab': - params = xref.fetchIfRef(cs[1]).getAll(); - return ['LabCS', params]; - default: - error('unimplemented color space object "' + mode + '"'); - } - } else { - error('unrecognized color space object: "' + cs + '"'); - } - return null; - }; - /** - * Checks if a decode map matches the default decode map for a color space. - * This handles the general decode maps where there are two values per - * component. e.g. [0, 1, 0, 1, 0, 1] for a RGB color. - * This does not handle Lab, Indexed, or Pattern decode maps since they are - * slightly different. - * @param {Array} decode Decode map (usually from an image). - * @param {Number} n Number of components the color space has. - */ - ColorSpace.isDefaultDecode = function ColorSpace_isDefaultDecode(decode, n) { - if (!isArray(decode)) { - return true; - } - - if (n * 2 !== decode.length) { - warn('The decode map is not the correct length'); - return true; - } - for (var i = 0, ii = decode.length; i < ii; i += 2) { - if (decode[i] !== 0 || decode[i + 1] !== 1) { - return false; - } - } - return true; - }; - - ColorSpace.singletons = { - get gray() { - return shadow(this, 'gray', new DeviceGrayCS()); - }, - get rgb() { - return shadow(this, 'rgb', new DeviceRgbCS()); - }, - get cmyk() { - return shadow(this, 'cmyk', new DeviceCmykCS()); - } - }; - - return ColorSpace; -})(); - -/** - * Alternate color space handles both Separation and DeviceN color spaces. A - * Separation color space is actually just a DeviceN with one color component. - * Both color spaces use a tinting function to convert colors to a base color - * space. - */ -var AlternateCS = (function AlternateCSClosure() { - function AlternateCS(numComps, base, tintFn) { - this.name = 'Alternate'; - this.numComps = numComps; - this.defaultColor = new Float32Array(numComps); - for (var i = 0; i < numComps; ++i) { - this.defaultColor[i] = 1; - } - this.base = base; - this.tintFn = tintFn; - this.tmpBuf = new Float32Array(base.numComps); - } - - AlternateCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function AlternateCS_getRgbItem(src, srcOffset, - dest, destOffset) { - var tmpBuf = this.tmpBuf; - this.tintFn(src, srcOffset, tmpBuf, 0); - this.base.getRgbItem(tmpBuf, 0, dest, destOffset); - }, - getRgbBuffer: function AlternateCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var tintFn = this.tintFn; - var base = this.base; - var scale = 1 / ((1 << bits) - 1); - var baseNumComps = base.numComps; - var usesZeroToOneRange = base.usesZeroToOneRange; - var isPassthrough = (base.isPassthrough(8) || !usesZeroToOneRange) && - alpha01 === 0; - var pos = isPassthrough ? destOffset : 0; - var baseBuf = isPassthrough ? dest : new Uint8Array(baseNumComps * count); - var numComps = this.numComps; - - var scaled = new Float32Array(numComps); - var tinted = new Float32Array(baseNumComps); - var i, j; - if (usesZeroToOneRange) { - for (i = 0; i < count; i++) { - for (j = 0; j < numComps; j++) { - scaled[j] = src[srcOffset++] * scale; - } - tintFn(scaled, 0, tinted, 0); - for (j = 0; j < baseNumComps; j++) { - baseBuf[pos++] = tinted[j] * 255; - } - } - } else { - for (i = 0; i < count; i++) { - for (j = 0; j < numComps; j++) { - scaled[j] = src[srcOffset++] * scale; - } - tintFn(scaled, 0, tinted, 0); - base.getRgbItem(tinted, 0, baseBuf, pos); - pos += baseNumComps; - } - } - if (!isPassthrough) { - base.getRgbBuffer(baseBuf, 0, count, dest, destOffset, 8, alpha01); - } - }, - getOutputLength: function AlternateCS_getOutputLength(inputLength, - alpha01) { - return this.base.getOutputLength(inputLength * - this.base.numComps / this.numComps, - alpha01); - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function AlternateCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - - return AlternateCS; -})(); - -var PatternCS = (function PatternCSClosure() { - function PatternCS(baseCS) { - this.name = 'Pattern'; - this.base = baseCS; - } - PatternCS.prototype = {}; - - return PatternCS; -})(); - -var IndexedCS = (function IndexedCSClosure() { - function IndexedCS(base, highVal, lookup) { - this.name = 'Indexed'; - this.numComps = 1; - this.defaultColor = new Uint8Array([0]); - this.base = base; - this.highVal = highVal; - - var baseNumComps = base.numComps; - var length = baseNumComps * highVal; - var lookupArray; - - if (isStream(lookup)) { - lookupArray = new Uint8Array(length); - var bytes = lookup.getBytes(length); - lookupArray.set(bytes); - } else if (isString(lookup)) { - lookupArray = new Uint8Array(length); - for (var i = 0; i < length; ++i) { - lookupArray[i] = lookup.charCodeAt(i); - } - } else if (lookup instanceof Uint8Array || lookup instanceof Array) { - lookupArray = lookup; - } else { - error('Unrecognized lookup table: ' + lookup); - } - this.lookup = lookupArray; - } - - IndexedCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function IndexedCS_getRgbItem(src, srcOffset, - dest, destOffset) { - var numComps = this.base.numComps; - var start = src[srcOffset] * numComps; - this.base.getRgbItem(this.lookup, start, dest, destOffset); - }, - getRgbBuffer: function IndexedCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var base = this.base; - var numComps = base.numComps; - var outputDelta = base.getOutputLength(numComps, alpha01); - var lookup = this.lookup; - - for (var i = 0; i < count; ++i) { - var lookupPos = src[srcOffset++] * numComps; - base.getRgbBuffer(lookup, lookupPos, 1, dest, destOffset, 8, alpha01); - destOffset += outputDelta; - } - }, - getOutputLength: function IndexedCS_getOutputLength(inputLength, alpha01) { - return this.base.getOutputLength(inputLength * this.base.numComps, - alpha01); - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function IndexedCS_isDefaultDecode(decodeMap) { - // indexed color maps shouldn't be changed - return true; - }, - usesZeroToOneRange: true - }; - return IndexedCS; -})(); - -var DeviceGrayCS = (function DeviceGrayCSClosure() { - function DeviceGrayCS() { - this.name = 'DeviceGray'; - this.numComps = 1; - this.defaultColor = new Float32Array([0]); - } - - DeviceGrayCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function DeviceGrayCS_getRgbItem(src, srcOffset, - dest, destOffset) { - var c = (src[srcOffset] * 255) | 0; - c = c < 0 ? 0 : c > 255 ? 255 : c; - dest[destOffset] = dest[destOffset + 1] = dest[destOffset + 2] = c; - }, - getRgbBuffer: function DeviceGrayCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var scale = 255 / ((1 << bits) - 1); - var j = srcOffset, q = destOffset; - for (var i = 0; i < count; ++i) { - var c = (scale * src[j++]) | 0; - dest[q++] = c; - dest[q++] = c; - dest[q++] = c; - q += alpha01; - } - }, - getOutputLength: function DeviceGrayCS_getOutputLength(inputLength, - alpha01) { - return inputLength * (3 + alpha01); - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function DeviceGrayCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - return DeviceGrayCS; -})(); - -var DeviceRgbCS = (function DeviceRgbCSClosure() { - function DeviceRgbCS() { - this.name = 'DeviceRGB'; - this.numComps = 3; - this.defaultColor = new Float32Array([0, 0, 0]); - } - DeviceRgbCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function DeviceRgbCS_getRgbItem(src, srcOffset, - dest, destOffset) { - var r = (src[srcOffset] * 255) | 0; - var g = (src[srcOffset + 1] * 255) | 0; - var b = (src[srcOffset + 2] * 255) | 0; - dest[destOffset] = r < 0 ? 0 : r > 255 ? 255 : r; - dest[destOffset + 1] = g < 0 ? 0 : g > 255 ? 255 : g; - dest[destOffset + 2] = b < 0 ? 0 : b > 255 ? 255 : b; - }, - getRgbBuffer: function DeviceRgbCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - if (bits === 8 && alpha01 === 0) { - dest.set(src.subarray(srcOffset, srcOffset + count * 3), destOffset); - return; - } - var scale = 255 / ((1 << bits) - 1); - var j = srcOffset, q = destOffset; - for (var i = 0; i < count; ++i) { - dest[q++] = (scale * src[j++]) | 0; - dest[q++] = (scale * src[j++]) | 0; - dest[q++] = (scale * src[j++]) | 0; - q += alpha01; - } - }, - getOutputLength: function DeviceRgbCS_getOutputLength(inputLength, - alpha01) { - return (inputLength * (3 + alpha01) / 3) | 0; - }, - isPassthrough: function DeviceRgbCS_isPassthrough(bits) { - return bits === 8; - }, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function DeviceRgbCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - return DeviceRgbCS; -})(); - -var DeviceCmykCS = (function DeviceCmykCSClosure() { - // The coefficients below was found using numerical analysis: the method of - // steepest descent for the sum((f_i - color_value_i)^2) for r/g/b colors, - // where color_value is the tabular value from the table of sampled RGB colors - // from CMYK US Web Coated (SWOP) colorspace, and f_i is the corresponding - // CMYK color conversion using the estimation below: - // f(A, B,.. N) = Acc+Bcm+Ccy+Dck+c+Fmm+Gmy+Hmk+Im+Jyy+Kyk+Ly+Mkk+Nk+255 - function convertToRgb(src, srcOffset, srcScale, dest, destOffset) { - var c = src[srcOffset + 0] * srcScale; - var m = src[srcOffset + 1] * srcScale; - var y = src[srcOffset + 2] * srcScale; - var k = src[srcOffset + 3] * srcScale; - - var r = - (c * (-4.387332384609988 * c + 54.48615194189176 * m + - 18.82290502165302 * y + 212.25662451639585 * k + - -285.2331026137004) + - m * (1.7149763477362134 * m - 5.6096736904047315 * y + - -17.873870861415444 * k - 5.497006427196366) + - y * (-2.5217340131683033 * y - 21.248923337353073 * k + - 17.5119270841813) + - k * (-21.86122147463605 * k - 189.48180835922747) + 255) | 0; - var g = - (c * (8.841041422036149 * c + 60.118027045597366 * m + - 6.871425592049007 * y + 31.159100130055922 * k + - -79.2970844816548) + - m * (-15.310361306967817 * m + 17.575251261109482 * y + - 131.35250912493976 * k - 190.9453302588951) + - y * (4.444339102852739 * y + 9.8632861493405 * k - 24.86741582555878) + - k * (-20.737325471181034 * k - 187.80453709719578) + 255) | 0; - var b = - (c * (0.8842522430003296 * c + 8.078677503112928 * m + - 30.89978309703729 * y - 0.23883238689178934 * k + - -14.183576799673286) + - m * (10.49593273432072 * m + 63.02378494754052 * y + - 50.606957656360734 * k - 112.23884253719248) + - y * (0.03296041114873217 * y + 115.60384449646641 * k + - -193.58209356861505) + - k * (-22.33816807309886 * k - 180.12613974708367) + 255) | 0; - - dest[destOffset] = r > 255 ? 255 : r < 0 ? 0 : r; - dest[destOffset + 1] = g > 255 ? 255 : g < 0 ? 0 : g; - dest[destOffset + 2] = b > 255 ? 255 : b < 0 ? 0 : b; - } - - function DeviceCmykCS() { - this.name = 'DeviceCMYK'; - this.numComps = 4; - this.defaultColor = new Float32Array([0, 0, 0, 1]); - } - DeviceCmykCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function DeviceCmykCS_getRgbItem(src, srcOffset, - dest, destOffset) { - convertToRgb(src, srcOffset, 1, dest, destOffset); - }, - getRgbBuffer: function DeviceCmykCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var scale = 1 / ((1 << bits) - 1); - for (var i = 0; i < count; i++) { - convertToRgb(src, srcOffset, scale, dest, destOffset); - srcOffset += 4; - destOffset += 3 + alpha01; - } - }, - getOutputLength: function DeviceCmykCS_getOutputLength(inputLength, - alpha01) { - return (inputLength / 4 * (3 + alpha01)) | 0; - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function DeviceCmykCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - - return DeviceCmykCS; -})(); - -// -// CalGrayCS: Based on "PDF Reference, Sixth Ed", p.245 -// -var CalGrayCS = (function CalGrayCSClosure() { - function CalGrayCS(whitePoint, blackPoint, gamma) { - this.name = 'CalGray'; - this.numComps = 1; - this.defaultColor = new Float32Array([0]); - - if (!whitePoint) { - error('WhitePoint missing - required for color space CalGray'); - } - blackPoint = blackPoint || [0, 0, 0]; - gamma = gamma || 1; - - // Translate arguments to spec variables. - this.XW = whitePoint[0]; - this.YW = whitePoint[1]; - this.ZW = whitePoint[2]; - - this.XB = blackPoint[0]; - this.YB = blackPoint[1]; - this.ZB = blackPoint[2]; - - this.G = gamma; - - // Validate variables as per spec. - if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { - error('Invalid WhitePoint components for ' + this.name + - ', no fallback available'); - } - - if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { - info('Invalid BlackPoint for ' + this.name + ', falling back to default'); - this.XB = this.YB = this.ZB = 0; - } - - if (this.XB !== 0 || this.YB !== 0 || this.ZB !== 0) { - warn(this.name + ', BlackPoint: XB: ' + this.XB + ', YB: ' + this.YB + - ', ZB: ' + this.ZB + ', only default values are supported.'); - } - - if (this.G < 1) { - info('Invalid Gamma: ' + this.G + ' for ' + this.name + - ', falling back to default'); - this.G = 1; - } - } - - function convertToRgb(cs, src, srcOffset, dest, destOffset, scale) { - // A represents a gray component of a calibrated gray space. - // A <---> AG in the spec - var A = src[srcOffset] * scale; - var AG = Math.pow(A, cs.G); - - // Computes L as per spec. ( = cs.YW * AG ) - // Except if other than default BlackPoint values are used. - var L = cs.YW * AG; - // http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html, Ch 4. - // Convert values to rgb range [0, 255]. - var val = Math.max(295.8 * Math.pow(L, 0.333333333333333333) - 40.8, 0) | 0; - dest[destOffset] = val; - dest[destOffset + 1] = val; - dest[destOffset + 2] = val; - } - - CalGrayCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function CalGrayCS_getRgbItem(src, srcOffset, - dest, destOffset) { - convertToRgb(this, src, srcOffset, dest, destOffset, 1); - }, - getRgbBuffer: function CalGrayCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var scale = 1 / ((1 << bits) - 1); - - for (var i = 0; i < count; ++i) { - convertToRgb(this, src, srcOffset, dest, destOffset, scale); - srcOffset += 1; - destOffset += 3 + alpha01; - } - }, - getOutputLength: function CalGrayCS_getOutputLength(inputLength, alpha01) { - return inputLength * (3 + alpha01); - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function CalGrayCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - return CalGrayCS; -})(); - -// -// CalRGBCS: Based on "PDF Reference, Sixth Ed", p.247 -// -var CalRGBCS = (function CalRGBCSClosure() { - - // See http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html for these - // matrices. - var BRADFORD_SCALE_MATRIX = new Float32Array([ - 0.8951, 0.2664, -0.1614, - -0.7502, 1.7135, 0.0367, - 0.0389, -0.0685, 1.0296]); - - var BRADFORD_SCALE_INVERSE_MATRIX = new Float32Array([ - 0.9869929, -0.1470543, 0.1599627, - 0.4323053, 0.5183603, 0.0492912, - -0.0085287, 0.0400428, 0.9684867]); - - // See http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html. - var SRGB_D65_XYZ_TO_RGB_MATRIX = new Float32Array([ - 3.2404542, -1.5371385, -0.4985314, - -0.9692660, 1.8760108, 0.0415560, - 0.0556434, -0.2040259, 1.0572252]); - - var FLAT_WHITEPOINT_MATRIX = new Float32Array([1, 1, 1]); - - var tempNormalizeMatrix = new Float32Array(3); - var tempConvertMatrix1 = new Float32Array(3); - var tempConvertMatrix2 = new Float32Array(3); - - var DECODE_L_CONSTANT = Math.pow(((8 + 16) / 116), 3) / 8.0; - - function CalRGBCS(whitePoint, blackPoint, gamma, matrix) { - this.name = 'CalRGB'; - this.numComps = 3; - this.defaultColor = new Float32Array(3); - - if (!whitePoint) { - error('WhitePoint missing - required for color space CalRGB'); - } - blackPoint = blackPoint || new Float32Array(3); - gamma = gamma || new Float32Array([1, 1, 1]); - matrix = matrix || new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]); - - // Translate arguments to spec variables. - var XW = whitePoint[0]; - var YW = whitePoint[1]; - var ZW = whitePoint[2]; - this.whitePoint = whitePoint; - - var XB = blackPoint[0]; - var YB = blackPoint[1]; - var ZB = blackPoint[2]; - this.blackPoint = blackPoint; - - this.GR = gamma[0]; - this.GG = gamma[1]; - this.GB = gamma[2]; - - this.MXA = matrix[0]; - this.MYA = matrix[1]; - this.MZA = matrix[2]; - this.MXB = matrix[3]; - this.MYB = matrix[4]; - this.MZB = matrix[5]; - this.MXC = matrix[6]; - this.MYC = matrix[7]; - this.MZC = matrix[8]; - - // Validate variables as per spec. - if (XW < 0 || ZW < 0 || YW !== 1) { - error('Invalid WhitePoint components for ' + this.name + - ', no fallback available'); - } - - if (XB < 0 || YB < 0 || ZB < 0) { - info('Invalid BlackPoint for ' + this.name + ' [' + XB + ', ' + YB + - ', ' + ZB + '], falling back to default'); - this.blackPoint = new Float32Array(3); - } - - if (this.GR < 0 || this.GG < 0 || this.GB < 0) { - info('Invalid Gamma [' + this.GR + ', ' + this.GG + ', ' + this.GB + - '] for ' + this.name + ', falling back to default'); - this.GR = this.GG = this.GB = 1; - } - - if (this.MXA < 0 || this.MYA < 0 || this.MZA < 0 || - this.MXB < 0 || this.MYB < 0 || this.MZB < 0 || - this.MXC < 0 || this.MYC < 0 || this.MZC < 0) { - info('Invalid Matrix for ' + this.name + ' [' + - this.MXA + ', ' + this.MYA + ', ' + this.MZA + - this.MXB + ', ' + this.MYB + ', ' + this.MZB + - this.MXC + ', ' + this.MYC + ', ' + this.MZC + - '], falling back to default'); - this.MXA = this.MYB = this.MZC = 1; - this.MXB = this.MYA = this.MZA = this.MXC = this.MYC = this.MZB = 0; - } - } - - function matrixProduct(a, b, result) { - result[0] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; - result[1] = a[3] * b[0] + a[4] * b[1] + a[5] * b[2]; - result[2] = a[6] * b[0] + a[7] * b[1] + a[8] * b[2]; - } - - function convertToFlat(sourceWhitePoint, LMS, result) { - result[0] = LMS[0] * 1 / sourceWhitePoint[0]; - result[1] = LMS[1] * 1 / sourceWhitePoint[1]; - result[2] = LMS[2] * 1 / sourceWhitePoint[2]; - } - - function convertToD65(sourceWhitePoint, LMS, result) { - var D65X = 0.95047; - var D65Y = 1; - var D65Z = 1.08883; - - result[0] = LMS[0] * D65X / sourceWhitePoint[0]; - result[1] = LMS[1] * D65Y / sourceWhitePoint[1]; - result[2] = LMS[2] * D65Z / sourceWhitePoint[2]; - } - - function sRGBTransferFunction(color) { - // See http://en.wikipedia.org/wiki/SRGB. - if (color <= 0.0031308){ - return adjustToRange(0, 1, 12.92 * color); - } - - return adjustToRange(0, 1, (1 + 0.055) * Math.pow(color, 1 / 2.4) - 0.055); - } - - function adjustToRange(min, max, value) { - return Math.max(min, Math.min(max, value)); - } - - function decodeL(L) { - if (L < 0) { - return -decodeL(-L); - } - - if (L > 8.0) { - return Math.pow(((L + 16) / 116), 3); - } - - return L * DECODE_L_CONSTANT; - } - - function compensateBlackPoint(sourceBlackPoint, XYZ_Flat, result) { - - // In case the blackPoint is already the default blackPoint then there is - // no need to do compensation. - if (sourceBlackPoint[0] === 0 && - sourceBlackPoint[1] === 0 && - sourceBlackPoint[2] === 0) { - result[0] = XYZ_Flat[0]; - result[1] = XYZ_Flat[1]; - result[2] = XYZ_Flat[2]; - return; - } - - // For the blackPoint calculation details, please see - // http://www.adobe.com/content/dam/Adobe/en/devnet/photoshop/sdk/ - // AdobeBPC.pdf. - // The destination blackPoint is the default blackPoint [0, 0, 0]. - var zeroDecodeL = decodeL(0); - - var X_DST = zeroDecodeL; - var X_SRC = decodeL(sourceBlackPoint[0]); - - var Y_DST = zeroDecodeL; - var Y_SRC = decodeL(sourceBlackPoint[1]); - - var Z_DST = zeroDecodeL; - var Z_SRC = decodeL(sourceBlackPoint[2]); - - var X_Scale = (1 - X_DST) / (1 - X_SRC); - var X_Offset = 1 - X_Scale; - - var Y_Scale = (1 - Y_DST) / (1 - Y_SRC); - var Y_Offset = 1 - Y_Scale; - - var Z_Scale = (1 - Z_DST) / (1 - Z_SRC); - var Z_Offset = 1 - Z_Scale; - - result[0] = XYZ_Flat[0] * X_Scale + X_Offset; - result[1] = XYZ_Flat[1] * Y_Scale + Y_Offset; - result[2] = XYZ_Flat[2] * Z_Scale + Z_Offset; - } - - function normalizeWhitePointToFlat(sourceWhitePoint, XYZ_In, result) { - - // In case the whitePoint is already flat then there is no need to do - // normalization. - if (sourceWhitePoint[0] === 1 && sourceWhitePoint[2] === 1) { - result[0] = XYZ_In[0]; - result[1] = XYZ_In[1]; - result[2] = XYZ_In[2]; - return; - } - - var LMS = result; - matrixProduct(BRADFORD_SCALE_MATRIX, XYZ_In, LMS); - - var LMS_Flat = tempNormalizeMatrix; - convertToFlat(sourceWhitePoint, LMS, LMS_Flat); - - matrixProduct(BRADFORD_SCALE_INVERSE_MATRIX, LMS_Flat, result); - } - - function normalizeWhitePointToD65(sourceWhitePoint, XYZ_In, result) { - - var LMS = result; - matrixProduct(BRADFORD_SCALE_MATRIX, XYZ_In, LMS); - - var LMS_D65 = tempNormalizeMatrix; - convertToD65(sourceWhitePoint, LMS, LMS_D65); - - matrixProduct(BRADFORD_SCALE_INVERSE_MATRIX, LMS_D65, result); - } - - function convertToRgb(cs, src, srcOffset, dest, destOffset, scale) { - // A, B and C represent a red, green and blue components of a calibrated - // rgb space. - var A = adjustToRange(0, 1, src[srcOffset] * scale); - var B = adjustToRange(0, 1, src[srcOffset + 1] * scale); - var C = adjustToRange(0, 1, src[srcOffset + 2] * scale); - - // A <---> AGR in the spec - // B <---> BGG in the spec - // C <---> CGB in the spec - var AGR = Math.pow(A, cs.GR); - var BGG = Math.pow(B, cs.GG); - var CGB = Math.pow(C, cs.GB); - - // Computes intermediate variables L, M, N as per spec. - // To decode X, Y, Z values map L, M, N directly to them. - var X = cs.MXA * AGR + cs.MXB * BGG + cs.MXC * CGB; - var Y = cs.MYA * AGR + cs.MYB * BGG + cs.MYC * CGB; - var Z = cs.MZA * AGR + cs.MZB * BGG + cs.MZC * CGB; - - // The following calculations are based on this document: - // http://www.adobe.com/content/dam/Adobe/en/devnet/photoshop/sdk/ - // AdobeBPC.pdf. - var XYZ = tempConvertMatrix1; - XYZ[0] = X; - XYZ[1] = Y; - XYZ[2] = Z; - var XYZ_Flat = tempConvertMatrix2; - - normalizeWhitePointToFlat(cs.whitePoint, XYZ, XYZ_Flat); - - var XYZ_Black = tempConvertMatrix1; - compensateBlackPoint(cs.blackPoint, XYZ_Flat, XYZ_Black); - - var XYZ_D65 = tempConvertMatrix2; - normalizeWhitePointToD65(FLAT_WHITEPOINT_MATRIX, XYZ_Black, XYZ_D65); - - var SRGB = tempConvertMatrix1; - matrixProduct(SRGB_D65_XYZ_TO_RGB_MATRIX, XYZ_D65, SRGB); - - var sR = sRGBTransferFunction(SRGB[0]); - var sG = sRGBTransferFunction(SRGB[1]); - var sB = sRGBTransferFunction(SRGB[2]); - - // Convert the values to rgb range [0, 255]. - dest[destOffset] = Math.round(sR * 255); - dest[destOffset + 1] = Math.round(sG * 255); - dest[destOffset + 2] = Math.round(sB * 255); - } - - CalRGBCS.prototype = { - getRgb: function CalRGBCS_getRgb(src, srcOffset) { - var rgb = new Uint8Array(3); - this.getRgbItem(src, srcOffset, rgb, 0); - return rgb; - }, - getRgbItem: function CalRGBCS_getRgbItem(src, srcOffset, - dest, destOffset) { - convertToRgb(this, src, srcOffset, dest, destOffset, 1); - }, - getRgbBuffer: function CalRGBCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var scale = 1 / ((1 << bits) - 1); - - for (var i = 0; i < count; ++i) { - convertToRgb(this, src, srcOffset, dest, destOffset, scale); - srcOffset += 3; - destOffset += 3 + alpha01; - } - }, - getOutputLength: function CalRGBCS_getOutputLength(inputLength, alpha01) { - return (inputLength * (3 + alpha01) / 3) | 0; - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function CalRGBCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - return CalRGBCS; -})(); - -// -// LabCS: Based on "PDF Reference, Sixth Ed", p.250 -// -var LabCS = (function LabCSClosure() { - function LabCS(whitePoint, blackPoint, range) { - this.name = 'Lab'; - this.numComps = 3; - this.defaultColor = new Float32Array([0, 0, 0]); - - if (!whitePoint) { - error('WhitePoint missing - required for color space Lab'); - } - blackPoint = blackPoint || [0, 0, 0]; - range = range || [-100, 100, -100, 100]; - - // Translate args to spec variables - this.XW = whitePoint[0]; - this.YW = whitePoint[1]; - this.ZW = whitePoint[2]; - this.amin = range[0]; - this.amax = range[1]; - this.bmin = range[2]; - this.bmax = range[3]; - - // These are here just for completeness - the spec doesn't offer any - // formulas that use BlackPoint in Lab - this.XB = blackPoint[0]; - this.YB = blackPoint[1]; - this.ZB = blackPoint[2]; - - // Validate vars as per spec - if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { - error('Invalid WhitePoint components, no fallback available'); - } - - if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { - info('Invalid BlackPoint, falling back to default'); - this.XB = this.YB = this.ZB = 0; - } - - if (this.amin > this.amax || this.bmin > this.bmax) { - info('Invalid Range, falling back to defaults'); - this.amin = -100; - this.amax = 100; - this.bmin = -100; - this.bmax = 100; - } - } - - // Function g(x) from spec - function fn_g(x) { - if (x >= 6 / 29) { - return x * x * x; - } else { - return (108 / 841) * (x - 4 / 29); - } - } - - function decode(value, high1, low2, high2) { - return low2 + (value) * (high2 - low2) / (high1); - } - - // If decoding is needed maxVal should be 2^bits per component - 1. - function convertToRgb(cs, src, srcOffset, maxVal, dest, destOffset) { - // XXX: Lab input is in the range of [0, 100], [amin, amax], [bmin, bmax] - // not the usual [0, 1]. If a command like setFillColor is used the src - // values will already be within the correct range. However, if we are - // converting an image we have to map the values to the correct range given - // above. - // Ls,as,bs <---> L*,a*,b* in the spec - var Ls = src[srcOffset]; - var as = src[srcOffset + 1]; - var bs = src[srcOffset + 2]; - if (maxVal !== false) { - Ls = decode(Ls, maxVal, 0, 100); - as = decode(as, maxVal, cs.amin, cs.amax); - bs = decode(bs, maxVal, cs.bmin, cs.bmax); - } - - // Adjust limits of 'as' and 'bs' - as = as > cs.amax ? cs.amax : as < cs.amin ? cs.amin : as; - bs = bs > cs.bmax ? cs.bmax : bs < cs.bmin ? cs.bmin : bs; - - // Computes intermediate variables X,Y,Z as per spec - var M = (Ls + 16) / 116; - var L = M + (as / 500); - var N = M - (bs / 200); - - var X = cs.XW * fn_g(L); - var Y = cs.YW * fn_g(M); - var Z = cs.ZW * fn_g(N); - - var r, g, b; - // Using different conversions for D50 and D65 white points, - // per http://www.color.org/srgb.pdf - if (cs.ZW < 1) { - // Assuming D50 (X=0.9642, Y=1.00, Z=0.8249) - r = X * 3.1339 + Y * -1.6170 + Z * -0.4906; - g = X * -0.9785 + Y * 1.9160 + Z * 0.0333; - b = X * 0.0720 + Y * -0.2290 + Z * 1.4057; - } else { - // Assuming D65 (X=0.9505, Y=1.00, Z=1.0888) - r = X * 3.2406 + Y * -1.5372 + Z * -0.4986; - g = X * -0.9689 + Y * 1.8758 + Z * 0.0415; - b = X * 0.0557 + Y * -0.2040 + Z * 1.0570; - } - // clamp color values to [0,1] range then convert to [0,255] range. - dest[destOffset] = r <= 0 ? 0 : r >= 1 ? 255 : Math.sqrt(r) * 255 | 0; - dest[destOffset + 1] = g <= 0 ? 0 : g >= 1 ? 255 : Math.sqrt(g) * 255 | 0; - dest[destOffset + 2] = b <= 0 ? 0 : b >= 1 ? 255 : Math.sqrt(b) * 255 | 0; - } - - LabCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function LabCS_getRgbItem(src, srcOffset, dest, destOffset) { - convertToRgb(this, src, srcOffset, false, dest, destOffset); - }, - getRgbBuffer: function LabCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var maxVal = (1 << bits) - 1; - for (var i = 0; i < count; i++) { - convertToRgb(this, src, srcOffset, maxVal, dest, destOffset); - srcOffset += 3; - destOffset += 3 + alpha01; - } - }, - getOutputLength: function LabCS_getOutputLength(inputLength, alpha01) { - return (inputLength * (3 + alpha01) / 3) | 0; - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function LabCS_isDefaultDecode(decodeMap) { - // XXX: Decoding is handled with the lab conversion because of the strange - // ranges that are used. - return true; - }, - usesZeroToOneRange: false - }; - return LabCS; -})(); - - -var ARCFourCipher = (function ARCFourCipherClosure() { - function ARCFourCipher(key) { - this.a = 0; - this.b = 0; - var s = new Uint8Array(256); - var i, j = 0, tmp, keyLength = key.length; - for (i = 0; i < 256; ++i) { - s[i] = i; - } - for (i = 0; i < 256; ++i) { - tmp = s[i]; - j = (j + tmp + key[i % keyLength]) & 0xFF; - s[i] = s[j]; - s[j] = tmp; - } - this.s = s; - } - - ARCFourCipher.prototype = { - encryptBlock: function ARCFourCipher_encryptBlock(data) { - var i, n = data.length, tmp, tmp2; - var a = this.a, b = this.b, s = this.s; - var output = new Uint8Array(n); - for (i = 0; i < n; ++i) { - a = (a + 1) & 0xFF; - tmp = s[a]; - b = (b + tmp) & 0xFF; - tmp2 = s[b]; - s[a] = tmp2; - s[b] = tmp; - output[i] = data[i] ^ s[(tmp + tmp2) & 0xFF]; - } - this.a = a; - this.b = b; - return output; - } - }; - ARCFourCipher.prototype.decryptBlock = ARCFourCipher.prototype.encryptBlock; - - return ARCFourCipher; -})(); - -var calculateMD5 = (function calculateMD5Closure() { - var r = new Uint8Array([ - 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, - 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, - 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, - 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21]); - - var k = new Int32Array([ - -680876936, -389564586, 606105819, -1044525330, -176418897, 1200080426, - -1473231341, -45705983, 1770035416, -1958414417, -42063, -1990404162, - 1804603682, -40341101, -1502002290, 1236535329, -165796510, -1069501632, - 643717713, -373897302, -701558691, 38016083, -660478335, -405537848, - 568446438, -1019803690, -187363961, 1163531501, -1444681467, -51403784, - 1735328473, -1926607734, -378558, -2022574463, 1839030562, -35309556, - -1530992060, 1272893353, -155497632, -1094730640, 681279174, -358537222, - -722521979, 76029189, -640364487, -421815835, 530742520, -995338651, - -198630844, 1126891415, -1416354905, -57434055, 1700485571, -1894986606, - -1051523, -2054922799, 1873313359, -30611744, -1560198380, 1309151649, - -145523070, -1120210379, 718787259, -343485551]); - - function hash(data, offset, length) { - var h0 = 1732584193, h1 = -271733879, h2 = -1732584194, h3 = 271733878; - // pre-processing - var paddedLength = (length + 72) & ~63; // data + 9 extra bytes - var padded = new Uint8Array(paddedLength); - var i, j, n; - for (i = 0; i < length; ++i) { - padded[i] = data[offset++]; - } - padded[i++] = 0x80; - n = paddedLength - 8; - while (i < n) { - padded[i++] = 0; - } - padded[i++] = (length << 3) & 0xFF; - padded[i++] = (length >> 5) & 0xFF; - padded[i++] = (length >> 13) & 0xFF; - padded[i++] = (length >> 21) & 0xFF; - padded[i++] = (length >>> 29) & 0xFF; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - var w = new Int32Array(16); - for (i = 0; i < paddedLength;) { - for (j = 0; j < 16; ++j, i += 4) { - w[j] = (padded[i] | (padded[i + 1] << 8) | - (padded[i + 2] << 16) | (padded[i + 3] << 24)); - } - var a = h0, b = h1, c = h2, d = h3, f, g; - for (j = 0; j < 64; ++j) { - if (j < 16) { - f = (b & c) | ((~b) & d); - g = j; - } else if (j < 32) { - f = (d & b) | ((~d) & c); - g = (5 * j + 1) & 15; - } else if (j < 48) { - f = b ^ c ^ d; - g = (3 * j + 5) & 15; - } else { - f = c ^ (b | (~d)); - g = (7 * j) & 15; - } - var tmp = d, rotateArg = (a + f + k[j] + w[g]) | 0, rotate = r[j]; - d = c; - c = b; - b = (b + ((rotateArg << rotate) | (rotateArg >>> (32 - rotate)))) | 0; - a = tmp; - } - h0 = (h0 + a) | 0; - h1 = (h1 + b) | 0; - h2 = (h2 + c) | 0; - h3 = (h3 + d) | 0; - } - return new Uint8Array([ - h0 & 0xFF, (h0 >> 8) & 0xFF, (h0 >> 16) & 0xFF, (h0 >>> 24) & 0xFF, - h1 & 0xFF, (h1 >> 8) & 0xFF, (h1 >> 16) & 0xFF, (h1 >>> 24) & 0xFF, - h2 & 0xFF, (h2 >> 8) & 0xFF, (h2 >> 16) & 0xFF, (h2 >>> 24) & 0xFF, - h3 & 0xFF, (h3 >> 8) & 0xFF, (h3 >> 16) & 0xFF, (h3 >>> 24) & 0xFF - ]); - } - - return hash; -})(); -var Word64 = (function Word64Closure() { - function Word64(highInteger, lowInteger) { - this.high = highInteger | 0; - this.low = lowInteger | 0; - } - Word64.prototype = { - and: function Word64_and(word) { - this.high &= word.high; - this.low &= word.low; - }, - xor: function Word64_xor(word) { - this.high ^= word.high; - this.low ^= word.low; - }, - - or: function Word64_or(word) { - this.high |= word.high; - this.low |= word.low; - }, - - shiftRight: function Word64_shiftRight(places) { - if (places >= 32) { - this.low = (this.high >>> (places - 32)) | 0; - this.high = 0; - } else { - this.low = (this.low >>> places) | (this.high << (32 - places)); - this.high = (this.high >>> places) | 0; - } - }, - - shiftLeft: function Word64_shiftLeft(places) { - if (places >= 32) { - this.high = this.low << (places - 32); - this.low = 0; - } else { - this.high = (this.high << places) | (this.low >>> (32 - places)); - this.low = this.low << places; - } - }, - - rotateRight: function Word64_rotateRight(places) { - var low, high; - if (places & 32) { - high = this.low; - low = this.high; - } else { - low = this.low; - high = this.high; - } - places &= 31; - this.low = (low >>> places) | (high << (32 - places)); - this.high = (high >>> places) | (low << (32 - places)); - }, - - not: function Word64_not() { - this.high = ~this.high; - this.low = ~this.low; - }, - - add: function Word64_add(word) { - var lowAdd = (this.low >>> 0) + (word.low >>> 0); - var highAdd = (this.high >>> 0) + (word.high >>> 0); - if (lowAdd > 0xFFFFFFFF) { - highAdd += 1; - } - this.low = lowAdd | 0; - this.high = highAdd | 0; - }, - - copyTo: function Word64_copyTo(bytes, offset) { - bytes[offset] = (this.high >>> 24) & 0xFF; - bytes[offset + 1] = (this.high >> 16) & 0xFF; - bytes[offset + 2] = (this.high >> 8) & 0xFF; - bytes[offset + 3] = this.high & 0xFF; - bytes[offset + 4] = (this.low >>> 24) & 0xFF; - bytes[offset + 5] = (this.low >> 16) & 0xFF; - bytes[offset + 6] = (this.low >> 8) & 0xFF; - bytes[offset + 7] = this.low & 0xFF; - }, - - assign: function Word64_assign(word) { - this.high = word.high; - this.low = word.low; - } - }; - return Word64; -})(); - -var calculateSHA256 = (function calculateSHA256Closure() { - function rotr(x, n) { - return (x >>> n) | (x << 32 - n); - } - - function ch(x, y, z) { - return (x & y) ^ (~x & z); - } - - function maj(x, y, z) { - return (x & y) ^ (x & z) ^ (y & z); - } - - function sigma(x) { - return rotr(x, 2) ^ rotr(x, 13) ^ rotr(x, 22); - } - - function sigmaPrime(x) { - return rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25); - } - - function littleSigma(x) { - return rotr(x, 7) ^ rotr(x, 18) ^ x >>> 3; - } - - function littleSigmaPrime(x) { - return rotr(x, 17) ^ rotr(x, 19) ^ x >>> 10; - } - - var k = [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, - 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, - 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, - 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, - 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, - 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, - 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, - 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, - 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2]; - - function hash(data, offset, length) { - // initial hash values - var h0 = 0x6a09e667, h1 = 0xbb67ae85, h2 = 0x3c6ef372, - h3 = 0xa54ff53a, h4 = 0x510e527f, h5 = 0x9b05688c, - h6 = 0x1f83d9ab, h7 = 0x5be0cd19; - // pre-processing - var paddedLength = Math.ceil((length + 9) / 64) * 64; - var padded = new Uint8Array(paddedLength); - var i, j, n; - for (i = 0; i < length; ++i) { - padded[i] = data[offset++]; - } - padded[i++] = 0x80; - n = paddedLength - 8; - while (i < n) { - padded[i++] = 0; - } - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = (length >>> 29) & 0xFF; - padded[i++] = (length >> 21) & 0xFF; - padded[i++] = (length >> 13) & 0xFF; - padded[i++] = (length >> 5) & 0xFF; - padded[i++] = (length << 3) & 0xFF; - var w = new Uint32Array(64); - // for each 512 bit block - for (i = 0; i < paddedLength;) { - for (j = 0; j < 16; ++j) { - w[j] = (padded[i] << 24 | (padded[i + 1] << 16) | - (padded[i + 2] << 8) | (padded[i + 3])); - i += 4; - } - - for (j = 16; j < 64; ++j) { - w[j] = littleSigmaPrime(w[j - 2]) + w[j - 7] + - littleSigma(w[j - 15]) + w[j - 16] | 0; - } - var a = h0, b = h1, c = h2, d = h3, e = h4, - f = h5, g = h6, h = h7, t1, t2; - for (j = 0; j < 64; ++j) { - t1 = h + sigmaPrime(e) + ch(e, f, g) + k[j] + w[j]; - t2 = sigma(a) + maj(a, b, c); - h = g; - g = f; - f = e; - e = (d + t1) | 0; - d = c; - c = b; - b = a; - a = (t1 + t2) | 0; - } - h0 = (h0 + a) | 0; - h1 = (h1 + b) | 0; - h2 = (h2 + c) | 0; - h3 = (h3 + d) | 0; - h4 = (h4 + e) | 0; - h5 = (h5 + f) | 0; - h6 = (h6 + g) | 0; - h7 = (h7 + h) | 0; - } - return new Uint8Array([ - (h0 >> 24) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 8) & 0xFF, (h0) & 0xFF, - (h1 >> 24) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 8) & 0xFF, (h1) & 0xFF, - (h2 >> 24) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 8) & 0xFF, (h2) & 0xFF, - (h3 >> 24) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 8) & 0xFF, (h3) & 0xFF, - (h4 >> 24) & 0xFF, (h4 >> 16) & 0xFF, (h4 >> 8) & 0xFF, (h4) & 0xFF, - (h5 >> 24) & 0xFF, (h5 >> 16) & 0xFF, (h5 >> 8) & 0xFF, (h5) & 0xFF, - (h6 >> 24) & 0xFF, (h6 >> 16) & 0xFF, (h6 >> 8) & 0xFF, (h6) & 0xFF, - (h7 >> 24) & 0xFF, (h7 >> 16) & 0xFF, (h7 >> 8) & 0xFF, (h7) & 0xFF - ]); - } - - return hash; -})(); - -var calculateSHA512 = (function calculateSHA512Closure() { - function ch(result, x, y, z, tmp) { - result.assign(x); - result.and(y); - tmp.assign(x); - tmp.not(); - tmp.and(z); - result.xor(tmp); - } - - function maj(result, x, y, z, tmp) { - result.assign(x); - result.and(y); - tmp.assign(x); - tmp.and(z); - result.xor(tmp); - tmp.assign(y); - tmp.and(z); - result.xor(tmp); - } - - function sigma(result, x, tmp) { - result.assign(x); - result.rotateRight(28); - tmp.assign(x); - tmp.rotateRight(34); - result.xor(tmp); - tmp.assign(x); - tmp.rotateRight(39); - result.xor(tmp); - } - - function sigmaPrime(result, x, tmp) { - result.assign(x); - result.rotateRight(14); - tmp.assign(x); - tmp.rotateRight(18); - result.xor(tmp); - tmp.assign(x); - tmp.rotateRight(41); - result.xor(tmp); - } - - function littleSigma(result, x, tmp) { - result.assign(x); - result.rotateRight(1); - tmp.assign(x); - tmp.rotateRight(8); - result.xor(tmp); - tmp.assign(x); - tmp.shiftRight(7); - result.xor(tmp); - } - - function littleSigmaPrime(result, x, tmp) { - result.assign(x); - result.rotateRight(19); - tmp.assign(x); - tmp.rotateRight(61); - result.xor(tmp); - tmp.assign(x); - tmp.shiftRight(6); - result.xor(tmp); - } - - var k = [ - new Word64(0x428a2f98, 0xd728ae22), new Word64(0x71374491, 0x23ef65cd), - new Word64(0xb5c0fbcf, 0xec4d3b2f), new Word64(0xe9b5dba5, 0x8189dbbc), - new Word64(0x3956c25b, 0xf348b538), new Word64(0x59f111f1, 0xb605d019), - new Word64(0x923f82a4, 0xaf194f9b), new Word64(0xab1c5ed5, 0xda6d8118), - new Word64(0xd807aa98, 0xa3030242), new Word64(0x12835b01, 0x45706fbe), - new Word64(0x243185be, 0x4ee4b28c), new Word64(0x550c7dc3, 0xd5ffb4e2), - new Word64(0x72be5d74, 0xf27b896f), new Word64(0x80deb1fe, 0x3b1696b1), - new Word64(0x9bdc06a7, 0x25c71235), new Word64(0xc19bf174, 0xcf692694), - new Word64(0xe49b69c1, 0x9ef14ad2), new Word64(0xefbe4786, 0x384f25e3), - new Word64(0x0fc19dc6, 0x8b8cd5b5), new Word64(0x240ca1cc, 0x77ac9c65), - new Word64(0x2de92c6f, 0x592b0275), new Word64(0x4a7484aa, 0x6ea6e483), - new Word64(0x5cb0a9dc, 0xbd41fbd4), new Word64(0x76f988da, 0x831153b5), - new Word64(0x983e5152, 0xee66dfab), new Word64(0xa831c66d, 0x2db43210), - new Word64(0xb00327c8, 0x98fb213f), new Word64(0xbf597fc7, 0xbeef0ee4), - new Word64(0xc6e00bf3, 0x3da88fc2), new Word64(0xd5a79147, 0x930aa725), - new Word64(0x06ca6351, 0xe003826f), new Word64(0x14292967, 0x0a0e6e70), - new Word64(0x27b70a85, 0x46d22ffc), new Word64(0x2e1b2138, 0x5c26c926), - new Word64(0x4d2c6dfc, 0x5ac42aed), new Word64(0x53380d13, 0x9d95b3df), - new Word64(0x650a7354, 0x8baf63de), new Word64(0x766a0abb, 0x3c77b2a8), - new Word64(0x81c2c92e, 0x47edaee6), new Word64(0x92722c85, 0x1482353b), - new Word64(0xa2bfe8a1, 0x4cf10364), new Word64(0xa81a664b, 0xbc423001), - new Word64(0xc24b8b70, 0xd0f89791), new Word64(0xc76c51a3, 0x0654be30), - new Word64(0xd192e819, 0xd6ef5218), new Word64(0xd6990624, 0x5565a910), - new Word64(0xf40e3585, 0x5771202a), new Word64(0x106aa070, 0x32bbd1b8), - new Word64(0x19a4c116, 0xb8d2d0c8), new Word64(0x1e376c08, 0x5141ab53), - new Word64(0x2748774c, 0xdf8eeb99), new Word64(0x34b0bcb5, 0xe19b48a8), - new Word64(0x391c0cb3, 0xc5c95a63), new Word64(0x4ed8aa4a, 0xe3418acb), - new Word64(0x5b9cca4f, 0x7763e373), new Word64(0x682e6ff3, 0xd6b2b8a3), - new Word64(0x748f82ee, 0x5defb2fc), new Word64(0x78a5636f, 0x43172f60), - new Word64(0x84c87814, 0xa1f0ab72), new Word64(0x8cc70208, 0x1a6439ec), - new Word64(0x90befffa, 0x23631e28), new Word64(0xa4506ceb, 0xde82bde9), - new Word64(0xbef9a3f7, 0xb2c67915), new Word64(0xc67178f2, 0xe372532b), - new Word64(0xca273ece, 0xea26619c), new Word64(0xd186b8c7, 0x21c0c207), - new Word64(0xeada7dd6, 0xcde0eb1e), new Word64(0xf57d4f7f, 0xee6ed178), - new Word64(0x06f067aa, 0x72176fba), new Word64(0x0a637dc5, 0xa2c898a6), - new Word64(0x113f9804, 0xbef90dae), new Word64(0x1b710b35, 0x131c471b), - new Word64(0x28db77f5, 0x23047d84), new Word64(0x32caab7b, 0x40c72493), - new Word64(0x3c9ebe0a, 0x15c9bebc), new Word64(0x431d67c4, 0x9c100d4c), - new Word64(0x4cc5d4be, 0xcb3e42b6), new Word64(0x597f299c, 0xfc657e2a), - new Word64(0x5fcb6fab, 0x3ad6faec), new Word64(0x6c44198c, 0x4a475817)]; - - function hash(data, offset, length, mode384) { - mode384 = !!mode384; - // initial hash values - var h0, h1, h2, h3, h4, h5, h6, h7; - if (!mode384) { - h0 = new Word64(0x6a09e667, 0xf3bcc908); - h1 = new Word64(0xbb67ae85, 0x84caa73b); - h2 = new Word64(0x3c6ef372, 0xfe94f82b); - h3 = new Word64(0xa54ff53a, 0x5f1d36f1); - h4 = new Word64(0x510e527f, 0xade682d1); - h5 = new Word64(0x9b05688c, 0x2b3e6c1f); - h6 = new Word64(0x1f83d9ab, 0xfb41bd6b); - h7 = new Word64(0x5be0cd19, 0x137e2179); - } - else { - // SHA384 is exactly the same - // except with different starting values and a trimmed result - h0 = new Word64(0xcbbb9d5d, 0xc1059ed8); - h1 = new Word64(0x629a292a, 0x367cd507); - h2 = new Word64(0x9159015a, 0x3070dd17); - h3 = new Word64(0x152fecd8, 0xf70e5939); - h4 = new Word64(0x67332667, 0xffc00b31); - h5 = new Word64(0x8eb44a87, 0x68581511); - h6 = new Word64(0xdb0c2e0d, 0x64f98fa7); - h7 = new Word64(0x47b5481d, 0xbefa4fa4); - } - - // pre-processing - var paddedLength = Math.ceil((length + 17) / 128) * 128; - var padded = new Uint8Array(paddedLength); - var i, j, n; - for (i = 0; i < length; ++i) { - padded[i] = data[offset++]; - } - padded[i++] = 0x80; - n = paddedLength - 16; - while (i < n) { - padded[i++] = 0; - } - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = (length >>> 29) & 0xFF; - padded[i++] = (length >> 21) & 0xFF; - padded[i++] = (length >> 13) & 0xFF; - padded[i++] = (length >> 5) & 0xFF; - padded[i++] = (length << 3) & 0xFF; - - var w = new Array(80); - for (i = 0; i < 80; i++) { - w[i] = new Word64(0, 0); - } - var a = new Word64(0, 0), b = new Word64(0, 0), c = new Word64(0, 0); - var d = new Word64(0, 0), e = new Word64(0, 0), f = new Word64(0, 0); - var g = new Word64(0, 0), h = new Word64(0, 0); - var t1 = new Word64(0, 0), t2 = new Word64(0, 0); - var tmp1 = new Word64(0, 0), tmp2 = new Word64(0, 0), tmp3; - - // for each 1024 bit block - for (i = 0; i < paddedLength;) { - for (j = 0; j < 16; ++j) { - w[j].high = (padded[i] << 24) | (padded[i + 1] << 16) | - (padded[i + 2] << 8) | (padded[i + 3]); - w[j].low = (padded[i + 4]) << 24 | (padded[i + 5]) << 16 | - (padded[i + 6]) << 8 | (padded[i + 7]); - i += 8; - } - for (j = 16; j < 80; ++j) { - tmp3 = w[j]; - littleSigmaPrime(tmp3, w[j - 2], tmp2); - tmp3.add(w[j - 7]); - littleSigma(tmp1, w[j - 15], tmp2); - tmp3.add(tmp1); - tmp3.add(w[j - 16]); - } - - a.assign(h0); b.assign(h1); c.assign(h2); d.assign(h3); - e.assign(h4); f.assign(h5); g.assign(h6); h.assign(h7); - for (j = 0; j < 80; ++j) { - t1.assign(h); - sigmaPrime(tmp1, e, tmp2); - t1.add(tmp1); - ch(tmp1, e, f, g, tmp2); - t1.add(tmp1); - t1.add(k[j]); - t1.add(w[j]); - - sigma(t2, a, tmp2); - maj(tmp1, a, b, c, tmp2); - t2.add(tmp1); - - tmp3 = h; - h = g; - g = f; - f = e; - d.add(t1); - e = d; - d = c; - c = b; - b = a; - tmp3.assign(t1); - tmp3.add(t2); - a = tmp3; - } - h0.add(a); - h1.add(b); - h2.add(c); - h3.add(d); - h4.add(e); - h5.add(f); - h6.add(g); - h7.add(h); - } - - var result; - if (!mode384) { - result = new Uint8Array(64); - h0.copyTo(result,0); - h1.copyTo(result,8); - h2.copyTo(result,16); - h3.copyTo(result,24); - h4.copyTo(result,32); - h5.copyTo(result,40); - h6.copyTo(result,48); - h7.copyTo(result,56); - } - else { - result = new Uint8Array(48); - h0.copyTo(result,0); - h1.copyTo(result,8); - h2.copyTo(result,16); - h3.copyTo(result,24); - h4.copyTo(result,32); - h5.copyTo(result,40); - } - return result; - } - - return hash; -})(); -var calculateSHA384 = (function calculateSHA384Closure() { - function hash(data, offset, length) { - return calculateSHA512(data, offset, length, true); - } - - return hash; -})(); -var NullCipher = (function NullCipherClosure() { - function NullCipher() { - } - - NullCipher.prototype = { - decryptBlock: function NullCipher_decryptBlock(data) { - return data; - } - }; - - return NullCipher; -})(); - -var AES128Cipher = (function AES128CipherClosure() { - var rcon = new Uint8Array([ - 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, - 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, - 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, - 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, - 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, - 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, - 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, - 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, - 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, - 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, - 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, - 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, - 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, - 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, - 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, - 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, - 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, - 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, - 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, - 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, - 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, - 0x74, 0xe8, 0xcb, 0x8d]); - - var s = new Uint8Array([ - 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, - 0xfe, 0xd7, 0xab,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xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, - 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, - 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, - 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, - 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, - 0xb0, 0x54, 0xbb, 0x16]); - - var inv_s = new Uint8Array([ - 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, - 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, - 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, - 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, - 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, - 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, - 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, - 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, - 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, - 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, - 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, - 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, - 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, - 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, - 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, - 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, - 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, - 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, - 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, - 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, - 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, - 0x55, 0x21, 0x0c, 0x7d]); - var mixCol = new Uint8Array(256); - for (var i = 0; i < 256; i++) { - if (i < 128) { - mixCol[i] = i << 1; - } else { - mixCol[i] = (i << 1) ^ 0x1b; - } - } - var mix = new Uint32Array([ - 0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, - 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, - 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, - 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, - 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, - 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, - 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, - 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, - 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, - 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, - 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, - 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, - 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, - 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, - 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, - 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, - 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, - 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, - 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, - 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, - 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, - 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, - 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, - 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, - 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, - 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, - 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, - 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, - 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, - 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, - 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, - 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, - 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, - 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, - 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, - 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, - 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, - 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, - 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, - 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, - 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, - 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, - 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]); - - function expandKey128(cipherKey) { - var b = 176, result = new Uint8Array(b); - result.set(cipherKey); - for (var j = 16, i = 1; j < b; ++i) { - // RotWord - var t1 = result[j - 3], t2 = result[j - 2], - t3 = result[j - 1], t4 = result[j - 4]; - // SubWord - t1 = s[t1]; - t2 = s[t2]; - t3 = s[t3]; - t4 = s[t4]; - // Rcon - t1 = t1 ^ rcon[i]; - for (var n = 0; n < 4; ++n) { - result[j] = (t1 ^= result[j - 16]); - j++; - result[j] = (t2 ^= result[j - 16]); - j++; - result[j] = (t3 ^= result[j - 16]); - j++; - result[j] = (t4 ^= result[j - 16]); - j++; - } - } - return result; - } - - function decrypt128(input, key) { - var state = new Uint8Array(16); - state.set(input); - var i, j, k; - var t, u, v; - // AddRoundKey - for (j = 0, k = 160; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - for (i = 9; i >= 1; --i) { - // InvShiftRows - t = state[13]; - state[13] = state[9]; - state[9] = state[5]; - state[5] = state[1]; - state[1] = t; - t = state[14]; - u = state[10]; - state[14] = state[6]; - state[10] = state[2]; - state[6] = t; - state[2] = u; - t = state[15]; - u = state[11]; - v = state[7]; - state[15] = state[3]; - state[11] = t; - state[7] = u; - state[3] = v; - // InvSubBytes - for (j = 0; j < 16; ++j) { - state[j] = inv_s[state[j]]; - } - // AddRoundKey - for (j = 0, k = i * 16; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - // InvMixColumns - for (j = 0; j < 16; j += 4) { - var s0 = mix[state[j]], s1 = mix[state[j + 1]], - s2 = mix[state[j + 2]], s3 = mix[state[j + 3]]; - t = (s0 ^ (s1 >>> 8) ^ (s1 << 24) ^ (s2 >>> 16) ^ (s2 << 16) ^ - (s3 >>> 24) ^ (s3 << 8)); - state[j] = (t >>> 24) & 0xFF; - state[j + 1] = (t >> 16) & 0xFF; - state[j + 2] = (t >> 8) & 0xFF; - state[j + 3] = t & 0xFF; - } - } - // InvShiftRows - t = state[13]; - state[13] = state[9]; - state[9] = state[5]; - state[5] = state[1]; - state[1] = t; - t = state[14]; - u = state[10]; - state[14] = state[6]; - state[10] = state[2]; - state[6] = t; - state[2] = u; - t = state[15]; - u = state[11]; - v = state[7]; - state[15] = state[3]; - state[11] = t; - state[7] = u; - state[3] = v; - for (j = 0; j < 16; ++j) { - // InvSubBytes - state[j] = inv_s[state[j]]; - // AddRoundKey - state[j] ^= key[j]; - } - return state; - } - - function encrypt128(input, key) { - var t, u, v, k; - var state = new Uint8Array(16); - state.set(input); - for (j = 0; j < 16; ++j) { - // AddRoundKey - state[j] ^= key[j]; - } - - for (i = 1; i < 10; i++) { - //SubBytes - for (j = 0; j < 16; ++j) { - state[j] = s[state[j]]; - } - //ShiftRows - v = state[1]; - state[1] = state[5]; - state[5] = state[9]; - state[9] = state[13]; - state[13] = v; - v = state[2]; - u = state[6]; - state[2] = state[10]; - state[6] = state[14]; - state[10] = v; - state[14] = u; - v = state[3]; - u = state[7]; - t = state[11]; - state[3] = state[15]; - state[7] = v; - state[11] = u; - state[15] = t; - //MixColumns - for (var j = 0; j < 16; j += 4) { - var s0 = state[j + 0], s1 = state[j + 1]; - var s2 = state[j + 2], s3 = state[j + 3]; - t = s0 ^ s1 ^ s2 ^ s3; - state[j + 0] ^= t ^ mixCol[s0 ^ s1]; - state[j + 1] ^= t ^ mixCol[s1 ^ s2]; - state[j + 2] ^= t ^ mixCol[s2 ^ s3]; - state[j + 3] ^= t ^ mixCol[s3 ^ s0]; - } - //AddRoundKey - for (j = 0, k = i * 16; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - } - - //SubBytes - for (j = 0; j < 16; ++j) { - state[j] = s[state[j]]; - } - //ShiftRows - v = state[1]; - state[1] = state[5]; - state[5] = state[9]; - state[9] = state[13]; - state[13] = v; - v = state[2]; - u = state[6]; - state[2] = state[10]; - state[6] = state[14]; - state[10] = v; - state[14] = u; - v = state[3]; - u = state[7]; - t = state[11]; - state[3] = state[15]; - state[7] = v; - state[11] = u; - state[15] = t; - //AddRoundKey - for (j = 0, k = 160; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - return state; - } - - function AES128Cipher(key) { - this.key = expandKey128(key); - this.buffer = new Uint8Array(16); - this.bufferPosition = 0; - } - - function decryptBlock2(data, finalize) { - var i, j, ii, sourceLength = data.length, - buffer = this.buffer, bufferLength = this.bufferPosition, - result = [], iv = this.iv; - for (i = 0; i < sourceLength; ++i) { - buffer[bufferLength] = data[i]; - ++bufferLength; - if (bufferLength < 16) { - continue; - } - // buffer is full, decrypting - var plain = decrypt128(buffer, this.key); - // xor-ing the IV vector to get plain text - for (j = 0; j < 16; ++j) { - plain[j] ^= iv[j]; - } - iv = buffer; - result.push(plain); - buffer = new Uint8Array(16); - bufferLength = 0; - } - // saving incomplete buffer - this.buffer = buffer; - this.bufferLength = bufferLength; - this.iv = iv; - if (result.length === 0) { - return new Uint8Array([]); - } - // combining plain text blocks into one - var outputLength = 16 * result.length; - if (finalize) { - // undo a padding that is described in RFC 2898 - var lastBlock = result[result.length - 1]; - var psLen = lastBlock[15]; - if (psLen <= 16) { - for (i = 15, ii = 16 - psLen; i >= ii; --i) { - if (lastBlock[i] !== psLen) { - // Invalid padding, assume that the block has no padding. - psLen = 0; - break; - } - } - outputLength -= psLen; - result[result.length - 1] = lastBlock.subarray(0, 16 - psLen); - } - } - var output = new Uint8Array(outputLength); - for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { - output.set(result[i], j); - } - return output; - } - - AES128Cipher.prototype = { - decryptBlock: function AES128Cipher_decryptBlock(data, finalize) { - var i, sourceLength = data.length; - var buffer = this.buffer, bufferLength = this.bufferPosition; - // waiting for IV values -- they are at the start of the stream - for (i = 0; bufferLength < 16 && i < sourceLength; ++i, ++bufferLength) { - buffer[bufferLength] = data[i]; - } - if (bufferLength < 16) { - // need more data - this.bufferLength = bufferLength; - return new Uint8Array([]); - } - this.iv = buffer; - this.buffer = new Uint8Array(16); - this.bufferLength = 0; - // starting decryption - this.decryptBlock = decryptBlock2; - return this.decryptBlock(data.subarray(16), finalize); - }, - encrypt: function AES128Cipher_encrypt(data, iv) { - var i, j, ii, sourceLength = data.length, - buffer = this.buffer, bufferLength = this.bufferPosition, - result = []; - if (!iv) { - iv = new Uint8Array(16); - } - for (i = 0; i < sourceLength; ++i) { - buffer[bufferLength] = data[i]; - ++bufferLength; - if (bufferLength < 16) { - continue; - } - for (j = 0; j < 16; ++j) { - buffer[j] ^= iv[j]; - } - - // buffer is full, encrypting - var cipher = encrypt128(buffer, this.key); - iv = cipher; - result.push(cipher); - buffer = new Uint8Array(16); - bufferLength = 0; - } - // saving incomplete buffer - this.buffer = buffer; - this.bufferLength = bufferLength; - this.iv = iv; - if (result.length === 0) { - return new Uint8Array([]); - } - // combining plain text blocks into one - var outputLength = 16 * result.length; - var output = new Uint8Array(outputLength); - for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { - output.set(result[i], j); - } - return output; - } - }; - - return AES128Cipher; -})(); - -var AES256Cipher = (function AES256CipherClosure() { - var rcon = new Uint8Array([ - 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, - 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, - 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, - 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83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0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, - 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, - 0x74, 0xe8, 0xcb, 0x8d]); - - var s = new Uint8Array([ - 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, - 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, - 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, - 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, - 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, - 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, - 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, - 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, - 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, - 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, - 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, - 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, - 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, - 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, - 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, - 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, - 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, - 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, - 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, - 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, - 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, - 0xb0, 0x54, 0xbb, 0x16]); - - var inv_s = new Uint8Array([ - 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, - 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, - 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, - 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, - 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, - 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, - 0xd4, 0xa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0x7d]); - - var mixCol = new Uint8Array(256); - for (var i = 0; i < 256; i++) { - if (i < 128) { - mixCol[i] = i << 1; - } else { - mixCol[i] = (i << 1) ^ 0x1b; - } - } - var mix = new Uint32Array([ - 0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, - 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, - 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, - 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, - 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, - 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, - 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, - 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, - 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, - 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, - 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, - 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, - 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, - 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, - 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, - 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, - 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, - 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, - 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, - 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, - 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, - 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, - 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, - 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, - 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, - 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, - 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, - 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, - 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, - 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, - 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, - 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, - 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, - 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, - 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, - 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, - 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, - 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, - 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, - 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, - 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, - 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, - 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]); - - function expandKey256(cipherKey) { - var b = 240, result = new Uint8Array(b); - var r = 1; - - result.set(cipherKey); - for (var j = 32, i = 1; j < b; ++i) { - if (j % 32 === 16) { - t1 = s[t1]; - t2 = s[t2]; - t3 = s[t3]; - t4 = s[t4]; - } else if (j % 32 === 0) { - // RotWord - var t1 = result[j - 3], t2 = result[j - 2], - t3 = result[j - 1], t4 = result[j - 4]; - // SubWord - t1 = s[t1]; - t2 = s[t2]; - t3 = s[t3]; - t4 = s[t4]; - // Rcon - t1 = t1 ^ r; - if ((r <<= 1) >= 256) { - r = (r ^ 0x1b) & 0xFF; - } - } - - for (var n = 0; n < 4; ++n) { - result[j] = (t1 ^= result[j - 32]); - j++; - result[j] = (t2 ^= result[j - 32]); - j++; - result[j] = (t3 ^= result[j - 32]); - j++; - result[j] = (t4 ^= result[j - 32]); - j++; - } - } - return result; - } - - function decrypt256(input, key) { - var state = new Uint8Array(16); - state.set(input); - var i, j, k; - var t, u, v; - // AddRoundKey - for (j = 0, k = 224; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - for (i = 13; i >= 1; --i) { - // InvShiftRows - t = state[13]; - state[13] = state[9]; - state[9] = state[5]; - state[5] = state[1]; - state[1] = t; - t = state[14]; - u = state[10]; - state[14] = state[6]; - state[10] = state[2]; - state[6] = t; - state[2] = u; - t = state[15]; - u = state[11]; - v = state[7]; - state[15] = state[3]; - state[11] = t; - state[7] = u; - state[3] = v; - // InvSubBytes - for (j = 0; j < 16; ++j) { - state[j] = inv_s[state[j]]; - } - // AddRoundKey - for (j = 0, k = i * 16; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - // InvMixColumns - for (j = 0; j < 16; j += 4) { - var s0 = mix[state[j]], s1 = mix[state[j + 1]], - s2 = mix[state[j + 2]], s3 = mix[state[j + 3]]; - t = (s0 ^ (s1 >>> 8) ^ (s1 << 24) ^ (s2 >>> 16) ^ (s2 << 16) ^ - (s3 >>> 24) ^ (s3 << 8)); - state[j] = (t >>> 24) & 0xFF; - state[j + 1] = (t >> 16) & 0xFF; - state[j + 2] = (t >> 8) & 0xFF; - state[j + 3] = t & 0xFF; - } - } - // InvShiftRows - t = state[13]; - state[13] = state[9]; - state[9] = state[5]; - state[5] = state[1]; - state[1] = t; - t = state[14]; - u = state[10]; - state[14] = state[6]; - state[10] = state[2]; - state[6] = t; - state[2] = u; - t = state[15]; - u = state[11]; - v = state[7]; - state[15] = state[3]; - state[11] = t; - state[7] = u; - state[3] = v; - for (j = 0; j < 16; ++j) { - // InvSubBytes - state[j] = inv_s[state[j]]; - // AddRoundKey - state[j] ^= key[j]; - } - return state; - } - - function encrypt256(input, key) { - var t, u, v, k; - var state = new Uint8Array(16); - state.set(input); - for (j = 0; j < 16; ++j) { - // AddRoundKey - state[j] ^= key[j]; - } - - for (i = 1; i < 14; i++) { - //SubBytes - for (j = 0; j < 16; ++j) { - state[j] = s[state[j]]; - } - //ShiftRows - v = state[1]; - state[1] = state[5]; - state[5] = state[9]; - state[9] = state[13]; - state[13] = v; - v = state[2]; - u = state[6]; - state[2] = state[10]; - state[6] = state[14]; - state[10] = v; - state[14] = u; - v = state[3]; - u = state[7]; - t = state[11]; - state[3] = state[15]; - state[7] = v; - state[11] = u; - state[15] = t; - //MixColumns - for (var j = 0; j < 16; j += 4) { - var s0 = state[j + 0], s1 = state[j + 1]; - var s2 = state[j + 2], s3 = state[j + 3]; - t = s0 ^ s1 ^ s2 ^ s3; - state[j + 0] ^= t ^ mixCol[s0 ^ s1]; - state[j + 1] ^= t ^ mixCol[s1 ^ s2]; - state[j + 2] ^= t ^ mixCol[s2 ^ s3]; - state[j + 3] ^= t ^ mixCol[s3 ^ s0]; - } - //AddRoundKey - for (j = 0, k = i * 16; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - } - - //SubBytes - for (j = 0; j < 16; ++j) { - state[j] = s[state[j]]; - } - //ShiftRows - v = state[1]; - state[1] = state[5]; - state[5] = state[9]; - state[9] = state[13]; - state[13] = v; - v = state[2]; - u = state[6]; - state[2] = state[10]; - state[6] = state[14]; - state[10] = v; - state[14] = u; - v = state[3]; - u = state[7]; - t = state[11]; - state[3] = state[15]; - state[7] = v; - state[11] = u; - state[15] = t; - //AddRoundKey - for (j = 0, k = 224; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - - return state; - - } - - function AES256Cipher(key) { - this.key = expandKey256(key); - this.buffer = new Uint8Array(16); - this.bufferPosition = 0; - } - - function decryptBlock2(data, finalize) { - var i, j, ii, sourceLength = data.length, - buffer = this.buffer, bufferLength = this.bufferPosition, - result = [], iv = this.iv; - - for (i = 0; i < sourceLength; ++i) { - buffer[bufferLength] = data[i]; - ++bufferLength; - if (bufferLength < 16) { - continue; - } - // buffer is full, decrypting - var plain = decrypt256(buffer, this.key); - // xor-ing the IV vector to get plain text - for (j = 0; j < 16; ++j) { - plain[j] ^= iv[j]; - } - iv = buffer; - result.push(plain); - buffer = new Uint8Array(16); - bufferLength = 0; - } - // saving incomplete buffer - this.buffer = buffer; - this.bufferLength = bufferLength; - this.iv = iv; - if (result.length === 0) { - return new Uint8Array([]); - } - // combining plain text blocks into one - var outputLength = 16 * result.length; - if (finalize) { - // undo a padding that is described in RFC 2898 - var lastBlock = result[result.length - 1]; - var psLen = lastBlock[15]; - if (psLen <= 16) { - for (i = 15, ii = 16 - psLen; i >= ii; --i) { - if (lastBlock[i] !== psLen) { - // Invalid padding, assume that the block has no padding. - psLen = 0; - break; - } - } - outputLength -= psLen; - result[result.length - 1] = lastBlock.subarray(0, 16 - psLen); - } - } - var output = new Uint8Array(outputLength); - for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { - output.set(result[i], j); - } - return output; - - } - - AES256Cipher.prototype = { - decryptBlock: function AES256Cipher_decryptBlock(data, finalize, iv) { - var i, sourceLength = data.length; - var buffer = this.buffer, bufferLength = this.bufferPosition; - // if not supplied an IV wait for IV values - // they are at the start of the stream - if (iv) { - this.iv = iv; - } else { - for (i = 0; bufferLength < 16 && - i < sourceLength; ++i, ++bufferLength) { - buffer[bufferLength] = data[i]; - } - if (bufferLength < 16) { - //need more data - this.bufferLength = bufferLength; - return new Uint8Array([]); - } - this.iv = buffer; - data = data.subarray(16); - } - this.buffer = new Uint8Array(16); - this.bufferLength = 0; - // starting decryption - this.decryptBlock = decryptBlock2; - return this.decryptBlock(data, finalize); - }, - encrypt: function AES256Cipher_encrypt(data, iv) { - var i, j, ii, sourceLength = data.length, - buffer = this.buffer, bufferLength = this.bufferPosition, - result = []; - if (!iv) { - iv = new Uint8Array(16); - } - for (i = 0; i < sourceLength; ++i) { - buffer[bufferLength] = data[i]; - ++bufferLength; - if (bufferLength < 16) { - continue; - } - for (j = 0; j < 16; ++j) { - buffer[j] ^= iv[j]; - } - - // buffer is full, encrypting - var cipher = encrypt256(buffer, this.key); - this.iv = cipher; - result.push(cipher); - buffer = new Uint8Array(16); - bufferLength = 0; - } - // saving incomplete buffer - this.buffer = buffer; - this.bufferLength = bufferLength; - this.iv = iv; - if (result.length === 0) { - return new Uint8Array([]); - } - // combining plain text blocks into one - var outputLength = 16 * result.length; - var output = new Uint8Array(outputLength); - for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { - output.set(result[i], j); - } - return output; - } - }; - - return AES256Cipher; -})(); - -var PDF17 = (function PDF17Closure() { - - function compareByteArrays(array1, array2) { - if (array1.length !== array2.length) { - return false; - } - for (var i = 0; i < array1.length; i++) { - if (array1[i] !== array2[i]) { - return false; - } - } - return true; - } - - function PDF17() { - } - - PDF17.prototype = { - checkOwnerPassword: function PDF17_checkOwnerPassword(password, - ownerValidationSalt, - userBytes, - ownerPassword) { - var hashData = new Uint8Array(password.length + 56); - hashData.set(password, 0); - hashData.set(ownerValidationSalt, password.length); - hashData.set(userBytes, password.length + ownerValidationSalt.length); - var result = calculateSHA256(hashData, 0, hashData.length); - return compareByteArrays(result, ownerPassword); - }, - checkUserPassword: function PDF17_checkUserPassword(password, - userValidationSalt, - userPassword) { - var hashData = new Uint8Array(password.length + 8); - hashData.set(password, 0); - hashData.set(userValidationSalt, password.length); - var result = calculateSHA256(hashData, 0, hashData.length); - return compareByteArrays(result, userPassword); - }, - getOwnerKey: function PDF17_getOwnerKey(password, ownerKeySalt, userBytes, - ownerEncryption) { - var hashData = new Uint8Array(password.length + 56); - hashData.set(password, 0); - hashData.set(ownerKeySalt, password.length); - hashData.set(userBytes, password.length + ownerKeySalt.length); - var key = calculateSHA256(hashData, 0, hashData.length); - var cipher = new AES256Cipher(key); - return cipher.decryptBlock(ownerEncryption, - false, - new Uint8Array(16)); - - }, - getUserKey: function PDF17_getUserKey(password, userKeySalt, - userEncryption) { - var hashData = new Uint8Array(password.length + 8); - hashData.set(password, 0); - hashData.set(userKeySalt, password.length); - //key is the decryption key for the UE string - var key = calculateSHA256(hashData, 0, hashData.length); - var cipher = new AES256Cipher(key); - return cipher.decryptBlock(userEncryption, - false, - new Uint8Array(16)); - } - }; - return PDF17; -})(); - -var PDF20 = (function PDF20Closure() { - - function concatArrays(array1, array2) { - var t = new Uint8Array(array1.length + array2.length); - t.set(array1, 0); - t.set(array2, array1.length); - return t; - } - - function calculatePDF20Hash(password, input, userBytes) { - //This refers to Algorithm 2.B as defined in ISO 32000-2 - var k = calculateSHA256(input, 0, input.length).subarray(0, 32); - var e = [0]; - var i = 0; - while (i < 64 || e[e.length - 1] > i - 32) { - var arrayLength = password.length + k.length + userBytes.length; - - var k1 = new Uint8Array(arrayLength * 64); - var array = concatArrays(password, k); - array = concatArrays(array, userBytes); - for (var j = 0, pos = 0; j < 64; j++, pos += arrayLength) { - k1.set(array, pos); - } - //AES128 CBC NO PADDING with - //first 16 bytes of k as the key and the second 16 as the iv. - var cipher = new AES128Cipher(k.subarray(0, 16)); - e = cipher.encrypt(k1, k.subarray(16, 32)); - //Now we have to take the first 16 bytes of an unsigned - //big endian integer... and compute the remainder - //modulo 3.... That is a fairly large number and - //JavaScript isn't going to handle that well... - //So we're using a trick that allows us to perform - //modulo math byte by byte - var remainder = 0; - for (var z = 0; z < 16; z++) { - remainder *= (256 % 3); - remainder %= 3; - remainder += ((e[z] >>> 0) % 3); - remainder %= 3; - } - if (remainder === 0) { - k = calculateSHA256(e, 0, e.length); - } - else if (remainder === 1) { - k = calculateSHA384(e, 0, e.length); - } - else if (remainder === 2) { - k = calculateSHA512(e, 0, e.length); - } - i++; - } - return k.subarray(0, 32); - } - - function PDF20() { - } - - function compareByteArrays(array1, array2) { - if (array1.length !== array2.length) { - return false; - } - for (var i = 0; i < array1.length; i++) { - if (array1[i] !== array2[i]) { - return false; - } - } - return true; - } - - PDF20.prototype = { - hash: function PDF20_hash(password, concatBytes, userBytes) { - return calculatePDF20Hash(password, concatBytes, userBytes); - }, - checkOwnerPassword: function PDF20_checkOwnerPassword(password, - ownerValidationSalt, - userBytes, - ownerPassword) { - var hashData = new Uint8Array(password.length + 56); - hashData.set(password, 0); - hashData.set(ownerValidationSalt, password.length); - hashData.set(userBytes, password.length + ownerValidationSalt.length); - var result = calculatePDF20Hash(password, hashData, userBytes); - return compareByteArrays(result, ownerPassword); - }, - checkUserPassword: function PDF20_checkUserPassword(password, - userValidationSalt, - userPassword) { - var hashData = new Uint8Array(password.length + 8); - hashData.set(password, 0); - hashData.set(userValidationSalt, password.length); - var result = calculatePDF20Hash(password, hashData, []); - return compareByteArrays(result, userPassword); - }, - getOwnerKey: function PDF20_getOwnerKey(password, ownerKeySalt, userBytes, - ownerEncryption) { - var hashData = new Uint8Array(password.length + 56); - hashData.set(password, 0); - hashData.set(ownerKeySalt, password.length); - hashData.set(userBytes, password.length + ownerKeySalt.length); - var key = calculatePDF20Hash(password, hashData, userBytes); - var cipher = new AES256Cipher(key); - return cipher.decryptBlock(ownerEncryption, - false, - new Uint8Array(16)); - - }, - getUserKey: function PDF20_getUserKey(password, userKeySalt, - userEncryption) { - var hashData = new Uint8Array(password.length + 8); - hashData.set(password, 0); - hashData.set(userKeySalt, password.length); - //key is the decryption key for the UE string - var key = calculatePDF20Hash(password, hashData, []); - var cipher = new AES256Cipher(key); - return cipher.decryptBlock(userEncryption, - false, - new Uint8Array(16)); - } - }; - return PDF20; -})(); - -var CipherTransform = (function CipherTransformClosure() { - function CipherTransform(stringCipherConstructor, streamCipherConstructor) { - this.stringCipherConstructor = stringCipherConstructor; - this.streamCipherConstructor = streamCipherConstructor; - } - - CipherTransform.prototype = { - createStream: function CipherTransform_createStream(stream, length) { - var cipher = new this.streamCipherConstructor(); - return new DecryptStream(stream, length, - function cipherTransformDecryptStream(data, finalize) { - return cipher.decryptBlock(data, finalize); - } - ); - }, - decryptString: function CipherTransform_decryptString(s) { - var cipher = new this.stringCipherConstructor(); - var data = stringToBytes(s); - data = cipher.decryptBlock(data, true); - return bytesToString(data); - } - }; - return CipherTransform; -})(); - -var CipherTransformFactory = (function CipherTransformFactoryClosure() { - var defaultPasswordBytes = new Uint8Array([ - 0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41, - 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08, - 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80, - 0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A]); - - function createEncryptionKey20(revision, password, ownerPassword, - ownerValidationSalt, ownerKeySalt, uBytes, - userPassword, userValidationSalt, userKeySalt, - ownerEncryption, userEncryption, perms) { - if (password) { - var passwordLength = Math.min(127, password.length); - password = password.subarray(0, passwordLength); - } else { - password = []; - } - var pdfAlgorithm; - if (revision === 6) { - pdfAlgorithm = new PDF20(); - } else { - pdfAlgorithm = new PDF17(); - } - - if (pdfAlgorithm) { - if (pdfAlgorithm.checkUserPassword(password, userValidationSalt, - userPassword)) { - return pdfAlgorithm.getUserKey(password, userKeySalt, userEncryption); - } else if (password.length && pdfAlgorithm.checkOwnerPassword(password, - ownerValidationSalt, - uBytes, - ownerPassword)) { - return pdfAlgorithm.getOwnerKey(password, ownerKeySalt, uBytes, - ownerEncryption); - } - } - - return null; - } - - function prepareKeyData(fileId, password, ownerPassword, userPassword, - flags, revision, keyLength, encryptMetadata) { - var hashDataSize = 40 + ownerPassword.length + fileId.length; - var hashData = new Uint8Array(hashDataSize), i = 0, j, n; - if (password) { - n = Math.min(32, password.length); - for (; i < n; ++i) { - hashData[i] = password[i]; - } - } - j = 0; - while (i < 32) { - hashData[i++] = defaultPasswordBytes[j++]; - } - // as now the padded password in the hashData[0..i] - for (j = 0, n = ownerPassword.length; j < n; ++j) { - hashData[i++] = ownerPassword[j]; - } - hashData[i++] = flags & 0xFF; - hashData[i++] = (flags >> 8) & 0xFF; - hashData[i++] = (flags >> 16) & 0xFF; - hashData[i++] = (flags >>> 24) & 0xFF; - for (j = 0, n = fileId.length; j < n; ++j) { - hashData[i++] = fileId[j]; - } - if (revision >= 4 && !encryptMetadata) { - hashData[i++] = 0xFF; - hashData[i++] = 0xFF; - hashData[i++] = 0xFF; - hashData[i++] = 0xFF; - } - var hash = calculateMD5(hashData, 0, i); - var keyLengthInBytes = keyLength >> 3; - if (revision >= 3) { - for (j = 0; j < 50; ++j) { - hash = calculateMD5(hash, 0, keyLengthInBytes); - } - } - var encryptionKey = hash.subarray(0, keyLengthInBytes); - var cipher, checkData; - - if (revision >= 3) { - for (i = 0; i < 32; ++i) { - hashData[i] = defaultPasswordBytes[i]; - } - for (j = 0, n = fileId.length; j < n; ++j) { - hashData[i++] = fileId[j]; - } - cipher = new ARCFourCipher(encryptionKey); - checkData = cipher.encryptBlock(calculateMD5(hashData, 0, i)); - n = encryptionKey.length; - var derivedKey = new Uint8Array(n), k; - for (j = 1; j <= 19; ++j) { - for (k = 0; k < n; ++k) { - derivedKey[k] = encryptionKey[k] ^ j; - } - cipher = new ARCFourCipher(derivedKey); - checkData = cipher.encryptBlock(checkData); - } - for (j = 0, n = checkData.length; j < n; ++j) { - if (userPassword[j] !== checkData[j]) { - return null; - } - } - } else { - cipher = new ARCFourCipher(encryptionKey); - checkData = cipher.encryptBlock(defaultPasswordBytes); - for (j = 0, n = checkData.length; j < n; ++j) { - if (userPassword[j] !== checkData[j]) { - return null; - } - } - } - return encryptionKey; - } - - function decodeUserPassword(password, ownerPassword, revision, keyLength) { - var hashData = new Uint8Array(32), i = 0, j, n; - n = Math.min(32, password.length); - for (; i < n; ++i) { - hashData[i] = password[i]; - } - j = 0; - while (i < 32) { - hashData[i++] = defaultPasswordBytes[j++]; - } - var hash = calculateMD5(hashData, 0, i); - var keyLengthInBytes = keyLength >> 3; - if (revision >= 3) { - for (j = 0; j < 50; ++j) { - hash = calculateMD5(hash, 0, hash.length); - } - } - - var cipher, userPassword; - if (revision >= 3) { - userPassword = ownerPassword; - var derivedKey = new Uint8Array(keyLengthInBytes), k; - for (j = 19; j >= 0; j--) { - for (k = 0; k < keyLengthInBytes; ++k) { - derivedKey[k] = hash[k] ^ j; - } - cipher = new ARCFourCipher(derivedKey); - userPassword = cipher.encryptBlock(userPassword); - } - } else { - cipher = new ARCFourCipher(hash.subarray(0, keyLengthInBytes)); - userPassword = cipher.encryptBlock(ownerPassword); - } - return userPassword; - } - - var identityName = Name.get('Identity'); - - function CipherTransformFactory(dict, fileId, password) { - var filter = dict.get('Filter'); - if (!isName(filter) || filter.name !== 'Standard') { - error('unknown encryption method'); - } - this.dict = dict; - var algorithm = dict.get('V'); - if (!isInt(algorithm) || - (algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && - algorithm !== 5)) { - error('unsupported encryption algorithm'); - } - this.algorithm = algorithm; - var keyLength = dict.get('Length') || 40; - if (!isInt(keyLength) || - keyLength < 40 || (keyLength % 8) !== 0) { - error('invalid key length'); - } - - // prepare keys - var ownerPassword = stringToBytes(dict.get('O')).subarray(0, 32); - var userPassword = stringToBytes(dict.get('U')).subarray(0, 32); - var flags = dict.get('P'); - var revision = dict.get('R'); - // meaningful when V is 4 or 5 - var encryptMetadata = ((algorithm === 4 || algorithm === 5) && - dict.get('EncryptMetadata') !== false); - this.encryptMetadata = encryptMetadata; - - var fileIdBytes = stringToBytes(fileId); - var passwordBytes; - if (password) { - if (revision === 6) { - try { - password = utf8StringToString(password); - } catch (ex) { - warn('CipherTransformFactory: ' + - 'Unable to convert UTF8 encoded password.'); - } - } - passwordBytes = stringToBytes(password); - } - - var encryptionKey; - if (algorithm !== 5) { - encryptionKey = prepareKeyData(fileIdBytes, passwordBytes, - ownerPassword, userPassword, flags, - revision, keyLength, encryptMetadata); - } - else { - var ownerValidationSalt = stringToBytes(dict.get('O')).subarray(32, 40); - var ownerKeySalt = stringToBytes(dict.get('O')).subarray(40, 48); - var uBytes = stringToBytes(dict.get('U')).subarray(0, 48); - var userValidationSalt = stringToBytes(dict.get('U')).subarray(32, 40); - var userKeySalt = stringToBytes(dict.get('U')).subarray(40, 48); - var ownerEncryption = stringToBytes(dict.get('OE')); - var userEncryption = stringToBytes(dict.get('UE')); - var perms = stringToBytes(dict.get('Perms')); - encryptionKey = - createEncryptionKey20(revision, passwordBytes, - ownerPassword, ownerValidationSalt, - ownerKeySalt, uBytes, - userPassword, userValidationSalt, - userKeySalt, ownerEncryption, - userEncryption, perms); - } - if (!encryptionKey && !password) { - throw new PasswordException('No password given', - PasswordResponses.NEED_PASSWORD); - } else if (!encryptionKey && password) { - // Attempting use the password as an owner password - var decodedPassword = decodeUserPassword(passwordBytes, ownerPassword, - revision, keyLength); - encryptionKey = prepareKeyData(fileIdBytes, decodedPassword, - ownerPassword, userPassword, flags, - revision, keyLength, encryptMetadata); - } - - if (!encryptionKey) { - throw new PasswordException('Incorrect Password', - PasswordResponses.INCORRECT_PASSWORD); - } - - this.encryptionKey = encryptionKey; - - if (algorithm >= 4) { - this.cf = dict.get('CF'); - this.stmf = dict.get('StmF') || identityName; - this.strf = dict.get('StrF') || identityName; - this.eff = dict.get('EFF') || this.stmf; - } - } - - function buildObjectKey(num, gen, encryptionKey, isAes) { - var key = new Uint8Array(encryptionKey.length + 9), i, n; - for (i = 0, n = encryptionKey.length; i < n; ++i) { - key[i] = encryptionKey[i]; - } - key[i++] = num & 0xFF; - key[i++] = (num >> 8) & 0xFF; - key[i++] = (num >> 16) & 0xFF; - key[i++] = gen & 0xFF; - key[i++] = (gen >> 8) & 0xFF; - if (isAes) { - key[i++] = 0x73; - key[i++] = 0x41; - key[i++] = 0x6C; - key[i++] = 0x54; - } - var hash = calculateMD5(key, 0, i); - return hash.subarray(0, Math.min(encryptionKey.length + 5, 16)); - } - - function buildCipherConstructor(cf, name, num, gen, key) { - var cryptFilter = cf.get(name.name); - var cfm; - if (cryptFilter !== null && cryptFilter !== undefined) { - cfm = cryptFilter.get('CFM'); - } - if (!cfm || cfm.name === 'None') { - return function cipherTransformFactoryBuildCipherConstructorNone() { - return new NullCipher(); - }; - } - if ('V2' === cfm.name) { - return function cipherTransformFactoryBuildCipherConstructorV2() { - return new ARCFourCipher(buildObjectKey(num, gen, key, false)); - }; - } - if ('AESV2' === cfm.name) { - return function cipherTransformFactoryBuildCipherConstructorAESV2() { - return new AES128Cipher(buildObjectKey(num, gen, key, true)); - }; - } - if ('AESV3' === cfm.name) { - return function cipherTransformFactoryBuildCipherConstructorAESV3() { - return new AES256Cipher(key); - }; - } - error('Unknown crypto method'); - } - - CipherTransformFactory.prototype = { - createCipherTransform: - function CipherTransformFactory_createCipherTransform(num, gen) { - if (this.algorithm === 4 || this.algorithm === 5) { - return new CipherTransform( - buildCipherConstructor(this.cf, this.stmf, - num, gen, this.encryptionKey), - buildCipherConstructor(this.cf, this.strf, - num, gen, this.encryptionKey)); - } - // algorithms 1 and 2 - var key = buildObjectKey(num, gen, this.encryptionKey, false); - var cipherConstructor = function buildCipherCipherConstructor() { - return new ARCFourCipher(key); - }; - return new CipherTransform(cipherConstructor, cipherConstructor); - } - }; - - return CipherTransformFactory; -})(); - - -var ShadingType = { - FUNCTION_BASED: 1, - AXIAL: 2, - RADIAL: 3, - FREE_FORM_MESH: 4, - LATTICE_FORM_MESH: 5, - COONS_PATCH_MESH: 6, - TENSOR_PATCH_MESH: 7 -}; - -var Pattern = (function PatternClosure() { - // Constructor should define this.getPattern - function Pattern() { - error('should not call Pattern constructor'); - } - - Pattern.prototype = { - // Input: current Canvas context - // Output: the appropriate fillStyle or strokeStyle - getPattern: function Pattern_getPattern(ctx) { - error('Should not call Pattern.getStyle: ' + ctx); - } - }; - - Pattern.parseShading = function Pattern_parseShading(shading, matrix, xref, - res, handler) { - - var dict = isStream(shading) ? shading.dict : shading; - var type = dict.get('ShadingType'); - - try { - switch (type) { - case ShadingType.AXIAL: - case ShadingType.RADIAL: - // Both radial and axial shadings are handled by RadialAxial shading. - return new Shadings.RadialAxial(dict, matrix, xref, res); - case ShadingType.FREE_FORM_MESH: - case ShadingType.LATTICE_FORM_MESH: - case ShadingType.COONS_PATCH_MESH: - case ShadingType.TENSOR_PATCH_MESH: - return new Shadings.Mesh(shading, matrix, xref, res); - default: - throw new Error('Unsupported ShadingType: ' + type); - } - } catch (ex) { - if (ex instanceof MissingDataException) { - throw ex; - } - handler.send('UnsupportedFeature', - {featureId: UNSUPPORTED_FEATURES.shadingPattern}); - warn(ex); - return new Shadings.Dummy(); - } - }; - return Pattern; -})(); - -var Shadings = {}; - -// A small number to offset the first/last color stops so we can insert ones to -// support extend. Number.MIN_VALUE appears to be too small and breaks the -// extend. 1e-7 works in FF but chrome seems to use an even smaller sized number -// internally so we have to go bigger. -Shadings.SMALL_NUMBER = 1e-2; - -// Radial and axial shading have very similar implementations -// If needed, the implementations can be broken into two classes -Shadings.RadialAxial = (function RadialAxialClosure() { - function RadialAxial(dict, matrix, xref, res) { - this.matrix = matrix; - this.coordsArr = dict.get('Coords'); - this.shadingType = dict.get('ShadingType'); - this.type = 'Pattern'; - var cs = dict.get('ColorSpace', 'CS'); - cs = ColorSpace.parse(cs, xref, res); - this.cs = cs; - - var t0 = 0.0, t1 = 1.0; - if (dict.has('Domain')) { - var domainArr = dict.get('Domain'); - t0 = domainArr[0]; - t1 = domainArr[1]; - } - - var extendStart = false, extendEnd = false; - if (dict.has('Extend')) { - var extendArr = dict.get('Extend'); - extendStart = extendArr[0]; - extendEnd = extendArr[1]; - } - - if (this.shadingType === ShadingType.RADIAL && - (!extendStart || !extendEnd)) { - // Radial gradient only currently works if either circle is fully within - // the other circle. - var x1 = this.coordsArr[0]; - var y1 = this.coordsArr[1]; - var r1 = this.coordsArr[2]; - var x2 = this.coordsArr[3]; - var y2 = this.coordsArr[4]; - var r2 = this.coordsArr[5]; - var distance = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); - if (r1 <= r2 + distance && - r2 <= r1 + distance) { - warn('Unsupported radial gradient.'); - } - } - - this.extendStart = extendStart; - this.extendEnd = extendEnd; - - var fnObj = dict.get('Function'); - var fn = PDFFunction.parseArray(xref, fnObj); - - // 10 samples seems good enough for now, but probably won't work - // if there are sharp color changes. Ideally, we would implement - // the spec faithfully and add lossless optimizations. - var diff = t1 - t0; - var step = diff / 10; - - var colorStops = this.colorStops = []; - - // Protect against bad domains so we don't end up in an infinte loop below. - if (t0 >= t1 || step <= 0) { - // Acrobat doesn't seem to handle these cases so we'll ignore for - // now. - info('Bad shading domain.'); - return; - } - - var color = new Float32Array(cs.numComps), ratio = new Float32Array(1); - var rgbColor; - for (var i = t0; i <= t1; i += step) { - ratio[0] = i; - fn(ratio, 0, color, 0); - rgbColor = cs.getRgb(color, 0); - var cssColor = Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]); - colorStops.push([(i - t0) / diff, cssColor]); - } - - var background = 'transparent'; - if (dict.has('Background')) { - rgbColor = cs.getRgb(dict.get('Background'), 0); - background = Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]); - } - - if (!extendStart) { - // Insert a color stop at the front and offset the first real color stop - // so it doesn't conflict with the one we insert. - colorStops.unshift([0, background]); - colorStops[1][0] += Shadings.SMALL_NUMBER; - } - if (!extendEnd) { - // Same idea as above in extendStart but for the end. - colorStops[colorStops.length - 1][0] -= Shadings.SMALL_NUMBER; - colorStops.push([1, background]); - } - - this.colorStops = colorStops; - } - - RadialAxial.prototype = { - getIR: function RadialAxial_getIR() { - var coordsArr = this.coordsArr; - var shadingType = this.shadingType; - var type, p0, p1, r0, r1; - if (shadingType === ShadingType.AXIAL) { - p0 = [coordsArr[0], coordsArr[1]]; - p1 = [coordsArr[2], coordsArr[3]]; - r0 = null; - r1 = null; - type = 'axial'; - } else if (shadingType === ShadingType.RADIAL) { - p0 = [coordsArr[0], coordsArr[1]]; - p1 = [coordsArr[3], coordsArr[4]]; - r0 = coordsArr[2]; - r1 = coordsArr[5]; - type = 'radial'; - } else { - error('getPattern type unknown: ' + shadingType); - } - - var matrix = this.matrix; - if (matrix) { - p0 = Util.applyTransform(p0, matrix); - p1 = Util.applyTransform(p1, matrix); - if (shadingType === ShadingType.RADIAL) { - var scale = Util.singularValueDecompose2dScale(matrix); - r0 *= scale[0]; - r1 *= scale[1]; - } - } - - return ['RadialAxial', type, this.colorStops, p0, p1, r0, r1]; - } - }; - - return RadialAxial; -})(); - -// All mesh shading. For now, they will be presented as set of the triangles -// to be drawn on the canvas and rgb color for each vertex. -Shadings.Mesh = (function MeshClosure() { - function MeshStreamReader(stream, context) { - this.stream = stream; - this.context = context; - this.buffer = 0; - this.bufferLength = 0; - - var numComps = context.numComps; - this.tmpCompsBuf = new Float32Array(numComps); - var csNumComps = context.colorSpace.numComps; - this.tmpCsCompsBuf = context.colorFn ? new Float32Array(csNumComps) : - this.tmpCompsBuf; - } - MeshStreamReader.prototype = { - get hasData() { - if (this.stream.end) { - return this.stream.pos < this.stream.end; - } - if (this.bufferLength > 0) { - return true; - } - var nextByte = this.stream.getByte(); - if (nextByte < 0) { - return false; - } - this.buffer = nextByte; - this.bufferLength = 8; - return true; - }, - readBits: function MeshStreamReader_readBits(n) { - var buffer = this.buffer; - var bufferLength = this.bufferLength; - if (n === 32) { - if (bufferLength === 0) { - return ((this.stream.getByte() << 24) | - (this.stream.getByte() << 16) | (this.stream.getByte() << 8) | - this.stream.getByte()) >>> 0; - } - buffer = (buffer << 24) | (this.stream.getByte() << 16) | - (this.stream.getByte() << 8) | this.stream.getByte(); - var nextByte = this.stream.getByte(); - this.buffer = nextByte & ((1 << bufferLength) - 1); - return ((buffer << (8 - bufferLength)) | - ((nextByte & 0xFF) >> bufferLength)) >>> 0; - } - if (n === 8 && bufferLength === 0) { - return this.stream.getByte(); - } - while (bufferLength < n) { - buffer = (buffer << 8) | this.stream.getByte(); - bufferLength += 8; - } - bufferLength -= n; - this.bufferLength = bufferLength; - this.buffer = buffer & ((1 << bufferLength) - 1); - return buffer >> bufferLength; - }, - align: function MeshStreamReader_align() { - this.buffer = 0; - this.bufferLength = 0; - }, - readFlag: function MeshStreamReader_readFlag() { - return this.readBits(this.context.bitsPerFlag); - }, - readCoordinate: function MeshStreamReader_readCoordinate() { - var bitsPerCoordinate = this.context.bitsPerCoordinate; - var xi = this.readBits(bitsPerCoordinate); - var yi = this.readBits(bitsPerCoordinate); - var decode = this.context.decode; - var scale = bitsPerCoordinate < 32 ? 1 / ((1 << bitsPerCoordinate) - 1) : - 2.3283064365386963e-10; // 2 ^ -32 - return [ - xi * scale * (decode[1] - decode[0]) + decode[0], - yi * scale * (decode[3] - decode[2]) + decode[2] - ]; - }, - readComponents: function MeshStreamReader_readComponents() { - var numComps = this.context.numComps; - var bitsPerComponent = this.context.bitsPerComponent; - var scale = bitsPerComponent < 32 ? 1 / ((1 << bitsPerComponent) - 1) : - 2.3283064365386963e-10; // 2 ^ -32 - var decode = this.context.decode; - var components = this.tmpCompsBuf; - for (var i = 0, j = 4; i < numComps; i++, j += 2) { - var ci = this.readBits(bitsPerComponent); - components[i] = ci * scale * (decode[j + 1] - decode[j]) + decode[j]; - } - var color = this.tmpCsCompsBuf; - if (this.context.colorFn) { - this.context.colorFn(components, 0, color, 0); - } - return this.context.colorSpace.getRgb(color, 0); - } - }; - - function decodeType4Shading(mesh, reader) { - var coords = mesh.coords; - var colors = mesh.colors; - var operators = []; - var ps = []; // not maintaining cs since that will match ps - var verticesLeft = 0; // assuming we have all data to start a new triangle - while (reader.hasData) { - var f = reader.readFlag(); - var coord = reader.readCoordinate(); - var color = reader.readComponents(); - if (verticesLeft === 0) { // ignoring flags if we started a triangle - assert(0 <= f && f <= 2, 'Unknown type4 flag'); - switch (f) { - case 0: - verticesLeft = 3; - break; - case 1: - ps.push(ps[ps.length - 2], ps[ps.length - 1]); - verticesLeft = 1; - break; - case 2: - ps.push(ps[ps.length - 3], ps[ps.length - 1]); - verticesLeft = 1; - break; - } - operators.push(f); - } - ps.push(coords.length); - coords.push(coord); - colors.push(color); - verticesLeft--; - - reader.align(); - } - mesh.figures.push({ - type: 'triangles', - coords: new Int32Array(ps), - colors: new Int32Array(ps), - }); - } - - function decodeType5Shading(mesh, reader, verticesPerRow) { - var coords = mesh.coords; - var colors = mesh.colors; - var ps = []; // not maintaining cs since that will match ps - while (reader.hasData) { - var coord = reader.readCoordinate(); - var color = reader.readComponents(); - ps.push(coords.length); - coords.push(coord); - colors.push(color); - } - mesh.figures.push({ - type: 'lattice', - coords: new Int32Array(ps), - colors: new Int32Array(ps), - verticesPerRow: verticesPerRow - }); - } - - var MIN_SPLIT_PATCH_CHUNKS_AMOUNT = 3; - var MAX_SPLIT_PATCH_CHUNKS_AMOUNT = 20; - - var TRIANGLE_DENSITY = 20; // count of triangles per entire mesh bounds - - var getB = (function getBClosure() { - function buildB(count) { - var lut = []; - for (var i = 0; i <= count; i++) { - var t = i / count, t_ = 1 - t; - lut.push(new Float32Array([t_ * t_ * t_, 3 * t * t_ * t_, - 3 * t * t * t_, t * t * t])); - } - return lut; - } - var cache = []; - return function getB(count) { - if (!cache[count]) { - cache[count] = buildB(count); - } - return cache[count]; - }; - })(); - - function buildFigureFromPatch(mesh, index) { - var figure = mesh.figures[index]; - assert(figure.type === 'patch', 'Unexpected patch mesh figure'); - - var coords = mesh.coords, colors = mesh.colors; - var pi = figure.coords; - var ci = figure.colors; - - var figureMinX = Math.min(coords[pi[0]][0], coords[pi[3]][0], - coords[pi[12]][0], coords[pi[15]][0]); - var figureMinY = Math.min(coords[pi[0]][1], coords[pi[3]][1], - coords[pi[12]][1], coords[pi[15]][1]); - var figureMaxX = Math.max(coords[pi[0]][0], coords[pi[3]][0], - coords[pi[12]][0], coords[pi[15]][0]); - var figureMaxY = Math.max(coords[pi[0]][1], coords[pi[3]][1], - coords[pi[12]][1], coords[pi[15]][1]); - var splitXBy = Math.ceil((figureMaxX - figureMinX) * TRIANGLE_DENSITY / - (mesh.bounds[2] - mesh.bounds[0])); - splitXBy = Math.max(MIN_SPLIT_PATCH_CHUNKS_AMOUNT, - Math.min(MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitXBy)); - var splitYBy = Math.ceil((figureMaxY - figureMinY) * TRIANGLE_DENSITY / - (mesh.bounds[3] - mesh.bounds[1])); - splitYBy = Math.max(MIN_SPLIT_PATCH_CHUNKS_AMOUNT, - Math.min(MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitYBy)); - - var verticesPerRow = splitXBy + 1; - var figureCoords = new Int32Array((splitYBy + 1) * verticesPerRow); - var figureColors = new Int32Array((splitYBy + 1) * verticesPerRow); - var k = 0; - var cl = new Uint8Array(3), cr = new Uint8Array(3); - var c0 = colors[ci[0]], c1 = colors[ci[1]], - c2 = colors[ci[2]], c3 = colors[ci[3]]; - var bRow = getB(splitYBy), bCol = getB(splitXBy); - for (var row = 0; row <= splitYBy; row++) { - cl[0] = ((c0[0] * (splitYBy - row) + c2[0] * row) / splitYBy) | 0; - cl[1] = ((c0[1] * (splitYBy - row) + c2[1] * row) / splitYBy) | 0; - cl[2] = ((c0[2] * (splitYBy - row) + c2[2] * row) / splitYBy) | 0; - - cr[0] = ((c1[0] * (splitYBy - row) + c3[0] * row) / splitYBy) | 0; - cr[1] = ((c1[1] * (splitYBy - row) + c3[1] * row) / splitYBy) | 0; - cr[2] = ((c1[2] * (splitYBy - row) + c3[2] * row) / splitYBy) | 0; - - for (var col = 0; col <= splitXBy; col++, k++) { - if ((row === 0 || row === splitYBy) && - (col === 0 || col === splitXBy)) { - continue; - } - var x = 0, y = 0; - var q = 0; - for (var i = 0; i <= 3; i++) { - for (var j = 0; j <= 3; j++, q++) { - var m = bRow[row][i] * bCol[col][j]; - x += coords[pi[q]][0] * m; - y += coords[pi[q]][1] * m; - } - } - figureCoords[k] = coords.length; - coords.push([x, y]); - figureColors[k] = colors.length; - var newColor = new Uint8Array(3); - newColor[0] = ((cl[0] * (splitXBy - col) + cr[0] * col) / splitXBy) | 0; - newColor[1] = ((cl[1] * (splitXBy - col) + cr[1] * col) / splitXBy) | 0; - newColor[2] = ((cl[2] * (splitXBy - col) + cr[2] * col) / splitXBy) | 0; - colors.push(newColor); - } - } - figureCoords[0] = pi[0]; - figureColors[0] = ci[0]; - figureCoords[splitXBy] = pi[3]; - figureColors[splitXBy] = ci[1]; - figureCoords[verticesPerRow * splitYBy] = pi[12]; - figureColors[verticesPerRow * splitYBy] = ci[2]; - figureCoords[verticesPerRow * splitYBy + splitXBy] = pi[15]; - figureColors[verticesPerRow * splitYBy + splitXBy] = ci[3]; - - mesh.figures[index] = { - type: 'lattice', - coords: figureCoords, - colors: figureColors, - verticesPerRow: verticesPerRow - }; - } - - function decodeType6Shading(mesh, reader) { - // A special case of Type 7. The p11, p12, p21, p22 automatically filled - var coords = mesh.coords; - var colors = mesh.colors; - var ps = new Int32Array(16); // p00, p10, ..., p30, p01, ..., p33 - var cs = new Int32Array(4); // c00, c30, c03, c33 - while (reader.hasData) { - var f = reader.readFlag(); - assert(0 <= f && f <= 3, 'Unknown type6 flag'); - var i, ii; - var pi = coords.length; - for (i = 0, ii = (f !== 0 ? 8 : 12); i < ii; i++) { - coords.push(reader.readCoordinate()); - } - var ci = colors.length; - for (i = 0, ii = (f !== 0 ? 2 : 4); i < ii; i++) { - colors.push(reader.readComponents()); - } - var tmp1, tmp2, tmp3, tmp4; - switch (f) { - case 0: - ps[12] = pi + 3; ps[13] = pi + 4; ps[14] = pi + 5; ps[15] = pi + 6; - ps[ 8] = pi + 2; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 7; - ps[ 4] = pi + 1; /* calculated below */ ps[ 7] = pi + 8; - ps[ 0] = pi; ps[ 1] = pi + 11; ps[ 2] = pi + 10; ps[ 3] = pi + 9; - cs[2] = ci + 1; cs[3] = ci + 2; - cs[0] = ci; cs[1] = ci + 3; - break; - case 1: - tmp1 = ps[12]; tmp2 = ps[13]; tmp3 = ps[14]; tmp4 = ps[15]; - ps[12] = tmp4; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = tmp3; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 3; - ps[ 4] = tmp2; /* calculated below */ ps[ 7] = pi + 4; - ps[ 0] = tmp1; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - tmp1 = cs[2]; tmp2 = cs[3]; - cs[2] = tmp2; cs[3] = ci; - cs[0] = tmp1; cs[1] = ci + 1; - break; - case 2: - tmp1 = ps[15]; - tmp2 = ps[11]; - ps[12] = ps[3]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = ps[7]; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 3; - ps[ 4] = tmp2; /* calculated below */ ps[ 7] = pi + 4; - ps[ 0] = tmp1; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - tmp1 = cs[3]; - cs[2] = cs[1]; cs[3] = ci; - cs[0] = tmp1; cs[1] = ci + 1; - break; - case 3: - ps[12] = ps[0]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = ps[1]; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 3; - ps[ 4] = ps[2]; /* calculated below */ ps[ 7] = pi + 4; - ps[ 0] = ps[3]; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - cs[2] = cs[0]; cs[3] = ci; - cs[0] = cs[1]; cs[1] = ci + 1; - break; - } - // set p11, p12, p21, p22 - ps[5] = coords.length; - coords.push([ - (-4 * coords[ps[0]][0] - coords[ps[15]][0] + - 6 * (coords[ps[4]][0] + coords[ps[1]][0]) - - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + - 3 * (coords[ps[13]][0] + coords[ps[7]][0])) / 9, - (-4 * coords[ps[0]][1] - coords[ps[15]][1] + - 6 * (coords[ps[4]][1] + coords[ps[1]][1]) - - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + - 3 * (coords[ps[13]][1] + coords[ps[7]][1])) / 9 - ]); - ps[6] = coords.length; - coords.push([ - (-4 * coords[ps[3]][0] - coords[ps[12]][0] + - 6 * (coords[ps[2]][0] + coords[ps[7]][0]) - - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + - 3 * (coords[ps[4]][0] + coords[ps[14]][0])) / 9, - (-4 * coords[ps[3]][1] - coords[ps[12]][1] + - 6 * (coords[ps[2]][1] + coords[ps[7]][1]) - - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + - 3 * (coords[ps[4]][1] + coords[ps[14]][1])) / 9 - ]); - ps[9] = coords.length; - coords.push([ - (-4 * coords[ps[12]][0] - coords[ps[3]][0] + - 6 * (coords[ps[8]][0] + coords[ps[13]][0]) - - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + - 3 * (coords[ps[11]][0] + coords[ps[1]][0])) / 9, - (-4 * coords[ps[12]][1] - coords[ps[3]][1] + - 6 * (coords[ps[8]][1] + coords[ps[13]][1]) - - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + - 3 * (coords[ps[11]][1] + coords[ps[1]][1])) / 9 - ]); - ps[10] = coords.length; - coords.push([ - (-4 * coords[ps[15]][0] - coords[ps[0]][0] + - 6 * (coords[ps[11]][0] + coords[ps[14]][0]) - - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + - 3 * (coords[ps[2]][0] + coords[ps[8]][0])) / 9, - (-4 * coords[ps[15]][1] - coords[ps[0]][1] + - 6 * (coords[ps[11]][1] + coords[ps[14]][1]) - - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + - 3 * (coords[ps[2]][1] + coords[ps[8]][1])) / 9 - ]); - mesh.figures.push({ - type: 'patch', - coords: new Int32Array(ps), // making copies of ps and cs - colors: new Int32Array(cs) - }); - } - } - - function decodeType7Shading(mesh, reader) { - var coords = mesh.coords; - var colors = mesh.colors; - var ps = new Int32Array(16); // p00, p10, ..., p30, p01, ..., p33 - var cs = new Int32Array(4); // c00, c30, c03, c33 - while (reader.hasData) { - var f = reader.readFlag(); - assert(0 <= f && f <= 3, 'Unknown type7 flag'); - var i, ii; - var pi = coords.length; - for (i = 0, ii = (f !== 0 ? 12 : 16); i < ii; i++) { - coords.push(reader.readCoordinate()); - } - var ci = colors.length; - for (i = 0, ii = (f !== 0 ? 2 : 4); i < ii; i++) { - colors.push(reader.readComponents()); - } - var tmp1, tmp2, tmp3, tmp4; - switch (f) { - case 0: - ps[12] = pi + 3; ps[13] = pi + 4; ps[14] = pi + 5; ps[15] = pi + 6; - ps[ 8] = pi + 2; ps[ 9] = pi + 13; ps[10] = pi + 14; ps[11] = pi + 7; - ps[ 4] = pi + 1; ps[ 5] = pi + 12; ps[ 6] = pi + 15; ps[ 7] = pi + 8; - ps[ 0] = pi; ps[ 1] = pi + 11; ps[ 2] = pi + 10; ps[ 3] = pi + 9; - cs[2] = ci + 1; cs[3] = ci + 2; - cs[0] = ci; cs[1] = ci + 3; - break; - case 1: - tmp1 = ps[12]; tmp2 = ps[13]; tmp3 = ps[14]; tmp4 = ps[15]; - ps[12] = tmp4; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = tmp3; ps[ 9] = pi + 9; ps[10] = pi + 10; ps[11] = pi + 3; - ps[ 4] = tmp2; ps[ 5] = pi + 8; ps[ 6] = pi + 11; ps[ 7] = pi + 4; - ps[ 0] = tmp1; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - tmp1 = cs[2]; tmp2 = cs[3]; - cs[2] = tmp2; cs[3] = ci; - cs[0] = tmp1; cs[1] = ci + 1; - break; - case 2: - tmp1 = ps[15]; - tmp2 = ps[11]; - ps[12] = ps[3]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = ps[7]; ps[ 9] = pi + 9; ps[10] = pi + 10; ps[11] = pi + 3; - ps[ 4] = tmp2; ps[ 5] = pi + 8; ps[ 6] = pi + 11; ps[ 7] = pi + 4; - ps[ 0] = tmp1; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - tmp1 = cs[3]; - cs[2] = cs[1]; cs[3] = ci; - cs[0] = tmp1; cs[1] = ci + 1; - break; - case 3: - ps[12] = ps[0]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = ps[1]; ps[ 9] = pi + 9; ps[10] = pi + 10; ps[11] = pi + 3; - ps[ 4] = ps[2]; ps[ 5] = pi + 8; ps[ 6] = pi + 11; ps[ 7] = pi + 4; - ps[ 0] = ps[3]; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - cs[2] = cs[0]; cs[3] = ci; - cs[0] = cs[1]; cs[1] = ci + 1; - break; - } - mesh.figures.push({ - type: 'patch', - coords: new Int32Array(ps), // making copies of ps and cs - colors: new Int32Array(cs) - }); - } - } - - function updateBounds(mesh) { - var minX = mesh.coords[0][0], minY = mesh.coords[0][1], - maxX = minX, maxY = minY; - for (var i = 1, ii = mesh.coords.length; i < ii; i++) { - var x = mesh.coords[i][0], y = mesh.coords[i][1]; - minX = minX > x ? x : minX; - minY = minY > y ? y : minY; - maxX = maxX < x ? x : maxX; - maxY = maxY < y ? y : maxY; - } - mesh.bounds = [minX, minY, maxX, maxY]; - } - - function packData(mesh) { - var i, ii, j, jj; - - var coords = mesh.coords; - var coordsPacked = new Float32Array(coords.length * 2); - for (i = 0, j = 0, ii = coords.length; i < ii; i++) { - var xy = coords[i]; - coordsPacked[j++] = xy[0]; - coordsPacked[j++] = xy[1]; - } - mesh.coords = coordsPacked; - - var colors = mesh.colors; - var colorsPacked = new Uint8Array(colors.length * 3); - for (i = 0, j = 0, ii = colors.length; i < ii; i++) { - var c = colors[i]; - colorsPacked[j++] = c[0]; - colorsPacked[j++] = c[1]; - colorsPacked[j++] = c[2]; - } - mesh.colors = colorsPacked; - - var figures = mesh.figures; - for (i = 0, ii = figures.length; i < ii; i++) { - var figure = figures[i], ps = figure.coords, cs = figure.colors; - for (j = 0, jj = ps.length; j < jj; j++) { - ps[j] *= 2; - cs[j] *= 3; - } - } - } - - function Mesh(stream, matrix, xref, res) { - assert(isStream(stream), 'Mesh data is not a stream'); - var dict = stream.dict; - this.matrix = matrix; - this.shadingType = dict.get('ShadingType'); - this.type = 'Pattern'; - this.bbox = dict.get('BBox'); - var cs = dict.get('ColorSpace', 'CS'); - cs = ColorSpace.parse(cs, xref, res); - this.cs = cs; - this.background = dict.has('Background') ? - cs.getRgb(dict.get('Background'), 0) : null; - - var fnObj = dict.get('Function'); - var fn = fnObj ? PDFFunction.parseArray(xref, fnObj) : null; - - this.coords = []; - this.colors = []; - this.figures = []; - - var decodeContext = { - bitsPerCoordinate: dict.get('BitsPerCoordinate'), - bitsPerComponent: dict.get('BitsPerComponent'), - bitsPerFlag: dict.get('BitsPerFlag'), - decode: dict.get('Decode'), - colorFn: fn, - colorSpace: cs, - numComps: fn ? 1 : cs.numComps - }; - var reader = new MeshStreamReader(stream, decodeContext); - - var patchMesh = false; - switch (this.shadingType) { - case ShadingType.FREE_FORM_MESH: - decodeType4Shading(this, reader); - break; - case ShadingType.LATTICE_FORM_MESH: - var verticesPerRow = dict.get('VerticesPerRow') | 0; - assert(verticesPerRow >= 2, 'Invalid VerticesPerRow'); - decodeType5Shading(this, reader, verticesPerRow); - break; - case ShadingType.COONS_PATCH_MESH: - decodeType6Shading(this, reader); - patchMesh = true; - break; - case ShadingType.TENSOR_PATCH_MESH: - decodeType7Shading(this, reader); - patchMesh = true; - break; - default: - error('Unsupported mesh type.'); - break; - } - - if (patchMesh) { - // dirty bounds calculation for determining, how dense shall be triangles - updateBounds(this); - for (var i = 0, ii = this.figures.length; i < ii; i++) { - buildFigureFromPatch(this, i); - } - } - // calculate bounds - updateBounds(this); - - packData(this); - } - - Mesh.prototype = { - getIR: function Mesh_getIR() { - return ['Mesh', this.shadingType, this.coords, this.colors, this.figures, - this.bounds, this.matrix, this.bbox, this.background]; - } - }; - - return Mesh; -})(); - -Shadings.Dummy = (function DummyClosure() { - function Dummy() { - this.type = 'Pattern'; - } - - Dummy.prototype = { - getIR: function Dummy_getIR() { - return ['Dummy']; - } - }; - return Dummy; -})(); - -function getTilingPatternIR(operatorList, dict, args) { - var matrix = dict.get('Matrix'); - var bbox = dict.get('BBox'); - var xstep = dict.get('XStep'); - var ystep = dict.get('YStep'); - var paintType = dict.get('PaintType'); - var tilingType = dict.get('TilingType'); - - return [ - 'TilingPattern', args, operatorList, matrix, bbox, xstep, ystep, - paintType, tilingType - ]; -} - - -var PartialEvaluator = (function PartialEvaluatorClosure() { - function PartialEvaluator(pdfManager, xref, handler, pageIndex, - uniquePrefix, idCounters, fontCache) { - this.pdfManager = pdfManager; - this.xref = xref; - this.handler = handler; - this.pageIndex = pageIndex; - this.uniquePrefix = uniquePrefix; - this.idCounters = idCounters; - this.fontCache = fontCache; - } - - // Trying to minimize Date.now() usage and check every 100 time - var TIME_SLOT_DURATION_MS = 20; - var CHECK_TIME_EVERY = 100; - function TimeSlotManager() { - this.reset(); - } - TimeSlotManager.prototype = { - check: function TimeSlotManager_check() { - if (++this.checked < CHECK_TIME_EVERY) { - return false; - } - this.checked = 0; - return this.endTime <= Date.now(); - }, - reset: function TimeSlotManager_reset() { - this.endTime = Date.now() + TIME_SLOT_DURATION_MS; - this.checked = 0; - } - }; - - var deferred = Promise.resolve(); - - var TILING_PATTERN = 1, SHADING_PATTERN = 2; - - PartialEvaluator.prototype = { - hasBlendModes: function PartialEvaluator_hasBlendModes(resources) { - if (!isDict(resources)) { - return false; - } - - var processed = Object.create(null); - if (resources.objId) { - processed[resources.objId] = true; - } - - var nodes = [resources]; - while (nodes.length) { - var key; - var node = nodes.shift(); - // First check the current resources for blend modes. - var graphicStates = node.get('ExtGState'); - if (isDict(graphicStates)) { - graphicStates = graphicStates.getAll(); - for (key in graphicStates) { - var graphicState = graphicStates[key]; - var bm = graphicState['BM']; - if (isName(bm) && bm.name !== 'Normal') { - return true; - } - } - } - // Descend into the XObjects to look for more resources and blend modes. - var xObjects = node.get('XObject'); - if (!isDict(xObjects)) { - continue; - } - xObjects = xObjects.getAll(); - for (key in xObjects) { - var xObject = xObjects[key]; - if (!isStream(xObject)) { - continue; - } - if (xObject.dict.objId) { - if (processed[xObject.dict.objId]) { - // stream has objId and is processed already - continue; - } - processed[xObject.dict.objId] = true; - } - var xResources = xObject.dict.get('Resources'); - // Checking objId to detect an infinite loop. - if (isDict(xResources) && - (!xResources.objId || !processed[xResources.objId])) { - nodes.push(xResources); - if (xResources.objId) { - processed[xResources.objId] = true; - } - } - } - } - return false; - }, - - buildFormXObject: function PartialEvaluator_buildFormXObject(resources, - xobj, smask, - operatorList, - task, - initialState) { - var matrix = xobj.dict.getArray('Matrix'); - var bbox = xobj.dict.getArray('BBox'); - var group = xobj.dict.get('Group'); - if (group) { - var groupOptions = { - matrix: matrix, - bbox: bbox, - smask: smask, - isolated: false, - knockout: false - }; - - var groupSubtype = group.get('S'); - var colorSpace; - if (isName(groupSubtype) && groupSubtype.name === 'Transparency') { - groupOptions.isolated = (group.get('I') || false); - groupOptions.knockout = (group.get('K') || false); - colorSpace = (group.has('CS') ? - ColorSpace.parse(group.get('CS'), this.xref, resources) : null); - } - - if (smask && smask.backdrop) { - colorSpace = colorSpace || ColorSpace.singletons.rgb; - smask.backdrop = colorSpace.getRgb(smask.backdrop, 0); - } - - operatorList.addOp(OPS.beginGroup, [groupOptions]); - } - - operatorList.addOp(OPS.paintFormXObjectBegin, [matrix, bbox]); - - return this.getOperatorList(xobj, task, - (xobj.dict.get('Resources') || resources), operatorList, initialState). - then(function () { - operatorList.addOp(OPS.paintFormXObjectEnd, []); - - if (group) { - operatorList.addOp(OPS.endGroup, [groupOptions]); - } - }); - }, - - buildPaintImageXObject: - function PartialEvaluator_buildPaintImageXObject(resources, image, - inline, operatorList, - cacheKey, imageCache) { - var self = this; - var dict = image.dict; - var w = dict.get('Width', 'W'); - var h = dict.get('Height', 'H'); - - if (!(w && isNum(w)) || !(h && isNum(h))) { - warn('Image dimensions are missing, or not numbers.'); - return; - } - if (PDFJS.maxImageSize !== -1 && w * h > PDFJS.maxImageSize) { - warn('Image exceeded maximum allowed size and was removed.'); - return; - } - - var imageMask = (dict.get('ImageMask', 'IM') || false); - var imgData, args; - if (imageMask) { - // This depends on a tmpCanvas being filled with the - // current fillStyle, such that processing the pixel - // data can't be done here. Instead of creating a - // complete PDFImage, only read the information needed - // for later. - - var width = dict.get('Width', 'W'); - var height = dict.get('Height', 'H'); - var bitStrideLength = (width + 7) >> 3; - var imgArray = image.getBytes(bitStrideLength * height); - var decode = dict.get('Decode', 'D'); - var inverseDecode = (!!decode && decode[0] > 0); - - imgData = PDFImage.createMask(imgArray, width, height, - image instanceof DecodeStream, - inverseDecode); - imgData.cached = true; - args = [imgData]; - operatorList.addOp(OPS.paintImageMaskXObject, args); - if (cacheKey) { - imageCache[cacheKey] = { - fn: OPS.paintImageMaskXObject, - args: args - }; - } - return; - } - - var softMask = (dict.get('SMask', 'SM') || false); - var mask = (dict.get('Mask') || false); - - var SMALL_IMAGE_DIMENSIONS = 200; - // Inlining small images into the queue as RGB data - if (inline && !softMask && !mask && !(image instanceof JpegStream) && - (w + h) < SMALL_IMAGE_DIMENSIONS) { - var imageObj = new PDFImage(this.xref, resources, image, - inline, null, null); - // We force the use of RGBA_32BPP images here, because we can't handle - // any other kind. - imgData = imageObj.createImageData(/* forceRGBA = */ true); - operatorList.addOp(OPS.paintInlineImageXObject, [imgData]); - return; - } - - // If there is no imageMask, create the PDFImage and a lot - // of image processing can be done here. - var uniquePrefix = (this.uniquePrefix || ''); - var objId = 'img_' + uniquePrefix + (++this.idCounters.obj); - operatorList.addDependency(objId); - args = [objId, w, h]; - - if (!softMask && !mask && image instanceof JpegStream && - image.isNativelySupported(this.xref, resources)) { - // These JPEGs don't need any more processing so we can just send it. - operatorList.addOp(OPS.paintJpegXObject, args); - this.handler.send('obj', - [objId, this.pageIndex, 'JpegStream', image.getIR()]); - return; - } - - PDFImage.buildImage(self.handler, self.xref, resources, image, inline). - then(function(imageObj) { - var imgData = imageObj.createImageData(/* forceRGBA = */ false); - self.handler.send('obj', [objId, self.pageIndex, 'Image', imgData], - [imgData.data.buffer]); - }).then(undefined, function (reason) { - warn('Unable to decode image: ' + reason); - self.handler.send('obj', [objId, self.pageIndex, 'Image', null]); - }); - - operatorList.addOp(OPS.paintImageXObject, args); - if (cacheKey) { - imageCache[cacheKey] = { - fn: OPS.paintImageXObject, - args: args - }; - } - }, - - handleSMask: function PartialEvaluator_handleSmask(smask, resources, - operatorList, task, - stateManager) { - var smaskContent = smask.get('G'); - var smaskOptions = { - subtype: smask.get('S').name, - backdrop: smask.get('BC') - }; - - // The SMask might have a alpha/luminosity value transfer function -- - // we will build a map of integer values in range 0..255 to be fast. - var transferObj = smask.get('TR'); - if (isPDFFunction(transferObj)) { - var transferFn = PDFFunction.parse(this.xref, transferObj); - var transferMap = new Uint8Array(256); - var tmp = new Float32Array(1); - for (var i = 0; i < 255; i++) { - tmp[0] = i / 255; - transferFn(tmp, 0, tmp, 0); - transferMap[i] = (tmp[0] * 255) | 0; - } - smaskOptions.transferMap = transferMap; - } - - return this.buildFormXObject(resources, smaskContent, smaskOptions, - operatorList, task, stateManager.state.clone()); - }, - - handleTilingType: - function PartialEvaluator_handleTilingType(fn, args, resources, - pattern, patternDict, - operatorList, task) { - // Create an IR of the pattern code. - var tilingOpList = new OperatorList(); - // Merge the available resources, to prevent issues when the patternDict - // is missing some /Resources entries (fixes issue6541.pdf). - var resourcesArray = [patternDict.get('Resources'), resources]; - var patternResources = Dict.merge(this.xref, resourcesArray); - - return this.getOperatorList(pattern, task, patternResources, - tilingOpList).then(function () { - // Add the dependencies to the parent operator list so they are - // resolved before sub operator list is executed synchronously. - operatorList.addDependencies(tilingOpList.dependencies); - operatorList.addOp(fn, getTilingPatternIR({ - fnArray: tilingOpList.fnArray, - argsArray: tilingOpList.argsArray - }, patternDict, args)); - }); - }, - - handleSetFont: - function PartialEvaluator_handleSetFont(resources, fontArgs, fontRef, - operatorList, task, state) { - // TODO(mack): Not needed? - var fontName; - if (fontArgs) { - fontArgs = fontArgs.slice(); - fontName = fontArgs[0].name; - } - - var self = this; - return this.loadFont(fontName, fontRef, this.xref, resources).then( - function (translated) { - if (!translated.font.isType3Font) { - return translated; - } - return translated.loadType3Data(self, resources, operatorList, task). - then(function () { - return translated; - }, function (reason) { - // Error in the font data -- sending unsupported feature notification. - self.handler.send('UnsupportedFeature', - {featureId: UNSUPPORTED_FEATURES.font}); - return new TranslatedFont('g_font_error', - new ErrorFont('Type3 font load error: ' + reason), translated.font); - }); - }).then(function (translated) { - state.font = translated.font; - translated.send(self.handler); - return translated.loadedName; - }); - }, - - handleText: function PartialEvaluator_handleText(chars, state) { - var font = state.font; - var glyphs = font.charsToGlyphs(chars); - var isAddToPathSet = !!(state.textRenderingMode & - TextRenderingMode.ADD_TO_PATH_FLAG); - if (font.data && (isAddToPathSet || PDFJS.disableFontFace)) { - var buildPath = function (fontChar) { - if (!font.renderer.hasBuiltPath(fontChar)) { - var path = font.renderer.getPathJs(fontChar); - this.handler.send('commonobj', [ - font.loadedName + '_path_' + fontChar, - 'FontPath', - path - ]); - } - }.bind(this); - - for (var i = 0, ii = glyphs.length; i < ii; i++) { - var glyph = glyphs[i]; - buildPath(glyph.fontChar); - - // If the glyph has an accent we need to build a path for its - // fontChar too, otherwise CanvasGraphics_paintChar will fail. - var accent = glyph.accent; - if (accent && accent.fontChar) { - buildPath(accent.fontChar); - } - } - } - - return glyphs; - }, - - setGState: function PartialEvaluator_setGState(resources, gState, - operatorList, task, - xref, stateManager) { - // This array holds the converted/processed state data. - var gStateObj = []; - var gStateMap = gState.map; - var self = this; - var promise = Promise.resolve(); - for (var key in gStateMap) { - var value = gStateMap[key]; - switch (key) { - case 'Type': - break; - case 'LW': - case 'LC': - case 'LJ': - case 'ML': - case 'D': - case 'RI': - case 'FL': - case 'CA': - case 'ca': - gStateObj.push([key, value]); - break; - case 'Font': - promise = promise.then(function () { - return self.handleSetFont(resources, null, value[0], operatorList, - task, stateManager.state). - then(function (loadedName) { - operatorList.addDependency(loadedName); - gStateObj.push([key, [loadedName, value[1]]]); - }); - }); - break; - case 'BM': - gStateObj.push([key, value]); - break; - case 'SMask': - if (isName(value) && value.name === 'None') { - gStateObj.push([key, false]); - break; - } - var dict = xref.fetchIfRef(value); - if (isDict(dict)) { - promise = promise.then(function () { - return self.handleSMask(dict, resources, operatorList, - task, stateManager); - }); - gStateObj.push([key, true]); - } else { - warn('Unsupported SMask type'); - } - - break; - // Only generate info log messages for the following since - // they are unlikely to have a big impact on the rendering. - case 'OP': - case 'op': - case 'OPM': - case 'BG': - case 'BG2': - case 'UCR': - case 'UCR2': - case 'TR': - case 'TR2': - case 'HT': - case 'SM': - case 'SA': - case 'AIS': - case 'TK': - // TODO implement these operators. - info('graphic state operator ' + key); - break; - default: - info('Unknown graphic state operator ' + key); - break; - } - } - return promise.then(function () { - if (gStateObj.length >= 0) { - operatorList.addOp(OPS.setGState, [gStateObj]); - } - }); - }, - - loadFont: function PartialEvaluator_loadFont(fontName, font, xref, - resources) { - - function errorFont() { - return Promise.resolve(new TranslatedFont('g_font_error', - new ErrorFont('Font ' + fontName + ' is not available'), font)); - } - var fontRef; - if (font) { // Loading by ref. - assert(isRef(font)); - fontRef = font; - } else { // Loading by name. - var fontRes = resources.get('Font'); - if (fontRes) { - fontRef = fontRes.getRaw(fontName); - } else { - warn('fontRes not available'); - return errorFont(); - } - } - if (!fontRef) { - warn('fontRef not available'); - return errorFont(); - } - - if (this.fontCache.has(fontRef)) { - return this.fontCache.get(fontRef); - } - - font = xref.fetchIfRef(fontRef); - if (!isDict(font)) { - return errorFont(); - } - - // We are holding font.translated references just for fontRef that are not - // dictionaries (Dict). See explanation below. - if (font.translated) { - return font.translated; - } - - var fontCapability = createPromiseCapability(); - - var preEvaluatedFont = this.preEvaluateFont(font, xref); - var descriptor = preEvaluatedFont.descriptor; - var fontID = fontRef.num + '_' + fontRef.gen; - if (isDict(descriptor)) { - if (!descriptor.fontAliases) { - descriptor.fontAliases = Object.create(null); - } - - var fontAliases = descriptor.fontAliases; - var hash = preEvaluatedFont.hash; - if (fontAliases[hash]) { - var aliasFontRef = fontAliases[hash].aliasRef; - if (aliasFontRef && this.fontCache.has(aliasFontRef)) { - this.fontCache.putAlias(fontRef, aliasFontRef); - return this.fontCache.get(fontRef); - } - } - - if (!fontAliases[hash]) { - fontAliases[hash] = { - fontID: Font.getFontID() - }; - } - - fontAliases[hash].aliasRef = fontRef; - fontID = fontAliases[hash].fontID; - } - - // Workaround for bad PDF generators that don't reference fonts - // properly, i.e. by not using an object identifier. - // Check if the fontRef is a Dict (as opposed to a standard object), - // in which case we don't cache the font and instead reference it by - // fontName in font.loadedName below. - var fontRefIsDict = isDict(fontRef); - if (!fontRefIsDict) { - this.fontCache.put(fontRef, fontCapability.promise); - } - - // Keep track of each font we translated so the caller can - // load them asynchronously before calling display on a page. - font.loadedName = 'g_' + this.pdfManager.docId + '_f' + (fontRefIsDict ? - fontName.replace(/\W/g, '') : fontID); - - font.translated = fontCapability.promise; - - // TODO move promises into translate font - var translatedPromise; - try { - translatedPromise = Promise.resolve( - this.translateFont(preEvaluatedFont, xref)); - } catch (e) { - translatedPromise = Promise.reject(e); - } - - var self = this; - translatedPromise.then(function (translatedFont) { - if (translatedFont.fontType !== undefined) { - var xrefFontStats = xref.stats.fontTypes; - xrefFontStats[translatedFont.fontType] = true; - } - - fontCapability.resolve(new TranslatedFont(font.loadedName, - translatedFont, font)); - }, function (reason) { - // TODO fontCapability.reject? - // Error in the font data -- sending unsupported feature notification. - self.handler.send('UnsupportedFeature', - {featureId: UNSUPPORTED_FEATURES.font}); - - try { - // error, but it's still nice to have font type reported - var descriptor = preEvaluatedFont.descriptor; - var fontFile3 = descriptor && descriptor.get('FontFile3'); - var subtype = fontFile3 && fontFile3.get('Subtype'); - var fontType = getFontType(preEvaluatedFont.type, - subtype && subtype.name); - var xrefFontStats = xref.stats.fontTypes; - xrefFontStats[fontType] = true; - } catch (ex) { } - - fontCapability.resolve(new TranslatedFont(font.loadedName, - new ErrorFont(reason instanceof Error ? reason.message : reason), - font)); - }); - return fontCapability.promise; - }, - - buildPath: function PartialEvaluator_buildPath(operatorList, fn, args) { - var lastIndex = operatorList.length - 1; - if (!args) { - args = []; - } - if (lastIndex < 0 || - operatorList.fnArray[lastIndex] !== OPS.constructPath) { - operatorList.addOp(OPS.constructPath, [[fn], args]); - } else { - var opArgs = operatorList.argsArray[lastIndex]; - opArgs[0].push(fn); - Array.prototype.push.apply(opArgs[1], args); - } - }, - - handleColorN: function PartialEvaluator_handleColorN(operatorList, fn, args, - cs, patterns, resources, task, xref) { - // compile tiling patterns - var patternName = args[args.length - 1]; - // SCN/scn applies patterns along with normal colors - var pattern; - if (isName(patternName) && - (pattern = patterns.get(patternName.name))) { - var dict = (isStream(pattern) ? pattern.dict : pattern); - var typeNum = dict.get('PatternType'); - - if (typeNum === TILING_PATTERN) { - var color = cs.base ? cs.base.getRgb(args, 0) : null; - return this.handleTilingType(fn, color, resources, pattern, - dict, operatorList, task); - } else if (typeNum === SHADING_PATTERN) { - var shading = dict.get('Shading'); - var matrix = dict.get('Matrix'); - pattern = Pattern.parseShading(shading, matrix, xref, resources, - this.handler); - operatorList.addOp(fn, pattern.getIR()); - return Promise.resolve(); - } else { - return Promise.reject('Unknown PatternType: ' + typeNum); - } - } - // TODO shall we fail here? - operatorList.addOp(fn, args); - return Promise.resolve(); - }, - - getOperatorList: function PartialEvaluator_getOperatorList(stream, - task, - resources, - operatorList, - initialState) { - - var self = this; - var xref = this.xref; - var imageCache = {}; - - assert(operatorList); - - resources = (resources || Dict.empty); - var xobjs = (resources.get('XObject') || Dict.empty); - var patterns = (resources.get('Pattern') || Dict.empty); - var stateManager = new StateManager(initialState || new EvalState()); - var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); - var timeSlotManager = new TimeSlotManager(); - - return new Promise(function next(resolve, reject) { - task.ensureNotTerminated(); - timeSlotManager.reset(); - var stop, operation = {}, i, ii, cs; - while (!(stop = timeSlotManager.check())) { - // The arguments parsed by read() are used beyond this loop, so we - // cannot reuse the same array on each iteration. Therefore we pass - // in |null| as the initial value (see the comment on - // EvaluatorPreprocessor_read() for why). - operation.args = null; - if (!(preprocessor.read(operation))) { - break; - } - var args = operation.args; - var fn = operation.fn; - - switch (fn | 0) { - case OPS.paintXObject: - if (args[0].code) { - break; - } - // eagerly compile XForm objects - var name = args[0].name; - if (!name) { - warn('XObject must be referred to by name.'); - continue; - } - if (imageCache[name] !== undefined) { - operatorList.addOp(imageCache[name].fn, imageCache[name].args); - args = null; - continue; - } - - var xobj = xobjs.get(name); - if (xobj) { - assert(isStream(xobj), 'XObject should be a stream'); - - var type = xobj.dict.get('Subtype'); - assert(isName(type), - 'XObject should have a Name subtype'); - - if (type.name === 'Form') { - stateManager.save(); - return self.buildFormXObject(resources, xobj, null, - operatorList, task, - stateManager.state.clone()). - then(function () { - stateManager.restore(); - next(resolve, reject); - }, reject); - } else if (type.name === 'Image') { - self.buildPaintImageXObject(resources, xobj, false, - operatorList, name, imageCache); - args = null; - continue; - } else if (type.name === 'PS') { - // PostScript XObjects are unused when viewing documents. - // See section 4.7.1 of Adobe's PDF reference. - info('Ignored XObject subtype PS'); - continue; - } else { - error('Unhandled XObject subtype ' + type.name); - } - } - break; - case OPS.setFont: - var fontSize = args[1]; - // eagerly collect all fonts - return self.handleSetFont(resources, args, null, operatorList, - task, stateManager.state). - then(function (loadedName) { - operatorList.addDependency(loadedName); - operatorList.addOp(OPS.setFont, [loadedName, fontSize]); - next(resolve, reject); - }, reject); - case OPS.endInlineImage: - var cacheKey = args[0].cacheKey; - if (cacheKey) { - var cacheEntry = imageCache[cacheKey]; - if (cacheEntry !== undefined) { - operatorList.addOp(cacheEntry.fn, cacheEntry.args); - args = null; - continue; - } - } - self.buildPaintImageXObject(resources, args[0], true, - operatorList, cacheKey, imageCache); - args = null; - continue; - case OPS.showText: - args[0] = self.handleText(args[0], stateManager.state); - break; - case OPS.showSpacedText: - var arr = args[0]; - var combinedGlyphs = []; - var arrLength = arr.length; - var state = stateManager.state; - for (i = 0; i < arrLength; ++i) { - var arrItem = arr[i]; - if (isString(arrItem)) { - Array.prototype.push.apply(combinedGlyphs, - self.handleText(arrItem, state)); - } else if (isNum(arrItem)) { - combinedGlyphs.push(arrItem); - } - } - args[0] = combinedGlyphs; - fn = OPS.showText; - break; - case OPS.nextLineShowText: - operatorList.addOp(OPS.nextLine); - args[0] = self.handleText(args[0], stateManager.state); - fn = OPS.showText; - break; - case OPS.nextLineSetSpacingShowText: - operatorList.addOp(OPS.nextLine); - operatorList.addOp(OPS.setWordSpacing, [args.shift()]); - operatorList.addOp(OPS.setCharSpacing, [args.shift()]); - args[0] = self.handleText(args[0], stateManager.state); - fn = OPS.showText; - break; - case OPS.setTextRenderingMode: - stateManager.state.textRenderingMode = args[0]; - break; - - case OPS.setFillColorSpace: - stateManager.state.fillColorSpace = - ColorSpace.parse(args[0], xref, resources); - continue; - case OPS.setStrokeColorSpace: - stateManager.state.strokeColorSpace = - ColorSpace.parse(args[0], xref, resources); - continue; - case OPS.setFillColor: - cs = stateManager.state.fillColorSpace; - args = cs.getRgb(args, 0); - fn = OPS.setFillRGBColor; - break; - case OPS.setStrokeColor: - cs = stateManager.state.strokeColorSpace; - args = cs.getRgb(args, 0); - fn = OPS.setStrokeRGBColor; - break; - case OPS.setFillGray: - stateManager.state.fillColorSpace = ColorSpace.singletons.gray; - args = ColorSpace.singletons.gray.getRgb(args, 0); - fn = OPS.setFillRGBColor; - break; - case OPS.setStrokeGray: - stateManager.state.strokeColorSpace = ColorSpace.singletons.gray; - args = ColorSpace.singletons.gray.getRgb(args, 0); - fn = OPS.setStrokeRGBColor; - break; - case OPS.setFillCMYKColor: - stateManager.state.fillColorSpace = ColorSpace.singletons.cmyk; - args = ColorSpace.singletons.cmyk.getRgb(args, 0); - fn = OPS.setFillRGBColor; - break; - case OPS.setStrokeCMYKColor: - stateManager.state.strokeColorSpace = ColorSpace.singletons.cmyk; - args = ColorSpace.singletons.cmyk.getRgb(args, 0); - fn = OPS.setStrokeRGBColor; - break; - case OPS.setFillRGBColor: - stateManager.state.fillColorSpace = ColorSpace.singletons.rgb; - args = ColorSpace.singletons.rgb.getRgb(args, 0); - break; - case OPS.setStrokeRGBColor: - stateManager.state.strokeColorSpace = ColorSpace.singletons.rgb; - args = ColorSpace.singletons.rgb.getRgb(args, 0); - break; - case OPS.setFillColorN: - cs = stateManager.state.fillColorSpace; - if (cs.name === 'Pattern') { - return self.handleColorN(operatorList, OPS.setFillColorN, - args, cs, patterns, resources, task, xref).then(function() { - next(resolve, reject); - }, reject); - } - args = cs.getRgb(args, 0); - fn = OPS.setFillRGBColor; - break; - case OPS.setStrokeColorN: - cs = stateManager.state.strokeColorSpace; - if (cs.name === 'Pattern') { - return self.handleColorN(operatorList, OPS.setStrokeColorN, - args, cs, patterns, resources, task, xref).then(function() { - next(resolve, reject); - }, reject); - } - args = cs.getRgb(args, 0); - fn = OPS.setStrokeRGBColor; - break; - - case OPS.shadingFill: - var shadingRes = resources.get('Shading'); - if (!shadingRes) { - error('No shading resource found'); - } - - var shading = shadingRes.get(args[0].name); - if (!shading) { - error('No shading object found'); - } - - var shadingFill = Pattern.parseShading(shading, null, xref, - resources, self.handler); - var patternIR = shadingFill.getIR(); - args = [patternIR]; - fn = OPS.shadingFill; - break; - case OPS.setGState: - var dictName = args[0]; - var extGState = resources.get('ExtGState'); - - if (!isDict(extGState) || !extGState.has(dictName.name)) { - break; - } - - var gState = extGState.get(dictName.name); - return self.setGState(resources, gState, operatorList, task, - xref, stateManager).then(function() { - next(resolve, reject); - }, reject); - case OPS.moveTo: - case OPS.lineTo: - case OPS.curveTo: - case OPS.curveTo2: - case OPS.curveTo3: - case OPS.closePath: - self.buildPath(operatorList, fn, args); - continue; - case OPS.rectangle: - self.buildPath(operatorList, fn, args); - continue; - case OPS.markPoint: - case OPS.markPointProps: - case OPS.beginMarkedContent: - case OPS.beginMarkedContentProps: - case OPS.endMarkedContent: - case OPS.beginCompat: - case OPS.endCompat: - // Ignore operators where the corresponding handlers are known to - // be no-op in CanvasGraphics (display/canvas.js). This prevents - // serialization errors and is also a bit more efficient. - // We could also try to serialize all objects in a general way, - // e.g. as done in https://github.com/mozilla/pdf.js/pull/6266, - // but doing so is meaningless without knowing the semantics. - continue; - default: - // Note: Let's hope that the ignored operator does not have any - // non-serializable arguments, otherwise postMessage will throw - // "An object could not be cloned.". - } - operatorList.addOp(fn, args); - } - if (stop) { - deferred.then(function () { - next(resolve, reject); - }, reject); - return; - } - // Some PDFs don't close all restores inside object/form. - // Closing those for them. - for (i = 0, ii = preprocessor.savedStatesDepth; i < ii; i++) { - operatorList.addOp(OPS.restore, []); - } - resolve(); - }); - }, - - getTextContent: - function PartialEvaluator_getTextContent(stream, task, resources, - stateManager, - normalizeWhitespace) { - - stateManager = (stateManager || new StateManager(new TextState())); - - var WhitespaceRegexp = /\s/g; - - var textContent = { - items: [], - styles: Object.create(null) - }; - var textContentItem = { - initialized: false, - str: [], - width: 0, - height: 0, - vertical: false, - lastAdvanceWidth: 0, - lastAdvanceHeight: 0, - textAdvanceScale: 0, - spaceWidth: 0, - fakeSpaceMin: Infinity, - fakeMultiSpaceMin: Infinity, - fakeMultiSpaceMax: -0, - textRunBreakAllowed: false, - transform: null, - fontName: null - }; - var SPACE_FACTOR = 0.3; - var MULTI_SPACE_FACTOR = 1.5; - var MULTI_SPACE_FACTOR_MAX = 4; - - var self = this; - var xref = this.xref; - - resources = (xref.fetchIfRef(resources) || Dict.empty); - - // The xobj is parsed iff it's needed, e.g. if there is a `DO` cmd. - var xobjs = null; - var xobjsCache = {}; - - var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); - - var textState; - - function ensureTextContentItem() { - if (textContentItem.initialized) { - return textContentItem; - } - var font = textState.font; - if (!(font.loadedName in textContent.styles)) { - textContent.styles[font.loadedName] = { - fontFamily: font.fallbackName, - ascent: font.ascent, - descent: font.descent, - vertical: font.vertical - }; - } - textContentItem.fontName = font.loadedName; - - // 9.4.4 Text Space Details - var tsm = [textState.fontSize * textState.textHScale, 0, - 0, textState.fontSize, - 0, textState.textRise]; - - if (font.isType3Font && - textState.fontMatrix !== FONT_IDENTITY_MATRIX && - textState.fontSize === 1) { - var glyphHeight = font.bbox[3] - font.bbox[1]; - if (glyphHeight > 0) { - glyphHeight = glyphHeight * textState.fontMatrix[3]; - tsm[3] *= glyphHeight; - } - } - - var trm = Util.transform(textState.ctm, - Util.transform(textState.textMatrix, tsm)); - textContentItem.transform = trm; - if (!font.vertical) { - textContentItem.width = 0; - textContentItem.height = Math.sqrt(trm[2] * trm[2] + trm[3] * trm[3]); - textContentItem.vertical = false; - } else { - textContentItem.width = Math.sqrt(trm[0] * trm[0] + trm[1] * trm[1]); - textContentItem.height = 0; - textContentItem.vertical = true; - } - - var a = textState.textLineMatrix[0]; - var b = textState.textLineMatrix[1]; - var scaleLineX = Math.sqrt(a * a + b * b); - a = textState.ctm[0]; - b = textState.ctm[1]; - var scaleCtmX = Math.sqrt(a * a + b * b); - textContentItem.textAdvanceScale = scaleCtmX * scaleLineX; - textContentItem.lastAdvanceWidth = 0; - textContentItem.lastAdvanceHeight = 0; - - var spaceWidth = font.spaceWidth / 1000 * textState.fontSize; - if (spaceWidth) { - textContentItem.spaceWidth = spaceWidth; - textContentItem.fakeSpaceMin = spaceWidth * SPACE_FACTOR; - textContentItem.fakeMultiSpaceMin = spaceWidth * MULTI_SPACE_FACTOR; - textContentItem.fakeMultiSpaceMax = - spaceWidth * MULTI_SPACE_FACTOR_MAX; - // It's okay for monospace fonts to fake as much space as needed. - textContentItem.textRunBreakAllowed = !font.isMonospace; - } else { - textContentItem.spaceWidth = 0; - textContentItem.fakeSpaceMin = Infinity; - textContentItem.fakeMultiSpaceMin = Infinity; - textContentItem.fakeMultiSpaceMax = 0; - textContentItem.textRunBreakAllowed = false; - } - - - textContentItem.initialized = true; - return textContentItem; - } - - function replaceWhitespace(str) { - // Replaces all whitespaces with standard spaces (0x20), to avoid - // alignment issues between the textLayer and the canvas if the text - // contains e.g. tabs (fixes issue6612.pdf). - var i = 0, ii = str.length, code; - while (i < ii && (code = str.charCodeAt(i)) >= 0x20 && code <= 0x7F) { - i++; - } - return (i < ii ? str.replace(WhitespaceRegexp, ' ') : str); - } - - function runBidiTransform(textChunk) { - var str = textChunk.str.join(''); - var bidiResult = PDFJS.bidi(str, -1, textChunk.vertical); - return { - str: (normalizeWhitespace ? replaceWhitespace(bidiResult.str) : - bidiResult.str), - dir: bidiResult.dir, - width: textChunk.width, - height: textChunk.height, - transform: textChunk.transform, - fontName: textChunk.fontName - }; - } - - function handleSetFont(fontName, fontRef) { - return self.loadFont(fontName, fontRef, xref, resources). - then(function (translated) { - textState.font = translated.font; - textState.fontMatrix = translated.font.fontMatrix || - FONT_IDENTITY_MATRIX; - }); - } - - function buildTextContentItem(chars) { - var font = textState.font; - var textChunk = ensureTextContentItem(); - var width = 0; - var height = 0; - var glyphs = font.charsToGlyphs(chars); - var defaultVMetrics = font.defaultVMetrics; - for (var i = 0; i < glyphs.length; i++) { - var glyph = glyphs[i]; - var vMetricX = null; - var vMetricY = null; - var glyphWidth = null; - if (font.vertical) { - if (glyph.vmetric) { - glyphWidth = glyph.vmetric[0]; - vMetricX = glyph.vmetric[1]; - vMetricY = glyph.vmetric[2]; - } else { - glyphWidth = glyph.width; - vMetricX = glyph.width * 0.5; - vMetricY = defaultVMetrics[2]; - } - } else { - glyphWidth = glyph.width; - } - - var glyphUnicode = glyph.unicode; - if (NormalizedUnicodes[glyphUnicode] !== undefined) { - glyphUnicode = NormalizedUnicodes[glyphUnicode]; - } - glyphUnicode = reverseIfRtl(glyphUnicode); - - // The following will calculate the x and y of the individual glyphs. - // if (font.vertical) { - // tsm[4] -= vMetricX * Math.abs(textState.fontSize) * - // textState.fontMatrix[0]; - // tsm[5] -= vMetricY * textState.fontSize * - // textState.fontMatrix[0]; - // } - // var trm = Util.transform(textState.textMatrix, tsm); - // var pt = Util.applyTransform([trm[4], trm[5]], textState.ctm); - // var x = pt[0]; - // var y = pt[1]; - - var charSpacing = textState.charSpacing; - if (glyph.isSpace) { - var wordSpacing = textState.wordSpacing; - charSpacing += wordSpacing; - if (wordSpacing > 0) { - addFakeSpaces(wordSpacing, textChunk.str); - } - } - - var tx = 0; - var ty = 0; - if (!font.vertical) { - var w0 = glyphWidth * textState.fontMatrix[0]; - tx = (w0 * textState.fontSize + charSpacing) * - textState.textHScale; - width += tx; - } else { - var w1 = glyphWidth * textState.fontMatrix[0]; - ty = w1 * textState.fontSize + charSpacing; - height += ty; - } - textState.translateTextMatrix(tx, ty); - - textChunk.str.push(glyphUnicode); - } - - if (!font.vertical) { - textChunk.lastAdvanceWidth = width; - textChunk.width += width * textChunk.textAdvanceScale; - } else { - textChunk.lastAdvanceHeight = height; - textChunk.height += Math.abs(height * textChunk.textAdvanceScale); - } - - return textChunk; - } - - function addFakeSpaces(width, strBuf) { - if (width < textContentItem.fakeSpaceMin) { - return; - } - if (width < textContentItem.fakeMultiSpaceMin) { - strBuf.push(' '); - return; - } - var fakeSpaces = Math.round(width / textContentItem.spaceWidth); - while (fakeSpaces-- > 0) { - strBuf.push(' '); - } - } - - function flushTextContentItem() { - if (!textContentItem.initialized) { - return; - } - textContent.items.push(runBidiTransform(textContentItem)); - - textContentItem.initialized = false; - textContentItem.str.length = 0; - } - - var timeSlotManager = new TimeSlotManager(); - - return new Promise(function next(resolve, reject) { - task.ensureNotTerminated(); - timeSlotManager.reset(); - var stop, operation = {}, args = []; - while (!(stop = timeSlotManager.check())) { - // The arguments parsed by read() are not used beyond this loop, so - // we can reuse the same array on every iteration, thus avoiding - // unnecessary allocations. - args.length = 0; - operation.args = args; - if (!(preprocessor.read(operation))) { - break; - } - textState = stateManager.state; - var fn = operation.fn; - args = operation.args; - var advance; - - switch (fn | 0) { - case OPS.setFont: - flushTextContentItem(); - textState.fontSize = args[1]; - return handleSetFont(args[0].name).then(function() { - next(resolve, reject); - }, reject); - case OPS.setTextRise: - flushTextContentItem(); - textState.textRise = args[0]; - break; - case OPS.setHScale: - flushTextContentItem(); - textState.textHScale = args[0] / 100; - break; - case OPS.setLeading: - flushTextContentItem(); - textState.leading = args[0]; - break; - case OPS.moveText: - // Optimization to treat same line movement as advance - var isSameTextLine = !textState.font ? false : - ((textState.font.vertical ? args[0] : args[1]) === 0); - advance = args[0] - args[1]; - if (isSameTextLine && textContentItem.initialized && - advance > 0 && - advance <= textContentItem.fakeMultiSpaceMax) { - textState.translateTextLineMatrix(args[0], args[1]); - textContentItem.width += - (args[0] - textContentItem.lastAdvanceWidth); - textContentItem.height += - (args[1] - textContentItem.lastAdvanceHeight); - var diff = (args[0] - textContentItem.lastAdvanceWidth) - - (args[1] - textContentItem.lastAdvanceHeight); - addFakeSpaces(diff, textContentItem.str); - break; - } - - flushTextContentItem(); - textState.translateTextLineMatrix(args[0], args[1]); - textState.textMatrix = textState.textLineMatrix.slice(); - break; - case OPS.setLeadingMoveText: - flushTextContentItem(); - textState.leading = -args[1]; - textState.translateTextLineMatrix(args[0], args[1]); - textState.textMatrix = textState.textLineMatrix.slice(); - break; - case OPS.nextLine: - flushTextContentItem(); - textState.carriageReturn(); - break; - case OPS.setTextMatrix: - flushTextContentItem(); - textState.setTextMatrix(args[0], args[1], args[2], args[3], - args[4], args[5]); - textState.setTextLineMatrix(args[0], args[1], args[2], args[3], - args[4], args[5]); - break; - case OPS.setCharSpacing: - textState.charSpacing = args[0]; - break; - case OPS.setWordSpacing: - textState.wordSpacing = args[0]; - break; - case OPS.beginText: - flushTextContentItem(); - textState.textMatrix = IDENTITY_MATRIX.slice(); - textState.textLineMatrix = IDENTITY_MATRIX.slice(); - break; - case OPS.showSpacedText: - var items = args[0]; - var offset; - for (var j = 0, jj = items.length; j < jj; j++) { - if (typeof items[j] === 'string') { - buildTextContentItem(items[j]); - } else { - ensureTextContentItem(); - - // PDF Specification 5.3.2 states: - // The number is expressed in thousandths of a unit of text - // space. - // This amount is subtracted from the current horizontal or - // vertical coordinate, depending on the writing mode. - // In the default coordinate system, a positive adjustment - // has the effect of moving the next glyph painted either to - // the left or down by the given amount. - advance = items[j] * textState.fontSize / 1000; - var breakTextRun = false; - if (textState.font.vertical) { - offset = advance * - (textState.textHScale * textState.textMatrix[2] + - textState.textMatrix[3]); - textState.translateTextMatrix(0, advance); - breakTextRun = textContentItem.textRunBreakAllowed && - advance > textContentItem.fakeMultiSpaceMax; - if (!breakTextRun) { - // Value needs to be added to height to paint down. - textContentItem.height += offset; - } - } else { - advance = -advance; - offset = advance * ( - textState.textHScale * textState.textMatrix[0] + - textState.textMatrix[1]); - textState.translateTextMatrix(advance, 0); - breakTextRun = textContentItem.textRunBreakAllowed && - advance > textContentItem.fakeMultiSpaceMax; - if (!breakTextRun) { - // Value needs to be subtracted from width to paint left. - textContentItem.width += offset; - } - } - if (breakTextRun) { - flushTextContentItem(); - } else if (advance > 0) { - addFakeSpaces(advance, textContentItem.str); - } - } - } - break; - case OPS.showText: - buildTextContentItem(args[0]); - break; - case OPS.nextLineShowText: - flushTextContentItem(); - textState.carriageReturn(); - buildTextContentItem(args[0]); - break; - case OPS.nextLineSetSpacingShowText: - flushTextContentItem(); - textState.wordSpacing = args[0]; - textState.charSpacing = args[1]; - textState.carriageReturn(); - buildTextContentItem(args[2]); - break; - case OPS.paintXObject: - flushTextContentItem(); - if (args[0].code) { - break; - } - - if (!xobjs) { - xobjs = (resources.get('XObject') || Dict.empty); - } - - var name = args[0].name; - if (xobjsCache.key === name) { - if (xobjsCache.texts) { - Util.appendToArray(textContent.items, xobjsCache.texts.items); - Util.extendObj(textContent.styles, xobjsCache.texts.styles); - } - break; - } - - var xobj = xobjs.get(name); - if (!xobj) { - break; - } - assert(isStream(xobj), 'XObject should be a stream'); - - var type = xobj.dict.get('Subtype'); - assert(isName(type), - 'XObject should have a Name subtype'); - - if ('Form' !== type.name) { - xobjsCache.key = name; - xobjsCache.texts = null; - break; - } - - stateManager.save(); - var matrix = xobj.dict.get('Matrix'); - if (isArray(matrix) && matrix.length === 6) { - stateManager.transform(matrix); - } - - return self.getTextContent(xobj, task, - xobj.dict.get('Resources') || resources, stateManager, - normalizeWhitespace).then(function (formTextContent) { - Util.appendToArray(textContent.items, formTextContent.items); - Util.extendObj(textContent.styles, formTextContent.styles); - stateManager.restore(); - - xobjsCache.key = name; - xobjsCache.texts = formTextContent; - - next(resolve, reject); - }, reject); - case OPS.setGState: - flushTextContentItem(); - var dictName = args[0]; - var extGState = resources.get('ExtGState'); - - if (!isDict(extGState) || !extGState.has(dictName.name)) { - break; - } - - var gsStateMap = extGState.get(dictName.name); - var gsStateFont = null; - for (var key in gsStateMap) { - if (key === 'Font') { - assert(!gsStateFont); - gsStateFont = gsStateMap[key]; - } - } - if (gsStateFont) { - textState.fontSize = gsStateFont[1]; - return handleSetFont(gsStateFont[0]).then(function() { - next(resolve, reject); - }, reject); - } - break; - } // switch - } // while - if (stop) { - deferred.then(function () { - next(resolve, reject); - }, reject); - return; - } - flushTextContentItem(); - resolve(textContent); - }); - }, - - extractDataStructures: function - partialEvaluatorExtractDataStructures(dict, baseDict, - xref, properties) { - // 9.10.2 - var toUnicode = (dict.get('ToUnicode') || baseDict.get('ToUnicode')); - if (toUnicode) { - properties.toUnicode = this.readToUnicode(toUnicode); - } - if (properties.composite) { - // CIDSystemInfo helps to match CID to glyphs - var cidSystemInfo = dict.get('CIDSystemInfo'); - if (isDict(cidSystemInfo)) { - properties.cidSystemInfo = { - registry: cidSystemInfo.get('Registry'), - ordering: cidSystemInfo.get('Ordering'), - supplement: cidSystemInfo.get('Supplement') - }; - } - - var cidToGidMap = dict.get('CIDToGIDMap'); - if (isStream(cidToGidMap)) { - properties.cidToGidMap = this.readCidToGidMap(cidToGidMap); - } - } - - // Based on 9.6.6 of the spec the encoding can come from multiple places - // and depends on the font type. The base encoding and differences are - // read here, but the encoding that is actually used is chosen during - // glyph mapping in the font. - // TODO: Loading the built in encoding in the font would allow the - // differences to be merged in here not require us to hold on to it. - var differences = []; - var baseEncodingName = null; - var encoding; - if (dict.has('Encoding')) { - encoding = dict.get('Encoding'); - if (isDict(encoding)) { - baseEncodingName = encoding.get('BaseEncoding'); - baseEncodingName = (isName(baseEncodingName) ? - baseEncodingName.name : null); - // Load the differences between the base and original - if (encoding.has('Differences')) { - var diffEncoding = encoding.get('Differences'); - var index = 0; - for (var j = 0, jj = diffEncoding.length; j < jj; j++) { - var data = diffEncoding[j]; - if (isNum(data)) { - index = data; - } else if (isName(data)) { - differences[index++] = data.name; - } else if (isRef(data)) { - diffEncoding[j--] = xref.fetch(data); - continue; - } else { - error('Invalid entry in \'Differences\' array: ' + data); - } - } - } - } else if (isName(encoding)) { - baseEncodingName = encoding.name; - } else { - error('Encoding is not a Name nor a Dict'); - } - // According to table 114 if the encoding is a named encoding it must be - // one of these predefined encodings. - if ((baseEncodingName !== 'MacRomanEncoding' && - baseEncodingName !== 'MacExpertEncoding' && - baseEncodingName !== 'WinAnsiEncoding')) { - baseEncodingName = null; - } - } - - if (baseEncodingName) { - properties.defaultEncoding = Encodings[baseEncodingName].slice(); - } else { - encoding = (properties.type === 'TrueType' ? - Encodings.WinAnsiEncoding : Encodings.StandardEncoding); - // The Symbolic attribute can be misused for regular fonts - // Heuristic: we have to check if the font is a standard one also - if (!!(properties.flags & FontFlags.Symbolic)) { - encoding = Encodings.MacRomanEncoding; - if (!properties.file) { - if (/Symbol/i.test(properties.name)) { - encoding = Encodings.SymbolSetEncoding; - } else if (/Dingbats/i.test(properties.name)) { - encoding = Encodings.ZapfDingbatsEncoding; - } - } - } - properties.defaultEncoding = encoding; - } - - properties.differences = differences; - properties.baseEncodingName = baseEncodingName; - properties.dict = dict; - }, - - readToUnicode: function PartialEvaluator_readToUnicode(toUnicode) { - var cmap, cmapObj = toUnicode; - if (isName(cmapObj)) { - cmap = CMapFactory.create(cmapObj, - { url: PDFJS.cMapUrl, packed: PDFJS.cMapPacked }, null); - if (cmap instanceof IdentityCMap) { - return new IdentityToUnicodeMap(0, 0xFFFF); - } - return new ToUnicodeMap(cmap.getMap()); - } else if (isStream(cmapObj)) { - cmap = CMapFactory.create(cmapObj, - { url: PDFJS.cMapUrl, packed: PDFJS.cMapPacked }, null); - if (cmap instanceof IdentityCMap) { - return new IdentityToUnicodeMap(0, 0xFFFF); - } - var map = new Array(cmap.length); - // Convert UTF-16BE - // NOTE: cmap can be a sparse array, so use forEach instead of for(;;) - // to iterate over all keys. - cmap.forEach(function(charCode, token) { - var str = []; - for (var k = 0; k < token.length; k += 2) { - var w1 = (token.charCodeAt(k) << 8) | token.charCodeAt(k + 1); - if ((w1 & 0xF800) !== 0xD800) { // w1 < 0xD800 || w1 > 0xDFFF - str.push(w1); - continue; - } - k += 2; - var w2 = (token.charCodeAt(k) << 8) | token.charCodeAt(k + 1); - str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000); - } - map[charCode] = String.fromCharCode.apply(String, str); - }); - return new ToUnicodeMap(map); - } - return null; - }, - - readCidToGidMap: function PartialEvaluator_readCidToGidMap(cidToGidStream) { - // Extract the encoding from the CIDToGIDMap - var glyphsData = cidToGidStream.getBytes(); - - // Set encoding 0 to later verify the font has an encoding - var result = []; - for (var j = 0, jj = glyphsData.length; j < jj; j++) { - var glyphID = (glyphsData[j++] << 8) | glyphsData[j]; - if (glyphID === 0) { - continue; - } - var code = j >> 1; - result[code] = glyphID; - } - return result; - }, - - extractWidths: function PartialEvaluator_extractWidths(dict, xref, - descriptor, - properties) { - var glyphsWidths = []; - var defaultWidth = 0; - var glyphsVMetrics = []; - var defaultVMetrics; - var i, ii, j, jj, start, code, widths; - if (properties.composite) { - defaultWidth = dict.get('DW') || 1000; - - widths = dict.get('W'); - if (widths) { - for (i = 0, ii = widths.length; i < ii; i++) { - start = widths[i++]; - code = xref.fetchIfRef(widths[i]); - if (isArray(code)) { - for (j = 0, jj = code.length; j < jj; j++) { - glyphsWidths[start++] = code[j]; - } - } else { - var width = widths[++i]; - for (j = start; j <= code; j++) { - glyphsWidths[j] = width; - } - } - } - } - - if (properties.vertical) { - var vmetrics = (dict.get('DW2') || [880, -1000]); - defaultVMetrics = [vmetrics[1], defaultWidth * 0.5, vmetrics[0]]; - vmetrics = dict.get('W2'); - if (vmetrics) { - for (i = 0, ii = vmetrics.length; i < ii; i++) { - start = vmetrics[i++]; - code = xref.fetchIfRef(vmetrics[i]); - if (isArray(code)) { - for (j = 0, jj = code.length; j < jj; j++) { - glyphsVMetrics[start++] = [code[j++], code[j++], code[j]]; - } - } else { - var vmetric = [vmetrics[++i], vmetrics[++i], vmetrics[++i]]; - for (j = start; j <= code; j++) { - glyphsVMetrics[j] = vmetric; - } - } - } - } - } - } else { - var firstChar = properties.firstChar; - widths = dict.get('Widths'); - if (widths) { - j = firstChar; - for (i = 0, ii = widths.length; i < ii; i++) { - glyphsWidths[j++] = widths[i]; - } - defaultWidth = (parseFloat(descriptor.get('MissingWidth')) || 0); - } else { - // Trying get the BaseFont metrics (see comment above). - var baseFontName = dict.get('BaseFont'); - if (isName(baseFontName)) { - var metrics = this.getBaseFontMetrics(baseFontName.name); - - glyphsWidths = this.buildCharCodeToWidth(metrics.widths, - properties); - defaultWidth = metrics.defaultWidth; - } - } - } - - // Heuristic: detection of monospace font by checking all non-zero widths - var isMonospace = true; - var firstWidth = defaultWidth; - for (var glyph in glyphsWidths) { - var glyphWidth = glyphsWidths[glyph]; - if (!glyphWidth) { - continue; - } - if (!firstWidth) { - firstWidth = glyphWidth; - continue; - } - if (firstWidth !== glyphWidth) { - isMonospace = false; - break; - } - } - if (isMonospace) { - properties.flags |= FontFlags.FixedPitch; - } - - properties.defaultWidth = defaultWidth; - properties.widths = glyphsWidths; - properties.defaultVMetrics = defaultVMetrics; - properties.vmetrics = glyphsVMetrics; - }, - - isSerifFont: function PartialEvaluator_isSerifFont(baseFontName) { - // Simulating descriptor flags attribute - var fontNameWoStyle = baseFontName.split('-')[0]; - return (fontNameWoStyle in serifFonts) || - (fontNameWoStyle.search(/serif/gi) !== -1); - }, - - getBaseFontMetrics: function PartialEvaluator_getBaseFontMetrics(name) { - var defaultWidth = 0; - var widths = []; - var monospace = false; - var lookupName = (stdFontMap[name] || name); - - if (!(lookupName in Metrics)) { - // Use default fonts for looking up font metrics if the passed - // font is not a base font - if (this.isSerifFont(name)) { - lookupName = 'Times-Roman'; - } else { - lookupName = 'Helvetica'; - } - } - var glyphWidths = Metrics[lookupName]; - - if (isNum(glyphWidths)) { - defaultWidth = glyphWidths; - monospace = true; - } else { - widths = glyphWidths; - } - - return { - defaultWidth: defaultWidth, - monospace: monospace, - widths: widths - }; - }, - - buildCharCodeToWidth: - function PartialEvaluator_bulildCharCodeToWidth(widthsByGlyphName, - properties) { - var widths = Object.create(null); - var differences = properties.differences; - var encoding = properties.defaultEncoding; - for (var charCode = 0; charCode < 256; charCode++) { - if (charCode in differences && - widthsByGlyphName[differences[charCode]]) { - widths[charCode] = widthsByGlyphName[differences[charCode]]; - continue; - } - if (charCode in encoding && widthsByGlyphName[encoding[charCode]]) { - widths[charCode] = widthsByGlyphName[encoding[charCode]]; - continue; - } - } - return widths; - }, - - preEvaluateFont: function PartialEvaluator_preEvaluateFont(dict, xref) { - var baseDict = dict; - var type = dict.get('Subtype'); - assert(isName(type), 'invalid font Subtype'); - - var composite = false; - var uint8array; - if (type.name === 'Type0') { - // If font is a composite - // - get the descendant font - // - set the type according to the descendant font - // - get the FontDescriptor from the descendant font - var df = dict.get('DescendantFonts'); - if (!df) { - error('Descendant fonts are not specified'); - } - dict = (isArray(df) ? xref.fetchIfRef(df[0]) : df); - - type = dict.get('Subtype'); - assert(isName(type), 'invalid font Subtype'); - composite = true; - } - - var descriptor = dict.get('FontDescriptor'); - if (descriptor) { - var hash = new MurmurHash3_64(); - var encoding = baseDict.getRaw('Encoding'); - if (isName(encoding)) { - hash.update(encoding.name); - } else if (isRef(encoding)) { - hash.update(encoding.num + '_' + encoding.gen); - } else if (isDict(encoding)) { - var keys = encoding.getKeys(); - for (var i = 0, ii = keys.length; i < ii; i++) { - var entry = encoding.getRaw(keys[i]); - if (isName(entry)) { - hash.update(entry.name); - } else if (isRef(entry)) { - hash.update(entry.num + '_' + entry.gen); - } else if (isArray(entry)) { // 'Differences' entry. - // Ideally we should check the contents of the array, but to avoid - // parsing it here and then again in |extractDataStructures|, - // we only use the array length for now (fixes bug1157493.pdf). - hash.update(entry.length.toString()); - } - } - } - - var toUnicode = dict.get('ToUnicode') || baseDict.get('ToUnicode'); - if (isStream(toUnicode)) { - var stream = toUnicode.str || toUnicode; - uint8array = stream.buffer ? - new Uint8Array(stream.buffer.buffer, 0, stream.bufferLength) : - new Uint8Array(stream.bytes.buffer, - stream.start, stream.end - stream.start); - hash.update(uint8array); - - } else if (isName(toUnicode)) { - hash.update(toUnicode.name); - } - - var widths = dict.get('Widths') || baseDict.get('Widths'); - if (widths) { - uint8array = new Uint8Array(new Uint32Array(widths).buffer); - hash.update(uint8array); - } - } - - return { - descriptor: descriptor, - dict: dict, - baseDict: baseDict, - composite: composite, - type: type.name, - hash: hash ? hash.hexdigest() : '' - }; - }, - - translateFont: function PartialEvaluator_translateFont(preEvaluatedFont, - xref) { - var baseDict = preEvaluatedFont.baseDict; - var dict = preEvaluatedFont.dict; - var composite = preEvaluatedFont.composite; - var descriptor = preEvaluatedFont.descriptor; - var type = preEvaluatedFont.type; - var maxCharIndex = (composite ? 0xFFFF : 0xFF); - var properties; - - if (!descriptor) { - if (type === 'Type3') { - // FontDescriptor is only required for Type3 fonts when the document - // is a tagged pdf. Create a barbebones one to get by. - descriptor = new Dict(null); - descriptor.set('FontName', Name.get(type)); - descriptor.set('FontBBox', dict.get('FontBBox')); - } else { - // Before PDF 1.5 if the font was one of the base 14 fonts, having a - // FontDescriptor was not required. - // This case is here for compatibility. - var baseFontName = dict.get('BaseFont'); - if (!isName(baseFontName)) { - error('Base font is not specified'); - } - - // Using base font name as a font name. - baseFontName = baseFontName.name.replace(/[,_]/g, '-'); - var metrics = this.getBaseFontMetrics(baseFontName); - - // Simulating descriptor flags attribute - var fontNameWoStyle = baseFontName.split('-')[0]; - var flags = - (this.isSerifFont(fontNameWoStyle) ? FontFlags.Serif : 0) | - (metrics.monospace ? FontFlags.FixedPitch : 0) | - (symbolsFonts[fontNameWoStyle] ? FontFlags.Symbolic : - FontFlags.Nonsymbolic); - - properties = { - type: type, - name: baseFontName, - widths: metrics.widths, - defaultWidth: metrics.defaultWidth, - flags: flags, - firstChar: 0, - lastChar: maxCharIndex - }; - this.extractDataStructures(dict, dict, xref, properties); - properties.widths = this.buildCharCodeToWidth(metrics.widths, - properties); - return new Font(baseFontName, null, properties); - } - } - - // According to the spec if 'FontDescriptor' is declared, 'FirstChar', - // 'LastChar' and 'Widths' should exist too, but some PDF encoders seem - // to ignore this rule when a variant of a standart font is used. - // TODO Fill the width array depending on which of the base font this is - // a variant. - var firstChar = (dict.get('FirstChar') || 0); - var lastChar = (dict.get('LastChar') || maxCharIndex); - - var fontName = descriptor.get('FontName'); - var baseFont = dict.get('BaseFont'); - // Some bad PDFs have a string as the font name. - if (isString(fontName)) { - fontName = Name.get(fontName); - } - if (isString(baseFont)) { - baseFont = Name.get(baseFont); - } - - if (type !== 'Type3') { - var fontNameStr = fontName && fontName.name; - var baseFontStr = baseFont && baseFont.name; - if (fontNameStr !== baseFontStr) { - info('The FontDescriptor\'s FontName is "' + fontNameStr + - '" but should be the same as the Font\'s BaseFont "' + - baseFontStr + '"'); - // Workaround for cases where e.g. fontNameStr = 'Arial' and - // baseFontStr = 'Arial,Bold' (needed when no font file is embedded). - if (fontNameStr && baseFontStr && - baseFontStr.indexOf(fontNameStr) === 0) { - fontName = baseFont; - } - } - } - fontName = (fontName || baseFont); - - assert(isName(fontName), 'invalid font name'); - - var fontFile = descriptor.get('FontFile', 'FontFile2', 'FontFile3'); - if (fontFile) { - if (fontFile.dict) { - var subtype = fontFile.dict.get('Subtype'); - if (subtype) { - subtype = subtype.name; - } - var length1 = fontFile.dict.get('Length1'); - var length2 = fontFile.dict.get('Length2'); - } - } - - properties = { - type: type, - name: fontName.name, - subtype: subtype, - file: fontFile, - length1: length1, - length2: length2, - loadedName: baseDict.loadedName, - composite: composite, - wideChars: composite, - fixedPitch: false, - fontMatrix: (dict.get('FontMatrix') || FONT_IDENTITY_MATRIX), - firstChar: firstChar || 0, - lastChar: (lastChar || maxCharIndex), - bbox: descriptor.get('FontBBox'), - ascent: descriptor.get('Ascent'), - descent: descriptor.get('Descent'), - xHeight: descriptor.get('XHeight'), - capHeight: descriptor.get('CapHeight'), - flags: descriptor.get('Flags'), - italicAngle: descriptor.get('ItalicAngle'), - coded: false - }; - - if (composite) { - var cidEncoding = baseDict.get('Encoding'); - if (isName(cidEncoding)) { - properties.cidEncoding = cidEncoding.name; - } - properties.cMap = CMapFactory.create(cidEncoding, - { url: PDFJS.cMapUrl, packed: PDFJS.cMapPacked }, null); - properties.vertical = properties.cMap.vertical; - } - this.extractDataStructures(dict, baseDict, xref, properties); - this.extractWidths(dict, xref, descriptor, properties); - - if (type === 'Type3') { - properties.isType3Font = true; - } - - return new Font(fontName.name, fontFile, properties); - } - }; - - return PartialEvaluator; -})(); - -var TranslatedFont = (function TranslatedFontClosure() { - function TranslatedFont(loadedName, font, dict) { - this.loadedName = loadedName; - this.font = font; - this.dict = dict; - this.type3Loaded = null; - this.sent = false; - } - TranslatedFont.prototype = { - send: function (handler) { - if (this.sent) { - return; - } - var fontData = this.font.exportData(); - handler.send('commonobj', [ - this.loadedName, - 'Font', - fontData - ]); - this.sent = true; - }, - loadType3Data: function (evaluator, resources, parentOperatorList, task) { - assert(this.font.isType3Font); - - if (this.type3Loaded) { - return this.type3Loaded; - } - - var translatedFont = this.font; - var loadCharProcsPromise = Promise.resolve(); - var charProcs = this.dict.get('CharProcs').getAll(); - var fontResources = this.dict.get('Resources') || resources; - var charProcKeys = Object.keys(charProcs); - var charProcOperatorList = {}; - for (var i = 0, n = charProcKeys.length; i < n; ++i) { - loadCharProcsPromise = loadCharProcsPromise.then(function (key) { - var glyphStream = charProcs[key]; - var operatorList = new OperatorList(); - return evaluator.getOperatorList(glyphStream, task, fontResources, - operatorList).then(function () { - charProcOperatorList[key] = operatorList.getIR(); - - // Add the dependencies to the parent operator list so they are - // resolved before sub operator list is executed synchronously. - parentOperatorList.addDependencies(operatorList.dependencies); - }, function (reason) { - warn('Type3 font resource \"' + key + '\" is not available'); - var operatorList = new OperatorList(); - charProcOperatorList[key] = operatorList.getIR(); - }); - }.bind(this, charProcKeys[i])); - } - this.type3Loaded = loadCharProcsPromise.then(function () { - translatedFont.charProcOperatorList = charProcOperatorList; - }); - return this.type3Loaded; - } - }; - return TranslatedFont; -})(); - -var OperatorList = (function OperatorListClosure() { - var CHUNK_SIZE = 1000; - var CHUNK_SIZE_ABOUT = CHUNK_SIZE - 5; // close to chunk size - - function getTransfers(queue) { - var transfers = []; - var fnArray = queue.fnArray, argsArray = queue.argsArray; - for (var i = 0, ii = queue.length; i < ii; i++) { - switch (fnArray[i]) { - case OPS.paintInlineImageXObject: - case OPS.paintInlineImageXObjectGroup: - case OPS.paintImageMaskXObject: - var arg = argsArray[i][0]; // first param in imgData - if (!arg.cached) { - transfers.push(arg.data.buffer); - } - break; - } - } - return transfers; - } - - function OperatorList(intent, messageHandler, pageIndex) { - this.messageHandler = messageHandler; - this.fnArray = []; - this.argsArray = []; - this.dependencies = {}; - this._totalLength = 0; - this.pageIndex = pageIndex; - this.intent = intent; - } - - OperatorList.prototype = { - get length() { - return this.argsArray.length; - }, - - /** - * @returns {number} The total length of the entire operator list, - * since `this.length === 0` after flushing. - */ - get totalLength() { - return (this._totalLength + this.length); - }, - - addOp: function(fn, args) { - this.fnArray.push(fn); - this.argsArray.push(args); - if (this.messageHandler) { - if (this.fnArray.length >= CHUNK_SIZE) { - this.flush(); - } else if (this.fnArray.length >= CHUNK_SIZE_ABOUT && - (fn === OPS.restore || fn === OPS.endText)) { - // heuristic to flush on boundary of restore or endText - this.flush(); - } - } - }, - - addDependency: function(dependency) { - if (dependency in this.dependencies) { - return; - } - this.dependencies[dependency] = true; - this.addOp(OPS.dependency, [dependency]); - }, - - addDependencies: function(dependencies) { - for (var key in dependencies) { - this.addDependency(key); - } - }, - - addOpList: function(opList) { - Util.extendObj(this.dependencies, opList.dependencies); - for (var i = 0, ii = opList.length; i < ii; i++) { - this.addOp(opList.fnArray[i], opList.argsArray[i]); - } - }, - - getIR: function() { - return { - fnArray: this.fnArray, - argsArray: this.argsArray, - length: this.length - }; - }, - - flush: function(lastChunk) { - if (this.intent !== 'oplist') { - new QueueOptimizer().optimize(this); - } - var transfers = getTransfers(this); - var length = this.length; - this._totalLength += length; - - this.messageHandler.send('RenderPageChunk', { - operatorList: { - fnArray: this.fnArray, - argsArray: this.argsArray, - lastChunk: lastChunk, - length: length - }, - pageIndex: this.pageIndex, - intent: this.intent - }, transfers); - this.dependencies = {}; - this.fnArray.length = 0; - this.argsArray.length = 0; - } - }; - - return OperatorList; -})(); - -var StateManager = (function StateManagerClosure() { - function StateManager(initialState) { - this.state = initialState; - this.stateStack = []; - } - StateManager.prototype = { - save: function () { - var old = this.state; - this.stateStack.push(this.state); - this.state = old.clone(); - }, - restore: function () { - var prev = this.stateStack.pop(); - if (prev) { - this.state = prev; - } - }, - transform: function (args) { - this.state.ctm = Util.transform(this.state.ctm, args); - } - }; - return StateManager; -})(); - -var TextState = (function TextStateClosure() { - function TextState() { - this.ctm = new Float32Array(IDENTITY_MATRIX); - this.fontSize = 0; - this.font = null; - this.fontMatrix = FONT_IDENTITY_MATRIX; - this.textMatrix = IDENTITY_MATRIX.slice(); - this.textLineMatrix = IDENTITY_MATRIX.slice(); - this.charSpacing = 0; - this.wordSpacing = 0; - this.leading = 0; - this.textHScale = 1; - this.textRise = 0; - } - - TextState.prototype = { - setTextMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) { - var m = this.textMatrix; - m[0] = a; m[1] = b; m[2] = c; m[3] = d; m[4] = e; m[5] = f; - }, - setTextLineMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) { - var m = this.textLineMatrix; - m[0] = a; m[1] = b; m[2] = c; m[3] = d; m[4] = e; m[5] = f; - }, - translateTextMatrix: function TextState_translateTextMatrix(x, y) { - var m = this.textMatrix; - m[4] = m[0] * x + m[2] * y + m[4]; - m[5] = m[1] * x + m[3] * y + m[5]; - }, - translateTextLineMatrix: function TextState_translateTextMatrix(x, y) { - var m = this.textLineMatrix; - m[4] = m[0] * x + m[2] * y + m[4]; - m[5] = m[1] * x + m[3] * y + m[5]; - }, - calcRenderMatrix: function TextState_calcRendeMatrix(ctm) { - // 9.4.4 Text Space Details - var tsm = [this.fontSize * this.textHScale, 0, - 0, this.fontSize, - 0, this.textRise]; - return Util.transform(ctm, Util.transform(this.textMatrix, tsm)); - }, - carriageReturn: function TextState_carriageReturn() { - this.translateTextLineMatrix(0, -this.leading); - this.textMatrix = this.textLineMatrix.slice(); - }, - clone: function TextState_clone() { - var clone = Object.create(this); - clone.textMatrix = this.textMatrix.slice(); - clone.textLineMatrix = this.textLineMatrix.slice(); - clone.fontMatrix = this.fontMatrix.slice(); - return clone; - } - }; - return TextState; -})(); - -var EvalState = (function EvalStateClosure() { - function EvalState() { - this.ctm = new Float32Array(IDENTITY_MATRIX); - this.font = null; - this.textRenderingMode = TextRenderingMode.FILL; - this.fillColorSpace = ColorSpace.singletons.gray; - this.strokeColorSpace = ColorSpace.singletons.gray; - } - EvalState.prototype = { - clone: function CanvasExtraState_clone() { - return Object.create(this); - }, - }; - return EvalState; -})(); - -var EvaluatorPreprocessor = (function EvaluatorPreprocessorClosure() { - // Specifies properties for each command - // - // If variableArgs === true: [0, `numArgs`] expected - // If variableArgs === false: exactly `numArgs` expected - var OP_MAP = { - // Graphic state - w: { id: OPS.setLineWidth, numArgs: 1, variableArgs: false }, - J: { id: OPS.setLineCap, numArgs: 1, variableArgs: false }, - j: { id: OPS.setLineJoin, numArgs: 1, variableArgs: false }, - M: { id: OPS.setMiterLimit, numArgs: 1, variableArgs: false }, - d: { id: OPS.setDash, numArgs: 2, variableArgs: false }, - ri: { id: OPS.setRenderingIntent, numArgs: 1, variableArgs: false }, - i: { id: OPS.setFlatness, numArgs: 1, variableArgs: false }, - gs: { id: OPS.setGState, numArgs: 1, variableArgs: false }, - q: { id: OPS.save, numArgs: 0, variableArgs: false }, - Q: { id: OPS.restore, numArgs: 0, variableArgs: false }, - cm: { id: OPS.transform, numArgs: 6, variableArgs: false }, - - // Path - m: { id: OPS.moveTo, numArgs: 2, variableArgs: false }, - l: { id: OPS.lineTo, numArgs: 2, variableArgs: false }, - c: { id: OPS.curveTo, numArgs: 6, variableArgs: false }, - v: { id: OPS.curveTo2, numArgs: 4, variableArgs: false }, - y: { id: OPS.curveTo3, numArgs: 4, variableArgs: false }, - h: { id: OPS.closePath, numArgs: 0, variableArgs: false }, - re: { id: OPS.rectangle, numArgs: 4, variableArgs: false }, - S: { id: OPS.stroke, numArgs: 0, variableArgs: false }, - s: { id: OPS.closeStroke, numArgs: 0, variableArgs: false }, - f: { id: OPS.fill, numArgs: 0, variableArgs: false }, - F: { id: OPS.fill, numArgs: 0, variableArgs: false }, - 'f*': { id: OPS.eoFill, numArgs: 0, variableArgs: false }, - B: { id: OPS.fillStroke, numArgs: 0, variableArgs: false }, - 'B*': { id: OPS.eoFillStroke, numArgs: 0, variableArgs: false }, - b: { id: OPS.closeFillStroke, numArgs: 0, variableArgs: false }, - 'b*': { id: OPS.closeEOFillStroke, numArgs: 0, variableArgs: false }, - n: { id: OPS.endPath, numArgs: 0, variableArgs: false }, - - // Clipping - W: { id: OPS.clip, numArgs: 0, variableArgs: false }, - 'W*': { id: OPS.eoClip, numArgs: 0, variableArgs: false }, - - // Text - BT: { id: OPS.beginText, numArgs: 0, variableArgs: false }, - ET: { id: OPS.endText, numArgs: 0, variableArgs: false }, - Tc: { id: OPS.setCharSpacing, numArgs: 1, variableArgs: false }, - Tw: { id: OPS.setWordSpacing, numArgs: 1, variableArgs: false }, - Tz: { id: OPS.setHScale, numArgs: 1, variableArgs: false }, - TL: { id: OPS.setLeading, numArgs: 1, variableArgs: false }, - Tf: { id: OPS.setFont, numArgs: 2, variableArgs: false }, - Tr: { id: OPS.setTextRenderingMode, numArgs: 1, variableArgs: false }, - Ts: { id: OPS.setTextRise, numArgs: 1, variableArgs: false }, - Td: { id: OPS.moveText, numArgs: 2, variableArgs: false }, - TD: { id: OPS.setLeadingMoveText, numArgs: 2, variableArgs: false }, - Tm: { id: OPS.setTextMatrix, numArgs: 6, variableArgs: false }, - 'T*': { id: OPS.nextLine, numArgs: 0, variableArgs: false }, - Tj: { id: OPS.showText, numArgs: 1, variableArgs: false }, - TJ: { id: OPS.showSpacedText, numArgs: 1, variableArgs: false }, - '\'': { id: OPS.nextLineShowText, numArgs: 1, variableArgs: false }, - '"': { id: OPS.nextLineSetSpacingShowText, numArgs: 3, - variableArgs: false }, - - // Type3 fonts - d0: { id: OPS.setCharWidth, numArgs: 2, variableArgs: false }, - d1: { id: OPS.setCharWidthAndBounds, numArgs: 6, variableArgs: false }, - - // Color - CS: { id: OPS.setStrokeColorSpace, numArgs: 1, variableArgs: false }, - cs: { id: OPS.setFillColorSpace, numArgs: 1, variableArgs: false }, - SC: { id: OPS.setStrokeColor, numArgs: 4, variableArgs: true }, - SCN: { id: OPS.setStrokeColorN, numArgs: 33, variableArgs: true }, - sc: { id: OPS.setFillColor, numArgs: 4, variableArgs: true }, - scn: { id: OPS.setFillColorN, numArgs: 33, variableArgs: true }, - G: { id: OPS.setStrokeGray, numArgs: 1, variableArgs: false }, - g: { id: OPS.setFillGray, numArgs: 1, variableArgs: false }, - RG: { id: OPS.setStrokeRGBColor, numArgs: 3, variableArgs: false }, - rg: { id: OPS.setFillRGBColor, numArgs: 3, variableArgs: false }, - K: { id: OPS.setStrokeCMYKColor, numArgs: 4, variableArgs: false }, - k: { id: OPS.setFillCMYKColor, numArgs: 4, variableArgs: false }, - - // Shading - sh: { id: OPS.shadingFill, numArgs: 1, variableArgs: false }, - - // Images - BI: { id: OPS.beginInlineImage, numArgs: 0, variableArgs: false }, - ID: { id: OPS.beginImageData, numArgs: 0, variableArgs: false }, - EI: { id: OPS.endInlineImage, numArgs: 1, variableArgs: false }, - - // XObjects - Do: { id: OPS.paintXObject, numArgs: 1, variableArgs: false }, - MP: { id: OPS.markPoint, numArgs: 1, variableArgs: false }, - DP: { id: OPS.markPointProps, numArgs: 2, variableArgs: false }, - BMC: { id: OPS.beginMarkedContent, numArgs: 1, variableArgs: false }, - BDC: { id: OPS.beginMarkedContentProps, numArgs: 2, - variableArgs: false }, - EMC: { id: OPS.endMarkedContent, numArgs: 0, variableArgs: false }, - - // Compatibility - BX: { id: OPS.beginCompat, numArgs: 0, variableArgs: false }, - EX: { id: OPS.endCompat, numArgs: 0, variableArgs: false }, - - // (reserved partial commands for the lexer) - BM: null, - BD: null, - 'true': null, - fa: null, - fal: null, - fals: null, - 'false': null, - nu: null, - nul: null, - 'null': null - }; - - function EvaluatorPreprocessor(stream, xref, stateManager) { - // TODO(mduan): pass array of knownCommands rather than OP_MAP - // dictionary - this.parser = new Parser(new Lexer(stream, OP_MAP), false, xref); - this.stateManager = stateManager; - this.nonProcessedArgs = []; - } - - EvaluatorPreprocessor.prototype = { - get savedStatesDepth() { - return this.stateManager.stateStack.length; - }, - - // |operation| is an object with two fields: - // - // - |fn| is an out param. - // - // - |args| is an inout param. On entry, it should have one of two values. - // - // - An empty array. This indicates that the caller is providing the - // array in which the args will be stored in. The caller should use - // this value if it can reuse a single array for each call to read(). - // - // - |null|. This indicates that the caller needs this function to create - // the array in which any args are stored in. If there are zero args, - // this function will leave |operation.args| as |null| (thus avoiding - // allocations that would occur if we used an empty array to represent - // zero arguments). Otherwise, it will replace |null| with a new array - // containing the arguments. The caller should use this value if it - // cannot reuse an array for each call to read(). - // - // These two modes are present because this function is very hot and so - // avoiding allocations where possible is worthwhile. - // - read: function EvaluatorPreprocessor_read(operation) { - var args = operation.args; - while (true) { - var obj = this.parser.getObj(); - if (isCmd(obj)) { - var cmd = obj.cmd; - // Check that the command is valid - var opSpec = OP_MAP[cmd]; - if (!opSpec) { - warn('Unknown command "' + cmd + '"'); - continue; - } - - var fn = opSpec.id; - var numArgs = opSpec.numArgs; - var argsLength = args !== null ? args.length : 0; - - if (!opSpec.variableArgs) { - // Postscript commands can be nested, e.g. /F2 /GS2 gs 5.711 Tf - if (argsLength !== numArgs) { - var nonProcessedArgs = this.nonProcessedArgs; - while (argsLength > numArgs) { - nonProcessedArgs.push(args.shift()); - argsLength--; - } - while (argsLength < numArgs && nonProcessedArgs.length !== 0) { - if (!args) { - args = []; - } - args.unshift(nonProcessedArgs.pop()); - argsLength++; - } - } - - if (argsLength < numArgs) { - // If we receive too few args, it's not possible to possible - // to execute the command, so skip the command - info('Command ' + fn + ': because expected ' + - numArgs + ' args, but received ' + argsLength + - ' args; skipping'); - args = null; - continue; - } - } else if (argsLength > numArgs) { - info('Command ' + fn + ': expected [0,' + numArgs + - '] args, but received ' + argsLength + ' args'); - } - - // TODO figure out how to type-check vararg functions - this.preprocessCommand(fn, args); - - operation.fn = fn; - operation.args = args; - return true; - } else { - if (isEOF(obj)) { - return false; // no more commands - } - // argument - if (obj !== null) { - if (!args) { - args = []; - } - args.push((obj instanceof Dict ? obj.getAll() : obj)); - assert(args.length <= 33, 'Too many arguments'); - } - } - } - }, - - preprocessCommand: - function EvaluatorPreprocessor_preprocessCommand(fn, args) { - switch (fn | 0) { - case OPS.save: - this.stateManager.save(); - break; - case OPS.restore: - this.stateManager.restore(); - break; - case OPS.transform: - this.stateManager.transform(args); - break; - } - } - }; - return EvaluatorPreprocessor; -})(); - -var QueueOptimizer = (function QueueOptimizerClosure() { - function addState(parentState, pattern, fn) { - var state = parentState; - for (var i = 0, ii = pattern.length - 1; i < ii; i++) { - var item = pattern[i]; - state = (state[item] || (state[item] = [])); - } - state[pattern[pattern.length - 1]] = fn; - } - - function handlePaintSolidColorImageMask(iFirstSave, count, fnArray, - argsArray) { - // Handles special case of mainly LaTeX documents which use image masks to - // draw lines with the current fill style. - // 'count' groups of (save, transform, paintImageMaskXObject, restore)+ - // have been found at iFirstSave. - var iFirstPIMXO = iFirstSave + 2; - for (var i = 0; i < count; i++) { - var arg = argsArray[iFirstPIMXO + 4 * i]; - var imageMask = arg.length === 1 && arg[0]; - if (imageMask && imageMask.width === 1 && imageMask.height === 1 && - (!imageMask.data.length || - (imageMask.data.length === 1 && imageMask.data[0] === 0))) { - fnArray[iFirstPIMXO + 4 * i] = OPS.paintSolidColorImageMask; - continue; - } - break; - } - return count - i; - } - - var InitialState = []; - - // This replaces (save, transform, paintInlineImageXObject, restore)+ - // sequences with one |paintInlineImageXObjectGroup| operation. - addState(InitialState, - [OPS.save, OPS.transform, OPS.paintInlineImageXObject, OPS.restore], - function foundInlineImageGroup(context) { - var MIN_IMAGES_IN_INLINE_IMAGES_BLOCK = 10; - var MAX_IMAGES_IN_INLINE_IMAGES_BLOCK = 200; - var MAX_WIDTH = 1000; - var IMAGE_PADDING = 1; - - var fnArray = context.fnArray, argsArray = context.argsArray; - var curr = context.iCurr; - var iFirstSave = curr - 3; - var iFirstTransform = curr - 2; - var iFirstPIIXO = curr - 1; - - // Look for the quartets. - var i = iFirstSave + 4; - var ii = fnArray.length; - while (i + 3 < ii) { - if (fnArray[i] !== OPS.save || - fnArray[i + 1] !== OPS.transform || - fnArray[i + 2] !== OPS.paintInlineImageXObject || - fnArray[i + 3] !== OPS.restore) { - break; // ops don't match - } - i += 4; - } - - // At this point, i is the index of the first op past the last valid - // quartet. - var count = Math.min((i - iFirstSave) / 4, - MAX_IMAGES_IN_INLINE_IMAGES_BLOCK); - if (count < MIN_IMAGES_IN_INLINE_IMAGES_BLOCK) { - return i; - } - - // assuming that heights of those image is too small (~1 pixel) - // packing as much as possible by lines - var maxX = 0; - var map = [], maxLineHeight = 0; - var currentX = IMAGE_PADDING, currentY = IMAGE_PADDING; - var q; - for (q = 0; q < count; q++) { - var transform = argsArray[iFirstTransform + (q << 2)]; - var img = argsArray[iFirstPIIXO + (q << 2)][0]; - if (currentX + img.width > MAX_WIDTH) { - // starting new line - maxX = Math.max(maxX, currentX); - currentY += maxLineHeight + 2 * IMAGE_PADDING; - currentX = 0; - maxLineHeight = 0; - } - map.push({ - transform: transform, - x: currentX, y: currentY, - w: img.width, h: img.height - }); - currentX += img.width + 2 * IMAGE_PADDING; - maxLineHeight = Math.max(maxLineHeight, img.height); - } - var imgWidth = Math.max(maxX, currentX) + IMAGE_PADDING; - var imgHeight = currentY + maxLineHeight + IMAGE_PADDING; - var imgData = new Uint8Array(imgWidth * imgHeight * 4); - var imgRowSize = imgWidth << 2; - for (q = 0; q < count; q++) { - var data = argsArray[iFirstPIIXO + (q << 2)][0].data; - // Copy image by lines and extends pixels into padding. - var rowSize = map[q].w << 2; - var dataOffset = 0; - var offset = (map[q].x + map[q].y * imgWidth) << 2; - imgData.set(data.subarray(0, rowSize), offset - imgRowSize); - for (var k = 0, kk = map[q].h; k < kk; k++) { - imgData.set(data.subarray(dataOffset, dataOffset + rowSize), offset); - dataOffset += rowSize; - offset += imgRowSize; - } - imgData.set(data.subarray(dataOffset - rowSize, dataOffset), offset); - while (offset >= 0) { - data[offset - 4] = data[offset]; - data[offset - 3] = data[offset + 1]; - data[offset - 2] = data[offset + 2]; - data[offset - 1] = data[offset + 3]; - data[offset + rowSize] = data[offset + rowSize - 4]; - data[offset + rowSize + 1] = data[offset + rowSize - 3]; - data[offset + rowSize + 2] = data[offset + rowSize - 2]; - data[offset + rowSize + 3] = data[offset + rowSize - 1]; - offset -= imgRowSize; - } - } - - // Replace queue items. - fnArray.splice(iFirstSave, count * 4, OPS.paintInlineImageXObjectGroup); - argsArray.splice(iFirstSave, count * 4, - [{ width: imgWidth, height: imgHeight, kind: ImageKind.RGBA_32BPP, - data: imgData }, map]); - - return iFirstSave + 1; - }); - - // This replaces (save, transform, paintImageMaskXObject, restore)+ - // sequences with one |paintImageMaskXObjectGroup| or one - // |paintImageMaskXObjectRepeat| operation. - addState(InitialState, - [OPS.save, OPS.transform, OPS.paintImageMaskXObject, OPS.restore], - function foundImageMaskGroup(context) { - var MIN_IMAGES_IN_MASKS_BLOCK = 10; - var MAX_IMAGES_IN_MASKS_BLOCK = 100; - var MAX_SAME_IMAGES_IN_MASKS_BLOCK = 1000; - - var fnArray = context.fnArray, argsArray = context.argsArray; - var curr = context.iCurr; - var iFirstSave = curr - 3; - var iFirstTransform = curr - 2; - var iFirstPIMXO = curr - 1; - - // Look for the quartets. - var i = iFirstSave + 4; - var ii = fnArray.length; - while (i + 3 < ii) { - if (fnArray[i] !== OPS.save || - fnArray[i + 1] !== OPS.transform || - fnArray[i + 2] !== OPS.paintImageMaskXObject || - fnArray[i + 3] !== OPS.restore) { - break; // ops don't match - } - i += 4; - } - - // At this point, i is the index of the first op past the last valid - // quartet. - var count = (i - iFirstSave) / 4; - count = handlePaintSolidColorImageMask(iFirstSave, count, fnArray, - argsArray); - if (count < MIN_IMAGES_IN_MASKS_BLOCK) { - return i; - } - - var q; - var isSameImage = false; - var iTransform, transformArgs; - var firstPIMXOArg0 = argsArray[iFirstPIMXO][0]; - if (argsArray[iFirstTransform][1] === 0 && - argsArray[iFirstTransform][2] === 0) { - isSameImage = true; - var firstTransformArg0 = argsArray[iFirstTransform][0]; - var firstTransformArg3 = argsArray[iFirstTransform][3]; - iTransform = iFirstTransform + 4; - var iPIMXO = iFirstPIMXO + 4; - for (q = 1; q < count; q++, iTransform += 4, iPIMXO += 4) { - transformArgs = argsArray[iTransform]; - if (argsArray[iPIMXO][0] !== firstPIMXOArg0 || - transformArgs[0] !== firstTransformArg0 || - transformArgs[1] !== 0 || - transformArgs[2] !== 0 || - transformArgs[3] !== firstTransformArg3) { - if (q < MIN_IMAGES_IN_MASKS_BLOCK) { - isSameImage = false; - } else { - count = q; - } - break; // different image or transform - } - } - } - - if (isSameImage) { - count = Math.min(count, MAX_SAME_IMAGES_IN_MASKS_BLOCK); - var positions = new Float32Array(count * 2); - iTransform = iFirstTransform; - for (q = 0; q < count; q++, iTransform += 4) { - transformArgs = argsArray[iTransform]; - positions[(q << 1)] = transformArgs[4]; - positions[(q << 1) + 1] = transformArgs[5]; - } - - // Replace queue items. - fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectRepeat); - argsArray.splice(iFirstSave, count * 4, - [firstPIMXOArg0, firstTransformArg0, firstTransformArg3, positions]); - } else { - count = Math.min(count, MAX_IMAGES_IN_MASKS_BLOCK); - var images = []; - for (q = 0; q < count; q++) { - transformArgs = argsArray[iFirstTransform + (q << 2)]; - var maskParams = argsArray[iFirstPIMXO + (q << 2)][0]; - images.push({ data: maskParams.data, width: maskParams.width, - height: maskParams.height, - transform: transformArgs }); - } - - // Replace queue items. - fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectGroup); - argsArray.splice(iFirstSave, count * 4, [images]); - } - - return iFirstSave + 1; - }); - - // This replaces (save, transform, paintImageXObject, restore)+ sequences - // with one paintImageXObjectRepeat operation, if the |transform| and - // |paintImageXObjectRepeat| ops are appropriate. - addState(InitialState, - [OPS.save, OPS.transform, OPS.paintImageXObject, OPS.restore], - function (context) { - var MIN_IMAGES_IN_BLOCK = 3; - var MAX_IMAGES_IN_BLOCK = 1000; - - var fnArray = context.fnArray, argsArray = context.argsArray; - var curr = context.iCurr; - var iFirstSave = curr - 3; - var iFirstTransform = curr - 2; - var iFirstPIXO = curr - 1; - var iFirstRestore = curr; - - if (argsArray[iFirstTransform][1] !== 0 || - argsArray[iFirstTransform][2] !== 0) { - return iFirstRestore + 1; // transform has the wrong form - } - - // Look for the quartets. - var firstPIXOArg0 = argsArray[iFirstPIXO][0]; - var firstTransformArg0 = argsArray[iFirstTransform][0]; - var firstTransformArg3 = argsArray[iFirstTransform][3]; - var i = iFirstSave + 4; - var ii = fnArray.length; - while (i + 3 < ii) { - if (fnArray[i] !== OPS.save || - fnArray[i + 1] !== OPS.transform || - fnArray[i + 2] !== OPS.paintImageXObject || - fnArray[i + 3] !== OPS.restore) { - break; // ops don't match - } - if (argsArray[i + 1][0] !== firstTransformArg0 || - argsArray[i + 1][1] !== 0 || - argsArray[i + 1][2] !== 0 || - argsArray[i + 1][3] !== firstTransformArg3) { - break; // transforms don't match - } - if (argsArray[i + 2][0] !== firstPIXOArg0) { - break; // images don't match - } - i += 4; - } - - // At this point, i is the index of the first op past the last valid - // quartet. - var count = Math.min((i - iFirstSave) / 4, MAX_IMAGES_IN_BLOCK); - if (count < MIN_IMAGES_IN_BLOCK) { - return i; - } - - // Extract the (x,y) positions from all of the matching transforms. - var positions = new Float32Array(count * 2); - var iTransform = iFirstTransform; - for (var q = 0; q < count; q++, iTransform += 4) { - var transformArgs = argsArray[iTransform]; - positions[(q << 1)] = transformArgs[4]; - positions[(q << 1) + 1] = transformArgs[5]; - } - - // Replace queue items. - var args = [firstPIXOArg0, firstTransformArg0, firstTransformArg3, - positions]; - fnArray.splice(iFirstSave, count * 4, OPS.paintImageXObjectRepeat); - argsArray.splice(iFirstSave, count * 4, args); - - return iFirstSave + 1; - }); - - // This replaces (beginText, setFont, setTextMatrix, showText, endText)+ - // sequences with (beginText, setFont, (setTextMatrix, showText)+, endText)+ - // sequences, if the font for each one is the same. - addState(InitialState, - [OPS.beginText, OPS.setFont, OPS.setTextMatrix, OPS.showText, OPS.endText], - function (context) { - var MIN_CHARS_IN_BLOCK = 3; - var MAX_CHARS_IN_BLOCK = 1000; - - var fnArray = context.fnArray, argsArray = context.argsArray; - var curr = context.iCurr; - var iFirstBeginText = curr - 4; - var iFirstSetFont = curr - 3; - var iFirstSetTextMatrix = curr - 2; - var iFirstShowText = curr - 1; - var iFirstEndText = curr; - - // Look for the quintets. - var firstSetFontArg0 = argsArray[iFirstSetFont][0]; - var firstSetFontArg1 = argsArray[iFirstSetFont][1]; - var i = iFirstBeginText + 5; - var ii = fnArray.length; - while (i + 4 < ii) { - if (fnArray[i] !== OPS.beginText || - fnArray[i + 1] !== OPS.setFont || - fnArray[i + 2] !== OPS.setTextMatrix || - fnArray[i + 3] !== OPS.showText || - fnArray[i + 4] !== OPS.endText) { - break; // ops don't match - } - if (argsArray[i + 1][0] !== firstSetFontArg0 || - argsArray[i + 1][1] !== firstSetFontArg1) { - break; // fonts don't match - } - i += 5; - } - - // At this point, i is the index of the first op past the last valid - // quintet. - var count = Math.min(((i - iFirstBeginText) / 5), MAX_CHARS_IN_BLOCK); - if (count < MIN_CHARS_IN_BLOCK) { - return i; - } - - // If the preceding quintet is (, setFont, setTextMatrix, - // showText, endText), include that as well. (E.g. might be - // |dependency|.) - var iFirst = iFirstBeginText; - if (iFirstBeginText >= 4 && - fnArray[iFirstBeginText - 4] === fnArray[iFirstSetFont] && - fnArray[iFirstBeginText - 3] === fnArray[iFirstSetTextMatrix] && - fnArray[iFirstBeginText - 2] === fnArray[iFirstShowText] && - fnArray[iFirstBeginText - 1] === fnArray[iFirstEndText] && - argsArray[iFirstBeginText - 4][0] === firstSetFontArg0 && - argsArray[iFirstBeginText - 4][1] === firstSetFontArg1) { - count++; - iFirst -= 5; - } - - // Remove (endText, beginText, setFont) trios. - var iEndText = iFirst + 4; - for (var q = 1; q < count; q++) { - fnArray.splice(iEndText, 3); - argsArray.splice(iEndText, 3); - iEndText += 2; - } - - return iEndText + 1; - }); - - function QueueOptimizer() {} - - QueueOptimizer.prototype = { - optimize: function QueueOptimizer_optimize(queue) { - var fnArray = queue.fnArray, argsArray = queue.argsArray; - var context = { - iCurr: 0, - fnArray: fnArray, - argsArray: argsArray - }; - var state; - var i = 0, ii = fnArray.length; - while (i < ii) { - state = (state || InitialState)[fnArray[i]]; - if (typeof state === 'function') { // we found some handler - context.iCurr = i; - // state() returns the index of the first non-matching op (if we - // didn't match) or the first op past the modified ops (if we did - // match and replace). - i = state(context); - state = undefined; // reset the state machine - ii = context.fnArray.length; - } else { - i++; - } - } - } - }; - return QueueOptimizer; -})(); - - -var BUILT_IN_CMAPS = [ -// << Start unicode maps. -'Adobe-GB1-UCS2', -'Adobe-CNS1-UCS2', -'Adobe-Japan1-UCS2', -'Adobe-Korea1-UCS2', -// >> End unicode maps. -'78-EUC-H', -'78-EUC-V', -'78-H', -'78-RKSJ-H', -'78-RKSJ-V', -'78-V', -'78ms-RKSJ-H', -'78ms-RKSJ-V', -'83pv-RKSJ-H', -'90ms-RKSJ-H', -'90ms-RKSJ-V', -'90msp-RKSJ-H', -'90msp-RKSJ-V', -'90pv-RKSJ-H', -'90pv-RKSJ-V', -'Add-H', -'Add-RKSJ-H', -'Add-RKSJ-V', -'Add-V', -'Adobe-CNS1-0', -'Adobe-CNS1-1', -'Adobe-CNS1-2', -'Adobe-CNS1-3', -'Adobe-CNS1-4', -'Adobe-CNS1-5', -'Adobe-CNS1-6', -'Adobe-GB1-0', -'Adobe-GB1-1', -'Adobe-GB1-2', -'Adobe-GB1-3', -'Adobe-GB1-4', -'Adobe-GB1-5', -'Adobe-Japan1-0', -'Adobe-Japan1-1', -'Adobe-Japan1-2', -'Adobe-Japan1-3', -'Adobe-Japan1-4', -'Adobe-Japan1-5', -'Adobe-Japan1-6', -'Adobe-Korea1-0', -'Adobe-Korea1-1', -'Adobe-Korea1-2', -'B5-H', -'B5-V', -'B5pc-H', -'B5pc-V', -'CNS-EUC-H', -'CNS-EUC-V', -'CNS1-H', -'CNS1-V', -'CNS2-H', -'CNS2-V', -'ETHK-B5-H', -'ETHK-B5-V', -'ETen-B5-H', -'ETen-B5-V', -'ETenms-B5-H', -'ETenms-B5-V', -'EUC-H', -'EUC-V', -'Ext-H', -'Ext-RKSJ-H', -'Ext-RKSJ-V', -'Ext-V', -'GB-EUC-H', -'GB-EUC-V', -'GB-H', -'GB-V', -'GBK-EUC-H', -'GBK-EUC-V', -'GBK2K-H', -'GBK2K-V', -'GBKp-EUC-H', -'GBKp-EUC-V', -'GBT-EUC-H', -'GBT-EUC-V', -'GBT-H', -'GBT-V', -'GBTpc-EUC-H', -'GBTpc-EUC-V', -'GBpc-EUC-H', -'GBpc-EUC-V', -'H', -'HKdla-B5-H', -'HKdla-B5-V', -'HKdlb-B5-H', -'HKdlb-B5-V', -'HKgccs-B5-H', -'HKgccs-B5-V', -'HKm314-B5-H', -'HKm314-B5-V', -'HKm471-B5-H', -'HKm471-B5-V', -'HKscs-B5-H', -'HKscs-B5-V', -'Hankaku', -'Hiragana', -'KSC-EUC-H', -'KSC-EUC-V', -'KSC-H', -'KSC-Johab-H', -'KSC-Johab-V', -'KSC-V', -'KSCms-UHC-H', -'KSCms-UHC-HW-H', -'KSCms-UHC-HW-V', -'KSCms-UHC-V', -'KSCpc-EUC-H', -'KSCpc-EUC-V', -'Katakana', -'NWP-H', -'NWP-V', -'RKSJ-H', -'RKSJ-V', -'Roman', -'UniCNS-UCS2-H', -'UniCNS-UCS2-V', -'UniCNS-UTF16-H', -'UniCNS-UTF16-V', -'UniCNS-UTF32-H', -'UniCNS-UTF32-V', -'UniCNS-UTF8-H', -'UniCNS-UTF8-V', -'UniGB-UCS2-H', -'UniGB-UCS2-V', -'UniGB-UTF16-H', -'UniGB-UTF16-V', -'UniGB-UTF32-H', -'UniGB-UTF32-V', -'UniGB-UTF8-H', -'UniGB-UTF8-V', -'UniJIS-UCS2-H', -'UniJIS-UCS2-HW-H', -'UniJIS-UCS2-HW-V', -'UniJIS-UCS2-V', -'UniJIS-UTF16-H', -'UniJIS-UTF16-V', -'UniJIS-UTF32-H', -'UniJIS-UTF32-V', -'UniJIS-UTF8-H', -'UniJIS-UTF8-V', -'UniJIS2004-UTF16-H', -'UniJIS2004-UTF16-V', -'UniJIS2004-UTF32-H', -'UniJIS2004-UTF32-V', -'UniJIS2004-UTF8-H', -'UniJIS2004-UTF8-V', -'UniJISPro-UCS2-HW-V', -'UniJISPro-UCS2-V', -'UniJISPro-UTF8-V', -'UniJISX0213-UTF32-H', -'UniJISX0213-UTF32-V', -'UniJISX02132004-UTF32-H', -'UniJISX02132004-UTF32-V', -'UniKS-UCS2-H', -'UniKS-UCS2-V', -'UniKS-UTF16-H', -'UniKS-UTF16-V', -'UniKS-UTF32-H', -'UniKS-UTF32-V', -'UniKS-UTF8-H', -'UniKS-UTF8-V', -'V', -'WP-Symbol']; - -// CMap, not to be confused with TrueType's cmap. -var CMap = (function CMapClosure() { - function CMap(builtInCMap) { - // Codespace ranges are stored as follows: - // [[1BytePairs], [2BytePairs], [3BytePairs], [4BytePairs]] - // where nBytePairs are ranges e.g. [low1, high1, low2, high2, ...] - this.codespaceRanges = [[], [], [], []]; - this.numCodespaceRanges = 0; - // Map entries have one of two forms. - // - cid chars are 16-bit unsigned integers, stored as integers. - // - bf chars are variable-length byte sequences, stored as strings, with - // one byte per character. - this._map = []; - this.name = ''; - this.vertical = false; - this.useCMap = null; - this.builtInCMap = builtInCMap; - } - CMap.prototype = { - addCodespaceRange: function(n, low, high) { - this.codespaceRanges[n - 1].push(low, high); - this.numCodespaceRanges++; - }, - - mapCidRange: function(low, high, dstLow) { - while (low <= high) { - this._map[low++] = dstLow++; - } - }, - - mapBfRange: function(low, high, dstLow) { - var lastByte = dstLow.length - 1; - while (low <= high) { - this._map[low++] = dstLow; - // Only the last byte has to be incremented. - dstLow = dstLow.substr(0, lastByte) + - String.fromCharCode(dstLow.charCodeAt(lastByte) + 1); - } - }, - - mapBfRangeToArray: function(low, high, array) { - var i = 0, ii = array.length; - while (low <= high && i < ii) { - this._map[low] = array[i++]; - ++low; - } - }, - - // This is used for both bf and cid chars. - mapOne: function(src, dst) { - this._map[src] = dst; - }, - - lookup: function(code) { - return this._map[code]; - }, - - contains: function(code) { - return this._map[code] !== undefined; - }, - - forEach: function(callback) { - // Most maps have fewer than 65536 entries, and for those we use normal - // array iteration. But really sparse tables are possible -- e.g. with - // indices in the *billions*. For such tables we use for..in, which isn't - // ideal because it stringifies the indices for all present elements, but - // it does avoid iterating over every undefined entry. - var map = this._map; - var length = map.length; - var i; - if (length <= 0x10000) { - for (i = 0; i < length; i++) { - if (map[i] !== undefined) { - callback(i, map[i]); - } - } - } else { - for (i in this._map) { - callback(i, map[i]); - } - } - }, - - charCodeOf: function(value) { - return this._map.indexOf(value); - }, - - getMap: function() { - return this._map; - }, - - readCharCode: function(str, offset, out) { - var c = 0; - var codespaceRanges = this.codespaceRanges; - var codespaceRangesLen = this.codespaceRanges.length; - // 9.7.6.2 CMap Mapping - // The code length is at most 4. - for (var n = 0; n < codespaceRangesLen; n++) { - c = ((c << 8) | str.charCodeAt(offset + n)) >>> 0; - // Check each codespace range to see if it falls within. - var codespaceRange = codespaceRanges[n]; - for (var k = 0, kk = codespaceRange.length; k < kk;) { - var low = codespaceRange[k++]; - var high = codespaceRange[k++]; - if (c >= low && c <= high) { - out.charcode = c; - out.length = n + 1; - return; - } - } - } - out.charcode = 0; - out.length = 1; - }, - - get length() { - return this._map.length; - }, - - get isIdentityCMap() { - if (!(this.name === 'Identity-H' || this.name === 'Identity-V')) { - return false; - } - if (this._map.length !== 0x10000) { - return false; - } - for (var i = 0; i < 0x10000; i++) { - if (this._map[i] !== i) { - return false; - } - } - return true; - } - }; - return CMap; -})(); - -// A special case of CMap, where the _map array implicitly has a length of -// 65536 and each element is equal to its index. -var IdentityCMap = (function IdentityCMapClosure() { - function IdentityCMap(vertical, n) { - CMap.call(this); - this.vertical = vertical; - this.addCodespaceRange(n, 0, 0xffff); - } - Util.inherit(IdentityCMap, CMap, {}); - - IdentityCMap.prototype = { - addCodespaceRange: CMap.prototype.addCodespaceRange, - - mapCidRange: function(low, high, dstLow) { - error('should not call mapCidRange'); - }, - - mapBfRange: function(low, high, dstLow) { - error('should not call mapBfRange'); - }, - - mapBfRangeToArray: function(low, high, array) { - error('should not call mapBfRangeToArray'); - }, - - mapOne: function(src, dst) { - error('should not call mapCidOne'); - }, - - lookup: function(code) { - return (isInt(code) && code <= 0xffff) ? code : undefined; - }, - - contains: function(code) { - return isInt(code) && code <= 0xffff; - }, - - forEach: function(callback) { - for (var i = 0; i <= 0xffff; i++) { - callback(i, i); - } - }, - - charCodeOf: function(value) { - return (isInt(value) && value <= 0xffff) ? value : -1; - }, - - getMap: function() { - // Sometimes identity maps must be instantiated, but it's rare. - var map = new Array(0x10000); - for (var i = 0; i <= 0xffff; i++) { - map[i] = i; - } - return map; - }, - - readCharCode: CMap.prototype.readCharCode, - - get length() { - return 0x10000; - }, - - get isIdentityCMap() { - error('should not access .isIdentityCMap'); - } - }; - - return IdentityCMap; -})(); - -var BinaryCMapReader = (function BinaryCMapReaderClosure() { - function fetchBinaryData(url) { - var nonBinaryRequest = PDFJS.disableWorker; - var request = new XMLHttpRequest(); - request.open('GET', url, false); - if (!nonBinaryRequest) { - try { - request.responseType = 'arraybuffer'; - nonBinaryRequest = request.responseType !== 'arraybuffer'; - } catch (e) { - nonBinaryRequest = true; - } - } - if (nonBinaryRequest && request.overrideMimeType) { - request.overrideMimeType('text/plain; charset=x-user-defined'); - } - request.send(null); - if (nonBinaryRequest ? !request.responseText : !request.response) { - error('Unable to get binary cMap at: ' + url); - } - if (nonBinaryRequest) { - var data = Array.prototype.map.call(request.responseText, function (ch) { - return ch.charCodeAt(0) & 255; - }); - return new Uint8Array(data); - } - return new Uint8Array(request.response); - } - - function hexToInt(a, size) { - var n = 0; - for (var i = 0; i <= size; i++) { - n = (n << 8) | a[i]; - } - return n >>> 0; - } - - function hexToStr(a, size) { - // This code is hot. Special-case some common values to avoid creating an - // object with subarray(). - if (size === 1) { - return String.fromCharCode(a[0], a[1]); - } - if (size === 3) { - return String.fromCharCode(a[0], a[1], a[2], a[3]); - } - return String.fromCharCode.apply(null, a.subarray(0, size + 1)); - } - - function addHex(a, b, size) { - var c = 0; - for (var i = size; i >= 0; i--) { - c += a[i] + b[i]; - a[i] = c & 255; - c >>= 8; - } - } - - function incHex(a, size) { - var c = 1; - for (var i = size; i >= 0 && c > 0; i--) { - c += a[i]; - a[i] = c & 255; - c >>= 8; - } - } - - var MAX_NUM_SIZE = 16; - var MAX_ENCODED_NUM_SIZE = 19; // ceil(MAX_NUM_SIZE * 7 / 8) - - function BinaryCMapStream(data) { - this.buffer = data; - this.pos = 0; - this.end = data.length; - this.tmpBuf = new Uint8Array(MAX_ENCODED_NUM_SIZE); - } - - BinaryCMapStream.prototype = { - readByte: function () { - if (this.pos >= this.end) { - return -1; - } - return this.buffer[this.pos++]; - }, - readNumber: function () { - var n = 0; - var last; - do { - var b = this.readByte(); - if (b < 0) { - error('unexpected EOF in bcmap'); - } - last = !(b & 0x80); - n = (n << 7) | (b & 0x7F); - } while (!last); - return n; - }, - readSigned: function () { - var n = this.readNumber(); - return (n & 1) ? ~(n >>> 1) : n >>> 1; - }, - readHex: function (num, size) { - num.set(this.buffer.subarray(this.pos, - this.pos + size + 1)); - this.pos += size + 1; - }, - readHexNumber: function (num, size) { - var last; - var stack = this.tmpBuf, sp = 0; - do { - var b = this.readByte(); - if (b < 0) { - error('unexpected EOF in bcmap'); - } - last = !(b & 0x80); - stack[sp++] = b & 0x7F; - } while (!last); - var i = size, buffer = 0, bufferSize = 0; - while (i >= 0) { - while (bufferSize < 8 && stack.length > 0) { - buffer = (stack[--sp] << bufferSize) | buffer; - bufferSize += 7; - } - num[i] = buffer & 255; - i--; - buffer >>= 8; - bufferSize -= 8; - } - }, - readHexSigned: function (num, size) { - this.readHexNumber(num, size); - var sign = num[size] & 1 ? 255 : 0; - var c = 0; - for (var i = 0; i <= size; i++) { - c = ((c & 1) << 8) | num[i]; - num[i] = (c >> 1) ^ sign; - } - }, - readString: function () { - var len = this.readNumber(); - var s = ''; - for (var i = 0; i < len; i++) { - s += String.fromCharCode(this.readNumber()); - } - return s; - } - }; - - function processBinaryCMap(url, cMap, extend) { - var data = fetchBinaryData(url); - var stream = new BinaryCMapStream(data); - - var header = stream.readByte(); - cMap.vertical = !!(header & 1); - - var useCMap = null; - var start = new Uint8Array(MAX_NUM_SIZE); - var end = new Uint8Array(MAX_NUM_SIZE); - var char = new Uint8Array(MAX_NUM_SIZE); - var charCode = new Uint8Array(MAX_NUM_SIZE); - var tmp = new Uint8Array(MAX_NUM_SIZE); - var code; - - var b; - while ((b = stream.readByte()) >= 0) { - var type = b >> 5; - if (type === 7) { // metadata, e.g. comment or usecmap - switch (b & 0x1F) { - case 0: - stream.readString(); // skipping comment - break; - case 1: - useCMap = stream.readString(); - break; - } - continue; - } - var sequence = !!(b & 0x10); - var dataSize = b & 15; - - assert(dataSize + 1 <= MAX_NUM_SIZE); - - var ucs2DataSize = 1; - var subitemsCount = stream.readNumber(); - var i; - switch (type) { - case 0: // codespacerange - stream.readHex(start, dataSize); - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), - hexToInt(end, dataSize)); - for (i = 1; i < subitemsCount; i++) { - incHex(end, dataSize); - stream.readHexNumber(start, dataSize); - addHex(start, end, dataSize); - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), - hexToInt(end, dataSize)); - } - break; - case 1: // notdefrange - stream.readHex(start, dataSize); - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - code = stream.readNumber(); - // undefined range, skipping - for (i = 1; i < subitemsCount; i++) { - incHex(end, dataSize); - stream.readHexNumber(start, dataSize); - addHex(start, end, dataSize); - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - code = stream.readNumber(); - // nop - } - break; - case 2: // cidchar - stream.readHex(char, dataSize); - code = stream.readNumber(); - cMap.mapOne(hexToInt(char, dataSize), code); - for (i = 1; i < subitemsCount; i++) { - incHex(char, dataSize); - if (!sequence) { - stream.readHexNumber(tmp, dataSize); - addHex(char, tmp, dataSize); - } - code = stream.readSigned() + (code + 1); - cMap.mapOne(hexToInt(char, dataSize), code); - } - break; - case 3: // cidrange - stream.readHex(start, dataSize); - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - code = stream.readNumber(); - cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), - code); - for (i = 1; i < subitemsCount; i++) { - incHex(end, dataSize); - if (!sequence) { - stream.readHexNumber(start, dataSize); - addHex(start, end, dataSize); - } else { - start.set(end); - } - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - code = stream.readNumber(); - cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), - code); - } - break; - case 4: // bfchar - stream.readHex(char, ucs2DataSize); - stream.readHex(charCode, dataSize); - cMap.mapOne(hexToInt(char, ucs2DataSize), - hexToStr(charCode, dataSize)); - for (i = 1; i < subitemsCount; i++) { - incHex(char, ucs2DataSize); - if (!sequence) { - stream.readHexNumber(tmp, ucs2DataSize); - addHex(char, tmp, ucs2DataSize); - } - incHex(charCode, dataSize); - stream.readHexSigned(tmp, dataSize); - addHex(charCode, tmp, dataSize); - cMap.mapOne(hexToInt(char, ucs2DataSize), - hexToStr(charCode, dataSize)); - } - break; - case 5: // bfrange - stream.readHex(start, ucs2DataSize); - stream.readHexNumber(end, ucs2DataSize); - addHex(end, start, ucs2DataSize); - stream.readHex(charCode, dataSize); - cMap.mapBfRange(hexToInt(start, ucs2DataSize), - hexToInt(end, ucs2DataSize), - hexToStr(charCode, dataSize)); - for (i = 1; i < subitemsCount; i++) { - incHex(end, ucs2DataSize); - if (!sequence) { - stream.readHexNumber(start, ucs2DataSize); - addHex(start, end, ucs2DataSize); - } else { - start.set(end); - } - stream.readHexNumber(end, ucs2DataSize); - addHex(end, start, ucs2DataSize); - stream.readHex(charCode, dataSize); - cMap.mapBfRange(hexToInt(start, ucs2DataSize), - hexToInt(end, ucs2DataSize), - hexToStr(charCode, dataSize)); - } - break; - default: - error('Unknown type: ' + type); - break; - } - } - - if (useCMap) { - extend(useCMap); - } - return cMap; - } - - function BinaryCMapReader() {} - - BinaryCMapReader.prototype = { - read: processBinaryCMap - }; - - return BinaryCMapReader; -})(); - -var CMapFactory = (function CMapFactoryClosure() { - function strToInt(str) { - var a = 0; - for (var i = 0; i < str.length; i++) { - a = (a << 8) | str.charCodeAt(i); - } - return a >>> 0; - } - - function expectString(obj) { - if (!isString(obj)) { - error('Malformed CMap: expected string.'); - } - } - - function expectInt(obj) { - if (!isInt(obj)) { - error('Malformed CMap: expected int.'); - } - } - - function parseBfChar(cMap, lexer) { - while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } - if (isCmd(obj, 'endbfchar')) { - return; - } - expectString(obj); - var src = strToInt(obj); - obj = lexer.getObj(); - // TODO are /dstName used? - expectString(obj); - var dst = obj; - cMap.mapOne(src, dst); - } - } - - function parseBfRange(cMap, lexer) { - while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } - if (isCmd(obj, 'endbfrange')) { - return; - } - expectString(obj); - var low = strToInt(obj); - obj = lexer.getObj(); - expectString(obj); - var high = strToInt(obj); - obj = lexer.getObj(); - if (isInt(obj) || isString(obj)) { - var dstLow = isInt(obj) ? String.fromCharCode(obj) : obj; - cMap.mapBfRange(low, high, dstLow); - } else if (isCmd(obj, '[')) { - obj = lexer.getObj(); - var array = []; - while (!isCmd(obj, ']') && !isEOF(obj)) { - array.push(obj); - obj = lexer.getObj(); - } - cMap.mapBfRangeToArray(low, high, array); - } else { - break; - } - } - error('Invalid bf range.'); - } - - function parseCidChar(cMap, lexer) { - while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } - if (isCmd(obj, 'endcidchar')) { - return; - } - expectString(obj); - var src = strToInt(obj); - obj = lexer.getObj(); - expectInt(obj); - var dst = obj; - cMap.mapOne(src, dst); - } - } - - function parseCidRange(cMap, lexer) { - while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } - if (isCmd(obj, 'endcidrange')) { - return; - } - expectString(obj); - var low = strToInt(obj); - obj = lexer.getObj(); - expectString(obj); - var high = strToInt(obj); - obj = lexer.getObj(); - expectInt(obj); - var dstLow = obj; - cMap.mapCidRange(low, high, dstLow); - } - } - - function parseCodespaceRange(cMap, lexer) { - while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } - if (isCmd(obj, 'endcodespacerange')) { - return; - } - if (!isString(obj)) { - break; - } - var low = strToInt(obj); - obj = lexer.getObj(); - if (!isString(obj)) { - break; - } - var high = strToInt(obj); - cMap.addCodespaceRange(obj.length, low, high); - } - error('Invalid codespace range.'); - } - - function parseWMode(cMap, lexer) { - var obj = lexer.getObj(); - if (isInt(obj)) { - cMap.vertical = !!obj; - } - } - - function parseCMapName(cMap, lexer) { - var obj = lexer.getObj(); - if (isName(obj) && isString(obj.name)) { - cMap.name = obj.name; - } - } - - function parseCMap(cMap, lexer, builtInCMapParams, useCMap) { - var previous; - var embededUseCMap; - objLoop: while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } else if (isName(obj)) { - if (obj.name === 'WMode') { - parseWMode(cMap, lexer); - } else if (obj.name === 'CMapName') { - parseCMapName(cMap, lexer); - } - previous = obj; - } else if (isCmd(obj)) { - switch (obj.cmd) { - case 'endcmap': - break objLoop; - case 'usecmap': - if (isName(previous)) { - embededUseCMap = previous.name; - } - break; - case 'begincodespacerange': - parseCodespaceRange(cMap, lexer); - break; - case 'beginbfchar': - parseBfChar(cMap, lexer); - break; - case 'begincidchar': - parseCidChar(cMap, lexer); - break; - case 'beginbfrange': - parseBfRange(cMap, lexer); - break; - case 'begincidrange': - parseCidRange(cMap, lexer); - break; - } - } - } - - if (!useCMap && embededUseCMap) { - // Load the usecmap definition from the file only if there wasn't one - // specified. - useCMap = embededUseCMap; - } - if (useCMap) { - extendCMap(cMap, builtInCMapParams, useCMap); - } - } - - function extendCMap(cMap, builtInCMapParams, useCMap) { - cMap.useCMap = createBuiltInCMap(useCMap, builtInCMapParams); - // If there aren't any code space ranges defined clone all the parent ones - // into this cMap. - if (cMap.numCodespaceRanges === 0) { - var useCodespaceRanges = cMap.useCMap.codespaceRanges; - for (var i = 0; i < useCodespaceRanges.length; i++) { - cMap.codespaceRanges[i] = useCodespaceRanges[i].slice(); - } - cMap.numCodespaceRanges = cMap.useCMap.numCodespaceRanges; - } - // Merge the map into the current one, making sure not to override - // any previously defined entries. - cMap.useCMap.forEach(function(key, value) { - if (!cMap.contains(key)) { - cMap.mapOne(key, cMap.useCMap.lookup(key)); - } - }); - } - - function parseBinaryCMap(name, builtInCMapParams) { - var url = builtInCMapParams.url + name + '.bcmap'; - var cMap = new CMap(true); - new BinaryCMapReader().read(url, cMap, function (useCMap) { - extendCMap(cMap, builtInCMapParams, useCMap); - }); - return cMap; - } - - function createBuiltInCMap(name, builtInCMapParams) { - if (name === 'Identity-H') { - return new IdentityCMap(false, 2); - } else if (name === 'Identity-V') { - return new IdentityCMap(true, 2); - } - if (BUILT_IN_CMAPS.indexOf(name) === -1) { - error('Unknown cMap name: ' + name); - } - assert(builtInCMapParams, 'built-in cMap parameters are not provided'); - - if (builtInCMapParams.packed) { - return parseBinaryCMap(name, builtInCMapParams); - } - - var request = new XMLHttpRequest(); - var url = builtInCMapParams.url + name; - request.open('GET', url, false); - request.send(null); - if (!request.responseText) { - error('Unable to get cMap at: ' + url); - } - var cMap = new CMap(true); - var lexer = new Lexer(new StringStream(request.responseText)); - parseCMap(cMap, lexer, builtInCMapParams, null); - return cMap; - } - - return { - create: function (encoding, builtInCMapParams, useCMap) { - if (isName(encoding)) { - return createBuiltInCMap(encoding.name, builtInCMapParams); - } else if (isStream(encoding)) { - var cMap = new CMap(); - var lexer = new Lexer(encoding); - try { - parseCMap(cMap, lexer, builtInCMapParams, useCMap); - } catch (e) { - warn('Invalid CMap data. ' + e); - } - if (cMap.isIdentityCMap) { - return createBuiltInCMap(cMap.name, builtInCMapParams); - } - return cMap; - } - error('Encoding required.'); - } - }; -})(); - - -// Unicode Private Use Area -var PRIVATE_USE_OFFSET_START = 0xE000; -var PRIVATE_USE_OFFSET_END = 0xF8FF; -var SKIP_PRIVATE_USE_RANGE_F000_TO_F01F = false; - -// PDF Glyph Space Units are one Thousandth of a TextSpace Unit -// except for Type 3 fonts -var PDF_GLYPH_SPACE_UNITS = 1000; - -// Hinting is currently disabled due to unknown problems on windows -// in tracemonkey and various other pdfs with type1 fonts. -var HINTING_ENABLED = false; - -// Accented charactars are not displayed properly on windows, using this flag -// to control analysis of seac charstrings. -var SEAC_ANALYSIS_ENABLED = false; - -var FontFlags = { - FixedPitch: 1, - Serif: 2, - Symbolic: 4, - Script: 8, - Nonsymbolic: 32, - Italic: 64, - AllCap: 65536, - SmallCap: 131072, - ForceBold: 262144 -}; - -var Encodings = { - ExpertEncoding: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclamsmall', 'Hungarumlautsmall', '', 'dollaroldstyle', - 'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior', - 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', - 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', - 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', - 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'colon', - 'semicolon', 'commasuperior', 'threequartersemdash', 'periodsuperior', - 'questionsmall', '', 'asuperior', 'bsuperior', 'centsuperior', 'dsuperior', - 'esuperior', '', '', 'isuperior', '', '', 'lsuperior', 'msuperior', - 'nsuperior', 'osuperior', '', '', 'rsuperior', 'ssuperior', 'tsuperior', - '', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', '', - 'parenrightinferior', 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', - 'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', - 'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', - 'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', - 'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', - 'onefitted', 'rupiah', 'Tildesmall', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', 'exclamdownsmall', 'centoldstyle', 'Lslashsmall', - '', '', 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', 'Brevesmall', - 'Caronsmall', '', 'Dotaccentsmall', '', '', 'Macronsmall', '', '', - 'figuredash', 'hypheninferior', '', '', 'Ogoneksmall', 'Ringsmall', - 'Cedillasmall', '', '', '', 'onequarter', 'onehalf', 'threequarters', - 'questiondownsmall', 'oneeighth', 'threeeighths', 'fiveeighths', - 'seveneighths', 'onethird', 'twothirds', '', '', 'zerosuperior', - 'onesuperior', 'twosuperior', 'threesuperior', 'foursuperior', - 'fivesuperior', 'sixsuperior', 'sevensuperior', 'eightsuperior', - 'ninesuperior', 'zeroinferior', 'oneinferior', 'twoinferior', - 'threeinferior', 'fourinferior', 'fiveinferior', 'sixinferior', - 'seveninferior', 'eightinferior', 'nineinferior', 'centinferior', - 'dollarinferior', 'periodinferior', 'commainferior', 'Agravesmall', - 'Aacutesmall', 'Acircumflexsmall', 'Atildesmall', 'Adieresissmall', - 'Aringsmall', 'AEsmall', 'Ccedillasmall', 'Egravesmall', 'Eacutesmall', - 'Ecircumflexsmall', 'Edieresissmall', 'Igravesmall', 'Iacutesmall', - 'Icircumflexsmall', 'Idieresissmall', 'Ethsmall', 'Ntildesmall', - 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', 'Otildesmall', - 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', 'Uacutesmall', - 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', 'Thornsmall', - 'Ydieresissmall'], - MacExpertEncoding: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclamsmall', 'Hungarumlautsmall', 'centoldstyle', - 'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', 'Acutesmall', - 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', - 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', 'zerooldstyle', - 'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle', - 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', - 'nineoldstyle', 'colon', 'semicolon', '', 'threequartersemdash', '', - 'questionsmall', '', '', '', '', 'Ethsmall', '', '', 'onequarter', - 'onehalf', 'threequarters', 'oneeighth', 'threeeighths', 'fiveeighths', - 'seveneighths', 'onethird', 'twothirds', '', '', '', '', '', '', 'ff', - 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', '', 'parenrightinferior', - 'Circumflexsmall', 'hypheninferior', 'Gravesmall', 'Asmall', 'Bsmall', - 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall', - 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall', - 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall', - 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah', - 'Tildesmall', '', '', 'asuperior', 'centsuperior', '', '', '', '', - 'Aacutesmall', 'Agravesmall', 'Acircumflexsmall', 'Adieresissmall', - 'Atildesmall', 'Aringsmall', 'Ccedillasmall', 'Eacutesmall', 'Egravesmall', - 'Ecircumflexsmall', 'Edieresissmall', 'Iacutesmall', 'Igravesmall', - 'Icircumflexsmall', 'Idieresissmall', 'Ntildesmall', 'Oacutesmall', - 'Ogravesmall', 'Ocircumflexsmall', 'Odieresissmall', 'Otildesmall', - 'Uacutesmall', 'Ugravesmall', 'Ucircumflexsmall', 'Udieresissmall', '', - 'eightsuperior', 'fourinferior', 'threeinferior', 'sixinferior', - 'eightinferior', 'seveninferior', 'Scaronsmall', '', 'centinferior', - 'twoinferior', '', 'Dieresissmall', '', 'Caronsmall', 'osuperior', - 'fiveinferior', '', 'commainferior', 'periodinferior', 'Yacutesmall', '', - 'dollarinferior', '', 'Thornsmall', '', 'nineinferior', 'zeroinferior', - 'Zcaronsmall', 'AEsmall', 'Oslashsmall', 'questiondownsmall', - 'oneinferior', 'Lslashsmall', '', '', '', '', '', '', 'Cedillasmall', '', - '', '', '', '', 'OEsmall', 'figuredash', 'hyphensuperior', '', '', '', '', - 'exclamdownsmall', '', 'Ydieresissmall', '', 'onesuperior', 'twosuperior', - 'threesuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', - 'sevensuperior', 'ninesuperior', 'zerosuperior', '', 'esuperior', - 'rsuperior', 'tsuperior', '', '', 'isuperior', 'ssuperior', 'dsuperior', - '', '', '', '', '', 'lsuperior', 'Ogoneksmall', 'Brevesmall', - 'Macronsmall', 'bsuperior', 'nsuperior', 'msuperior', 'commasuperior', - 'periodsuperior', 'Dotaccentsmall', 'Ringsmall'], - MacRomanEncoding: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', - 'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus', - 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', - 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', - 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', - 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', - 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', - 'asciicircum', 'underscore', 'grave', 'a', 'b', 'c', 'd', 'e', 'f', 'g', - 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', - 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', '', - 'Adieresis', 'Aring', 'Ccedilla', 'Eacute', 'Ntilde', 'Odieresis', - 'Udieresis', 'aacute', 'agrave', 'acircumflex', 'adieresis', 'atilde', - 'aring', 'ccedilla', 'eacute', 'egrave', 'ecircumflex', 'edieresis', - 'iacute', 'igrave', 'icircumflex', 'idieresis', 'ntilde', 'oacute', - 'ograve', 'ocircumflex', 'odieresis', 'otilde', 'uacute', 'ugrave', - 'ucircumflex', 'udieresis', 'dagger', 'degree', 'cent', 'sterling', - 'section', 'bullet', 'paragraph', 'germandbls', 'registered', 'copyright', - 'trademark', 'acute', 'dieresis', 'notequal', 'AE', 'Oslash', 'infinity', - 'plusminus', 'lessequal', 'greaterequal', 'yen', 'mu', 'partialdiff', - 'summation', 'product', 'pi', 'integral', 'ordfeminine', 'ordmasculine', - 'Omega', 'ae', 'oslash', 'questiondown', 'exclamdown', 'logicalnot', - 'radical', 'florin', 'approxequal', 'Delta', 'guillemotleft', - 'guillemotright', 'ellipsis', 'space', 'Agrave', 'Atilde', 'Otilde', 'OE', - 'oe', 'endash', 'emdash', 'quotedblleft', 'quotedblright', 'quoteleft', - 'quoteright', 'divide', 'lozenge', 'ydieresis', 'Ydieresis', 'fraction', - 'currency', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'daggerdbl', - 'periodcentered', 'quotesinglbase', 'quotedblbase', 'perthousand', - 'Acircumflex', 'Ecircumflex', 'Aacute', 'Edieresis', 'Egrave', 'Iacute', - 'Icircumflex', 'Idieresis', 'Igrave', 'Oacute', 'Ocircumflex', 'apple', - 'Ograve', 'Uacute', 'Ucircumflex', 'Ugrave', 'dotlessi', 'circumflex', - 'tilde', 'macron', 'breve', 'dotaccent', 'ring', 'cedilla', 'hungarumlaut', - 'ogonek', 'caron'], - StandardEncoding: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', - 'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus', - 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', - 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', - 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', - 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', - 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', - 'asciicircum', 'underscore', 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f', - 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', - 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'exclamdown', - 'cent', 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', - 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', - 'guilsinglright', 'fi', 'fl', '', 'endash', 'dagger', 'daggerdbl', - 'periodcentered', '', 'paragraph', 'bullet', 'quotesinglbase', - 'quotedblbase', 'quotedblright', 'guillemotright', 'ellipsis', - 'perthousand', '', 'questiondown', '', 'grave', 'acute', 'circumflex', - 'tilde', 'macron', 'breve', 'dotaccent', 'dieresis', '', 'ring', 'cedilla', - '', 'hungarumlaut', 'ogonek', 'caron', 'emdash', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', 'AE', '', 'ordfeminine', '', '', - '', '', 'Lslash', 'Oslash', 'OE', 'ordmasculine', '', '', '', '', '', 'ae', - '', '', '', 'dotlessi', '', '', 'lslash', 'oslash', 'oe', 'germandbls'], - WinAnsiEncoding: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', - 'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus', - 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', - 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', - 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', - 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', - 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', - 'asciicircum', 'underscore', 'grave', 'a', 'b', 'c', 'd', 'e', 'f', 'g', - 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', - 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', - 'bullet', 'Euro', 'bullet', 'quotesinglbase', 'florin', 'quotedblbase', - 'ellipsis', 'dagger', 'daggerdbl', 'circumflex', 'perthousand', 'Scaron', - 'guilsinglleft', 'OE', 'bullet', 'Zcaron', 'bullet', 'bullet', 'quoteleft', - 'quoteright', 'quotedblleft', 'quotedblright', 'bullet', 'endash', - 'emdash', 'tilde', 'trademark', 'scaron', 'guilsinglright', 'oe', 'bullet', - 'zcaron', 'Ydieresis', 'space', 'exclamdown', 'cent', 'sterling', - 'currency', 'yen', 'brokenbar', 'section', 'dieresis', 'copyright', - 'ordfeminine', 'guillemotleft', 'logicalnot', 'hyphen', 'registered', - 'macron', 'degree', 'plusminus', 'twosuperior', 'threesuperior', 'acute', - 'mu', 'paragraph', 'periodcentered', 'cedilla', 'onesuperior', - 'ordmasculine', 'guillemotright', 'onequarter', 'onehalf', 'threequarters', - 'questiondown', 'Agrave', 'Aacute', 'Acircumflex', 'Atilde', 'Adieresis', - 'Aring', 'AE', 'Ccedilla', 'Egrave', 'Eacute', 'Ecircumflex', 'Edieresis', - 'Igrave', 'Iacute', 'Icircumflex', 'Idieresis', 'Eth', 'Ntilde', 'Ograve', - 'Oacute', 'Ocircumflex', 'Otilde', 'Odieresis', 'multiply', 'Oslash', - 'Ugrave', 'Uacute', 'Ucircumflex', 'Udieresis', 'Yacute', 'Thorn', - 'germandbls', 'agrave', 'aacute', 'acircumflex', 'atilde', 'adieresis', - 'aring', 'ae', 'ccedilla', 'egrave', 'eacute', 'ecircumflex', 'edieresis', - 'igrave', 'iacute', 'icircumflex', 'idieresis', 'eth', 'ntilde', 'ograve', - 'oacute', 'ocircumflex', 'otilde', 'odieresis', 'divide', 'oslash', - 'ugrave', 'uacute', 'ucircumflex', 'udieresis', 'yacute', 'thorn', - 'ydieresis'], - SymbolSetEncoding: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclam', 'universal', 'numbersign', 'existential', 'percent', - 'ampersand', 'suchthat', 'parenleft', 'parenright', 'asteriskmath', 'plus', - 'comma', 'minus', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', - 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', - 'equal', 'greater', 'question', 'congruent', 'Alpha', 'Beta', 'Chi', - 'Delta', 'Epsilon', 'Phi', 'Gamma', 'Eta', 'Iota', 'theta1', 'Kappa', - 'Lambda', 'Mu', 'Nu', 'Omicron', 'Pi', 'Theta', 'Rho', 'Sigma', 'Tau', - 'Upsilon', 'sigma1', 'Omega', 'Xi', 'Psi', 'Zeta', 'bracketleft', - 'therefore', 'bracketright', 'perpendicular', 'underscore', 'radicalex', - 'alpha', 'beta', 'chi', 'delta', 'epsilon', 'phi', 'gamma', 'eta', 'iota', - 'phi1', 'kappa', 'lambda', 'mu', 'nu', 'omicron', 'pi', 'theta', 'rho', - 'sigma', 'tau', 'upsilon', 'omega1', 'omega', 'xi', 'psi', 'zeta', - 'braceleft', 'bar', 'braceright', 'similar', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', 'Euro', 'Upsilon1', 'minute', 'lessequal', - 'fraction', 'infinity', 'florin', 'club', 'diamond', 'heart', 'spade', - 'arrowboth', 'arrowleft', 'arrowup', 'arrowright', 'arrowdown', 'degree', - 'plusminus', 'second', 'greaterequal', 'multiply', 'proportional', - 'partialdiff', 'bullet', 'divide', 'notequal', 'equivalence', - 'approxequal', 'ellipsis', 'arrowvertex', 'arrowhorizex', 'carriagereturn', - 'aleph', 'Ifraktur', 'Rfraktur', 'weierstrass', 'circlemultiply', - 'circleplus', 'emptyset', 'intersection', 'union', 'propersuperset', - 'reflexsuperset', 'notsubset', 'propersubset', 'reflexsubset', 'element', - 'notelement', 'angle', 'gradient', 'registerserif', 'copyrightserif', - 'trademarkserif', 'product', 'radical', 'dotmath', 'logicalnot', - 'logicaland', 'logicalor', 'arrowdblboth', 'arrowdblleft', 'arrowdblup', - 'arrowdblright', 'arrowdbldown', 'lozenge', 'angleleft', 'registersans', - 'copyrightsans', 'trademarksans', 'summation', 'parenlefttp', - 'parenleftex', 'parenleftbt', 'bracketlefttp', 'bracketleftex', - 'bracketleftbt', 'bracelefttp', 'braceleftmid', 'braceleftbt', 'braceex', - '', 'angleright', 'integral', 'integraltp', 'integralex', 'integralbt', - 'parenrighttp', 'parenrightex', 'parenrightbt', 'bracketrighttp', - 'bracketrightex', 'bracketrightbt', 'bracerighttp', 'bracerightmid', - 'bracerightbt'], - ZapfDingbatsEncoding: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'a1', 'a2', 'a202', 'a3', 'a4', 'a5', 'a119', 'a118', 'a117', - 'a11', 'a12', 'a13', 'a14', 'a15', 'a16', 'a105', 'a17', 'a18', 'a19', - 'a20', 'a21', 'a22', 'a23', 'a24', 'a25', 'a26', 'a27', 'a28', 'a6', 'a7', - 'a8', 'a9', 'a10', 'a29', 'a30', 'a31', 'a32', 'a33', 'a34', 'a35', 'a36', - 'a37', 'a38', 'a39', 'a40', 'a41', 'a42', 'a43', 'a44', 'a45', 'a46', - 'a47', 'a48', 'a49', 'a50', 'a51', 'a52', 'a53', 'a54', 'a55', 'a56', - 'a57', 'a58', 'a59', 'a60', 'a61', 'a62', 'a63', 'a64', 'a65', 'a66', - 'a67', 'a68', 'a69', 'a70', 'a71', 'a72', 'a73', 'a74', 'a203', 'a75', - 'a204', 'a76', 'a77', 'a78', 'a79', 'a81', 'a82', 'a83', 'a84', 'a97', - 'a98', 'a99', 'a100', '', 'a89', 'a90', 'a93', 'a94', 'a91', 'a92', 'a205', - 'a85', 'a206', 'a86', 'a87', 'a88', 'a95', 'a96', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', 'a101', 'a102', 'a103', - 'a104', 'a106', 'a107', 'a108', 'a112', 'a111', 'a110', 'a109', 'a120', - 'a121', 'a122', 'a123', 'a124', 'a125', 'a126', 'a127', 'a128', 'a129', - 'a130', 'a131', 'a132', 'a133', 'a134', 'a135', 'a136', 'a137', 'a138', - 'a139', 'a140', 'a141', 'a142', 'a143', 'a144', 'a145', 'a146', 'a147', - 'a148', 'a149', 'a150', 'a151', 'a152', 'a153', 'a154', 'a155', 'a156', - 'a157', 'a158', 'a159', 'a160', 'a161', 'a163', 'a164', 'a196', 'a165', - 'a192', 'a166', 'a167', 'a168', 'a169', 'a170', 'a171', 'a172', 'a173', - 'a162', 'a174', 'a175', 'a176', 'a177', 'a178', 'a179', 'a193', 'a180', - 'a199', 'a181', 'a200', 'a182', '', 'a201', 'a183', 'a184', 'a197', 'a185', - 'a194', 'a198', 'a186', 'a195', 'a187', 'a188', 'a189', 'a190', 'a191'] -}; - -/** - * Hold a map of decoded fonts and of the standard fourteen Type1 - * fonts and their acronyms. - */ -var stdFontMap = { - 'ArialNarrow': 'Helvetica', - 'ArialNarrow-Bold': 'Helvetica-Bold', - 'ArialNarrow-BoldItalic': 'Helvetica-BoldOblique', - 'ArialNarrow-Italic': 'Helvetica-Oblique', - 'ArialBlack': 'Helvetica', - 'ArialBlack-Bold': 'Helvetica-Bold', - 'ArialBlack-BoldItalic': 'Helvetica-BoldOblique', - 'ArialBlack-Italic': 'Helvetica-Oblique', - 'Arial': 'Helvetica', - 'Arial-Bold': 'Helvetica-Bold', - 'Arial-BoldItalic': 'Helvetica-BoldOblique', - 'Arial-Italic': 'Helvetica-Oblique', - 'Arial-BoldItalicMT': 'Helvetica-BoldOblique', - 'Arial-BoldMT': 'Helvetica-Bold', - 'Arial-ItalicMT': 'Helvetica-Oblique', - 'ArialMT': 'Helvetica', - 'Courier-Bold': 'Courier-Bold', - 'Courier-BoldItalic': 'Courier-BoldOblique', - 'Courier-Italic': 'Courier-Oblique', - 'CourierNew': 'Courier', - 'CourierNew-Bold': 'Courier-Bold', - 'CourierNew-BoldItalic': 'Courier-BoldOblique', - 'CourierNew-Italic': 'Courier-Oblique', - 'CourierNewPS-BoldItalicMT': 'Courier-BoldOblique', - 'CourierNewPS-BoldMT': 'Courier-Bold', - 'CourierNewPS-ItalicMT': 'Courier-Oblique', - 'CourierNewPSMT': 'Courier', - 'Helvetica': 'Helvetica', - 'Helvetica-Bold': 'Helvetica-Bold', - 'Helvetica-BoldItalic': 'Helvetica-BoldOblique', - 'Helvetica-BoldOblique': 'Helvetica-BoldOblique', - 'Helvetica-Italic': 'Helvetica-Oblique', - 'Helvetica-Oblique':'Helvetica-Oblique', - 'Symbol-Bold': 'Symbol', - 'Symbol-BoldItalic': 'Symbol', - 'Symbol-Italic': 'Symbol', - 'TimesNewRoman': 'Times-Roman', - 'TimesNewRoman-Bold': 'Times-Bold', - 'TimesNewRoman-BoldItalic': 'Times-BoldItalic', - 'TimesNewRoman-Italic': 'Times-Italic', - 'TimesNewRomanPS': 'Times-Roman', - 'TimesNewRomanPS-Bold': 'Times-Bold', - 'TimesNewRomanPS-BoldItalic': 'Times-BoldItalic', - 'TimesNewRomanPS-BoldItalicMT': 'Times-BoldItalic', - 'TimesNewRomanPS-BoldMT': 'Times-Bold', - 'TimesNewRomanPS-Italic': 'Times-Italic', - 'TimesNewRomanPS-ItalicMT': 'Times-Italic', - 'TimesNewRomanPSMT': 'Times-Roman', - 'TimesNewRomanPSMT-Bold': 'Times-Bold', - 'TimesNewRomanPSMT-BoldItalic': 'Times-BoldItalic', - 'TimesNewRomanPSMT-Italic': 'Times-Italic' -}; - -/** - * Holds the map of the non-standard fonts that might be included as a standard - * fonts without glyph data. - */ -var nonStdFontMap = { - 'CenturyGothic': 'Helvetica', - 'CenturyGothic-Bold': 'Helvetica-Bold', - 'CenturyGothic-BoldItalic': 'Helvetica-BoldOblique', - 'CenturyGothic-Italic': 'Helvetica-Oblique', - 'ComicSansMS': 'Comic Sans MS', - 'ComicSansMS-Bold': 'Comic Sans MS-Bold', - 'ComicSansMS-BoldItalic': 'Comic Sans MS-BoldItalic', - 'ComicSansMS-Italic': 'Comic Sans MS-Italic', - 'LucidaConsole': 'Courier', - 'LucidaConsole-Bold': 'Courier-Bold', - 'LucidaConsole-BoldItalic': 'Courier-BoldOblique', - 'LucidaConsole-Italic': 'Courier-Oblique', - 'MS-Gothic': 'MS Gothic', - 'MS-Gothic-Bold': 'MS Gothic-Bold', - 'MS-Gothic-BoldItalic': 'MS Gothic-BoldItalic', - 'MS-Gothic-Italic': 'MS Gothic-Italic', - 'MS-Mincho': 'MS Mincho', - 'MS-Mincho-Bold': 'MS Mincho-Bold', - 'MS-Mincho-BoldItalic': 'MS Mincho-BoldItalic', - 'MS-Mincho-Italic': 'MS Mincho-Italic', - 'MS-PGothic': 'MS PGothic', - 'MS-PGothic-Bold': 'MS PGothic-Bold', - 'MS-PGothic-BoldItalic': 'MS PGothic-BoldItalic', - 'MS-PGothic-Italic': 'MS PGothic-Italic', - 'MS-PMincho': 'MS PMincho', - 'MS-PMincho-Bold': 'MS PMincho-Bold', - 'MS-PMincho-BoldItalic': 'MS PMincho-BoldItalic', - 'MS-PMincho-Italic': 'MS PMincho-Italic', - 'Wingdings': 'ZapfDingbats' -}; - -var serifFonts = { - 'Adobe Jenson': true, 'Adobe Text': true, 'Albertus': true, - 'Aldus': true, 'Alexandria': true, 'Algerian': true, - 'American Typewriter': true, 'Antiqua': true, 'Apex': true, - 'Arno': true, 'Aster': true, 'Aurora': true, - 'Baskerville': true, 'Bell': true, 'Bembo': true, - 'Bembo Schoolbook': true, 'Benguiat': true, 'Berkeley Old Style': true, - 'Bernhard Modern': true, 'Berthold City': true, 'Bodoni': true, - 'Bauer Bodoni': true, 'Book Antiqua': true, 'Bookman': true, - 'Bordeaux Roman': true, 'Californian FB': true, 'Calisto': true, - 'Calvert': true, 'Capitals': true, 'Cambria': true, - 'Cartier': true, 'Caslon': true, 'Catull': true, - 'Centaur': true, 'Century Old Style': true, 'Century Schoolbook': true, - 'Chaparral': true, 'Charis SIL': true, 'Cheltenham': true, - 'Cholla Slab': true, 'Clarendon': true, 'Clearface': true, - 'Cochin': true, 'Colonna': true, 'Computer Modern': true, - 'Concrete Roman': true, 'Constantia': true, 'Cooper Black': true, - 'Corona': true, 'Ecotype': true, 'Egyptienne': true, - 'Elephant': true, 'Excelsior': true, 'Fairfield': true, - 'FF Scala': true, 'Folkard': true, 'Footlight': true, - 'FreeSerif': true, 'Friz Quadrata': true, 'Garamond': true, - 'Gentium': true, 'Georgia': true, 'Gloucester': true, - 'Goudy Old Style': true, 'Goudy Schoolbook': true, 'Goudy Pro Font': true, - 'Granjon': true, 'Guardian Egyptian': true, 'Heather': true, - 'Hercules': true, 'High Tower Text': true, 'Hiroshige': true, - 'Hoefler Text': true, 'Humana Serif': true, 'Imprint': true, - 'Ionic No. 5': true, 'Janson': true, 'Joanna': true, - 'Korinna': true, 'Lexicon': true, 'Liberation Serif': true, - 'Linux Libertine': true, 'Literaturnaya': true, 'Lucida': true, - 'Lucida Bright': true, 'Melior': true, 'Memphis': true, - 'Miller': true, 'Minion': true, 'Modern': true, - 'Mona Lisa': true, 'Mrs Eaves': true, 'MS Serif': true, - 'Museo Slab': true, 'New York': true, 'Nimbus Roman': true, - 'NPS Rawlinson Roadway': true, 'Palatino': true, 'Perpetua': true, - 'Plantin': true, 'Plantin Schoolbook': true, 'Playbill': true, - 'Poor Richard': true, 'Rawlinson Roadway': true, 'Renault': true, - 'Requiem': true, 'Rockwell': true, 'Roman': true, - 'Rotis Serif': true, 'Sabon': true, 'Scala': true, - 'Seagull': true, 'Sistina': true, 'Souvenir': true, - 'STIX': true, 'Stone Informal': true, 'Stone Serif': true, - 'Sylfaen': true, 'Times': true, 'Trajan': true, - 'Trinité': true, 'Trump Mediaeval': true, 'Utopia': true, - 'Vale Type': true, 'Bitstream Vera': true, 'Vera Serif': true, - 'Versailles': true, 'Wanted': true, 'Weiss': true, - 'Wide Latin': true, 'Windsor': true, 'XITS': true -}; - -var symbolsFonts = { - 'Dingbats': true, 'Symbol': true, 'ZapfDingbats': true -}; - -// Glyph map for well-known standard fonts. Sometimes Ghostscript uses CID fonts -// but does not embed the CID to GID mapping. The mapping is incomplete for all -// glyphs, but common for some set of the standard fonts. -var GlyphMapForStandardFonts = { - '2': 10, '3': 32, '4': 33, '5': 34, '6': 35, '7': 36, '8': 37, '9': 38, - '10': 39, '11': 40, '12': 41, '13': 42, '14': 43, '15': 44, '16': 45, - '17': 46, '18': 47, '19': 48, '20': 49, '21': 50, '22': 51, '23': 52, - '24': 53, '25': 54, '26': 55, '27': 56, '28': 57, '29': 58, '30': 894, - '31': 60, '32': 61, '33': 62, '34': 63, '35': 64, '36': 65, '37': 66, - '38': 67, '39': 68, '40': 69, '41': 70, '42': 71, '43': 72, '44': 73, - '45': 74, '46': 75, '47': 76, '48': 77, '49': 78, '50': 79, '51': 80, - '52': 81, '53': 82, '54': 83, '55': 84, '56': 85, '57': 86, '58': 87, - '59': 88, '60': 89, '61': 90, '62': 91, '63': 92, '64': 93, '65': 94, - '66': 95, '67': 96, '68': 97, '69': 98, '70': 99, '71': 100, '72': 101, - '73': 102, '74': 103, '75': 104, '76': 105, '77': 106, '78': 107, '79': 108, - '80': 109, '81': 110, '82': 111, '83': 112, '84': 113, '85': 114, '86': 115, - '87': 116, '88': 117, '89': 118, '90': 119, '91': 120, '92': 121, '93': 122, - '94': 123, '95': 124, '96': 125, '97': 126, '98': 196, '99': 197, '100': 199, - '101': 201, '102': 209, '103': 214, '104': 220, '105': 225, '106': 224, - '107': 226, '108': 228, '109': 227, '110': 229, '111': 231, '112': 233, - '113': 232, '114': 234, '115': 235, '116': 237, '117': 236, '118': 238, - '119': 239, '120': 241, '121': 243, '122': 242, '123': 244, '124': 246, - '125': 245, '126': 250, '127': 249, '128': 251, '129': 252, '130': 8224, - '131': 176, '132': 162, '133': 163, '134': 167, '135': 8226, '136': 182, - '137': 223, '138': 174, '139': 169, '140': 8482, '141': 180, '142': 168, - '143': 8800, '144': 198, '145': 216, '146': 8734, '147': 177, '148': 8804, - '149': 8805, '150': 165, '151': 181, '152': 8706, '153': 8721, '154': 8719, - '156': 8747, '157': 170, '158': 186, '159': 8486, '160': 230, '161': 248, - '162': 191, '163': 161, '164': 172, '165': 8730, '166': 402, '167': 8776, - '168': 8710, '169': 171, '170': 187, '171': 8230, '210': 218, '223': 711, - '224': 321, '225': 322, '227': 353, '229': 382, '234': 253, '252': 263, - '253': 268, '254': 269, '258': 258, '260': 260, '261': 261, '265': 280, - '266': 281, '268': 283, '269': 313, '275': 323, '276': 324, '278': 328, - '284': 345, '285': 346, '286': 347, '292': 367, '295': 377, '296': 378, - '298': 380, '305': 963, - '306': 964, '307': 966, '308': 8215, '309': 8252, '310': 8319, '311': 8359, - '312': 8592, '313': 8593, '337': 9552, '493': 1039, '494': 1040, '705': 1524, - '706': 8362, '710': 64288, '711': 64298, '759': 1617, '761': 1776, - '763': 1778, '775': 1652, '777': 1764, '778': 1780, '779': 1781, '780': 1782, - '782': 771, '783': 64726, '786': 8363, '788': 8532, '790': 768, '791': 769, - '792': 768, '795': 803, '797': 64336, '798': 64337, '799': 64342, - '800': 64343, '801': 64344, '802': 64345, '803': 64362, '804': 64363, - '805': 64364, '2424': 7821, '2425': 7822, '2426': 7823, '2427': 7824, - '2428': 7825, '2429': 7826, '2430': 7827, '2433': 7682, '2678': 8045, - '2679': 8046, '2830': 1552, '2838': 686, '2840': 751, '2842': 753, - '2843': 754, '2844': 755, '2846': 757, '2856': 767, '2857': 848, '2858': 849, - '2862': 853, '2863': 854, '2864': 855, '2865': 861, '2866': 862, '2906': 7460, - '2908': 7462, '2909': 7463, '2910': 7464, '2912': 7466, '2913': 7467, - '2914': 7468, '2916': 7470, '2917': 7471, '2918': 7472, '2920': 7474, - '2921': 7475, '2922': 7476, '2924': 7478, '2925': 7479, '2926': 7480, - '2928': 7482, '2929': 7483, '2930': 7484, '2932': 7486, '2933': 7487, - '2934': 7488, '2936': 7490, '2937': 7491, '2938': 7492, '2940': 7494, - '2941': 7495, '2942': 7496, '2944': 7498, '2946': 7500, '2948': 7502, - '2950': 7504, '2951': 7505, '2952': 7506, '2954': 7508, '2955': 7509, - '2956': 7510, '2958': 7512, '2959': 7513, '2960': 7514, '2962': 7516, - '2963': 7517, '2964': 7518, '2966': 7520, '2967': 7521, '2968': 7522, - '2970': 7524, '2971': 7525, '2972': 7526, '2974': 7528, '2975': 7529, - '2976': 7530, '2978': 1537, '2979': 1538, '2980': 1539, '2982': 1549, - '2983': 1551, '2984': 1552, '2986': 1554, '2987': 1555, '2988': 1556, - '2990': 1623, '2991': 1624, '2995': 1775, '2999': 1791, '3002': 64290, - '3003': 64291, '3004': 64292, '3006': 64294, '3007': 64295, '3008': 64296, - '3011': 1900, '3014': 8223, '3015': 8244, '3017': 7532, '3018': 7533, - '3019': 7534, '3075': 7590, '3076': 7591, '3079': 7594, '3080': 7595, - '3083': 7598, '3084': 7599, '3087': 7602, '3088': 7603, '3091': 7606, - '3092': 7607, '3095': 7610, '3096': 7611, '3099': 7614, '3100': 7615, - '3103': 7618, '3104': 7619, '3107': 8337, '3108': 8338, '3116': 1884, - '3119': 1885, '3120': 1885, '3123': 1886, '3124': 1886, '3127': 1887, - '3128': 1887, '3131': 1888, '3132': 1888, '3135': 1889, '3136': 1889, - '3139': 1890, '3140': 1890, '3143': 1891, '3144': 1891, '3147': 1892, - '3148': 1892, '3153': 580, '3154': 581, '3157': 584, '3158': 585, '3161': 588, - '3162': 589, '3165': 891, '3166': 892, '3169': 1274, '3170': 1275, - '3173': 1278, '3174': 1279, '3181': 7622, '3182': 7623, '3282': 11799, - '3316': 578, '3379': 42785, '3393': 1159, '3416': 8377 -}; - -// The glyph map for ArialBlack differs slightly from the glyph map used for -// other well-known standard fonts. Hence we use this (incomplete) CID to GID -// mapping to adjust the glyph map for non-embedded ArialBlack fonts. -var SupplementalGlyphMapForArialBlack = { - '227': 322, '264': 261, '291': 346, -}; - -// Some characters, e.g. copyrightserif, are mapped to the private use area and -// might not be displayed using standard fonts. Mapping/hacking well-known chars -// to the similar equivalents in the normal characters range. -var SpecialPUASymbols = { - '63721': 0x00A9, // copyrightsans (0xF8E9) => copyright - '63193': 0x00A9, // copyrightserif (0xF6D9) => copyright - '63720': 0x00AE, // registersans (0xF8E8) => registered - '63194': 0x00AE, // registerserif (0xF6DA) => registered - '63722': 0x2122, // trademarksans (0xF8EA) => trademark - '63195': 0x2122, // trademarkserif (0xF6DB) => trademark - '63729': 0x23A7, // bracelefttp (0xF8F1) - '63730': 0x23A8, // braceleftmid (0xF8F2) - '63731': 0x23A9, // braceleftbt (0xF8F3) - '63740': 0x23AB, // bracerighttp (0xF8FC) - '63741': 0x23AC, // bracerightmid (0xF8FD) - '63742': 0x23AD, // bracerightbt (0xF8FE) - '63726': 0x23A1, // bracketlefttp (0xF8EE) - '63727': 0x23A2, // bracketleftex (0xF8EF) - '63728': 0x23A3, // bracketleftbt (0xF8F0) - '63737': 0x23A4, // bracketrighttp (0xF8F9) - '63738': 0x23A5, // bracketrightex (0xF8FA) - '63739': 0x23A6, // bracketrightbt (0xF8FB) - '63723': 0x239B, // parenlefttp (0xF8EB) - '63724': 0x239C, // parenleftex (0xF8EC) - '63725': 0x239D, // parenleftbt (0xF8ED) - '63734': 0x239E, // parenrighttp (0xF8F6) - '63735': 0x239F, // parenrightex (0xF8F7) - '63736': 0x23A0, // parenrightbt (0xF8F8) -}; -function mapSpecialUnicodeValues(code) { - if (code >= 0xFFF0 && code <= 0xFFFF) { // Specials unicode block. - return 0; - } else if (code >= 0xF600 && code <= 0xF8FF) { - return (SpecialPUASymbols[code] || code); - } - return code; -} - -var UnicodeRanges = [ - { 'begin': 0x0000, 'end': 0x007F }, // Basic Latin - { 'begin': 0x0080, 'end': 0x00FF }, // Latin-1 Supplement - { 'begin': 0x0100, 'end': 0x017F }, // Latin Extended-A - { 'begin': 0x0180, 'end': 0x024F }, // Latin Extended-B - { 'begin': 0x0250, 'end': 0x02AF }, // IPA Extensions - { 'begin': 0x02B0, 'end': 0x02FF }, // Spacing Modifier Letters - { 'begin': 0x0300, 'end': 0x036F }, // Combining Diacritical Marks - { 'begin': 0x0370, 'end': 0x03FF }, // Greek and Coptic - { 'begin': 0x2C80, 'end': 0x2CFF }, // Coptic - { 'begin': 0x0400, 'end': 0x04FF }, // Cyrillic - { 'begin': 0x0530, 'end': 0x058F }, // Armenian - { 'begin': 0x0590, 'end': 0x05FF }, // Hebrew - { 'begin': 0xA500, 'end': 0xA63F }, // Vai - { 'begin': 0x0600, 'end': 0x06FF }, // Arabic - { 'begin': 0x07C0, 'end': 0x07FF }, // NKo - { 'begin': 0x0900, 'end': 0x097F }, // Devanagari - { 'begin': 0x0980, 'end': 0x09FF }, // Bengali - { 'begin': 0x0A00, 'end': 0x0A7F }, // Gurmukhi - { 'begin': 0x0A80, 'end': 0x0AFF }, // Gujarati - { 'begin': 0x0B00, 'end': 0x0B7F }, // Oriya - { 'begin': 0x0B80, 'end': 0x0BFF }, // Tamil - { 'begin': 0x0C00, 'end': 0x0C7F }, // Telugu - { 'begin': 0x0C80, 'end': 0x0CFF }, // Kannada - { 'begin': 0x0D00, 'end': 0x0D7F }, // Malayalam - { 'begin': 0x0E00, 'end': 0x0E7F }, // Thai - { 'begin': 0x0E80, 'end': 0x0EFF }, // Lao - { 'begin': 0x10A0, 'end': 0x10FF }, // Georgian - { 'begin': 0x1B00, 'end': 0x1B7F }, // Balinese - { 'begin': 0x1100, 'end': 0x11FF }, // Hangul Jamo - { 'begin': 0x1E00, 'end': 0x1EFF }, // Latin Extended Additional - { 'begin': 0x1F00, 'end': 0x1FFF }, // Greek Extended - { 'begin': 0x2000, 'end': 0x206F }, // General Punctuation - { 'begin': 0x2070, 'end': 0x209F }, // Superscripts And Subscripts - { 'begin': 0x20A0, 'end': 0x20CF }, // Currency Symbol - { 'begin': 0x20D0, 'end': 0x20FF }, // Combining Diacritical Marks For Symbols - { 'begin': 0x2100, 'end': 0x214F }, // Letterlike Symbols - { 'begin': 0x2150, 'end': 0x218F }, // Number Forms - { 'begin': 0x2190, 'end': 0x21FF }, // Arrows - { 'begin': 0x2200, 'end': 0x22FF }, // Mathematical Operators - { 'begin': 0x2300, 'end': 0x23FF }, // Miscellaneous Technical - { 'begin': 0x2400, 'end': 0x243F }, // Control Pictures - { 'begin': 0x2440, 'end': 0x245F }, // Optical Character Recognition - { 'begin': 0x2460, 'end': 0x24FF }, // Enclosed Alphanumerics - { 'begin': 0x2500, 'end': 0x257F }, // Box Drawing - { 'begin': 0x2580, 'end': 0x259F }, // Block Elements - { 'begin': 0x25A0, 'end': 0x25FF }, // Geometric Shapes - { 'begin': 0x2600, 'end': 0x26FF }, // Miscellaneous Symbols - { 'begin': 0x2700, 'end': 0x27BF }, // Dingbats - { 'begin': 0x3000, 'end': 0x303F }, // CJK Symbols And Punctuation - { 'begin': 0x3040, 'end': 0x309F }, // Hiragana - { 'begin': 0x30A0, 'end': 0x30FF }, // Katakana - { 'begin': 0x3100, 'end': 0x312F }, // Bopomofo - { 'begin': 0x3130, 'end': 0x318F }, // Hangul Compatibility Jamo - { 'begin': 0xA840, 'end': 0xA87F }, // Phags-pa - { 'begin': 0x3200, 'end': 0x32FF }, // Enclosed CJK Letters And Months - { 'begin': 0x3300, 'end': 0x33FF }, // CJK Compatibility - { 'begin': 0xAC00, 'end': 0xD7AF }, // Hangul Syllables - { 'begin': 0xD800, 'end': 0xDFFF }, // Non-Plane 0 * - { 'begin': 0x10900, 'end': 0x1091F }, // Phoenicia - { 'begin': 0x4E00, 'end': 0x9FFF }, // CJK Unified Ideographs - { 'begin': 0xE000, 'end': 0xF8FF }, // Private Use Area (plane 0) - { 'begin': 0x31C0, 'end': 0x31EF }, // CJK Strokes - { 'begin': 0xFB00, 'end': 0xFB4F }, // Alphabetic Presentation Forms - { 'begin': 0xFB50, 'end': 0xFDFF }, // Arabic Presentation Forms-A - { 'begin': 0xFE20, 'end': 0xFE2F }, // Combining Half Marks - { 'begin': 0xFE10, 'end': 0xFE1F }, // Vertical Forms - { 'begin': 0xFE50, 'end': 0xFE6F }, // Small Form Variants - { 'begin': 0xFE70, 'end': 0xFEFF }, // Arabic Presentation Forms-B - { 'begin': 0xFF00, 'end': 0xFFEF }, // Halfwidth And Fullwidth Forms - { 'begin': 0xFFF0, 'end': 0xFFFF }, // Specials - { 'begin': 0x0F00, 'end': 0x0FFF }, // Tibetan - { 'begin': 0x0700, 'end': 0x074F }, // Syriac - { 'begin': 0x0780, 'end': 0x07BF }, // Thaana - { 'begin': 0x0D80, 'end': 0x0DFF }, // Sinhala - { 'begin': 0x1000, 'end': 0x109F }, // Myanmar - { 'begin': 0x1200, 'end': 0x137F }, // Ethiopic - { 'begin': 0x13A0, 'end': 0x13FF }, // Cherokee - { 'begin': 0x1400, 'end': 0x167F }, // Unified Canadian Aboriginal Syllabics - { 'begin': 0x1680, 'end': 0x169F }, // Ogham - { 'begin': 0x16A0, 'end': 0x16FF }, // Runic - { 'begin': 0x1780, 'end': 0x17FF }, // Khmer - { 'begin': 0x1800, 'end': 0x18AF }, // Mongolian - { 'begin': 0x2800, 'end': 0x28FF }, // Braille Patterns - { 'begin': 0xA000, 'end': 0xA48F }, // Yi Syllables - { 'begin': 0x1700, 'end': 0x171F }, // Tagalog - { 'begin': 0x10300, 'end': 0x1032F }, // Old Italic - { 'begin': 0x10330, 'end': 0x1034F }, // Gothic - { 'begin': 0x10400, 'end': 0x1044F }, // Deseret - { 'begin': 0x1D000, 'end': 0x1D0FF }, // Byzantine Musical Symbols - { 'begin': 0x1D400, 'end': 0x1D7FF }, // Mathematical Alphanumeric Symbols - { 'begin': 0xFF000, 'end': 0xFFFFD }, // Private Use (plane 15) - { 'begin': 0xFE00, 'end': 0xFE0F }, // Variation Selectors - { 'begin': 0xE0000, 'end': 0xE007F }, // Tags - { 'begin': 0x1900, 'end': 0x194F }, // Limbu - { 'begin': 0x1950, 'end': 0x197F }, // Tai Le - { 'begin': 0x1980, 'end': 0x19DF }, // New Tai Lue - { 'begin': 0x1A00, 'end': 0x1A1F }, // Buginese - { 'begin': 0x2C00, 'end': 0x2C5F }, // Glagolitic - { 'begin': 0x2D30, 'end': 0x2D7F }, // Tifinagh - { 'begin': 0x4DC0, 'end': 0x4DFF }, // Yijing Hexagram Symbols - { 'begin': 0xA800, 'end': 0xA82F }, // Syloti Nagri - { 'begin': 0x10000, 'end': 0x1007F }, // Linear B Syllabary - { 'begin': 0x10140, 'end': 0x1018F }, // Ancient Greek Numbers - { 'begin': 0x10380, 'end': 0x1039F }, // Ugaritic - { 'begin': 0x103A0, 'end': 0x103DF }, // Old Persian - { 'begin': 0x10450, 'end': 0x1047F }, // Shavian - { 'begin': 0x10480, 'end': 0x104AF }, // Osmanya - { 'begin': 0x10800, 'end': 0x1083F }, // Cypriot Syllabary - { 'begin': 0x10A00, 'end': 0x10A5F }, // Kharoshthi - { 'begin': 0x1D300, 'end': 0x1D35F }, // Tai Xuan Jing Symbols - { 'begin': 0x12000, 'end': 0x123FF }, // Cuneiform - { 'begin': 0x1D360, 'end': 0x1D37F }, // Counting Rod Numerals - { 'begin': 0x1B80, 'end': 0x1BBF }, // Sundanese - { 'begin': 0x1C00, 'end': 0x1C4F }, // Lepcha - { 'begin': 0x1C50, 'end': 0x1C7F }, // Ol Chiki - { 'begin': 0xA880, 'end': 0xA8DF }, // Saurashtra - { 'begin': 0xA900, 'end': 0xA92F }, // Kayah Li - { 'begin': 0xA930, 'end': 0xA95F }, // Rejang - { 'begin': 0xAA00, 'end': 0xAA5F }, // Cham - { 'begin': 0x10190, 'end': 0x101CF }, // Ancient Symbols - { 'begin': 0x101D0, 'end': 0x101FF }, // Phaistos Disc - { 'begin': 0x102A0, 'end': 0x102DF }, // Carian - { 'begin': 0x1F030, 'end': 0x1F09F } // Domino Tiles -]; - -var MacStandardGlyphOrdering = [ - '.notdef', '.null', 'nonmarkingreturn', 'space', 'exclam', 'quotedbl', - 'numbersign', 'dollar', 'percent', 'ampersand', 'quotesingle', 'parenleft', - 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', - 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', - 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', 'at', - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', - 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', - 'backslash', 'bracketright', 'asciicircum', 'underscore', 'grave', 'a', 'b', - 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', - 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', - 'asciitilde', 'Adieresis', 'Aring', 'Ccedilla', 'Eacute', 'Ntilde', - 'Odieresis', 'Udieresis', 'aacute', 'agrave', 'acircumflex', 'adieresis', - 'atilde', 'aring', 'ccedilla', 'eacute', 'egrave', 'ecircumflex', 'edieresis', - 'iacute', 'igrave', 'icircumflex', 'idieresis', 'ntilde', 'oacute', 'ograve', - 'ocircumflex', 'odieresis', 'otilde', 'uacute', 'ugrave', 'ucircumflex', - 'udieresis', 'dagger', 'degree', 'cent', 'sterling', 'section', 'bullet', - 'paragraph', 'germandbls', 'registered', 'copyright', 'trademark', 'acute', - 'dieresis', 'notequal', 'AE', 'Oslash', 'infinity', 'plusminus', 'lessequal', - 'greaterequal', 'yen', 'mu', 'partialdiff', 'summation', 'product', 'pi', - 'integral', 'ordfeminine', 'ordmasculine', 'Omega', 'ae', 'oslash', - 'questiondown', 'exclamdown', 'logicalnot', 'radical', 'florin', - 'approxequal', 'Delta', 'guillemotleft', 'guillemotright', 'ellipsis', - 'nonbreakingspace', 'Agrave', 'Atilde', 'Otilde', 'OE', 'oe', 'endash', - 'emdash', 'quotedblleft', 'quotedblright', 'quoteleft', 'quoteright', - 'divide', 'lozenge', 'ydieresis', 'Ydieresis', 'fraction', 'currency', - 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'daggerdbl', 'periodcentered', - 'quotesinglbase', 'quotedblbase', 'perthousand', 'Acircumflex', - 'Ecircumflex', 'Aacute', 'Edieresis', 'Egrave', 'Iacute', 'Icircumflex', - 'Idieresis', 'Igrave', 'Oacute', 'Ocircumflex', 'apple', 'Ograve', 'Uacute', - 'Ucircumflex', 'Ugrave', 'dotlessi', 'circumflex', 'tilde', 'macron', - 'breve', 'dotaccent', 'ring', 'cedilla', 'hungarumlaut', 'ogonek', 'caron', - 'Lslash', 'lslash', 'Scaron', 'scaron', 'Zcaron', 'zcaron', 'brokenbar', - 'Eth', 'eth', 'Yacute', 'yacute', 'Thorn', 'thorn', 'minus', 'multiply', - 'onesuperior', 'twosuperior', 'threesuperior', 'onehalf', 'onequarter', - 'threequarters', 'franc', 'Gbreve', 'gbreve', 'Idotaccent', 'Scedilla', - 'scedilla', 'Cacute', 'cacute', 'Ccaron', 'ccaron', 'dcroat']; - -function getUnicodeRangeFor(value) { - for (var i = 0, ii = UnicodeRanges.length; i < ii; i++) { - var range = UnicodeRanges[i]; - if (value >= range.begin && value < range.end) { - return i; - } - } - return -1; -} - -function isRTLRangeFor(value) { - var range = UnicodeRanges[13]; - if (value >= range.begin && value < range.end) { - return true; - } - range = UnicodeRanges[11]; - if (value >= range.begin && value < range.end) { - return true; - } - return false; -} - -// The normalization table is obtained by filtering the Unicode characters -// database with entries. -var NormalizedUnicodes = { - '\u00A8': '\u0020\u0308', - '\u00AF': '\u0020\u0304', - '\u00B4': '\u0020\u0301', - '\u00B5': '\u03BC', - '\u00B8': '\u0020\u0327', - '\u0132': '\u0049\u004A', - '\u0133': '\u0069\u006A', - '\u013F': '\u004C\u00B7', - '\u0140': '\u006C\u00B7', - '\u0149': '\u02BC\u006E', - '\u017F': '\u0073', - '\u01C4': '\u0044\u017D', - '\u01C5': '\u0044\u017E', - '\u01C6': '\u0064\u017E', - '\u01C7': '\u004C\u004A', - '\u01C8': '\u004C\u006A', - '\u01C9': '\u006C\u006A', - '\u01CA': '\u004E\u004A', - '\u01CB': '\u004E\u006A', - '\u01CC': '\u006E\u006A', - '\u01F1': '\u0044\u005A', - '\u01F2': '\u0044\u007A', - '\u01F3': '\u0064\u007A', - '\u02D8': '\u0020\u0306', - '\u02D9': '\u0020\u0307', - '\u02DA': '\u0020\u030A', - '\u02DB': '\u0020\u0328', - '\u02DC': '\u0020\u0303', - '\u02DD': '\u0020\u030B', - '\u037A': '\u0020\u0345', - '\u0384': '\u0020\u0301', - '\u03D0': '\u03B2', - '\u03D1': '\u03B8', - '\u03D2': '\u03A5', - '\u03D5': '\u03C6', - '\u03D6': '\u03C0', - '\u03F0': '\u03BA', - '\u03F1': '\u03C1', - '\u03F2': '\u03C2', - '\u03F4': '\u0398', - '\u03F5': '\u03B5', - '\u03F9': '\u03A3', - '\u0587': '\u0565\u0582', - '\u0675': '\u0627\u0674', - '\u0676': '\u0648\u0674', - '\u0677': '\u06C7\u0674', - '\u0678': '\u064A\u0674', - '\u0E33': '\u0E4D\u0E32', - '\u0EB3': '\u0ECD\u0EB2', - '\u0EDC': '\u0EAB\u0E99', - '\u0EDD': '\u0EAB\u0EA1', - '\u0F77': '\u0FB2\u0F81', - '\u0F79': '\u0FB3\u0F81', - '\u1E9A': '\u0061\u02BE', - '\u1FBD': '\u0020\u0313', - '\u1FBF': '\u0020\u0313', - '\u1FC0': '\u0020\u0342', - '\u1FFE': '\u0020\u0314', - '\u2002': '\u0020', - '\u2003': '\u0020', - '\u2004': '\u0020', - '\u2005': '\u0020', - '\u2006': '\u0020', - '\u2008': '\u0020', - '\u2009': '\u0020', - '\u200A': '\u0020', - '\u2017': '\u0020\u0333', - '\u2024': '\u002E', - '\u2025': '\u002E\u002E', - '\u2026': '\u002E\u002E\u002E', - '\u2033': '\u2032\u2032', - '\u2034': '\u2032\u2032\u2032', - '\u2036': '\u2035\u2035', - '\u2037': '\u2035\u2035\u2035', - '\u203C': '\u0021\u0021', - '\u203E': '\u0020\u0305', - '\u2047': '\u003F\u003F', - '\u2048': '\u003F\u0021', - '\u2049': '\u0021\u003F', - '\u2057': '\u2032\u2032\u2032\u2032', - '\u205F': '\u0020', - '\u20A8': '\u0052\u0073', - '\u2100': '\u0061\u002F\u0063', - '\u2101': '\u0061\u002F\u0073', - '\u2103': '\u00B0\u0043', - '\u2105': '\u0063\u002F\u006F', - '\u2106': '\u0063\u002F\u0075', - '\u2107': '\u0190', - '\u2109': '\u00B0\u0046', - '\u2116': '\u004E\u006F', - '\u2121': '\u0054\u0045\u004C', - '\u2135': '\u05D0', - '\u2136': '\u05D1', - '\u2137': '\u05D2', - '\u2138': '\u05D3', - '\u213B': '\u0046\u0041\u0058', - '\u2160': '\u0049', - '\u2161': '\u0049\u0049', - '\u2162': '\u0049\u0049\u0049', - '\u2163': '\u0049\u0056', - '\u2164': '\u0056', - '\u2165': '\u0056\u0049', - '\u2166': '\u0056\u0049\u0049', - '\u2167': '\u0056\u0049\u0049\u0049', - '\u2168': '\u0049\u0058', - '\u2169': '\u0058', - '\u216A': '\u0058\u0049', - '\u216B': '\u0058\u0049\u0049', - '\u216C': '\u004C', - '\u216D': '\u0043', - '\u216E': '\u0044', - '\u216F': '\u004D', - '\u2170': '\u0069', - '\u2171': '\u0069\u0069', - '\u2172': '\u0069\u0069\u0069', - '\u2173': '\u0069\u0076', - '\u2174': '\u0076', - '\u2175': '\u0076\u0069', - '\u2176': '\u0076\u0069\u0069', - '\u2177': '\u0076\u0069\u0069\u0069', - '\u2178': '\u0069\u0078', - '\u2179': '\u0078', - '\u217A': '\u0078\u0069', - '\u217B': '\u0078\u0069\u0069', - '\u217C': '\u006C', - '\u217D': '\u0063', - '\u217E': '\u0064', - '\u217F': '\u006D', - '\u222C': '\u222B\u222B', - '\u222D': '\u222B\u222B\u222B', - '\u222F': '\u222E\u222E', - '\u2230': '\u222E\u222E\u222E', - '\u2474': '\u0028\u0031\u0029', - '\u2475': '\u0028\u0032\u0029', - '\u2476': '\u0028\u0033\u0029', - '\u2477': '\u0028\u0034\u0029', - '\u2478': '\u0028\u0035\u0029', - '\u2479': '\u0028\u0036\u0029', - '\u247A': '\u0028\u0037\u0029', - '\u247B': '\u0028\u0038\u0029', - '\u247C': '\u0028\u0039\u0029', - '\u247D': '\u0028\u0031\u0030\u0029', - '\u247E': '\u0028\u0031\u0031\u0029', - '\u247F': '\u0028\u0031\u0032\u0029', - '\u2480': '\u0028\u0031\u0033\u0029', - '\u2481': '\u0028\u0031\u0034\u0029', - '\u2482': '\u0028\u0031\u0035\u0029', - '\u2483': '\u0028\u0031\u0036\u0029', - '\u2484': '\u0028\u0031\u0037\u0029', - '\u2485': '\u0028\u0031\u0038\u0029', - '\u2486': '\u0028\u0031\u0039\u0029', - '\u2487': '\u0028\u0032\u0030\u0029', - '\u2488': '\u0031\u002E', - '\u2489': '\u0032\u002E', - '\u248A': '\u0033\u002E', - '\u248B': '\u0034\u002E', - '\u248C': '\u0035\u002E', - '\u248D': '\u0036\u002E', - '\u248E': '\u0037\u002E', - '\u248F': '\u0038\u002E', - '\u2490': '\u0039\u002E', - '\u2491': '\u0031\u0030\u002E', - '\u2492': '\u0031\u0031\u002E', - '\u2493': '\u0031\u0032\u002E', - '\u2494': '\u0031\u0033\u002E', - '\u2495': '\u0031\u0034\u002E', - '\u2496': '\u0031\u0035\u002E', - '\u2497': '\u0031\u0036\u002E', - '\u2498': '\u0031\u0037\u002E', - '\u2499': '\u0031\u0038\u002E', - '\u249A': '\u0031\u0039\u002E', - '\u249B': '\u0032\u0030\u002E', - '\u249C': '\u0028\u0061\u0029', - '\u249D': '\u0028\u0062\u0029', - '\u249E': '\u0028\u0063\u0029', - '\u249F': '\u0028\u0064\u0029', - '\u24A0': '\u0028\u0065\u0029', - '\u24A1': '\u0028\u0066\u0029', - '\u24A2': '\u0028\u0067\u0029', - '\u24A3': '\u0028\u0068\u0029', - '\u24A4': '\u0028\u0069\u0029', - '\u24A5': '\u0028\u006A\u0029', - '\u24A6': '\u0028\u006B\u0029', - '\u24A7': '\u0028\u006C\u0029', - '\u24A8': '\u0028\u006D\u0029', - '\u24A9': '\u0028\u006E\u0029', - '\u24AA': '\u0028\u006F\u0029', - '\u24AB': '\u0028\u0070\u0029', - '\u24AC': '\u0028\u0071\u0029', - '\u24AD': '\u0028\u0072\u0029', - '\u24AE': '\u0028\u0073\u0029', - '\u24AF': '\u0028\u0074\u0029', - '\u24B0': '\u0028\u0075\u0029', - '\u24B1': '\u0028\u0076\u0029', - '\u24B2': '\u0028\u0077\u0029', - '\u24B3': '\u0028\u0078\u0029', - '\u24B4': '\u0028\u0079\u0029', - '\u24B5': '\u0028\u007A\u0029', - '\u2A0C': '\u222B\u222B\u222B\u222B', - '\u2A74': '\u003A\u003A\u003D', - '\u2A75': '\u003D\u003D', - '\u2A76': '\u003D\u003D\u003D', - '\u2E9F': '\u6BCD', - '\u2EF3': '\u9F9F', - '\u2F00': '\u4E00', - '\u2F01': '\u4E28', - '\u2F02': '\u4E36', - '\u2F03': '\u4E3F', - '\u2F04': '\u4E59', - '\u2F05': '\u4E85', - '\u2F06': '\u4E8C', - '\u2F07': '\u4EA0', - '\u2F08': '\u4EBA', - '\u2F09': '\u513F', - '\u2F0A': '\u5165', - '\u2F0B': '\u516B', - '\u2F0C': '\u5182', - '\u2F0D': '\u5196', - '\u2F0E': '\u51AB', - '\u2F0F': '\u51E0', - '\u2F10': '\u51F5', - '\u2F11': '\u5200', - '\u2F12': '\u529B', - '\u2F13': '\u52F9', - '\u2F14': '\u5315', - '\u2F15': '\u531A', - '\u2F16': '\u5338', - '\u2F17': '\u5341', - '\u2F18': '\u535C', - '\u2F19': '\u5369', - '\u2F1A': '\u5382', - '\u2F1B': '\u53B6', - '\u2F1C': '\u53C8', - '\u2F1D': '\u53E3', - '\u2F1E': '\u56D7', - '\u2F1F': '\u571F', - '\u2F20': '\u58EB', - '\u2F21': '\u5902', - '\u2F22': '\u590A', - '\u2F23': '\u5915', - '\u2F24': '\u5927', - '\u2F25': '\u5973', - '\u2F26': '\u5B50', - '\u2F27': '\u5B80', - '\u2F28': '\u5BF8', - '\u2F29': '\u5C0F', - '\u2F2A': '\u5C22', - '\u2F2B': '\u5C38', - '\u2F2C': '\u5C6E', - '\u2F2D': '\u5C71', - '\u2F2E': '\u5DDB', - '\u2F2F': '\u5DE5', - '\u2F30': '\u5DF1', - '\u2F31': '\u5DFE', - '\u2F32': '\u5E72', - '\u2F33': '\u5E7A', - '\u2F34': '\u5E7F', - '\u2F35': '\u5EF4', - '\u2F36': '\u5EFE', - '\u2F37': '\u5F0B', - '\u2F38': '\u5F13', - '\u2F39': '\u5F50', - '\u2F3A': '\u5F61', - '\u2F3B': '\u5F73', - '\u2F3C': '\u5FC3', - '\u2F3D': '\u6208', - '\u2F3E': '\u6236', - '\u2F3F': '\u624B', - '\u2F40': '\u652F', - '\u2F41': '\u6534', - '\u2F42': '\u6587', - '\u2F43': '\u6597', - '\u2F44': '\u65A4', - '\u2F45': '\u65B9', - '\u2F46': '\u65E0', - '\u2F47': '\u65E5', - '\u2F48': '\u66F0', - '\u2F49': '\u6708', - '\u2F4A': '\u6728', - '\u2F4B': '\u6B20', - '\u2F4C': '\u6B62', - '\u2F4D': '\u6B79', - '\u2F4E': '\u6BB3', - '\u2F4F': '\u6BCB', - '\u2F50': '\u6BD4', - '\u2F51': '\u6BDB', - '\u2F52': '\u6C0F', - '\u2F53': '\u6C14', - '\u2F54': '\u6C34', - '\u2F55': '\u706B', - '\u2F56': '\u722A', - '\u2F57': '\u7236', - '\u2F58': '\u723B', - '\u2F59': '\u723F', - '\u2F5A': '\u7247', - '\u2F5B': '\u7259', - '\u2F5C': '\u725B', - '\u2F5D': '\u72AC', - '\u2F5E': '\u7384', - '\u2F5F': '\u7389', - '\u2F60': '\u74DC', - '\u2F61': '\u74E6', - '\u2F62': '\u7518', - '\u2F63': '\u751F', - '\u2F64': '\u7528', - '\u2F65': '\u7530', - '\u2F66': '\u758B', - '\u2F67': '\u7592', - '\u2F68': '\u7676', - '\u2F69': '\u767D', - '\u2F6A': '\u76AE', - '\u2F6B': '\u76BF', - '\u2F6C': '\u76EE', - '\u2F6D': '\u77DB', - '\u2F6E': '\u77E2', - '\u2F6F': '\u77F3', - '\u2F70': '\u793A', - '\u2F71': '\u79B8', - '\u2F72': '\u79BE', - '\u2F73': '\u7A74', - '\u2F74': '\u7ACB', - '\u2F75': '\u7AF9', - '\u2F76': '\u7C73', - '\u2F77': '\u7CF8', - '\u2F78': '\u7F36', - '\u2F79': '\u7F51', - '\u2F7A': '\u7F8A', - '\u2F7B': '\u7FBD', - '\u2F7C': '\u8001', - '\u2F7D': '\u800C', - '\u2F7E': '\u8012', - '\u2F7F': '\u8033', - '\u2F80': '\u807F', - '\u2F81': '\u8089', - '\u2F82': '\u81E3', - '\u2F83': '\u81EA', - '\u2F84': '\u81F3', - '\u2F85': '\u81FC', - '\u2F86': '\u820C', - '\u2F87': '\u821B', - '\u2F88': '\u821F', - '\u2F89': '\u826E', - '\u2F8A': '\u8272', - '\u2F8B': '\u8278', - '\u2F8C': '\u864D', - '\u2F8D': '\u866B', - '\u2F8E': '\u8840', - '\u2F8F': '\u884C', - '\u2F90': '\u8863', - '\u2F91': '\u897E', - '\u2F92': '\u898B', - '\u2F93': '\u89D2', - '\u2F94': '\u8A00', - '\u2F95': '\u8C37', - '\u2F96': '\u8C46', - '\u2F97': '\u8C55', - '\u2F98': '\u8C78', - '\u2F99': '\u8C9D', - '\u2F9A': '\u8D64', - '\u2F9B': '\u8D70', - '\u2F9C': '\u8DB3', - '\u2F9D': '\u8EAB', - '\u2F9E': '\u8ECA', - '\u2F9F': '\u8F9B', - '\u2FA0': '\u8FB0', - '\u2FA1': '\u8FB5', - '\u2FA2': '\u9091', - '\u2FA3': '\u9149', - '\u2FA4': '\u91C6', - '\u2FA5': '\u91CC', - '\u2FA6': '\u91D1', - '\u2FA7': '\u9577', - '\u2FA8': '\u9580', - '\u2FA9': '\u961C', - '\u2FAA': '\u96B6', - '\u2FAB': '\u96B9', - '\u2FAC': '\u96E8', - '\u2FAD': '\u9751', - '\u2FAE': '\u975E', - '\u2FAF': '\u9762', - '\u2FB0': '\u9769', - '\u2FB1': '\u97CB', - '\u2FB2': '\u97ED', - '\u2FB3': '\u97F3', - '\u2FB4': '\u9801', - '\u2FB5': '\u98A8', - '\u2FB6': '\u98DB', - '\u2FB7': '\u98DF', - '\u2FB8': '\u9996', - '\u2FB9': '\u9999', - '\u2FBA': '\u99AC', - '\u2FBB': '\u9AA8', - '\u2FBC': '\u9AD8', - '\u2FBD': '\u9ADF', - '\u2FBE': '\u9B25', - '\u2FBF': '\u9B2F', - '\u2FC0': '\u9B32', - '\u2FC1': '\u9B3C', - '\u2FC2': '\u9B5A', - '\u2FC3': '\u9CE5', - '\u2FC4': '\u9E75', - '\u2FC5': '\u9E7F', - '\u2FC6': '\u9EA5', - '\u2FC7': '\u9EBB', - '\u2FC8': '\u9EC3', - '\u2FC9': '\u9ECD', - '\u2FCA': '\u9ED1', - '\u2FCB': '\u9EF9', - '\u2FCC': '\u9EFD', - '\u2FCD': '\u9F0E', - '\u2FCE': '\u9F13', - '\u2FCF': '\u9F20', - '\u2FD0': '\u9F3B', - '\u2FD1': '\u9F4A', - '\u2FD2': '\u9F52', - '\u2FD3': '\u9F8D', - '\u2FD4': '\u9F9C', - '\u2FD5': '\u9FA0', - '\u3036': '\u3012', - '\u3038': '\u5341', - '\u3039': '\u5344', - '\u303A': '\u5345', - '\u309B': '\u0020\u3099', - '\u309C': '\u0020\u309A', - '\u3131': '\u1100', - '\u3132': '\u1101', - '\u3133': '\u11AA', - '\u3134': '\u1102', - '\u3135': '\u11AC', - '\u3136': '\u11AD', - '\u3137': '\u1103', - '\u3138': '\u1104', - '\u3139': '\u1105', - '\u313A': '\u11B0', - '\u313B': '\u11B1', - '\u313C': '\u11B2', - '\u313D': '\u11B3', - '\u313E': '\u11B4', - '\u313F': '\u11B5', - '\u3140': '\u111A', - '\u3141': '\u1106', - '\u3142': '\u1107', - '\u3143': '\u1108', - '\u3144': '\u1121', - '\u3145': '\u1109', - '\u3146': '\u110A', - '\u3147': '\u110B', - '\u3148': '\u110C', - '\u3149': '\u110D', - '\u314A': '\u110E', - '\u314B': '\u110F', - '\u314C': '\u1110', - '\u314D': '\u1111', - '\u314E': '\u1112', - '\u314F': '\u1161', - '\u3150': '\u1162', - '\u3151': '\u1163', - '\u3152': '\u1164', - '\u3153': '\u1165', - '\u3154': '\u1166', - '\u3155': '\u1167', - '\u3156': '\u1168', - '\u3157': '\u1169', - '\u3158': '\u116A', - '\u3159': '\u116B', - '\u315A': '\u116C', - '\u315B': '\u116D', - '\u315C': '\u116E', - '\u315D': '\u116F', - '\u315E': '\u1170', - '\u315F': '\u1171', - '\u3160': '\u1172', - '\u3161': '\u1173', - '\u3162': '\u1174', - '\u3163': '\u1175', - '\u3164': '\u1160', - '\u3165': '\u1114', - '\u3166': '\u1115', - '\u3167': '\u11C7', - '\u3168': '\u11C8', - '\u3169': '\u11CC', - '\u316A': '\u11CE', - '\u316B': '\u11D3', - '\u316C': '\u11D7', - '\u316D': '\u11D9', - '\u316E': '\u111C', - '\u316F': '\u11DD', - '\u3170': '\u11DF', - '\u3171': '\u111D', - '\u3172': '\u111E', - '\u3173': '\u1120', - '\u3174': '\u1122', - '\u3175': '\u1123', - '\u3176': '\u1127', - '\u3177': '\u1129', - '\u3178': '\u112B', - '\u3179': '\u112C', - '\u317A': '\u112D', - '\u317B': '\u112E', - '\u317C': '\u112F', - '\u317D': '\u1132', - '\u317E': '\u1136', - '\u317F': '\u1140', - '\u3180': '\u1147', - '\u3181': '\u114C', - '\u3182': '\u11F1', - '\u3183': '\u11F2', - '\u3184': '\u1157', - '\u3185': '\u1158', - '\u3186': '\u1159', - '\u3187': '\u1184', - '\u3188': '\u1185', - '\u3189': '\u1188', - '\u318A': '\u1191', - '\u318B': '\u1192', - '\u318C': '\u1194', - '\u318D': '\u119E', - '\u318E': '\u11A1', - '\u3200': '\u0028\u1100\u0029', - '\u3201': '\u0028\u1102\u0029', - '\u3202': '\u0028\u1103\u0029', - '\u3203': '\u0028\u1105\u0029', - '\u3204': '\u0028\u1106\u0029', - '\u3205': '\u0028\u1107\u0029', - '\u3206': '\u0028\u1109\u0029', - '\u3207': '\u0028\u110B\u0029', - '\u3208': '\u0028\u110C\u0029', - '\u3209': '\u0028\u110E\u0029', - '\u320A': '\u0028\u110F\u0029', - '\u320B': '\u0028\u1110\u0029', - '\u320C': '\u0028\u1111\u0029', - '\u320D': '\u0028\u1112\u0029', - '\u320E': '\u0028\u1100\u1161\u0029', - '\u320F': '\u0028\u1102\u1161\u0029', - '\u3210': '\u0028\u1103\u1161\u0029', - '\u3211': '\u0028\u1105\u1161\u0029', - '\u3212': '\u0028\u1106\u1161\u0029', - '\u3213': '\u0028\u1107\u1161\u0029', - '\u3214': '\u0028\u1109\u1161\u0029', - '\u3215': '\u0028\u110B\u1161\u0029', - '\u3216': '\u0028\u110C\u1161\u0029', - '\u3217': '\u0028\u110E\u1161\u0029', - '\u3218': '\u0028\u110F\u1161\u0029', - '\u3219': '\u0028\u1110\u1161\u0029', - '\u321A': '\u0028\u1111\u1161\u0029', - '\u321B': '\u0028\u1112\u1161\u0029', - '\u321C': '\u0028\u110C\u116E\u0029', - '\u321D': '\u0028\u110B\u1169\u110C\u1165\u11AB\u0029', - '\u321E': '\u0028\u110B\u1169\u1112\u116E\u0029', - '\u3220': '\u0028\u4E00\u0029', - '\u3221': '\u0028\u4E8C\u0029', - '\u3222': '\u0028\u4E09\u0029', - '\u3223': '\u0028\u56DB\u0029', - '\u3224': '\u0028\u4E94\u0029', - '\u3225': '\u0028\u516D\u0029', - '\u3226': '\u0028\u4E03\u0029', - '\u3227': '\u0028\u516B\u0029', - '\u3228': '\u0028\u4E5D\u0029', - '\u3229': '\u0028\u5341\u0029', - '\u322A': '\u0028\u6708\u0029', - '\u322B': '\u0028\u706B\u0029', - '\u322C': '\u0028\u6C34\u0029', - '\u322D': '\u0028\u6728\u0029', - '\u322E': '\u0028\u91D1\u0029', - '\u322F': '\u0028\u571F\u0029', - '\u3230': '\u0028\u65E5\u0029', - '\u3231': '\u0028\u682A\u0029', - '\u3232': '\u0028\u6709\u0029', - '\u3233': '\u0028\u793E\u0029', - '\u3234': '\u0028\u540D\u0029', - '\u3235': '\u0028\u7279\u0029', - '\u3236': '\u0028\u8CA1\u0029', - '\u3237': '\u0028\u795D\u0029', - '\u3238': '\u0028\u52B4\u0029', - '\u3239': '\u0028\u4EE3\u0029', - '\u323A': '\u0028\u547C\u0029', - '\u323B': '\u0028\u5B66\u0029', - '\u323C': '\u0028\u76E3\u0029', - '\u323D': '\u0028\u4F01\u0029', - '\u323E': '\u0028\u8CC7\u0029', - '\u323F': '\u0028\u5354\u0029', - '\u3240': '\u0028\u796D\u0029', - '\u3241': '\u0028\u4F11\u0029', - '\u3242': '\u0028\u81EA\u0029', - '\u3243': '\u0028\u81F3\u0029', - '\u32C0': '\u0031\u6708', - '\u32C1': '\u0032\u6708', - '\u32C2': '\u0033\u6708', - '\u32C3': '\u0034\u6708', - '\u32C4': '\u0035\u6708', - '\u32C5': '\u0036\u6708', - '\u32C6': '\u0037\u6708', - '\u32C7': '\u0038\u6708', - '\u32C8': '\u0039\u6708', - '\u32C9': '\u0031\u0030\u6708', - '\u32CA': '\u0031\u0031\u6708', - '\u32CB': '\u0031\u0032\u6708', - '\u3358': '\u0030\u70B9', - '\u3359': '\u0031\u70B9', - '\u335A': '\u0032\u70B9', - '\u335B': '\u0033\u70B9', - '\u335C': '\u0034\u70B9', - '\u335D': '\u0035\u70B9', - '\u335E': '\u0036\u70B9', - '\u335F': '\u0037\u70B9', - '\u3360': '\u0038\u70B9', - '\u3361': '\u0039\u70B9', - '\u3362': '\u0031\u0030\u70B9', - '\u3363': '\u0031\u0031\u70B9', - '\u3364': '\u0031\u0032\u70B9', - '\u3365': '\u0031\u0033\u70B9', - '\u3366': '\u0031\u0034\u70B9', - '\u3367': '\u0031\u0035\u70B9', - '\u3368': '\u0031\u0036\u70B9', - '\u3369': '\u0031\u0037\u70B9', - '\u336A': '\u0031\u0038\u70B9', - '\u336B': '\u0031\u0039\u70B9', - '\u336C': '\u0032\u0030\u70B9', - '\u336D': '\u0032\u0031\u70B9', - '\u336E': '\u0032\u0032\u70B9', - '\u336F': '\u0032\u0033\u70B9', - '\u3370': '\u0032\u0034\u70B9', - '\u33E0': '\u0031\u65E5', - '\u33E1': '\u0032\u65E5', - '\u33E2': '\u0033\u65E5', - '\u33E3': '\u0034\u65E5', - '\u33E4': '\u0035\u65E5', - '\u33E5': '\u0036\u65E5', - '\u33E6': '\u0037\u65E5', - '\u33E7': '\u0038\u65E5', - '\u33E8': '\u0039\u65E5', - '\u33E9': '\u0031\u0030\u65E5', - '\u33EA': '\u0031\u0031\u65E5', - '\u33EB': '\u0031\u0032\u65E5', - '\u33EC': '\u0031\u0033\u65E5', - '\u33ED': '\u0031\u0034\u65E5', - '\u33EE': '\u0031\u0035\u65E5', - '\u33EF': '\u0031\u0036\u65E5', - '\u33F0': '\u0031\u0037\u65E5', - '\u33F1': '\u0031\u0038\u65E5', - '\u33F2': '\u0031\u0039\u65E5', - '\u33F3': '\u0032\u0030\u65E5', - '\u33F4': '\u0032\u0031\u65E5', - '\u33F5': '\u0032\u0032\u65E5', - '\u33F6': '\u0032\u0033\u65E5', - '\u33F7': '\u0032\u0034\u65E5', - '\u33F8': '\u0032\u0035\u65E5', - '\u33F9': '\u0032\u0036\u65E5', - '\u33FA': '\u0032\u0037\u65E5', - '\u33FB': '\u0032\u0038\u65E5', - '\u33FC': '\u0032\u0039\u65E5', - '\u33FD': '\u0033\u0030\u65E5', - '\u33FE': '\u0033\u0031\u65E5', - '\uFB00': '\u0066\u0066', - '\uFB01': '\u0066\u0069', - '\uFB02': '\u0066\u006C', - '\uFB03': '\u0066\u0066\u0069', - '\uFB04': '\u0066\u0066\u006C', - '\uFB05': '\u017F\u0074', - '\uFB06': '\u0073\u0074', - '\uFB13': '\u0574\u0576', - '\uFB14': '\u0574\u0565', - '\uFB15': '\u0574\u056B', - '\uFB16': '\u057E\u0576', - '\uFB17': '\u0574\u056D', - '\uFB4F': '\u05D0\u05DC', - '\uFB50': '\u0671', - '\uFB51': '\u0671', - '\uFB52': '\u067B', - '\uFB53': '\u067B', - '\uFB54': '\u067B', - '\uFB55': '\u067B', - '\uFB56': '\u067E', - '\uFB57': '\u067E', - '\uFB58': '\u067E', - '\uFB59': '\u067E', - '\uFB5A': '\u0680', - '\uFB5B': '\u0680', - '\uFB5C': '\u0680', - '\uFB5D': '\u0680', - '\uFB5E': '\u067A', - '\uFB5F': '\u067A', - '\uFB60': '\u067A', - '\uFB61': '\u067A', - '\uFB62': '\u067F', - '\uFB63': '\u067F', - '\uFB64': '\u067F', - '\uFB65': '\u067F', - '\uFB66': '\u0679', - '\uFB67': '\u0679', - '\uFB68': '\u0679', - '\uFB69': '\u0679', - '\uFB6A': '\u06A4', - '\uFB6B': '\u06A4', - '\uFB6C': '\u06A4', - '\uFB6D': '\u06A4', - '\uFB6E': '\u06A6', - '\uFB6F': '\u06A6', - '\uFB70': '\u06A6', - '\uFB71': '\u06A6', - '\uFB72': '\u0684', - '\uFB73': '\u0684', - '\uFB74': '\u0684', - '\uFB75': '\u0684', - '\uFB76': '\u0683', - '\uFB77': '\u0683', - '\uFB78': '\u0683', - '\uFB79': '\u0683', - '\uFB7A': '\u0686', - '\uFB7B': '\u0686', - '\uFB7C': '\u0686', - '\uFB7D': '\u0686', - '\uFB7E': '\u0687', - '\uFB7F': '\u0687', - '\uFB80': '\u0687', - '\uFB81': '\u0687', - '\uFB82': '\u068D', - '\uFB83': '\u068D', - '\uFB84': '\u068C', - '\uFB85': '\u068C', - '\uFB86': '\u068E', - '\uFB87': '\u068E', - '\uFB88': '\u0688', - '\uFB89': '\u0688', - '\uFB8A': '\u0698', - '\uFB8B': '\u0698', - '\uFB8C': '\u0691', - '\uFB8D': '\u0691', - '\uFB8E': '\u06A9', - '\uFB8F': '\u06A9', - '\uFB90': '\u06A9', - '\uFB91': '\u06A9', - '\uFB92': '\u06AF', - '\uFB93': '\u06AF', - '\uFB94': '\u06AF', - '\uFB95': '\u06AF', - '\uFB96': '\u06B3', - '\uFB97': '\u06B3', - '\uFB98': '\u06B3', - '\uFB99': '\u06B3', - '\uFB9A': '\u06B1', - '\uFB9B': '\u06B1', - '\uFB9C': '\u06B1', - '\uFB9D': '\u06B1', - '\uFB9E': '\u06BA', - '\uFB9F': '\u06BA', - '\uFBA0': '\u06BB', - '\uFBA1': '\u06BB', - '\uFBA2': '\u06BB', - '\uFBA3': '\u06BB', - '\uFBA4': '\u06C0', - '\uFBA5': '\u06C0', - '\uFBA6': '\u06C1', - '\uFBA7': '\u06C1', - '\uFBA8': '\u06C1', - '\uFBA9': '\u06C1', - '\uFBAA': '\u06BE', - '\uFBAB': '\u06BE', - '\uFBAC': '\u06BE', - '\uFBAD': '\u06BE', - '\uFBAE': '\u06D2', - '\uFBAF': '\u06D2', - '\uFBB0': '\u06D3', - '\uFBB1': '\u06D3', - '\uFBD3': '\u06AD', - '\uFBD4': '\u06AD', - '\uFBD5': '\u06AD', - '\uFBD6': '\u06AD', - '\uFBD7': '\u06C7', - '\uFBD8': '\u06C7', - '\uFBD9': '\u06C6', - '\uFBDA': '\u06C6', - '\uFBDB': '\u06C8', - '\uFBDC': '\u06C8', - '\uFBDD': '\u0677', - '\uFBDE': '\u06CB', - '\uFBDF': '\u06CB', - '\uFBE0': '\u06C5', - '\uFBE1': '\u06C5', - '\uFBE2': '\u06C9', - '\uFBE3': '\u06C9', - '\uFBE4': '\u06D0', - '\uFBE5': '\u06D0', - '\uFBE6': '\u06D0', - '\uFBE7': '\u06D0', - '\uFBE8': '\u0649', - '\uFBE9': '\u0649', - '\uFBEA': '\u0626\u0627', - '\uFBEB': '\u0626\u0627', - '\uFBEC': '\u0626\u06D5', - '\uFBED': '\u0626\u06D5', - '\uFBEE': '\u0626\u0648', - '\uFBEF': '\u0626\u0648', - '\uFBF0': '\u0626\u06C7', - '\uFBF1': '\u0626\u06C7', - '\uFBF2': '\u0626\u06C6', - '\uFBF3': '\u0626\u06C6', - '\uFBF4': '\u0626\u06C8', - '\uFBF5': '\u0626\u06C8', - '\uFBF6': '\u0626\u06D0', - '\uFBF7': '\u0626\u06D0', - '\uFBF8': '\u0626\u06D0', - '\uFBF9': '\u0626\u0649', - '\uFBFA': '\u0626\u0649', - '\uFBFB': '\u0626\u0649', - '\uFBFC': '\u06CC', - '\uFBFD': '\u06CC', - '\uFBFE': '\u06CC', - '\uFBFF': '\u06CC', - '\uFC00': '\u0626\u062C', - '\uFC01': '\u0626\u062D', - '\uFC02': '\u0626\u0645', - '\uFC03': '\u0626\u0649', - '\uFC04': '\u0626\u064A', - '\uFC05': '\u0628\u062C', - '\uFC06': '\u0628\u062D', - '\uFC07': '\u0628\u062E', - '\uFC08': '\u0628\u0645', - '\uFC09': '\u0628\u0649', - '\uFC0A': '\u0628\u064A', - '\uFC0B': '\u062A\u062C', - '\uFC0C': '\u062A\u062D', - '\uFC0D': '\u062A\u062E', - '\uFC0E': '\u062A\u0645', - '\uFC0F': '\u062A\u0649', - '\uFC10': '\u062A\u064A', - '\uFC11': '\u062B\u062C', - '\uFC12': '\u062B\u0645', - '\uFC13': '\u062B\u0649', - '\uFC14': '\u062B\u064A', - '\uFC15': '\u062C\u062D', - '\uFC16': '\u062C\u0645', - '\uFC17': '\u062D\u062C', - '\uFC18': '\u062D\u0645', - '\uFC19': '\u062E\u062C', - '\uFC1A': '\u062E\u062D', - '\uFC1B': '\u062E\u0645', - '\uFC1C': '\u0633\u062C', - '\uFC1D': '\u0633\u062D', - '\uFC1E': '\u0633\u062E', - '\uFC1F': '\u0633\u0645', - '\uFC20': '\u0635\u062D', - '\uFC21': '\u0635\u0645', - '\uFC22': '\u0636\u062C', - '\uFC23': '\u0636\u062D', - '\uFC24': '\u0636\u062E', - '\uFC25': '\u0636\u0645', - '\uFC26': '\u0637\u062D', - '\uFC27': '\u0637\u0645', - '\uFC28': '\u0638\u0645', - '\uFC29': '\u0639\u062C', - '\uFC2A': '\u0639\u0645', - '\uFC2B': '\u063A\u062C', - '\uFC2C': '\u063A\u0645', - '\uFC2D': '\u0641\u062C', - '\uFC2E': '\u0641\u062D', - '\uFC2F': '\u0641\u062E', - '\uFC30': '\u0641\u0645', - '\uFC31': '\u0641\u0649', - '\uFC32': '\u0641\u064A', - '\uFC33': '\u0642\u062D', - '\uFC34': '\u0642\u0645', - '\uFC35': '\u0642\u0649', - '\uFC36': '\u0642\u064A', - '\uFC37': '\u0643\u0627', - '\uFC38': '\u0643\u062C', - '\uFC39': '\u0643\u062D', - '\uFC3A': '\u0643\u062E', - '\uFC3B': '\u0643\u0644', - '\uFC3C': '\u0643\u0645', - '\uFC3D': '\u0643\u0649', - '\uFC3E': '\u0643\u064A', - '\uFC3F': '\u0644\u062C', - '\uFC40': '\u0644\u062D', - '\uFC41': '\u0644\u062E', - '\uFC42': '\u0644\u0645', - '\uFC43': '\u0644\u0649', - '\uFC44': '\u0644\u064A', - '\uFC45': '\u0645\u062C', - '\uFC46': '\u0645\u062D', - '\uFC47': '\u0645\u062E', - '\uFC48': '\u0645\u0645', - '\uFC49': '\u0645\u0649', - '\uFC4A': '\u0645\u064A', - '\uFC4B': '\u0646\u062C', - '\uFC4C': '\u0646\u062D', - '\uFC4D': '\u0646\u062E', - '\uFC4E': '\u0646\u0645', - '\uFC4F': '\u0646\u0649', - '\uFC50': '\u0646\u064A', - '\uFC51': '\u0647\u062C', - '\uFC52': '\u0647\u0645', - '\uFC53': '\u0647\u0649', - '\uFC54': '\u0647\u064A', - '\uFC55': '\u064A\u062C', - '\uFC56': '\u064A\u062D', - '\uFC57': '\u064A\u062E', - '\uFC58': '\u064A\u0645', - '\uFC59': '\u064A\u0649', - '\uFC5A': '\u064A\u064A', - '\uFC5B': '\u0630\u0670', - '\uFC5C': '\u0631\u0670', - '\uFC5D': '\u0649\u0670', - '\uFC5E': '\u0020\u064C\u0651', - '\uFC5F': '\u0020\u064D\u0651', - '\uFC60': '\u0020\u064E\u0651', - '\uFC61': '\u0020\u064F\u0651', - '\uFC62': '\u0020\u0650\u0651', - '\uFC63': '\u0020\u0651\u0670', - '\uFC64': '\u0626\u0631', - '\uFC65': '\u0626\u0632', - '\uFC66': '\u0626\u0645', - '\uFC67': '\u0626\u0646', - '\uFC68': '\u0626\u0649', - '\uFC69': '\u0626\u064A', - '\uFC6A': '\u0628\u0631', - '\uFC6B': '\u0628\u0632', - '\uFC6C': '\u0628\u0645', - '\uFC6D': '\u0628\u0646', - '\uFC6E': '\u0628\u0649', - '\uFC6F': '\u0628\u064A', - '\uFC70': '\u062A\u0631', - '\uFC71': '\u062A\u0632', - '\uFC72': '\u062A\u0645', - '\uFC73': '\u062A\u0646', - '\uFC74': '\u062A\u0649', - '\uFC75': '\u062A\u064A', - '\uFC76': '\u062B\u0631', - '\uFC77': '\u062B\u0632', - '\uFC78': '\u062B\u0645', - '\uFC79': '\u062B\u0646', - '\uFC7A': '\u062B\u0649', - '\uFC7B': '\u062B\u064A', - '\uFC7C': '\u0641\u0649', - '\uFC7D': '\u0641\u064A', - '\uFC7E': '\u0642\u0649', - '\uFC7F': '\u0642\u064A', - '\uFC80': '\u0643\u0627', - '\uFC81': '\u0643\u0644', - '\uFC82': '\u0643\u0645', - '\uFC83': '\u0643\u0649', - '\uFC84': '\u0643\u064A', - '\uFC85': '\u0644\u0645', - '\uFC86': '\u0644\u0649', - '\uFC87': '\u0644\u064A', - '\uFC88': '\u0645\u0627', - '\uFC89': '\u0645\u0645', - '\uFC8A': '\u0646\u0631', - '\uFC8B': '\u0646\u0632', - '\uFC8C': '\u0646\u0645', - '\uFC8D': '\u0646\u0646', - '\uFC8E': '\u0646\u0649', - '\uFC8F': '\u0646\u064A', - '\uFC90': '\u0649\u0670', - '\uFC91': '\u064A\u0631', - '\uFC92': '\u064A\u0632', - '\uFC93': '\u064A\u0645', - '\uFC94': '\u064A\u0646', - '\uFC95': '\u064A\u0649', - '\uFC96': '\u064A\u064A', - '\uFC97': '\u0626\u062C', - '\uFC98': '\u0626\u062D', - '\uFC99': '\u0626\u062E', - '\uFC9A': '\u0626\u0645', - '\uFC9B': '\u0626\u0647', - '\uFC9C': '\u0628\u062C', - '\uFC9D': '\u0628\u062D', - '\uFC9E': '\u0628\u062E', - '\uFC9F': '\u0628\u0645', - '\uFCA0': '\u0628\u0647', - '\uFCA1': '\u062A\u062C', - '\uFCA2': '\u062A\u062D', - '\uFCA3': '\u062A\u062E', - '\uFCA4': '\u062A\u0645', - '\uFCA5': '\u062A\u0647', - '\uFCA6': '\u062B\u0645', - '\uFCA7': '\u062C\u062D', - '\uFCA8': '\u062C\u0645', - '\uFCA9': '\u062D\u062C', - '\uFCAA': '\u062D\u0645', - '\uFCAB': '\u062E\u062C', - '\uFCAC': '\u062E\u0645', - '\uFCAD': '\u0633\u062C', - '\uFCAE': '\u0633\u062D', - '\uFCAF': '\u0633\u062E', - '\uFCB0': '\u0633\u0645', - '\uFCB1': '\u0635\u062D', - '\uFCB2': '\u0635\u062E', - '\uFCB3': '\u0635\u0645', - '\uFCB4': '\u0636\u062C', - '\uFCB5': '\u0636\u062D', - '\uFCB6': '\u0636\u062E', - '\uFCB7': '\u0636\u0645', - '\uFCB8': '\u0637\u062D', - '\uFCB9': '\u0638\u0645', - '\uFCBA': '\u0639\u062C', - '\uFCBB': '\u0639\u0645', - '\uFCBC': '\u063A\u062C', - '\uFCBD': '\u063A\u0645', - '\uFCBE': '\u0641\u062C', - '\uFCBF': '\u0641\u062D', - '\uFCC0': '\u0641\u062E', - '\uFCC1': '\u0641\u0645', - '\uFCC2': '\u0642\u062D', - '\uFCC3': '\u0642\u0645', - '\uFCC4': '\u0643\u062C', - '\uFCC5': '\u0643\u062D', - '\uFCC6': '\u0643\u062E', - '\uFCC7': '\u0643\u0644', - '\uFCC8': '\u0643\u0645', - '\uFCC9': '\u0644\u062C', - '\uFCCA': '\u0644\u062D', - '\uFCCB': '\u0644\u062E', - '\uFCCC': '\u0644\u0645', - '\uFCCD': '\u0644\u0647', - '\uFCCE': '\u0645\u062C', - '\uFCCF': '\u0645\u062D', - '\uFCD0': '\u0645\u062E', - '\uFCD1': '\u0645\u0645', - '\uFCD2': '\u0646\u062C', - '\uFCD3': '\u0646\u062D', - '\uFCD4': '\u0646\u062E', - '\uFCD5': '\u0646\u0645', - '\uFCD6': '\u0646\u0647', - '\uFCD7': '\u0647\u062C', - '\uFCD8': '\u0647\u0645', - '\uFCD9': '\u0647\u0670', - '\uFCDA': '\u064A\u062C', - '\uFCDB': '\u064A\u062D', - '\uFCDC': '\u064A\u062E', - '\uFCDD': '\u064A\u0645', - '\uFCDE': '\u064A\u0647', - '\uFCDF': '\u0626\u0645', - '\uFCE0': '\u0626\u0647', - '\uFCE1': '\u0628\u0645', - '\uFCE2': '\u0628\u0647', - '\uFCE3': '\u062A\u0645', - '\uFCE4': '\u062A\u0647', - '\uFCE5': '\u062B\u0645', - '\uFCE6': '\u062B\u0647', - '\uFCE7': '\u0633\u0645', - '\uFCE8': '\u0633\u0647', - '\uFCE9': '\u0634\u0645', - '\uFCEA': '\u0634\u0647', - '\uFCEB': '\u0643\u0644', - '\uFCEC': '\u0643\u0645', - '\uFCED': '\u0644\u0645', - '\uFCEE': '\u0646\u0645', - '\uFCEF': '\u0646\u0647', - '\uFCF0': '\u064A\u0645', - '\uFCF1': '\u064A\u0647', - '\uFCF2': '\u0640\u064E\u0651', - '\uFCF3': '\u0640\u064F\u0651', - '\uFCF4': '\u0640\u0650\u0651', - '\uFCF5': '\u0637\u0649', - '\uFCF6': '\u0637\u064A', - '\uFCF7': '\u0639\u0649', - '\uFCF8': '\u0639\u064A', - '\uFCF9': '\u063A\u0649', - '\uFCFA': '\u063A\u064A', - '\uFCFB': '\u0633\u0649', - '\uFCFC': '\u0633\u064A', - '\uFCFD': '\u0634\u0649', - '\uFCFE': '\u0634\u064A', - '\uFCFF': '\u062D\u0649', - '\uFD00': '\u062D\u064A', - '\uFD01': '\u062C\u0649', - '\uFD02': '\u062C\u064A', - '\uFD03': '\u062E\u0649', - '\uFD04': '\u062E\u064A', - '\uFD05': '\u0635\u0649', - '\uFD06': '\u0635\u064A', - '\uFD07': '\u0636\u0649', - '\uFD08': '\u0636\u064A', - '\uFD09': '\u0634\u062C', - '\uFD0A': '\u0634\u062D', - '\uFD0B': '\u0634\u062E', - '\uFD0C': '\u0634\u0645', - '\uFD0D': '\u0634\u0631', - '\uFD0E': '\u0633\u0631', - '\uFD0F': '\u0635\u0631', - '\uFD10': '\u0636\u0631', - '\uFD11': '\u0637\u0649', - '\uFD12': '\u0637\u064A', - '\uFD13': '\u0639\u0649', - '\uFD14': '\u0639\u064A', - '\uFD15': '\u063A\u0649', - '\uFD16': '\u063A\u064A', - '\uFD17': '\u0633\u0649', - '\uFD18': '\u0633\u064A', - '\uFD19': '\u0634\u0649', - '\uFD1A': '\u0634\u064A', - '\uFD1B': '\u062D\u0649', - '\uFD1C': '\u062D\u064A', - '\uFD1D': '\u062C\u0649', - '\uFD1E': '\u062C\u064A', - '\uFD1F': '\u062E\u0649', - '\uFD20': '\u062E\u064A', - '\uFD21': '\u0635\u0649', - '\uFD22': '\u0635\u064A', - '\uFD23': '\u0636\u0649', - '\uFD24': '\u0636\u064A', - '\uFD25': '\u0634\u062C', - '\uFD26': '\u0634\u062D', - '\uFD27': '\u0634\u062E', - '\uFD28': '\u0634\u0645', - '\uFD29': '\u0634\u0631', - '\uFD2A': '\u0633\u0631', - '\uFD2B': '\u0635\u0631', - '\uFD2C': '\u0636\u0631', - '\uFD2D': '\u0634\u062C', - '\uFD2E': '\u0634\u062D', - '\uFD2F': '\u0634\u062E', - '\uFD30': '\u0634\u0645', - '\uFD31': '\u0633\u0647', - '\uFD32': '\u0634\u0647', - '\uFD33': '\u0637\u0645', - '\uFD34': '\u0633\u062C', - '\uFD35': '\u0633\u062D', - '\uFD36': '\u0633\u062E', - '\uFD37': '\u0634\u062C', - '\uFD38': '\u0634\u062D', - '\uFD39': '\u0634\u062E', - '\uFD3A': '\u0637\u0645', - '\uFD3B': '\u0638\u0645', - '\uFD3C': '\u0627\u064B', - '\uFD3D': '\u0627\u064B', - '\uFD50': '\u062A\u062C\u0645', - '\uFD51': '\u062A\u062D\u062C', - '\uFD52': '\u062A\u062D\u062C', - '\uFD53': '\u062A\u062D\u0645', - '\uFD54': '\u062A\u062E\u0645', - '\uFD55': '\u062A\u0645\u062C', - '\uFD56': '\u062A\u0645\u062D', - '\uFD57': '\u062A\u0645\u062E', - '\uFD58': '\u062C\u0645\u062D', - '\uFD59': '\u062C\u0645\u062D', - '\uFD5A': '\u062D\u0645\u064A', - '\uFD5B': '\u062D\u0645\u0649', - '\uFD5C': '\u0633\u062D\u062C', - '\uFD5D': '\u0633\u062C\u062D', - '\uFD5E': '\u0633\u062C\u0649', - '\uFD5F': '\u0633\u0645\u062D', - '\uFD60': '\u0633\u0645\u062D', - '\uFD61': '\u0633\u0645\u062C', - '\uFD62': '\u0633\u0645\u0645', - '\uFD63': '\u0633\u0645\u0645', - '\uFD64': '\u0635\u062D\u062D', - '\uFD65': '\u0635\u062D\u062D', - '\uFD66': '\u0635\u0645\u0645', - '\uFD67': '\u0634\u062D\u0645', - '\uFD68': '\u0634\u062D\u0645', - '\uFD69': '\u0634\u062C\u064A', - '\uFD6A': '\u0634\u0645\u062E', - '\uFD6B': '\u0634\u0645\u062E', - '\uFD6C': '\u0634\u0645\u0645', - '\uFD6D': '\u0634\u0645\u0645', - '\uFD6E': '\u0636\u062D\u0649', - '\uFD6F': '\u0636\u062E\u0645', - '\uFD70': '\u0636\u062E\u0645', - '\uFD71': '\u0637\u0645\u062D', - '\uFD72': '\u0637\u0645\u062D', - '\uFD73': '\u0637\u0645\u0645', - '\uFD74': '\u0637\u0645\u064A', - '\uFD75': '\u0639\u062C\u0645', - '\uFD76': '\u0639\u0645\u0645', - '\uFD77': '\u0639\u0645\u0645', - '\uFD78': '\u0639\u0645\u0649', - '\uFD79': '\u063A\u0645\u0645', - '\uFD7A': '\u063A\u0645\u064A', - '\uFD7B': '\u063A\u0645\u0649', - '\uFD7C': '\u0641\u062E\u0645', - '\uFD7D': '\u0641\u062E\u0645', - '\uFD7E': '\u0642\u0645\u062D', - '\uFD7F': '\u0642\u0645\u0645', - '\uFD80': '\u0644\u062D\u0645', - '\uFD81': '\u0644\u062D\u064A', - '\uFD82': '\u0644\u062D\u0649', - '\uFD83': '\u0644\u062C\u062C', - '\uFD84': '\u0644\u062C\u062C', - '\uFD85': '\u0644\u062E\u0645', - '\uFD86': '\u0644\u062E\u0645', - '\uFD87': '\u0644\u0645\u062D', - '\uFD88': '\u0644\u0645\u062D', - '\uFD89': '\u0645\u062D\u062C', - '\uFD8A': '\u0645\u062D\u0645', - '\uFD8B': '\u0645\u062D\u064A', - '\uFD8C': '\u0645\u062C\u062D', - '\uFD8D': '\u0645\u062C\u0645', - '\uFD8E': '\u0645\u062E\u062C', - '\uFD8F': '\u0645\u062E\u0645', - '\uFD92': '\u0645\u062C\u062E', - '\uFD93': '\u0647\u0645\u062C', - '\uFD94': '\u0647\u0645\u0645', - '\uFD95': '\u0646\u062D\u0645', - '\uFD96': '\u0646\u062D\u0649', - '\uFD97': '\u0646\u062C\u0645', - '\uFD98': '\u0646\u062C\u0645', - '\uFD99': '\u0646\u062C\u0649', - '\uFD9A': '\u0646\u0645\u064A', - '\uFD9B': '\u0646\u0645\u0649', - '\uFD9C': '\u064A\u0645\u0645', - '\uFD9D': '\u064A\u0645\u0645', - '\uFD9E': '\u0628\u062E\u064A', - '\uFD9F': '\u062A\u062C\u064A', - '\uFDA0': '\u062A\u062C\u0649', - '\uFDA1': '\u062A\u062E\u064A', - '\uFDA2': '\u062A\u062E\u0649', - '\uFDA3': '\u062A\u0645\u064A', - '\uFDA4': '\u062A\u0645\u0649', - '\uFDA5': '\u062C\u0645\u064A', - '\uFDA6': '\u062C\u062D\u0649', - '\uFDA7': '\u062C\u0645\u0649', - '\uFDA8': '\u0633\u062E\u0649', - '\uFDA9': '\u0635\u062D\u064A', - '\uFDAA': '\u0634\u062D\u064A', - '\uFDAB': '\u0636\u062D\u064A', - '\uFDAC': '\u0644\u062C\u064A', - '\uFDAD': '\u0644\u0645\u064A', - '\uFDAE': '\u064A\u062D\u064A', - '\uFDAF': '\u064A\u062C\u064A', - '\uFDB0': '\u064A\u0645\u064A', - '\uFDB1': '\u0645\u0645\u064A', - '\uFDB2': '\u0642\u0645\u064A', - '\uFDB3': '\u0646\u062D\u064A', - '\uFDB4': '\u0642\u0645\u062D', - '\uFDB5': '\u0644\u062D\u0645', - '\uFDB6': '\u0639\u0645\u064A', - '\uFDB7': '\u0643\u0645\u064A', - '\uFDB8': '\u0646\u062C\u062D', - '\uFDB9': '\u0645\u062E\u064A', - '\uFDBA': '\u0644\u062C\u0645', - '\uFDBB': '\u0643\u0645\u0645', - '\uFDBC': '\u0644\u062C\u0645', - '\uFDBD': '\u0646\u062C\u062D', - '\uFDBE': '\u062C\u062D\u064A', - '\uFDBF': '\u062D\u062C\u064A', - '\uFDC0': '\u0645\u062C\u064A', - '\uFDC1': '\u0641\u0645\u064A', - '\uFDC2': '\u0628\u062D\u064A', - '\uFDC3': '\u0643\u0645\u0645', - '\uFDC4': '\u0639\u062C\u0645', - '\uFDC5': '\u0635\u0645\u0645', - '\uFDC6': '\u0633\u062E\u064A', - '\uFDC7': '\u0646\u062C\u064A', - '\uFE49': '\u203E', - '\uFE4A': '\u203E', - '\uFE4B': '\u203E', - '\uFE4C': '\u203E', - '\uFE4D': '\u005F', - '\uFE4E': '\u005F', - '\uFE4F': '\u005F', - '\uFE80': '\u0621', - '\uFE81': '\u0622', - '\uFE82': '\u0622', - '\uFE83': '\u0623', - '\uFE84': '\u0623', - '\uFE85': '\u0624', - '\uFE86': '\u0624', - '\uFE87': '\u0625', - '\uFE88': '\u0625', - '\uFE89': '\u0626', - '\uFE8A': '\u0626', - '\uFE8B': '\u0626', - '\uFE8C': '\u0626', - '\uFE8D': '\u0627', - '\uFE8E': '\u0627', - '\uFE8F': '\u0628', - '\uFE90': '\u0628', - '\uFE91': '\u0628', - '\uFE92': '\u0628', - '\uFE93': '\u0629', - '\uFE94': '\u0629', - '\uFE95': '\u062A', - '\uFE96': '\u062A', - '\uFE97': '\u062A', - '\uFE98': '\u062A', - '\uFE99': '\u062B', - '\uFE9A': '\u062B', - '\uFE9B': '\u062B', - '\uFE9C': '\u062B', - '\uFE9D': '\u062C', - '\uFE9E': '\u062C', - '\uFE9F': '\u062C', - '\uFEA0': '\u062C', - '\uFEA1': '\u062D', - '\uFEA2': '\u062D', - '\uFEA3': '\u062D', - '\uFEA4': '\u062D', - '\uFEA5': '\u062E', - '\uFEA6': '\u062E', - '\uFEA7': '\u062E', - '\uFEA8': '\u062E', - '\uFEA9': '\u062F', - '\uFEAA': '\u062F', - '\uFEAB': '\u0630', - '\uFEAC': '\u0630', - '\uFEAD': '\u0631', - '\uFEAE': '\u0631', - '\uFEAF': '\u0632', - '\uFEB0': '\u0632', - '\uFEB1': '\u0633', - '\uFEB2': '\u0633', - '\uFEB3': '\u0633', - '\uFEB4': '\u0633', - '\uFEB5': '\u0634', - '\uFEB6': '\u0634', - '\uFEB7': '\u0634', - '\uFEB8': '\u0634', - '\uFEB9': '\u0635', - '\uFEBA': '\u0635', - '\uFEBB': '\u0635', - '\uFEBC': '\u0635', - '\uFEBD': '\u0636', - '\uFEBE': '\u0636', - '\uFEBF': '\u0636', - '\uFEC0': '\u0636', - '\uFEC1': '\u0637', - '\uFEC2': '\u0637', - '\uFEC3': '\u0637', - '\uFEC4': '\u0637', - '\uFEC5': '\u0638', - '\uFEC6': '\u0638', - '\uFEC7': '\u0638', - '\uFEC8': '\u0638', - '\uFEC9': '\u0639', - '\uFECA': '\u0639', - '\uFECB': '\u0639', - '\uFECC': '\u0639', - '\uFECD': '\u063A', - '\uFECE': '\u063A', - '\uFECF': '\u063A', - '\uFED0': '\u063A', - '\uFED1': '\u0641', - '\uFED2': '\u0641', - '\uFED3': '\u0641', - '\uFED4': '\u0641', - '\uFED5': '\u0642', - '\uFED6': '\u0642', - '\uFED7': '\u0642', - '\uFED8': '\u0642', - '\uFED9': '\u0643', - '\uFEDA': '\u0643', - '\uFEDB': '\u0643', - '\uFEDC': '\u0643', - '\uFEDD': '\u0644', - '\uFEDE': '\u0644', - '\uFEDF': '\u0644', - '\uFEE0': '\u0644', - '\uFEE1': '\u0645', - '\uFEE2': '\u0645', - '\uFEE3': '\u0645', - '\uFEE4': '\u0645', - '\uFEE5': '\u0646', - '\uFEE6': '\u0646', - '\uFEE7': '\u0646', - '\uFEE8': '\u0646', - '\uFEE9': '\u0647', - '\uFEEA': '\u0647', - '\uFEEB': '\u0647', - '\uFEEC': '\u0647', - '\uFEED': '\u0648', - '\uFEEE': '\u0648', - '\uFEEF': '\u0649', - '\uFEF0': '\u0649', - '\uFEF1': '\u064A', - '\uFEF2': '\u064A', - '\uFEF3': '\u064A', - '\uFEF4': '\u064A', - '\uFEF5': '\u0644\u0622', - '\uFEF6': '\u0644\u0622', - '\uFEF7': '\u0644\u0623', - '\uFEF8': '\u0644\u0623', - '\uFEF9': '\u0644\u0625', - '\uFEFA': '\u0644\u0625', - '\uFEFB': '\u0644\u0627', - '\uFEFC': '\u0644\u0627' -}; - -function reverseIfRtl(chars) { - var charsLength = chars.length; - //reverse an arabic ligature - if (charsLength <= 1 || !isRTLRangeFor(chars.charCodeAt(0))) { - return chars; - } - var s = ''; - for (var ii = charsLength - 1; ii >= 0; ii--) { - s += chars[ii]; - } - return s; -} - -function adjustWidths(properties) { - if (!properties.fontMatrix) { - return; - } - if (properties.fontMatrix[0] === FONT_IDENTITY_MATRIX[0]) { - return; - } - // adjusting width to fontMatrix scale - var scale = 0.001 / properties.fontMatrix[0]; - var glyphsWidths = properties.widths; - for (var glyph in glyphsWidths) { - glyphsWidths[glyph] *= scale; - } - properties.defaultWidth *= scale; -} - -function getFontType(type, subtype) { - switch (type) { - case 'Type1': - return subtype === 'Type1C' ? FontType.TYPE1C : FontType.TYPE1; - case 'CIDFontType0': - return subtype === 'CIDFontType0C' ? FontType.CIDFONTTYPE0C : - FontType.CIDFONTTYPE0; - case 'OpenType': - return FontType.OPENTYPE; - case 'TrueType': - return FontType.TRUETYPE; - case 'CIDFontType2': - return FontType.CIDFONTTYPE2; - case 'MMType1': - return FontType.MMTYPE1; - case 'Type0': - return FontType.TYPE0; - default: - return FontType.UNKNOWN; - } -} - -var Glyph = (function GlyphClosure() { - function Glyph(fontChar, unicode, accent, width, vmetric, operatorListId, - isSpace) { - this.fontChar = fontChar; - this.unicode = unicode; - this.accent = accent; - this.width = width; - this.vmetric = vmetric; - this.operatorListId = operatorListId; - this.isSpace = isSpace; - } - - Glyph.prototype.matchesForCache = function(fontChar, unicode, accent, width, - vmetric, operatorListId, isSpace) { - return this.fontChar === fontChar && - this.unicode === unicode && - this.accent === accent && - this.width === width && - this.vmetric === vmetric && - this.operatorListId === operatorListId && - this.isSpace === isSpace; - }; - - return Glyph; -})(); - -var ToUnicodeMap = (function ToUnicodeMapClosure() { - function ToUnicodeMap(cmap) { - // The elements of this._map can be integers or strings, depending on how - // |cmap| was created. - this._map = cmap; - } - - ToUnicodeMap.prototype = { - get length() { - return this._map.length; - }, - - forEach: function(callback) { - for (var charCode in this._map) { - callback(charCode, this._map[charCode].charCodeAt(0)); - } - }, - - has: function(i) { - return this._map[i] !== undefined; - }, - - get: function(i) { - return this._map[i]; - }, - - charCodeOf: function(v) { - return this._map.indexOf(v); - } - }; - - return ToUnicodeMap; -})(); - -var IdentityToUnicodeMap = (function IdentityToUnicodeMapClosure() { - function IdentityToUnicodeMap(firstChar, lastChar) { - this.firstChar = firstChar; - this.lastChar = lastChar; - } - - IdentityToUnicodeMap.prototype = { - get length() { - return (this.lastChar + 1) - this.firstChar; - }, - - forEach: function (callback) { - for (var i = this.firstChar, ii = this.lastChar; i <= ii; i++) { - callback(i, i); - } - }, - - has: function (i) { - return this.firstChar <= i && i <= this.lastChar; - }, - - get: function (i) { - if (this.firstChar <= i && i <= this.lastChar) { - return String.fromCharCode(i); - } - return undefined; - }, - - charCodeOf: function (v) { - return (isInt(v) && v >= this.firstChar && v <= this.lastChar) ? v : -1; - } - }; - - return IdentityToUnicodeMap; -})(); - -var OpenTypeFileBuilder = (function OpenTypeFileBuilderClosure() { - function writeInt16(dest, offset, num) { - dest[offset] = (num >> 8) & 0xFF; - dest[offset + 1] = num & 0xFF; - } - - function writeInt32(dest, offset, num) { - dest[offset] = (num >> 24) & 0xFF; - dest[offset + 1] = (num >> 16) & 0xFF; - dest[offset + 2] = (num >> 8) & 0xFF; - dest[offset + 3] = num & 0xFF; - } - - function writeData(dest, offset, data) { - var i, ii; - if (data instanceof Uint8Array) { - dest.set(data, offset); - } else if (typeof data === 'string') { - for (i = 0, ii = data.length; i < ii; i++) { - dest[offset++] = data.charCodeAt(i) & 0xFF; - } - } else { - // treating everything else as array - for (i = 0, ii = data.length; i < ii; i++) { - dest[offset++] = data[i] & 0xFF; - } - } - } - - function OpenTypeFileBuilder(sfnt) { - this.sfnt = sfnt; - this.tables = Object.create(null); - } - - OpenTypeFileBuilder.getSearchParams = - function OpenTypeFileBuilder_getSearchParams(entriesCount, entrySize) { - var maxPower2 = 1, log2 = 0; - while ((maxPower2 ^ entriesCount) > maxPower2) { - maxPower2 <<= 1; - log2++; - } - var searchRange = maxPower2 * entrySize; - return { - range: searchRange, - entry: log2, - rangeShift: entrySize * entriesCount - searchRange - }; - }; - - var OTF_HEADER_SIZE = 12; - var OTF_TABLE_ENTRY_SIZE = 16; - - OpenTypeFileBuilder.prototype = { - toArray: function OpenTypeFileBuilder_toArray() { - var sfnt = this.sfnt; - - // Tables needs to be written by ascendant alphabetic order - var tables = this.tables; - var tablesNames = Object.keys(tables); - tablesNames.sort(); - var numTables = tablesNames.length; - - var i, j, jj, table, tableName; - // layout the tables data - var offset = OTF_HEADER_SIZE + numTables * OTF_TABLE_ENTRY_SIZE; - var tableOffsets = [offset]; - for (i = 0; i < numTables; i++) { - table = tables[tablesNames[i]]; - var paddedLength = ((table.length + 3) & ~3) >>> 0; - offset += paddedLength; - tableOffsets.push(offset); - } - - var file = new Uint8Array(offset); - // write the table data first (mostly for checksum) - for (i = 0; i < numTables; i++) { - table = tables[tablesNames[i]]; - writeData(file, tableOffsets[i], table); - } - - // sfnt version (4 bytes) - if (sfnt === 'true') { - // Windows hates the Mac TrueType sfnt version number - sfnt = string32(0x00010000); - } - file[0] = sfnt.charCodeAt(0) & 0xFF; - file[1] = sfnt.charCodeAt(1) & 0xFF; - file[2] = sfnt.charCodeAt(2) & 0xFF; - file[3] = sfnt.charCodeAt(3) & 0xFF; - - // numTables (2 bytes) - writeInt16(file, 4, numTables); - - var searchParams = OpenTypeFileBuilder.getSearchParams(numTables, 16); - - // searchRange (2 bytes) - writeInt16(file, 6, searchParams.range); - // entrySelector (2 bytes) - writeInt16(file, 8, searchParams.entry); - // rangeShift (2 bytes) - writeInt16(file, 10, searchParams.rangeShift); - - offset = OTF_HEADER_SIZE; - // writing table entries - for (i = 0; i < numTables; i++) { - tableName = tablesNames[i]; - file[offset] = tableName.charCodeAt(0) & 0xFF; - file[offset + 1] = tableName.charCodeAt(1) & 0xFF; - file[offset + 2] = tableName.charCodeAt(2) & 0xFF; - file[offset + 3] = tableName.charCodeAt(3) & 0xFF; - - // checksum - var checksum = 0; - for (j = tableOffsets[i], jj = tableOffsets[i + 1]; j < jj; j += 4) { - var quad = (file[j] << 24) + (file[j + 1] << 16) + - (file[j + 2] << 8) + file[j + 3]; - checksum = (checksum + quad) | 0; - } - writeInt32(file, offset + 4, checksum); - - // offset - writeInt32(file, offset + 8, tableOffsets[i]); - // length - writeInt32(file, offset + 12, tables[tableName].length); - - offset += OTF_TABLE_ENTRY_SIZE; - } - return file; - }, - - addTable: function OpenTypeFileBuilder_addTable(tag, data) { - if (tag in this.tables) { - throw new Error('Table ' + tag + ' already exists'); - } - this.tables[tag] = data; - } - }; - - return OpenTypeFileBuilder; -})(); - -// Problematic Unicode characters in the fonts that needs to be moved to avoid -// issues when they are painted on the canvas, e.g. complex-script shaping or -// control/whitespace characters. The ranges are listed in pairs: the first item -// is a code of the first problematic code, the second one is the next -// non-problematic code. The ranges must be in sorted order. -var ProblematicCharRanges = new Int32Array([ - // Control characters. - 0x0000, 0x0020, - 0x007F, 0x00A1, - 0x00AD, 0x00AE, - // Chars that is used in complex-script shaping. - 0x0600, 0x0780, - 0x08A0, 0x10A0, - 0x1780, 0x1800, - // General punctuation chars. - 0x2000, 0x2010, - 0x2011, 0x2012, - 0x2028, 0x2030, - 0x205F, 0x2070, - 0x25CC, 0x25CD, - // Chars that is used in complex-script shaping. - 0xAA60, 0xAA80, - // Specials Unicode block. - 0xFFF0, 0x10000 -]); - -/** - * 'Font' is the class the outside world should use, it encapsulate all the font - * decoding logics whatever type it is (assuming the font type is supported). - * - * For example to read a Type1 font and to attach it to the document: - * var type1Font = new Font("MyFontName", binaryFile, propertiesObject); - * type1Font.bind(); - */ -var Font = (function FontClosure() { - function Font(name, file, properties) { - var charCode, glyphName, fontChar; - - this.name = name; - this.loadedName = properties.loadedName; - this.isType3Font = properties.isType3Font; - this.sizes = []; - - this.glyphCache = {}; - - var names = name.split('+'); - names = names.length > 1 ? names[1] : names[0]; - names = names.split(/[-,_]/g)[0]; - this.isSerifFont = !!(properties.flags & FontFlags.Serif); - this.isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); - this.isMonospace = !!(properties.flags & FontFlags.FixedPitch); - - var type = properties.type; - var subtype = properties.subtype; - this.type = type; - - this.fallbackName = (this.isMonospace ? 'monospace' : - (this.isSerifFont ? 'serif' : 'sans-serif')); - - this.differences = properties.differences; - this.widths = properties.widths; - this.defaultWidth = properties.defaultWidth; - this.composite = properties.composite; - this.wideChars = properties.wideChars; - this.cMap = properties.cMap; - this.ascent = properties.ascent / PDF_GLYPH_SPACE_UNITS; - this.descent = properties.descent / PDF_GLYPH_SPACE_UNITS; - this.fontMatrix = properties.fontMatrix; - this.bbox = properties.bbox; - - this.toUnicode = properties.toUnicode = this.buildToUnicode(properties); - - this.toFontChar = []; - - if (properties.type === 'Type3') { - for (charCode = 0; charCode < 256; charCode++) { - this.toFontChar[charCode] = (this.differences[charCode] || - properties.defaultEncoding[charCode]); - } - this.fontType = FontType.TYPE3; - return; - } - - this.cidEncoding = properties.cidEncoding; - this.vertical = properties.vertical; - if (this.vertical) { - this.vmetrics = properties.vmetrics; - this.defaultVMetrics = properties.defaultVMetrics; - } - - if (!file || file.isEmpty) { - if (file) { - // Some bad PDF generators will include empty font files, - // attempting to recover by assuming that no file exists. - warn('Font file is empty in "' + name + '" (' + this.loadedName + ')'); - } - - this.missingFile = true; - // The file data is not specified. Trying to fix the font name - // to be used with the canvas.font. - var fontName = name.replace(/[,_]/g, '-'); - var isStandardFont = !!stdFontMap[fontName] || - !!(nonStdFontMap[fontName] && stdFontMap[nonStdFontMap[fontName]]); - fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName; - - this.bold = (fontName.search(/bold/gi) !== -1); - this.italic = ((fontName.search(/oblique/gi) !== -1) || - (fontName.search(/italic/gi) !== -1)); - - // Use 'name' instead of 'fontName' here because the original - // name ArialBlack for example will be replaced by Helvetica. - this.black = (name.search(/Black/g) !== -1); - - // if at least one width is present, remeasure all chars when exists - this.remeasure = Object.keys(this.widths).length > 0; - if (isStandardFont && type === 'CIDFontType2' && - properties.cidEncoding.indexOf('Identity-') === 0) { - // Standard fonts might be embedded as CID font without glyph mapping. - // Building one based on GlyphMapForStandardFonts. - var map = []; - for (charCode in GlyphMapForStandardFonts) { - map[+charCode] = GlyphMapForStandardFonts[charCode]; - } - if (/ArialBlack/i.test(name)) { - for (charCode in SupplementalGlyphMapForArialBlack) { - map[+charCode] = SupplementalGlyphMapForArialBlack[charCode]; - } - } - var isIdentityUnicode = this.toUnicode instanceof IdentityToUnicodeMap; - if (!isIdentityUnicode) { - this.toUnicode.forEach(function(charCode, unicodeCharCode) { - map[+charCode] = unicodeCharCode; - }); - } - this.toFontChar = map; - this.toUnicode = new ToUnicodeMap(map); - } else if (/Symbol/i.test(fontName)) { - var symbols = Encodings.SymbolSetEncoding; - for (charCode in symbols) { - fontChar = GlyphsUnicode[symbols[charCode]]; - if (!fontChar) { - continue; - } - this.toFontChar[charCode] = fontChar; - } - for (charCode in properties.differences) { - fontChar = GlyphsUnicode[properties.differences[charCode]]; - if (!fontChar) { - continue; - } - this.toFontChar[charCode] = fontChar; - } - } else if (/Dingbats/i.test(fontName)) { - if (/Wingdings/i.test(name)) { - warn('Wingdings font without embedded font file, ' + - 'falling back to the ZapfDingbats encoding.'); - } - var dingbats = Encodings.ZapfDingbatsEncoding; - for (charCode in dingbats) { - fontChar = DingbatsGlyphsUnicode[dingbats[charCode]]; - if (!fontChar) { - continue; - } - this.toFontChar[charCode] = fontChar; - } - for (charCode in properties.differences) { - fontChar = DingbatsGlyphsUnicode[properties.differences[charCode]]; - if (!fontChar) { - continue; - } - this.toFontChar[charCode] = fontChar; - } - } else if (isStandardFont) { - this.toFontChar = []; - for (charCode in properties.defaultEncoding) { - glyphName = (properties.differences[charCode] || - properties.defaultEncoding[charCode]); - this.toFontChar[charCode] = GlyphsUnicode[glyphName]; - } - } else { - var unicodeCharCode, notCidFont = (type.indexOf('CIDFontType') === -1); - this.toUnicode.forEach(function(charCode, unicodeCharCode) { - if (notCidFont) { - glyphName = (properties.differences[charCode] || - properties.defaultEncoding[charCode]); - unicodeCharCode = (GlyphsUnicode[glyphName] || unicodeCharCode); - } - this.toFontChar[charCode] = unicodeCharCode; - }.bind(this)); - } - this.loadedName = fontName.split('-')[0]; - this.loading = false; - this.fontType = getFontType(type, subtype); - return; - } - - // Some fonts might use wrong font types for Type1C or CIDFontType0C - if (subtype === 'Type1C' && (type !== 'Type1' && type !== 'MMType1')) { - // Some TrueType fonts by mistake claim Type1C - if (isTrueTypeFile(file)) { - subtype = 'TrueType'; - } else { - type = 'Type1'; - } - } - if (subtype === 'CIDFontType0C' && type !== 'CIDFontType0') { - type = 'CIDFontType0'; - } - if (subtype === 'OpenType') { - type = 'OpenType'; - } - // Some CIDFontType0C fonts by mistake claim CIDFontType0. - if (type === 'CIDFontType0') { - subtype = isType1File(file) ? 'CIDFontType0' : 'CIDFontType0C'; - } - - var data; - switch (type) { - case 'MMType1': - info('MMType1 font (' + name + '), falling back to Type1.'); - /* falls through */ - case 'Type1': - case 'CIDFontType0': - this.mimetype = 'font/opentype'; - - var cff = (subtype === 'Type1C' || subtype === 'CIDFontType0C') ? - new CFFFont(file, properties) : new Type1Font(name, file, properties); - - adjustWidths(properties); - - // Wrap the CFF data inside an OTF font file - data = this.convert(name, cff, properties); - break; - - case 'OpenType': - case 'TrueType': - case 'CIDFontType2': - this.mimetype = 'font/opentype'; - - // Repair the TrueType file. It is can be damaged in the point of - // view of the sanitizer - data = this.checkAndRepair(name, file, properties); - if (this.isOpenType) { - adjustWidths(properties); - - type = 'OpenType'; - } - break; - - default: - error('Font ' + type + ' is not supported'); - break; - } - - this.data = data; - this.fontType = getFontType(type, subtype); - - // Transfer some properties again that could change during font conversion - this.fontMatrix = properties.fontMatrix; - this.widths = properties.widths; - this.defaultWidth = properties.defaultWidth; - this.encoding = properties.baseEncoding; - this.seacMap = properties.seacMap; - - this.loading = true; - } - - Font.getFontID = (function () { - var ID = 1; - return function Font_getFontID() { - return String(ID++); - }; - })(); - - function int16(b0, b1) { - return (b0 << 8) + b1; - } - - function int32(b0, b1, b2, b3) { - return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; - } - - function string16(value) { - return String.fromCharCode((value >> 8) & 0xff, value & 0xff); - } - - function safeString16(value) { - // clamp value to the 16-bit int range - value = (value > 0x7FFF ? 0x7FFF : (value < -0x8000 ? -0x8000 : value)); - return String.fromCharCode((value >> 8) & 0xff, value & 0xff); - } - - function isTrueTypeFile(file) { - var header = file.peekBytes(4); - return readUint32(header, 0) === 0x00010000; - } - - function isType1File(file) { - var header = file.peekBytes(2); - // All Type1 font programs must begin with the comment '%!' (0x25 + 0x21). - if (header[0] === 0x25 && header[1] === 0x21) { - return true; - } - // ... obviously some fonts violate that part of the specification, - // please refer to the comment in |Type1Font| below. - if (header[0] === 0x80 && header[1] === 0x01) { // pfb file header. - return true; - } - return false; - } - - /** - * Helper function for `adjustMapping`. - * @return {boolean} - */ - function isProblematicUnicodeLocation(code) { - // Using binary search to find a range start. - var i = 0, j = ProblematicCharRanges.length - 1; - while (i < j) { - var c = (i + j + 1) >> 1; - if (code < ProblematicCharRanges[c]) { - j = c - 1; - } else { - i = c; - } - } - // Even index means code in problematic range. - return !(i & 1); - } - - /** - * Rebuilds the char code to glyph ID map by trying to replace the char codes - * with their unicode value. It also moves char codes that are in known - * problematic locations. - * @return {Object} Two properties: - * 'toFontChar' - maps original char codes(the value that will be read - * from commands such as show text) to the char codes that will be used in the - * font that we build - * 'charCodeToGlyphId' - maps the new font char codes to glyph ids - */ - function adjustMapping(charCodeToGlyphId, properties) { - var toUnicode = properties.toUnicode; - var isSymbolic = !!(properties.flags & FontFlags.Symbolic); - var isIdentityUnicode = - properties.toUnicode instanceof IdentityToUnicodeMap; - var newMap = Object.create(null); - var toFontChar = []; - var usedFontCharCodes = []; - var nextAvailableFontCharCode = PRIVATE_USE_OFFSET_START; - for (var originalCharCode in charCodeToGlyphId) { - originalCharCode |= 0; - var glyphId = charCodeToGlyphId[originalCharCode]; - var fontCharCode = originalCharCode; - // First try to map the value to a unicode position if a non identity map - // was created. - var hasUnicodeValue = false; - if (!isIdentityUnicode && toUnicode.has(originalCharCode)) { - var unicode = toUnicode.get(fontCharCode); - // TODO: Try to map ligatures to the correct spot. - if (unicode.length === 1) { - fontCharCode = unicode.charCodeAt(0); - } - // For Symbolic fonts, we trust the `unicode` value if and only if the - // font includes either `ToUnicode` or `Encoding` data, since otherwise - // `toUnicode` may not be correct. - hasUnicodeValue = properties.hasIncludedToUnicodeMap || - properties.hasEncoding; - } - // Try to move control characters, special characters and already mapped - // characters to the private use area since they will not be drawn by - // canvas if left in their current position. Also, move characters if the - // font was symbolic and there is only an identity unicode map since the - // characters probably aren't in the correct position (fixes an issue - // with firefox and thuluthfont). - if ((usedFontCharCodes[fontCharCode] !== undefined || - isProblematicUnicodeLocation(fontCharCode) || - (isSymbolic && !hasUnicodeValue)) && - nextAvailableFontCharCode <= PRIVATE_USE_OFFSET_END) { // Room left. - // Loop to try and find a free spot in the private use area. - do { - fontCharCode = nextAvailableFontCharCode++; - - if (SKIP_PRIVATE_USE_RANGE_F000_TO_F01F && fontCharCode === 0xF000) { - fontCharCode = 0xF020; - nextAvailableFontCharCode = fontCharCode + 1; - } - - } while (usedFontCharCodes[fontCharCode] !== undefined && - nextAvailableFontCharCode <= PRIVATE_USE_OFFSET_END); - } - - newMap[fontCharCode] = glyphId; - toFontChar[originalCharCode] = fontCharCode; - usedFontCharCodes[fontCharCode] = true; - } - return { - toFontChar: toFontChar, - charCodeToGlyphId: newMap, - nextAvailableFontCharCode: nextAvailableFontCharCode - }; - } - - function getRanges(glyphs, numGlyphs) { - // Array.sort() sorts by characters, not numerically, so convert to an - // array of characters. - var codes = []; - for (var charCode in glyphs) { - // Remove an invalid glyph ID mappings to make OTS happy. - if (glyphs[charCode] >= numGlyphs) { - continue; - } - codes.push({ fontCharCode: charCode | 0, glyphId: glyphs[charCode] }); - } - codes.sort(function fontGetRangesSort(a, b) { - return a.fontCharCode - b.fontCharCode; - }); - - // Split the sorted codes into ranges. - var ranges = []; - var length = codes.length; - for (var n = 0; n < length; ) { - var start = codes[n].fontCharCode; - var codeIndices = [codes[n].glyphId]; - ++n; - var end = start; - while (n < length && end + 1 === codes[n].fontCharCode) { - codeIndices.push(codes[n].glyphId); - ++end; - ++n; - if (end === 0xFFFF) { - break; - } - } - ranges.push([start, end, codeIndices]); - } - - return ranges; - } - - function createCmapTable(glyphs, numGlyphs) { - var ranges = getRanges(glyphs, numGlyphs); - var numTables = ranges[ranges.length - 1][1] > 0xFFFF ? 2 : 1; - var cmap = '\x00\x00' + // version - string16(numTables) + // numTables - '\x00\x03' + // platformID - '\x00\x01' + // encodingID - string32(4 + numTables * 8); // start of the table record - - var i, ii, j, jj; - for (i = ranges.length - 1; i >= 0; --i) { - if (ranges[i][0] <= 0xFFFF) { break; } - } - var bmpLength = i + 1; - - if (ranges[i][0] < 0xFFFF && ranges[i][1] === 0xFFFF) { - ranges[i][1] = 0xFFFE; - } - var trailingRangesCount = ranges[i][1] < 0xFFFF ? 1 : 0; - var segCount = bmpLength + trailingRangesCount; - var searchParams = OpenTypeFileBuilder.getSearchParams(segCount, 2); - - // Fill up the 4 parallel arrays describing the segments. - var startCount = ''; - var endCount = ''; - var idDeltas = ''; - var idRangeOffsets = ''; - var glyphsIds = ''; - var bias = 0; - - var range, start, end, codes; - for (i = 0, ii = bmpLength; i < ii; i++) { - range = ranges[i]; - start = range[0]; - end = range[1]; - startCount += string16(start); - endCount += string16(end); - codes = range[2]; - var contiguous = true; - for (j = 1, jj = codes.length; j < jj; ++j) { - if (codes[j] !== codes[j - 1] + 1) { - contiguous = false; - break; - } - } - if (!contiguous) { - var offset = (segCount - i) * 2 + bias * 2; - bias += (end - start + 1); - - idDeltas += string16(0); - idRangeOffsets += string16(offset); - - for (j = 0, jj = codes.length; j < jj; ++j) { - glyphsIds += string16(codes[j]); - } - } else { - var startCode = codes[0]; - - idDeltas += string16((startCode - start) & 0xFFFF); - idRangeOffsets += string16(0); - } - } - - if (trailingRangesCount > 0) { - endCount += '\xFF\xFF'; - startCount += '\xFF\xFF'; - idDeltas += '\x00\x01'; - idRangeOffsets += '\x00\x00'; - } - - var format314 = '\x00\x00' + // language - string16(2 * segCount) + - string16(searchParams.range) + - string16(searchParams.entry) + - string16(searchParams.rangeShift) + - endCount + '\x00\x00' + startCount + - idDeltas + idRangeOffsets + glyphsIds; - - var format31012 = ''; - var header31012 = ''; - if (numTables > 1) { - cmap += '\x00\x03' + // platformID - '\x00\x0A' + // encodingID - string32(4 + numTables * 8 + - 4 + format314.length); // start of the table record - format31012 = ''; - for (i = 0, ii = ranges.length; i < ii; i++) { - range = ranges[i]; - start = range[0]; - codes = range[2]; - var code = codes[0]; - for (j = 1, jj = codes.length; j < jj; ++j) { - if (codes[j] !== codes[j - 1] + 1) { - end = range[0] + j - 1; - format31012 += string32(start) + // startCharCode - string32(end) + // endCharCode - string32(code); // startGlyphID - start = end + 1; - code = codes[j]; - } - } - format31012 += string32(start) + // startCharCode - string32(range[1]) + // endCharCode - string32(code); // startGlyphID - } - header31012 = '\x00\x0C' + // format - '\x00\x00' + // reserved - string32(format31012.length + 16) + // length - '\x00\x00\x00\x00' + // language - string32(format31012.length / 12); // nGroups - } - - return cmap + '\x00\x04' + // format - string16(format314.length + 4) + // length - format314 + header31012 + format31012; - } - - function validateOS2Table(os2) { - var stream = new Stream(os2.data); - var version = stream.getUint16(); - // TODO verify all OS/2 tables fields, but currently we validate only those - // that give us issues - stream.getBytes(60); // skipping type, misc sizes, panose, unicode ranges - var selection = stream.getUint16(); - if (version < 4 && (selection & 0x0300)) { - return false; - } - var firstChar = stream.getUint16(); - var lastChar = stream.getUint16(); - if (firstChar > lastChar) { - return false; - } - stream.getBytes(6); // skipping sTypoAscender/Descender/LineGap - var usWinAscent = stream.getUint16(); - if (usWinAscent === 0) { // makes font unreadable by windows - return false; - } - - // OS/2 appears to be valid, resetting some fields - os2.data[8] = os2.data[9] = 0; // IE rejects fonts if fsType != 0 - return true; - } - - function createOS2Table(properties, charstrings, override) { - override = override || { - unitsPerEm: 0, - yMax: 0, - yMin: 0, - ascent: 0, - descent: 0 - }; - - var ulUnicodeRange1 = 0; - var ulUnicodeRange2 = 0; - var ulUnicodeRange3 = 0; - var ulUnicodeRange4 = 0; - - var firstCharIndex = null; - var lastCharIndex = 0; - - if (charstrings) { - for (var code in charstrings) { - code |= 0; - if (firstCharIndex > code || !firstCharIndex) { - firstCharIndex = code; - } - if (lastCharIndex < code) { - lastCharIndex = code; - } - - var position = getUnicodeRangeFor(code); - if (position < 32) { - ulUnicodeRange1 |= 1 << position; - } else if (position < 64) { - ulUnicodeRange2 |= 1 << position - 32; - } else if (position < 96) { - ulUnicodeRange3 |= 1 << position - 64; - } else if (position < 123) { - ulUnicodeRange4 |= 1 << position - 96; - } else { - error('Unicode ranges Bits > 123 are reserved for internal usage'); - } - } - } else { - // TODO - firstCharIndex = 0; - lastCharIndex = 255; - } - - var bbox = properties.bbox || [0, 0, 0, 0]; - var unitsPerEm = (override.unitsPerEm || - 1 / (properties.fontMatrix || FONT_IDENTITY_MATRIX)[0]); - - // if the font units differ to the PDF glyph space units - // then scale up the values - var scale = (properties.ascentScaled ? 1.0 : - unitsPerEm / PDF_GLYPH_SPACE_UNITS); - - var typoAscent = (override.ascent || - Math.round(scale * (properties.ascent || bbox[3]))); - var typoDescent = (override.descent || - Math.round(scale * (properties.descent || bbox[1]))); - if (typoDescent > 0 && properties.descent > 0 && bbox[1] < 0) { - typoDescent = -typoDescent; // fixing incorrect descent - } - var winAscent = override.yMax || typoAscent; - var winDescent = -override.yMin || -typoDescent; - - return '\x00\x03' + // version - '\x02\x24' + // xAvgCharWidth - '\x01\xF4' + // usWeightClass - '\x00\x05' + // usWidthClass - '\x00\x00' + // fstype (0 to let the font loads via font-face on IE) - '\x02\x8A' + // ySubscriptXSize - '\x02\xBB' + // ySubscriptYSize - '\x00\x00' + // ySubscriptXOffset - '\x00\x8C' + // ySubscriptYOffset - '\x02\x8A' + // ySuperScriptXSize - '\x02\xBB' + // ySuperScriptYSize - '\x00\x00' + // ySuperScriptXOffset - '\x01\xDF' + // ySuperScriptYOffset - '\x00\x31' + // yStrikeOutSize - '\x01\x02' + // yStrikeOutPosition - '\x00\x00' + // sFamilyClass - '\x00\x00\x06' + - String.fromCharCode(properties.fixedPitch ? 0x09 : 0x00) + - '\x00\x00\x00\x00\x00\x00' + // Panose - string32(ulUnicodeRange1) + // ulUnicodeRange1 (Bits 0-31) - string32(ulUnicodeRange2) + // ulUnicodeRange2 (Bits 32-63) - string32(ulUnicodeRange3) + // ulUnicodeRange3 (Bits 64-95) - string32(ulUnicodeRange4) + // ulUnicodeRange4 (Bits 96-127) - '\x2A\x32\x31\x2A' + // achVendID - string16(properties.italicAngle ? 1 : 0) + // fsSelection - string16(firstCharIndex || - properties.firstChar) + // usFirstCharIndex - string16(lastCharIndex || properties.lastChar) + // usLastCharIndex - string16(typoAscent) + // sTypoAscender - string16(typoDescent) + // sTypoDescender - '\x00\x64' + // sTypoLineGap (7%-10% of the unitsPerEM value) - string16(winAscent) + // usWinAscent - string16(winDescent) + // usWinDescent - '\x00\x00\x00\x00' + // ulCodePageRange1 (Bits 0-31) - '\x00\x00\x00\x00' + // ulCodePageRange2 (Bits 32-63) - string16(properties.xHeight) + // sxHeight - string16(properties.capHeight) + // sCapHeight - string16(0) + // usDefaultChar - string16(firstCharIndex || properties.firstChar) + // usBreakChar - '\x00\x03'; // usMaxContext - } - - function createPostTable(properties) { - var angle = Math.floor(properties.italicAngle * (Math.pow(2, 16))); - return ('\x00\x03\x00\x00' + // Version number - string32(angle) + // italicAngle - '\x00\x00' + // underlinePosition - '\x00\x00' + // underlineThickness - string32(properties.fixedPitch) + // isFixedPitch - '\x00\x00\x00\x00' + // minMemType42 - '\x00\x00\x00\x00' + // maxMemType42 - '\x00\x00\x00\x00' + // minMemType1 - '\x00\x00\x00\x00'); // maxMemType1 - } - - function createNameTable(name, proto) { - if (!proto) { - proto = [[], []]; // no strings and unicode strings - } - - var strings = [ - proto[0][0] || 'Original licence', // 0.Copyright - proto[0][1] || name, // 1.Font family - proto[0][2] || 'Unknown', // 2.Font subfamily (font weight) - proto[0][3] || 'uniqueID', // 3.Unique ID - proto[0][4] || name, // 4.Full font name - proto[0][5] || 'Version 0.11', // 5.Version - proto[0][6] || '', // 6.Postscript name - proto[0][7] || 'Unknown', // 7.Trademark - proto[0][8] || 'Unknown', // 8.Manufacturer - proto[0][9] || 'Unknown' // 9.Designer - ]; - - // Mac want 1-byte per character strings while Windows want - // 2-bytes per character, so duplicate the names table - var stringsUnicode = []; - var i, ii, j, jj, str; - for (i = 0, ii = strings.length; i < ii; i++) { - str = proto[1][i] || strings[i]; - - var strBufUnicode = []; - for (j = 0, jj = str.length; j < jj; j++) { - strBufUnicode.push(string16(str.charCodeAt(j))); - } - stringsUnicode.push(strBufUnicode.join('')); - } - - var names = [strings, stringsUnicode]; - var platforms = ['\x00\x01', '\x00\x03']; - var encodings = ['\x00\x00', '\x00\x01']; - var languages = ['\x00\x00', '\x04\x09']; - - var namesRecordCount = strings.length * platforms.length; - var nameTable = - '\x00\x00' + // format - string16(namesRecordCount) + // Number of names Record - string16(namesRecordCount * 12 + 6); // Storage - - // Build the name records field - var strOffset = 0; - for (i = 0, ii = platforms.length; i < ii; i++) { - var strs = names[i]; - for (j = 0, jj = strs.length; j < jj; j++) { - str = strs[j]; - var nameRecord = - platforms[i] + // platform ID - encodings[i] + // encoding ID - languages[i] + // language ID - string16(j) + // name ID - string16(str.length) + - string16(strOffset); - nameTable += nameRecord; - strOffset += str.length; - } - } - - nameTable += strings.join('') + stringsUnicode.join(''); - return nameTable; - } - - Font.prototype = { - name: null, - font: null, - mimetype: null, - encoding: null, - get renderer() { - var renderer = FontRendererFactory.create(this); - return shadow(this, 'renderer', renderer); - }, - - exportData: function Font_exportData() { - var data = {}; - for (var i in this) { - if (this.hasOwnProperty(i)) { - data[i] = this[i]; - } - } - return data; - }, - - checkAndRepair: function Font_checkAndRepair(name, font, properties) { - function readTableEntry(file) { - var tag = bytesToString(file.getBytes(4)); - - var checksum = file.getInt32(); - var offset = file.getInt32() >>> 0; - var length = file.getInt32() >>> 0; - - // Read the table associated data - var previousPosition = file.pos; - file.pos = file.start ? file.start : 0; - file.skip(offset); - var data = file.getBytes(length); - file.pos = previousPosition; - - if (tag === 'head') { - // clearing checksum adjustment - data[8] = data[9] = data[10] = data[11] = 0; - data[17] |= 0x20; //Set font optimized for cleartype flag - } - - return { - tag: tag, - checksum: checksum, - length: length, - offset: offset, - data: data - }; - } - - function readOpenTypeHeader(ttf) { - return { - version: bytesToString(ttf.getBytes(4)), - numTables: ttf.getUint16(), - searchRange: ttf.getUint16(), - entrySelector: ttf.getUint16(), - rangeShift: ttf.getUint16() - }; - } - - /** - * Read the appropriate subtable from the cmap according to 9.6.6.4 from - * PDF spec - */ - function readCmapTable(cmap, font, isSymbolicFont, hasEncoding) { - if (!cmap) { - warn('No cmap table available.'); - return { - platformId: -1, - encodingId: -1, - mappings: [], - hasShortCmap: false - }; - } - var segment; - var start = (font.start ? font.start : 0) + cmap.offset; - font.pos = start; - - var version = font.getUint16(); - var numTables = font.getUint16(); - - var potentialTable; - var canBreak = false; - // There's an order of preference in terms of which cmap subtable to - // use: - // - non-symbolic fonts the preference is a 3,1 table then a 1,0 table - // - symbolic fonts the preference is a 3,0 table then a 1,0 table - // The following takes advantage of the fact that the tables are sorted - // to work. - for (var i = 0; i < numTables; i++) { - var platformId = font.getUint16(); - var encodingId = font.getUint16(); - var offset = font.getInt32() >>> 0; - var useTable = false; - - if (platformId === 0 && encodingId === 0) { - useTable = true; - // Continue the loop since there still may be a higher priority - // table. - } else if (platformId === 1 && encodingId === 0) { - useTable = true; - // Continue the loop since there still may be a higher priority - // table. - } else if (platformId === 3 && encodingId === 1 && - ((!isSymbolicFont && hasEncoding) || !potentialTable)) { - useTable = true; - if (!isSymbolicFont) { - canBreak = true; - } - } else if (isSymbolicFont && platformId === 3 && encodingId === 0) { - useTable = true; - canBreak = true; - } - - if (useTable) { - potentialTable = { - platformId: platformId, - encodingId: encodingId, - offset: offset - }; - } - if (canBreak) { - break; - } - } - - if (potentialTable) { - font.pos = start + potentialTable.offset; - } - if (!potentialTable || font.peekByte() === -1) { - warn('Could not find a preferred cmap table.'); - return { - platformId: -1, - encodingId: -1, - mappings: [], - hasShortCmap: false - }; - } - - var format = font.getUint16(); - var length = font.getUint16(); - var language = font.getUint16(); - - var hasShortCmap = false; - var mappings = []; - var j, glyphId; - - // TODO(mack): refactor this cmap subtable reading logic out - if (format === 0) { - for (j = 0; j < 256; j++) { - var index = font.getByte(); - if (!index) { - continue; - } - mappings.push({ - charCode: j, - glyphId: index - }); - } - hasShortCmap = true; - } else if (format === 4) { - // re-creating the table in format 4 since the encoding - // might be changed - var segCount = (font.getUint16() >> 1); - font.getBytes(6); // skipping range fields - var segIndex, segments = []; - for (segIndex = 0; segIndex < segCount; segIndex++) { - segments.push({ end: font.getUint16() }); - } - font.getUint16(); - for (segIndex = 0; segIndex < segCount; segIndex++) { - segments[segIndex].start = font.getUint16(); - } - - for (segIndex = 0; segIndex < segCount; segIndex++) { - segments[segIndex].delta = font.getUint16(); - } - - var offsetsCount = 0; - for (segIndex = 0; segIndex < segCount; segIndex++) { - segment = segments[segIndex]; - var rangeOffset = font.getUint16(); - if (!rangeOffset) { - segment.offsetIndex = -1; - continue; - } - - var offsetIndex = (rangeOffset >> 1) - (segCount - segIndex); - segment.offsetIndex = offsetIndex; - offsetsCount = Math.max(offsetsCount, offsetIndex + - segment.end - segment.start + 1); - } - - var offsets = []; - for (j = 0; j < offsetsCount; j++) { - offsets.push(font.getUint16()); - } - - for (segIndex = 0; segIndex < segCount; segIndex++) { - segment = segments[segIndex]; - start = segment.start; - var end = segment.end; - var delta = segment.delta; - offsetIndex = segment.offsetIndex; - - for (j = start; j <= end; j++) { - if (j === 0xFFFF) { - continue; - } - - glyphId = (offsetIndex < 0 ? - j : offsets[offsetIndex + j - start]); - glyphId = (glyphId + delta) & 0xFFFF; - if (glyphId === 0) { - continue; - } - mappings.push({ - charCode: j, - glyphId: glyphId - }); - } - } - } else if (format === 6) { - // Format 6 is a 2-bytes dense mapping, which means the font data - // lives glue together even if they are pretty far in the unicode - // table. (This looks weird, so I can have missed something), this - // works on Linux but seems to fails on Mac so let's rewrite the - // cmap table to a 3-1-4 style - var firstCode = font.getUint16(); - var entryCount = font.getUint16(); - - for (j = 0; j < entryCount; j++) { - glyphId = font.getUint16(); - var charCode = firstCode + j; - - mappings.push({ - charCode: charCode, - glyphId: glyphId - }); - } - } else { - warn('cmap table has unsupported format: ' + format); - return { - platformId: -1, - encodingId: -1, - mappings: [], - hasShortCmap: false - }; - } - - // removing duplicate entries - mappings.sort(function (a, b) { - return a.charCode - b.charCode; - }); - for (i = 1; i < mappings.length; i++) { - if (mappings[i - 1].charCode === mappings[i].charCode) { - mappings.splice(i, 1); - i--; - } - } - - return { - platformId: potentialTable.platformId, - encodingId: potentialTable.encodingId, - mappings: mappings, - hasShortCmap: hasShortCmap - }; - } - - function sanitizeMetrics(font, header, metrics, numGlyphs) { - if (!header) { - if (metrics) { - metrics.data = null; - } - return; - } - - font.pos = (font.start ? font.start : 0) + header.offset; - font.pos += header.length - 2; - var numOfMetrics = font.getUint16(); - - if (numOfMetrics > numGlyphs) { - info('The numOfMetrics (' + numOfMetrics + ') should not be ' + - 'greater than the numGlyphs (' + numGlyphs + ')'); - // Reduce numOfMetrics if it is greater than numGlyphs - numOfMetrics = numGlyphs; - header.data[34] = (numOfMetrics & 0xff00) >> 8; - header.data[35] = numOfMetrics & 0x00ff; - } - - var numOfSidebearings = numGlyphs - numOfMetrics; - var numMissing = numOfSidebearings - - ((metrics.length - numOfMetrics * 4) >> 1); - - if (numMissing > 0) { - // For each missing glyph, we set both the width and lsb to 0 (zero). - // Since we need to add two properties for each glyph, this explains - // the use of |numMissing * 2| when initializing the typed array. - var entries = new Uint8Array(metrics.length + numMissing * 2); - entries.set(metrics.data); - metrics.data = entries; - } - } - - function sanitizeGlyph(source, sourceStart, sourceEnd, dest, destStart, - hintsValid) { - if (sourceEnd - sourceStart <= 12) { - // glyph with data less than 12 is invalid one - return 0; - } - var glyf = source.subarray(sourceStart, sourceEnd); - var contoursCount = (glyf[0] << 8) | glyf[1]; - if (contoursCount & 0x8000) { - // complex glyph, writing as is - dest.set(glyf, destStart); - return glyf.length; - } - - var i, j = 10, flagsCount = 0; - for (i = 0; i < contoursCount; i++) { - var endPoint = (glyf[j] << 8) | glyf[j + 1]; - flagsCount = endPoint + 1; - j += 2; - } - // skipping instructions - var instructionsStart = j; - var instructionsLength = (glyf[j] << 8) | glyf[j + 1]; - j += 2 + instructionsLength; - var instructionsEnd = j; - // validating flags - var coordinatesLength = 0; - for (i = 0; i < flagsCount; i++) { - var flag = glyf[j++]; - if (flag & 0xC0) { - // reserved flags must be zero, cleaning up - glyf[j - 1] = flag & 0x3F; - } - var xyLength = ((flag & 2) ? 1 : (flag & 16) ? 0 : 2) + - ((flag & 4) ? 1 : (flag & 32) ? 0 : 2); - coordinatesLength += xyLength; - if (flag & 8) { - var repeat = glyf[j++]; - i += repeat; - coordinatesLength += repeat * xyLength; - } - } - // glyph without coordinates will be rejected - if (coordinatesLength === 0) { - return 0; - } - var glyphDataLength = j + coordinatesLength; - if (glyphDataLength > glyf.length) { - // not enough data for coordinates - return 0; - } - if (!hintsValid && instructionsLength > 0) { - dest.set(glyf.subarray(0, instructionsStart), destStart); - dest.set([0, 0], destStart + instructionsStart); - dest.set(glyf.subarray(instructionsEnd, glyphDataLength), - destStart + instructionsStart + 2); - glyphDataLength -= instructionsLength; - if (glyf.length - glyphDataLength > 3) { - glyphDataLength = (glyphDataLength + 3) & ~3; - } - return glyphDataLength; - } - if (glyf.length - glyphDataLength > 3) { - // truncating and aligning to 4 bytes the long glyph data - glyphDataLength = (glyphDataLength + 3) & ~3; - dest.set(glyf.subarray(0, glyphDataLength), destStart); - return glyphDataLength; - } - // glyph data is fine - dest.set(glyf, destStart); - return glyf.length; - } - - function sanitizeHead(head, numGlyphs, locaLength) { - var data = head.data; - - // Validate version: - // Should always be 0x00010000 - var version = int32(data[0], data[1], data[2], data[3]); - if (version >> 16 !== 1) { - info('Attempting to fix invalid version in head table: ' + version); - data[0] = 0; - data[1] = 1; - data[2] = 0; - data[3] = 0; - } - - var indexToLocFormat = int16(data[50], data[51]); - if (indexToLocFormat < 0 || indexToLocFormat > 1) { - info('Attempting to fix invalid indexToLocFormat in head table: ' + - indexToLocFormat); - - // The value of indexToLocFormat should be 0 if the loca table - // consists of short offsets, and should be 1 if the loca table - // consists of long offsets. - // - // The number of entries in the loca table should be numGlyphs + 1. - // - // Using this information, we can work backwards to deduce if the - // size of each offset in the loca table, and thus figure out the - // appropriate value for indexToLocFormat. - - var numGlyphsPlusOne = numGlyphs + 1; - if (locaLength === numGlyphsPlusOne << 1) { - // 0x0000 indicates the loca table consists of short offsets - data[50] = 0; - data[51] = 0; - } else if (locaLength === numGlyphsPlusOne << 2) { - // 0x0001 indicates the loca table consists of long offsets - data[50] = 0; - data[51] = 1; - } else { - warn('Could not fix indexToLocFormat: ' + indexToLocFormat); - } - } - } - - function sanitizeGlyphLocations(loca, glyf, numGlyphs, - isGlyphLocationsLong, hintsValid, - dupFirstEntry) { - var itemSize, itemDecode, itemEncode; - if (isGlyphLocationsLong) { - itemSize = 4; - itemDecode = function fontItemDecodeLong(data, offset) { - return (data[offset] << 24) | (data[offset + 1] << 16) | - (data[offset + 2] << 8) | data[offset + 3]; - }; - itemEncode = function fontItemEncodeLong(data, offset, value) { - data[offset] = (value >>> 24) & 0xFF; - data[offset + 1] = (value >> 16) & 0xFF; - data[offset + 2] = (value >> 8) & 0xFF; - data[offset + 3] = value & 0xFF; - }; - } else { - itemSize = 2; - itemDecode = function fontItemDecode(data, offset) { - return (data[offset] << 9) | (data[offset + 1] << 1); - }; - itemEncode = function fontItemEncode(data, offset, value) { - data[offset] = (value >> 9) & 0xFF; - data[offset + 1] = (value >> 1) & 0xFF; - }; - } - var locaData = loca.data; - var locaDataSize = itemSize * (1 + numGlyphs); - // is loca.data too short or long? - if (locaData.length !== locaDataSize) { - locaData = new Uint8Array(locaDataSize); - locaData.set(loca.data.subarray(0, locaDataSize)); - loca.data = locaData; - } - // removing the invalid glyphs - var oldGlyfData = glyf.data; - var oldGlyfDataLength = oldGlyfData.length; - var newGlyfData = new Uint8Array(oldGlyfDataLength); - var startOffset = itemDecode(locaData, 0); - var writeOffset = 0; - var missingGlyphData = {}; - itemEncode(locaData, 0, writeOffset); - var i, j; - for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) { - var endOffset = itemDecode(locaData, j); - if (endOffset > oldGlyfDataLength && - ((oldGlyfDataLength + 3) & ~3) === endOffset) { - // Aspose breaks fonts by aligning the glyphs to the qword, but not - // the glyf table size, which makes last glyph out of range. - endOffset = oldGlyfDataLength; - } - if (endOffset > oldGlyfDataLength) { - // glyph end offset points outside glyf data, rejecting the glyph - itemEncode(locaData, j, writeOffset); - startOffset = endOffset; - continue; - } - - if (startOffset === endOffset) { - missingGlyphData[i] = true; - } - - var newLength = sanitizeGlyph(oldGlyfData, startOffset, endOffset, - newGlyfData, writeOffset, hintsValid); - writeOffset += newLength; - itemEncode(locaData, j, writeOffset); - startOffset = endOffset; - } - - if (writeOffset === 0) { - // glyf table cannot be empty -- redoing the glyf and loca tables - // to have single glyph with one point - var simpleGlyph = new Uint8Array( - [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0]); - for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) { - itemEncode(locaData, j, simpleGlyph.length); - } - glyf.data = simpleGlyph; - return missingGlyphData; - } - - if (dupFirstEntry) { - var firstEntryLength = itemDecode(locaData, itemSize); - if (newGlyfData.length > firstEntryLength + writeOffset) { - glyf.data = newGlyfData.subarray(0, firstEntryLength + writeOffset); - } else { - glyf.data = new Uint8Array(firstEntryLength + writeOffset); - glyf.data.set(newGlyfData.subarray(0, writeOffset)); - } - glyf.data.set(newGlyfData.subarray(0, firstEntryLength), writeOffset); - itemEncode(loca.data, locaData.length - itemSize, - writeOffset + firstEntryLength); - } else { - glyf.data = newGlyfData.subarray(0, writeOffset); - } - return missingGlyphData; - } - - function readPostScriptTable(post, properties, maxpNumGlyphs) { - var start = (font.start ? font.start : 0) + post.offset; - font.pos = start; - - var length = post.length, end = start + length; - var version = font.getInt32(); - // skip rest to the tables - font.getBytes(28); - - var glyphNames; - var valid = true; - var i; - - switch (version) { - case 0x00010000: - glyphNames = MacStandardGlyphOrdering; - break; - case 0x00020000: - var numGlyphs = font.getUint16(); - if (numGlyphs !== maxpNumGlyphs) { - valid = false; - break; - } - var glyphNameIndexes = []; - for (i = 0; i < numGlyphs; ++i) { - var index = font.getUint16(); - if (index >= 32768) { - valid = false; - break; - } - glyphNameIndexes.push(index); - } - if (!valid) { - break; - } - var customNames = []; - var strBuf = []; - while (font.pos < end) { - var stringLength = font.getByte(); - strBuf.length = stringLength; - for (i = 0; i < stringLength; ++i) { - strBuf[i] = String.fromCharCode(font.getByte()); - } - customNames.push(strBuf.join('')); - } - glyphNames = []; - for (i = 0; i < numGlyphs; ++i) { - var j = glyphNameIndexes[i]; - if (j < 258) { - glyphNames.push(MacStandardGlyphOrdering[j]); - continue; - } - glyphNames.push(customNames[j - 258]); - } - break; - case 0x00030000: - break; - default: - warn('Unknown/unsupported post table version ' + version); - valid = false; - if (properties.defaultEncoding) { - glyphNames = properties.defaultEncoding; - } - break; - } - properties.glyphNames = glyphNames; - return valid; - } - - function readNameTable(nameTable) { - var start = (font.start ? font.start : 0) + nameTable.offset; - font.pos = start; - - var names = [[], []]; - var length = nameTable.length, end = start + length; - var format = font.getUint16(); - var FORMAT_0_HEADER_LENGTH = 6; - if (format !== 0 || length < FORMAT_0_HEADER_LENGTH) { - // unsupported name table format or table "too" small - return names; - } - var numRecords = font.getUint16(); - var stringsStart = font.getUint16(); - var records = []; - var NAME_RECORD_LENGTH = 12; - var i, ii; - - for (i = 0; i < numRecords && - font.pos + NAME_RECORD_LENGTH <= end; i++) { - var r = { - platform: font.getUint16(), - encoding: font.getUint16(), - language: font.getUint16(), - name: font.getUint16(), - length: font.getUint16(), - offset: font.getUint16() - }; - // using only Macintosh and Windows platform/encoding names - if ((r.platform === 1 && r.encoding === 0 && r.language === 0) || - (r.platform === 3 && r.encoding === 1 && r.language === 0x409)) { - records.push(r); - } - } - for (i = 0, ii = records.length; i < ii; i++) { - var record = records[i]; - var pos = start + stringsStart + record.offset; - if (pos + record.length > end) { - continue; // outside of name table, ignoring - } - font.pos = pos; - var nameIndex = record.name; - if (record.encoding) { - // unicode - var str = ''; - for (var j = 0, jj = record.length; j < jj; j += 2) { - str += String.fromCharCode(font.getUint16()); - } - names[1][nameIndex] = str; - } else { - names[0][nameIndex] = bytesToString(font.getBytes(record.length)); - } - } - return names; - } - - var TTOpsStackDeltas = [ - 0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, 0, 0, -2, -5, - -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, -1, -1, - 1, -1, -999, 0, 1, 0, -1, -2, 0, -1, -2, -1, -1, 0, -1, -1, - 0, 0, -999, -999, -1, -1, -1, -1, -2, -999, -2, -2, -999, 0, -2, -2, - 0, 0, -2, 0, -2, 0, 0, 0, -2, -1, -1, 1, 1, 0, 0, -1, - -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, 0, -999, -1, -1, - -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -2, -999, -999, -999, -999, -999, -1, -1, -2, -2, 0, 0, 0, 0, -1, -1, - -999, -2, -2, 0, 0, -1, -2, -2, 0, 0, 0, -1, -1, -1, -2]; - // 0xC0-DF == -1 and 0xE0-FF == -2 - - function sanitizeTTProgram(table, ttContext) { - var data = table.data; - var i = 0, j, n, b, funcId, pc, lastEndf = 0, lastDeff = 0; - var stack = []; - var callstack = []; - var functionsCalled = []; - var tooComplexToFollowFunctions = - ttContext.tooComplexToFollowFunctions; - var inFDEF = false, ifLevel = 0, inELSE = 0; - for (var ii = data.length; i < ii;) { - var op = data[i++]; - // The TrueType instruction set docs can be found at - // https://developer.apple.com/fonts/TTRefMan/RM05/Chap5.html - if (op === 0x40) { // NPUSHB - pushes n bytes - n = data[i++]; - if (inFDEF || inELSE) { - i += n; - } else { - for (j = 0; j < n; j++) { - stack.push(data[i++]); - } - } - } else if (op === 0x41) { // NPUSHW - pushes n words - n = data[i++]; - if (inFDEF || inELSE) { - i += n * 2; - } else { - for (j = 0; j < n; j++) { - b = data[i++]; - stack.push((b << 8) | data[i++]); - } - } - } else if ((op & 0xF8) === 0xB0) { // PUSHB - pushes bytes - n = op - 0xB0 + 1; - if (inFDEF || inELSE) { - i += n; - } else { - for (j = 0; j < n; j++) { - stack.push(data[i++]); - } - } - } else if ((op & 0xF8) === 0xB8) { // PUSHW - pushes words - n = op - 0xB8 + 1; - if (inFDEF || inELSE) { - i += n * 2; - } else { - for (j = 0; j < n; j++) { - b = data[i++]; - stack.push((b << 8) | data[i++]); - } - } - } else if (op === 0x2B && !tooComplexToFollowFunctions) { // CALL - if (!inFDEF && !inELSE) { - // collecting inforamtion about which functions are used - funcId = stack[stack.length - 1]; - ttContext.functionsUsed[funcId] = true; - if (funcId in ttContext.functionsStackDeltas) { - stack.length += ttContext.functionsStackDeltas[funcId]; - } else if (funcId in ttContext.functionsDefined && - functionsCalled.indexOf(funcId) < 0) { - callstack.push({data: data, i: i, stackTop: stack.length - 1}); - functionsCalled.push(funcId); - pc = ttContext.functionsDefined[funcId]; - if (!pc) { - warn('TT: CALL non-existent function'); - ttContext.hintsValid = false; - return; - } - data = pc.data; - i = pc.i; - } - } - } else if (op === 0x2C && !tooComplexToFollowFunctions) { // FDEF - if (inFDEF || inELSE) { - warn('TT: nested FDEFs not allowed'); - tooComplexToFollowFunctions = true; - } - inFDEF = true; - // collecting inforamtion about which functions are defined - lastDeff = i; - funcId = stack.pop(); - ttContext.functionsDefined[funcId] = {data: data, i: i}; - } else if (op === 0x2D) { // ENDF - end of function - if (inFDEF) { - inFDEF = false; - lastEndf = i; - } else { - pc = callstack.pop(); - if (!pc) { - warn('TT: ENDF bad stack'); - ttContext.hintsValid = false; - return; - } - funcId = functionsCalled.pop(); - data = pc.data; - i = pc.i; - ttContext.functionsStackDeltas[funcId] = - stack.length - pc.stackTop; - } - } else if (op === 0x89) { // IDEF - instruction definition - if (inFDEF || inELSE) { - warn('TT: nested IDEFs not allowed'); - tooComplexToFollowFunctions = true; - } - inFDEF = true; - // recording it as a function to track ENDF - lastDeff = i; - } else if (op === 0x58) { // IF - ++ifLevel; - } else if (op === 0x1B) { // ELSE - inELSE = ifLevel; - } else if (op === 0x59) { // EIF - if (inELSE === ifLevel) { - inELSE = 0; - } - --ifLevel; - } else if (op === 0x1C) { // JMPR - if (!inFDEF && !inELSE) { - var offset = stack[stack.length - 1]; - // only jumping forward to prevent infinite loop - if (offset > 0) { - i += offset - 1; - } - } - } - // Adjusting stack not extactly, but just enough to get function id - if (!inFDEF && !inELSE) { - var stackDelta = op <= 0x8E ? TTOpsStackDeltas[op] : - op >= 0xC0 && op <= 0xDF ? -1 : op >= 0xE0 ? -2 : 0; - if (op >= 0x71 && op <= 0x75) { - n = stack.pop(); - if (n === n) { - stackDelta = -n * 2; - } - } - while (stackDelta < 0 && stack.length > 0) { - stack.pop(); - stackDelta++; - } - while (stackDelta > 0) { - stack.push(NaN); // pushing any number into stack - stackDelta--; - } - } - } - ttContext.tooComplexToFollowFunctions = tooComplexToFollowFunctions; - var content = [data]; - if (i > data.length) { - content.push(new Uint8Array(i - data.length)); - } - if (lastDeff > lastEndf) { - warn('TT: complementing a missing function tail'); - // new function definition started, but not finished - // complete function by [CLEAR, ENDF] - content.push(new Uint8Array([0x22, 0x2D])); - } - foldTTTable(table, content); - } - - function checkInvalidFunctions(ttContext, maxFunctionDefs) { - if (ttContext.tooComplexToFollowFunctions) { - return; - } - if (ttContext.functionsDefined.length > maxFunctionDefs) { - warn('TT: more functions defined than expected'); - ttContext.hintsValid = false; - return; - } - for (var j = 0, jj = ttContext.functionsUsed.length; j < jj; j++) { - if (j > maxFunctionDefs) { - warn('TT: invalid function id: ' + j); - ttContext.hintsValid = false; - return; - } - if (ttContext.functionsUsed[j] && !ttContext.functionsDefined[j]) { - warn('TT: undefined function: ' + j); - ttContext.hintsValid = false; - return; - } - } - } - - function foldTTTable(table, content) { - if (content.length > 1) { - // concatenating the content items - var newLength = 0; - var j, jj; - for (j = 0, jj = content.length; j < jj; j++) { - newLength += content[j].length; - } - newLength = (newLength + 3) & ~3; - var result = new Uint8Array(newLength); - var pos = 0; - for (j = 0, jj = content.length; j < jj; j++) { - result.set(content[j], pos); - pos += content[j].length; - } - table.data = result; - table.length = newLength; - } - } - - function sanitizeTTPrograms(fpgm, prep, cvt) { - var ttContext = { - functionsDefined: [], - functionsUsed: [], - functionsStackDeltas: [], - tooComplexToFollowFunctions: false, - hintsValid: true - }; - if (fpgm) { - sanitizeTTProgram(fpgm, ttContext); - } - if (prep) { - sanitizeTTProgram(prep, ttContext); - } - if (fpgm) { - checkInvalidFunctions(ttContext, maxFunctionDefs); - } - if (cvt && (cvt.length & 1)) { - var cvtData = new Uint8Array(cvt.length + 1); - cvtData.set(cvt.data); - cvt.data = cvtData; - } - return ttContext.hintsValid; - } - - // The following steps modify the original font data, making copy - font = new Stream(new Uint8Array(font.getBytes())); - - var VALID_TABLES = ['OS/2', 'cmap', 'head', 'hhea', 'hmtx', 'maxp', - 'name', 'post', 'loca', 'glyf', 'fpgm', 'prep', 'cvt ', 'CFF ']; - - var header = readOpenTypeHeader(font); - var numTables = header.numTables; - var cff, cffFile; - - var tables = { 'OS/2': null, cmap: null, head: null, hhea: null, - hmtx: null, maxp: null, name: null, post: null }; - var table; - for (var i = 0; i < numTables; i++) { - table = readTableEntry(font); - if (VALID_TABLES.indexOf(table.tag) < 0) { - continue; // skipping table if it's not a required or optional table - } - if (table.length === 0) { - continue; // skipping empty tables - } - tables[table.tag] = table; - } - - var isTrueType = !tables['CFF ']; - if (!isTrueType) { - // OpenType font - if ((header.version === 'OTTO' && properties.type !== 'CIDFontType2') || - !tables.head || !tables.hhea || !tables.maxp || !tables.post) { - // no major tables: throwing everything at CFFFont - cffFile = new Stream(tables['CFF '].data); - cff = new CFFFont(cffFile, properties); - - adjustWidths(properties); - - return this.convert(name, cff, properties); - } - - delete tables.glyf; - delete tables.loca; - delete tables.fpgm; - delete tables.prep; - delete tables['cvt ']; - this.isOpenType = true; - } else { - if (!tables.glyf || !tables.loca) { - error('Required "glyf" or "loca" tables are not found'); - } - this.isOpenType = false; - } - - if (!tables.maxp) { - error('Required "maxp" table is not found'); - } - - font.pos = (font.start || 0) + tables.maxp.offset; - var version = font.getInt32(); - var numGlyphs = font.getUint16(); - var maxFunctionDefs = 0; - if (version >= 0x00010000 && tables.maxp.length >= 22) { - // maxZones can be invalid - font.pos += 8; - var maxZones = font.getUint16(); - if (maxZones > 2) { // reset to 2 if font has invalid maxZones - tables.maxp.data[14] = 0; - tables.maxp.data[15] = 2; - } - font.pos += 4; - maxFunctionDefs = font.getUint16(); - } - - var dupFirstEntry = false; - if (properties.type === 'CIDFontType2' && properties.toUnicode && - properties.toUnicode.get(0) > '\u0000') { - // oracle's defect (see 3427), duplicating first entry - dupFirstEntry = true; - numGlyphs++; - tables.maxp.data[4] = numGlyphs >> 8; - tables.maxp.data[5] = numGlyphs & 255; - } - - var hintsValid = sanitizeTTPrograms(tables.fpgm, tables.prep, - tables['cvt '], maxFunctionDefs); - if (!hintsValid) { - delete tables.fpgm; - delete tables.prep; - delete tables['cvt ']; - } - - // Ensure the hmtx table contains the advance width and - // sidebearings information for numGlyphs in the maxp table - sanitizeMetrics(font, tables.hhea, tables.hmtx, numGlyphs); - - if (!tables.head) { - error('Required "head" table is not found'); - } - - sanitizeHead(tables.head, numGlyphs, isTrueType ? tables.loca.length : 0); - - var missingGlyphs = {}; - if (isTrueType) { - var isGlyphLocationsLong = int16(tables.head.data[50], - tables.head.data[51]); - missingGlyphs = sanitizeGlyphLocations(tables.loca, tables.glyf, - numGlyphs, isGlyphLocationsLong, - hintsValid, dupFirstEntry); - } - - if (!tables.hhea) { - error('Required "hhea" table is not found'); - } - - // Sanitizer reduces the glyph advanceWidth to the maxAdvanceWidth - // Sometimes it's 0. That needs to be fixed - if (tables.hhea.data[10] === 0 && tables.hhea.data[11] === 0) { - tables.hhea.data[10] = 0xFF; - tables.hhea.data[11] = 0xFF; - } - - // Extract some more font properties from the OpenType head and - // hhea tables; yMin and descent value are always negative. - var metricsOverride = { - unitsPerEm: int16(tables.head.data[18], tables.head.data[19]), - yMax: int16(tables.head.data[42], tables.head.data[43]), - yMin: int16(tables.head.data[38], tables.head.data[39]) - 0x10000, - ascent: int16(tables.hhea.data[4], tables.hhea.data[5]), - descent: int16(tables.hhea.data[6], tables.hhea.data[7]) - 0x10000 - }; - - // PDF FontDescriptor metrics lie -- using data from actual font. - this.ascent = metricsOverride.ascent / metricsOverride.unitsPerEm; - this.descent = metricsOverride.descent / metricsOverride.unitsPerEm; - - // The 'post' table has glyphs names. - if (tables.post) { - var valid = readPostScriptTable(tables.post, properties, numGlyphs); - if (!valid) { - tables.post = null; - } - } - - var charCodeToGlyphId = [], charCode; - var toUnicode = properties.toUnicode, widths = properties.widths; - var skipToUnicode = (toUnicode instanceof IdentityToUnicodeMap || - toUnicode.length === 0x10000); - - // Helper function to try to skip mapping of empty glyphs. - // Note: In some cases, just relying on the glyph data doesn't work, - // hence we also use a few heuristics to fix various PDF files. - function hasGlyph(glyphId, charCode, widthCode) { - if (!missingGlyphs[glyphId]) { - return true; - } - if (!skipToUnicode && charCode >= 0 && toUnicode.has(charCode)) { - return true; - } - if (widths && widthCode >= 0 && isNum(widths[widthCode])) { - return true; - } - return false; - } - - if (properties.type === 'CIDFontType2') { - var cidToGidMap = properties.cidToGidMap || []; - var isCidToGidMapEmpty = cidToGidMap.length === 0; - - properties.cMap.forEach(function(charCode, cid) { - assert(cid <= 0xffff, 'Max size of CID is 65,535'); - var glyphId = -1; - if (isCidToGidMapEmpty) { - glyphId = charCode; - } else if (cidToGidMap[cid] !== undefined) { - glyphId = cidToGidMap[cid]; - } - - if (glyphId >= 0 && glyphId < numGlyphs && - hasGlyph(glyphId, charCode, cid)) { - charCodeToGlyphId[charCode] = glyphId; - } - }); - if (dupFirstEntry) { - charCodeToGlyphId[0] = numGlyphs - 1; - } - } else { - // Most of the following logic in this code branch is based on the - // 9.6.6.4 of the PDF spec. - var hasEncoding = - properties.differences.length > 0 || !!properties.baseEncodingName; - var cmapTable = - readCmapTable(tables.cmap, font, this.isSymbolicFont, hasEncoding); - var cmapPlatformId = cmapTable.platformId; - var cmapEncodingId = cmapTable.encodingId; - var cmapMappings = cmapTable.mappings; - var cmapMappingsLength = cmapMappings.length; - - // The spec seems to imply that if the font is symbolic the encoding - // should be ignored, this doesn't appear to work for 'preistabelle.pdf' - // where the the font is symbolic and it has an encoding. - if (hasEncoding && - (cmapPlatformId === 3 && cmapEncodingId === 1 || - cmapPlatformId === 1 && cmapEncodingId === 0) || - (cmapPlatformId === -1 && cmapEncodingId === -1 && // Temporary hack - !!Encodings[properties.baseEncodingName])) { // Temporary hack - // When no preferred cmap table was found and |baseEncodingName| is - // one of the predefined encodings, we seem to obtain a better - // |charCodeToGlyphId| map from the code below (fixes bug 1057544). - // TODO: Note that this is a hack which should be removed as soon as - // we have proper support for more exotic cmap tables. - - var baseEncoding = []; - if (properties.baseEncodingName === 'MacRomanEncoding' || - properties.baseEncodingName === 'WinAnsiEncoding') { - baseEncoding = Encodings[properties.baseEncodingName]; - } - for (charCode = 0; charCode < 256; charCode++) { - var glyphName; - if (this.differences && charCode in this.differences) { - glyphName = this.differences[charCode]; - } else if (charCode in baseEncoding && - baseEncoding[charCode] !== '') { - glyphName = baseEncoding[charCode]; - } else { - glyphName = Encodings.StandardEncoding[charCode]; - } - if (!glyphName) { - continue; - } - var unicodeOrCharCode, isUnicode = false; - if (cmapPlatformId === 3 && cmapEncodingId === 1) { - unicodeOrCharCode = GlyphsUnicode[glyphName]; - isUnicode = true; - } else if (cmapPlatformId === 1 && cmapEncodingId === 0) { - // TODO: the encoding needs to be updated with mac os table. - unicodeOrCharCode = Encodings.MacRomanEncoding.indexOf(glyphName); - } - - var found = false; - for (i = 0; i < cmapMappingsLength; ++i) { - if (cmapMappings[i].charCode !== unicodeOrCharCode) { - continue; - } - var code = isUnicode ? charCode : unicodeOrCharCode; - if (hasGlyph(cmapMappings[i].glyphId, code, -1)) { - charCodeToGlyphId[charCode] = cmapMappings[i].glyphId; - found = true; - break; - } - } - if (!found && properties.glyphNames) { - // Try to map using the post table. - var glyphId = properties.glyphNames.indexOf(glyphName); - if (glyphId > 0 && hasGlyph(glyphId, -1, -1)) { - charCodeToGlyphId[charCode] = glyphId; - } else { - charCodeToGlyphId[charCode] = 0; // notdef - } - } - } - } else if (cmapPlatformId === 0 && cmapEncodingId === 0) { - // Default Unicode semantics, use the charcodes as is. - for (i = 0; i < cmapMappingsLength; ++i) { - charCodeToGlyphId[cmapMappings[i].charCode] = - cmapMappings[i].glyphId; - } - } else { - // For (3, 0) cmap tables: - // The charcode key being stored in charCodeToGlyphId is the lower - // byte of the two-byte charcodes of the cmap table since according to - // the spec: 'each byte from the string shall be prepended with the - // high byte of the range [of charcodes in the cmap table], to form - // a two-byte character, which shall be used to select the - // associated glyph description from the subtable'. - // - // For (1, 0) cmap tables: - // 'single bytes from the string shall be used to look up the - // associated glyph descriptions from the subtable'. This means - // charcodes in the cmap will be single bytes, so no-op since - // glyph.charCode & 0xFF === glyph.charCode - for (i = 0; i < cmapMappingsLength; ++i) { - charCode = cmapMappings[i].charCode & 0xFF; - charCodeToGlyphId[charCode] = cmapMappings[i].glyphId; - } - } - } - - if (charCodeToGlyphId.length === 0) { - // defines at least one glyph - charCodeToGlyphId[0] = 0; - } - - // Converting glyphs and ids into font's cmap table - var newMapping = adjustMapping(charCodeToGlyphId, properties); - this.toFontChar = newMapping.toFontChar; - tables.cmap = { - tag: 'cmap', - data: createCmapTable(newMapping.charCodeToGlyphId, numGlyphs) - }; - - if (!tables['OS/2'] || !validateOS2Table(tables['OS/2'])) { - tables['OS/2'] = { - tag: 'OS/2', - data: createOS2Table(properties, newMapping.charCodeToGlyphId, - metricsOverride) - }; - } - - // Rewrite the 'post' table if needed - if (!tables.post) { - tables.post = { - tag: 'post', - data: createPostTable(properties) - }; - } - - if (!isTrueType) { - try { - // Trying to repair CFF file - cffFile = new Stream(tables['CFF '].data); - var parser = new CFFParser(cffFile, properties); - cff = parser.parse(); - var compiler = new CFFCompiler(cff); - tables['CFF '].data = compiler.compile(); - } catch (e) { - warn('Failed to compile font ' + properties.loadedName); - } - } - - // Re-creating 'name' table - if (!tables.name) { - tables.name = { - tag: 'name', - data: createNameTable(this.name) - }; - } else { - // ... using existing 'name' table as prototype - var namePrototype = readNameTable(tables.name); - tables.name.data = createNameTable(name, namePrototype); - } - - var builder = new OpenTypeFileBuilder(header.version); - for (var tableTag in tables) { - builder.addTable(tableTag, tables[tableTag].data); - } - return builder.toArray(); - }, - - convert: function Font_convert(fontName, font, properties) { - // TODO: Check the charstring widths to determine this. - properties.fixedPitch = false; - - var mapping = font.getGlyphMapping(properties); - var newMapping = adjustMapping(mapping, properties); - this.toFontChar = newMapping.toFontChar; - var numGlyphs = font.numGlyphs; - - function getCharCodes(charCodeToGlyphId, glyphId) { - var charCodes = null; - for (var charCode in charCodeToGlyphId) { - if (glyphId === charCodeToGlyphId[charCode]) { - if (!charCodes) { - charCodes = []; - } - charCodes.push(charCode | 0); - } - } - return charCodes; - } - - function createCharCode(charCodeToGlyphId, glyphId) { - for (var charCode in charCodeToGlyphId) { - if (glyphId === charCodeToGlyphId[charCode]) { - return charCode | 0; - } - } - newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode] = - glyphId; - return newMapping.nextAvailableFontCharCode++; - } - - var seacs = font.seacs; - if (SEAC_ANALYSIS_ENABLED && seacs && seacs.length) { - var matrix = properties.fontMatrix || FONT_IDENTITY_MATRIX; - var charset = font.getCharset(); - var seacMap = Object.create(null); - for (var glyphId in seacs) { - glyphId |= 0; - var seac = seacs[glyphId]; - var baseGlyphName = Encodings.StandardEncoding[seac[2]]; - var accentGlyphName = Encodings.StandardEncoding[seac[3]]; - var baseGlyphId = charset.indexOf(baseGlyphName); - var accentGlyphId = charset.indexOf(accentGlyphName); - if (baseGlyphId < 0 || accentGlyphId < 0) { - continue; - } - var accentOffset = { - x: seac[0] * matrix[0] + seac[1] * matrix[2] + matrix[4], - y: seac[0] * matrix[1] + seac[1] * matrix[3] + matrix[5] - }; - - var charCodes = getCharCodes(mapping, glyphId); - if (!charCodes) { - // There's no point in mapping it if the char code was never mapped - // to begin with. - continue; - } - for (var i = 0, ii = charCodes.length; i < ii; i++) { - var charCode = charCodes[i]; - // Find a fontCharCode that maps to the base and accent glyphs. - // If one doesn't exists, create it. - var charCodeToGlyphId = newMapping.charCodeToGlyphId; - var baseFontCharCode = createCharCode(charCodeToGlyphId, - baseGlyphId); - var accentFontCharCode = createCharCode(charCodeToGlyphId, - accentGlyphId); - seacMap[charCode] = { - baseFontCharCode: baseFontCharCode, - accentFontCharCode: accentFontCharCode, - accentOffset: accentOffset - }; - } - } - properties.seacMap = seacMap; - } - - var unitsPerEm = 1 / (properties.fontMatrix || FONT_IDENTITY_MATRIX)[0]; - - var builder = new OpenTypeFileBuilder('\x4F\x54\x54\x4F'); - // PostScript Font Program - builder.addTable('CFF ', font.data); - // OS/2 and Windows Specific metrics - builder.addTable('OS/2', createOS2Table(properties, - newMapping.charCodeToGlyphId)); - // Character to glyphs mapping - builder.addTable('cmap', createCmapTable(newMapping.charCodeToGlyphId, - numGlyphs)); - // Font header - builder.addTable('head', - '\x00\x01\x00\x00' + // Version number - '\x00\x00\x10\x00' + // fontRevision - '\x00\x00\x00\x00' + // checksumAdjustement - '\x5F\x0F\x3C\xF5' + // magicNumber - '\x00\x00' + // Flags - safeString16(unitsPerEm) + // unitsPerEM - '\x00\x00\x00\x00\x9e\x0b\x7e\x27' + // creation date - '\x00\x00\x00\x00\x9e\x0b\x7e\x27' + // modifification date - '\x00\x00' + // xMin - safeString16(properties.descent) + // yMin - '\x0F\xFF' + // xMax - safeString16(properties.ascent) + // yMax - string16(properties.italicAngle ? 2 : 0) + // macStyle - '\x00\x11' + // lowestRecPPEM - '\x00\x00' + // fontDirectionHint - '\x00\x00' + // indexToLocFormat - '\x00\x00'); // glyphDataFormat - - // Horizontal header - builder.addTable('hhea', - '\x00\x01\x00\x00' + // Version number - safeString16(properties.ascent) + // Typographic Ascent - safeString16(properties.descent) + // Typographic Descent - '\x00\x00' + // Line Gap - '\xFF\xFF' + // advanceWidthMax - '\x00\x00' + // minLeftSidebearing - '\x00\x00' + // minRightSidebearing - '\x00\x00' + // xMaxExtent - safeString16(properties.capHeight) + // caretSlopeRise - safeString16(Math.tan(properties.italicAngle) * - properties.xHeight) + // caretSlopeRun - '\x00\x00' + // caretOffset - '\x00\x00' + // -reserved- - '\x00\x00' + // -reserved- - '\x00\x00' + // -reserved- - '\x00\x00' + // -reserved- - '\x00\x00' + // metricDataFormat - string16(numGlyphs)); // Number of HMetrics - - // Horizontal metrics - builder.addTable('hmtx', (function fontFieldsHmtx() { - var charstrings = font.charstrings; - var cffWidths = font.cff ? font.cff.widths : null; - var hmtx = '\x00\x00\x00\x00'; // Fake .notdef - for (var i = 1, ii = numGlyphs; i < ii; i++) { - var width = 0; - if (charstrings) { - var charstring = charstrings[i - 1]; - width = 'width' in charstring ? charstring.width : 0; - } else if (cffWidths) { - width = Math.ceil(cffWidths[i] || 0); - } - hmtx += string16(width) + string16(0); - } - return hmtx; - })()); - - // Maximum profile - builder.addTable('maxp', - '\x00\x00\x50\x00' + // Version number - string16(numGlyphs)); // Num of glyphs - - // Naming tables - builder.addTable('name', createNameTable(fontName)); - - // PostScript informations - builder.addTable('post', createPostTable(properties)); - - return builder.toArray(); - }, - - /** - * Builds a char code to unicode map based on section 9.10 of the spec. - * @param {Object} properties Font properties object. - * @return {Object} A ToUnicodeMap object. - */ - buildToUnicode: function Font_buildToUnicode(properties) { - // Section 9.10.2 Mapping Character Codes to Unicode Values - if (properties.toUnicode && properties.toUnicode.length !== 0) { - return properties.toUnicode; - } - // According to the spec if the font is a simple font we should only map - // to unicode if the base encoding is MacRoman, MacExpert, or WinAnsi or - // the differences array only contains adobe standard or symbol set names, - // in pratice it seems better to always try to create a toUnicode - // map based of the default encoding. - var toUnicode, charcode; - if (!properties.composite /* is simple font */) { - toUnicode = []; - var encoding = properties.defaultEncoding.slice(); - var baseEncodingName = properties.baseEncodingName; - // Merge in the differences array. - var differences = properties.differences; - for (charcode in differences) { - encoding[charcode] = differences[charcode]; - } - for (charcode in encoding) { - // a) Map the character code to a character name. - var glyphName = encoding[charcode]; - // b) Look up the character name in the Adobe Glyph List (see the - // Bibliography) to obtain the corresponding Unicode value. - if (glyphName === '') { - continue; - } else if (GlyphsUnicode[glyphName] === undefined) { - // (undocumented) c) Few heuristics to recognize unknown glyphs - // NOTE: Adobe Reader does not do this step, but OSX Preview does - var code = 0; - switch (glyphName[0]) { - case 'G': // Gxx glyph - if (glyphName.length === 3) { - code = parseInt(glyphName.substr(1), 16); - } - break; - case 'g': // g00xx glyph - if (glyphName.length === 5) { - code = parseInt(glyphName.substr(1), 16); - } - break; - case 'C': // Cddd glyph - case 'c': // cddd glyph - if (glyphName.length >= 3) { - code = +glyphName.substr(1); - } - break; - } - if (code) { - // If |baseEncodingName| is one the predefined encodings, - // and |code| equals |charcode|, using the glyph defined in the - // baseEncoding seems to yield a better |toUnicode| mapping - // (fixes issue 5070). - if (baseEncodingName && code === +charcode) { - var baseEncoding = Encodings[baseEncodingName]; - if (baseEncoding && (glyphName = baseEncoding[charcode])) { - toUnicode[charcode] = - String.fromCharCode(GlyphsUnicode[glyphName]); - continue; - } - } - toUnicode[charcode] = String.fromCharCode(code); - } - continue; - } - toUnicode[charcode] = String.fromCharCode(GlyphsUnicode[glyphName]); - } - return new ToUnicodeMap(toUnicode); - } - // If the font is a composite font that uses one of the predefined CMaps - // listed in Table 118 (except Identity–H and Identity–V) or whose - // descendant CIDFont uses the Adobe-GB1, Adobe-CNS1, Adobe-Japan1, or - // Adobe-Korea1 character collection: - if (properties.composite && ( - (properties.cMap.builtInCMap && - !(properties.cMap instanceof IdentityCMap)) || - (properties.cidSystemInfo.registry === 'Adobe' && - (properties.cidSystemInfo.ordering === 'GB1' || - properties.cidSystemInfo.ordering === 'CNS1' || - properties.cidSystemInfo.ordering === 'Japan1' || - properties.cidSystemInfo.ordering === 'Korea1')))) { - // Then: - // a) Map the character code to a character identifier (CID) according - // to the font’s CMap. - // b) Obtain the registry and ordering of the character collection used - // by the font’s CMap (for example, Adobe and Japan1) from its - // CIDSystemInfo dictionary. - var registry = properties.cidSystemInfo.registry; - var ordering = properties.cidSystemInfo.ordering; - // c) Construct a second CMap name by concatenating the registry and - // ordering obtained in step (b) in the format registry–ordering–UCS2 - // (for example, Adobe–Japan1–UCS2). - var ucs2CMapName = new Name(registry + '-' + ordering + '-UCS2'); - // d) Obtain the CMap with the name constructed in step (c) (available - // from the ASN Web site; see the Bibliography). - var ucs2CMap = CMapFactory.create(ucs2CMapName, - { url: PDFJS.cMapUrl, packed: PDFJS.cMapPacked }, null); - var cMap = properties.cMap; - toUnicode = []; - cMap.forEach(function(charcode, cid) { - assert(cid <= 0xffff, 'Max size of CID is 65,535'); - // e) Map the CID obtained in step (a) according to the CMap obtained - // in step (d), producing a Unicode value. - var ucs2 = ucs2CMap.lookup(cid); - if (ucs2) { - toUnicode[charcode] = - String.fromCharCode((ucs2.charCodeAt(0) << 8) + - ucs2.charCodeAt(1)); - } - }); - return new ToUnicodeMap(toUnicode); - } - - // The viewer's choice, just use an identity map. - return new IdentityToUnicodeMap(properties.firstChar, - properties.lastChar); - }, - - get spaceWidth() { - if ('_shadowWidth' in this) { - return this._shadowWidth; - } - - // trying to estimate space character width - var possibleSpaceReplacements = ['space', 'minus', 'one', 'i']; - var width; - for (var i = 0, ii = possibleSpaceReplacements.length; i < ii; i++) { - var glyphName = possibleSpaceReplacements[i]; - // if possible, getting width by glyph name - if (glyphName in this.widths) { - width = this.widths[glyphName]; - break; - } - var glyphUnicode = GlyphsUnicode[glyphName]; - // finding the charcode via unicodeToCID map - var charcode = 0; - if (this.composite) { - if (this.cMap.contains(glyphUnicode)) { - charcode = this.cMap.lookup(glyphUnicode); - } - } - // ... via toUnicode map - if (!charcode && this.toUnicode) { - charcode = this.toUnicode.charCodeOf(glyphUnicode); - } - // setting it to unicode if negative or undefined - if (charcode <= 0) { - charcode = glyphUnicode; - } - // trying to get width via charcode - width = this.widths[charcode]; - if (width) { - break; // the non-zero width found - } - } - width = width || this.defaultWidth; - // Do not shadow the property here. See discussion: - // https://github.com/mozilla/pdf.js/pull/2127#discussion_r1662280 - this._shadowWidth = width; - return width; - }, - - charToGlyph: function Font_charToGlyph(charcode, isSpace) { - var fontCharCode, width, operatorListId; - - var widthCode = charcode; - if (this.cMap && this.cMap.contains(charcode)) { - widthCode = this.cMap.lookup(charcode); - } - width = this.widths[widthCode]; - width = isNum(width) ? width : this.defaultWidth; - var vmetric = this.vmetrics && this.vmetrics[widthCode]; - - var unicode = this.toUnicode.get(charcode) || charcode; - if (typeof unicode === 'number') { - unicode = String.fromCharCode(unicode); - } - - // First try the toFontChar map, if it's not there then try falling - // back to the char code. - fontCharCode = this.toFontChar[charcode] || charcode; - if (this.missingFile) { - fontCharCode = mapSpecialUnicodeValues(fontCharCode); - } - - if (this.isType3Font) { - // Font char code in this case is actually a glyph name. - operatorListId = fontCharCode; - } - - var accent = null; - if (this.seacMap && this.seacMap[charcode]) { - var seac = this.seacMap[charcode]; - fontCharCode = seac.baseFontCharCode; - accent = { - fontChar: String.fromCharCode(seac.accentFontCharCode), - offset: seac.accentOffset - }; - } - - var fontChar = String.fromCharCode(fontCharCode); - - var glyph = this.glyphCache[charcode]; - if (!glyph || - !glyph.matchesForCache(fontChar, unicode, accent, width, vmetric, - operatorListId, isSpace)) { - glyph = new Glyph(fontChar, unicode, accent, width, vmetric, - operatorListId, isSpace); - this.glyphCache[charcode] = glyph; - } - return glyph; - }, - - charsToGlyphs: function Font_charsToGlyphs(chars) { - var charsCache = this.charsCache; - var glyphs, glyph, charcode; - - // if we translated this string before, just grab it from the cache - if (charsCache) { - glyphs = charsCache[chars]; - if (glyphs) { - return glyphs; - } - } - - // lazily create the translation cache - if (!charsCache) { - charsCache = this.charsCache = Object.create(null); - } - - glyphs = []; - var charsCacheKey = chars; - var i = 0, ii; - - if (this.cMap) { - // composite fonts have multi-byte strings convert the string from - // single-byte to multi-byte - var c = {}; - while (i < chars.length) { - this.cMap.readCharCode(chars, i, c); - charcode = c.charcode; - var length = c.length; - i += length; - // Space is char with code 0x20 and length 1 in multiple-byte codes. - var isSpace = length === 1 && chars.charCodeAt(i - 1) === 0x20; - glyph = this.charToGlyph(charcode, isSpace); - glyphs.push(glyph); - } - } else { - for (i = 0, ii = chars.length; i < ii; ++i) { - charcode = chars.charCodeAt(i); - glyph = this.charToGlyph(charcode, charcode === 0x20); - glyphs.push(glyph); - } - } - - // Enter the translated string into the cache - return (charsCache[charsCacheKey] = glyphs); - } - }; - - return Font; -})(); - -var ErrorFont = (function ErrorFontClosure() { - function ErrorFont(error) { - this.error = error; - this.loadedName = 'g_font_error'; - this.loading = false; - } - - ErrorFont.prototype = { - charsToGlyphs: function ErrorFont_charsToGlyphs() { - return []; - }, - exportData: function ErrorFont_exportData() { - return {error: this.error}; - } - }; - - return ErrorFont; -})(); - -/** - * Shared logic for building a char code to glyph id mapping for Type1 and - * simple CFF fonts. See section 9.6.6.2 of the spec. - * @param {Object} properties Font properties object. - * @param {Object} builtInEncoding The encoding contained within the actual font - * data. - * @param {Array} Array of glyph names where the index is the glyph ID. - * @returns {Object} A char code to glyph ID map. - */ -function type1FontGlyphMapping(properties, builtInEncoding, glyphNames) { - var charCodeToGlyphId = Object.create(null); - var glyphId, charCode, baseEncoding; - - if (properties.baseEncodingName) { - // If a valid base encoding name was used, the mapping is initialized with - // that. - baseEncoding = Encodings[properties.baseEncodingName]; - for (charCode = 0; charCode < baseEncoding.length; charCode++) { - glyphId = glyphNames.indexOf(baseEncoding[charCode]); - if (glyphId >= 0) { - charCodeToGlyphId[charCode] = glyphId; - } else { - charCodeToGlyphId[charCode] = 0; // notdef - } - } - } else if (!!(properties.flags & FontFlags.Symbolic)) { - // For a symbolic font the encoding should be the fonts built-in - // encoding. - for (charCode in builtInEncoding) { - charCodeToGlyphId[charCode] = builtInEncoding[charCode]; - } - } else { - // For non-symbolic fonts that don't have a base encoding the standard - // encoding should be used. - baseEncoding = Encodings.StandardEncoding; - for (charCode = 0; charCode < baseEncoding.length; charCode++) { - glyphId = glyphNames.indexOf(baseEncoding[charCode]); - if (glyphId >= 0) { - charCodeToGlyphId[charCode] = glyphId; - } else { - charCodeToGlyphId[charCode] = 0; // notdef - } - } - } - - // Lastly, merge in the differences. - var differences = properties.differences; - if (differences) { - for (charCode in differences) { - var glyphName = differences[charCode]; - glyphId = glyphNames.indexOf(glyphName); - if (glyphId >= 0) { - charCodeToGlyphId[charCode] = glyphId; - } else { - charCodeToGlyphId[charCode] = 0; // notdef - } - } - } - return charCodeToGlyphId; -} - -/* - * CharStrings are encoded following the the CharString Encoding sequence - * describe in Chapter 6 of the "Adobe Type1 Font Format" specification. - * The value in a byte indicates a command, a number, or subsequent bytes - * that are to be interpreted in a special way. - * - * CharString Number Encoding: - * A CharString byte containing the values from 32 through 255 inclusive - * indicate an integer. These values are decoded in four ranges. - * - * 1. A CharString byte containing a value, v, between 32 and 246 inclusive, - * indicate the integer v - 139. Thus, the integer values from -107 through - * 107 inclusive may be encoded in single byte. - * - * 2. A CharString byte containing a value, v, between 247 and 250 inclusive, - * indicates an integer involving the next byte, w, according to the formula: - * [(v - 247) x 256] + w + 108 - * - * 3. A CharString byte containing a value, v, between 251 and 254 inclusive, - * indicates an integer involving the next byte, w, according to the formula: - * -[(v - 251) * 256] - w - 108 - * - * 4. A CharString containing the value 255 indicates that the next 4 bytes - * are a two complement signed integer. The first of these bytes contains the - * highest order bits, the second byte contains the next higher order bits - * and the fourth byte contain the lowest order bits. - * - * - * CharString Command Encoding: - * CharStrings commands are encoded in 1 or 2 bytes. - * - * Single byte commands are encoded in 1 byte that contains a value between - * 0 and 31 inclusive. - * If a command byte contains the value 12, then the value in the next byte - * indicates a command. This "escape" mechanism allows many extra commands - * to be encoded and this encoding technique helps to minimize the length of - * the charStrings. - */ -var Type1CharString = (function Type1CharStringClosure() { - var COMMAND_MAP = { - 'hstem': [1], - 'vstem': [3], - 'vmoveto': [4], - 'rlineto': [5], - 'hlineto': [6], - 'vlineto': [7], - 'rrcurveto': [8], - 'callsubr': [10], - 'flex': [12, 35], - 'drop' : [12, 18], - 'endchar': [14], - 'rmoveto': [21], - 'hmoveto': [22], - 'vhcurveto': [30], - 'hvcurveto': [31] - }; - - function Type1CharString() { - this.width = 0; - this.lsb = 0; - this.flexing = false; - this.output = []; - this.stack = []; - } - - Type1CharString.prototype = { - convert: function Type1CharString_convert(encoded, subrs) { - var count = encoded.length; - var error = false; - var wx, sbx, subrNumber; - for (var i = 0; i < count; i++) { - var value = encoded[i]; - if (value < 32) { - if (value === 12) { - value = (value << 8) + encoded[++i]; - } - switch (value) { - case 1: // hstem - if (!HINTING_ENABLED) { - this.stack = []; - break; - } - error = this.executeCommand(2, COMMAND_MAP.hstem); - break; - case 3: // vstem - if (!HINTING_ENABLED) { - this.stack = []; - break; - } - error = this.executeCommand(2, COMMAND_MAP.vstem); - break; - case 4: // vmoveto - if (this.flexing) { - if (this.stack.length < 1) { - error = true; - break; - } - // Add the dx for flex and but also swap the values so they are - // the right order. - var dy = this.stack.pop(); - this.stack.push(0, dy); - break; - } - error = this.executeCommand(1, COMMAND_MAP.vmoveto); - break; - case 5: // rlineto - error = this.executeCommand(2, COMMAND_MAP.rlineto); - break; - case 6: // hlineto - error = this.executeCommand(1, COMMAND_MAP.hlineto); - break; - case 7: // vlineto - error = this.executeCommand(1, COMMAND_MAP.vlineto); - break; - case 8: // rrcurveto - error = this.executeCommand(6, COMMAND_MAP.rrcurveto); - break; - case 9: // closepath - // closepath is a Type1 command that does not take argument and is - // useless in Type2 and it can simply be ignored. - this.stack = []; - break; - case 10: // callsubr - if (this.stack.length < 1) { - error = true; - break; - } - subrNumber = this.stack.pop(); - error = this.convert(subrs[subrNumber], subrs); - break; - case 11: // return - return error; - case 13: // hsbw - if (this.stack.length < 2) { - error = true; - break; - } - // To convert to type2 we have to move the width value to the - // first part of the charstring and then use hmoveto with lsb. - wx = this.stack.pop(); - sbx = this.stack.pop(); - this.lsb = sbx; - this.width = wx; - this.stack.push(wx, sbx); - error = this.executeCommand(2, COMMAND_MAP.hmoveto); - break; - case 14: // endchar - this.output.push(COMMAND_MAP.endchar[0]); - break; - case 21: // rmoveto - if (this.flexing) { - break; - } - error = this.executeCommand(2, COMMAND_MAP.rmoveto); - break; - case 22: // hmoveto - if (this.flexing) { - // Add the dy for flex. - this.stack.push(0); - break; - } - error = this.executeCommand(1, COMMAND_MAP.hmoveto); - break; - case 30: // vhcurveto - error = this.executeCommand(4, COMMAND_MAP.vhcurveto); - break; - case 31: // hvcurveto - error = this.executeCommand(4, COMMAND_MAP.hvcurveto); - break; - case (12 << 8) + 0: // dotsection - // dotsection is a Type1 command to specify some hinting feature - // for dots that do not take a parameter and it can safely be - // ignored for Type2. - this.stack = []; - break; - case (12 << 8) + 1: // vstem3 - if (!HINTING_ENABLED) { - this.stack = []; - break; - } - // [vh]stem3 are Type1 only and Type2 supports [vh]stem with - // multiple parameters, so instead of returning [vh]stem3 take a - // shortcut and return [vhstem] instead. - error = this.executeCommand(2, COMMAND_MAP.vstem); - break; - case (12 << 8) + 2: // hstem3 - if (!HINTING_ENABLED) { - this.stack = []; - break; - } - // See vstem3. - error = this.executeCommand(2, COMMAND_MAP.hstem); - break; - case (12 << 8) + 6: // seac - // seac is like type 2's special endchar but it doesn't use the - // first argument asb, so remove it. - if (SEAC_ANALYSIS_ENABLED) { - this.seac = this.stack.splice(-4, 4); - error = this.executeCommand(0, COMMAND_MAP.endchar); - } else { - error = this.executeCommand(4, COMMAND_MAP.endchar); - } - break; - case (12 << 8) + 7: // sbw - if (this.stack.length < 4) { - error = true; - break; - } - // To convert to type2 we have to move the width value to the - // first part of the charstring and then use rmoveto with - // (dx, dy). The height argument will not be used for vmtx and - // vhea tables reconstruction -- ignoring it. - var wy = this.stack.pop(); - wx = this.stack.pop(); - var sby = this.stack.pop(); - sbx = this.stack.pop(); - this.lsb = sbx; - this.width = wx; - this.stack.push(wx, sbx, sby); - error = this.executeCommand(3, COMMAND_MAP.rmoveto); - break; - case (12 << 8) + 12: // div - if (this.stack.length < 2) { - error = true; - break; - } - var num2 = this.stack.pop(); - var num1 = this.stack.pop(); - this.stack.push(num1 / num2); - break; - case (12 << 8) + 16: // callothersubr - if (this.stack.length < 2) { - error = true; - break; - } - subrNumber = this.stack.pop(); - var numArgs = this.stack.pop(); - if (subrNumber === 0 && numArgs === 3) { - var flexArgs = this.stack.splice(this.stack.length - 17, 17); - this.stack.push( - flexArgs[2] + flexArgs[0], // bcp1x + rpx - flexArgs[3] + flexArgs[1], // bcp1y + rpy - flexArgs[4], // bcp2x - flexArgs[5], // bcp2y - flexArgs[6], // p2x - flexArgs[7], // p2y - flexArgs[8], // bcp3x - flexArgs[9], // bcp3y - flexArgs[10], // bcp4x - flexArgs[11], // bcp4y - flexArgs[12], // p3x - flexArgs[13], // p3y - flexArgs[14] // flexDepth - // 15 = finalx unused by flex - // 16 = finaly unused by flex - ); - error = this.executeCommand(13, COMMAND_MAP.flex, true); - this.flexing = false; - this.stack.push(flexArgs[15], flexArgs[16]); - } else if (subrNumber === 1 && numArgs === 0) { - this.flexing = true; - } - break; - case (12 << 8) + 17: // pop - // Ignore this since it is only used with othersubr. - break; - case (12 << 8) + 33: // setcurrentpoint - // Ignore for now. - this.stack = []; - break; - default: - warn('Unknown type 1 charstring command of "' + value + '"'); - break; - } - if (error) { - break; - } - continue; - } else if (value <= 246) { - value = value - 139; - } else if (value <= 250) { - value = ((value - 247) * 256) + encoded[++i] + 108; - } else if (value <= 254) { - value = -((value - 251) * 256) - encoded[++i] - 108; - } else { - value = (encoded[++i] & 0xff) << 24 | (encoded[++i] & 0xff) << 16 | - (encoded[++i] & 0xff) << 8 | (encoded[++i] & 0xff) << 0; - } - this.stack.push(value); - } - return error; - }, - - executeCommand: function(howManyArgs, command, keepStack) { - var stackLength = this.stack.length; - if (howManyArgs > stackLength) { - return true; - } - var start = stackLength - howManyArgs; - for (var i = start; i < stackLength; i++) { - var value = this.stack[i]; - if (value === (value | 0)) { // int - this.output.push(28, (value >> 8) & 0xff, value & 0xff); - } else { // fixed point - value = (65536 * value) | 0; - this.output.push(255, - (value >> 24) & 0xFF, - (value >> 16) & 0xFF, - (value >> 8) & 0xFF, - value & 0xFF); - } - } - this.output.push.apply(this.output, command); - if (keepStack) { - this.stack.splice(start, howManyArgs); - } else { - this.stack.length = 0; - } - return false; - } - }; - - return Type1CharString; -})(); - -/* - * Type1Parser encapsulate the needed code for parsing a Type1 font - * program. Some of its logic depends on the Type2 charstrings - * structure. - * Note: this doesn't really parse the font since that would require evaluation - * of PostScript, but it is possible in most cases to extract what we need - * without a full parse. - */ -var Type1Parser = (function Type1ParserClosure() { - /* - * Decrypt a Sequence of Ciphertext Bytes to Produce the Original Sequence - * of Plaintext Bytes. The function took a key as a parameter which can be - * for decrypting the eexec block of for decoding charStrings. - */ - var EEXEC_ENCRYPT_KEY = 55665; - var CHAR_STRS_ENCRYPT_KEY = 4330; - - function isHexDigit(code) { - return code >= 48 && code <= 57 || // '0'-'9' - code >= 65 && code <= 70 || // 'A'-'F' - code >= 97 && code <= 102; // 'a'-'f' - } - - function decrypt(data, key, discardNumber) { - var r = key | 0, c1 = 52845, c2 = 22719; - var count = data.length; - var decrypted = new Uint8Array(count); - for (var i = 0; i < count; i++) { - var value = data[i]; - decrypted[i] = value ^ (r >> 8); - r = ((value + r) * c1 + c2) & ((1 << 16) - 1); - } - return Array.prototype.slice.call(decrypted, discardNumber); - } - - function decryptAscii(data, key, discardNumber) { - var r = key | 0, c1 = 52845, c2 = 22719; - var count = data.length, maybeLength = count >>> 1; - var decrypted = new Uint8Array(maybeLength); - var i, j; - for (i = 0, j = 0; i < count; i++) { - var digit1 = data[i]; - if (!isHexDigit(digit1)) { - continue; - } - i++; - var digit2; - while (i < count && !isHexDigit(digit2 = data[i])) { - i++; - } - if (i < count) { - var value = parseInt(String.fromCharCode(digit1, digit2), 16); - decrypted[j++] = value ^ (r >> 8); - r = ((value + r) * c1 + c2) & ((1 << 16) - 1); - } - } - return Array.prototype.slice.call(decrypted, discardNumber, j); - } - - function isSpecial(c) { - return c === 0x2F || // '/' - c === 0x5B || c === 0x5D || // '[', ']' - c === 0x7B || c === 0x7D || // '{', '}' - c === 0x28 || c === 0x29; // '(', ')' - } - - function Type1Parser(stream, encrypted) { - if (encrypted) { - var data = stream.getBytes(); - var isBinary = !(isHexDigit(data[0]) && isHexDigit(data[1]) && - isHexDigit(data[2]) && isHexDigit(data[3])); - stream = new Stream(isBinary ? decrypt(data, EEXEC_ENCRYPT_KEY, 4) : - decryptAscii(data, EEXEC_ENCRYPT_KEY, 4)); - } - this.stream = stream; - this.nextChar(); - } - - Type1Parser.prototype = { - readNumberArray: function Type1Parser_readNumberArray() { - this.getToken(); // read '[' or '{' (arrays can start with either) - var array = []; - while (true) { - var token = this.getToken(); - if (token === null || token === ']' || token === '}') { - break; - } - array.push(parseFloat(token || 0)); - } - return array; - }, - - readNumber: function Type1Parser_readNumber() { - var token = this.getToken(); - return parseFloat(token || 0); - }, - - readInt: function Type1Parser_readInt() { - // Use '| 0' to prevent setting a double into length such as the double - // does not flow into the loop variable. - var token = this.getToken(); - return parseInt(token || 0, 10) | 0; - }, - - readBoolean: function Type1Parser_readBoolean() { - var token = this.getToken(); - - // Use 1 and 0 since that's what type2 charstrings use. - return token === 'true' ? 1 : 0; - }, - - nextChar : function Type1_nextChar() { - return (this.currentChar = this.stream.getByte()); - }, - - getToken: function Type1Parser_getToken() { - // Eat whitespace and comments. - var comment = false; - var ch = this.currentChar; - while (true) { - if (ch === -1) { - return null; - } - - if (comment) { - if (ch === 0x0A || ch === 0x0D) { - comment = false; - } - } else if (ch === 0x25) { // '%' - comment = true; - } else if (!Lexer.isSpace(ch)) { - break; - } - ch = this.nextChar(); - } - if (isSpecial(ch)) { - this.nextChar(); - return String.fromCharCode(ch); - } - var token = ''; - do { - token += String.fromCharCode(ch); - ch = this.nextChar(); - } while (ch >= 0 && !Lexer.isSpace(ch) && !isSpecial(ch)); - return token; - }, - - /* - * Returns an object containing a Subrs array and a CharStrings - * array extracted from and eexec encrypted block of data - */ - extractFontProgram: function Type1Parser_extractFontProgram() { - var stream = this.stream; - - var subrs = [], charstrings = []; - var program = { - subrs: [], - charstrings: [], - properties: { - 'privateData': { - 'lenIV': 4 - } - } - }; - var token, length, data, lenIV, encoded; - while ((token = this.getToken()) !== null) { - if (token !== '/') { - continue; - } - token = this.getToken(); - switch (token) { - case 'CharStrings': - // The number immediately following CharStrings must be greater or - // equal to the number of CharStrings. - this.getToken(); - this.getToken(); // read in 'dict' - this.getToken(); // read in 'dup' - this.getToken(); // read in 'begin' - while(true) { - token = this.getToken(); - if (token === null || token === 'end') { - break; - } - - if (token !== '/') { - continue; - } - var glyph = this.getToken(); - length = this.readInt(); - this.getToken(); // read in 'RD' or '-|' - data = stream.makeSubStream(stream.pos, length); - lenIV = program.properties.privateData['lenIV']; - encoded = decrypt(data.getBytes(), CHAR_STRS_ENCRYPT_KEY, lenIV); - // Skip past the required space and binary data. - stream.skip(length); - this.nextChar(); - token = this.getToken(); // read in 'ND' or '|-' - if (token === 'noaccess') { - this.getToken(); // read in 'def' - } - charstrings.push({ - glyph: glyph, - encoded: encoded - }); - } - break; - case 'Subrs': - var num = this.readInt(); - this.getToken(); // read in 'array' - while ((token = this.getToken()) === 'dup') { - var index = this.readInt(); - length = this.readInt(); - this.getToken(); // read in 'RD' or '-|' - data = stream.makeSubStream(stream.pos, length); - lenIV = program.properties.privateData['lenIV']; - encoded = decrypt(data.getBytes(), CHAR_STRS_ENCRYPT_KEY, lenIV); - // Skip past the required space and binary data. - stream.skip(length); - this.nextChar(); - token = this.getToken(); // read in 'NP' or '|' - if (token === 'noaccess') { - this.getToken(); // read in 'put' - } - subrs[index] = encoded; - } - break; - case 'BlueValues': - case 'OtherBlues': - case 'FamilyBlues': - case 'FamilyOtherBlues': - var blueArray = this.readNumberArray(); - // *Blue* values may contain invalid data: disables reading of - // those values when hinting is disabled. - if (blueArray.length > 0 && (blueArray.length % 2) === 0 && - HINTING_ENABLED) { - program.properties.privateData[token] = blueArray; - } - break; - case 'StemSnapH': - case 'StemSnapV': - program.properties.privateData[token] = this.readNumberArray(); - break; - case 'StdHW': - case 'StdVW': - program.properties.privateData[token] = - this.readNumberArray()[0]; - break; - case 'BlueShift': - case 'lenIV': - case 'BlueFuzz': - case 'BlueScale': - case 'LanguageGroup': - case 'ExpansionFactor': - program.properties.privateData[token] = this.readNumber(); - break; - case 'ForceBold': - program.properties.privateData[token] = this.readBoolean(); - break; - } - } - - for (var i = 0; i < charstrings.length; i++) { - glyph = charstrings[i].glyph; - encoded = charstrings[i].encoded; - var charString = new Type1CharString(); - var error = charString.convert(encoded, subrs); - var output = charString.output; - if (error) { - // It seems when FreeType encounters an error while evaluating a glyph - // that it completely ignores the glyph so we'll mimic that behaviour - // here and put an endchar to make the validator happy. - output = [14]; - } - program.charstrings.push({ - glyphName: glyph, - charstring: output, - width: charString.width, - lsb: charString.lsb, - seac: charString.seac - }); - } - - return program; - }, - - extractFontHeader: function Type1Parser_extractFontHeader(properties) { - var token; - while ((token = this.getToken()) !== null) { - if (token !== '/') { - continue; - } - token = this.getToken(); - switch (token) { - case 'FontMatrix': - var matrix = this.readNumberArray(); - properties.fontMatrix = matrix; - break; - case 'Encoding': - var encodingArg = this.getToken(); - var encoding; - if (!/^\d+$/.test(encodingArg)) { - // encoding name is specified - encoding = Encodings[encodingArg]; - } else { - encoding = []; - var size = parseInt(encodingArg, 10) | 0; - this.getToken(); // read in 'array' - - for (var j = 0; j < size; j++) { - token = this.getToken(); - // skipping till first dup or def (e.g. ignoring for statement) - while (token !== 'dup' && token !== 'def') { - token = this.getToken(); - if (token === null) { - return; // invalid header - } - } - if (token === 'def') { - break; // read all array data - } - var index = this.readInt(); - this.getToken(); // read in '/' - var glyph = this.getToken(); - encoding[index] = glyph; - this.getToken(); // read the in 'put' - } - } - properties.builtInEncoding = encoding; - break; - case 'FontBBox': - var fontBBox = this.readNumberArray(); - // adjusting ascent/descent - properties.ascent = fontBBox[3]; - properties.descent = fontBBox[1]; - properties.ascentScaled = true; - break; - } - } - } - }; - - return Type1Parser; -})(); - -/** - * The CFF class takes a Type1 file and wrap it into a - * 'Compact Font Format' which itself embed Type2 charstrings. - */ -var CFFStandardStrings = [ - '.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', - 'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus', - 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', - 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', - 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', - 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', - 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', - 'underscore', 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', - 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', - 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', 'exclamdown', 'cent', - 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', - 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', - 'guilsinglright', 'fi', 'fl', 'endash', 'dagger', 'daggerdbl', - 'periodcentered', 'paragraph', 'bullet', 'quotesinglbase', 'quotedblbase', - 'quotedblright', 'guillemotright', 'ellipsis', 'perthousand', 'questiondown', - 'grave', 'acute', 'circumflex', 'tilde', 'macron', 'breve', 'dotaccent', - 'dieresis', 'ring', 'cedilla', 'hungarumlaut', 'ogonek', 'caron', 'emdash', - 'AE', 'ordfeminine', 'Lslash', 'Oslash', 'OE', 'ordmasculine', 'ae', - 'dotlessi', 'lslash', 'oslash', 'oe', 'germandbls', 'onesuperior', - 'logicalnot', 'mu', 'trademark', 'Eth', 'onehalf', 'plusminus', 'Thorn', - 'onequarter', 'divide', 'brokenbar', 'degree', 'thorn', 'threequarters', - 'twosuperior', 'registered', 'minus', 'eth', 'multiply', 'threesuperior', - 'copyright', 'Aacute', 'Acircumflex', 'Adieresis', 'Agrave', 'Aring', - 'Atilde', 'Ccedilla', 'Eacute', 'Ecircumflex', 'Edieresis', 'Egrave', - 'Iacute', 'Icircumflex', 'Idieresis', 'Igrave', 'Ntilde', 'Oacute', - 'Ocircumflex', 'Odieresis', 'Ograve', 'Otilde', 'Scaron', 'Uacute', - 'Ucircumflex', 'Udieresis', 'Ugrave', 'Yacute', 'Ydieresis', 'Zcaron', - 'aacute', 'acircumflex', 'adieresis', 'agrave', 'aring', 'atilde', - 'ccedilla', 'eacute', 'ecircumflex', 'edieresis', 'egrave', 'iacute', - 'icircumflex', 'idieresis', 'igrave', 'ntilde', 'oacute', 'ocircumflex', - 'odieresis', 'ograve', 'otilde', 'scaron', 'uacute', 'ucircumflex', - 'udieresis', 'ugrave', 'yacute', 'ydieresis', 'zcaron', 'exclamsmall', - 'Hungarumlautsmall', 'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', - 'Acutesmall', 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', - 'onedotenleader', 'zerooldstyle', 'oneoldstyle', 'twooldstyle', - 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', - 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'commasuperior', - 'threequartersemdash', 'periodsuperior', 'questionsmall', 'asuperior', - 'bsuperior', 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', - 'lsuperior', 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', - 'tsuperior', 'ff', 'ffi', 'ffl', 'parenleftinferior', 'parenrightinferior', - 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', 'Asmall', 'Bsmall', - 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall', - 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall', - 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall', - 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah', - 'Tildesmall', 'exclamdownsmall', 'centoldstyle', 'Lslashsmall', - 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', 'Brevesmall', 'Caronsmall', - 'Dotaccentsmall', 'Macronsmall', 'figuredash', 'hypheninferior', - 'Ogoneksmall', 'Ringsmall', 'Cedillasmall', 'questiondownsmall', 'oneeighth', - 'threeeighths', 'fiveeighths', 'seveneighths', 'onethird', 'twothirds', - 'zerosuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', - 'sevensuperior', 'eightsuperior', 'ninesuperior', 'zeroinferior', - 'oneinferior', 'twoinferior', 'threeinferior', 'fourinferior', - 'fiveinferior', 'sixinferior', 'seveninferior', 'eightinferior', - 'nineinferior', 'centinferior', 'dollarinferior', 'periodinferior', - 'commainferior', 'Agravesmall', 'Aacutesmall', 'Acircumflexsmall', - 'Atildesmall', 'Adieresissmall', 'Aringsmall', 'AEsmall', 'Ccedillasmall', - 'Egravesmall', 'Eacutesmall', 'Ecircumflexsmall', 'Edieresissmall', - 'Igravesmall', 'Iacutesmall', 'Icircumflexsmall', 'Idieresissmall', - 'Ethsmall', 'Ntildesmall', 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', - 'Otildesmall', 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', - 'Uacutesmall', 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', - 'Thornsmall', 'Ydieresissmall', '001.000', '001.001', '001.002', '001.003', - 'Black', 'Bold', 'Book', 'Light', 'Medium', 'Regular', 'Roman', 'Semibold' -]; - -// Type1Font is also a CIDFontType0. -var Type1Font = function Type1Font(name, file, properties) { - // Some bad generators embed pfb file as is, we have to strip 6-byte headers. - // Also, length1 and length2 might be off by 6 bytes as well. - // http://www.math.ubc.ca/~cass/piscript/type1.pdf - var PFB_HEADER_SIZE = 6; - var headerBlockLength = properties.length1; - var eexecBlockLength = properties.length2; - var pfbHeader = file.peekBytes(PFB_HEADER_SIZE); - var pfbHeaderPresent = pfbHeader[0] === 0x80 && pfbHeader[1] === 0x01; - if (pfbHeaderPresent) { - file.skip(PFB_HEADER_SIZE); - headerBlockLength = (pfbHeader[5] << 24) | (pfbHeader[4] << 16) | - (pfbHeader[3] << 8) | pfbHeader[2]; - } - - // Get the data block containing glyphs and subrs informations - var headerBlock = new Stream(file.getBytes(headerBlockLength)); - var headerBlockParser = new Type1Parser(headerBlock); - headerBlockParser.extractFontHeader(properties); - - if (pfbHeaderPresent) { - pfbHeader = file.getBytes(PFB_HEADER_SIZE); - eexecBlockLength = (pfbHeader[5] << 24) | (pfbHeader[4] << 16) | - (pfbHeader[3] << 8) | pfbHeader[2]; - } - - // Decrypt the data blocks and retrieve it's content - var eexecBlock = new Stream(file.getBytes(eexecBlockLength)); - var eexecBlockParser = new Type1Parser(eexecBlock, true); - var data = eexecBlockParser.extractFontProgram(); - for (var info in data.properties) { - properties[info] = data.properties[info]; - } - - var charstrings = data.charstrings; - var type2Charstrings = this.getType2Charstrings(charstrings); - var subrs = this.getType2Subrs(data.subrs); - - this.charstrings = charstrings; - this.data = this.wrap(name, type2Charstrings, this.charstrings, - subrs, properties); - this.seacs = this.getSeacs(data.charstrings); -}; - -Type1Font.prototype = { - get numGlyphs() { - return this.charstrings.length + 1; - }, - - getCharset: function Type1Font_getCharset() { - var charset = ['.notdef']; - var charstrings = this.charstrings; - for (var glyphId = 0; glyphId < charstrings.length; glyphId++) { - charset.push(charstrings[glyphId].glyphName); - } - return charset; - }, - - getGlyphMapping: function Type1Font_getGlyphMapping(properties) { - var charstrings = this.charstrings; - var glyphNames = ['.notdef'], glyphId; - for (glyphId = 0; glyphId < charstrings.length; glyphId++) { - glyphNames.push(charstrings[glyphId].glyphName); - } - var encoding = properties.builtInEncoding; - if (encoding) { - var builtInEncoding = {}; - for (var charCode in encoding) { - glyphId = glyphNames.indexOf(encoding[charCode]); - if (glyphId >= 0) { - builtInEncoding[charCode] = glyphId; - } - } - } - - return type1FontGlyphMapping(properties, builtInEncoding, glyphNames); - }, - - getSeacs: function Type1Font_getSeacs(charstrings) { - var i, ii; - var seacMap = []; - for (i = 0, ii = charstrings.length; i < ii; i++) { - var charstring = charstrings[i]; - if (charstring.seac) { - // Offset by 1 for .notdef - seacMap[i + 1] = charstring.seac; - } - } - return seacMap; - }, - - getType2Charstrings: function Type1Font_getType2Charstrings( - type1Charstrings) { - var type2Charstrings = []; - for (var i = 0, ii = type1Charstrings.length; i < ii; i++) { - type2Charstrings.push(type1Charstrings[i].charstring); - } - return type2Charstrings; - }, - - getType2Subrs: function Type1Font_getType2Subrs(type1Subrs) { - var bias = 0; - var count = type1Subrs.length; - if (count < 1133) { - bias = 107; - } else if (count < 33769) { - bias = 1131; - } else { - bias = 32768; - } - - // Add a bunch of empty subrs to deal with the Type2 bias - var type2Subrs = []; - var i; - for (i = 0; i < bias; i++) { - type2Subrs.push([0x0B]); - } - - for (i = 0; i < count; i++) { - type2Subrs.push(type1Subrs[i]); - } - - return type2Subrs; - }, - - wrap: function Type1Font_wrap(name, glyphs, charstrings, subrs, properties) { - var cff = new CFF(); - cff.header = new CFFHeader(1, 0, 4, 4); - - cff.names = [name]; - - var topDict = new CFFTopDict(); - // CFF strings IDs 0...390 are predefined names, so refering - // to entries in our own String INDEX starts at SID 391. - topDict.setByName('version', 391); - topDict.setByName('Notice', 392); - topDict.setByName('FullName', 393); - topDict.setByName('FamilyName', 394); - topDict.setByName('Weight', 395); - topDict.setByName('Encoding', null); // placeholder - topDict.setByName('FontMatrix', properties.fontMatrix); - topDict.setByName('FontBBox', properties.bbox); - topDict.setByName('charset', null); // placeholder - topDict.setByName('CharStrings', null); // placeholder - topDict.setByName('Private', null); // placeholder - cff.topDict = topDict; - - var strings = new CFFStrings(); - strings.add('Version 0.11'); // Version - strings.add('See original notice'); // Notice - strings.add(name); // FullName - strings.add(name); // FamilyName - strings.add('Medium'); // Weight - cff.strings = strings; - - cff.globalSubrIndex = new CFFIndex(); - - var count = glyphs.length; - var charsetArray = [0]; - var i, ii; - for (i = 0; i < count; i++) { - var index = CFFStandardStrings.indexOf(charstrings[i].glyphName); - // TODO: Insert the string and correctly map it. Previously it was - // thought mapping names that aren't in the standard strings to .notdef - // was fine, however in issue818 when mapping them all to .notdef the - // adieresis glyph no longer worked. - if (index === -1) { - index = 0; - } - charsetArray.push((index >> 8) & 0xff, index & 0xff); - } - cff.charset = new CFFCharset(false, 0, [], charsetArray); - - var charStringsIndex = new CFFIndex(); - charStringsIndex.add([0x8B, 0x0E]); // .notdef - for (i = 0; i < count; i++) { - charStringsIndex.add(glyphs[i]); - } - cff.charStrings = charStringsIndex; - - var privateDict = new CFFPrivateDict(); - privateDict.setByName('Subrs', null); // placeholder - var fields = [ - 'BlueValues', - 'OtherBlues', - 'FamilyBlues', - 'FamilyOtherBlues', - 'StemSnapH', - 'StemSnapV', - 'BlueShift', - 'BlueFuzz', - 'BlueScale', - 'LanguageGroup', - 'ExpansionFactor', - 'ForceBold', - 'StdHW', - 'StdVW' - ]; - for (i = 0, ii = fields.length; i < ii; i++) { - var field = fields[i]; - if (!properties.privateData.hasOwnProperty(field)) { - continue; - } - var value = properties.privateData[field]; - if (isArray(value)) { - // All of the private dictionary array data in CFF must be stored as - // "delta-encoded" numbers. - for (var j = value.length - 1; j > 0; j--) { - value[j] -= value[j - 1]; // ... difference from previous value - } - } - privateDict.setByName(field, value); - } - cff.topDict.privateDict = privateDict; - - var subrIndex = new CFFIndex(); - for (i = 0, ii = subrs.length; i < ii; i++) { - subrIndex.add(subrs[i]); - } - privateDict.subrsIndex = subrIndex; - - var compiler = new CFFCompiler(cff); - return compiler.compile(); - } -}; - -var CFFFont = (function CFFFontClosure() { - function CFFFont(file, properties) { - this.properties = properties; - - var parser = new CFFParser(file, properties); - this.cff = parser.parse(); - var compiler = new CFFCompiler(this.cff); - this.seacs = this.cff.seacs; - try { - this.data = compiler.compile(); - } catch (e) { - warn('Failed to compile font ' + properties.loadedName); - // There may have just been an issue with the compiler, set the data - // anyway and hope the font loaded. - this.data = file; - } - } - - CFFFont.prototype = { - get numGlyphs() { - return this.cff.charStrings.count; - }, - getCharset: function CFFFont_getCharset() { - return this.cff.charset.charset; - }, - getGlyphMapping: function CFFFont_getGlyphMapping() { - var cff = this.cff; - var properties = this.properties; - var charsets = cff.charset.charset; - var charCodeToGlyphId; - var glyphId; - - if (properties.composite) { - charCodeToGlyphId = Object.create(null); - if (cff.isCIDFont) { - // If the font is actually a CID font then we should use the charset - // to map CIDs to GIDs. - for (glyphId = 0; glyphId < charsets.length; glyphId++) { - var cid = charsets[glyphId]; - var charCode = properties.cMap.charCodeOf(cid); - charCodeToGlyphId[charCode] = glyphId; - } - } else { - // If it is NOT actually a CID font then CIDs should be mapped - // directly to GIDs. - for (glyphId = 0; glyphId < cff.charStrings.count; glyphId++) { - charCodeToGlyphId[glyphId] = glyphId; - } - } - return charCodeToGlyphId; - } - - var encoding = cff.encoding ? cff.encoding.encoding : null; - charCodeToGlyphId = type1FontGlyphMapping(properties, encoding, charsets); - return charCodeToGlyphId; - } - }; - - return CFFFont; -})(); - -var CFFParser = (function CFFParserClosure() { - var CharstringValidationData = [ - null, - { id: 'hstem', min: 2, stackClearing: true, stem: true }, - null, - { id: 'vstem', min: 2, stackClearing: true, stem: true }, - { id: 'vmoveto', min: 1, stackClearing: true }, - { id: 'rlineto', min: 2, resetStack: true }, - { id: 'hlineto', min: 1, resetStack: true }, - { id: 'vlineto', min: 1, resetStack: true }, - { id: 'rrcurveto', min: 6, resetStack: true }, - null, - { id: 'callsubr', min: 1, undefStack: true }, - { id: 'return', min: 0, undefStack: true }, - null, // 12 - null, - { id: 'endchar', min: 0, stackClearing: true }, - null, - null, - null, - { id: 'hstemhm', min: 2, stackClearing: true, stem: true }, - { id: 'hintmask', min: 0, stackClearing: true }, - { id: 'cntrmask', min: 0, stackClearing: true }, - { id: 'rmoveto', min: 2, stackClearing: true }, - { id: 'hmoveto', min: 1, stackClearing: true }, - { id: 'vstemhm', min: 2, stackClearing: true, stem: true }, - { id: 'rcurveline', min: 8, resetStack: true }, - { id: 'rlinecurve', min: 8, resetStack: true }, - { id: 'vvcurveto', min: 4, resetStack: true }, - { id: 'hhcurveto', min: 4, resetStack: true }, - null, // shortint - { id: 'callgsubr', min: 1, undefStack: true }, - { id: 'vhcurveto', min: 4, resetStack: true }, - { id: 'hvcurveto', min: 4, resetStack: true } - ]; - var CharstringValidationData12 = [ - null, - null, - null, - { id: 'and', min: 2, stackDelta: -1 }, - { id: 'or', min: 2, stackDelta: -1 }, - { id: 'not', min: 1, stackDelta: 0 }, - null, - null, - null, - { id: 'abs', min: 1, stackDelta: 0 }, - { id: 'add', min: 2, stackDelta: -1, - stackFn: function stack_div(stack, index) { - stack[index - 2] = stack[index - 2] + stack[index - 1]; - } - }, - { id: 'sub', min: 2, stackDelta: -1, - stackFn: function stack_div(stack, index) { - stack[index - 2] = stack[index - 2] - stack[index - 1]; - } - }, - { id: 'div', min: 2, stackDelta: -1, - stackFn: function stack_div(stack, index) { - stack[index - 2] = stack[index - 2] / stack[index - 1]; - } - }, - null, - { id: 'neg', min: 1, stackDelta: 0, - stackFn: function stack_div(stack, index) { - stack[index - 1] = -stack[index - 1]; - } - }, - { id: 'eq', min: 2, stackDelta: -1 }, - null, - null, - { id: 'drop', min: 1, stackDelta: -1 }, - null, - { id: 'put', min: 2, stackDelta: -2 }, - { id: 'get', min: 1, stackDelta: 0 }, - { id: 'ifelse', min: 4, stackDelta: -3 }, - { id: 'random', min: 0, stackDelta: 1 }, - { id: 'mul', min: 2, stackDelta: -1, - stackFn: function stack_div(stack, index) { - stack[index - 2] = stack[index - 2] * stack[index - 1]; - } - }, - null, - { id: 'sqrt', min: 1, stackDelta: 0 }, - { id: 'dup', min: 1, stackDelta: 1 }, - { id: 'exch', min: 2, stackDelta: 0 }, - { id: 'index', min: 2, stackDelta: 0 }, - { id: 'roll', min: 3, stackDelta: -2 }, - null, - null, - null, - { id: 'hflex', min: 7, resetStack: true }, - { id: 'flex', min: 13, resetStack: true }, - { id: 'hflex1', min: 9, resetStack: true }, - { id: 'flex1', min: 11, resetStack: true } - ]; - - function CFFParser(file, properties) { - this.bytes = file.getBytes(); - this.properties = properties; - } - CFFParser.prototype = { - parse: function CFFParser_parse() { - var properties = this.properties; - var cff = new CFF(); - this.cff = cff; - - // The first five sections must be in order, all the others are reached - // via offsets contained in one of the below. - var header = this.parseHeader(); - var nameIndex = this.parseIndex(header.endPos); - var topDictIndex = this.parseIndex(nameIndex.endPos); - var stringIndex = this.parseIndex(topDictIndex.endPos); - var globalSubrIndex = this.parseIndex(stringIndex.endPos); - - var topDictParsed = this.parseDict(topDictIndex.obj.get(0)); - var topDict = this.createDict(CFFTopDict, topDictParsed, cff.strings); - - cff.header = header.obj; - cff.names = this.parseNameIndex(nameIndex.obj); - cff.strings = this.parseStringIndex(stringIndex.obj); - cff.topDict = topDict; - cff.globalSubrIndex = globalSubrIndex.obj; - - this.parsePrivateDict(cff.topDict); - - cff.isCIDFont = topDict.hasName('ROS'); - - var charStringOffset = topDict.getByName('CharStrings'); - var charStringsAndSeacs = this.parseCharStrings(charStringOffset); - cff.charStrings = charStringsAndSeacs.charStrings; - cff.seacs = charStringsAndSeacs.seacs; - cff.widths = charStringsAndSeacs.widths; - - var fontMatrix = topDict.getByName('FontMatrix'); - if (fontMatrix) { - properties.fontMatrix = fontMatrix; - } - - var fontBBox = topDict.getByName('FontBBox'); - if (fontBBox) { - // adjusting ascent/descent - properties.ascent = fontBBox[3]; - properties.descent = fontBBox[1]; - properties.ascentScaled = true; - } - - var charset, encoding; - if (cff.isCIDFont) { - var fdArrayIndex = this.parseIndex(topDict.getByName('FDArray')).obj; - for (var i = 0, ii = fdArrayIndex.count; i < ii; ++i) { - var dictRaw = fdArrayIndex.get(i); - var fontDict = this.createDict(CFFTopDict, this.parseDict(dictRaw), - cff.strings); - this.parsePrivateDict(fontDict); - cff.fdArray.push(fontDict); - } - // cid fonts don't have an encoding - encoding = null; - charset = this.parseCharsets(topDict.getByName('charset'), - cff.charStrings.count, cff.strings, true); - cff.fdSelect = this.parseFDSelect(topDict.getByName('FDSelect'), - cff.charStrings.count); - } else { - charset = this.parseCharsets(topDict.getByName('charset'), - cff.charStrings.count, cff.strings, false); - encoding = this.parseEncoding(topDict.getByName('Encoding'), - properties, - cff.strings, charset.charset); - } - cff.charset = charset; - cff.encoding = encoding; - - return cff; - }, - parseHeader: function CFFParser_parseHeader() { - var bytes = this.bytes; - var bytesLength = bytes.length; - var offset = 0; - - // Prevent an infinite loop, by checking that the offset is within the - // bounds of the bytes array. Necessary in empty, or invalid, font files. - while (offset < bytesLength && bytes[offset] !== 1) { - ++offset; - } - if (offset >= bytesLength) { - error('Invalid CFF header'); - } else if (offset !== 0) { - info('cff data is shifted'); - bytes = bytes.subarray(offset); - this.bytes = bytes; - } - var major = bytes[0]; - var minor = bytes[1]; - var hdrSize = bytes[2]; - var offSize = bytes[3]; - var header = new CFFHeader(major, minor, hdrSize, offSize); - return { obj: header, endPos: hdrSize }; - }, - parseDict: function CFFParser_parseDict(dict) { - var pos = 0; - - function parseOperand() { - var value = dict[pos++]; - if (value === 30) { - return parseFloatOperand(pos); - } else if (value === 28) { - value = dict[pos++]; - value = ((value << 24) | (dict[pos++] << 16)) >> 16; - return value; - } else if (value === 29) { - value = dict[pos++]; - value = (value << 8) | dict[pos++]; - value = (value << 8) | dict[pos++]; - value = (value << 8) | dict[pos++]; - return value; - } else if (value >= 32 && value <= 246) { - return value - 139; - } else if (value >= 247 && value <= 250) { - return ((value - 247) * 256) + dict[pos++] + 108; - } else if (value >= 251 && value <= 254) { - return -((value - 251) * 256) - dict[pos++] - 108; - } else { - error('255 is not a valid DICT command'); - } - return -1; - } - - function parseFloatOperand() { - var str = ''; - var eof = 15; - var lookup = ['0', '1', '2', '3', '4', '5', '6', '7', '8', - '9', '.', 'E', 'E-', null, '-']; - var length = dict.length; - while (pos < length) { - var b = dict[pos++]; - var b1 = b >> 4; - var b2 = b & 15; - - if (b1 === eof) { - break; - } - str += lookup[b1]; - - if (b2 === eof) { - break; - } - str += lookup[b2]; - } - return parseFloat(str); - } - - var operands = []; - var entries = []; - - pos = 0; - var end = dict.length; - while (pos < end) { - var b = dict[pos]; - if (b <= 21) { - if (b === 12) { - b = (b << 8) | dict[++pos]; - } - entries.push([b, operands]); - operands = []; - ++pos; - } else { - operands.push(parseOperand()); - } - } - return entries; - }, - parseIndex: function CFFParser_parseIndex(pos) { - var cffIndex = new CFFIndex(); - var bytes = this.bytes; - var count = (bytes[pos++] << 8) | bytes[pos++]; - var offsets = []; - var end = pos; - var i, ii; - - if (count !== 0) { - var offsetSize = bytes[pos++]; - // add 1 for offset to determine size of last object - var startPos = pos + ((count + 1) * offsetSize) - 1; - - for (i = 0, ii = count + 1; i < ii; ++i) { - var offset = 0; - for (var j = 0; j < offsetSize; ++j) { - offset <<= 8; - offset += bytes[pos++]; - } - offsets.push(startPos + offset); - } - end = offsets[count]; - } - for (i = 0, ii = offsets.length - 1; i < ii; ++i) { - var offsetStart = offsets[i]; - var offsetEnd = offsets[i + 1]; - cffIndex.add(bytes.subarray(offsetStart, offsetEnd)); - } - return {obj: cffIndex, endPos: end}; - }, - parseNameIndex: function CFFParser_parseNameIndex(index) { - var names = []; - for (var i = 0, ii = index.count; i < ii; ++i) { - var name = index.get(i); - // OTS doesn't allow names to be over 127 characters. - var length = Math.min(name.length, 127); - var data = []; - // OTS also only permits certain characters in the name. - for (var j = 0; j < length; ++j) { - var c = name[j]; - if (j === 0 && c === 0) { - data[j] = c; - continue; - } - if ((c < 33 || c > 126) || c === 91 /* [ */ || c === 93 /* ] */ || - c === 40 /* ( */ || c === 41 /* ) */ || c === 123 /* { */ || - c === 125 /* } */ || c === 60 /* < */ || c === 62 /* > */ || - c === 47 /* / */ || c === 37 /* % */ || c === 35 /* # */) { - data[j] = 95; - continue; - } - data[j] = c; - } - names.push(bytesToString(data)); - } - return names; - }, - parseStringIndex: function CFFParser_parseStringIndex(index) { - var strings = new CFFStrings(); - for (var i = 0, ii = index.count; i < ii; ++i) { - var data = index.get(i); - strings.add(bytesToString(data)); - } - return strings; - }, - createDict: function CFFParser_createDict(Type, dict, strings) { - var cffDict = new Type(strings); - for (var i = 0, ii = dict.length; i < ii; ++i) { - var pair = dict[i]; - var key = pair[0]; - var value = pair[1]; - cffDict.setByKey(key, value); - } - return cffDict; - }, - parseCharStrings: function CFFParser_parseCharStrings(charStringOffset) { - var charStrings = this.parseIndex(charStringOffset).obj; - var seacs = []; - var widths = []; - var count = charStrings.count; - for (var i = 0; i < count; i++) { - var charstring = charStrings.get(i); - - var stackSize = 0; - var stack = []; - var undefStack = true; - var hints = 0; - var valid = true; - var data = charstring; - var length = data.length; - var firstStackClearing = true; - for (var j = 0; j < length;) { - var value = data[j++]; - var validationCommand = null; - if (value === 12) { - var q = data[j++]; - if (q === 0) { - // The CFF specification state that the 'dotsection' command - // (12, 0) is deprecated and treated as a no-op, but all Type2 - // charstrings processors should support them. Unfortunately - // the font sanitizer don't. As a workaround the sequence (12, 0) - // is replaced by a useless (0, hmoveto). - data[j - 2] = 139; - data[j - 1] = 22; - stackSize = 0; - } else { - validationCommand = CharstringValidationData12[q]; - } - } else if (value === 28) { // number (16 bit) - stack[stackSize] = ((data[j] << 24) | (data[j + 1] << 16)) >> 16; - j += 2; - stackSize++; - } else if (value === 14) { - if (stackSize >= 4) { - stackSize -= 4; - if (SEAC_ANALYSIS_ENABLED) { - seacs[i] = stack.slice(stackSize, stackSize + 4); - valid = false; - } - } - validationCommand = CharstringValidationData[value]; - } else if (value >= 32 && value <= 246) { // number - stack[stackSize] = value - 139; - stackSize++; - } else if (value >= 247 && value <= 254) { // number (+1 bytes) - stack[stackSize] = (value < 251 ? - ((value - 247) << 8) + data[j] + 108 : - -((value - 251) << 8) - data[j] - 108); - j++; - stackSize++; - } else if (value === 255) { // number (32 bit) - stack[stackSize] = ((data[j] << 24) | (data[j + 1] << 16) | - (data[j + 2] << 8) | data[j + 3]) / 65536; - j += 4; - stackSize++; - } else if (value === 19 || value === 20) { - hints += stackSize >> 1; - j += (hints + 7) >> 3; // skipping right amount of hints flag data - stackSize %= 2; - validationCommand = CharstringValidationData[value]; - } else { - validationCommand = CharstringValidationData[value]; - } - if (validationCommand) { - if (validationCommand.stem) { - hints += stackSize >> 1; - } - if ('min' in validationCommand) { - if (!undefStack && stackSize < validationCommand.min) { - warn('Not enough parameters for ' + validationCommand.id + - '; actual: ' + stackSize + - ', expected: ' + validationCommand.min); - valid = false; - break; - } - } - if (firstStackClearing && validationCommand.stackClearing) { - firstStackClearing = false; - // the optional character width can be found before the first - // stack-clearing command arguments - stackSize -= validationCommand.min; - if (stackSize >= 2 && validationCommand.stem) { - // there are even amount of arguments for stem commands - stackSize %= 2; - } else if (stackSize > 1) { - warn('Found too many parameters for stack-clearing command'); - } - if (stackSize > 0 && stack[stackSize - 1] >= 0) { - widths[i] = stack[stackSize - 1]; - } - } - if ('stackDelta' in validationCommand) { - if ('stackFn' in validationCommand) { - validationCommand.stackFn(stack, stackSize); - } - stackSize += validationCommand.stackDelta; - } else if (validationCommand.stackClearing) { - stackSize = 0; - } else if (validationCommand.resetStack) { - stackSize = 0; - undefStack = false; - } else if (validationCommand.undefStack) { - stackSize = 0; - undefStack = true; - firstStackClearing = false; - } - } - } - if (!valid) { - // resetting invalid charstring to single 'endchar' - charStrings.set(i, new Uint8Array([14])); - } - } - return { charStrings: charStrings, seacs: seacs, widths: widths }; - }, - emptyPrivateDictionary: - function CFFParser_emptyPrivateDictionary(parentDict) { - var privateDict = this.createDict(CFFPrivateDict, [], - parentDict.strings); - parentDict.setByKey(18, [0, 0]); - parentDict.privateDict = privateDict; - }, - parsePrivateDict: function CFFParser_parsePrivateDict(parentDict) { - // no private dict, do nothing - if (!parentDict.hasName('Private')) { - this.emptyPrivateDictionary(parentDict); - return; - } - var privateOffset = parentDict.getByName('Private'); - // make sure the params are formatted correctly - if (!isArray(privateOffset) || privateOffset.length !== 2) { - parentDict.removeByName('Private'); - return; - } - var size = privateOffset[0]; - var offset = privateOffset[1]; - // remove empty dicts or ones that refer to invalid location - if (size === 0 || offset >= this.bytes.length) { - this.emptyPrivateDictionary(parentDict); - return; - } - - var privateDictEnd = offset + size; - var dictData = this.bytes.subarray(offset, privateDictEnd); - var dict = this.parseDict(dictData); - var privateDict = this.createDict(CFFPrivateDict, dict, - parentDict.strings); - parentDict.privateDict = privateDict; - - // Parse the Subrs index also since it's relative to the private dict. - if (!privateDict.getByName('Subrs')) { - return; - } - var subrsOffset = privateDict.getByName('Subrs'); - var relativeOffset = offset + subrsOffset; - // Validate the offset. - if (subrsOffset === 0 || relativeOffset >= this.bytes.length) { - this.emptyPrivateDictionary(parentDict); - return; - } - var subrsIndex = this.parseIndex(relativeOffset); - privateDict.subrsIndex = subrsIndex.obj; - }, - parseCharsets: function CFFParser_parseCharsets(pos, length, strings, cid) { - if (pos === 0) { - return new CFFCharset(true, CFFCharsetPredefinedTypes.ISO_ADOBE, - ISOAdobeCharset); - } else if (pos === 1) { - return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT, - ExpertCharset); - } else if (pos === 2) { - return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT_SUBSET, - ExpertSubsetCharset); - } - - var bytes = this.bytes; - var start = pos; - var format = bytes[pos++]; - var charset = ['.notdef']; - var id, count, i; - - // subtract 1 for the .notdef glyph - length -= 1; - - switch (format) { - case 0: - for (i = 0; i < length; i++) { - id = (bytes[pos++] << 8) | bytes[pos++]; - charset.push(cid ? id : strings.get(id)); - } - break; - case 1: - while (charset.length <= length) { - id = (bytes[pos++] << 8) | bytes[pos++]; - count = bytes[pos++]; - for (i = 0; i <= count; i++) { - charset.push(cid ? id++ : strings.get(id++)); - } - } - break; - case 2: - while (charset.length <= length) { - id = (bytes[pos++] << 8) | bytes[pos++]; - count = (bytes[pos++] << 8) | bytes[pos++]; - for (i = 0; i <= count; i++) { - charset.push(cid ? id++ : strings.get(id++)); - } - } - break; - default: - error('Unknown charset format'); - } - // Raw won't be needed if we actually compile the charset. - var end = pos; - var raw = bytes.subarray(start, end); - - return new CFFCharset(false, format, charset, raw); - }, - parseEncoding: function CFFParser_parseEncoding(pos, - properties, - strings, - charset) { - var encoding = {}; - var bytes = this.bytes; - var predefined = false; - var hasSupplement = false; - var format, i, ii; - var raw = null; - - function readSupplement() { - var supplementsCount = bytes[pos++]; - for (i = 0; i < supplementsCount; i++) { - var code = bytes[pos++]; - var sid = (bytes[pos++] << 8) + (bytes[pos++] & 0xff); - encoding[code] = charset.indexOf(strings.get(sid)); - } - } - - if (pos === 0 || pos === 1) { - predefined = true; - format = pos; - var baseEncoding = pos ? Encodings.ExpertEncoding : - Encodings.StandardEncoding; - for (i = 0, ii = charset.length; i < ii; i++) { - var index = baseEncoding.indexOf(charset[i]); - if (index !== -1) { - encoding[index] = i; - } - } - } else { - var dataStart = pos; - format = bytes[pos++]; - switch (format & 0x7f) { - case 0: - var glyphsCount = bytes[pos++]; - for (i = 1; i <= glyphsCount; i++) { - encoding[bytes[pos++]] = i; - } - break; - - case 1: - var rangesCount = bytes[pos++]; - var gid = 1; - for (i = 0; i < rangesCount; i++) { - var start = bytes[pos++]; - var left = bytes[pos++]; - for (var j = start; j <= start + left; j++) { - encoding[j] = gid++; - } - } - break; - - default: - error('Unknow encoding format: ' + format + ' in CFF'); - break; - } - var dataEnd = pos; - if (format & 0x80) { - // The font sanitizer does not support CFF encoding with a - // supplement, since the encoding is not really used to map - // between gid to glyph, let's overwrite what is declared in - // the top dictionary to let the sanitizer think the font use - // StandardEncoding, that's a lie but that's ok. - bytes[dataStart] &= 0x7f; - readSupplement(); - hasSupplement = true; - } - raw = bytes.subarray(dataStart, dataEnd); - } - format = format & 0x7f; - return new CFFEncoding(predefined, format, encoding, raw); - }, - parseFDSelect: function CFFParser_parseFDSelect(pos, length) { - var start = pos; - var bytes = this.bytes; - var format = bytes[pos++]; - var fdSelect = []; - var i; - - switch (format) { - case 0: - for (i = 0; i < length; ++i) { - var id = bytes[pos++]; - fdSelect.push(id); - } - break; - case 3: - var rangesCount = (bytes[pos++] << 8) | bytes[pos++]; - for (i = 0; i < rangesCount; ++i) { - var first = (bytes[pos++] << 8) | bytes[pos++]; - var fdIndex = bytes[pos++]; - var next = (bytes[pos] << 8) | bytes[pos + 1]; - for (var j = first; j < next; ++j) { - fdSelect.push(fdIndex); - } - } - // Advance past the sentinel(next). - pos += 2; - break; - default: - error('Unknown fdselect format ' + format); - break; - } - var end = pos; - return new CFFFDSelect(fdSelect, bytes.subarray(start, end)); - } - }; - return CFFParser; -})(); - -// Compact Font Format -var CFF = (function CFFClosure() { - function CFF() { - this.header = null; - this.names = []; - this.topDict = null; - this.strings = new CFFStrings(); - this.globalSubrIndex = null; - - // The following could really be per font, but since we only have one font - // store them here. - this.encoding = null; - this.charset = null; - this.charStrings = null; - this.fdArray = []; - this.fdSelect = null; - - this.isCIDFont = false; - } - return CFF; -})(); - -var CFFHeader = (function CFFHeaderClosure() { - function CFFHeader(major, minor, hdrSize, offSize) { - this.major = major; - this.minor = minor; - this.hdrSize = hdrSize; - this.offSize = offSize; - } - return CFFHeader; -})(); - -var CFFStrings = (function CFFStringsClosure() { - function CFFStrings() { - this.strings = []; - } - CFFStrings.prototype = { - get: function CFFStrings_get(index) { - if (index >= 0 && index <= 390) { - return CFFStandardStrings[index]; - } - if (index - 391 <= this.strings.length) { - return this.strings[index - 391]; - } - return CFFStandardStrings[0]; - }, - add: function CFFStrings_add(value) { - this.strings.push(value); - }, - get count() { - return this.strings.length; - } - }; - return CFFStrings; -})(); - -var CFFIndex = (function CFFIndexClosure() { - function CFFIndex() { - this.objects = []; - this.length = 0; - } - CFFIndex.prototype = { - add: function CFFIndex_add(data) { - this.length += data.length; - this.objects.push(data); - }, - set: function CFFIndex_set(index, data) { - this.length += data.length - this.objects[index].length; - this.objects[index] = data; - }, - get: function CFFIndex_get(index) { - return this.objects[index]; - }, - get count() { - return this.objects.length; - } - }; - return CFFIndex; -})(); - -var CFFDict = (function CFFDictClosure() { - function CFFDict(tables, strings) { - this.keyToNameMap = tables.keyToNameMap; - this.nameToKeyMap = tables.nameToKeyMap; - this.defaults = tables.defaults; - this.types = tables.types; - this.opcodes = tables.opcodes; - this.order = tables.order; - this.strings = strings; - this.values = {}; - } - CFFDict.prototype = { - // value should always be an array - setByKey: function CFFDict_setByKey(key, value) { - if (!(key in this.keyToNameMap)) { - return false; - } - // ignore empty values - if (value.length === 0) { - return true; - } - var type = this.types[key]; - // remove the array wrapping these types of values - if (type === 'num' || type === 'sid' || type === 'offset') { - value = value[0]; - } - this.values[key] = value; - return true; - }, - setByName: function CFFDict_setByName(name, value) { - if (!(name in this.nameToKeyMap)) { - error('Invalid dictionary name "' + name + '"'); - } - this.values[this.nameToKeyMap[name]] = value; - }, - hasName: function CFFDict_hasName(name) { - return this.nameToKeyMap[name] in this.values; - }, - getByName: function CFFDict_getByName(name) { - if (!(name in this.nameToKeyMap)) { - error('Invalid dictionary name "' + name + '"'); - } - var key = this.nameToKeyMap[name]; - if (!(key in this.values)) { - return this.defaults[key]; - } - return this.values[key]; - }, - removeByName: function CFFDict_removeByName(name) { - delete this.values[this.nameToKeyMap[name]]; - } - }; - CFFDict.createTables = function CFFDict_createTables(layout) { - var tables = { - keyToNameMap: {}, - nameToKeyMap: {}, - defaults: {}, - types: {}, - opcodes: {}, - order: [] - }; - for (var i = 0, ii = layout.length; i < ii; ++i) { - var entry = layout[i]; - var key = isArray(entry[0]) ? (entry[0][0] << 8) + entry[0][1] : entry[0]; - tables.keyToNameMap[key] = entry[1]; - tables.nameToKeyMap[entry[1]] = key; - tables.types[key] = entry[2]; - tables.defaults[key] = entry[3]; - tables.opcodes[key] = isArray(entry[0]) ? entry[0] : [entry[0]]; - tables.order.push(key); - } - return tables; - }; - return CFFDict; -})(); - -var CFFTopDict = (function CFFTopDictClosure() { - var layout = [ - [[12, 30], 'ROS', ['sid', 'sid', 'num'], null], - [[12, 20], 'SyntheticBase', 'num', null], - [0, 'version', 'sid', null], - [1, 'Notice', 'sid', null], - [[12, 0], 'Copyright', 'sid', null], - [2, 'FullName', 'sid', null], - [3, 'FamilyName', 'sid', null], - [4, 'Weight', 'sid', null], - [[12, 1], 'isFixedPitch', 'num', 0], - [[12, 2], 'ItalicAngle', 'num', 0], - [[12, 3], 'UnderlinePosition', 'num', -100], - [[12, 4], 'UnderlineThickness', 'num', 50], - [[12, 5], 'PaintType', 'num', 0], - [[12, 6], 'CharstringType', 'num', 2], - [[12, 7], 'FontMatrix', ['num', 'num', 'num', 'num', 'num', 'num'], - [0.001, 0, 0, 0.001, 0, 0]], - [13, 'UniqueID', 'num', null], - [5, 'FontBBox', ['num', 'num', 'num', 'num'], [0, 0, 0, 0]], - [[12, 8], 'StrokeWidth', 'num', 0], - [14, 'XUID', 'array', null], - [15, 'charset', 'offset', 0], - [16, 'Encoding', 'offset', 0], - [17, 'CharStrings', 'offset', 0], - [18, 'Private', ['offset', 'offset'], null], - [[12, 21], 'PostScript', 'sid', null], - [[12, 22], 'BaseFontName', 'sid', null], - [[12, 23], 'BaseFontBlend', 'delta', null], - [[12, 31], 'CIDFontVersion', 'num', 0], - [[12, 32], 'CIDFontRevision', 'num', 0], - [[12, 33], 'CIDFontType', 'num', 0], - [[12, 34], 'CIDCount', 'num', 8720], - [[12, 35], 'UIDBase', 'num', null], - // XXX: CID Fonts on DirectWrite 6.1 only seem to work if FDSelect comes - // before FDArray. - [[12, 37], 'FDSelect', 'offset', null], - [[12, 36], 'FDArray', 'offset', null], - [[12, 38], 'FontName', 'sid', null] - ]; - var tables = null; - function CFFTopDict(strings) { - if (tables === null) { - tables = CFFDict.createTables(layout); - } - CFFDict.call(this, tables, strings); - this.privateDict = null; - } - CFFTopDict.prototype = Object.create(CFFDict.prototype); - return CFFTopDict; -})(); - -var CFFPrivateDict = (function CFFPrivateDictClosure() { - var layout = [ - [6, 'BlueValues', 'delta', null], - [7, 'OtherBlues', 'delta', null], - [8, 'FamilyBlues', 'delta', null], - [9, 'FamilyOtherBlues', 'delta', null], - [[12, 9], 'BlueScale', 'num', 0.039625], - [[12, 10], 'BlueShift', 'num', 7], - [[12, 11], 'BlueFuzz', 'num', 1], - [10, 'StdHW', 'num', null], - [11, 'StdVW', 'num', null], - [[12, 12], 'StemSnapH', 'delta', null], - [[12, 13], 'StemSnapV', 'delta', null], - [[12, 14], 'ForceBold', 'num', 0], - [[12, 17], 'LanguageGroup', 'num', 0], - [[12, 18], 'ExpansionFactor', 'num', 0.06], - [[12, 19], 'initialRandomSeed', 'num', 0], - [20, 'defaultWidthX', 'num', 0], - [21, 'nominalWidthX', 'num', 0], - [19, 'Subrs', 'offset', null] - ]; - var tables = null; - function CFFPrivateDict(strings) { - if (tables === null) { - tables = CFFDict.createTables(layout); - } - CFFDict.call(this, tables, strings); - this.subrsIndex = null; - } - CFFPrivateDict.prototype = Object.create(CFFDict.prototype); - return CFFPrivateDict; -})(); - -var CFFCharsetPredefinedTypes = { - ISO_ADOBE: 0, - EXPERT: 1, - EXPERT_SUBSET: 2 -}; -var CFFCharset = (function CFFCharsetClosure() { - function CFFCharset(predefined, format, charset, raw) { - this.predefined = predefined; - this.format = format; - this.charset = charset; - this.raw = raw; - } - return CFFCharset; -})(); - -var CFFEncoding = (function CFFEncodingClosure() { - function CFFEncoding(predefined, format, encoding, raw) { - this.predefined = predefined; - this.format = format; - this.encoding = encoding; - this.raw = raw; - } - return CFFEncoding; -})(); - -var CFFFDSelect = (function CFFFDSelectClosure() { - function CFFFDSelect(fdSelect, raw) { - this.fdSelect = fdSelect; - this.raw = raw; - } - return CFFFDSelect; -})(); - -// Helper class to keep track of where an offset is within the data and helps -// filling in that offset once it's known. -var CFFOffsetTracker = (function CFFOffsetTrackerClosure() { - function CFFOffsetTracker() { - this.offsets = {}; - } - CFFOffsetTracker.prototype = { - isTracking: function CFFOffsetTracker_isTracking(key) { - return key in this.offsets; - }, - track: function CFFOffsetTracker_track(key, location) { - if (key in this.offsets) { - error('Already tracking location of ' + key); - } - this.offsets[key] = location; - }, - offset: function CFFOffsetTracker_offset(value) { - for (var key in this.offsets) { - this.offsets[key] += value; - } - }, - setEntryLocation: function CFFOffsetTracker_setEntryLocation(key, - values, - output) { - if (!(key in this.offsets)) { - error('Not tracking location of ' + key); - } - var data = output.data; - var dataOffset = this.offsets[key]; - var size = 5; - for (var i = 0, ii = values.length; i < ii; ++i) { - var offset0 = i * size + dataOffset; - var offset1 = offset0 + 1; - var offset2 = offset0 + 2; - var offset3 = offset0 + 3; - var offset4 = offset0 + 4; - // It's easy to screw up offsets so perform this sanity check. - if (data[offset0] !== 0x1d || data[offset1] !== 0 || - data[offset2] !== 0 || data[offset3] !== 0 || data[offset4] !== 0) { - error('writing to an offset that is not empty'); - } - var value = values[i]; - data[offset0] = 0x1d; - data[offset1] = (value >> 24) & 0xFF; - data[offset2] = (value >> 16) & 0xFF; - data[offset3] = (value >> 8) & 0xFF; - data[offset4] = value & 0xFF; - } - } - }; - return CFFOffsetTracker; -})(); - -// Takes a CFF and converts it to the binary representation. -var CFFCompiler = (function CFFCompilerClosure() { - function CFFCompiler(cff) { - this.cff = cff; - } - CFFCompiler.prototype = { - compile: function CFFCompiler_compile() { - var cff = this.cff; - var output = { - data: [], - length: 0, - add: function CFFCompiler_add(data) { - this.data = this.data.concat(data); - this.length = this.data.length; - } - }; - - // Compile the five entries that must be in order. - var header = this.compileHeader(cff.header); - output.add(header); - - var nameIndex = this.compileNameIndex(cff.names); - output.add(nameIndex); - - if (cff.isCIDFont) { - // The spec is unclear on how font matrices should relate to each other - // when there is one in the main top dict and the sub top dicts. - // Windows handles this differently than linux and osx so we have to - // normalize to work on all. - // Rules based off of some mailing list discussions: - // - If main font has a matrix and subfont doesn't, use the main matrix. - // - If no main font matrix and there is a subfont matrix, use the - // subfont matrix. - // - If both have matrices, concat together. - // - If neither have matrices, use default. - // To make this work on all platforms we move the top matrix into each - // sub top dict and concat if necessary. - if (cff.topDict.hasName('FontMatrix')) { - var base = cff.topDict.getByName('FontMatrix'); - cff.topDict.removeByName('FontMatrix'); - for (var i = 0, ii = cff.fdArray.length; i < ii; i++) { - var subDict = cff.fdArray[i]; - var matrix = base.slice(0); - if (subDict.hasName('FontMatrix')) { - matrix = Util.transform(matrix, subDict.getByName('FontMatrix')); - } - subDict.setByName('FontMatrix', matrix); - } - } - } - - var compiled = this.compileTopDicts([cff.topDict], - output.length, - cff.isCIDFont); - output.add(compiled.output); - var topDictTracker = compiled.trackers[0]; - - var stringIndex = this.compileStringIndex(cff.strings.strings); - output.add(stringIndex); - - var globalSubrIndex = this.compileIndex(cff.globalSubrIndex); - output.add(globalSubrIndex); - - // Now start on the other entries that have no specfic order. - if (cff.encoding && cff.topDict.hasName('Encoding')) { - if (cff.encoding.predefined) { - topDictTracker.setEntryLocation('Encoding', [cff.encoding.format], - output); - } else { - var encoding = this.compileEncoding(cff.encoding); - topDictTracker.setEntryLocation('Encoding', [output.length], output); - output.add(encoding); - } - } - - if (cff.charset && cff.topDict.hasName('charset')) { - if (cff.charset.predefined) { - topDictTracker.setEntryLocation('charset', [cff.charset.format], - output); - } else { - var charset = this.compileCharset(cff.charset); - topDictTracker.setEntryLocation('charset', [output.length], output); - output.add(charset); - } - } - - var charStrings = this.compileCharStrings(cff.charStrings); - topDictTracker.setEntryLocation('CharStrings', [output.length], output); - output.add(charStrings); - - if (cff.isCIDFont) { - // For some reason FDSelect must be in front of FDArray on windows. OSX - // and linux don't seem to care. - topDictTracker.setEntryLocation('FDSelect', [output.length], output); - var fdSelect = this.compileFDSelect(cff.fdSelect.raw); - output.add(fdSelect); - // It is unclear if the sub font dictionary can have CID related - // dictionary keys, but the sanitizer doesn't like them so remove them. - compiled = this.compileTopDicts(cff.fdArray, output.length, true); - topDictTracker.setEntryLocation('FDArray', [output.length], output); - output.add(compiled.output); - var fontDictTrackers = compiled.trackers; - - this.compilePrivateDicts(cff.fdArray, fontDictTrackers, output); - } - - this.compilePrivateDicts([cff.topDict], [topDictTracker], output); - - // If the font data ends with INDEX whose object data is zero-length, - // the sanitizer will bail out. Add a dummy byte to avoid that. - output.add([0]); - - return output.data; - }, - encodeNumber: function CFFCompiler_encodeNumber(value) { - if (parseFloat(value) === parseInt(value, 10) && !isNaN(value)) { // isInt - return this.encodeInteger(value); - } else { - return this.encodeFloat(value); - } - }, - encodeFloat: function CFFCompiler_encodeFloat(num) { - var value = num.toString(); - - // rounding inaccurate doubles - var m = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(value); - if (m) { - var epsilon = parseFloat('1e' + ((m[2] ? +m[2] : 0) + m[1].length)); - value = (Math.round(num * epsilon) / epsilon).toString(); - } - - var nibbles = ''; - var i, ii; - for (i = 0, ii = value.length; i < ii; ++i) { - var a = value[i]; - if (a === 'e') { - nibbles += value[++i] === '-' ? 'c' : 'b'; - } else if (a === '.') { - nibbles += 'a'; - } else if (a === '-') { - nibbles += 'e'; - } else { - nibbles += a; - } - } - nibbles += (nibbles.length & 1) ? 'f' : 'ff'; - var out = [30]; - for (i = 0, ii = nibbles.length; i < ii; i += 2) { - out.push(parseInt(nibbles.substr(i, 2), 16)); - } - return out; - }, - encodeInteger: function CFFCompiler_encodeInteger(value) { - var code; - if (value >= -107 && value <= 107) { - code = [value + 139]; - } else if (value >= 108 && value <= 1131) { - value = [value - 108]; - code = [(value >> 8) + 247, value & 0xFF]; - } else if (value >= -1131 && value <= -108) { - value = -value - 108; - code = [(value >> 8) + 251, value & 0xFF]; - } else if (value >= -32768 && value <= 32767) { - code = [0x1c, (value >> 8) & 0xFF, value & 0xFF]; - } else { - code = [0x1d, - (value >> 24) & 0xFF, - (value >> 16) & 0xFF, - (value >> 8) & 0xFF, - value & 0xFF]; - } - return code; - }, - compileHeader: function CFFCompiler_compileHeader(header) { - return [ - header.major, - header.minor, - header.hdrSize, - header.offSize - ]; - }, - compileNameIndex: function CFFCompiler_compileNameIndex(names) { - var nameIndex = new CFFIndex(); - for (var i = 0, ii = names.length; i < ii; ++i) { - nameIndex.add(stringToBytes(names[i])); - } - return this.compileIndex(nameIndex); - }, - compileTopDicts: function CFFCompiler_compileTopDicts(dicts, - length, - removeCidKeys) { - var fontDictTrackers = []; - var fdArrayIndex = new CFFIndex(); - for (var i = 0, ii = dicts.length; i < ii; ++i) { - var fontDict = dicts[i]; - if (removeCidKeys) { - fontDict.removeByName('CIDFontVersion'); - fontDict.removeByName('CIDFontRevision'); - fontDict.removeByName('CIDFontType'); - fontDict.removeByName('CIDCount'); - fontDict.removeByName('UIDBase'); - } - var fontDictTracker = new CFFOffsetTracker(); - var fontDictData = this.compileDict(fontDict, fontDictTracker); - fontDictTrackers.push(fontDictTracker); - fdArrayIndex.add(fontDictData); - fontDictTracker.offset(length); - } - fdArrayIndex = this.compileIndex(fdArrayIndex, fontDictTrackers); - return { - trackers: fontDictTrackers, - output: fdArrayIndex - }; - }, - compilePrivateDicts: function CFFCompiler_compilePrivateDicts(dicts, - trackers, - output) { - for (var i = 0, ii = dicts.length; i < ii; ++i) { - var fontDict = dicts[i]; - assert(fontDict.privateDict && fontDict.hasName('Private'), - 'There must be an private dictionary.'); - var privateDict = fontDict.privateDict; - var privateDictTracker = new CFFOffsetTracker(); - var privateDictData = this.compileDict(privateDict, privateDictTracker); - - var outputLength = output.length; - privateDictTracker.offset(outputLength); - if (!privateDictData.length) { - // The private dictionary was empty, set the output length to zero to - // ensure the offset length isn't out of bounds in the eyes of the - // sanitizer. - outputLength = 0; - } - - trackers[i].setEntryLocation('Private', - [privateDictData.length, outputLength], - output); - output.add(privateDictData); - - if (privateDict.subrsIndex && privateDict.hasName('Subrs')) { - var subrs = this.compileIndex(privateDict.subrsIndex); - privateDictTracker.setEntryLocation('Subrs', [privateDictData.length], - output); - output.add(subrs); - } - } - }, - compileDict: function CFFCompiler_compileDict(dict, offsetTracker) { - var out = []; - // The dictionary keys must be in a certain order. - var order = dict.order; - for (var i = 0; i < order.length; ++i) { - var key = order[i]; - if (!(key in dict.values)) { - continue; - } - var values = dict.values[key]; - var types = dict.types[key]; - if (!isArray(types)) { - types = [types]; - } - if (!isArray(values)) { - values = [values]; - } - - // Remove any empty dict values. - if (values.length === 0) { - continue; - } - - for (var j = 0, jj = types.length; j < jj; ++j) { - var type = types[j]; - var value = values[j]; - switch (type) { - case 'num': - case 'sid': - out = out.concat(this.encodeNumber(value)); - break; - case 'offset': - // For offsets we just insert a 32bit integer so we don't have to - // deal with figuring out the length of the offset when it gets - // replaced later on by the compiler. - var name = dict.keyToNameMap[key]; - // Some offsets have the offset and the length, so just record the - // position of the first one. - if (!offsetTracker.isTracking(name)) { - offsetTracker.track(name, out.length); - } - out = out.concat([0x1d, 0, 0, 0, 0]); - break; - case 'array': - case 'delta': - out = out.concat(this.encodeNumber(value)); - for (var k = 1, kk = values.length; k < kk; ++k) { - out = out.concat(this.encodeNumber(values[k])); - } - break; - default: - error('Unknown data type of ' + type); - break; - } - } - out = out.concat(dict.opcodes[key]); - } - return out; - }, - compileStringIndex: function CFFCompiler_compileStringIndex(strings) { - var stringIndex = new CFFIndex(); - for (var i = 0, ii = strings.length; i < ii; ++i) { - stringIndex.add(stringToBytes(strings[i])); - } - return this.compileIndex(stringIndex); - }, - compileGlobalSubrIndex: function CFFCompiler_compileGlobalSubrIndex() { - var globalSubrIndex = this.cff.globalSubrIndex; - this.out.writeByteArray(this.compileIndex(globalSubrIndex)); - }, - compileCharStrings: function CFFCompiler_compileCharStrings(charStrings) { - return this.compileIndex(charStrings); - }, - compileCharset: function CFFCompiler_compileCharset(charset) { - return this.compileTypedArray(charset.raw); - }, - compileEncoding: function CFFCompiler_compileEncoding(encoding) { - return this.compileTypedArray(encoding.raw); - }, - compileFDSelect: function CFFCompiler_compileFDSelect(fdSelect) { - return this.compileTypedArray(fdSelect); - }, - compileTypedArray: function CFFCompiler_compileTypedArray(data) { - var out = []; - for (var i = 0, ii = data.length; i < ii; ++i) { - out[i] = data[i]; - } - return out; - }, - compileIndex: function CFFCompiler_compileIndex(index, trackers) { - trackers = trackers || []; - var objects = index.objects; - // First 2 bytes contains the number of objects contained into this index - var count = objects.length; - - // If there is no object, just create an index. This technically - // should just be [0, 0] but OTS has an issue with that. - if (count === 0) { - return [0, 0, 0]; - } - - var data = [(count >> 8) & 0xFF, count & 0xff]; - - var lastOffset = 1, i; - for (i = 0; i < count; ++i) { - lastOffset += objects[i].length; - } - - var offsetSize; - if (lastOffset < 0x100) { - offsetSize = 1; - } else if (lastOffset < 0x10000) { - offsetSize = 2; - } else if (lastOffset < 0x1000000) { - offsetSize = 3; - } else { - offsetSize = 4; - } - - // Next byte contains the offset size use to reference object in the file - data.push(offsetSize); - - // Add another offset after this one because we need a new offset - var relativeOffset = 1; - for (i = 0; i < count + 1; i++) { - if (offsetSize === 1) { - data.push(relativeOffset & 0xFF); - } else if (offsetSize === 2) { - data.push((relativeOffset >> 8) & 0xFF, - relativeOffset & 0xFF); - } else if (offsetSize === 3) { - data.push((relativeOffset >> 16) & 0xFF, - (relativeOffset >> 8) & 0xFF, - relativeOffset & 0xFF); - } else { - data.push((relativeOffset >>> 24) & 0xFF, - (relativeOffset >> 16) & 0xFF, - (relativeOffset >> 8) & 0xFF, - relativeOffset & 0xFF); - } - - if (objects[i]) { - relativeOffset += objects[i].length; - } - } - - for (i = 0; i < count; i++) { - // Notify the tracker where the object will be offset in the data. - if (trackers[i]) { - trackers[i].offset(data.length); - } - for (var j = 0, jj = objects[i].length; j < jj; j++) { - data.push(objects[i][j]); - } - } - return data; - } - }; - return CFFCompiler; -})(); - -// Workaround for seac on Windows. -(function checkSeacSupport() { - if (/Windows/.test(navigator.userAgent)) { - SEAC_ANALYSIS_ENABLED = true; - } -})(); - -// Workaround for Private Use Area characters in Chrome on Windows -// http://code.google.com/p/chromium/issues/detail?id=122465 -// https://github.com/mozilla/pdf.js/issues/1689 -(function checkChromeWindows() { - if (/Windows.*Chrome/.test(navigator.userAgent)) { - SKIP_PRIVATE_USE_RANGE_F000_TO_F01F = true; - } -})(); - - -var FontRendererFactory = (function FontRendererFactoryClosure() { - function getLong(data, offset) { - return (data[offset] << 24) | (data[offset + 1] << 16) | - (data[offset + 2] << 8) | data[offset + 3]; - } - - function getUshort(data, offset) { - return (data[offset] << 8) | data[offset + 1]; - } - - function parseCmap(data, start, end) { - var offset = (getUshort(data, start + 2) === 1 ? - getLong(data, start + 8) : getLong(data, start + 16)); - var format = getUshort(data, start + offset); - var length, ranges, p, i; - if (format === 4) { - length = getUshort(data, start + offset + 2); - var segCount = getUshort(data, start + offset + 6) >> 1; - p = start + offset + 14; - ranges = []; - for (i = 0; i < segCount; i++, p += 2) { - ranges[i] = {end: getUshort(data, p)}; - } - p += 2; - for (i = 0; i < segCount; i++, p += 2) { - ranges[i].start = getUshort(data, p); - } - for (i = 0; i < segCount; i++, p += 2) { - ranges[i].idDelta = getUshort(data, p); - } - for (i = 0; i < segCount; i++, p += 2) { - var idOffset = getUshort(data, p); - if (idOffset === 0) { - continue; - } - ranges[i].ids = []; - for (var j = 0, jj = ranges[i].end - ranges[i].start + 1; j < jj; j++) { - ranges[i].ids[j] = getUshort(data, p + idOffset); - idOffset += 2; - } - } - return ranges; - } else if (format === 12) { - length = getLong(data, start + offset + 4); - var groups = getLong(data, start + offset + 12); - p = start + offset + 16; - ranges = []; - for (i = 0; i < groups; i++) { - ranges.push({ - start: getLong(data, p), - end: getLong(data, p + 4), - idDelta: getLong(data, p + 8) - getLong(data, p) - }); - p += 12; - } - return ranges; - } - error('not supported cmap: ' + format); - } - - function parseCff(data, start, end) { - var properties = {}; - var parser = new CFFParser(new Stream(data, start, end - start), - properties); - var cff = parser.parse(); - return { - glyphs: cff.charStrings.objects, - subrs: (cff.topDict.privateDict && cff.topDict.privateDict.subrsIndex && - cff.topDict.privateDict.subrsIndex.objects), - gsubrs: cff.globalSubrIndex && cff.globalSubrIndex.objects - }; - } - - function parseGlyfTable(glyf, loca, isGlyphLocationsLong) { - var itemSize, itemDecode; - if (isGlyphLocationsLong) { - itemSize = 4; - itemDecode = function fontItemDecodeLong(data, offset) { - return (data[offset] << 24) | (data[offset + 1] << 16) | - (data[offset + 2] << 8) | data[offset + 3]; - }; - } else { - itemSize = 2; - itemDecode = function fontItemDecode(data, offset) { - return (data[offset] << 9) | (data[offset + 1] << 1); - }; - } - var glyphs = []; - var startOffset = itemDecode(loca, 0); - for (var j = itemSize; j < loca.length; j += itemSize) { - var endOffset = itemDecode(loca, j); - glyphs.push(glyf.subarray(startOffset, endOffset)); - startOffset = endOffset; - } - return glyphs; - } - - function lookupCmap(ranges, unicode) { - var code = unicode.charCodeAt(0); - var l = 0, r = ranges.length - 1; - while (l < r) { - var c = (l + r + 1) >> 1; - if (code < ranges[c].start) { - r = c - 1; - } else { - l = c; - } - } - if (ranges[l].start <= code && code <= ranges[l].end) { - return (ranges[l].idDelta + (ranges[l].ids ? - ranges[l].ids[code - ranges[l].start] : code)) & 0xFFFF; - } - return 0; - } - - function compileGlyf(code, cmds, font) { - function moveTo(x, y) { - cmds.push({cmd: 'moveTo', args: [x, y]}); - } - function lineTo(x, y) { - cmds.push({cmd: 'lineTo', args: [x, y]}); - } - function quadraticCurveTo(xa, ya, x, y) { - cmds.push({cmd: 'quadraticCurveTo', args: [xa, ya, x, y]}); - } - - var i = 0; - var numberOfContours = ((code[i] << 24) | (code[i + 1] << 16)) >> 16; - var flags; - var x = 0, y = 0; - i += 10; - if (numberOfContours < 0) { - // composite glyph - do { - flags = (code[i] << 8) | code[i + 1]; - var glyphIndex = (code[i + 2] << 8) | code[i + 3]; - i += 4; - var arg1, arg2; - if ((flags & 0x01)) { - arg1 = ((code[i] << 24) | (code[i + 1] << 16)) >> 16; - arg2 = ((code[i + 2] << 24) | (code[i + 3] << 16)) >> 16; - i += 4; - } else { - arg1 = code[i++]; arg2 = code[i++]; - } - if ((flags & 0x02)) { - x = arg1; - y = arg2; - } else { - x = 0; y = 0; // TODO "they are points" ? - } - var scaleX = 1, scaleY = 1, scale01 = 0, scale10 = 0; - if ((flags & 0x08)) { - scaleX = - scaleY = ((code[i] << 24) | (code[i + 1] << 16)) / 1073741824; - i += 2; - } else if ((flags & 0x40)) { - scaleX = ((code[i] << 24) | (code[i + 1] << 16)) / 1073741824; - scaleY = ((code[i + 2] << 24) | (code[i + 3] << 16)) / 1073741824; - i += 4; - } else if ((flags & 0x80)) { - scaleX = ((code[i] << 24) | (code[i + 1] << 16)) / 1073741824; - scale01 = ((code[i + 2] << 24) | (code[i + 3] << 16)) / 1073741824; - scale10 = ((code[i + 4] << 24) | (code[i + 5] << 16)) / 1073741824; - scaleY = ((code[i + 6] << 24) | (code[i + 7] << 16)) / 1073741824; - i += 8; - } - var subglyph = font.glyphs[glyphIndex]; - if (subglyph) { - cmds.push({cmd: 'save'}); - cmds.push({cmd: 'transform', - args: [scaleX, scale01, scale10, scaleY, x, y]}); - compileGlyf(subglyph, cmds, font); - cmds.push({cmd: 'restore'}); - } - } while ((flags & 0x20)); - } else { - // simple glyph - var endPtsOfContours = []; - var j, jj; - for (j = 0; j < numberOfContours; j++) { - endPtsOfContours.push((code[i] << 8) | code[i + 1]); - i += 2; - } - var instructionLength = (code[i] << 8) | code[i + 1]; - i += 2 + instructionLength; // skipping the instructions - var numberOfPoints = endPtsOfContours[endPtsOfContours.length - 1] + 1; - var points = []; - while (points.length < numberOfPoints) { - flags = code[i++]; - var repeat = 1; - if ((flags & 0x08)) { - repeat += code[i++]; - } - while (repeat-- > 0) { - points.push({flags: flags}); - } - } - for (j = 0; j < numberOfPoints; j++) { - switch (points[j].flags & 0x12) { - case 0x00: - x += ((code[i] << 24) | (code[i + 1] << 16)) >> 16; - i += 2; - break; - case 0x02: - x -= code[i++]; - break; - case 0x12: - x += code[i++]; - break; - } - points[j].x = x; - } - for (j = 0; j < numberOfPoints; j++) { - switch (points[j].flags & 0x24) { - case 0x00: - y += ((code[i] << 24) | (code[i + 1] << 16)) >> 16; - i += 2; - break; - case 0x04: - y -= code[i++]; - break; - case 0x24: - y += code[i++]; - break; - } - points[j].y = y; - } - - var startPoint = 0; - for (i = 0; i < numberOfContours; i++) { - var endPoint = endPtsOfContours[i]; - // contours might have implicit points, which is located in the middle - // between two neighboring off-curve points - var contour = points.slice(startPoint, endPoint + 1); - if ((contour[0].flags & 1)) { - contour.push(contour[0]); // using start point at the contour end - } else if ((contour[contour.length - 1].flags & 1)) { - // first is off-curve point, trying to use one from the end - contour.unshift(contour[contour.length - 1]); - } else { - // start and end are off-curve points, creating implicit one - var p = { - flags: 1, - x: (contour[0].x + contour[contour.length - 1].x) / 2, - y: (contour[0].y + contour[contour.length - 1].y) / 2 - }; - contour.unshift(p); - contour.push(p); - } - moveTo(contour[0].x, contour[0].y); - for (j = 1, jj = contour.length; j < jj; j++) { - if ((contour[j].flags & 1)) { - lineTo(contour[j].x, contour[j].y); - } else if ((contour[j + 1].flags & 1)){ - quadraticCurveTo(contour[j].x, contour[j].y, - contour[j + 1].x, contour[j + 1].y); - j++; - } else { - quadraticCurveTo(contour[j].x, contour[j].y, - (contour[j].x + contour[j + 1].x) / 2, - (contour[j].y + contour[j + 1].y) / 2); - } - } - startPoint = endPoint + 1; - } - } - } - - function compileCharString(code, cmds, font) { - var stack = []; - var x = 0, y = 0; - var stems = 0; - - function moveTo(x, y) { - cmds.push({cmd: 'moveTo', args: [x, y]}); - } - function lineTo(x, y) { - cmds.push({cmd: 'lineTo', args: [x, y]}); - } - function bezierCurveTo(x1, y1, x2, y2, x, y) { - cmds.push({cmd: 'bezierCurveTo', args: [x1, y1, x2, y2, x, y]}); - } - - function parse(code) { - var i = 0; - while (i < code.length) { - var stackClean = false; - var v = code[i++]; - var xa, xb, ya, yb, y1, y2, y3, n, subrCode; - switch (v) { - case 1: // hstem - stems += stack.length >> 1; - stackClean = true; - break; - case 3: // vstem - stems += stack.length >> 1; - stackClean = true; - break; - case 4: // vmoveto - y += stack.pop(); - moveTo(x, y); - stackClean = true; - break; - case 5: // rlineto - while (stack.length > 0) { - x += stack.shift(); - y += stack.shift(); - lineTo(x, y); - } - break; - case 6: // hlineto - while (stack.length > 0) { - x += stack.shift(); - lineTo(x, y); - if (stack.length === 0) { - break; - } - y += stack.shift(); - lineTo(x, y); - } - break; - case 7: // vlineto - while (stack.length > 0) { - y += stack.shift(); - lineTo(x, y); - if (stack.length === 0) { - break; - } - x += stack.shift(); - lineTo(x, y); - } - break; - case 8: // rrcurveto - while (stack.length > 0) { - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - } - break; - case 10: // callsubr - n = stack.pop() + font.subrsBias; - subrCode = font.subrs[n]; - if (subrCode) { - parse(subrCode); - } - break; - case 11: // return - return; - case 12: - v = code[i++]; - switch (v) { - case 34: // flex - xa = x + stack.shift(); - xb = xa + stack.shift(); y1 = y + stack.shift(); - x = xb + stack.shift(); - bezierCurveTo(xa, y, xb, y1, x, y1); - xa = x + stack.shift(); - xb = xa + stack.shift(); - x = xb + stack.shift(); - bezierCurveTo(xa, y1, xb, y, x, y); - break; - case 35: // flex - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - stack.pop(); // fd - break; - case 36: // hflex1 - xa = x + stack.shift(); y1 = y + stack.shift(); - xb = xa + stack.shift(); y2 = y1 + stack.shift(); - x = xb + stack.shift(); - bezierCurveTo(xa, y1, xb, y2, x, y2); - xa = x + stack.shift(); - xb = xa + stack.shift(); y3 = y2 + stack.shift(); - x = xb + stack.shift(); - bezierCurveTo(xa, y2, xb, y3, x, y); - break; - case 37: // flex1 - var x0 = x, y0 = y; - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb; y = yb; - if (Math.abs(x - x0) > Math.abs(y - y0)) { - x += stack.shift(); - } else { - y += stack.shift(); - } - bezierCurveTo(xa, ya, xb, yb, x, y); - break; - default: - error('unknown operator: 12 ' + v); - } - break; - case 14: // endchar - if (stack.length >= 4) { - var achar = stack.pop(); - var bchar = stack.pop(); - y = stack.pop(); - x = stack.pop(); - cmds.push({cmd: 'save'}); - cmds.push({cmd: 'translate', args: [x, y]}); - var gid = lookupCmap(font.cmap, String.fromCharCode( - font.glyphNameMap[Encodings.StandardEncoding[achar]])); - compileCharString(font.glyphs[gid], cmds, font); - cmds.push({cmd: 'restore'}); - - gid = lookupCmap(font.cmap, String.fromCharCode( - font.glyphNameMap[Encodings.StandardEncoding[bchar]])); - compileCharString(font.glyphs[gid], cmds, font); - } - return; - case 18: // hstemhm - stems += stack.length >> 1; - stackClean = true; - break; - case 19: // hintmask - stems += stack.length >> 1; - i += (stems + 7) >> 3; - stackClean = true; - break; - case 20: // cntrmask - stems += stack.length >> 1; - i += (stems + 7) >> 3; - stackClean = true; - break; - case 21: // rmoveto - y += stack.pop(); - x += stack.pop(); - moveTo(x, y); - stackClean = true; - break; - case 22: // hmoveto - x += stack.pop(); - moveTo(x, y); - stackClean = true; - break; - case 23: // vstemhm - stems += stack.length >> 1; - stackClean = true; - break; - case 24: // rcurveline - while (stack.length > 2) { - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - } - x += stack.shift(); - y += stack.shift(); - lineTo(x, y); - break; - case 25: // rlinecurve - while (stack.length > 6) { - x += stack.shift(); - y += stack.shift(); - lineTo(x, y); - } - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - break; - case 26: // vvcurveto - if (stack.length % 2) { - x += stack.shift(); - } - while (stack.length > 0) { - xa = x; ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb; y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - } - break; - case 27: // hhcurveto - if (stack.length % 2) { - y += stack.shift(); - } - while (stack.length > 0) { - xa = x + stack.shift(); ya = y; - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb; - bezierCurveTo(xa, ya, xb, yb, x, y); - } - break; - case 28: - stack.push(((code[i] << 24) | (code[i + 1] << 16)) >> 16); - i += 2; - break; - case 29: // callgsubr - n = stack.pop() + font.gsubrsBias; - subrCode = font.gsubrs[n]; - if (subrCode) { - parse(subrCode); - } - break; - case 30: // vhcurveto - while (stack.length > 0) { - xa = x; ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); - y = yb + (stack.length === 1 ? stack.shift() : 0); - bezierCurveTo(xa, ya, xb, yb, x, y); - if (stack.length === 0) { - break; - } - - xa = x + stack.shift(); ya = y; - xb = xa + stack.shift(); yb = ya + stack.shift(); - y = yb + stack.shift(); - x = xb + (stack.length === 1 ? stack.shift() : 0); - bezierCurveTo(xa, ya, xb, yb, x, y); - } - break; - case 31: // hvcurveto - while (stack.length > 0) { - xa = x + stack.shift(); ya = y; - xb = xa + stack.shift(); yb = ya + stack.shift(); - y = yb + stack.shift(); - x = xb + (stack.length === 1 ? stack.shift() : 0); - bezierCurveTo(xa, ya, xb, yb, x, y); - if (stack.length === 0) { - break; - } - - xa = x; ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); - y = yb + (stack.length === 1 ? stack.shift() : 0); - bezierCurveTo(xa, ya, xb, yb, x, y); - } - break; - default: - if (v < 32) { - error('unknown operator: ' + v); - } - if (v < 247) { - stack.push(v - 139); - } else if (v < 251) { - stack.push((v - 247) * 256 + code[i++] + 108); - } else if (v < 255) { - stack.push(-(v - 251) * 256 - code[i++] - 108); - } else { - stack.push(((code[i] << 24) | (code[i + 1] << 16) | - (code[i + 2] << 8) | code[i + 3]) / 65536); - i += 4; - } - break; - } - if (stackClean) { - stack.length = 0; - } - } - } - parse(code); - } - - var noop = ''; - - function CompiledFont(fontMatrix) { - this.compiledGlyphs = {}; - this.fontMatrix = fontMatrix; - } - CompiledFont.prototype = { - getPathJs: function (unicode) { - var gid = lookupCmap(this.cmap, unicode); - var fn = this.compiledGlyphs[gid]; - if (!fn) { - this.compiledGlyphs[gid] = fn = this.compileGlyph(this.glyphs[gid]); - } - return fn; - }, - - compileGlyph: function (code) { - if (!code || code.length === 0 || code[0] === 14) { - return noop; - } - - var cmds = []; - cmds.push({cmd: 'save'}); - cmds.push({cmd: 'transform', args: this.fontMatrix.slice()}); - cmds.push({cmd: 'scale', args: ['size', '-size']}); - - this.compileGlyphImpl(code, cmds); - - cmds.push({cmd: 'restore'}); - - return cmds; - }, - - compileGlyphImpl: function () { - error('Children classes should implement this.'); - }, - - hasBuiltPath: function (unicode) { - var gid = lookupCmap(this.cmap, unicode); - return gid in this.compiledGlyphs; - } - }; - - function TrueTypeCompiled(glyphs, cmap, fontMatrix) { - fontMatrix = fontMatrix || [0.000488, 0, 0, 0.000488, 0, 0]; - CompiledFont.call(this, fontMatrix); - - this.glyphs = glyphs; - this.cmap = cmap; - - this.compiledGlyphs = []; - } - - Util.inherit(TrueTypeCompiled, CompiledFont, { - compileGlyphImpl: function (code, cmds) { - compileGlyf(code, cmds, this); - } - }); - - function Type2Compiled(cffInfo, cmap, fontMatrix, glyphNameMap) { - fontMatrix = fontMatrix || [0.001, 0, 0, 0.001, 0, 0]; - CompiledFont.call(this, fontMatrix); - this.glyphs = cffInfo.glyphs; - this.gsubrs = cffInfo.gsubrs || []; - this.subrs = cffInfo.subrs || []; - this.cmap = cmap; - this.glyphNameMap = glyphNameMap || GlyphsUnicode; - - this.compiledGlyphs = []; - this.gsubrsBias = (this.gsubrs.length < 1240 ? - 107 : (this.gsubrs.length < 33900 ? 1131 : 32768)); - this.subrsBias = (this.subrs.length < 1240 ? - 107 : (this.subrs.length < 33900 ? 1131 : 32768)); - } - - Util.inherit(Type2Compiled, CompiledFont, { - compileGlyphImpl: function (code, cmds) { - compileCharString(code, cmds, this); - } - }); - - - return { - create: function FontRendererFactory_create(font) { - var data = new Uint8Array(font.data); - var cmap, glyf, loca, cff, indexToLocFormat, unitsPerEm; - var numTables = getUshort(data, 4); - for (var i = 0, p = 12; i < numTables; i++, p += 16) { - var tag = bytesToString(data.subarray(p, p + 4)); - var offset = getLong(data, p + 8); - var length = getLong(data, p + 12); - switch (tag) { - case 'cmap': - cmap = parseCmap(data, offset, offset + length); - break; - case 'glyf': - glyf = data.subarray(offset, offset + length); - break; - case 'loca': - loca = data.subarray(offset, offset + length); - break; - case 'head': - unitsPerEm = getUshort(data, offset + 18); - indexToLocFormat = getUshort(data, offset + 50); - break; - case 'CFF ': - cff = parseCff(data, offset, offset + length); - break; - } - } - - if (glyf) { - var fontMatrix = (!unitsPerEm ? font.fontMatrix : - [1 / unitsPerEm, 0, 0, 1 / unitsPerEm, 0, 0]); - return new TrueTypeCompiled( - parseGlyfTable(glyf, loca, indexToLocFormat), cmap, fontMatrix); - } else { - return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap); - } - } - }; -})(); - - -var GlyphsUnicode = { - A: 0x0041, - AE: 0x00C6, - AEacute: 0x01FC, - AEmacron: 0x01E2, - AEsmall: 0xF7E6, - Aacute: 0x00C1, - Aacutesmall: 0xF7E1, - Abreve: 0x0102, - Abreveacute: 0x1EAE, - Abrevecyrillic: 0x04D0, - Abrevedotbelow: 0x1EB6, - Abrevegrave: 0x1EB0, - Abrevehookabove: 0x1EB2, - Abrevetilde: 0x1EB4, - Acaron: 0x01CD, - Acircle: 0x24B6, - Acircumflex: 0x00C2, - Acircumflexacute: 0x1EA4, - Acircumflexdotbelow: 0x1EAC, - Acircumflexgrave: 0x1EA6, - Acircumflexhookabove: 0x1EA8, - Acircumflexsmall: 0xF7E2, - Acircumflextilde: 0x1EAA, - Acute: 0xF6C9, - Acutesmall: 0xF7B4, - Acyrillic: 0x0410, - Adblgrave: 0x0200, - Adieresis: 0x00C4, - Adieresiscyrillic: 0x04D2, - Adieresismacron: 0x01DE, - Adieresissmall: 0xF7E4, - Adotbelow: 0x1EA0, - Adotmacron: 0x01E0, - Agrave: 0x00C0, - Agravesmall: 0xF7E0, - Ahookabove: 0x1EA2, - Aiecyrillic: 0x04D4, - Ainvertedbreve: 0x0202, - Alpha: 0x0391, - Alphatonos: 0x0386, - Amacron: 0x0100, - Amonospace: 0xFF21, - Aogonek: 0x0104, - Aring: 0x00C5, - Aringacute: 0x01FA, - Aringbelow: 0x1E00, - Aringsmall: 0xF7E5, - Asmall: 0xF761, - Atilde: 0x00C3, - Atildesmall: 0xF7E3, - Aybarmenian: 0x0531, - B: 0x0042, - Bcircle: 0x24B7, - Bdotaccent: 0x1E02, - Bdotbelow: 0x1E04, - Becyrillic: 0x0411, - Benarmenian: 0x0532, - Beta: 0x0392, - Bhook: 0x0181, - Blinebelow: 0x1E06, - Bmonospace: 0xFF22, - Brevesmall: 0xF6F4, - Bsmall: 0xF762, - Btopbar: 0x0182, - C: 0x0043, - Caarmenian: 0x053E, - Cacute: 0x0106, - Caron: 0xF6CA, - Caronsmall: 0xF6F5, - Ccaron: 0x010C, - Ccedilla: 0x00C7, - Ccedillaacute: 0x1E08, - Ccedillasmall: 0xF7E7, - Ccircle: 0x24B8, - Ccircumflex: 0x0108, - Cdot: 0x010A, - Cdotaccent: 0x010A, - Cedillasmall: 0xF7B8, - Chaarmenian: 0x0549, - Cheabkhasiancyrillic: 0x04BC, - Checyrillic: 0x0427, - Chedescenderabkhasiancyrillic: 0x04BE, - Chedescendercyrillic: 0x04B6, - Chedieresiscyrillic: 0x04F4, - Cheharmenian: 0x0543, - Chekhakassiancyrillic: 0x04CB, - Cheverticalstrokecyrillic: 0x04B8, - Chi: 0x03A7, - Chook: 0x0187, - Circumflexsmall: 0xF6F6, - Cmonospace: 0xFF23, - Coarmenian: 0x0551, - Csmall: 0xF763, - D: 0x0044, - DZ: 0x01F1, - DZcaron: 0x01C4, - Daarmenian: 0x0534, - Dafrican: 0x0189, - Dcaron: 0x010E, - Dcedilla: 0x1E10, - Dcircle: 0x24B9, - Dcircumflexbelow: 0x1E12, - Dcroat: 0x0110, - Ddotaccent: 0x1E0A, - Ddotbelow: 0x1E0C, - Decyrillic: 0x0414, - Deicoptic: 0x03EE, - Delta: 0x2206, - Deltagreek: 0x0394, - Dhook: 0x018A, - Dieresis: 0xF6CB, - DieresisAcute: 0xF6CC, - DieresisGrave: 0xF6CD, - Dieresissmall: 0xF7A8, - Digammagreek: 0x03DC, - Djecyrillic: 0x0402, - Dlinebelow: 0x1E0E, - Dmonospace: 0xFF24, - Dotaccentsmall: 0xF6F7, - Dslash: 0x0110, - Dsmall: 0xF764, - Dtopbar: 0x018B, - Dz: 0x01F2, - Dzcaron: 0x01C5, - Dzeabkhasiancyrillic: 0x04E0, - Dzecyrillic: 0x0405, - Dzhecyrillic: 0x040F, - E: 0x0045, - Eacute: 0x00C9, - Eacutesmall: 0xF7E9, - Ebreve: 0x0114, - Ecaron: 0x011A, - Ecedillabreve: 0x1E1C, - Echarmenian: 0x0535, - Ecircle: 0x24BA, - Ecircumflex: 0x00CA, - Ecircumflexacute: 0x1EBE, - Ecircumflexbelow: 0x1E18, - Ecircumflexdotbelow: 0x1EC6, - Ecircumflexgrave: 0x1EC0, - Ecircumflexhookabove: 0x1EC2, - Ecircumflexsmall: 0xF7EA, - Ecircumflextilde: 0x1EC4, - Ecyrillic: 0x0404, - Edblgrave: 0x0204, - Edieresis: 0x00CB, - Edieresissmall: 0xF7EB, - Edot: 0x0116, - Edotaccent: 0x0116, - Edotbelow: 0x1EB8, - Efcyrillic: 0x0424, - Egrave: 0x00C8, - Egravesmall: 0xF7E8, - Eharmenian: 0x0537, - Ehookabove: 0x1EBA, - Eightroman: 0x2167, - Einvertedbreve: 0x0206, - Eiotifiedcyrillic: 0x0464, - Elcyrillic: 0x041B, - Elevenroman: 0x216A, - Emacron: 0x0112, - Emacronacute: 0x1E16, - Emacrongrave: 0x1E14, - Emcyrillic: 0x041C, - Emonospace: 0xFF25, - Encyrillic: 0x041D, - Endescendercyrillic: 0x04A2, - Eng: 0x014A, - Enghecyrillic: 0x04A4, - Enhookcyrillic: 0x04C7, - Eogonek: 0x0118, - Eopen: 0x0190, - Epsilon: 0x0395, - Epsilontonos: 0x0388, - Ercyrillic: 0x0420, - Ereversed: 0x018E, - Ereversedcyrillic: 0x042D, - Escyrillic: 0x0421, - Esdescendercyrillic: 0x04AA, - Esh: 0x01A9, - Esmall: 0xF765, - Eta: 0x0397, - Etarmenian: 0x0538, - Etatonos: 0x0389, - Eth: 0x00D0, - Ethsmall: 0xF7F0, - Etilde: 0x1EBC, - Etildebelow: 0x1E1A, - Euro: 0x20AC, - Ezh: 0x01B7, - Ezhcaron: 0x01EE, - Ezhreversed: 0x01B8, - F: 0x0046, - Fcircle: 0x24BB, - Fdotaccent: 0x1E1E, - Feharmenian: 0x0556, - Feicoptic: 0x03E4, - Fhook: 0x0191, - Fitacyrillic: 0x0472, - Fiveroman: 0x2164, - Fmonospace: 0xFF26, - Fourroman: 0x2163, - Fsmall: 0xF766, - G: 0x0047, - GBsquare: 0x3387, - Gacute: 0x01F4, - Gamma: 0x0393, - Gammaafrican: 0x0194, - Gangiacoptic: 0x03EA, - Gbreve: 0x011E, - Gcaron: 0x01E6, - Gcedilla: 0x0122, - Gcircle: 0x24BC, - Gcircumflex: 0x011C, - Gcommaaccent: 0x0122, - Gdot: 0x0120, - Gdotaccent: 0x0120, - Gecyrillic: 0x0413, - Ghadarmenian: 0x0542, - Ghemiddlehookcyrillic: 0x0494, - Ghestrokecyrillic: 0x0492, - Gheupturncyrillic: 0x0490, - Ghook: 0x0193, - Gimarmenian: 0x0533, - Gjecyrillic: 0x0403, - Gmacron: 0x1E20, - Gmonospace: 0xFF27, - Grave: 0xF6CE, - Gravesmall: 0xF760, - Gsmall: 0xF767, - Gsmallhook: 0x029B, - Gstroke: 0x01E4, - H: 0x0048, - H18533: 0x25CF, - H18543: 0x25AA, - H18551: 0x25AB, - H22073: 0x25A1, - HPsquare: 0x33CB, - Haabkhasiancyrillic: 0x04A8, - Hadescendercyrillic: 0x04B2, - Hardsigncyrillic: 0x042A, - Hbar: 0x0126, - Hbrevebelow: 0x1E2A, - Hcedilla: 0x1E28, - Hcircle: 0x24BD, - Hcircumflex: 0x0124, - Hdieresis: 0x1E26, - Hdotaccent: 0x1E22, - Hdotbelow: 0x1E24, - Hmonospace: 0xFF28, - Hoarmenian: 0x0540, - Horicoptic: 0x03E8, - Hsmall: 0xF768, - Hungarumlaut: 0xF6CF, - Hungarumlautsmall: 0xF6F8, - Hzsquare: 0x3390, - I: 0x0049, - IAcyrillic: 0x042F, - IJ: 0x0132, - IUcyrillic: 0x042E, - Iacute: 0x00CD, - Iacutesmall: 0xF7ED, - Ibreve: 0x012C, - Icaron: 0x01CF, - Icircle: 0x24BE, - Icircumflex: 0x00CE, - Icircumflexsmall: 0xF7EE, - Icyrillic: 0x0406, - Idblgrave: 0x0208, - Idieresis: 0x00CF, - Idieresisacute: 0x1E2E, - Idieresiscyrillic: 0x04E4, - Idieresissmall: 0xF7EF, - Idot: 0x0130, - Idotaccent: 0x0130, - Idotbelow: 0x1ECA, - Iebrevecyrillic: 0x04D6, - Iecyrillic: 0x0415, - Ifraktur: 0x2111, - Igrave: 0x00CC, - Igravesmall: 0xF7EC, - Ihookabove: 0x1EC8, - Iicyrillic: 0x0418, - Iinvertedbreve: 0x020A, - Iishortcyrillic: 0x0419, - Imacron: 0x012A, - Imacroncyrillic: 0x04E2, - Imonospace: 0xFF29, - Iniarmenian: 0x053B, - Iocyrillic: 0x0401, - Iogonek: 0x012E, - Iota: 0x0399, - Iotaafrican: 0x0196, - Iotadieresis: 0x03AA, - Iotatonos: 0x038A, - Ismall: 0xF769, - Istroke: 0x0197, - Itilde: 0x0128, - Itildebelow: 0x1E2C, - Izhitsacyrillic: 0x0474, - Izhitsadblgravecyrillic: 0x0476, - J: 0x004A, - Jaarmenian: 0x0541, - Jcircle: 0x24BF, - Jcircumflex: 0x0134, - Jecyrillic: 0x0408, - Jheharmenian: 0x054B, - Jmonospace: 0xFF2A, - Jsmall: 0xF76A, - K: 0x004B, - KBsquare: 0x3385, - KKsquare: 0x33CD, - Kabashkircyrillic: 0x04A0, - Kacute: 0x1E30, - Kacyrillic: 0x041A, - Kadescendercyrillic: 0x049A, - Kahookcyrillic: 0x04C3, - Kappa: 0x039A, - Kastrokecyrillic: 0x049E, - Kaverticalstrokecyrillic: 0x049C, - Kcaron: 0x01E8, - Kcedilla: 0x0136, - Kcircle: 0x24C0, - Kcommaaccent: 0x0136, - Kdotbelow: 0x1E32, - Keharmenian: 0x0554, - Kenarmenian: 0x053F, - Khacyrillic: 0x0425, - Kheicoptic: 0x03E6, - Khook: 0x0198, - Kjecyrillic: 0x040C, - Klinebelow: 0x1E34, - Kmonospace: 0xFF2B, - Koppacyrillic: 0x0480, - Koppagreek: 0x03DE, - Ksicyrillic: 0x046E, - Ksmall: 0xF76B, - L: 0x004C, - LJ: 0x01C7, - LL: 0xF6BF, - Lacute: 0x0139, - Lambda: 0x039B, - Lcaron: 0x013D, - Lcedilla: 0x013B, - Lcircle: 0x24C1, - Lcircumflexbelow: 0x1E3C, - Lcommaaccent: 0x013B, - Ldot: 0x013F, - Ldotaccent: 0x013F, - Ldotbelow: 0x1E36, - Ldotbelowmacron: 0x1E38, - Liwnarmenian: 0x053C, - Lj: 0x01C8, - Ljecyrillic: 0x0409, - Llinebelow: 0x1E3A, - Lmonospace: 0xFF2C, - Lslash: 0x0141, - Lslashsmall: 0xF6F9, - Lsmall: 0xF76C, - M: 0x004D, - MBsquare: 0x3386, - Macron: 0xF6D0, - Macronsmall: 0xF7AF, - Macute: 0x1E3E, - Mcircle: 0x24C2, - Mdotaccent: 0x1E40, - Mdotbelow: 0x1E42, - Menarmenian: 0x0544, - Mmonospace: 0xFF2D, - Msmall: 0xF76D, - Mturned: 0x019C, - Mu: 0x039C, - N: 0x004E, - NJ: 0x01CA, - Nacute: 0x0143, - Ncaron: 0x0147, - Ncedilla: 0x0145, - Ncircle: 0x24C3, - Ncircumflexbelow: 0x1E4A, - Ncommaaccent: 0x0145, - Ndotaccent: 0x1E44, - Ndotbelow: 0x1E46, - Nhookleft: 0x019D, - Nineroman: 0x2168, - Nj: 0x01CB, - Njecyrillic: 0x040A, - Nlinebelow: 0x1E48, - Nmonospace: 0xFF2E, - Nowarmenian: 0x0546, - Nsmall: 0xF76E, - Ntilde: 0x00D1, - Ntildesmall: 0xF7F1, - Nu: 0x039D, - O: 0x004F, - OE: 0x0152, - OEsmall: 0xF6FA, - Oacute: 0x00D3, - Oacutesmall: 0xF7F3, - Obarredcyrillic: 0x04E8, - Obarreddieresiscyrillic: 0x04EA, - Obreve: 0x014E, - Ocaron: 0x01D1, - Ocenteredtilde: 0x019F, - Ocircle: 0x24C4, - Ocircumflex: 0x00D4, - Ocircumflexacute: 0x1ED0, - Ocircumflexdotbelow: 0x1ED8, - Ocircumflexgrave: 0x1ED2, - Ocircumflexhookabove: 0x1ED4, - Ocircumflexsmall: 0xF7F4, - Ocircumflextilde: 0x1ED6, - Ocyrillic: 0x041E, - Odblacute: 0x0150, - Odblgrave: 0x020C, - Odieresis: 0x00D6, - Odieresiscyrillic: 0x04E6, - Odieresissmall: 0xF7F6, - Odotbelow: 0x1ECC, - Ogoneksmall: 0xF6FB, - Ograve: 0x00D2, - Ogravesmall: 0xF7F2, - Oharmenian: 0x0555, - Ohm: 0x2126, - Ohookabove: 0x1ECE, - Ohorn: 0x01A0, - Ohornacute: 0x1EDA, - Ohorndotbelow: 0x1EE2, - Ohorngrave: 0x1EDC, - Ohornhookabove: 0x1EDE, - Ohorntilde: 0x1EE0, - Ohungarumlaut: 0x0150, - Oi: 0x01A2, - Oinvertedbreve: 0x020E, - Omacron: 0x014C, - Omacronacute: 0x1E52, - Omacrongrave: 0x1E50, - Omega: 0x2126, - Omegacyrillic: 0x0460, - Omegagreek: 0x03A9, - Omegaroundcyrillic: 0x047A, - Omegatitlocyrillic: 0x047C, - Omegatonos: 0x038F, - Omicron: 0x039F, - Omicrontonos: 0x038C, - Omonospace: 0xFF2F, - Oneroman: 0x2160, - Oogonek: 0x01EA, - Oogonekmacron: 0x01EC, - Oopen: 0x0186, - Oslash: 0x00D8, - Oslashacute: 0x01FE, - Oslashsmall: 0xF7F8, - Osmall: 0xF76F, - Ostrokeacute: 0x01FE, - Otcyrillic: 0x047E, - Otilde: 0x00D5, - Otildeacute: 0x1E4C, - Otildedieresis: 0x1E4E, - Otildesmall: 0xF7F5, - P: 0x0050, - Pacute: 0x1E54, - Pcircle: 0x24C5, - Pdotaccent: 0x1E56, - Pecyrillic: 0x041F, - Peharmenian: 0x054A, - Pemiddlehookcyrillic: 0x04A6, - Phi: 0x03A6, - Phook: 0x01A4, - Pi: 0x03A0, - Piwrarmenian: 0x0553, - Pmonospace: 0xFF30, - Psi: 0x03A8, - Psicyrillic: 0x0470, - Psmall: 0xF770, - Q: 0x0051, - Qcircle: 0x24C6, - Qmonospace: 0xFF31, - Qsmall: 0xF771, - R: 0x0052, - Raarmenian: 0x054C, - Racute: 0x0154, - Rcaron: 0x0158, - Rcedilla: 0x0156, - Rcircle: 0x24C7, - Rcommaaccent: 0x0156, - Rdblgrave: 0x0210, - Rdotaccent: 0x1E58, - Rdotbelow: 0x1E5A, - Rdotbelowmacron: 0x1E5C, - Reharmenian: 0x0550, - Rfraktur: 0x211C, - Rho: 0x03A1, - Ringsmall: 0xF6FC, - Rinvertedbreve: 0x0212, - Rlinebelow: 0x1E5E, - Rmonospace: 0xFF32, - Rsmall: 0xF772, - Rsmallinverted: 0x0281, - Rsmallinvertedsuperior: 0x02B6, - S: 0x0053, - SF010000: 0x250C, - SF020000: 0x2514, - SF030000: 0x2510, - SF040000: 0x2518, - SF050000: 0x253C, - SF060000: 0x252C, - SF070000: 0x2534, - SF080000: 0x251C, - SF090000: 0x2524, - SF100000: 0x2500, - SF110000: 0x2502, - SF190000: 0x2561, - SF200000: 0x2562, - SF210000: 0x2556, - SF220000: 0x2555, - SF230000: 0x2563, - SF240000: 0x2551, - SF250000: 0x2557, - SF260000: 0x255D, - SF270000: 0x255C, - SF280000: 0x255B, - SF360000: 0x255E, - SF370000: 0x255F, - SF380000: 0x255A, - SF390000: 0x2554, - SF400000: 0x2569, - SF410000: 0x2566, - SF420000: 0x2560, - SF430000: 0x2550, - SF440000: 0x256C, - SF450000: 0x2567, - SF460000: 0x2568, - SF470000: 0x2564, - SF480000: 0x2565, - SF490000: 0x2559, - SF500000: 0x2558, - SF510000: 0x2552, - SF520000: 0x2553, - SF530000: 0x256B, - SF540000: 0x256A, - Sacute: 0x015A, - Sacutedotaccent: 0x1E64, - Sampigreek: 0x03E0, - Scaron: 0x0160, - Scarondotaccent: 0x1E66, - Scaronsmall: 0xF6FD, - Scedilla: 0x015E, - Schwa: 0x018F, - Schwacyrillic: 0x04D8, - Schwadieresiscyrillic: 0x04DA, - Scircle: 0x24C8, - Scircumflex: 0x015C, - Scommaaccent: 0x0218, - Sdotaccent: 0x1E60, - Sdotbelow: 0x1E62, - Sdotbelowdotaccent: 0x1E68, - Seharmenian: 0x054D, - Sevenroman: 0x2166, - Shaarmenian: 0x0547, - Shacyrillic: 0x0428, - Shchacyrillic: 0x0429, - Sheicoptic: 0x03E2, - Shhacyrillic: 0x04BA, - Shimacoptic: 0x03EC, - Sigma: 0x03A3, - Sixroman: 0x2165, - Smonospace: 0xFF33, - Softsigncyrillic: 0x042C, - Ssmall: 0xF773, - Stigmagreek: 0x03DA, - T: 0x0054, - Tau: 0x03A4, - Tbar: 0x0166, - Tcaron: 0x0164, - Tcedilla: 0x0162, - Tcircle: 0x24C9, - Tcircumflexbelow: 0x1E70, - Tcommaaccent: 0x0162, - Tdotaccent: 0x1E6A, - Tdotbelow: 0x1E6C, - Tecyrillic: 0x0422, - Tedescendercyrillic: 0x04AC, - Tenroman: 0x2169, - Tetsecyrillic: 0x04B4, - Theta: 0x0398, - Thook: 0x01AC, - Thorn: 0x00DE, - Thornsmall: 0xF7FE, - Threeroman: 0x2162, - Tildesmall: 0xF6FE, - Tiwnarmenian: 0x054F, - Tlinebelow: 0x1E6E, - Tmonospace: 0xFF34, - Toarmenian: 0x0539, - Tonefive: 0x01BC, - Tonesix: 0x0184, - Tonetwo: 0x01A7, - Tretroflexhook: 0x01AE, - Tsecyrillic: 0x0426, - Tshecyrillic: 0x040B, - Tsmall: 0xF774, - Twelveroman: 0x216B, - Tworoman: 0x2161, - U: 0x0055, - Uacute: 0x00DA, - Uacutesmall: 0xF7FA, - Ubreve: 0x016C, - Ucaron: 0x01D3, - Ucircle: 0x24CA, - Ucircumflex: 0x00DB, - Ucircumflexbelow: 0x1E76, - Ucircumflexsmall: 0xF7FB, - Ucyrillic: 0x0423, - Udblacute: 0x0170, - Udblgrave: 0x0214, - Udieresis: 0x00DC, - Udieresisacute: 0x01D7, - Udieresisbelow: 0x1E72, - Udieresiscaron: 0x01D9, - Udieresiscyrillic: 0x04F0, - Udieresisgrave: 0x01DB, - Udieresismacron: 0x01D5, - Udieresissmall: 0xF7FC, - Udotbelow: 0x1EE4, - Ugrave: 0x00D9, - Ugravesmall: 0xF7F9, - Uhookabove: 0x1EE6, - Uhorn: 0x01AF, - Uhornacute: 0x1EE8, - Uhorndotbelow: 0x1EF0, - Uhorngrave: 0x1EEA, - Uhornhookabove: 0x1EEC, - Uhorntilde: 0x1EEE, - Uhungarumlaut: 0x0170, - Uhungarumlautcyrillic: 0x04F2, - Uinvertedbreve: 0x0216, - Ukcyrillic: 0x0478, - Umacron: 0x016A, - Umacroncyrillic: 0x04EE, - Umacrondieresis: 0x1E7A, - Umonospace: 0xFF35, - Uogonek: 0x0172, - Upsilon: 0x03A5, - Upsilon1: 0x03D2, - Upsilonacutehooksymbolgreek: 0x03D3, - Upsilonafrican: 0x01B1, - Upsilondieresis: 0x03AB, - Upsilondieresishooksymbolgreek: 0x03D4, - Upsilonhooksymbol: 0x03D2, - Upsilontonos: 0x038E, - Uring: 0x016E, - Ushortcyrillic: 0x040E, - Usmall: 0xF775, - Ustraightcyrillic: 0x04AE, - Ustraightstrokecyrillic: 0x04B0, - Utilde: 0x0168, - Utildeacute: 0x1E78, - Utildebelow: 0x1E74, - V: 0x0056, - Vcircle: 0x24CB, - Vdotbelow: 0x1E7E, - Vecyrillic: 0x0412, - Vewarmenian: 0x054E, - Vhook: 0x01B2, - Vmonospace: 0xFF36, - Voarmenian: 0x0548, - Vsmall: 0xF776, - Vtilde: 0x1E7C, - W: 0x0057, - Wacute: 0x1E82, - Wcircle: 0x24CC, - Wcircumflex: 0x0174, - Wdieresis: 0x1E84, - Wdotaccent: 0x1E86, - Wdotbelow: 0x1E88, - Wgrave: 0x1E80, - Wmonospace: 0xFF37, - Wsmall: 0xF777, - X: 0x0058, - Xcircle: 0x24CD, - Xdieresis: 0x1E8C, - Xdotaccent: 0x1E8A, - Xeharmenian: 0x053D, - Xi: 0x039E, - Xmonospace: 0xFF38, - Xsmall: 0xF778, - Y: 0x0059, - Yacute: 0x00DD, - Yacutesmall: 0xF7FD, - Yatcyrillic: 0x0462, - Ycircle: 0x24CE, - Ycircumflex: 0x0176, - Ydieresis: 0x0178, - Ydieresissmall: 0xF7FF, - Ydotaccent: 0x1E8E, - Ydotbelow: 0x1EF4, - Yericyrillic: 0x042B, - Yerudieresiscyrillic: 0x04F8, - Ygrave: 0x1EF2, - Yhook: 0x01B3, - Yhookabove: 0x1EF6, - Yiarmenian: 0x0545, - Yicyrillic: 0x0407, - Yiwnarmenian: 0x0552, - Ymonospace: 0xFF39, - Ysmall: 0xF779, - Ytilde: 0x1EF8, - Yusbigcyrillic: 0x046A, - Yusbigiotifiedcyrillic: 0x046C, - Yuslittlecyrillic: 0x0466, - Yuslittleiotifiedcyrillic: 0x0468, - Z: 0x005A, - Zaarmenian: 0x0536, - Zacute: 0x0179, - Zcaron: 0x017D, - Zcaronsmall: 0xF6FF, - Zcircle: 0x24CF, - Zcircumflex: 0x1E90, - Zdot: 0x017B, - Zdotaccent: 0x017B, - Zdotbelow: 0x1E92, - Zecyrillic: 0x0417, - Zedescendercyrillic: 0x0498, - Zedieresiscyrillic: 0x04DE, - Zeta: 0x0396, - Zhearmenian: 0x053A, - Zhebrevecyrillic: 0x04C1, - Zhecyrillic: 0x0416, - Zhedescendercyrillic: 0x0496, - Zhedieresiscyrillic: 0x04DC, - Zlinebelow: 0x1E94, - Zmonospace: 0xFF3A, - Zsmall: 0xF77A, - Zstroke: 0x01B5, - a: 0x0061, - aabengali: 0x0986, - aacute: 0x00E1, - aadeva: 0x0906, - aagujarati: 0x0A86, - aagurmukhi: 0x0A06, - aamatragurmukhi: 0x0A3E, - aarusquare: 0x3303, - aavowelsignbengali: 0x09BE, - aavowelsigndeva: 0x093E, - aavowelsigngujarati: 0x0ABE, - abbreviationmarkarmenian: 0x055F, - abbreviationsigndeva: 0x0970, - abengali: 0x0985, - abopomofo: 0x311A, - abreve: 0x0103, - abreveacute: 0x1EAF, - abrevecyrillic: 0x04D1, - abrevedotbelow: 0x1EB7, - abrevegrave: 0x1EB1, - abrevehookabove: 0x1EB3, - abrevetilde: 0x1EB5, - acaron: 0x01CE, - acircle: 0x24D0, - acircumflex: 0x00E2, - acircumflexacute: 0x1EA5, - acircumflexdotbelow: 0x1EAD, - acircumflexgrave: 0x1EA7, - acircumflexhookabove: 0x1EA9, - acircumflextilde: 0x1EAB, - acute: 0x00B4, - acutebelowcmb: 0x0317, - acutecmb: 0x0301, - acutecomb: 0x0301, - acutedeva: 0x0954, - acutelowmod: 0x02CF, - acutetonecmb: 0x0341, - acyrillic: 0x0430, - adblgrave: 0x0201, - addakgurmukhi: 0x0A71, - adeva: 0x0905, - adieresis: 0x00E4, - adieresiscyrillic: 0x04D3, - adieresismacron: 0x01DF, - adotbelow: 0x1EA1, - adotmacron: 0x01E1, - ae: 0x00E6, - aeacute: 0x01FD, - aekorean: 0x3150, - aemacron: 0x01E3, - afii00208: 0x2015, - afii08941: 0x20A4, - afii10017: 0x0410, - afii10018: 0x0411, - afii10019: 0x0412, - afii10020: 0x0413, - afii10021: 0x0414, - afii10022: 0x0415, - afii10023: 0x0401, - afii10024: 0x0416, - afii10025: 0x0417, - afii10026: 0x0418, - afii10027: 0x0419, - afii10028: 0x041A, - afii10029: 0x041B, - afii10030: 0x041C, - afii10031: 0x041D, - afii10032: 0x041E, - afii10033: 0x041F, - afii10034: 0x0420, - afii10035: 0x0421, - afii10036: 0x0422, - afii10037: 0x0423, - afii10038: 0x0424, - afii10039: 0x0425, - afii10040: 0x0426, - afii10041: 0x0427, - afii10042: 0x0428, - afii10043: 0x0429, - afii10044: 0x042A, - afii10045: 0x042B, - afii10046: 0x042C, - afii10047: 0x042D, - afii10048: 0x042E, - afii10049: 0x042F, - afii10050: 0x0490, - afii10051: 0x0402, - afii10052: 0x0403, - afii10053: 0x0404, - afii10054: 0x0405, - afii10055: 0x0406, - afii10056: 0x0407, - afii10057: 0x0408, - afii10058: 0x0409, - afii10059: 0x040A, - afii10060: 0x040B, - afii10061: 0x040C, - afii10062: 0x040E, - afii10063: 0xF6C4, - afii10064: 0xF6C5, - afii10065: 0x0430, - afii10066: 0x0431, - afii10067: 0x0432, - afii10068: 0x0433, - afii10069: 0x0434, - afii10070: 0x0435, - afii10071: 0x0451, - afii10072: 0x0436, - afii10073: 0x0437, - afii10074: 0x0438, - afii10075: 0x0439, - afii10076: 0x043A, - afii10077: 0x043B, - afii10078: 0x043C, - afii10079: 0x043D, - afii10080: 0x043E, - afii10081: 0x043F, - afii10082: 0x0440, - afii10083: 0x0441, - afii10084: 0x0442, - afii10085: 0x0443, - afii10086: 0x0444, - afii10087: 0x0445, - afii10088: 0x0446, - afii10089: 0x0447, - afii10090: 0x0448, - afii10091: 0x0449, - afii10092: 0x044A, - afii10093: 0x044B, - afii10094: 0x044C, - afii10095: 0x044D, - afii10096: 0x044E, - afii10097: 0x044F, - afii10098: 0x0491, - afii10099: 0x0452, - afii10100: 0x0453, - afii10101: 0x0454, - afii10102: 0x0455, - afii10103: 0x0456, - afii10104: 0x0457, - afii10105: 0x0458, - afii10106: 0x0459, - afii10107: 0x045A, - afii10108: 0x045B, - afii10109: 0x045C, - afii10110: 0x045E, - afii10145: 0x040F, - afii10146: 0x0462, - afii10147: 0x0472, - afii10148: 0x0474, - afii10192: 0xF6C6, - afii10193: 0x045F, - afii10194: 0x0463, - afii10195: 0x0473, - afii10196: 0x0475, - afii10831: 0xF6C7, - afii10832: 0xF6C8, - afii10846: 0x04D9, - afii299: 0x200E, - afii300: 0x200F, - afii301: 0x200D, - afii57381: 0x066A, - afii57388: 0x060C, - afii57392: 0x0660, - afii57393: 0x0661, - afii57394: 0x0662, - afii57395: 0x0663, - afii57396: 0x0664, - afii57397: 0x0665, - afii57398: 0x0666, - afii57399: 0x0667, - afii57400: 0x0668, - afii57401: 0x0669, - afii57403: 0x061B, - afii57407: 0x061F, - afii57409: 0x0621, - afii57410: 0x0622, - afii57411: 0x0623, - afii57412: 0x0624, - afii57413: 0x0625, - afii57414: 0x0626, - afii57415: 0x0627, - afii57416: 0x0628, - afii57417: 0x0629, - afii57418: 0x062A, - afii57419: 0x062B, - afii57420: 0x062C, - afii57421: 0x062D, - afii57422: 0x062E, - afii57423: 0x062F, - afii57424: 0x0630, - afii57425: 0x0631, - afii57426: 0x0632, - afii57427: 0x0633, - afii57428: 0x0634, - afii57429: 0x0635, - afii57430: 0x0636, - afii57431: 0x0637, - afii57432: 0x0638, - afii57433: 0x0639, - afii57434: 0x063A, - afii57440: 0x0640, - afii57441: 0x0641, - afii57442: 0x0642, - afii57443: 0x0643, - afii57444: 0x0644, - afii57445: 0x0645, - afii57446: 0x0646, - afii57448: 0x0648, - afii57449: 0x0649, - afii57450: 0x064A, - afii57451: 0x064B, - afii57452: 0x064C, - afii57453: 0x064D, - afii57454: 0x064E, - afii57455: 0x064F, - afii57456: 0x0650, - afii57457: 0x0651, - afii57458: 0x0652, - afii57470: 0x0647, - afii57505: 0x06A4, - afii57506: 0x067E, - afii57507: 0x0686, - afii57508: 0x0698, - afii57509: 0x06AF, - afii57511: 0x0679, - afii57512: 0x0688, - afii57513: 0x0691, - afii57514: 0x06BA, - afii57519: 0x06D2, - afii57534: 0x06D5, - afii57636: 0x20AA, - afii57645: 0x05BE, - afii57658: 0x05C3, - afii57664: 0x05D0, - afii57665: 0x05D1, - afii57666: 0x05D2, - afii57667: 0x05D3, - afii57668: 0x05D4, - afii57669: 0x05D5, - afii57670: 0x05D6, - afii57671: 0x05D7, - afii57672: 0x05D8, - afii57673: 0x05D9, - afii57674: 0x05DA, - afii57675: 0x05DB, - afii57676: 0x05DC, - afii57677: 0x05DD, - afii57678: 0x05DE, - afii57679: 0x05DF, - afii57680: 0x05E0, - afii57681: 0x05E1, - afii57682: 0x05E2, - afii57683: 0x05E3, - afii57684: 0x05E4, - afii57685: 0x05E5, - afii57686: 0x05E6, - afii57687: 0x05E7, - afii57688: 0x05E8, - afii57689: 0x05E9, - afii57690: 0x05EA, - afii57694: 0xFB2A, - afii57695: 0xFB2B, - afii57700: 0xFB4B, - afii57705: 0xFB1F, - afii57716: 0x05F0, - afii57717: 0x05F1, - afii57718: 0x05F2, - afii57723: 0xFB35, - afii57793: 0x05B4, - afii57794: 0x05B5, - afii57795: 0x05B6, - afii57796: 0x05BB, - afii57797: 0x05B8, - afii57798: 0x05B7, - afii57799: 0x05B0, - afii57800: 0x05B2, - afii57801: 0x05B1, - afii57802: 0x05B3, - afii57803: 0x05C2, - afii57804: 0x05C1, - afii57806: 0x05B9, - afii57807: 0x05BC, - afii57839: 0x05BD, - afii57841: 0x05BF, - afii57842: 0x05C0, - afii57929: 0x02BC, - afii61248: 0x2105, - afii61289: 0x2113, - afii61352: 0x2116, - afii61573: 0x202C, - afii61574: 0x202D, - afii61575: 0x202E, - afii61664: 0x200C, - afii63167: 0x066D, - afii64937: 0x02BD, - agrave: 0x00E0, - agujarati: 0x0A85, - agurmukhi: 0x0A05, - ahiragana: 0x3042, - ahookabove: 0x1EA3, - aibengali: 0x0990, - aibopomofo: 0x311E, - aideva: 0x0910, - aiecyrillic: 0x04D5, - aigujarati: 0x0A90, - aigurmukhi: 0x0A10, - aimatragurmukhi: 0x0A48, - ainarabic: 0x0639, - ainfinalarabic: 0xFECA, - aininitialarabic: 0xFECB, - ainmedialarabic: 0xFECC, - ainvertedbreve: 0x0203, - aivowelsignbengali: 0x09C8, - aivowelsigndeva: 0x0948, - aivowelsigngujarati: 0x0AC8, - akatakana: 0x30A2, - akatakanahalfwidth: 0xFF71, - akorean: 0x314F, - alef: 0x05D0, - alefarabic: 0x0627, - alefdageshhebrew: 0xFB30, - aleffinalarabic: 0xFE8E, - alefhamzaabovearabic: 0x0623, - alefhamzaabovefinalarabic: 0xFE84, - alefhamzabelowarabic: 0x0625, - alefhamzabelowfinalarabic: 0xFE88, - alefhebrew: 0x05D0, - aleflamedhebrew: 0xFB4F, - alefmaddaabovearabic: 0x0622, - alefmaddaabovefinalarabic: 0xFE82, - alefmaksuraarabic: 0x0649, - alefmaksurafinalarabic: 0xFEF0, - alefmaksurainitialarabic: 0xFEF3, - alefmaksuramedialarabic: 0xFEF4, - alefpatahhebrew: 0xFB2E, - alefqamatshebrew: 0xFB2F, - aleph: 0x2135, - allequal: 0x224C, - alpha: 0x03B1, - alphatonos: 0x03AC, - amacron: 0x0101, - amonospace: 0xFF41, - ampersand: 0x0026, - ampersandmonospace: 0xFF06, - ampersandsmall: 0xF726, - amsquare: 0x33C2, - anbopomofo: 0x3122, - angbopomofo: 0x3124, - angbracketleft: 0x3008, // This glyph is missing from Adobe's original list. - angbracketright: 0x3009, // This glyph is missing from Adobe's original list. - angkhankhuthai: 0x0E5A, - angle: 0x2220, - anglebracketleft: 0x3008, - anglebracketleftvertical: 0xFE3F, - anglebracketright: 0x3009, - anglebracketrightvertical: 0xFE40, - angleleft: 0x2329, - angleright: 0x232A, - angstrom: 0x212B, - anoteleia: 0x0387, - anudattadeva: 0x0952, - anusvarabengali: 0x0982, - anusvaradeva: 0x0902, - anusvaragujarati: 0x0A82, - aogonek: 0x0105, - apaatosquare: 0x3300, - aparen: 0x249C, - apostrophearmenian: 0x055A, - apostrophemod: 0x02BC, - apple: 0xF8FF, - approaches: 0x2250, - approxequal: 0x2248, - approxequalorimage: 0x2252, - approximatelyequal: 0x2245, - araeaekorean: 0x318E, - araeakorean: 0x318D, - arc: 0x2312, - arighthalfring: 0x1E9A, - aring: 0x00E5, - aringacute: 0x01FB, - aringbelow: 0x1E01, - arrowboth: 0x2194, - arrowdashdown: 0x21E3, - arrowdashleft: 0x21E0, - arrowdashright: 0x21E2, - arrowdashup: 0x21E1, - arrowdblboth: 0x21D4, - arrowdbldown: 0x21D3, - arrowdblleft: 0x21D0, - arrowdblright: 0x21D2, - arrowdblup: 0x21D1, - arrowdown: 0x2193, - arrowdownleft: 0x2199, - arrowdownright: 0x2198, - arrowdownwhite: 0x21E9, - arrowheaddownmod: 0x02C5, - arrowheadleftmod: 0x02C2, - arrowheadrightmod: 0x02C3, - arrowheadupmod: 0x02C4, - arrowhorizex: 0xF8E7, - arrowleft: 0x2190, - arrowleftdbl: 0x21D0, - arrowleftdblstroke: 0x21CD, - arrowleftoverright: 0x21C6, - arrowleftwhite: 0x21E6, - arrowright: 0x2192, - arrowrightdblstroke: 0x21CF, - arrowrightheavy: 0x279E, - arrowrightoverleft: 0x21C4, - arrowrightwhite: 0x21E8, - arrowtableft: 0x21E4, - arrowtabright: 0x21E5, - arrowup: 0x2191, - arrowupdn: 0x2195, - arrowupdnbse: 0x21A8, - arrowupdownbase: 0x21A8, - arrowupleft: 0x2196, - arrowupleftofdown: 0x21C5, - arrowupright: 0x2197, - arrowupwhite: 0x21E7, - arrowvertex: 0xF8E6, - asciicircum: 0x005E, - asciicircummonospace: 0xFF3E, - asciitilde: 0x007E, - asciitildemonospace: 0xFF5E, - ascript: 0x0251, - ascriptturned: 0x0252, - asmallhiragana: 0x3041, - asmallkatakana: 0x30A1, - asmallkatakanahalfwidth: 0xFF67, - asterisk: 0x002A, - asteriskaltonearabic: 0x066D, - asteriskarabic: 0x066D, - asteriskmath: 0x2217, - asteriskmonospace: 0xFF0A, - asterisksmall: 0xFE61, - asterism: 0x2042, - asuperior: 0xF6E9, - asymptoticallyequal: 0x2243, - at: 0x0040, - atilde: 0x00E3, - atmonospace: 0xFF20, - atsmall: 0xFE6B, - aturned: 0x0250, - aubengali: 0x0994, - aubopomofo: 0x3120, - audeva: 0x0914, - augujarati: 0x0A94, - augurmukhi: 0x0A14, - aulengthmarkbengali: 0x09D7, - aumatragurmukhi: 0x0A4C, - auvowelsignbengali: 0x09CC, - auvowelsigndeva: 0x094C, - auvowelsigngujarati: 0x0ACC, - avagrahadeva: 0x093D, - aybarmenian: 0x0561, - ayin: 0x05E2, - ayinaltonehebrew: 0xFB20, - ayinhebrew: 0x05E2, - b: 0x0062, - babengali: 0x09AC, - backslash: 0x005C, - backslashmonospace: 0xFF3C, - badeva: 0x092C, - bagujarati: 0x0AAC, - bagurmukhi: 0x0A2C, - bahiragana: 0x3070, - bahtthai: 0x0E3F, - bakatakana: 0x30D0, - bar: 0x007C, - barmonospace: 0xFF5C, - bbopomofo: 0x3105, - bcircle: 0x24D1, - bdotaccent: 0x1E03, - bdotbelow: 0x1E05, - beamedsixteenthnotes: 0x266C, - because: 0x2235, - becyrillic: 0x0431, - beharabic: 0x0628, - behfinalarabic: 0xFE90, - behinitialarabic: 0xFE91, - behiragana: 0x3079, - behmedialarabic: 0xFE92, - behmeeminitialarabic: 0xFC9F, - behmeemisolatedarabic: 0xFC08, - behnoonfinalarabic: 0xFC6D, - bekatakana: 0x30D9, - benarmenian: 0x0562, - bet: 0x05D1, - beta: 0x03B2, - betasymbolgreek: 0x03D0, - betdagesh: 0xFB31, - betdageshhebrew: 0xFB31, - bethebrew: 0x05D1, - betrafehebrew: 0xFB4C, - bhabengali: 0x09AD, - bhadeva: 0x092D, - bhagujarati: 0x0AAD, - bhagurmukhi: 0x0A2D, - bhook: 0x0253, - bihiragana: 0x3073, - bikatakana: 0x30D3, - bilabialclick: 0x0298, - bindigurmukhi: 0x0A02, - birusquare: 0x3331, - blackcircle: 0x25CF, - blackdiamond: 0x25C6, - blackdownpointingtriangle: 0x25BC, - blackleftpointingpointer: 0x25C4, - blackleftpointingtriangle: 0x25C0, - blacklenticularbracketleft: 0x3010, - blacklenticularbracketleftvertical: 0xFE3B, - blacklenticularbracketright: 0x3011, - blacklenticularbracketrightvertical: 0xFE3C, - blacklowerlefttriangle: 0x25E3, - blacklowerrighttriangle: 0x25E2, - blackrectangle: 0x25AC, - blackrightpointingpointer: 0x25BA, - blackrightpointingtriangle: 0x25B6, - blacksmallsquare: 0x25AA, - blacksmilingface: 0x263B, - blacksquare: 0x25A0, - blackstar: 0x2605, - blackupperlefttriangle: 0x25E4, - blackupperrighttriangle: 0x25E5, - blackuppointingsmalltriangle: 0x25B4, - blackuppointingtriangle: 0x25B2, - blank: 0x2423, - blinebelow: 0x1E07, - block: 0x2588, - bmonospace: 0xFF42, - bobaimaithai: 0x0E1A, - bohiragana: 0x307C, - bokatakana: 0x30DC, - bparen: 0x249D, - bqsquare: 0x33C3, - braceex: 0xF8F4, - braceleft: 0x007B, - braceleftbt: 0xF8F3, - braceleftmid: 0xF8F2, - braceleftmonospace: 0xFF5B, - braceleftsmall: 0xFE5B, - bracelefttp: 0xF8F1, - braceleftvertical: 0xFE37, - braceright: 0x007D, - bracerightbt: 0xF8FE, - bracerightmid: 0xF8FD, - bracerightmonospace: 0xFF5D, - bracerightsmall: 0xFE5C, - bracerighttp: 0xF8FC, - bracerightvertical: 0xFE38, - bracketleft: 0x005B, - bracketleftbt: 0xF8F0, - bracketleftex: 0xF8EF, - bracketleftmonospace: 0xFF3B, - bracketlefttp: 0xF8EE, - bracketright: 0x005D, - bracketrightbt: 0xF8FB, - bracketrightex: 0xF8FA, - bracketrightmonospace: 0xFF3D, - bracketrighttp: 0xF8F9, - breve: 0x02D8, - brevebelowcmb: 0x032E, - brevecmb: 0x0306, - breveinvertedbelowcmb: 0x032F, - breveinvertedcmb: 0x0311, - breveinverteddoublecmb: 0x0361, - bridgebelowcmb: 0x032A, - bridgeinvertedbelowcmb: 0x033A, - brokenbar: 0x00A6, - bstroke: 0x0180, - bsuperior: 0xF6EA, - btopbar: 0x0183, - buhiragana: 0x3076, - bukatakana: 0x30D6, - bullet: 0x2022, - bulletinverse: 0x25D8, - bulletoperator: 0x2219, - bullseye: 0x25CE, - c: 0x0063, - caarmenian: 0x056E, - cabengali: 0x099A, - cacute: 0x0107, - cadeva: 0x091A, - cagujarati: 0x0A9A, - cagurmukhi: 0x0A1A, - calsquare: 0x3388, - candrabindubengali: 0x0981, - candrabinducmb: 0x0310, - candrabindudeva: 0x0901, - candrabindugujarati: 0x0A81, - capslock: 0x21EA, - careof: 0x2105, - caron: 0x02C7, - caronbelowcmb: 0x032C, - caroncmb: 0x030C, - carriagereturn: 0x21B5, - cbopomofo: 0x3118, - ccaron: 0x010D, - ccedilla: 0x00E7, - ccedillaacute: 0x1E09, - ccircle: 0x24D2, - ccircumflex: 0x0109, - ccurl: 0x0255, - cdot: 0x010B, - cdotaccent: 0x010B, - cdsquare: 0x33C5, - cedilla: 0x00B8, - cedillacmb: 0x0327, - cent: 0x00A2, - centigrade: 0x2103, - centinferior: 0xF6DF, - centmonospace: 0xFFE0, - centoldstyle: 0xF7A2, - centsuperior: 0xF6E0, - chaarmenian: 0x0579, - chabengali: 0x099B, - chadeva: 0x091B, - chagujarati: 0x0A9B, - chagurmukhi: 0x0A1B, - chbopomofo: 0x3114, - cheabkhasiancyrillic: 0x04BD, - checkmark: 0x2713, - checyrillic: 0x0447, - chedescenderabkhasiancyrillic: 0x04BF, - chedescendercyrillic: 0x04B7, - chedieresiscyrillic: 0x04F5, - cheharmenian: 0x0573, - chekhakassiancyrillic: 0x04CC, - cheverticalstrokecyrillic: 0x04B9, - chi: 0x03C7, - chieuchacirclekorean: 0x3277, - chieuchaparenkorean: 0x3217, - chieuchcirclekorean: 0x3269, - chieuchkorean: 0x314A, - chieuchparenkorean: 0x3209, - chochangthai: 0x0E0A, - chochanthai: 0x0E08, - chochingthai: 0x0E09, - chochoethai: 0x0E0C, - chook: 0x0188, - cieucacirclekorean: 0x3276, - cieucaparenkorean: 0x3216, - cieuccirclekorean: 0x3268, - cieuckorean: 0x3148, - cieucparenkorean: 0x3208, - cieucuparenkorean: 0x321C, - circle: 0x25CB, - circlecopyrt: 0x00A9, // This glyph is missing from Adobe's original list. - circlemultiply: 0x2297, - circleot: 0x2299, - circleplus: 0x2295, - circlepostalmark: 0x3036, - circlewithlefthalfblack: 0x25D0, - circlewithrighthalfblack: 0x25D1, - circumflex: 0x02C6, - circumflexbelowcmb: 0x032D, - circumflexcmb: 0x0302, - clear: 0x2327, - clickalveolar: 0x01C2, - clickdental: 0x01C0, - clicklateral: 0x01C1, - clickretroflex: 0x01C3, - club: 0x2663, - clubsuitblack: 0x2663, - clubsuitwhite: 0x2667, - cmcubedsquare: 0x33A4, - cmonospace: 0xFF43, - cmsquaredsquare: 0x33A0, - coarmenian: 0x0581, - colon: 0x003A, - colonmonetary: 0x20A1, - colonmonospace: 0xFF1A, - colonsign: 0x20A1, - colonsmall: 0xFE55, - colontriangularhalfmod: 0x02D1, - colontriangularmod: 0x02D0, - comma: 0x002C, - commaabovecmb: 0x0313, - commaaboverightcmb: 0x0315, - commaaccent: 0xF6C3, - commaarabic: 0x060C, - commaarmenian: 0x055D, - commainferior: 0xF6E1, - commamonospace: 0xFF0C, - commareversedabovecmb: 0x0314, - commareversedmod: 0x02BD, - commasmall: 0xFE50, - commasuperior: 0xF6E2, - commaturnedabovecmb: 0x0312, - commaturnedmod: 0x02BB, - compass: 0x263C, - congruent: 0x2245, - contourintegral: 0x222E, - control: 0x2303, - controlACK: 0x0006, - controlBEL: 0x0007, - controlBS: 0x0008, - controlCAN: 0x0018, - controlCR: 0x000D, - controlDC1: 0x0011, - controlDC2: 0x0012, - controlDC3: 0x0013, - controlDC4: 0x0014, - controlDEL: 0x007F, - controlDLE: 0x0010, - controlEM: 0x0019, - controlENQ: 0x0005, - controlEOT: 0x0004, - controlESC: 0x001B, - controlETB: 0x0017, - controlETX: 0x0003, - controlFF: 0x000C, - controlFS: 0x001C, - controlGS: 0x001D, - controlHT: 0x0009, - controlLF: 0x000A, - controlNAK: 0x0015, - controlRS: 0x001E, - controlSI: 0x000F, - controlSO: 0x000E, - controlSOT: 0x0002, - controlSTX: 0x0001, - controlSUB: 0x001A, - controlSYN: 0x0016, - controlUS: 0x001F, - controlVT: 0x000B, - copyright: 0x00A9, - copyrightsans: 0xF8E9, - copyrightserif: 0xF6D9, - cornerbracketleft: 0x300C, - cornerbracketlefthalfwidth: 0xFF62, - cornerbracketleftvertical: 0xFE41, - cornerbracketright: 0x300D, - cornerbracketrighthalfwidth: 0xFF63, - cornerbracketrightvertical: 0xFE42, - corporationsquare: 0x337F, - cosquare: 0x33C7, - coverkgsquare: 0x33C6, - cparen: 0x249E, - cruzeiro: 0x20A2, - cstretched: 0x0297, - curlyand: 0x22CF, - curlyor: 0x22CE, - currency: 0x00A4, - cyrBreve: 0xF6D1, - cyrFlex: 0xF6D2, - cyrbreve: 0xF6D4, - cyrflex: 0xF6D5, - d: 0x0064, - daarmenian: 0x0564, - dabengali: 0x09A6, - dadarabic: 0x0636, - dadeva: 0x0926, - dadfinalarabic: 0xFEBE, - dadinitialarabic: 0xFEBF, - dadmedialarabic: 0xFEC0, - dagesh: 0x05BC, - dageshhebrew: 0x05BC, - dagger: 0x2020, - daggerdbl: 0x2021, - dagujarati: 0x0AA6, - dagurmukhi: 0x0A26, - dahiragana: 0x3060, - dakatakana: 0x30C0, - dalarabic: 0x062F, - dalet: 0x05D3, - daletdagesh: 0xFB33, - daletdageshhebrew: 0xFB33, - dalethebrew: 0x05D3, - dalfinalarabic: 0xFEAA, - dammaarabic: 0x064F, - dammalowarabic: 0x064F, - dammatanaltonearabic: 0x064C, - dammatanarabic: 0x064C, - danda: 0x0964, - dargahebrew: 0x05A7, - dargalefthebrew: 0x05A7, - dasiapneumatacyrilliccmb: 0x0485, - dblGrave: 0xF6D3, - dblanglebracketleft: 0x300A, - dblanglebracketleftvertical: 0xFE3D, - dblanglebracketright: 0x300B, - dblanglebracketrightvertical: 0xFE3E, - dblarchinvertedbelowcmb: 0x032B, - dblarrowleft: 0x21D4, - dblarrowright: 0x21D2, - dbldanda: 0x0965, - dblgrave: 0xF6D6, - dblgravecmb: 0x030F, - dblintegral: 0x222C, - dbllowline: 0x2017, - dbllowlinecmb: 0x0333, - dbloverlinecmb: 0x033F, - dblprimemod: 0x02BA, - dblverticalbar: 0x2016, - dblverticallineabovecmb: 0x030E, - dbopomofo: 0x3109, - dbsquare: 0x33C8, - dcaron: 0x010F, - dcedilla: 0x1E11, - dcircle: 0x24D3, - dcircumflexbelow: 0x1E13, - dcroat: 0x0111, - ddabengali: 0x09A1, - ddadeva: 0x0921, - ddagujarati: 0x0AA1, - ddagurmukhi: 0x0A21, - ddalarabic: 0x0688, - ddalfinalarabic: 0xFB89, - dddhadeva: 0x095C, - ddhabengali: 0x09A2, - ddhadeva: 0x0922, - ddhagujarati: 0x0AA2, - ddhagurmukhi: 0x0A22, - ddotaccent: 0x1E0B, - ddotbelow: 0x1E0D, - decimalseparatorarabic: 0x066B, - decimalseparatorpersian: 0x066B, - decyrillic: 0x0434, - degree: 0x00B0, - dehihebrew: 0x05AD, - dehiragana: 0x3067, - deicoptic: 0x03EF, - dekatakana: 0x30C7, - deleteleft: 0x232B, - deleteright: 0x2326, - delta: 0x03B4, - deltaturned: 0x018D, - denominatorminusonenumeratorbengali: 0x09F8, - dezh: 0x02A4, - dhabengali: 0x09A7, - dhadeva: 0x0927, - dhagujarati: 0x0AA7, - dhagurmukhi: 0x0A27, - dhook: 0x0257, - dialytikatonos: 0x0385, - dialytikatonoscmb: 0x0344, - diamond: 0x2666, - diamondsuitwhite: 0x2662, - dieresis: 0x00A8, - dieresisacute: 0xF6D7, - dieresisbelowcmb: 0x0324, - dieresiscmb: 0x0308, - dieresisgrave: 0xF6D8, - dieresistonos: 0x0385, - dihiragana: 0x3062, - dikatakana: 0x30C2, - dittomark: 0x3003, - divide: 0x00F7, - divides: 0x2223, - divisionslash: 0x2215, - djecyrillic: 0x0452, - dkshade: 0x2593, - dlinebelow: 0x1E0F, - dlsquare: 0x3397, - dmacron: 0x0111, - dmonospace: 0xFF44, - dnblock: 0x2584, - dochadathai: 0x0E0E, - dodekthai: 0x0E14, - dohiragana: 0x3069, - dokatakana: 0x30C9, - dollar: 0x0024, - dollarinferior: 0xF6E3, - dollarmonospace: 0xFF04, - dollaroldstyle: 0xF724, - dollarsmall: 0xFE69, - dollarsuperior: 0xF6E4, - dong: 0x20AB, - dorusquare: 0x3326, - dotaccent: 0x02D9, - dotaccentcmb: 0x0307, - dotbelowcmb: 0x0323, - dotbelowcomb: 0x0323, - dotkatakana: 0x30FB, - dotlessi: 0x0131, - dotlessj: 0xF6BE, - dotlessjstrokehook: 0x0284, - dotmath: 0x22C5, - dottedcircle: 0x25CC, - doubleyodpatah: 0xFB1F, - doubleyodpatahhebrew: 0xFB1F, - downtackbelowcmb: 0x031E, - downtackmod: 0x02D5, - dparen: 0x249F, - dsuperior: 0xF6EB, - dtail: 0x0256, - dtopbar: 0x018C, - duhiragana: 0x3065, - dukatakana: 0x30C5, - dz: 0x01F3, - dzaltone: 0x02A3, - dzcaron: 0x01C6, - dzcurl: 0x02A5, - dzeabkhasiancyrillic: 0x04E1, - dzecyrillic: 0x0455, - dzhecyrillic: 0x045F, - e: 0x0065, - eacute: 0x00E9, - earth: 0x2641, - ebengali: 0x098F, - ebopomofo: 0x311C, - ebreve: 0x0115, - ecandradeva: 0x090D, - ecandragujarati: 0x0A8D, - ecandravowelsigndeva: 0x0945, - ecandravowelsigngujarati: 0x0AC5, - ecaron: 0x011B, - ecedillabreve: 0x1E1D, - echarmenian: 0x0565, - echyiwnarmenian: 0x0587, - ecircle: 0x24D4, - ecircumflex: 0x00EA, - ecircumflexacute: 0x1EBF, - ecircumflexbelow: 0x1E19, - ecircumflexdotbelow: 0x1EC7, - ecircumflexgrave: 0x1EC1, - ecircumflexhookabove: 0x1EC3, - ecircumflextilde: 0x1EC5, - ecyrillic: 0x0454, - edblgrave: 0x0205, - edeva: 0x090F, - edieresis: 0x00EB, - edot: 0x0117, - edotaccent: 0x0117, - edotbelow: 0x1EB9, - eegurmukhi: 0x0A0F, - eematragurmukhi: 0x0A47, - efcyrillic: 0x0444, - egrave: 0x00E8, - egujarati: 0x0A8F, - eharmenian: 0x0567, - ehbopomofo: 0x311D, - ehiragana: 0x3048, - ehookabove: 0x1EBB, - eibopomofo: 0x311F, - eight: 0x0038, - eightarabic: 0x0668, - eightbengali: 0x09EE, - eightcircle: 0x2467, - eightcircleinversesansserif: 0x2791, - eightdeva: 0x096E, - eighteencircle: 0x2471, - eighteenparen: 0x2485, - eighteenperiod: 0x2499, - eightgujarati: 0x0AEE, - eightgurmukhi: 0x0A6E, - eighthackarabic: 0x0668, - eighthangzhou: 0x3028, - eighthnotebeamed: 0x266B, - eightideographicparen: 0x3227, - eightinferior: 0x2088, - eightmonospace: 0xFF18, - eightoldstyle: 0xF738, - eightparen: 0x247B, - eightperiod: 0x248F, - eightpersian: 0x06F8, - eightroman: 0x2177, - eightsuperior: 0x2078, - eightthai: 0x0E58, - einvertedbreve: 0x0207, - eiotifiedcyrillic: 0x0465, - ekatakana: 0x30A8, - ekatakanahalfwidth: 0xFF74, - ekonkargurmukhi: 0x0A74, - ekorean: 0x3154, - elcyrillic: 0x043B, - element: 0x2208, - elevencircle: 0x246A, - elevenparen: 0x247E, - elevenperiod: 0x2492, - elevenroman: 0x217A, - ellipsis: 0x2026, - ellipsisvertical: 0x22EE, - emacron: 0x0113, - emacronacute: 0x1E17, - emacrongrave: 0x1E15, - emcyrillic: 0x043C, - emdash: 0x2014, - emdashvertical: 0xFE31, - emonospace: 0xFF45, - emphasismarkarmenian: 0x055B, - emptyset: 0x2205, - enbopomofo: 0x3123, - encyrillic: 0x043D, - endash: 0x2013, - endashvertical: 0xFE32, - endescendercyrillic: 0x04A3, - eng: 0x014B, - engbopomofo: 0x3125, - enghecyrillic: 0x04A5, - enhookcyrillic: 0x04C8, - enspace: 0x2002, - eogonek: 0x0119, - eokorean: 0x3153, - eopen: 0x025B, - eopenclosed: 0x029A, - eopenreversed: 0x025C, - eopenreversedclosed: 0x025E, - eopenreversedhook: 0x025D, - eparen: 0x24A0, - epsilon: 0x03B5, - epsilontonos: 0x03AD, - equal: 0x003D, - equalmonospace: 0xFF1D, - equalsmall: 0xFE66, - equalsuperior: 0x207C, - equivalence: 0x2261, - erbopomofo: 0x3126, - ercyrillic: 0x0440, - ereversed: 0x0258, - ereversedcyrillic: 0x044D, - escyrillic: 0x0441, - esdescendercyrillic: 0x04AB, - esh: 0x0283, - eshcurl: 0x0286, - eshortdeva: 0x090E, - eshortvowelsigndeva: 0x0946, - eshreversedloop: 0x01AA, - eshsquatreversed: 0x0285, - esmallhiragana: 0x3047, - esmallkatakana: 0x30A7, - esmallkatakanahalfwidth: 0xFF6A, - estimated: 0x212E, - esuperior: 0xF6EC, - eta: 0x03B7, - etarmenian: 0x0568, - etatonos: 0x03AE, - eth: 0x00F0, - etilde: 0x1EBD, - etildebelow: 0x1E1B, - etnahtafoukhhebrew: 0x0591, - etnahtafoukhlefthebrew: 0x0591, - etnahtahebrew: 0x0591, - etnahtalefthebrew: 0x0591, - eturned: 0x01DD, - eukorean: 0x3161, - euro: 0x20AC, - evowelsignbengali: 0x09C7, - evowelsigndeva: 0x0947, - evowelsigngujarati: 0x0AC7, - exclam: 0x0021, - exclamarmenian: 0x055C, - exclamdbl: 0x203C, - exclamdown: 0x00A1, - exclamdownsmall: 0xF7A1, - exclammonospace: 0xFF01, - exclamsmall: 0xF721, - existential: 0x2203, - ezh: 0x0292, - ezhcaron: 0x01EF, - ezhcurl: 0x0293, - ezhreversed: 0x01B9, - ezhtail: 0x01BA, - f: 0x0066, - fadeva: 0x095E, - fagurmukhi: 0x0A5E, - fahrenheit: 0x2109, - fathaarabic: 0x064E, - fathalowarabic: 0x064E, - fathatanarabic: 0x064B, - fbopomofo: 0x3108, - fcircle: 0x24D5, - fdotaccent: 0x1E1F, - feharabic: 0x0641, - feharmenian: 0x0586, - fehfinalarabic: 0xFED2, - fehinitialarabic: 0xFED3, - fehmedialarabic: 0xFED4, - feicoptic: 0x03E5, - female: 0x2640, - ff: 0xFB00, - ffi: 0xFB03, - ffl: 0xFB04, - fi: 0xFB01, - fifteencircle: 0x246E, - fifteenparen: 0x2482, - fifteenperiod: 0x2496, - figuredash: 0x2012, - filledbox: 0x25A0, - filledrect: 0x25AC, - finalkaf: 0x05DA, - finalkafdagesh: 0xFB3A, - finalkafdageshhebrew: 0xFB3A, - finalkafhebrew: 0x05DA, - finalmem: 0x05DD, - finalmemhebrew: 0x05DD, - finalnun: 0x05DF, - finalnunhebrew: 0x05DF, - finalpe: 0x05E3, - finalpehebrew: 0x05E3, - finaltsadi: 0x05E5, - finaltsadihebrew: 0x05E5, - firsttonechinese: 0x02C9, - fisheye: 0x25C9, - fitacyrillic: 0x0473, - five: 0x0035, - fivearabic: 0x0665, - fivebengali: 0x09EB, - fivecircle: 0x2464, - fivecircleinversesansserif: 0x278E, - fivedeva: 0x096B, - fiveeighths: 0x215D, - fivegujarati: 0x0AEB, - fivegurmukhi: 0x0A6B, - fivehackarabic: 0x0665, - fivehangzhou: 0x3025, - fiveideographicparen: 0x3224, - fiveinferior: 0x2085, - fivemonospace: 0xFF15, - fiveoldstyle: 0xF735, - fiveparen: 0x2478, - fiveperiod: 0x248C, - fivepersian: 0x06F5, - fiveroman: 0x2174, - fivesuperior: 0x2075, - fivethai: 0x0E55, - fl: 0xFB02, - florin: 0x0192, - fmonospace: 0xFF46, - fmsquare: 0x3399, - fofanthai: 0x0E1F, - fofathai: 0x0E1D, - fongmanthai: 0x0E4F, - forall: 0x2200, - four: 0x0034, - fourarabic: 0x0664, - fourbengali: 0x09EA, - fourcircle: 0x2463, - fourcircleinversesansserif: 0x278D, - fourdeva: 0x096A, - fourgujarati: 0x0AEA, - fourgurmukhi: 0x0A6A, - fourhackarabic: 0x0664, - fourhangzhou: 0x3024, - fourideographicparen: 0x3223, - fourinferior: 0x2084, - fourmonospace: 0xFF14, - fournumeratorbengali: 0x09F7, - fouroldstyle: 0xF734, - fourparen: 0x2477, - fourperiod: 0x248B, - fourpersian: 0x06F4, - fourroman: 0x2173, - foursuperior: 0x2074, - fourteencircle: 0x246D, - fourteenparen: 0x2481, - fourteenperiod: 0x2495, - fourthai: 0x0E54, - fourthtonechinese: 0x02CB, - fparen: 0x24A1, - fraction: 0x2044, - franc: 0x20A3, - g: 0x0067, - gabengali: 0x0997, - gacute: 0x01F5, - gadeva: 0x0917, - gafarabic: 0x06AF, - gaffinalarabic: 0xFB93, - gafinitialarabic: 0xFB94, - gafmedialarabic: 0xFB95, - gagujarati: 0x0A97, - gagurmukhi: 0x0A17, - gahiragana: 0x304C, - gakatakana: 0x30AC, - gamma: 0x03B3, - gammalatinsmall: 0x0263, - gammasuperior: 0x02E0, - gangiacoptic: 0x03EB, - gbopomofo: 0x310D, - gbreve: 0x011F, - gcaron: 0x01E7, - gcedilla: 0x0123, - gcircle: 0x24D6, - gcircumflex: 0x011D, - gcommaaccent: 0x0123, - gdot: 0x0121, - gdotaccent: 0x0121, - gecyrillic: 0x0433, - gehiragana: 0x3052, - gekatakana: 0x30B2, - geometricallyequal: 0x2251, - gereshaccenthebrew: 0x059C, - gereshhebrew: 0x05F3, - gereshmuqdamhebrew: 0x059D, - germandbls: 0x00DF, - gershayimaccenthebrew: 0x059E, - gershayimhebrew: 0x05F4, - getamark: 0x3013, - ghabengali: 0x0998, - ghadarmenian: 0x0572, - ghadeva: 0x0918, - ghagujarati: 0x0A98, - ghagurmukhi: 0x0A18, - ghainarabic: 0x063A, - ghainfinalarabic: 0xFECE, - ghaininitialarabic: 0xFECF, - ghainmedialarabic: 0xFED0, - ghemiddlehookcyrillic: 0x0495, - ghestrokecyrillic: 0x0493, - gheupturncyrillic: 0x0491, - ghhadeva: 0x095A, - ghhagurmukhi: 0x0A5A, - ghook: 0x0260, - ghzsquare: 0x3393, - gihiragana: 0x304E, - gikatakana: 0x30AE, - gimarmenian: 0x0563, - gimel: 0x05D2, - gimeldagesh: 0xFB32, - gimeldageshhebrew: 0xFB32, - gimelhebrew: 0x05D2, - gjecyrillic: 0x0453, - glottalinvertedstroke: 0x01BE, - glottalstop: 0x0294, - glottalstopinverted: 0x0296, - glottalstopmod: 0x02C0, - glottalstopreversed: 0x0295, - glottalstopreversedmod: 0x02C1, - glottalstopreversedsuperior: 0x02E4, - glottalstopstroke: 0x02A1, - glottalstopstrokereversed: 0x02A2, - gmacron: 0x1E21, - gmonospace: 0xFF47, - gohiragana: 0x3054, - gokatakana: 0x30B4, - gparen: 0x24A2, - gpasquare: 0x33AC, - gradient: 0x2207, - grave: 0x0060, - gravebelowcmb: 0x0316, - gravecmb: 0x0300, - gravecomb: 0x0300, - gravedeva: 0x0953, - gravelowmod: 0x02CE, - gravemonospace: 0xFF40, - gravetonecmb: 0x0340, - greater: 0x003E, - greaterequal: 0x2265, - greaterequalorless: 0x22DB, - greatermonospace: 0xFF1E, - greaterorequivalent: 0x2273, - greaterorless: 0x2277, - greateroverequal: 0x2267, - greatersmall: 0xFE65, - gscript: 0x0261, - gstroke: 0x01E5, - guhiragana: 0x3050, - guillemotleft: 0x00AB, - guillemotright: 0x00BB, - guilsinglleft: 0x2039, - guilsinglright: 0x203A, - gukatakana: 0x30B0, - guramusquare: 0x3318, - gysquare: 0x33C9, - h: 0x0068, - haabkhasiancyrillic: 0x04A9, - haaltonearabic: 0x06C1, - habengali: 0x09B9, - hadescendercyrillic: 0x04B3, - hadeva: 0x0939, - hagujarati: 0x0AB9, - hagurmukhi: 0x0A39, - haharabic: 0x062D, - hahfinalarabic: 0xFEA2, - hahinitialarabic: 0xFEA3, - hahiragana: 0x306F, - hahmedialarabic: 0xFEA4, - haitusquare: 0x332A, - hakatakana: 0x30CF, - hakatakanahalfwidth: 0xFF8A, - halantgurmukhi: 0x0A4D, - hamzaarabic: 0x0621, - hamzalowarabic: 0x0621, - hangulfiller: 0x3164, - hardsigncyrillic: 0x044A, - harpoonleftbarbup: 0x21BC, - harpoonrightbarbup: 0x21C0, - hasquare: 0x33CA, - hatafpatah: 0x05B2, - hatafpatah16: 0x05B2, - hatafpatah23: 0x05B2, - hatafpatah2f: 0x05B2, - hatafpatahhebrew: 0x05B2, - hatafpatahnarrowhebrew: 0x05B2, - hatafpatahquarterhebrew: 0x05B2, - hatafpatahwidehebrew: 0x05B2, - hatafqamats: 0x05B3, - hatafqamats1b: 0x05B3, - hatafqamats28: 0x05B3, - hatafqamats34: 0x05B3, - hatafqamatshebrew: 0x05B3, - hatafqamatsnarrowhebrew: 0x05B3, - hatafqamatsquarterhebrew: 0x05B3, - hatafqamatswidehebrew: 0x05B3, - hatafsegol: 0x05B1, - hatafsegol17: 0x05B1, - hatafsegol24: 0x05B1, - hatafsegol30: 0x05B1, - hatafsegolhebrew: 0x05B1, - hatafsegolnarrowhebrew: 0x05B1, - hatafsegolquarterhebrew: 0x05B1, - hatafsegolwidehebrew: 0x05B1, - hbar: 0x0127, - hbopomofo: 0x310F, - hbrevebelow: 0x1E2B, - hcedilla: 0x1E29, - hcircle: 0x24D7, - hcircumflex: 0x0125, - hdieresis: 0x1E27, - hdotaccent: 0x1E23, - hdotbelow: 0x1E25, - he: 0x05D4, - heart: 0x2665, - heartsuitblack: 0x2665, - heartsuitwhite: 0x2661, - hedagesh: 0xFB34, - hedageshhebrew: 0xFB34, - hehaltonearabic: 0x06C1, - heharabic: 0x0647, - hehebrew: 0x05D4, - hehfinalaltonearabic: 0xFBA7, - hehfinalalttwoarabic: 0xFEEA, - hehfinalarabic: 0xFEEA, - hehhamzaabovefinalarabic: 0xFBA5, - hehhamzaaboveisolatedarabic: 0xFBA4, - hehinitialaltonearabic: 0xFBA8, - hehinitialarabic: 0xFEEB, - hehiragana: 0x3078, - hehmedialaltonearabic: 0xFBA9, - hehmedialarabic: 0xFEEC, - heiseierasquare: 0x337B, - hekatakana: 0x30D8, - hekatakanahalfwidth: 0xFF8D, - hekutaarusquare: 0x3336, - henghook: 0x0267, - herutusquare: 0x3339, - het: 0x05D7, - hethebrew: 0x05D7, - hhook: 0x0266, - hhooksuperior: 0x02B1, - hieuhacirclekorean: 0x327B, - hieuhaparenkorean: 0x321B, - hieuhcirclekorean: 0x326D, - hieuhkorean: 0x314E, - hieuhparenkorean: 0x320D, - hihiragana: 0x3072, - hikatakana: 0x30D2, - hikatakanahalfwidth: 0xFF8B, - hiriq: 0x05B4, - hiriq14: 0x05B4, - hiriq21: 0x05B4, - hiriq2d: 0x05B4, - hiriqhebrew: 0x05B4, - hiriqnarrowhebrew: 0x05B4, - hiriqquarterhebrew: 0x05B4, - hiriqwidehebrew: 0x05B4, - hlinebelow: 0x1E96, - hmonospace: 0xFF48, - hoarmenian: 0x0570, - hohipthai: 0x0E2B, - hohiragana: 0x307B, - hokatakana: 0x30DB, - hokatakanahalfwidth: 0xFF8E, - holam: 0x05B9, - holam19: 0x05B9, - holam26: 0x05B9, - holam32: 0x05B9, - holamhebrew: 0x05B9, - holamnarrowhebrew: 0x05B9, - holamquarterhebrew: 0x05B9, - holamwidehebrew: 0x05B9, - honokhukthai: 0x0E2E, - hookabovecomb: 0x0309, - hookcmb: 0x0309, - hookpalatalizedbelowcmb: 0x0321, - hookretroflexbelowcmb: 0x0322, - hoonsquare: 0x3342, - horicoptic: 0x03E9, - horizontalbar: 0x2015, - horncmb: 0x031B, - hotsprings: 0x2668, - house: 0x2302, - hparen: 0x24A3, - hsuperior: 0x02B0, - hturned: 0x0265, - huhiragana: 0x3075, - huiitosquare: 0x3333, - hukatakana: 0x30D5, - hukatakanahalfwidth: 0xFF8C, - hungarumlaut: 0x02DD, - hungarumlautcmb: 0x030B, - hv: 0x0195, - hyphen: 0x002D, - hypheninferior: 0xF6E5, - hyphenmonospace: 0xFF0D, - hyphensmall: 0xFE63, - hyphensuperior: 0xF6E6, - hyphentwo: 0x2010, - i: 0x0069, - iacute: 0x00ED, - iacyrillic: 0x044F, - ibengali: 0x0987, - ibopomofo: 0x3127, - ibreve: 0x012D, - icaron: 0x01D0, - icircle: 0x24D8, - icircumflex: 0x00EE, - icyrillic: 0x0456, - idblgrave: 0x0209, - ideographearthcircle: 0x328F, - ideographfirecircle: 0x328B, - ideographicallianceparen: 0x323F, - ideographiccallparen: 0x323A, - ideographiccentrecircle: 0x32A5, - ideographicclose: 0x3006, - ideographiccomma: 0x3001, - ideographiccommaleft: 0xFF64, - ideographiccongratulationparen: 0x3237, - ideographiccorrectcircle: 0x32A3, - ideographicearthparen: 0x322F, - ideographicenterpriseparen: 0x323D, - ideographicexcellentcircle: 0x329D, - ideographicfestivalparen: 0x3240, - ideographicfinancialcircle: 0x3296, - ideographicfinancialparen: 0x3236, - ideographicfireparen: 0x322B, - ideographichaveparen: 0x3232, - ideographichighcircle: 0x32A4, - ideographiciterationmark: 0x3005, - ideographiclaborcircle: 0x3298, - ideographiclaborparen: 0x3238, - ideographicleftcircle: 0x32A7, - ideographiclowcircle: 0x32A6, - ideographicmedicinecircle: 0x32A9, - ideographicmetalparen: 0x322E, - ideographicmoonparen: 0x322A, - ideographicnameparen: 0x3234, - ideographicperiod: 0x3002, - ideographicprintcircle: 0x329E, - ideographicreachparen: 0x3243, - ideographicrepresentparen: 0x3239, - ideographicresourceparen: 0x323E, - ideographicrightcircle: 0x32A8, - ideographicsecretcircle: 0x3299, - ideographicselfparen: 0x3242, - ideographicsocietyparen: 0x3233, - ideographicspace: 0x3000, - ideographicspecialparen: 0x3235, - ideographicstockparen: 0x3231, - ideographicstudyparen: 0x323B, - ideographicsunparen: 0x3230, - ideographicsuperviseparen: 0x323C, - ideographicwaterparen: 0x322C, - ideographicwoodparen: 0x322D, - ideographiczero: 0x3007, - ideographmetalcircle: 0x328E, - ideographmooncircle: 0x328A, - ideographnamecircle: 0x3294, - ideographsuncircle: 0x3290, - ideographwatercircle: 0x328C, - ideographwoodcircle: 0x328D, - ideva: 0x0907, - idieresis: 0x00EF, - idieresisacute: 0x1E2F, - idieresiscyrillic: 0x04E5, - idotbelow: 0x1ECB, - iebrevecyrillic: 0x04D7, - iecyrillic: 0x0435, - ieungacirclekorean: 0x3275, - ieungaparenkorean: 0x3215, - ieungcirclekorean: 0x3267, - ieungkorean: 0x3147, - ieungparenkorean: 0x3207, - igrave: 0x00EC, - igujarati: 0x0A87, - igurmukhi: 0x0A07, - ihiragana: 0x3044, - ihookabove: 0x1EC9, - iibengali: 0x0988, - iicyrillic: 0x0438, - iideva: 0x0908, - iigujarati: 0x0A88, - iigurmukhi: 0x0A08, - iimatragurmukhi: 0x0A40, - iinvertedbreve: 0x020B, - iishortcyrillic: 0x0439, - iivowelsignbengali: 0x09C0, - iivowelsigndeva: 0x0940, - iivowelsigngujarati: 0x0AC0, - ij: 0x0133, - ikatakana: 0x30A4, - ikatakanahalfwidth: 0xFF72, - ikorean: 0x3163, - ilde: 0x02DC, - iluyhebrew: 0x05AC, - imacron: 0x012B, - imacroncyrillic: 0x04E3, - imageorapproximatelyequal: 0x2253, - imatragurmukhi: 0x0A3F, - imonospace: 0xFF49, - increment: 0x2206, - infinity: 0x221E, - iniarmenian: 0x056B, - integral: 0x222B, - integralbottom: 0x2321, - integralbt: 0x2321, - integralex: 0xF8F5, - integraltop: 0x2320, - integraltp: 0x2320, - intersection: 0x2229, - intisquare: 0x3305, - invbullet: 0x25D8, - invcircle: 0x25D9, - invsmileface: 0x263B, - iocyrillic: 0x0451, - iogonek: 0x012F, - iota: 0x03B9, - iotadieresis: 0x03CA, - iotadieresistonos: 0x0390, - iotalatin: 0x0269, - iotatonos: 0x03AF, - iparen: 0x24A4, - irigurmukhi: 0x0A72, - ismallhiragana: 0x3043, - ismallkatakana: 0x30A3, - ismallkatakanahalfwidth: 0xFF68, - issharbengali: 0x09FA, - istroke: 0x0268, - isuperior: 0xF6ED, - iterationhiragana: 0x309D, - iterationkatakana: 0x30FD, - itilde: 0x0129, - itildebelow: 0x1E2D, - iubopomofo: 0x3129, - iucyrillic: 0x044E, - ivowelsignbengali: 0x09BF, - ivowelsigndeva: 0x093F, - ivowelsigngujarati: 0x0ABF, - izhitsacyrillic: 0x0475, - izhitsadblgravecyrillic: 0x0477, - j: 0x006A, - jaarmenian: 0x0571, - jabengali: 0x099C, - jadeva: 0x091C, - jagujarati: 0x0A9C, - jagurmukhi: 0x0A1C, - jbopomofo: 0x3110, - jcaron: 0x01F0, - jcircle: 0x24D9, - jcircumflex: 0x0135, - jcrossedtail: 0x029D, - jdotlessstroke: 0x025F, - jecyrillic: 0x0458, - jeemarabic: 0x062C, - jeemfinalarabic: 0xFE9E, - jeeminitialarabic: 0xFE9F, - jeemmedialarabic: 0xFEA0, - jeharabic: 0x0698, - jehfinalarabic: 0xFB8B, - jhabengali: 0x099D, - jhadeva: 0x091D, - jhagujarati: 0x0A9D, - jhagurmukhi: 0x0A1D, - jheharmenian: 0x057B, - jis: 0x3004, - jmonospace: 0xFF4A, - jparen: 0x24A5, - jsuperior: 0x02B2, - k: 0x006B, - kabashkircyrillic: 0x04A1, - kabengali: 0x0995, - kacute: 0x1E31, - kacyrillic: 0x043A, - kadescendercyrillic: 0x049B, - kadeva: 0x0915, - kaf: 0x05DB, - kafarabic: 0x0643, - kafdagesh: 0xFB3B, - kafdageshhebrew: 0xFB3B, - kaffinalarabic: 0xFEDA, - kafhebrew: 0x05DB, - kafinitialarabic: 0xFEDB, - kafmedialarabic: 0xFEDC, - kafrafehebrew: 0xFB4D, - kagujarati: 0x0A95, - kagurmukhi: 0x0A15, - kahiragana: 0x304B, - kahookcyrillic: 0x04C4, - kakatakana: 0x30AB, - kakatakanahalfwidth: 0xFF76, - kappa: 0x03BA, - kappasymbolgreek: 0x03F0, - kapyeounmieumkorean: 0x3171, - kapyeounphieuphkorean: 0x3184, - kapyeounpieupkorean: 0x3178, - kapyeounssangpieupkorean: 0x3179, - karoriisquare: 0x330D, - kashidaautoarabic: 0x0640, - kashidaautonosidebearingarabic: 0x0640, - kasmallkatakana: 0x30F5, - kasquare: 0x3384, - kasraarabic: 0x0650, - kasratanarabic: 0x064D, - kastrokecyrillic: 0x049F, - katahiraprolongmarkhalfwidth: 0xFF70, - kaverticalstrokecyrillic: 0x049D, - kbopomofo: 0x310E, - kcalsquare: 0x3389, - kcaron: 0x01E9, - kcedilla: 0x0137, - kcircle: 0x24DA, - kcommaaccent: 0x0137, - kdotbelow: 0x1E33, - keharmenian: 0x0584, - kehiragana: 0x3051, - kekatakana: 0x30B1, - kekatakanahalfwidth: 0xFF79, - kenarmenian: 0x056F, - kesmallkatakana: 0x30F6, - kgreenlandic: 0x0138, - khabengali: 0x0996, - khacyrillic: 0x0445, - khadeva: 0x0916, - khagujarati: 0x0A96, - khagurmukhi: 0x0A16, - khaharabic: 0x062E, - khahfinalarabic: 0xFEA6, - khahinitialarabic: 0xFEA7, - khahmedialarabic: 0xFEA8, - kheicoptic: 0x03E7, - khhadeva: 0x0959, - khhagurmukhi: 0x0A59, - khieukhacirclekorean: 0x3278, - khieukhaparenkorean: 0x3218, - khieukhcirclekorean: 0x326A, - khieukhkorean: 0x314B, - khieukhparenkorean: 0x320A, - khokhaithai: 0x0E02, - khokhonthai: 0x0E05, - khokhuatthai: 0x0E03, - khokhwaithai: 0x0E04, - khomutthai: 0x0E5B, - khook: 0x0199, - khorakhangthai: 0x0E06, - khzsquare: 0x3391, - kihiragana: 0x304D, - kikatakana: 0x30AD, - kikatakanahalfwidth: 0xFF77, - kiroguramusquare: 0x3315, - kiromeetorusquare: 0x3316, - kirosquare: 0x3314, - kiyeokacirclekorean: 0x326E, - kiyeokaparenkorean: 0x320E, - kiyeokcirclekorean: 0x3260, - kiyeokkorean: 0x3131, - kiyeokparenkorean: 0x3200, - kiyeoksioskorean: 0x3133, - kjecyrillic: 0x045C, - klinebelow: 0x1E35, - klsquare: 0x3398, - kmcubedsquare: 0x33A6, - kmonospace: 0xFF4B, - kmsquaredsquare: 0x33A2, - kohiragana: 0x3053, - kohmsquare: 0x33C0, - kokaithai: 0x0E01, - kokatakana: 0x30B3, - kokatakanahalfwidth: 0xFF7A, - kooposquare: 0x331E, - koppacyrillic: 0x0481, - koreanstandardsymbol: 0x327F, - koroniscmb: 0x0343, - kparen: 0x24A6, - kpasquare: 0x33AA, - ksicyrillic: 0x046F, - ktsquare: 0x33CF, - kturned: 0x029E, - kuhiragana: 0x304F, - kukatakana: 0x30AF, - kukatakanahalfwidth: 0xFF78, - kvsquare: 0x33B8, - kwsquare: 0x33BE, - l: 0x006C, - labengali: 0x09B2, - lacute: 0x013A, - ladeva: 0x0932, - lagujarati: 0x0AB2, - lagurmukhi: 0x0A32, - lakkhangyaothai: 0x0E45, - lamaleffinalarabic: 0xFEFC, - lamalefhamzaabovefinalarabic: 0xFEF8, - lamalefhamzaaboveisolatedarabic: 0xFEF7, - lamalefhamzabelowfinalarabic: 0xFEFA, - lamalefhamzabelowisolatedarabic: 0xFEF9, - lamalefisolatedarabic: 0xFEFB, - lamalefmaddaabovefinalarabic: 0xFEF6, - lamalefmaddaaboveisolatedarabic: 0xFEF5, - lamarabic: 0x0644, - lambda: 0x03BB, - lambdastroke: 0x019B, - lamed: 0x05DC, - lameddagesh: 0xFB3C, - lameddageshhebrew: 0xFB3C, - lamedhebrew: 0x05DC, - lamfinalarabic: 0xFEDE, - lamhahinitialarabic: 0xFCCA, - laminitialarabic: 0xFEDF, - lamjeeminitialarabic: 0xFCC9, - lamkhahinitialarabic: 0xFCCB, - lamlamhehisolatedarabic: 0xFDF2, - lammedialarabic: 0xFEE0, - lammeemhahinitialarabic: 0xFD88, - lammeeminitialarabic: 0xFCCC, - largecircle: 0x25EF, - lbar: 0x019A, - lbelt: 0x026C, - lbopomofo: 0x310C, - lcaron: 0x013E, - lcedilla: 0x013C, - lcircle: 0x24DB, - lcircumflexbelow: 0x1E3D, - lcommaaccent: 0x013C, - ldot: 0x0140, - ldotaccent: 0x0140, - ldotbelow: 0x1E37, - ldotbelowmacron: 0x1E39, - leftangleabovecmb: 0x031A, - lefttackbelowcmb: 0x0318, - less: 0x003C, - lessequal: 0x2264, - lessequalorgreater: 0x22DA, - lessmonospace: 0xFF1C, - lessorequivalent: 0x2272, - lessorgreater: 0x2276, - lessoverequal: 0x2266, - lesssmall: 0xFE64, - lezh: 0x026E, - lfblock: 0x258C, - lhookretroflex: 0x026D, - lira: 0x20A4, - liwnarmenian: 0x056C, - lj: 0x01C9, - ljecyrillic: 0x0459, - ll: 0xF6C0, - lladeva: 0x0933, - llagujarati: 0x0AB3, - llinebelow: 0x1E3B, - llladeva: 0x0934, - llvocalicbengali: 0x09E1, - llvocalicdeva: 0x0961, - llvocalicvowelsignbengali: 0x09E3, - llvocalicvowelsigndeva: 0x0963, - lmiddletilde: 0x026B, - lmonospace: 0xFF4C, - lmsquare: 0x33D0, - lochulathai: 0x0E2C, - logicaland: 0x2227, - logicalnot: 0x00AC, - logicalnotreversed: 0x2310, - logicalor: 0x2228, - lolingthai: 0x0E25, - longs: 0x017F, - lowlinecenterline: 0xFE4E, - lowlinecmb: 0x0332, - lowlinedashed: 0xFE4D, - lozenge: 0x25CA, - lparen: 0x24A7, - lslash: 0x0142, - lsquare: 0x2113, - lsuperior: 0xF6EE, - ltshade: 0x2591, - luthai: 0x0E26, - lvocalicbengali: 0x098C, - lvocalicdeva: 0x090C, - lvocalicvowelsignbengali: 0x09E2, - lvocalicvowelsigndeva: 0x0962, - lxsquare: 0x33D3, - m: 0x006D, - mabengali: 0x09AE, - macron: 0x00AF, - macronbelowcmb: 0x0331, - macroncmb: 0x0304, - macronlowmod: 0x02CD, - macronmonospace: 0xFFE3, - macute: 0x1E3F, - madeva: 0x092E, - magujarati: 0x0AAE, - magurmukhi: 0x0A2E, - mahapakhhebrew: 0x05A4, - mahapakhlefthebrew: 0x05A4, - mahiragana: 0x307E, - maichattawalowleftthai: 0xF895, - maichattawalowrightthai: 0xF894, - maichattawathai: 0x0E4B, - maichattawaupperleftthai: 0xF893, - maieklowleftthai: 0xF88C, - maieklowrightthai: 0xF88B, - maiekthai: 0x0E48, - maiekupperleftthai: 0xF88A, - maihanakatleftthai: 0xF884, - maihanakatthai: 0x0E31, - maitaikhuleftthai: 0xF889, - maitaikhuthai: 0x0E47, - maitholowleftthai: 0xF88F, - maitholowrightthai: 0xF88E, - maithothai: 0x0E49, - maithoupperleftthai: 0xF88D, - maitrilowleftthai: 0xF892, - maitrilowrightthai: 0xF891, - maitrithai: 0x0E4A, - maitriupperleftthai: 0xF890, - maiyamokthai: 0x0E46, - makatakana: 0x30DE, - makatakanahalfwidth: 0xFF8F, - male: 0x2642, - mansyonsquare: 0x3347, - maqafhebrew: 0x05BE, - mars: 0x2642, - masoracirclehebrew: 0x05AF, - masquare: 0x3383, - mbopomofo: 0x3107, - mbsquare: 0x33D4, - mcircle: 0x24DC, - mcubedsquare: 0x33A5, - mdotaccent: 0x1E41, - mdotbelow: 0x1E43, - meemarabic: 0x0645, - meemfinalarabic: 0xFEE2, - meeminitialarabic: 0xFEE3, - meemmedialarabic: 0xFEE4, - meemmeeminitialarabic: 0xFCD1, - meemmeemisolatedarabic: 0xFC48, - meetorusquare: 0x334D, - mehiragana: 0x3081, - meizierasquare: 0x337E, - mekatakana: 0x30E1, - mekatakanahalfwidth: 0xFF92, - mem: 0x05DE, - memdagesh: 0xFB3E, - memdageshhebrew: 0xFB3E, - memhebrew: 0x05DE, - menarmenian: 0x0574, - merkhahebrew: 0x05A5, - merkhakefulahebrew: 0x05A6, - merkhakefulalefthebrew: 0x05A6, - merkhalefthebrew: 0x05A5, - mhook: 0x0271, - mhzsquare: 0x3392, - middledotkatakanahalfwidth: 0xFF65, - middot: 0x00B7, - mieumacirclekorean: 0x3272, - mieumaparenkorean: 0x3212, - mieumcirclekorean: 0x3264, - mieumkorean: 0x3141, - mieumpansioskorean: 0x3170, - mieumparenkorean: 0x3204, - mieumpieupkorean: 0x316E, - mieumsioskorean: 0x316F, - mihiragana: 0x307F, - mikatakana: 0x30DF, - mikatakanahalfwidth: 0xFF90, - minus: 0x2212, - minusbelowcmb: 0x0320, - minuscircle: 0x2296, - minusmod: 0x02D7, - minusplus: 0x2213, - minute: 0x2032, - miribaarusquare: 0x334A, - mirisquare: 0x3349, - mlonglegturned: 0x0270, - mlsquare: 0x3396, - mmcubedsquare: 0x33A3, - mmonospace: 0xFF4D, - mmsquaredsquare: 0x339F, - mohiragana: 0x3082, - mohmsquare: 0x33C1, - mokatakana: 0x30E2, - mokatakanahalfwidth: 0xFF93, - molsquare: 0x33D6, - momathai: 0x0E21, - moverssquare: 0x33A7, - moverssquaredsquare: 0x33A8, - mparen: 0x24A8, - mpasquare: 0x33AB, - mssquare: 0x33B3, - msuperior: 0xF6EF, - mturned: 0x026F, - mu: 0x00B5, - mu1: 0x00B5, - muasquare: 0x3382, - muchgreater: 0x226B, - muchless: 0x226A, - mufsquare: 0x338C, - mugreek: 0x03BC, - mugsquare: 0x338D, - muhiragana: 0x3080, - mukatakana: 0x30E0, - mukatakanahalfwidth: 0xFF91, - mulsquare: 0x3395, - multiply: 0x00D7, - mumsquare: 0x339B, - munahhebrew: 0x05A3, - munahlefthebrew: 0x05A3, - musicalnote: 0x266A, - musicalnotedbl: 0x266B, - musicflatsign: 0x266D, - musicsharpsign: 0x266F, - mussquare: 0x33B2, - muvsquare: 0x33B6, - muwsquare: 0x33BC, - mvmegasquare: 0x33B9, - mvsquare: 0x33B7, - mwmegasquare: 0x33BF, - mwsquare: 0x33BD, - n: 0x006E, - nabengali: 0x09A8, - nabla: 0x2207, - nacute: 0x0144, - nadeva: 0x0928, - nagujarati: 0x0AA8, - nagurmukhi: 0x0A28, - nahiragana: 0x306A, - nakatakana: 0x30CA, - nakatakanahalfwidth: 0xFF85, - napostrophe: 0x0149, - nasquare: 0x3381, - nbopomofo: 0x310B, - nbspace: 0x00A0, - ncaron: 0x0148, - ncedilla: 0x0146, - ncircle: 0x24DD, - ncircumflexbelow: 0x1E4B, - ncommaaccent: 0x0146, - ndotaccent: 0x1E45, - ndotbelow: 0x1E47, - nehiragana: 0x306D, - nekatakana: 0x30CD, - nekatakanahalfwidth: 0xFF88, - newsheqelsign: 0x20AA, - nfsquare: 0x338B, - ngabengali: 0x0999, - ngadeva: 0x0919, - ngagujarati: 0x0A99, - ngagurmukhi: 0x0A19, - ngonguthai: 0x0E07, - nhiragana: 0x3093, - nhookleft: 0x0272, - nhookretroflex: 0x0273, - nieunacirclekorean: 0x326F, - nieunaparenkorean: 0x320F, - nieuncieuckorean: 0x3135, - nieuncirclekorean: 0x3261, - nieunhieuhkorean: 0x3136, - nieunkorean: 0x3134, - nieunpansioskorean: 0x3168, - nieunparenkorean: 0x3201, - nieunsioskorean: 0x3167, - nieuntikeutkorean: 0x3166, - nihiragana: 0x306B, - nikatakana: 0x30CB, - nikatakanahalfwidth: 0xFF86, - nikhahitleftthai: 0xF899, - nikhahitthai: 0x0E4D, - nine: 0x0039, - ninearabic: 0x0669, - ninebengali: 0x09EF, - ninecircle: 0x2468, - ninecircleinversesansserif: 0x2792, - ninedeva: 0x096F, - ninegujarati: 0x0AEF, - ninegurmukhi: 0x0A6F, - ninehackarabic: 0x0669, - ninehangzhou: 0x3029, - nineideographicparen: 0x3228, - nineinferior: 0x2089, - ninemonospace: 0xFF19, - nineoldstyle: 0xF739, - nineparen: 0x247C, - nineperiod: 0x2490, - ninepersian: 0x06F9, - nineroman: 0x2178, - ninesuperior: 0x2079, - nineteencircle: 0x2472, - nineteenparen: 0x2486, - nineteenperiod: 0x249A, - ninethai: 0x0E59, - nj: 0x01CC, - njecyrillic: 0x045A, - nkatakana: 0x30F3, - nkatakanahalfwidth: 0xFF9D, - nlegrightlong: 0x019E, - nlinebelow: 0x1E49, - nmonospace: 0xFF4E, - nmsquare: 0x339A, - nnabengali: 0x09A3, - nnadeva: 0x0923, - nnagujarati: 0x0AA3, - nnagurmukhi: 0x0A23, - nnnadeva: 0x0929, - nohiragana: 0x306E, - nokatakana: 0x30CE, - nokatakanahalfwidth: 0xFF89, - nonbreakingspace: 0x00A0, - nonenthai: 0x0E13, - nonuthai: 0x0E19, - noonarabic: 0x0646, - noonfinalarabic: 0xFEE6, - noonghunnaarabic: 0x06BA, - noonghunnafinalarabic: 0xFB9F, - nooninitialarabic: 0xFEE7, - noonjeeminitialarabic: 0xFCD2, - noonjeemisolatedarabic: 0xFC4B, - noonmedialarabic: 0xFEE8, - noonmeeminitialarabic: 0xFCD5, - noonmeemisolatedarabic: 0xFC4E, - noonnoonfinalarabic: 0xFC8D, - notcontains: 0x220C, - notelement: 0x2209, - notelementof: 0x2209, - notequal: 0x2260, - notgreater: 0x226F, - notgreaternorequal: 0x2271, - notgreaternorless: 0x2279, - notidentical: 0x2262, - notless: 0x226E, - notlessnorequal: 0x2270, - notparallel: 0x2226, - notprecedes: 0x2280, - notsubset: 0x2284, - notsucceeds: 0x2281, - notsuperset: 0x2285, - nowarmenian: 0x0576, - nparen: 0x24A9, - nssquare: 0x33B1, - nsuperior: 0x207F, - ntilde: 0x00F1, - nu: 0x03BD, - nuhiragana: 0x306C, - nukatakana: 0x30CC, - nukatakanahalfwidth: 0xFF87, - nuktabengali: 0x09BC, - nuktadeva: 0x093C, - nuktagujarati: 0x0ABC, - nuktagurmukhi: 0x0A3C, - numbersign: 0x0023, - numbersignmonospace: 0xFF03, - numbersignsmall: 0xFE5F, - numeralsigngreek: 0x0374, - numeralsignlowergreek: 0x0375, - numero: 0x2116, - nun: 0x05E0, - nundagesh: 0xFB40, - nundageshhebrew: 0xFB40, - nunhebrew: 0x05E0, - nvsquare: 0x33B5, - nwsquare: 0x33BB, - nyabengali: 0x099E, - nyadeva: 0x091E, - nyagujarati: 0x0A9E, - nyagurmukhi: 0x0A1E, - o: 0x006F, - oacute: 0x00F3, - oangthai: 0x0E2D, - obarred: 0x0275, - obarredcyrillic: 0x04E9, - obarreddieresiscyrillic: 0x04EB, - obengali: 0x0993, - obopomofo: 0x311B, - obreve: 0x014F, - ocandradeva: 0x0911, - ocandragujarati: 0x0A91, - ocandravowelsigndeva: 0x0949, - ocandravowelsigngujarati: 0x0AC9, - ocaron: 0x01D2, - ocircle: 0x24DE, - ocircumflex: 0x00F4, - ocircumflexacute: 0x1ED1, - ocircumflexdotbelow: 0x1ED9, - ocircumflexgrave: 0x1ED3, - ocircumflexhookabove: 0x1ED5, - ocircumflextilde: 0x1ED7, - ocyrillic: 0x043E, - odblacute: 0x0151, - odblgrave: 0x020D, - odeva: 0x0913, - odieresis: 0x00F6, - odieresiscyrillic: 0x04E7, - odotbelow: 0x1ECD, - oe: 0x0153, - oekorean: 0x315A, - ogonek: 0x02DB, - ogonekcmb: 0x0328, - ograve: 0x00F2, - ogujarati: 0x0A93, - oharmenian: 0x0585, - ohiragana: 0x304A, - ohookabove: 0x1ECF, - ohorn: 0x01A1, - ohornacute: 0x1EDB, - ohorndotbelow: 0x1EE3, - ohorngrave: 0x1EDD, - ohornhookabove: 0x1EDF, - ohorntilde: 0x1EE1, - ohungarumlaut: 0x0151, - oi: 0x01A3, - oinvertedbreve: 0x020F, - okatakana: 0x30AA, - okatakanahalfwidth: 0xFF75, - okorean: 0x3157, - olehebrew: 0x05AB, - omacron: 0x014D, - omacronacute: 0x1E53, - omacrongrave: 0x1E51, - omdeva: 0x0950, - omega: 0x03C9, - omega1: 0x03D6, - omegacyrillic: 0x0461, - omegalatinclosed: 0x0277, - omegaroundcyrillic: 0x047B, - omegatitlocyrillic: 0x047D, - omegatonos: 0x03CE, - omgujarati: 0x0AD0, - omicron: 0x03BF, - omicrontonos: 0x03CC, - omonospace: 0xFF4F, - one: 0x0031, - onearabic: 0x0661, - onebengali: 0x09E7, - onecircle: 0x2460, - onecircleinversesansserif: 0x278A, - onedeva: 0x0967, - onedotenleader: 0x2024, - oneeighth: 0x215B, - onefitted: 0xF6DC, - onegujarati: 0x0AE7, - onegurmukhi: 0x0A67, - onehackarabic: 0x0661, - onehalf: 0x00BD, - onehangzhou: 0x3021, - oneideographicparen: 0x3220, - oneinferior: 0x2081, - onemonospace: 0xFF11, - onenumeratorbengali: 0x09F4, - oneoldstyle: 0xF731, - oneparen: 0x2474, - oneperiod: 0x2488, - onepersian: 0x06F1, - onequarter: 0x00BC, - oneroman: 0x2170, - onesuperior: 0x00B9, - onethai: 0x0E51, - onethird: 0x2153, - oogonek: 0x01EB, - oogonekmacron: 0x01ED, - oogurmukhi: 0x0A13, - oomatragurmukhi: 0x0A4B, - oopen: 0x0254, - oparen: 0x24AA, - openbullet: 0x25E6, - option: 0x2325, - ordfeminine: 0x00AA, - ordmasculine: 0x00BA, - orthogonal: 0x221F, - oshortdeva: 0x0912, - oshortvowelsigndeva: 0x094A, - oslash: 0x00F8, - oslashacute: 0x01FF, - osmallhiragana: 0x3049, - osmallkatakana: 0x30A9, - osmallkatakanahalfwidth: 0xFF6B, - ostrokeacute: 0x01FF, - osuperior: 0xF6F0, - otcyrillic: 0x047F, - otilde: 0x00F5, - otildeacute: 0x1E4D, - otildedieresis: 0x1E4F, - oubopomofo: 0x3121, - overline: 0x203E, - overlinecenterline: 0xFE4A, - overlinecmb: 0x0305, - overlinedashed: 0xFE49, - overlinedblwavy: 0xFE4C, - overlinewavy: 0xFE4B, - overscore: 0x00AF, - ovowelsignbengali: 0x09CB, - ovowelsigndeva: 0x094B, - ovowelsigngujarati: 0x0ACB, - p: 0x0070, - paampssquare: 0x3380, - paasentosquare: 0x332B, - pabengali: 0x09AA, - pacute: 0x1E55, - padeva: 0x092A, - pagedown: 0x21DF, - pageup: 0x21DE, - pagujarati: 0x0AAA, - pagurmukhi: 0x0A2A, - pahiragana: 0x3071, - paiyannoithai: 0x0E2F, - pakatakana: 0x30D1, - palatalizationcyrilliccmb: 0x0484, - palochkacyrillic: 0x04C0, - pansioskorean: 0x317F, - paragraph: 0x00B6, - parallel: 0x2225, - parenleft: 0x0028, - parenleftaltonearabic: 0xFD3E, - parenleftbt: 0xF8ED, - parenleftex: 0xF8EC, - parenleftinferior: 0x208D, - parenleftmonospace: 0xFF08, - parenleftsmall: 0xFE59, - parenleftsuperior: 0x207D, - parenlefttp: 0xF8EB, - parenleftvertical: 0xFE35, - parenright: 0x0029, - parenrightaltonearabic: 0xFD3F, - parenrightbt: 0xF8F8, - parenrightex: 0xF8F7, - parenrightinferior: 0x208E, - parenrightmonospace: 0xFF09, - parenrightsmall: 0xFE5A, - parenrightsuperior: 0x207E, - parenrighttp: 0xF8F6, - parenrightvertical: 0xFE36, - partialdiff: 0x2202, - paseqhebrew: 0x05C0, - pashtahebrew: 0x0599, - pasquare: 0x33A9, - patah: 0x05B7, - patah11: 0x05B7, - patah1d: 0x05B7, - patah2a: 0x05B7, - patahhebrew: 0x05B7, - patahnarrowhebrew: 0x05B7, - patahquarterhebrew: 0x05B7, - patahwidehebrew: 0x05B7, - pazerhebrew: 0x05A1, - pbopomofo: 0x3106, - pcircle: 0x24DF, - pdotaccent: 0x1E57, - pe: 0x05E4, - pecyrillic: 0x043F, - pedagesh: 0xFB44, - pedageshhebrew: 0xFB44, - peezisquare: 0x333B, - pefinaldageshhebrew: 0xFB43, - peharabic: 0x067E, - peharmenian: 0x057A, - pehebrew: 0x05E4, - pehfinalarabic: 0xFB57, - pehinitialarabic: 0xFB58, - pehiragana: 0x307A, - pehmedialarabic: 0xFB59, - pekatakana: 0x30DA, - pemiddlehookcyrillic: 0x04A7, - perafehebrew: 0xFB4E, - percent: 0x0025, - percentarabic: 0x066A, - percentmonospace: 0xFF05, - percentsmall: 0xFE6A, - period: 0x002E, - periodarmenian: 0x0589, - periodcentered: 0x00B7, - periodhalfwidth: 0xFF61, - periodinferior: 0xF6E7, - periodmonospace: 0xFF0E, - periodsmall: 0xFE52, - periodsuperior: 0xF6E8, - perispomenigreekcmb: 0x0342, - perpendicular: 0x22A5, - perthousand: 0x2030, - peseta: 0x20A7, - pfsquare: 0x338A, - phabengali: 0x09AB, - phadeva: 0x092B, - phagujarati: 0x0AAB, - phagurmukhi: 0x0A2B, - phi: 0x03C6, - phi1: 0x03D5, - phieuphacirclekorean: 0x327A, - phieuphaparenkorean: 0x321A, - phieuphcirclekorean: 0x326C, - phieuphkorean: 0x314D, - phieuphparenkorean: 0x320C, - philatin: 0x0278, - phinthuthai: 0x0E3A, - phisymbolgreek: 0x03D5, - phook: 0x01A5, - phophanthai: 0x0E1E, - phophungthai: 0x0E1C, - phosamphaothai: 0x0E20, - pi: 0x03C0, - pieupacirclekorean: 0x3273, - pieupaparenkorean: 0x3213, - pieupcieuckorean: 0x3176, - pieupcirclekorean: 0x3265, - pieupkiyeokkorean: 0x3172, - pieupkorean: 0x3142, - pieupparenkorean: 0x3205, - pieupsioskiyeokkorean: 0x3174, - pieupsioskorean: 0x3144, - pieupsiostikeutkorean: 0x3175, - pieupthieuthkorean: 0x3177, - pieuptikeutkorean: 0x3173, - pihiragana: 0x3074, - pikatakana: 0x30D4, - pisymbolgreek: 0x03D6, - piwrarmenian: 0x0583, - plus: 0x002B, - plusbelowcmb: 0x031F, - pluscircle: 0x2295, - plusminus: 0x00B1, - plusmod: 0x02D6, - plusmonospace: 0xFF0B, - plussmall: 0xFE62, - plussuperior: 0x207A, - pmonospace: 0xFF50, - pmsquare: 0x33D8, - pohiragana: 0x307D, - pointingindexdownwhite: 0x261F, - pointingindexleftwhite: 0x261C, - pointingindexrightwhite: 0x261E, - pointingindexupwhite: 0x261D, - pokatakana: 0x30DD, - poplathai: 0x0E1B, - postalmark: 0x3012, - postalmarkface: 0x3020, - pparen: 0x24AB, - precedes: 0x227A, - prescription: 0x211E, - primemod: 0x02B9, - primereversed: 0x2035, - product: 0x220F, - projective: 0x2305, - prolongedkana: 0x30FC, - propellor: 0x2318, - propersubset: 0x2282, - propersuperset: 0x2283, - proportion: 0x2237, - proportional: 0x221D, - psi: 0x03C8, - psicyrillic: 0x0471, - psilipneumatacyrilliccmb: 0x0486, - pssquare: 0x33B0, - puhiragana: 0x3077, - pukatakana: 0x30D7, - pvsquare: 0x33B4, - pwsquare: 0x33BA, - q: 0x0071, - qadeva: 0x0958, - qadmahebrew: 0x05A8, - qafarabic: 0x0642, - qaffinalarabic: 0xFED6, - qafinitialarabic: 0xFED7, - qafmedialarabic: 0xFED8, - qamats: 0x05B8, - qamats10: 0x05B8, - qamats1a: 0x05B8, - qamats1c: 0x05B8, - qamats27: 0x05B8, - qamats29: 0x05B8, - qamats33: 0x05B8, - qamatsde: 0x05B8, - qamatshebrew: 0x05B8, - qamatsnarrowhebrew: 0x05B8, - qamatsqatanhebrew: 0x05B8, - qamatsqatannarrowhebrew: 0x05B8, - qamatsqatanquarterhebrew: 0x05B8, - qamatsqatanwidehebrew: 0x05B8, - qamatsquarterhebrew: 0x05B8, - qamatswidehebrew: 0x05B8, - qarneyparahebrew: 0x059F, - qbopomofo: 0x3111, - qcircle: 0x24E0, - qhook: 0x02A0, - qmonospace: 0xFF51, - qof: 0x05E7, - qofdagesh: 0xFB47, - qofdageshhebrew: 0xFB47, - qofhebrew: 0x05E7, - qparen: 0x24AC, - quarternote: 0x2669, - qubuts: 0x05BB, - qubuts18: 0x05BB, - qubuts25: 0x05BB, - qubuts31: 0x05BB, - qubutshebrew: 0x05BB, - qubutsnarrowhebrew: 0x05BB, - qubutsquarterhebrew: 0x05BB, - qubutswidehebrew: 0x05BB, - question: 0x003F, - questionarabic: 0x061F, - questionarmenian: 0x055E, - questiondown: 0x00BF, - questiondownsmall: 0xF7BF, - questiongreek: 0x037E, - questionmonospace: 0xFF1F, - questionsmall: 0xF73F, - quotedbl: 0x0022, - quotedblbase: 0x201E, - quotedblleft: 0x201C, - quotedblmonospace: 0xFF02, - quotedblprime: 0x301E, - quotedblprimereversed: 0x301D, - quotedblright: 0x201D, - quoteleft: 0x2018, - quoteleftreversed: 0x201B, - quotereversed: 0x201B, - quoteright: 0x2019, - quoterightn: 0x0149, - quotesinglbase: 0x201A, - quotesingle: 0x0027, - quotesinglemonospace: 0xFF07, - r: 0x0072, - raarmenian: 0x057C, - rabengali: 0x09B0, - racute: 0x0155, - radeva: 0x0930, - radical: 0x221A, - radicalex: 0xF8E5, - radoverssquare: 0x33AE, - radoverssquaredsquare: 0x33AF, - radsquare: 0x33AD, - rafe: 0x05BF, - rafehebrew: 0x05BF, - ragujarati: 0x0AB0, - ragurmukhi: 0x0A30, - rahiragana: 0x3089, - rakatakana: 0x30E9, - rakatakanahalfwidth: 0xFF97, - ralowerdiagonalbengali: 0x09F1, - ramiddlediagonalbengali: 0x09F0, - ramshorn: 0x0264, - ratio: 0x2236, - rbopomofo: 0x3116, - rcaron: 0x0159, - rcedilla: 0x0157, - rcircle: 0x24E1, - rcommaaccent: 0x0157, - rdblgrave: 0x0211, - rdotaccent: 0x1E59, - rdotbelow: 0x1E5B, - rdotbelowmacron: 0x1E5D, - referencemark: 0x203B, - reflexsubset: 0x2286, - reflexsuperset: 0x2287, - registered: 0x00AE, - registersans: 0xF8E8, - registerserif: 0xF6DA, - reharabic: 0x0631, - reharmenian: 0x0580, - rehfinalarabic: 0xFEAE, - rehiragana: 0x308C, - rekatakana: 0x30EC, - rekatakanahalfwidth: 0xFF9A, - resh: 0x05E8, - reshdageshhebrew: 0xFB48, - reshhebrew: 0x05E8, - reversedtilde: 0x223D, - reviahebrew: 0x0597, - reviamugrashhebrew: 0x0597, - revlogicalnot: 0x2310, - rfishhook: 0x027E, - rfishhookreversed: 0x027F, - rhabengali: 0x09DD, - rhadeva: 0x095D, - rho: 0x03C1, - rhook: 0x027D, - rhookturned: 0x027B, - rhookturnedsuperior: 0x02B5, - rhosymbolgreek: 0x03F1, - rhotichookmod: 0x02DE, - rieulacirclekorean: 0x3271, - rieulaparenkorean: 0x3211, - rieulcirclekorean: 0x3263, - rieulhieuhkorean: 0x3140, - rieulkiyeokkorean: 0x313A, - rieulkiyeoksioskorean: 0x3169, - rieulkorean: 0x3139, - rieulmieumkorean: 0x313B, - rieulpansioskorean: 0x316C, - rieulparenkorean: 0x3203, - rieulphieuphkorean: 0x313F, - rieulpieupkorean: 0x313C, - rieulpieupsioskorean: 0x316B, - rieulsioskorean: 0x313D, - rieulthieuthkorean: 0x313E, - rieultikeutkorean: 0x316A, - rieulyeorinhieuhkorean: 0x316D, - rightangle: 0x221F, - righttackbelowcmb: 0x0319, - righttriangle: 0x22BF, - rihiragana: 0x308A, - rikatakana: 0x30EA, - rikatakanahalfwidth: 0xFF98, - ring: 0x02DA, - ringbelowcmb: 0x0325, - ringcmb: 0x030A, - ringhalfleft: 0x02BF, - ringhalfleftarmenian: 0x0559, - ringhalfleftbelowcmb: 0x031C, - ringhalfleftcentered: 0x02D3, - ringhalfright: 0x02BE, - ringhalfrightbelowcmb: 0x0339, - ringhalfrightcentered: 0x02D2, - rinvertedbreve: 0x0213, - rittorusquare: 0x3351, - rlinebelow: 0x1E5F, - rlongleg: 0x027C, - rlonglegturned: 0x027A, - rmonospace: 0xFF52, - rohiragana: 0x308D, - rokatakana: 0x30ED, - rokatakanahalfwidth: 0xFF9B, - roruathai: 0x0E23, - rparen: 0x24AD, - rrabengali: 0x09DC, - rradeva: 0x0931, - rragurmukhi: 0x0A5C, - rreharabic: 0x0691, - rrehfinalarabic: 0xFB8D, - rrvocalicbengali: 0x09E0, - rrvocalicdeva: 0x0960, - rrvocalicgujarati: 0x0AE0, - rrvocalicvowelsignbengali: 0x09C4, - rrvocalicvowelsigndeva: 0x0944, - rrvocalicvowelsigngujarati: 0x0AC4, - rsuperior: 0xF6F1, - rtblock: 0x2590, - rturned: 0x0279, - rturnedsuperior: 0x02B4, - ruhiragana: 0x308B, - rukatakana: 0x30EB, - rukatakanahalfwidth: 0xFF99, - rupeemarkbengali: 0x09F2, - rupeesignbengali: 0x09F3, - rupiah: 0xF6DD, - ruthai: 0x0E24, - rvocalicbengali: 0x098B, - rvocalicdeva: 0x090B, - rvocalicgujarati: 0x0A8B, - rvocalicvowelsignbengali: 0x09C3, - rvocalicvowelsigndeva: 0x0943, - rvocalicvowelsigngujarati: 0x0AC3, - s: 0x0073, - sabengali: 0x09B8, - sacute: 0x015B, - sacutedotaccent: 0x1E65, - sadarabic: 0x0635, - sadeva: 0x0938, - sadfinalarabic: 0xFEBA, - sadinitialarabic: 0xFEBB, - sadmedialarabic: 0xFEBC, - sagujarati: 0x0AB8, - sagurmukhi: 0x0A38, - sahiragana: 0x3055, - sakatakana: 0x30B5, - sakatakanahalfwidth: 0xFF7B, - sallallahoualayhewasallamarabic: 0xFDFA, - samekh: 0x05E1, - samekhdagesh: 0xFB41, - samekhdageshhebrew: 0xFB41, - samekhhebrew: 0x05E1, - saraaathai: 0x0E32, - saraaethai: 0x0E41, - saraaimaimalaithai: 0x0E44, - saraaimaimuanthai: 0x0E43, - saraamthai: 0x0E33, - saraathai: 0x0E30, - saraethai: 0x0E40, - saraiileftthai: 0xF886, - saraiithai: 0x0E35, - saraileftthai: 0xF885, - saraithai: 0x0E34, - saraothai: 0x0E42, - saraueeleftthai: 0xF888, - saraueethai: 0x0E37, - saraueleftthai: 0xF887, - sarauethai: 0x0E36, - sarauthai: 0x0E38, - sarauuthai: 0x0E39, - sbopomofo: 0x3119, - scaron: 0x0161, - scarondotaccent: 0x1E67, - scedilla: 0x015F, - schwa: 0x0259, - schwacyrillic: 0x04D9, - schwadieresiscyrillic: 0x04DB, - schwahook: 0x025A, - scircle: 0x24E2, - scircumflex: 0x015D, - scommaaccent: 0x0219, - sdotaccent: 0x1E61, - sdotbelow: 0x1E63, - sdotbelowdotaccent: 0x1E69, - seagullbelowcmb: 0x033C, - second: 0x2033, - secondtonechinese: 0x02CA, - section: 0x00A7, - seenarabic: 0x0633, - seenfinalarabic: 0xFEB2, - seeninitialarabic: 0xFEB3, - seenmedialarabic: 0xFEB4, - segol: 0x05B6, - segol13: 0x05B6, - segol1f: 0x05B6, - segol2c: 0x05B6, - segolhebrew: 0x05B6, - segolnarrowhebrew: 0x05B6, - segolquarterhebrew: 0x05B6, - segoltahebrew: 0x0592, - segolwidehebrew: 0x05B6, - seharmenian: 0x057D, - sehiragana: 0x305B, - sekatakana: 0x30BB, - sekatakanahalfwidth: 0xFF7E, - semicolon: 0x003B, - semicolonarabic: 0x061B, - semicolonmonospace: 0xFF1B, - semicolonsmall: 0xFE54, - semivoicedmarkkana: 0x309C, - semivoicedmarkkanahalfwidth: 0xFF9F, - sentisquare: 0x3322, - sentosquare: 0x3323, - seven: 0x0037, - sevenarabic: 0x0667, - sevenbengali: 0x09ED, - sevencircle: 0x2466, - sevencircleinversesansserif: 0x2790, - sevendeva: 0x096D, - seveneighths: 0x215E, - sevengujarati: 0x0AED, - sevengurmukhi: 0x0A6D, - sevenhackarabic: 0x0667, - sevenhangzhou: 0x3027, - sevenideographicparen: 0x3226, - seveninferior: 0x2087, - sevenmonospace: 0xFF17, - sevenoldstyle: 0xF737, - sevenparen: 0x247A, - sevenperiod: 0x248E, - sevenpersian: 0x06F7, - sevenroman: 0x2176, - sevensuperior: 0x2077, - seventeencircle: 0x2470, - seventeenparen: 0x2484, - seventeenperiod: 0x2498, - seventhai: 0x0E57, - sfthyphen: 0x00AD, - shaarmenian: 0x0577, - shabengali: 0x09B6, - shacyrillic: 0x0448, - shaddaarabic: 0x0651, - shaddadammaarabic: 0xFC61, - shaddadammatanarabic: 0xFC5E, - shaddafathaarabic: 0xFC60, - shaddakasraarabic: 0xFC62, - shaddakasratanarabic: 0xFC5F, - shade: 0x2592, - shadedark: 0x2593, - shadelight: 0x2591, - shademedium: 0x2592, - shadeva: 0x0936, - shagujarati: 0x0AB6, - shagurmukhi: 0x0A36, - shalshelethebrew: 0x0593, - shbopomofo: 0x3115, - shchacyrillic: 0x0449, - sheenarabic: 0x0634, - sheenfinalarabic: 0xFEB6, - sheeninitialarabic: 0xFEB7, - sheenmedialarabic: 0xFEB8, - sheicoptic: 0x03E3, - sheqel: 0x20AA, - sheqelhebrew: 0x20AA, - sheva: 0x05B0, - sheva115: 0x05B0, - sheva15: 0x05B0, - sheva22: 0x05B0, - sheva2e: 0x05B0, - shevahebrew: 0x05B0, - shevanarrowhebrew: 0x05B0, - shevaquarterhebrew: 0x05B0, - shevawidehebrew: 0x05B0, - shhacyrillic: 0x04BB, - shimacoptic: 0x03ED, - shin: 0x05E9, - shindagesh: 0xFB49, - shindageshhebrew: 0xFB49, - shindageshshindot: 0xFB2C, - shindageshshindothebrew: 0xFB2C, - shindageshsindot: 0xFB2D, - shindageshsindothebrew: 0xFB2D, - shindothebrew: 0x05C1, - shinhebrew: 0x05E9, - shinshindot: 0xFB2A, - shinshindothebrew: 0xFB2A, - shinsindot: 0xFB2B, - shinsindothebrew: 0xFB2B, - shook: 0x0282, - sigma: 0x03C3, - sigma1: 0x03C2, - sigmafinal: 0x03C2, - sigmalunatesymbolgreek: 0x03F2, - sihiragana: 0x3057, - sikatakana: 0x30B7, - sikatakanahalfwidth: 0xFF7C, - siluqhebrew: 0x05BD, - siluqlefthebrew: 0x05BD, - similar: 0x223C, - sindothebrew: 0x05C2, - siosacirclekorean: 0x3274, - siosaparenkorean: 0x3214, - sioscieuckorean: 0x317E, - sioscirclekorean: 0x3266, - sioskiyeokkorean: 0x317A, - sioskorean: 0x3145, - siosnieunkorean: 0x317B, - siosparenkorean: 0x3206, - siospieupkorean: 0x317D, - siostikeutkorean: 0x317C, - six: 0x0036, - sixarabic: 0x0666, - sixbengali: 0x09EC, - sixcircle: 0x2465, - sixcircleinversesansserif: 0x278F, - sixdeva: 0x096C, - sixgujarati: 0x0AEC, - sixgurmukhi: 0x0A6C, - sixhackarabic: 0x0666, - sixhangzhou: 0x3026, - sixideographicparen: 0x3225, - sixinferior: 0x2086, - sixmonospace: 0xFF16, - sixoldstyle: 0xF736, - sixparen: 0x2479, - sixperiod: 0x248D, - sixpersian: 0x06F6, - sixroman: 0x2175, - sixsuperior: 0x2076, - sixteencircle: 0x246F, - sixteencurrencydenominatorbengali: 0x09F9, - sixteenparen: 0x2483, - sixteenperiod: 0x2497, - sixthai: 0x0E56, - slash: 0x002F, - slashmonospace: 0xFF0F, - slong: 0x017F, - slongdotaccent: 0x1E9B, - smileface: 0x263A, - smonospace: 0xFF53, - sofpasuqhebrew: 0x05C3, - softhyphen: 0x00AD, - softsigncyrillic: 0x044C, - sohiragana: 0x305D, - sokatakana: 0x30BD, - sokatakanahalfwidth: 0xFF7F, - soliduslongoverlaycmb: 0x0338, - solidusshortoverlaycmb: 0x0337, - sorusithai: 0x0E29, - sosalathai: 0x0E28, - sosothai: 0x0E0B, - sosuathai: 0x0E2A, - space: 0x0020, - spacehackarabic: 0x0020, - spade: 0x2660, - spadesuitblack: 0x2660, - spadesuitwhite: 0x2664, - sparen: 0x24AE, - squarebelowcmb: 0x033B, - squarecc: 0x33C4, - squarecm: 0x339D, - squarediagonalcrosshatchfill: 0x25A9, - squarehorizontalfill: 0x25A4, - squarekg: 0x338F, - squarekm: 0x339E, - squarekmcapital: 0x33CE, - squareln: 0x33D1, - squarelog: 0x33D2, - squaremg: 0x338E, - squaremil: 0x33D5, - squaremm: 0x339C, - squaremsquared: 0x33A1, - squareorthogonalcrosshatchfill: 0x25A6, - squareupperlefttolowerrightfill: 0x25A7, - squareupperrighttolowerleftfill: 0x25A8, - squareverticalfill: 0x25A5, - squarewhitewithsmallblack: 0x25A3, - srsquare: 0x33DB, - ssabengali: 0x09B7, - ssadeva: 0x0937, - ssagujarati: 0x0AB7, - ssangcieuckorean: 0x3149, - ssanghieuhkorean: 0x3185, - ssangieungkorean: 0x3180, - ssangkiyeokkorean: 0x3132, - ssangnieunkorean: 0x3165, - ssangpieupkorean: 0x3143, - ssangsioskorean: 0x3146, - ssangtikeutkorean: 0x3138, - ssuperior: 0xF6F2, - sterling: 0x00A3, - sterlingmonospace: 0xFFE1, - strokelongoverlaycmb: 0x0336, - strokeshortoverlaycmb: 0x0335, - subset: 0x2282, - subsetnotequal: 0x228A, - subsetorequal: 0x2286, - succeeds: 0x227B, - suchthat: 0x220B, - suhiragana: 0x3059, - sukatakana: 0x30B9, - sukatakanahalfwidth: 0xFF7D, - sukunarabic: 0x0652, - summation: 0x2211, - sun: 0x263C, - superset: 0x2283, - supersetnotequal: 0x228B, - supersetorequal: 0x2287, - svsquare: 0x33DC, - syouwaerasquare: 0x337C, - t: 0x0074, - tabengali: 0x09A4, - tackdown: 0x22A4, - tackleft: 0x22A3, - tadeva: 0x0924, - tagujarati: 0x0AA4, - tagurmukhi: 0x0A24, - taharabic: 0x0637, - tahfinalarabic: 0xFEC2, - tahinitialarabic: 0xFEC3, - tahiragana: 0x305F, - tahmedialarabic: 0xFEC4, - taisyouerasquare: 0x337D, - takatakana: 0x30BF, - takatakanahalfwidth: 0xFF80, - tatweelarabic: 0x0640, - tau: 0x03C4, - tav: 0x05EA, - tavdages: 0xFB4A, - tavdagesh: 0xFB4A, - tavdageshhebrew: 0xFB4A, - tavhebrew: 0x05EA, - tbar: 0x0167, - tbopomofo: 0x310A, - tcaron: 0x0165, - tccurl: 0x02A8, - tcedilla: 0x0163, - tcheharabic: 0x0686, - tchehfinalarabic: 0xFB7B, - tchehinitialarabic: 0xFB7C, - tchehmedialarabic: 0xFB7D, - tcircle: 0x24E3, - tcircumflexbelow: 0x1E71, - tcommaaccent: 0x0163, - tdieresis: 0x1E97, - tdotaccent: 0x1E6B, - tdotbelow: 0x1E6D, - tecyrillic: 0x0442, - tedescendercyrillic: 0x04AD, - teharabic: 0x062A, - tehfinalarabic: 0xFE96, - tehhahinitialarabic: 0xFCA2, - tehhahisolatedarabic: 0xFC0C, - tehinitialarabic: 0xFE97, - tehiragana: 0x3066, - tehjeeminitialarabic: 0xFCA1, - tehjeemisolatedarabic: 0xFC0B, - tehmarbutaarabic: 0x0629, - tehmarbutafinalarabic: 0xFE94, - tehmedialarabic: 0xFE98, - tehmeeminitialarabic: 0xFCA4, - tehmeemisolatedarabic: 0xFC0E, - tehnoonfinalarabic: 0xFC73, - tekatakana: 0x30C6, - tekatakanahalfwidth: 0xFF83, - telephone: 0x2121, - telephoneblack: 0x260E, - telishagedolahebrew: 0x05A0, - telishaqetanahebrew: 0x05A9, - tencircle: 0x2469, - tenideographicparen: 0x3229, - tenparen: 0x247D, - tenperiod: 0x2491, - tenroman: 0x2179, - tesh: 0x02A7, - tet: 0x05D8, - tetdagesh: 0xFB38, - tetdageshhebrew: 0xFB38, - tethebrew: 0x05D8, - tetsecyrillic: 0x04B5, - tevirhebrew: 0x059B, - tevirlefthebrew: 0x059B, - thabengali: 0x09A5, - thadeva: 0x0925, - thagujarati: 0x0AA5, - thagurmukhi: 0x0A25, - thalarabic: 0x0630, - thalfinalarabic: 0xFEAC, - thanthakhatlowleftthai: 0xF898, - thanthakhatlowrightthai: 0xF897, - thanthakhatthai: 0x0E4C, - thanthakhatupperleftthai: 0xF896, - theharabic: 0x062B, - thehfinalarabic: 0xFE9A, - thehinitialarabic: 0xFE9B, - thehmedialarabic: 0xFE9C, - thereexists: 0x2203, - therefore: 0x2234, - theta: 0x03B8, - theta1: 0x03D1, - thetasymbolgreek: 0x03D1, - thieuthacirclekorean: 0x3279, - thieuthaparenkorean: 0x3219, - thieuthcirclekorean: 0x326B, - thieuthkorean: 0x314C, - thieuthparenkorean: 0x320B, - thirteencircle: 0x246C, - thirteenparen: 0x2480, - thirteenperiod: 0x2494, - thonangmonthothai: 0x0E11, - thook: 0x01AD, - thophuthaothai: 0x0E12, - thorn: 0x00FE, - thothahanthai: 0x0E17, - thothanthai: 0x0E10, - thothongthai: 0x0E18, - thothungthai: 0x0E16, - thousandcyrillic: 0x0482, - thousandsseparatorarabic: 0x066C, - thousandsseparatorpersian: 0x066C, - three: 0x0033, - threearabic: 0x0663, - threebengali: 0x09E9, - threecircle: 0x2462, - threecircleinversesansserif: 0x278C, - threedeva: 0x0969, - threeeighths: 0x215C, - threegujarati: 0x0AE9, - threegurmukhi: 0x0A69, - threehackarabic: 0x0663, - threehangzhou: 0x3023, - threeideographicparen: 0x3222, - threeinferior: 0x2083, - threemonospace: 0xFF13, - threenumeratorbengali: 0x09F6, - threeoldstyle: 0xF733, - threeparen: 0x2476, - threeperiod: 0x248A, - threepersian: 0x06F3, - threequarters: 0x00BE, - threequartersemdash: 0xF6DE, - threeroman: 0x2172, - threesuperior: 0x00B3, - threethai: 0x0E53, - thzsquare: 0x3394, - tihiragana: 0x3061, - tikatakana: 0x30C1, - tikatakanahalfwidth: 0xFF81, - tikeutacirclekorean: 0x3270, - tikeutaparenkorean: 0x3210, - tikeutcirclekorean: 0x3262, - tikeutkorean: 0x3137, - tikeutparenkorean: 0x3202, - tilde: 0x02DC, - tildebelowcmb: 0x0330, - tildecmb: 0x0303, - tildecomb: 0x0303, - tildedoublecmb: 0x0360, - tildeoperator: 0x223C, - tildeoverlaycmb: 0x0334, - tildeverticalcmb: 0x033E, - timescircle: 0x2297, - tipehahebrew: 0x0596, - tipehalefthebrew: 0x0596, - tippigurmukhi: 0x0A70, - titlocyrilliccmb: 0x0483, - tiwnarmenian: 0x057F, - tlinebelow: 0x1E6F, - tmonospace: 0xFF54, - toarmenian: 0x0569, - tohiragana: 0x3068, - tokatakana: 0x30C8, - tokatakanahalfwidth: 0xFF84, - tonebarextrahighmod: 0x02E5, - tonebarextralowmod: 0x02E9, - tonebarhighmod: 0x02E6, - tonebarlowmod: 0x02E8, - tonebarmidmod: 0x02E7, - tonefive: 0x01BD, - tonesix: 0x0185, - tonetwo: 0x01A8, - tonos: 0x0384, - tonsquare: 0x3327, - topatakthai: 0x0E0F, - tortoiseshellbracketleft: 0x3014, - tortoiseshellbracketleftsmall: 0xFE5D, - tortoiseshellbracketleftvertical: 0xFE39, - tortoiseshellbracketright: 0x3015, - tortoiseshellbracketrightsmall: 0xFE5E, - tortoiseshellbracketrightvertical: 0xFE3A, - totaothai: 0x0E15, - tpalatalhook: 0x01AB, - tparen: 0x24AF, - trademark: 0x2122, - trademarksans: 0xF8EA, - trademarkserif: 0xF6DB, - tretroflexhook: 0x0288, - triagdn: 0x25BC, - triaglf: 0x25C4, - triagrt: 0x25BA, - triagup: 0x25B2, - ts: 0x02A6, - tsadi: 0x05E6, - tsadidagesh: 0xFB46, - tsadidageshhebrew: 0xFB46, - tsadihebrew: 0x05E6, - tsecyrillic: 0x0446, - tsere: 0x05B5, - tsere12: 0x05B5, - tsere1e: 0x05B5, - tsere2b: 0x05B5, - tserehebrew: 0x05B5, - tserenarrowhebrew: 0x05B5, - tserequarterhebrew: 0x05B5, - tserewidehebrew: 0x05B5, - tshecyrillic: 0x045B, - tsuperior: 0xF6F3, - ttabengali: 0x099F, - ttadeva: 0x091F, - ttagujarati: 0x0A9F, - ttagurmukhi: 0x0A1F, - tteharabic: 0x0679, - ttehfinalarabic: 0xFB67, - ttehinitialarabic: 0xFB68, - ttehmedialarabic: 0xFB69, - tthabengali: 0x09A0, - tthadeva: 0x0920, - tthagujarati: 0x0AA0, - tthagurmukhi: 0x0A20, - tturned: 0x0287, - tuhiragana: 0x3064, - tukatakana: 0x30C4, - tukatakanahalfwidth: 0xFF82, - tusmallhiragana: 0x3063, - tusmallkatakana: 0x30C3, - tusmallkatakanahalfwidth: 0xFF6F, - twelvecircle: 0x246B, - twelveparen: 0x247F, - twelveperiod: 0x2493, - twelveroman: 0x217B, - twentycircle: 0x2473, - twentyhangzhou: 0x5344, - twentyparen: 0x2487, - twentyperiod: 0x249B, - two: 0x0032, - twoarabic: 0x0662, - twobengali: 0x09E8, - twocircle: 0x2461, - twocircleinversesansserif: 0x278B, - twodeva: 0x0968, - twodotenleader: 0x2025, - twodotleader: 0x2025, - twodotleadervertical: 0xFE30, - twogujarati: 0x0AE8, - twogurmukhi: 0x0A68, - twohackarabic: 0x0662, - twohangzhou: 0x3022, - twoideographicparen: 0x3221, - twoinferior: 0x2082, - twomonospace: 0xFF12, - twonumeratorbengali: 0x09F5, - twooldstyle: 0xF732, - twoparen: 0x2475, - twoperiod: 0x2489, - twopersian: 0x06F2, - tworoman: 0x2171, - twostroke: 0x01BB, - twosuperior: 0x00B2, - twothai: 0x0E52, - twothirds: 0x2154, - u: 0x0075, - uacute: 0x00FA, - ubar: 0x0289, - ubengali: 0x0989, - ubopomofo: 0x3128, - ubreve: 0x016D, - ucaron: 0x01D4, - ucircle: 0x24E4, - ucircumflex: 0x00FB, - ucircumflexbelow: 0x1E77, - ucyrillic: 0x0443, - udattadeva: 0x0951, - udblacute: 0x0171, - udblgrave: 0x0215, - udeva: 0x0909, - udieresis: 0x00FC, - udieresisacute: 0x01D8, - udieresisbelow: 0x1E73, - udieresiscaron: 0x01DA, - udieresiscyrillic: 0x04F1, - udieresisgrave: 0x01DC, - udieresismacron: 0x01D6, - udotbelow: 0x1EE5, - ugrave: 0x00F9, - ugujarati: 0x0A89, - ugurmukhi: 0x0A09, - uhiragana: 0x3046, - uhookabove: 0x1EE7, - uhorn: 0x01B0, - uhornacute: 0x1EE9, - uhorndotbelow: 0x1EF1, - uhorngrave: 0x1EEB, - uhornhookabove: 0x1EED, - uhorntilde: 0x1EEF, - uhungarumlaut: 0x0171, - uhungarumlautcyrillic: 0x04F3, - uinvertedbreve: 0x0217, - ukatakana: 0x30A6, - ukatakanahalfwidth: 0xFF73, - ukcyrillic: 0x0479, - ukorean: 0x315C, - umacron: 0x016B, - umacroncyrillic: 0x04EF, - umacrondieresis: 0x1E7B, - umatragurmukhi: 0x0A41, - umonospace: 0xFF55, - underscore: 0x005F, - underscoredbl: 0x2017, - underscoremonospace: 0xFF3F, - underscorevertical: 0xFE33, - underscorewavy: 0xFE4F, - union: 0x222A, - universal: 0x2200, - uogonek: 0x0173, - uparen: 0x24B0, - upblock: 0x2580, - upperdothebrew: 0x05C4, - upsilon: 0x03C5, - upsilondieresis: 0x03CB, - upsilondieresistonos: 0x03B0, - upsilonlatin: 0x028A, - upsilontonos: 0x03CD, - uptackbelowcmb: 0x031D, - uptackmod: 0x02D4, - uragurmukhi: 0x0A73, - uring: 0x016F, - ushortcyrillic: 0x045E, - usmallhiragana: 0x3045, - usmallkatakana: 0x30A5, - usmallkatakanahalfwidth: 0xFF69, - ustraightcyrillic: 0x04AF, - ustraightstrokecyrillic: 0x04B1, - utilde: 0x0169, - utildeacute: 0x1E79, - utildebelow: 0x1E75, - uubengali: 0x098A, - uudeva: 0x090A, - uugujarati: 0x0A8A, - uugurmukhi: 0x0A0A, - uumatragurmukhi: 0x0A42, - uuvowelsignbengali: 0x09C2, - uuvowelsigndeva: 0x0942, - uuvowelsigngujarati: 0x0AC2, - uvowelsignbengali: 0x09C1, - uvowelsigndeva: 0x0941, - uvowelsigngujarati: 0x0AC1, - v: 0x0076, - vadeva: 0x0935, - vagujarati: 0x0AB5, - vagurmukhi: 0x0A35, - vakatakana: 0x30F7, - vav: 0x05D5, - vavdagesh: 0xFB35, - vavdagesh65: 0xFB35, - vavdageshhebrew: 0xFB35, - vavhebrew: 0x05D5, - vavholam: 0xFB4B, - vavholamhebrew: 0xFB4B, - vavvavhebrew: 0x05F0, - vavyodhebrew: 0x05F1, - vcircle: 0x24E5, - vdotbelow: 0x1E7F, - vecyrillic: 0x0432, - veharabic: 0x06A4, - vehfinalarabic: 0xFB6B, - vehinitialarabic: 0xFB6C, - vehmedialarabic: 0xFB6D, - vekatakana: 0x30F9, - venus: 0x2640, - verticalbar: 0x007C, - verticallineabovecmb: 0x030D, - verticallinebelowcmb: 0x0329, - verticallinelowmod: 0x02CC, - verticallinemod: 0x02C8, - vewarmenian: 0x057E, - vhook: 0x028B, - vikatakana: 0x30F8, - viramabengali: 0x09CD, - viramadeva: 0x094D, - viramagujarati: 0x0ACD, - visargabengali: 0x0983, - visargadeva: 0x0903, - visargagujarati: 0x0A83, - vmonospace: 0xFF56, - voarmenian: 0x0578, - voicediterationhiragana: 0x309E, - voicediterationkatakana: 0x30FE, - voicedmarkkana: 0x309B, - voicedmarkkanahalfwidth: 0xFF9E, - vokatakana: 0x30FA, - vparen: 0x24B1, - vtilde: 0x1E7D, - vturned: 0x028C, - vuhiragana: 0x3094, - vukatakana: 0x30F4, - w: 0x0077, - wacute: 0x1E83, - waekorean: 0x3159, - wahiragana: 0x308F, - wakatakana: 0x30EF, - wakatakanahalfwidth: 0xFF9C, - wakorean: 0x3158, - wasmallhiragana: 0x308E, - wasmallkatakana: 0x30EE, - wattosquare: 0x3357, - wavedash: 0x301C, - wavyunderscorevertical: 0xFE34, - wawarabic: 0x0648, - wawfinalarabic: 0xFEEE, - wawhamzaabovearabic: 0x0624, - wawhamzaabovefinalarabic: 0xFE86, - wbsquare: 0x33DD, - wcircle: 0x24E6, - wcircumflex: 0x0175, - wdieresis: 0x1E85, - wdotaccent: 0x1E87, - wdotbelow: 0x1E89, - wehiragana: 0x3091, - weierstrass: 0x2118, - wekatakana: 0x30F1, - wekorean: 0x315E, - weokorean: 0x315D, - wgrave: 0x1E81, - whitebullet: 0x25E6, - whitecircle: 0x25CB, - whitecircleinverse: 0x25D9, - whitecornerbracketleft: 0x300E, - whitecornerbracketleftvertical: 0xFE43, - whitecornerbracketright: 0x300F, - whitecornerbracketrightvertical: 0xFE44, - whitediamond: 0x25C7, - whitediamondcontainingblacksmalldiamond: 0x25C8, - whitedownpointingsmalltriangle: 0x25BF, - whitedownpointingtriangle: 0x25BD, - whiteleftpointingsmalltriangle: 0x25C3, - whiteleftpointingtriangle: 0x25C1, - whitelenticularbracketleft: 0x3016, - whitelenticularbracketright: 0x3017, - whiterightpointingsmalltriangle: 0x25B9, - whiterightpointingtriangle: 0x25B7, - whitesmallsquare: 0x25AB, - whitesmilingface: 0x263A, - whitesquare: 0x25A1, - whitestar: 0x2606, - whitetelephone: 0x260F, - whitetortoiseshellbracketleft: 0x3018, - whitetortoiseshellbracketright: 0x3019, - whiteuppointingsmalltriangle: 0x25B5, - whiteuppointingtriangle: 0x25B3, - wihiragana: 0x3090, - wikatakana: 0x30F0, - wikorean: 0x315F, - wmonospace: 0xFF57, - wohiragana: 0x3092, - wokatakana: 0x30F2, - wokatakanahalfwidth: 0xFF66, - won: 0x20A9, - wonmonospace: 0xFFE6, - wowaenthai: 0x0E27, - wparen: 0x24B2, - wring: 0x1E98, - wsuperior: 0x02B7, - wturned: 0x028D, - wynn: 0x01BF, - x: 0x0078, - xabovecmb: 0x033D, - xbopomofo: 0x3112, - xcircle: 0x24E7, - xdieresis: 0x1E8D, - xdotaccent: 0x1E8B, - xeharmenian: 0x056D, - xi: 0x03BE, - xmonospace: 0xFF58, - xparen: 0x24B3, - xsuperior: 0x02E3, - y: 0x0079, - yaadosquare: 0x334E, - yabengali: 0x09AF, - yacute: 0x00FD, - yadeva: 0x092F, - yaekorean: 0x3152, - yagujarati: 0x0AAF, - yagurmukhi: 0x0A2F, - yahiragana: 0x3084, - yakatakana: 0x30E4, - yakatakanahalfwidth: 0xFF94, - yakorean: 0x3151, - yamakkanthai: 0x0E4E, - yasmallhiragana: 0x3083, - yasmallkatakana: 0x30E3, - yasmallkatakanahalfwidth: 0xFF6C, - yatcyrillic: 0x0463, - ycircle: 0x24E8, - ycircumflex: 0x0177, - ydieresis: 0x00FF, - ydotaccent: 0x1E8F, - ydotbelow: 0x1EF5, - yeharabic: 0x064A, - yehbarreearabic: 0x06D2, - yehbarreefinalarabic: 0xFBAF, - yehfinalarabic: 0xFEF2, - yehhamzaabovearabic: 0x0626, - yehhamzaabovefinalarabic: 0xFE8A, - yehhamzaaboveinitialarabic: 0xFE8B, - yehhamzaabovemedialarabic: 0xFE8C, - yehinitialarabic: 0xFEF3, - yehmedialarabic: 0xFEF4, - yehmeeminitialarabic: 0xFCDD, - yehmeemisolatedarabic: 0xFC58, - yehnoonfinalarabic: 0xFC94, - yehthreedotsbelowarabic: 0x06D1, - yekorean: 0x3156, - yen: 0x00A5, - yenmonospace: 0xFFE5, - yeokorean: 0x3155, - yeorinhieuhkorean: 0x3186, - yerahbenyomohebrew: 0x05AA, - yerahbenyomolefthebrew: 0x05AA, - yericyrillic: 0x044B, - yerudieresiscyrillic: 0x04F9, - yesieungkorean: 0x3181, - yesieungpansioskorean: 0x3183, - yesieungsioskorean: 0x3182, - yetivhebrew: 0x059A, - ygrave: 0x1EF3, - yhook: 0x01B4, - yhookabove: 0x1EF7, - yiarmenian: 0x0575, - yicyrillic: 0x0457, - yikorean: 0x3162, - yinyang: 0x262F, - yiwnarmenian: 0x0582, - ymonospace: 0xFF59, - yod: 0x05D9, - yoddagesh: 0xFB39, - yoddageshhebrew: 0xFB39, - yodhebrew: 0x05D9, - yodyodhebrew: 0x05F2, - yodyodpatahhebrew: 0xFB1F, - yohiragana: 0x3088, - yoikorean: 0x3189, - yokatakana: 0x30E8, - yokatakanahalfwidth: 0xFF96, - yokorean: 0x315B, - yosmallhiragana: 0x3087, - yosmallkatakana: 0x30E7, - yosmallkatakanahalfwidth: 0xFF6E, - yotgreek: 0x03F3, - yoyaekorean: 0x3188, - yoyakorean: 0x3187, - yoyakthai: 0x0E22, - yoyingthai: 0x0E0D, - yparen: 0x24B4, - ypogegrammeni: 0x037A, - ypogegrammenigreekcmb: 0x0345, - yr: 0x01A6, - yring: 0x1E99, - ysuperior: 0x02B8, - ytilde: 0x1EF9, - yturned: 0x028E, - yuhiragana: 0x3086, - yuikorean: 0x318C, - yukatakana: 0x30E6, - yukatakanahalfwidth: 0xFF95, - yukorean: 0x3160, - yusbigcyrillic: 0x046B, - yusbigiotifiedcyrillic: 0x046D, - yuslittlecyrillic: 0x0467, - yuslittleiotifiedcyrillic: 0x0469, - yusmallhiragana: 0x3085, - yusmallkatakana: 0x30E5, - yusmallkatakanahalfwidth: 0xFF6D, - yuyekorean: 0x318B, - yuyeokorean: 0x318A, - yyabengali: 0x09DF, - yyadeva: 0x095F, - z: 0x007A, - zaarmenian: 0x0566, - zacute: 0x017A, - zadeva: 0x095B, - zagurmukhi: 0x0A5B, - zaharabic: 0x0638, - zahfinalarabic: 0xFEC6, - zahinitialarabic: 0xFEC7, - zahiragana: 0x3056, - zahmedialarabic: 0xFEC8, - zainarabic: 0x0632, - zainfinalarabic: 0xFEB0, - zakatakana: 0x30B6, - zaqefgadolhebrew: 0x0595, - zaqefqatanhebrew: 0x0594, - zarqahebrew: 0x0598, - zayin: 0x05D6, - zayindagesh: 0xFB36, - zayindageshhebrew: 0xFB36, - zayinhebrew: 0x05D6, - zbopomofo: 0x3117, - zcaron: 0x017E, - zcircle: 0x24E9, - zcircumflex: 0x1E91, - zcurl: 0x0291, - zdot: 0x017C, - zdotaccent: 0x017C, - zdotbelow: 0x1E93, - zecyrillic: 0x0437, - zedescendercyrillic: 0x0499, - zedieresiscyrillic: 0x04DF, - zehiragana: 0x305C, - zekatakana: 0x30BC, - zero: 0x0030, - zeroarabic: 0x0660, - zerobengali: 0x09E6, - zerodeva: 0x0966, - zerogujarati: 0x0AE6, - zerogurmukhi: 0x0A66, - zerohackarabic: 0x0660, - zeroinferior: 0x2080, - zeromonospace: 0xFF10, - zerooldstyle: 0xF730, - zeropersian: 0x06F0, - zerosuperior: 0x2070, - zerothai: 0x0E50, - zerowidthjoiner: 0xFEFF, - zerowidthnonjoiner: 0x200C, - zerowidthspace: 0x200B, - zeta: 0x03B6, - zhbopomofo: 0x3113, - zhearmenian: 0x056A, - zhebrevecyrillic: 0x04C2, - zhecyrillic: 0x0436, - zhedescendercyrillic: 0x0497, - zhedieresiscyrillic: 0x04DD, - zihiragana: 0x3058, - zikatakana: 0x30B8, - zinorhebrew: 0x05AE, - zlinebelow: 0x1E95, - zmonospace: 0xFF5A, - zohiragana: 0x305E, - zokatakana: 0x30BE, - zparen: 0x24B5, - zretroflexhook: 0x0290, - zstroke: 0x01B6, - zuhiragana: 0x305A, - zukatakana: 0x30BA, - '.notdef': 0x0000 -}; - -var DingbatsGlyphsUnicode = { - space: 0x0020, - a1: 0x2701, - a2: 0x2702, - a202: 0x2703, - a3: 0x2704, - a4: 0x260E, - a5: 0x2706, - a119: 0x2707, - a118: 0x2708, - a117: 0x2709, - a11: 0x261B, - a12: 0x261E, - a13: 0x270C, - a14: 0x270D, - a15: 0x270E, - a16: 0x270F, - a105: 0x2710, - a17: 0x2711, - a18: 0x2712, - a19: 0x2713, - a20: 0x2714, - a21: 0x2715, - a22: 0x2716, - a23: 0x2717, - a24: 0x2718, - a25: 0x2719, - a26: 0x271A, - a27: 0x271B, - a28: 0x271C, - a6: 0x271D, - a7: 0x271E, - a8: 0x271F, - a9: 0x2720, - a10: 0x2721, - a29: 0x2722, - a30: 0x2723, - a31: 0x2724, - a32: 0x2725, - a33: 0x2726, - a34: 0x2727, - a35: 0x2605, - a36: 0x2729, - a37: 0x272A, - a38: 0x272B, - a39: 0x272C, - a40: 0x272D, - a41: 0x272E, - a42: 0x272F, - a43: 0x2730, - a44: 0x2731, - a45: 0x2732, - a46: 0x2733, - a47: 0x2734, - a48: 0x2735, - a49: 0x2736, - a50: 0x2737, - a51: 0x2738, - a52: 0x2739, - a53: 0x273A, - a54: 0x273B, - a55: 0x273C, - a56: 0x273D, - a57: 0x273E, - a58: 0x273F, - a59: 0x2740, - a60: 0x2741, - a61: 0x2742, - a62: 0x2743, - a63: 0x2744, - a64: 0x2745, - a65: 0x2746, - a66: 0x2747, - a67: 0x2748, - a68: 0x2749, - a69: 0x274A, - a70: 0x274B, - a71: 0x25CF, - a72: 0x274D, - a73: 0x25A0, - a74: 0x274F, - a203: 0x2750, - a75: 0x2751, - a204: 0x2752, - a76: 0x25B2, - a77: 0x25BC, - a78: 0x25C6, - a79: 0x2756, - a81: 0x25D7, - a82: 0x2758, - a83: 0x2759, - a84: 0x275A, - a97: 0x275B, - a98: 0x275C, - a99: 0x275D, - a100: 0x275E, - a101: 0x2761, - a102: 0x2762, - a103: 0x2763, - a104: 0x2764, - a106: 0x2765, - a107: 0x2766, - a108: 0x2767, - a112: 0x2663, - a111: 0x2666, - a110: 0x2665, - a109: 0x2660, - a120: 0x2460, - a121: 0x2461, - a122: 0x2462, - a123: 0x2463, - a124: 0x2464, - a125: 0x2465, - a126: 0x2466, - a127: 0x2467, - a128: 0x2468, - a129: 0x2469, - a130: 0x2776, - a131: 0x2777, - a132: 0x2778, - a133: 0x2779, - a134: 0x277A, - a135: 0x277B, - a136: 0x277C, - a137: 0x277D, - a138: 0x277E, - a139: 0x277F, - a140: 0x2780, - a141: 0x2781, - a142: 0x2782, - a143: 0x2783, - a144: 0x2784, - a145: 0x2785, - a146: 0x2786, - a147: 0x2787, - a148: 0x2788, - a149: 0x2789, - a150: 0x278A, - a151: 0x278B, - a152: 0x278C, - a153: 0x278D, - a154: 0x278E, - a155: 0x278F, - a156: 0x2790, - a157: 0x2791, - a158: 0x2792, - a159: 0x2793, - a160: 0x2794, - a161: 0x2192, - a163: 0x2194, - a164: 0x2195, - a196: 0x2798, - a165: 0x2799, - a192: 0x279A, - a166: 0x279B, - a167: 0x279C, - a168: 0x279D, - a169: 0x279E, - a170: 0x279F, - a171: 0x27A0, - a172: 0x27A1, - a173: 0x27A2, - a162: 0x27A3, - a174: 0x27A4, - a175: 0x27A5, - a176: 0x27A6, - a177: 0x27A7, - a178: 0x27A8, - a179: 0x27A9, - a193: 0x27AA, - a180: 0x27AB, - a199: 0x27AC, - a181: 0x27AD, - a200: 0x27AE, - a182: 0x27AF, - a201: 0x27B1, - a183: 0x27B2, - a184: 0x27B3, - a197: 0x27B4, - a185: 0x27B5, - a194: 0x27B6, - a198: 0x27B7, - a186: 0x27B8, - a195: 0x27B9, - a187: 0x27BA, - a188: 0x27BB, - a189: 0x27BC, - a190: 0x27BD, - a191: 0x27BE, - a89: 0x2768, // 0xF8D7 - a90: 0x2769, // 0xF8D8 - a93: 0x276A, // 0xF8D9 - a94: 0x276B, // 0xF8DA - a91: 0x276C, // 0xF8DB - a92: 0x276D, // 0xF8DC - a205: 0x276E, // 0xF8DD - a85: 0x276F, // 0xF8DE - a206: 0x2770, // 0xF8DF - a86: 0x2771, // 0xF8E0 - a87: 0x2772, // 0xF8E1 - a88: 0x2773, // 0xF8E2 - a95: 0x2774, // 0xF8E3 - a96: 0x2775, // 0xF8E4 - '.notdef': 0x0000 -}; - - -var PDFImage = (function PDFImageClosure() { - /** - * Decode the image in the main thread if it supported. Resovles the promise - * when the image data is ready. - */ - function handleImageData(handler, xref, res, image) { - if (image instanceof JpegStream && image.isNativelyDecodable(xref, res)) { - // For natively supported jpegs send them to the main thread for decoding. - var dict = image.dict; - var colorSpace = dict.get('ColorSpace', 'CS'); - colorSpace = ColorSpace.parse(colorSpace, xref, res); - var numComps = colorSpace.numComps; - var decodePromise = handler.sendWithPromise('JpegDecode', - [image.getIR(), numComps]); - return decodePromise.then(function (message) { - var data = message.data; - return new Stream(data, 0, data.length, image.dict); - }); - } else { - return Promise.resolve(image); - } - } - - /** - * Decode and clamp a value. The formula is different from the spec because we - * don't decode to float range [0,1], we decode it in the [0,max] range. - */ - function decodeAndClamp(value, addend, coefficient, max) { - value = addend + value * coefficient; - // Clamp the value to the range - return (value < 0 ? 0 : (value > max ? max : value)); - } - - function PDFImage(xref, res, image, inline, smask, mask, isMask) { - this.image = image; - var dict = image.dict; - if (dict.has('Filter')) { - var filter = dict.get('Filter').name; - if (filter === 'JPXDecode') { - var jpxImage = new JpxImage(); - jpxImage.parseImageProperties(image.stream); - image.stream.reset(); - image.bitsPerComponent = jpxImage.bitsPerComponent; - image.numComps = jpxImage.componentsCount; - } else if (filter === 'JBIG2Decode') { - image.bitsPerComponent = 1; - image.numComps = 1; - } - } - // TODO cache rendered images? - - this.width = dict.get('Width', 'W'); - this.height = dict.get('Height', 'H'); - - if (this.width < 1 || this.height < 1) { - error('Invalid image width: ' + this.width + ' or height: ' + - this.height); - } - - this.interpolate = dict.get('Interpolate', 'I') || false; - this.imageMask = dict.get('ImageMask', 'IM') || false; - this.matte = dict.get('Matte') || false; - - var bitsPerComponent = image.bitsPerComponent; - if (!bitsPerComponent) { - bitsPerComponent = dict.get('BitsPerComponent', 'BPC'); - if (!bitsPerComponent) { - if (this.imageMask) { - bitsPerComponent = 1; - } else { - error('Bits per component missing in image: ' + this.imageMask); - } - } - } - this.bpc = bitsPerComponent; - - if (!this.imageMask) { - var colorSpace = dict.get('ColorSpace', 'CS'); - if (!colorSpace) { - info('JPX images (which do not require color spaces)'); - switch (image.numComps) { - case 1: - colorSpace = Name.get('DeviceGray'); - break; - case 3: - colorSpace = Name.get('DeviceRGB'); - break; - case 4: - colorSpace = Name.get('DeviceCMYK'); - break; - default: - error('JPX images with ' + this.numComps + - ' color components not supported.'); - } - } - this.colorSpace = ColorSpace.parse(colorSpace, xref, res); - this.numComps = this.colorSpace.numComps; - } - - this.decode = dict.get('Decode', 'D'); - this.needsDecode = false; - if (this.decode && - ((this.colorSpace && !this.colorSpace.isDefaultDecode(this.decode)) || - (isMask && !ColorSpace.isDefaultDecode(this.decode, 1)))) { - this.needsDecode = true; - // Do some preprocessing to avoid more math. - var max = (1 << bitsPerComponent) - 1; - this.decodeCoefficients = []; - this.decodeAddends = []; - for (var i = 0, j = 0; i < this.decode.length; i += 2, ++j) { - var dmin = this.decode[i]; - var dmax = this.decode[i + 1]; - this.decodeCoefficients[j] = dmax - dmin; - this.decodeAddends[j] = max * dmin; - } - } - - if (smask) { - this.smask = new PDFImage(xref, res, smask, false); - } else if (mask) { - if (isStream(mask)) { - var maskDict = mask.dict, imageMask = maskDict.get('ImageMask', 'IM'); - if (!imageMask) { - warn('Ignoring /Mask in image without /ImageMask.'); - } else { - this.mask = new PDFImage(xref, res, mask, false, null, null, true); - } - } else { - // Color key mask (just an array). - this.mask = mask; - } - } - } - /** - * Handles processing of image data and returns the Promise that is resolved - * with a PDFImage when the image is ready to be used. - */ - PDFImage.buildImage = function PDFImage_buildImage(handler, xref, - res, image, inline) { - var imagePromise = handleImageData(handler, xref, res, image); - var smaskPromise; - var maskPromise; - - var smask = image.dict.get('SMask'); - var mask = image.dict.get('Mask'); - - if (smask) { - smaskPromise = handleImageData(handler, xref, res, smask); - maskPromise = Promise.resolve(null); - } else { - smaskPromise = Promise.resolve(null); - if (mask) { - if (isStream(mask)) { - maskPromise = handleImageData(handler, xref, res, mask); - } else if (isArray(mask)) { - maskPromise = Promise.resolve(mask); - } else { - warn('Unsupported mask format.'); - maskPromise = Promise.resolve(null); - } - } else { - maskPromise = Promise.resolve(null); - } - } - return Promise.all([imagePromise, smaskPromise, maskPromise]).then( - function(results) { - var imageData = results[0]; - var smaskData = results[1]; - var maskData = results[2]; - return new PDFImage(xref, res, imageData, inline, smaskData, maskData); - }); - }; - - /** - * Resize an image using the nearest neighbor algorithm. Currently only - * supports one and three component images. - * @param {TypedArray} pixels The original image with one component. - * @param {Number} bpc Number of bits per component. - * @param {Number} components Number of color components, 1 or 3 is supported. - * @param {Number} w1 Original width. - * @param {Number} h1 Original height. - * @param {Number} w2 New width. - * @param {Number} h2 New height. - * @param {TypedArray} dest (Optional) The destination buffer. - * @param {Number} alpha01 (Optional) Size reserved for the alpha channel. - * @return {TypedArray} Resized image data. - */ - PDFImage.resize = function PDFImage_resize(pixels, bpc, components, - w1, h1, w2, h2, dest, alpha01) { - - if (components !== 1 && components !== 3) { - error('Unsupported component count for resizing.'); - } - - var length = w2 * h2 * components; - var temp = dest ? dest : (bpc <= 8 ? new Uint8Array(length) : - (bpc <= 16 ? new Uint16Array(length) : new Uint32Array(length))); - var xRatio = w1 / w2; - var yRatio = h1 / h2; - var i, j, py, newIndex = 0, oldIndex; - var xScaled = new Uint16Array(w2); - var w1Scanline = w1 * components; - if (alpha01 !== 1) { - alpha01 = 0; - } - - for (j = 0; j < w2; j++) { - xScaled[j] = Math.floor(j * xRatio) * components; - } - - if (components === 1) { - for (i = 0; i < h2; i++) { - py = Math.floor(i * yRatio) * w1Scanline; - for (j = 0; j < w2; j++) { - oldIndex = py + xScaled[j]; - temp[newIndex++] = pixels[oldIndex]; - } - } - } else if (components === 3) { - for (i = 0; i < h2; i++) { - py = Math.floor(i * yRatio) * w1Scanline; - for (j = 0; j < w2; j++) { - oldIndex = py + xScaled[j]; - temp[newIndex++] = pixels[oldIndex++]; - temp[newIndex++] = pixels[oldIndex++]; - temp[newIndex++] = pixels[oldIndex++]; - newIndex += alpha01; - } - } - } - return temp; - }; - - PDFImage.createMask = - function PDFImage_createMask(imgArray, width, height, - imageIsFromDecodeStream, inverseDecode) { - - // |imgArray| might not contain full data for every pixel of the mask, so - // we need to distinguish between |computedLength| and |actualLength|. - // In particular, if inverseDecode is true, then the array we return must - // have a length of |computedLength|. - - var computedLength = ((width + 7) >> 3) * height; - var actualLength = imgArray.byteLength; - var haveFullData = computedLength === actualLength; - var data, i; - - if (imageIsFromDecodeStream && (!inverseDecode || haveFullData)) { - // imgArray came from a DecodeStream and its data is in an appropriate - // form, so we can just transfer it. - data = imgArray; - } else if (!inverseDecode) { - data = new Uint8Array(actualLength); - data.set(imgArray); - } else { - data = new Uint8Array(computedLength); - data.set(imgArray); - for (i = actualLength; i < computedLength; i++) { - data[i] = 0xff; - } - } - - // If necessary, invert the original mask data (but not any extra we might - // have added above). It's safe to modify the array -- whether it's the - // original or a copy, we're about to transfer it anyway, so nothing else - // in this thread can be relying on its contents. - if (inverseDecode) { - for (i = 0; i < actualLength; i++) { - data[i] = ~data[i]; - } - } - - return {data: data, width: width, height: height}; - }; - - PDFImage.prototype = { - get drawWidth() { - return Math.max(this.width, - this.smask && this.smask.width || 0, - this.mask && this.mask.width || 0); - }, - - get drawHeight() { - return Math.max(this.height, - this.smask && this.smask.height || 0, - this.mask && this.mask.height || 0); - }, - - decodeBuffer: function PDFImage_decodeBuffer(buffer) { - var bpc = this.bpc; - var numComps = this.numComps; - - var decodeAddends = this.decodeAddends; - var decodeCoefficients = this.decodeCoefficients; - var max = (1 << bpc) - 1; - var i, ii; - - if (bpc === 1) { - // If the buffer needed decode that means it just needs to be inverted. - for (i = 0, ii = buffer.length; i < ii; i++) { - buffer[i] = +!(buffer[i]); - } - return; - } - var index = 0; - for (i = 0, ii = this.width * this.height; i < ii; i++) { - for (var j = 0; j < numComps; j++) { - buffer[index] = decodeAndClamp(buffer[index], decodeAddends[j], - decodeCoefficients[j], max); - index++; - } - } - }, - - getComponents: function PDFImage_getComponents(buffer) { - var bpc = this.bpc; - - // This image doesn't require any extra work. - if (bpc === 8) { - return buffer; - } - - var width = this.width; - var height = this.height; - var numComps = this.numComps; - - var length = width * height * numComps; - var bufferPos = 0; - var output = (bpc <= 8 ? new Uint8Array(length) : - (bpc <= 16 ? new Uint16Array(length) : new Uint32Array(length))); - var rowComps = width * numComps; - - var max = (1 << bpc) - 1; - var i = 0, ii, buf; - - if (bpc === 1) { - // Optimization for reading 1 bpc images. - var mask, loop1End, loop2End; - for (var j = 0; j < height; j++) { - loop1End = i + (rowComps & ~7); - loop2End = i + rowComps; - - // unroll loop for all full bytes - while (i < loop1End) { - buf = buffer[bufferPos++]; - output[i] = (buf >> 7) & 1; - output[i + 1] = (buf >> 6) & 1; - output[i + 2] = (buf >> 5) & 1; - output[i + 3] = (buf >> 4) & 1; - output[i + 4] = (buf >> 3) & 1; - output[i + 5] = (buf >> 2) & 1; - output[i + 6] = (buf >> 1) & 1; - output[i + 7] = buf & 1; - i += 8; - } - - // handle remaing bits - if (i < loop2End) { - buf = buffer[bufferPos++]; - mask = 128; - while (i < loop2End) { - output[i++] = +!!(buf & mask); - mask >>= 1; - } - } - } - } else { - // The general case that handles all other bpc values. - var bits = 0; - buf = 0; - for (i = 0, ii = length; i < ii; ++i) { - if (i % rowComps === 0) { - buf = 0; - bits = 0; - } - - while (bits < bpc) { - buf = (buf << 8) | buffer[bufferPos++]; - bits += 8; - } - - var remainingBits = bits - bpc; - var value = buf >> remainingBits; - output[i] = (value < 0 ? 0 : (value > max ? max : value)); - buf = buf & ((1 << remainingBits) - 1); - bits = remainingBits; - } - } - return output; - }, - - fillOpacity: function PDFImage_fillOpacity(rgbaBuf, width, height, - actualHeight, image) { - var smask = this.smask; - var mask = this.mask; - var alphaBuf, sw, sh, i, ii, j; - - if (smask) { - sw = smask.width; - sh = smask.height; - alphaBuf = new Uint8Array(sw * sh); - smask.fillGrayBuffer(alphaBuf); - if (sw !== width || sh !== height) { - alphaBuf = PDFImage.resize(alphaBuf, smask.bpc, 1, sw, sh, width, - height); - } - } else if (mask) { - if (mask instanceof PDFImage) { - sw = mask.width; - sh = mask.height; - alphaBuf = new Uint8Array(sw * sh); - mask.numComps = 1; - mask.fillGrayBuffer(alphaBuf); - - // Need to invert values in rgbaBuf - for (i = 0, ii = sw * sh; i < ii; ++i) { - alphaBuf[i] = 255 - alphaBuf[i]; - } - - if (sw !== width || sh !== height) { - alphaBuf = PDFImage.resize(alphaBuf, mask.bpc, 1, sw, sh, width, - height); - } - } else if (isArray(mask)) { - // Color key mask: if any of the compontents are outside the range - // then they should be painted. - alphaBuf = new Uint8Array(width * height); - var numComps = this.numComps; - for (i = 0, ii = width * height; i < ii; ++i) { - var opacity = 0; - var imageOffset = i * numComps; - for (j = 0; j < numComps; ++j) { - var color = image[imageOffset + j]; - var maskOffset = j * 2; - if (color < mask[maskOffset] || color > mask[maskOffset + 1]) { - opacity = 255; - break; - } - } - alphaBuf[i] = opacity; - } - } else { - error('Unknown mask format.'); - } - } - - if (alphaBuf) { - for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { - rgbaBuf[j] = alphaBuf[i]; - } - } else { - // No mask. - for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { - rgbaBuf[j] = 255; - } - } - }, - - undoPreblend: function PDFImage_undoPreblend(buffer, width, height) { - var matte = this.smask && this.smask.matte; - if (!matte) { - return; - } - var matteRgb = this.colorSpace.getRgb(matte, 0); - var matteR = matteRgb[0]; - var matteG = matteRgb[1]; - var matteB = matteRgb[2]; - var length = width * height * 4; - var r, g, b; - for (var i = 0; i < length; i += 4) { - var alpha = buffer[i + 3]; - if (alpha === 0) { - // according formula we have to get Infinity in all components - // making it white (typical paper color) should be okay - buffer[i] = 255; - buffer[i + 1] = 255; - buffer[i + 2] = 255; - continue; - } - var k = 255 / alpha; - r = (buffer[i] - matteR) * k + matteR; - g = (buffer[i + 1] - matteG) * k + matteG; - b = (buffer[i + 2] - matteB) * k + matteB; - buffer[i] = r <= 0 ? 0 : r >= 255 ? 255 : r | 0; - buffer[i + 1] = g <= 0 ? 0 : g >= 255 ? 255 : g | 0; - buffer[i + 2] = b <= 0 ? 0 : b >= 255 ? 255 : b | 0; - } - }, - - createImageData: function PDFImage_createImageData(forceRGBA) { - var drawWidth = this.drawWidth; - var drawHeight = this.drawHeight; - var imgData = { // other fields are filled in below - width: drawWidth, - height: drawHeight - }; - - var numComps = this.numComps; - var originalWidth = this.width; - var originalHeight = this.height; - var bpc = this.bpc; - - // Rows start at byte boundary. - var rowBytes = (originalWidth * numComps * bpc + 7) >> 3; - var imgArray; - - if (!forceRGBA) { - // If it is a 1-bit-per-pixel grayscale (i.e. black-and-white) image - // without any complications, we pass a same-sized copy to the main - // thread rather than expanding by 32x to RGBA form. This saves *lots* - // of memory for many scanned documents. It's also much faster. - // - // Similarly, if it is a 24-bit-per pixel RGB image without any - // complications, we avoid expanding by 1.333x to RGBA form. - var kind; - if (this.colorSpace.name === 'DeviceGray' && bpc === 1) { - kind = ImageKind.GRAYSCALE_1BPP; - } else if (this.colorSpace.name === 'DeviceRGB' && bpc === 8 && - !this.needsDecode) { - kind = ImageKind.RGB_24BPP; - } - if (kind && !this.smask && !this.mask && - drawWidth === originalWidth && drawHeight === originalHeight) { - imgData.kind = kind; - - imgArray = this.getImageBytes(originalHeight * rowBytes); - // If imgArray came from a DecodeStream, we're safe to transfer it - // (and thus neuter it) because it will constitute the entire - // DecodeStream's data. But if it came from a Stream, we need to - // copy it because it'll only be a portion of the Stream's data, and - // the rest will be read later on. - if (this.image instanceof DecodeStream) { - imgData.data = imgArray; - } else { - var newArray = new Uint8Array(imgArray.length); - newArray.set(imgArray); - imgData.data = newArray; - } - if (this.needsDecode) { - // Invert the buffer (which must be grayscale if we reached here). - assert(kind === ImageKind.GRAYSCALE_1BPP); - var buffer = imgData.data; - for (var i = 0, ii = buffer.length; i < ii; i++) { - buffer[i] ^= 0xff; - } - } - return imgData; - } - if (this.image instanceof JpegStream && !this.smask && !this.mask && - (this.colorSpace.name === 'DeviceGray' || - this.colorSpace.name === 'DeviceRGB' || - this.colorSpace.name === 'DeviceCMYK')) { - imgData.kind = ImageKind.RGB_24BPP; - imgData.data = this.getImageBytes(originalHeight * rowBytes, - drawWidth, drawHeight, true); - return imgData; - } - } - - imgArray = this.getImageBytes(originalHeight * rowBytes); - // imgArray can be incomplete (e.g. after CCITT fax encoding). - var actualHeight = 0 | (imgArray.length / rowBytes * - drawHeight / originalHeight); - - var comps = this.getComponents(imgArray); - - // If opacity data is present, use RGBA_32BPP form. Otherwise, use the - // more compact RGB_24BPP form if allowable. - var alpha01, maybeUndoPreblend; - if (!forceRGBA && !this.smask && !this.mask) { - imgData.kind = ImageKind.RGB_24BPP; - imgData.data = new Uint8Array(drawWidth * drawHeight * 3); - alpha01 = 0; - maybeUndoPreblend = false; - } else { - imgData.kind = ImageKind.RGBA_32BPP; - imgData.data = new Uint8Array(drawWidth * drawHeight * 4); - alpha01 = 1; - maybeUndoPreblend = true; - - // Color key masking (opacity) must be performed before decoding. - this.fillOpacity(imgData.data, drawWidth, drawHeight, actualHeight, - comps); - } - - if (this.needsDecode) { - this.decodeBuffer(comps); - } - this.colorSpace.fillRgb(imgData.data, originalWidth, originalHeight, - drawWidth, drawHeight, actualHeight, bpc, comps, - alpha01); - if (maybeUndoPreblend) { - this.undoPreblend(imgData.data, drawWidth, actualHeight); - } - - return imgData; - }, - - fillGrayBuffer: function PDFImage_fillGrayBuffer(buffer) { - var numComps = this.numComps; - if (numComps !== 1) { - error('Reading gray scale from a color image: ' + numComps); - } - - var width = this.width; - var height = this.height; - var bpc = this.bpc; - - // rows start at byte boundary - var rowBytes = (width * numComps * bpc + 7) >> 3; - var imgArray = this.getImageBytes(height * rowBytes); - - var comps = this.getComponents(imgArray); - var i, length; - - if (bpc === 1) { - // inline decoding (= inversion) for 1 bpc images - length = width * height; - if (this.needsDecode) { - // invert and scale to {0, 255} - for (i = 0; i < length; ++i) { - buffer[i] = (comps[i] - 1) & 255; - } - } else { - // scale to {0, 255} - for (i = 0; i < length; ++i) { - buffer[i] = (-comps[i]) & 255; - } - } - return; - } - - if (this.needsDecode) { - this.decodeBuffer(comps); - } - length = width * height; - // we aren't using a colorspace so we need to scale the value - var scale = 255 / ((1 << bpc) - 1); - for (i = 0; i < length; ++i) { - buffer[i] = (scale * comps[i]) | 0; - } - }, - - getImageBytes: function PDFImage_getImageBytes(length, - drawWidth, drawHeight, - forceRGB) { - this.image.reset(); - this.image.drawWidth = drawWidth || this.width; - this.image.drawHeight = drawHeight || this.height; - this.image.forceRGB = !!forceRGB; - return this.image.getBytes(length); - } - }; - return PDFImage; -})(); - - -// The Metrics object contains glyph widths (in glyph space units). -// As per PDF spec, for most fonts (Type 3 being an exception) a glyph -// space unit corresponds to 1/1000th of text space unit. -var Metrics = { - 'Courier': 600, - 'Courier-Bold': 600, - 'Courier-BoldOblique': 600, - 'Courier-Oblique': 600, - 'Helvetica' : { - 'space': 278, - 'exclam': 278, - 'quotedbl': 355, - 'numbersign': 556, - 'dollar': 556, - 'percent': 889, - 'ampersand': 667, - 'quoteright': 222, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 389, - 'plus': 584, - 'comma': 278, - 'hyphen': 333, - 'period': 278, - 'slash': 278, - 'zero': 556, - 'one': 556, - 'two': 556, - 'three': 556, - 'four': 556, - 'five': 556, - 'six': 556, - 'seven': 556, - 'eight': 556, - 'nine': 556, - 'colon': 278, - 'semicolon': 278, - 'less': 584, - 'equal': 584, - 'greater': 584, - 'question': 556, - 'at': 1015, - 'A': 667, - 'B': 667, - 'C': 722, - 'D': 722, - 'E': 667, - 'F': 611, - 'G': 778, - 'H': 722, - 'I': 278, - 'J': 500, - 'K': 667, - 'L': 556, - 'M': 833, - 'N': 722, - 'O': 778, - 'P': 667, - 'Q': 778, - 'R': 722, - 'S': 667, - 'T': 611, - 'U': 722, - 'V': 667, - 'W': 944, - 'X': 667, - 'Y': 667, - 'Z': 611, - 'bracketleft': 278, - 'backslash': 278, - 'bracketright': 278, - 'asciicircum': 469, - 'underscore': 556, - 'quoteleft': 222, - 'a': 556, - 'b': 556, - 'c': 500, - 'd': 556, - 'e': 556, - 'f': 278, - 'g': 556, - 'h': 556, - 'i': 222, - 'j': 222, - 'k': 500, - 'l': 222, - 'm': 833, - 'n': 556, - 'o': 556, - 'p': 556, - 'q': 556, - 'r': 333, - 's': 500, - 't': 278, - 'u': 556, - 'v': 500, - 'w': 722, - 'x': 500, - 'y': 500, - 'z': 500, - 'braceleft': 334, - 'bar': 260, - 'braceright': 334, - 'asciitilde': 584, - 'exclamdown': 333, - 'cent': 556, - 'sterling': 556, - 'fraction': 167, - 'yen': 556, - 'florin': 556, - 'section': 556, - 'currency': 556, - 'quotesingle': 191, - 'quotedblleft': 333, - 'guillemotleft': 556, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 500, - 'fl': 500, - 'endash': 556, - 'dagger': 556, - 'daggerdbl': 556, - 'periodcentered': 278, - 'paragraph': 537, - 'bullet': 350, - 'quotesinglbase': 222, - 'quotedblbase': 333, - 'quotedblright': 333, - 'guillemotright': 556, - 'ellipsis': 1000, - 'perthousand': 1000, - 'questiondown': 611, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 1000, - 'AE': 1000, - 'ordfeminine': 370, - 'Lslash': 556, - 'Oslash': 778, - 'OE': 1000, - 'ordmasculine': 365, - 'ae': 889, - 'dotlessi': 278, - 'lslash': 222, - 'oslash': 611, - 'oe': 944, - 'germandbls': 611, - 'Idieresis': 278, - 'eacute': 556, - 'abreve': 556, - 'uhungarumlaut': 556, - 'ecaron': 556, - 'Ydieresis': 667, - 'divide': 584, - 'Yacute': 667, - 'Acircumflex': 667, - 'aacute': 556, - 'Ucircumflex': 722, - 'yacute': 500, - 'scommaaccent': 500, - 'ecircumflex': 556, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 556, - 'Uacute': 722, - 'uogonek': 556, - 'Edieresis': 667, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 737, - 'Emacron': 667, - 'ccaron': 500, - 'aring': 556, - 'Ncommaaccent': 722, - 'lacute': 222, - 'agrave': 556, - 'Tcommaaccent': 611, - 'Cacute': 722, - 'atilde': 556, - 'Edotaccent': 667, - 'scaron': 500, - 'scedilla': 500, - 'iacute': 278, - 'lozenge': 471, - 'Rcaron': 722, - 'Gcommaaccent': 778, - 'ucircumflex': 556, - 'acircumflex': 556, - 'Amacron': 667, - 'rcaron': 333, - 'ccedilla': 500, - 'Zdotaccent': 611, - 'Thorn': 667, - 'Omacron': 778, - 'Racute': 722, - 'Sacute': 667, - 'dcaron': 643, - 'Umacron': 722, - 'uring': 556, - 'threesuperior': 333, - 'Ograve': 778, - 'Agrave': 667, - 'Abreve': 667, - 'multiply': 584, - 'uacute': 556, - 'Tcaron': 611, - 'partialdiff': 476, - 'ydieresis': 500, - 'Nacute': 722, - 'icircumflex': 278, - 'Ecircumflex': 667, - 'adieresis': 556, - 'edieresis': 556, - 'cacute': 500, - 'nacute': 556, - 'umacron': 556, - 'Ncaron': 722, - 'Iacute': 278, - 'plusminus': 584, - 'brokenbar': 260, - 'registered': 737, - 'Gbreve': 778, - 'Idotaccent': 278, - 'summation': 600, - 'Egrave': 667, - 'racute': 333, - 'omacron': 556, - 'Zacute': 611, - 'Zcaron': 611, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 722, - 'lcommaaccent': 222, - 'tcaron': 317, - 'eogonek': 556, - 'Uogonek': 722, - 'Aacute': 667, - 'Adieresis': 667, - 'egrave': 556, - 'zacute': 500, - 'iogonek': 222, - 'Oacute': 778, - 'oacute': 556, - 'amacron': 556, - 'sacute': 500, - 'idieresis': 278, - 'Ocircumflex': 778, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 556, - 'twosuperior': 333, - 'Odieresis': 778, - 'mu': 556, - 'igrave': 278, - 'ohungarumlaut': 556, - 'Eogonek': 667, - 'dcroat': 556, - 'threequarters': 834, - 'Scedilla': 667, - 'lcaron': 299, - 'Kcommaaccent': 667, - 'Lacute': 556, - 'trademark': 1000, - 'edotaccent': 556, - 'Igrave': 278, - 'Imacron': 278, - 'Lcaron': 556, - 'onehalf': 834, - 'lessequal': 549, - 'ocircumflex': 556, - 'ntilde': 556, - 'Uhungarumlaut': 722, - 'Eacute': 667, - 'emacron': 556, - 'gbreve': 556, - 'onequarter': 834, - 'Scaron': 667, - 'Scommaaccent': 667, - 'Ohungarumlaut': 778, - 'degree': 400, - 'ograve': 556, - 'Ccaron': 722, - 'ugrave': 556, - 'radical': 453, - 'Dcaron': 722, - 'rcommaaccent': 333, - 'Ntilde': 722, - 'otilde': 556, - 'Rcommaaccent': 722, - 'Lcommaaccent': 556, - 'Atilde': 667, - 'Aogonek': 667, - 'Aring': 667, - 'Otilde': 778, - 'zdotaccent': 500, - 'Ecaron': 667, - 'Iogonek': 278, - 'kcommaaccent': 500, - 'minus': 584, - 'Icircumflex': 278, - 'ncaron': 556, - 'tcommaaccent': 278, - 'logicalnot': 584, - 'odieresis': 556, - 'udieresis': 556, - 'notequal': 549, - 'gcommaaccent': 556, - 'eth': 556, - 'zcaron': 500, - 'ncommaaccent': 556, - 'onesuperior': 333, - 'imacron': 278, - 'Euro': 556 - }, - 'Helvetica-Bold': { - 'space': 278, - 'exclam': 333, - 'quotedbl': 474, - 'numbersign': 556, - 'dollar': 556, - 'percent': 889, - 'ampersand': 722, - 'quoteright': 278, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 389, - 'plus': 584, - 'comma': 278, - 'hyphen': 333, - 'period': 278, - 'slash': 278, - 'zero': 556, - 'one': 556, - 'two': 556, - 'three': 556, - 'four': 556, - 'five': 556, - 'six': 556, - 'seven': 556, - 'eight': 556, - 'nine': 556, - 'colon': 333, - 'semicolon': 333, - 'less': 584, - 'equal': 584, - 'greater': 584, - 'question': 611, - 'at': 975, - 'A': 722, - 'B': 722, - 'C': 722, - 'D': 722, - 'E': 667, - 'F': 611, - 'G': 778, - 'H': 722, - 'I': 278, - 'J': 556, - 'K': 722, - 'L': 611, - 'M': 833, - 'N': 722, - 'O': 778, - 'P': 667, - 'Q': 778, - 'R': 722, - 'S': 667, - 'T': 611, - 'U': 722, - 'V': 667, - 'W': 944, - 'X': 667, - 'Y': 667, - 'Z': 611, - 'bracketleft': 333, - 'backslash': 278, - 'bracketright': 333, - 'asciicircum': 584, - 'underscore': 556, - 'quoteleft': 278, - 'a': 556, - 'b': 611, - 'c': 556, - 'd': 611, - 'e': 556, - 'f': 333, - 'g': 611, - 'h': 611, - 'i': 278, - 'j': 278, - 'k': 556, - 'l': 278, - 'm': 889, - 'n': 611, - 'o': 611, - 'p': 611, - 'q': 611, - 'r': 389, - 's': 556, - 't': 333, - 'u': 611, - 'v': 556, - 'w': 778, - 'x': 556, - 'y': 556, - 'z': 500, - 'braceleft': 389, - 'bar': 280, - 'braceright': 389, - 'asciitilde': 584, - 'exclamdown': 333, - 'cent': 556, - 'sterling': 556, - 'fraction': 167, - 'yen': 556, - 'florin': 556, - 'section': 556, - 'currency': 556, - 'quotesingle': 238, - 'quotedblleft': 500, - 'guillemotleft': 556, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 611, - 'fl': 611, - 'endash': 556, - 'dagger': 556, - 'daggerdbl': 556, - 'periodcentered': 278, - 'paragraph': 556, - 'bullet': 350, - 'quotesinglbase': 278, - 'quotedblbase': 500, - 'quotedblright': 500, - 'guillemotright': 556, - 'ellipsis': 1000, - 'perthousand': 1000, - 'questiondown': 611, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 1000, - 'AE': 1000, - 'ordfeminine': 370, - 'Lslash': 611, - 'Oslash': 778, - 'OE': 1000, - 'ordmasculine': 365, - 'ae': 889, - 'dotlessi': 278, - 'lslash': 278, - 'oslash': 611, - 'oe': 944, - 'germandbls': 611, - 'Idieresis': 278, - 'eacute': 556, - 'abreve': 556, - 'uhungarumlaut': 611, - 'ecaron': 556, - 'Ydieresis': 667, - 'divide': 584, - 'Yacute': 667, - 'Acircumflex': 722, - 'aacute': 556, - 'Ucircumflex': 722, - 'yacute': 556, - 'scommaaccent': 556, - 'ecircumflex': 556, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 556, - 'Uacute': 722, - 'uogonek': 611, - 'Edieresis': 667, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 737, - 'Emacron': 667, - 'ccaron': 556, - 'aring': 556, - 'Ncommaaccent': 722, - 'lacute': 278, - 'agrave': 556, - 'Tcommaaccent': 611, - 'Cacute': 722, - 'atilde': 556, - 'Edotaccent': 667, - 'scaron': 556, - 'scedilla': 556, - 'iacute': 278, - 'lozenge': 494, - 'Rcaron': 722, - 'Gcommaaccent': 778, - 'ucircumflex': 611, - 'acircumflex': 556, - 'Amacron': 722, - 'rcaron': 389, - 'ccedilla': 556, - 'Zdotaccent': 611, - 'Thorn': 667, - 'Omacron': 778, - 'Racute': 722, - 'Sacute': 667, - 'dcaron': 743, - 'Umacron': 722, - 'uring': 611, - 'threesuperior': 333, - 'Ograve': 778, - 'Agrave': 722, - 'Abreve': 722, - 'multiply': 584, - 'uacute': 611, - 'Tcaron': 611, - 'partialdiff': 494, - 'ydieresis': 556, - 'Nacute': 722, - 'icircumflex': 278, - 'Ecircumflex': 667, - 'adieresis': 556, - 'edieresis': 556, - 'cacute': 556, - 'nacute': 611, - 'umacron': 611, - 'Ncaron': 722, - 'Iacute': 278, - 'plusminus': 584, - 'brokenbar': 280, - 'registered': 737, - 'Gbreve': 778, - 'Idotaccent': 278, - 'summation': 600, - 'Egrave': 667, - 'racute': 389, - 'omacron': 611, - 'Zacute': 611, - 'Zcaron': 611, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 722, - 'lcommaaccent': 278, - 'tcaron': 389, - 'eogonek': 556, - 'Uogonek': 722, - 'Aacute': 722, - 'Adieresis': 722, - 'egrave': 556, - 'zacute': 500, - 'iogonek': 278, - 'Oacute': 778, - 'oacute': 611, - 'amacron': 556, - 'sacute': 556, - 'idieresis': 278, - 'Ocircumflex': 778, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 611, - 'twosuperior': 333, - 'Odieresis': 778, - 'mu': 611, - 'igrave': 278, - 'ohungarumlaut': 611, - 'Eogonek': 667, - 'dcroat': 611, - 'threequarters': 834, - 'Scedilla': 667, - 'lcaron': 400, - 'Kcommaaccent': 722, - 'Lacute': 611, - 'trademark': 1000, - 'edotaccent': 556, - 'Igrave': 278, - 'Imacron': 278, - 'Lcaron': 611, - 'onehalf': 834, - 'lessequal': 549, - 'ocircumflex': 611, - 'ntilde': 611, - 'Uhungarumlaut': 722, - 'Eacute': 667, - 'emacron': 556, - 'gbreve': 611, - 'onequarter': 834, - 'Scaron': 667, - 'Scommaaccent': 667, - 'Ohungarumlaut': 778, - 'degree': 400, - 'ograve': 611, - 'Ccaron': 722, - 'ugrave': 611, - 'radical': 549, - 'Dcaron': 722, - 'rcommaaccent': 389, - 'Ntilde': 722, - 'otilde': 611, - 'Rcommaaccent': 722, - 'Lcommaaccent': 611, - 'Atilde': 722, - 'Aogonek': 722, - 'Aring': 722, - 'Otilde': 778, - 'zdotaccent': 500, - 'Ecaron': 667, - 'Iogonek': 278, - 'kcommaaccent': 556, - 'minus': 584, - 'Icircumflex': 278, - 'ncaron': 611, - 'tcommaaccent': 333, - 'logicalnot': 584, - 'odieresis': 611, - 'udieresis': 611, - 'notequal': 549, - 'gcommaaccent': 611, - 'eth': 611, - 'zcaron': 500, - 'ncommaaccent': 611, - 'onesuperior': 333, - 'imacron': 278, - 'Euro': 556 - }, - 'Helvetica-BoldOblique': { - 'space': 278, - 'exclam': 333, - 'quotedbl': 474, - 'numbersign': 556, - 'dollar': 556, - 'percent': 889, - 'ampersand': 722, - 'quoteright': 278, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 389, - 'plus': 584, - 'comma': 278, - 'hyphen': 333, - 'period': 278, - 'slash': 278, - 'zero': 556, - 'one': 556, - 'two': 556, - 'three': 556, - 'four': 556, - 'five': 556, - 'six': 556, - 'seven': 556, - 'eight': 556, - 'nine': 556, - 'colon': 333, - 'semicolon': 333, - 'less': 584, - 'equal': 584, - 'greater': 584, - 'question': 611, - 'at': 975, - 'A': 722, - 'B': 722, - 'C': 722, - 'D': 722, - 'E': 667, - 'F': 611, - 'G': 778, - 'H': 722, - 'I': 278, - 'J': 556, - 'K': 722, - 'L': 611, - 'M': 833, - 'N': 722, - 'O': 778, - 'P': 667, - 'Q': 778, - 'R': 722, - 'S': 667, - 'T': 611, - 'U': 722, - 'V': 667, - 'W': 944, - 'X': 667, - 'Y': 667, - 'Z': 611, - 'bracketleft': 333, - 'backslash': 278, - 'bracketright': 333, - 'asciicircum': 584, - 'underscore': 556, - 'quoteleft': 278, - 'a': 556, - 'b': 611, - 'c': 556, - 'd': 611, - 'e': 556, - 'f': 333, - 'g': 611, - 'h': 611, - 'i': 278, - 'j': 278, - 'k': 556, - 'l': 278, - 'm': 889, - 'n': 611, - 'o': 611, - 'p': 611, - 'q': 611, - 'r': 389, - 's': 556, - 't': 333, - 'u': 611, - 'v': 556, - 'w': 778, - 'x': 556, - 'y': 556, - 'z': 500, - 'braceleft': 389, - 'bar': 280, - 'braceright': 389, - 'asciitilde': 584, - 'exclamdown': 333, - 'cent': 556, - 'sterling': 556, - 'fraction': 167, - 'yen': 556, - 'florin': 556, - 'section': 556, - 'currency': 556, - 'quotesingle': 238, - 'quotedblleft': 500, - 'guillemotleft': 556, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 611, - 'fl': 611, - 'endash': 556, - 'dagger': 556, - 'daggerdbl': 556, - 'periodcentered': 278, - 'paragraph': 556, - 'bullet': 350, - 'quotesinglbase': 278, - 'quotedblbase': 500, - 'quotedblright': 500, - 'guillemotright': 556, - 'ellipsis': 1000, - 'perthousand': 1000, - 'questiondown': 611, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 1000, - 'AE': 1000, - 'ordfeminine': 370, - 'Lslash': 611, - 'Oslash': 778, - 'OE': 1000, - 'ordmasculine': 365, - 'ae': 889, - 'dotlessi': 278, - 'lslash': 278, - 'oslash': 611, - 'oe': 944, - 'germandbls': 611, - 'Idieresis': 278, - 'eacute': 556, - 'abreve': 556, - 'uhungarumlaut': 611, - 'ecaron': 556, - 'Ydieresis': 667, - 'divide': 584, - 'Yacute': 667, - 'Acircumflex': 722, - 'aacute': 556, - 'Ucircumflex': 722, - 'yacute': 556, - 'scommaaccent': 556, - 'ecircumflex': 556, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 556, - 'Uacute': 722, - 'uogonek': 611, - 'Edieresis': 667, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 737, - 'Emacron': 667, - 'ccaron': 556, - 'aring': 556, - 'Ncommaaccent': 722, - 'lacute': 278, - 'agrave': 556, - 'Tcommaaccent': 611, - 'Cacute': 722, - 'atilde': 556, - 'Edotaccent': 667, - 'scaron': 556, - 'scedilla': 556, - 'iacute': 278, - 'lozenge': 494, - 'Rcaron': 722, - 'Gcommaaccent': 778, - 'ucircumflex': 611, - 'acircumflex': 556, - 'Amacron': 722, - 'rcaron': 389, - 'ccedilla': 556, - 'Zdotaccent': 611, - 'Thorn': 667, - 'Omacron': 778, - 'Racute': 722, - 'Sacute': 667, - 'dcaron': 743, - 'Umacron': 722, - 'uring': 611, - 'threesuperior': 333, - 'Ograve': 778, - 'Agrave': 722, - 'Abreve': 722, - 'multiply': 584, - 'uacute': 611, - 'Tcaron': 611, - 'partialdiff': 494, - 'ydieresis': 556, - 'Nacute': 722, - 'icircumflex': 278, - 'Ecircumflex': 667, - 'adieresis': 556, - 'edieresis': 556, - 'cacute': 556, - 'nacute': 611, - 'umacron': 611, - 'Ncaron': 722, - 'Iacute': 278, - 'plusminus': 584, - 'brokenbar': 280, - 'registered': 737, - 'Gbreve': 778, - 'Idotaccent': 278, - 'summation': 600, - 'Egrave': 667, - 'racute': 389, - 'omacron': 611, - 'Zacute': 611, - 'Zcaron': 611, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 722, - 'lcommaaccent': 278, - 'tcaron': 389, - 'eogonek': 556, - 'Uogonek': 722, - 'Aacute': 722, - 'Adieresis': 722, - 'egrave': 556, - 'zacute': 500, - 'iogonek': 278, - 'Oacute': 778, - 'oacute': 611, - 'amacron': 556, - 'sacute': 556, - 'idieresis': 278, - 'Ocircumflex': 778, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 611, - 'twosuperior': 333, - 'Odieresis': 778, - 'mu': 611, - 'igrave': 278, - 'ohungarumlaut': 611, - 'Eogonek': 667, - 'dcroat': 611, - 'threequarters': 834, - 'Scedilla': 667, - 'lcaron': 400, - 'Kcommaaccent': 722, - 'Lacute': 611, - 'trademark': 1000, - 'edotaccent': 556, - 'Igrave': 278, - 'Imacron': 278, - 'Lcaron': 611, - 'onehalf': 834, - 'lessequal': 549, - 'ocircumflex': 611, - 'ntilde': 611, - 'Uhungarumlaut': 722, - 'Eacute': 667, - 'emacron': 556, - 'gbreve': 611, - 'onequarter': 834, - 'Scaron': 667, - 'Scommaaccent': 667, - 'Ohungarumlaut': 778, - 'degree': 400, - 'ograve': 611, - 'Ccaron': 722, - 'ugrave': 611, - 'radical': 549, - 'Dcaron': 722, - 'rcommaaccent': 389, - 'Ntilde': 722, - 'otilde': 611, - 'Rcommaaccent': 722, - 'Lcommaaccent': 611, - 'Atilde': 722, - 'Aogonek': 722, - 'Aring': 722, - 'Otilde': 778, - 'zdotaccent': 500, - 'Ecaron': 667, - 'Iogonek': 278, - 'kcommaaccent': 556, - 'minus': 584, - 'Icircumflex': 278, - 'ncaron': 611, - 'tcommaaccent': 333, - 'logicalnot': 584, - 'odieresis': 611, - 'udieresis': 611, - 'notequal': 549, - 'gcommaaccent': 611, - 'eth': 611, - 'zcaron': 500, - 'ncommaaccent': 611, - 'onesuperior': 333, - 'imacron': 278, - 'Euro': 556 - }, - 'Helvetica-Oblique' : { - 'space': 278, - 'exclam': 278, - 'quotedbl': 355, - 'numbersign': 556, - 'dollar': 556, - 'percent': 889, - 'ampersand': 667, - 'quoteright': 222, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 389, - 'plus': 584, - 'comma': 278, - 'hyphen': 333, - 'period': 278, - 'slash': 278, - 'zero': 556, - 'one': 556, - 'two': 556, - 'three': 556, - 'four': 556, - 'five': 556, - 'six': 556, - 'seven': 556, - 'eight': 556, - 'nine': 556, - 'colon': 278, - 'semicolon': 278, - 'less': 584, - 'equal': 584, - 'greater': 584, - 'question': 556, - 'at': 1015, - 'A': 667, - 'B': 667, - 'C': 722, - 'D': 722, - 'E': 667, - 'F': 611, - 'G': 778, - 'H': 722, - 'I': 278, - 'J': 500, - 'K': 667, - 'L': 556, - 'M': 833, - 'N': 722, - 'O': 778, - 'P': 667, - 'Q': 778, - 'R': 722, - 'S': 667, - 'T': 611, - 'U': 722, - 'V': 667, - 'W': 944, - 'X': 667, - 'Y': 667, - 'Z': 611, - 'bracketleft': 278, - 'backslash': 278, - 'bracketright': 278, - 'asciicircum': 469, - 'underscore': 556, - 'quoteleft': 222, - 'a': 556, - 'b': 556, - 'c': 500, - 'd': 556, - 'e': 556, - 'f': 278, - 'g': 556, - 'h': 556, - 'i': 222, - 'j': 222, - 'k': 500, - 'l': 222, - 'm': 833, - 'n': 556, - 'o': 556, - 'p': 556, - 'q': 556, - 'r': 333, - 's': 500, - 't': 278, - 'u': 556, - 'v': 500, - 'w': 722, - 'x': 500, - 'y': 500, - 'z': 500, - 'braceleft': 334, - 'bar': 260, - 'braceright': 334, - 'asciitilde': 584, - 'exclamdown': 333, - 'cent': 556, - 'sterling': 556, - 'fraction': 167, - 'yen': 556, - 'florin': 556, - 'section': 556, - 'currency': 556, - 'quotesingle': 191, - 'quotedblleft': 333, - 'guillemotleft': 556, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 500, - 'fl': 500, - 'endash': 556, - 'dagger': 556, - 'daggerdbl': 556, - 'periodcentered': 278, - 'paragraph': 537, - 'bullet': 350, - 'quotesinglbase': 222, - 'quotedblbase': 333, - 'quotedblright': 333, - 'guillemotright': 556, - 'ellipsis': 1000, - 'perthousand': 1000, - 'questiondown': 611, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 1000, - 'AE': 1000, - 'ordfeminine': 370, - 'Lslash': 556, - 'Oslash': 778, - 'OE': 1000, - 'ordmasculine': 365, - 'ae': 889, - 'dotlessi': 278, - 'lslash': 222, - 'oslash': 611, - 'oe': 944, - 'germandbls': 611, - 'Idieresis': 278, - 'eacute': 556, - 'abreve': 556, - 'uhungarumlaut': 556, - 'ecaron': 556, - 'Ydieresis': 667, - 'divide': 584, - 'Yacute': 667, - 'Acircumflex': 667, - 'aacute': 556, - 'Ucircumflex': 722, - 'yacute': 500, - 'scommaaccent': 500, - 'ecircumflex': 556, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 556, - 'Uacute': 722, - 'uogonek': 556, - 'Edieresis': 667, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 737, - 'Emacron': 667, - 'ccaron': 500, - 'aring': 556, - 'Ncommaaccent': 722, - 'lacute': 222, - 'agrave': 556, - 'Tcommaaccent': 611, - 'Cacute': 722, - 'atilde': 556, - 'Edotaccent': 667, - 'scaron': 500, - 'scedilla': 500, - 'iacute': 278, - 'lozenge': 471, - 'Rcaron': 722, - 'Gcommaaccent': 778, - 'ucircumflex': 556, - 'acircumflex': 556, - 'Amacron': 667, - 'rcaron': 333, - 'ccedilla': 500, - 'Zdotaccent': 611, - 'Thorn': 667, - 'Omacron': 778, - 'Racute': 722, - 'Sacute': 667, - 'dcaron': 643, - 'Umacron': 722, - 'uring': 556, - 'threesuperior': 333, - 'Ograve': 778, - 'Agrave': 667, - 'Abreve': 667, - 'multiply': 584, - 'uacute': 556, - 'Tcaron': 611, - 'partialdiff': 476, - 'ydieresis': 500, - 'Nacute': 722, - 'icircumflex': 278, - 'Ecircumflex': 667, - 'adieresis': 556, - 'edieresis': 556, - 'cacute': 500, - 'nacute': 556, - 'umacron': 556, - 'Ncaron': 722, - 'Iacute': 278, - 'plusminus': 584, - 'brokenbar': 260, - 'registered': 737, - 'Gbreve': 778, - 'Idotaccent': 278, - 'summation': 600, - 'Egrave': 667, - 'racute': 333, - 'omacron': 556, - 'Zacute': 611, - 'Zcaron': 611, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 722, - 'lcommaaccent': 222, - 'tcaron': 317, - 'eogonek': 556, - 'Uogonek': 722, - 'Aacute': 667, - 'Adieresis': 667, - 'egrave': 556, - 'zacute': 500, - 'iogonek': 222, - 'Oacute': 778, - 'oacute': 556, - 'amacron': 556, - 'sacute': 500, - 'idieresis': 278, - 'Ocircumflex': 778, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 556, - 'twosuperior': 333, - 'Odieresis': 778, - 'mu': 556, - 'igrave': 278, - 'ohungarumlaut': 556, - 'Eogonek': 667, - 'dcroat': 556, - 'threequarters': 834, - 'Scedilla': 667, - 'lcaron': 299, - 'Kcommaaccent': 667, - 'Lacute': 556, - 'trademark': 1000, - 'edotaccent': 556, - 'Igrave': 278, - 'Imacron': 278, - 'Lcaron': 556, - 'onehalf': 834, - 'lessequal': 549, - 'ocircumflex': 556, - 'ntilde': 556, - 'Uhungarumlaut': 722, - 'Eacute': 667, - 'emacron': 556, - 'gbreve': 556, - 'onequarter': 834, - 'Scaron': 667, - 'Scommaaccent': 667, - 'Ohungarumlaut': 778, - 'degree': 400, - 'ograve': 556, - 'Ccaron': 722, - 'ugrave': 556, - 'radical': 453, - 'Dcaron': 722, - 'rcommaaccent': 333, - 'Ntilde': 722, - 'otilde': 556, - 'Rcommaaccent': 722, - 'Lcommaaccent': 556, - 'Atilde': 667, - 'Aogonek': 667, - 'Aring': 667, - 'Otilde': 778, - 'zdotaccent': 500, - 'Ecaron': 667, - 'Iogonek': 278, - 'kcommaaccent': 500, - 'minus': 584, - 'Icircumflex': 278, - 'ncaron': 556, - 'tcommaaccent': 278, - 'logicalnot': 584, - 'odieresis': 556, - 'udieresis': 556, - 'notequal': 549, - 'gcommaaccent': 556, - 'eth': 556, - 'zcaron': 500, - 'ncommaaccent': 556, - 'onesuperior': 333, - 'imacron': 278, - 'Euro': 556 - }, - 'Symbol': { - 'space': 250, - 'exclam': 333, - 'universal': 713, - 'numbersign': 500, - 'existential': 549, - 'percent': 833, - 'ampersand': 778, - 'suchthat': 439, - 'parenleft': 333, - 'parenright': 333, - 'asteriskmath': 500, - 'plus': 549, - 'comma': 250, - 'minus': 549, - 'period': 250, - 'slash': 278, - 'zero': 500, - 'one': 500, - 'two': 500, - 'three': 500, - 'four': 500, - 'five': 500, - 'six': 500, - 'seven': 500, - 'eight': 500, - 'nine': 500, - 'colon': 278, - 'semicolon': 278, - 'less': 549, - 'equal': 549, - 'greater': 549, - 'question': 444, - 'congruent': 549, - 'Alpha': 722, - 'Beta': 667, - 'Chi': 722, - 'Delta': 612, - 'Epsilon': 611, - 'Phi': 763, - 'Gamma': 603, - 'Eta': 722, - 'Iota': 333, - 'theta1': 631, - 'Kappa': 722, - 'Lambda': 686, - 'Mu': 889, - 'Nu': 722, - 'Omicron': 722, - 'Pi': 768, - 'Theta': 741, - 'Rho': 556, - 'Sigma': 592, - 'Tau': 611, - 'Upsilon': 690, - 'sigma1': 439, - 'Omega': 768, - 'Xi': 645, - 'Psi': 795, - 'Zeta': 611, - 'bracketleft': 333, - 'therefore': 863, - 'bracketright': 333, - 'perpendicular': 658, - 'underscore': 500, - 'radicalex': 500, - 'alpha': 631, - 'beta': 549, - 'chi': 549, - 'delta': 494, - 'epsilon': 439, - 'phi': 521, - 'gamma': 411, - 'eta': 603, - 'iota': 329, - 'phi1': 603, - 'kappa': 549, - 'lambda': 549, - 'mu': 576, - 'nu': 521, - 'omicron': 549, - 'pi': 549, - 'theta': 521, - 'rho': 549, - 'sigma': 603, - 'tau': 439, - 'upsilon': 576, - 'omega1': 713, - 'omega': 686, - 'xi': 493, - 'psi': 686, - 'zeta': 494, - 'braceleft': 480, - 'bar': 200, - 'braceright': 480, - 'similar': 549, - 'Euro': 750, - 'Upsilon1': 620, - 'minute': 247, - 'lessequal': 549, - 'fraction': 167, - 'infinity': 713, - 'florin': 500, - 'club': 753, - 'diamond': 753, - 'heart': 753, - 'spade': 753, - 'arrowboth': 1042, - 'arrowleft': 987, - 'arrowup': 603, - 'arrowright': 987, - 'arrowdown': 603, - 'degree': 400, - 'plusminus': 549, - 'second': 411, - 'greaterequal': 549, - 'multiply': 549, - 'proportional': 713, - 'partialdiff': 494, - 'bullet': 460, - 'divide': 549, - 'notequal': 549, - 'equivalence': 549, - 'approxequal': 549, - 'ellipsis': 1000, - 'arrowvertex': 603, - 'arrowhorizex': 1000, - 'carriagereturn': 658, - 'aleph': 823, - 'Ifraktur': 686, - 'Rfraktur': 795, - 'weierstrass': 987, - 'circlemultiply': 768, - 'circleplus': 768, - 'emptyset': 823, - 'intersection': 768, - 'union': 768, - 'propersuperset': 713, - 'reflexsuperset': 713, - 'notsubset': 713, - 'propersubset': 713, - 'reflexsubset': 713, - 'element': 713, - 'notelement': 713, - 'angle': 768, - 'gradient': 713, - 'registerserif': 790, - 'copyrightserif': 790, - 'trademarkserif': 890, - 'product': 823, - 'radical': 549, - 'dotmath': 250, - 'logicalnot': 713, - 'logicaland': 603, - 'logicalor': 603, - 'arrowdblboth': 1042, - 'arrowdblleft': 987, - 'arrowdblup': 603, - 'arrowdblright': 987, - 'arrowdbldown': 603, - 'lozenge': 494, - 'angleleft': 329, - 'registersans': 790, - 'copyrightsans': 790, - 'trademarksans': 786, - 'summation': 713, - 'parenlefttp': 384, - 'parenleftex': 384, - 'parenleftbt': 384, - 'bracketlefttp': 384, - 'bracketleftex': 384, - 'bracketleftbt': 384, - 'bracelefttp': 494, - 'braceleftmid': 494, - 'braceleftbt': 494, - 'braceex': 494, - 'angleright': 329, - 'integral': 274, - 'integraltp': 686, - 'integralex': 686, - 'integralbt': 686, - 'parenrighttp': 384, - 'parenrightex': 384, - 'parenrightbt': 384, - 'bracketrighttp': 384, - 'bracketrightex': 384, - 'bracketrightbt': 384, - 'bracerighttp': 494, - 'bracerightmid': 494, - 'bracerightbt': 494, - 'apple': 790 - }, - 'Times-Roman': { - 'space': 250, - 'exclam': 333, - 'quotedbl': 408, - 'numbersign': 500, - 'dollar': 500, - 'percent': 833, - 'ampersand': 778, - 'quoteright': 333, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 500, - 'plus': 564, - 'comma': 250, - 'hyphen': 333, - 'period': 250, - 'slash': 278, - 'zero': 500, - 'one': 500, - 'two': 500, - 'three': 500, - 'four': 500, - 'five': 500, - 'six': 500, - 'seven': 500, - 'eight': 500, - 'nine': 500, - 'colon': 278, - 'semicolon': 278, - 'less': 564, - 'equal': 564, - 'greater': 564, - 'question': 444, - 'at': 921, - 'A': 722, - 'B': 667, - 'C': 667, - 'D': 722, - 'E': 611, - 'F': 556, - 'G': 722, - 'H': 722, - 'I': 333, - 'J': 389, - 'K': 722, - 'L': 611, - 'M': 889, - 'N': 722, - 'O': 722, - 'P': 556, - 'Q': 722, - 'R': 667, - 'S': 556, - 'T': 611, - 'U': 722, - 'V': 722, - 'W': 944, - 'X': 722, - 'Y': 722, - 'Z': 611, - 'bracketleft': 333, - 'backslash': 278, - 'bracketright': 333, - 'asciicircum': 469, - 'underscore': 500, - 'quoteleft': 333, - 'a': 444, - 'b': 500, - 'c': 444, - 'd': 500, - 'e': 444, - 'f': 333, - 'g': 500, - 'h': 500, - 'i': 278, - 'j': 278, - 'k': 500, - 'l': 278, - 'm': 778, - 'n': 500, - 'o': 500, - 'p': 500, - 'q': 500, - 'r': 333, - 's': 389, - 't': 278, - 'u': 500, - 'v': 500, - 'w': 722, - 'x': 500, - 'y': 500, - 'z': 444, - 'braceleft': 480, - 'bar': 200, - 'braceright': 480, - 'asciitilde': 541, - 'exclamdown': 333, - 'cent': 500, - 'sterling': 500, - 'fraction': 167, - 'yen': 500, - 'florin': 500, - 'section': 500, - 'currency': 500, - 'quotesingle': 180, - 'quotedblleft': 444, - 'guillemotleft': 500, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 556, - 'fl': 556, - 'endash': 500, - 'dagger': 500, - 'daggerdbl': 500, - 'periodcentered': 250, - 'paragraph': 453, - 'bullet': 350, - 'quotesinglbase': 333, - 'quotedblbase': 444, - 'quotedblright': 444, - 'guillemotright': 500, - 'ellipsis': 1000, - 'perthousand': 1000, - 'questiondown': 444, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 1000, - 'AE': 889, - 'ordfeminine': 276, - 'Lslash': 611, - 'Oslash': 722, - 'OE': 889, - 'ordmasculine': 310, - 'ae': 667, - 'dotlessi': 278, - 'lslash': 278, - 'oslash': 500, - 'oe': 722, - 'germandbls': 500, - 'Idieresis': 333, - 'eacute': 444, - 'abreve': 444, - 'uhungarumlaut': 500, - 'ecaron': 444, - 'Ydieresis': 722, - 'divide': 564, - 'Yacute': 722, - 'Acircumflex': 722, - 'aacute': 444, - 'Ucircumflex': 722, - 'yacute': 500, - 'scommaaccent': 389, - 'ecircumflex': 444, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 444, - 'Uacute': 722, - 'uogonek': 500, - 'Edieresis': 611, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 760, - 'Emacron': 611, - 'ccaron': 444, - 'aring': 444, - 'Ncommaaccent': 722, - 'lacute': 278, - 'agrave': 444, - 'Tcommaaccent': 611, - 'Cacute': 667, - 'atilde': 444, - 'Edotaccent': 611, - 'scaron': 389, - 'scedilla': 389, - 'iacute': 278, - 'lozenge': 471, - 'Rcaron': 667, - 'Gcommaaccent': 722, - 'ucircumflex': 500, - 'acircumflex': 444, - 'Amacron': 722, - 'rcaron': 333, - 'ccedilla': 444, - 'Zdotaccent': 611, - 'Thorn': 556, - 'Omacron': 722, - 'Racute': 667, - 'Sacute': 556, - 'dcaron': 588, - 'Umacron': 722, - 'uring': 500, - 'threesuperior': 300, - 'Ograve': 722, - 'Agrave': 722, - 'Abreve': 722, - 'multiply': 564, - 'uacute': 500, - 'Tcaron': 611, - 'partialdiff': 476, - 'ydieresis': 500, - 'Nacute': 722, - 'icircumflex': 278, - 'Ecircumflex': 611, - 'adieresis': 444, - 'edieresis': 444, - 'cacute': 444, - 'nacute': 500, - 'umacron': 500, - 'Ncaron': 722, - 'Iacute': 333, - 'plusminus': 564, - 'brokenbar': 200, - 'registered': 760, - 'Gbreve': 722, - 'Idotaccent': 333, - 'summation': 600, - 'Egrave': 611, - 'racute': 333, - 'omacron': 500, - 'Zacute': 611, - 'Zcaron': 611, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 667, - 'lcommaaccent': 278, - 'tcaron': 326, - 'eogonek': 444, - 'Uogonek': 722, - 'Aacute': 722, - 'Adieresis': 722, - 'egrave': 444, - 'zacute': 444, - 'iogonek': 278, - 'Oacute': 722, - 'oacute': 500, - 'amacron': 444, - 'sacute': 389, - 'idieresis': 278, - 'Ocircumflex': 722, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 500, - 'twosuperior': 300, - 'Odieresis': 722, - 'mu': 500, - 'igrave': 278, - 'ohungarumlaut': 500, - 'Eogonek': 611, - 'dcroat': 500, - 'threequarters': 750, - 'Scedilla': 556, - 'lcaron': 344, - 'Kcommaaccent': 722, - 'Lacute': 611, - 'trademark': 980, - 'edotaccent': 444, - 'Igrave': 333, - 'Imacron': 333, - 'Lcaron': 611, - 'onehalf': 750, - 'lessequal': 549, - 'ocircumflex': 500, - 'ntilde': 500, - 'Uhungarumlaut': 722, - 'Eacute': 611, - 'emacron': 444, - 'gbreve': 500, - 'onequarter': 750, - 'Scaron': 556, - 'Scommaaccent': 556, - 'Ohungarumlaut': 722, - 'degree': 400, - 'ograve': 500, - 'Ccaron': 667, - 'ugrave': 500, - 'radical': 453, - 'Dcaron': 722, - 'rcommaaccent': 333, - 'Ntilde': 722, - 'otilde': 500, - 'Rcommaaccent': 667, - 'Lcommaaccent': 611, - 'Atilde': 722, - 'Aogonek': 722, - 'Aring': 722, - 'Otilde': 722, - 'zdotaccent': 444, - 'Ecaron': 611, - 'Iogonek': 333, - 'kcommaaccent': 500, - 'minus': 564, - 'Icircumflex': 333, - 'ncaron': 500, - 'tcommaaccent': 278, - 'logicalnot': 564, - 'odieresis': 500, - 'udieresis': 500, - 'notequal': 549, - 'gcommaaccent': 500, - 'eth': 500, - 'zcaron': 444, - 'ncommaaccent': 500, - 'onesuperior': 300, - 'imacron': 278, - 'Euro': 500 - }, - 'Times-Bold': { - 'space': 250, - 'exclam': 333, - 'quotedbl': 555, - 'numbersign': 500, - 'dollar': 500, - 'percent': 1000, - 'ampersand': 833, - 'quoteright': 333, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 500, - 'plus': 570, - 'comma': 250, - 'hyphen': 333, - 'period': 250, - 'slash': 278, - 'zero': 500, - 'one': 500, - 'two': 500, - 'three': 500, - 'four': 500, - 'five': 500, - 'six': 500, - 'seven': 500, - 'eight': 500, - 'nine': 500, - 'colon': 333, - 'semicolon': 333, - 'less': 570, - 'equal': 570, - 'greater': 570, - 'question': 500, - 'at': 930, - 'A': 722, - 'B': 667, - 'C': 722, - 'D': 722, - 'E': 667, - 'F': 611, - 'G': 778, - 'H': 778, - 'I': 389, - 'J': 500, - 'K': 778, - 'L': 667, - 'M': 944, - 'N': 722, - 'O': 778, - 'P': 611, - 'Q': 778, - 'R': 722, - 'S': 556, - 'T': 667, - 'U': 722, - 'V': 722, - 'W': 1000, - 'X': 722, - 'Y': 722, - 'Z': 667, - 'bracketleft': 333, - 'backslash': 278, - 'bracketright': 333, - 'asciicircum': 581, - 'underscore': 500, - 'quoteleft': 333, - 'a': 500, - 'b': 556, - 'c': 444, - 'd': 556, - 'e': 444, - 'f': 333, - 'g': 500, - 'h': 556, - 'i': 278, - 'j': 333, - 'k': 556, - 'l': 278, - 'm': 833, - 'n': 556, - 'o': 500, - 'p': 556, - 'q': 556, - 'r': 444, - 's': 389, - 't': 333, - 'u': 556, - 'v': 500, - 'w': 722, - 'x': 500, - 'y': 500, - 'z': 444, - 'braceleft': 394, - 'bar': 220, - 'braceright': 394, - 'asciitilde': 520, - 'exclamdown': 333, - 'cent': 500, - 'sterling': 500, - 'fraction': 167, - 'yen': 500, - 'florin': 500, - 'section': 500, - 'currency': 500, - 'quotesingle': 278, - 'quotedblleft': 500, - 'guillemotleft': 500, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 556, - 'fl': 556, - 'endash': 500, - 'dagger': 500, - 'daggerdbl': 500, - 'periodcentered': 250, - 'paragraph': 540, - 'bullet': 350, - 'quotesinglbase': 333, - 'quotedblbase': 500, - 'quotedblright': 500, - 'guillemotright': 500, - 'ellipsis': 1000, - 'perthousand': 1000, - 'questiondown': 500, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 1000, - 'AE': 1000, - 'ordfeminine': 300, - 'Lslash': 667, - 'Oslash': 778, - 'OE': 1000, - 'ordmasculine': 330, - 'ae': 722, - 'dotlessi': 278, - 'lslash': 278, - 'oslash': 500, - 'oe': 722, - 'germandbls': 556, - 'Idieresis': 389, - 'eacute': 444, - 'abreve': 500, - 'uhungarumlaut': 556, - 'ecaron': 444, - 'Ydieresis': 722, - 'divide': 570, - 'Yacute': 722, - 'Acircumflex': 722, - 'aacute': 500, - 'Ucircumflex': 722, - 'yacute': 500, - 'scommaaccent': 389, - 'ecircumflex': 444, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 500, - 'Uacute': 722, - 'uogonek': 556, - 'Edieresis': 667, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 747, - 'Emacron': 667, - 'ccaron': 444, - 'aring': 500, - 'Ncommaaccent': 722, - 'lacute': 278, - 'agrave': 500, - 'Tcommaaccent': 667, - 'Cacute': 722, - 'atilde': 500, - 'Edotaccent': 667, - 'scaron': 389, - 'scedilla': 389, - 'iacute': 278, - 'lozenge': 494, - 'Rcaron': 722, - 'Gcommaaccent': 778, - 'ucircumflex': 556, - 'acircumflex': 500, - 'Amacron': 722, - 'rcaron': 444, - 'ccedilla': 444, - 'Zdotaccent': 667, - 'Thorn': 611, - 'Omacron': 778, - 'Racute': 722, - 'Sacute': 556, - 'dcaron': 672, - 'Umacron': 722, - 'uring': 556, - 'threesuperior': 300, - 'Ograve': 778, - 'Agrave': 722, - 'Abreve': 722, - 'multiply': 570, - 'uacute': 556, - 'Tcaron': 667, - 'partialdiff': 494, - 'ydieresis': 500, - 'Nacute': 722, - 'icircumflex': 278, - 'Ecircumflex': 667, - 'adieresis': 500, - 'edieresis': 444, - 'cacute': 444, - 'nacute': 556, - 'umacron': 556, - 'Ncaron': 722, - 'Iacute': 389, - 'plusminus': 570, - 'brokenbar': 220, - 'registered': 747, - 'Gbreve': 778, - 'Idotaccent': 389, - 'summation': 600, - 'Egrave': 667, - 'racute': 444, - 'omacron': 500, - 'Zacute': 667, - 'Zcaron': 667, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 722, - 'lcommaaccent': 278, - 'tcaron': 416, - 'eogonek': 444, - 'Uogonek': 722, - 'Aacute': 722, - 'Adieresis': 722, - 'egrave': 444, - 'zacute': 444, - 'iogonek': 278, - 'Oacute': 778, - 'oacute': 500, - 'amacron': 500, - 'sacute': 389, - 'idieresis': 278, - 'Ocircumflex': 778, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 556, - 'twosuperior': 300, - 'Odieresis': 778, - 'mu': 556, - 'igrave': 278, - 'ohungarumlaut': 500, - 'Eogonek': 667, - 'dcroat': 556, - 'threequarters': 750, - 'Scedilla': 556, - 'lcaron': 394, - 'Kcommaaccent': 778, - 'Lacute': 667, - 'trademark': 1000, - 'edotaccent': 444, - 'Igrave': 389, - 'Imacron': 389, - 'Lcaron': 667, - 'onehalf': 750, - 'lessequal': 549, - 'ocircumflex': 500, - 'ntilde': 556, - 'Uhungarumlaut': 722, - 'Eacute': 667, - 'emacron': 444, - 'gbreve': 500, - 'onequarter': 750, - 'Scaron': 556, - 'Scommaaccent': 556, - 'Ohungarumlaut': 778, - 'degree': 400, - 'ograve': 500, - 'Ccaron': 722, - 'ugrave': 556, - 'radical': 549, - 'Dcaron': 722, - 'rcommaaccent': 444, - 'Ntilde': 722, - 'otilde': 500, - 'Rcommaaccent': 722, - 'Lcommaaccent': 667, - 'Atilde': 722, - 'Aogonek': 722, - 'Aring': 722, - 'Otilde': 778, - 'zdotaccent': 444, - 'Ecaron': 667, - 'Iogonek': 389, - 'kcommaaccent': 556, - 'minus': 570, - 'Icircumflex': 389, - 'ncaron': 556, - 'tcommaaccent': 333, - 'logicalnot': 570, - 'odieresis': 500, - 'udieresis': 556, - 'notequal': 549, - 'gcommaaccent': 500, - 'eth': 500, - 'zcaron': 444, - 'ncommaaccent': 556, - 'onesuperior': 300, - 'imacron': 278, - 'Euro': 500 - }, - 'Times-BoldItalic': { - 'space': 250, - 'exclam': 389, - 'quotedbl': 555, - 'numbersign': 500, - 'dollar': 500, - 'percent': 833, - 'ampersand': 778, - 'quoteright': 333, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 500, - 'plus': 570, - 'comma': 250, - 'hyphen': 333, - 'period': 250, - 'slash': 278, - 'zero': 500, - 'one': 500, - 'two': 500, - 'three': 500, - 'four': 500, - 'five': 500, - 'six': 500, - 'seven': 500, - 'eight': 500, - 'nine': 500, - 'colon': 333, - 'semicolon': 333, - 'less': 570, - 'equal': 570, - 'greater': 570, - 'question': 500, - 'at': 832, - 'A': 667, - 'B': 667, - 'C': 667, - 'D': 722, - 'E': 667, - 'F': 667, - 'G': 722, - 'H': 778, - 'I': 389, - 'J': 500, - 'K': 667, - 'L': 611, - 'M': 889, - 'N': 722, - 'O': 722, - 'P': 611, - 'Q': 722, - 'R': 667, - 'S': 556, - 'T': 611, - 'U': 722, - 'V': 667, - 'W': 889, - 'X': 667, - 'Y': 611, - 'Z': 611, - 'bracketleft': 333, - 'backslash': 278, - 'bracketright': 333, - 'asciicircum': 570, - 'underscore': 500, - 'quoteleft': 333, - 'a': 500, - 'b': 500, - 'c': 444, - 'd': 500, - 'e': 444, - 'f': 333, - 'g': 500, - 'h': 556, - 'i': 278, - 'j': 278, - 'k': 500, - 'l': 278, - 'm': 778, - 'n': 556, - 'o': 500, - 'p': 500, - 'q': 500, - 'r': 389, - 's': 389, - 't': 278, - 'u': 556, - 'v': 444, - 'w': 667, - 'x': 500, - 'y': 444, - 'z': 389, - 'braceleft': 348, - 'bar': 220, - 'braceright': 348, - 'asciitilde': 570, - 'exclamdown': 389, - 'cent': 500, - 'sterling': 500, - 'fraction': 167, - 'yen': 500, - 'florin': 500, - 'section': 500, - 'currency': 500, - 'quotesingle': 278, - 'quotedblleft': 500, - 'guillemotleft': 500, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 556, - 'fl': 556, - 'endash': 500, - 'dagger': 500, - 'daggerdbl': 500, - 'periodcentered': 250, - 'paragraph': 500, - 'bullet': 350, - 'quotesinglbase': 333, - 'quotedblbase': 500, - 'quotedblright': 500, - 'guillemotright': 500, - 'ellipsis': 1000, - 'perthousand': 1000, - 'questiondown': 500, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 1000, - 'AE': 944, - 'ordfeminine': 266, - 'Lslash': 611, - 'Oslash': 722, - 'OE': 944, - 'ordmasculine': 300, - 'ae': 722, - 'dotlessi': 278, - 'lslash': 278, - 'oslash': 500, - 'oe': 722, - 'germandbls': 500, - 'Idieresis': 389, - 'eacute': 444, - 'abreve': 500, - 'uhungarumlaut': 556, - 'ecaron': 444, - 'Ydieresis': 611, - 'divide': 570, - 'Yacute': 611, - 'Acircumflex': 667, - 'aacute': 500, - 'Ucircumflex': 722, - 'yacute': 444, - 'scommaaccent': 389, - 'ecircumflex': 444, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 500, - 'Uacute': 722, - 'uogonek': 556, - 'Edieresis': 667, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 747, - 'Emacron': 667, - 'ccaron': 444, - 'aring': 500, - 'Ncommaaccent': 722, - 'lacute': 278, - 'agrave': 500, - 'Tcommaaccent': 611, - 'Cacute': 667, - 'atilde': 500, - 'Edotaccent': 667, - 'scaron': 389, - 'scedilla': 389, - 'iacute': 278, - 'lozenge': 494, - 'Rcaron': 667, - 'Gcommaaccent': 722, - 'ucircumflex': 556, - 'acircumflex': 500, - 'Amacron': 667, - 'rcaron': 389, - 'ccedilla': 444, - 'Zdotaccent': 611, - 'Thorn': 611, - 'Omacron': 722, - 'Racute': 667, - 'Sacute': 556, - 'dcaron': 608, - 'Umacron': 722, - 'uring': 556, - 'threesuperior': 300, - 'Ograve': 722, - 'Agrave': 667, - 'Abreve': 667, - 'multiply': 570, - 'uacute': 556, - 'Tcaron': 611, - 'partialdiff': 494, - 'ydieresis': 444, - 'Nacute': 722, - 'icircumflex': 278, - 'Ecircumflex': 667, - 'adieresis': 500, - 'edieresis': 444, - 'cacute': 444, - 'nacute': 556, - 'umacron': 556, - 'Ncaron': 722, - 'Iacute': 389, - 'plusminus': 570, - 'brokenbar': 220, - 'registered': 747, - 'Gbreve': 722, - 'Idotaccent': 389, - 'summation': 600, - 'Egrave': 667, - 'racute': 389, - 'omacron': 500, - 'Zacute': 611, - 'Zcaron': 611, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 667, - 'lcommaaccent': 278, - 'tcaron': 366, - 'eogonek': 444, - 'Uogonek': 722, - 'Aacute': 667, - 'Adieresis': 667, - 'egrave': 444, - 'zacute': 389, - 'iogonek': 278, - 'Oacute': 722, - 'oacute': 500, - 'amacron': 500, - 'sacute': 389, - 'idieresis': 278, - 'Ocircumflex': 722, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 500, - 'twosuperior': 300, - 'Odieresis': 722, - 'mu': 576, - 'igrave': 278, - 'ohungarumlaut': 500, - 'Eogonek': 667, - 'dcroat': 500, - 'threequarters': 750, - 'Scedilla': 556, - 'lcaron': 382, - 'Kcommaaccent': 667, - 'Lacute': 611, - 'trademark': 1000, - 'edotaccent': 444, - 'Igrave': 389, - 'Imacron': 389, - 'Lcaron': 611, - 'onehalf': 750, - 'lessequal': 549, - 'ocircumflex': 500, - 'ntilde': 556, - 'Uhungarumlaut': 722, - 'Eacute': 667, - 'emacron': 444, - 'gbreve': 500, - 'onequarter': 750, - 'Scaron': 556, - 'Scommaaccent': 556, - 'Ohungarumlaut': 722, - 'degree': 400, - 'ograve': 500, - 'Ccaron': 667, - 'ugrave': 556, - 'radical': 549, - 'Dcaron': 722, - 'rcommaaccent': 389, - 'Ntilde': 722, - 'otilde': 500, - 'Rcommaaccent': 667, - 'Lcommaaccent': 611, - 'Atilde': 667, - 'Aogonek': 667, - 'Aring': 667, - 'Otilde': 722, - 'zdotaccent': 389, - 'Ecaron': 667, - 'Iogonek': 389, - 'kcommaaccent': 500, - 'minus': 606, - 'Icircumflex': 389, - 'ncaron': 556, - 'tcommaaccent': 278, - 'logicalnot': 606, - 'odieresis': 500, - 'udieresis': 556, - 'notequal': 549, - 'gcommaaccent': 500, - 'eth': 500, - 'zcaron': 389, - 'ncommaaccent': 556, - 'onesuperior': 300, - 'imacron': 278, - 'Euro': 500 - }, - 'Times-Italic': { - 'space': 250, - 'exclam': 333, - 'quotedbl': 420, - 'numbersign': 500, - 'dollar': 500, - 'percent': 833, - 'ampersand': 778, - 'quoteright': 333, - 'parenleft': 333, - 'parenright': 333, - 'asterisk': 500, - 'plus': 675, - 'comma': 250, - 'hyphen': 333, - 'period': 250, - 'slash': 278, - 'zero': 500, - 'one': 500, - 'two': 500, - 'three': 500, - 'four': 500, - 'five': 500, - 'six': 500, - 'seven': 500, - 'eight': 500, - 'nine': 500, - 'colon': 333, - 'semicolon': 333, - 'less': 675, - 'equal': 675, - 'greater': 675, - 'question': 500, - 'at': 920, - 'A': 611, - 'B': 611, - 'C': 667, - 'D': 722, - 'E': 611, - 'F': 611, - 'G': 722, - 'H': 722, - 'I': 333, - 'J': 444, - 'K': 667, - 'L': 556, - 'M': 833, - 'N': 667, - 'O': 722, - 'P': 611, - 'Q': 722, - 'R': 611, - 'S': 500, - 'T': 556, - 'U': 722, - 'V': 611, - 'W': 833, - 'X': 611, - 'Y': 556, - 'Z': 556, - 'bracketleft': 389, - 'backslash': 278, - 'bracketright': 389, - 'asciicircum': 422, - 'underscore': 500, - 'quoteleft': 333, - 'a': 500, - 'b': 500, - 'c': 444, - 'd': 500, - 'e': 444, - 'f': 278, - 'g': 500, - 'h': 500, - 'i': 278, - 'j': 278, - 'k': 444, - 'l': 278, - 'm': 722, - 'n': 500, - 'o': 500, - 'p': 500, - 'q': 500, - 'r': 389, - 's': 389, - 't': 278, - 'u': 500, - 'v': 444, - 'w': 667, - 'x': 444, - 'y': 444, - 'z': 389, - 'braceleft': 400, - 'bar': 275, - 'braceright': 400, - 'asciitilde': 541, - 'exclamdown': 389, - 'cent': 500, - 'sterling': 500, - 'fraction': 167, - 'yen': 500, - 'florin': 500, - 'section': 500, - 'currency': 500, - 'quotesingle': 214, - 'quotedblleft': 556, - 'guillemotleft': 500, - 'guilsinglleft': 333, - 'guilsinglright': 333, - 'fi': 500, - 'fl': 500, - 'endash': 500, - 'dagger': 500, - 'daggerdbl': 500, - 'periodcentered': 250, - 'paragraph': 523, - 'bullet': 350, - 'quotesinglbase': 333, - 'quotedblbase': 556, - 'quotedblright': 556, - 'guillemotright': 500, - 'ellipsis': 889, - 'perthousand': 1000, - 'questiondown': 500, - 'grave': 333, - 'acute': 333, - 'circumflex': 333, - 'tilde': 333, - 'macron': 333, - 'breve': 333, - 'dotaccent': 333, - 'dieresis': 333, - 'ring': 333, - 'cedilla': 333, - 'hungarumlaut': 333, - 'ogonek': 333, - 'caron': 333, - 'emdash': 889, - 'AE': 889, - 'ordfeminine': 276, - 'Lslash': 556, - 'Oslash': 722, - 'OE': 944, - 'ordmasculine': 310, - 'ae': 667, - 'dotlessi': 278, - 'lslash': 278, - 'oslash': 500, - 'oe': 667, - 'germandbls': 500, - 'Idieresis': 333, - 'eacute': 444, - 'abreve': 500, - 'uhungarumlaut': 500, - 'ecaron': 444, - 'Ydieresis': 556, - 'divide': 675, - 'Yacute': 556, - 'Acircumflex': 611, - 'aacute': 500, - 'Ucircumflex': 722, - 'yacute': 444, - 'scommaaccent': 389, - 'ecircumflex': 444, - 'Uring': 722, - 'Udieresis': 722, - 'aogonek': 500, - 'Uacute': 722, - 'uogonek': 500, - 'Edieresis': 611, - 'Dcroat': 722, - 'commaaccent': 250, - 'copyright': 760, - 'Emacron': 611, - 'ccaron': 444, - 'aring': 500, - 'Ncommaaccent': 667, - 'lacute': 278, - 'agrave': 500, - 'Tcommaaccent': 556, - 'Cacute': 667, - 'atilde': 500, - 'Edotaccent': 611, - 'scaron': 389, - 'scedilla': 389, - 'iacute': 278, - 'lozenge': 471, - 'Rcaron': 611, - 'Gcommaaccent': 722, - 'ucircumflex': 500, - 'acircumflex': 500, - 'Amacron': 611, - 'rcaron': 389, - 'ccedilla': 444, - 'Zdotaccent': 556, - 'Thorn': 611, - 'Omacron': 722, - 'Racute': 611, - 'Sacute': 500, - 'dcaron': 544, - 'Umacron': 722, - 'uring': 500, - 'threesuperior': 300, - 'Ograve': 722, - 'Agrave': 611, - 'Abreve': 611, - 'multiply': 675, - 'uacute': 500, - 'Tcaron': 556, - 'partialdiff': 476, - 'ydieresis': 444, - 'Nacute': 667, - 'icircumflex': 278, - 'Ecircumflex': 611, - 'adieresis': 500, - 'edieresis': 444, - 'cacute': 444, - 'nacute': 500, - 'umacron': 500, - 'Ncaron': 667, - 'Iacute': 333, - 'plusminus': 675, - 'brokenbar': 275, - 'registered': 760, - 'Gbreve': 722, - 'Idotaccent': 333, - 'summation': 600, - 'Egrave': 611, - 'racute': 389, - 'omacron': 500, - 'Zacute': 556, - 'Zcaron': 556, - 'greaterequal': 549, - 'Eth': 722, - 'Ccedilla': 667, - 'lcommaaccent': 278, - 'tcaron': 300, - 'eogonek': 444, - 'Uogonek': 722, - 'Aacute': 611, - 'Adieresis': 611, - 'egrave': 444, - 'zacute': 389, - 'iogonek': 278, - 'Oacute': 722, - 'oacute': 500, - 'amacron': 500, - 'sacute': 389, - 'idieresis': 278, - 'Ocircumflex': 722, - 'Ugrave': 722, - 'Delta': 612, - 'thorn': 500, - 'twosuperior': 300, - 'Odieresis': 722, - 'mu': 500, - 'igrave': 278, - 'ohungarumlaut': 500, - 'Eogonek': 611, - 'dcroat': 500, - 'threequarters': 750, - 'Scedilla': 500, - 'lcaron': 300, - 'Kcommaaccent': 667, - 'Lacute': 556, - 'trademark': 980, - 'edotaccent': 444, - 'Igrave': 333, - 'Imacron': 333, - 'Lcaron': 611, - 'onehalf': 750, - 'lessequal': 549, - 'ocircumflex': 500, - 'ntilde': 500, - 'Uhungarumlaut': 722, - 'Eacute': 611, - 'emacron': 444, - 'gbreve': 500, - 'onequarter': 750, - 'Scaron': 500, - 'Scommaaccent': 500, - 'Ohungarumlaut': 722, - 'degree': 400, - 'ograve': 500, - 'Ccaron': 667, - 'ugrave': 500, - 'radical': 453, - 'Dcaron': 722, - 'rcommaaccent': 389, - 'Ntilde': 667, - 'otilde': 500, - 'Rcommaaccent': 611, - 'Lcommaaccent': 556, - 'Atilde': 611, - 'Aogonek': 611, - 'Aring': 611, - 'Otilde': 722, - 'zdotaccent': 389, - 'Ecaron': 611, - 'Iogonek': 333, - 'kcommaaccent': 444, - 'minus': 675, - 'Icircumflex': 333, - 'ncaron': 500, - 'tcommaaccent': 278, - 'logicalnot': 675, - 'odieresis': 500, - 'udieresis': 500, - 'notequal': 549, - 'gcommaaccent': 500, - 'eth': 500, - 'zcaron': 389, - 'ncommaaccent': 500, - 'onesuperior': 300, - 'imacron': 278, - 'Euro': 500 - }, - 'ZapfDingbats': { - 'space': 278, - 'a1': 974, - 'a2': 961, - 'a202': 974, - 'a3': 980, - 'a4': 719, - 'a5': 789, - 'a119': 790, - 'a118': 791, - 'a117': 690, - 'a11': 960, - 'a12': 939, - 'a13': 549, - 'a14': 855, - 'a15': 911, - 'a16': 933, - 'a105': 911, - 'a17': 945, - 'a18': 974, - 'a19': 755, - 'a20': 846, - 'a21': 762, - 'a22': 761, - 'a23': 571, - 'a24': 677, - 'a25': 763, - 'a26': 760, - 'a27': 759, - 'a28': 754, - 'a6': 494, - 'a7': 552, - 'a8': 537, - 'a9': 577, - 'a10': 692, - 'a29': 786, - 'a30': 788, - 'a31': 788, - 'a32': 790, - 'a33': 793, - 'a34': 794, - 'a35': 816, - 'a36': 823, - 'a37': 789, - 'a38': 841, - 'a39': 823, - 'a40': 833, - 'a41': 816, - 'a42': 831, - 'a43': 923, - 'a44': 744, - 'a45': 723, - 'a46': 749, - 'a47': 790, - 'a48': 792, - 'a49': 695, - 'a50': 776, - 'a51': 768, - 'a52': 792, - 'a53': 759, - 'a54': 707, - 'a55': 708, - 'a56': 682, - 'a57': 701, - 'a58': 826, - 'a59': 815, - 'a60': 789, - 'a61': 789, - 'a62': 707, - 'a63': 687, - 'a64': 696, - 'a65': 689, - 'a66': 786, - 'a67': 787, - 'a68': 713, - 'a69': 791, - 'a70': 785, - 'a71': 791, - 'a72': 873, - 'a73': 761, - 'a74': 762, - 'a203': 762, - 'a75': 759, - 'a204': 759, - 'a76': 892, - 'a77': 892, - 'a78': 788, - 'a79': 784, - 'a81': 438, - 'a82': 138, - 'a83': 277, - 'a84': 415, - 'a97': 392, - 'a98': 392, - 'a99': 668, - 'a100': 668, - 'a89': 390, - 'a90': 390, - 'a93': 317, - 'a94': 317, - 'a91': 276, - 'a92': 276, - 'a205': 509, - 'a85': 509, - 'a206': 410, - 'a86': 410, - 'a87': 234, - 'a88': 234, - 'a95': 334, - 'a96': 334, - 'a101': 732, - 'a102': 544, - 'a103': 544, - 'a104': 910, - 'a106': 667, - 'a107': 760, - 'a108': 760, - 'a112': 776, - 'a111': 595, - 'a110': 694, - 'a109': 626, - 'a120': 788, - 'a121': 788, - 'a122': 788, - 'a123': 788, - 'a124': 788, - 'a125': 788, - 'a126': 788, - 'a127': 788, - 'a128': 788, - 'a129': 788, - 'a130': 788, - 'a131': 788, - 'a132': 788, - 'a133': 788, - 'a134': 788, - 'a135': 788, - 'a136': 788, - 'a137': 788, - 'a138': 788, - 'a139': 788, - 'a140': 788, - 'a141': 788, - 'a142': 788, - 'a143': 788, - 'a144': 788, - 'a145': 788, - 'a146': 788, - 'a147': 788, - 'a148': 788, - 'a149': 788, - 'a150': 788, - 'a151': 788, - 'a152': 788, - 'a153': 788, - 'a154': 788, - 'a155': 788, - 'a156': 788, - 'a157': 788, - 'a158': 788, - 'a159': 788, - 'a160': 894, - 'a161': 838, - 'a163': 1016, - 'a164': 458, - 'a196': 748, - 'a165': 924, - 'a192': 748, - 'a166': 918, - 'a167': 927, - 'a168': 928, - 'a169': 928, - 'a170': 834, - 'a171': 873, - 'a172': 828, - 'a173': 924, - 'a162': 924, - 'a174': 917, - 'a175': 930, - 'a176': 931, - 'a177': 463, - 'a178': 883, - 'a179': 836, - 'a193': 836, - 'a180': 867, - 'a199': 867, - 'a181': 696, - 'a200': 696, - 'a182': 874, - 'a201': 874, - 'a183': 760, - 'a184': 946, - 'a197': 771, - 'a185': 865, - 'a194': 771, - 'a198': 888, - 'a186': 967, - 'a195': 888, - 'a187': 831, - 'a188': 873, - 'a189': 927, - 'a190': 970, - 'a191': 918 - } -}; - - -var EOF = {}; - -function isEOF(v) { - return (v === EOF); -} - -var MAX_LENGTH_TO_CACHE = 1000; - -var Parser = (function ParserClosure() { - function Parser(lexer, allowStreams, xref) { - this.lexer = lexer; - this.allowStreams = allowStreams; - this.xref = xref; - this.imageCache = {}; - this.refill(); - } - - Parser.prototype = { - refill: function Parser_refill() { - this.buf1 = this.lexer.getObj(); - this.buf2 = this.lexer.getObj(); - }, - shift: function Parser_shift() { - if (isCmd(this.buf2, 'ID')) { - this.buf1 = this.buf2; - this.buf2 = null; - } else { - this.buf1 = this.buf2; - this.buf2 = this.lexer.getObj(); - } - }, - tryShift: function Parser_tryShift() { - try { - this.shift(); - return true; - } catch (e) { - if (e instanceof MissingDataException) { - throw e; - } - // Upon failure, the caller should reset this.lexer.pos to a known good - // state and call this.shift() twice to reset the buffers. - return false; - } - }, - getObj: function Parser_getObj(cipherTransform) { - var buf1 = this.buf1; - this.shift(); - - if (buf1 instanceof Cmd) { - switch (buf1.cmd) { - case 'BI': // inline image - return this.makeInlineImage(cipherTransform); - case '[': // array - var array = []; - while (!isCmd(this.buf1, ']') && !isEOF(this.buf1)) { - array.push(this.getObj(cipherTransform)); - } - if (isEOF(this.buf1)) { - error('End of file inside array'); - } - this.shift(); - return array; - case '<<': // dictionary or stream - var dict = new Dict(this.xref); - while (!isCmd(this.buf1, '>>') && !isEOF(this.buf1)) { - if (!isName(this.buf1)) { - info('Malformed dictionary: key must be a name object'); - this.shift(); - continue; - } - - var key = this.buf1.name; - this.shift(); - if (isEOF(this.buf1)) { - break; - } - dict.set(key, this.getObj(cipherTransform)); - } - if (isEOF(this.buf1)) { - error('End of file inside dictionary'); - } - - // Stream objects are not allowed inside content streams or - // object streams. - if (isCmd(this.buf2, 'stream')) { - return (this.allowStreams ? - this.makeStream(dict, cipherTransform) : dict); - } - this.shift(); - return dict; - default: // simple object - return buf1; - } - } - - if (isInt(buf1)) { // indirect reference or integer - var num = buf1; - if (isInt(this.buf1) && isCmd(this.buf2, 'R')) { - var ref = new Ref(num, this.buf1); - this.shift(); - this.shift(); - return ref; - } - return num; - } - - if (isString(buf1)) { // string - var str = buf1; - if (cipherTransform) { - str = cipherTransform.decryptString(str); - } - return str; - } - - // simple object - return buf1; - }, - /** - * Find the end of the stream by searching for the /EI\s/. - * @returns {number} The inline stream length. - */ - findDefaultInlineStreamEnd: - function Parser_findDefaultInlineStreamEnd(stream) { - var E = 0x45, I = 0x49, SPACE = 0x20, LF = 0xA, CR = 0xD; - var startPos = stream.pos, state = 0, ch, i, n, followingBytes; - while ((ch = stream.getByte()) !== -1) { - if (state === 0) { - state = (ch === E) ? 1 : 0; - } else if (state === 1) { - state = (ch === I) ? 2 : 0; - } else { - assert(state === 2); - if (ch === SPACE || ch === LF || ch === CR) { - // Let's check the next five bytes are ASCII... just be sure. - n = 5; - followingBytes = stream.peekBytes(n); - for (i = 0; i < n; i++) { - ch = followingBytes[i]; - if (ch !== LF && ch !== CR && (ch < SPACE || ch > 0x7F)) { - // Not a LF, CR, SPACE or any visible ASCII character, i.e. - // it's binary stuff. Resetting the state. - state = 0; - break; - } - } - if (state === 2) { - break; // Finished! - } - } else { - state = 0; - } - } - } - return ((stream.pos - 4) - startPos); - }, - /** - * Find the EOI (end-of-image) marker 0xFFD9 of the stream. - * @returns {number} The inline stream length. - */ - findDCTDecodeInlineStreamEnd: - function Parser_findDCTDecodeInlineStreamEnd(stream) { - var startPos = stream.pos, foundEOI = false, b, markerLength, length; - while ((b = stream.getByte()) !== -1) { - if (b !== 0xFF) { // Not a valid marker. - continue; - } - switch (stream.getByte()) { - case 0x00: // Byte stuffing. - // 0xFF00 appears to be a very common byte sequence in JPEG images. - break; - - case 0xFF: // Fill byte. - // Avoid skipping a valid marker, resetting the stream position. - stream.skip(-1); - break; - - case 0xD9: // EOI - foundEOI = true; - break; - - case 0xC0: // SOF0 - case 0xC1: // SOF1 - case 0xC2: // SOF2 - case 0xC3: // SOF3 - - case 0xC5: // SOF5 - case 0xC6: // SOF6 - case 0xC7: // SOF7 - - case 0xC9: // SOF9 - case 0xCA: // SOF10 - case 0xCB: // SOF11 - - case 0xCD: // SOF13 - case 0xCE: // SOF14 - case 0xCF: // SOF15 - - case 0xC4: // DHT - case 0xCC: // DAC - - case 0xDA: // SOS - case 0xDB: // DQT - case 0xDC: // DNL - case 0xDD: // DRI - case 0xDE: // DHP - case 0xDF: // EXP - - case 0xE0: // APP0 - case 0xE1: // APP1 - case 0xE2: // APP2 - case 0xE3: // APP3 - case 0xE4: // APP4 - case 0xE5: // APP5 - case 0xE6: // APP6 - case 0xE7: // APP7 - case 0xE8: // APP8 - case 0xE9: // APP9 - case 0xEA: // APP10 - case 0xEB: // APP11 - case 0xEC: // APP12 - case 0xED: // APP13 - case 0xEE: // APP14 - case 0xEF: // APP15 - - case 0xFE: // COM - // The marker should be followed by the length of the segment. - markerLength = stream.getUint16(); - if (markerLength > 2) { - // |markerLength| contains the byte length of the marker segment, - // including its own length (2 bytes) and excluding the marker. - stream.skip(markerLength - 2); // Jump to the next marker. - } else { - // The marker length is invalid, resetting the stream position. - stream.skip(-2); - } - break; - } - if (foundEOI) { - break; - } - } - length = stream.pos - startPos; - if (b === -1) { - warn('Inline DCTDecode image stream: ' + - 'EOI marker not found, searching for /EI/ instead.'); - stream.skip(-length); // Reset the stream position. - return this.findDefaultInlineStreamEnd(stream); - } - this.inlineStreamSkipEI(stream); - return length; - }, - /** - * Find the EOD (end-of-data) marker '~>' (i.e. TILDE + GT) of the stream. - * @returns {number} The inline stream length. - */ - findASCII85DecodeInlineStreamEnd: - function Parser_findASCII85DecodeInlineStreamEnd(stream) { - var TILDE = 0x7E, GT = 0x3E; - var startPos = stream.pos, ch, length; - while ((ch = stream.getByte()) !== -1) { - if (ch === TILDE && stream.peekByte() === GT) { - stream.skip(); - break; - } - } - length = stream.pos - startPos; - if (ch === -1) { - warn('Inline ASCII85Decode image stream: ' + - 'EOD marker not found, searching for /EI/ instead.'); - stream.skip(-length); // Reset the stream position. - return this.findDefaultInlineStreamEnd(stream); - } - this.inlineStreamSkipEI(stream); - return length; - }, - /** - * Find the EOD (end-of-data) marker '>' (i.e. GT) of the stream. - * @returns {number} The inline stream length. - */ - findASCIIHexDecodeInlineStreamEnd: - function Parser_findASCIIHexDecodeInlineStreamEnd(stream) { - var GT = 0x3E; - var startPos = stream.pos, ch, length; - while ((ch = stream.getByte()) !== -1) { - if (ch === GT) { - break; - } - } - length = stream.pos - startPos; - if (ch === -1) { - warn('Inline ASCIIHexDecode image stream: ' + - 'EOD marker not found, searching for /EI/ instead.'); - stream.skip(-length); // Reset the stream position. - return this.findDefaultInlineStreamEnd(stream); - } - this.inlineStreamSkipEI(stream); - return length; - }, - /** - * Skip over the /EI/ for streams where we search for an EOD marker. - */ - inlineStreamSkipEI: function Parser_inlineStreamSkipEI(stream) { - var E = 0x45, I = 0x49; - var state = 0, ch; - while ((ch = stream.getByte()) !== -1) { - if (state === 0) { - state = (ch === E) ? 1 : 0; - } else if (state === 1) { - state = (ch === I) ? 2 : 0; - } else if (state === 2) { - break; - } - } - }, - makeInlineImage: function Parser_makeInlineImage(cipherTransform) { - var lexer = this.lexer; - var stream = lexer.stream; - - // Parse dictionary. - var dict = new Dict(this.xref); - while (!isCmd(this.buf1, 'ID') && !isEOF(this.buf1)) { - if (!isName(this.buf1)) { - error('Dictionary key must be a name object'); - } - var key = this.buf1.name; - this.shift(); - if (isEOF(this.buf1)) { - break; - } - dict.set(key, this.getObj(cipherTransform)); - } - - // Extract the name of the first (i.e. the current) image filter. - var filter = dict.get('Filter', 'F'), filterName; - if (isName(filter)) { - filterName = filter.name; - } else if (isArray(filter) && isName(filter[0])) { - filterName = filter[0].name; - } - - // Parse image stream. - var startPos = stream.pos, length, i, ii; - if (filterName === 'DCTDecode' || filterName === 'DCT') { - length = this.findDCTDecodeInlineStreamEnd(stream); - } else if (filterName === 'ASCII85Decide' || filterName === 'A85') { - length = this.findASCII85DecodeInlineStreamEnd(stream); - } else if (filterName === 'ASCIIHexDecode' || filterName === 'AHx') { - length = this.findASCIIHexDecodeInlineStreamEnd(stream); - } else { - length = this.findDefaultInlineStreamEnd(stream); - } - var imageStream = stream.makeSubStream(startPos, length, dict); - - // Cache all images below the MAX_LENGTH_TO_CACHE threshold by their - // adler32 checksum. - var adler32; - if (length < MAX_LENGTH_TO_CACHE) { - var imageBytes = imageStream.getBytes(); - imageStream.reset(); - - var a = 1; - var b = 0; - for (i = 0, ii = imageBytes.length; i < ii; ++i) { - // No modulo required in the loop if imageBytes.length < 5552. - a += imageBytes[i] & 0xff; - b += a; - } - adler32 = ((b % 65521) << 16) | (a % 65521); - - if (this.imageCache.adler32 === adler32) { - this.buf2 = Cmd.get('EI'); - this.shift(); - - this.imageCache[adler32].reset(); - return this.imageCache[adler32]; - } - } - - if (cipherTransform) { - imageStream = cipherTransform.createStream(imageStream, length); - } - - imageStream = this.filter(imageStream, dict, length); - imageStream.dict = dict; - if (adler32 !== undefined) { - imageStream.cacheKey = 'inline_' + length + '_' + adler32; - this.imageCache[adler32] = imageStream; - } - - this.buf2 = Cmd.get('EI'); - this.shift(); - - return imageStream; - }, - makeStream: function Parser_makeStream(dict, cipherTransform) { - var lexer = this.lexer; - var stream = lexer.stream; - - // get stream start position - lexer.skipToNextLine(); - var pos = stream.pos - 1; - - // get length - var length = dict.get('Length'); - if (!isInt(length)) { - info('Bad ' + length + ' attribute in stream'); - length = 0; - } - - // skip over the stream data - stream.pos = pos + length; - lexer.nextChar(); - - // Shift '>>' and check whether the new object marks the end of the stream - if (this.tryShift() && isCmd(this.buf2, 'endstream')) { - this.shift(); // 'stream' - } else { - // bad stream length, scanning for endstream - stream.pos = pos; - var SCAN_BLOCK_SIZE = 2048; - var ENDSTREAM_SIGNATURE_LENGTH = 9; - var ENDSTREAM_SIGNATURE = [0x65, 0x6E, 0x64, 0x73, 0x74, 0x72, 0x65, - 0x61, 0x6D]; - var skipped = 0, found = false, i, j; - while (stream.pos < stream.end) { - var scanBytes = stream.peekBytes(SCAN_BLOCK_SIZE); - var scanLength = scanBytes.length - ENDSTREAM_SIGNATURE_LENGTH; - if (scanLength <= 0) { - break; - } - found = false; - for (i = 0, j = 0; i < scanLength; i++) { - var b = scanBytes[i]; - if (b !== ENDSTREAM_SIGNATURE[j]) { - i -= j; - j = 0; - } else { - j++; - if (j >= ENDSTREAM_SIGNATURE_LENGTH) { - i++; - found = true; - break; - } - } - } - if (found) { - skipped += i - ENDSTREAM_SIGNATURE_LENGTH; - stream.pos += i - ENDSTREAM_SIGNATURE_LENGTH; - break; - } - skipped += scanLength; - stream.pos += scanLength; - } - if (!found) { - error('Missing endstream'); - } - length = skipped; - - lexer.nextChar(); - this.shift(); - this.shift(); - } - this.shift(); // 'endstream' - - stream = stream.makeSubStream(pos, length, dict); - if (cipherTransform) { - stream = cipherTransform.createStream(stream, length); - } - stream = this.filter(stream, dict, length); - stream.dict = dict; - return stream; - }, - filter: function Parser_filter(stream, dict, length) { - var filter = dict.get('Filter', 'F'); - var params = dict.get('DecodeParms', 'DP'); - if (isName(filter)) { - return this.makeFilter(stream, filter.name, length, params); - } - - var maybeLength = length; - if (isArray(filter)) { - var filterArray = filter; - var paramsArray = params; - for (var i = 0, ii = filterArray.length; i < ii; ++i) { - filter = filterArray[i]; - if (!isName(filter)) { - error('Bad filter name: ' + filter); - } - - params = null; - if (isArray(paramsArray) && (i in paramsArray)) { - params = paramsArray[i]; - } - stream = this.makeFilter(stream, filter.name, maybeLength, params); - // after the first stream the length variable is invalid - maybeLength = null; - } - } - return stream; - }, - makeFilter: function Parser_makeFilter(stream, name, maybeLength, params) { - if (stream.dict.get('Length') === 0 && !maybeLength) { - warn('Empty "' + name + '" stream.'); - return new NullStream(stream); - } - try { - if (params && this.xref) { - params = this.xref.fetchIfRef(params); - } - var xrefStreamStats = this.xref.stats.streamTypes; - if (name === 'FlateDecode' || name === 'Fl') { - xrefStreamStats[StreamType.FLATE] = true; - if (params) { - return new PredictorStream(new FlateStream(stream, maybeLength), - maybeLength, params); - } - return new FlateStream(stream, maybeLength); - } - if (name === 'LZWDecode' || name === 'LZW') { - xrefStreamStats[StreamType.LZW] = true; - var earlyChange = 1; - if (params) { - if (params.has('EarlyChange')) { - earlyChange = params.get('EarlyChange'); - } - return new PredictorStream( - new LZWStream(stream, maybeLength, earlyChange), - maybeLength, params); - } - return new LZWStream(stream, maybeLength, earlyChange); - } - if (name === 'DCTDecode' || name === 'DCT') { - xrefStreamStats[StreamType.DCT] = true; - return new JpegStream(stream, maybeLength, stream.dict, this.xref); - } - if (name === 'JPXDecode' || name === 'JPX') { - xrefStreamStats[StreamType.JPX] = true; - return new JpxStream(stream, maybeLength, stream.dict); - } - if (name === 'ASCII85Decode' || name === 'A85') { - xrefStreamStats[StreamType.A85] = true; - return new Ascii85Stream(stream, maybeLength); - } - if (name === 'ASCIIHexDecode' || name === 'AHx') { - xrefStreamStats[StreamType.AHX] = true; - return new AsciiHexStream(stream, maybeLength); - } - if (name === 'CCITTFaxDecode' || name === 'CCF') { - xrefStreamStats[StreamType.CCF] = true; - return new CCITTFaxStream(stream, maybeLength, params); - } - if (name === 'RunLengthDecode' || name === 'RL') { - xrefStreamStats[StreamType.RL] = true; - return new RunLengthStream(stream, maybeLength); - } - if (name === 'JBIG2Decode') { - xrefStreamStats[StreamType.JBIG] = true; - return new Jbig2Stream(stream, maybeLength, stream.dict); - } - warn('filter "' + name + '" not supported yet'); - return stream; - } catch (ex) { - if (ex instanceof MissingDataException) { - throw ex; - } - warn('Invalid stream: \"' + ex + '\"'); - return new NullStream(stream); - } - } - }; - - return Parser; -})(); - -var Lexer = (function LexerClosure() { - function Lexer(stream, knownCommands) { - this.stream = stream; - this.nextChar(); - - // While lexing, we build up many strings one char at a time. Using += for - // this can result in lots of garbage strings. It's better to build an - // array of single-char strings and then join() them together at the end. - // And reusing a single array (i.e. |this.strBuf|) over and over for this - // purpose uses less memory than using a new array for each string. - this.strBuf = []; - - // The PDFs might have "glued" commands with other commands, operands or - // literals, e.g. "q1". The knownCommands is a dictionary of the valid - // commands and their prefixes. The prefixes are built the following way: - // if there a command that is a prefix of the other valid command or - // literal (e.g. 'f' and 'false') the following prefixes must be included, - // 'fa', 'fal', 'fals'. The prefixes are not needed, if the command has no - // other commands or literals as a prefix. The knowCommands is optional. - this.knownCommands = knownCommands; - } - - Lexer.isSpace = function Lexer_isSpace(ch) { - // Space is one of the following characters: SPACE, TAB, CR or LF. - return (ch === 0x20 || ch === 0x09 || ch === 0x0D || ch === 0x0A); - }; - - // A '1' in this array means the character is white space. A '1' or - // '2' means the character ends a name or command. - var specialChars = [ - 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, // 0x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1x - 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, // 2x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, // 3x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 4x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 5x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 6x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 7x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 8x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 9x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ax - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // bx - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // cx - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // dx - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ex - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // fx - ]; - - function toHexDigit(ch) { - if (ch >= 0x30 && ch <= 0x39) { // '0'-'9' - return ch & 0x0F; - } - if ((ch >= 0x41 && ch <= 0x46) || (ch >= 0x61 && ch <= 0x66)) { - // 'A'-'F', 'a'-'f' - return (ch & 0x0F) + 9; - } - return -1; - } - - Lexer.prototype = { - nextChar: function Lexer_nextChar() { - return (this.currentChar = this.stream.getByte()); - }, - peekChar: function Lexer_peekChar() { - return this.stream.peekByte(); - }, - getNumber: function Lexer_getNumber() { - var ch = this.currentChar; - var eNotation = false; - var divideBy = 0; // different from 0 if it's a floating point value - var sign = 1; - - if (ch === 0x2D) { // '-' - sign = -1; - ch = this.nextChar(); - - if (ch === 0x2D) { // '-' - // Ignore double negative (this is consistent with Adobe Reader). - ch = this.nextChar(); - } - } else if (ch === 0x2B) { // '+' - ch = this.nextChar(); - } - if (ch === 0x2E) { // '.' - divideBy = 10; - ch = this.nextChar(); - } - if (ch < 0x30 || ch > 0x39) { // '0' - '9' - error('Invalid number: ' + String.fromCharCode(ch)); - return 0; - } - - var baseValue = ch - 0x30; // '0' - var powerValue = 0; - var powerValueSign = 1; - - while ((ch = this.nextChar()) >= 0) { - if (0x30 <= ch && ch <= 0x39) { // '0' - '9' - var currentDigit = ch - 0x30; // '0' - if (eNotation) { // We are after an 'e' or 'E' - powerValue = powerValue * 10 + currentDigit; - } else { - if (divideBy !== 0) { // We are after a point - divideBy *= 10; - } - baseValue = baseValue * 10 + currentDigit; - } - } else if (ch === 0x2E) { // '.' - if (divideBy === 0) { - divideBy = 1; - } else { - // A number can have only one '.' - break; - } - } else if (ch === 0x2D) { // '-' - // ignore minus signs in the middle of numbers to match - // Adobe's behavior - warn('Badly formated number'); - } else if (ch === 0x45 || ch === 0x65) { // 'E', 'e' - // 'E' can be either a scientific notation or the beginning of a new - // operator - ch = this.peekChar(); - if (ch === 0x2B || ch === 0x2D) { // '+', '-' - powerValueSign = (ch === 0x2D) ? -1 : 1; - this.nextChar(); // Consume the sign character - } else if (ch < 0x30 || ch > 0x39) { // '0' - '9' - // The 'E' must be the beginning of a new operator - break; - } - eNotation = true; - } else { - // the last character doesn't belong to us - break; - } - } - - if (divideBy !== 0) { - baseValue /= divideBy; - } - if (eNotation) { - baseValue *= Math.pow(10, powerValueSign * powerValue); - } - return sign * baseValue; - }, - getString: function Lexer_getString() { - var numParen = 1; - var done = false; - var strBuf = this.strBuf; - strBuf.length = 0; - - var ch = this.nextChar(); - while (true) { - var charBuffered = false; - switch (ch | 0) { - case -1: - warn('Unterminated string'); - done = true; - break; - case 0x28: // '(' - ++numParen; - strBuf.push('('); - break; - case 0x29: // ')' - if (--numParen === 0) { - this.nextChar(); // consume strings ')' - done = true; - } else { - strBuf.push(')'); - } - break; - case 0x5C: // '\\' - ch = this.nextChar(); - switch (ch) { - case -1: - warn('Unterminated string'); - done = true; - break; - case 0x6E: // 'n' - strBuf.push('\n'); - break; - case 0x72: // 'r' - strBuf.push('\r'); - break; - case 0x74: // 't' - strBuf.push('\t'); - break; - case 0x62: // 'b' - strBuf.push('\b'); - break; - case 0x66: // 'f' - strBuf.push('\f'); - break; - case 0x5C: // '\' - case 0x28: // '(' - case 0x29: // ')' - strBuf.push(String.fromCharCode(ch)); - break; - case 0x30: case 0x31: case 0x32: case 0x33: // '0'-'3' - case 0x34: case 0x35: case 0x36: case 0x37: // '4'-'7' - var x = ch & 0x0F; - ch = this.nextChar(); - charBuffered = true; - if (ch >= 0x30 && ch <= 0x37) { // '0'-'7' - x = (x << 3) + (ch & 0x0F); - ch = this.nextChar(); - if (ch >= 0x30 && ch <= 0x37) { // '0'-'7' - charBuffered = false; - x = (x << 3) + (ch & 0x0F); - } - } - strBuf.push(String.fromCharCode(x)); - break; - case 0x0D: // CR - if (this.peekChar() === 0x0A) { // LF - this.nextChar(); - } - break; - case 0x0A: // LF - break; - default: - strBuf.push(String.fromCharCode(ch)); - break; - } - break; - default: - strBuf.push(String.fromCharCode(ch)); - break; - } - if (done) { - break; - } - if (!charBuffered) { - ch = this.nextChar(); - } - } - return strBuf.join(''); - }, - getName: function Lexer_getName() { - var ch, previousCh; - var strBuf = this.strBuf; - strBuf.length = 0; - while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { - if (ch === 0x23) { // '#' - ch = this.nextChar(); - if (specialChars[ch]) { - warn('Lexer_getName: ' + - 'NUMBER SIGN (#) should be followed by a hexadecimal number.'); - strBuf.push('#'); - break; - } - var x = toHexDigit(ch); - if (x !== -1) { - previousCh = ch; - ch = this.nextChar(); - var x2 = toHexDigit(ch); - if (x2 === -1) { - warn('Lexer_getName: Illegal digit (' + - String.fromCharCode(ch) +') in hexadecimal number.'); - strBuf.push('#', String.fromCharCode(previousCh)); - if (specialChars[ch]) { - break; - } - strBuf.push(String.fromCharCode(ch)); - continue; - } - strBuf.push(String.fromCharCode((x << 4) | x2)); - } else { - strBuf.push('#', String.fromCharCode(ch)); - } - } else { - strBuf.push(String.fromCharCode(ch)); - } - } - if (strBuf.length > 127) { - warn('name token is longer than allowed by the spec: ' + strBuf.length); - } - return Name.get(strBuf.join('')); - }, - getHexString: function Lexer_getHexString() { - var strBuf = this.strBuf; - strBuf.length = 0; - var ch = this.currentChar; - var isFirstHex = true; - var firstDigit; - var secondDigit; - while (true) { - if (ch < 0) { - warn('Unterminated hex string'); - break; - } else if (ch === 0x3E) { // '>' - this.nextChar(); - break; - } else if (specialChars[ch] === 1) { - ch = this.nextChar(); - continue; - } else { - if (isFirstHex) { - firstDigit = toHexDigit(ch); - if (firstDigit === -1) { - warn('Ignoring invalid character "' + ch + '" in hex string'); - ch = this.nextChar(); - continue; - } - } else { - secondDigit = toHexDigit(ch); - if (secondDigit === -1) { - warn('Ignoring invalid character "' + ch + '" in hex string'); - ch = this.nextChar(); - continue; - } - strBuf.push(String.fromCharCode((firstDigit << 4) | secondDigit)); - } - isFirstHex = !isFirstHex; - ch = this.nextChar(); - } - } - return strBuf.join(''); - }, - getObj: function Lexer_getObj() { - // skip whitespace and comments - var comment = false; - var ch = this.currentChar; - while (true) { - if (ch < 0) { - return EOF; - } - if (comment) { - if (ch === 0x0A || ch === 0x0D) { // LF, CR - comment = false; - } - } else if (ch === 0x25) { // '%' - comment = true; - } else if (specialChars[ch] !== 1) { - break; - } - ch = this.nextChar(); - } - - // start reading token - switch (ch | 0) { - case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: // '0'-'4' - case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: // '5'-'9' - case 0x2B: case 0x2D: case 0x2E: // '+', '-', '.' - return this.getNumber(); - case 0x28: // '(' - return this.getString(); - case 0x2F: // '/' - return this.getName(); - // array punctuation - case 0x5B: // '[' - this.nextChar(); - return Cmd.get('['); - case 0x5D: // ']' - this.nextChar(); - return Cmd.get(']'); - // hex string or dict punctuation - case 0x3C: // '<' - ch = this.nextChar(); - if (ch === 0x3C) { - // dict punctuation - this.nextChar(); - return Cmd.get('<<'); - } - return this.getHexString(); - // dict punctuation - case 0x3E: // '>' - ch = this.nextChar(); - if (ch === 0x3E) { - this.nextChar(); - return Cmd.get('>>'); - } - return Cmd.get('>'); - case 0x7B: // '{' - this.nextChar(); - return Cmd.get('{'); - case 0x7D: // '}' - this.nextChar(); - return Cmd.get('}'); - case 0x29: // ')' - error('Illegal character: ' + ch); - break; - } - - // command - var str = String.fromCharCode(ch); - var knownCommands = this.knownCommands; - var knownCommandFound = knownCommands && knownCommands[str] !== undefined; - while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { - // stop if known command is found and next character does not make - // the str a command - var possibleCommand = str + String.fromCharCode(ch); - if (knownCommandFound && knownCommands[possibleCommand] === undefined) { - break; - } - if (str.length === 128) { - error('Command token too long: ' + str.length); - } - str = possibleCommand; - knownCommandFound = knownCommands && knownCommands[str] !== undefined; - } - if (str === 'true') { - return true; - } - if (str === 'false') { - return false; - } - if (str === 'null') { - return null; - } - return Cmd.get(str); - }, - skipToNextLine: function Lexer_skipToNextLine() { - var ch = this.currentChar; - while (ch >= 0) { - if (ch === 0x0D) { // CR - ch = this.nextChar(); - if (ch === 0x0A) { // LF - this.nextChar(); - } - break; - } else if (ch === 0x0A) { // LF - this.nextChar(); - break; - } - ch = this.nextChar(); - } - } - }; - - return Lexer; -})(); - -var Linearization = { - create: function LinearizationCreate(stream) { - function getInt(name, allowZeroValue) { - var obj = linDict.get(name); - if (isInt(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) { - return obj; - } - throw new Error('The "' + name + '" parameter in the linearization ' + - 'dictionary is invalid.'); - } - function getHints() { - var hints = linDict.get('H'), hintsLength, item; - if (isArray(hints) && - ((hintsLength = hints.length) === 2 || hintsLength === 4)) { - for (var index = 0; index < hintsLength; index++) { - if (!(isInt(item = hints[index]) && item > 0)) { - throw new Error('Hint (' + index + - ') in the linearization dictionary is invalid.'); - } - } - return hints; - } - throw new Error('Hint array in the linearization dictionary is invalid.'); - } - var parser = new Parser(new Lexer(stream), false, null); - var obj1 = parser.getObj(); - var obj2 = parser.getObj(); - var obj3 = parser.getObj(); - var linDict = parser.getObj(); - var obj, length; - if (!(isInt(obj1) && isInt(obj2) && isCmd(obj3, 'obj') && isDict(linDict) && - isNum(obj = linDict.get('Linearized')) && obj > 0)) { - return null; // No valid linearization dictionary found. - } else if ((length = getInt('L')) !== stream.length) { - throw new Error('The "L" parameter in the linearization dictionary ' + - 'does not equal the stream length.'); - } - return { - length: length, - hints: getHints(), - objectNumberFirst: getInt('O'), - endFirst: getInt('E'), - numPages: getInt('N'), - mainXRefEntriesOffset: getInt('T'), - pageFirst: (linDict.has('P') ? getInt('P', true) : 0) - }; - } -}; - - -var PostScriptParser = (function PostScriptParserClosure() { - function PostScriptParser(lexer) { - this.lexer = lexer; - this.operators = []; - this.token = null; - this.prev = null; - } - PostScriptParser.prototype = { - nextToken: function PostScriptParser_nextToken() { - this.prev = this.token; - this.token = this.lexer.getToken(); - }, - accept: function PostScriptParser_accept(type) { - if (this.token.type === type) { - this.nextToken(); - return true; - } - return false; - }, - expect: function PostScriptParser_expect(type) { - if (this.accept(type)) { - return true; - } - error('Unexpected symbol: found ' + this.token.type + ' expected ' + - type + '.'); - }, - parse: function PostScriptParser_parse() { - this.nextToken(); - this.expect(PostScriptTokenTypes.LBRACE); - this.parseBlock(); - this.expect(PostScriptTokenTypes.RBRACE); - return this.operators; - }, - parseBlock: function PostScriptParser_parseBlock() { - while (true) { - if (this.accept(PostScriptTokenTypes.NUMBER)) { - this.operators.push(this.prev.value); - } else if (this.accept(PostScriptTokenTypes.OPERATOR)) { - this.operators.push(this.prev.value); - } else if (this.accept(PostScriptTokenTypes.LBRACE)) { - this.parseCondition(); - } else { - return; - } - } - }, - parseCondition: function PostScriptParser_parseCondition() { - // Add two place holders that will be updated later - var conditionLocation = this.operators.length; - this.operators.push(null, null); - - this.parseBlock(); - this.expect(PostScriptTokenTypes.RBRACE); - if (this.accept(PostScriptTokenTypes.IF)) { - // The true block is right after the 'if' so it just falls through on - // true else it jumps and skips the true block. - this.operators[conditionLocation] = this.operators.length; - this.operators[conditionLocation + 1] = 'jz'; - } else if (this.accept(PostScriptTokenTypes.LBRACE)) { - var jumpLocation = this.operators.length; - this.operators.push(null, null); - var endOfTrue = this.operators.length; - this.parseBlock(); - this.expect(PostScriptTokenTypes.RBRACE); - this.expect(PostScriptTokenTypes.IFELSE); - // The jump is added at the end of the true block to skip the false - // block. - this.operators[jumpLocation] = this.operators.length; - this.operators[jumpLocation + 1] = 'j'; - - this.operators[conditionLocation] = endOfTrue; - this.operators[conditionLocation + 1] = 'jz'; - } else { - error('PS Function: error parsing conditional.'); - } - } - }; - return PostScriptParser; -})(); - -var PostScriptTokenTypes = { - LBRACE: 0, - RBRACE: 1, - NUMBER: 2, - OPERATOR: 3, - IF: 4, - IFELSE: 5 -}; - -var PostScriptToken = (function PostScriptTokenClosure() { - function PostScriptToken(type, value) { - this.type = type; - this.value = value; - } - - var opCache = {}; - - PostScriptToken.getOperator = function PostScriptToken_getOperator(op) { - var opValue = opCache[op]; - if (opValue) { - return opValue; - } - return opCache[op] = new PostScriptToken(PostScriptTokenTypes.OPERATOR, op); - }; - - PostScriptToken.LBRACE = new PostScriptToken(PostScriptTokenTypes.LBRACE, - '{'); - PostScriptToken.RBRACE = new PostScriptToken(PostScriptTokenTypes.RBRACE, - '}'); - PostScriptToken.IF = new PostScriptToken(PostScriptTokenTypes.IF, 'IF'); - PostScriptToken.IFELSE = new PostScriptToken(PostScriptTokenTypes.IFELSE, - 'IFELSE'); - return PostScriptToken; -})(); - -var PostScriptLexer = (function PostScriptLexerClosure() { - function PostScriptLexer(stream) { - this.stream = stream; - this.nextChar(); - - this.strBuf = []; - } - PostScriptLexer.prototype = { - nextChar: function PostScriptLexer_nextChar() { - return (this.currentChar = this.stream.getByte()); - }, - getToken: function PostScriptLexer_getToken() { - var comment = false; - var ch = this.currentChar; - - // skip comments - while (true) { - if (ch < 0) { - return EOF; - } - - if (comment) { - if (ch === 0x0A || ch === 0x0D) { - comment = false; - } - } else if (ch === 0x25) { // '%' - comment = true; - } else if (!Lexer.isSpace(ch)) { - break; - } - ch = this.nextChar(); - } - switch (ch | 0) { - case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: // '0'-'4' - case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: // '5'-'9' - case 0x2B: case 0x2D: case 0x2E: // '+', '-', '.' - return new PostScriptToken(PostScriptTokenTypes.NUMBER, - this.getNumber()); - case 0x7B: // '{' - this.nextChar(); - return PostScriptToken.LBRACE; - case 0x7D: // '}' - this.nextChar(); - return PostScriptToken.RBRACE; - } - // operator - var strBuf = this.strBuf; - strBuf.length = 0; - strBuf[0] = String.fromCharCode(ch); - - while ((ch = this.nextChar()) >= 0 && // and 'A'-'Z', 'a'-'z' - ((ch >= 0x41 && ch <= 0x5A) || (ch >= 0x61 && ch <= 0x7A))) { - strBuf.push(String.fromCharCode(ch)); - } - var str = strBuf.join(''); - switch (str.toLowerCase()) { - case 'if': - return PostScriptToken.IF; - case 'ifelse': - return PostScriptToken.IFELSE; - default: - return PostScriptToken.getOperator(str); - } - }, - getNumber: function PostScriptLexer_getNumber() { - var ch = this.currentChar; - var strBuf = this.strBuf; - strBuf.length = 0; - strBuf[0] = String.fromCharCode(ch); - - while ((ch = this.nextChar()) >= 0) { - if ((ch >= 0x30 && ch <= 0x39) || // '0'-'9' - ch === 0x2D || ch === 0x2E) { // '-', '.' - strBuf.push(String.fromCharCode(ch)); - } else { - break; - } - } - var value = parseFloat(strBuf.join('')); - if (isNaN(value)) { - error('Invalid floating point number: ' + value); - } - return value; - } - }; - return PostScriptLexer; -})(); - - -var Stream = (function StreamClosure() { - function Stream(arrayBuffer, start, length, dict) { - this.bytes = (arrayBuffer instanceof Uint8Array ? - arrayBuffer : new Uint8Array(arrayBuffer)); - this.start = start || 0; - this.pos = this.start; - this.end = (start + length) || this.bytes.length; - this.dict = dict; - } - - // required methods for a stream. if a particular stream does not - // implement these, an error should be thrown - Stream.prototype = { - get length() { - return this.end - this.start; - }, - get isEmpty() { - return this.length === 0; - }, - getByte: function Stream_getByte() { - if (this.pos >= this.end) { - return -1; - } - return this.bytes[this.pos++]; - }, - getUint16: function Stream_getUint16() { - var b0 = this.getByte(); - var b1 = this.getByte(); - if (b0 === -1 || b1 === -1) { - return -1; - } - return (b0 << 8) + b1; - }, - getInt32: function Stream_getInt32() { - var b0 = this.getByte(); - var b1 = this.getByte(); - var b2 = this.getByte(); - var b3 = this.getByte(); - return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; - }, - // returns subarray of original buffer - // should only be read - getBytes: function Stream_getBytes(length) { - var bytes = this.bytes; - var pos = this.pos; - var strEnd = this.end; - - if (!length) { - return bytes.subarray(pos, strEnd); - } - var end = pos + length; - if (end > strEnd) { - end = strEnd; - } - this.pos = end; - return bytes.subarray(pos, end); - }, - peekByte: function Stream_peekByte() { - var peekedByte = this.getByte(); - this.pos--; - return peekedByte; - }, - peekBytes: function Stream_peekBytes(length) { - var bytes = this.getBytes(length); - this.pos -= bytes.length; - return bytes; - }, - skip: function Stream_skip(n) { - if (!n) { - n = 1; - } - this.pos += n; - }, - reset: function Stream_reset() { - this.pos = this.start; - }, - moveStart: function Stream_moveStart() { - this.start = this.pos; - }, - makeSubStream: function Stream_makeSubStream(start, length, dict) { - return new Stream(this.bytes.buffer, start, length, dict); - }, - isStream: true - }; - - return Stream; -})(); - -var StringStream = (function StringStreamClosure() { - function StringStream(str) { - var length = str.length; - var bytes = new Uint8Array(length); - for (var n = 0; n < length; ++n) { - bytes[n] = str.charCodeAt(n); - } - Stream.call(this, bytes); - } - - StringStream.prototype = Stream.prototype; - - return StringStream; -})(); - -// super class for the decoding streams -var DecodeStream = (function DecodeStreamClosure() { - // Lots of DecodeStreams are created whose buffers are never used. For these - // we share a single empty buffer. This is (a) space-efficient and (b) avoids - // having special cases that would be required if we used |null| for an empty - // buffer. - var emptyBuffer = new Uint8Array(0); - - function DecodeStream(maybeMinBufferLength) { - this.pos = 0; - this.bufferLength = 0; - this.eof = false; - this.buffer = emptyBuffer; - this.minBufferLength = 512; - if (maybeMinBufferLength) { - // Compute the first power of two that is as big as maybeMinBufferLength. - while (this.minBufferLength < maybeMinBufferLength) { - this.minBufferLength *= 2; - } - } - } - - DecodeStream.prototype = { - get isEmpty() { - while (!this.eof && this.bufferLength === 0) { - this.readBlock(); - } - return this.bufferLength === 0; - }, - ensureBuffer: function DecodeStream_ensureBuffer(requested) { - var buffer = this.buffer; - if (requested <= buffer.byteLength) { - return buffer; - } - var size = this.minBufferLength; - while (size < requested) { - size *= 2; - } - var buffer2 = new Uint8Array(size); - buffer2.set(buffer); - return (this.buffer = buffer2); - }, - getByte: function DecodeStream_getByte() { - var pos = this.pos; - while (this.bufferLength <= pos) { - if (this.eof) { - return -1; - } - this.readBlock(); - } - return this.buffer[this.pos++]; - }, - getUint16: function DecodeStream_getUint16() { - var b0 = this.getByte(); - var b1 = this.getByte(); - if (b0 === -1 || b1 === -1) { - return -1; - } - return (b0 << 8) + b1; - }, - getInt32: function DecodeStream_getInt32() { - var b0 = this.getByte(); - var b1 = this.getByte(); - var b2 = this.getByte(); - var b3 = this.getByte(); - return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; - }, - getBytes: function DecodeStream_getBytes(length) { - var end, pos = this.pos; - - if (length) { - this.ensureBuffer(pos + length); - end = pos + length; - - while (!this.eof && this.bufferLength < end) { - this.readBlock(); - } - var bufEnd = this.bufferLength; - if (end > bufEnd) { - end = bufEnd; - } - } else { - while (!this.eof) { - this.readBlock(); - } - end = this.bufferLength; - } - - this.pos = end; - return this.buffer.subarray(pos, end); - }, - peekByte: function DecodeStream_peekByte() { - var peekedByte = this.getByte(); - this.pos--; - return peekedByte; - }, - peekBytes: function DecodeStream_peekBytes(length) { - var bytes = this.getBytes(length); - this.pos -= bytes.length; - return bytes; - }, - makeSubStream: function DecodeStream_makeSubStream(start, length, dict) { - var end = start + length; - while (this.bufferLength <= end && !this.eof) { - this.readBlock(); - } - return new Stream(this.buffer, start, length, dict); - }, - skip: function DecodeStream_skip(n) { - if (!n) { - n = 1; - } - this.pos += n; - }, - reset: function DecodeStream_reset() { - this.pos = 0; - }, - getBaseStreams: function DecodeStream_getBaseStreams() { - if (this.str && this.str.getBaseStreams) { - return this.str.getBaseStreams(); - } - return []; - } - }; - - return DecodeStream; -})(); - -var StreamsSequenceStream = (function StreamsSequenceStreamClosure() { - function StreamsSequenceStream(streams) { - this.streams = streams; - DecodeStream.call(this, /* maybeLength = */ null); - } - - StreamsSequenceStream.prototype = Object.create(DecodeStream.prototype); - - StreamsSequenceStream.prototype.readBlock = - function streamSequenceStreamReadBlock() { - - var streams = this.streams; - if (streams.length === 0) { - this.eof = true; - return; - } - var stream = streams.shift(); - var chunk = stream.getBytes(); - var bufferLength = this.bufferLength; - var newLength = bufferLength + chunk.length; - var buffer = this.ensureBuffer(newLength); - buffer.set(chunk, bufferLength); - this.bufferLength = newLength; - }; - - StreamsSequenceStream.prototype.getBaseStreams = - function StreamsSequenceStream_getBaseStreams() { - - var baseStreams = []; - for (var i = 0, ii = this.streams.length; i < ii; i++) { - var stream = this.streams[i]; - if (stream.getBaseStreams) { - Util.appendToArray(baseStreams, stream.getBaseStreams()); - } - } - return baseStreams; - }; - - return StreamsSequenceStream; -})(); - -var FlateStream = (function FlateStreamClosure() { - var codeLenCodeMap = new Int32Array([ - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 - ]); - - var lengthDecode = new Int32Array([ - 0x00003, 0x00004, 0x00005, 0x00006, 0x00007, 0x00008, 0x00009, 0x0000a, - 0x1000b, 0x1000d, 0x1000f, 0x10011, 0x20013, 0x20017, 0x2001b, 0x2001f, - 0x30023, 0x3002b, 0x30033, 0x3003b, 0x40043, 0x40053, 0x40063, 0x40073, - 0x50083, 0x500a3, 0x500c3, 0x500e3, 0x00102, 0x00102, 0x00102 - ]); - - var distDecode = new Int32Array([ - 0x00001, 0x00002, 0x00003, 0x00004, 0x10005, 0x10007, 0x20009, 0x2000d, - 0x30011, 0x30019, 0x40021, 0x40031, 0x50041, 0x50061, 0x60081, 0x600c1, - 0x70101, 0x70181, 0x80201, 0x80301, 0x90401, 0x90601, 0xa0801, 0xa0c01, - 0xb1001, 0xb1801, 0xc2001, 0xc3001, 0xd4001, 0xd6001 - ]); - - var fixedLitCodeTab = [new Int32Array([ - 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c0, - 0x70108, 0x80060, 0x80020, 0x900a0, 0x80000, 0x80080, 0x80040, 0x900e0, - 0x70104, 0x80058, 0x80018, 0x90090, 0x70114, 0x80078, 0x80038, 0x900d0, - 0x7010c, 0x80068, 0x80028, 0x900b0, 0x80008, 0x80088, 0x80048, 0x900f0, - 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c8, - 0x7010a, 0x80064, 0x80024, 0x900a8, 0x80004, 0x80084, 0x80044, 0x900e8, - 0x70106, 0x8005c, 0x8001c, 0x90098, 0x70116, 0x8007c, 0x8003c, 0x900d8, - 0x7010e, 0x8006c, 0x8002c, 0x900b8, 0x8000c, 0x8008c, 0x8004c, 0x900f8, - 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c4, - 0x70109, 0x80062, 0x80022, 0x900a4, 0x80002, 0x80082, 0x80042, 0x900e4, - 0x70105, 0x8005a, 0x8001a, 0x90094, 0x70115, 0x8007a, 0x8003a, 0x900d4, - 0x7010d, 0x8006a, 0x8002a, 0x900b4, 0x8000a, 0x8008a, 0x8004a, 0x900f4, - 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cc, - 0x7010b, 0x80066, 0x80026, 0x900ac, 0x80006, 0x80086, 0x80046, 0x900ec, - 0x70107, 0x8005e, 0x8001e, 0x9009c, 0x70117, 0x8007e, 0x8003e, 0x900dc, - 0x7010f, 0x8006e, 0x8002e, 0x900bc, 0x8000e, 0x8008e, 0x8004e, 0x900fc, - 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c2, - 0x70108, 0x80061, 0x80021, 0x900a2, 0x80001, 0x80081, 0x80041, 0x900e2, - 0x70104, 0x80059, 0x80019, 0x90092, 0x70114, 0x80079, 0x80039, 0x900d2, - 0x7010c, 0x80069, 0x80029, 0x900b2, 0x80009, 0x80089, 0x80049, 0x900f2, - 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900ca, - 0x7010a, 0x80065, 0x80025, 0x900aa, 0x80005, 0x80085, 0x80045, 0x900ea, - 0x70106, 0x8005d, 0x8001d, 0x9009a, 0x70116, 0x8007d, 0x8003d, 0x900da, - 0x7010e, 0x8006d, 0x8002d, 0x900ba, 0x8000d, 0x8008d, 0x8004d, 0x900fa, - 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c6, - 0x70109, 0x80063, 0x80023, 0x900a6, 0x80003, 0x80083, 0x80043, 0x900e6, - 0x70105, 0x8005b, 0x8001b, 0x90096, 0x70115, 0x8007b, 0x8003b, 0x900d6, - 0x7010d, 0x8006b, 0x8002b, 0x900b6, 0x8000b, 0x8008b, 0x8004b, 0x900f6, - 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900ce, - 0x7010b, 0x80067, 0x80027, 0x900ae, 0x80007, 0x80087, 0x80047, 0x900ee, - 0x70107, 0x8005f, 0x8001f, 0x9009e, 0x70117, 0x8007f, 0x8003f, 0x900de, - 0x7010f, 0x8006f, 0x8002f, 0x900be, 0x8000f, 0x8008f, 0x8004f, 0x900fe, - 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c1, - 0x70108, 0x80060, 0x80020, 0x900a1, 0x80000, 0x80080, 0x80040, 0x900e1, - 0x70104, 0x80058, 0x80018, 0x90091, 0x70114, 0x80078, 0x80038, 0x900d1, - 0x7010c, 0x80068, 0x80028, 0x900b1, 0x80008, 0x80088, 0x80048, 0x900f1, - 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c9, - 0x7010a, 0x80064, 0x80024, 0x900a9, 0x80004, 0x80084, 0x80044, 0x900e9, - 0x70106, 0x8005c, 0x8001c, 0x90099, 0x70116, 0x8007c, 0x8003c, 0x900d9, - 0x7010e, 0x8006c, 0x8002c, 0x900b9, 0x8000c, 0x8008c, 0x8004c, 0x900f9, - 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c5, - 0x70109, 0x80062, 0x80022, 0x900a5, 0x80002, 0x80082, 0x80042, 0x900e5, - 0x70105, 0x8005a, 0x8001a, 0x90095, 0x70115, 0x8007a, 0x8003a, 0x900d5, - 0x7010d, 0x8006a, 0x8002a, 0x900b5, 0x8000a, 0x8008a, 0x8004a, 0x900f5, - 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cd, - 0x7010b, 0x80066, 0x80026, 0x900ad, 0x80006, 0x80086, 0x80046, 0x900ed, - 0x70107, 0x8005e, 0x8001e, 0x9009d, 0x70117, 0x8007e, 0x8003e, 0x900dd, - 0x7010f, 0x8006e, 0x8002e, 0x900bd, 0x8000e, 0x8008e, 0x8004e, 0x900fd, - 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c3, - 0x70108, 0x80061, 0x80021, 0x900a3, 0x80001, 0x80081, 0x80041, 0x900e3, - 0x70104, 0x80059, 0x80019, 0x90093, 0x70114, 0x80079, 0x80039, 0x900d3, - 0x7010c, 0x80069, 0x80029, 0x900b3, 0x80009, 0x80089, 0x80049, 0x900f3, - 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900cb, - 0x7010a, 0x80065, 0x80025, 0x900ab, 0x80005, 0x80085, 0x80045, 0x900eb, - 0x70106, 0x8005d, 0x8001d, 0x9009b, 0x70116, 0x8007d, 0x8003d, 0x900db, - 0x7010e, 0x8006d, 0x8002d, 0x900bb, 0x8000d, 0x8008d, 0x8004d, 0x900fb, - 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c7, - 0x70109, 0x80063, 0x80023, 0x900a7, 0x80003, 0x80083, 0x80043, 0x900e7, - 0x70105, 0x8005b, 0x8001b, 0x90097, 0x70115, 0x8007b, 0x8003b, 0x900d7, - 0x7010d, 0x8006b, 0x8002b, 0x900b7, 0x8000b, 0x8008b, 0x8004b, 0x900f7, - 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900cf, - 0x7010b, 0x80067, 0x80027, 0x900af, 0x80007, 0x80087, 0x80047, 0x900ef, - 0x70107, 0x8005f, 0x8001f, 0x9009f, 0x70117, 0x8007f, 0x8003f, 0x900df, - 0x7010f, 0x8006f, 0x8002f, 0x900bf, 0x8000f, 0x8008f, 0x8004f, 0x900ff - ]), 9]; - - var fixedDistCodeTab = [new Int32Array([ - 0x50000, 0x50010, 0x50008, 0x50018, 0x50004, 0x50014, 0x5000c, 0x5001c, - 0x50002, 0x50012, 0x5000a, 0x5001a, 0x50006, 0x50016, 0x5000e, 0x00000, - 0x50001, 0x50011, 0x50009, 0x50019, 0x50005, 0x50015, 0x5000d, 0x5001d, - 0x50003, 0x50013, 0x5000b, 0x5001b, 0x50007, 0x50017, 0x5000f, 0x00000 - ]), 5]; - - function FlateStream(str, maybeLength) { - this.str = str; - this.dict = str.dict; - - var cmf = str.getByte(); - var flg = str.getByte(); - if (cmf === -1 || flg === -1) { - error('Invalid header in flate stream: ' + cmf + ', ' + flg); - } - if ((cmf & 0x0f) !== 0x08) { - error('Unknown compression method in flate stream: ' + cmf + ', ' + flg); - } - if ((((cmf << 8) + flg) % 31) !== 0) { - error('Bad FCHECK in flate stream: ' + cmf + ', ' + flg); - } - if (flg & 0x20) { - error('FDICT bit set in flate stream: ' + cmf + ', ' + flg); - } - - this.codeSize = 0; - this.codeBuf = 0; - - DecodeStream.call(this, maybeLength); - } - - FlateStream.prototype = Object.create(DecodeStream.prototype); - - FlateStream.prototype.getBits = function FlateStream_getBits(bits) { - var str = this.str; - var codeSize = this.codeSize; - var codeBuf = this.codeBuf; - - var b; - while (codeSize < bits) { - if ((b = str.getByte()) === -1) { - error('Bad encoding in flate stream'); - } - codeBuf |= b << codeSize; - codeSize += 8; - } - b = codeBuf & ((1 << bits) - 1); - this.codeBuf = codeBuf >> bits; - this.codeSize = codeSize -= bits; - - return b; - }; - - FlateStream.prototype.getCode = function FlateStream_getCode(table) { - var str = this.str; - var codes = table[0]; - var maxLen = table[1]; - var codeSize = this.codeSize; - var codeBuf = this.codeBuf; - - var b; - while (codeSize < maxLen) { - if ((b = str.getByte()) === -1) { - // premature end of stream. code might however still be valid. - // codeSize < codeLen check below guards against incomplete codeVal. - break; - } - codeBuf |= (b << codeSize); - codeSize += 8; - } - var code = codes[codeBuf & ((1 << maxLen) - 1)]; - var codeLen = code >> 16; - var codeVal = code & 0xffff; - if (codeLen < 1 || codeSize < codeLen) { - error('Bad encoding in flate stream'); - } - this.codeBuf = (codeBuf >> codeLen); - this.codeSize = (codeSize - codeLen); - return codeVal; - }; - - FlateStream.prototype.generateHuffmanTable = - function flateStreamGenerateHuffmanTable(lengths) { - var n = lengths.length; - - // find max code length - var maxLen = 0; - var i; - for (i = 0; i < n; ++i) { - if (lengths[i] > maxLen) { - maxLen = lengths[i]; - } - } - - // build the table - var size = 1 << maxLen; - var codes = new Int32Array(size); - for (var len = 1, code = 0, skip = 2; - len <= maxLen; - ++len, code <<= 1, skip <<= 1) { - for (var val = 0; val < n; ++val) { - if (lengths[val] === len) { - // bit-reverse the code - var code2 = 0; - var t = code; - for (i = 0; i < len; ++i) { - code2 = (code2 << 1) | (t & 1); - t >>= 1; - } - - // fill the table entries - for (i = code2; i < size; i += skip) { - codes[i] = (len << 16) | val; - } - ++code; - } - } - } - - return [codes, maxLen]; - }; - - FlateStream.prototype.readBlock = function FlateStream_readBlock() { - var buffer, len; - var str = this.str; - // read block header - var hdr = this.getBits(3); - if (hdr & 1) { - this.eof = true; - } - hdr >>= 1; - - if (hdr === 0) { // uncompressed block - var b; - - if ((b = str.getByte()) === -1) { - error('Bad block header in flate stream'); - } - var blockLen = b; - if ((b = str.getByte()) === -1) { - error('Bad block header in flate stream'); - } - blockLen |= (b << 8); - if ((b = str.getByte()) === -1) { - error('Bad block header in flate stream'); - } - var check = b; - if ((b = str.getByte()) === -1) { - error('Bad block header in flate stream'); - } - check |= (b << 8); - if (check !== (~blockLen & 0xffff) && - (blockLen !== 0 || check !== 0)) { - // Ignoring error for bad "empty" block (see issue 1277) - error('Bad uncompressed block length in flate stream'); - } - - this.codeBuf = 0; - this.codeSize = 0; - - var bufferLength = this.bufferLength; - buffer = this.ensureBuffer(bufferLength + blockLen); - var end = bufferLength + blockLen; - this.bufferLength = end; - if (blockLen === 0) { - if (str.peekByte() === -1) { - this.eof = true; - } - } else { - for (var n = bufferLength; n < end; ++n) { - if ((b = str.getByte()) === -1) { - this.eof = true; - break; - } - buffer[n] = b; - } - } - return; - } - - var litCodeTable; - var distCodeTable; - if (hdr === 1) { // compressed block, fixed codes - litCodeTable = fixedLitCodeTab; - distCodeTable = fixedDistCodeTab; - } else if (hdr === 2) { // compressed block, dynamic codes - var numLitCodes = this.getBits(5) + 257; - var numDistCodes = this.getBits(5) + 1; - var numCodeLenCodes = this.getBits(4) + 4; - - // build the code lengths code table - var codeLenCodeLengths = new Uint8Array(codeLenCodeMap.length); - - var i; - for (i = 0; i < numCodeLenCodes; ++i) { - codeLenCodeLengths[codeLenCodeMap[i]] = this.getBits(3); - } - var codeLenCodeTab = this.generateHuffmanTable(codeLenCodeLengths); - - // build the literal and distance code tables - len = 0; - i = 0; - var codes = numLitCodes + numDistCodes; - var codeLengths = new Uint8Array(codes); - var bitsLength, bitsOffset, what; - while (i < codes) { - var code = this.getCode(codeLenCodeTab); - if (code === 16) { - bitsLength = 2; bitsOffset = 3; what = len; - } else if (code === 17) { - bitsLength = 3; bitsOffset = 3; what = (len = 0); - } else if (code === 18) { - bitsLength = 7; bitsOffset = 11; what = (len = 0); - } else { - codeLengths[i++] = len = code; - continue; - } - - var repeatLength = this.getBits(bitsLength) + bitsOffset; - while (repeatLength-- > 0) { - codeLengths[i++] = what; - } - } - - litCodeTable = - this.generateHuffmanTable(codeLengths.subarray(0, numLitCodes)); - distCodeTable = - this.generateHuffmanTable(codeLengths.subarray(numLitCodes, codes)); - } else { - error('Unknown block type in flate stream'); - } - - buffer = this.buffer; - var limit = buffer ? buffer.length : 0; - var pos = this.bufferLength; - while (true) { - var code1 = this.getCode(litCodeTable); - if (code1 < 256) { - if (pos + 1 >= limit) { - buffer = this.ensureBuffer(pos + 1); - limit = buffer.length; - } - buffer[pos++] = code1; - continue; - } - if (code1 === 256) { - this.bufferLength = pos; - return; - } - code1 -= 257; - code1 = lengthDecode[code1]; - var code2 = code1 >> 16; - if (code2 > 0) { - code2 = this.getBits(code2); - } - len = (code1 & 0xffff) + code2; - code1 = this.getCode(distCodeTable); - code1 = distDecode[code1]; - code2 = code1 >> 16; - if (code2 > 0) { - code2 = this.getBits(code2); - } - var dist = (code1 & 0xffff) + code2; - if (pos + len >= limit) { - buffer = this.ensureBuffer(pos + len); - limit = buffer.length; - } - for (var k = 0; k < len; ++k, ++pos) { - buffer[pos] = buffer[pos - dist]; - } - } - }; - - return FlateStream; -})(); - -var PredictorStream = (function PredictorStreamClosure() { - function PredictorStream(str, maybeLength, params) { - var predictor = this.predictor = params.get('Predictor') || 1; - - if (predictor <= 1) { - return str; // no prediction - } - if (predictor !== 2 && (predictor < 10 || predictor > 15)) { - error('Unsupported predictor: ' + predictor); - } - - if (predictor === 2) { - this.readBlock = this.readBlockTiff; - } else { - this.readBlock = this.readBlockPng; - } - - this.str = str; - this.dict = str.dict; - - var colors = this.colors = params.get('Colors') || 1; - var bits = this.bits = params.get('BitsPerComponent') || 8; - var columns = this.columns = params.get('Columns') || 1; - - this.pixBytes = (colors * bits + 7) >> 3; - this.rowBytes = (columns * colors * bits + 7) >> 3; - - DecodeStream.call(this, maybeLength); - return this; - } - - PredictorStream.prototype = Object.create(DecodeStream.prototype); - - PredictorStream.prototype.readBlockTiff = - function predictorStreamReadBlockTiff() { - var rowBytes = this.rowBytes; - - var bufferLength = this.bufferLength; - var buffer = this.ensureBuffer(bufferLength + rowBytes); - - var bits = this.bits; - var colors = this.colors; - - var rawBytes = this.str.getBytes(rowBytes); - this.eof = !rawBytes.length; - if (this.eof) { - return; - } - - var inbuf = 0, outbuf = 0; - var inbits = 0, outbits = 0; - var pos = bufferLength; - var i; - - if (bits === 1) { - for (i = 0; i < rowBytes; ++i) { - var c = rawBytes[i]; - inbuf = (inbuf << 8) | c; - // bitwise addition is exclusive or - // first shift inbuf and then add - buffer[pos++] = (c ^ (inbuf >> colors)) & 0xFF; - // truncate inbuf (assumes colors < 16) - inbuf &= 0xFFFF; - } - } else if (bits === 8) { - for (i = 0; i < colors; ++i) { - buffer[pos++] = rawBytes[i]; - } - for (; i < rowBytes; ++i) { - buffer[pos] = buffer[pos - colors] + rawBytes[i]; - pos++; - } - } else { - var compArray = new Uint8Array(colors + 1); - var bitMask = (1 << bits) - 1; - var j = 0, k = bufferLength; - var columns = this.columns; - for (i = 0; i < columns; ++i) { - for (var kk = 0; kk < colors; ++kk) { - if (inbits < bits) { - inbuf = (inbuf << 8) | (rawBytes[j++] & 0xFF); - inbits += 8; - } - compArray[kk] = (compArray[kk] + - (inbuf >> (inbits - bits))) & bitMask; - inbits -= bits; - outbuf = (outbuf << bits) | compArray[kk]; - outbits += bits; - if (outbits >= 8) { - buffer[k++] = (outbuf >> (outbits - 8)) & 0xFF; - outbits -= 8; - } - } - } - if (outbits > 0) { - buffer[k++] = (outbuf << (8 - outbits)) + - (inbuf & ((1 << (8 - outbits)) - 1)); - } - } - this.bufferLength += rowBytes; - }; - - PredictorStream.prototype.readBlockPng = - function predictorStreamReadBlockPng() { - - var rowBytes = this.rowBytes; - var pixBytes = this.pixBytes; - - var predictor = this.str.getByte(); - var rawBytes = this.str.getBytes(rowBytes); - this.eof = !rawBytes.length; - if (this.eof) { - return; - } - - var bufferLength = this.bufferLength; - var buffer = this.ensureBuffer(bufferLength + rowBytes); - - var prevRow = buffer.subarray(bufferLength - rowBytes, bufferLength); - if (prevRow.length === 0) { - prevRow = new Uint8Array(rowBytes); - } - - var i, j = bufferLength, up, c; - switch (predictor) { - case 0: - for (i = 0; i < rowBytes; ++i) { - buffer[j++] = rawBytes[i]; - } - break; - case 1: - for (i = 0; i < pixBytes; ++i) { - buffer[j++] = rawBytes[i]; - } - for (; i < rowBytes; ++i) { - buffer[j] = (buffer[j - pixBytes] + rawBytes[i]) & 0xFF; - j++; - } - break; - case 2: - for (i = 0; i < rowBytes; ++i) { - buffer[j++] = (prevRow[i] + rawBytes[i]) & 0xFF; - } - break; - case 3: - for (i = 0; i < pixBytes; ++i) { - buffer[j++] = (prevRow[i] >> 1) + rawBytes[i]; - } - for (; i < rowBytes; ++i) { - buffer[j] = (((prevRow[i] + buffer[j - pixBytes]) >> 1) + - rawBytes[i]) & 0xFF; - j++; - } - break; - case 4: - // we need to save the up left pixels values. the simplest way - // is to create a new buffer - for (i = 0; i < pixBytes; ++i) { - up = prevRow[i]; - c = rawBytes[i]; - buffer[j++] = up + c; - } - for (; i < rowBytes; ++i) { - up = prevRow[i]; - var upLeft = prevRow[i - pixBytes]; - var left = buffer[j - pixBytes]; - var p = left + up - upLeft; - - var pa = p - left; - if (pa < 0) { - pa = -pa; - } - var pb = p - up; - if (pb < 0) { - pb = -pb; - } - var pc = p - upLeft; - if (pc < 0) { - pc = -pc; - } - - c = rawBytes[i]; - if (pa <= pb && pa <= pc) { - buffer[j++] = left + c; - } else if (pb <= pc) { - buffer[j++] = up + c; - } else { - buffer[j++] = upLeft + c; - } - } - break; - default: - error('Unsupported predictor: ' + predictor); - } - this.bufferLength += rowBytes; - }; - - return PredictorStream; -})(); - -/** - * Depending on the type of JPEG a JpegStream is handled in different ways. For - * JPEG's that are supported natively such as DeviceGray and DeviceRGB the image - * data is stored and then loaded by the browser. For unsupported JPEG's we use - * a library to decode these images and the stream behaves like all the other - * DecodeStreams. - */ -var JpegStream = (function JpegStreamClosure() { - function JpegStream(stream, maybeLength, dict, xref) { - // Some images may contain 'junk' before the SOI (start-of-image) marker. - // Note: this seems to mainly affect inline images. - var ch; - while ((ch = stream.getByte()) !== -1) { - if (ch === 0xFF) { // Find the first byte of the SOI marker (0xFFD8). - stream.skip(-1); // Reset the stream position to the SOI. - break; - } - } - this.stream = stream; - this.maybeLength = maybeLength; - this.dict = dict; - - DecodeStream.call(this, maybeLength); - } - - JpegStream.prototype = Object.create(DecodeStream.prototype); - - Object.defineProperty(JpegStream.prototype, 'bytes', { - get: function JpegStream_bytes() { - // If this.maybeLength is null, we'll get the entire stream. - return shadow(this, 'bytes', this.stream.getBytes(this.maybeLength)); - }, - configurable: true - }); - - JpegStream.prototype.ensureBuffer = function JpegStream_ensureBuffer(req) { - if (this.bufferLength) { - return; - } - try { - var jpegImage = new JpegImage(); - - // checking if values needs to be transformed before conversion - if (this.forceRGB && this.dict && isArray(this.dict.get('Decode'))) { - var decodeArr = this.dict.get('Decode'); - var bitsPerComponent = this.dict.get('BitsPerComponent') || 8; - var decodeArrLength = decodeArr.length; - var transform = new Int32Array(decodeArrLength); - var transformNeeded = false; - var maxValue = (1 << bitsPerComponent) - 1; - for (var i = 0; i < decodeArrLength; i += 2) { - transform[i] = ((decodeArr[i + 1] - decodeArr[i]) * 256) | 0; - transform[i + 1] = (decodeArr[i] * maxValue) | 0; - if (transform[i] !== 256 || transform[i + 1] !== 0) { - transformNeeded = true; - } - } - if (transformNeeded) { - jpegImage.decodeTransform = transform; - } - } - - jpegImage.parse(this.bytes); - var data = jpegImage.getData(this.drawWidth, this.drawHeight, - this.forceRGB); - this.buffer = data; - this.bufferLength = data.length; - this.eof = true; - } catch (e) { - error('JPEG error: ' + e); - } - }; - - JpegStream.prototype.getBytes = function JpegStream_getBytes(length) { - this.ensureBuffer(); - return this.buffer; - }; - - JpegStream.prototype.getIR = function JpegStream_getIR() { - return PDFJS.createObjectURL(this.bytes, 'image/jpeg'); - }; - /** - * Checks if the image can be decoded and displayed by the browser without any - * further processing such as color space conversions. - */ - JpegStream.prototype.isNativelySupported = - function JpegStream_isNativelySupported(xref, res) { - var cs = ColorSpace.parse(this.dict.get('ColorSpace', 'CS'), xref, res); - return (cs.name === 'DeviceGray' || cs.name === 'DeviceRGB') && - cs.isDefaultDecode(this.dict.get('Decode', 'D')); - }; - /** - * Checks if the image can be decoded by the browser. - */ - JpegStream.prototype.isNativelyDecodable = - function JpegStream_isNativelyDecodable(xref, res) { - var cs = ColorSpace.parse(this.dict.get('ColorSpace', 'CS'), xref, res); - return (cs.numComps === 1 || cs.numComps === 3) && - cs.isDefaultDecode(this.dict.get('Decode', 'D')); - }; - - return JpegStream; -})(); - -/** - * For JPEG 2000's we use a library to decode these images and - * the stream behaves like all the other DecodeStreams. - */ -var JpxStream = (function JpxStreamClosure() { - function JpxStream(stream, maybeLength, dict) { - this.stream = stream; - this.maybeLength = maybeLength; - this.dict = dict; - - DecodeStream.call(this, maybeLength); - } - - JpxStream.prototype = Object.create(DecodeStream.prototype); - - Object.defineProperty(JpxStream.prototype, 'bytes', { - get: function JpxStream_bytes() { - // If this.maybeLength is null, we'll get the entire stream. - return shadow(this, 'bytes', this.stream.getBytes(this.maybeLength)); - }, - configurable: true - }); - - JpxStream.prototype.ensureBuffer = function JpxStream_ensureBuffer(req) { - if (this.bufferLength) { - return; - } - - var jpxImage = new JpxImage(); - jpxImage.parse(this.bytes); - - var width = jpxImage.width; - var height = jpxImage.height; - var componentsCount = jpxImage.componentsCount; - var tileCount = jpxImage.tiles.length; - if (tileCount === 1) { - this.buffer = jpxImage.tiles[0].items; - } else { - var data = new Uint8Array(width * height * componentsCount); - - for (var k = 0; k < tileCount; k++) { - var tileComponents = jpxImage.tiles[k]; - var tileWidth = tileComponents.width; - var tileHeight = tileComponents.height; - var tileLeft = tileComponents.left; - var tileTop = tileComponents.top; - - var src = tileComponents.items; - var srcPosition = 0; - var dataPosition = (width * tileTop + tileLeft) * componentsCount; - var imgRowSize = width * componentsCount; - var tileRowSize = tileWidth * componentsCount; - - for (var j = 0; j < tileHeight; j++) { - var rowBytes = src.subarray(srcPosition, srcPosition + tileRowSize); - data.set(rowBytes, dataPosition); - srcPosition += tileRowSize; - dataPosition += imgRowSize; - } - } - this.buffer = data; - } - this.bufferLength = this.buffer.length; - this.eof = true; - }; - - return JpxStream; -})(); - -/** - * For JBIG2's we use a library to decode these images and - * the stream behaves like all the other DecodeStreams. - */ -var Jbig2Stream = (function Jbig2StreamClosure() { - function Jbig2Stream(stream, maybeLength, dict) { - this.stream = stream; - this.maybeLength = maybeLength; - this.dict = dict; - - DecodeStream.call(this, maybeLength); - } - - Jbig2Stream.prototype = Object.create(DecodeStream.prototype); - - Object.defineProperty(Jbig2Stream.prototype, 'bytes', { - get: function Jbig2Stream_bytes() { - // If this.maybeLength is null, we'll get the entire stream. - return shadow(this, 'bytes', this.stream.getBytes(this.maybeLength)); - }, - configurable: true - }); - - Jbig2Stream.prototype.ensureBuffer = function Jbig2Stream_ensureBuffer(req) { - if (this.bufferLength) { - return; - } - - var jbig2Image = new Jbig2Image(); - - var chunks = [], xref = this.dict.xref; - var decodeParams = xref.fetchIfRef(this.dict.get('DecodeParms')); - - // According to the PDF specification, DecodeParms can be either - // a dictionary, or an array whose elements are dictionaries. - if (isArray(decodeParams)) { - if (decodeParams.length > 1) { - warn('JBIG2 - \'DecodeParms\' array with multiple elements ' + - 'not supported.'); - } - decodeParams = xref.fetchIfRef(decodeParams[0]); - } - if (decodeParams && decodeParams.has('JBIG2Globals')) { - var globalsStream = decodeParams.get('JBIG2Globals'); - var globals = globalsStream.getBytes(); - chunks.push({data: globals, start: 0, end: globals.length}); - } - chunks.push({data: this.bytes, start: 0, end: this.bytes.length}); - var data = jbig2Image.parseChunks(chunks); - var dataLength = data.length; - - // JBIG2 had black as 1 and white as 0, inverting the colors - for (var i = 0; i < dataLength; i++) { - data[i] ^= 0xFF; - } - - this.buffer = data; - this.bufferLength = dataLength; - this.eof = true; - }; - - return Jbig2Stream; -})(); - -var DecryptStream = (function DecryptStreamClosure() { - function DecryptStream(str, maybeLength, decrypt) { - this.str = str; - this.dict = str.dict; - this.decrypt = decrypt; - this.nextChunk = null; - this.initialized = false; - - DecodeStream.call(this, maybeLength); - } - - var chunkSize = 512; - - DecryptStream.prototype = Object.create(DecodeStream.prototype); - - DecryptStream.prototype.readBlock = function DecryptStream_readBlock() { - var chunk; - if (this.initialized) { - chunk = this.nextChunk; - } else { - chunk = this.str.getBytes(chunkSize); - this.initialized = true; - } - if (!chunk || chunk.length === 0) { - this.eof = true; - return; - } - this.nextChunk = this.str.getBytes(chunkSize); - var hasMoreData = this.nextChunk && this.nextChunk.length > 0; - - var decrypt = this.decrypt; - chunk = decrypt(chunk, !hasMoreData); - - var bufferLength = this.bufferLength; - var i, n = chunk.length; - var buffer = this.ensureBuffer(bufferLength + n); - for (i = 0; i < n; i++) { - buffer[bufferLength++] = chunk[i]; - } - this.bufferLength = bufferLength; - }; - - return DecryptStream; -})(); - -var Ascii85Stream = (function Ascii85StreamClosure() { - function Ascii85Stream(str, maybeLength) { - this.str = str; - this.dict = str.dict; - this.input = new Uint8Array(5); - - // Most streams increase in size when decoded, but Ascii85 streams - // typically shrink by ~20%. - if (maybeLength) { - maybeLength = 0.8 * maybeLength; - } - DecodeStream.call(this, maybeLength); - } - - Ascii85Stream.prototype = Object.create(DecodeStream.prototype); - - Ascii85Stream.prototype.readBlock = function Ascii85Stream_readBlock() { - var TILDA_CHAR = 0x7E; // '~' - var Z_LOWER_CHAR = 0x7A; // 'z' - var EOF = -1; - - var str = this.str; - - var c = str.getByte(); - while (Lexer.isSpace(c)) { - c = str.getByte(); - } - - if (c === EOF || c === TILDA_CHAR) { - this.eof = true; - return; - } - - var bufferLength = this.bufferLength, buffer; - var i; - - // special code for z - if (c === Z_LOWER_CHAR) { - buffer = this.ensureBuffer(bufferLength + 4); - for (i = 0; i < 4; ++i) { - buffer[bufferLength + i] = 0; - } - this.bufferLength += 4; - } else { - var input = this.input; - input[0] = c; - for (i = 1; i < 5; ++i) { - c = str.getByte(); - while (Lexer.isSpace(c)) { - c = str.getByte(); - } - - input[i] = c; - - if (c === EOF || c === TILDA_CHAR) { - break; - } - } - buffer = this.ensureBuffer(bufferLength + i - 1); - this.bufferLength += i - 1; - - // partial ending; - if (i < 5) { - for (; i < 5; ++i) { - input[i] = 0x21 + 84; - } - this.eof = true; - } - var t = 0; - for (i = 0; i < 5; ++i) { - t = t * 85 + (input[i] - 0x21); - } - - for (i = 3; i >= 0; --i) { - buffer[bufferLength + i] = t & 0xFF; - t >>= 8; - } - } - }; - - return Ascii85Stream; -})(); - -var AsciiHexStream = (function AsciiHexStreamClosure() { - function AsciiHexStream(str, maybeLength) { - this.str = str; - this.dict = str.dict; - - this.firstDigit = -1; - - // Most streams increase in size when decoded, but AsciiHex streams shrink - // by 50%. - if (maybeLength) { - maybeLength = 0.5 * maybeLength; - } - DecodeStream.call(this, maybeLength); - } - - AsciiHexStream.prototype = Object.create(DecodeStream.prototype); - - AsciiHexStream.prototype.readBlock = function AsciiHexStream_readBlock() { - var UPSTREAM_BLOCK_SIZE = 8000; - var bytes = this.str.getBytes(UPSTREAM_BLOCK_SIZE); - if (!bytes.length) { - this.eof = true; - return; - } - - var maxDecodeLength = (bytes.length + 1) >> 1; - var buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength); - var bufferLength = this.bufferLength; - - var firstDigit = this.firstDigit; - for (var i = 0, ii = bytes.length; i < ii; i++) { - var ch = bytes[i], digit; - if (ch >= 0x30 && ch <= 0x39) { // '0'-'9' - digit = ch & 0x0F; - } else if ((ch >= 0x41 && ch <= 0x46) || (ch >= 0x61 && ch <= 0x66)) { - // 'A'-'Z', 'a'-'z' - digit = (ch & 0x0F) + 9; - } else if (ch === 0x3E) { // '>' - this.eof = true; - break; - } else { // probably whitespace - continue; // ignoring - } - if (firstDigit < 0) { - firstDigit = digit; - } else { - buffer[bufferLength++] = (firstDigit << 4) | digit; - firstDigit = -1; - } - } - if (firstDigit >= 0 && this.eof) { - // incomplete byte - buffer[bufferLength++] = (firstDigit << 4); - firstDigit = -1; - } - this.firstDigit = firstDigit; - this.bufferLength = bufferLength; - }; - - return AsciiHexStream; -})(); - -var RunLengthStream = (function RunLengthStreamClosure() { - function RunLengthStream(str, maybeLength) { - this.str = str; - this.dict = str.dict; - - DecodeStream.call(this, maybeLength); - } - - RunLengthStream.prototype = Object.create(DecodeStream.prototype); - - RunLengthStream.prototype.readBlock = function RunLengthStream_readBlock() { - // The repeatHeader has following format. The first byte defines type of run - // and amount of bytes to repeat/copy: n = 0 through 127 - copy next n bytes - // (in addition to the second byte from the header), n = 129 through 255 - - // duplicate the second byte from the header (257 - n) times, n = 128 - end. - var repeatHeader = this.str.getBytes(2); - if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) { - this.eof = true; - return; - } - - var buffer; - var bufferLength = this.bufferLength; - var n = repeatHeader[0]; - if (n < 128) { - // copy n bytes - buffer = this.ensureBuffer(bufferLength + n + 1); - buffer[bufferLength++] = repeatHeader[1]; - if (n > 0) { - var source = this.str.getBytes(n); - buffer.set(source, bufferLength); - bufferLength += n; - } - } else { - n = 257 - n; - var b = repeatHeader[1]; - buffer = this.ensureBuffer(bufferLength + n + 1); - for (var i = 0; i < n; i++) { - buffer[bufferLength++] = b; - } - } - this.bufferLength = bufferLength; - }; - - return RunLengthStream; -})(); - -var CCITTFaxStream = (function CCITTFaxStreamClosure() { - - var ccittEOL = -2; - var twoDimPass = 0; - var twoDimHoriz = 1; - var twoDimVert0 = 2; - var twoDimVertR1 = 3; - var twoDimVertL1 = 4; - var twoDimVertR2 = 5; - var twoDimVertL2 = 6; - var twoDimVertR3 = 7; - var twoDimVertL3 = 8; - - var twoDimTable = [ - [-1, -1], [-1, -1], // 000000x - [7, twoDimVertL3], // 0000010 - [7, twoDimVertR3], // 0000011 - [6, twoDimVertL2], [6, twoDimVertL2], // 000010x - [6, twoDimVertR2], [6, twoDimVertR2], // 000011x - [4, twoDimPass], [4, twoDimPass], // 0001xxx - [4, twoDimPass], [4, twoDimPass], - [4, twoDimPass], [4, twoDimPass], - [4, twoDimPass], [4, twoDimPass], - [3, twoDimHoriz], [3, twoDimHoriz], // 001xxxx - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimVertL1], [3, twoDimVertL1], // 010xxxx - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertR1], [3, twoDimVertR1], // 011xxxx - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [1, twoDimVert0], [1, twoDimVert0], // 1xxxxxx - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0] - ]; - - var whiteTable1 = [ - [-1, -1], // 00000 - [12, ccittEOL], // 00001 - [-1, -1], [-1, -1], // 0001x - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 001xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 010xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 011xx - [11, 1792], [11, 1792], // 1000x - [12, 1984], // 10010 - [12, 2048], // 10011 - [12, 2112], // 10100 - [12, 2176], // 10101 - [12, 2240], // 10110 - [12, 2304], // 10111 - [11, 1856], [11, 1856], // 1100x - [11, 1920], [11, 1920], // 1101x - [12, 2368], // 11100 - [12, 2432], // 11101 - [12, 2496], // 11110 - [12, 2560] // 11111 - ]; - - var whiteTable2 = [ - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 0000000xx - [8, 29], [8, 29], // 00000010x - [8, 30], [8, 30], // 00000011x - [8, 45], [8, 45], // 00000100x - [8, 46], [8, 46], // 00000101x - [7, 22], [7, 22], [7, 22], [7, 22], // 0000011xx - [7, 23], [7, 23], [7, 23], [7, 23], // 0000100xx - [8, 47], [8, 47], // 00001010x - [8, 48], [8, 48], // 00001011x - [6, 13], [6, 13], [6, 13], [6, 13], // 000011xxx - [6, 13], [6, 13], [6, 13], [6, 13], - [7, 20], [7, 20], [7, 20], [7, 20], // 0001000xx - [8, 33], [8, 33], // 00010010x - [8, 34], [8, 34], // 00010011x - [8, 35], [8, 35], // 00010100x - [8, 36], [8, 36], // 00010101x - [8, 37], [8, 37], // 00010110x - [8, 38], [8, 38], // 00010111x - [7, 19], [7, 19], [7, 19], [7, 19], // 0001100xx - [8, 31], [8, 31], // 00011010x - [8, 32], [8, 32], // 00011011x - [6, 1], [6, 1], [6, 1], [6, 1], // 000111xxx - [6, 1], [6, 1], [6, 1], [6, 1], - [6, 12], [6, 12], [6, 12], [6, 12], // 001000xxx - [6, 12], [6, 12], [6, 12], [6, 12], - [8, 53], [8, 53], // 00100100x - [8, 54], [8, 54], // 00100101x - [7, 26], [7, 26], [7, 26], [7, 26], // 0010011xx - [8, 39], [8, 39], // 00101000x - [8, 40], [8, 40], // 00101001x - [8, 41], [8, 41], // 00101010x - [8, 42], [8, 42], // 00101011x - [8, 43], [8, 43], // 00101100x - [8, 44], [8, 44], // 00101101x - [7, 21], [7, 21], [7, 21], [7, 21], // 0010111xx - [7, 28], [7, 28], [7, 28], [7, 28], // 0011000xx - [8, 61], [8, 61], // 00110010x - [8, 62], [8, 62], // 00110011x - [8, 63], [8, 63], // 00110100x - [8, 0], [8, 0], // 00110101x - [8, 320], [8, 320], // 00110110x - [8, 384], [8, 384], // 00110111x - [5, 10], [5, 10], [5, 10], [5, 10], // 00111xxxx - [5, 10], [5, 10], [5, 10], [5, 10], - [5, 10], [5, 10], [5, 10], [5, 10], - [5, 10], [5, 10], [5, 10], [5, 10], - [5, 11], [5, 11], [5, 11], [5, 11], // 01000xxxx - [5, 11], [5, 11], [5, 11], [5, 11], - [5, 11], [5, 11], [5, 11], [5, 11], - [5, 11], [5, 11], [5, 11], [5, 11], - [7, 27], [7, 27], [7, 27], [7, 27], // 0100100xx - [8, 59], [8, 59], // 01001010x - [8, 60], [8, 60], // 01001011x - [9, 1472], // 010011000 - [9, 1536], // 010011001 - [9, 1600], // 010011010 - [9, 1728], // 010011011 - [7, 18], [7, 18], [7, 18], [7, 18], // 0100111xx - [7, 24], [7, 24], [7, 24], [7, 24], // 0101000xx - [8, 49], [8, 49], // 01010010x - [8, 50], [8, 50], // 01010011x - [8, 51], [8, 51], // 01010100x - [8, 52], [8, 52], // 01010101x - [7, 25], [7, 25], [7, 25], [7, 25], // 0101011xx - [8, 55], [8, 55], // 01011000x - [8, 56], [8, 56], // 01011001x - [8, 57], [8, 57], // 01011010x - [8, 58], [8, 58], // 01011011x - [6, 192], [6, 192], [6, 192], [6, 192], // 010111xxx - [6, 192], [6, 192], [6, 192], [6, 192], - [6, 1664], [6, 1664], [6, 1664], [6, 1664], // 011000xxx - [6, 1664], [6, 1664], [6, 1664], [6, 1664], - [8, 448], [8, 448], // 01100100x - [8, 512], [8, 512], // 01100101x - [9, 704], // 011001100 - [9, 768], // 011001101 - [8, 640], [8, 640], // 01100111x - [8, 576], [8, 576], // 01101000x - [9, 832], // 011010010 - [9, 896], // 011010011 - [9, 960], // 011010100 - [9, 1024], // 011010101 - [9, 1088], // 011010110 - [9, 1152], // 011010111 - [9, 1216], // 011011000 - [9, 1280], // 011011001 - [9, 1344], // 011011010 - [9, 1408], // 011011011 - [7, 256], [7, 256], [7, 256], [7, 256], // 0110111xx - [4, 2], [4, 2], [4, 2], [4, 2], // 0111xxxxx - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 3], [4, 3], [4, 3], [4, 3], // 1000xxxxx - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [5, 128], [5, 128], [5, 128], [5, 128], // 10010xxxx - [5, 128], [5, 128], [5, 128], [5, 128], - [5, 128], [5, 128], [5, 128], [5, 128], - [5, 128], [5, 128], [5, 128], [5, 128], - [5, 8], [5, 8], [5, 8], [5, 8], // 10011xxxx - [5, 8], [5, 8], [5, 8], [5, 8], - [5, 8], [5, 8], [5, 8], [5, 8], - [5, 8], [5, 8], [5, 8], [5, 8], - [5, 9], [5, 9], [5, 9], [5, 9], // 10100xxxx - [5, 9], [5, 9], [5, 9], [5, 9], - [5, 9], [5, 9], [5, 9], [5, 9], - [5, 9], [5, 9], [5, 9], [5, 9], - [6, 16], [6, 16], [6, 16], [6, 16], // 101010xxx - [6, 16], [6, 16], [6, 16], [6, 16], - [6, 17], [6, 17], [6, 17], [6, 17], // 101011xxx - [6, 17], [6, 17], [6, 17], [6, 17], - [4, 4], [4, 4], [4, 4], [4, 4], // 1011xxxxx - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 5], [4, 5], [4, 5], [4, 5], // 1100xxxxx - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [6, 14], [6, 14], [6, 14], [6, 14], // 110100xxx - [6, 14], [6, 14], [6, 14], [6, 14], - [6, 15], [6, 15], [6, 15], [6, 15], // 110101xxx - [6, 15], [6, 15], [6, 15], [6, 15], - [5, 64], [5, 64], [5, 64], [5, 64], // 11011xxxx - [5, 64], [5, 64], [5, 64], [5, 64], - [5, 64], [5, 64], [5, 64], [5, 64], - [5, 64], [5, 64], [5, 64], [5, 64], - [4, 6], [4, 6], [4, 6], [4, 6], // 1110xxxxx - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 7], [4, 7], [4, 7], [4, 7], // 1111xxxxx - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7] - ]; - - var blackTable1 = [ - [-1, -1], [-1, -1], // 000000000000x - [12, ccittEOL], [12, ccittEOL], // 000000000001x - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000001xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000010xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000011xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000100xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000101xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000110xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000111xx - [11, 1792], [11, 1792], [11, 1792], [11, 1792], // 00000001000xx - [12, 1984], [12, 1984], // 000000010010x - [12, 2048], [12, 2048], // 000000010011x - [12, 2112], [12, 2112], // 000000010100x - [12, 2176], [12, 2176], // 000000010101x - [12, 2240], [12, 2240], // 000000010110x - [12, 2304], [12, 2304], // 000000010111x - [11, 1856], [11, 1856], [11, 1856], [11, 1856], // 00000001100xx - [11, 1920], [11, 1920], [11, 1920], [11, 1920], // 00000001101xx - [12, 2368], [12, 2368], // 000000011100x - [12, 2432], [12, 2432], // 000000011101x - [12, 2496], [12, 2496], // 000000011110x - [12, 2560], [12, 2560], // 000000011111x - [10, 18], [10, 18], [10, 18], [10, 18], // 0000001000xxx - [10, 18], [10, 18], [10, 18], [10, 18], - [12, 52], [12, 52], // 000000100100x - [13, 640], // 0000001001010 - [13, 704], // 0000001001011 - [13, 768], // 0000001001100 - [13, 832], // 0000001001101 - [12, 55], [12, 55], // 000000100111x - [12, 56], [12, 56], // 000000101000x - [13, 1280], // 0000001010010 - [13, 1344], // 0000001010011 - [13, 1408], // 0000001010100 - [13, 1472], // 0000001010101 - [12, 59], [12, 59], // 000000101011x - [12, 60], [12, 60], // 000000101100x - [13, 1536], // 0000001011010 - [13, 1600], // 0000001011011 - [11, 24], [11, 24], [11, 24], [11, 24], // 00000010111xx - [11, 25], [11, 25], [11, 25], [11, 25], // 00000011000xx - [13, 1664], // 0000001100100 - [13, 1728], // 0000001100101 - [12, 320], [12, 320], // 000000110011x - [12, 384], [12, 384], // 000000110100x - [12, 448], [12, 448], // 000000110101x - [13, 512], // 0000001101100 - [13, 576], // 0000001101101 - [12, 53], [12, 53], // 000000110111x - [12, 54], [12, 54], // 000000111000x - [13, 896], // 0000001110010 - [13, 960], // 0000001110011 - [13, 1024], // 0000001110100 - [13, 1088], // 0000001110101 - [13, 1152], // 0000001110110 - [13, 1216], // 0000001110111 - [10, 64], [10, 64], [10, 64], [10, 64], // 0000001111xxx - [10, 64], [10, 64], [10, 64], [10, 64] - ]; - - var blackTable2 = [ - [8, 13], [8, 13], [8, 13], [8, 13], // 00000100xxxx - [8, 13], [8, 13], [8, 13], [8, 13], - [8, 13], [8, 13], [8, 13], [8, 13], - [8, 13], [8, 13], [8, 13], [8, 13], - [11, 23], [11, 23], // 00000101000x - [12, 50], // 000001010010 - [12, 51], // 000001010011 - [12, 44], // 000001010100 - [12, 45], // 000001010101 - [12, 46], // 000001010110 - [12, 47], // 000001010111 - [12, 57], // 000001011000 - [12, 58], // 000001011001 - [12, 61], // 000001011010 - [12, 256], // 000001011011 - [10, 16], [10, 16], [10, 16], [10, 16], // 0000010111xx - [10, 17], [10, 17], [10, 17], [10, 17], // 0000011000xx - [12, 48], // 000001100100 - [12, 49], // 000001100101 - [12, 62], // 000001100110 - [12, 63], // 000001100111 - [12, 30], // 000001101000 - [12, 31], // 000001101001 - [12, 32], // 000001101010 - [12, 33], // 000001101011 - [12, 40], // 000001101100 - [12, 41], // 000001101101 - [11, 22], [11, 22], // 00000110111x - [8, 14], [8, 14], [8, 14], [8, 14], // 00000111xxxx - [8, 14], [8, 14], [8, 14], [8, 14], - [8, 14], [8, 14], [8, 14], [8, 14], - [8, 14], [8, 14], [8, 14], [8, 14], - [7, 10], [7, 10], [7, 10], [7, 10], // 0000100xxxxx - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 11], [7, 11], [7, 11], [7, 11], // 0000101xxxxx - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [9, 15], [9, 15], [9, 15], [9, 15], // 000011000xxx - [9, 15], [9, 15], [9, 15], [9, 15], - [12, 128], // 000011001000 - [12, 192], // 000011001001 - [12, 26], // 000011001010 - [12, 27], // 000011001011 - [12, 28], // 000011001100 - [12, 29], // 000011001101 - [11, 19], [11, 19], // 00001100111x - [11, 20], [11, 20], // 00001101000x - [12, 34], // 000011010010 - [12, 35], // 000011010011 - [12, 36], // 000011010100 - [12, 37], // 000011010101 - [12, 38], // 000011010110 - [12, 39], // 000011010111 - [11, 21], [11, 21], // 00001101100x - [12, 42], // 000011011010 - [12, 43], // 000011011011 - [10, 0], [10, 0], [10, 0], [10, 0], // 0000110111xx - [7, 12], [7, 12], [7, 12], [7, 12], // 0000111xxxxx - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12] - ]; - - var blackTable3 = [ - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 0000xx - [6, 9], // 000100 - [6, 8], // 000101 - [5, 7], [5, 7], // 00011x - [4, 6], [4, 6], [4, 6], [4, 6], // 0010xx - [4, 5], [4, 5], [4, 5], [4, 5], // 0011xx - [3, 1], [3, 1], [3, 1], [3, 1], // 010xxx - [3, 1], [3, 1], [3, 1], [3, 1], - [3, 4], [3, 4], [3, 4], [3, 4], // 011xxx - [3, 4], [3, 4], [3, 4], [3, 4], - [2, 3], [2, 3], [2, 3], [2, 3], // 10xxxx - [2, 3], [2, 3], [2, 3], [2, 3], - [2, 3], [2, 3], [2, 3], [2, 3], - [2, 3], [2, 3], [2, 3], [2, 3], - [2, 2], [2, 2], [2, 2], [2, 2], // 11xxxx - [2, 2], [2, 2], [2, 2], [2, 2], - [2, 2], [2, 2], [2, 2], [2, 2], - [2, 2], [2, 2], [2, 2], [2, 2] - ]; - - function CCITTFaxStream(str, maybeLength, params) { - this.str = str; - this.dict = str.dict; - - params = params || Dict.empty; - - this.encoding = params.get('K') || 0; - this.eoline = params.get('EndOfLine') || false; - this.byteAlign = params.get('EncodedByteAlign') || false; - this.columns = params.get('Columns') || 1728; - this.rows = params.get('Rows') || 0; - var eoblock = params.get('EndOfBlock'); - if (eoblock === null || eoblock === undefined) { - eoblock = true; - } - this.eoblock = eoblock; - this.black = params.get('BlackIs1') || false; - - this.codingLine = new Uint32Array(this.columns + 1); - this.refLine = new Uint32Array(this.columns + 2); - - this.codingLine[0] = this.columns; - this.codingPos = 0; - - this.row = 0; - this.nextLine2D = this.encoding < 0; - this.inputBits = 0; - this.inputBuf = 0; - this.outputBits = 0; - - var code1; - while ((code1 = this.lookBits(12)) === 0) { - this.eatBits(1); - } - if (code1 === 1) { - this.eatBits(12); - } - if (this.encoding > 0) { - this.nextLine2D = !this.lookBits(1); - this.eatBits(1); - } - - DecodeStream.call(this, maybeLength); - } - - CCITTFaxStream.prototype = Object.create(DecodeStream.prototype); - - CCITTFaxStream.prototype.readBlock = function CCITTFaxStream_readBlock() { - while (!this.eof) { - var c = this.lookChar(); - this.ensureBuffer(this.bufferLength + 1); - this.buffer[this.bufferLength++] = c; - } - }; - - CCITTFaxStream.prototype.addPixels = - function ccittFaxStreamAddPixels(a1, blackPixels) { - var codingLine = this.codingLine; - var codingPos = this.codingPos; - - if (a1 > codingLine[codingPos]) { - if (a1 > this.columns) { - info('row is wrong length'); - this.err = true; - a1 = this.columns; - } - if ((codingPos & 1) ^ blackPixels) { - ++codingPos; - } - - codingLine[codingPos] = a1; - } - this.codingPos = codingPos; - }; - - CCITTFaxStream.prototype.addPixelsNeg = - function ccittFaxStreamAddPixelsNeg(a1, blackPixels) { - var codingLine = this.codingLine; - var codingPos = this.codingPos; - - if (a1 > codingLine[codingPos]) { - if (a1 > this.columns) { - info('row is wrong length'); - this.err = true; - a1 = this.columns; - } - if ((codingPos & 1) ^ blackPixels) { - ++codingPos; - } - - codingLine[codingPos] = a1; - } else if (a1 < codingLine[codingPos]) { - if (a1 < 0) { - info('invalid code'); - this.err = true; - a1 = 0; - } - while (codingPos > 0 && a1 < codingLine[codingPos - 1]) { - --codingPos; - } - codingLine[codingPos] = a1; - } - - this.codingPos = codingPos; - }; - - CCITTFaxStream.prototype.lookChar = function CCITTFaxStream_lookChar() { - var refLine = this.refLine; - var codingLine = this.codingLine; - var columns = this.columns; - - var refPos, blackPixels, bits, i; - - if (this.outputBits === 0) { - if (this.eof) { - return null; - } - this.err = false; - - var code1, code2, code3; - if (this.nextLine2D) { - for (i = 0; codingLine[i] < columns; ++i) { - refLine[i] = codingLine[i]; - } - refLine[i++] = columns; - refLine[i] = columns; - codingLine[0] = 0; - this.codingPos = 0; - refPos = 0; - blackPixels = 0; - - while (codingLine[this.codingPos] < columns) { - code1 = this.getTwoDimCode(); - switch (code1) { - case twoDimPass: - this.addPixels(refLine[refPos + 1], blackPixels); - if (refLine[refPos + 1] < columns) { - refPos += 2; - } - break; - case twoDimHoriz: - code1 = code2 = 0; - if (blackPixels) { - do { - code1 += (code3 = this.getBlackCode()); - } while (code3 >= 64); - do { - code2 += (code3 = this.getWhiteCode()); - } while (code3 >= 64); - } else { - do { - code1 += (code3 = this.getWhiteCode()); - } while (code3 >= 64); - do { - code2 += (code3 = this.getBlackCode()); - } while (code3 >= 64); - } - this.addPixels(codingLine[this.codingPos] + - code1, blackPixels); - if (codingLine[this.codingPos] < columns) { - this.addPixels(codingLine[this.codingPos] + code2, - blackPixels ^ 1); - } - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - break; - case twoDimVertR3: - this.addPixels(refLine[refPos] + 3, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - ++refPos; - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVertR2: - this.addPixels(refLine[refPos] + 2, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - ++refPos; - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVertR1: - this.addPixels(refLine[refPos] + 1, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - ++refPos; - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVert0: - this.addPixels(refLine[refPos], blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - ++refPos; - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVertL3: - this.addPixelsNeg(refLine[refPos] - 3, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - if (refPos > 0) { - --refPos; - } else { - ++refPos; - } - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVertL2: - this.addPixelsNeg(refLine[refPos] - 2, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - if (refPos > 0) { - --refPos; - } else { - ++refPos; - } - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVertL1: - this.addPixelsNeg(refLine[refPos] - 1, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - if (refPos > 0) { - --refPos; - } else { - ++refPos; - } - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case EOF: - this.addPixels(columns, 0); - this.eof = true; - break; - default: - info('bad 2d code'); - this.addPixels(columns, 0); - this.err = true; - } - } - } else { - codingLine[0] = 0; - this.codingPos = 0; - blackPixels = 0; - while (codingLine[this.codingPos] < columns) { - code1 = 0; - if (blackPixels) { - do { - code1 += (code3 = this.getBlackCode()); - } while (code3 >= 64); - } else { - do { - code1 += (code3 = this.getWhiteCode()); - } while (code3 >= 64); - } - this.addPixels(codingLine[this.codingPos] + code1, blackPixels); - blackPixels ^= 1; - } - } - - var gotEOL = false; - - if (this.byteAlign) { - this.inputBits &= ~7; - } - - if (!this.eoblock && this.row === this.rows - 1) { - this.eof = true; - } else { - code1 = this.lookBits(12); - if (this.eoline) { - while (code1 !== EOF && code1 !== 1) { - this.eatBits(1); - code1 = this.lookBits(12); - } - } else { - while (code1 === 0) { - this.eatBits(1); - code1 = this.lookBits(12); - } - } - if (code1 === 1) { - this.eatBits(12); - gotEOL = true; - } else if (code1 === EOF) { - this.eof = true; - } - } - - if (!this.eof && this.encoding > 0) { - this.nextLine2D = !this.lookBits(1); - this.eatBits(1); - } - - if (this.eoblock && gotEOL && this.byteAlign) { - code1 = this.lookBits(12); - if (code1 === 1) { - this.eatBits(12); - if (this.encoding > 0) { - this.lookBits(1); - this.eatBits(1); - } - if (this.encoding >= 0) { - for (i = 0; i < 4; ++i) { - code1 = this.lookBits(12); - if (code1 !== 1) { - info('bad rtc code: ' + code1); - } - this.eatBits(12); - if (this.encoding > 0) { - this.lookBits(1); - this.eatBits(1); - } - } - } - this.eof = true; - } - } else if (this.err && this.eoline) { - while (true) { - code1 = this.lookBits(13); - if (code1 === EOF) { - this.eof = true; - return null; - } - if ((code1 >> 1) === 1) { - break; - } - this.eatBits(1); - } - this.eatBits(12); - if (this.encoding > 0) { - this.eatBits(1); - this.nextLine2D = !(code1 & 1); - } - } - - if (codingLine[0] > 0) { - this.outputBits = codingLine[this.codingPos = 0]; - } else { - this.outputBits = codingLine[this.codingPos = 1]; - } - this.row++; - } - - var c; - if (this.outputBits >= 8) { - c = (this.codingPos & 1) ? 0 : 0xFF; - this.outputBits -= 8; - if (this.outputBits === 0 && codingLine[this.codingPos] < columns) { - this.codingPos++; - this.outputBits = (codingLine[this.codingPos] - - codingLine[this.codingPos - 1]); - } - } else { - bits = 8; - c = 0; - do { - if (this.outputBits > bits) { - c <<= bits; - if (!(this.codingPos & 1)) { - c |= 0xFF >> (8 - bits); - } - this.outputBits -= bits; - bits = 0; - } else { - c <<= this.outputBits; - if (!(this.codingPos & 1)) { - c |= 0xFF >> (8 - this.outputBits); - } - bits -= this.outputBits; - this.outputBits = 0; - if (codingLine[this.codingPos] < columns) { - this.codingPos++; - this.outputBits = (codingLine[this.codingPos] - - codingLine[this.codingPos - 1]); - } else if (bits > 0) { - c <<= bits; - bits = 0; - } - } - } while (bits); - } - if (this.black) { - c ^= 0xFF; - } - return c; - }; - - // This functions returns the code found from the table. - // The start and end parameters set the boundaries for searching the table. - // The limit parameter is optional. Function returns an array with three - // values. The first array element indicates whether a valid code is being - // returned. The second array element is the actual code. The third array - // element indicates whether EOF was reached. - CCITTFaxStream.prototype.findTableCode = - function ccittFaxStreamFindTableCode(start, end, table, limit) { - - var limitValue = limit || 0; - for (var i = start; i <= end; ++i) { - var code = this.lookBits(i); - if (code === EOF) { - return [true, 1, false]; - } - if (i < end) { - code <<= end - i; - } - if (!limitValue || code >= limitValue) { - var p = table[code - limitValue]; - if (p[0] === i) { - this.eatBits(i); - return [true, p[1], true]; - } - } - } - return [false, 0, false]; - }; - - CCITTFaxStream.prototype.getTwoDimCode = - function ccittFaxStreamGetTwoDimCode() { - - var code = 0; - var p; - if (this.eoblock) { - code = this.lookBits(7); - p = twoDimTable[code]; - if (p && p[0] > 0) { - this.eatBits(p[0]); - return p[1]; - } - } else { - var result = this.findTableCode(1, 7, twoDimTable); - if (result[0] && result[2]) { - return result[1]; - } - } - info('Bad two dim code'); - return EOF; - }; - - CCITTFaxStream.prototype.getWhiteCode = - function ccittFaxStreamGetWhiteCode() { - - var code = 0; - var p; - if (this.eoblock) { - code = this.lookBits(12); - if (code === EOF) { - return 1; - } - - if ((code >> 5) === 0) { - p = whiteTable1[code]; - } else { - p = whiteTable2[code >> 3]; - } - - if (p[0] > 0) { - this.eatBits(p[0]); - return p[1]; - } - } else { - var result = this.findTableCode(1, 9, whiteTable2); - if (result[0]) { - return result[1]; - } - - result = this.findTableCode(11, 12, whiteTable1); - if (result[0]) { - return result[1]; - } - } - info('bad white code'); - this.eatBits(1); - return 1; - }; - - CCITTFaxStream.prototype.getBlackCode = - function ccittFaxStreamGetBlackCode() { - - var code, p; - if (this.eoblock) { - code = this.lookBits(13); - if (code === EOF) { - return 1; - } - if ((code >> 7) === 0) { - p = blackTable1[code]; - } else if ((code >> 9) === 0 && (code >> 7) !== 0) { - p = blackTable2[(code >> 1) - 64]; - } else { - p = blackTable3[code >> 7]; - } - - if (p[0] > 0) { - this.eatBits(p[0]); - return p[1]; - } - } else { - var result = this.findTableCode(2, 6, blackTable3); - if (result[0]) { - return result[1]; - } - - result = this.findTableCode(7, 12, blackTable2, 64); - if (result[0]) { - return result[1]; - } - - result = this.findTableCode(10, 13, blackTable1); - if (result[0]) { - return result[1]; - } - } - info('bad black code'); - this.eatBits(1); - return 1; - }; - - CCITTFaxStream.prototype.lookBits = function CCITTFaxStream_lookBits(n) { - var c; - while (this.inputBits < n) { - if ((c = this.str.getByte()) === -1) { - if (this.inputBits === 0) { - return EOF; - } - return ((this.inputBuf << (n - this.inputBits)) & - (0xFFFF >> (16 - n))); - } - this.inputBuf = (this.inputBuf << 8) + c; - this.inputBits += 8; - } - return (this.inputBuf >> (this.inputBits - n)) & (0xFFFF >> (16 - n)); - }; - - CCITTFaxStream.prototype.eatBits = function CCITTFaxStream_eatBits(n) { - if ((this.inputBits -= n) < 0) { - this.inputBits = 0; - } - }; - - return CCITTFaxStream; -})(); - -var LZWStream = (function LZWStreamClosure() { - function LZWStream(str, maybeLength, earlyChange) { - this.str = str; - this.dict = str.dict; - this.cachedData = 0; - this.bitsCached = 0; - - var maxLzwDictionarySize = 4096; - var lzwState = { - earlyChange: earlyChange, - codeLength: 9, - nextCode: 258, - dictionaryValues: new Uint8Array(maxLzwDictionarySize), - dictionaryLengths: new Uint16Array(maxLzwDictionarySize), - dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize), - currentSequence: new Uint8Array(maxLzwDictionarySize), - currentSequenceLength: 0 - }; - for (var i = 0; i < 256; ++i) { - lzwState.dictionaryValues[i] = i; - lzwState.dictionaryLengths[i] = 1; - } - this.lzwState = lzwState; - - DecodeStream.call(this, maybeLength); - } - - LZWStream.prototype = Object.create(DecodeStream.prototype); - - LZWStream.prototype.readBits = function LZWStream_readBits(n) { - var bitsCached = this.bitsCached; - var cachedData = this.cachedData; - while (bitsCached < n) { - var c = this.str.getByte(); - if (c === -1) { - this.eof = true; - return null; - } - cachedData = (cachedData << 8) | c; - bitsCached += 8; - } - this.bitsCached = (bitsCached -= n); - this.cachedData = cachedData; - this.lastCode = null; - return (cachedData >>> bitsCached) & ((1 << n) - 1); - }; - - LZWStream.prototype.readBlock = function LZWStream_readBlock() { - var blockSize = 512; - var estimatedDecodedSize = blockSize * 2, decodedSizeDelta = blockSize; - var i, j, q; - - var lzwState = this.lzwState; - if (!lzwState) { - return; // eof was found - } - - var earlyChange = lzwState.earlyChange; - var nextCode = lzwState.nextCode; - var dictionaryValues = lzwState.dictionaryValues; - var dictionaryLengths = lzwState.dictionaryLengths; - var dictionaryPrevCodes = lzwState.dictionaryPrevCodes; - var codeLength = lzwState.codeLength; - var prevCode = lzwState.prevCode; - var currentSequence = lzwState.currentSequence; - var currentSequenceLength = lzwState.currentSequenceLength; - - var decodedLength = 0; - var currentBufferLength = this.bufferLength; - var buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); - - for (i = 0; i < blockSize; i++) { - var code = this.readBits(codeLength); - var hasPrev = currentSequenceLength > 0; - if (code < 256) { - currentSequence[0] = code; - currentSequenceLength = 1; - } else if (code >= 258) { - if (code < nextCode) { - currentSequenceLength = dictionaryLengths[code]; - for (j = currentSequenceLength - 1, q = code; j >= 0; j--) { - currentSequence[j] = dictionaryValues[q]; - q = dictionaryPrevCodes[q]; - } - } else { - currentSequence[currentSequenceLength++] = currentSequence[0]; - } - } else if (code === 256) { - codeLength = 9; - nextCode = 258; - currentSequenceLength = 0; - continue; - } else { - this.eof = true; - delete this.lzwState; - break; - } - - if (hasPrev) { - dictionaryPrevCodes[nextCode] = prevCode; - dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1; - dictionaryValues[nextCode] = currentSequence[0]; - nextCode++; - codeLength = (nextCode + earlyChange) & (nextCode + earlyChange - 1) ? - codeLength : Math.min(Math.log(nextCode + earlyChange) / - 0.6931471805599453 + 1, 12) | 0; - } - prevCode = code; - - decodedLength += currentSequenceLength; - if (estimatedDecodedSize < decodedLength) { - do { - estimatedDecodedSize += decodedSizeDelta; - } while (estimatedDecodedSize < decodedLength); - buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); - } - for (j = 0; j < currentSequenceLength; j++) { - buffer[currentBufferLength++] = currentSequence[j]; - } - } - lzwState.nextCode = nextCode; - lzwState.codeLength = codeLength; - lzwState.prevCode = prevCode; - lzwState.currentSequenceLength = currentSequenceLength; - - this.bufferLength = currentBufferLength; - }; - - return LZWStream; -})(); - -var NullStream = (function NullStreamClosure() { - function NullStream() { - Stream.call(this, new Uint8Array(0)); - } - - NullStream.prototype = Stream.prototype; - - return NullStream; -})(); - - -var WorkerTask = (function WorkerTaskClosure() { - function WorkerTask(name) { - this.name = name; - this.terminated = false; - this._capability = createPromiseCapability(); - } - - WorkerTask.prototype = { - get finished() { - return this._capability.promise; - }, - - finish: function () { - this._capability.resolve(); - }, - - terminate: function () { - this.terminated = true; - }, - - ensureNotTerminated: function () { - if (this.terminated) { - throw new Error('Worker task was terminated'); - } - } - }; - - return WorkerTask; -})(); - -var WorkerMessageHandler = PDFJS.WorkerMessageHandler = { - setup: function wphSetup(handler, port) { - handler.on('test', function wphSetupTest(data) { - // check if Uint8Array can be sent to worker - if (!(data instanceof Uint8Array)) { - handler.send('test', 'main', false); - return; - } - // making sure postMessage transfers are working - var supportTransfers = data[0] === 255; - handler.postMessageTransfers = supportTransfers; - // check if the response property is supported by xhr - var xhr = new XMLHttpRequest(); - var responseExists = 'response' in xhr; - // check if the property is actually implemented - try { - var dummy = xhr.responseType; - } catch (e) { - responseExists = false; - } - if (!responseExists) { - handler.send('test', false); - return; - } - handler.send('test', { - supportTypedArray: true, - supportTransfers: supportTransfers - }); - }); - - handler.on('GetDocRequest', function wphSetupDoc(data) { - return WorkerMessageHandler.createDocumentHandler(data, port); - }); - }, - createDocumentHandler: function wphCreateDocumentHandler(docParams, port) { - // This context is actually holds references on pdfManager and handler, - // until the latter is destroyed. - var pdfManager; - var terminated = false; - var cancelXHRs = null; - var WorkerTasks = []; - - var docId = docParams.docId; - var workerHandlerName = docParams.docId + '_worker'; - var handler = new MessageHandler(workerHandlerName, docId, port); - - function ensureNotTerminated() { - if (terminated) { - throw new Error('Worker was terminated'); - } - } - - function startWorkerTask(task) { - WorkerTasks.push(task); - } - - function finishWorkerTask(task) { - task.finish(); - var i = WorkerTasks.indexOf(task); - WorkerTasks.splice(i, 1); - } - - function loadDocument(recoveryMode) { - var loadDocumentCapability = createPromiseCapability(); - - var parseSuccess = function parseSuccess() { - var numPagesPromise = pdfManager.ensureDoc('numPages'); - var fingerprintPromise = pdfManager.ensureDoc('fingerprint'); - var encryptedPromise = pdfManager.ensureXRef('encrypt'); - Promise.all([numPagesPromise, fingerprintPromise, - encryptedPromise]).then(function onDocReady(results) { - var doc = { - numPages: results[0], - fingerprint: results[1], - encrypted: !!results[2], - }; - loadDocumentCapability.resolve(doc); - }, - parseFailure); - }; - - var parseFailure = function parseFailure(e) { - loadDocumentCapability.reject(e); - }; - - pdfManager.ensureDoc('checkHeader', []).then(function() { - pdfManager.ensureDoc('parseStartXRef', []).then(function() { - pdfManager.ensureDoc('parse', [recoveryMode]).then( - parseSuccess, parseFailure); - }, parseFailure); - }, parseFailure); - - return loadDocumentCapability.promise; - } - - function getPdfManager(data) { - var pdfManagerCapability = createPromiseCapability(); - var pdfManager; - - var source = data.source; - var disableRange = data.disableRange; - if (source.data) { - try { - pdfManager = new LocalPdfManager(docId, source.data, source.password); - pdfManagerCapability.resolve(pdfManager); - } catch (ex) { - pdfManagerCapability.reject(ex); - } - return pdfManagerCapability.promise; - } else if (source.chunkedViewerLoading) { - try { - pdfManager = new NetworkPdfManager(docId, source, handler); - pdfManagerCapability.resolve(pdfManager); - } catch (ex) { - pdfManagerCapability.reject(ex); - } - return pdfManagerCapability.promise; - } - - var networkManager = new NetworkManager(source.url, { - httpHeaders: source.httpHeaders, - withCredentials: source.withCredentials - }); - var cachedChunks = []; - var fullRequestXhrId = networkManager.requestFull({ - onHeadersReceived: function onHeadersReceived() { - if (disableRange) { - return; - } - - var fullRequestXhr = networkManager.getRequestXhr(fullRequestXhrId); - if (fullRequestXhr.getResponseHeader('Accept-Ranges') !== 'bytes') { - return; - } - - var contentEncoding = - fullRequestXhr.getResponseHeader('Content-Encoding') || 'identity'; - if (contentEncoding !== 'identity') { - return; - } - - var length = fullRequestXhr.getResponseHeader('Content-Length'); - length = parseInt(length, 10); - if (!isInt(length)) { - return; - } - source.length = length; - if (length <= 2 * source.rangeChunkSize) { - // The file size is smaller than the size of two chunks, so it does - // not make any sense to abort the request and retry with a range - // request. - return; - } - - if (networkManager.isStreamingRequest(fullRequestXhrId)) { - // We can continue fetching when progressive loading is enabled, - // and we don't need the autoFetch feature. - source.disableAutoFetch = true; - } else { - // NOTE: by cancelling the full request, and then issuing range - // requests, there will be an issue for sites where you can only - // request the pdf once. However, if this is the case, then the - // server should not be returning that it can support range - // requests. - networkManager.abortRequest(fullRequestXhrId); - } - - try { - pdfManager = new NetworkPdfManager(docId, source, handler); - pdfManagerCapability.resolve(pdfManager); - } catch (ex) { - pdfManagerCapability.reject(ex); - } - cancelXHRs = null; - }, - - onProgressiveData: source.disableStream ? null : - function onProgressiveData(chunk) { - if (!pdfManager) { - cachedChunks.push(chunk); - return; - } - pdfManager.sendProgressiveData(chunk); - }, - - onDone: function onDone(args) { - if (pdfManager) { - return; // already processed - } - - var pdfFile; - if (args === null) { - // TODO add some streaming manager, e.g. for unknown length files. - // The data was returned in the onProgressiveData, combining... - var pdfFileLength = 0, pos = 0; - cachedChunks.forEach(function (chunk) { - pdfFileLength += chunk.byteLength; - }); - if (source.length && pdfFileLength !== source.length) { - warn('reported HTTP length is different from actual'); - } - var pdfFileArray = new Uint8Array(pdfFileLength); - cachedChunks.forEach(function (chunk) { - pdfFileArray.set(new Uint8Array(chunk), pos); - pos += chunk.byteLength; - }); - pdfFile = pdfFileArray.buffer; - } else { - pdfFile = args.chunk; - } - - // the data is array, instantiating directly from it - try { - pdfManager = new LocalPdfManager(docId, pdfFile, source.password); - pdfManagerCapability.resolve(pdfManager); - } catch (ex) { - pdfManagerCapability.reject(ex); - } - cancelXHRs = null; - }, - - onError: function onError(status) { - var exception; - if (status === 404 || status === 0 && /^file:/.test(source.url)) { - exception = new MissingPDFException('Missing PDF "' + - source.url + '".'); - handler.send('MissingPDF', exception); - } else { - exception = new UnexpectedResponseException( - 'Unexpected server response (' + status + - ') while retrieving PDF "' + source.url + '".', status); - handler.send('UnexpectedResponse', exception); - } - cancelXHRs = null; - }, - - onProgress: function onProgress(evt) { - handler.send('DocProgress', { - loaded: evt.loaded, - total: evt.lengthComputable ? evt.total : source.length - }); - } - }); - - cancelXHRs = function () { - networkManager.abortRequest(fullRequestXhrId); - }; - - return pdfManagerCapability.promise; - } - - var setupDoc = function(data) { - var onSuccess = function(doc) { - ensureNotTerminated(); - handler.send('GetDoc', { pdfInfo: doc }); - }; - - var onFailure = function(e) { - if (e instanceof PasswordException) { - if (e.code === PasswordResponses.NEED_PASSWORD) { - handler.send('NeedPassword', e); - } else if (e.code === PasswordResponses.INCORRECT_PASSWORD) { - handler.send('IncorrectPassword', e); - } - } else if (e instanceof InvalidPDFException) { - handler.send('InvalidPDF', e); - } else if (e instanceof MissingPDFException) { - handler.send('MissingPDF', e); - } else if (e instanceof UnexpectedResponseException) { - handler.send('UnexpectedResponse', e); - } else { - handler.send('UnknownError', - new UnknownErrorException(e.message, e.toString())); - } - }; - - ensureNotTerminated(); - - PDFJS.maxImageSize = data.maxImageSize === undefined ? - -1 : data.maxImageSize; - PDFJS.disableFontFace = data.disableFontFace; - PDFJS.disableCreateObjectURL = data.disableCreateObjectURL; - PDFJS.verbosity = data.verbosity; - PDFJS.cMapUrl = data.cMapUrl === undefined ? - null : data.cMapUrl; - PDFJS.cMapPacked = data.cMapPacked === true; - - getPdfManager(data).then(function (newPdfManager) { - if (terminated) { - // We were in a process of setting up the manager, but it got - // terminated in the middle. - newPdfManager.terminate(); - throw new Error('Worker was terminated'); - } - - pdfManager = newPdfManager; - handler.send('PDFManagerReady', null); - pdfManager.onLoadedStream().then(function(stream) { - handler.send('DataLoaded', { length: stream.bytes.byteLength }); - }); - }).then(function pdfManagerReady() { - ensureNotTerminated(); - - loadDocument(false).then(onSuccess, function loadFailure(ex) { - ensureNotTerminated(); - - // Try again with recoveryMode == true - if (!(ex instanceof XRefParseException)) { - if (ex instanceof PasswordException) { - // after password exception prepare to receive a new password - // to repeat loading - pdfManager.passwordChanged().then(pdfManagerReady); - } - - onFailure(ex); - return; - } - - pdfManager.requestLoadedStream(); - pdfManager.onLoadedStream().then(function() { - ensureNotTerminated(); - - loadDocument(true).then(onSuccess, onFailure); - }); - }, onFailure); - }, onFailure); - }; - - handler.on('GetPage', function wphSetupGetPage(data) { - return pdfManager.getPage(data.pageIndex).then(function(page) { - var rotatePromise = pdfManager.ensure(page, 'rotate'); - var refPromise = pdfManager.ensure(page, 'ref'); - var viewPromise = pdfManager.ensure(page, 'view'); - - return Promise.all([rotatePromise, refPromise, viewPromise]).then( - function(results) { - return { - rotate: results[0], - ref: results[1], - view: results[2] - }; - }); - }); - }); - - handler.on('GetPageIndex', function wphSetupGetPageIndex(data) { - var ref = new Ref(data.ref.num, data.ref.gen); - var catalog = pdfManager.pdfDocument.catalog; - return catalog.getPageIndex(ref); - }); - - handler.on('GetDestinations', - function wphSetupGetDestinations(data) { - return pdfManager.ensureCatalog('destinations'); - } - ); - - handler.on('GetDestination', - function wphSetupGetDestination(data) { - return pdfManager.ensureCatalog('getDestination', [data.id]); - } - ); - - handler.on('GetAttachments', - function wphSetupGetAttachments(data) { - return pdfManager.ensureCatalog('attachments'); - } - ); - - handler.on('GetJavaScript', - function wphSetupGetJavaScript(data) { - return pdfManager.ensureCatalog('javaScript'); - } - ); - - handler.on('GetOutline', - function wphSetupGetOutline(data) { - return pdfManager.ensureCatalog('documentOutline'); - } - ); - - handler.on('GetMetadata', - function wphSetupGetMetadata(data) { - return Promise.all([pdfManager.ensureDoc('documentInfo'), - pdfManager.ensureCatalog('metadata')]); - } - ); - - handler.on('GetData', function wphSetupGetData(data) { - pdfManager.requestLoadedStream(); - return pdfManager.onLoadedStream().then(function(stream) { - return stream.bytes; - }); - }); - - handler.on('GetStats', - function wphSetupGetStats(data) { - return pdfManager.pdfDocument.xref.stats; - } - ); - - handler.on('UpdatePassword', function wphSetupUpdatePassword(data) { - pdfManager.updatePassword(data); - }); - - handler.on('GetAnnotations', function wphSetupGetAnnotations(data) { - return pdfManager.getPage(data.pageIndex).then(function(page) { - return pdfManager.ensure(page, 'getAnnotationsData', [data.intent]); - }); - }); - - handler.on('RenderPageRequest', function wphSetupRenderPage(data) { - var pageIndex = data.pageIndex; - pdfManager.getPage(pageIndex).then(function(page) { - var task = new WorkerTask('RenderPageRequest: page ' + pageIndex); - startWorkerTask(task); - - var pageNum = pageIndex + 1; - var start = Date.now(); - // Pre compile the pdf page and fetch the fonts/images. - page.getOperatorList(handler, task, data.intent).then( - function(operatorList) { - finishWorkerTask(task); - - info('page=' + pageNum + ' - getOperatorList: time=' + - (Date.now() - start) + 'ms, len=' + operatorList.totalLength); - }, function(e) { - finishWorkerTask(task); - if (task.terminated) { - return; // ignoring errors from the terminated thread - } - - // For compatibility with older behavior, generating unknown - // unsupported feature notification on errors. - handler.send('UnsupportedFeature', - {featureId: UNSUPPORTED_FEATURES.unknown}); - - var minimumStackMessage = - 'worker.js: while trying to getPage() and getOperatorList()'; - - var wrappedException; - - // Turn the error into an obj that can be serialized - if (typeof e === 'string') { - wrappedException = { - message: e, - stack: minimumStackMessage - }; - } else if (typeof e === 'object') { - wrappedException = { - message: e.message || e.toString(), - stack: e.stack || minimumStackMessage - }; - } else { - wrappedException = { - message: 'Unknown exception type: ' + (typeof e), - stack: minimumStackMessage - }; - } - - handler.send('PageError', { - pageNum: pageNum, - error: wrappedException, - intent: data.intent - }); - }); - }); - }, this); - - handler.on('GetTextContent', function wphExtractText(data) { - var pageIndex = data.pageIndex; - var normalizeWhitespace = data.normalizeWhitespace; - return pdfManager.getPage(pageIndex).then(function(page) { - var task = new WorkerTask('GetTextContent: page ' + pageIndex); - startWorkerTask(task); - var pageNum = pageIndex + 1; - var start = Date.now(); - return page.extractTextContent(task, normalizeWhitespace).then( - function(textContent) { - finishWorkerTask(task); - info('text indexing: page=' + pageNum + ' - time=' + - (Date.now() - start) + 'ms'); - return textContent; - }, function (reason) { - finishWorkerTask(task); - if (task.terminated) { - return; // ignoring errors from the terminated thread - } - throw reason; - }); - }); - }); - - handler.on('Cleanup', function wphCleanup(data) { - return pdfManager.cleanup(); - }); - - handler.on('Terminate', function wphTerminate(data) { - terminated = true; - if (pdfManager) { - pdfManager.terminate(); - pdfManager = null; - } - if (cancelXHRs) { - cancelXHRs(); - } - - var waitOn = []; - WorkerTasks.forEach(function (task) { - waitOn.push(task.finished); - task.terminate(); - }); - - return Promise.all(waitOn).then(function () { - // Notice that even if we destroying handler, resolved response promise - // must be sent back. - handler.destroy(); - handler = null; - }); - }); - - handler.on('Ready', function wphReady(data) { - setupDoc(docParams); - docParams = null; // we don't need docParams anymore -- saving memory. - }); - return workerHandlerName; - } -}; - -var consoleTimer = {}; - -var workerConsole = { - log: function log() { - var args = Array.prototype.slice.call(arguments); - globalScope.postMessage({ - targetName: 'main', - action: 'console_log', - data: args - }); - }, - - error: function error() { - var args = Array.prototype.slice.call(arguments); - globalScope.postMessage({ - targetName: 'main', - action: 'console_error', - data: args - }); - throw 'pdf.js execution error'; - }, - - time: function time(name) { - consoleTimer[name] = Date.now(); - }, - - timeEnd: function timeEnd(name) { - var time = consoleTimer[name]; - if (!time) { - error('Unknown timer name ' + name); - } - this.log('Timer:', name, Date.now() - time); - } -}; - - -// Worker thread? -if (typeof window === 'undefined') { - if (!('console' in globalScope)) { - globalScope.console = workerConsole; - } - - var handler = new MessageHandler('worker', 'main', this); - WorkerMessageHandler.setup(handler, this); -} - - -/* This class implements the QM Coder decoding as defined in - * JPEG 2000 Part I Final Committee Draft Version 1.0 - * Annex C.3 Arithmetic decoding procedure - * available at http://www.jpeg.org/public/fcd15444-1.pdf - * - * The arithmetic decoder is used in conjunction with context models to decode - * JPEG2000 and JBIG2 streams. - */ -var ArithmeticDecoder = (function ArithmeticDecoderClosure() { - // Table C-2 - var QeTable = [ - {qe: 0x5601, nmps: 1, nlps: 1, switchFlag: 1}, - {qe: 0x3401, nmps: 2, nlps: 6, switchFlag: 0}, - {qe: 0x1801, nmps: 3, nlps: 9, switchFlag: 0}, - {qe: 0x0AC1, nmps: 4, nlps: 12, switchFlag: 0}, - {qe: 0x0521, nmps: 5, nlps: 29, switchFlag: 0}, - {qe: 0x0221, nmps: 38, nlps: 33, switchFlag: 0}, - {qe: 0x5601, nmps: 7, nlps: 6, switchFlag: 1}, - {qe: 0x5401, nmps: 8, nlps: 14, switchFlag: 0}, - {qe: 0x4801, nmps: 9, nlps: 14, switchFlag: 0}, - {qe: 0x3801, nmps: 10, nlps: 14, switchFlag: 0}, - {qe: 0x3001, nmps: 11, nlps: 17, switchFlag: 0}, - {qe: 0x2401, nmps: 12, nlps: 18, switchFlag: 0}, - {qe: 0x1C01, nmps: 13, nlps: 20, switchFlag: 0}, - {qe: 0x1601, nmps: 29, nlps: 21, switchFlag: 0}, - {qe: 0x5601, nmps: 15, nlps: 14, switchFlag: 1}, - {qe: 0x5401, nmps: 16, nlps: 14, switchFlag: 0}, - {qe: 0x5101, nmps: 17, nlps: 15, switchFlag: 0}, - {qe: 0x4801, nmps: 18, nlps: 16, switchFlag: 0}, - {qe: 0x3801, nmps: 19, nlps: 17, switchFlag: 0}, - {qe: 0x3401, nmps: 20, nlps: 18, switchFlag: 0}, - {qe: 0x3001, nmps: 21, nlps: 19, switchFlag: 0}, - {qe: 0x2801, nmps: 22, nlps: 19, switchFlag: 0}, - {qe: 0x2401, nmps: 23, nlps: 20, switchFlag: 0}, - {qe: 0x2201, nmps: 24, nlps: 21, switchFlag: 0}, - {qe: 0x1C01, nmps: 25, nlps: 22, switchFlag: 0}, - {qe: 0x1801, nmps: 26, nlps: 23, switchFlag: 0}, - {qe: 0x1601, nmps: 27, nlps: 24, switchFlag: 0}, - {qe: 0x1401, nmps: 28, nlps: 25, switchFlag: 0}, - {qe: 0x1201, nmps: 29, nlps: 26, switchFlag: 0}, - {qe: 0x1101, nmps: 30, nlps: 27, switchFlag: 0}, - {qe: 0x0AC1, nmps: 31, nlps: 28, switchFlag: 0}, - {qe: 0x09C1, nmps: 32, nlps: 29, switchFlag: 0}, - {qe: 0x08A1, nmps: 33, nlps: 30, switchFlag: 0}, - {qe: 0x0521, nmps: 34, nlps: 31, switchFlag: 0}, - {qe: 0x0441, nmps: 35, nlps: 32, switchFlag: 0}, - {qe: 0x02A1, nmps: 36, nlps: 33, switchFlag: 0}, - {qe: 0x0221, nmps: 37, nlps: 34, switchFlag: 0}, - {qe: 0x0141, nmps: 38, nlps: 35, switchFlag: 0}, - {qe: 0x0111, nmps: 39, nlps: 36, switchFlag: 0}, - {qe: 0x0085, nmps: 40, nlps: 37, switchFlag: 0}, - {qe: 0x0049, nmps: 41, nlps: 38, switchFlag: 0}, - {qe: 0x0025, nmps: 42, nlps: 39, switchFlag: 0}, - {qe: 0x0015, nmps: 43, nlps: 40, switchFlag: 0}, - {qe: 0x0009, nmps: 44, nlps: 41, switchFlag: 0}, - {qe: 0x0005, nmps: 45, nlps: 42, switchFlag: 0}, - {qe: 0x0001, nmps: 45, nlps: 43, switchFlag: 0}, - {qe: 0x5601, nmps: 46, nlps: 46, switchFlag: 0} - ]; - - // C.3.5 Initialisation of the decoder (INITDEC) - function ArithmeticDecoder(data, start, end) { - this.data = data; - this.bp = start; - this.dataEnd = end; - - this.chigh = data[start]; - this.clow = 0; - - this.byteIn(); - - this.chigh = ((this.chigh << 7) & 0xFFFF) | ((this.clow >> 9) & 0x7F); - this.clow = (this.clow << 7) & 0xFFFF; - this.ct -= 7; - this.a = 0x8000; - } - - ArithmeticDecoder.prototype = { - // C.3.4 Compressed data input (BYTEIN) - byteIn: function ArithmeticDecoder_byteIn() { - var data = this.data; - var bp = this.bp; - if (data[bp] === 0xFF) { - var b1 = data[bp + 1]; - if (b1 > 0x8F) { - this.clow += 0xFF00; - this.ct = 8; - } else { - bp++; - this.clow += (data[bp] << 9); - this.ct = 7; - this.bp = bp; - } - } else { - bp++; - this.clow += bp < this.dataEnd ? (data[bp] << 8) : 0xFF00; - this.ct = 8; - this.bp = bp; - } - if (this.clow > 0xFFFF) { - this.chigh += (this.clow >> 16); - this.clow &= 0xFFFF; - } - }, - // C.3.2 Decoding a decision (DECODE) - readBit: function ArithmeticDecoder_readBit(contexts, pos) { - // contexts are packed into 1 byte: - // highest 7 bits carry cx.index, lowest bit carries cx.mps - var cx_index = contexts[pos] >> 1, cx_mps = contexts[pos] & 1; - var qeTableIcx = QeTable[cx_index]; - var qeIcx = qeTableIcx.qe; - var d; - var a = this.a - qeIcx; - - if (this.chigh < qeIcx) { - // exchangeLps - if (a < qeIcx) { - a = qeIcx; - d = cx_mps; - cx_index = qeTableIcx.nmps; - } else { - a = qeIcx; - d = 1 ^ cx_mps; - if (qeTableIcx.switchFlag === 1) { - cx_mps = d; - } - cx_index = qeTableIcx.nlps; - } - } else { - this.chigh -= qeIcx; - if ((a & 0x8000) !== 0) { - this.a = a; - return cx_mps; - } - // exchangeMps - if (a < qeIcx) { - d = 1 ^ cx_mps; - if (qeTableIcx.switchFlag === 1) { - cx_mps = d; - } - cx_index = qeTableIcx.nlps; - } else { - d = cx_mps; - cx_index = qeTableIcx.nmps; - } - } - // C.3.3 renormD; - do { - if (this.ct === 0) { - this.byteIn(); - } - - a <<= 1; - this.chigh = ((this.chigh << 1) & 0xFFFF) | ((this.clow >> 15) & 1); - this.clow = (this.clow << 1) & 0xFFFF; - this.ct--; - } while ((a & 0x8000) === 0); - this.a = a; - - contexts[pos] = cx_index << 1 | cx_mps; - return d; - } - }; - - return ArithmeticDecoder; -})(); - - - -var JpegImage = (function jpegImage() { - var dctZigZag = new Uint8Array([ - 0, - 1, 8, - 16, 9, 2, - 3, 10, 17, 24, - 32, 25, 18, 11, 4, - 5, 12, 19, 26, 33, 40, - 48, 41, 34, 27, 20, 13, 6, - 7, 14, 21, 28, 35, 42, 49, 56, - 57, 50, 43, 36, 29, 22, 15, - 23, 30, 37, 44, 51, 58, - 59, 52, 45, 38, 31, - 39, 46, 53, 60, - 61, 54, 47, - 55, 62, - 63 - ]); - - var dctCos1 = 4017; // cos(pi/16) - var dctSin1 = 799; // sin(pi/16) - var dctCos3 = 3406; // cos(3*pi/16) - var dctSin3 = 2276; // sin(3*pi/16) - var dctCos6 = 1567; // cos(6*pi/16) - var dctSin6 = 3784; // sin(6*pi/16) - var dctSqrt2 = 5793; // sqrt(2) - var dctSqrt1d2 = 2896; // sqrt(2) / 2 - - function constructor() { - } - - function buildHuffmanTable(codeLengths, values) { - var k = 0, code = [], i, j, length = 16; - while (length > 0 && !codeLengths[length - 1]) { - length--; - } - code.push({children: [], index: 0}); - var p = code[0], q; - for (i = 0; i < length; i++) { - for (j = 0; j < codeLengths[i]; j++) { - p = code.pop(); - p.children[p.index] = values[k]; - while (p.index > 0) { - p = code.pop(); - } - p.index++; - code.push(p); - while (code.length <= i) { - code.push(q = {children: [], index: 0}); - p.children[p.index] = q.children; - p = q; - } - k++; - } - if (i + 1 < length) { - // p here points to last code - code.push(q = {children: [], index: 0}); - p.children[p.index] = q.children; - p = q; - } - } - return code[0].children; - } - - function getBlockBufferOffset(component, row, col) { - return 64 * ((component.blocksPerLine + 1) * row + col); - } - - function decodeScan(data, offset, frame, components, resetInterval, - spectralStart, spectralEnd, successivePrev, successive) { - var precision = frame.precision; - var samplesPerLine = frame.samplesPerLine; - var scanLines = frame.scanLines; - var mcusPerLine = frame.mcusPerLine; - var progressive = frame.progressive; - var maxH = frame.maxH, maxV = frame.maxV; - - var startOffset = offset, bitsData = 0, bitsCount = 0; - - function readBit() { - if (bitsCount > 0) { - bitsCount--; - return (bitsData >> bitsCount) & 1; - } - bitsData = data[offset++]; - if (bitsData === 0xFF) { - var nextByte = data[offset++]; - if (nextByte) { - throw 'unexpected marker: ' + - ((bitsData << 8) | nextByte).toString(16); - } - // unstuff 0 - } - bitsCount = 7; - return bitsData >>> 7; - } - - function decodeHuffman(tree) { - var node = tree; - while (true) { - node = node[readBit()]; - if (typeof node === 'number') { - return node; - } - if (typeof node !== 'object') { - throw 'invalid huffman sequence'; - } - } - } - - function receive(length) { - var n = 0; - while (length > 0) { - n = (n << 1) | readBit(); - length--; - } - return n; - } - - function receiveAndExtend(length) { - if (length === 1) { - return readBit() === 1 ? 1 : -1; - } - var n = receive(length); - if (n >= 1 << (length - 1)) { - return n; - } - return n + (-1 << length) + 1; - } - - function decodeBaseline(component, offset) { - var t = decodeHuffman(component.huffmanTableDC); - var diff = t === 0 ? 0 : receiveAndExtend(t); - component.blockData[offset] = (component.pred += diff); - var k = 1; - while (k < 64) { - var rs = decodeHuffman(component.huffmanTableAC); - var s = rs & 15, r = rs >> 4; - if (s === 0) { - if (r < 15) { - break; - } - k += 16; - continue; - } - k += r; - var z = dctZigZag[k]; - component.blockData[offset + z] = receiveAndExtend(s); - k++; - } - } - - function decodeDCFirst(component, offset) { - var t = decodeHuffman(component.huffmanTableDC); - var diff = t === 0 ? 0 : (receiveAndExtend(t) << successive); - component.blockData[offset] = (component.pred += diff); - } - - function decodeDCSuccessive(component, offset) { - component.blockData[offset] |= readBit() << successive; - } - - var eobrun = 0; - function decodeACFirst(component, offset) { - if (eobrun > 0) { - eobrun--; - return; - } - var k = spectralStart, e = spectralEnd; - while (k <= e) { - var rs = decodeHuffman(component.huffmanTableAC); - var s = rs & 15, r = rs >> 4; - if (s === 0) { - if (r < 15) { - eobrun = receive(r) + (1 << r) - 1; - break; - } - k += 16; - continue; - } - k += r; - var z = dctZigZag[k]; - component.blockData[offset + z] = - receiveAndExtend(s) * (1 << successive); - k++; - } - } - - var successiveACState = 0, successiveACNextValue; - function decodeACSuccessive(component, offset) { - var k = spectralStart; - var e = spectralEnd; - var r = 0; - var s; - var rs; - while (k <= e) { - var z = dctZigZag[k]; - switch (successiveACState) { - case 0: // initial state - rs = decodeHuffman(component.huffmanTableAC); - s = rs & 15; - r = rs >> 4; - if (s === 0) { - if (r < 15) { - eobrun = receive(r) + (1 << r); - successiveACState = 4; - } else { - r = 16; - successiveACState = 1; - } - } else { - if (s !== 1) { - throw 'invalid ACn encoding'; - } - successiveACNextValue = receiveAndExtend(s); - successiveACState = r ? 2 : 3; - } - continue; - case 1: // skipping r zero items - case 2: - if (component.blockData[offset + z]) { - component.blockData[offset + z] += (readBit() << successive); - } else { - r--; - if (r === 0) { - successiveACState = successiveACState === 2 ? 3 : 0; - } - } - break; - case 3: // set value for a zero item - if (component.blockData[offset + z]) { - component.blockData[offset + z] += (readBit() << successive); - } else { - component.blockData[offset + z] = - successiveACNextValue << successive; - successiveACState = 0; - } - break; - case 4: // eob - if (component.blockData[offset + z]) { - component.blockData[offset + z] += (readBit() << successive); - } - break; - } - k++; - } - if (successiveACState === 4) { - eobrun--; - if (eobrun === 0) { - successiveACState = 0; - } - } - } - - function decodeMcu(component, decode, mcu, row, col) { - var mcuRow = (mcu / mcusPerLine) | 0; - var mcuCol = mcu % mcusPerLine; - var blockRow = mcuRow * component.v + row; - var blockCol = mcuCol * component.h + col; - var offset = getBlockBufferOffset(component, blockRow, blockCol); - decode(component, offset); - } - - function decodeBlock(component, decode, mcu) { - var blockRow = (mcu / component.blocksPerLine) | 0; - var blockCol = mcu % component.blocksPerLine; - var offset = getBlockBufferOffset(component, blockRow, blockCol); - decode(component, offset); - } - - var componentsLength = components.length; - var component, i, j, k, n; - var decodeFn; - if (progressive) { - if (spectralStart === 0) { - decodeFn = successivePrev === 0 ? decodeDCFirst : decodeDCSuccessive; - } else { - decodeFn = successivePrev === 0 ? decodeACFirst : decodeACSuccessive; - } - } else { - decodeFn = decodeBaseline; - } - - var mcu = 0, marker; - var mcuExpected; - if (componentsLength === 1) { - mcuExpected = components[0].blocksPerLine * components[0].blocksPerColumn; - } else { - mcuExpected = mcusPerLine * frame.mcusPerColumn; - } - if (!resetInterval) { - resetInterval = mcuExpected; - } - - var h, v; - while (mcu < mcuExpected) { - // reset interval stuff - for (i = 0; i < componentsLength; i++) { - components[i].pred = 0; - } - eobrun = 0; - - if (componentsLength === 1) { - component = components[0]; - for (n = 0; n < resetInterval; n++) { - decodeBlock(component, decodeFn, mcu); - mcu++; - } - } else { - for (n = 0; n < resetInterval; n++) { - for (i = 0; i < componentsLength; i++) { - component = components[i]; - h = component.h; - v = component.v; - for (j = 0; j < v; j++) { - for (k = 0; k < h; k++) { - decodeMcu(component, decodeFn, mcu, j, k); - } - } - } - mcu++; - } - } - - // find marker - bitsCount = 0; - marker = (data[offset] << 8) | data[offset + 1]; - if (marker <= 0xFF00) { - throw 'marker was not found'; - } - - if (marker >= 0xFFD0 && marker <= 0xFFD7) { // RSTx - offset += 2; - } else { - break; - } - } - - return offset - startOffset; - } - - // A port of poppler's IDCT method which in turn is taken from: - // Christoph Loeffler, Adriaan Ligtenberg, George S. Moschytz, - // 'Practical Fast 1-D DCT Algorithms with 11 Multiplications', - // IEEE Intl. Conf. on Acoustics, Speech & Signal Processing, 1989, - // 988-991. - function quantizeAndInverse(component, blockBufferOffset, p) { - var qt = component.quantizationTable, blockData = component.blockData; - var v0, v1, v2, v3, v4, v5, v6, v7; - var p0, p1, p2, p3, p4, p5, p6, p7; - var t; - - // inverse DCT on rows - for (var row = 0; row < 64; row += 8) { - // gather block data - p0 = blockData[blockBufferOffset + row]; - p1 = blockData[blockBufferOffset + row + 1]; - p2 = blockData[blockBufferOffset + row + 2]; - p3 = blockData[blockBufferOffset + row + 3]; - p4 = blockData[blockBufferOffset + row + 4]; - p5 = blockData[blockBufferOffset + row + 5]; - p6 = blockData[blockBufferOffset + row + 6]; - p7 = blockData[blockBufferOffset + row + 7]; - - // dequant p0 - p0 *= qt[row]; - - // check for all-zero AC coefficients - if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { - t = (dctSqrt2 * p0 + 512) >> 10; - p[row] = t; - p[row + 1] = t; - p[row + 2] = t; - p[row + 3] = t; - p[row + 4] = t; - p[row + 5] = t; - p[row + 6] = t; - p[row + 7] = t; - continue; - } - // dequant p1 ... p7 - p1 *= qt[row + 1]; - p2 *= qt[row + 2]; - p3 *= qt[row + 3]; - p4 *= qt[row + 4]; - p5 *= qt[row + 5]; - p6 *= qt[row + 6]; - p7 *= qt[row + 7]; - - // stage 4 - v0 = (dctSqrt2 * p0 + 128) >> 8; - v1 = (dctSqrt2 * p4 + 128) >> 8; - v2 = p2; - v3 = p6; - v4 = (dctSqrt1d2 * (p1 - p7) + 128) >> 8; - v7 = (dctSqrt1d2 * (p1 + p7) + 128) >> 8; - v5 = p3 << 4; - v6 = p5 << 4; - - // stage 3 - v0 = (v0 + v1 + 1) >> 1; - v1 = v0 - v1; - t = (v2 * dctSin6 + v3 * dctCos6 + 128) >> 8; - v2 = (v2 * dctCos6 - v3 * dctSin6 + 128) >> 8; - v3 = t; - v4 = (v4 + v6 + 1) >> 1; - v6 = v4 - v6; - v7 = (v7 + v5 + 1) >> 1; - v5 = v7 - v5; - - // stage 2 - v0 = (v0 + v3 + 1) >> 1; - v3 = v0 - v3; - v1 = (v1 + v2 + 1) >> 1; - v2 = v1 - v2; - t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12; - v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12; - v7 = t; - t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12; - v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12; - v6 = t; - - // stage 1 - p[row] = v0 + v7; - p[row + 7] = v0 - v7; - p[row + 1] = v1 + v6; - p[row + 6] = v1 - v6; - p[row + 2] = v2 + v5; - p[row + 5] = v2 - v5; - p[row + 3] = v3 + v4; - p[row + 4] = v3 - v4; - } - - // inverse DCT on columns - for (var col = 0; col < 8; ++col) { - p0 = p[col]; - p1 = p[col + 8]; - p2 = p[col + 16]; - p3 = p[col + 24]; - p4 = p[col + 32]; - p5 = p[col + 40]; - p6 = p[col + 48]; - p7 = p[col + 56]; - - // check for all-zero AC coefficients - if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { - t = (dctSqrt2 * p0 + 8192) >> 14; - // convert to 8 bit - t = (t < -2040) ? 0 : (t >= 2024) ? 255 : (t + 2056) >> 4; - blockData[blockBufferOffset + col] = t; - blockData[blockBufferOffset + col + 8] = t; - blockData[blockBufferOffset + col + 16] = t; - blockData[blockBufferOffset + col + 24] = t; - blockData[blockBufferOffset + col + 32] = t; - blockData[blockBufferOffset + col + 40] = t; - blockData[blockBufferOffset + col + 48] = t; - blockData[blockBufferOffset + col + 56] = t; - continue; - } - - // stage 4 - v0 = (dctSqrt2 * p0 + 2048) >> 12; - v1 = (dctSqrt2 * p4 + 2048) >> 12; - v2 = p2; - v3 = p6; - v4 = (dctSqrt1d2 * (p1 - p7) + 2048) >> 12; - v7 = (dctSqrt1d2 * (p1 + p7) + 2048) >> 12; - v5 = p3; - v6 = p5; - - // stage 3 - // Shift v0 by 128.5 << 5 here, so we don't need to shift p0...p7 when - // converting to UInt8 range later. - v0 = ((v0 + v1 + 1) >> 1) + 4112; - v1 = v0 - v1; - t = (v2 * dctSin6 + v3 * dctCos6 + 2048) >> 12; - v2 = (v2 * dctCos6 - v3 * dctSin6 + 2048) >> 12; - v3 = t; - v4 = (v4 + v6 + 1) >> 1; - v6 = v4 - v6; - v7 = (v7 + v5 + 1) >> 1; - v5 = v7 - v5; - - // stage 2 - v0 = (v0 + v3 + 1) >> 1; - v3 = v0 - v3; - v1 = (v1 + v2 + 1) >> 1; - v2 = v1 - v2; - t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12; - v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12; - v7 = t; - t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12; - v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12; - v6 = t; - - // stage 1 - p0 = v0 + v7; - p7 = v0 - v7; - p1 = v1 + v6; - p6 = v1 - v6; - p2 = v2 + v5; - p5 = v2 - v5; - p3 = v3 + v4; - p4 = v3 - v4; - - // convert to 8-bit integers - p0 = (p0 < 16) ? 0 : (p0 >= 4080) ? 255 : p0 >> 4; - p1 = (p1 < 16) ? 0 : (p1 >= 4080) ? 255 : p1 >> 4; - p2 = (p2 < 16) ? 0 : (p2 >= 4080) ? 255 : p2 >> 4; - p3 = (p3 < 16) ? 0 : (p3 >= 4080) ? 255 : p3 >> 4; - p4 = (p4 < 16) ? 0 : (p4 >= 4080) ? 255 : p4 >> 4; - p5 = (p5 < 16) ? 0 : (p5 >= 4080) ? 255 : p5 >> 4; - p6 = (p6 < 16) ? 0 : (p6 >= 4080) ? 255 : p6 >> 4; - p7 = (p7 < 16) ? 0 : (p7 >= 4080) ? 255 : p7 >> 4; - - // store block data - blockData[blockBufferOffset + col] = p0; - blockData[blockBufferOffset + col + 8] = p1; - blockData[blockBufferOffset + col + 16] = p2; - blockData[blockBufferOffset + col + 24] = p3; - blockData[blockBufferOffset + col + 32] = p4; - blockData[blockBufferOffset + col + 40] = p5; - blockData[blockBufferOffset + col + 48] = p6; - blockData[blockBufferOffset + col + 56] = p7; - } - } - - function buildComponentData(frame, component) { - var blocksPerLine = component.blocksPerLine; - var blocksPerColumn = component.blocksPerColumn; - var computationBuffer = new Int16Array(64); - - for (var blockRow = 0; blockRow < blocksPerColumn; blockRow++) { - for (var blockCol = 0; blockCol < blocksPerLine; blockCol++) { - var offset = getBlockBufferOffset(component, blockRow, blockCol); - quantizeAndInverse(component, offset, computationBuffer); - } - } - return component.blockData; - } - - function clamp0to255(a) { - return a <= 0 ? 0 : a >= 255 ? 255 : a; - } - - constructor.prototype = { - parse: function parse(data) { - - function readUint16() { - var value = (data[offset] << 8) | data[offset + 1]; - offset += 2; - return value; - } - - function readDataBlock() { - var length = readUint16(); - var array = data.subarray(offset, offset + length - 2); - offset += array.length; - return array; - } - - function prepareComponents(frame) { - var mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / frame.maxH); - var mcusPerColumn = Math.ceil(frame.scanLines / 8 / frame.maxV); - for (var i = 0; i < frame.components.length; i++) { - component = frame.components[i]; - var blocksPerLine = Math.ceil(Math.ceil(frame.samplesPerLine / 8) * - component.h / frame.maxH); - var blocksPerColumn = Math.ceil(Math.ceil(frame.scanLines / 8) * - component.v / frame.maxV); - var blocksPerLineForMcu = mcusPerLine * component.h; - var blocksPerColumnForMcu = mcusPerColumn * component.v; - - var blocksBufferSize = 64 * blocksPerColumnForMcu * - (blocksPerLineForMcu + 1); - component.blockData = new Int16Array(blocksBufferSize); - component.blocksPerLine = blocksPerLine; - component.blocksPerColumn = blocksPerColumn; - } - frame.mcusPerLine = mcusPerLine; - frame.mcusPerColumn = mcusPerColumn; - } - - var offset = 0, length = data.length; - var jfif = null; - var adobe = null; - var pixels = null; - var frame, resetInterval; - var quantizationTables = []; - var huffmanTablesAC = [], huffmanTablesDC = []; - var fileMarker = readUint16(); - if (fileMarker !== 0xFFD8) { // SOI (Start of Image) - throw 'SOI not found'; - } - - fileMarker = readUint16(); - while (fileMarker !== 0xFFD9) { // EOI (End of image) - var i, j, l; - switch(fileMarker) { - case 0xFFE0: // APP0 (Application Specific) - case 0xFFE1: // APP1 - case 0xFFE2: // APP2 - case 0xFFE3: // APP3 - case 0xFFE4: // APP4 - case 0xFFE5: // APP5 - case 0xFFE6: // APP6 - case 0xFFE7: // APP7 - case 0xFFE8: // APP8 - case 0xFFE9: // APP9 - case 0xFFEA: // APP10 - case 0xFFEB: // APP11 - case 0xFFEC: // APP12 - case 0xFFED: // APP13 - case 0xFFEE: // APP14 - case 0xFFEF: // APP15 - case 0xFFFE: // COM (Comment) - var appData = readDataBlock(); - - if (fileMarker === 0xFFE0) { - if (appData[0] === 0x4A && appData[1] === 0x46 && - appData[2] === 0x49 && appData[3] === 0x46 && - appData[4] === 0) { // 'JFIF\x00' - jfif = { - version: { major: appData[5], minor: appData[6] }, - densityUnits: appData[7], - xDensity: (appData[8] << 8) | appData[9], - yDensity: (appData[10] << 8) | appData[11], - thumbWidth: appData[12], - thumbHeight: appData[13], - thumbData: appData.subarray(14, 14 + - 3 * appData[12] * appData[13]) - }; - } - } - // TODO APP1 - Exif - if (fileMarker === 0xFFEE) { - if (appData[0] === 0x41 && appData[1] === 0x64 && - appData[2] === 0x6F && appData[3] === 0x62 && - appData[4] === 0x65) { // 'Adobe' - adobe = { - version: (appData[5] << 8) | appData[6], - flags0: (appData[7] << 8) | appData[8], - flags1: (appData[9] << 8) | appData[10], - transformCode: appData[11] - }; - } - } - break; - - case 0xFFDB: // DQT (Define Quantization Tables) - var quantizationTablesLength = readUint16(); - var quantizationTablesEnd = quantizationTablesLength + offset - 2; - var z; - while (offset < quantizationTablesEnd) { - var quantizationTableSpec = data[offset++]; - var tableData = new Uint16Array(64); - if ((quantizationTableSpec >> 4) === 0) { // 8 bit values - for (j = 0; j < 64; j++) { - z = dctZigZag[j]; - tableData[z] = data[offset++]; - } - } else if ((quantizationTableSpec >> 4) === 1) { //16 bit - for (j = 0; j < 64; j++) { - z = dctZigZag[j]; - tableData[z] = readUint16(); - } - } else { - throw 'DQT: invalid table spec'; - } - quantizationTables[quantizationTableSpec & 15] = tableData; - } - break; - - case 0xFFC0: // SOF0 (Start of Frame, Baseline DCT) - case 0xFFC1: // SOF1 (Start of Frame, Extended DCT) - case 0xFFC2: // SOF2 (Start of Frame, Progressive DCT) - if (frame) { - throw 'Only single frame JPEGs supported'; - } - readUint16(); // skip data length - frame = {}; - frame.extended = (fileMarker === 0xFFC1); - frame.progressive = (fileMarker === 0xFFC2); - frame.precision = data[offset++]; - frame.scanLines = readUint16(); - frame.samplesPerLine = readUint16(); - frame.components = []; - frame.componentIds = {}; - var componentsCount = data[offset++], componentId; - var maxH = 0, maxV = 0; - for (i = 0; i < componentsCount; i++) { - componentId = data[offset]; - var h = data[offset + 1] >> 4; - var v = data[offset + 1] & 15; - if (maxH < h) { - maxH = h; - } - if (maxV < v) { - maxV = v; - } - var qId = data[offset + 2]; - l = frame.components.push({ - h: h, - v: v, - quantizationTable: quantizationTables[qId] - }); - frame.componentIds[componentId] = l - 1; - offset += 3; - } - frame.maxH = maxH; - frame.maxV = maxV; - prepareComponents(frame); - break; - - case 0xFFC4: // DHT (Define Huffman Tables) - var huffmanLength = readUint16(); - for (i = 2; i < huffmanLength;) { - var huffmanTableSpec = data[offset++]; - var codeLengths = new Uint8Array(16); - var codeLengthSum = 0; - for (j = 0; j < 16; j++, offset++) { - codeLengthSum += (codeLengths[j] = data[offset]); - } - var huffmanValues = new Uint8Array(codeLengthSum); - for (j = 0; j < codeLengthSum; j++, offset++) { - huffmanValues[j] = data[offset]; - } - i += 17 + codeLengthSum; - - ((huffmanTableSpec >> 4) === 0 ? - huffmanTablesDC : huffmanTablesAC)[huffmanTableSpec & 15] = - buildHuffmanTable(codeLengths, huffmanValues); - } - break; - - case 0xFFDD: // DRI (Define Restart Interval) - readUint16(); // skip data length - resetInterval = readUint16(); - break; - - case 0xFFDA: // SOS (Start of Scan) - var scanLength = readUint16(); - var selectorsCount = data[offset++]; - var components = [], component; - for (i = 0; i < selectorsCount; i++) { - var componentIndex = frame.componentIds[data[offset++]]; - component = frame.components[componentIndex]; - var tableSpec = data[offset++]; - component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4]; - component.huffmanTableAC = huffmanTablesAC[tableSpec & 15]; - components.push(component); - } - var spectralStart = data[offset++]; - var spectralEnd = data[offset++]; - var successiveApproximation = data[offset++]; - var processed = decodeScan(data, offset, - frame, components, resetInterval, - spectralStart, spectralEnd, - successiveApproximation >> 4, successiveApproximation & 15); - offset += processed; - break; - - case 0xFFFF: // Fill bytes - if (data[offset] !== 0xFF) { // Avoid skipping a valid marker. - offset--; - } - break; - - default: - if (data[offset - 3] === 0xFF && - data[offset - 2] >= 0xC0 && data[offset - 2] <= 0xFE) { - // could be incorrect encoding -- last 0xFF byte of the previous - // block was eaten by the encoder - offset -= 3; - break; - } - throw 'unknown JPEG marker ' + fileMarker.toString(16); - } - fileMarker = readUint16(); - } - - this.width = frame.samplesPerLine; - this.height = frame.scanLines; - this.jfif = jfif; - this.adobe = adobe; - this.components = []; - for (i = 0; i < frame.components.length; i++) { - component = frame.components[i]; - this.components.push({ - output: buildComponentData(frame, component), - scaleX: component.h / frame.maxH, - scaleY: component.v / frame.maxV, - blocksPerLine: component.blocksPerLine, - blocksPerColumn: component.blocksPerColumn - }); - } - this.numComponents = this.components.length; - }, - - _getLinearizedBlockData: function getLinearizedBlockData(width, height) { - var scaleX = this.width / width, scaleY = this.height / height; - - var component, componentScaleX, componentScaleY, blocksPerScanline; - var x, y, i, j, k; - var index; - var offset = 0; - var output; - var numComponents = this.components.length; - var dataLength = width * height * numComponents; - var data = new Uint8Array(dataLength); - var xScaleBlockOffset = new Uint32Array(width); - var mask3LSB = 0xfffffff8; // used to clear the 3 LSBs - - for (i = 0; i < numComponents; i++) { - component = this.components[i]; - componentScaleX = component.scaleX * scaleX; - componentScaleY = component.scaleY * scaleY; - offset = i; - output = component.output; - blocksPerScanline = (component.blocksPerLine + 1) << 3; - // precalculate the xScaleBlockOffset - for (x = 0; x < width; x++) { - j = 0 | (x * componentScaleX); - xScaleBlockOffset[x] = ((j & mask3LSB) << 3) | (j & 7); - } - // linearize the blocks of the component - for (y = 0; y < height; y++) { - j = 0 | (y * componentScaleY); - index = blocksPerScanline * (j & mask3LSB) | ((j & 7) << 3); - for (x = 0; x < width; x++) { - data[offset] = output[index + xScaleBlockOffset[x]]; - offset += numComponents; - } - } - } - - // decodeTransform contains pairs of multiplier (-256..256) and additive - var transform = this.decodeTransform; - if (transform) { - for (i = 0; i < dataLength;) { - for (j = 0, k = 0; j < numComponents; j++, i++, k += 2) { - data[i] = ((data[i] * transform[k]) >> 8) + transform[k + 1]; - } - } - } - return data; - }, - - _isColorConversionNeeded: function isColorConversionNeeded() { - if (this.adobe && this.adobe.transformCode) { - // The adobe transform marker overrides any previous setting - return true; - } else if (this.numComponents === 3) { - return true; - } else { - return false; - } - }, - - _convertYccToRgb: function convertYccToRgb(data) { - var Y, Cb, Cr; - for (var i = 0, length = data.length; i < length; i += 3) { - Y = data[i ]; - Cb = data[i + 1]; - Cr = data[i + 2]; - data[i ] = clamp0to255(Y - 179.456 + 1.402 * Cr); - data[i + 1] = clamp0to255(Y + 135.459 - 0.344 * Cb - 0.714 * Cr); - data[i + 2] = clamp0to255(Y - 226.816 + 1.772 * Cb); - } - return data; - }, - - _convertYcckToRgb: function convertYcckToRgb(data) { - var Y, Cb, Cr, k; - var offset = 0; - for (var i = 0, length = data.length; i < length; i += 4) { - Y = data[i]; - Cb = data[i + 1]; - Cr = data[i + 2]; - k = data[i + 3]; - - var r = -122.67195406894 + - Cb * (-6.60635669420364e-5 * Cb + 0.000437130475926232 * Cr - - 5.4080610064599e-5 * Y + 0.00048449797120281 * k - - 0.154362151871126) + - Cr * (-0.000957964378445773 * Cr + 0.000817076911346625 * Y - - 0.00477271405408747 * k + 1.53380253221734) + - Y * (0.000961250184130688 * Y - 0.00266257332283933 * k + - 0.48357088451265) + - k * (-0.000336197177618394 * k + 0.484791561490776); - - var g = 107.268039397724 + - Cb * (2.19927104525741e-5 * Cb - 0.000640992018297945 * Cr + - 0.000659397001245577 * Y + 0.000426105652938837 * k - - 0.176491792462875) + - Cr * (-0.000778269941513683 * Cr + 0.00130872261408275 * Y + - 0.000770482631801132 * k - 0.151051492775562) + - Y * (0.00126935368114843 * Y - 0.00265090189010898 * k + - 0.25802910206845) + - k * (-0.000318913117588328 * k - 0.213742400323665); - - var b = -20.810012546947 + - Cb * (-0.000570115196973677 * Cb - 2.63409051004589e-5 * Cr + - 0.0020741088115012 * Y - 0.00288260236853442 * k + - 0.814272968359295) + - Cr * (-1.53496057440975e-5 * Cr - 0.000132689043961446 * Y + - 0.000560833691242812 * k - 0.195152027534049) + - Y * (0.00174418132927582 * Y - 0.00255243321439347 * k + - 0.116935020465145) + - k * (-0.000343531996510555 * k + 0.24165260232407); - - data[offset++] = clamp0to255(r); - data[offset++] = clamp0to255(g); - data[offset++] = clamp0to255(b); - } - return data; - }, - - _convertYcckToCmyk: function convertYcckToCmyk(data) { - var Y, Cb, Cr; - for (var i = 0, length = data.length; i < length; i += 4) { - Y = data[i]; - Cb = data[i + 1]; - Cr = data[i + 2]; - data[i ] = clamp0to255(434.456 - Y - 1.402 * Cr); - data[i + 1] = clamp0to255(119.541 - Y + 0.344 * Cb + 0.714 * Cr); - data[i + 2] = clamp0to255(481.816 - Y - 1.772 * Cb); - // K in data[i + 3] is unchanged - } - return data; - }, - - _convertCmykToRgb: function convertCmykToRgb(data) { - var c, m, y, k; - var offset = 0; - var min = -255 * 255 * 255; - var scale = 1 / 255 / 255; - for (var i = 0, length = data.length; i < length; i += 4) { - c = data[i]; - m = data[i + 1]; - y = data[i + 2]; - k = data[i + 3]; - - var r = - c * (-4.387332384609988 * c + 54.48615194189176 * m + - 18.82290502165302 * y + 212.25662451639585 * k - - 72734.4411664936) + - m * (1.7149763477362134 * m - 5.6096736904047315 * y - - 17.873870861415444 * k - 1401.7366389350734) + - y * (-2.5217340131683033 * y - 21.248923337353073 * k + - 4465.541406466231) - - k * (21.86122147463605 * k + 48317.86113160301); - var g = - c * (8.841041422036149 * c + 60.118027045597366 * m + - 6.871425592049007 * y + 31.159100130055922 * k - - 20220.756542821975) + - m * (-15.310361306967817 * m + 17.575251261109482 * y + - 131.35250912493976 * k - 48691.05921601825) + - y * (4.444339102852739 * y + 9.8632861493405 * k - - 6341.191035517494) - - k * (20.737325471181034 * k + 47890.15695978492); - var b = - c * (0.8842522430003296 * c + 8.078677503112928 * m + - 30.89978309703729 * y - 0.23883238689178934 * k - - 3616.812083916688) + - m * (10.49593273432072 * m + 63.02378494754052 * y + - 50.606957656360734 * k - 28620.90484698408) + - y * (0.03296041114873217 * y + 115.60384449646641 * k - - 49363.43385999684) - - k * (22.33816807309886 * k + 45932.16563550634); - - data[offset++] = r >= 0 ? 255 : r <= min ? 0 : 255 + r * scale | 0; - data[offset++] = g >= 0 ? 255 : g <= min ? 0 : 255 + g * scale | 0; - data[offset++] = b >= 0 ? 255 : b <= min ? 0 : 255 + b * scale | 0; - } - return data; - }, - - getData: function getData(width, height, forceRGBoutput) { - if (this.numComponents > 4) { - throw 'Unsupported color mode'; - } - // type of data: Uint8Array(width * height * numComponents) - var data = this._getLinearizedBlockData(width, height); - - if (this.numComponents === 3) { - return this._convertYccToRgb(data); - } else if (this.numComponents === 4) { - if (this._isColorConversionNeeded()) { - if (forceRGBoutput) { - return this._convertYcckToRgb(data); - } else { - return this._convertYcckToCmyk(data); - } - } else if (forceRGBoutput) { - return this._convertCmykToRgb(data); - } - } - return data; - } - }; - - return constructor; -})(); - - -var JpxImage = (function JpxImageClosure() { - // Table E.1 - var SubbandsGainLog2 = { - 'LL': 0, - 'LH': 1, - 'HL': 1, - 'HH': 2 - }; - function JpxImage() { - this.failOnCorruptedImage = false; - } - JpxImage.prototype = { - parse: function JpxImage_parse(data) { - - var head = readUint16(data, 0); - // No box header, immediate start of codestream (SOC) - if (head === 0xFF4F) { - this.parseCodestream(data, 0, data.length); - return; - } - - var position = 0, length = data.length; - while (position < length) { - var headerSize = 8; - var lbox = readUint32(data, position); - var tbox = readUint32(data, position + 4); - position += headerSize; - if (lbox === 1) { - // XLBox: read UInt64 according to spec. - // JavaScript's int precision of 53 bit should be sufficient here. - lbox = readUint32(data, position) * 4294967296 + - readUint32(data, position + 4); - position += 8; - headerSize += 8; - } - if (lbox === 0) { - lbox = length - position + headerSize; - } - if (lbox < headerSize) { - throw new Error('JPX Error: Invalid box field size'); - } - var dataLength = lbox - headerSize; - var jumpDataLength = true; - switch (tbox) { - case 0x6A703268: // 'jp2h' - jumpDataLength = false; // parsing child boxes - break; - case 0x636F6C72: // 'colr' - // Colorspaces are not used, the CS from the PDF is used. - var method = data[position]; - var precedence = data[position + 1]; - var approximation = data[position + 2]; - if (method === 1) { - // enumerated colorspace - var colorspace = readUint32(data, position + 3); - switch (colorspace) { - case 16: // this indicates a sRGB colorspace - case 17: // this indicates a grayscale colorspace - case 18: // this indicates a YUV colorspace - break; - default: - warn('Unknown colorspace ' + colorspace); - break; - } - } else if (method === 2) { - info('ICC profile not supported'); - } - break; - case 0x6A703263: // 'jp2c' - this.parseCodestream(data, position, position + dataLength); - break; - case 0x6A502020: // 'jP\024\024' - if (0x0d0a870a !== readUint32(data, position)) { - warn('Invalid JP2 signature'); - } - break; - // The following header types are valid but currently not used: - case 0x6A501A1A: // 'jP\032\032' - case 0x66747970: // 'ftyp' - case 0x72726571: // 'rreq' - case 0x72657320: // 'res ' - case 0x69686472: // 'ihdr' - break; - default: - var headerType = String.fromCharCode((tbox >> 24) & 0xFF, - (tbox >> 16) & 0xFF, - (tbox >> 8) & 0xFF, - tbox & 0xFF); - warn('Unsupported header type ' + tbox + ' (' + headerType + ')'); - break; - } - if (jumpDataLength) { - position += dataLength; - } - } - }, - parseImageProperties: function JpxImage_parseImageProperties(stream) { - var newByte = stream.getByte(); - while (newByte >= 0) { - var oldByte = newByte; - newByte = stream.getByte(); - var code = (oldByte << 8) | newByte; - // Image and tile size (SIZ) - if (code === 0xFF51) { - stream.skip(4); - var Xsiz = stream.getInt32() >>> 0; // Byte 4 - var Ysiz = stream.getInt32() >>> 0; // Byte 8 - var XOsiz = stream.getInt32() >>> 0; // Byte 12 - var YOsiz = stream.getInt32() >>> 0; // Byte 16 - stream.skip(16); - var Csiz = stream.getUint16(); // Byte 36 - this.width = Xsiz - XOsiz; - this.height = Ysiz - YOsiz; - this.componentsCount = Csiz; - // Results are always returned as Uint8Arrays - this.bitsPerComponent = 8; - return; - } - } - throw new Error('JPX Error: No size marker found in JPX stream'); - }, - parseCodestream: function JpxImage_parseCodestream(data, start, end) { - var context = {}; - try { - var doNotRecover = false; - var position = start; - while (position + 1 < end) { - var code = readUint16(data, position); - position += 2; - - var length = 0, j, sqcd, spqcds, spqcdSize, scalarExpounded, tile; - switch (code) { - case 0xFF4F: // Start of codestream (SOC) - context.mainHeader = true; - break; - case 0xFFD9: // End of codestream (EOC) - break; - case 0xFF51: // Image and tile size (SIZ) - length = readUint16(data, position); - var siz = {}; - siz.Xsiz = readUint32(data, position + 4); - siz.Ysiz = readUint32(data, position + 8); - siz.XOsiz = readUint32(data, position + 12); - siz.YOsiz = readUint32(data, position + 16); - siz.XTsiz = readUint32(data, position + 20); - siz.YTsiz = readUint32(data, position + 24); - siz.XTOsiz = readUint32(data, position + 28); - siz.YTOsiz = readUint32(data, position + 32); - var componentsCount = readUint16(data, position + 36); - siz.Csiz = componentsCount; - var components = []; - j = position + 38; - for (var i = 0; i < componentsCount; i++) { - var component = { - precision: (data[j] & 0x7F) + 1, - isSigned: !!(data[j] & 0x80), - XRsiz: data[j + 1], - YRsiz: data[j + 1] - }; - calculateComponentDimensions(component, siz); - components.push(component); - } - context.SIZ = siz; - context.components = components; - calculateTileGrids(context, components); - context.QCC = []; - context.COC = []; - break; - case 0xFF5C: // Quantization default (QCD) - length = readUint16(data, position); - var qcd = {}; - j = position + 2; - sqcd = data[j++]; - switch (sqcd & 0x1F) { - case 0: - spqcdSize = 8; - scalarExpounded = true; - break; - case 1: - spqcdSize = 16; - scalarExpounded = false; - break; - case 2: - spqcdSize = 16; - scalarExpounded = true; - break; - default: - throw new Error('JPX Error: Invalid SQcd value ' + sqcd); - } - qcd.noQuantization = (spqcdSize === 8); - qcd.scalarExpounded = scalarExpounded; - qcd.guardBits = sqcd >> 5; - spqcds = []; - while (j < length + position) { - var spqcd = {}; - if (spqcdSize === 8) { - spqcd.epsilon = data[j++] >> 3; - spqcd.mu = 0; - } else { - spqcd.epsilon = data[j] >> 3; - spqcd.mu = ((data[j] & 0x7) << 8) | data[j + 1]; - j += 2; - } - spqcds.push(spqcd); - } - qcd.SPqcds = spqcds; - if (context.mainHeader) { - context.QCD = qcd; - } else { - context.currentTile.QCD = qcd; - context.currentTile.QCC = []; - } - break; - case 0xFF5D: // Quantization component (QCC) - length = readUint16(data, position); - var qcc = {}; - j = position + 2; - var cqcc; - if (context.SIZ.Csiz < 257) { - cqcc = data[j++]; - } else { - cqcc = readUint16(data, j); - j += 2; - } - sqcd = data[j++]; - switch (sqcd & 0x1F) { - case 0: - spqcdSize = 8; - scalarExpounded = true; - break; - case 1: - spqcdSize = 16; - scalarExpounded = false; - break; - case 2: - spqcdSize = 16; - scalarExpounded = true; - break; - default: - throw new Error('JPX Error: Invalid SQcd value ' + sqcd); - } - qcc.noQuantization = (spqcdSize === 8); - qcc.scalarExpounded = scalarExpounded; - qcc.guardBits = sqcd >> 5; - spqcds = []; - while (j < (length + position)) { - spqcd = {}; - if (spqcdSize === 8) { - spqcd.epsilon = data[j++] >> 3; - spqcd.mu = 0; - } else { - spqcd.epsilon = data[j] >> 3; - spqcd.mu = ((data[j] & 0x7) << 8) | data[j + 1]; - j += 2; - } - spqcds.push(spqcd); - } - qcc.SPqcds = spqcds; - if (context.mainHeader) { - context.QCC[cqcc] = qcc; - } else { - context.currentTile.QCC[cqcc] = qcc; - } - break; - case 0xFF52: // Coding style default (COD) - length = readUint16(data, position); - var cod = {}; - j = position + 2; - var scod = data[j++]; - cod.entropyCoderWithCustomPrecincts = !!(scod & 1); - cod.sopMarkerUsed = !!(scod & 2); - cod.ephMarkerUsed = !!(scod & 4); - cod.progressionOrder = data[j++]; - cod.layersCount = readUint16(data, j); - j += 2; - cod.multipleComponentTransform = data[j++]; - - cod.decompositionLevelsCount = data[j++]; - cod.xcb = (data[j++] & 0xF) + 2; - cod.ycb = (data[j++] & 0xF) + 2; - var blockStyle = data[j++]; - cod.selectiveArithmeticCodingBypass = !!(blockStyle & 1); - cod.resetContextProbabilities = !!(blockStyle & 2); - cod.terminationOnEachCodingPass = !!(blockStyle & 4); - cod.verticalyStripe = !!(blockStyle & 8); - cod.predictableTermination = !!(blockStyle & 16); - cod.segmentationSymbolUsed = !!(blockStyle & 32); - cod.reversibleTransformation = data[j++]; - if (cod.entropyCoderWithCustomPrecincts) { - var precinctsSizes = []; - while (j < length + position) { - var precinctsSize = data[j++]; - precinctsSizes.push({ - PPx: precinctsSize & 0xF, - PPy: precinctsSize >> 4 - }); - } - cod.precinctsSizes = precinctsSizes; - } - var unsupported = []; - if (cod.selectiveArithmeticCodingBypass) { - unsupported.push('selectiveArithmeticCodingBypass'); - } - if (cod.resetContextProbabilities) { - unsupported.push('resetContextProbabilities'); - } - if (cod.terminationOnEachCodingPass) { - unsupported.push('terminationOnEachCodingPass'); - } - if (cod.verticalyStripe) { - unsupported.push('verticalyStripe'); - } - if (cod.predictableTermination) { - unsupported.push('predictableTermination'); - } - if (unsupported.length > 0) { - doNotRecover = true; - throw new Error('JPX Error: Unsupported COD options (' + - unsupported.join(', ') + ')'); - } - if (context.mainHeader) { - context.COD = cod; - } else { - context.currentTile.COD = cod; - context.currentTile.COC = []; - } - break; - case 0xFF90: // Start of tile-part (SOT) - length = readUint16(data, position); - tile = {}; - tile.index = readUint16(data, position + 2); - tile.length = readUint32(data, position + 4); - tile.dataEnd = tile.length + position - 2; - tile.partIndex = data[position + 8]; - tile.partsCount = data[position + 9]; - - context.mainHeader = false; - if (tile.partIndex === 0) { - // reset component specific settings - tile.COD = context.COD; - tile.COC = context.COC.slice(0); // clone of the global COC - tile.QCD = context.QCD; - tile.QCC = context.QCC.slice(0); // clone of the global COC - } - context.currentTile = tile; - break; - case 0xFF93: // Start of data (SOD) - tile = context.currentTile; - if (tile.partIndex === 0) { - initializeTile(context, tile.index); - buildPackets(context); - } - - // moving to the end of the data - length = tile.dataEnd - position; - parseTilePackets(context, data, position, length); - break; - case 0xFF55: // Tile-part lengths, main header (TLM) - case 0xFF57: // Packet length, main header (PLM) - case 0xFF58: // Packet length, tile-part header (PLT) - case 0xFF64: // Comment (COM) - length = readUint16(data, position); - // skipping content - break; - case 0xFF53: // Coding style component (COC) - throw new Error('JPX Error: Codestream code 0xFF53 (COC) is ' + - 'not implemented'); - default: - throw new Error('JPX Error: Unknown codestream code: ' + - code.toString(16)); - } - position += length; - } - } catch (e) { - if (doNotRecover || this.failOnCorruptedImage) { - throw e; - } else { - warn('Trying to recover from ' + e.message); - } - } - this.tiles = transformComponents(context); - this.width = context.SIZ.Xsiz - context.SIZ.XOsiz; - this.height = context.SIZ.Ysiz - context.SIZ.YOsiz; - this.componentsCount = context.SIZ.Csiz; - } - }; - function calculateComponentDimensions(component, siz) { - // Section B.2 Component mapping - component.x0 = Math.ceil(siz.XOsiz / component.XRsiz); - component.x1 = Math.ceil(siz.Xsiz / component.XRsiz); - component.y0 = Math.ceil(siz.YOsiz / component.YRsiz); - component.y1 = Math.ceil(siz.Ysiz / component.YRsiz); - component.width = component.x1 - component.x0; - component.height = component.y1 - component.y0; - } - function calculateTileGrids(context, components) { - var siz = context.SIZ; - // Section B.3 Division into tile and tile-components - var tile, tiles = []; - var numXtiles = Math.ceil((siz.Xsiz - siz.XTOsiz) / siz.XTsiz); - var numYtiles = Math.ceil((siz.Ysiz - siz.YTOsiz) / siz.YTsiz); - for (var q = 0; q < numYtiles; q++) { - for (var p = 0; p < numXtiles; p++) { - tile = {}; - tile.tx0 = Math.max(siz.XTOsiz + p * siz.XTsiz, siz.XOsiz); - tile.ty0 = Math.max(siz.YTOsiz + q * siz.YTsiz, siz.YOsiz); - tile.tx1 = Math.min(siz.XTOsiz + (p + 1) * siz.XTsiz, siz.Xsiz); - tile.ty1 = Math.min(siz.YTOsiz + (q + 1) * siz.YTsiz, siz.Ysiz); - tile.width = tile.tx1 - tile.tx0; - tile.height = tile.ty1 - tile.ty0; - tile.components = []; - tiles.push(tile); - } - } - context.tiles = tiles; - - var componentsCount = siz.Csiz; - for (var i = 0, ii = componentsCount; i < ii; i++) { - var component = components[i]; - for (var j = 0, jj = tiles.length; j < jj; j++) { - var tileComponent = {}; - tile = tiles[j]; - tileComponent.tcx0 = Math.ceil(tile.tx0 / component.XRsiz); - tileComponent.tcy0 = Math.ceil(tile.ty0 / component.YRsiz); - tileComponent.tcx1 = Math.ceil(tile.tx1 / component.XRsiz); - tileComponent.tcy1 = Math.ceil(tile.ty1 / component.YRsiz); - tileComponent.width = tileComponent.tcx1 - tileComponent.tcx0; - tileComponent.height = tileComponent.tcy1 - tileComponent.tcy0; - tile.components[i] = tileComponent; - } - } - } - function getBlocksDimensions(context, component, r) { - var codOrCoc = component.codingStyleParameters; - var result = {}; - if (!codOrCoc.entropyCoderWithCustomPrecincts) { - result.PPx = 15; - result.PPy = 15; - } else { - result.PPx = codOrCoc.precinctsSizes[r].PPx; - result.PPy = codOrCoc.precinctsSizes[r].PPy; - } - // calculate codeblock size as described in section B.7 - result.xcb_ = (r > 0 ? Math.min(codOrCoc.xcb, result.PPx - 1) : - Math.min(codOrCoc.xcb, result.PPx)); - result.ycb_ = (r > 0 ? Math.min(codOrCoc.ycb, result.PPy - 1) : - Math.min(codOrCoc.ycb, result.PPy)); - return result; - } - function buildPrecincts(context, resolution, dimensions) { - // Section B.6 Division resolution to precincts - var precinctWidth = 1 << dimensions.PPx; - var precinctHeight = 1 << dimensions.PPy; - // Jasper introduces codeblock groups for mapping each subband codeblocks - // to precincts. Precinct partition divides a resolution according to width - // and height parameters. The subband that belongs to the resolution level - // has a different size than the level, unless it is the zero resolution. - - // From Jasper documentation: jpeg2000.pdf, section K: Tier-2 coding: - // The precinct partitioning for a particular subband is derived from a - // partitioning of its parent LL band (i.e., the LL band at the next higher - // resolution level)... The LL band associated with each resolution level is - // divided into precincts... Each of the resulting precinct regions is then - // mapped into its child subbands (if any) at the next lower resolution - // level. This is accomplished by using the coordinate transformation - // (u, v) = (ceil(x/2), ceil(y/2)) where (x, y) and (u, v) are the - // coordinates of a point in the LL band and child subband, respectively. - var isZeroRes = resolution.resLevel === 0; - var precinctWidthInSubband = 1 << (dimensions.PPx + (isZeroRes ? 0 : -1)); - var precinctHeightInSubband = 1 << (dimensions.PPy + (isZeroRes ? 0 : -1)); - var numprecinctswide = (resolution.trx1 > resolution.trx0 ? - Math.ceil(resolution.trx1 / precinctWidth) - - Math.floor(resolution.trx0 / precinctWidth) : 0); - var numprecinctshigh = (resolution.try1 > resolution.try0 ? - Math.ceil(resolution.try1 / precinctHeight) - - Math.floor(resolution.try0 / precinctHeight) : 0); - var numprecincts = numprecinctswide * numprecinctshigh; - - resolution.precinctParameters = { - precinctWidth: precinctWidth, - precinctHeight: precinctHeight, - numprecinctswide: numprecinctswide, - numprecinctshigh: numprecinctshigh, - numprecincts: numprecincts, - precinctWidthInSubband: precinctWidthInSubband, - precinctHeightInSubband: precinctHeightInSubband - }; - } - function buildCodeblocks(context, subband, dimensions) { - // Section B.7 Division sub-band into code-blocks - var xcb_ = dimensions.xcb_; - var ycb_ = dimensions.ycb_; - var codeblockWidth = 1 << xcb_; - var codeblockHeight = 1 << ycb_; - var cbx0 = subband.tbx0 >> xcb_; - var cby0 = subband.tby0 >> ycb_; - var cbx1 = (subband.tbx1 + codeblockWidth - 1) >> xcb_; - var cby1 = (subband.tby1 + codeblockHeight - 1) >> ycb_; - var precinctParameters = subband.resolution.precinctParameters; - var codeblocks = []; - var precincts = []; - var i, j, codeblock, precinctNumber; - for (j = cby0; j < cby1; j++) { - for (i = cbx0; i < cbx1; i++) { - codeblock = { - cbx: i, - cby: j, - tbx0: codeblockWidth * i, - tby0: codeblockHeight * j, - tbx1: codeblockWidth * (i + 1), - tby1: codeblockHeight * (j + 1) - }; - - codeblock.tbx0_ = Math.max(subband.tbx0, codeblock.tbx0); - codeblock.tby0_ = Math.max(subband.tby0, codeblock.tby0); - codeblock.tbx1_ = Math.min(subband.tbx1, codeblock.tbx1); - codeblock.tby1_ = Math.min(subband.tby1, codeblock.tby1); - - // Calculate precinct number for this codeblock, codeblock position - // should be relative to its subband, use actual dimension and position - // See comment about codeblock group width and height - var pi = Math.floor((codeblock.tbx0_ - subband.tbx0) / - precinctParameters.precinctWidthInSubband); - var pj = Math.floor((codeblock.tby0_ - subband.tby0) / - precinctParameters.precinctHeightInSubband); - precinctNumber = pi + (pj * precinctParameters.numprecinctswide); - - codeblock.precinctNumber = precinctNumber; - codeblock.subbandType = subband.type; - codeblock.Lblock = 3; - - if (codeblock.tbx1_ <= codeblock.tbx0_ || - codeblock.tby1_ <= codeblock.tby0_) { - continue; - } - codeblocks.push(codeblock); - // building precinct for the sub-band - var precinct = precincts[precinctNumber]; - if (precinct !== undefined) { - if (i < precinct.cbxMin) { - precinct.cbxMin = i; - } else if (i > precinct.cbxMax) { - precinct.cbxMax = i; - } - if (j < precinct.cbyMin) { - precinct.cbxMin = j; - } else if (j > precinct.cbyMax) { - precinct.cbyMax = j; - } - } else { - precincts[precinctNumber] = precinct = { - cbxMin: i, - cbyMin: j, - cbxMax: i, - cbyMax: j - }; - } - codeblock.precinct = precinct; - } - } - subband.codeblockParameters = { - codeblockWidth: xcb_, - codeblockHeight: ycb_, - numcodeblockwide: cbx1 - cbx0 + 1, - numcodeblockhigh: cby1 - cby0 + 1 - }; - subband.codeblocks = codeblocks; - subband.precincts = precincts; - } - function createPacket(resolution, precinctNumber, layerNumber) { - var precinctCodeblocks = []; - // Section B.10.8 Order of info in packet - var subbands = resolution.subbands; - // sub-bands already ordered in 'LL', 'HL', 'LH', and 'HH' sequence - for (var i = 0, ii = subbands.length; i < ii; i++) { - var subband = subbands[i]; - var codeblocks = subband.codeblocks; - for (var j = 0, jj = codeblocks.length; j < jj; j++) { - var codeblock = codeblocks[j]; - if (codeblock.precinctNumber !== precinctNumber) { - continue; - } - precinctCodeblocks.push(codeblock); - } - } - return { - layerNumber: layerNumber, - codeblocks: precinctCodeblocks - }; - } - function LayerResolutionComponentPositionIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var maxDecompositionLevelsCount = 0; - for (var q = 0; q < componentsCount; q++) { - maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, - tile.components[q].codingStyleParameters.decompositionLevelsCount); - } - - var l = 0, r = 0, i = 0, k = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.1 Layer-resolution-component-position - for (; l < layersCount; l++) { - for (; r <= maxDecompositionLevelsCount; r++) { - for (; i < componentsCount; i++) { - var component = tile.components[i]; - if (r > component.codingStyleParameters.decompositionLevelsCount) { - continue; - } - - var resolution = component.resolutions[r]; - var numprecincts = resolution.precinctParameters.numprecincts; - for (; k < numprecincts;) { - var packet = createPacket(resolution, k, l); - k++; - return packet; - } - k = 0; - } - i = 0; - } - r = 0; - } - throw new Error('JPX Error: Out of packets'); - }; - } - function ResolutionLayerComponentPositionIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var maxDecompositionLevelsCount = 0; - for (var q = 0; q < componentsCount; q++) { - maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, - tile.components[q].codingStyleParameters.decompositionLevelsCount); - } - - var r = 0, l = 0, i = 0, k = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.2 Resolution-layer-component-position - for (; r <= maxDecompositionLevelsCount; r++) { - for (; l < layersCount; l++) { - for (; i < componentsCount; i++) { - var component = tile.components[i]; - if (r > component.codingStyleParameters.decompositionLevelsCount) { - continue; - } - - var resolution = component.resolutions[r]; - var numprecincts = resolution.precinctParameters.numprecincts; - for (; k < numprecincts;) { - var packet = createPacket(resolution, k, l); - k++; - return packet; - } - k = 0; - } - i = 0; - } - l = 0; - } - throw new Error('JPX Error: Out of packets'); - }; - } - function ResolutionPositionComponentLayerIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var l, r, c, p; - var maxDecompositionLevelsCount = 0; - for (c = 0; c < componentsCount; c++) { - var component = tile.components[c]; - maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, - component.codingStyleParameters.decompositionLevelsCount); - } - var maxNumPrecinctsInLevel = new Int32Array( - maxDecompositionLevelsCount + 1); - for (r = 0; r <= maxDecompositionLevelsCount; ++r) { - var maxNumPrecincts = 0; - for (c = 0; c < componentsCount; ++c) { - var resolutions = tile.components[c].resolutions; - if (r < resolutions.length) { - maxNumPrecincts = Math.max(maxNumPrecincts, - resolutions[r].precinctParameters.numprecincts); - } - } - maxNumPrecinctsInLevel[r] = maxNumPrecincts; - } - l = 0; - r = 0; - c = 0; - p = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.3 Resolution-position-component-layer - for (; r <= maxDecompositionLevelsCount; r++) { - for (; p < maxNumPrecinctsInLevel[r]; p++) { - for (; c < componentsCount; c++) { - var component = tile.components[c]; - if (r > component.codingStyleParameters.decompositionLevelsCount) { - continue; - } - var resolution = component.resolutions[r]; - var numprecincts = resolution.precinctParameters.numprecincts; - if (p >= numprecincts) { - continue; - } - for (; l < layersCount;) { - var packet = createPacket(resolution, p, l); - l++; - return packet; - } - l = 0; - } - c = 0; - } - p = 0; - } - throw new Error('JPX Error: Out of packets'); - }; - } - function PositionComponentResolutionLayerIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var precinctsSizes = getPrecinctSizesInImageScale(tile); - var precinctsIterationSizes = precinctsSizes; - var l = 0, r = 0, c = 0, px = 0, py = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.4 Position-component-resolution-layer - for (; py < precinctsIterationSizes.maxNumHigh; py++) { - for (; px < precinctsIterationSizes.maxNumWide; px++) { - for (; c < componentsCount; c++) { - var component = tile.components[c]; - var decompositionLevelsCount = - component.codingStyleParameters.decompositionLevelsCount; - for (; r <= decompositionLevelsCount; r++) { - var resolution = component.resolutions[r]; - var sizeInImageScale = - precinctsSizes.components[c].resolutions[r]; - var k = getPrecinctIndexIfExist( - px, - py, - sizeInImageScale, - precinctsIterationSizes, - resolution); - if (k === null) { - continue; - } - for (; l < layersCount;) { - var packet = createPacket(resolution, k, l); - l++; - return packet; - } - l = 0; - } - r = 0; - } - c = 0; - } - px = 0; - } - throw new Error('JPX Error: Out of packets'); - }; - } - function ComponentPositionResolutionLayerIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var precinctsSizes = getPrecinctSizesInImageScale(tile); - var l = 0, r = 0, c = 0, px = 0, py = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.5 Component-position-resolution-layer - for (; c < componentsCount; ++c) { - var component = tile.components[c]; - var precinctsIterationSizes = precinctsSizes.components[c]; - var decompositionLevelsCount = - component.codingStyleParameters.decompositionLevelsCount; - for (; py < precinctsIterationSizes.maxNumHigh; py++) { - for (; px < precinctsIterationSizes.maxNumWide; px++) { - for (; r <= decompositionLevelsCount; r++) { - var resolution = component.resolutions[r]; - var sizeInImageScale = precinctsIterationSizes.resolutions[r]; - var k = getPrecinctIndexIfExist( - px, - py, - sizeInImageScale, - precinctsIterationSizes, - resolution); - if (k === null) { - continue; - } - for (; l < layersCount;) { - var packet = createPacket(resolution, k, l); - l++; - return packet; - } - l = 0; - } - r = 0; - } - px = 0; - } - py = 0; - } - throw new Error('JPX Error: Out of packets'); - }; - } - function getPrecinctIndexIfExist( - pxIndex, pyIndex, sizeInImageScale, precinctIterationSizes, resolution) { - var posX = pxIndex * precinctIterationSizes.minWidth; - var posY = pyIndex * precinctIterationSizes.minHeight; - if (posX % sizeInImageScale.width !== 0 || - posY % sizeInImageScale.height !== 0) { - return null; - } - var startPrecinctRowIndex = - (posY / sizeInImageScale.width) * - resolution.precinctParameters.numprecinctswide; - return (posX / sizeInImageScale.height) + startPrecinctRowIndex; - } - function getPrecinctSizesInImageScale(tile) { - var componentsCount = tile.components.length; - var minWidth = Number.MAX_VALUE; - var minHeight = Number.MAX_VALUE; - var maxNumWide = 0; - var maxNumHigh = 0; - var sizePerComponent = new Array(componentsCount); - for (var c = 0; c < componentsCount; c++) { - var component = tile.components[c]; - var decompositionLevelsCount = - component.codingStyleParameters.decompositionLevelsCount; - var sizePerResolution = new Array(decompositionLevelsCount + 1); - var minWidthCurrentComponent = Number.MAX_VALUE; - var minHeightCurrentComponent = Number.MAX_VALUE; - var maxNumWideCurrentComponent = 0; - var maxNumHighCurrentComponent = 0; - var scale = 1; - for (var r = decompositionLevelsCount; r >= 0; --r) { - var resolution = component.resolutions[r]; - var widthCurrentResolution = - scale * resolution.precinctParameters.precinctWidth; - var heightCurrentResolution = - scale * resolution.precinctParameters.precinctHeight; - minWidthCurrentComponent = Math.min( - minWidthCurrentComponent, - widthCurrentResolution); - minHeightCurrentComponent = Math.min( - minHeightCurrentComponent, - heightCurrentResolution); - maxNumWideCurrentComponent = Math.max(maxNumWideCurrentComponent, - resolution.precinctParameters.numprecinctswide); - maxNumHighCurrentComponent = Math.max(maxNumHighCurrentComponent, - resolution.precinctParameters.numprecinctshigh); - sizePerResolution[r] = { - width: widthCurrentResolution, - height: heightCurrentResolution - }; - scale <<= 1; - } - minWidth = Math.min(minWidth, minWidthCurrentComponent); - minHeight = Math.min(minHeight, minHeightCurrentComponent); - maxNumWide = Math.max(maxNumWide, maxNumWideCurrentComponent); - maxNumHigh = Math.max(maxNumHigh, maxNumHighCurrentComponent); - sizePerComponent[c] = { - resolutions: sizePerResolution, - minWidth: minWidthCurrentComponent, - minHeight: minHeightCurrentComponent, - maxNumWide: maxNumWideCurrentComponent, - maxNumHigh: maxNumHighCurrentComponent - }; - } - return { - components: sizePerComponent, - minWidth: minWidth, - minHeight: minHeight, - maxNumWide: maxNumWide, - maxNumHigh: maxNumHigh - }; - } - function buildPackets(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var componentsCount = siz.Csiz; - // Creating resolutions and sub-bands for each component - for (var c = 0; c < componentsCount; c++) { - var component = tile.components[c]; - var decompositionLevelsCount = - component.codingStyleParameters.decompositionLevelsCount; - // Section B.5 Resolution levels and sub-bands - var resolutions = []; - var subbands = []; - for (var r = 0; r <= decompositionLevelsCount; r++) { - var blocksDimensions = getBlocksDimensions(context, component, r); - var resolution = {}; - var scale = 1 << (decompositionLevelsCount - r); - resolution.trx0 = Math.ceil(component.tcx0 / scale); - resolution.try0 = Math.ceil(component.tcy0 / scale); - resolution.trx1 = Math.ceil(component.tcx1 / scale); - resolution.try1 = Math.ceil(component.tcy1 / scale); - resolution.resLevel = r; - buildPrecincts(context, resolution, blocksDimensions); - resolutions.push(resolution); - - var subband; - if (r === 0) { - // one sub-band (LL) with last decomposition - subband = {}; - subband.type = 'LL'; - subband.tbx0 = Math.ceil(component.tcx0 / scale); - subband.tby0 = Math.ceil(component.tcy0 / scale); - subband.tbx1 = Math.ceil(component.tcx1 / scale); - subband.tby1 = Math.ceil(component.tcy1 / scale); - subband.resolution = resolution; - buildCodeblocks(context, subband, blocksDimensions); - subbands.push(subband); - resolution.subbands = [subband]; - } else { - var bscale = 1 << (decompositionLevelsCount - r + 1); - var resolutionSubbands = []; - // three sub-bands (HL, LH and HH) with rest of decompositions - subband = {}; - subband.type = 'HL'; - subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5); - subband.tby0 = Math.ceil(component.tcy0 / bscale); - subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5); - subband.tby1 = Math.ceil(component.tcy1 / bscale); - subband.resolution = resolution; - buildCodeblocks(context, subband, blocksDimensions); - subbands.push(subband); - resolutionSubbands.push(subband); - - subband = {}; - subband.type = 'LH'; - subband.tbx0 = Math.ceil(component.tcx0 / bscale); - subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5); - subband.tbx1 = Math.ceil(component.tcx1 / bscale); - subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5); - subband.resolution = resolution; - buildCodeblocks(context, subband, blocksDimensions); - subbands.push(subband); - resolutionSubbands.push(subband); - - subband = {}; - subband.type = 'HH'; - subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5); - subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5); - subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5); - subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5); - subband.resolution = resolution; - buildCodeblocks(context, subband, blocksDimensions); - subbands.push(subband); - resolutionSubbands.push(subband); - - resolution.subbands = resolutionSubbands; - } - } - component.resolutions = resolutions; - component.subbands = subbands; - } - // Generate the packets sequence - var progressionOrder = tile.codingStyleDefaultParameters.progressionOrder; - switch (progressionOrder) { - case 0: - tile.packetsIterator = - new LayerResolutionComponentPositionIterator(context); - break; - case 1: - tile.packetsIterator = - new ResolutionLayerComponentPositionIterator(context); - break; - case 2: - tile.packetsIterator = - new ResolutionPositionComponentLayerIterator(context); - break; - case 3: - tile.packetsIterator = - new PositionComponentResolutionLayerIterator(context); - break; - case 4: - tile.packetsIterator = - new ComponentPositionResolutionLayerIterator(context); - break; - default: - throw new Error('JPX Error: Unsupported progression order ' + - progressionOrder); - } - } - function parseTilePackets(context, data, offset, dataLength) { - var position = 0; - var buffer, bufferSize = 0, skipNextBit = false; - function readBits(count) { - while (bufferSize < count) { - var b = data[offset + position]; - position++; - if (skipNextBit) { - buffer = (buffer << 7) | b; - bufferSize += 7; - skipNextBit = false; - } else { - buffer = (buffer << 8) | b; - bufferSize += 8; - } - if (b === 0xFF) { - skipNextBit = true; - } - } - bufferSize -= count; - return (buffer >>> bufferSize) & ((1 << count) - 1); - } - function skipMarkerIfEqual(value) { - if (data[offset + position - 1] === 0xFF && - data[offset + position] === value) { - skipBytes(1); - return true; - } else if (data[offset + position] === 0xFF && - data[offset + position + 1] === value) { - skipBytes(2); - return true; - } - return false; - } - function skipBytes(count) { - position += count; - } - function alignToByte() { - bufferSize = 0; - if (skipNextBit) { - position++; - skipNextBit = false; - } - } - function readCodingpasses() { - if (readBits(1) === 0) { - return 1; - } - if (readBits(1) === 0) { - return 2; - } - var value = readBits(2); - if (value < 3) { - return value + 3; - } - value = readBits(5); - if (value < 31) { - return value + 6; - } - value = readBits(7); - return value + 37; - } - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var sopMarkerUsed = context.COD.sopMarkerUsed; - var ephMarkerUsed = context.COD.ephMarkerUsed; - var packetsIterator = tile.packetsIterator; - while (position < dataLength) { - alignToByte(); - if (sopMarkerUsed && skipMarkerIfEqual(0x91)) { - // Skip also marker segment length and packet sequence ID - skipBytes(4); - } - var packet = packetsIterator.nextPacket(); - if (!readBits(1)) { - continue; - } - var layerNumber = packet.layerNumber; - var queue = [], codeblock; - for (var i = 0, ii = packet.codeblocks.length; i < ii; i++) { - codeblock = packet.codeblocks[i]; - var precinct = codeblock.precinct; - var codeblockColumn = codeblock.cbx - precinct.cbxMin; - var codeblockRow = codeblock.cby - precinct.cbyMin; - var codeblockIncluded = false; - var firstTimeInclusion = false; - var valueReady; - if (codeblock['included'] !== undefined) { - codeblockIncluded = !!readBits(1); - } else { - // reading inclusion tree - precinct = codeblock.precinct; - var inclusionTree, zeroBitPlanesTree; - if (precinct['inclusionTree'] !== undefined) { - inclusionTree = precinct.inclusionTree; - } else { - // building inclusion and zero bit-planes trees - var width = precinct.cbxMax - precinct.cbxMin + 1; - var height = precinct.cbyMax - precinct.cbyMin + 1; - inclusionTree = new InclusionTree(width, height, layerNumber); - zeroBitPlanesTree = new TagTree(width, height); - precinct.inclusionTree = inclusionTree; - precinct.zeroBitPlanesTree = zeroBitPlanesTree; - } - - if (inclusionTree.reset(codeblockColumn, codeblockRow, layerNumber)) { - while (true) { - if (readBits(1)) { - valueReady = !inclusionTree.nextLevel(); - if (valueReady) { - codeblock.included = true; - codeblockIncluded = firstTimeInclusion = true; - break; - } - } else { - inclusionTree.incrementValue(layerNumber); - break; - } - } - } - } - if (!codeblockIncluded) { - continue; - } - if (firstTimeInclusion) { - zeroBitPlanesTree = precinct.zeroBitPlanesTree; - zeroBitPlanesTree.reset(codeblockColumn, codeblockRow); - while (true) { - if (readBits(1)) { - valueReady = !zeroBitPlanesTree.nextLevel(); - if (valueReady) { - break; - } - } else { - zeroBitPlanesTree.incrementValue(); - } - } - codeblock.zeroBitPlanes = zeroBitPlanesTree.value; - } - var codingpasses = readCodingpasses(); - while (readBits(1)) { - codeblock.Lblock++; - } - var codingpassesLog2 = log2(codingpasses); - // rounding down log2 - var bits = ((codingpasses < (1 << codingpassesLog2)) ? - codingpassesLog2 - 1 : codingpassesLog2) + codeblock.Lblock; - var codedDataLength = readBits(bits); - queue.push({ - codeblock: codeblock, - codingpasses: codingpasses, - dataLength: codedDataLength - }); - } - alignToByte(); - if (ephMarkerUsed) { - skipMarkerIfEqual(0x92); - } - while (queue.length > 0) { - var packetItem = queue.shift(); - codeblock = packetItem.codeblock; - if (codeblock['data'] === undefined) { - codeblock.data = []; - } - codeblock.data.push({ - data: data, - start: offset + position, - end: offset + position + packetItem.dataLength, - codingpasses: packetItem.codingpasses - }); - position += packetItem.dataLength; - } - } - return position; - } - function copyCoefficients(coefficients, levelWidth, levelHeight, subband, - delta, mb, reversible, segmentationSymbolUsed) { - var x0 = subband.tbx0; - var y0 = subband.tby0; - var width = subband.tbx1 - subband.tbx0; - var codeblocks = subband.codeblocks; - var right = subband.type.charAt(0) === 'H' ? 1 : 0; - var bottom = subband.type.charAt(1) === 'H' ? levelWidth : 0; - - for (var i = 0, ii = codeblocks.length; i < ii; ++i) { - var codeblock = codeblocks[i]; - var blockWidth = codeblock.tbx1_ - codeblock.tbx0_; - var blockHeight = codeblock.tby1_ - codeblock.tby0_; - if (blockWidth === 0 || blockHeight === 0) { - continue; - } - if (codeblock['data'] === undefined) { - continue; - } - - var bitModel, currentCodingpassType; - bitModel = new BitModel(blockWidth, blockHeight, codeblock.subbandType, - codeblock.zeroBitPlanes, mb); - currentCodingpassType = 2; // first bit plane starts from cleanup - - // collect data - var data = codeblock.data, totalLength = 0, codingpasses = 0; - var j, jj, dataItem; - for (j = 0, jj = data.length; j < jj; j++) { - dataItem = data[j]; - totalLength += dataItem.end - dataItem.start; - codingpasses += dataItem.codingpasses; - } - var encodedData = new Uint8Array(totalLength); - var position = 0; - for (j = 0, jj = data.length; j < jj; j++) { - dataItem = data[j]; - var chunk = dataItem.data.subarray(dataItem.start, dataItem.end); - encodedData.set(chunk, position); - position += chunk.length; - } - // decoding the item - var decoder = new ArithmeticDecoder(encodedData, 0, totalLength); - bitModel.setDecoder(decoder); - - for (j = 0; j < codingpasses; j++) { - switch (currentCodingpassType) { - case 0: - bitModel.runSignificancePropogationPass(); - break; - case 1: - bitModel.runMagnitudeRefinementPass(); - break; - case 2: - bitModel.runCleanupPass(); - if (segmentationSymbolUsed) { - bitModel.checkSegmentationSymbol(); - } - break; - } - currentCodingpassType = (currentCodingpassType + 1) % 3; - } - - var offset = (codeblock.tbx0_ - x0) + (codeblock.tby0_ - y0) * width; - var sign = bitModel.coefficentsSign; - var magnitude = bitModel.coefficentsMagnitude; - var bitsDecoded = bitModel.bitsDecoded; - var magnitudeCorrection = reversible ? 0 : 0.5; - var k, n, nb; - position = 0; - // Do the interleaving of Section F.3.3 here, so we do not need - // to copy later. LL level is not interleaved, just copied. - var interleave = (subband.type !== 'LL'); - for (j = 0; j < blockHeight; j++) { - var row = (offset / width) | 0; // row in the non-interleaved subband - var levelOffset = 2 * row * (levelWidth - width) + right + bottom; - for (k = 0; k < blockWidth; k++) { - n = magnitude[position]; - if (n !== 0) { - n = (n + magnitudeCorrection) * delta; - if (sign[position] !== 0) { - n = -n; - } - nb = bitsDecoded[position]; - var pos = interleave ? (levelOffset + (offset << 1)) : offset; - if (reversible && (nb >= mb)) { - coefficients[pos] = n; - } else { - coefficients[pos] = n * (1 << (mb - nb)); - } - } - offset++; - position++; - } - offset += width - blockWidth; - } - } - } - function transformTile(context, tile, c) { - var component = tile.components[c]; - var codingStyleParameters = component.codingStyleParameters; - var quantizationParameters = component.quantizationParameters; - var decompositionLevelsCount = - codingStyleParameters.decompositionLevelsCount; - var spqcds = quantizationParameters.SPqcds; - var scalarExpounded = quantizationParameters.scalarExpounded; - var guardBits = quantizationParameters.guardBits; - var segmentationSymbolUsed = codingStyleParameters.segmentationSymbolUsed; - var precision = context.components[c].precision; - - var reversible = codingStyleParameters.reversibleTransformation; - var transform = (reversible ? new ReversibleTransform() : - new IrreversibleTransform()); - - var subbandCoefficients = []; - var b = 0; - for (var i = 0; i <= decompositionLevelsCount; i++) { - var resolution = component.resolutions[i]; - - var width = resolution.trx1 - resolution.trx0; - var height = resolution.try1 - resolution.try0; - // Allocate space for the whole sublevel. - var coefficients = new Float32Array(width * height); - - for (var j = 0, jj = resolution.subbands.length; j < jj; j++) { - var mu, epsilon; - if (!scalarExpounded) { - // formula E-5 - mu = spqcds[0].mu; - epsilon = spqcds[0].epsilon + (i > 0 ? 1 - i : 0); - } else { - mu = spqcds[b].mu; - epsilon = spqcds[b].epsilon; - b++; - } - - var subband = resolution.subbands[j]; - var gainLog2 = SubbandsGainLog2[subband.type]; - - // calulate quantization coefficient (Section E.1.1.1) - var delta = (reversible ? 1 : - Math.pow(2, precision + gainLog2 - epsilon) * (1 + mu / 2048)); - var mb = (guardBits + epsilon - 1); - - // In the first resolution level, copyCoefficients will fill the - // whole array with coefficients. In the succeding passes, - // copyCoefficients will consecutively fill in the values that belong - // to the interleaved positions of the HL, LH, and HH coefficients. - // The LL coefficients will then be interleaved in Transform.iterate(). - copyCoefficients(coefficients, width, height, subband, delta, mb, - reversible, segmentationSymbolUsed); - } - subbandCoefficients.push({ - width: width, - height: height, - items: coefficients - }); - } - - var result = transform.calculate(subbandCoefficients, - component.tcx0, component.tcy0); - return { - left: component.tcx0, - top: component.tcy0, - width: result.width, - height: result.height, - items: result.items - }; - } - function transformComponents(context) { - var siz = context.SIZ; - var components = context.components; - var componentsCount = siz.Csiz; - var resultImages = []; - for (var i = 0, ii = context.tiles.length; i < ii; i++) { - var tile = context.tiles[i]; - var transformedTiles = []; - var c; - for (c = 0; c < componentsCount; c++) { - transformedTiles[c] = transformTile(context, tile, c); - } - var tile0 = transformedTiles[0]; - var out = new Uint8Array(tile0.items.length * componentsCount); - var result = { - left: tile0.left, - top: tile0.top, - width: tile0.width, - height: tile0.height, - items: out - }; - - // Section G.2.2 Inverse multi component transform - var shift, offset, max, min, maxK; - var pos = 0, j, jj, y0, y1, y2, r, g, b, k, val; - if (tile.codingStyleDefaultParameters.multipleComponentTransform) { - var fourComponents = componentsCount === 4; - var y0items = transformedTiles[0].items; - var y1items = transformedTiles[1].items; - var y2items = transformedTiles[2].items; - var y3items = fourComponents ? transformedTiles[3].items : null; - - // HACK: The multiple component transform formulas below assume that - // all components have the same precision. With this in mind, we - // compute shift and offset only once. - shift = components[0].precision - 8; - offset = (128 << shift) + 0.5; - max = 255 * (1 << shift); - maxK = max * 0.5; - min = -maxK; - - var component0 = tile.components[0]; - var alpha01 = componentsCount - 3; - jj = y0items.length; - if (!component0.codingStyleParameters.reversibleTransformation) { - // inverse irreversible multiple component transform - for (j = 0; j < jj; j++, pos += alpha01) { - y0 = y0items[j] + offset; - y1 = y1items[j]; - y2 = y2items[j]; - r = y0 + 1.402 * y2; - g = y0 - 0.34413 * y1 - 0.71414 * y2; - b = y0 + 1.772 * y1; - out[pos++] = r <= 0 ? 0 : r >= max ? 255 : r >> shift; - out[pos++] = g <= 0 ? 0 : g >= max ? 255 : g >> shift; - out[pos++] = b <= 0 ? 0 : b >= max ? 255 : b >> shift; - } - } else { - // inverse reversible multiple component transform - for (j = 0; j < jj; j++, pos += alpha01) { - y0 = y0items[j] + offset; - y1 = y1items[j]; - y2 = y2items[j]; - g = y0 - ((y2 + y1) >> 2); - r = g + y2; - b = g + y1; - out[pos++] = r <= 0 ? 0 : r >= max ? 255 : r >> shift; - out[pos++] = g <= 0 ? 0 : g >= max ? 255 : g >> shift; - out[pos++] = b <= 0 ? 0 : b >= max ? 255 : b >> shift; - } - } - if (fourComponents) { - for (j = 0, pos = 3; j < jj; j++, pos += 4) { - k = y3items[j]; - out[pos] = k <= min ? 0 : k >= maxK ? 255 : (k + offset) >> shift; - } - } - } else { // no multi-component transform - for (c = 0; c < componentsCount; c++) { - var items = transformedTiles[c].items; - shift = components[c].precision - 8; - offset = (128 << shift) + 0.5; - max = (127.5 * (1 << shift)); - min = -max; - for (pos = c, j = 0, jj = items.length; j < jj; j++) { - val = items[j]; - out[pos] = val <= min ? 0 : - val >= max ? 255 : (val + offset) >> shift; - pos += componentsCount; - } - } - } - resultImages.push(result); - } - return resultImages; - } - function initializeTile(context, tileIndex) { - var siz = context.SIZ; - var componentsCount = siz.Csiz; - var tile = context.tiles[tileIndex]; - for (var c = 0; c < componentsCount; c++) { - var component = tile.components[c]; - var qcdOrQcc = (context.currentTile.QCC[c] !== undefined ? - context.currentTile.QCC[c] : context.currentTile.QCD); - component.quantizationParameters = qcdOrQcc; - var codOrCoc = (context.currentTile.COC[c] !== undefined ? - context.currentTile.COC[c] : context.currentTile.COD); - component.codingStyleParameters = codOrCoc; - } - tile.codingStyleDefaultParameters = context.currentTile.COD; - } - - // Section B.10.2 Tag trees - var TagTree = (function TagTreeClosure() { - function TagTree(width, height) { - var levelsLength = log2(Math.max(width, height)) + 1; - this.levels = []; - for (var i = 0; i < levelsLength; i++) { - var level = { - width: width, - height: height, - items: [] - }; - this.levels.push(level); - width = Math.ceil(width / 2); - height = Math.ceil(height / 2); - } - } - TagTree.prototype = { - reset: function TagTree_reset(i, j) { - var currentLevel = 0, value = 0, level; - while (currentLevel < this.levels.length) { - level = this.levels[currentLevel]; - var index = i + j * level.width; - if (level.items[index] !== undefined) { - value = level.items[index]; - break; - } - level.index = index; - i >>= 1; - j >>= 1; - currentLevel++; - } - currentLevel--; - level = this.levels[currentLevel]; - level.items[level.index] = value; - this.currentLevel = currentLevel; - delete this.value; - }, - incrementValue: function TagTree_incrementValue() { - var level = this.levels[this.currentLevel]; - level.items[level.index]++; - }, - nextLevel: function TagTree_nextLevel() { - var currentLevel = this.currentLevel; - var level = this.levels[currentLevel]; - var value = level.items[level.index]; - currentLevel--; - if (currentLevel < 0) { - this.value = value; - return false; - } - - this.currentLevel = currentLevel; - level = this.levels[currentLevel]; - level.items[level.index] = value; - return true; - } - }; - return TagTree; - })(); - - var InclusionTree = (function InclusionTreeClosure() { - function InclusionTree(width, height, defaultValue) { - var levelsLength = log2(Math.max(width, height)) + 1; - this.levels = []; - for (var i = 0; i < levelsLength; i++) { - var items = new Uint8Array(width * height); - for (var j = 0, jj = items.length; j < jj; j++) { - items[j] = defaultValue; - } - - var level = { - width: width, - height: height, - items: items - }; - this.levels.push(level); - - width = Math.ceil(width / 2); - height = Math.ceil(height / 2); - } - } - InclusionTree.prototype = { - reset: function InclusionTree_reset(i, j, stopValue) { - var currentLevel = 0; - while (currentLevel < this.levels.length) { - var level = this.levels[currentLevel]; - var index = i + j * level.width; - level.index = index; - var value = level.items[index]; - - if (value === 0xFF) { - break; - } - - if (value > stopValue) { - this.currentLevel = currentLevel; - // already know about this one, propagating the value to top levels - this.propagateValues(); - return false; - } - - i >>= 1; - j >>= 1; - currentLevel++; - } - this.currentLevel = currentLevel - 1; - return true; - }, - incrementValue: function InclusionTree_incrementValue(stopValue) { - var level = this.levels[this.currentLevel]; - level.items[level.index] = stopValue + 1; - this.propagateValues(); - }, - propagateValues: function InclusionTree_propagateValues() { - var levelIndex = this.currentLevel; - var level = this.levels[levelIndex]; - var currentValue = level.items[level.index]; - while (--levelIndex >= 0) { - level = this.levels[levelIndex]; - level.items[level.index] = currentValue; - } - }, - nextLevel: function InclusionTree_nextLevel() { - var currentLevel = this.currentLevel; - var level = this.levels[currentLevel]; - var value = level.items[level.index]; - level.items[level.index] = 0xFF; - currentLevel--; - if (currentLevel < 0) { - return false; - } - - this.currentLevel = currentLevel; - level = this.levels[currentLevel]; - level.items[level.index] = value; - return true; - } - }; - return InclusionTree; - })(); - - // Section D. Coefficient bit modeling - var BitModel = (function BitModelClosure() { - var UNIFORM_CONTEXT = 17; - var RUNLENGTH_CONTEXT = 18; - // Table D-1 - // The index is binary presentation: 0dddvvhh, ddd - sum of Di (0..4), - // vv - sum of Vi (0..2), and hh - sum of Hi (0..2) - var LLAndLHContextsLabel = new Uint8Array([ - 0, 5, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 1, 6, 8, 0, 3, 7, 8, 0, 4, - 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6, - 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8 - ]); - var HLContextLabel = new Uint8Array([ - 0, 3, 4, 0, 5, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 1, 3, 4, 0, 6, 7, 7, 0, 8, - 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, - 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8 - ]); - var HHContextLabel = new Uint8Array([ - 0, 1, 2, 0, 1, 2, 2, 0, 2, 2, 2, 0, 0, 0, 0, 0, 3, 4, 5, 0, 4, 5, 5, 0, 5, - 5, 5, 0, 0, 0, 0, 0, 6, 7, 7, 0, 7, 7, 7, 0, 7, 7, 7, 0, 0, 0, 0, 0, 8, 8, - 8, 0, 8, 8, 8, 0, 8, 8, 8, 0, 0, 0, 0, 0, 8, 8, 8, 0, 8, 8, 8, 0, 8, 8, 8 - ]); - - function BitModel(width, height, subband, zeroBitPlanes, mb) { - this.width = width; - this.height = height; - - this.contextLabelTable = (subband === 'HH' ? HHContextLabel : - (subband === 'HL' ? HLContextLabel : LLAndLHContextsLabel)); - - var coefficientCount = width * height; - - // coefficients outside the encoding region treated as insignificant - // add border state cells for significanceState - this.neighborsSignificance = new Uint8Array(coefficientCount); - this.coefficentsSign = new Uint8Array(coefficientCount); - this.coefficentsMagnitude = mb > 14 ? new Uint32Array(coefficientCount) : - mb > 6 ? new Uint16Array(coefficientCount) : - new Uint8Array(coefficientCount); - this.processingFlags = new Uint8Array(coefficientCount); - - var bitsDecoded = new Uint8Array(coefficientCount); - if (zeroBitPlanes !== 0) { - for (var i = 0; i < coefficientCount; i++) { - bitsDecoded[i] = zeroBitPlanes; - } - } - this.bitsDecoded = bitsDecoded; - - this.reset(); - } - - BitModel.prototype = { - setDecoder: function BitModel_setDecoder(decoder) { - this.decoder = decoder; - }, - reset: function BitModel_reset() { - // We have 17 contexts that are accessed via context labels, - // plus the uniform and runlength context. - this.contexts = new Int8Array(19); - - // Contexts are packed into 1 byte: - // highest 7 bits carry the index, lowest bit carries mps - this.contexts[0] = (4 << 1) | 0; - this.contexts[UNIFORM_CONTEXT] = (46 << 1) | 0; - this.contexts[RUNLENGTH_CONTEXT] = (3 << 1) | 0; - }, - setNeighborsSignificance: - function BitModel_setNeighborsSignificance(row, column, index) { - var neighborsSignificance = this.neighborsSignificance; - var width = this.width, height = this.height; - var left = (column > 0); - var right = (column + 1 < width); - var i; - - if (row > 0) { - i = index - width; - if (left) { - neighborsSignificance[i - 1] += 0x10; - } - if (right) { - neighborsSignificance[i + 1] += 0x10; - } - neighborsSignificance[i] += 0x04; - } - - if (row + 1 < height) { - i = index + width; - if (left) { - neighborsSignificance[i - 1] += 0x10; - } - if (right) { - neighborsSignificance[i + 1] += 0x10; - } - neighborsSignificance[i] += 0x04; - } - - if (left) { - neighborsSignificance[index - 1] += 0x01; - } - if (right) { - neighborsSignificance[index + 1] += 0x01; - } - neighborsSignificance[index] |= 0x80; - }, - runSignificancePropogationPass: - function BitModel_runSignificancePropogationPass() { - var decoder = this.decoder; - var width = this.width, height = this.height; - var coefficentsMagnitude = this.coefficentsMagnitude; - var coefficentsSign = this.coefficentsSign; - var neighborsSignificance = this.neighborsSignificance; - var processingFlags = this.processingFlags; - var contexts = this.contexts; - var labels = this.contextLabelTable; - var bitsDecoded = this.bitsDecoded; - var processedInverseMask = ~1; - var processedMask = 1; - var firstMagnitudeBitMask = 2; - - for (var i0 = 0; i0 < height; i0 += 4) { - for (var j = 0; j < width; j++) { - var index = i0 * width + j; - for (var i1 = 0; i1 < 4; i1++, index += width) { - var i = i0 + i1; - if (i >= height) { - break; - } - // clear processed flag first - processingFlags[index] &= processedInverseMask; - - if (coefficentsMagnitude[index] || - !neighborsSignificance[index]) { - continue; - } - - var contextLabel = labels[neighborsSignificance[index]]; - var decision = decoder.readBit(contexts, contextLabel); - if (decision) { - var sign = this.decodeSignBit(i, j, index); - coefficentsSign[index] = sign; - coefficentsMagnitude[index] = 1; - this.setNeighborsSignificance(i, j, index); - processingFlags[index] |= firstMagnitudeBitMask; - } - bitsDecoded[index]++; - processingFlags[index] |= processedMask; - } - } - } - }, - decodeSignBit: function BitModel_decodeSignBit(row, column, index) { - var width = this.width, height = this.height; - var coefficentsMagnitude = this.coefficentsMagnitude; - var coefficentsSign = this.coefficentsSign; - var contribution, sign0, sign1, significance1; - var contextLabel, decoded; - - // calculate horizontal contribution - significance1 = (column > 0 && coefficentsMagnitude[index - 1] !== 0); - if (column + 1 < width && coefficentsMagnitude[index + 1] !== 0) { - sign1 = coefficentsSign[index + 1]; - if (significance1) { - sign0 = coefficentsSign[index - 1]; - contribution = 1 - sign1 - sign0; - } else { - contribution = 1 - sign1 - sign1; - } - } else if (significance1) { - sign0 = coefficentsSign[index - 1]; - contribution = 1 - sign0 - sign0; - } else { - contribution = 0; - } - var horizontalContribution = 3 * contribution; - - // calculate vertical contribution and combine with the horizontal - significance1 = (row > 0 && coefficentsMagnitude[index - width] !== 0); - if (row + 1 < height && coefficentsMagnitude[index + width] !== 0) { - sign1 = coefficentsSign[index + width]; - if (significance1) { - sign0 = coefficentsSign[index - width]; - contribution = 1 - sign1 - sign0 + horizontalContribution; - } else { - contribution = 1 - sign1 - sign1 + horizontalContribution; - } - } else if (significance1) { - sign0 = coefficentsSign[index - width]; - contribution = 1 - sign0 - sign0 + horizontalContribution; - } else { - contribution = horizontalContribution; - } - - if (contribution >= 0) { - contextLabel = 9 + contribution; - decoded = this.decoder.readBit(this.contexts, contextLabel); - } else { - contextLabel = 9 - contribution; - decoded = this.decoder.readBit(this.contexts, contextLabel) ^ 1; - } - return decoded; - }, - runMagnitudeRefinementPass: - function BitModel_runMagnitudeRefinementPass() { - var decoder = this.decoder; - var width = this.width, height = this.height; - var coefficentsMagnitude = this.coefficentsMagnitude; - var neighborsSignificance = this.neighborsSignificance; - var contexts = this.contexts; - var bitsDecoded = this.bitsDecoded; - var processingFlags = this.processingFlags; - var processedMask = 1; - var firstMagnitudeBitMask = 2; - var length = width * height; - var width4 = width * 4; - - for (var index0 = 0, indexNext; index0 < length; index0 = indexNext) { - indexNext = Math.min(length, index0 + width4); - for (var j = 0; j < width; j++) { - for (var index = index0 + j; index < indexNext; index += width) { - - // significant but not those that have just become - if (!coefficentsMagnitude[index] || - (processingFlags[index] & processedMask) !== 0) { - continue; - } - - var contextLabel = 16; - if ((processingFlags[index] & firstMagnitudeBitMask) !== 0) { - processingFlags[index] ^= firstMagnitudeBitMask; - // first refinement - var significance = neighborsSignificance[index] & 127; - contextLabel = significance === 0 ? 15 : 14; - } - - var bit = decoder.readBit(contexts, contextLabel); - coefficentsMagnitude[index] = - (coefficentsMagnitude[index] << 1) | bit; - bitsDecoded[index]++; - processingFlags[index] |= processedMask; - } - } - } - }, - runCleanupPass: function BitModel_runCleanupPass() { - var decoder = this.decoder; - var width = this.width, height = this.height; - var neighborsSignificance = this.neighborsSignificance; - var coefficentsMagnitude = this.coefficentsMagnitude; - var coefficentsSign = this.coefficentsSign; - var contexts = this.contexts; - var labels = this.contextLabelTable; - var bitsDecoded = this.bitsDecoded; - var processingFlags = this.processingFlags; - var processedMask = 1; - var firstMagnitudeBitMask = 2; - var oneRowDown = width; - var twoRowsDown = width * 2; - var threeRowsDown = width * 3; - var iNext; - for (var i0 = 0; i0 < height; i0 = iNext) { - iNext = Math.min(i0 + 4, height); - var indexBase = i0 * width; - var checkAllEmpty = i0 + 3 < height; - for (var j = 0; j < width; j++) { - var index0 = indexBase + j; - // using the property: labels[neighborsSignificance[index]] === 0 - // when neighborsSignificance[index] === 0 - var allEmpty = (checkAllEmpty && - processingFlags[index0] === 0 && - processingFlags[index0 + oneRowDown] === 0 && - processingFlags[index0 + twoRowsDown] === 0 && - processingFlags[index0 + threeRowsDown] === 0 && - neighborsSignificance[index0] === 0 && - neighborsSignificance[index0 + oneRowDown] === 0 && - neighborsSignificance[index0 + twoRowsDown] === 0 && - neighborsSignificance[index0 + threeRowsDown] === 0); - var i1 = 0, index = index0; - var i = i0, sign; - if (allEmpty) { - var hasSignificantCoefficent = - decoder.readBit(contexts, RUNLENGTH_CONTEXT); - if (!hasSignificantCoefficent) { - bitsDecoded[index0]++; - bitsDecoded[index0 + oneRowDown]++; - bitsDecoded[index0 + twoRowsDown]++; - bitsDecoded[index0 + threeRowsDown]++; - continue; // next column - } - i1 = (decoder.readBit(contexts, UNIFORM_CONTEXT) << 1) | - decoder.readBit(contexts, UNIFORM_CONTEXT); - if (i1 !== 0) { - i = i0 + i1; - index += i1 * width; - } - - sign = this.decodeSignBit(i, j, index); - coefficentsSign[index] = sign; - coefficentsMagnitude[index] = 1; - this.setNeighborsSignificance(i, j, index); - processingFlags[index] |= firstMagnitudeBitMask; - - index = index0; - for (var i2 = i0; i2 <= i; i2++, index += width) { - bitsDecoded[index]++; - } - - i1++; - } - for (i = i0 + i1; i < iNext; i++, index += width) { - if (coefficentsMagnitude[index] || - (processingFlags[index] & processedMask) !== 0) { - continue; - } - - var contextLabel = labels[neighborsSignificance[index]]; - var decision = decoder.readBit(contexts, contextLabel); - if (decision === 1) { - sign = this.decodeSignBit(i, j, index); - coefficentsSign[index] = sign; - coefficentsMagnitude[index] = 1; - this.setNeighborsSignificance(i, j, index); - processingFlags[index] |= firstMagnitudeBitMask; - } - bitsDecoded[index]++; - } - } - } - }, - checkSegmentationSymbol: function BitModel_checkSegmentationSymbol() { - var decoder = this.decoder; - var contexts = this.contexts; - var symbol = (decoder.readBit(contexts, UNIFORM_CONTEXT) << 3) | - (decoder.readBit(contexts, UNIFORM_CONTEXT) << 2) | - (decoder.readBit(contexts, UNIFORM_CONTEXT) << 1) | - decoder.readBit(contexts, UNIFORM_CONTEXT); - if (symbol !== 0xA) { - throw new Error('JPX Error: Invalid segmentation symbol'); - } - } - }; - - return BitModel; - })(); - - // Section F, Discrete wavelet transformation - var Transform = (function TransformClosure() { - function Transform() {} - - Transform.prototype.calculate = - function transformCalculate(subbands, u0, v0) { - var ll = subbands[0]; - for (var i = 1, ii = subbands.length; i < ii; i++) { - ll = this.iterate(ll, subbands[i], u0, v0); - } - return ll; - }; - Transform.prototype.extend = function extend(buffer, offset, size) { - // Section F.3.7 extending... using max extension of 4 - var i1 = offset - 1, j1 = offset + 1; - var i2 = offset + size - 2, j2 = offset + size; - buffer[i1--] = buffer[j1++]; - buffer[j2++] = buffer[i2--]; - buffer[i1--] = buffer[j1++]; - buffer[j2++] = buffer[i2--]; - buffer[i1--] = buffer[j1++]; - buffer[j2++] = buffer[i2--]; - buffer[i1] = buffer[j1]; - buffer[j2] = buffer[i2]; - }; - Transform.prototype.iterate = function Transform_iterate(ll, hl_lh_hh, - u0, v0) { - var llWidth = ll.width, llHeight = ll.height, llItems = ll.items; - var width = hl_lh_hh.width; - var height = hl_lh_hh.height; - var items = hl_lh_hh.items; - var i, j, k, l, u, v; - - // Interleave LL according to Section F.3.3 - for (k = 0, i = 0; i < llHeight; i++) { - l = i * 2 * width; - for (j = 0; j < llWidth; j++, k++, l += 2) { - items[l] = llItems[k]; - } - } - // The LL band is not needed anymore. - llItems = ll.items = null; - - var bufferPadding = 4; - var rowBuffer = new Float32Array(width + 2 * bufferPadding); - - // Section F.3.4 HOR_SR - if (width === 1) { - // if width = 1, when u0 even keep items as is, when odd divide by 2 - if ((u0 & 1) !== 0) { - for (v = 0, k = 0; v < height; v++, k += width) { - items[k] *= 0.5; - } - } - } else { - for (v = 0, k = 0; v < height; v++, k += width) { - rowBuffer.set(items.subarray(k, k + width), bufferPadding); - - this.extend(rowBuffer, bufferPadding, width); - this.filter(rowBuffer, bufferPadding, width); - - items.set( - rowBuffer.subarray(bufferPadding, bufferPadding + width), - k); - } - } - - // Accesses to the items array can take long, because it may not fit into - // CPU cache and has to be fetched from main memory. Since subsequent - // accesses to the items array are not local when reading columns, we - // have a cache miss every time. To reduce cache misses, get up to - // 'numBuffers' items at a time and store them into the individual - // buffers. The colBuffers should be small enough to fit into CPU cache. - var numBuffers = 16; - var colBuffers = []; - for (i = 0; i < numBuffers; i++) { - colBuffers.push(new Float32Array(height + 2 * bufferPadding)); - } - var b, currentBuffer = 0; - ll = bufferPadding + height; - - // Section F.3.5 VER_SR - if (height === 1) { - // if height = 1, when v0 even keep items as is, when odd divide by 2 - if ((v0 & 1) !== 0) { - for (u = 0; u < width; u++) { - items[u] *= 0.5; - } - } - } else { - for (u = 0; u < width; u++) { - // if we ran out of buffers, copy several image columns at once - if (currentBuffer === 0) { - numBuffers = Math.min(width - u, numBuffers); - for (k = u, l = bufferPadding; l < ll; k += width, l++) { - for (b = 0; b < numBuffers; b++) { - colBuffers[b][l] = items[k + b]; - } - } - currentBuffer = numBuffers; - } - - currentBuffer--; - var buffer = colBuffers[currentBuffer]; - this.extend(buffer, bufferPadding, height); - this.filter(buffer, bufferPadding, height); - - // If this is last buffer in this group of buffers, flush all buffers. - if (currentBuffer === 0) { - k = u - numBuffers + 1; - for (l = bufferPadding; l < ll; k += width, l++) { - for (b = 0; b < numBuffers; b++) { - items[k + b] = colBuffers[b][l]; - } - } - } - } - } - - return { - width: width, - height: height, - items: items - }; - }; - return Transform; - })(); - - // Section 3.8.2 Irreversible 9-7 filter - var IrreversibleTransform = (function IrreversibleTransformClosure() { - function IrreversibleTransform() { - Transform.call(this); - } - - IrreversibleTransform.prototype = Object.create(Transform.prototype); - IrreversibleTransform.prototype.filter = - function irreversibleTransformFilter(x, offset, length) { - var len = length >> 1; - offset = offset | 0; - var j, n, current, next; - - var alpha = -1.586134342059924; - var beta = -0.052980118572961; - var gamma = 0.882911075530934; - var delta = 0.443506852043971; - var K = 1.230174104914001; - var K_ = 1 / K; - - // step 1 is combined with step 3 - - // step 2 - j = offset - 3; - for (n = len + 4; n--; j += 2) { - x[j] *= K_; - } - - // step 1 & 3 - j = offset - 2; - current = delta * x[j -1]; - for (n = len + 3; n--; j += 2) { - next = delta * x[j + 1]; - x[j] = K * x[j] - current - next; - if (n--) { - j += 2; - current = delta * x[j + 1]; - x[j] = K * x[j] - current - next; - } else { - break; - } - } - - // step 4 - j = offset - 1; - current = gamma * x[j - 1]; - for (n = len + 2; n--; j += 2) { - next = gamma * x[j + 1]; - x[j] -= current + next; - if (n--) { - j += 2; - current = gamma * x[j + 1]; - x[j] -= current + next; - } else { - break; - } - } - - // step 5 - j = offset; - current = beta * x[j - 1]; - for (n = len + 1; n--; j += 2) { - next = beta * x[j + 1]; - x[j] -= current + next; - if (n--) { - j += 2; - current = beta * x[j + 1]; - x[j] -= current + next; - } else { - break; - } - } - - // step 6 - if (len !== 0) { - j = offset + 1; - current = alpha * x[j - 1]; - for (n = len; n--; j += 2) { - next = alpha * x[j + 1]; - x[j] -= current + next; - if (n--) { - j += 2; - current = alpha * x[j + 1]; - x[j] -= current + next; - } else { - break; - } - } - } - }; - - return IrreversibleTransform; - })(); - - // Section 3.8.1 Reversible 5-3 filter - var ReversibleTransform = (function ReversibleTransformClosure() { - function ReversibleTransform() { - Transform.call(this); - } - - ReversibleTransform.prototype = Object.create(Transform.prototype); - ReversibleTransform.prototype.filter = - function reversibleTransformFilter(x, offset, length) { - var len = length >> 1; - offset = offset | 0; - var j, n; - - for (j = offset, n = len + 1; n--; j += 2) { - x[j] -= (x[j - 1] + x[j + 1] + 2) >> 2; - } - - for (j = offset + 1, n = len; n--; j += 2) { - x[j] += (x[j - 1] + x[j + 1]) >> 1; - } - }; - - return ReversibleTransform; - })(); - - return JpxImage; -})(); - - -var Jbig2Image = (function Jbig2ImageClosure() { - // Utility data structures - function ContextCache() {} - - ContextCache.prototype = { - getContexts: function(id) { - if (id in this) { - return this[id]; - } - return (this[id] = new Int8Array(1 << 16)); - } - }; - - function DecodingContext(data, start, end) { - this.data = data; - this.start = start; - this.end = end; - } - - DecodingContext.prototype = { - get decoder() { - var decoder = new ArithmeticDecoder(this.data, this.start, this.end); - return shadow(this, 'decoder', decoder); - }, - get contextCache() { - var cache = new ContextCache(); - return shadow(this, 'contextCache', cache); - } - }; - - // Annex A. Arithmetic Integer Decoding Procedure - // A.2 Procedure for decoding values - function decodeInteger(contextCache, procedure, decoder) { - var contexts = contextCache.getContexts(procedure); - var prev = 1; - - function readBits(length) { - var v = 0; - for (var i = 0; i < length; i++) { - var bit = decoder.readBit(contexts, prev); - prev = (prev < 256 ? (prev << 1) | bit : - (((prev << 1) | bit) & 511) | 256); - v = (v << 1) | bit; - } - return v >>> 0; - } - - var sign = readBits(1); - var value = readBits(1) ? - (readBits(1) ? - (readBits(1) ? - (readBits(1) ? - (readBits(1) ? - (readBits(32) + 4436) : - readBits(12) + 340) : - readBits(8) + 84) : - readBits(6) + 20) : - readBits(4) + 4) : - readBits(2); - return (sign === 0 ? value : (value > 0 ? -value : null)); - } - - // A.3 The IAID decoding procedure - function decodeIAID(contextCache, decoder, codeLength) { - var contexts = contextCache.getContexts('IAID'); - - var prev = 1; - for (var i = 0; i < codeLength; i++) { - var bit = decoder.readBit(contexts, prev); - prev = (prev << 1) | bit; - } - if (codeLength < 31) { - return prev & ((1 << codeLength) - 1); - } - return prev & 0x7FFFFFFF; - } - - // 7.3 Segment types - var SegmentTypes = [ - 'SymbolDictionary', null, null, null, 'IntermediateTextRegion', null, - 'ImmediateTextRegion', 'ImmediateLosslessTextRegion', null, null, null, - null, null, null, null, null, 'patternDictionary', null, null, null, - 'IntermediateHalftoneRegion', null, 'ImmediateHalftoneRegion', - 'ImmediateLosslessHalftoneRegion', null, null, null, null, null, null, null, - null, null, null, null, null, 'IntermediateGenericRegion', null, - 'ImmediateGenericRegion', 'ImmediateLosslessGenericRegion', - 'IntermediateGenericRefinementRegion', null, - 'ImmediateGenericRefinementRegion', - 'ImmediateLosslessGenericRefinementRegion', null, null, null, null, - 'PageInformation', 'EndOfPage', 'EndOfStripe', 'EndOfFile', 'Profiles', - 'Tables', null, null, null, null, null, null, null, null, - 'Extension' - ]; - - var CodingTemplates = [ - [{x: -1, y: -2}, {x: 0, y: -2}, {x: 1, y: -2}, {x: -2, y: -1}, - {x: -1, y: -1}, {x: 0, y: -1}, {x: 1, y: -1}, {x: 2, y: -1}, - {x: -4, y: 0}, {x: -3, y: 0}, {x: -2, y: 0}, {x: -1, y: 0}], - [{x: -1, y: -2}, {x: 0, y: -2}, {x: 1, y: -2}, {x: 2, y: -2}, - {x: -2, y: -1}, {x: -1, y: -1}, {x: 0, y: -1}, {x: 1, y: -1}, - {x: 2, y: -1}, {x: -3, y: 0}, {x: -2, y: 0}, {x: -1, y: 0}], - [{x: -1, y: -2}, {x: 0, y: -2}, {x: 1, y: -2}, {x: -2, y: -1}, - {x: -1, y: -1}, {x: 0, y: -1}, {x: 1, y: -1}, {x: -2, y: 0}, - {x: -1, y: 0}], - [{x: -3, y: -1}, {x: -2, y: -1}, {x: -1, y: -1}, {x: 0, y: -1}, - {x: 1, y: -1}, {x: -4, y: 0}, {x: -3, y: 0}, {x: -2, y: 0}, {x: -1, y: 0}] - ]; - - var RefinementTemplates = [ - { - coding: [{x: 0, y: -1}, {x: 1, y: -1}, {x: -1, y: 0}], - reference: [{x: 0, y: -1}, {x: 1, y: -1}, {x: -1, y: 0}, {x: 0, y: 0}, - {x: 1, y: 0}, {x: -1, y: 1}, {x: 0, y: 1}, {x: 1, y: 1}] - }, - { - coding: [{x: -1, y: -1}, {x: 0, y: -1}, {x: 1, y: -1}, {x: -1, y: 0}], - reference: [{x: 0, y: -1}, {x: -1, y: 0}, {x: 0, y: 0}, {x: 1, y: 0}, - {x: 0, y: 1}, {x: 1, y: 1}] - } - ]; - - // See 6.2.5.7 Decoding the bitmap. - var ReusedContexts = [ - 0x9B25, // 10011 0110010 0101 - 0x0795, // 0011 110010 101 - 0x00E5, // 001 11001 01 - 0x0195 // 011001 0101 - ]; - - var RefinementReusedContexts = [ - 0x0020, // '000' + '0' (coding) + '00010000' + '0' (reference) - 0x0008 // '0000' + '001000' - ]; - - function decodeBitmapTemplate0(width, height, decodingContext) { - var decoder = decodingContext.decoder; - var contexts = decodingContext.contextCache.getContexts('GB'); - var contextLabel, i, j, pixel, row, row1, row2, bitmap = []; - - // ...ooooo.... - // ..ooooooo... Context template for current pixel (X) - // .ooooX...... (concatenate values of 'o'-pixels to get contextLabel) - var OLD_PIXEL_MASK = 0x7BF7; // 01111 0111111 0111 - - for (i = 0; i < height; i++) { - row = bitmap[i] = new Uint8Array(width); - row1 = (i < 1) ? row : bitmap[i - 1]; - row2 = (i < 2) ? row : bitmap[i - 2]; - - // At the beginning of each row: - // Fill contextLabel with pixels that are above/right of (X) - contextLabel = (row2[0] << 13) | (row2[1] << 12) | (row2[2] << 11) | - (row1[0] << 7) | (row1[1] << 6) | (row1[2] << 5) | - (row1[3] << 4); - - for (j = 0; j < width; j++) { - row[j] = pixel = decoder.readBit(contexts, contextLabel); - - // At each pixel: Clear contextLabel pixels that are shifted - // out of the context, then add new ones. - contextLabel = ((contextLabel & OLD_PIXEL_MASK) << 1) | - (j + 3 < width ? row2[j + 3] << 11 : 0) | - (j + 4 < width ? row1[j + 4] << 4 : 0) | pixel; - } - } - - return bitmap; - } - - // 6.2 Generic Region Decoding Procedure - function decodeBitmap(mmr, width, height, templateIndex, prediction, skip, at, - decodingContext) { - if (mmr) { - error('JBIG2 error: MMR encoding is not supported'); - } - - // Use optimized version for the most common case - if (templateIndex === 0 && !skip && !prediction && at.length === 4 && - at[0].x === 3 && at[0].y === -1 && at[1].x === -3 && at[1].y === -1 && - at[2].x === 2 && at[2].y === -2 && at[3].x === -2 && at[3].y === -2) { - return decodeBitmapTemplate0(width, height, decodingContext); - } - - var useskip = !!skip; - var template = CodingTemplates[templateIndex].concat(at); - - // Sorting is non-standard, and it is not required. But sorting increases - // the number of template bits that can be reused from the previous - // contextLabel in the main loop. - template.sort(function (a, b) { - return (a.y - b.y) || (a.x - b.x); - }); - - var templateLength = template.length; - var templateX = new Int8Array(templateLength); - var templateY = new Int8Array(templateLength); - var changingTemplateEntries = []; - var reuseMask = 0, minX = 0, maxX = 0, minY = 0; - var c, k; - - for (k = 0; k < templateLength; k++) { - templateX[k] = template[k].x; - templateY[k] = template[k].y; - minX = Math.min(minX, template[k].x); - maxX = Math.max(maxX, template[k].x); - minY = Math.min(minY, template[k].y); - // Check if the template pixel appears in two consecutive context labels, - // so it can be reused. Otherwise, we add it to the list of changing - // template entries. - if (k < templateLength - 1 && - template[k].y === template[k + 1].y && - template[k].x === template[k + 1].x - 1) { - reuseMask |= 1 << (templateLength - 1 - k); - } else { - changingTemplateEntries.push(k); - } - } - var changingEntriesLength = changingTemplateEntries.length; - - var changingTemplateX = new Int8Array(changingEntriesLength); - var changingTemplateY = new Int8Array(changingEntriesLength); - var changingTemplateBit = new Uint16Array(changingEntriesLength); - for (c = 0; c < changingEntriesLength; c++) { - k = changingTemplateEntries[c]; - changingTemplateX[c] = template[k].x; - changingTemplateY[c] = template[k].y; - changingTemplateBit[c] = 1 << (templateLength - 1 - k); - } - - // Get the safe bounding box edges from the width, height, minX, maxX, minY - var sbb_left = -minX; - var sbb_top = -minY; - var sbb_right = width - maxX; - - var pseudoPixelContext = ReusedContexts[templateIndex]; - var row = new Uint8Array(width); - var bitmap = []; - - var decoder = decodingContext.decoder; - var contexts = decodingContext.contextCache.getContexts('GB'); - - var ltp = 0, j, i0, j0, contextLabel = 0, bit, shift; - for (var i = 0; i < height; i++) { - if (prediction) { - var sltp = decoder.readBit(contexts, pseudoPixelContext); - ltp ^= sltp; - if (ltp) { - bitmap.push(row); // duplicate previous row - continue; - } - } - row = new Uint8Array(row); - bitmap.push(row); - for (j = 0; j < width; j++) { - if (useskip && skip[i][j]) { - row[j] = 0; - continue; - } - // Are we in the middle of a scanline, so we can reuse contextLabel - // bits? - if (j >= sbb_left && j < sbb_right && i >= sbb_top) { - // If yes, we can just shift the bits that are reusable and only - // fetch the remaining ones. - contextLabel = (contextLabel << 1) & reuseMask; - for (k = 0; k < changingEntriesLength; k++) { - i0 = i + changingTemplateY[k]; - j0 = j + changingTemplateX[k]; - bit = bitmap[i0][j0]; - if (bit) { - bit = changingTemplateBit[k]; - contextLabel |= bit; - } - } - } else { - // compute the contextLabel from scratch - contextLabel = 0; - shift = templateLength - 1; - for (k = 0; k < templateLength; k++, shift--) { - j0 = j + templateX[k]; - if (j0 >= 0 && j0 < width) { - i0 = i + templateY[k]; - if (i0 >= 0) { - bit = bitmap[i0][j0]; - if (bit) { - contextLabel |= bit << shift; - } - } - } - } - } - var pixel = decoder.readBit(contexts, contextLabel); - row[j] = pixel; - } - } - return bitmap; - } - - // 6.3.2 Generic Refinement Region Decoding Procedure - function decodeRefinement(width, height, templateIndex, referenceBitmap, - offsetX, offsetY, prediction, at, - decodingContext) { - var codingTemplate = RefinementTemplates[templateIndex].coding; - if (templateIndex === 0) { - codingTemplate = codingTemplate.concat([at[0]]); - } - var codingTemplateLength = codingTemplate.length; - var codingTemplateX = new Int32Array(codingTemplateLength); - var codingTemplateY = new Int32Array(codingTemplateLength); - var k; - for (k = 0; k < codingTemplateLength; k++) { - codingTemplateX[k] = codingTemplate[k].x; - codingTemplateY[k] = codingTemplate[k].y; - } - - var referenceTemplate = RefinementTemplates[templateIndex].reference; - if (templateIndex === 0) { - referenceTemplate = referenceTemplate.concat([at[1]]); - } - var referenceTemplateLength = referenceTemplate.length; - var referenceTemplateX = new Int32Array(referenceTemplateLength); - var referenceTemplateY = new Int32Array(referenceTemplateLength); - for (k = 0; k < referenceTemplateLength; k++) { - referenceTemplateX[k] = referenceTemplate[k].x; - referenceTemplateY[k] = referenceTemplate[k].y; - } - var referenceWidth = referenceBitmap[0].length; - var referenceHeight = referenceBitmap.length; - - var pseudoPixelContext = RefinementReusedContexts[templateIndex]; - var bitmap = []; - - var decoder = decodingContext.decoder; - var contexts = decodingContext.contextCache.getContexts('GR'); - - var ltp = 0; - for (var i = 0; i < height; i++) { - if (prediction) { - var sltp = decoder.readBit(contexts, pseudoPixelContext); - ltp ^= sltp; - if (ltp) { - error('JBIG2 error: prediction is not supported'); - } - } - var row = new Uint8Array(width); - bitmap.push(row); - for (var j = 0; j < width; j++) { - var i0, j0; - var contextLabel = 0; - for (k = 0; k < codingTemplateLength; k++) { - i0 = i + codingTemplateY[k]; - j0 = j + codingTemplateX[k]; - if (i0 < 0 || j0 < 0 || j0 >= width) { - contextLabel <<= 1; // out of bound pixel - } else { - contextLabel = (contextLabel << 1) | bitmap[i0][j0]; - } - } - for (k = 0; k < referenceTemplateLength; k++) { - i0 = i + referenceTemplateY[k] + offsetY; - j0 = j + referenceTemplateX[k] + offsetX; - if (i0 < 0 || i0 >= referenceHeight || j0 < 0 || - j0 >= referenceWidth) { - contextLabel <<= 1; // out of bound pixel - } else { - contextLabel = (contextLabel << 1) | referenceBitmap[i0][j0]; - } - } - var pixel = decoder.readBit(contexts, contextLabel); - row[j] = pixel; - } - } - - return bitmap; - } - - // 6.5.5 Decoding the symbol dictionary - function decodeSymbolDictionary(huffman, refinement, symbols, - numberOfNewSymbols, numberOfExportedSymbols, - huffmanTables, templateIndex, at, - refinementTemplateIndex, refinementAt, - decodingContext) { - if (huffman) { - error('JBIG2 error: huffman is not supported'); - } - - var newSymbols = []; - var currentHeight = 0; - var symbolCodeLength = log2(symbols.length + numberOfNewSymbols); - - var decoder = decodingContext.decoder; - var contextCache = decodingContext.contextCache; - - while (newSymbols.length < numberOfNewSymbols) { - var deltaHeight = decodeInteger(contextCache, 'IADH', decoder); // 6.5.6 - currentHeight += deltaHeight; - var currentWidth = 0; - var totalWidth = 0; - while (true) { - var deltaWidth = decodeInteger(contextCache, 'IADW', decoder); // 6.5.7 - if (deltaWidth === null) { - break; // OOB - } - currentWidth += deltaWidth; - totalWidth += currentWidth; - var bitmap; - if (refinement) { - // 6.5.8.2 Refinement/aggregate-coded symbol bitmap - var numberOfInstances = decodeInteger(contextCache, 'IAAI', decoder); - if (numberOfInstances > 1) { - bitmap = decodeTextRegion(huffman, refinement, - currentWidth, currentHeight, 0, - numberOfInstances, 1, //strip size - symbols.concat(newSymbols), - symbolCodeLength, - 0, //transposed - 0, //ds offset - 1, //top left 7.4.3.1.1 - 0, //OR operator - huffmanTables, - refinementTemplateIndex, refinementAt, - decodingContext); - } else { - var symbolId = decodeIAID(contextCache, decoder, symbolCodeLength); - var rdx = decodeInteger(contextCache, 'IARDX', decoder); // 6.4.11.3 - var rdy = decodeInteger(contextCache, 'IARDY', decoder); // 6.4.11.4 - var symbol = (symbolId < symbols.length ? symbols[symbolId] : - newSymbols[symbolId - symbols.length]); - bitmap = decodeRefinement(currentWidth, currentHeight, - refinementTemplateIndex, symbol, rdx, rdy, false, refinementAt, - decodingContext); - } - } else { - // 6.5.8.1 Direct-coded symbol bitmap - bitmap = decodeBitmap(false, currentWidth, currentHeight, - templateIndex, false, null, at, decodingContext); - } - newSymbols.push(bitmap); - } - } - // 6.5.10 Exported symbols - var exportedSymbols = []; - var flags = [], currentFlag = false; - var totalSymbolsLength = symbols.length + numberOfNewSymbols; - while (flags.length < totalSymbolsLength) { - var runLength = decodeInteger(contextCache, 'IAEX', decoder); - while (runLength--) { - flags.push(currentFlag); - } - currentFlag = !currentFlag; - } - for (var i = 0, ii = symbols.length; i < ii; i++) { - if (flags[i]) { - exportedSymbols.push(symbols[i]); - } - } - for (var j = 0; j < numberOfNewSymbols; i++, j++) { - if (flags[i]) { - exportedSymbols.push(newSymbols[j]); - } - } - return exportedSymbols; - } - - function decodeTextRegion(huffman, refinement, width, height, - defaultPixelValue, numberOfSymbolInstances, - stripSize, inputSymbols, symbolCodeLength, - transposed, dsOffset, referenceCorner, - combinationOperator, huffmanTables, - refinementTemplateIndex, refinementAt, - decodingContext) { - if (huffman) { - error('JBIG2 error: huffman is not supported'); - } - - // Prepare bitmap - var bitmap = []; - var i, row; - for (i = 0; i < height; i++) { - row = new Uint8Array(width); - if (defaultPixelValue) { - for (var j = 0; j < width; j++) { - row[j] = defaultPixelValue; - } - } - bitmap.push(row); - } - - var decoder = decodingContext.decoder; - var contextCache = decodingContext.contextCache; - var stripT = -decodeInteger(contextCache, 'IADT', decoder); // 6.4.6 - var firstS = 0; - i = 0; - while (i < numberOfSymbolInstances) { - var deltaT = decodeInteger(contextCache, 'IADT', decoder); // 6.4.6 - stripT += deltaT; - - var deltaFirstS = decodeInteger(contextCache, 'IAFS', decoder); // 6.4.7 - firstS += deltaFirstS; - var currentS = firstS; - do { - var currentT = (stripSize === 1 ? 0 : - decodeInteger(contextCache, 'IAIT', decoder)); // 6.4.9 - var t = stripSize * stripT + currentT; - var symbolId = decodeIAID(contextCache, decoder, symbolCodeLength); - var applyRefinement = (refinement && - decodeInteger(contextCache, 'IARI', decoder)); - var symbolBitmap = inputSymbols[symbolId]; - var symbolWidth = symbolBitmap[0].length; - var symbolHeight = symbolBitmap.length; - if (applyRefinement) { - var rdw = decodeInteger(contextCache, 'IARDW', decoder); // 6.4.11.1 - var rdh = decodeInteger(contextCache, 'IARDH', decoder); // 6.4.11.2 - var rdx = decodeInteger(contextCache, 'IARDX', decoder); // 6.4.11.3 - var rdy = decodeInteger(contextCache, 'IARDY', decoder); // 6.4.11.4 - symbolWidth += rdw; - symbolHeight += rdh; - symbolBitmap = decodeRefinement(symbolWidth, symbolHeight, - refinementTemplateIndex, symbolBitmap, (rdw >> 1) + rdx, - (rdh >> 1) + rdy, false, refinementAt, - decodingContext); - } - var offsetT = t - ((referenceCorner & 1) ? 0 : symbolHeight); - var offsetS = currentS - ((referenceCorner & 2) ? symbolWidth : 0); - var s2, t2, symbolRow; - if (transposed) { - // Place Symbol Bitmap from T1,S1 - for (s2 = 0; s2 < symbolHeight; s2++) { - row = bitmap[offsetS + s2]; - if (!row) { - continue; - } - symbolRow = symbolBitmap[s2]; - // To ignore Parts of Symbol bitmap which goes - // outside bitmap region - var maxWidth = Math.min(width - offsetT, symbolWidth); - switch (combinationOperator) { - case 0: // OR - for (t2 = 0; t2 < maxWidth; t2++) { - row[offsetT + t2] |= symbolRow[t2]; - } - break; - case 2: // XOR - for (t2 = 0; t2 < maxWidth; t2++) { - row[offsetT + t2] ^= symbolRow[t2]; - } - break; - default: - error('JBIG2 error: operator ' + combinationOperator + - ' is not supported'); - } - } - currentS += symbolHeight - 1; - } else { - for (t2 = 0; t2 < symbolHeight; t2++) { - row = bitmap[offsetT + t2]; - if (!row) { - continue; - } - symbolRow = symbolBitmap[t2]; - switch (combinationOperator) { - case 0: // OR - for (s2 = 0; s2 < symbolWidth; s2++) { - row[offsetS + s2] |= symbolRow[s2]; - } - break; - case 2: // XOR - for (s2 = 0; s2 < symbolWidth; s2++) { - row[offsetS + s2] ^= symbolRow[s2]; - } - break; - default: - error('JBIG2 error: operator ' + combinationOperator + - ' is not supported'); - } - } - currentS += symbolWidth - 1; - } - i++; - var deltaS = decodeInteger(contextCache, 'IADS', decoder); // 6.4.8 - if (deltaS === null) { - break; // OOB - } - currentS += deltaS + dsOffset; - } while (true); - } - return bitmap; - } - - function readSegmentHeader(data, start) { - var segmentHeader = {}; - segmentHeader.number = readUint32(data, start); - var flags = data[start + 4]; - var segmentType = flags & 0x3F; - if (!SegmentTypes[segmentType]) { - error('JBIG2 error: invalid segment type: ' + segmentType); - } - segmentHeader.type = segmentType; - segmentHeader.typeName = SegmentTypes[segmentType]; - segmentHeader.deferredNonRetain = !!(flags & 0x80); - - var pageAssociationFieldSize = !!(flags & 0x40); - var referredFlags = data[start + 5]; - var referredToCount = (referredFlags >> 5) & 7; - var retainBits = [referredFlags & 31]; - var position = start + 6; - if (referredFlags === 7) { - referredToCount = readUint32(data, position - 1) & 0x1FFFFFFF; - position += 3; - var bytes = (referredToCount + 7) >> 3; - retainBits[0] = data[position++]; - while (--bytes > 0) { - retainBits.push(data[position++]); - } - } else if (referredFlags === 5 || referredFlags === 6) { - error('JBIG2 error: invalid referred-to flags'); - } - - segmentHeader.retainBits = retainBits; - var referredToSegmentNumberSize = (segmentHeader.number <= 256 ? 1 : - (segmentHeader.number <= 65536 ? 2 : 4)); - var referredTo = []; - var i, ii; - for (i = 0; i < referredToCount; i++) { - var number = (referredToSegmentNumberSize === 1 ? data[position] : - (referredToSegmentNumberSize === 2 ? readUint16(data, position) : - readUint32(data, position))); - referredTo.push(number); - position += referredToSegmentNumberSize; - } - segmentHeader.referredTo = referredTo; - if (!pageAssociationFieldSize) { - segmentHeader.pageAssociation = data[position++]; - } else { - segmentHeader.pageAssociation = readUint32(data, position); - position += 4; - } - segmentHeader.length = readUint32(data, position); - position += 4; - - if (segmentHeader.length === 0xFFFFFFFF) { - // 7.2.7 Segment data length, unknown segment length - if (segmentType === 38) { // ImmediateGenericRegion - var genericRegionInfo = readRegionSegmentInformation(data, position); - var genericRegionSegmentFlags = data[position + - RegionSegmentInformationFieldLength]; - var genericRegionMmr = !!(genericRegionSegmentFlags & 1); - // searching for the segment end - var searchPatternLength = 6; - var searchPattern = new Uint8Array(searchPatternLength); - if (!genericRegionMmr) { - searchPattern[0] = 0xFF; - searchPattern[1] = 0xAC; - } - searchPattern[2] = (genericRegionInfo.height >>> 24) & 0xFF; - searchPattern[3] = (genericRegionInfo.height >> 16) & 0xFF; - searchPattern[4] = (genericRegionInfo.height >> 8) & 0xFF; - searchPattern[5] = genericRegionInfo.height & 0xFF; - for (i = position, ii = data.length; i < ii; i++) { - var j = 0; - while (j < searchPatternLength && searchPattern[j] === data[i + j]) { - j++; - } - if (j === searchPatternLength) { - segmentHeader.length = i + searchPatternLength; - break; - } - } - if (segmentHeader.length === 0xFFFFFFFF) { - error('JBIG2 error: segment end was not found'); - } - } else { - error('JBIG2 error: invalid unknown segment length'); - } - } - segmentHeader.headerEnd = position; - return segmentHeader; - } - - function readSegments(header, data, start, end) { - var segments = []; - var position = start; - while (position < end) { - var segmentHeader = readSegmentHeader(data, position); - position = segmentHeader.headerEnd; - var segment = { - header: segmentHeader, - data: data - }; - if (!header.randomAccess) { - segment.start = position; - position += segmentHeader.length; - segment.end = position; - } - segments.push(segment); - if (segmentHeader.type === 51) { - break; // end of file is found - } - } - if (header.randomAccess) { - for (var i = 0, ii = segments.length; i < ii; i++) { - segments[i].start = position; - position += segments[i].header.length; - segments[i].end = position; - } - } - return segments; - } - - // 7.4.1 Region segment information field - function readRegionSegmentInformation(data, start) { - return { - width: readUint32(data, start), - height: readUint32(data, start + 4), - x: readUint32(data, start + 8), - y: readUint32(data, start + 12), - combinationOperator: data[start + 16] & 7 - }; - } - var RegionSegmentInformationFieldLength = 17; - - function processSegment(segment, visitor) { - var header = segment.header; - - var data = segment.data, position = segment.start, end = segment.end; - var args, at, i, atLength; - switch (header.type) { - case 0: // SymbolDictionary - // 7.4.2 Symbol dictionary segment syntax - var dictionary = {}; - var dictionaryFlags = readUint16(data, position); // 7.4.2.1.1 - dictionary.huffman = !!(dictionaryFlags & 1); - dictionary.refinement = !!(dictionaryFlags & 2); - dictionary.huffmanDHSelector = (dictionaryFlags >> 2) & 3; - dictionary.huffmanDWSelector = (dictionaryFlags >> 4) & 3; - dictionary.bitmapSizeSelector = (dictionaryFlags >> 6) & 1; - dictionary.aggregationInstancesSelector = (dictionaryFlags >> 7) & 1; - dictionary.bitmapCodingContextUsed = !!(dictionaryFlags & 256); - dictionary.bitmapCodingContextRetained = !!(dictionaryFlags & 512); - dictionary.template = (dictionaryFlags >> 10) & 3; - dictionary.refinementTemplate = (dictionaryFlags >> 12) & 1; - position += 2; - if (!dictionary.huffman) { - atLength = dictionary.template === 0 ? 4 : 1; - at = []; - for (i = 0; i < atLength; i++) { - at.push({ - x: readInt8(data, position), - y: readInt8(data, position + 1) - }); - position += 2; - } - dictionary.at = at; - } - if (dictionary.refinement && !dictionary.refinementTemplate) { - at = []; - for (i = 0; i < 2; i++) { - at.push({ - x: readInt8(data, position), - y: readInt8(data, position + 1) - }); - position += 2; - } - dictionary.refinementAt = at; - } - dictionary.numberOfExportedSymbols = readUint32(data, position); - position += 4; - dictionary.numberOfNewSymbols = readUint32(data, position); - position += 4; - args = [dictionary, header.number, header.referredTo, - data, position, end]; - break; - case 6: // ImmediateTextRegion - case 7: // ImmediateLosslessTextRegion - var textRegion = {}; - textRegion.info = readRegionSegmentInformation(data, position); - position += RegionSegmentInformationFieldLength; - var textRegionSegmentFlags = readUint16(data, position); - position += 2; - textRegion.huffman = !!(textRegionSegmentFlags & 1); - textRegion.refinement = !!(textRegionSegmentFlags & 2); - textRegion.stripSize = 1 << ((textRegionSegmentFlags >> 2) & 3); - textRegion.referenceCorner = (textRegionSegmentFlags >> 4) & 3; - textRegion.transposed = !!(textRegionSegmentFlags & 64); - textRegion.combinationOperator = (textRegionSegmentFlags >> 7) & 3; - textRegion.defaultPixelValue = (textRegionSegmentFlags >> 9) & 1; - textRegion.dsOffset = (textRegionSegmentFlags << 17) >> 27; - textRegion.refinementTemplate = (textRegionSegmentFlags >> 15) & 1; - if (textRegion.huffman) { - var textRegionHuffmanFlags = readUint16(data, position); - position += 2; - textRegion.huffmanFS = (textRegionHuffmanFlags) & 3; - textRegion.huffmanDS = (textRegionHuffmanFlags >> 2) & 3; - textRegion.huffmanDT = (textRegionHuffmanFlags >> 4) & 3; - textRegion.huffmanRefinementDW = (textRegionHuffmanFlags >> 6) & 3; - textRegion.huffmanRefinementDH = (textRegionHuffmanFlags >> 8) & 3; - textRegion.huffmanRefinementDX = (textRegionHuffmanFlags >> 10) & 3; - textRegion.huffmanRefinementDY = (textRegionHuffmanFlags >> 12) & 3; - textRegion.huffmanRefinementSizeSelector = - !!(textRegionHuffmanFlags & 14); - } - if (textRegion.refinement && !textRegion.refinementTemplate) { - at = []; - for (i = 0; i < 2; i++) { - at.push({ - x: readInt8(data, position), - y: readInt8(data, position + 1) - }); - position += 2; - } - textRegion.refinementAt = at; - } - textRegion.numberOfSymbolInstances = readUint32(data, position); - position += 4; - // TODO 7.4.3.1.7 Symbol ID Huffman table decoding - if (textRegion.huffman) { - error('JBIG2 error: huffman is not supported'); - } - args = [textRegion, header.referredTo, data, position, end]; - break; - case 38: // ImmediateGenericRegion - case 39: // ImmediateLosslessGenericRegion - var genericRegion = {}; - genericRegion.info = readRegionSegmentInformation(data, position); - position += RegionSegmentInformationFieldLength; - var genericRegionSegmentFlags = data[position++]; - genericRegion.mmr = !!(genericRegionSegmentFlags & 1); - genericRegion.template = (genericRegionSegmentFlags >> 1) & 3; - genericRegion.prediction = !!(genericRegionSegmentFlags & 8); - if (!genericRegion.mmr) { - atLength = genericRegion.template === 0 ? 4 : 1; - at = []; - for (i = 0; i < atLength; i++) { - at.push({ - x: readInt8(data, position), - y: readInt8(data, position + 1) - }); - position += 2; - } - genericRegion.at = at; - } - args = [genericRegion, data, position, end]; - break; - case 48: // PageInformation - var pageInfo = { - width: readUint32(data, position), - height: readUint32(data, position + 4), - resolutionX: readUint32(data, position + 8), - resolutionY: readUint32(data, position + 12) - }; - if (pageInfo.height === 0xFFFFFFFF) { - delete pageInfo.height; - } - var pageSegmentFlags = data[position + 16]; - var pageStripingInformatiom = readUint16(data, position + 17); - pageInfo.lossless = !!(pageSegmentFlags & 1); - pageInfo.refinement = !!(pageSegmentFlags & 2); - pageInfo.defaultPixelValue = (pageSegmentFlags >> 2) & 1; - pageInfo.combinationOperator = (pageSegmentFlags >> 3) & 3; - pageInfo.requiresBuffer = !!(pageSegmentFlags & 32); - pageInfo.combinationOperatorOverride = !!(pageSegmentFlags & 64); - args = [pageInfo]; - break; - case 49: // EndOfPage - break; - case 50: // EndOfStripe - break; - case 51: // EndOfFile - break; - case 62: // 7.4.15 defines 2 extension types which - // are comments and can be ignored. - break; - default: - error('JBIG2 error: segment type ' + header.typeName + '(' + - header.type + ') is not implemented'); - } - var callbackName = 'on' + header.typeName; - if (callbackName in visitor) { - visitor[callbackName].apply(visitor, args); - } - } - - function processSegments(segments, visitor) { - for (var i = 0, ii = segments.length; i < ii; i++) { - processSegment(segments[i], visitor); - } - } - - function parseJbig2(data, start, end) { - var position = start; - if (data[position] !== 0x97 || data[position + 1] !== 0x4A || - data[position + 2] !== 0x42 || data[position + 3] !== 0x32 || - data[position + 4] !== 0x0D || data[position + 5] !== 0x0A || - data[position + 6] !== 0x1A || data[position + 7] !== 0x0A) { - error('JBIG2 error: invalid header'); - } - var header = {}; - position += 8; - var flags = data[position++]; - header.randomAccess = !(flags & 1); - if (!(flags & 2)) { - header.numberOfPages = readUint32(data, position); - position += 4; - } - var segments = readSegments(header, data, position, end); - error('Not implemented'); - // processSegments(segments, new SimpleSegmentVisitor()); - } - - function parseJbig2Chunks(chunks) { - var visitor = new SimpleSegmentVisitor(); - for (var i = 0, ii = chunks.length; i < ii; i++) { - var chunk = chunks[i]; - var segments = readSegments({}, chunk.data, chunk.start, chunk.end); - processSegments(segments, visitor); - } - return visitor.buffer; - } - - function SimpleSegmentVisitor() {} - - SimpleSegmentVisitor.prototype = { - onPageInformation: function SimpleSegmentVisitor_onPageInformation(info) { - this.currentPageInfo = info; - var rowSize = (info.width + 7) >> 3; - var buffer = new Uint8Array(rowSize * info.height); - // The contents of ArrayBuffers are initialized to 0. - // Fill the buffer with 0xFF only if info.defaultPixelValue is set - if (info.defaultPixelValue) { - for (var i = 0, ii = buffer.length; i < ii; i++) { - buffer[i] = 0xFF; - } - } - this.buffer = buffer; - }, - drawBitmap: function SimpleSegmentVisitor_drawBitmap(regionInfo, bitmap) { - var pageInfo = this.currentPageInfo; - var width = regionInfo.width, height = regionInfo.height; - var rowSize = (pageInfo.width + 7) >> 3; - var combinationOperator = pageInfo.combinationOperatorOverride ? - regionInfo.combinationOperator : pageInfo.combinationOperator; - var buffer = this.buffer; - var mask0 = 128 >> (regionInfo.x & 7); - var offset0 = regionInfo.y * rowSize + (regionInfo.x >> 3); - var i, j, mask, offset; - switch (combinationOperator) { - case 0: // OR - for (i = 0; i < height; i++) { - mask = mask0; - offset = offset0; - for (j = 0; j < width; j++) { - if (bitmap[i][j]) { - buffer[offset] |= mask; - } - mask >>= 1; - if (!mask) { - mask = 128; - offset++; - } - } - offset0 += rowSize; - } - break; - case 2: // XOR - for (i = 0; i < height; i++) { - mask = mask0; - offset = offset0; - for (j = 0; j < width; j++) { - if (bitmap[i][j]) { - buffer[offset] ^= mask; - } - mask >>= 1; - if (!mask) { - mask = 128; - offset++; - } - } - offset0 += rowSize; - } - break; - default: - error('JBIG2 error: operator ' + combinationOperator + - ' is not supported'); - } - }, - onImmediateGenericRegion: - function SimpleSegmentVisitor_onImmediateGenericRegion(region, data, - start, end) { - var regionInfo = region.info; - var decodingContext = new DecodingContext(data, start, end); - var bitmap = decodeBitmap(region.mmr, regionInfo.width, regionInfo.height, - region.template, region.prediction, null, - region.at, decodingContext); - this.drawBitmap(regionInfo, bitmap); - }, - onImmediateLosslessGenericRegion: - function SimpleSegmentVisitor_onImmediateLosslessGenericRegion() { - this.onImmediateGenericRegion.apply(this, arguments); - }, - onSymbolDictionary: - function SimpleSegmentVisitor_onSymbolDictionary(dictionary, - currentSegment, - referredSegments, - data, start, end) { - var huffmanTables; - if (dictionary.huffman) { - error('JBIG2 error: huffman is not supported'); - } - - // Combines exported symbols from all referred segments - var symbols = this.symbols; - if (!symbols) { - this.symbols = symbols = {}; - } - - var inputSymbols = []; - for (var i = 0, ii = referredSegments.length; i < ii; i++) { - inputSymbols = inputSymbols.concat(symbols[referredSegments[i]]); - } - - var decodingContext = new DecodingContext(data, start, end); - symbols[currentSegment] = decodeSymbolDictionary(dictionary.huffman, - dictionary.refinement, inputSymbols, dictionary.numberOfNewSymbols, - dictionary.numberOfExportedSymbols, huffmanTables, - dictionary.template, dictionary.at, - dictionary.refinementTemplate, dictionary.refinementAt, - decodingContext); - }, - onImmediateTextRegion: - function SimpleSegmentVisitor_onImmediateTextRegion(region, - referredSegments, - data, start, end) { - var regionInfo = region.info; - var huffmanTables; - - // Combines exported symbols from all referred segments - var symbols = this.symbols; - var inputSymbols = []; - for (var i = 0, ii = referredSegments.length; i < ii; i++) { - inputSymbols = inputSymbols.concat(symbols[referredSegments[i]]); - } - var symbolCodeLength = log2(inputSymbols.length); - - var decodingContext = new DecodingContext(data, start, end); - var bitmap = decodeTextRegion(region.huffman, region.refinement, - regionInfo.width, regionInfo.height, region.defaultPixelValue, - region.numberOfSymbolInstances, region.stripSize, inputSymbols, - symbolCodeLength, region.transposed, region.dsOffset, - region.referenceCorner, region.combinationOperator, huffmanTables, - region.refinementTemplate, region.refinementAt, decodingContext); - this.drawBitmap(regionInfo, bitmap); - }, - onImmediateLosslessTextRegion: - function SimpleSegmentVisitor_onImmediateLosslessTextRegion() { - this.onImmediateTextRegion.apply(this, arguments); - } - }; - - function Jbig2Image() {} - - Jbig2Image.prototype = { - parseChunks: function Jbig2Image_parseChunks(chunks) { - return parseJbig2Chunks(chunks); - } - }; - - return Jbig2Image; -})(); - - -var bidi = PDFJS.bidi = (function bidiClosure() { - // Character types for symbols from 0000 to 00FF. - var baseTypes = [ - 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'S', 'B', 'S', 'WS', - 'B', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', - 'BN', 'BN', 'B', 'B', 'B', 'S', 'WS', 'ON', 'ON', 'ET', 'ET', 'ET', 'ON', - 'ON', 'ON', 'ON', 'ON', 'ON', 'CS', 'ON', 'CS', 'ON', 'EN', 'EN', 'EN', - 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'ON', 'ON', 'ON', 'ON', 'ON', - 'ON', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'ON', 'ON', - 'ON', 'ON', 'ON', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'ON', 'ON', 'ON', 'ON', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'B', 'BN', - 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', - 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', - 'BN', 'CS', 'ON', 'ET', 'ET', 'ET', 'ET', 'ON', 'ON', 'ON', 'ON', 'L', 'ON', - 'ON', 'ON', 'ON', 'ON', 'ET', 'ET', 'EN', 'EN', 'ON', 'L', 'ON', 'ON', 'ON', - 'EN', 'L', 'ON', 'ON', 'ON', 'ON', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'L', 'L', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L' - ]; - - // Character types for symbols from 0600 to 06FF - var arabicTypes = [ - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'CS', 'AL', 'ON', 'ON', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', - 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', - 'AN', 'ET', 'AN', 'AN', 'AL', 'AL', 'AL', 'NSM', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', - 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'ON', 'NSM', - 'NSM', 'NSM', 'NSM', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL' - ]; - - function isOdd(i) { - return (i & 1) !== 0; - } - - function isEven(i) { - return (i & 1) === 0; - } - - function findUnequal(arr, start, value) { - for (var j = start, jj = arr.length; j < jj; ++j) { - if (arr[j] !== value) { - return j; - } - } - return j; - } - - function setValues(arr, start, end, value) { - for (var j = start; j < end; ++j) { - arr[j] = value; - } - } - - function reverseValues(arr, start, end) { - for (var i = start, j = end - 1; i < j; ++i, --j) { - var temp = arr[i]; - arr[i] = arr[j]; - arr[j] = temp; - } - } - - function createBidiText(str, isLTR, vertical) { - return { - str: str, - dir: (vertical ? 'ttb' : (isLTR ? 'ltr' : 'rtl')) - }; - } - - // These are used in bidi(), which is called frequently. We re-use them on - // each call to avoid unnecessary allocations. - var chars = []; - var types = []; - - function bidi(str, startLevel, vertical) { - var isLTR = true; - var strLength = str.length; - if (strLength === 0 || vertical) { - return createBidiText(str, isLTR, vertical); - } - - // Get types and fill arrays - chars.length = strLength; - types.length = strLength; - var numBidi = 0; - - var i, ii; - for (i = 0; i < strLength; ++i) { - chars[i] = str.charAt(i); - - var charCode = str.charCodeAt(i); - var charType = 'L'; - if (charCode <= 0x00ff) { - charType = baseTypes[charCode]; - } else if (0x0590 <= charCode && charCode <= 0x05f4) { - charType = 'R'; - } else if (0x0600 <= charCode && charCode <= 0x06ff) { - charType = arabicTypes[charCode & 0xff]; - } else if (0x0700 <= charCode && charCode <= 0x08AC) { - charType = 'AL'; - } - if (charType === 'R' || charType === 'AL' || charType === 'AN') { - numBidi++; - } - types[i] = charType; - } - - // Detect the bidi method - // - If there are no rtl characters then no bidi needed - // - If less than 30% chars are rtl then string is primarily ltr - // - If more than 30% chars are rtl then string is primarily rtl - if (numBidi === 0) { - isLTR = true; - return createBidiText(str, isLTR); - } - - if (startLevel === -1) { - if ((strLength / numBidi) < 0.3) { - isLTR = true; - startLevel = 0; - } else { - isLTR = false; - startLevel = 1; - } - } - - var levels = []; - for (i = 0; i < strLength; ++i) { - levels[i] = startLevel; - } - - /* - X1-X10: skip most of this, since we are NOT doing the embeddings. - */ - var e = (isOdd(startLevel) ? 'R' : 'L'); - var sor = e; - var eor = sor; - - /* - W1. Examine each non-spacing mark (NSM) in the level run, and change the - type of the NSM to the type of the previous character. If the NSM is at the - start of the level run, it will get the type of sor. - */ - var lastType = sor; - for (i = 0; i < strLength; ++i) { - if (types[i] === 'NSM') { - types[i] = lastType; - } else { - lastType = types[i]; - } - } - - /* - W2. Search backwards from each instance of a European number until the - first strong type (R, L, AL, or sor) is found. If an AL is found, change - the type of the European number to Arabic number. - */ - lastType = sor; - var t; - for (i = 0; i < strLength; ++i) { - t = types[i]; - if (t === 'EN') { - types[i] = (lastType === 'AL') ? 'AN' : 'EN'; - } else if (t === 'R' || t === 'L' || t === 'AL') { - lastType = t; - } - } - - /* - W3. Change all ALs to R. - */ - for (i = 0; i < strLength; ++i) { - t = types[i]; - if (t === 'AL') { - types[i] = 'R'; - } - } - - /* - W4. A single European separator between two European numbers changes to a - European number. A single common separator between two numbers of the same - type changes to that type: - */ - for (i = 1; i < strLength - 1; ++i) { - if (types[i] === 'ES' && types[i - 1] === 'EN' && types[i + 1] === 'EN') { - types[i] = 'EN'; - } - if (types[i] === 'CS' && - (types[i - 1] === 'EN' || types[i - 1] === 'AN') && - types[i + 1] === types[i - 1]) { - types[i] = types[i - 1]; - } - } - - /* - W5. A sequence of European terminators adjacent to European numbers changes - to all European numbers: - */ - for (i = 0; i < strLength; ++i) { - if (types[i] === 'EN') { - // do before - var j; - for (j = i - 1; j >= 0; --j) { - if (types[j] !== 'ET') { - break; - } - types[j] = 'EN'; - } - // do after - for (j = i + 1; j < strLength; --j) { - if (types[j] !== 'ET') { - break; - } - types[j] = 'EN'; - } - } - } - - /* - W6. Otherwise, separators and terminators change to Other Neutral: - */ - for (i = 0; i < strLength; ++i) { - t = types[i]; - if (t === 'WS' || t === 'ES' || t === 'ET' || t === 'CS') { - types[i] = 'ON'; - } - } - - /* - W7. Search backwards from each instance of a European number until the - first strong type (R, L, or sor) is found. If an L is found, then change - the type of the European number to L. - */ - lastType = sor; - for (i = 0; i < strLength; ++i) { - t = types[i]; - if (t === 'EN') { - types[i] = ((lastType === 'L') ? 'L' : 'EN'); - } else if (t === 'R' || t === 'L') { - lastType = t; - } - } - - /* - N1. A sequence of neutrals takes the direction of the surrounding strong - text if the text on both sides has the same direction. European and Arabic - numbers are treated as though they were R. Start-of-level-run (sor) and - end-of-level-run (eor) are used at level run boundaries. - */ - for (i = 0; i < strLength; ++i) { - if (types[i] === 'ON') { - var end = findUnequal(types, i + 1, 'ON'); - var before = sor; - if (i > 0) { - before = types[i - 1]; - } - - var after = eor; - if (end + 1 < strLength) { - after = types[end + 1]; - } - if (before !== 'L') { - before = 'R'; - } - if (after !== 'L') { - after = 'R'; - } - if (before === after) { - setValues(types, i, end, before); - } - i = end - 1; // reset to end (-1 so next iteration is ok) - } - } - - /* - N2. Any remaining neutrals take the embedding direction. - */ - for (i = 0; i < strLength; ++i) { - if (types[i] === 'ON') { - types[i] = e; - } - } - - /* - I1. For all characters with an even (left-to-right) embedding direction, - those of type R go up one level and those of type AN or EN go up two - levels. - I2. For all characters with an odd (right-to-left) embedding direction, - those of type L, EN or AN go up one level. - */ - for (i = 0; i < strLength; ++i) { - t = types[i]; - if (isEven(levels[i])) { - if (t === 'R') { - levels[i] += 1; - } else if (t === 'AN' || t === 'EN') { - levels[i] += 2; - } - } else { // isOdd - if (t === 'L' || t === 'AN' || t === 'EN') { - levels[i] += 1; - } - } - } - - /* - L1. On each line, reset the embedding level of the following characters to - the paragraph embedding level: - - segment separators, - paragraph separators, - any sequence of whitespace characters preceding a segment separator or - paragraph separator, and any sequence of white space characters at the end - of the line. - */ - - // don't bother as text is only single line - - /* - L2. From the highest level found in the text to the lowest odd level on - each line, reverse any contiguous sequence of characters that are at that - level or higher. - */ - - // find highest level & lowest odd level - var highestLevel = -1; - var lowestOddLevel = 99; - var level; - for (i = 0, ii = levels.length; i < ii; ++i) { - level = levels[i]; - if (highestLevel < level) { - highestLevel = level; - } - if (lowestOddLevel > level && isOdd(level)) { - lowestOddLevel = level; - } - } - - // now reverse between those limits - for (level = highestLevel; level >= lowestOddLevel; --level) { - // find segments to reverse - var start = -1; - for (i = 0, ii = levels.length; i < ii; ++i) { - if (levels[i] < level) { - if (start >= 0) { - reverseValues(chars, start, i); - start = -1; - } - } else if (start < 0) { - start = i; - } - } - if (start >= 0) { - reverseValues(chars, start, levels.length); - } - } - - /* - L3. Combining marks applied to a right-to-left base character will at this - point precede their base character. If the rendering engine expects them to - follow the base characters in the final display process, then the ordering - of the marks and the base character must be reversed. - */ - - // don't bother for now - - /* - L4. A character that possesses the mirrored property as specified by - Section 4.7, Mirrored, must be depicted by a mirrored glyph if the resolved - directionality of that character is R. - */ - - // don't mirror as characters are already mirrored in the pdf - - // Finally, return string - for (i = 0, ii = chars.length; i < ii; ++i) { - var ch = chars[i]; - if (ch === '<' || ch === '>') { - chars[i] = ''; - } - } - return createBidiText(chars.join(''), isLTR); - } - - return bidi; -})(); - - - -var MurmurHash3_64 = (function MurmurHash3_64Closure (seed) { - // Workaround for missing math precison in JS. - var MASK_HIGH = 0xffff0000; - var MASK_LOW = 0xffff; - - function MurmurHash3_64 (seed) { - var SEED = 0xc3d2e1f0; - this.h1 = seed ? seed & 0xffffffff : SEED; - this.h2 = seed ? seed & 0xffffffff : SEED; - } - - var alwaysUseUint32ArrayView = false; - // old webkits have issues with non-aligned arrays - try { - new Uint32Array(new Uint8Array(5).buffer, 0, 1); - } catch (e) { - alwaysUseUint32ArrayView = true; - } - - MurmurHash3_64.prototype = { - update: function MurmurHash3_64_update(input) { - var useUint32ArrayView = alwaysUseUint32ArrayView; - var i; - if (typeof input === 'string') { - var data = new Uint8Array(input.length * 2); - var length = 0; - for (i = 0; i < input.length; i++) { - var code = input.charCodeAt(i); - if (code <= 0xff) { - data[length++] = code; - } - else { - data[length++] = code >>> 8; - data[length++] = code & 0xff; - } - } - } else if (input instanceof Uint8Array) { - data = input; - length = data.length; - } else if (typeof input === 'object' && ('length' in input)) { - // processing regular arrays as well, e.g. for IE9 - data = input; - length = data.length; - useUint32ArrayView = true; - } else { - throw new Error('Wrong data format in MurmurHash3_64_update. ' + - 'Input must be a string or array.'); - } - - var blockCounts = length >> 2; - var tailLength = length - blockCounts * 4; - // we don't care about endianness here - var dataUint32 = useUint32ArrayView ? - new Uint32ArrayView(data, blockCounts) : - new Uint32Array(data.buffer, 0, blockCounts); - var k1 = 0; - var k2 = 0; - var h1 = this.h1; - var h2 = this.h2; - var C1 = 0xcc9e2d51; - var C2 = 0x1b873593; - var C1_LOW = C1 & MASK_LOW; - var C2_LOW = C2 & MASK_LOW; - - for (i = 0; i < blockCounts; i++) { - if (i & 1) { - k1 = dataUint32[i]; - k1 = (k1 * C1 & MASK_HIGH) | (k1 * C1_LOW & MASK_LOW); - k1 = k1 << 15 | k1 >>> 17; - k1 = (k1 * C2 & MASK_HIGH) | (k1 * C2_LOW & MASK_LOW); - h1 ^= k1; - h1 = h1 << 13 | h1 >>> 19; - h1 = h1 * 5 + 0xe6546b64; - } else { - k2 = dataUint32[i]; - k2 = (k2 * C1 & MASK_HIGH) | (k2 * C1_LOW & MASK_LOW); - k2 = k2 << 15 | k2 >>> 17; - k2 = (k2 * C2 & MASK_HIGH) | (k2 * C2_LOW & MASK_LOW); - h2 ^= k2; - h2 = h2 << 13 | h2 >>> 19; - h2 = h2 * 5 + 0xe6546b64; - } - } - - k1 = 0; - - switch (tailLength) { - case 3: - k1 ^= data[blockCounts * 4 + 2] << 16; - /* falls through */ - case 2: - k1 ^= data[blockCounts * 4 + 1] << 8; - /* falls through */ - case 1: - k1 ^= data[blockCounts * 4]; - /* falls through */ - k1 = (k1 * C1 & MASK_HIGH) | (k1 * C1_LOW & MASK_LOW); - k1 = k1 << 15 | k1 >>> 17; - k1 = (k1 * C2 & MASK_HIGH) | (k1 * C2_LOW & MASK_LOW); - if (blockCounts & 1) { - h1 ^= k1; - } else { - h2 ^= k1; - } - } - - this.h1 = h1; - this.h2 = h2; - return this; - }, - - hexdigest: function MurmurHash3_64_hexdigest () { - var h1 = this.h1; - var h2 = this.h2; - - h1 ^= h2 >>> 1; - h1 = (h1 * 0xed558ccd & MASK_HIGH) | (h1 * 0x8ccd & MASK_LOW); - h2 = (h2 * 0xff51afd7 & MASK_HIGH) | - (((h2 << 16 | h1 >>> 16) * 0xafd7ed55 & MASK_HIGH) >>> 16); - h1 ^= h2 >>> 1; - h1 = (h1 * 0x1a85ec53 & MASK_HIGH) | (h1 * 0xec53 & MASK_LOW); - h2 = (h2 * 0xc4ceb9fe & MASK_HIGH) | - (((h2 << 16 | h1 >>> 16) * 0xb9fe1a85 & MASK_HIGH) >>> 16); - h1 ^= h2 >>> 1; - - for (var i = 0, arr = [h1, h2], str = ''; i < arr.length; i++) { - var hex = (arr[i] >>> 0).toString(16); - while (hex.length < 8) { - hex = '0' + hex; - } - str += hex; - } - - return str; - } - }; - - return MurmurHash3_64; -})(); - - -}).call((typeof window === 'undefined') ? this : window); - -if (!PDFJS.workerSrc && typeof document !== 'undefined') { - // workerSrc is not set -- using last script url to define default location - PDFJS.workerSrc = (function () { - 'use strict'; - var pdfJsSrc = document.currentScript.src; - return pdfJsSrc && pdfJsSrc.replace(/\.js$/i, '.worker.js'); - })(); -} - - From 81e8e0e1defa4911ce1307a6aa9e156a683e11d2 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 2 Mar 2017 09:38:49 +0000 Subject: [PATCH 3/3] delete pdfjs-1.6.210p1 --- .../pdfjs-1.6.210p1/bcmaps/.gitattributes | 1 - .../pdfjs-1.6.210p1/bcmaps/78-EUC-H.bcmap | Bin 2404 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/78-EUC-V.bcmap | Bin 173 -> 0 bytes .../js/libs/pdfjs-1.6.210p1/bcmaps/78-H.bcmap | Bin 2379 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/78-RKSJ-H.bcmap | Bin 2398 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/78-RKSJ-V.bcmap | Bin 173 -> 0 bytes .../js/libs/pdfjs-1.6.210p1/bcmaps/78-V.bcmap | Bin 169 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/78ms-RKSJ-H.bcmap | Bin 2651 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/78ms-RKSJ-V.bcmap | Bin 290 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/83pv-RKSJ-H.bcmap | Bin 905 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/90ms-RKSJ-H.bcmap | Bin 721 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/90ms-RKSJ-V.bcmap | Bin 290 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/90msp-RKSJ-H.bcmap | Bin 715 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/90msp-RKSJ-V.bcmap | Bin 291 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/90pv-RKSJ-H.bcmap | Bin 982 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/90pv-RKSJ-V.bcmap | Bin 260 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/Add-H.bcmap | Bin 2419 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/Add-RKSJ-H.bcmap | Bin 2413 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/Add-RKSJ-V.bcmap | Bin 287 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/Add-V.bcmap | Bin 282 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-0.bcmap | Bin 317 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-1.bcmap | Bin 371 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-2.bcmap | Bin 376 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-3.bcmap | Bin 401 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-4.bcmap | Bin 405 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-5.bcmap | Bin 406 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-6.bcmap | Bin 406 -> 0 bytes .../bcmaps/Adobe-CNS1-UCS2.bcmap | Bin 41193 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/Adobe-GB1-0.bcmap | Bin 217 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/Adobe-GB1-1.bcmap | Bin 250 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/Adobe-GB1-2.bcmap | Bin 465 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/Adobe-GB1-3.bcmap | Bin 470 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/Adobe-GB1-4.bcmap | Bin 601 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/Adobe-GB1-5.bcmap | Bin 625 -> 0 bytes .../bcmaps/Adobe-GB1-UCS2.bcmap | Bin 33974 -> 0 bytes .../bcmaps/Adobe-Japan1-0.bcmap | Bin 225 -> 0 bytes .../bcmaps/Adobe-Japan1-1.bcmap | Bin 226 -> 0 bytes .../bcmaps/Adobe-Japan1-2.bcmap | Bin 233 -> 0 bytes .../bcmaps/Adobe-Japan1-3.bcmap | Bin 242 -> 0 bytes .../bcmaps/Adobe-Japan1-4.bcmap | Bin 337 -> 0 bytes .../bcmaps/Adobe-Japan1-5.bcmap | Bin 430 -> 0 bytes .../bcmaps/Adobe-Japan1-6.bcmap | Bin 485 -> 0 bytes .../bcmaps/Adobe-Japan1-UCS2.bcmap | Bin 40951 -> 0 bytes .../bcmaps/Adobe-Korea1-0.bcmap | Bin 241 -> 0 bytes .../bcmaps/Adobe-Korea1-1.bcmap | Bin 386 -> 0 bytes .../bcmaps/Adobe-Korea1-2.bcmap | Bin 391 -> 0 bytes .../bcmaps/Adobe-Korea1-UCS2.bcmap | Bin 23293 -> 0 bytes .../js/libs/pdfjs-1.6.210p1/bcmaps/B5-H.bcmap | Bin 1086 -> 0 bytes .../js/libs/pdfjs-1.6.210p1/bcmaps/B5-V.bcmap | Bin 142 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/B5pc-H.bcmap | Bin 1099 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/B5pc-V.bcmap | Bin 144 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/CNS-EUC-H.bcmap | Bin 1780 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/CNS-EUC-V.bcmap | Bin 1920 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/CNS1-H.bcmap | Bin 706 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/CNS1-V.bcmap | Bin 143 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/CNS2-H.bcmap | Bin 504 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/CNS2-V.bcmap | 3 - .../pdfjs-1.6.210p1/bcmaps/ETHK-B5-H.bcmap | Bin 4426 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/ETHK-B5-V.bcmap | Bin 158 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/ETen-B5-H.bcmap | Bin 1125 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/ETen-B5-V.bcmap | Bin 158 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/ETenms-B5-H.bcmap | 3 - .../pdfjs-1.6.210p1/bcmaps/ETenms-B5-V.bcmap | Bin 172 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/EUC-H.bcmap | Bin 578 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/EUC-V.bcmap | Bin 170 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/Ext-H.bcmap | Bin 2536 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/Ext-RKSJ-H.bcmap | Bin 2542 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/Ext-RKSJ-V.bcmap | Bin 218 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/Ext-V.bcmap | Bin 215 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/GB-EUC-H.bcmap | Bin 549 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/GB-EUC-V.bcmap | Bin 179 -> 0 bytes .../js/libs/pdfjs-1.6.210p1/bcmaps/GB-H.bcmap | 4 - .../js/libs/pdfjs-1.6.210p1/bcmaps/GB-V.bcmap | Bin 175 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/GBK-EUC-H.bcmap | Bin 14692 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/GBK-EUC-V.bcmap | Bin 180 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/GBK2K-H.bcmap | Bin 19662 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/GBK2K-V.bcmap | Bin 219 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/GBKp-EUC-H.bcmap | Bin 14686 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/GBKp-EUC-V.bcmap | Bin 181 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/GBT-EUC-H.bcmap | Bin 7290 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/GBT-EUC-V.bcmap | Bin 180 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/GBT-H.bcmap | Bin 7269 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/GBT-V.bcmap | Bin 176 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/GBTpc-EUC-H.bcmap | Bin 7298 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/GBTpc-EUC-V.bcmap | Bin 182 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/GBpc-EUC-H.bcmap | Bin 557 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/GBpc-EUC-V.bcmap | Bin 181 -> 0 bytes .../js/libs/pdfjs-1.6.210p1/bcmaps/H.bcmap | Bin 553 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/HKdla-B5-H.bcmap | Bin 2654 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/HKdla-B5-V.bcmap | Bin 148 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/HKdlb-B5-H.bcmap | Bin 2414 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/HKdlb-B5-V.bcmap | Bin 148 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/HKgccs-B5-H.bcmap | Bin 2292 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/HKgccs-B5-V.bcmap | Bin 149 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/HKm314-B5-H.bcmap | Bin 1772 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/HKm314-B5-V.bcmap | Bin 149 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/HKm471-B5-H.bcmap | Bin 2171 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/HKm471-B5-V.bcmap | Bin 149 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/HKscs-B5-H.bcmap | Bin 4437 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/HKscs-B5-V.bcmap | Bin 159 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/Hankaku.bcmap | Bin 132 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/Hiragana.bcmap | Bin 124 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/KSC-EUC-H.bcmap | Bin 1848 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/KSC-EUC-V.bcmap | Bin 164 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/KSC-H.bcmap | Bin 1831 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/KSC-Johab-H.bcmap | Bin 16791 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/KSC-Johab-V.bcmap | Bin 166 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/KSC-V.bcmap | Bin 160 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/KSCms-UHC-H.bcmap | Bin 2787 -> 0 bytes .../bcmaps/KSCms-UHC-HW-H.bcmap | Bin 2789 -> 0 bytes .../bcmaps/KSCms-UHC-HW-V.bcmap | Bin 169 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/KSCms-UHC-V.bcmap | Bin 166 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/KSCpc-EUC-H.bcmap | Bin 2024 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/KSCpc-EUC-V.bcmap | Bin 166 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/Katakana.bcmap | Bin 100 -> 0 bytes .../js/libs/pdfjs-1.6.210p1/bcmaps/LICENSE | 36 - .../libs/pdfjs-1.6.210p1/bcmaps/NWP-H.bcmap | Bin 2765 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/NWP-V.bcmap | Bin 252 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/RKSJ-H.bcmap | Bin 534 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/RKSJ-V.bcmap | Bin 170 -> 0 bytes .../libs/pdfjs-1.6.210p1/bcmaps/Roman.bcmap | Bin 96 -> 0 bytes .../bcmaps/UniCNS-UCS2-H.bcmap | Bin 48280 -> 0 bytes .../bcmaps/UniCNS-UCS2-V.bcmap | Bin 156 -> 0 bytes .../bcmaps/UniCNS-UTF16-H.bcmap | Bin 50419 -> 0 bytes .../bcmaps/UniCNS-UTF16-V.bcmap | Bin 156 -> 0 bytes .../bcmaps/UniCNS-UTF32-H.bcmap | Bin 52679 -> 0 bytes .../bcmaps/UniCNS-UTF32-V.bcmap | Bin 160 -> 0 bytes .../bcmaps/UniCNS-UTF8-H.bcmap | Bin 53629 -> 0 bytes .../bcmaps/UniCNS-UTF8-V.bcmap | Bin 157 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/UniGB-UCS2-H.bcmap | Bin 43366 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/UniGB-UCS2-V.bcmap | Bin 193 -> 0 bytes .../bcmaps/UniGB-UTF16-H.bcmap | Bin 44086 -> 0 bytes .../bcmaps/UniGB-UTF16-V.bcmap | Bin 178 -> 0 bytes .../bcmaps/UniGB-UTF32-H.bcmap | Bin 45738 -> 0 bytes .../bcmaps/UniGB-UTF32-V.bcmap | Bin 182 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/UniGB-UTF8-H.bcmap | Bin 46837 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/UniGB-UTF8-V.bcmap | Bin 181 -> 0 bytes .../bcmaps/UniJIS-UCS2-H.bcmap | Bin 25439 -> 0 bytes .../bcmaps/UniJIS-UCS2-HW-H.bcmap | Bin 119 -> 0 bytes .../bcmaps/UniJIS-UCS2-HW-V.bcmap | Bin 680 -> 0 bytes .../bcmaps/UniJIS-UCS2-V.bcmap | Bin 664 -> 0 bytes .../bcmaps/UniJIS-UTF16-H.bcmap | Bin 39443 -> 0 bytes .../bcmaps/UniJIS-UTF16-V.bcmap | Bin 643 -> 0 bytes .../bcmaps/UniJIS-UTF32-H.bcmap | Bin 40539 -> 0 bytes .../bcmaps/UniJIS-UTF32-V.bcmap | Bin 677 -> 0 bytes .../bcmaps/UniJIS-UTF8-H.bcmap | Bin 41695 -> 0 bytes .../bcmaps/UniJIS-UTF8-V.bcmap | Bin 678 -> 0 bytes .../bcmaps/UniJIS2004-UTF16-H.bcmap | Bin 39534 -> 0 bytes .../bcmaps/UniJIS2004-UTF16-V.bcmap | Bin 647 -> 0 bytes .../bcmaps/UniJIS2004-UTF32-H.bcmap | Bin 40630 -> 0 bytes .../bcmaps/UniJIS2004-UTF32-V.bcmap | Bin 681 -> 0 bytes .../bcmaps/UniJIS2004-UTF8-H.bcmap | Bin 41779 -> 0 bytes .../bcmaps/UniJIS2004-UTF8-V.bcmap | Bin 682 -> 0 bytes .../bcmaps/UniJISPro-UCS2-HW-V.bcmap | Bin 705 -> 0 bytes .../bcmaps/UniJISPro-UCS2-V.bcmap | Bin 689 -> 0 bytes .../bcmaps/UniJISPro-UTF8-V.bcmap | Bin 726 -> 0 bytes .../bcmaps/UniJISX0213-UTF32-H.bcmap | Bin 40517 -> 0 bytes .../bcmaps/UniJISX0213-UTF32-V.bcmap | Bin 684 -> 0 bytes .../bcmaps/UniJISX02132004-UTF32-H.bcmap | Bin 40608 -> 0 bytes .../bcmaps/UniJISX02132004-UTF32-V.bcmap | Bin 688 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/UniKS-UCS2-H.bcmap | Bin 25783 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/UniKS-UCS2-V.bcmap | Bin 178 -> 0 bytes .../bcmaps/UniKS-UTF16-H.bcmap | Bin 26327 -> 0 bytes .../bcmaps/UniKS-UTF16-V.bcmap | Bin 164 -> 0 bytes .../bcmaps/UniKS-UTF32-H.bcmap | Bin 26451 -> 0 bytes .../bcmaps/UniKS-UTF32-V.bcmap | Bin 168 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/UniKS-UTF8-H.bcmap | Bin 27790 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/UniKS-UTF8-V.bcmap | Bin 169 -> 0 bytes .../js/libs/pdfjs-1.6.210p1/bcmaps/V.bcmap | Bin 166 -> 0 bytes .../pdfjs-1.6.210p1/bcmaps/WP-Symbol.bcmap | Bin 179 -> 0 bytes .../js/libs/pdfjs-1.6.210p1/compatibility.js | 596 - .../web/public/js/libs/pdfjs-1.6.210p1/pdf.js | 11515 ---- .../js/libs/pdfjs-1.6.210p1/pdf.worker.js | 43512 ---------------- 173 files changed, 55670 deletions(-) delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/.gitattributes delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78-EUC-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78-EUC-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78-RKSJ-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78-RKSJ-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78ms-RKSJ-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78ms-RKSJ-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/83pv-RKSJ-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/90ms-RKSJ-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/90ms-RKSJ-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/90msp-RKSJ-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/90msp-RKSJ-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/90pv-RKSJ-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/90pv-RKSJ-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Add-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Add-RKSJ-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Add-RKSJ-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Add-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-0.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-1.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-2.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-3.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-4.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-5.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-6.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-UCS2.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-GB1-0.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-GB1-1.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-GB1-2.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-GB1-3.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-GB1-4.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-GB1-5.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-GB1-UCS2.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Japan1-0.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Japan1-1.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Japan1-2.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Japan1-3.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Japan1-4.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Japan1-5.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Japan1-6.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Japan1-UCS2.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Korea1-0.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Korea1-1.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Korea1-2.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Korea1-UCS2.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/B5-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/B5-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/B5pc-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/B5pc-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/CNS-EUC-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/CNS-EUC-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/CNS1-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/CNS1-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/CNS2-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/CNS2-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/ETHK-B5-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/ETHK-B5-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/ETen-B5-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/ETen-B5-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/ETenms-B5-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/ETenms-B5-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/EUC-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/EUC-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Ext-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Ext-RKSJ-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Ext-RKSJ-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Ext-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GB-EUC-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GB-EUC-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GB-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GB-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBK-EUC-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBK-EUC-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBK2K-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBK2K-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBKp-EUC-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBKp-EUC-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBT-EUC-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBT-EUC-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBT-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBT-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBTpc-EUC-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBTpc-EUC-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBpc-EUC-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBpc-EUC-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKdla-B5-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKdla-B5-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKdlb-B5-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKdlb-B5-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKgccs-B5-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKgccs-B5-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKm314-B5-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKm314-B5-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKm471-B5-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKm471-B5-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKscs-B5-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKscs-B5-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Hankaku.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Hiragana.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSC-EUC-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSC-EUC-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSC-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSC-Johab-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSC-Johab-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSC-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSCms-UHC-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSCms-UHC-HW-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSCms-UHC-HW-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSCms-UHC-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSCpc-EUC-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSCpc-EUC-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Katakana.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/LICENSE delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/NWP-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/NWP-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/RKSJ-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/RKSJ-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Roman.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniCNS-UCS2-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniCNS-UCS2-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniCNS-UTF16-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniCNS-UTF16-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniCNS-UTF32-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniCNS-UTF32-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniCNS-UTF8-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniCNS-UTF8-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniGB-UCS2-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniGB-UCS2-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniGB-UTF16-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniGB-UTF16-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniGB-UTF32-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniGB-UTF32-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniGB-UTF8-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniGB-UTF8-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UCS2-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UCS2-HW-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UCS2-HW-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UCS2-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UTF16-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UTF16-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UTF32-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UTF32-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UTF8-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UTF8-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS2004-UTF16-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS2004-UTF16-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS2004-UTF32-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS2004-UTF32-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS2004-UTF8-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS2004-UTF8-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJISPro-UCS2-HW-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJISPro-UCS2-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJISPro-UTF8-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJISX0213-UTF32-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJISX0213-UTF32-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJISX02132004-UTF32-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJISX02132004-UTF32-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniKS-UCS2-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniKS-UCS2-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniKS-UTF16-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniKS-UTF16-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniKS-UTF32-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniKS-UTF32-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniKS-UTF8-H.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniKS-UTF8-V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/V.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/WP-Symbol.bcmap delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/compatibility.js delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/pdf.js delete mode 100644 services/web/public/js/libs/pdfjs-1.6.210p1/pdf.worker.js diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/.gitattributes b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/.gitattributes deleted file mode 100644 index 556f8c827b..0000000000 --- a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* binary diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78-EUC-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78-EUC-H.bcmap deleted file mode 100644 index 2655fc70ae706c7ba52a5d647cbfdfad6072c697..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc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ZGvTBnqqsQ~4MXj$I-nYr$%j5iuHDe6<}sNk|Fmn#UW714D_*&efd>yQ_i2~OPOauHUkuj&1aB|`CO7Re_m7mPE89T7)~S$Ht^iY1qXPZcOeCQn{%ODQ~p827A}Bq zPhV(7m(#MC48Fs;m;s(|S=^zLZ$3wVhU)l+Zdlw$)+{y>Wyvm9l2ziFj!tF)!oDx|dspKQGU!)^ENB-zje1rJn-dodCW^Ovqk+2Y7)PjD4}- zg_`Z3H071Z9I(Br0)NB&>I!&q+$#-%Z1586YnMv?MJr#&XtsY-`|DQlQpd7*1_xcs k5om7%Ka{$hiq3Rpxm1<^LpLp-6zwQO#)>TPFtC#SKLc+9MgRZ+ diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78-EUC-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78-EUC-V.bcmap deleted file mode 100644 index f1ed8538287499647d923d7d8f517a00cdac4e3a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 173 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|TVQ!)88tSa;k;uAm5#wHeUdFwF voJ@OznOOFQu?X&sb`)LsaBps_Jp&^YN;1fUS!@iAMpy(B8JB)#+{Xj}Q4TH^ diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78-H.bcmap deleted file mode 100644 index 39e89d3339c74cbe06e7e4f76d60bf3556b0d4b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2379 zcmW+#`CAjo7Cn_tlXOB7KxC0E6;J^M1G0!Hh@b)rDv093(r8qa#RddiM!%k!=Kz6- zAR+9oPaY$vEGl%>eDkNgKjqcDAL=`OZ&%$q=bl@p|JIdvKX}yBe&=qVJEy3~o0aSJ z7P-rAb+`H4^^bb{e4V}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EITTE}BgIn=d0$03mWtG&?rnd!}Qcs=lqQPy}cWK~u&%11Jhy7h0 zxHIZqi%PBz!oOeLb%}c3^^oNEF~IZy;@=nOo`m-oNZR{OvggAt-GdL=2)xNT171=RQ}dVa*r7lYVOePdNhaj=@g8o(E3NgnKlljVh}#;AzFH6fe85 z+KkXeX|)x6uXEL>T5i(x)jojlgLN%g;C_MWfd3Lw)^auF7L8pKT~4>J-N(|6#5K`| z4C@zBFVpqKt(w|Bc=fOlez!{6v#}_vi9QS%Fz7{Bl|Mq@8>Ux`|+@q$AFw7>C4I6kt^o9ex(7TZee#E)apegrh#KtY~qKu7xj5;lw z6#S@jGZVbnvUyY`9W|KBR2?1kz~)J^XS16qTXwNxbkD&pH%Z*8CD`g9t}QVumaS(b z>br%+eNQ0!zUK>nzTZ%-9qr)9#LdU`tKcO`;H6?hPUuI$%fw)uj0Z2*Y!7Ja50N=- z`_Te^#{A|N;KN^GfuPhQ2Wn*@M_1lcm`)(+ff)A06&+uoraMN ZWxHCHd+DL=OQIb$$lQ?y)&e^@{{yR6zuEu* diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78-RKSJ-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78-RKSJ-H.bcmap deleted file mode 100644 index e4167cb51f66c60ef7d9500b450303b5da175574..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2398 zcmW+%X4)d#tmFZT%e3CqAV65xJ4VEnS`dH zL7+EQ*O3^3$f82sn)^Iqy?t_}J*`zImsoz3p0` zy|l8@v3sw>QE9Ke(tX)&Z@Sal=kDya*LQu@-E*_MN9}W8DKXb}blCqN-)rx2_qu!f z|99EscH2w#d|vN5biC;h2nIpOpu(y_p41TXQQ54v6J!szwG#WK!8X-8s5t+0hZO($ zz+kTYO|+EuO)`HR#>Q_Njyu22B+1`iFr|FkYf2fiwA+XBVr)ZoByOlliyd0PkQ@3b zai|SHHAq8U_%RKexlu#6p*NO#0li7^m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+^e)Wj! zJm#Qny$GzTZ2cetMcdZ9!K&pA3)m;}MzSjWrW9}3d9D+&8^<-vZyw7=3s?;{xTZ?V zMi*FZ{5!t9pQgS`2XpOsSFV!Z73aGPn)!Fnr|K!Rk#P zVpQ^n;{1@Rng8$8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|TX>Oq#ygOX=*YO&pO=jMENuV) diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78-V.bcmap deleted file mode 100644 index d7af99b5e2ae9a21d534f1965c35a2b572143322..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 169 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|TVs4@9k;tm3#JJa=mvL_(C)3_w qCYHTnEP{KZ9Yqxr_vW_RGcZD-B!fJd#m3NRgheosQMHtD9}@un{3-|l diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78ms-RKSJ-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78ms-RKSJ-H.bcmap deleted file mode 100644 index 37077d01e26f9ee2427592f6deebb145d628e731..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2651 zcmW+&>su379)3?IlVlPI_nQO=7v(Aj5fH&R7(l=(3boRT!dN4sTpU0UwHkd20)c>B zl5n?bS84?+7Zv6VTibnh{|&dhz3ubte%bx9{j_KMVV?IlGv{}E-`~tRn)fx1_UpYJ z%}rOjtT}~+w!QmpwnA&krS^+XYi)05m$S9gTG{q#d&l+m4yns|Dce}m(qjF6eW$g< z+3D=){{O>Tr_-9f?}JK5*~!{65ZnhL_eHfB%z{z!J&v^D)zC+!d8NaVwML)61g zL)3t&**cIMWF9CbAp^Cit)DM$7idCtX2B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%Bqf72od{@umB%7nU)du4-a)4$4tniK!Z4s}2O>H^f< zf>%zc2ZXhFN&lmWHCD%?8!)bA01G@a*78|hR%q8Q%EFJX#I+{O#FKR+)co*uCS-wa zok@DoynaUFe-eY&FR|Q(NMG*;hRq-wiL&V@7r(*Q95QcYKrPDMIE1N;T^sFCi-k=S z)WgDNq{RI!W^G!TuN}dgCuP&mF4JZM)FaqroQhGKZBR=>U$fyo8vQyJs$_%p#y8C4nD)&zs1>nqWO#C*RvO+0N#s}2{x(`R{_4tjdlqU{;1-+o z<3U@Y7+@NGkg}D6p>$!ZN+SRIFZ$Xg^3M&7R!Zi7i2JsfBI*eQZu7*l9medF&~E2| zd|TfaYk!wYa^GDh$G+R;uzz=vw0xha5&mc)nw>IP_)TP{phU5F>>kQdD2Lc#h@F0t c-la;q-(1!2s=%@!^LOuZa_4*AVfvHif0(Q+AOHXW diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78ms-RKSJ-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/78ms-RKSJ-V.bcmap deleted file mode 100644 index acf23231aea22e1a95761f7eafd35f1d42ea6b84..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 290 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|TZElfUtQ+JV?4|3G$lSPsp*5L- zp*4wtu{9x)to?* z-GEF#OMV%BCslD3bEiU{_ISp9EDQ%Z8TPR=9292Q$H{O|h;bh`!$AqgeS8cDWf=Df PG8~jmWNdF>+$RD6ERIW@ diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/83pv-RKSJ-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/83pv-RKSJ-H.bcmap deleted file mode 100644 index 2359bc529d160857cce4c1d1bfca1322290205c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 905 zcmaiy;cpXl7{{OI+O^wmYtyl`HDmR3WD>!x+fX(zk2fF27#QYSGOjrry9(r-~(pVo1{Nw?mtLYJ4UUE`k0lkkCo*kO1UE(D(}Ha zIX$MVRMvM&ErC!&C=p47ic-|WsE3L1&Ed_Vp)Ij3En2goQt2?lasb+wwgN2;Lt;6| zwA_i2WgTGY5s;UQrFk$;02m7ZCI-O-t-D+~RMwf^W)!C+rc;Y3P7~9a-6+nSV0x#B z;@u~h&i0`=n`3$}i{kw*rgPg+oO_k&gBcVbb~2ssKyiMW>7z*$A19bDw4u20BGV`1 zC_arcUEGA?Vv6arQ52ttm@dgEF74;u%JB9>6;J2#3n;#bF|D?uSWPosc^1W&VWz81 zD6Sr0`f4AFuf2cP{3zC#>6(h-+M*UPR}ZZ3Otn{i7_C0k7_RpF0@Zzp)zK+0oTa^* zw4u^B0>!txwbtKNy55iCdXee70*deZm~JFd+{iNhFpJ{HZA>?}qPRK3^iu}K&mBy+ z6co26nSPl-@oO8??Kq0t<4kv+!-v;5Y52z#{B2@hzN>;4wmsUkBG4YIH)P39qY?Al z&-;u-#D2+V?9k-9C&B0ku;<`WW7q$+Vyxj_#Xjl|yL;UscaO{N)9#?F&dc}K;$|A` ze8QXqy8u=**sp^X2K#uO6#={Gx8h?Bj%vT*Jnrmp`kY>;$4NTfPM79$M&eedr~f9j zS?YYFb5gPx0b5+mtNTAx&)Lh;5 ZujiWNPKIm#2-aGseD|Rg2PkC##Gk&38VCRY diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/90ms-RKSJ-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/90ms-RKSJ-H.bcmap deleted file mode 100644 index af8293829c90ce63cc4c5eda0318003785ffcba1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 721 zcmW-eTTc^l5XJwq#gw8#R@%k}Gf`{k zMMO~)MNz7F#ryrXv0C+m@CEc;pImvE1P@4ZMh0a$e!5_#hJh!c`*BVy;Neh zTkWo5mpv{y40IUiYAY)$v->KYl_e^qm8H6=e}1|X^yMOVNa&R!*CX^Qk?RA!TI52Y zyG8CW=pK;^oAnw)aZ=<>{nqqplU^rs@wxhDkvt)i10n@xy-}nD=&hzZk)D1k^M|e31e5HzTtO9tf zi|}eE@HH3Vcq#Dse!}Z*z&9L(6AOSR{De1Kfp6IfCvCu!&9pYVV^v4ixO00S@Es@N z)I#8?0O8%;!1sy>@6Q9izmxDmBk)5D;iCfJN2E$w1*a9@=~D-cn9ek)@cWNQhE@3W zR*W>Mt{DX%Gw_p*giq^$pT-HF#ekpJ629;PzX%h)3<1A#6TYqnejOxy(+&K#g7BRT z{H~MmeLL`nQo@gmfIqeoe%cG=pBD)D)}AcI{0gYeAA%j u^{--}Rd*VGj9%#5gucOu!1#H2euZlOd%88>EDV>zJ*#d2{xOGaKc#=yUE^>7 diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/90ms-RKSJ-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/90ms-RKSJ-V.bcmap deleted file mode 100644 index 780549de19de05b6cbea4ccd4737351bc9ff6104..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 290 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|TZE28OtQ+JV?4|3G$lSPsp*5L- zp*4wtu{9x)to?* z-GEF#OMV%BCslD3bEiU{_ISp9EDQ%Z8TPR=9292Q$H{O|h;bh`!$AqgeS8cDWf=Df PG8~jmWNdF>+$RD6C)7)p diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/90msp-RKSJ-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/90msp-RKSJ-H.bcmap deleted file mode 100644 index bfd3119c62d9976dde9b1e59c572c678cf5811a0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 715 zcmW-eTTc^l5XJw~VoNEO2&Pqmx?BQ85Gy1Kg5&B40vb?if-xX2vLIS5w2cHZ5is;3 zUQoQDs8tjNMNzzg8>r(=1dvVfUk4O5y@0Wb4U-e!1H*~A2RJ`p_EmhUK zs|1K40Wc(gs}%5L55S7NSSf+n3@1T40ZQtSjKh6U6fCovgKDBFc+P4I2F&J=F+qf^ zjh0Zdd1J_~mn)$$R9BDTOt6QW6CGiHq9bDMk|H@Nw#a^17jYkvhNEA18d6O*i_N*t zY3nuEb+qf~Y|2Q9qDB-#>D2`>}yh(Xyh zBIC#a@D(JyS^<2upYU2Q@bw*pqou&3KEfMb;G4ySV}-zDX9#a~0^iOfypscbr;YG# zEATxh;dnam_;JGfO~4QAgcE7N6ODuq8-O3#2p?O4AJ`z>C7g2s&v^;od4S&+63!O@&vz1jXb1k7L-e=3qL;^Px1}0SA^g5iYfXXF1DY`JMrWSXGZ@Ro2m> pIdngIFSLC^+oeaK|2#XMub5T`8{&0BcPR@0tE+*R*O2w6;V*K+;HLlp diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/90msp-RKSJ-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/90msp-RKSJ-V.bcmap deleted file mode 100644 index 25ef14ab4af42f4b70ccac76cddac8f3b22d8813..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 291 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|TV`-3ET%a4|9qgs+k;vS*f}u5; zfuS{tfw46qk*(2@aj!owG3?DvWNLI~IN-y;a3IK0v~kS= zzs90gM@9w+lw^69KH^V^*#(jJY2W1%d Q2{Ig%O=N6uVB9AH0G^~w2LJ#7 diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/90pv-RKSJ-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/90pv-RKSJ-H.bcm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#5jfBX6&}f#u@B(W49ftwevY`QZfP4^1i`2PSF56W5q diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Add-RKSJ-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Add-RKSJ-H.bcmap deleted file mode 100644 index a3065e441a0e1f1a65e9109ec9bc4f826fccac24..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2413 zcmW+&Yg<#t7JgTDc9NYyAOwPxTexVs69h$s#!VxNsHort6_ss`c;R9I;draTQz>^5 zB-}yKw$@sywYJqgd*Ivo8$RvnH=n29&!;oze3<>NJu~k+Yt~xN%$Pnj1Uj$X=(^l` zsmEJVQQ<4x>ho22t1on(4|*GKboT_?yS@85zUb__*4d@?1TPfXtJ~VV|DWIO?Fx1W zyL$iE*%%CZi;55I3)Iv%)_~9tqJGt=0zKYE^g(@B;gL7U}%yTf_E$7&sr%ouPqC<9T}qydj;K6ArB9ZcM_-~V+gdA@G8C4Sv)OB{4u z_6}ynI0tu=Yq0T%_p6on<)%1`Q*oxb(wu!Jk1##LOgoVhlj5w&PRx$0HVv)}2JzSN zQ1svv=U^*%l69~TdPB(&pf}P`DflNC+7A7wb!Z3lV>DD9iXKvJLjmZ=twRUFlQDE0 z`U%re6L^Ygs2TbxX{ZJI>6D?Mm>RYZo1ix*4LhNq!Ei40vt`5i(9g-k8hEN}_!9IM zY50~V4XYTwD^@*^su2oB4~Oj|e&`o0BX!V&@<;>pi`gS5p|>g{ccEYMjM|}J-ZYx2 z$s?*VS}B-U;2zy0@G84aeD1G1$MURD}9&~}3tu@a#Q3Iv5M$O zJ6L5#P#irE@kEvn2MPoShY0M3Kl4uX$!?oshCX$ z+bzweg4M{gnP7V?v$%d<}SB-25@H^Xc=K z!7kVq?4jss6$@@+LHmM`Xr%?Qp-Z%|8SJvMAbh_PwNMInHFlvoUaZsPh-zItBz)_Fcdl88sIc}ZlZkCxiN{^3~?b$kQMRV{XI5?o@L1T7Pm%NSb#gtCY1@-Ts(Dhc*=LS`-4+SEBY}OH z0Cu;74B7)jih*Ia!jSJtFf8In(WIIGfEV5qnJel6FAgd5s&h3ShTXQB4Z{(&S_JNk zU#)@>jnxJ*9Ja4E!f=9@l&!YFhymZa`Dr3}sq3j_@0!2!dQ2P3h+07jA+PS(r|v*2atiEq1C2VUOq z1K$x+R>JuHE_lWM7lN8+}oo?e^C7|Zd2S3l@#;CAu9i& zh0+CEa& z_S2@dK8#}NwGW2R`g$9T zlFhIEFiK-z2f=swUiWFz$GsQ;aQ~)gH?)+$RR7O8l=^ckee%X)^1aC-=bK}J*f$rb z;7u>dzhu$5U-Bsats_wI)=RN(>uJl|a}@WhmDFF81O8u|ss6WQD){Ycp#1kuB>#Sd z@_s)-(eEUReHTZ?@3I5M?~au$E;rrIsR73IE0M@*l19U hBiJ~FjYe!VVdI#~IGtd0&_=Ch`g=^e-y*oZ{{`ID*(m@3 diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Add-RKSJ-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Add-RKSJ-V.bcmap deleted file mode 100644 index 040014cfc0880371c20a89212942727c5dc30a78..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 287 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T<(QJ98{{4ArR$N%-RQ`;*Pnsm zfDaG{aWn1>~Fdm56S{nsR6Mn5Gw+)3Jb$Qmev}EgS-IcxJ}{! diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Add-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Add-V.bcmap deleted file mode 100644 index 2f816d320f08b8671498299c4d00e4564d2ece6c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 282 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T>X?$E>ygNGht``8&6_OUQ99OMMjtU#KJf$^YlAa{AfKF&6QHh#7?i8gWe mHX)Wa;Wmy$_VR4TgR($XYCxDx8|p%l=LmHM8lDo74dk4_$_P(g(w!-Hg>R!685l< z1014^3aY5#2*)_VDe5@GIWEvZ6D?e#jSjAGjT_wJ4)^Hd0grgXGhWccE8ft@07Hy0 T#ycjM;sc-f!Z&`z(oFmT7oB|o diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-1.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-1.bcmap deleted file mode 100644 index 03a501477c91d8156723f0c274a37d397ed65bad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 371 zcmW;IQAa~@7{~FmUG^&eZ(!@RyK_0)E=Ic8c?GTgwb(lAe~#GII?0+zl4K@HGLs}p zW|AaHlF3YxOp+u?l9{CMiRbhDcsy4>e>V}aa(Oi|o_55LVd#O7t{WnpvXWAmdE1d$ zTf`^FES0m=s3TLsfp8`x{{L;Eq%GC7cQmCG!NK8pBsOBkd_GNc=L=I&qQJ~z4n>qu z#sU_xgk`K?6%|ymhIMRU6I-aEj&1B<7kk*p0S?hX6Gu442~Kf_b6nsOSGYzCH)x}S qTioFu59s0%Pk6=)Uh#%^eBcvb_(l(X{NNYvjJLc7T(1JRsQm#8LY3P9 diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-2.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-2.bcmap deleted file mode 100644 index 2aa95141f9f5802818e34b0aa626e34e7cfee805..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 376 zcmW;I(MLmJ7{~FmF8eFqf1vHu-MQP$xfto9^A}WmtyrDyJxAWRfH^ z$xM>WB$*^hCP|WHk|gPS;`uy39?#XUt34QZGdVSu8udl5WtlyFrfG>-(jAt<$$7pU z_e5f1#8nwr4f!$|?vAC?;{V?hN_tXF21iFq5svgH;`V@JheC#-XY*N`$TL%z#te#> z!#ozSh$SqegcYn}4eQvzCbqDRGIp?wJ?!HE6;yGEBh*mGF-~xbGc?e|IWBOC7OrrO s8{Fa!_h{n*k9fi}Uhs-HyrY8;eBuk=_`xr9Ay`2JI;cR?K~xuwKLRC}r~m)} diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-3.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-3.bcmap deleted file mode 100644 index 86d8b8c79cfa3907281aa3f25a46f178b87aedfa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 401 zcmW;IK`TU26u|K}mcGN({Q|~g_m$`K@18oH)xWONo(l2>)7#w>sV2{J8=76$Q^{=5sg+*{Bi$FO zOn+Bk@`34ybT(0+%;nVoeW;8MwHdTaUu%_UY|W(7ZGJiya~zo}4zw_eykU%>gi(xP z921yC8Pk}-Eaote1uS9-%UHoG*07EZY+?)B*ugILu#W>A;t0n$!70vgjtgAk3fH*7 zE$(oS2UPHgDr$JbGhXnDH@xEmpZLNze((z!vY#y=Hi6g%Vk3yHAU1>84nl~yl$}3x CU7_Cq diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-4.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-4.bcmap deleted file mode 100644 index f50fc6c14e67a228c4ba9a61b1357c16410e8228..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 405 zcmW;IK`TU26u|K}mexMN{Q|~g_m#NRlK?k|s%# zBuSDaNs^>Vk|arzB>7);fA`estp0Vij%1K8n7*FgNHu$&+t}i|o=RkbF0K4R80r2{ zrE}eZ$p@x0(wTUDBAZqJ_n|U6)Mn5weXUizsV$vMwfm`9%yDG8IMB){@`f>jQH)_6 z6PUylN+@FnvzWs?7O;pVETe)ItYQsStYZV4*upk;u!}wH;{b;^!ZA*8iZh(!0++bL zHEwW=JJfKG2Rz~l&v?Nr-tdkOeBuk=_`xq^$bPnf*aTu5h>ak&g4hgVJBSS-C8t5k F&L0K8qip~H diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-5.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-5.bcmap deleted file mode 100644 index 6caf4a83146a60a2db652647b9cfed5fb71bd97c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 406 zcmW;IK`TU26u|K}mNve^{Q|~g_mN!#-X5)|zBpQ#PGx_A`luPwPmMBxy;KBx#c*Ns=T< zk|arzv`LaANs=W0qwepXI-RF~O|>;06pCSYXIE?*JkPCbbY0J+azVQ_eldz|Ph_&a z9YI(K!nWAvlC`OP-u&N3CbW?a`*rDCYm)WN*>tAG&m-sM?B#fFL=cp-tmD?eBm2E_=ODUrv*e4h&B+7AX-5*gJ=iQ5JCxG%FZ9F CgrqG1 diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-UCS2.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-CNS1-UCS2.bcmap deleted file mode 100644 index 69d79a2c2c2b00207ab27b68ebf4404aa17c6f2c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 41193 zcma&OXJ z`{`F-QDack{`^`~zvZ^T=U9V<4Kip68`6N|SNuE#IDaA)KC zvv=aBSD(7IzIJQ<+Q#+8f_P$OCH|k!zY|}-e&_o7=HqW(xPCoeXdXTN#L2M>CyyMV zDElWb5|*NV@*h{NDTRZWq3jVi5g_$#sLH+mSCoBnD zy-#San_>qYoT)DsG+(wvjBHgi0hwe{hV>e#%jjBvh zs^de4PyU!JS*Bk-T>sh&nCqqW2?!d5;+1Wb+nF~w8+qZCGD3=xw`QdW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q;3qw?}mf<-L?I8B9q+EoQ~OvtHps9&CB! zwyP-Hl)rR+n%~Z9{dQe54T~;gH66xw=ze-y{k1}5UhU^&qt>mkvp|L0&8jL4ipWZuvtZy@qc zV`;~370yBUPBY=RGJfb}sMgM8qM=7WBh><98?eUek1HxV*xs6UmVIlG@EG7XcULkhyBo@I3nOB^69E z(f*wdV^qx+Y||<_mZA{yj$0{0Ix*IT9`s=VLm0srCNPB=%wYjbSiu@Lu!SA$;Q&WC R!5J=ag&W-A0Z)>CkuT=vPT>Fm diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-GB1-1.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-GB1-1.bcmap deleted file mode 100644 index 707bb1065c76d69551c287141cb258519132ef8e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 250 zcmW;C!HPjq0LJmd(o>ur8(emGDOo64xKA)R4P{);y(uf1rfHfqO`0Z2k|asfBuSDa zNgD6qQRYv5zs=X*d(Fh{N?jKp3$BcqrV)%9hACrtJFBEscU<-4$YeQZ>x!)(T$K;` zVx^M2_m0%cQMz_JEu~~AoJz(MX)EFJ2ytmt{X#Sw>=`e3#T(wy!UsOl#uvWPK^Hyr kF~ATbj4{C!GyLEeb1bmL3Ttez#SVKMaKs5`(G2{Fe=CDsrT_o{ diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-GB1-2.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-GB1-2.bcmap deleted file mode 100644 index f7648cc3ff02c44e9594ccbd71deec742e253c2f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 465 zcmW;IK`TU26u|K}mOjP(0>)!E%W0a$lq|f3HRgsI^TvBGHLGzXNs=TL-VlZ{f>DfN z921zt6s9qQS&{5KST4 dLNtbG4bdE;Jw$_u77-d=%W0a$lq7Fsi@BkOH{N@xS&bt}k|arzBx%w#BuSDa zNs=TU}~*Hl|me!dX&bah9j!F3aLjfsS7l3BmQ8m|yWwl_4H zzD_^L`$2nTv+>$wE@%GlLlfB01_QeEtTplarc5f`?4@Hd$C0&Se;cF78^SO~Fp4pZ zV*-4l~8|5gz6Tq;Wr6vm{3v&eie4&Qnn@L%5OOhl>k|arzBuSDaNs=T< zlB5Yqk|arzT(^3E?^93D>MAPKr?QAtrsV)XL*F@Qk~ zVHhJA#Tdphfk{kZ8Z(&19OkirMJ!<%D_F%E*0F(2Y+)Na*u@_9aezY{;TR`4#Tm|V zflFNB8aKE_0e5)7BcAY#7rf#P@A$wczVMA7{6c;HTtH4BH;^O9732(Z2RVdXLQWyK zkYmU-4m-=_tMvz_6R8WHFJ2IRbyaP#C_M$ZFh@BuSDaNs=TCWD$wYeo5lqC}J;_`Sr5mYp#8^R#fo5_alnIPHG zn2tKrQGGUSDk-XHYYYDGGeHz)!l>KJR2T*&r8UXQs@halK|w60mt0p5BggB<00uFH zVT@oDV;IK-CNYI+%wQICn8yMZv4mx;U=?dv#|AdBg>CF$7kk*p0S|+(wQg*OBwcedIuLAvuxUNRA{|k~7Jj ijwRQUbIHBrU~(}zncPf{rl(l7o@0OOeg}^L diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-GB1-UCS2.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-GB1-UCS2.bcmap deleted file mode 100644 index 7586525936cc5398b86d3752a4eb45b15825b25c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33974 zcmbSyg#^~;Dq`SLCNL%sw+i2N{zNG!^ z$?Yk$5++TC7EIHnbl@j zL>j^%M!o;^j0oPervI<+6Q?2wVGh2R4+reFD~3GkG$FYsWlU|O`ryo7Cx}AGcZY)y zxsPa^R$VF>bccxgAnSh6i^M5Kw40o9+-AI+wOSW<^;T!D3K)+#RruRmSh72~5X)V# z-T|%ochcM4uxZZv7+gyHqKeh!_-lLDY)7n!H8Eo%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{3D<>_0hO&_ z9a{PhpkIr;$(TNF3DzW8eGg0DQ_}Z>^t~Z{??~VKy6+?D`^@h9;?&YL*N66fEB=1& z&-CA`?-tk?-XBu zFZwrA&TXW5cGG`1>4$VkKO2qymyy3o-jB&g5BGnq!uo$uo`Dc$2BI7pm}B%niZKJ5 zc;mW5>w!JsYGi!LK$Efu2;c@fl{L^M)&L9Nz|WznXW&lgdw~1lKSKI<&`*;W4>s^J z^y|>?^JbQrJix8Pz&F}EsEiDT8+$NDyn`1h8N5_EgGt63oUg1w7Qw+~Vg~VCgBidE zk-=PeThIDZzqAI6%wU-_SRsP}8En;q?RxNp4E9@tr%nw|3)A1TUHX2w=bq1Sy#@Hq;EoX5`H6TrqY*9R3k6D z;cUp-eo3s+iS?4$i4R_!_{`a9>tykCHF5fq zK=AZkf!ND=Y%mx!L;Gh83*^tZAW(IM6{wnN4WDJLnKf$Dtm2SaFHD&A&bHaUz=+wq zuAbu$%$c(?du~w4+~P@d-wjk<84{?P2h0yyvLGZdW5L?wt3m^bS7imN77n}k>S1M9 z&oo!xKJn^bO~3lDfrX2P&t3Ftpz4~)D;7r%U%WgpZE<$+wNci!39GK1IPBU3{2Aib zK-H3%$=AhPcHI)WuF_n0@N95V-tg-h^>uwCuDfCTb@v6TmW~TlT|aKsvT@^=RqR-H tdgSt$%H>m?uYcr|HMtjvN~!GAq^@i6l&0y_aCw1ICy+j?Nov=NTzFjMedelBqgti^UQ)p% z6V2c0FhV<`$D@30Xgq!nUq=s*{G(1!sGVFY8Cz!YXMhXpKQ1#8&A7Iv_Q U103N5XSl!>Zg7VOJW1|FzIH}ZoB#j- diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Japan1-1.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Japan1-1.bcmap deleted file mode 100644 index dad42c5ad7dad57954fc9a051ee7e222e83bee45..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 226 zcmW;C(F(y(0LJk%m!9Idac9QeF4x+{N-pdPuoG%*&RJ?#Ymy{Mk|arzBuSDai8t{m zKI;43eEnmeg6?_&uT`o(&8Vu9$|{OVHQOyQY6Ze)bwSNW+2x+gi$1gExaK(Y-wVo_ zV7&D^Eyk#v&Y8NAw+u-lghV0Mh7NS02Ynd85JoVD2~1%Ib6CI`GD7x@CoEK=wI diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Japan1-2.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Japan1-2.bcmap deleted file mode 100644 index 090819a064533f20aa68f562275556397683ae81..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 233 zcmW;C!HPjq0LJmd(q>-alr^r|-KAuqWZ^!6;WQL3=iZc+NRl*3(xgd}BuSbiNs@RE zkK#{#zs=X*`$$FYa!u#IbFK`VrV;ow3{yt3_Lq`Y&2d%Hk?~T-)@56#U6l>`B87r{ z_m0%cQM&p%Eu~~Il!!-TNh{{@2yw4h{6aM9tce!d=%9-pe$dANLyYi?G5#>Y6f?}R Zz!EF0vB4Jq*kO+YjyU0r3$EhhCY~ULRonmo diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Japan1-3.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Japan1-3.bcmap deleted file mode 100644 index 087dfc155860e65d2dc828dd432ffe88239fde23..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 242 zcmW;C!Ab&A0EOW@?&>M-#%1H=ZkB`0VnAFpPf*Pzg~>bJ83I>gL_|b{h=@pth)9G) zNJNB)MCe=iDE;OXBS?d4* diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Japan1-4.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Japan1-4.bcmap deleted file mode 100644 index 46aa9bffe576e9a8b714646aed7f9e1a4e99dfe2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 337 zcmW;CQAa~z0LJlmyWFREzd-BM-MQ#uW*1|2(fI_`UM;qr?LEiX)ig;aNs=U)B$;HA zWRlEGW+pQ;NhZlmk|cH4fARco9)Is(HfX1FdTBB4$|=({CZ-L;l!2H%ucVc8T$OZW zIJIEww5{h{74!Q7iG=*`9jTS0bas4NN=g4@BpeJyt&qnf#BV+`BgAr^6|jO;tf7c? zY+w^x*v1Zav4?#epoBvl;TR_<;}mD8;2amY#1*Qz#tm*!Lmds=p@|mSxJL(F^w7rx a9`S?$p7DZL3^BqR-tmD?eBoPIKjIHvDu)yR diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Japan1-5.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Japan1-5.bcmap deleted file mode 100644 index 5b4b65cc6292a5ba7d89e976565bf08814bb88b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 430 zcmW;IK`TU26u|K}mOjP(0>)!E%W0a$lq7F!gSnxGH{N@xS&bt}k|ar*hNMZ7BuSDa zNs=TU}~*Hl|me!dX&bah9jA(3$F8eKPGl3BmQ8m|yWwl_4H zzD_^L`$2nTv+>$wE@%GlLlfB01_QeEtTplarc5f`?4@Hd$C3GBe+#3?8^SO~Fp4pZ zV*-o?x9UIuh7Phg2UF=~W2ROtLj&XuhoZ%c7xWpB% zaf4gjp^AGv;1N%F#tUBYhIf466JPko4}Kwo`e^~t1fmT@BZyWI%^=!AG=yjg(G;RB OL}Q57kdo6TW#IUmUh0u{Q}0Yo8>gkVoDZfX@$9=hCA+^)U3u|k|arzBuSDaX&RCw zNs=TF0|AGX#{mv;gkzlG6lXZc z1uk)gYuw-#ceuv`9`S@{yx5fKp)5fBlPB1NPWyY|V< zc$mZiah|nmt+sV;Z5?{;Tx$nw=fT?E+tJSccGM2Hz3=nC@AJI>FVSSLJ@3!jXYaMw zUh7cr z0r8EI`1Jw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1a1820..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 241 zcmW;CK}*750LJlm9s3mT#ba}M+i{E?2I0Ydf^;t$thU~bV5eb3M1+Wlh=_;<6+}yI|M2!7c7^j|X(nMGt)pFvJLB jOfba^k9fi}Uhs-HyyF9NeBuk=Sl|as{9=Vak*&o)>2O)q diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Korea1-1.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Korea1-1.bcmap deleted file mode 100644 index 11ffa36df8404ab970df2a24b2d80b1dc6348436..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 386 zcmW;IVMjwz7{KwnUhY$zFR*p%-F-PT8QF{OC#ZI;vURs}uh^?~l4MqrBuSDalO#zd zNs=Ts!7SO2zVPu$BF)nH~I5FL(VM>=iW5wWz_Cxu(|1DW$h za=719c~A8QG93-avRUze?+Yb;sYcAwl~P38yOZ%m%1wkqmZhgkg)T;kH->RcU=n3i zFpU|^Vh;0Iz#^8gj1{b64eQuI6`RR!J?x`~103QA$2h?$&Tx(kT;dAXxWO&% wP)7szXyO5nc)~MUc)=^)@Qx3B;tSvS!7ucv`Ah+A5@^#vn+Tc;L%L%90TF_m@Bjb+ diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Korea1-2.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Adobe-Korea1-2.bcmap deleted file mode 100644 index 3172308c79d57147cdbe05930228043faa48ca54..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 391 zcmW;IVMjwz7{KwnUiK-@7ihcd-F-PTHqwjkCur@cSi9S~SM1d~NhVoIk|arz%*-T{ zBuSDa$t1}nNs=Ts!7SO1Q7U);+V)$rg@Afk?AcXivgBVrjZErnb313BW0 zRBpgic~A8RG868MWwYY{-WN*xQjMCWE2RiWdQ$O3ubT*kEKARn3Q0zZH;xH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ncp%Z!jJ7L^+tsbSMnvP$ARdWR%0|tZxM6ND$MJEhyibn2!3R z9L;4qwiM-Zvz>>~PHg#zLJtpwzN<`^W z4Y(1EawDJVW&+Ah)r?>BFsWPpXy+;j=~j#EcH*p_ILPZsV7jG4xwV?9*NE$S%K&;c z&~BTVZm&eS7U4TXs^$F*3x_r^4b|YBVS=3Dbf%}lXnvXxFtz}6BjHRVCX|sX_I;KM zFuVdHo|R(c=mLO&0*D-0FN3tHV9=(lOjDas{t9QDo(V8zfxzhql8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T;$*7pk;t>qo8groAH!>XMuyjh f42+FTOpJ|eK+FZid_XJ }}!1;lb046pnFxKb%J diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/B5pc-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/B5pc-H.bcmap deleted file mode 100644 index ce0013167f852a873b639e301088c094d468a750..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1099 zcmW-g`%~0q6vodN6a}qhlS>5pun5Mq5J!##vdM@Bf}@NT7m;gd^fxrqTR%L%JoC!)l4};NoKa|MO+K-CAa~m;Yy` zTdjJ8G1Z)yv?e_XG;o5ZH6}Pa2(*7(bPX13xi0#9ng;QCPDf*cZvnXeZG=E4V1^R` zoRvxy;O4Ai+72k&S1{ECpkGb4=2BAudTmq=)uyA=8JOxyQ9dy;?RWuYM=I0Kr6@a# zm_A*FvdfKWmj&gsAg0|K%I*ZFJ®2-Ds;%-*{dpuU>v^DLBo-c0)(C|^V~)q7$@ z{aT1<0Hy{bN<#_Lm#HZG=P~UsLiy@7rUPy$2a=c$2B93xXF8OCa!B3vwV)jKXF9wU zz5g(KznM_BQqZ}<``gR@4u?0-WN-(%F9AX;RGaa9ga(p$@iBOaih3t7U8K5x( z!cJ~LIW>#vR6fe-K&I2xDBlrNlRvsQZG!Zs_nFSbV(6JFfF>(MH3zZYoCyKVmFUyr z4bWm#ih#tHNcL)R05n%X$XO4Rvr$av7NDFerWB1l#fLaIWt>s{7^F{x*Fn~56 z2yaUP&$bGt^X|C*e2VhQ!L5A}Q~MH>b_>(@D^V_JOc!!cE-L@xHk2RYm@d77a%lro zM+{2GM@&B|SeF&7%L>*{3f2_`>xzPPRl&NdVEwFMT~n~GS#W7*5I}bZEbB~TQ!#G>3#<@hBFz@ zM%>t20?@00cFW9kYcD~&Idml6XmW^`%Ri^t@ zD8IkS^uQbCftv9!8s(v#>5sK2k6vPWv<0=k*I`qik>BW_2Xp&XCjAQLV+HeZA^Qy^ zL(o7zrVY9Q^hLn@K~;vq0(@&o6}_Kf@lX!aP&LjSCde30VR{mP<|o+zV++AB63jGW zLK&%Kucw&+!>b_VX)%V5E(93JgQ!tr9Q_dHjClb}%IsOxnO}JO%^D zQz35L#>*$dzIW`GnjFD7QmDR{H8-t vrdKjO(@~zOJ)g&;Jm1DKe{F<0GX}&NKY$rerFbPXc+3#E&b*VWK6&oH7Gi0w diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/B5pc-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/B5pc-V.bcmap deleted file mode 100644 index 73b99ff2fbca40e7ca5501f61e3f2f29c1fc1af6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 144 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T=44ustm~1;v(TI2l^-9&YkfwB h*M71;l(nECj@2Kr98sav2P-`~e{wDhU7p diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/CNS-EUC-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/CNS-EUC-H.bcmap deleted file mode 100644 index 61d1d0cb001dd484630e52eb7e47eaabbdee62cd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1780 zcmeIy+gDU&9LDkA-kV{N7%VIoIuhGKu~2XrO+`8pQjuoF2qrneFl_OF49p-n=(4rp z-2+WBSyWb*wJk$C%#4~H6s;_^QahLCDe_RpU(xgP!rQ!QtuDIxto6R@z54FG9(lO3 z)ZZEktY})^t`-&*IrCjkXOUXc=x@+ecPQAdtq!W?Ek1vs)gSP-YmEh|CC$z1)%QU) zpar!+2Vc51O)Z$dpuDtfp}UME(n(RGrfKT?Jl%&K*Oa8ISE@wWBNg?MT02tVv+_HS zPj`6q65WyCovl}Tx*ygZ^LwUBa!;r3%Pa+^P)YbG<|i>x5{)Dr6l*1sLt+_;5XII=qKm{NMXV<=Sutdab&!!vB3Cj} zBqL20Q)DAu5_uHsRE!ETsz^*zjA|13$wm#uQx(HY@w6mEqqt2mR#Lb+XpfpZOiOq% zg=;C?Ac+EN*hg`f9A2gLc2FWi?(ItI-H_5}p~M(UWGa25DKX9xNuga$)<`-DCq?XX zL{<97k|`G=D!S4IO9+lYu-d_s#&IKQ2G9BQSW&+^53h;da_#us134VMK{FDoRPGTCsFZY6z zw=(O&sT%O>9B_Ip(+BSGeC5?)Mk^<&5Nct^c?LZLa_74z$_-g%xPCUH1lfi~k>h>l%Q+0o(|0 ALjV8( diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/CNS-EUC-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/CNS-EUC-V.bcmap deleted file mode 100644 index 1a393a51e079d1b5e7898423463fac5e87170da2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1920 zcmeIy`%_eP7{~GFoWo_^SS+j^bOnx!Vxi!&+J)#M5fy1jtYA?KEX#@)WZ7K=7a5uZ z-?Pvrt3_pHS%)&T%d&RQ=w_*1?0&x)S(fcz(dXG8`k9%gnSN;Inb*wu&hyjz%sk3W zeU-mE9NgTosYfjDp%s%u@69_ddT88nTiQ(_(^a+T4!l$f6$HPPXY%xE?V2SsgiR8_{TB+8Vr z0`s0Cd3<}w5;G1NG`*6>chK}IX*`_1*CX$%pyRD{GDqIOQ<@+;Fh`nn(kY8q!}d`_ z70%%nw{U58w_XM!bD3>mWDOX-2;7;;ptL($1@2nJ+yQpE!B_=|&1d?+?gp@DCAj-M z#t-hnzj2Q*1NY8hI>3F^;Qm6eS7KVg16P6vZA=(Ev;pk97(6_W34lk|f&C@m(Q}y1 z;IZq0u>?#gj0Ze^HFzSA*$EEZ3ZA?aOkTi*z`>irp%vgM3$qnGT?3w33Z6}8yqdi@ zUO9B4!5#0!_tcFbaUnRI!L)UUWP%#P@7xMc6WB24|Xx8 zY35Ho20e9rXrB%2sdE||WmzF8D zqL^bn7bOfE!Cp|rMG$>}M-|Zz=*<^{kS$U~2(ra_!hozx5jVl=kGhX&4r>6cYhaBq zY<5~<$ojc8p`_*^SH@F|d8s=ED-Ot&L#{$uDTQ36BV7PL#+>OAKp&*tJgq9L2LW4^ z)#{?PI-Z$}x*9atYlF-!*gM8D3CBi=Z+5`1VfbCfx0cv8z)m6C^}`=msN=MzqCYvL zV~{Eot%Ox7nIcj>#7YBk&nYp8bSH6NliVd9=)`IV@vu^|Ks@Rr*4l{2`y~-#ohH#U zO~jKz$r$mpi+EN;Y%s|X@%$w5!YxS8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T=Ij@2sOyo)qo~91%8!qshLNF; gfw7T^iLsFlh`E564~T_;SPY1zfLN|EgW;7w0IZHEdH?_b diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/CNS2-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/CNS2-H.bcmap deleted file mode 100644 index c89b3527fe57ad3b32061f36b73c756ead3fb071..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 504 zcmW;IX)8ow0L5`6Ns=T<(sPF-F)m3)lCgy(%}A1wWv;C;ce;0)jHG-a`#Sc0-}im& z!>4eLH@_FB^Xebsx0I?buh!Gm?H1W4lbo3&%O+vAtL=)gdUdzbr;93QhpM?$twYNk~HkIwOJ&|HsTmI*hZ_tSQ;1)BX%%R z0wx6+0#nUkx&X|?6AzfJ2Xi@KKAJdzuLdlngT-*t36{#hvH`3FkruF82-XrvKUi-7 z8@XUJhPc31E!fTgI}xNC>{fui6tEvcTERgPI7}o1;HVKC=Yf-0qJh&oaApMOk)#(~ zRD#P?a1~10!F4gXNg{*bwh7$jgZnt*1`ihSD1)ac!hX-}_riXD_VcsfEBn2%-y8eA dv)>2%eX`#t`+c$BH~R(HFTj33=$HJP{s+tZ#wGv& diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/CNS2-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/CNS2-V.bcmap deleted file mode 100644 index 7588cec83e..0000000000 --- a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/CNS2-V.bcmap +++ /dev/null @@ -1,3 +0,0 @@ -àRCopyright 1990-2009 Adobe Systems Incorporated. -All rights reserved. -See ./LICENSEáCNS2-H \ No newline at end of file diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/ETHK-B5-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/ETHK-B5-H.bcmap deleted file mode 100644 index cb29415de4f5a669c1b47e34ab889b5fdee6e428..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4426 zcmZ8jd017~wcqQUbI(0@gnJof^0EP$L0i(lkxy<~6TPo1_^uzO+wUa5j;_uH*afedpVYwe}kJTEDgS<_ce} zC~Dl<+O%~`U5hJs+O(XkyquhAE>_dHvDQ`A+T2px(CnJOV^d?(&c>$dmfD(0W>#PC zdSu`1YN~CnZQ7%6metm}CS@<0UsSxLte61d1fYEmA5vXF#sd?Bhuw)s^DIPUw&2!h z%2|fe(GvZWy~3*!m!D{EK0Yz;xkEeJckX!F8QzubFF#S}aST*2W3chFI^KGGv2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Qj@0ozcJ$VROPXT7oqvCk|aldPWGcoF9;&+ppmV8a8}FSY0q>oOnD?p~ zND5^n#h7Gose-=qO=!2oisCBWq|%6DmA+T4o75PQ)Gb2N;6Tz8hGhRFBu7x&2dM2c zI0fFP*hSuFrO1WPm3UvYuEkfL_l=ivF9{>}r6Q7j>5`N8WZzN) zie(1mD)Bz`;p@fwG!yP^;Fw!q9oFBs9qaFF%0aPJ_dA4z^aDEgi-N%W4VX;7Nf#~X z+;7J){h@KF2wQ>NIDGm0W8H^k-k*cW^go94)<6Bja)Ad*h{8MK5bBN;oPv%l$;1bo VUn5lgC0;DLe}&hDRI?#j{~y^L&k+Cs diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/ETHK-B5-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/ETHK-B5-V.bcmap deleted file mode 100644 index f09aec6318dbec88491e3e488526882eaa930f37..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 158 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T=^EnUt?Oi}>ygN@FqW~AiHWh1 w4T!mbm=B1BfLIKOrGQv2k!7Jb!z({NhS&Ox46h9v*%)5=Co&#;!uU=Q09TwZ8~^|S diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/ETen-B5-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/ETen-B5-H.bcmap deleted file mode 100644 index c2d77462d298cdb261f5e2eed5218fcba35cbe4e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1125 zcmW-g`&ZOe6vfY1bQH7_;w1qNhb4%_41%&6h$BY=Az6ZfV9H5>nS>Pr!NhA>tPy-< zY6h8_Y2qsc1xeEk6EqM_%``zCBG1qU{U5sZ!~SKjv(CMDfA*a=@?LCVQAKgyrd+Fj zvB?w~5*8Y2(zCfR+oDgcD6v{Lm*^77PG;L^Yiup&zI(^f#)x{RsX2feB@wQ1F5HlUhRlx;3d+lo-O8<}>zg0drtY3Cx8oq0^3uRz(Q zW7=g#`NE%Rw}!GihG~y4${u0b8-!!;IuV3&BA1;{#sk!+LGa17D5s_~ zoytZz?ZQJ6V>x;>xdSvAl?)Ku z6v}Q*R)EGb2t4bAayE?V++37%$xO{5=u=$@o;CA8Hx&-h;tIY~kxWzXqrC8BdQpmD zFPG*!Hs=G>SV7-h3N9_4=-m>mW<4OJB>|jU%9zeO;+pdb$}0t3t1naQ0+d!W(~rwh zE@(^_HlSQo{>3dQKSeQJnul^}Ez{))l*^wm{j7LiQ9Q3Gp1&xbZHi}`;(1l^ysCKq zs(4;gJg=E?QM*4tXBsSSPi9kx2GC^!hmI(e4poxtJ}B2SnQla)+)(BDEd!%FRTk~5 zz_(Ln-D$-cUEz??rQUec1?A>yrfwsy>n;H3)i~KTFsEPjr9TJX9#9{lmtp?E2Bv{3 zoHa<0HkiQl#0L|fWCD!1g3C|<(~t>esGQxNrUMMFfWW8u7&Pn((3b^a!^AlJG0Yrs z0~p%~E+Z_$7eu=kfZbUs SS}75n>;w+>cVXen+8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T=^B!nr|V>@>ygN@FqW~AiHWh1 w4T!mbm=B1BfLIKOrGQv2k!7Jb!z({NhS&Ox46h9v*%)5=Co&#;!uU=Q0BE@{TmS$7 diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/ETenms-B5-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/ETenms-B5-H.bcmap deleted file mode 100644 index a7d69db5e3..0000000000 --- a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/ETenms-B5-H.bcmap +++ /dev/null @@ -1,3 +0,0 @@ -àRCopyright 1990-2009 Adobe Systems Incorporated. -All rights reserved. -See ./LICENSEá ETen-B5-H` ^ \ No newline at end of file diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/ETenms-B5-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/ETenms-B5-V.bcmap deleted file mode 100644 index adc5d618d6912cb3a67e4745b63764120f93d17f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 172 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T?HZDrms_msWUA}o$hOe?l^;Xn zWoOQ25yqxk#>Oidj7*6<3u74@nV1+G*?^b}i1~n62#CdiSPF>cfS5@MD9-?tKV{GO GP7na4qA}0_ diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/EUC-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/EUC-H.bcmap deleted file mode 100644 index e92ea5b3b99b1f20d31c9760481de0472e72685b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 578 zcmW;HX-^Yj6b0a!LR#wJkfLdA#QItYF__k&#-$pgwHAR0XbY(^j9ToQiYX4xOdvHz z^BOzU4fhQfs9HsF!Cm{wpW;vPT)#Xy_vC!JuD|J|F9gk~~n5M;9B5#aw zmMK{_pRicpnUjV&X_z^i=c6kU#UlH^x0uN-Zcb5|;haS`AM8t}1~Vy1mV_j`W*7F< z5~8j%Sz0d&CuDX^6mmYamwIXm{c=f!SC+Gir_7t&NfCV zHDQ96hrp{Ss5KL(!Rub|rV}hS5@X=)UhpnNoCixs!TTNHgP*X$$29n)fn}8_g3tZn n%SQ0kP2|D1ec(GIE`T4S;O9>8YYj04eh-UqLp>(Re@6cS^@+ph diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/EUC-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/EUC-V.bcmap deleted file mode 100644 index 7a7c183228dfdc5c236b7914ca68298520ac60a1..0000000000000000000000000000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FG&5j=5!^4L}W=dw=t KcNEe6tK@(8IPMSt diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Ext-RKSJ-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Ext-RKSJ-H.bcmap deleted file mode 100644 index ea4d2d97b8bc1df2abebce0d4f8c58789f723eb1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2542 zcmW+%X;)NN7TvdA6;-cB=0T=nPzDtX5fCBe!vY12s1PG2Dm-I}D1#3WM2!~ODn&st zR~56t*b*ZU8B}=pcCV!WNRsZ(&}(&n=}-NwZ}*3{_FebhbIv|zpLee2$2wQXt-j8d z=Ih<|{E`yK{(}xjiM{-4#}&7|zOSp>-PUEVZvUdA^HxWv-0i-aXDn}Rwg3Nqm%Y>7 z^$Aa7`RCBqJ*}yAK1(LC&n_C`o^=`G223sXfef2zu`4ny*zY&ajCK+0pi%lUW@iFoV=9%aGwxVK-yle@r^KHw?Q<0)i)zZW}2gYhSK zitCb9fyAn5Mw@zA2ve&FQBTX{*#mqpD3*am47j15wGA|5J3VaR4%E7QFQC>7-U6tf z=)H%bo+I9J#pIO?UKi9)Meix7=QZ92s13w>k*F60Zxhtdle})l;`JB@HBc`m3|gUH z!ge*(%ZCQ{LT!v6l%Y0}!Fy0;3_g(cgAxWG@<>;Z;v>Mi44p3xc$JD6U$zoG=+XL| zP`}XnDxh8s^VL9g6JH%x^EJM6P_JeBErTTEcXC}AGGfynF=T_<5wJ

75+cDMEZB&av3deI|b?)VpDR?)#qLKLhoCq@UCO(&TS}`k>6;qlm+jIKpfF&^Y1*g*Z|JO5#V( zVdau$q(iX`d(0!9pc>sMKm}n`52`I1HG}FRM=Ln zF%sG13n6(agOhWB-K0F$KCwyJ8*nfTrpvvq0@JlMc|dl*tpI>FJZrpc&$niO@{lR2-pu zgsD`;G$!e$GC;Gj*>0QK3z`!#RR)?%rcQ(IwNBN6?o%ShJcg+&p!*$Dt)O|pM%{K;kr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rrX=X({o@41eZ;qOm@9XGz`)+e;@Z-P}NzE|Mq-BoS)V3W!3lJi5nV*K5c`{6uT zjb)qv11D|Ukr?25eVn_vq-`B*T{(8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T!*Pnsm zfDaG{u`(P80Mh>aOnZZwSoVei*^xjT0>t4!9L6BHH`-C6vHO580~>>ooOEMRt0N-= n1WGc8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T>RM5v>ygN#sKmI}pMl|k4-f~j zG8_m1(*FERdxM!+_J#r3kw6>*#Nj|3#vr&i+EGF=`+zS48-q}zgLHFIt0N-=1WGc< ggIR10jYd!*Mh1jnBC~2K<36T-PyT%@0*w1a03e<=y#N3J diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GB-EUC-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GB-EUC-H.bcmap deleted file mode 100644 index e39908b9844939a3c6d6baccced5771b8c1b1b2d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 549 zcmW;HX-^Yj6b0bvh=x@^fcgdPo2C^bbR!B*V$ecRss^bX`N|ESR}dF ziYT(U;(|CJ$SNud2>cj-3g`OeNzTp5Nv`@Y)R0Q|8Qq;-8R6G7pS#-U(?lSVit8fW zXJ+&VrU>?Qq>OaRh-LJIr!bIAivN967`mw&y?hMoy6|{!1{)fi!;OkfA;o61EZUXA zrr7tLQB^4WPDMWP#3Gg@qg3suI<?M`$=f?v}^3bnaxfB>#NYMU^7k zeoSNs$ZOA)=ecs1NV}1XlOHqWu#XgvM&(EqIpotqrVET-1<#z|xynSrSRHs#&h&%v z2$-k=lVywnrf!3m7?rPznS0=M6L@n5yv<|c;N2B4eVQ2r@7uwLi{Rr4CIdc&z>E)k zKFTD)>~-+vEU@sWv=U&h9?T1JMCOO6LVj&UT(|%hOPPn@+byu<2FpcEH(0p_R$XB2 z5EBFIm%;Z_%mCPE13zlP&*O{KFoB0odEc2XC8swyI@Z{ E08&E2d;kCd diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GB-EUC-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GB-EUC-V.bcmap deleted file mode 100644 index d5be5446aa40898742183202ce0624b8acee5234..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 179 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T;qIjC8tSa;ktnio5kreT14D}) z8$(MN1LGbEAUm9ex5dqlVUJX^5<`m<8)J(L6GMwFBf}nPZpIb|AT7hl(Bdr3utyfi TmIJaQq#0U5fOIGW!yb76lc_S5 diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GB-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GB-H.bcmap deleted file mode 100644 index 39189c54e3..0000000000 --- a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GB-H.bcmap +++ /dev/null @@ -1,4 +0,0 @@ -àRCopyright 1990-2009 Adobe Systems Incorporated. -All rights reserved. -See ./LICENSE!!º]aX!!]`21> p z$]‚"R‚d-Uƒ7*„ 4„%+ „Z „{/…%…<9K…b1]†."‡ ‰`]‡,"]ˆ -"]ˆh"]‰F"]Š$"]‹"]‹`"]Œ>"]"]z"]ŽX"]6"]"]r"]‘P"]’."]“ "]“j"]”H"]•&"]–"]–b"]—@"]˜"]˜|"]™Z"]š8"]›"]›t"]œR"]0"]ž"]žl"]ŸJ"] ("]¡"]¡d"]¢B"]£ "X£~']¤W"]¥5"]¦"]¦q"]§O"]¨-"]© "]©i"]ªG"]«%"]¬"]¬a"]­?"]®"]®{"]¯Y"]°7"]±"]±s"]²Q"]³/"]´ "]´k"]µI"]¶'"]·"]·c"]¸A"]¹"]¹}"]º["]»9 \ No newline at end of file diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GB-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GB-V.bcmap deleted file mode 100644 index 310834512ffe49cbb7ca903abc2dc1aaa934e6f4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 175 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T;_jsDktm|5#L!~Tz|dmH#?TVR zz_>>O$PQ=WZE>?>*dx^plyqWaY;j>?Xt8Bv*dxu&*x~@BWf&P+oTVA|$O74NKz4*Q OLrVyd4rO52BM$&=>M(}@ diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBK-EUC-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBK-EUC-H.bcmap deleted file mode 100644 index 05fff7e8254c995031783fb3b4892d58a6b176ac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14692 zcmW-IcVJajw*Gg{?YZdJ3#$D519tTp;uiPU!t^q)QQL(gGoLoOx4y zGjDG1EshAnz!OD9L7xH&h=}O#CR@YdTSI%i4SGss{{{N?6mS0o3tg>e1 z>&mf}mHF*Eln)y?c;wi@kRTvQ!X#ey%a@R6E0`(g!&U(Ew)U1dVe0w8B)~Np>VKz5 zntx{kUImr^ZUQ)Kp!-l}o0(~xV%%&>{V){`O%gsVgtuGrhh5+=SARGNu1x8}VX)1@ zhh<9kW-A=|(ud`6Z8Cm160T`!A5MWcz1fFLV5@{*%DkEk{|H=d2~Qks{d8AbA+||% zwIh7(Rad*ho(X>$e2a0lCp?Yht0hX#nNq&t!ap|d>J&I7_0>xFl5uq*{G)Jn5qxR5x){zm9MlSDvifQj z{1c?BHSmvyf24GEIT|F*)s?WV)L&f>UnlKH8raiRAH~BzM*4^op9ueW_$%}urNU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*YQ;Q#;t diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBK2K-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBK2K-H.bcmap deleted file mode 100644 index 46f6ba5967cdfb381f001eb1193f17b43d943962..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 19662 zcmW-o1$Y%#+Q-j1BiC}4r!I(5ox)iy7$ zQ;KuOqG_cmBUUe6R=Qwm%7BH_7cE)5Xvx%Nr88Qao%83XQ2eDSOG=lPE?J?U98p@D z(mJpx z_hbnyp7~?h!zBznt=QkpBh1jLBCjc{sbovs-l@l}FyC@?!2gYZN6`Z+^J*9Ei_uzj ze%#`RoV_8(v);2EPtpT|dAqx8Z~o@!ZH4Ymd(971erbQ8OXFfaq$+P;UhSHXOov2$ z*!Ee6rW{`XM%Qy~^pNVj>Q-8cZ~6Izv$=oi;LZle+fzU2poi4t9bK5%l)h&a{An!I z4XR$ez4xI7d%NgCoAPRU1_tlR@UN|jvo;QJXEdmP;d(%A-ru?%jXo+htt*@BN%lrH zbUV1_|5Ejky1adJs%IX}tnR$Y;_hFu!5wp;Wcv_3q&}~*Pt*9y*@3~wR2U4EUE!-P zJA1mK^{|G#hBTO7);T-@uFi!oLU+eC4&G(dLmKnyCtirq!jH}KOw*QZ>lifL&AOYZ zhiuOKd(vBlJ3GCV1k?A1RCnLIu6q3&LJw)mYnlO{t$_ojpAI@|e@zp@(GS|rG3;sS|t!uBJ-nQE@eC>#BleJoU)msnSo>%kQj<65oD#Bww9M#v?>s-MX@%s54 zd6nZIrn&mQG0(m7jrL#7@OEh&{e7_>vNP}WYxfGZqjR;LYa3s?to~Vs*JrsGHjORh z&}mnmKd(^1?=~OwWdY8-Q<&Sp{vs6`q0@mp_%oBn@HE(vzyy<+fFRTCPOUqvK0VIr zZ9UVs(Fh~wd0L0MTPkG>gm;e6)(B5mYrhEh!nBIXthz%qL~);imB-quCdt7zta>(s z9^8}DXR_oQEh;)n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?J{%o9r?{BRK==E>EK6LHxqF43(xK@V!JrUFXLhPOQ_rp$c{}?^pT&(o_ z7vbb(|5`|q;eZ`Wc0eDA4kTi=JCKEop#wSkVHY_Z4)nr1IDl(mIDm^vIDoYmlT5)% zb6}>T!U4T`A6SKRzyoU(3mnwFIT(g@=wP&LgoBBQ?jUZA3pm&kZ915T{l`JvaDsy! z@h%T`MmrA{qKOCfMa01&xcE3&tmiORKPsHGsGI_a67-JwkUr)e>VdHj;m$Q2>Mh&h&>-0ihbHK;XJS)3 zq<2z>79-w6OL4VvXf>udEMbbn_+p<84jZwEhojKS!%29(!zmd1aC1F42b;s;R+!D< zuGj+|)-fF(q(>g6U-_`!@f_A?t%q^{5e`qo%O9SJ_i}i?g1PEl^x=(oyGQg<>xdb% zKBD(KMzUH&>WeiCs~5;5y26C zKt8e>jXts-lN`0-;n7IE=+Rg#@zE5Fcr*>?BS$kZhoky1f3y|0*rV8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T?(XDm{t7tYAUD8MMn$S27l&jMsKv#~ZBaR3=SjDn0@2*I{OJ^=ma BHq8J4 diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBKp-EUC-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBKp-EUC-H.bcmap deleted file mode 100644 index 5cb0af687ee20a10ecc367892ae49d7b1e74acd1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14686 zcmW-IcVJajw*Gg{?YZdL`3xW@%tm$ZS8$_TWfu5t$pQtV+U0&TU)(w{(=?xor{Y* zweQlYQ*nOD+^X3X`Qz3uUr|xHJb(DoIaSrms;Vt3D&}^GD_OE6|Nql3&#$gnUQxa3 zb>+B}jfx;^7}FeZ+}Rf`0=1<@%3OVXsK|Ck079k*+79UZuUBq7-hmO4l31(J1bEHXKFr z^#b@uz@DYQ-Wrb4^7YPej)toT9KCV98~n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-lJlI>?jnH`oh}!bA~u;N9zEZakL0vgAvTR)*@PIu z{Kd_P@f9$4vZG2|;(-i>xTHp`P%AERH>az`rFg^`3cZwqSPQn1i91{5=hl32sR_*g zDps<7=Ep8k*il+s8h|KI_7Z0}>+Cah1VN3b?EJh%IE&T#7YjTT6@PS1#{rTi&~Du%bOP%ZZP!c2%0bqDr_r z9Bz7~7L#Tg!i>UcITWE$62~W(5DH$UJR|PCN_mlt7_|{iy{q#PquRW>05LiQukz;_ zlvYQcC?*?T!+Jo~GwmBd$8&Up=7bV$7ixVy^YJsFPX2v;(vfuoyFyr%~P cI6^Q`{TiF8EUMp3I5!3T#Cyq7K0Vm~4>;Q@XaE2J diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBKp-EUC-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBKp-EUC-V.bcmap deleted file mode 100644 index bca93b8efbb18a13e15025ad41d23db8267d2577..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 181 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|Tof+Gg1Hm diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBT-EUC-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBT-EUC-H.bcmap deleted file mode 100644 index 4b4e2d32294538b5093ed3870bb9de37abf21599..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7290 zcmW;QXH*n#pXTxFcUM(+lY=Nmf`TFj5KO2b0xAfKSws*}f+7k9iXw*N?DMSToO6Kz zLH&dBh+tQTst)wixN&B~%vzC1IE9Y95x{uL;X|aJ#a)s2NN=m}^#$;uro;-KyBnYoSBuTH9^TPGtK(ZRp-G3@_c{UYM?{B@@rycWZYv^llF?3GSz1|IDBwp`_aXY;}NX8u=uaCgEQ+Rz6#^`|8 zSupOx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M)`|%X3cgg65)pCQ;S4{ZdlCXLYjag{&MALd&7111oX6?8d zG}qGVL$q8%%L}a5qBV_HAEWIUt=6GEm0PVx$1beCM8`RF+@+sDmpA=n=o0ahr|ymT zsr_3o7e96Ae(L#CkN#Zr=cB(I{T1l1=6?oaFc3oW7E~8R^_cX)&xj(!|B)~i4*ZM+rjCGqZr7eywAWGE^EvQl!~X?@>N$x3 diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBT-EUC-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBT-EUC-V.bcmap deleted file mode 100644 index 38f706699f395dcdad5c6ad93d1a9b6fe9f66c78..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 180 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T>FyMw>l*5;>yaq3a1ld`Jp)6F z9UDVS7z5)T2_QS1g}24cj$w~fvl2s#6B}cT3ll?&EhEDoX>P_A2OurO$k5^}&9Fxn U$d&`LBcvHxLV$EA1H&G90MDZ`>Hq)$ diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBT-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBT-H.bcmap deleted file mode 100644 index 8437ac33771536813228e3f9c1cb6c35af3acc72..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7269 zcmW;QXIB(^oA%-J`d3wVlY;>xPzs6|Ku{DFL_h^WKoLcPfD#l?C{PqJEa$oJM{>?N z7!cGA>TDFdI#hL_r|~oF`6yE}uX@poRp)X2y59i%@9Qab_00_rs_s7yJsuw)eKaOI zIzIG5dEMQL(A?(6#}yA7L(?DKt81vQYbbkMQGU$xLTzp6|NVYrXhTI~MMKm7zL{H5 z5qc~tGd<;ER_;Y2QGByrT;?x|#iegzj=xD{9&hTI*PG{W!ixVx_h#Sq|0sWRH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#}Zm_S{;JUf) zYc^cjzF$SSZqWk4l|u`fG*?*Aiy{9(g6p=h;0srtu&|C?`D{Ux-@!sSTz9ds4X#2g zM8Z|XE$o1+m=<=Et3Qv$ z?=gHUhI=o4tAIO(zE!~;tNT_B_da}k33nVV0`7QPEaPOx@AGixRYWaNpp+>)^gg-@VD5 zjqlog4*MPmcdq~U^>E+Te~*GYPyc-%-1+?XBXAesd$JhxU!^VIwaq)i_k6hT;(H0) zh2G!q!(Bw*pTb@2`Ms9hC2UC#_kApR!CgvA+Iez-+`DH-lc-O_1tSMf_(a6buLx(atSx1`NH<(D48{miiRSlsyE zC4T7zxoZNJd2-k3mp8!uf-P&+Uh>P4?_+OzX?KQghJ&;PiF)dKv;q18L=M;@&f zvLA)CTI~JfK34D1kEiHK@cU7V)%#@h!fL6(=qo1tFG*N^fQAe-dZKXyt%_(`ize-H zRcNZF)yHVQjOLeEtwu{Ktv*HTFrtXunTCflhDw$8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T?d}v(kgV$(>a6RLD6()7LyJ8F zLyH|7LrWL~;~ohhJDi2L#m$akk5sb~LyHp|V~YzDLyIjV!yajF#uf)4EyKvr;w;Uu WM;6GI1F|Ee8CpVsbSMME9(e#*4Ku$0 diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBpc-EUC-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/GBpc-EUC-H.bcmap deleted file mode 100644 index c9edf67cf6d640607080ad2775c14760df77dd96..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 557 zcmW;JSx*yT6b9g#5sk8Wp~4N)&xVRox)HTbV$ezus|KWvvDSQMS~>x=+B(ya0BUlu z6%kOt4Hc2GF1UglxbS2ABPP6unKL6=RYgKy|sm^&HD=; z+9wK$t)ehQepj)s%u_r}`l(`yg7UVH+^&(zQA3V2kz3v=XL`Ztad5W*jA@Jk##_Kd z9Ww~-#lii9U~)TSfvGcK8b{@WO6C%Hcmh1y4IY;=1Zf!{oti z6ubz4xoRc@UY-Q=dw_$U(n*6?$3RJtJ6^g;jq>$5#5V`P+ilD>@U9aqc)|M$rVo5* z2OmA)(*`C9J|6*Jb}~a?@jO@xfv-Cl8+_{m-~Hf66>}N8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|To({Gim?; diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/H.bcmap deleted file mode 100644 index 7b24ea4629d0d4cc9f0cd5852edde324156ef0b1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 553 zcmW;HTTc^F6a`>fNJ|+U1WZdKHfIVU1k*BRx(Q8g4%)hO%E=p&pZ zbEd^7Ox8PjMK`8&BW>|axS~6oW&igkGq}l(87h;Uvv6yFZ!CT`8Fx4oMHIF4enru4 z=0tE`J|(&Hyxf(akmS7OcH5<8CAK8mJa(nqZ+l&STNO*h{HDE1f!7`2 zO)W7E7S4gi5O^yQV7GO1K*p$4;PUEKTm>RjJOVd4}m{N!QVP! Q2JBoE!O~)+#IZZH2g5hHiU0rr diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKdla-B5-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKdla-B5-H.bcmap deleted file mode 100644 index 7d30c0500520d563d0e5891c8f4781c61ddcca5e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2654 zcmW-fc~p~E8piLJgoLoDV1iVG#EWdQB!Dska^Z@KEGiKJt6VieWR+b7OJVMpTBmj!JFV@ww9{?uR9m&JOC9YvJu_$KuQ_Vzd^3MM|2*fO=e_Uydjxkk zm-X}x_qVsU4JvaA3e;J-YIT7UxAZjWl(oYHgStHf%8Kshp8npRe(j*HB|8Flbt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3_lx-`u4pUoGg+)V)G$p^3{yIv_sW>Xes3s zwsnSZw^U`GPd}`nA4dhof&%eiyF|0&m(Z^(U;j;DwQFggC@3`47%D;?LXj}sD4(ti zcNRKxWYQ>SyyJzCa;`Aet#zgz9t}6{rI#i2vO?llg%s9G57Rn6dPL&Nx9<#=imudM z=}HXZU?xq@4;0PRICnY~GtxkuE8VWU6LUuv0Pg(B4VEzHMpni?XO1z5^;Kp?5W}fz z{VJQ(u}0#kHH?}wgXMvgnRNSzYt_tfFe(@w7}BK8mOh<7UKvcDIY4EBy)$d5dc4Y~ zz92oNpc!euF>KQJvkPfwgd|KF>rA(&POqm~(*?A~FB1yG4pyG2^=~b6L?3R`GP7;W zlTM9%wu5q`u2ycqlQ)&=UrSdy)2<4y3Y-a(rH1YXM|+ge*&EKL$7^J>p(~rOFP~CR zCHb=1N`I@T(Ssv=g{EQ?@)i5CeTlZ!_8no|3O@Qx=3l!t>u2Alzg?jZo08a;+tQ7T z&ZV7>v}M}Xu;GqP&TdO8C-a2~d`(=Dc`2JD@GgoJc%#Bu#H!fkbd2trO7{*er=qDG zuOQ!B;;uI?vTkIX&3(pjM!LhBo?^ QxJF!^-VRzcnd;s4Uw8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T<>8%@lc?)ts_T)+v(TI2l^-9& lYkfwB*M71;l(nECj@2Kr98sav2P-`~ljyD=Pp1 diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKdlb-B5-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKdlb-B5-H.bcmap deleted file mode 100644 index d829a231015161e107123e211d4a78110daab6bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2414 zcmW;KX;hO}8VB$j_OQsJG{|PSK#(=aRsp%;$|5LKBC^T_S%M&IO_arj-Z$Gz_5=fj z1VX@Cs}=3EQ`_lc+tJ!qJ5D>*+SP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sc}@Yq*)fpvQXnKR(Qe2tekADiD5Q45N#D*l@9mn;ijuFUMo_axx?@_h9t9?U1~} z!|0U`NM7aUuO5Ts_r(~!wh@xonlZXm0Li7p7`@J6y}@CQVMkyjMZ_i8R^x>|(M2N95bAjRmK7`9#;2H+YG@II`@=)+x*d=!Y$ zM}3fdoPyDHUr4T(V{`*Ta-$QYPb83hass12wLx+-2BVu3ko8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T<>8%@lceips_T)+v(TI2l^-9& lYkfwB*M71;l(nECj@2Kr98sav2P-`~lkWD=Yv2 diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKgccs-B5-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKgccs-B5-H.bcmap deleted file mode 100644 index 971a4f23f791f75d4e604ad717735ee55529eda5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2292 zcmW+&3s{t87Cz_yhk+4LK)HmV!xluLDa-%_0}!{Q89xgv!bn_%)-tr4wyp+MR&IvNCGYw6h3((wIh9R8} zvURRQ=(1v9R}@;ik`TL!a#Z(9^u8U0 zgKvl1;C2j_+>Vvvj+y-LWSA!0DMa5MFGiq@?uo?Uo(%HoDZ!AQN{s4x5>0m_G3YKy zue*=n#Jf{S-L02?_X^PWUK!f%t)Nl&2jj&1NmAUeqQqZfG3FN~#joC^e$AB0y`wbf zUBFm47J5s3p|{iwy^8fR9ec}l=(QvCRv`8+w)<{L6UHVVnrUpxDnX;oPXnWEFqgA! z$iNXWa0H@mv<2xbg$x{_1GX?3wc}c^LkBO=xcU~zd~k+?4raE*fG>En91Vd`%pO11 z%rJ;wNnm0f+3&-r9e1A7TxRLNv)yGuPOvacFpE!oaKS*R9d})V4~E(C#VWYD!k)gX z3|%1sx+_f6ToD?&Mk2VP2wa5dvT3?&H0v=MxMDSL*EkcnlF;l**1IQ*?08$Od;h=gnk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210p1/bcmaps/HKgccs-B5-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKgccs-B5-V.bcmap deleted file mode 100644 index d353ca256b54236a4acefafdbc08e5b719892014..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 149 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T?ctrCoLsEyWUA|t$g|L!;gugB m!)tv;hS!D+jEzi8jE!tS%mu`JKr95rVn8ef#Bv!7ulxZLvn!hb diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKm314-B5-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKm314-B5-H.bcmap deleted file mode 100644 index 576dc01112bd7f28c30804661f546ece203c53d8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1772 zcmW-hX;9Q>62|+_CEy8y9C8dzGJu2|ML=I^i69Frj-ce=RRZ<=ems{ZVz@n00OLs6mXL4yS)n(eWt+g{b8nYHPhBhV` zV~s&}MupK|AES5C?@aXe(gzPD%ZWYP%&}bo&G9<5Xj3W82dfrZw7-Togc}@{-JWu7 zce0!suUp)3Nabr8nU|gmbTq$cUTuyws~vn)ihy3niMSzcSCUz+KiC@68g0lk?AJ@h za;+}3ccrOb^gJ)gEm0~D%SBnvXkD!LvKuThq?$G~d6{cYDP`!Y8Qgg?O0Q~MI<&j3 zWZ6MN93R;%yHT`+! zWVu+bG87HI+*#~p^c3-5M0_JTTK@HOFq|re2r#5W94vrsV60Xttx3ODFEG|GHYRLK z8~pu{o1L9&S9w=`cTV>qTbt(U>S6aTKe?bMZ#c+M))Cgfsx`&FHMJ?dBl3j%2}P4% zr&^b;wzU?B8R-DeqQORPa#k(3mi)5ojjf$==A_QUo%OwmW#+BA!tui4Ej_lKFP~k~ zRoD%SCOlL=){%dvtdP^Y)-F62+*3ECv3=oahH-Vr^2y-Iph>0Kf3S3{cywQTWLv1N zPPuMi?Lg|lMzxLgQ|a+akRJP~oUE7TqZ-RPv>iFkRA1A!-B6--uzn%7DFk@DQ@mx% zUVwiyfO&fn*rRf@UVBo~Q{(2`AK4$&?%YB04u4aHIc`FERBhyqPL0YVTlzAMp8MUc zkEGvRM7|t;wud#O@0??=h#hC-(I^l^v6QKYT9uPLM8C)i6h@Ex9?PoU&?*KSV`VpIa z9{FTGv3EBje@`Oz-Y(?t3;+E?$UjIV_MsQ@4__ko(Hi6*RTKMzpv%XCE*}fJ{87;5 zoS@4&L6=ViT|N30u;xjL70l&-Q^Dk@B{z?qwTuC7IxhwL|Rm3b2_==?rz#@TUO(SMa zM}F0r*wrHBUjz~R(jNJjFB1C-k$KhBe@rJm`4MCrqf<8Bk$op0b1m4QS%-aqC z*TZ4aZ9%WwdvM(yf#n+n{&#i}yK@*F?=r}~yP4SczL@rXF2IxyiI-h}Qi56<9Fqia6^HFzX_;UMLNmXBpVe{_ekxKy8fx diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKm314-B5-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKm314-B5-V.bcmap deleted file mode 100644 index 0e96d0e228e0608f77f035655140c6a235d4ea56..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 149 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T?ctqkY-pnEWUA|t$g|L!;gugB m!)tv;hS!D+jEzi8jE!tS%mu`JKr95rVn8ef#Bv!7ulxb;p(_9Y diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKm471-B5-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/HKm471-B5-H.bcmap deleted file mode 100644 index 11d170c75ed8696f0705f9fb9f5afcf3b0aff4c9..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hcm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Df=KqKNlxCMjV1IK zBp@j^p+diq{mTp}mKu<&!28sXFBtFFOt`n6V{ZNRSbzUktiQiG8^t}k-vKOS0ML0r z6a+qCz+?tYx@bY?0Xv2n2#!HTNC|Qi@bw>vb{~}aKsF*X@EFe9z>E*e1nw^)3h#_T gs5_Hz3OX|-6CZSbjZh5~d9mn$60ZxXW8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T<>6hNT&(M4s_T)+u`rggk%@`1 xkqwBsfS3=6g@9NLh^2s7E|F!SH^VDGK8Dx&j0~?08`&6M`6n_Sd&2lm5CElUFU8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC8-WN55U;8L(}OlM#KV%a7QCYC05 b2F?~128O0E2EG8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC8-WN55U;80*_VP;@ya%bRdVPRls W3S-b|;bUNIW?^7zv1XQNu>%0E(j#{O diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSC-EUC-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSC-EUC-H.bcmap deleted file mode 100644 index a45c65f008e7d6ff34edaf53af15ea471d4f6d90..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1848 zcmW-i`CC-i8OOixy)y#?3=?IQ2uv?U1Z7bx1Vjvs#IU1aP?TlFfka8h8Nemd^tlqE zY0{)i(l!C)+;eVZ(YZ5oO(85Me?Xr;PnRG1OMmDOZIdqcZ|Ir+a6jjH&vMW5e&6?1 z{(8DH>z9aSZHI+weYU+K>S3_5VzP>wC)4?~Vd~I)yg(5dXk-&8DYE@eE zYf=pZr-eS649DE_8slzhYA6a`Kh#!yh# zPV0XC#L&G|T|0VjoXY3+>6&}a?{v>~rR2>Gq~^_q^n?C)Q}o8}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4?SQb@3p|F)BP~=yf7-#U`)?|%^l||SZ2R6r$vNa)7#a4(iw_W7k&Y_C! yV!7M4%-TEI$l7s`XGdn5p&eNauv8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T=^gB>>l*5;>yaq1a1rCa3Py%~ zRSXOV8JL*%RRh^|EZqC*bs6?^H=8o-=V4>q&&$NHpP!LozW_JuenDx5{o+8j1Q1I~ IGw+uI04wP+sQ>@~ diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSC-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSC-H.bcmap deleted file mode 100644 index b9b22b67879d4043c75b617a24f96b0bd47cf4ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1831 zcmW-i`Cn648pfaZ-Xstpq{U(4L1XORb!_ZPeu>guX1 zE>>69d7H-P?uESmXY&i8*?Diaa zWmRWeOKZ2kmB{DQ4+Ft#K3^cDYuEJ_{Yv0Ps;*spF+pX^r*zG^++uewccpli2U0!D zbNbnqZ&UP!?r%Hv3+hTfVWp5#R*I-=rBv4fD~r0;_nlv_xb^akUhaLls3t;!n0D?n(UlGl{m8S0;@K7)-O=bdYi7Lua5xhgXmqK*0npY8-Ul1P&RUd)G>*DSCG2yLGDwfC~usdX^b~YGn^!oyAR0?FX5!f6?HkU8P&VqQJuBkj9@IxPdH@A=^$=3$Lz~iJQRNYIwwRI%Q-@Hy9NX|4vWhfvy$5xdCh!q2SFl z@TMN8ww!XCtzx>pC1s{=1K1is<+e?>izwK>M9%G-x;D6dSN^sa*r}1<6J0y8Q%mP} z+N2SIedjT-JByqhshghNlYkjU#;(*<`tF<@=||)4b2+mWAHA)Y=Xl$pYyNj-l=|-1 zda)zw0Nz!iKPsI+Fb*p(Xdf!U;qZ%Y9Mvv2V*lK$ChP_Eb2w-ZdqTd9=siRu6rCg9 zW{-x!I}m+Byvq@N3f_|%{RZ3*GZnlarW5>@Vy1x)Xr_z!AfzA7YVe_O&4dqpgv<-z zK{79a-?N#Q!9y_X6+Q`5dVNYU8;DOU<~8s+huIAF8O%1~VKUpnnjB^)_<~~k!57K= z68tflx51jp90Y#?a|rw?nE~*xz@LFXhdBbi1ap-5*RZO{3_=jhF$hII5t-u^5^UTs$e|mZF+75UFH7f^b5l!;B=|E?i{JLu9(lMF=-yDvl@Bm<{3tM3xdu zg~&lH9U>R83=$rSxghe>Vs41jYAhe30I@=dLU*hP(Go|jD(t%NYmL>AxZ#K`L9|Kf z+Ttoi2jZzo4aVi(ofJ=l=n6X@`0Vivh+Z{*65?iIJQu=W7Qc*Ne&vXdgfpgmMezy5 zrnQ6vBIrt#felci7Gg|I)Io%hxC${5&YSiriAIR~lxTvOLPCbj4A||=#B~x6k&r?3 zNJ+>D3Pa2*i2)J|YGM%L2_=RV@l@*EmKcS2UXlofOJ;mFD;Fg_ux zo{SQg)j&omtacdXs?`y6&iWLi;zt+Q$al@ytkqkv>2YJTJPn%*E8SR~Xu(>;ax>N^ zgSOd+*qQvk8}G&%5KaGK5nH3d(%DbitR8Z|m(`%|eHma4Lwi3aL*yq%65|s8Y1Xxm z_q=pvuYuIPr@H3eTcXZ=naS<@cjStGwC>B4`qOE+f0juh@bhI^C=Rj+2NS^l7*Y-< zWvV!sqs&7GIS+HF{IE#wb||y=~ivf-csQK7Np5q&`=XgZdQa)Uz L{tvCv`X&E=BnB!` diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSC-Johab-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSC-Johab-H.bcmap deleted file mode 100644 index 2531ffcf41acc01338f781c845c7f50f62fcc84a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16791 zcmZvjXLM9owxIXEw{8_xLIII6AdzztIU6K`0FiSpat0xhlP^(Hm84QhRjN{VzZMen z-0s(w4fJbw@SD}M*8FH=qQTh4HpyU{WFrK|H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9TCC&9;!!_f-#w2h2@1Fk!^~r-0 diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSC-Johab-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSC-Johab-V.bcmap deleted file mode 100644 index 367ceb226ab1e33624b30512716a3b65feb5a100..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 166 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T?H%l_>y@98n565GC~(t=abE=^ z!@ep8hJy@DO#7;V>^c_ief7Ew`?(uU8TRwAG4AJOV%X2m$gp34n{~gSG{b&zAX@^6 KC3TtiO923;%QA`p diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSC-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSC-V.bcmap deleted file mode 100644 index 6ae2f0b6b7238adc67bd9231668d9853ea3c8e1e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 160 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T>K*K?>yap+sKmIhf{|fg6$8UT z1}3I`)j)O~3-`WyU55SK&87_ddDs~D^D;5)=VxTtFTl;ZUr?H1zc`RB0mPEh%=@JP DC895z diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSCms-UHC-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSCms-UHC-H.bcmap deleted file mode 100644 index a8d4240e6adb3ac1db859085b769a0715be03c72..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2787 zcmW;Odt6jy9tQB|of%$07>Q8uMPbHa5m6D;MM44N5E&|>0^to|#F4y(!zDF2TQ7)r z_kLI6%z3B0BnM_{H81t|R%@GGwwrBk7cEP-+A>S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ZsUm@q diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSCms-UHC-HW-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSCms-UHC-HW-V.bcmap deleted file mode 100644 index b655dbcfb123ed06c7eeb87dfc96ecf6759363dd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 169 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T=N;^vTdW)E;jHTsuIrH~uy7IM zz6wT$eN_w$2N{@{_EiJfbu8Tb>UA0Rb2pnZ?B`))+|SFzu%DliVZQ)3>wZCLhW+9| NwgeDMN;B`50suw^GhF}x diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSCms-UHC-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSCms-UHC-V.bcmap deleted file mode 100644 index 21f97f65b4a61adfa13f55d5a096ceab45eb485b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 166 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T?H%l#TdW)E;jHVCD6nu5x=3`|5QW_H#FzGVJGJW8BZn#IT>Akzv08H|u^uX@>pcK(+)B KOG-2EmjVE*uriJS diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSCpc-EUC-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSCpc-EUC-H.bcmap deleted file mode 100644 index e06f361eb6d429290806b9f9cd7a0aebce22be4d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2024 zcmW-i*H27iO?oT*=I*WEh>y zWZwfw)x9+eYFE?kLGTF?ZkWX&sp}x1yUFzOj=XcJL{@hkG za{2n`g`xA~u00hMC53xSN-A8{=SKQ{uJ-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Z@Pei51Hz-4GccJIO*1h-nuA%FJQ zI(U?94ueONc^TXe9t(3c;&$#Ja|}G*VNQT2ASh#PNDf-Sw}2-~!D#Sg1Y^Nd5R4<9 zNg$PYdy zg*u6k%b_mts}$;y_%)$(OQ;Y0W=_cG&-u4*3CF^)!HA~tJ1}D8@K%^rWW+%`L*Wz{ zTPU0cBN5>Y7|E9KHZszrunUGTw^KNqw6peb4h*MFc*k&2xD19u;r%eaLE%a=avWhd z8Mz48!zhr$4PN_OT`~$kb3p6;*aN*>t%07J0KFgv`uKD+W(I38>z?vpZpdqS`yVV0 zebS6a18xLjKb^q+K5y<@qb}S+36Dj=s(73agnOVo9uOh&g)M?}0>AR8%C;viI`G6z z@{?<-lJI1b8ka?}u`Zt$D>_iSEVBL=+mZ04NDAFw?i00aC6TZ)2rLgEYGp{Iij@(H zU$v2aHJJ)lv&3$zqOd$oLgG^kIi8A4)BRM`E39RbXU#&XYez-TTCb`^Jv&Gp&uWGB LRYsqvzytpSc&T|h diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSCpc-EUC-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/KSCpc-EUC-V.bcmap deleted file mode 100644 index f3c9113fcf0b02e1deea8246bfd27408becc8401..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 166 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T?H%k~kgV$(>a6RLD6nu5x=3`|5QW_H#FzGVJGJW8BZn#IT>Akzv08H|u^uX@>pcK(+)B KOG-2EmjVE${4#z3 diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Katakana.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/Katakana.bcmap deleted file mode 100644 index 524303c4f0c20e6cd19aa1d35805e98c2c05cb7c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 100 zcmZR25agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe y$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC8-WN55UU{bJea$}HdW(NS2fFFMV diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/LICENSE b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/LICENSE deleted file mode 100644 index b1ad168ad0..0000000000 --- a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/LICENSE +++ /dev/null @@ -1,36 +0,0 @@ -%%Copyright: ----------------------------------------------------------- -%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated. -%%Copyright: All rights reserved. -%%Copyright: -%%Copyright: Redistribution and use in source and binary forms, with or -%%Copyright: without modification, are permitted provided that the -%%Copyright: following conditions are met: -%%Copyright: -%%Copyright: Redistributions of source code must retain the above -%%Copyright: copyright notice, this list of conditions and the following -%%Copyright: disclaimer. -%%Copyright: -%%Copyright: Redistributions in binary form must reproduce the above -%%Copyright: copyright notice, this list of conditions and the following -%%Copyright: disclaimer in the documentation and/or other materials -%%Copyright: provided with the distribution. -%%Copyright: -%%Copyright: Neither the name of Adobe Systems Incorporated nor the names -%%Copyright: of its contributors may be used to endorse or promote -%%Copyright: products derived from this software without specific prior -%%Copyright: written permission. -%%Copyright: -%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND -%%Copyright: CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -%%Copyright: ----------------------------------------------------------- diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/NWP-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/NWP-H.bcmap deleted file mode 100644 index afc5e4b05ee6f4be4f17eb616742b59aee4c5ac1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2765 zcmXw430D)z7XB)orqc;Y0FgzuR6rIL2*@I$D1r(oAP6HaER9A*L2N+4W%RVtL{?D* z!tUre@)*$(aHFgL%lj#>eDAzE=bo>t>ej9A-tYD)%fIW(y6@ia>9}#T&y!PB({#;S^7J$kpGlhc+_O~RX&M~Q29({Do*ueS zBJ~rR*QsA{NV?w^qIWr5dY>c>3swv}v>bUjREiyr3W*)|X{q(YRa$0aAVJ#~9q6@1 zKX+&qp6AJK&-3!J$Iu@D`h8%SNEn79(GKhs%p5+mQ>f)67y^khsO&Zl2_Z%WAx5oA zvnX^6bc$gSdIj_|(5s;*5#0;D26`Tb9zoB?(C^TrISn%O1bQ*_BIrk;6X>;^7xYx< zr=h1ow?Vf<|3wsfI`lZ`8PH|Ll1(x65Jb z`6Q59=gKY&Wc=Fu->_ONsyq9n7&wJM4FYutG$3%n8n}c&8v^ZO;2HwA5$GnmKmwfz z+#&(BE-c$0xT}T#KL$r0MiH~`k-%AyKrOd=ZjIcURHu*PxgSQI`}qz0^oBeigi)U} z0vP9ok%KTAq>)1~8p%kh>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dZUC|G3N&xryK^Mv zT^HH&=Pu2QKeI^9pFZMv56#>BK2-Bs-rph@-{0X6@Lv_g{=vpAl87HXnm77GDv9`T zjQBpBSL_Y^KDRaqGmNJYu9d)ysD-)fSq{v|r^PULJ77j>XJJO~f*GSaFVo~TE6iA7 zEd%DB(6uZqdc)U_z>LFMErK`2wK|yb@>-K(X(>Xms~BTX6!#U{yw=W%{p&ctem#-w zUN0oc>ovr--m7`*)*li3-?f_8`u8PL_;(xG{V|qEAAOov{&Ol!K7AVdR4id${SHIQ;IhzUfjV(3xajRMjOn%t_{B;U8U(8 zeSnz?+owd1X&lpmu?8f4%2nlSH2M=Sd%EM(ZLD62|HNyOVf)PE?Q?(jC^3E-{n^J) z?FT+ray$U}^BInrDE$1J=1uv>#V1)P{3lQIp7^JePqHC=`E|kv=}SJx95}v|Xx@k~ zReX{Q@kh1Gf|a0C^pma@}7NjA6CTB%>tPD@tfrs^CWM!tMV;s*$Tlz zBH6OTEQs84!YuS{CBr=A+GkW=R6fV+7`L?J&$z-XSMqVU|7Rw93`cyEObeUp^W3y&C2z`}bCu zr>);_!>ow=u40mRSf%ZUTOlfK{t=_vd#K|_Kg=rUPyVBvasQ0K^8uJ=Q+}pkG(-Mb XrHH*W`)32MRW8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T>K7iM>ygN#sKmI}pMl|k4-f~j zG8_m1(*FERdxM!+_J#r3kw6>*#Nj|3#vr&i+EGF=`+zS48-q}zgLHFIt0N-=1WGc< zgIR10jYd!*Mh1jnB9Ce*<36T-PyT%@0*w1an(Z0(1~4%0O=n=(>kqW7f`Mso9gtlM K#KF2yhX4S!xj~o! diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/RKSJ-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/RKSJ-H.bcmap deleted file mode 100644 index fb8d298e9bb8e090139bbc5e958f11a237672825..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 534 zcmW-dVM|kS6vlV1!_6jlIAtre^(Q4FZ7qdzD5oo@Ra#hW!6IgQZI@-tuH22r;(#pN zc3YNZS(fEYv$QPBvQ!BADC=#XqScEBemwl(fk!HbNFU1>Bk}7gaWoL{A8z;i1EMFU z4{IWvNv5>Xr0BhQO*h7LLrrNh->#lSLj3oW!qAeMaqC|h)->Tea;}$x{o$YmELjUc zR{7a&frS$QWo5ftfMs7cJ_O=wHmj={)2+bMHwYicfu9^8oM{H0876!>2>i@TINJz3dxh|M1o(xUaIPMBE=2h9Jn$=- zaNYqt-$(7G(`^H#%Fe=N;MX3)#RlNTFyYb#;5Saf(o zt}4K*<3p7z@0?PlvV!j!_(PZ4@LR#PPT;jP;l~v4rw+n(Kk&Lv_&EXmrIm2wAn-<< p@M{eCTQlLN0NxxV{2m4V(MY(p8+a>1xP1xs@6@aCX9<2q{{oKurl8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T7UUi5rR$N%+UUr**PoYhZy+br u-e4w{y8J;XlZGnYh++xso>knU|bjRFGekSdyBe u$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC8-WN55UU{r`}Oa}lMG#?cJ diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniCNS-UCS2-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniCNS-UCS2-H.bcmap deleted file mode 100644 index d5db27c5cf1f5b0e66e16f6314d042a4ef707222..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 48280 zcmXVY2Y6FQ*7ljXO;=s+z1!GejA^EWFTL89ZQQYuJ8qcXAtS3;asf;UgqDyH(jg>d zVHc83*aVUV$%>6h%*OwQB&3mSc2mAh|Bv#0kDn{)O83s3Id|rq_q^wf=|A)5t!>}7 zeoaH;#<=m*re%(ukeN9xPN`j6T^CodZNtX8)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1-ncks4McilG0)21O@wt63#nYp*7CDJ(`~xhxYjloBUoyH zUn#a>Uh0n?D~046FBK=E(hw0k8lzJRc0IR&55P;ou;(_QT)Z?w1VoAykQ(5nvFO%P zNFs9^gid+s0!$K{sHzQgB3_y(0u~}u+affibeTw&Dt_b9w@?&@C}Jr?1r%}?kl(f# zkiQg=lb4DWTe=U&yHfD1xlI*m^MxPg1qbIIeu*NNGw>?|CybXVBHmKe&z6MzY~sLU z1KWq&#BmnS5>Rg2gcN1ouxtW>D8q$EZrdh8airj7xcA6y+l34CCT=sM&Se3BP_|v7 z3@EkYw!NZ(*_fWTgCf6Nk(GcMHUTqi$FLl2xY)rjfPBp_Kxs3-07ePFFdCz9AslTx zZ$`ZHJE61w{840e{v>jS;&=o=2$+}4IGUA%Ue3$?g)77|0f`F%Ln<^ru!0b~Vx%RO zzK#M573b2|u`qFY`Zse(dlYG(O*yi{2^2aqeJCgbd<4ifl!uuOZ&D~KBiyB(2MRF{z0(=w=$vaJ6 Jqc2`({U4}20Ez$r diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniCNS-UCS2-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniCNS-UCS2-V.bcmap deleted file mode 100644 index 1dc9b7a21bc59b6540d55b3d8933e5a6ba9f8947..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 156 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T8=9Bt>=&#X>KtsO>ygN-Ak0v~ yz)&T?kUKw#u~CeHu~7(!rGQuti20Zp8@Zb2STejeY_wo(WC~*tk@VqML;Z65djr@%N?dLLlFUuMvYlhOtRVZ zWRu;LO|nT$aULV15=hvM$-3FB$(EFFlWdajO!hbWeDmI&Th6`rod5ZsbESV?Th!Wi zaQF6x#`dJCbLZwxnUvB-OfEp%Ufz%cel0f-r8PQo2^rto0EPi z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6&bx>Cjq=S0J(GPh(SFSo=)TM$jw6y`*J(EW+oJt`} zSe(k%sc~upb?Vf1YUosfFSnceffO3`l%6)xyCy zo$Kkvq(}i=x+OJ zEY{;xXtVy|%@@DwYm1nnPykLfkuP*=zg`X>n-$F~3g diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniCNS-UTF8-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniCNS-UTF8-V.bcmap deleted file mode 100644 index 22a27e4ddbe26664c57f778a864b6872f6c2ba03..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 157 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T8=9Bt>=scW5>*2)qs9|yi z1CxOCmXDc@SJ^ta8?S^jG93_uk|Tihu!8Nh+WcB#0n_A_#7hh$uOTpl*Tz1*S~oASg+4kV6td zPc~;~K1Im_qJTs}#c$5cId{&?{cG;?KiIu?S65f9TC2iZZ>^I1;Nfue*s0h<5s~rQ z8!RnN)^9X1vDCH?JsKRQ?RhFLJ}f3q+xbYy(b!{0V}s(uLXBkXqocL|U;a4l*s!>; z*yI0A^b8BrHZpc~c5rm_bR-;bt}P`G_fl38UZ3u1}kvR z-IDP3TKI5b1%whZ5JHzMgHXVJ3E4&D1RInkBsoQHrNlCc;AKRCNU%SS;J<%M2;5wCHy6&^YTRE{BlX9^J^G2x4`*81>t!=tT-P8jSK9H3*=@DE?AuN!Xbjggv4;< zs1%~5K@AC^t0X};(;c8|R6y4`%hJTvgjxaAl3g}Ia@=3Z%T4llY4(dbUg>anX-@Fc zLJ==Fv&)jYxJT2Y}*`UQbp@eEl z5vpMTsw4|4=Zt6_P{p&mrD?c~D)oRWwLL2UHDlbHDuG%sYR+1=iP4Qbs4)k+f&Dfy z12tlFy(K7971a(RYv6JrI7nJ2oV?t=9Y-2Dd_~m97**TS?3QY!X$;5G z3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O%`#!0egO><`s|g?n^MZemuB>CH90?v!87^_4iq&Z_=8PpIA#v~IrXX;@fg zwJb=EaiD2S;e(^(J-5p}x690bUrg$l=ear8(|qnxJ!HeY*-~u9_`qSprc^5i{(?sj zmsqh4`f{>jn{;JSQf#xDa;(@kDu@|{PZV5DxKy$2nElo(hUz!GNwEsq=wHK|T`}l* zc#C3Scfwm0drQ}0VZ-IAv7L&cj|^{@moS+7D63HH0Et`A`0n8yddByHvkt$dzEK*i zR~M#KK4Tct{~?|2wrtqnFm(SSSeyOo<`h*_gyAFV$AS@txnhQe0RktHV~?&=158sG z4i?9taJ`=KUBmC|ajl+>q5LB~K1Fg-4J@XJW!bn)L|nR#89b6EKm1E1OHcO*^Vcn6 zOfIBRwyvXgh;W_<+;JpFjr0>4=ju*Y4;F@Wbu*14;M+1No~Z6o zd5XG6Qwt@8+ltK4GuCxvrkvyC2$aSvjLfmVg)jpJftD~MBXi|26(e9bE|4r%*L(WI zQLYHP4YL|qs%vm&k!5n&pd!oVt0Tc1^gxP<6zN_jxz*|hH4|B*?i_B|sP3_;CbC)G zD5N4_grOag*L7(rNrlyol_$dHJCS6k29Q*+L_{j}6QR~J^$q5;RN5gfVjhY>Mn_)A zVL51;BJ3PFa^N&ada98FV;ngq2mDFogdFxb;OY)cPNY@?XSw@bIg@yh3%cx57vCcC zvASw?yD+7T@WWiAWrq+&rGe!xLrm*lg0G+ADn+-~>zbu+K`^idN7IGdlOH%$G_xx0 zUzW?0Dw%xk_GC&YjAfYxmOO{~%cx5GzomMfH#y_^A}i^6k(K?tm~=C7!=6vK^n6Cu z*k2|xz)a{tbO9eTx)f3rEgJc^8r5xd<49RKFEP5GNgb{AZsz|ObC7#-uvA9JF<5jw Uyk~SGTv&9{NH!N6NOao&1LeutHUIzs diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniGB-UCS2-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniGB-UCS2-V.bcmap deleted file mode 100644 index 53c534b7fecfd84e465c8943fe3adf500a4444f4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 193 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T6PlOl?xY*)9BicPk;tzg!q5^X z$j}nrT*t6SW_C0~i#-EFiybR_iw6T^OAsT&9w{L02E+l)b2AxQoY)v!T$mVIY=JV; k+>9*_j-3Bx_sB55H!Wak%8eoOCt*p0P(FjU;qFB diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniGB-UTF16-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniGB-UTF16-H.bcmap deleted file mode 100644 index b95045b400a77419292cab245f9f66f6298dbb5d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 44086 zcmXuL2V7KF`ab@ibIaW6^e!EgB4Pmr8&^fe0uCT5A|Qew(xfPe%AR4E!pzWn7X+k; zU^hk+Tgqm$o2F)yY_h4FP1)USV#=oM|FGZR|HJ2V9qwGtJ@?$VJn!>9NBq~sjm0HZ zrAKn}%DtCHMTIY379JkuEoK*I<#;Dmm6hidmU+h&9V#v@DK0%&o|7FW6AKEw|95?v zcWF*pPU-RalSw%_-eF62#BGd?Pl`ndp!Q-7gWiVsVDJ}14MKl~=W2ZDX)h$E!w_P$ z+b|DAE;$ZcxG1kxf^iLSybL%9L<@jp=_kghLB>?zkb+%m%S*5ty96@8`YqtI79bVk z=?_LQ|Kp+9BUKAIrp0vFm4@R9F_#PTYm-e25SH6AHqw(aHy`~P5}?nqQ&hVETb|2H z5F^O26UdMk%P?|azzzfFLjR2d73U;l7{;Cl`AUgg8YlX0s#9(Q#)bvPP67-g!5Ekb z4wxuc#E5n<@vM(-$#CE^kz_9>`w*z<4@sb7Ig_n0a+;J5M@#8%VX%Qf&}n^KrKpBc zGL!f`&-5k{2dJyYJi}rDK?Z6U%rY#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+SneCNOiuGEcMf9bt_aEvRcVLpIU$r2HFA#>JOQEHGXd3BXBZE=4Oc2wL)+nx zpx?3#vmV(kqd2HoNFld5f4 zN@w^E+l%4*0`Lax^V&P)<*&$3aZI)RRJ2=u5e&^YvUSQgsX)^rFC!OJ$G?!5D>VO*5#^s?8{}V-9N|x1Y(xv! zNUf3_$=S#Z2r zCM05%YZ5jp17`FvlpJkUOv4)G9t_VOsPa|R)Mz{Cj*6F~kI?_4Phig&pRd@MgnFzN z#XBamWo#}TjmfnzroF@1vc;6HRzWjs?-&=cY;2=SHv?*nGa4Jy-eydWpt0THJa(Xj z*zvL&8*3BfYiPGI&R%WoJ{%nDaMF=h-0@QK#w%d_copLqmkBUF57frxmmL30rJp~2xzHfF+eveV}ey?jr)6X0>!Icl2m`}Zlg|KvDv0_auaTBW* zlh99ai^V2dl>7=%6MNw`A3!wP#Oa@HcN*Vh61=f{6gfI(+eF#VzusftIULLFyRRKK z$-e7wIhspsuKoU7S6OrVqVbaZWc!0RoG<(WE8>d%Vz$e%zQo?zAHH%qHYoB(uUr)y zOJ>_2zj7S6U(Rq`uwUN9KmGka$9((#RLMj8{;A8c=@G#HT{$`)c z*;4YY{p~}C&9}d6bvbsb(%(ODId_$;vwwKt=&<*VuCiUfS86}hGrk`dI2!DS1ANbK zKiqLScmKB0e!WXge%>5h-= z$19Ep_TwX$gIDU`+HbG9s`r)bv46hiSYsbnLh=u?$v?Qt>r9t(?ZXSlO#ATKxz~PI zrv|@kb2;e$t^Es;gC$SwU)x+|2cPj^;<55J`?u#M)9t4dl~!jz-EcV%O;p&wzp~-| l)c=nvmm{l&|4C#>k^dr+Q{=yi43}7~{f{F4b@snA{|_{wc(?!n diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniGB-UTF16-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniGB-UTF16-V.bcmap deleted file mode 100644 index 51f023e0d609798e72d46bf41309e092d72ccb07..0000000000000000000000000000000000000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A-MoUGa+qAamk@qRQjs3&4!j@ZimFWp-vb!q^W)A1ek~3)w{E_JH*ie8|rNY zm1d=({)Seo)`O}lGhdyIJgQUCjVhOzT6H$8tFmEY)m3vSl|NYBM%1^u8#YzU*?NJx9CMi$bM|u&P*jRndp4B3RXjYONn@QLE!!t(nK#Xq37( z4ytMs^w`EQs7=96)?_?tGw5nH>VAcB7!>H zZrXIIQ1(_>r<}mHp92JzRCL&N0<~{E_ppeKyH?%09bHtorla&RO>PF~@ED z{GOoK-=U$OT+ufX8yx%Wr+1zFe&A=@RkYD@&3^v=^W2S__KP0DZ2WeneQ{VVeDR#P z&C34rd3KAkzv>gzn~o#)>ps4tvfu31bBE(S`|WL~&9dKh3Ex(M{{EJVwmDYYA8tAO z?D1mtaNGCl?a6dF@MN}gjy>t*UIBY@O@Q0KUTj}(Q^hZPd$@06r=!#U*vkm{YONCn zeYLlT+d6hR=Gvb)MPpCLI=k%YMCW*Wdd_*vp59Tj{N146zP`}Icc8l+JMGUGoGb0w zQpEF29{jU2jcul*y!PyYbFw{qShvf*X;YPNx>Xxm`t2{zvwIzP?XTUUcklg$_P0Zg z-S)Q+924!^BhA)k-(C{E`$n4V?;lxV54HZ$A_Q3>_~-L%PT7Aw&*qi=_w#JQVPot+ M|Id0?+kYqj4{W+_`v3p{ diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniGB-UTF32-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniGB-UTF32-V.bcmap deleted file mode 100644 index ce9c30a98541e23244876fef9dc67c2639fdd746..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 182 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T8=9Bt?xY(U;%025>)|ZOz@Q+~ z5+=wnKgy7SS>U}{^W5C`hFsi?@2&V47~dO9zc*q8(!A1~j0_C#SsGb*lGzv-3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((c|C@{d W-NpY7&VvC#?^62*GzIJ*TmK)sASzq{ diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniGB-UTF8-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniGB-UTF8-V.bcmap deleted file mode 100644 index f78020dd4028d56497c44b7afa94985f0d18f8ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 181 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T6PlOl?xY(U;%1@i;UxH|VM5Yq4M+!U_+G%+;v&G<;s5}C8#>Vd diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UCS2-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UCS2-H.bcmap deleted file mode 100644 index 7daf56afabf65a4707d7bb06d829f56b247c9e80..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 25439 zcmX8530Ra_mL`18z26c$I|#_Wh#Sb}F8aCefVd$FhJb<_f(QZ%`2_?7`@ZixDhjw| zDw!%+SzTFw_579HJ=0w?X=Yb-_e?!qHJPqGH9i0H%zq;LiRU9CAmV;^Irp6Ryyv~J ze>}1y=UP!-_Jyo`|Hus+)~t?Nvu1<8l96*R(?6-`dVc1W>;C($rsw2c%gHn6XJ&-! zl*^a>fByV+|GdoWnRx~FUnXT{`iDmx+_z)b;iO&20Lo{|n&4$w00Q`-Spfe{^vVnY zae*u|(F9|c&g`!~sk&69d2T%}3enZfJ9h~@MAZkZBB*{)se>D!N}&3K>IfxF4S-Tn z4F*;3psoPxI#5lbx(QTwQB^>7a!~hxbv>xAl6q1xV5I8opa-3U7IX&H86>EPX|3q0QWPi>9rGGE_Atpdzdas zW*R{NdU$G#8jV&IwlD>8+4q~x298(;kOrXASk-gDREG8@L6zy!dfCSVszwXjIH)?a zmYcy^5aC#L9VM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t@D@DH89UcJV(Eed^%sQ)kQkzcBK0dLREU#9s35f-($w_tE=1n75p~Pmy;Od9IUp zHMA d{uftm>(0&0i|EID0XO8}?{CNbPPpQ&{|9JB0F(d# diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UCS2-HW-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UCS2-HW-H.bcmap deleted file mode 100644 index ac9975c585ede6958758980ade161f687d40d58b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 119 zcmZR25agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T8=9BtKtsO>ygO9pkUpY R&cJYlpFy!nMUA0J8303WB^dw! diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UCS2-HW-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UCS2-HW-V.bcmap deleted file mode 100644 index 3da0a1c62f19f720590b54fc1de7b027af100945..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 680 zcmZY4T~8B16b9gTW_C-zEKrO{Xki;z^rld0f@uiR4Ix@Y5SLOB2rjVUBlNpUP=hJZ zdv1(>g-o)Woy5N}MSq0Xx}bOFeWi!YTCQwVdLmXyM5o#>UP7ff4B)v+t$V>7V@)mi{{+VJB9MW zeBMkKX3fd;b1MvOy0r&Plg#y)x zX}a?kEYdC`e%><$20DDP28u4w=~n3;YfUN!NqxPZvI05?&-otvW_;5=!}nylUyt%< zl+mDX_+Nh*P#INNtw$dr{1ChXUIIS?FN4>>tKfC;b;>uvHz-@HZAgi;yP{& zWD?FQJ`$vs2>#XphHs|;qU{Wr(w_ML#!@oBh)Y#C<^_Wo0+Cb8kt`GOtNE+q)oMTu zssZYjYJJ(5D(B#;5O*QMkP8rfkc&*df=E%h0uh2pKo%j_;C90e5xD^|3b(hWWz&#b zRBl6zLD~>8BKP4&Aj^y3Hq)$ diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UCS2-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UCS2-V.bcmap deleted file mode 100644 index c50b9ddfde9da7ebb2f67eba68d58fa2cdee902a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 664 zcmZY4-%b-j6bA5bW_FjB)(XXlgci2ZMQ;j~CYXj0-4LQh1aVs`0>K3~0-^u5Re~A} zf!=dtd<`$jB)i#pkSY2QUh9J1nUi16nQtbO9QNbYY`t;h?!DV>>kkWsTy`>-E9mA< zeaq3UqgLCgw)A3cyY4pXuHANa#(T|!1O57aOLv`?<9@gbEyvNvCl-pcbBos8&l~01 z-h9!@mS?TW>@!=#cLXo|O?YJmUJ39jgaoUU1Qk=soOiaMLV;=~bi;cC7VFfIJnfqT z106kE1w{|&^hxzLJDF5WlKFZ$WorfqFN7Y2W_0HUIjk@uYotg8{jVZ8s!_{>y*C*w>WI%5zcAaZIsmS-Y)F@I6HSkcsos!_k%9LOhBIR{^b zxCPM*xd1T$xya;8hzyk_h$ut~vI4mZ|0et>k?Rom;P*H6d=_$($}Na7NCzT8U9yTM)xc9zqz9pWrL-lSF=o-viN4x)favT}HZLc*mys kFA&Pl?BDFTeoUu+^SXUg5mjCgl?~4^7FE04LFzfiN2N!jg7?S=ccVGT5 z5qR{x_lr#-FA99qjC-~DCjNbz#J@l1n`U~kNzG?7JU5By)#qjeS&`TVmuPghSjPY+K%d;X>COZ7|5OYKYDOX;Nw zPyAPIrz$>Mu+GRfBApu`jeif1ysr^bN2wz^8we-}V4#P?a1RuH#1c-oD z5K2ldI$HRrM6=u0hzNfd9`@CluTIN4diBpH;IVK3b`cf05S|F!13ci%HSpyz{Dt*T z>sD*`eYx_>oAKP2M{WO#$rtF;(;#X#xv9y%(2aCGYz4kW;2VGf^;H4Ya9767e0OtF z+LkA)nsz{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GD z@za|WL-eM!nDLuF4iw?$NOvT$5IHx;=|_+*Lg(CE7KvolU?e%yk>q0J+}tgm*%yoC zC~AE3I8S4|(`ux=(=KLsX8;yf-Z>IA?;M9V>x>IP5|57ROb`!gDjrWlA9v0|sXEh8 zpw2Apk~`;Nj(0A{VCdYyAxJupjb;3n5ks|V`PR&I zBy&*KTZ03uda-2ixbp@bWU17+&D+)jAiosav8s(UYGy~(fD;wgeYcaa2 zYgs&!HB%TUoAYtCZ3U78Nl1<(hi)kYiQ76OEPn0*A9E=1o#$FI8}z&vxzFW0b_3-r-+fO45VmK6Fp5;|l4X!_S7SR!`8tzZYj za3Cv`4lLMh`egzgSWX9W=)g)ku$2yMpabiqflc&(;QX)EImTa&v=Dk`5e%XQ$CZF0 UUp1g87AoR8lAx!|poMAw7d?}<%>V!Z diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UTF16-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UTF16-V.bcmap deleted file mode 100644 index 70bf90c0efb66da2a7aa19a820d766cfe3ef3183..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 643 zcmZXOTTc^F5XWcEIeWU@mZfZql}p1S79^z5N>bApgDXKP7qONqiI&*X4WK}=trCdA zkfrgJ7Xyht_z`$)Hfb#%WUGFXdH~!%YTOcem-5?-7jsfZ&dVHA`y+;jYbo? zQ7Gn3J-uJ9nA>GNxwBR*?G{V9idh&}jIAyGYQC(O%(7Yfcv(!FranHgker@*nx6Ti zW_C8`lIcih`Ee{BnKjtpNi`1=Fpvzl?yF}Q1*S5f*3?k}2)KY49L}4IKaqoG`Qku< zr2IqQT9x53c5B3YqmOC9#u%lIM~wufsbJV^KOvOJf`NbW4wool)bNDEc2OJ?65`;c zpP)ef6jJW+L;J(!l8eaH(1-h*q3fqC44xbu@4*4W;1a^M^}xVY#=%>S0%g^S|2rMo zWBMgv;0XDp85sT1o=4jFCtG%qf;F2tH(%3e%$v{Ku(x8K?N{7}7y(CCw>vVo9 z6cU=DzJBn720cg2BSyO~0?>^#LgnI-v}~-6~Uex?ZdBe ztS?FK`WnG{_A@qTSFu5??_F4bl~bcPvGuOHj!xVoIWwF(&yYCF9G%yUIC+ZBhD@9a nq0Syd=MzEakYUSZoypkR&at6$Y_Fabu${D4-0ek>+ADtn7bS_K diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UTF32-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UTF32-H.bcmap deleted file mode 100644 index 7a83d53ae70ca3d81cda827cc224ec8c5efa4f17..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 40539 zcmYJb2Ut~EmM^~c-shZ~$r(YC1Oo_&5#trJf?`g9ihv*>q9}^=K7@O@mz>k(l0ifS z)UvANR<%~plCGZauV>!8o~{lvRr9*0EZYi`yWh-PhxvcszbLuqp19B2EBw}PtquLd zA!9+|&7z#F?BbxV@58xgHq~6Escd7>ffzP~jUl#jpb@K7?(tdg;?8SK>Z=V;^3)NQ!U8(_3@Zx>>%HA)J zczv0oeF5Q1!lI07JP`KhDA2;E7va-2@KrE)!70$C2H}Bd-gh-5LVmhcei|ZuTBdy= zg=~1S&gaGIkeB{WFSe=WryI2V$J>4{mWRB!?DxV=$0t0ws7sB(Yg7L0;m7|u0*_zv zd9f+vMXq16(>`sE3;!Wm;y+yUOLlp&NzEtHyw2;sTB-f=ve%b>elH?J{Qdm>mZ6{SKx|18eS)yv(>(~D1Bdg=O7{ZjK%`%?E(dZ}7C z`Cqu5s`y0iIzQ#LY096Ee--dmNWhonUxg$`YQItm!k48+Egm`h=VPz}0>PIq1py*p zC4`cqR2?44`}1ly_iYgoi=27bSLeSvXH<6H_=^khSU3#3i3*$vUk%(7JmJeV@a4&c ztIU61w@SPJ%N1YVj^};YMD|Nav**0v0DqffJIgcExLt!5zu64lHpV8UrVA z+o;KdD#Hd~E&?#M@=u2k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sigA83RKrHUISX@tGY(U6bAC9A#iIV3%Tejg zjhKm>JFw_(=7;bR!@IDnUQ9Kmwz$S;bdyfX~5*cpLE*Ev}%ctqHuSm=sk5yy_`T!X3U z+`vzuJiw>mi?itJEh7gVxaF;Rpp3wj-kN~d+=>SAxHV-midgQAauHf_Yq7Xz35NGp z`ZmUItq@E3)>({sm(GSw*)6(T1cO|Yvk;0(~b*<3Q!Y)YGyz4MWd0Pi5lHYb& zj=~ES-uA_m-VR-WBGMnlL_r8|FR+5%-ae|~W!<`yCuyXDl7Wd@E zpg4^l-#g1w8SgRaDetj}UEbphHVb{(0Q*fy44$us(ZunP;VsGN^i7v5z2I|UQN3$1 zRlQkpD7MaF$n{-_t9=_$97{xT7B%!q=_s6!!l&`m3_7xbj%=eNo9M`1Is$PqTN>F- z{}rdsZOMjT<7Yj!L1rw5WwPk3;#=&c`WDBi@mlf%YD*PD<kM3$tN=n~({Pr{iT9l$wIBWgw)hOAdh=y8T~Y0auFv diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UTF32-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UTF32-V.bcmap deleted file mode 100644 index 7a8713539491f51c52ba3a1525d181efd32c1f0f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 677 zcmZXSTTc@~6vxk*GdtZbWho0-xiln=?6=|2Z=m`u)tx?(XL{*Eb60Xd)3G8jHsh z=2RxT=9u<=zTj-<&E!rxo7>Ii-V~h7ur{@|WnSgy&76~Wav$qX+i}d{k@=)G{luRB zqo;N@XOs3&YU$DV*wBo{0eVh~YoGuJ#R>wL;ZlkdaGe9WlSdg~5CCQg064EK{6qnU z8=e3HX14(JeybMx2KlZ2(2Y)RM9PCi<%i`2ksSeug}ld%m@4W1XYUAw7$>ViMq^%9 zwv|G%b$uTppcVpK4iS6ceW(`(m`auj(AQOoUXSQvCYsrI%@4UicBmM*-{IrrX}2LD>KcMs{X51zkle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seCS{^mly3&+LcS8lElcfPp^1{=Sb3Yxo_CZ6%; z$t-->Xn>;Tu)aX)jX@lA);Pps#mqI16BN=o7mw38A65x(Ou{oXt`KzAxE2F$gbBkN zx7xNc-nf4xP7j098jqn~f;SE4n;CB!Jq4$e{=bgSuC<9E3d4|KBGHf{#*V@yeU-_w4p}^hSEsKjU+}d9w-G znKS3S=VNBrS*1Nsf&&~<2iE#{#z9kBTyG5E*1_wYHotUrrGOQ0#6~>t0&RMh&49gY8eqNgOTdK2N^hP6_{4iVq!a&t$nr-~ zk8f#ze(C#CTKsw1_G<(9?KfD-;N!(!Atga>2P*{@+7GVSP&OE&sh~_{DZ$Lwi{Oe* zrh-RgWC*BAehd!Aqkp zrV|pi3&1<|fM{Er>)Hcm%^j8u~6I*h%0*vW>$#@Z%+Czeb&0}y?16cAHYbNW;@Z_m< zQXIdpo|C-Npp(4UFqU++sl&8->|uU0$6DmRb#y*cI4-gXdVD=&{mo_yCsn?jtPYP( Zk@2$oe=xv)=QA%Cm7k5@(*(V9{{Wi~yy*Y{ diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UTF8-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS-UTF8-V.bcmap deleted file mode 100644 index 808a94f0fd9c3b3cb0267e5cfe4dced2e65ecb1c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 678 zcmXwz-%b-z5XNWDIlJBd1-57ft!#`D2?2^1Xk!fNHXub1XsKclmC^=Kpx9Oj#6XvV z-V}mK2_|ykjrWaLWRo^UpTWzmxP1bjpl$&(`OSASGv}M3r$K*wc`Y$NJC~BWyE1CyM_Y( zzQ>`yKlbp_{9qu|5gzZq*D>J3ANkU-%=8cYI}zZ30VkXF^nM}CC@=>Dy1S`Ffq)5! z%<1Xxr7;k9M|*$*2|D$?FXhy&c6OuHcKIq3UBz}vi*nIRY0#zTvg$)ZiD1xjp|^RC z5=LdKp8KZ8jdg~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4-yps z5~FdlYx8YjnAZ-ecv+wBIEcn#`h3tVeSUahU${*#@V@zYbl(Dwao4v(8-jg1ZAiv{ z-H26)U-v_EUmvp(eSSm0 z>u;E`mhc19I^ zZccOsi39JrIaNIYx)Pmpb8R@t#<3u|^FZ=2a&8{bt~neBauPMZS;Es9?>Ffw@3(4G zwcig*D(|0&n)gpdoAt;0fh3@#`V+N_6d9K%qmTO+qE!9qC{X`mXvY0ZF z=imtar=~D|OOK-6a0Z1&cIOprw=>#dcx1Gu3GL;BW9 zjg;V*+j<@W>W8}B4#D$pN8rxeQ5Z0{V{HpSvoM%%=YZMVUWNX;y*2@4^K6D3&&4>} zy&mL9GDr!YFd$@sn78U->T~t`$W!+Fy_f9wJEZvkvod5$!GfcEN8=0iMXf(90V7*s z`(;1ak$bM;#b)+mxjKoCQZBN$1uK2KcoO~FI57MDa2i+vH5^?WOh=a=F#J57j;^Dl zxpZ^`9W9`v+v(_5VRR?`cWflKDOdlCp4uT|mca^IS|a(CdCPufagYwTl0-FiKDDR+ E-=u#IHvj+t diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS2004-UTF16-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS2004-UTF16-V.bcmap deleted file mode 100644 index 3d5bf6fb4ef94b452ed1ef0df926fc2bee55e973..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 647 zcmZXOTTc^F5XWcEoITxcODS8ha%o(|f`kCAn3~2ITnS3Kh_zHn6k?$pK!IXgB@lxl zOXDjq1`>VnBk)KzX@w86RX<5RfNy5yQNzGM`wl2!b8QOsDDF*H1#8XJF_8ULea zH`gXp87XylFgy1+o*0}kdG}#u2^8RTl(-T{8I&ws6x>*3k}QSDJJNt6yp{mv6cOqJaD7jFxN7$?&gjXDK+OiIXu z7k-$4LIi1V^r7?NV#&i)GL7D@v&hv`Hii#(54K?!p?enL%G%+^WhTI1i2?D-@c*5r zg#-H1YGNPzrJET0(U?m6M(A8WojiSc`a&qGB3Nz1)JIxtN{bFn6wsRVX6RsHQthLu z(MUvUMmoD71Uj_ubDtb-J8y+H3@RNIhg%{b7{-+#YC_?<=vV!H{q~XnJ!)ofBB&Rx&Ty_M)@* zHG$Px#amrwSY7yxXA_H9WA^tJtiH+xV%M?$uCjt|!l$_7g4}1w+&O{nYtGyyLU&bV oZkdt0&C&hD(B0!$_t?iO);Dsz=L8#z$9Zg|?0Iiv29(D9Ur3XRZ2$lO diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS2004-UTF32-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS2004-UTF32-H.bcmap deleted file mode 100644 index 09eee10d4fb4b9fe1e70a1ee56825a207ae8034a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 40630 zcmYIw2V50dn(uecsj8a^mmDQYFo1xV#c;)}pqLY&A|Mh(6akSrMY`Ne&iRr-R7BLa zyXAI|cF>lYotd58oi{r@VYmCe>D9LFu(LC}v+wQuihaM|Yg%sIs#8@beBuB7zwbc* zaL|;OUtExtky#iJy>{)2EZcYdanA?pi4Gj19v`|1iP5SGxFa5p@^82Fv%b>(??UyP+_@cz5#Vcq2dK8v}KX}n4AV3(b zfM8OPtivmp{<_NOvNbHs*O7;OdG5=zCgtSy|8xQ#4ToSCQGp}jtAM+K8+@@EzBsXP zm-(-2S8DftvHXi0vD}+SZ2yv(a`3(d$(yN}isi~K5& zuU+R~lb|+lxUd6+cuxXLfv7>l)DT8NIw#cU8A;Z$ zjy)hlKwmnwF4I??m#R+cn&MdRZWweSZ8u1DBIzlhqo+-=00AfLCn)1ft0VC(l~J^M zleYT0SH(4xX1jJ#>Mw@wG6aO6yZ_o zlpDD77*~9zFEGCI)nJi2a#-GhD!urr2$cn zKxtxlEb-HDgzO@E;Ad9^YuAv)Dm}O{J-Cu!ss{m|;X#dH2o6iF%76DpRW_|obzsY@ zvQJlU-&J>Vc||CXt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Q{Lw$7HeMs*efh(XnEgs^jTkg0Ez?*R9~XFX_1QClQG79OHix6bX2G>2Z~|e3M|*Y z4VVmlJ2_}V-`Q!5-_fILcU&x3dv_v53-3%s|J<2^&c8EF1EIaMI1|NE)b-A4%V9iF zgeiUJj3`QQ<*uGbqYOaX?uOz0ccby--B?VRyOS-8QD$K>-(3!Jb9W8K>+bpl6kF#q zBnB_W(Y}o+jwhoi!5jLeEEKLs;k5W^CLP&8N4C+CO>|^09f7QvCynf;|BCJFw&cMA z{j;80AuyJ~AX!?X1eE!z0cCM&qL#XlTGNF@`STX~WuE2VrUZQGtp@zoM-BK5_M`aY eqC6PgCggy7>3Ai2##Yp`3`B8N`5{m?&;J`5G_K|V diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS2004-UTF32-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS2004-UTF32-V.bcmap deleted file mode 100644 index 6c546001331cf4f2f68563229f994b55730dfdb1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 681 zcmZXSTTc@~6vxk*GdtZbrIZD%TpAX!R6>9P2GbaWxIrlwF)r063Q^h(pg^&$5{SW& zrSX*)1BpKP5qKn`1s-L7z!8bGc&6%9b|D2f&{eEudws-UEt7}DLB$0>@j>h8& zV=|jtu?=gtP_#D-Msh2Y%WvoMZ;N(zNSoZ)Fs||oM&2&i`A>DHW!uKk@LbZIdTLGm z(NkONGf7KI-5pFVJ{}t#oHjW?&rxXw6yTtkegGp>PH_Sr zg1l$QyhVZDYtFnCLT^oFUXhWv!_oW9(A(!&^*JXhRyQ;9qx7C)ZTTdNwWO2w*XBW~ GrT+p)28xXU diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS2004-UTF8-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS2004-UTF8-H.bcmap deleted file mode 100644 index 1b1a64f50d204b03ef0c5575233687830a1b053a..0000000000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!RR)^iUyPiz$pVmzF{TN@~&uqQ@fQhbkXBRi@ StUu@Nr1Glp*C4U(!~X!6rxDoz diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS2004-UTF8-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJIS2004-UTF8-V.bcmap deleted file mode 100644 index 994aa9ef9f50495a3ac558630b0234680be23c2f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 682 zcmXwz-%b-j6voe)ncZ&xP+*Hz(8|Ubkr1F5gEq#HZUa&TftD%;Q7LTz1&VEjKn!## z=uIJ*lt3aE-gw`5MK)VT^@u_4q(qZw=&r4_igcOe^qVeVGV=x+(Iywja zzTPLn-aqxB#km20(1^O*9vbVr-`?-VAGzX?%=C|Y+hO2<0VkXF)LuTsC@?z%y0f7~ zfPe{z%;~A`#ZeG^0V(#gN*vo=5JBP^5)md8@17Nw74BHt?5T3U13;5)R)_2tZgHi*Ph2gGDy7G|gsSPOPV z=E20<%{DMJ?9j6*R6T&|J%fh^4-C8pJx)~L2t=JkqP{i=8H^jOD1KDe)4!H6Kg^l) z(**OA=?yIQZ(hd&$^9M0{6yGZP90+D?ZFIc-BwQP<*7D;L>uE#d%=hnrl`#ds3jF2 o)m9j49|&se3`?fmseq-0Fw=K)Sb3Q)N3i1Gy<)Bm0aqFS2j0}QeHI+_hb#t%0 z^sD3GC; zUAp1EhZJd*5WDP|h6FltwGN67(3xiOfz+ImO_Kb2J8i252+IbZ1!e;?0WU)R-Fv-F+$BYGcZ0(sh`VKz#}v0Q zb1)ruSMix3xkT`{1~KwyQW0&XA<3=D|8HzL{fl^1fook!;KLwddO4Djcz>% diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJISPro-UCS2-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJISPro-UCS2-V.bcmap deleted file mode 100644 index c148f67f5e9fe4a108519eeaace89e708a51f8f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 689 zcmZY4-%b-j6bA5bW_FiuTM!Bnkyf_RMQ;j~CYXj0-H=905X4dtf#3ogfzW^3DnSeh zf!=dtd<`$jB)jQ6$SnF0UgLt^nUi16nQtbO9QO0=Os#(8?tR>C8Bg>1Y-S>x%^TKE zZObuAN6nT~X&S}qcFnEVT)XA$j76=31LO96({P=p<9@ygOO9iVjn5Tl3iGAHukLbn zZ?;&+XyjjiqN$83 ztkG*eBzzyd23`R_0Iz~K!0X^H_!{LK;Omrs054Hq24AB5olVSX$`2QH^9BEO^J^E4 zurMqVeq!sRNpw;`XE^jAlsqHo^j&NcZ$Z_)?eH)U;%(UEF~wEF8pFA)5# zA&lHk8shCNn9?5q|Hf9bzll#(c%^d&@c=|lF2-_9Braz!S1y+|HKJuo$7=?5odWhVG zAA_ty)*%KV8xSeTeMpze7Gx7*n8`y36Y?0o0zX0ISNL5JeMFwXk0YQ6Gz5$UVR+Bh za>oebKoAQ>LpmUov+oh&ty%hY%B!SO;r^-NB>IuS(5Vu$=ykj^N1_(Fz8@6+0LGcP AI{*Lx diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJISPro-UTF8-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJISPro-UTF8-V.bcmap deleted file mode 100644 index 1849d809a679e56414f4e18dce8ca3c41109e84e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 726 zcmXxgT~8B16b9gTW_Js1`H(_H0)?8W@dl_~pp7wxk}41c(hm@UAPXCT&=0m1f*8^Y zB{3-mlad&NSH?>dZcLhy-E{PKOwsKR;4io!X7Xgtyl3WIjPyG^kW6jr%P*HQzB_?{ zzx%G=AMo`rCRNQB*-U4&c-l9VSV-!rq&}a~7JFR%tE;|?`)Qx9r8Ry1Jd9|Xucvop zXdpBi3H_;$C63r${xUo$uOdTF-gd2JtbyKP`36C@+uU_ zP=XCs_N(z6k~^P(XMem85@^@%6ewyyb6dIiRVlB_L1OJ4p7yB@tC%G$0K)Fs9@-w* z`fZQGtyZzXo=}O_+PW_H+YUvdvZPVf^yT&uQ_6j zDNbX-K8=DHv-Xptw>b3#+p5_kV*;-Ua`R&Z|5h7va~Gupb$LG|Ip6!gm77A>WlNQ- zJKu>(6&R5Z1K^z?qA%>O7IwI&G+df2O*oWV#X-%u-drubS40S=0^S1df*1jBh8UH^ zIQVrcqTo*O4v0yJDVU8gokYxl-+Y&3?q?y^A=2ROlGp&h39$uJhUp>V4a^$wCL*?B)}caCaiAiRiXC249o79G zsMG-!x6Ng90$e^8gT$B)I?ql%8*#7K{tj<$x&zJdplw%n2kF^Kp*%udL2`ETsS^4N DWh&!c diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJISX0213-UTF32-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJISX0213-UTF32-H.bcmap deleted file mode 100644 index a83a677c56df6f1ac395d2ba71e60a08b0985e97..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 40517 zcmYJb2Ut~EmM^~c-shZ~fqThO1SA+hK#Ul#m=zRrAgBn40wQLS-iLI#mz>k(l0ifS z)UvANR<%~plCGZauV>!8o~{lvRr9*0EZYi`yWh-PhxvcszbN6{6Zctrh2Q$EwJ-g{ z0dqm&jiTJ_oZ{fvHEWhHi(9^YP4MQk1*fxuQ*T@@&boLxcxV2Zf}+BLqRir~v(ehk z7cKHDC=@o(N$$h7fELnQau0&eCDP5 zve;*{i;s_&_R~9IFV6UQ`@E1|sJ=4jQVn>57w^qi_I`QD>&q1F3kY8n7G+lBfv`VE zffhbJ2cNEjuNHzAoB&;FFdm5Jy_Z8G!dFk)+VvAaS zx=zb~yzTd5X~>IKK2iwz+!^8Aur_Gok6_z%ev z|KXfpvfGOdYCfLsbw>Bqa_yHFy}tDGdl4Dp@8|C)zkh=NkmzPK@gGtpGsBxT7ZZaWBfs(q!T zkWhZe8d70c2h2?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FTfI0qB5n-@ZgdMxua0nDeOOI!Zs`C60rxTEOd)#z**mhtnc!v%MF-p* z6(b=k*xbiC@Gu95F^DiAH0t~TVTGPgUG!`ssWRhQK=kw<;&tJ%rBFU_}ZEEE0s7mb`wDO?Z zs;2R9lJZL$m-Fq1t@&KTlAnp?PiF?Eh zF|DKfPGRl}GWQL!Or(jDAKk;RQ&?G&{FMyD%F1V~&8=dUIp5o{@+uRg$KS;I`|>(^ zQ!SD=D|7D|GA|{g_gXM-jia}rFt5nCR}$!bV(1+TtoxiZ1?$@x`YQcDv9WrV#YWOe L`x{R{YNY=HNrj7y diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJISX02132004-UTF32-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniJISX02132004-UTF32-H.bcmap deleted file mode 100644 index e1a988dc9e80be9a0803e22d021b1e81fdcc5b94..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 40608 zcmYIw2V7KHn(uecx%XBEs>nG?Fo1xV#ZY1vP|Sg#A|MKgm@qKsl8P#F&P4`M5mDRj zmg*kupe-{yGdsIGZ+3dZZufiBt8Lq1XJ>Y2-`n?H_WgdZX{&BH_ug~Q`NIGEf8Qzk zhrQ;)qN~MuIk_c4v8z@sT@tr+>8hZOrwUJG2c=!TP?CM_LeTbtlZC}ag~eGV*{7nl z8_%8%ns0w0s5tvVcJU?UU|M!|P;|_$?dGK9v?N9V|NH2_%0lNi0*P6~{bN~y6m*~s z=3CSBxIdDAJkcvI+@-hmNlcX~WX>I@nKJ(Ch zQR21H$;-<_`{~WF=O?{9y`D?YRbLu(X$EZI!TSr8qhIXz_###N9KsibMVZxjBJ8hG zpoLFQ!>23Y%V6+;qo7L*!V}TF|3XNF{A8p2Bt-i3hW5D>vgY|Jujk7{Uidma-=vnG ztkLoxuKPS+9P<2}&vTQGPr7qamllK9rvBBc{(YKcW_YvaJm7yy zjn<{P;LcA!i}NsgxO%vI@X0eTj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N+@tT(Vb8LLZ7be0EiWG&g1)JUEv(YY?2rm)%A%oyaE$W^mZ2667|1Z$WUuRO7vd zAP?8~DF|k1#`_r(%;vK+1ap+Z(seL5#(1BB;9^2@Cf!90nlA-u-SnPm^2B95I=GAt z^IJ~j8U$Am!o>1+Nm zyzkE-xPc9m-l!Wa`35(!AJg1S2=m**ezy?h!TbIWg4^Sb_xBOx-mX^?+$l!=6a=}c z>*EmItsC`IC0GQ5F1l?a~T%>qmCByX;k;AviMK=3S^ji7UfQNIbnb3|@Mu#{KZ5iDa!OOgP8bSV!s4tNq|0<}zIB6$h)L$aOo5+fzQ%CS&#;fc9tK@&D z{J-V@NkPOZd2#O5fftuvthtpoGF5Mwg@5F#hIFlAfojN`WY{(oNW)saVZAi$q^2H? z8Pb@kHD;^ErCMXYYFsCcn^og>H14LUfQ3|WIt@3LTNGSJmo%y(` zV2XEl{UP_A7yJKp_rD}<_^;}p4!J7!aQzGY*5Q$Rs$s8c zIH+im-B2tIXYgSw8cNVmCJpD&P@y$cqM-&Kwh2WcAGWK8yZEp}8Xlm5oZwn%cq|Qd z_>UFRDERLuK%a>ZJMn?>X{s>>jq&(Uq#CE<|5T!JIvP_fjWf}hrW)tsAIz!VJLspEX9_^AqP|Cu9TdZ*UXy={b&D27i$y S(T;EjMeP+lDW8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T6PlOl9jqJb9BicPktn1f%($8{>XnCWig|Kv4m1*8PIg4Ex1_ WYzZKilxEs5#lWzyu91adzbpV2cs2|G diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniKS-UTF16-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniKS-UTF16-H.bcmap deleted file mode 100644 index fd4e66e81f3507b190fb2986a26a45c1c380e302..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 26327 zcmZs@XK+=?vM!ieRcmd(<-HJ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aniMXpObTP2Nm)(%NLlan>_{VJhr@8xEQPCVlM?;^t0B9v diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniKS-UTF16-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniKS-UTF16-V.bcmap deleted file mode 100644 index 075efb7054901b1022af68e723647769cbe1d556..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 164 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T8=9Bt9jqG~;$~>3>*2_)AhxfT zk9~fwLi5~Q1}+vx1|1$o21W)s^F|h%M0N#X#(mZEa~StkuyXEaWMbS`-#oX7aX+sB L>wZCNru|X?)N3(k diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniKS-UTF32-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniKS-UTF32-H.bcmap deleted file mode 100644 index 769d2142c03b10680800b3b6ae883e27fe04c5a2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 26451 zcmZs@S8!FyvM88YRcmd(<-HIxNC~kbzNCdUp8C48k||bWyUT1TS~aM+?WJ(sxlzbW z$@HS6{C3e7UE7w$>$v$nl zXS)RPkO1-J8vxiZzt?_kILtY-U5P1BnQuwv%3|AIbAjtLsA!UEkW`r*^d=p0daOa% zYEEHg4CF1kIF=u8FV~r`A!kfwIR{zD<=v{)iI$sMD*zW(9k3+JbFf^jG&d#LuNXF! z6Q(n_|Hu0vS=N{hK$8Z>)XQmYEI_W_syW095_a<3xDvi5Wj9|PmtVevDl)Arn2y#h zpXn$~VHu!i2@v=9G=XI>wK}1~+GsG*w9y32NPQEM)ut%m>^9BjI;B@Ay+_3+8W~L* zLKfdH0auywfa@7TmT4dIOj8EvKoISu@(fUwX8~-2_q(|%3rle)mOfpt4qQ*@}$4`UpHrOj6P=)5FFj@n_KR2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/libs/pdfjs-1.6.210p1/bcmaps/UniKS-UTF32-V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniKS-UTF32-V.bcmap deleted file mode 100644 index bdab208b69d287128195eccbd084c8cf4ca658c3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 168 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T8=9Bt9jqG~;%025>*37Jz@Q+u zua=K}ey&3E+*}4O7Dfgg9!3U6208Oa7Mo;tpu8~SzUuiojQc8BIrlR%G488xo?FDY OpI3l&zo0eKeklND@-b-u diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniKS-UTF8-H.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/UniKS-UTF8-H.bcmap deleted file mode 100644 index 6ff8674af772af896d7d33c7addc37c57822f8a2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 27790 zcmZ6zXHZ?qvM!ieRcmd_#tRS# zwWRKI&b#l$M9fUY{G0jprth1HnRoAt^L|fE%uFs&pZj83z1geQs#R5)m6etGW!7f@ zu`sQs_R-zytJm%&?nqAFzGdh3?a7I$mujjmCl)=byLb6kU1Ij_i#2y^YwljSclpv* zW9rSDi3|1X67OEFyL|V7cC+a6<;1Pq^0L!1@{2M6;RWJvKYcsO@IU_a)35)}QI7xh zr=NcM<^TSFjwT|kz*N&;h7jz_n2|k%3lIsOyWlPp$03|a{Ym3rKFWKxIGN*pU_0Ty z?0KwHJx5awf9;ff1vH+J`Y-?ioIar-QkVbLk2oly}W_o^`lrZX!-7RE%$T_ATG z0OUS;AV8JLGDYqOnGABjY6f{&`<7|+H$v{AzwKrA=eE$4RQ&IL{jJEl`;VWRE+|Xm zWP$OKtoNNaf~@ve*vm>48DVhVWX?FF9(3IKRJd>0uk2+qmIkC~A6b73LEZqYfU~>; zjxgYRk?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8dfa76a58eb720dd1992c2cc9abf1dd4b39c5a66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 169 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T6PlOl9jqG~;%1@i;l%x@VcNc0 zKKADSxe6P;=Q41yFf!=yFfuSQG{%{?u-GKAKWdoFxUahTe-7im3Rcejj7*IC>Nk8Z RV%*Owz`9?sv6^YW6ad@#ITio_ diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/V.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/V.bcmap deleted file mode 100644 index fdec9906621904180f42bd5c91f377397fd6cf95..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 166 zcmZR65agU+P+63jo>8J;XlZGnYh++xso>knU|bjRFGekSdyBe z$K{xlqX1T4tWcC%oLW={5)4jFRnXJ-@pN|e3wC|T=#j{(sKmI}pOXoN*Dkx{jjaUT-^bqy(L diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/WP-Symbol.bcmap b/services/web/public/js/libs/pdfjs-1.6.210p1/bcmaps/WP-Symbol.bcmap deleted file mode 100644 index 46729bbf30f3b2f176492d907fb8ca3f6a1e3026..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 179 zcmW;C-wMG{90&04*(h8{xuKNv0%qLpa><2~3lnNLW=^QFb+%;wBoDUVIgjE|#O#wbv3o&3S`2gr-Jo93r6xVAssnXnw1B!ZT0%WQ!k{%%Po}{NAH@>d0EGtm W&}LiN6j32_>FyT<6+0XN diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/compatibility.js b/services/web/public/js/libs/pdfjs-1.6.210p1/compatibility.js deleted file mode 100644 index 2874bcb12e..0000000000 --- a/services/web/public/js/libs/pdfjs-1.6.210p1/compatibility.js +++ /dev/null @@ -1,596 +0,0 @@ -/* Copyright 2012 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* globals VBArray, PDFJS */ - -(function compatibilityWrapper() { - 'use strict'; - -// Initializing PDFJS global object here, it case if we need to change/disable -// some PDF.js features, e.g. range requests -if (typeof PDFJS === 'undefined') { - (typeof window !== 'undefined' ? window : this).PDFJS = {}; -} - -// Checking if the typed arrays are supported -// Support: iOS<6.0 (subarray), IE<10, Android<4.0 -(function checkTypedArrayCompatibility() { - if (typeof Uint8Array !== 'undefined') { - // Support: iOS<6.0 - if (typeof Uint8Array.prototype.subarray === 'undefined') { - Uint8Array.prototype.subarray = function subarray(start, end) { - return new Uint8Array(this.slice(start, end)); - }; - Float32Array.prototype.subarray = function subarray(start, end) { - return new Float32Array(this.slice(start, end)); - }; - } - - // Support: Android<4.1 - if (typeof Float64Array === 'undefined') { - window.Float64Array = Float32Array; - } - return; - } - - function subarray(start, end) { - return new TypedArray(this.slice(start, end)); - } - - function setArrayOffset(array, offset) { - if (arguments.length < 2) { - offset = 0; - } - for (var i = 0, n = array.length; i < n; ++i, ++offset) { - this[offset] = array[i] & 0xFF; - } - } - - function TypedArray(arg1) { - var result, i, n; - if (typeof arg1 === 'number') { - result = []; - for (i = 0; i < arg1; ++i) { - result[i] = 0; - } - } else if ('slice' in arg1) { - result = arg1.slice(0); - } else { - result = []; - for (i = 0, n = arg1.length; i < n; ++i) { - result[i] = arg1[i]; - } - } - - result.subarray = subarray; - result.buffer = result; - result.byteLength = result.length; - result.set = setArrayOffset; - - if (typeof arg1 === 'object' && arg1.buffer) { - result.buffer = arg1.buffer; - } - return result; - } - - window.Uint8Array = TypedArray; - window.Int8Array = TypedArray; - - // we don't need support for set, byteLength for 32-bit array - // so we can use the TypedArray as well - window.Uint32Array = TypedArray; - window.Int32Array = TypedArray; - window.Uint16Array = TypedArray; - window.Float32Array = TypedArray; - window.Float64Array = TypedArray; -})(); - -// URL = URL || webkitURL -// Support: Safari<7, Android 4.2+ -(function normalizeURLObject() { - if (!window.URL) { - window.URL = window.webkitURL; - } -})(); - -// Object.defineProperty()? -// Support: Android<4.0, Safari<5.1 -(function checkObjectDefinePropertyCompatibility() { - if (typeof Object.defineProperty !== 'undefined') { - var definePropertyPossible = true; - try { - // some browsers (e.g. safari) cannot use defineProperty() on DOM objects - // and thus the native version is not sufficient - Object.defineProperty(new Image(), 'id', { value: 'test' }); - // ... another test for android gb browser for non-DOM objects - var Test = function Test() {}; - Test.prototype = { get id() { } }; - Object.defineProperty(new Test(), 'id', - { value: '', configurable: true, enumerable: true, writable: false }); - } catch (e) { - definePropertyPossible = false; - } - if (definePropertyPossible) { - return; - } - } - - Object.defineProperty = function objectDefineProperty(obj, name, def) { - delete obj[name]; - if ('get' in def) { - obj.__defineGetter__(name, def['get']); - } - if ('set' in def) { - obj.__defineSetter__(name, def['set']); - } - if ('value' in def) { - obj.__defineSetter__(name, function objectDefinePropertySetter(value) { - this.__defineGetter__(name, function objectDefinePropertyGetter() { - return value; - }); - return value; - }); - obj[name] = def.value; - } - }; -})(); - - -// No XMLHttpRequest#response? -// Support: IE<11, Android <4.0 -(function checkXMLHttpRequestResponseCompatibility() { - var xhrPrototype = XMLHttpRequest.prototype; - var xhr = new XMLHttpRequest(); - if (!('overrideMimeType' in xhr)) { - // IE10 might have response, but not overrideMimeType - // Support: IE10 - Object.defineProperty(xhrPrototype, 'overrideMimeType', { - value: function xmlHttpRequestOverrideMimeType(mimeType) {} - }); - } - if ('responseType' in xhr) { - return; - } - - // The worker will be using XHR, so we can save time and disable worker. - PDFJS.disableWorker = true; - - Object.defineProperty(xhrPrototype, 'responseType', { - get: function xmlHttpRequestGetResponseType() { - return this._responseType || 'text'; - }, - set: function xmlHttpRequestSetResponseType(value) { - if (value === 'text' || value === 'arraybuffer') { - this._responseType = value; - if (value === 'arraybuffer' && - typeof this.overrideMimeType === 'function') { - this.overrideMimeType('text/plain; charset=x-user-defined'); - } - } - } - }); - - // Support: IE9 - if (typeof VBArray !== 'undefined') { - Object.defineProperty(xhrPrototype, 'response', { - get: function xmlHttpRequestResponseGet() { - if (this.responseType === 'arraybuffer') { - return new Uint8Array(new VBArray(this.responseBody).toArray()); - } else { - return this.responseText; - } - } - }); - return; - } - - Object.defineProperty(xhrPrototype, 'response', { - get: function xmlHttpRequestResponseGet() { - if (this.responseType !== 'arraybuffer') { - return this.responseText; - } - var text = this.responseText; - var i, n = text.length; - var result = new Uint8Array(n); - for (i = 0; i < n; ++i) { - result[i] = text.charCodeAt(i) & 0xFF; - } - return result.buffer; - } - }); -})(); - -// window.btoa (base64 encode function) ? -// Support: IE<10 -(function checkWindowBtoaCompatibility() { - if ('btoa' in window) { - return; - } - - var digits = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - - window.btoa = function windowBtoa(chars) { - var buffer = ''; - var i, n; - for (i = 0, n = chars.length; i < n; i += 3) { - var b1 = chars.charCodeAt(i) & 0xFF; - var b2 = chars.charCodeAt(i + 1) & 0xFF; - var b3 = chars.charCodeAt(i + 2) & 0xFF; - var d1 = b1 >> 2, d2 = ((b1 & 3) << 4) | (b2 >> 4); - var d3 = i + 1 < n ? ((b2 & 0xF) << 2) | (b3 >> 6) : 64; - var d4 = i + 2 < n ? (b3 & 0x3F) : 64; - buffer += (digits.charAt(d1) + digits.charAt(d2) + - digits.charAt(d3) + digits.charAt(d4)); - } - return buffer; - }; -})(); - -// window.atob (base64 encode function)? -// Support: IE<10 -(function checkWindowAtobCompatibility() { - if ('atob' in window) { - return; - } - - // https://github.com/davidchambers/Base64.js - var digits = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - window.atob = function (input) { - input = input.replace(/=+$/, ''); - if (input.length % 4 === 1) { - throw new Error('bad atob input'); - } - for ( - // initialize result and counters - var bc = 0, bs, buffer, idx = 0, output = ''; - // get next character - buffer = input.charAt(idx++); - // character found in table? - // initialize bit storage and add its ascii value - ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, - // and if not first of each 4 characters, - // convert the first 8 bits to one ascii character - bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 - ) { - // try to find character in table (0-63, not found => -1) - buffer = digits.indexOf(buffer); - } - return output; - }; -})(); - -// Function.prototype.bind? -// Support: Android<4.0, iOS<6.0 -(function checkFunctionPrototypeBindCompatibility() { - if (typeof Function.prototype.bind !== 'undefined') { - return; - } - - Function.prototype.bind = function functionPrototypeBind(obj) { - var fn = this, headArgs = Array.prototype.slice.call(arguments, 1); - var bound = function functionPrototypeBindBound() { - var args = headArgs.concat(Array.prototype.slice.call(arguments)); - return fn.apply(obj, args); - }; - return bound; - }; -})(); - -// HTMLElement dataset property -// Support: IE<11, Safari<5.1, Android<4.0 -(function checkDatasetProperty() { - var div = document.createElement('div'); - if ('dataset' in div) { - return; // dataset property exists - } - - Object.defineProperty(HTMLElement.prototype, 'dataset', { - get: function() { - if (this._dataset) { - return this._dataset; - } - - var dataset = {}; - for (var j = 0, jj = this.attributes.length; j < jj; j++) { - var attribute = this.attributes[j]; - if (attribute.name.substring(0, 5) !== 'data-') { - continue; - } - var key = attribute.name.substring(5).replace(/\-([a-z])/g, - function(all, ch) { - return ch.toUpperCase(); - }); - dataset[key] = attribute.value; - } - - Object.defineProperty(this, '_dataset', { - value: dataset, - writable: false, - enumerable: false - }); - return dataset; - }, - enumerable: true - }); -})(); - -// HTMLElement classList property -// Support: IE<10, Android<4.0, iOS<5.0 -(function checkClassListProperty() { - var div = document.createElement('div'); - if ('classList' in div) { - return; // classList property exists - } - - function changeList(element, itemName, add, remove) { - var s = element.className || ''; - var list = s.split(/\s+/g); - if (list[0] === '') { - list.shift(); - } - var index = list.indexOf(itemName); - if (index < 0 && add) { - list.push(itemName); - } - if (index >= 0 && remove) { - list.splice(index, 1); - } - element.className = list.join(' '); - return (index >= 0); - } - - var classListPrototype = { - add: function(name) { - changeList(this.element, name, true, false); - }, - contains: function(name) { - return changeList(this.element, name, false, false); - }, - remove: function(name) { - changeList(this.element, name, false, true); - }, - toggle: function(name) { - changeList(this.element, name, true, true); - } - }; - - Object.defineProperty(HTMLElement.prototype, 'classList', { - get: function() { - if (this._classList) { - return this._classList; - } - - var classList = Object.create(classListPrototype, { - element: { - value: this, - writable: false, - enumerable: true - } - }); - Object.defineProperty(this, '_classList', { - value: classList, - writable: false, - enumerable: false - }); - return classList; - }, - enumerable: true - }); -})(); - -// Check console compatibility -// In older IE versions the console object is not available -// unless console is open. -// Support: IE<10 -(function checkConsoleCompatibility() { - if (!('console' in window)) { - window.console = { - log: function() {}, - error: function() {}, - warn: function() {} - }; - } else if (!('bind' in console.log)) { - // native functions in IE9 might not have bind - console.log = (function(fn) { - return function(msg) { return fn(msg); }; - })(console.log); - console.error = (function(fn) { - return function(msg) { return fn(msg); }; - })(console.error); - console.warn = (function(fn) { - return function(msg) { return fn(msg); }; - })(console.warn); - } -})(); - -// Check onclick compatibility in Opera -// Support: Opera<15 -(function checkOnClickCompatibility() { - // workaround for reported Opera bug DSK-354448: - // onclick fires on disabled buttons with opaque content - function ignoreIfTargetDisabled(event) { - if (isDisabled(event.target)) { - event.stopPropagation(); - } - } - function isDisabled(node) { - return node.disabled || (node.parentNode && isDisabled(node.parentNode)); - } - if (navigator.userAgent.indexOf('Opera') !== -1) { - // use browser detection since we cannot feature-check this bug - document.addEventListener('click', ignoreIfTargetDisabled, true); - } -})(); - -// Checks if possible to use URL.createObjectURL() -// Support: IE -(function checkOnBlobSupport() { - // sometimes IE loosing the data created with createObjectURL(), see #3977 - if (navigator.userAgent.indexOf('Trident') >= 0) { - PDFJS.disableCreateObjectURL = true; - } -})(); - -// Checks if navigator.language is supported -(function checkNavigatorLanguage() { - if ('language' in navigator) { - return; - } - PDFJS.locale = navigator.userLanguage || 'en-US'; -})(); - -(function checkRangeRequests() { - // Safari has issues with cached range requests see: - // https://github.com/mozilla/pdf.js/issues/3260 - // Last tested with version 6.0.4. - // Support: Safari 6.0+ - var isSafari = Object.prototype.toString.call( - window.HTMLElement).indexOf('Constructor') > 0; - - // Older versions of Android (pre 3.0) has issues with range requests, see: - // https://github.com/mozilla/pdf.js/issues/3381. - // Make sure that we only match webkit-based Android browsers, - // since Firefox/Fennec works as expected. - // Support: Android<3.0 - var regex = /Android\s[0-2][^\d]/; - var isOldAndroid = regex.test(navigator.userAgent); - - // Range requests are broken in Chrome 39 and 40, https://crbug.com/442318 - var isChromeWithRangeBug = /Chrome\/(39|40)\./.test(navigator.userAgent); - - if (isSafari || isOldAndroid || isChromeWithRangeBug) { - PDFJS.disableRange = true; - PDFJS.disableStream = true; - } -})(); - -// Check if the browser supports manipulation of the history. -// Support: IE<10, Android<4.2 -(function checkHistoryManipulation() { - // Android 2.x has so buggy pushState support that it was removed in - // Android 3.0 and restored as late as in Android 4.2. - // Support: Android 2.x - if (!history.pushState || navigator.userAgent.indexOf('Android 2.') >= 0) { - PDFJS.disableHistory = true; - } -})(); - -// Support: IE<11, Chrome<21, Android<4.4, Safari<6 -(function checkSetPresenceInImageData() { - // IE < 11 will use window.CanvasPixelArray which lacks set function. - if (window.CanvasPixelArray) { - if (typeof window.CanvasPixelArray.prototype.set !== 'function') { - window.CanvasPixelArray.prototype.set = function(arr) { - for (var i = 0, ii = this.length; i < ii; i++) { - this[i] = arr[i]; - } - }; - } - } else { - // Old Chrome and Android use an inaccessible CanvasPixelArray prototype. - // Because we cannot feature detect it, we rely on user agent parsing. - var polyfill = false, versionMatch; - if (navigator.userAgent.indexOf('Chrom') >= 0) { - versionMatch = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./); - // Chrome < 21 lacks the set function. - polyfill = versionMatch && parseInt(versionMatch[2]) < 21; - } else if (navigator.userAgent.indexOf('Android') >= 0) { - // Android < 4.4 lacks the set function. - // Android >= 4.4 will contain Chrome in the user agent, - // thus pass the Chrome check above and not reach this block. - polyfill = /Android\s[0-4][^\d]/g.test(navigator.userAgent); - } else if (navigator.userAgent.indexOf('Safari') >= 0) { - versionMatch = navigator.userAgent. - match(/Version\/([0-9]+)\.([0-9]+)\.([0-9]+) Safari\//); - // Safari < 6 lacks the set function. - polyfill = versionMatch && parseInt(versionMatch[1]) < 6; - } - - if (polyfill) { - var contextPrototype = window.CanvasRenderingContext2D.prototype; - var createImageData = contextPrototype.createImageData; - contextPrototype.createImageData = function(w, h) { - var imageData = createImageData.call(this, w, h); - imageData.data.set = function(arr) { - for (var i = 0, ii = this.length; i < ii; i++) { - this[i] = arr[i]; - } - }; - return imageData; - }; - // this closure will be kept referenced, so clear its vars - contextPrototype = null; - } - } -})(); - -// Support: IE<10, Android<4.0, iOS -(function checkRequestAnimationFrame() { - function fakeRequestAnimationFrame(callback) { - window.setTimeout(callback, 20); - } - - var isIOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent); - if (isIOS) { - // requestAnimationFrame on iOS is broken, replacing with fake one. - window.requestAnimationFrame = fakeRequestAnimationFrame; - return; - } - if ('requestAnimationFrame' in window) { - return; - } - window.requestAnimationFrame = - window.mozRequestAnimationFrame || - window.webkitRequestAnimationFrame || - fakeRequestAnimationFrame; -})(); - -(function checkCanvasSizeLimitation() { - var isIOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent); - var isAndroid = /Android/g.test(navigator.userAgent); - if (isIOS || isAndroid) { - // 5MP - PDFJS.maxCanvasPixels = 5242880; - } -})(); - -// Disable fullscreen support for certain problematic configurations. -// Support: IE11+ (when embedded). -(function checkFullscreenSupport() { - var isEmbeddedIE = (navigator.userAgent.indexOf('Trident') >= 0 && - window.parent !== window); - if (isEmbeddedIE) { - PDFJS.disableFullscreen = true; - } -})(); - -// Provides document.currentScript support -// Support: IE, Chrome<29. -(function checkCurrentScript() { - if ('currentScript' in document) { - return; - } - Object.defineProperty(document, 'currentScript', { - get: function () { - var scripts = document.getElementsByTagName('script'); - return scripts[scripts.length - 1]; - }, - enumerable: true, - configurable: true - }); -})(); - -}).call((typeof window === 'undefined') ? this : window); diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/pdf.js b/services/web/public/js/libs/pdfjs-1.6.210p1/pdf.js deleted file mode 100644 index 2d3c3c83bc..0000000000 --- a/services/web/public/js/libs/pdfjs-1.6.210p1/pdf.js +++ /dev/null @@ -1,11515 +0,0 @@ -/* Copyright 2012 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* jshint globalstrict: false */ -/* umdutils ignore */ - -(function (root, factory) { - 'use strict'; - if (typeof define === 'function' && define.amd) { -define('pdfjs-dist/build/pdf', ['exports'], factory); - } else if (typeof exports !== 'undefined') { - factory(exports); - } else { -factory((root.pdfjsDistBuildPdf = {})); - } -}(this, function (exports) { - // Use strict in our context only - users might not want it - 'use strict'; - -var pdfjsVersion = '1.6.210'; -var pdfjsBuild = '4ce2356'; - - var pdfjsFilePath = - typeof document !== 'undefined' && document.currentScript ? - document.currentScript.src : null; - - var pdfjsLibs = {}; - - (function pdfjsWrapper() { - - - -(function (root, factory) { - { - factory((root.pdfjsSharedUtil = {})); - } -}(this, function (exports) { - -var globalScope = (typeof window !== 'undefined') ? window : - (typeof global !== 'undefined') ? global : - (typeof self !== 'undefined') ? self : this; - -var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; - -var TextRenderingMode = { - FILL: 0, - STROKE: 1, - FILL_STROKE: 2, - INVISIBLE: 3, - FILL_ADD_TO_PATH: 4, - STROKE_ADD_TO_PATH: 5, - FILL_STROKE_ADD_TO_PATH: 6, - ADD_TO_PATH: 7, - FILL_STROKE_MASK: 3, - ADD_TO_PATH_FLAG: 4 -}; - -var ImageKind = { - GRAYSCALE_1BPP: 1, - RGB_24BPP: 2, - RGBA_32BPP: 3 -}; - -var AnnotationType = { - TEXT: 1, - LINK: 2, - FREETEXT: 3, - LINE: 4, - SQUARE: 5, - CIRCLE: 6, - POLYGON: 7, - POLYLINE: 8, - HIGHLIGHT: 9, - UNDERLINE: 10, - SQUIGGLY: 11, - STRIKEOUT: 12, - STAMP: 13, - CARET: 14, - INK: 15, - POPUP: 16, - FILEATTACHMENT: 17, - SOUND: 18, - MOVIE: 19, - WIDGET: 20, - SCREEN: 21, - PRINTERMARK: 22, - TRAPNET: 23, - WATERMARK: 24, - THREED: 25, - REDACT: 26 -}; - -var AnnotationFlag = { - INVISIBLE: 0x01, - HIDDEN: 0x02, - PRINT: 0x04, - NOZOOM: 0x08, - NOROTATE: 0x10, - NOVIEW: 0x20, - READONLY: 0x40, - LOCKED: 0x80, - TOGGLENOVIEW: 0x100, - LOCKEDCONTENTS: 0x200 -}; - -var AnnotationFieldFlag = { - READONLY: 0x0000001, - REQUIRED: 0x0000002, - NOEXPORT: 0x0000004, - MULTILINE: 0x0001000, - PASSWORD: 0x0002000, - NOTOGGLETOOFF: 0x0004000, - RADIO: 0x0008000, - PUSHBUTTON: 0x0010000, - COMBO: 0x0020000, - EDIT: 0x0040000, - SORT: 0x0080000, - FILESELECT: 0x0100000, - MULTISELECT: 0x0200000, - DONOTSPELLCHECK: 0x0400000, - DONOTSCROLL: 0x0800000, - COMB: 0x1000000, - RICHTEXT: 0x2000000, - RADIOSINUNISON: 0x2000000, - COMMITONSELCHANGE: 0x4000000, -}; - -var AnnotationBorderStyleType = { - SOLID: 1, - DASHED: 2, - BEVELED: 3, - INSET: 4, - UNDERLINE: 5 -}; - -var StreamType = { - UNKNOWN: 0, - FLATE: 1, - LZW: 2, - DCT: 3, - JPX: 4, - JBIG: 5, - A85: 6, - AHX: 7, - CCF: 8, - RL: 9 -}; - -var FontType = { - UNKNOWN: 0, - TYPE1: 1, - TYPE1C: 2, - CIDFONTTYPE0: 3, - CIDFONTTYPE0C: 4, - TRUETYPE: 5, - CIDFONTTYPE2: 6, - TYPE3: 7, - OPENTYPE: 8, - TYPE0: 9, - MMTYPE1: 10 -}; - -var VERBOSITY_LEVELS = { - errors: 0, - warnings: 1, - infos: 5 -}; - -// All the possible operations for an operator list. -var OPS = { - // Intentionally start from 1 so it is easy to spot bad operators that will be - // 0's. - dependency: 1, - setLineWidth: 2, - setLineCap: 3, - setLineJoin: 4, - setMiterLimit: 5, - setDash: 6, - setRenderingIntent: 7, - setFlatness: 8, - setGState: 9, - save: 10, - restore: 11, - transform: 12, - moveTo: 13, - lineTo: 14, - curveTo: 15, - curveTo2: 16, - curveTo3: 17, - closePath: 18, - rectangle: 19, - stroke: 20, - closeStroke: 21, - fill: 22, - eoFill: 23, - fillStroke: 24, - eoFillStroke: 25, - closeFillStroke: 26, - closeEOFillStroke: 27, - endPath: 28, - clip: 29, - eoClip: 30, - beginText: 31, - endText: 32, - setCharSpacing: 33, - setWordSpacing: 34, - setHScale: 35, - setLeading: 36, - setFont: 37, - setTextRenderingMode: 38, - setTextRise: 39, - moveText: 40, - setLeadingMoveText: 41, - setTextMatrix: 42, - nextLine: 43, - showText: 44, - showSpacedText: 45, - nextLineShowText: 46, - nextLineSetSpacingShowText: 47, - setCharWidth: 48, - setCharWidthAndBounds: 49, - setStrokeColorSpace: 50, - setFillColorSpace: 51, - setStrokeColor: 52, - setStrokeColorN: 53, - setFillColor: 54, - setFillColorN: 55, - setStrokeGray: 56, - setFillGray: 57, - setStrokeRGBColor: 58, - setFillRGBColor: 59, - setStrokeCMYKColor: 60, - setFillCMYKColor: 61, - shadingFill: 62, - beginInlineImage: 63, - beginImageData: 64, - endInlineImage: 65, - paintXObject: 66, - markPoint: 67, - markPointProps: 68, - beginMarkedContent: 69, - beginMarkedContentProps: 70, - endMarkedContent: 71, - beginCompat: 72, - endCompat: 73, - paintFormXObjectBegin: 74, - paintFormXObjectEnd: 75, - beginGroup: 76, - endGroup: 77, - beginAnnotations: 78, - endAnnotations: 79, - beginAnnotation: 80, - endAnnotation: 81, - paintJpegXObject: 82, - paintImageMaskXObject: 83, - paintImageMaskXObjectGroup: 84, - paintImageXObject: 85, - paintInlineImageXObject: 86, - paintInlineImageXObjectGroup: 87, - paintImageXObjectRepeat: 88, - paintImageMaskXObjectRepeat: 89, - paintSolidColorImageMask: 90, - constructPath: 91 -}; - -var verbosity = VERBOSITY_LEVELS.warnings; - -function setVerbosityLevel(level) { - verbosity = level; -} - -function getVerbosityLevel() { - return verbosity; -} - -// A notice for devs. These are good for things that are helpful to devs, such -// as warning that Workers were disabled, which is important to devs but not -// end users. -function info(msg) { - if (verbosity >= VERBOSITY_LEVELS.infos) { - console.log('Info: ' + msg); - } -} - -// Non-fatal warnings. -function warn(msg) { - if (verbosity >= VERBOSITY_LEVELS.warnings) { - console.log('Warning: ' + msg); - } -} - -// Deprecated API function -- display regardless of the PDFJS.verbosity setting. -function deprecated(details) { - console.log('Deprecated API usage: ' + details); -} - -// Fatal errors that should trigger the fallback UI and halt execution by -// throwing an exception. -function error(msg) { - if (verbosity >= VERBOSITY_LEVELS.errors) { - console.log('Error: ' + msg); - console.log(backtrace()); - } - throw new Error(msg); -} - -function backtrace() { - try { - throw new Error(); - } catch (e) { - return e.stack ? e.stack.split('\n').slice(2).join('\n') : ''; - } -} - -function assert(cond, msg) { - if (!cond) { - error(msg); - } -} - -var UNSUPPORTED_FEATURES = { - unknown: 'unknown', - forms: 'forms', - javaScript: 'javaScript', - smask: 'smask', - shadingPattern: 'shadingPattern', - font: 'font' -}; - -// Checks if URLs have the same origin. For non-HTTP based URLs, returns false. -function isSameOrigin(baseUrl, otherUrl) { - try { - var base = new URL(baseUrl); - if (!base.origin || base.origin === 'null') { - return false; // non-HTTP url - } - } catch (e) { - return false; - } - - var other = new URL(otherUrl, base); - return base.origin === other.origin; -} - -// Validates if URL is safe and allowed, e.g. to avoid XSS. -function isValidUrl(url, allowRelative) { - if (!url || typeof url !== 'string') { - return false; - } - // RFC 3986 (http://tools.ietf.org/html/rfc3986#section-3.1) - // scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - var protocol = /^[a-z][a-z0-9+\-.]*(?=:)/i.exec(url); - if (!protocol) { - return allowRelative; - } - protocol = protocol[0].toLowerCase(); - switch (protocol) { - case 'http': - case 'https': - case 'ftp': - case 'mailto': - case 'tel': - return true; - default: - return false; - } -} - -function shadow(obj, prop, value) { - Object.defineProperty(obj, prop, { value: value, - enumerable: true, - configurable: true, - writable: false }); - return value; -} - -function getLookupTableFactory(initializer) { - var lookup; - return function () { - if (initializer) { - lookup = Object.create(null); - initializer(lookup); - initializer = null; - } - return lookup; - }; -} - -var PasswordResponses = { - NEED_PASSWORD: 1, - INCORRECT_PASSWORD: 2 -}; - -var PasswordException = (function PasswordExceptionClosure() { - function PasswordException(msg, code) { - this.name = 'PasswordException'; - this.message = msg; - this.code = code; - } - - PasswordException.prototype = new Error(); - PasswordException.constructor = PasswordException; - - return PasswordException; -})(); - -var UnknownErrorException = (function UnknownErrorExceptionClosure() { - function UnknownErrorException(msg, details) { - this.name = 'UnknownErrorException'; - this.message = msg; - this.details = details; - } - - UnknownErrorException.prototype = new Error(); - UnknownErrorException.constructor = UnknownErrorException; - - return UnknownErrorException; -})(); - -var InvalidPDFException = (function InvalidPDFExceptionClosure() { - function InvalidPDFException(msg) { - this.name = 'InvalidPDFException'; - this.message = msg; - } - - InvalidPDFException.prototype = new Error(); - InvalidPDFException.constructor = InvalidPDFException; - - return InvalidPDFException; -})(); - -var MissingPDFException = (function MissingPDFExceptionClosure() { - function MissingPDFException(msg) { - this.name = 'MissingPDFException'; - this.message = msg; - } - - MissingPDFException.prototype = new Error(); - MissingPDFException.constructor = MissingPDFException; - - return MissingPDFException; -})(); - -var UnexpectedResponseException = - (function UnexpectedResponseExceptionClosure() { - function UnexpectedResponseException(msg, status) { - this.name = 'UnexpectedResponseException'; - this.message = msg; - this.status = status; - } - - UnexpectedResponseException.prototype = new Error(); - UnexpectedResponseException.constructor = UnexpectedResponseException; - - return UnexpectedResponseException; -})(); - -var NotImplementedException = (function NotImplementedExceptionClosure() { - function NotImplementedException(msg) { - this.message = msg; - } - - NotImplementedException.prototype = new Error(); - NotImplementedException.prototype.name = 'NotImplementedException'; - NotImplementedException.constructor = NotImplementedException; - - return NotImplementedException; -})(); - -var MissingDataException = (function MissingDataExceptionClosure() { - function MissingDataException(begin, end) { - this.begin = begin; - this.end = end; - this.message = 'Missing data [' + begin + ', ' + end + ')'; - } - - MissingDataException.prototype = new Error(); - MissingDataException.prototype.name = 'MissingDataException'; - MissingDataException.constructor = MissingDataException; - - return MissingDataException; -})(); - -var XRefParseException = (function XRefParseExceptionClosure() { - function XRefParseException(msg) { - this.message = msg; - } - - XRefParseException.prototype = new Error(); - XRefParseException.prototype.name = 'XRefParseException'; - XRefParseException.constructor = XRefParseException; - - return XRefParseException; -})(); - -var NullCharactersRegExp = /\x00/g; - -function removeNullCharacters(str) { - if (typeof str !== 'string') { - warn('The argument for removeNullCharacters must be a string.'); - return str; - } - return str.replace(NullCharactersRegExp, ''); -} - -function bytesToString(bytes) { - assert(bytes !== null && typeof bytes === 'object' && - bytes.length !== undefined, 'Invalid argument for bytesToString'); - var length = bytes.length; - var MAX_ARGUMENT_COUNT = 8192; - if (length < MAX_ARGUMENT_COUNT) { - return String.fromCharCode.apply(null, bytes); - } - var strBuf = []; - for (var i = 0; i < length; i += MAX_ARGUMENT_COUNT) { - var chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); - var chunk = bytes.subarray(i, chunkEnd); - strBuf.push(String.fromCharCode.apply(null, chunk)); - } - return strBuf.join(''); -} - -function stringToBytes(str) { - assert(typeof str === 'string', 'Invalid argument for stringToBytes'); - var length = str.length; - var bytes = new Uint8Array(length); - for (var i = 0; i < length; ++i) { - bytes[i] = str.charCodeAt(i) & 0xFF; - } - return bytes; -} - -/** - * Gets length of the array (Array, Uint8Array, or string) in bytes. - * @param {Array|Uint8Array|string} arr - * @returns {number} - */ -function arrayByteLength(arr) { - if (arr.length !== undefined) { - return arr.length; - } - assert(arr.byteLength !== undefined); - return arr.byteLength; -} - -/** - * Combines array items (arrays) into single Uint8Array object. - * @param {Array} arr - the array of the arrays (Array, Uint8Array, or string). - * @returns {Uint8Array} - */ -function arraysToBytes(arr) { - // Shortcut: if first and only item is Uint8Array, return it. - if (arr.length === 1 && (arr[0] instanceof Uint8Array)) { - return arr[0]; - } - var resultLength = 0; - var i, ii = arr.length; - var item, itemLength ; - for (i = 0; i < ii; i++) { - item = arr[i]; - itemLength = arrayByteLength(item); - resultLength += itemLength; - } - var pos = 0; - var data = new Uint8Array(resultLength); - for (i = 0; i < ii; i++) { - item = arr[i]; - if (!(item instanceof Uint8Array)) { - if (typeof item === 'string') { - item = stringToBytes(item); - } else { - item = new Uint8Array(item); - } - } - itemLength = item.byteLength; - data.set(item, pos); - pos += itemLength; - } - return data; -} - -function string32(value) { - return String.fromCharCode((value >> 24) & 0xff, (value >> 16) & 0xff, - (value >> 8) & 0xff, value & 0xff); -} - -function log2(x) { - var n = 1, i = 0; - while (x > n) { - n <<= 1; - i++; - } - return i; -} - -function readInt8(data, start) { - return (data[start] << 24) >> 24; -} - -function readUint16(data, offset) { - return (data[offset] << 8) | data[offset + 1]; -} - -function readUint32(data, offset) { - return ((data[offset] << 24) | (data[offset + 1] << 16) | - (data[offset + 2] << 8) | data[offset + 3]) >>> 0; -} - -// Lazy test the endianness of the platform -// NOTE: This will be 'true' for simulated TypedArrays -function isLittleEndian() { - var buffer8 = new Uint8Array(2); - buffer8[0] = 1; - var buffer16 = new Uint16Array(buffer8.buffer); - return (buffer16[0] === 1); -} - -// Checks if it's possible to eval JS expressions. -function isEvalSupported() { - try { - /* jshint evil: true */ - new Function(''); - return true; - } catch (e) { - return false; - } -} - -var Uint32ArrayView = (function Uint32ArrayViewClosure() { - - function Uint32ArrayView(buffer, length) { - this.buffer = buffer; - this.byteLength = buffer.length; - this.length = length === undefined ? (this.byteLength >> 2) : length; - ensureUint32ArrayViewProps(this.length); - } - Uint32ArrayView.prototype = Object.create(null); - - var uint32ArrayViewSetters = 0; - function createUint32ArrayProp(index) { - return { - get: function () { - var buffer = this.buffer, offset = index << 2; - return (buffer[offset] | (buffer[offset + 1] << 8) | - (buffer[offset + 2] << 16) | (buffer[offset + 3] << 24)) >>> 0; - }, - set: function (value) { - var buffer = this.buffer, offset = index << 2; - buffer[offset] = value & 255; - buffer[offset + 1] = (value >> 8) & 255; - buffer[offset + 2] = (value >> 16) & 255; - buffer[offset + 3] = (value >>> 24) & 255; - } - }; - } - - function ensureUint32ArrayViewProps(length) { - while (uint32ArrayViewSetters < length) { - Object.defineProperty(Uint32ArrayView.prototype, - uint32ArrayViewSetters, - createUint32ArrayProp(uint32ArrayViewSetters)); - uint32ArrayViewSetters++; - } - } - - return Uint32ArrayView; -})(); - -exports.Uint32ArrayView = Uint32ArrayView; - -var IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; - -var Util = (function UtilClosure() { - function Util() {} - - var rgbBuf = ['rgb(', 0, ',', 0, ',', 0, ')']; - - // makeCssRgb() can be called thousands of times. Using |rgbBuf| avoids - // creating many intermediate strings. - Util.makeCssRgb = function Util_makeCssRgb(r, g, b) { - rgbBuf[1] = r; - rgbBuf[3] = g; - rgbBuf[5] = b; - return rgbBuf.join(''); - }; - - // Concatenates two transformation matrices together and returns the result. - Util.transform = function Util_transform(m1, m2) { - return [ - m1[0] * m2[0] + m1[2] * m2[1], - m1[1] * m2[0] + m1[3] * m2[1], - m1[0] * m2[2] + m1[2] * m2[3], - m1[1] * m2[2] + m1[3] * m2[3], - m1[0] * m2[4] + m1[2] * m2[5] + m1[4], - m1[1] * m2[4] + m1[3] * m2[5] + m1[5] - ]; - }; - - // For 2d affine transforms - Util.applyTransform = function Util_applyTransform(p, m) { - var xt = p[0] * m[0] + p[1] * m[2] + m[4]; - var yt = p[0] * m[1] + p[1] * m[3] + m[5]; - return [xt, yt]; - }; - - Util.applyInverseTransform = function Util_applyInverseTransform(p, m) { - var d = m[0] * m[3] - m[1] * m[2]; - var xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; - var yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; - return [xt, yt]; - }; - - // Applies the transform to the rectangle and finds the minimum axially - // aligned bounding box. - Util.getAxialAlignedBoundingBox = - function Util_getAxialAlignedBoundingBox(r, m) { - - var p1 = Util.applyTransform(r, m); - var p2 = Util.applyTransform(r.slice(2, 4), m); - var p3 = Util.applyTransform([r[0], r[3]], m); - var p4 = Util.applyTransform([r[2], r[1]], m); - return [ - Math.min(p1[0], p2[0], p3[0], p4[0]), - Math.min(p1[1], p2[1], p3[1], p4[1]), - Math.max(p1[0], p2[0], p3[0], p4[0]), - Math.max(p1[1], p2[1], p3[1], p4[1]) - ]; - }; - - Util.inverseTransform = function Util_inverseTransform(m) { - var d = m[0] * m[3] - m[1] * m[2]; - return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, - (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d]; - }; - - // Apply a generic 3d matrix M on a 3-vector v: - // | a b c | | X | - // | d e f | x | Y | - // | g h i | | Z | - // M is assumed to be serialized as [a,b,c,d,e,f,g,h,i], - // with v as [X,Y,Z] - Util.apply3dTransform = function Util_apply3dTransform(m, v) { - return [ - m[0] * v[0] + m[1] * v[1] + m[2] * v[2], - m[3] * v[0] + m[4] * v[1] + m[5] * v[2], - m[6] * v[0] + m[7] * v[1] + m[8] * v[2] - ]; - }; - - // This calculation uses Singular Value Decomposition. - // The SVD can be represented with formula A = USV. We are interested in the - // matrix S here because it represents the scale values. - Util.singularValueDecompose2dScale = - function Util_singularValueDecompose2dScale(m) { - - var transpose = [m[0], m[2], m[1], m[3]]; - - // Multiply matrix m with its transpose. - var a = m[0] * transpose[0] + m[1] * transpose[2]; - var b = m[0] * transpose[1] + m[1] * transpose[3]; - var c = m[2] * transpose[0] + m[3] * transpose[2]; - var d = m[2] * transpose[1] + m[3] * transpose[3]; - - // Solve the second degree polynomial to get roots. - var first = (a + d) / 2; - var second = Math.sqrt((a + d) * (a + d) - 4 * (a * d - c * b)) / 2; - var sx = first + second || 1; - var sy = first - second || 1; - - // Scale values are the square roots of the eigenvalues. - return [Math.sqrt(sx), Math.sqrt(sy)]; - }; - - // Normalize rectangle rect=[x1, y1, x2, y2] so that (x1,y1) < (x2,y2) - // For coordinate systems whose origin lies in the bottom-left, this - // means normalization to (BL,TR) ordering. For systems with origin in the - // top-left, this means (TL,BR) ordering. - Util.normalizeRect = function Util_normalizeRect(rect) { - var r = rect.slice(0); // clone rect - if (rect[0] > rect[2]) { - r[0] = rect[2]; - r[2] = rect[0]; - } - if (rect[1] > rect[3]) { - r[1] = rect[3]; - r[3] = rect[1]; - } - return r; - }; - - // Returns a rectangle [x1, y1, x2, y2] corresponding to the - // intersection of rect1 and rect2. If no intersection, returns 'false' - // The rectangle coordinates of rect1, rect2 should be [x1, y1, x2, y2] - Util.intersect = function Util_intersect(rect1, rect2) { - function compare(a, b) { - return a - b; - } - - // Order points along the axes - var orderedX = [rect1[0], rect1[2], rect2[0], rect2[2]].sort(compare), - orderedY = [rect1[1], rect1[3], rect2[1], rect2[3]].sort(compare), - result = []; - - rect1 = Util.normalizeRect(rect1); - rect2 = Util.normalizeRect(rect2); - - // X: first and second points belong to different rectangles? - if ((orderedX[0] === rect1[0] && orderedX[1] === rect2[0]) || - (orderedX[0] === rect2[0] && orderedX[1] === rect1[0])) { - // Intersection must be between second and third points - result[0] = orderedX[1]; - result[2] = orderedX[2]; - } else { - return false; - } - - // Y: first and second points belong to different rectangles? - if ((orderedY[0] === rect1[1] && orderedY[1] === rect2[1]) || - (orderedY[0] === rect2[1] && orderedY[1] === rect1[1])) { - // Intersection must be between second and third points - result[1] = orderedY[1]; - result[3] = orderedY[2]; - } else { - return false; - } - - return result; - }; - - Util.sign = function Util_sign(num) { - return num < 0 ? -1 : 1; - }; - - var ROMAN_NUMBER_MAP = [ - '', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM', - '', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC', - '', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX' - ]; - /** - * Converts positive integers to (upper case) Roman numerals. - * @param {integer} number - The number that should be converted. - * @param {boolean} lowerCase - Indicates if the result should be converted - * to lower case letters. The default is false. - * @return {string} The resulting Roman number. - */ - Util.toRoman = function Util_toRoman(number, lowerCase) { - assert(isInt(number) && number > 0, - 'The number should be a positive integer.'); - var pos, romanBuf = []; - // Thousands - while (number >= 1000) { - number -= 1000; - romanBuf.push('M'); - } - // Hundreds - pos = (number / 100) | 0; - number %= 100; - romanBuf.push(ROMAN_NUMBER_MAP[pos]); - // Tens - pos = (number / 10) | 0; - number %= 10; - romanBuf.push(ROMAN_NUMBER_MAP[10 + pos]); - // Ones - romanBuf.push(ROMAN_NUMBER_MAP[20 + number]); - - var romanStr = romanBuf.join(''); - return (lowerCase ? romanStr.toLowerCase() : romanStr); - }; - - Util.appendToArray = function Util_appendToArray(arr1, arr2) { - Array.prototype.push.apply(arr1, arr2); - }; - - Util.prependToArray = function Util_prependToArray(arr1, arr2) { - Array.prototype.unshift.apply(arr1, arr2); - }; - - Util.extendObj = function extendObj(obj1, obj2) { - for (var key in obj2) { - obj1[key] = obj2[key]; - } - }; - - Util.getInheritableProperty = function Util_getInheritableProperty(dict, - name) { - while (dict && !dict.has(name)) { - dict = dict.get('Parent'); - } - if (!dict) { - return null; - } - return dict.get(name); - }; - - Util.inherit = function Util_inherit(sub, base, prototype) { - sub.prototype = Object.create(base.prototype); - sub.prototype.constructor = sub; - for (var prop in prototype) { - sub.prototype[prop] = prototype[prop]; - } - }; - - Util.loadScript = function Util_loadScript(src, callback) { - var script = document.createElement('script'); - var loaded = false; - script.setAttribute('src', src); - if (callback) { - script.onload = function() { - if (!loaded) { - callback(); - } - loaded = true; - }; - } - document.getElementsByTagName('head')[0].appendChild(script); - }; - - return Util; -})(); - -/** - * PDF page viewport created based on scale, rotation and offset. - * @class - * @alias PageViewport - */ -var PageViewport = (function PageViewportClosure() { - /** - * @constructor - * @private - * @param viewBox {Array} xMin, yMin, xMax and yMax coordinates. - * @param scale {number} scale of the viewport. - * @param rotation {number} rotations of the viewport in degrees. - * @param offsetX {number} offset X - * @param offsetY {number} offset Y - * @param dontFlip {boolean} if true, axis Y will not be flipped. - */ - function PageViewport(viewBox, scale, rotation, offsetX, offsetY, dontFlip) { - this.viewBox = viewBox; - this.scale = scale; - this.rotation = rotation; - this.offsetX = offsetX; - this.offsetY = offsetY; - - // creating transform to convert pdf coordinate system to the normal - // canvas like coordinates taking in account scale and rotation - var centerX = (viewBox[2] + viewBox[0]) / 2; - var centerY = (viewBox[3] + viewBox[1]) / 2; - var rotateA, rotateB, rotateC, rotateD; - rotation = rotation % 360; - rotation = rotation < 0 ? rotation + 360 : rotation; - switch (rotation) { - case 180: - rotateA = -1; rotateB = 0; rotateC = 0; rotateD = 1; - break; - case 90: - rotateA = 0; rotateB = 1; rotateC = 1; rotateD = 0; - break; - case 270: - rotateA = 0; rotateB = -1; rotateC = -1; rotateD = 0; - break; - //case 0: - default: - rotateA = 1; rotateB = 0; rotateC = 0; rotateD = -1; - break; - } - - if (dontFlip) { - rotateC = -rotateC; rotateD = -rotateD; - } - - var offsetCanvasX, offsetCanvasY; - var width, height; - if (rotateA === 0) { - offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX; - offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY; - width = Math.abs(viewBox[3] - viewBox[1]) * scale; - height = Math.abs(viewBox[2] - viewBox[0]) * scale; - } else { - offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX; - offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY; - width = Math.abs(viewBox[2] - viewBox[0]) * scale; - height = Math.abs(viewBox[3] - viewBox[1]) * scale; - } - // creating transform for the following operations: - // translate(-centerX, -centerY), rotate and flip vertically, - // scale, and translate(offsetCanvasX, offsetCanvasY) - this.transform = [ - rotateA * scale, - rotateB * scale, - rotateC * scale, - rotateD * scale, - offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY, - offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY - ]; - - this.width = width; - this.height = height; - this.fontScale = scale; - } - PageViewport.prototype = /** @lends PageViewport.prototype */ { - /** - * Clones viewport with additional properties. - * @param args {Object} (optional) If specified, may contain the 'scale' or - * 'rotation' properties to override the corresponding properties in - * the cloned viewport. - * @returns {PageViewport} Cloned viewport. - */ - clone: function PageViewPort_clone(args) { - args = args || {}; - var scale = 'scale' in args ? args.scale : this.scale; - var rotation = 'rotation' in args ? args.rotation : this.rotation; - return new PageViewport(this.viewBox.slice(), scale, rotation, - this.offsetX, this.offsetY, args.dontFlip); - }, - /** - * Converts PDF point to the viewport coordinates. For examples, useful for - * converting PDF location into canvas pixel coordinates. - * @param x {number} X coordinate. - * @param y {number} Y coordinate. - * @returns {Object} Object that contains 'x' and 'y' properties of the - * point in the viewport coordinate space. - * @see {@link convertToPdfPoint} - * @see {@link convertToViewportRectangle} - */ - convertToViewportPoint: function PageViewport_convertToViewportPoint(x, y) { - return Util.applyTransform([x, y], this.transform); - }, - /** - * Converts PDF rectangle to the viewport coordinates. - * @param rect {Array} xMin, yMin, xMax and yMax coordinates. - * @returns {Array} Contains corresponding coordinates of the rectangle - * in the viewport coordinate space. - * @see {@link convertToViewportPoint} - */ - convertToViewportRectangle: - function PageViewport_convertToViewportRectangle(rect) { - var tl = Util.applyTransform([rect[0], rect[1]], this.transform); - var br = Util.applyTransform([rect[2], rect[3]], this.transform); - return [tl[0], tl[1], br[0], br[1]]; - }, - /** - * Converts viewport coordinates to the PDF location. For examples, useful - * for converting canvas pixel location into PDF one. - * @param x {number} X coordinate. - * @param y {number} Y coordinate. - * @returns {Object} Object that contains 'x' and 'y' properties of the - * point in the PDF coordinate space. - * @see {@link convertToViewportPoint} - */ - convertToPdfPoint: function PageViewport_convertToPdfPoint(x, y) { - return Util.applyInverseTransform([x, y], this.transform); - } - }; - return PageViewport; -})(); - -var PDFStringTranslateTable = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0x2D8, 0x2C7, 0x2C6, 0x2D9, 0x2DD, 0x2DB, 0x2DA, 0x2DC, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, - 0x2013, 0x192, 0x2044, 0x2039, 0x203A, 0x2212, 0x2030, 0x201E, 0x201C, - 0x201D, 0x2018, 0x2019, 0x201A, 0x2122, 0xFB01, 0xFB02, 0x141, 0x152, 0x160, - 0x178, 0x17D, 0x131, 0x142, 0x153, 0x161, 0x17E, 0, 0x20AC -]; - -function stringToPDFString(str) { - var i, n = str.length, strBuf = []; - if (str[0] === '\xFE' && str[1] === '\xFF') { - // UTF16BE BOM - for (i = 2; i < n; i += 2) { - strBuf.push(String.fromCharCode( - (str.charCodeAt(i) << 8) | str.charCodeAt(i + 1))); - } - } else { - for (i = 0; i < n; ++i) { - var code = PDFStringTranslateTable[str.charCodeAt(i)]; - strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); - } - } - return strBuf.join(''); -} - -function stringToUTF8String(str) { - return decodeURIComponent(escape(str)); -} - -function utf8StringToString(str) { - return unescape(encodeURIComponent(str)); -} - -function isEmptyObj(obj) { - for (var key in obj) { - return false; - } - return true; -} - -function isBool(v) { - return typeof v === 'boolean'; -} - -function isInt(v) { - return typeof v === 'number' && ((v | 0) === v); -} - -function isNum(v) { - return typeof v === 'number'; -} - -function isString(v) { - return typeof v === 'string'; -} - -function isArray(v) { - return v instanceof Array; -} - -function isArrayBuffer(v) { - return typeof v === 'object' && v !== null && v.byteLength !== undefined; -} - -// Checks if ch is one of the following characters: SPACE, TAB, CR or LF. -function isSpace(ch) { - return (ch === 0x20 || ch === 0x09 || ch === 0x0D || ch === 0x0A); -} - -/** - * Promise Capability object. - * - * @typedef {Object} PromiseCapability - * @property {Promise} promise - A promise object. - * @property {function} resolve - Fulfills the promise. - * @property {function} reject - Rejects the promise. - */ - -/** - * Creates a promise capability object. - * @alias createPromiseCapability - * - * @return {PromiseCapability} A capability object contains: - * - a Promise, resolve and reject methods. - */ -function createPromiseCapability() { - var capability = {}; - capability.promise = new Promise(function (resolve, reject) { - capability.resolve = resolve; - capability.reject = reject; - }); - return capability; -} - -/** - * Polyfill for Promises: - * The following promise implementation tries to generally implement the - * Promise/A+ spec. Some notable differences from other promise libraries are: - * - There currently isn't a separate deferred and promise object. - * - Unhandled rejections eventually show an error if they aren't handled. - * - * Based off of the work in: - * https://bugzilla.mozilla.org/show_bug.cgi?id=810490 - */ -(function PromiseClosure() { - if (globalScope.Promise) { - // Promises existing in the DOM/Worker, checking presence of all/resolve - if (typeof globalScope.Promise.all !== 'function') { - globalScope.Promise.all = function (iterable) { - var count = 0, results = [], resolve, reject; - var promise = new globalScope.Promise(function (resolve_, reject_) { - resolve = resolve_; - reject = reject_; - }); - iterable.forEach(function (p, i) { - count++; - p.then(function (result) { - results[i] = result; - count--; - if (count === 0) { - resolve(results); - } - }, reject); - }); - if (count === 0) { - resolve(results); - } - return promise; - }; - } - if (typeof globalScope.Promise.resolve !== 'function') { - globalScope.Promise.resolve = function (value) { - return new globalScope.Promise(function (resolve) { resolve(value); }); - }; - } - if (typeof globalScope.Promise.reject !== 'function') { - globalScope.Promise.reject = function (reason) { - return new globalScope.Promise(function (resolve, reject) { - reject(reason); - }); - }; - } - if (typeof globalScope.Promise.prototype.catch !== 'function') { - globalScope.Promise.prototype.catch = function (onReject) { - return globalScope.Promise.prototype.then(undefined, onReject); - }; - } - return; - } - var STATUS_PENDING = 0; - var STATUS_RESOLVED = 1; - var STATUS_REJECTED = 2; - - // In an attempt to avoid silent exceptions, unhandled rejections are - // tracked and if they aren't handled in a certain amount of time an - // error is logged. - var REJECTION_TIMEOUT = 500; - - var HandlerManager = { - handlers: [], - running: false, - unhandledRejections: [], - pendingRejectionCheck: false, - - scheduleHandlers: function scheduleHandlers(promise) { - if (promise._status === STATUS_PENDING) { - return; - } - - this.handlers = this.handlers.concat(promise._handlers); - promise._handlers = []; - - if (this.running) { - return; - } - this.running = true; - - setTimeout(this.runHandlers.bind(this), 0); - }, - - runHandlers: function runHandlers() { - var RUN_TIMEOUT = 1; // ms - var timeoutAt = Date.now() + RUN_TIMEOUT; - while (this.handlers.length > 0) { - var handler = this.handlers.shift(); - - var nextStatus = handler.thisPromise._status; - var nextValue = handler.thisPromise._value; - - try { - if (nextStatus === STATUS_RESOLVED) { - if (typeof handler.onResolve === 'function') { - nextValue = handler.onResolve(nextValue); - } - } else if (typeof handler.onReject === 'function') { - nextValue = handler.onReject(nextValue); - nextStatus = STATUS_RESOLVED; - - if (handler.thisPromise._unhandledRejection) { - this.removeUnhandeledRejection(handler.thisPromise); - } - } - } catch (ex) { - nextStatus = STATUS_REJECTED; - nextValue = ex; - } - - handler.nextPromise._updateStatus(nextStatus, nextValue); - if (Date.now() >= timeoutAt) { - break; - } - } - - if (this.handlers.length > 0) { - setTimeout(this.runHandlers.bind(this), 0); - return; - } - - this.running = false; - }, - - addUnhandledRejection: function addUnhandledRejection(promise) { - this.unhandledRejections.push({ - promise: promise, - time: Date.now() - }); - this.scheduleRejectionCheck(); - }, - - removeUnhandeledRejection: function removeUnhandeledRejection(promise) { - promise._unhandledRejection = false; - for (var i = 0; i < this.unhandledRejections.length; i++) { - if (this.unhandledRejections[i].promise === promise) { - this.unhandledRejections.splice(i); - i--; - } - } - }, - - scheduleRejectionCheck: function scheduleRejectionCheck() { - if (this.pendingRejectionCheck) { - return; - } - this.pendingRejectionCheck = true; - setTimeout(function rejectionCheck() { - this.pendingRejectionCheck = false; - var now = Date.now(); - for (var i = 0; i < this.unhandledRejections.length; i++) { - if (now - this.unhandledRejections[i].time > REJECTION_TIMEOUT) { - var unhandled = this.unhandledRejections[i].promise._value; - var msg = 'Unhandled rejection: ' + unhandled; - if (unhandled.stack) { - msg += '\n' + unhandled.stack; - } - warn(msg); - this.unhandledRejections.splice(i); - i--; - } - } - if (this.unhandledRejections.length) { - this.scheduleRejectionCheck(); - } - }.bind(this), REJECTION_TIMEOUT); - } - }; - - function Promise(resolver) { - this._status = STATUS_PENDING; - this._handlers = []; - try { - resolver.call(this, this._resolve.bind(this), this._reject.bind(this)); - } catch (e) { - this._reject(e); - } - } - /** - * Builds a promise that is resolved when all the passed in promises are - * resolved. - * @param {array} promises array of data and/or promises to wait for. - * @return {Promise} New dependent promise. - */ - Promise.all = function Promise_all(promises) { - var resolveAll, rejectAll; - var deferred = new Promise(function (resolve, reject) { - resolveAll = resolve; - rejectAll = reject; - }); - var unresolved = promises.length; - var results = []; - if (unresolved === 0) { - resolveAll(results); - return deferred; - } - function reject(reason) { - if (deferred._status === STATUS_REJECTED) { - return; - } - results = []; - rejectAll(reason); - } - for (var i = 0, ii = promises.length; i < ii; ++i) { - var promise = promises[i]; - var resolve = (function(i) { - return function(value) { - if (deferred._status === STATUS_REJECTED) { - return; - } - results[i] = value; - unresolved--; - if (unresolved === 0) { - resolveAll(results); - } - }; - })(i); - if (Promise.isPromise(promise)) { - promise.then(resolve, reject); - } else { - resolve(promise); - } - } - return deferred; - }; - - /** - * Checks if the value is likely a promise (has a 'then' function). - * @return {boolean} true if value is thenable - */ - Promise.isPromise = function Promise_isPromise(value) { - return value && typeof value.then === 'function'; - }; - - /** - * Creates resolved promise - * @param value resolve value - * @returns {Promise} - */ - Promise.resolve = function Promise_resolve(value) { - return new Promise(function (resolve) { resolve(value); }); - }; - - /** - * Creates rejected promise - * @param reason rejection value - * @returns {Promise} - */ - Promise.reject = function Promise_reject(reason) { - return new Promise(function (resolve, reject) { reject(reason); }); - }; - - Promise.prototype = { - _status: null, - _value: null, - _handlers: null, - _unhandledRejection: null, - - _updateStatus: function Promise__updateStatus(status, value) { - if (this._status === STATUS_RESOLVED || - this._status === STATUS_REJECTED) { - return; - } - - if (status === STATUS_RESOLVED && - Promise.isPromise(value)) { - value.then(this._updateStatus.bind(this, STATUS_RESOLVED), - this._updateStatus.bind(this, STATUS_REJECTED)); - return; - } - - this._status = status; - this._value = value; - - if (status === STATUS_REJECTED && this._handlers.length === 0) { - this._unhandledRejection = true; - HandlerManager.addUnhandledRejection(this); - } - - HandlerManager.scheduleHandlers(this); - }, - - _resolve: function Promise_resolve(value) { - this._updateStatus(STATUS_RESOLVED, value); - }, - - _reject: function Promise_reject(reason) { - this._updateStatus(STATUS_REJECTED, reason); - }, - - then: function Promise_then(onResolve, onReject) { - var nextPromise = new Promise(function (resolve, reject) { - this.resolve = resolve; - this.reject = reject; - }); - this._handlers.push({ - thisPromise: this, - onResolve: onResolve, - onReject: onReject, - nextPromise: nextPromise - }); - HandlerManager.scheduleHandlers(this); - return nextPromise; - }, - - catch: function Promise_catch(onReject) { - return this.then(undefined, onReject); - } - }; - - globalScope.Promise = Promise; -})(); - -(function WeakMapClosure() { - if (globalScope.WeakMap) { - return; - } - - var id = 0; - function WeakMap() { - this.id = '$weakmap' + (id++); - } - WeakMap.prototype = { - has: function(obj) { - return !!Object.getOwnPropertyDescriptor(obj, this.id); - }, - get: function(obj, defaultValue) { - return this.has(obj) ? obj[this.id] : defaultValue; - }, - set: function(obj, value) { - Object.defineProperty(obj, this.id, { - value: value, - enumerable: false, - configurable: true - }); - }, - delete: function(obj) { - delete obj[this.id]; - } - }; - - globalScope.WeakMap = WeakMap; -})(); - -var StatTimer = (function StatTimerClosure() { - function rpad(str, pad, length) { - while (str.length < length) { - str += pad; - } - return str; - } - function StatTimer() { - this.started = Object.create(null); - this.times = []; - this.enabled = true; - } - StatTimer.prototype = { - time: function StatTimer_time(name) { - if (!this.enabled) { - return; - } - if (name in this.started) { - warn('Timer is already running for ' + name); - } - this.started[name] = Date.now(); - }, - timeEnd: function StatTimer_timeEnd(name) { - if (!this.enabled) { - return; - } - if (!(name in this.started)) { - warn('Timer has not been started for ' + name); - } - this.times.push({ - 'name': name, - 'start': this.started[name], - 'end': Date.now() - }); - // Remove timer from started so it can be called again. - delete this.started[name]; - }, - toString: function StatTimer_toString() { - var i, ii; - var times = this.times; - var out = ''; - // Find the longest name for padding purposes. - var longest = 0; - for (i = 0, ii = times.length; i < ii; ++i) { - var name = times[i]['name']; - if (name.length > longest) { - longest = name.length; - } - } - for (i = 0, ii = times.length; i < ii; ++i) { - var span = times[i]; - var duration = span.end - span.start; - out += rpad(span['name'], ' ', longest) + ' ' + duration + 'ms\n'; - } - return out; - } - }; - return StatTimer; -})(); - -var createBlob = function createBlob(data, contentType) { - if (typeof Blob !== 'undefined') { - return new Blob([data], { type: contentType }); - } - warn('The "Blob" constructor is not supported.'); -}; - -var createObjectURL = (function createObjectURLClosure() { - // Blob/createObjectURL is not available, falling back to data schema. - var digits = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - - return function createObjectURL(data, contentType, forceDataSchema) { - if (!forceDataSchema && - typeof URL !== 'undefined' && URL.createObjectURL) { - var blob = createBlob(data, contentType); - return URL.createObjectURL(blob); - } - - var buffer = 'data:' + contentType + ';base64,'; - for (var i = 0, ii = data.length; i < ii; i += 3) { - var b1 = data[i] & 0xFF; - var b2 = data[i + 1] & 0xFF; - var b3 = data[i + 2] & 0xFF; - var d1 = b1 >> 2, d2 = ((b1 & 3) << 4) | (b2 >> 4); - var d3 = i + 1 < ii ? ((b2 & 0xF) << 2) | (b3 >> 6) : 64; - var d4 = i + 2 < ii ? (b3 & 0x3F) : 64; - buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4]; - } - return buffer; - }; -})(); - -function MessageHandler(sourceName, targetName, comObj) { - this.sourceName = sourceName; - this.targetName = targetName; - this.comObj = comObj; - this.callbackIndex = 1; - this.postMessageTransfers = true; - var callbacksCapabilities = this.callbacksCapabilities = Object.create(null); - var ah = this.actionHandler = Object.create(null); - - this._onComObjOnMessage = function messageHandlerComObjOnMessage(event) { - var data = event.data; - if (data.targetName !== this.sourceName) { - return; - } - if (data.isReply) { - var callbackId = data.callbackId; - if (data.callbackId in callbacksCapabilities) { - var callback = callbacksCapabilities[callbackId]; - delete callbacksCapabilities[callbackId]; - if ('error' in data) { - callback.reject(data.error); - } else { - callback.resolve(data.data); - } - } else { - error('Cannot resolve callback ' + callbackId); - } - } else if (data.action in ah) { - var action = ah[data.action]; - if (data.callbackId) { - var sourceName = this.sourceName; - var targetName = data.sourceName; - Promise.resolve().then(function () { - return action[0].call(action[1], data.data); - }).then(function (result) { - comObj.postMessage({ - sourceName: sourceName, - targetName: targetName, - isReply: true, - callbackId: data.callbackId, - data: result - }); - }, function (reason) { - if (reason instanceof Error) { - // Serialize error to avoid "DataCloneError" - reason = reason + ''; - } - comObj.postMessage({ - sourceName: sourceName, - targetName: targetName, - isReply: true, - callbackId: data.callbackId, - error: reason - }); - }); - } else { - action[0].call(action[1], data.data); - } - } else { - error('Unknown action from worker: ' + data.action); - } - }.bind(this); - comObj.addEventListener('message', this._onComObjOnMessage); -} - -MessageHandler.prototype = { - on: function messageHandlerOn(actionName, handler, scope) { - var ah = this.actionHandler; - if (ah[actionName]) { - error('There is already an actionName called "' + actionName + '"'); - } - ah[actionName] = [handler, scope]; - }, - /** - * Sends a message to the comObj to invoke the action with the supplied data. - * @param {String} actionName Action to call. - * @param {JSON} data JSON data to send. - * @param {Array} [transfers] Optional list of transfers/ArrayBuffers - */ - send: function messageHandlerSend(actionName, data, transfers) { - var message = { - sourceName: this.sourceName, - targetName: this.targetName, - action: actionName, - data: data - }; - this.postMessage(message, transfers); - }, - /** - * Sends a message to the comObj to invoke the action with the supplied data. - * Expects that other side will callback with the response. - * @param {String} actionName Action to call. - * @param {JSON} data JSON data to send. - * @param {Array} [transfers] Optional list of transfers/ArrayBuffers. - * @returns {Promise} Promise to be resolved with response data. - */ - sendWithPromise: - function messageHandlerSendWithPromise(actionName, data, transfers) { - var callbackId = this.callbackIndex++; - var message = { - sourceName: this.sourceName, - targetName: this.targetName, - action: actionName, - data: data, - callbackId: callbackId - }; - var capability = createPromiseCapability(); - this.callbacksCapabilities[callbackId] = capability; - try { - this.postMessage(message, transfers); - } catch (e) { - capability.reject(e); - } - return capability.promise; - }, - /** - * Sends raw message to the comObj. - * @private - * @param message {Object} Raw message. - * @param transfers List of transfers/ArrayBuffers, or undefined. - */ - postMessage: function (message, transfers) { - if (transfers && this.postMessageTransfers) { - this.comObj.postMessage(message, transfers); - } else { - this.comObj.postMessage(message); - } - }, - - destroy: function () { - this.comObj.removeEventListener('message', this._onComObjOnMessage); - } -}; - -function loadJpegStream(id, imageUrl, objs) { - var img = new Image(); - img.onload = (function loadJpegStream_onloadClosure() { - objs.resolve(id, img); - }); - img.onerror = (function loadJpegStream_onerrorClosure() { - objs.resolve(id, null); - warn('Error during JPEG image loading'); - }); - img.src = imageUrl; -} - - // Polyfill from https://github.com/Polymer/URL -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ -(function checkURLConstructor(scope) { - // feature detect for URL constructor - var hasWorkingUrl = false; - try { - if (typeof URL === 'function' && - typeof URL.prototype === 'object' && - ('origin' in URL.prototype)) { - var u = new URL('b', 'http://a'); - u.pathname = 'c%20d'; - hasWorkingUrl = u.href === 'http://a/c%20d'; - } - } catch(e) { } - - if (hasWorkingUrl) { - return; - } - - var relative = Object.create(null); - relative['ftp'] = 21; - relative['file'] = 0; - relative['gopher'] = 70; - relative['http'] = 80; - relative['https'] = 443; - relative['ws'] = 80; - relative['wss'] = 443; - - var relativePathDotMapping = Object.create(null); - relativePathDotMapping['%2e'] = '.'; - relativePathDotMapping['.%2e'] = '..'; - relativePathDotMapping['%2e.'] = '..'; - relativePathDotMapping['%2e%2e'] = '..'; - - function isRelativeScheme(scheme) { - return relative[scheme] !== undefined; - } - - function invalid() { - clear.call(this); - this._isInvalid = true; - } - - function IDNAToASCII(h) { - if ('' === h) { - invalid.call(this); - } - // XXX - return h.toLowerCase(); - } - - function percentEscape(c) { - var unicode = c.charCodeAt(0); - if (unicode > 0x20 && - unicode < 0x7F && - // " # < > ? ` - [0x22, 0x23, 0x3C, 0x3E, 0x3F, 0x60].indexOf(unicode) === -1 - ) { - return c; - } - return encodeURIComponent(c); - } - - function percentEscapeQuery(c) { - // XXX This actually needs to encode c using encoding and then - // convert the bytes one-by-one. - - var unicode = c.charCodeAt(0); - if (unicode > 0x20 && - unicode < 0x7F && - // " # < > ` (do not escape '?') - [0x22, 0x23, 0x3C, 0x3E, 0x60].indexOf(unicode) === -1 - ) { - return c; - } - return encodeURIComponent(c); - } - - var EOF, ALPHA = /[a-zA-Z]/, - ALPHANUMERIC = /[a-zA-Z0-9\+\-\.]/; - - function parse(input, stateOverride, base) { - function err(message) { - errors.push(message); - } - - var state = stateOverride || 'scheme start', - cursor = 0, - buffer = '', - seenAt = false, - seenBracket = false, - errors = []; - - loop: while ((input[cursor - 1] !== EOF || cursor === 0) && - !this._isInvalid) { - var c = input[cursor]; - switch (state) { - case 'scheme start': - if (c && ALPHA.test(c)) { - buffer += c.toLowerCase(); // ASCII-safe - state = 'scheme'; - } else if (!stateOverride) { - buffer = ''; - state = 'no scheme'; - continue; - } else { - err('Invalid scheme.'); - break loop; - } - break; - - case 'scheme': - if (c && ALPHANUMERIC.test(c)) { - buffer += c.toLowerCase(); // ASCII-safe - } else if (':' === c) { - this._scheme = buffer; - buffer = ''; - if (stateOverride) { - break loop; - } - if (isRelativeScheme(this._scheme)) { - this._isRelative = true; - } - if ('file' === this._scheme) { - state = 'relative'; - } else if (this._isRelative && base && - base._scheme === this._scheme) { - state = 'relative or authority'; - } else if (this._isRelative) { - state = 'authority first slash'; - } else { - state = 'scheme data'; - } - } else if (!stateOverride) { - buffer = ''; - cursor = 0; - state = 'no scheme'; - continue; - } else if (EOF === c) { - break loop; - } else { - err('Code point not allowed in scheme: ' + c); - break loop; - } - break; - - case 'scheme data': - if ('?' === c) { - this._query = '?'; - state = 'query'; - } else if ('#' === c) { - this._fragment = '#'; - state = 'fragment'; - } else { - // XXX error handling - if (EOF !== c && '\t' !== c && '\n' !== c && '\r' !== c) { - this._schemeData += percentEscape(c); - } - } - break; - - case 'no scheme': - if (!base || !(isRelativeScheme(base._scheme))) { - err('Missing scheme.'); - invalid.call(this); - } else { - state = 'relative'; - continue; - } - break; - - case 'relative or authority': - if ('/' === c && '/' === input[cursor+1]) { - state = 'authority ignore slashes'; - } else { - err('Expected /, got: ' + c); - state = 'relative'; - continue; - } - break; - - case 'relative': - this._isRelative = true; - if ('file' !== this._scheme) { - this._scheme = base._scheme; - } - if (EOF === c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = base._query; - this._username = base._username; - this._password = base._password; - break loop; - } else if ('/' === c || '\\' === c) { - if ('\\' === c) { - err('\\ is an invalid code point.'); - } - state = 'relative slash'; - } else if ('?' === c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = '?'; - this._username = base._username; - this._password = base._password; - state = 'query'; - } else if ('#' === c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = base._query; - this._fragment = '#'; - this._username = base._username; - this._password = base._password; - state = 'fragment'; - } else { - var nextC = input[cursor+1]; - var nextNextC = input[cursor+2]; - if ('file' !== this._scheme || !ALPHA.test(c) || - (nextC !== ':' && nextC !== '|') || - (EOF !== nextNextC && '/' !== nextNextC && '\\' !== nextNextC && - '?' !== nextNextC && '#' !== nextNextC)) { - this._host = base._host; - this._port = base._port; - this._username = base._username; - this._password = base._password; - this._path = base._path.slice(); - this._path.pop(); - } - state = 'relative path'; - continue; - } - break; - - case 'relative slash': - if ('/' === c || '\\' === c) { - if ('\\' === c) { - err('\\ is an invalid code point.'); - } - if ('file' === this._scheme) { - state = 'file host'; - } else { - state = 'authority ignore slashes'; - } - } else { - if ('file' !== this._scheme) { - this._host = base._host; - this._port = base._port; - this._username = base._username; - this._password = base._password; - } - state = 'relative path'; - continue; - } - break; - - case 'authority first slash': - if ('/' === c) { - state = 'authority second slash'; - } else { - err('Expected \'/\', got: ' + c); - state = 'authority ignore slashes'; - continue; - } - break; - - case 'authority second slash': - state = 'authority ignore slashes'; - if ('/' !== c) { - err('Expected \'/\', got: ' + c); - continue; - } - break; - - case 'authority ignore slashes': - if ('/' !== c && '\\' !== c) { - state = 'authority'; - continue; - } else { - err('Expected authority, got: ' + c); - } - break; - - case 'authority': - if ('@' === c) { - if (seenAt) { - err('@ already seen.'); - buffer += '%40'; - } - seenAt = true; - for (var i = 0; i < buffer.length; i++) { - var cp = buffer[i]; - if ('\t' === cp || '\n' === cp || '\r' === cp) { - err('Invalid whitespace in authority.'); - continue; - } - // XXX check URL code points - if (':' === cp && null === this._password) { - this._password = ''; - continue; - } - var tempC = percentEscape(cp); - if (null !== this._password) { - this._password += tempC; - } else { - this._username += tempC; - } - } - buffer = ''; - } else if (EOF === c || '/' === c || '\\' === c || - '?' === c || '#' === c) { - cursor -= buffer.length; - buffer = ''; - state = 'host'; - continue; - } else { - buffer += c; - } - break; - - case 'file host': - if (EOF === c || '/' === c || '\\' === c || '?' === c || '#' === c) { - if (buffer.length === 2 && ALPHA.test(buffer[0]) && - (buffer[1] === ':' || buffer[1] === '|')) { - state = 'relative path'; - } else if (buffer.length === 0) { - state = 'relative path start'; - } else { - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'relative path start'; - } - continue; - } else if ('\t' === c || '\n' === c || '\r' === c) { - err('Invalid whitespace in file host.'); - } else { - buffer += c; - } - break; - - case 'host': - case 'hostname': - if (':' === c && !seenBracket) { - // XXX host parsing - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'port'; - if ('hostname' === stateOverride) { - break loop; - } - } else if (EOF === c || '/' === c || - '\\' === c || '?' === c || '#' === c) { - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'relative path start'; - if (stateOverride) { - break loop; - } - continue; - } else if ('\t' !== c && '\n' !== c && '\r' !== c) { - if ('[' === c) { - seenBracket = true; - } else if (']' === c) { - seenBracket = false; - } - buffer += c; - } else { - err('Invalid code point in host/hostname: ' + c); - } - break; - - case 'port': - if (/[0-9]/.test(c)) { - buffer += c; - } else if (EOF === c || '/' === c || '\\' === c || - '?' === c || '#' === c || stateOverride) { - if ('' !== buffer) { - var temp = parseInt(buffer, 10); - if (temp !== relative[this._scheme]) { - this._port = temp + ''; - } - buffer = ''; - } - if (stateOverride) { - break loop; - } - state = 'relative path start'; - continue; - } else if ('\t' === c || '\n' === c || '\r' === c) { - err('Invalid code point in port: ' + c); - } else { - invalid.call(this); - } - break; - - case 'relative path start': - if ('\\' === c) { - err('\'\\\' not allowed in path.'); - } - state = 'relative path'; - if ('/' !== c && '\\' !== c) { - continue; - } - break; - - case 'relative path': - if (EOF === c || '/' === c || '\\' === c || - (!stateOverride && ('?' === c || '#' === c))) { - if ('\\' === c) { - err('\\ not allowed in relative path.'); - } - var tmp; - if (tmp = relativePathDotMapping[buffer.toLowerCase()]) { - buffer = tmp; - } - if ('..' === buffer) { - this._path.pop(); - if ('/' !== c && '\\' !== c) { - this._path.push(''); - } - } else if ('.' === buffer && '/' !== c && '\\' !== c) { - this._path.push(''); - } else if ('.' !== buffer) { - if ('file' === this._scheme && this._path.length === 0 && - buffer.length === 2 && ALPHA.test(buffer[0]) && - buffer[1] === '|') { - buffer = buffer[0] + ':'; - } - this._path.push(buffer); - } - buffer = ''; - if ('?' === c) { - this._query = '?'; - state = 'query'; - } else if ('#' === c) { - this._fragment = '#'; - state = 'fragment'; - } - } else if ('\t' !== c && '\n' !== c && '\r' !== c) { - buffer += percentEscape(c); - } - break; - - case 'query': - if (!stateOverride && '#' === c) { - this._fragment = '#'; - state = 'fragment'; - } else if (EOF !== c && '\t' !== c && '\n' !== c && '\r' !== c) { - this._query += percentEscapeQuery(c); - } - break; - - case 'fragment': - if (EOF !== c && '\t' !== c && '\n' !== c && '\r' !== c) { - this._fragment += c; - } - break; - } - - cursor++; - } - } - - function clear() { - this._scheme = ''; - this._schemeData = ''; - this._username = ''; - this._password = null; - this._host = ''; - this._port = ''; - this._path = []; - this._query = ''; - this._fragment = ''; - this._isInvalid = false; - this._isRelative = false; - } - - // Does not process domain names or IP addresses. - // Does not handle encoding for the query parameter. - function JURL(url, base /* , encoding */) { - if (base !== undefined && !(base instanceof JURL)) { - base = new JURL(String(base)); - } - - this._url = url; - clear.call(this); - - var input = url.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, ''); - // encoding = encoding || 'utf-8' - - parse.call(this, input, null, base); - } - - JURL.prototype = { - toString: function() { - return this.href; - }, - get href() { - if (this._isInvalid) { - return this._url; - } - var authority = ''; - if ('' !== this._username || null !== this._password) { - authority = this._username + - (null !== this._password ? ':' + this._password : '') + '@'; - } - - return this.protocol + - (this._isRelative ? '//' + authority + this.host : '') + - this.pathname + this._query + this._fragment; - }, - set href(href) { - clear.call(this); - parse.call(this, href); - }, - - get protocol() { - return this._scheme + ':'; - }, - set protocol(protocol) { - if (this._isInvalid) { - return; - } - parse.call(this, protocol + ':', 'scheme start'); - }, - - get host() { - return this._isInvalid ? '' : this._port ? - this._host + ':' + this._port : this._host; - }, - set host(host) { - if (this._isInvalid || !this._isRelative) { - return; - } - parse.call(this, host, 'host'); - }, - - get hostname() { - return this._host; - }, - set hostname(hostname) { - if (this._isInvalid || !this._isRelative) { - return; - } - parse.call(this, hostname, 'hostname'); - }, - - get port() { - return this._port; - }, - set port(port) { - if (this._isInvalid || !this._isRelative) { - return; - } - parse.call(this, port, 'port'); - }, - - get pathname() { - return this._isInvalid ? '' : this._isRelative ? - '/' + this._path.join('/') : this._schemeData; - }, - set pathname(pathname) { - if (this._isInvalid || !this._isRelative) { - return; - } - this._path = []; - parse.call(this, pathname, 'relative path start'); - }, - - get search() { - return this._isInvalid || !this._query || '?' === this._query ? - '' : this._query; - }, - set search(search) { - if (this._isInvalid || !this._isRelative) { - return; - } - this._query = '?'; - if ('?' === search[0]) { - search = search.slice(1); - } - parse.call(this, search, 'query'); - }, - - get hash() { - return this._isInvalid || !this._fragment || '#' === this._fragment ? - '' : this._fragment; - }, - set hash(hash) { - if (this._isInvalid) { - return; - } - this._fragment = '#'; - if ('#' === hash[0]) { - hash = hash.slice(1); - } - parse.call(this, hash, 'fragment'); - }, - - get origin() { - var host; - if (this._isInvalid || !this._scheme) { - return ''; - } - // javascript: Gecko returns String(""), WebKit/Blink String("null") - // Gecko throws error for "data://" - // data: Gecko returns "", Blink returns "data://", WebKit returns "null" - // Gecko returns String("") for file: mailto: - // WebKit/Blink returns String("SCHEME://") for file: mailto: - switch (this._scheme) { - case 'data': - case 'file': - case 'javascript': - case 'mailto': - return 'null'; - } - host = this.host; - if (!host) { - return ''; - } - return this._scheme + '://' + host; - } - }; - - // Copy over the static methods - var OriginalURL = scope.URL; - if (OriginalURL) { - JURL.createObjectURL = function(blob) { - // IE extension allows a second optional options argument. - // http://msdn.microsoft.com/en-us/library/ie/hh772302(v=vs.85).aspx - return OriginalURL.createObjectURL.apply(OriginalURL, arguments); - }; - JURL.revokeObjectURL = function(url) { - OriginalURL.revokeObjectURL(url); - }; - } - - scope.URL = JURL; -})(globalScope); - -exports.FONT_IDENTITY_MATRIX = FONT_IDENTITY_MATRIX; -exports.IDENTITY_MATRIX = IDENTITY_MATRIX; -exports.OPS = OPS; -exports.VERBOSITY_LEVELS = VERBOSITY_LEVELS; -exports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES; -exports.AnnotationBorderStyleType = AnnotationBorderStyleType; -exports.AnnotationFieldFlag = AnnotationFieldFlag; -exports.AnnotationFlag = AnnotationFlag; -exports.AnnotationType = AnnotationType; -exports.FontType = FontType; -exports.ImageKind = ImageKind; -exports.InvalidPDFException = InvalidPDFException; -exports.MessageHandler = MessageHandler; -exports.MissingDataException = MissingDataException; -exports.MissingPDFException = MissingPDFException; -exports.NotImplementedException = NotImplementedException; -exports.PageViewport = PageViewport; -exports.PasswordException = PasswordException; -exports.PasswordResponses = PasswordResponses; -exports.StatTimer = StatTimer; -exports.StreamType = StreamType; -exports.TextRenderingMode = TextRenderingMode; -exports.UnexpectedResponseException = UnexpectedResponseException; -exports.UnknownErrorException = UnknownErrorException; -exports.Util = Util; -exports.XRefParseException = XRefParseException; -exports.arrayByteLength = arrayByteLength; -exports.arraysToBytes = arraysToBytes; -exports.assert = assert; -exports.bytesToString = bytesToString; -exports.createBlob = createBlob; -exports.createPromiseCapability = createPromiseCapability; -exports.createObjectURL = createObjectURL; -exports.deprecated = deprecated; -exports.error = error; -exports.getLookupTableFactory = getLookupTableFactory; -exports.getVerbosityLevel = getVerbosityLevel; -exports.globalScope = globalScope; -exports.info = info; -exports.isArray = isArray; -exports.isArrayBuffer = isArrayBuffer; -exports.isBool = isBool; -exports.isEmptyObj = isEmptyObj; -exports.isInt = isInt; -exports.isNum = isNum; -exports.isString = isString; -exports.isSpace = isSpace; -exports.isSameOrigin = isSameOrigin; -exports.isValidUrl = isValidUrl; -exports.isLittleEndian = isLittleEndian; -exports.isEvalSupported = isEvalSupported; -exports.loadJpegStream = loadJpegStream; -exports.log2 = log2; -exports.readInt8 = readInt8; -exports.readUint16 = readUint16; -exports.readUint32 = readUint32; -exports.removeNullCharacters = removeNullCharacters; -exports.setVerbosityLevel = setVerbosityLevel; -exports.shadow = shadow; -exports.string32 = string32; -exports.stringToBytes = stringToBytes; -exports.stringToPDFString = stringToPDFString; -exports.stringToUTF8String = stringToUTF8String; -exports.utf8StringToString = utf8StringToString; -exports.warn = warn; -})); - - -(function (root, factory) { - { - factory((root.pdfjsDisplayDOMUtils = {}), root.pdfjsSharedUtil); - } -}(this, function (exports, sharedUtil) { - -var removeNullCharacters = sharedUtil.removeNullCharacters; -var warn = sharedUtil.warn; - -/** - * Optimised CSS custom property getter/setter. - * @class - */ -var CustomStyle = (function CustomStyleClosure() { - - // As noted on: http://www.zachstronaut.com/posts/2009/02/17/ - // animate-css-transforms-firefox-webkit.html - // in some versions of IE9 it is critical that ms appear in this list - // before Moz - var prefixes = ['ms', 'Moz', 'Webkit', 'O']; - var _cache = Object.create(null); - - function CustomStyle() {} - - CustomStyle.getProp = function get(propName, element) { - // check cache only when no element is given - if (arguments.length === 1 && typeof _cache[propName] === 'string') { - return _cache[propName]; - } - - element = element || document.documentElement; - var style = element.style, prefixed, uPropName; - - // test standard property first - if (typeof style[propName] === 'string') { - return (_cache[propName] = propName); - } - - // capitalize - uPropName = propName.charAt(0).toUpperCase() + propName.slice(1); - - // test vendor specific properties - for (var i = 0, l = prefixes.length; i < l; i++) { - prefixed = prefixes[i] + uPropName; - if (typeof style[prefixed] === 'string') { - return (_cache[propName] = prefixed); - } - } - - //if all fails then set to undefined - return (_cache[propName] = 'undefined'); - }; - - CustomStyle.setProp = function set(propName, element, str) { - var prop = this.getProp(propName); - if (prop !== 'undefined') { - element.style[prop] = str; - } - }; - - return CustomStyle; -})(); - -function hasCanvasTypedArrays() { - var canvas = document.createElement('canvas'); - canvas.width = canvas.height = 1; - var ctx = canvas.getContext('2d'); - var imageData = ctx.createImageData(1, 1); - return (typeof imageData.data.buffer !== 'undefined'); -} - -var LinkTarget = { - NONE: 0, // Default value. - SELF: 1, - BLANK: 2, - PARENT: 3, - TOP: 4, -}; - -var LinkTargetStringMap = [ - '', - '_self', - '_blank', - '_parent', - '_top' -]; - -/** - * @typedef ExternalLinkParameters - * @typedef {Object} ExternalLinkParameters - * @property {string} url - An absolute URL. - * @property {LinkTarget} target - The link target. - * @property {string} rel - The link relationship. - */ - -/** - * Adds various attributes (href, title, target, rel) to hyperlinks. - * @param {HTMLLinkElement} link - The link element. - * @param {ExternalLinkParameters} params - */ -function addLinkAttributes(link, params) { - var url = params && params.url; - link.href = link.title = (url ? removeNullCharacters(url) : ''); - - if (url) { - var target = params.target; - if (typeof target === 'undefined') { - target = getDefaultSetting('externalLinkTarget'); - } - link.target = LinkTargetStringMap[target]; - - var rel = params.rel; - if (typeof rel === 'undefined') { - rel = getDefaultSetting('externalLinkRel'); - } - link.rel = rel; - } -} - -// Gets the file name from a given URL. -function getFilenameFromUrl(url) { - var anchor = url.indexOf('#'); - var query = url.indexOf('?'); - var end = Math.min( - anchor > 0 ? anchor : url.length, - query > 0 ? query : url.length); - return url.substring(url.lastIndexOf('/', end) + 1, end); -} - -function getDefaultSetting(id) { - // The list of the settings and their default is maintained for backward - // compatibility and shall not be extended or modified. See also global.js. - var globalSettings = sharedUtil.globalScope.PDFJS; - switch (id) { - case 'pdfBug': - return globalSettings ? globalSettings.pdfBug : false; - case 'disableAutoFetch': - return globalSettings ? globalSettings.disableAutoFetch : false; - case 'disableStream': - return globalSettings ? globalSettings.disableStream : false; - case 'disableRange': - return globalSettings ? globalSettings.disableRange : false; - case 'disableFontFace': - return globalSettings ? globalSettings.disableFontFace : false; - case 'disableCreateObjectURL': - return globalSettings ? globalSettings.disableCreateObjectURL : false; - case 'disableWebGL': - return globalSettings ? globalSettings.disableWebGL : true; - case 'cMapUrl': - return globalSettings ? globalSettings.cMapUrl : null; - case 'cMapPacked': - return globalSettings ? globalSettings.cMapPacked : false; - case 'postMessageTransfers': - return globalSettings ? globalSettings.postMessageTransfers : true; - case 'workerSrc': - return globalSettings ? globalSettings.workerSrc : null; - case 'disableWorker': - return globalSettings ? globalSettings.disableWorker : false; - case 'maxImageSize': - return globalSettings ? globalSettings.maxImageSize : -1; - case 'imageResourcesPath': - return globalSettings ? globalSettings.imageResourcesPath : ''; - case 'isEvalSupported': - return globalSettings ? globalSettings.isEvalSupported : true; - case 'externalLinkTarget': - if (!globalSettings) { - return LinkTarget.NONE; - } - switch (globalSettings.externalLinkTarget) { - case LinkTarget.NONE: - case LinkTarget.SELF: - case LinkTarget.BLANK: - case LinkTarget.PARENT: - case LinkTarget.TOP: - return globalSettings.externalLinkTarget; - } - warn('PDFJS.externalLinkTarget is invalid: ' + - globalSettings.externalLinkTarget); - // Reset the external link target, to suppress further warnings. - globalSettings.externalLinkTarget = LinkTarget.NONE; - return LinkTarget.NONE; - case 'externalLinkRel': - return globalSettings ? globalSettings.externalLinkRel : 'noreferrer'; - case 'enableStats': - return !!(globalSettings && globalSettings.enableStats); - default: - throw new Error('Unknown default setting: ' + id); - } -} - -function isExternalLinkTargetSet() { - var externalLinkTarget = getDefaultSetting('externalLinkTarget'); - switch (externalLinkTarget) { - case LinkTarget.NONE: - return false; - case LinkTarget.SELF: - case LinkTarget.BLANK: - case LinkTarget.PARENT: - case LinkTarget.TOP: - return true; - } -} - -exports.CustomStyle = CustomStyle; -exports.addLinkAttributes = addLinkAttributes; -exports.isExternalLinkTargetSet = isExternalLinkTargetSet; -exports.getFilenameFromUrl = getFilenameFromUrl; -exports.LinkTarget = LinkTarget; -exports.hasCanvasTypedArrays = hasCanvasTypedArrays; -exports.getDefaultSetting = getDefaultSetting; -})); - - -(function (root, factory) { - { - factory((root.pdfjsDisplayFontLoader = {}), root.pdfjsSharedUtil); - } -}(this, function (exports, sharedUtil) { - -var assert = sharedUtil.assert; -var bytesToString = sharedUtil.bytesToString; -var string32 = sharedUtil.string32; -var shadow = sharedUtil.shadow; -var warn = sharedUtil.warn; - -function FontLoader(docId) { - this.docId = docId; - this.styleElement = null; - this.nativeFontFaces = []; - this.loadTestFontId = 0; - this.loadingContext = { - requests: [], - nextRequestId: 0 - }; -} -FontLoader.prototype = { - insertRule: function fontLoaderInsertRule(rule) { - var styleElement = this.styleElement; - if (!styleElement) { - styleElement = this.styleElement = document.createElement('style'); - styleElement.id = 'PDFJS_FONT_STYLE_TAG_' + this.docId; - document.documentElement.getElementsByTagName('head')[0].appendChild( - styleElement); - } - - var styleSheet = styleElement.sheet; - styleSheet.insertRule(rule, styleSheet.cssRules.length); - }, - - clear: function fontLoaderClear() { - var styleElement = this.styleElement; - if (styleElement) { - styleElement.parentNode.removeChild(styleElement); - styleElement = this.styleElement = null; - } - this.nativeFontFaces.forEach(function(nativeFontFace) { - document.fonts.delete(nativeFontFace); - }); - this.nativeFontFaces.length = 0; - }, - get loadTestFont() { - // This is a CFF font with 1 glyph for '.' that fills its entire width and - // height. - return shadow(this, 'loadTestFont', atob( - 'T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQ' + - 'AABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwA' + - 'AAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbm' + - 'FtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAA' + - 'AADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6A' + - 'ABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAA' + - 'MQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAA' + - 'AAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAA' + - 'AAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQ' + - 'AAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMA' + - 'AQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAA' + - 'EAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAA' + - 'AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAA' + - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + - 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAA' + - 'AAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgc' + - 'A/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWF' + - 'hYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQA' + - 'AAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAg' + - 'ABAAAAAAAAAAAD6AAAAAAAAA==' - )); - }, - - addNativeFontFace: function fontLoader_addNativeFontFace(nativeFontFace) { - this.nativeFontFaces.push(nativeFontFace); - document.fonts.add(nativeFontFace); - }, - - bind: function fontLoaderBind(fonts, callback) { - var rules = []; - var fontsToLoad = []; - var fontLoadPromises = []; - var getNativeFontPromise = function(nativeFontFace) { - // Return a promise that is always fulfilled, even when the font fails to - // load. - return nativeFontFace.loaded.catch(function(e) { - warn('Failed to load font "' + nativeFontFace.family + '": ' + e); - }); - }; - for (var i = 0, ii = fonts.length; i < ii; i++) { - var font = fonts[i]; - - // Add the font to the DOM only once or skip if the font - // is already loaded. - if (font.attached || font.loading === false) { - continue; - } - font.attached = true; - - if (FontLoader.isFontLoadingAPISupported) { - var nativeFontFace = font.createNativeFontFace(); - if (nativeFontFace) { - this.addNativeFontFace(nativeFontFace); - fontLoadPromises.push(getNativeFontPromise(nativeFontFace)); - } - } else { - var rule = font.createFontFaceRule(); - if (rule) { - this.insertRule(rule); - rules.push(rule); - fontsToLoad.push(font); - } - } - } - - var request = this.queueLoadingCallback(callback); - if (FontLoader.isFontLoadingAPISupported) { - Promise.all(fontLoadPromises).then(function() { - request.complete(); - }); - } else if (rules.length > 0 && !FontLoader.isSyncFontLoadingSupported) { - this.prepareFontLoadEvent(rules, fontsToLoad, request); - } else { - request.complete(); - } - }, - - queueLoadingCallback: function FontLoader_queueLoadingCallback(callback) { - function LoadLoader_completeRequest() { - assert(!request.end, 'completeRequest() cannot be called twice'); - request.end = Date.now(); - - // sending all completed requests in order how they were queued - while (context.requests.length > 0 && context.requests[0].end) { - var otherRequest = context.requests.shift(); - setTimeout(otherRequest.callback, 0); - } - } - - var context = this.loadingContext; - var requestId = 'pdfjs-font-loading-' + (context.nextRequestId++); - var request = { - id: requestId, - complete: LoadLoader_completeRequest, - callback: callback, - started: Date.now() - }; - context.requests.push(request); - return request; - }, - - prepareFontLoadEvent: function fontLoaderPrepareFontLoadEvent(rules, - fonts, - request) { - /** Hack begin */ - // There's currently no event when a font has finished downloading so the - // following code is a dirty hack to 'guess' when a font is - // ready. It's assumed fonts are loaded in order, so add a known test - // font after the desired fonts and then test for the loading of that - // test font. - - function int32(data, offset) { - return (data.charCodeAt(offset) << 24) | - (data.charCodeAt(offset + 1) << 16) | - (data.charCodeAt(offset + 2) << 8) | - (data.charCodeAt(offset + 3) & 0xff); - } - - function spliceString(s, offset, remove, insert) { - var chunk1 = s.substr(0, offset); - var chunk2 = s.substr(offset + remove); - return chunk1 + insert + chunk2; - } - - var i, ii; - - var canvas = document.createElement('canvas'); - canvas.width = 1; - canvas.height = 1; - var ctx = canvas.getContext('2d'); - - var called = 0; - function isFontReady(name, callback) { - called++; - // With setTimeout clamping this gives the font ~100ms to load. - if(called > 30) { - warn('Load test font never loaded.'); - callback(); - return; - } - ctx.font = '30px ' + name; - ctx.fillText('.', 0, 20); - var imageData = ctx.getImageData(0, 0, 1, 1); - if (imageData.data[3] > 0) { - callback(); - return; - } - setTimeout(isFontReady.bind(null, name, callback)); - } - - var loadTestFontId = 'lt' + Date.now() + this.loadTestFontId++; - // Chromium seems to cache fonts based on a hash of the actual font data, - // so the font must be modified for each load test else it will appear to - // be loaded already. - // TODO: This could maybe be made faster by avoiding the btoa of the full - // font by splitting it in chunks before hand and padding the font id. - var data = this.loadTestFont; - var COMMENT_OFFSET = 976; // has to be on 4 byte boundary (for checksum) - data = spliceString(data, COMMENT_OFFSET, loadTestFontId.length, - loadTestFontId); - // CFF checksum is important for IE, adjusting it - var CFF_CHECKSUM_OFFSET = 16; - var XXXX_VALUE = 0x58585858; // the "comment" filled with 'X' - var checksum = int32(data, CFF_CHECKSUM_OFFSET); - for (i = 0, ii = loadTestFontId.length - 3; i < ii; i += 4) { - checksum = (checksum - XXXX_VALUE + int32(loadTestFontId, i)) | 0; - } - if (i < loadTestFontId.length) { // align to 4 bytes boundary - checksum = (checksum - XXXX_VALUE + - int32(loadTestFontId + 'XXX', i)) | 0; - } - data = spliceString(data, CFF_CHECKSUM_OFFSET, 4, string32(checksum)); - - var url = 'url(data:font/opentype;base64,' + btoa(data) + ');'; - var rule = '@font-face { font-family:"' + loadTestFontId + '";src:' + - url + '}'; - this.insertRule(rule); - - var names = []; - for (i = 0, ii = fonts.length; i < ii; i++) { - names.push(fonts[i].loadedName); - } - names.push(loadTestFontId); - - var div = document.createElement('div'); - div.setAttribute('style', - 'visibility: hidden;' + - 'width: 10px; height: 10px;' + - 'position: absolute; top: 0px; left: 0px;'); - for (i = 0, ii = names.length; i < ii; ++i) { - var span = document.createElement('span'); - span.textContent = 'Hi'; - span.style.fontFamily = names[i]; - div.appendChild(span); - } - document.body.appendChild(div); - - isFontReady(loadTestFontId, function() { - document.body.removeChild(div); - request.complete(); - }); - /** Hack end */ - } -}; -FontLoader.isFontLoadingAPISupported = typeof document !== 'undefined' && - !!document.fonts; -Object.defineProperty(FontLoader, 'isSyncFontLoadingSupported', { - get: function () { - if (typeof navigator === 'undefined') { - // node.js - we can pretend sync font loading is supported. - return shadow(FontLoader, 'isSyncFontLoadingSupported', true); - } - - var supported = false; - - // User agent string sniffing is bad, but there is no reliable way to tell - // if font is fully loaded and ready to be used with canvas. - var m = /Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent); - if (m && m[1] >= 14) { - supported = true; - } - // TODO other browsers - return shadow(FontLoader, 'isSyncFontLoadingSupported', supported); - }, - enumerable: true, - configurable: true -}); - -var IsEvalSupportedCached = { - get value() { - return shadow(this, 'value', sharedUtil.isEvalSupported()); - } -}; - -var FontFaceObject = (function FontFaceObjectClosure() { - function FontFaceObject(translatedData, options) { - this.compiledGlyphs = Object.create(null); - // importing translated data - for (var i in translatedData) { - this[i] = translatedData[i]; - } - this.options = options; - } - FontFaceObject.prototype = { - createNativeFontFace: function FontFaceObject_createNativeFontFace() { - if (!this.data) { - return null; - } - - if (this.options.disableFontFace) { - this.disableFontFace = true; - return null; - } - - var nativeFontFace = new FontFace(this.loadedName, this.data, {}); - - if (this.options.fontRegistry) { - this.options.fontRegistry.registerFont(this); - } - return nativeFontFace; - }, - - createFontFaceRule: function FontFaceObject_createFontFaceRule() { - if (!this.data) { - return null; - } - - if (this.options.disableFontFace) { - this.disableFontFace = true; - return null; - } - - var data = bytesToString(new Uint8Array(this.data)); - var fontName = this.loadedName; - - // Add the font-face rule to the document - var url = ('url(data:' + this.mimetype + ';base64,' + btoa(data) + ');'); - var rule = '@font-face { font-family:"' + fontName + '";src:' + url + '}'; - - if (this.options.fontRegistry) { - this.options.fontRegistry.registerFont(this, url); - } - - return rule; - }, - - getPathGenerator: - function FontFaceObject_getPathGenerator(objs, character) { - if (!(character in this.compiledGlyphs)) { - var cmds = objs.get(this.loadedName + '_path_' + character); - var current, i, len; - - // If we can, compile cmds into JS for MAXIMUM SPEED - if (this.options.isEvalSupported && IsEvalSupportedCached.value) { - var args, js = ''; - for (i = 0, len = cmds.length; i < len; i++) { - current = cmds[i]; - - if (current.args !== undefined) { - args = current.args.join(','); - } else { - args = ''; - } - - js += 'c.' + current.cmd + '(' + args + ');\n'; - } - /* jshint -W054 */ - this.compiledGlyphs[character] = new Function('c', 'size', js); - } else { - // But fall back on using Function.prototype.apply() if we're - // blocked from using eval() for whatever reason (like CSP policies) - this.compiledGlyphs[character] = function(c, size) { - for (i = 0, len = cmds.length; i < len; i++) { - current = cmds[i]; - - if (current.cmd === 'scale') { - current.args = [size, -size]; - } - - c[current.cmd].apply(c, current.args); - } - }; - } - } - return this.compiledGlyphs[character]; - } - }; - return FontFaceObject; -})(); - -exports.FontFaceObject = FontFaceObject; -exports.FontLoader = FontLoader; -})); - - -(function (root, factory) { - { - factory((root.pdfjsDisplayMetadata = {}), root.pdfjsSharedUtil); - } -}(this, function (exports, sharedUtil) { - -var error = sharedUtil.error; - - function fixMetadata(meta) { - return meta.replace(/>\\376\\377([^<]+)/g, function(all, codes) { - var bytes = codes.replace(/\\([0-3])([0-7])([0-7])/g, - function(code, d1, d2, d3) { - return String.fromCharCode(d1 * 64 + d2 * 8 + d3 * 1); - }); - var chars = ''; - for (var i = 0; i < bytes.length; i += 2) { - var code = bytes.charCodeAt(i) * 256 + bytes.charCodeAt(i + 1); - chars += code >= 32 && code < 127 && code !== 60 && code !== 62 && - code !== 38 && false ? String.fromCharCode(code) : - '&#x' + (0x10000 + code).toString(16).substring(1) + ';'; - } - return '>' + chars; - }); - } - - function Metadata(meta) { - if (typeof meta === 'string') { - // Ghostscript produces invalid metadata - meta = fixMetadata(meta); - - var parser = new DOMParser(); - meta = parser.parseFromString(meta, 'application/xml'); - } else if (!(meta instanceof Document)) { - error('Metadata: Invalid metadata object'); - } - - this.metaDocument = meta; - this.metadata = Object.create(null); - this.parse(); - } - - Metadata.prototype = { - parse: function Metadata_parse() { - var doc = this.metaDocument; - var rdf = doc.documentElement; - - if (rdf.nodeName.toLowerCase() !== 'rdf:rdf') { // Wrapped in - rdf = rdf.firstChild; - while (rdf && rdf.nodeName.toLowerCase() !== 'rdf:rdf') { - rdf = rdf.nextSibling; - } - } - - var nodeName = (rdf) ? rdf.nodeName.toLowerCase() : null; - if (!rdf || nodeName !== 'rdf:rdf' || !rdf.hasChildNodes()) { - return; - } - - var children = rdf.childNodes, desc, entry, name, i, ii, length, iLength; - for (i = 0, length = children.length; i < length; i++) { - desc = children[i]; - if (desc.nodeName.toLowerCase() !== 'rdf:description') { - continue; - } - - for (ii = 0, iLength = desc.childNodes.length; ii < iLength; ii++) { - if (desc.childNodes[ii].nodeName.toLowerCase() !== '#text') { - entry = desc.childNodes[ii]; - name = entry.nodeName.toLowerCase(); - this.metadata[name] = entry.textContent.trim(); - } - } - } - }, - - get: function Metadata_get(name) { - return this.metadata[name] || null; - }, - - has: function Metadata_has(name) { - return typeof this.metadata[name] !== 'undefined'; - } - }; - -exports.Metadata = Metadata; -})); - - -(function (root, factory) { - { - factory((root.pdfjsDisplaySVG = {}), root.pdfjsSharedUtil); - } -}(this, function (exports, sharedUtil) { -var FONT_IDENTITY_MATRIX = sharedUtil.FONT_IDENTITY_MATRIX; -var IDENTITY_MATRIX = sharedUtil.IDENTITY_MATRIX; -var ImageKind = sharedUtil.ImageKind; -var OPS = sharedUtil.OPS; -var Util = sharedUtil.Util; -var isNum = sharedUtil.isNum; -var isArray = sharedUtil.isArray; -var warn = sharedUtil.warn; -var createObjectURL = sharedUtil.createObjectURL; - -var SVG_DEFAULTS = { - fontStyle: 'normal', - fontWeight: 'normal', - fillColor: '#000000' -}; - -var convertImgDataToPng = (function convertImgDataToPngClosure() { - var PNG_HEADER = - new Uint8Array([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]); - - var CHUNK_WRAPPER_SIZE = 12; - - var crcTable = new Int32Array(256); - for (var i = 0; i < 256; i++) { - var c = i; - for (var h = 0; h < 8; h++) { - if (c & 1) { - c = 0xedB88320 ^ ((c >> 1) & 0x7fffffff); - } else { - c = (c >> 1) & 0x7fffffff; - } - } - crcTable[i] = c; - } - - function crc32(data, start, end) { - var crc = -1; - for (var i = start; i < end; i++) { - var a = (crc ^ data[i]) & 0xff; - var b = crcTable[a]; - crc = (crc >>> 8) ^ b; - } - return crc ^ -1; - } - - function writePngChunk(type, body, data, offset) { - var p = offset; - var len = body.length; - - data[p] = len >> 24 & 0xff; - data[p + 1] = len >> 16 & 0xff; - data[p + 2] = len >> 8 & 0xff; - data[p + 3] = len & 0xff; - p += 4; - - data[p] = type.charCodeAt(0) & 0xff; - data[p + 1] = type.charCodeAt(1) & 0xff; - data[p + 2] = type.charCodeAt(2) & 0xff; - data[p + 3] = type.charCodeAt(3) & 0xff; - p += 4; - - data.set(body, p); - p += body.length; - - var crc = crc32(data, offset + 4, p); - - data[p] = crc >> 24 & 0xff; - data[p + 1] = crc >> 16 & 0xff; - data[p + 2] = crc >> 8 & 0xff; - data[p + 3] = crc & 0xff; - } - - function adler32(data, start, end) { - var a = 1; - var b = 0; - for (var i = start; i < end; ++i) { - a = (a + (data[i] & 0xff)) % 65521; - b = (b + a) % 65521; - } - return (b << 16) | a; - } - - function encode(imgData, kind, forceDataSchema) { - var width = imgData.width; - var height = imgData.height; - var bitDepth, colorType, lineSize; - var bytes = imgData.data; - - switch (kind) { - case ImageKind.GRAYSCALE_1BPP: - colorType = 0; - bitDepth = 1; - lineSize = (width + 7) >> 3; - break; - case ImageKind.RGB_24BPP: - colorType = 2; - bitDepth = 8; - lineSize = width * 3; - break; - case ImageKind.RGBA_32BPP: - colorType = 6; - bitDepth = 8; - lineSize = width * 4; - break; - default: - throw new Error('invalid format'); - } - - // prefix every row with predictor 0 - var literals = new Uint8Array((1 + lineSize) * height); - var offsetLiterals = 0, offsetBytes = 0; - var y, i; - for (y = 0; y < height; ++y) { - literals[offsetLiterals++] = 0; // no prediction - literals.set(bytes.subarray(offsetBytes, offsetBytes + lineSize), - offsetLiterals); - offsetBytes += lineSize; - offsetLiterals += lineSize; - } - - if (kind === ImageKind.GRAYSCALE_1BPP) { - // inverting for B/W - offsetLiterals = 0; - for (y = 0; y < height; y++) { - offsetLiterals++; // skipping predictor - for (i = 0; i < lineSize; i++) { - literals[offsetLiterals++] ^= 0xFF; - } - } - } - - var ihdr = new Uint8Array([ - width >> 24 & 0xff, - width >> 16 & 0xff, - width >> 8 & 0xff, - width & 0xff, - height >> 24 & 0xff, - height >> 16 & 0xff, - height >> 8 & 0xff, - height & 0xff, - bitDepth, // bit depth - colorType, // color type - 0x00, // compression method - 0x00, // filter method - 0x00 // interlace method - ]); - - var len = literals.length; - var maxBlockLength = 0xFFFF; - - var deflateBlocks = Math.ceil(len / maxBlockLength); - var idat = new Uint8Array(2 + len + deflateBlocks * 5 + 4); - var pi = 0; - idat[pi++] = 0x78; // compression method and flags - idat[pi++] = 0x9c; // flags - - var pos = 0; - while (len > maxBlockLength) { - // writing non-final DEFLATE blocks type 0 and length of 65535 - idat[pi++] = 0x00; - idat[pi++] = 0xff; - idat[pi++] = 0xff; - idat[pi++] = 0x00; - idat[pi++] = 0x00; - idat.set(literals.subarray(pos, pos + maxBlockLength), pi); - pi += maxBlockLength; - pos += maxBlockLength; - len -= maxBlockLength; - } - - // writing non-final DEFLATE blocks type 0 - idat[pi++] = 0x01; - idat[pi++] = len & 0xff; - idat[pi++] = len >> 8 & 0xff; - idat[pi++] = (~len & 0xffff) & 0xff; - idat[pi++] = (~len & 0xffff) >> 8 & 0xff; - idat.set(literals.subarray(pos), pi); - pi += literals.length - pos; - - var adler = adler32(literals, 0, literals.length); // checksum - idat[pi++] = adler >> 24 & 0xff; - idat[pi++] = adler >> 16 & 0xff; - idat[pi++] = adler >> 8 & 0xff; - idat[pi++] = adler & 0xff; - - // PNG will consists: header, IHDR+data, IDAT+data, and IEND. - var pngLength = PNG_HEADER.length + (CHUNK_WRAPPER_SIZE * 3) + - ihdr.length + idat.length; - var data = new Uint8Array(pngLength); - var offset = 0; - data.set(PNG_HEADER, offset); - offset += PNG_HEADER.length; - writePngChunk('IHDR', ihdr, data, offset); - offset += CHUNK_WRAPPER_SIZE + ihdr.length; - writePngChunk('IDATA', idat, data, offset); - offset += CHUNK_WRAPPER_SIZE + idat.length; - writePngChunk('IEND', new Uint8Array(0), data, offset); - - return createObjectURL(data, 'image/png', forceDataSchema); - } - - return function convertImgDataToPng(imgData, forceDataSchema) { - var kind = (imgData.kind === undefined ? - ImageKind.GRAYSCALE_1BPP : imgData.kind); - return encode(imgData, kind, forceDataSchema); - }; -})(); - -var SVGExtraState = (function SVGExtraStateClosure() { - function SVGExtraState() { - this.fontSizeScale = 1; - this.fontWeight = SVG_DEFAULTS.fontWeight; - this.fontSize = 0; - - this.textMatrix = IDENTITY_MATRIX; - this.fontMatrix = FONT_IDENTITY_MATRIX; - this.leading = 0; - - // Current point (in user coordinates) - this.x = 0; - this.y = 0; - - // Start of text line (in text coordinates) - this.lineX = 0; - this.lineY = 0; - - // Character and word spacing - this.charSpacing = 0; - this.wordSpacing = 0; - this.textHScale = 1; - this.textRise = 0; - - // Default foreground and background colors - this.fillColor = SVG_DEFAULTS.fillColor; - this.strokeColor = '#000000'; - - this.fillAlpha = 1; - this.strokeAlpha = 1; - this.lineWidth = 1; - this.lineJoin = ''; - this.lineCap = ''; - this.miterLimit = 0; - - this.dashArray = []; - this.dashPhase = 0; - - this.dependencies = []; - - // Clipping - this.clipId = ''; - this.pendingClip = false; - - this.maskId = ''; - } - - SVGExtraState.prototype = { - clone: function SVGExtraState_clone() { - return Object.create(this); - }, - setCurrentPoint: function SVGExtraState_setCurrentPoint(x, y) { - this.x = x; - this.y = y; - } - }; - return SVGExtraState; -})(); - -var SVGGraphics = (function SVGGraphicsClosure() { - function createScratchSVG(width, height) { - var NS = 'http://www.w3.org/2000/svg'; - var svg = document.createElementNS(NS, 'svg:svg'); - svg.setAttributeNS(null, 'version', '1.1'); - svg.setAttributeNS(null, 'width', width + 'px'); - svg.setAttributeNS(null, 'height', height + 'px'); - svg.setAttributeNS(null, 'viewBox', '0 0 ' + width + ' ' + height); - return svg; - } - - function opListToTree(opList) { - var opTree = []; - var tmp = []; - var opListLen = opList.length; - - for (var x = 0; x < opListLen; x++) { - if (opList[x].fn === 'save') { - opTree.push({'fnId': 92, 'fn': 'group', 'items': []}); - tmp.push(opTree); - opTree = opTree[opTree.length - 1].items; - continue; - } - - if(opList[x].fn === 'restore') { - opTree = tmp.pop(); - } else { - opTree.push(opList[x]); - } - } - return opTree; - } - - /** - * Formats float number. - * @param value {number} number to format. - * @returns {string} - */ - function pf(value) { - if (value === (value | 0)) { // integer number - return value.toString(); - } - var s = value.toFixed(10); - var i = s.length - 1; - if (s[i] !== '0') { - return s; - } - // removing trailing zeros - do { - i--; - } while (s[i] === '0'); - return s.substr(0, s[i] === '.' ? i : i + 1); - } - - /** - * Formats transform matrix. The standard rotation, scale and translate - * matrices are replaced by their shorter forms, and for identity matrix - * returns empty string to save the memory. - * @param m {Array} matrix to format. - * @returns {string} - */ - function pm(m) { - if (m[4] === 0 && m[5] === 0) { - if (m[1] === 0 && m[2] === 0) { - if (m[0] === 1 && m[3] === 1) { - return ''; - } - return 'scale(' + pf(m[0]) + ' ' + pf(m[3]) + ')'; - } - if (m[0] === m[3] && m[1] === -m[2]) { - var a = Math.acos(m[0]) * 180 / Math.PI; - return 'rotate(' + pf(a) + ')'; - } - } else { - if (m[0] === 1 && m[1] === 0 && m[2] === 0 && m[3] === 1) { - return 'translate(' + pf(m[4]) + ' ' + pf(m[5]) + ')'; - } - } - return 'matrix(' + pf(m[0]) + ' ' + pf(m[1]) + ' ' + pf(m[2]) + ' ' + - pf(m[3]) + ' ' + pf(m[4]) + ' ' + pf(m[5]) + ')'; - } - - function SVGGraphics(commonObjs, objs, forceDataSchema) { - this.current = new SVGExtraState(); - this.transformMatrix = IDENTITY_MATRIX; // Graphics state matrix - this.transformStack = []; - this.extraStack = []; - this.commonObjs = commonObjs; - this.objs = objs; - this.pendingEOFill = false; - - this.embedFonts = false; - this.embeddedFonts = Object.create(null); - this.cssStyle = null; - this.forceDataSchema = !!forceDataSchema; - } - - var NS = 'http://www.w3.org/2000/svg'; - var XML_NS = 'http://www.w3.org/XML/1998/namespace'; - var XLINK_NS = 'http://www.w3.org/1999/xlink'; - var LINE_CAP_STYLES = ['butt', 'round', 'square']; - var LINE_JOIN_STYLES = ['miter', 'round', 'bevel']; - var clipCount = 0; - var maskCount = 0; - - SVGGraphics.prototype = { - save: function SVGGraphics_save() { - this.transformStack.push(this.transformMatrix); - var old = this.current; - this.extraStack.push(old); - this.current = old.clone(); - }, - - restore: function SVGGraphics_restore() { - this.transformMatrix = this.transformStack.pop(); - this.current = this.extraStack.pop(); - - this.tgrp = document.createElementNS(NS, 'svg:g'); - this.tgrp.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - this.pgrp.appendChild(this.tgrp); - }, - - group: function SVGGraphics_group(items) { - this.save(); - this.executeOpTree(items); - this.restore(); - }, - - loadDependencies: function SVGGraphics_loadDependencies(operatorList) { - var fnArray = operatorList.fnArray; - var fnArrayLen = fnArray.length; - var argsArray = operatorList.argsArray; - - var self = this; - for (var i = 0; i < fnArrayLen; i++) { - if (OPS.dependency === fnArray[i]) { - var deps = argsArray[i]; - for (var n = 0, nn = deps.length; n < nn; n++) { - var obj = deps[n]; - var common = obj.substring(0, 2) === 'g_'; - var promise; - if (common) { - promise = new Promise(function(resolve) { - self.commonObjs.get(obj, resolve); - }); - } else { - promise = new Promise(function(resolve) { - self.objs.get(obj, resolve); - }); - } - this.current.dependencies.push(promise); - } - } - } - return Promise.all(this.current.dependencies); - }, - - transform: function SVGGraphics_transform(a, b, c, d, e, f) { - var transformMatrix = [a, b, c, d, e, f]; - this.transformMatrix = Util.transform(this.transformMatrix, - transformMatrix); - - this.tgrp = document.createElementNS(NS, 'svg:g'); - this.tgrp.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - }, - - getSVG: function SVGGraphics_getSVG(operatorList, viewport) { - this.svg = createScratchSVG(viewport.width, viewport.height); - this.viewport = viewport; - - return this.loadDependencies(operatorList).then(function () { - this.transformMatrix = IDENTITY_MATRIX; - this.pgrp = document.createElementNS(NS, 'svg:g'); // Parent group - this.pgrp.setAttributeNS(null, 'transform', pm(viewport.transform)); - this.tgrp = document.createElementNS(NS, 'svg:g'); // Transform group - this.tgrp.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - this.defs = document.createElementNS(NS, 'svg:defs'); - this.pgrp.appendChild(this.defs); - this.pgrp.appendChild(this.tgrp); - this.svg.appendChild(this.pgrp); - var opTree = this.convertOpList(operatorList); - this.executeOpTree(opTree); - return this.svg; - }.bind(this)); - }, - - convertOpList: function SVGGraphics_convertOpList(operatorList) { - var argsArray = operatorList.argsArray; - var fnArray = operatorList.fnArray; - var fnArrayLen = fnArray.length; - var REVOPS = []; - var opList = []; - - for (var op in OPS) { - REVOPS[OPS[op]] = op; - } - - for (var x = 0; x < fnArrayLen; x++) { - var fnId = fnArray[x]; - opList.push({'fnId' : fnId, 'fn': REVOPS[fnId], 'args': argsArray[x]}); - } - return opListToTree(opList); - }, - - executeOpTree: function SVGGraphics_executeOpTree(opTree) { - var opTreeLen = opTree.length; - for(var x = 0; x < opTreeLen; x++) { - var fn = opTree[x].fn; - var fnId = opTree[x].fnId; - var args = opTree[x].args; - - switch (fnId | 0) { - case OPS.beginText: - this.beginText(); - break; - case OPS.setLeading: - this.setLeading(args); - break; - case OPS.setLeadingMoveText: - this.setLeadingMoveText(args[0], args[1]); - break; - case OPS.setFont: - this.setFont(args); - break; - case OPS.showText: - this.showText(args[0]); - break; - case OPS.showSpacedText: - this.showText(args[0]); - break; - case OPS.endText: - this.endText(); - break; - case OPS.moveText: - this.moveText(args[0], args[1]); - break; - case OPS.setCharSpacing: - this.setCharSpacing(args[0]); - break; - case OPS.setWordSpacing: - this.setWordSpacing(args[0]); - break; - case OPS.setHScale: - this.setHScale(args[0]); - break; - case OPS.setTextMatrix: - this.setTextMatrix(args[0], args[1], args[2], - args[3], args[4], args[5]); - break; - case OPS.setLineWidth: - this.setLineWidth(args[0]); - break; - case OPS.setLineJoin: - this.setLineJoin(args[0]); - break; - case OPS.setLineCap: - this.setLineCap(args[0]); - break; - case OPS.setMiterLimit: - this.setMiterLimit(args[0]); - break; - case OPS.setFillRGBColor: - this.setFillRGBColor(args[0], args[1], args[2]); - break; - case OPS.setStrokeRGBColor: - this.setStrokeRGBColor(args[0], args[1], args[2]); - break; - case OPS.setDash: - this.setDash(args[0], args[1]); - break; - case OPS.setGState: - this.setGState(args[0]); - break; - case OPS.fill: - this.fill(); - break; - case OPS.eoFill: - this.eoFill(); - break; - case OPS.stroke: - this.stroke(); - break; - case OPS.fillStroke: - this.fillStroke(); - break; - case OPS.eoFillStroke: - this.eoFillStroke(); - break; - case OPS.clip: - this.clip('nonzero'); - break; - case OPS.eoClip: - this.clip('evenodd'); - break; - case OPS.paintSolidColorImageMask: - this.paintSolidColorImageMask(); - break; - case OPS.paintJpegXObject: - this.paintJpegXObject(args[0], args[1], args[2]); - break; - case OPS.paintImageXObject: - this.paintImageXObject(args[0]); - break; - case OPS.paintInlineImageXObject: - this.paintInlineImageXObject(args[0]); - break; - case OPS.paintImageMaskXObject: - this.paintImageMaskXObject(args[0]); - break; - case OPS.paintFormXObjectBegin: - this.paintFormXObjectBegin(args[0], args[1]); - break; - case OPS.paintFormXObjectEnd: - this.paintFormXObjectEnd(); - break; - case OPS.closePath: - this.closePath(); - break; - case OPS.closeStroke: - this.closeStroke(); - break; - case OPS.closeFillStroke: - this.closeFillStroke(); - break; - case OPS.nextLine: - this.nextLine(); - break; - case OPS.transform: - this.transform(args[0], args[1], args[2], args[3], - args[4], args[5]); - break; - case OPS.constructPath: - this.constructPath(args[0], args[1]); - break; - case OPS.endPath: - this.endPath(); - break; - case 92: - this.group(opTree[x].items); - break; - default: - warn('Unimplemented method '+ fn); - break; - } - } - }, - - setWordSpacing: function SVGGraphics_setWordSpacing(wordSpacing) { - this.current.wordSpacing = wordSpacing; - }, - - setCharSpacing: function SVGGraphics_setCharSpacing(charSpacing) { - this.current.charSpacing = charSpacing; - }, - - nextLine: function SVGGraphics_nextLine() { - this.moveText(0, this.current.leading); - }, - - setTextMatrix: function SVGGraphics_setTextMatrix(a, b, c, d, e, f) { - var current = this.current; - this.current.textMatrix = this.current.lineMatrix = [a, b, c, d, e, f]; - - this.current.x = this.current.lineX = 0; - this.current.y = this.current.lineY = 0; - - current.xcoords = []; - current.tspan = document.createElementNS(NS, 'svg:tspan'); - current.tspan.setAttributeNS(null, 'font-family', current.fontFamily); - current.tspan.setAttributeNS(null, 'font-size', - pf(current.fontSize) + 'px'); - current.tspan.setAttributeNS(null, 'y', pf(-current.y)); - - current.txtElement = document.createElementNS(NS, 'svg:text'); - current.txtElement.appendChild(current.tspan); - }, - - beginText: function SVGGraphics_beginText() { - this.current.x = this.current.lineX = 0; - this.current.y = this.current.lineY = 0; - this.current.textMatrix = IDENTITY_MATRIX; - this.current.lineMatrix = IDENTITY_MATRIX; - this.current.tspan = document.createElementNS(NS, 'svg:tspan'); - this.current.txtElement = document.createElementNS(NS, 'svg:text'); - this.current.txtgrp = document.createElementNS(NS, 'svg:g'); - this.current.xcoords = []; - }, - - moveText: function SVGGraphics_moveText(x, y) { - var current = this.current; - this.current.x = this.current.lineX += x; - this.current.y = this.current.lineY += y; - - current.xcoords = []; - current.tspan = document.createElementNS(NS, 'svg:tspan'); - current.tspan.setAttributeNS(null, 'font-family', current.fontFamily); - current.tspan.setAttributeNS(null, 'font-size', - pf(current.fontSize) + 'px'); - current.tspan.setAttributeNS(null, 'y', pf(-current.y)); - }, - - showText: function SVGGraphics_showText(glyphs) { - var current = this.current; - var font = current.font; - var fontSize = current.fontSize; - - if (fontSize === 0) { - return; - } - - var charSpacing = current.charSpacing; - var wordSpacing = current.wordSpacing; - var fontDirection = current.fontDirection; - var textHScale = current.textHScale * fontDirection; - var glyphsLength = glyphs.length; - var vertical = font.vertical; - var widthAdvanceScale = fontSize * current.fontMatrix[0]; - - var x = 0, i; - for (i = 0; i < glyphsLength; ++i) { - var glyph = glyphs[i]; - if (glyph === null) { - // word break - x += fontDirection * wordSpacing; - continue; - } else if (isNum(glyph)) { - x += -glyph * fontSize * 0.001; - continue; - } - current.xcoords.push(current.x + x * textHScale); - - var width = glyph.width; - var character = glyph.fontChar; - var charWidth = width * widthAdvanceScale + charSpacing * fontDirection; - x += charWidth; - - current.tspan.textContent += character; - } - if (vertical) { - current.y -= x * textHScale; - } else { - current.x += x * textHScale; - } - - current.tspan.setAttributeNS(null, 'x', - current.xcoords.map(pf).join(' ')); - current.tspan.setAttributeNS(null, 'y', pf(-current.y)); - current.tspan.setAttributeNS(null, 'font-family', current.fontFamily); - current.tspan.setAttributeNS(null, 'font-size', - pf(current.fontSize) + 'px'); - if (current.fontStyle !== SVG_DEFAULTS.fontStyle) { - current.tspan.setAttributeNS(null, 'font-style', current.fontStyle); - } - if (current.fontWeight !== SVG_DEFAULTS.fontWeight) { - current.tspan.setAttributeNS(null, 'font-weight', current.fontWeight); - } - if (current.fillColor !== SVG_DEFAULTS.fillColor) { - current.tspan.setAttributeNS(null, 'fill', current.fillColor); - } - - current.txtElement.setAttributeNS(null, 'transform', - pm(current.textMatrix) + - ' scale(1, -1)' ); - current.txtElement.setAttributeNS(XML_NS, 'xml:space', 'preserve'); - current.txtElement.appendChild(current.tspan); - current.txtgrp.appendChild(current.txtElement); - - this.tgrp.appendChild(current.txtElement); - - }, - - setLeadingMoveText: function SVGGraphics_setLeadingMoveText(x, y) { - this.setLeading(-y); - this.moveText(x, y); - }, - - addFontStyle: function SVGGraphics_addFontStyle(fontObj) { - if (!this.cssStyle) { - this.cssStyle = document.createElementNS(NS, 'svg:style'); - this.cssStyle.setAttributeNS(null, 'type', 'text/css'); - this.defs.appendChild(this.cssStyle); - } - - var url = createObjectURL(fontObj.data, fontObj.mimetype, - this.forceDataSchema); - this.cssStyle.textContent += - '@font-face { font-family: "' + fontObj.loadedName + '";' + - ' src: url(' + url + '); }\n'; - }, - - setFont: function SVGGraphics_setFont(details) { - var current = this.current; - var fontObj = this.commonObjs.get(details[0]); - var size = details[1]; - this.current.font = fontObj; - - if (this.embedFonts && fontObj.data && - !this.embeddedFonts[fontObj.loadedName]) { - this.addFontStyle(fontObj); - this.embeddedFonts[fontObj.loadedName] = fontObj; - } - - current.fontMatrix = (fontObj.fontMatrix ? - fontObj.fontMatrix : FONT_IDENTITY_MATRIX); - - var bold = fontObj.black ? (fontObj.bold ? 'bolder' : 'bold') : - (fontObj.bold ? 'bold' : 'normal'); - var italic = fontObj.italic ? 'italic' : 'normal'; - - if (size < 0) { - size = -size; - current.fontDirection = -1; - } else { - current.fontDirection = 1; - } - current.fontSize = size; - current.fontFamily = fontObj.loadedName; - current.fontWeight = bold; - current.fontStyle = italic; - - current.tspan = document.createElementNS(NS, 'svg:tspan'); - current.tspan.setAttributeNS(null, 'y', pf(-current.y)); - current.xcoords = []; - }, - - endText: function SVGGraphics_endText() { - if (this.current.pendingClip) { - this.cgrp.appendChild(this.tgrp); - this.pgrp.appendChild(this.cgrp); - } else { - this.pgrp.appendChild(this.tgrp); - } - this.tgrp = document.createElementNS(NS, 'svg:g'); - this.tgrp.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - }, - - // Path properties - setLineWidth: function SVGGraphics_setLineWidth(width) { - this.current.lineWidth = width; - }, - setLineCap: function SVGGraphics_setLineCap(style) { - this.current.lineCap = LINE_CAP_STYLES[style]; - }, - setLineJoin: function SVGGraphics_setLineJoin(style) { - this.current.lineJoin = LINE_JOIN_STYLES[style]; - }, - setMiterLimit: function SVGGraphics_setMiterLimit(limit) { - this.current.miterLimit = limit; - }, - setStrokeRGBColor: function SVGGraphics_setStrokeRGBColor(r, g, b) { - var color = Util.makeCssRgb(r, g, b); - this.current.strokeColor = color; - }, - setFillRGBColor: function SVGGraphics_setFillRGBColor(r, g, b) { - var color = Util.makeCssRgb(r, g, b); - this.current.fillColor = color; - this.current.tspan = document.createElementNS(NS, 'svg:tspan'); - this.current.xcoords = []; - }, - setDash: function SVGGraphics_setDash(dashArray, dashPhase) { - this.current.dashArray = dashArray; - this.current.dashPhase = dashPhase; - }, - - constructPath: function SVGGraphics_constructPath(ops, args) { - var current = this.current; - var x = current.x, y = current.y; - current.path = document.createElementNS(NS, 'svg:path'); - var d = []; - var opLength = ops.length; - - for (var i = 0, j = 0; i < opLength; i++) { - switch (ops[i] | 0) { - case OPS.rectangle: - x = args[j++]; - y = args[j++]; - var width = args[j++]; - var height = args[j++]; - var xw = x + width; - var yh = y + height; - d.push('M', pf(x), pf(y), 'L', pf(xw) , pf(y), 'L', pf(xw), pf(yh), - 'L', pf(x), pf(yh), 'Z'); - break; - case OPS.moveTo: - x = args[j++]; - y = args[j++]; - d.push('M', pf(x), pf(y)); - break; - case OPS.lineTo: - x = args[j++]; - y = args[j++]; - d.push('L', pf(x) , pf(y)); - break; - case OPS.curveTo: - x = args[j + 4]; - y = args[j + 5]; - d.push('C', pf(args[j]), pf(args[j + 1]), pf(args[j + 2]), - pf(args[j + 3]), pf(x), pf(y)); - j += 6; - break; - case OPS.curveTo2: - x = args[j + 2]; - y = args[j + 3]; - d.push('C', pf(x), pf(y), pf(args[j]), pf(args[j + 1]), - pf(args[j + 2]), pf(args[j + 3])); - j += 4; - break; - case OPS.curveTo3: - x = args[j + 2]; - y = args[j + 3]; - d.push('C', pf(args[j]), pf(args[j + 1]), pf(x), pf(y), - pf(x), pf(y)); - j += 4; - break; - case OPS.closePath: - d.push('Z'); - break; - } - } - current.path.setAttributeNS(null, 'd', d.join(' ')); - current.path.setAttributeNS(null, 'stroke-miterlimit', - pf(current.miterLimit)); - current.path.setAttributeNS(null, 'stroke-linecap', current.lineCap); - current.path.setAttributeNS(null, 'stroke-linejoin', current.lineJoin); - current.path.setAttributeNS(null, 'stroke-width', - pf(current.lineWidth) + 'px'); - current.path.setAttributeNS(null, 'stroke-dasharray', - current.dashArray.map(pf).join(' ')); - current.path.setAttributeNS(null, 'stroke-dashoffset', - pf(current.dashPhase) + 'px'); - current.path.setAttributeNS(null, 'fill', 'none'); - - this.tgrp.appendChild(current.path); - if (current.pendingClip) { - this.cgrp.appendChild(this.tgrp); - this.pgrp.appendChild(this.cgrp); - } else { - this.pgrp.appendChild(this.tgrp); - } - // Saving a reference in current.element so that it can be addressed - // in 'fill' and 'stroke' - current.element = current.path; - current.setCurrentPoint(x, y); - }, - - endPath: function SVGGraphics_endPath() { - var current = this.current; - if (current.pendingClip) { - this.cgrp.appendChild(this.tgrp); - this.pgrp.appendChild(this.cgrp); - } else { - this.pgrp.appendChild(this.tgrp); - } - this.tgrp = document.createElementNS(NS, 'svg:g'); - this.tgrp.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - }, - - clip: function SVGGraphics_clip(type) { - var current = this.current; - // Add current path to clipping path - current.clipId = 'clippath' + clipCount; - clipCount++; - this.clippath = document.createElementNS(NS, 'svg:clipPath'); - this.clippath.setAttributeNS(null, 'id', current.clipId); - var clipElement = current.element.cloneNode(); - if (type === 'evenodd') { - clipElement.setAttributeNS(null, 'clip-rule', 'evenodd'); - } else { - clipElement.setAttributeNS(null, 'clip-rule', 'nonzero'); - } - this.clippath.setAttributeNS(null, 'transform', pm(this.transformMatrix)); - this.clippath.appendChild(clipElement); - this.defs.appendChild(this.clippath); - - // Create a new group with that attribute - current.pendingClip = true; - this.cgrp = document.createElementNS(NS, 'svg:g'); - this.cgrp.setAttributeNS(null, 'clip-path', - 'url(#' + current.clipId + ')'); - this.pgrp.appendChild(this.cgrp); - }, - - closePath: function SVGGraphics_closePath() { - var current = this.current; - var d = current.path.getAttributeNS(null, 'd'); - d += 'Z'; - current.path.setAttributeNS(null, 'd', d); - }, - - setLeading: function SVGGraphics_setLeading(leading) { - this.current.leading = -leading; - }, - - setTextRise: function SVGGraphics_setTextRise(textRise) { - this.current.textRise = textRise; - }, - - setHScale: function SVGGraphics_setHScale(scale) { - this.current.textHScale = scale / 100; - }, - - setGState: function SVGGraphics_setGState(states) { - for (var i = 0, ii = states.length; i < ii; i++) { - var state = states[i]; - var key = state[0]; - var value = state[1]; - - switch (key) { - case 'LW': - this.setLineWidth(value); - break; - case 'LC': - this.setLineCap(value); - break; - case 'LJ': - this.setLineJoin(value); - break; - case 'ML': - this.setMiterLimit(value); - break; - case 'D': - this.setDash(value[0], value[1]); - break; - case 'RI': - break; - case 'FL': - break; - case 'Font': - this.setFont(value); - break; - case 'CA': - break; - case 'ca': - break; - case 'BM': - break; - case 'SMask': - break; - } - } - }, - - fill: function SVGGraphics_fill() { - var current = this.current; - current.element.setAttributeNS(null, 'fill', current.fillColor); - }, - - stroke: function SVGGraphics_stroke() { - var current = this.current; - current.element.setAttributeNS(null, 'stroke', current.strokeColor); - current.element.setAttributeNS(null, 'fill', 'none'); - }, - - eoFill: function SVGGraphics_eoFill() { - var current = this.current; - current.element.setAttributeNS(null, 'fill', current.fillColor); - current.element.setAttributeNS(null, 'fill-rule', 'evenodd'); - }, - - fillStroke: function SVGGraphics_fillStroke() { - // Order is important since stroke wants fill to be none. - // First stroke, then if fill needed, it will be overwritten. - this.stroke(); - this.fill(); - }, - - eoFillStroke: function SVGGraphics_eoFillStroke() { - this.current.element.setAttributeNS(null, 'fill-rule', 'evenodd'); - this.fillStroke(); - }, - - closeStroke: function SVGGraphics_closeStroke() { - this.closePath(); - this.stroke(); - }, - - closeFillStroke: function SVGGraphics_closeFillStroke() { - this.closePath(); - this.fillStroke(); - }, - - paintSolidColorImageMask: - function SVGGraphics_paintSolidColorImageMask() { - var current = this.current; - var rect = document.createElementNS(NS, 'svg:rect'); - rect.setAttributeNS(null, 'x', '0'); - rect.setAttributeNS(null, 'y', '0'); - rect.setAttributeNS(null, 'width', '1px'); - rect.setAttributeNS(null, 'height', '1px'); - rect.setAttributeNS(null, 'fill', current.fillColor); - this.tgrp.appendChild(rect); - }, - - paintJpegXObject: function SVGGraphics_paintJpegXObject(objId, w, h) { - var current = this.current; - var imgObj = this.objs.get(objId); - var imgEl = document.createElementNS(NS, 'svg:image'); - imgEl.setAttributeNS(XLINK_NS, 'xlink:href', imgObj.src); - imgEl.setAttributeNS(null, 'width', imgObj.width + 'px'); - imgEl.setAttributeNS(null, 'height', imgObj.height + 'px'); - imgEl.setAttributeNS(null, 'x', '0'); - imgEl.setAttributeNS(null, 'y', pf(-h)); - imgEl.setAttributeNS(null, 'transform', - 'scale(' + pf(1 / w) + ' ' + pf(-1 / h) + ')'); - - this.tgrp.appendChild(imgEl); - if (current.pendingClip) { - this.cgrp.appendChild(this.tgrp); - this.pgrp.appendChild(this.cgrp); - } else { - this.pgrp.appendChild(this.tgrp); - } - }, - - paintImageXObject: function SVGGraphics_paintImageXObject(objId) { - var imgData = this.objs.get(objId); - if (!imgData) { - warn('Dependent image isn\'t ready yet'); - return; - } - this.paintInlineImageXObject(imgData); - }, - - paintInlineImageXObject: - function SVGGraphics_paintInlineImageXObject(imgData, mask) { - var current = this.current; - var width = imgData.width; - var height = imgData.height; - - var imgSrc = convertImgDataToPng(imgData, this.forceDataSchema); - var cliprect = document.createElementNS(NS, 'svg:rect'); - cliprect.setAttributeNS(null, 'x', '0'); - cliprect.setAttributeNS(null, 'y', '0'); - cliprect.setAttributeNS(null, 'width', pf(width)); - cliprect.setAttributeNS(null, 'height', pf(height)); - current.element = cliprect; - this.clip('nonzero'); - var imgEl = document.createElementNS(NS, 'svg:image'); - imgEl.setAttributeNS(XLINK_NS, 'xlink:href', imgSrc); - imgEl.setAttributeNS(null, 'x', '0'); - imgEl.setAttributeNS(null, 'y', pf(-height)); - imgEl.setAttributeNS(null, 'width', pf(width) + 'px'); - imgEl.setAttributeNS(null, 'height', pf(height) + 'px'); - imgEl.setAttributeNS(null, 'transform', - 'scale(' + pf(1 / width) + ' ' + - pf(-1 / height) + ')'); - if (mask) { - mask.appendChild(imgEl); - } else { - this.tgrp.appendChild(imgEl); - } - if (current.pendingClip) { - this.cgrp.appendChild(this.tgrp); - this.pgrp.appendChild(this.cgrp); - } else { - this.pgrp.appendChild(this.tgrp); - } - }, - - paintImageMaskXObject: - function SVGGraphics_paintImageMaskXObject(imgData) { - var current = this.current; - var width = imgData.width; - var height = imgData.height; - var fillColor = current.fillColor; - - current.maskId = 'mask' + maskCount++; - var mask = document.createElementNS(NS, 'svg:mask'); - mask.setAttributeNS(null, 'id', current.maskId); - - var rect = document.createElementNS(NS, 'svg:rect'); - rect.setAttributeNS(null, 'x', '0'); - rect.setAttributeNS(null, 'y', '0'); - rect.setAttributeNS(null, 'width', pf(width)); - rect.setAttributeNS(null, 'height', pf(height)); - rect.setAttributeNS(null, 'fill', fillColor); - rect.setAttributeNS(null, 'mask', 'url(#' + current.maskId +')'); - this.defs.appendChild(mask); - this.tgrp.appendChild(rect); - - this.paintInlineImageXObject(imgData, mask); - }, - - paintFormXObjectBegin: - function SVGGraphics_paintFormXObjectBegin(matrix, bbox) { - this.save(); - - if (isArray(matrix) && matrix.length === 6) { - this.transform(matrix[0], matrix[1], matrix[2], - matrix[3], matrix[4], matrix[5]); - } - - if (isArray(bbox) && bbox.length === 4) { - var width = bbox[2] - bbox[0]; - var height = bbox[3] - bbox[1]; - - var cliprect = document.createElementNS(NS, 'svg:rect'); - cliprect.setAttributeNS(null, 'x', bbox[0]); - cliprect.setAttributeNS(null, 'y', bbox[1]); - cliprect.setAttributeNS(null, 'width', pf(width)); - cliprect.setAttributeNS(null, 'height', pf(height)); - this.current.element = cliprect; - this.clip('nonzero'); - this.endPath(); - } - }, - - paintFormXObjectEnd: - function SVGGraphics_paintFormXObjectEnd() { - this.restore(); - } - }; - return SVGGraphics; -})(); - -exports.SVGGraphics = SVGGraphics; -})); - - -(function (root, factory) { - { - factory((root.pdfjsDisplayAnnotationLayer = {}), root.pdfjsSharedUtil, - root.pdfjsDisplayDOMUtils); - } -}(this, function (exports, sharedUtil, displayDOMUtils) { - -var AnnotationBorderStyleType = sharedUtil.AnnotationBorderStyleType; -var AnnotationType = sharedUtil.AnnotationType; -var Util = sharedUtil.Util; -var addLinkAttributes = displayDOMUtils.addLinkAttributes; -var LinkTarget = displayDOMUtils.LinkTarget; -var getFilenameFromUrl = displayDOMUtils.getFilenameFromUrl; -var warn = sharedUtil.warn; -var CustomStyle = displayDOMUtils.CustomStyle; -var getDefaultSetting = displayDOMUtils.getDefaultSetting; - -/** - * @typedef {Object} AnnotationElementParameters - * @property {Object} data - * @property {HTMLDivElement} layer - * @property {PDFPage} page - * @property {PageViewport} viewport - * @property {IPDFLinkService} linkService - * @property {DownloadManager} downloadManager - * @property {string} imageResourcesPath - * @property {boolean} renderInteractiveForms - */ - -/** - * @class - * @alias AnnotationElementFactory - */ -function AnnotationElementFactory() {} -AnnotationElementFactory.prototype = - /** @lends AnnotationElementFactory.prototype */ { - /** - * @param {AnnotationElementParameters} parameters - * @returns {AnnotationElement} - */ - create: function AnnotationElementFactory_create(parameters) { - var subtype = parameters.data.annotationType; - - switch (subtype) { - case AnnotationType.LINK: - return new LinkAnnotationElement(parameters); - - case AnnotationType.TEXT: - return new TextAnnotationElement(parameters); - - case AnnotationType.WIDGET: - var fieldType = parameters.data.fieldType; - - switch (fieldType) { - case 'Tx': - return new TextWidgetAnnotationElement(parameters); - } - return new WidgetAnnotationElement(parameters); - - case AnnotationType.POPUP: - return new PopupAnnotationElement(parameters); - - case AnnotationType.HIGHLIGHT: - return new HighlightAnnotationElement(parameters); - - case AnnotationType.UNDERLINE: - return new UnderlineAnnotationElement(parameters); - - case AnnotationType.SQUIGGLY: - return new SquigglyAnnotationElement(parameters); - - case AnnotationType.STRIKEOUT: - return new StrikeOutAnnotationElement(parameters); - - case AnnotationType.FILEATTACHMENT: - return new FileAttachmentAnnotationElement(parameters); - - default: - return new AnnotationElement(parameters); - } - } -}; - -/** - * @class - * @alias AnnotationElement - */ -var AnnotationElement = (function AnnotationElementClosure() { - function AnnotationElement(parameters, isRenderable) { - this.isRenderable = isRenderable || false; - this.data = parameters.data; - this.layer = parameters.layer; - this.page = parameters.page; - this.viewport = parameters.viewport; - this.linkService = parameters.linkService; - this.downloadManager = parameters.downloadManager; - this.imageResourcesPath = parameters.imageResourcesPath; - this.renderInteractiveForms = parameters.renderInteractiveForms; - - if (isRenderable) { - this.container = this._createContainer(); - } - } - - AnnotationElement.prototype = /** @lends AnnotationElement.prototype */ { - /** - * Create an empty container for the annotation's HTML element. - * - * @private - * @memberof AnnotationElement - * @returns {HTMLSectionElement} - */ - _createContainer: function AnnotationElement_createContainer() { - var data = this.data, page = this.page, viewport = this.viewport; - var container = document.createElement('section'); - var width = data.rect[2] - data.rect[0]; - var height = data.rect[3] - data.rect[1]; - - container.setAttribute('data-annotation-id', data.id); - - // Do *not* modify `data.rect`, since that will corrupt the annotation - // position on subsequent calls to `_createContainer` (see issue 6804). - var rect = Util.normalizeRect([ - data.rect[0], - page.view[3] - data.rect[1] + page.view[1], - data.rect[2], - page.view[3] - data.rect[3] + page.view[1] - ]); - - CustomStyle.setProp('transform', container, - 'matrix(' + viewport.transform.join(',') + ')'); - CustomStyle.setProp('transformOrigin', container, - -rect[0] + 'px ' + -rect[1] + 'px'); - - if (data.borderStyle.width > 0) { - container.style.borderWidth = data.borderStyle.width + 'px'; - if (data.borderStyle.style !== AnnotationBorderStyleType.UNDERLINE) { - // Underline styles only have a bottom border, so we do not need - // to adjust for all borders. This yields a similar result as - // Adobe Acrobat/Reader. - width = width - 2 * data.borderStyle.width; - height = height - 2 * data.borderStyle.width; - } - - var horizontalRadius = data.borderStyle.horizontalCornerRadius; - var verticalRadius = data.borderStyle.verticalCornerRadius; - if (horizontalRadius > 0 || verticalRadius > 0) { - var radius = horizontalRadius + 'px / ' + verticalRadius + 'px'; - CustomStyle.setProp('borderRadius', container, radius); - } - - switch (data.borderStyle.style) { - case AnnotationBorderStyleType.SOLID: - container.style.borderStyle = 'solid'; - break; - - case AnnotationBorderStyleType.DASHED: - container.style.borderStyle = 'dashed'; - break; - - case AnnotationBorderStyleType.BEVELED: - warn('Unimplemented border style: beveled'); - break; - - case AnnotationBorderStyleType.INSET: - warn('Unimplemented border style: inset'); - break; - - case AnnotationBorderStyleType.UNDERLINE: - container.style.borderBottomStyle = 'solid'; - break; - - default: - break; - } - - if (data.color) { - container.style.borderColor = - Util.makeCssRgb(data.color[0] | 0, - data.color[1] | 0, - data.color[2] | 0); - } else { - // Transparent (invisible) border, so do not draw it at all. - container.style.borderWidth = 0; - } - } - - container.style.left = rect[0] + 'px'; - container.style.top = rect[1] + 'px'; - - container.style.width = width + 'px'; - container.style.height = height + 'px'; - - return container; - }, - - /** - * Create a popup for the annotation's HTML element. This is used for - * annotations that do not have a Popup entry in the dictionary, but - * are of a type that works with popups (such as Highlight annotations). - * - * @private - * @param {HTMLSectionElement} container - * @param {HTMLDivElement|HTMLImageElement|null} trigger - * @param {Object} data - * @memberof AnnotationElement - */ - _createPopup: - function AnnotationElement_createPopup(container, trigger, data) { - // If no trigger element is specified, create it. - if (!trigger) { - trigger = document.createElement('div'); - trigger.style.height = container.style.height; - trigger.style.width = container.style.width; - container.appendChild(trigger); - } - - var popupElement = new PopupElement({ - container: container, - trigger: trigger, - color: data.color, - title: data.title, - contents: data.contents, - hideWrapper: true - }); - var popup = popupElement.render(); - - // Position the popup next to the annotation's container. - popup.style.left = container.style.width; - - container.appendChild(popup); - }, - - /** - * Render the annotation's HTML element in the empty container. - * - * @public - * @memberof AnnotationElement - */ - render: function AnnotationElement_render() { - throw new Error('Abstract method AnnotationElement.render called'); - } - }; - - return AnnotationElement; -})(); - -/** - * @class - * @alias LinkAnnotationElement - */ -var LinkAnnotationElement = (function LinkAnnotationElementClosure() { - function LinkAnnotationElement(parameters) { - AnnotationElement.call(this, parameters, true); - } - - Util.inherit(LinkAnnotationElement, AnnotationElement, { - /** - * Render the link annotation's HTML element in the empty container. - * - * @public - * @memberof LinkAnnotationElement - * @returns {HTMLSectionElement} - */ - render: function LinkAnnotationElement_render() { - this.container.className = 'linkAnnotation'; - - var link = document.createElement('a'); - addLinkAttributes(link, { - url: this.data.url, - target: (this.data.newWindow ? LinkTarget.BLANK : undefined), - }); - - if (!this.data.url) { - if (this.data.action) { - this._bindNamedAction(link, this.data.action); - } else { - this._bindLink(link, (this.data.dest || null)); - } - } - - this.container.appendChild(link); - return this.container; - }, - - /** - * Bind internal links to the link element. - * - * @private - * @param {Object} link - * @param {Object} destination - * @memberof LinkAnnotationElement - */ - _bindLink: function LinkAnnotationElement_bindLink(link, destination) { - var self = this; - - link.href = this.linkService.getDestinationHash(destination); - link.onclick = function() { - if (destination) { - self.linkService.navigateTo(destination); - } - return false; - }; - if (destination) { - link.className = 'internalLink'; - } - }, - - /** - * Bind named actions to the link element. - * - * @private - * @param {Object} link - * @param {Object} action - * @memberof LinkAnnotationElement - */ - _bindNamedAction: - function LinkAnnotationElement_bindNamedAction(link, action) { - var self = this; - - link.href = this.linkService.getAnchorUrl(''); - link.onclick = function() { - self.linkService.executeNamedAction(action); - return false; - }; - link.className = 'internalLink'; - } - }); - - return LinkAnnotationElement; -})(); - -/** - * @class - * @alias TextAnnotationElement - */ -var TextAnnotationElement = (function TextAnnotationElementClosure() { - function TextAnnotationElement(parameters) { - var isRenderable = !!(parameters.data.hasPopup || - parameters.data.title || parameters.data.contents); - AnnotationElement.call(this, parameters, isRenderable); - } - - Util.inherit(TextAnnotationElement, AnnotationElement, { - /** - * Render the text annotation's HTML element in the empty container. - * - * @public - * @memberof TextAnnotationElement - * @returns {HTMLSectionElement} - */ - render: function TextAnnotationElement_render() { - this.container.className = 'textAnnotation'; - - var image = document.createElement('img'); - image.style.height = this.container.style.height; - image.style.width = this.container.style.width; - image.src = this.imageResourcesPath + 'annotation-' + - this.data.name.toLowerCase() + '.svg'; - image.alt = '[{{type}} Annotation]'; - image.dataset.l10nId = 'text_annotation_type'; - image.dataset.l10nArgs = JSON.stringify({type: this.data.name}); - - if (!this.data.hasPopup) { - this._createPopup(this.container, image, this.data); - } - - this.container.appendChild(image); - return this.container; - } - }); - - return TextAnnotationElement; -})(); - -/** - * @class - * @alias WidgetAnnotationElement - */ -var WidgetAnnotationElement = (function WidgetAnnotationElementClosure() { - function WidgetAnnotationElement(parameters) { - var isRenderable = parameters.renderInteractiveForms || - (!parameters.data.hasAppearance && !!parameters.data.fieldValue); - AnnotationElement.call(this, parameters, isRenderable); - } - - Util.inherit(WidgetAnnotationElement, AnnotationElement, { - /** - * Render the widget annotation's HTML element in the empty container. - * - * @public - * @memberof WidgetAnnotationElement - * @returns {HTMLSectionElement} - */ - render: function WidgetAnnotationElement_render() { - // Show only the container for unsupported field types. - return this.container; - } - }); - - return WidgetAnnotationElement; -})(); - -/** - * @class - * @alias TextWidgetAnnotationElement - */ -var TextWidgetAnnotationElement = ( - function TextWidgetAnnotationElementClosure() { - var TEXT_ALIGNMENT = ['left', 'center', 'right']; - - function TextWidgetAnnotationElement(parameters) { - WidgetAnnotationElement.call(this, parameters); - } - - Util.inherit(TextWidgetAnnotationElement, WidgetAnnotationElement, { - /** - * Render the text widget annotation's HTML element in the empty container. - * - * @public - * @memberof TextWidgetAnnotationElement - * @returns {HTMLSectionElement} - */ - render: function TextWidgetAnnotationElement_render() { - this.container.className = 'textWidgetAnnotation'; - - var element = null; - if (this.renderInteractiveForms) { - // NOTE: We cannot set the values using `element.value` below, since it - // prevents the AnnotationLayer rasterizer in `test/driver.js` - // from parsing the elements correctly for the reference tests. - if (this.data.multiLine) { - element = document.createElement('textarea'); - element.textContent = this.data.fieldValue; - } else { - element = document.createElement('input'); - element.type = 'text'; - element.setAttribute('value', this.data.fieldValue); - } - - element.disabled = this.data.readOnly; - - if (this.data.maxLen !== null) { - element.maxLength = this.data.maxLen; - } - - if (this.data.comb) { - var fieldWidth = this.data.rect[2] - this.data.rect[0]; - var combWidth = fieldWidth / this.data.maxLen; - - element.classList.add('comb'); - element.style.letterSpacing = 'calc(' + combWidth + 'px - 1ch)'; - } - } else { - element = document.createElement('div'); - element.textContent = this.data.fieldValue; - element.style.verticalAlign = 'middle'; - element.style.display = 'table-cell'; - - var font = null; - if (this.data.fontRefName) { - font = this.page.commonObjs.getData(this.data.fontRefName); - } - this._setTextStyle(element, font); - } - - if (this.data.textAlignment !== null) { - element.style.textAlign = TEXT_ALIGNMENT[this.data.textAlignment]; - } - - this.container.appendChild(element); - return this.container; - }, - - /** - * Apply text styles to the text in the element. - * - * @private - * @param {HTMLDivElement} element - * @param {Object} font - * @memberof TextWidgetAnnotationElement - */ - _setTextStyle: - function TextWidgetAnnotationElement_setTextStyle(element, font) { - // TODO: This duplicates some of the logic in CanvasGraphics.setFont(). - var style = element.style; - style.fontSize = this.data.fontSize + 'px'; - style.direction = (this.data.fontDirection < 0 ? 'rtl': 'ltr'); - - if (!font) { - return; - } - - style.fontWeight = (font.black ? - (font.bold ? '900' : 'bold') : - (font.bold ? 'bold' : 'normal')); - style.fontStyle = (font.italic ? 'italic' : 'normal'); - - // Use a reasonable default font if the font doesn't specify a fallback. - var fontFamily = font.loadedName ? '"' + font.loadedName + '", ' : ''; - var fallbackName = font.fallbackName || 'Helvetica, sans-serif'; - style.fontFamily = fontFamily + fallbackName; - } - }); - - return TextWidgetAnnotationElement; -})(); - -/** - * @class - * @alias PopupAnnotationElement - */ -var PopupAnnotationElement = (function PopupAnnotationElementClosure() { - function PopupAnnotationElement(parameters) { - var isRenderable = !!(parameters.data.title || parameters.data.contents); - AnnotationElement.call(this, parameters, isRenderable); - } - - Util.inherit(PopupAnnotationElement, AnnotationElement, { - /** - * Render the popup annotation's HTML element in the empty container. - * - * @public - * @memberof PopupAnnotationElement - * @returns {HTMLSectionElement} - */ - render: function PopupAnnotationElement_render() { - this.container.className = 'popupAnnotation'; - - var selector = '[data-annotation-id="' + this.data.parentId + '"]'; - var parentElement = this.layer.querySelector(selector); - if (!parentElement) { - return this.container; - } - - var popup = new PopupElement({ - container: this.container, - trigger: parentElement, - color: this.data.color, - title: this.data.title, - contents: this.data.contents - }); - - // Position the popup next to the parent annotation's container. - // PDF viewers ignore a popup annotation's rectangle. - var parentLeft = parseFloat(parentElement.style.left); - var parentWidth = parseFloat(parentElement.style.width); - CustomStyle.setProp('transformOrigin', this.container, - -(parentLeft + parentWidth) + 'px -' + - parentElement.style.top); - this.container.style.left = (parentLeft + parentWidth) + 'px'; - - this.container.appendChild(popup.render()); - return this.container; - } - }); - - return PopupAnnotationElement; -})(); - -/** - * @class - * @alias PopupElement - */ -var PopupElement = (function PopupElementClosure() { - var BACKGROUND_ENLIGHT = 0.7; - - function PopupElement(parameters) { - this.container = parameters.container; - this.trigger = parameters.trigger; - this.color = parameters.color; - this.title = parameters.title; - this.contents = parameters.contents; - this.hideWrapper = parameters.hideWrapper || false; - - this.pinned = false; - } - - PopupElement.prototype = /** @lends PopupElement.prototype */ { - /** - * Render the popup's HTML element. - * - * @public - * @memberof PopupElement - * @returns {HTMLSectionElement} - */ - render: function PopupElement_render() { - var wrapper = document.createElement('div'); - wrapper.className = 'popupWrapper'; - - // For Popup annotations we hide the entire section because it contains - // only the popup. However, for Text annotations without a separate Popup - // annotation, we cannot hide the entire container as the image would - // disappear too. In that special case, hiding the wrapper suffices. - this.hideElement = (this.hideWrapper ? wrapper : this.container); - this.hideElement.setAttribute('hidden', true); - - var popup = document.createElement('div'); - popup.className = 'popup'; - - var color = this.color; - if (color) { - // Enlighten the color. - var r = BACKGROUND_ENLIGHT * (255 - color[0]) + color[0]; - var g = BACKGROUND_ENLIGHT * (255 - color[1]) + color[1]; - var b = BACKGROUND_ENLIGHT * (255 - color[2]) + color[2]; - popup.style.backgroundColor = Util.makeCssRgb(r | 0, g | 0, b | 0); - } - - var contents = this._formatContents(this.contents); - var title = document.createElement('h1'); - title.textContent = this.title; - - // Attach the event listeners to the trigger element. - this.trigger.addEventListener('click', this._toggle.bind(this)); - this.trigger.addEventListener('mouseover', this._show.bind(this, false)); - this.trigger.addEventListener('mouseout', this._hide.bind(this, false)); - popup.addEventListener('click', this._hide.bind(this, true)); - - popup.appendChild(title); - popup.appendChild(contents); - wrapper.appendChild(popup); - return wrapper; - }, - - /** - * Format the contents of the popup by adding newlines where necessary. - * - * @private - * @param {string} contents - * @memberof PopupElement - * @returns {HTMLParagraphElement} - */ - _formatContents: function PopupElement_formatContents(contents) { - var p = document.createElement('p'); - var lines = contents.split(/(?:\r\n?|\n)/); - for (var i = 0, ii = lines.length; i < ii; ++i) { - var line = lines[i]; - p.appendChild(document.createTextNode(line)); - if (i < (ii - 1)) { - p.appendChild(document.createElement('br')); - } - } - return p; - }, - - /** - * Toggle the visibility of the popup. - * - * @private - * @memberof PopupElement - */ - _toggle: function PopupElement_toggle() { - if (this.pinned) { - this._hide(true); - } else { - this._show(true); - } - }, - - /** - * Show the popup. - * - * @private - * @param {boolean} pin - * @memberof PopupElement - */ - _show: function PopupElement_show(pin) { - if (pin) { - this.pinned = true; - } - if (this.hideElement.hasAttribute('hidden')) { - this.hideElement.removeAttribute('hidden'); - this.container.style.zIndex += 1; - } - }, - - /** - * Hide the popup. - * - * @private - * @param {boolean} unpin - * @memberof PopupElement - */ - _hide: function PopupElement_hide(unpin) { - if (unpin) { - this.pinned = false; - } - if (!this.hideElement.hasAttribute('hidden') && !this.pinned) { - this.hideElement.setAttribute('hidden', true); - this.container.style.zIndex -= 1; - } - } - }; - - return PopupElement; -})(); - -/** - * @class - * @alias HighlightAnnotationElement - */ -var HighlightAnnotationElement = ( - function HighlightAnnotationElementClosure() { - function HighlightAnnotationElement(parameters) { - var isRenderable = !!(parameters.data.hasPopup || - parameters.data.title || parameters.data.contents); - AnnotationElement.call(this, parameters, isRenderable); - } - - Util.inherit(HighlightAnnotationElement, AnnotationElement, { - /** - * Render the highlight annotation's HTML element in the empty container. - * - * @public - * @memberof HighlightAnnotationElement - * @returns {HTMLSectionElement} - */ - render: function HighlightAnnotationElement_render() { - this.container.className = 'highlightAnnotation'; - - if (!this.data.hasPopup) { - this._createPopup(this.container, null, this.data); - } - - return this.container; - } - }); - - return HighlightAnnotationElement; -})(); - -/** - * @class - * @alias UnderlineAnnotationElement - */ -var UnderlineAnnotationElement = ( - function UnderlineAnnotationElementClosure() { - function UnderlineAnnotationElement(parameters) { - var isRenderable = !!(parameters.data.hasPopup || - parameters.data.title || parameters.data.contents); - AnnotationElement.call(this, parameters, isRenderable); - } - - Util.inherit(UnderlineAnnotationElement, AnnotationElement, { - /** - * Render the underline annotation's HTML element in the empty container. - * - * @public - * @memberof UnderlineAnnotationElement - * @returns {HTMLSectionElement} - */ - render: function UnderlineAnnotationElement_render() { - this.container.className = 'underlineAnnotation'; - - if (!this.data.hasPopup) { - this._createPopup(this.container, null, this.data); - } - - return this.container; - } - }); - - return UnderlineAnnotationElement; -})(); - -/** - * @class - * @alias SquigglyAnnotationElement - */ -var SquigglyAnnotationElement = (function SquigglyAnnotationElementClosure() { - function SquigglyAnnotationElement(parameters) { - var isRenderable = !!(parameters.data.hasPopup || - parameters.data.title || parameters.data.contents); - AnnotationElement.call(this, parameters, isRenderable); - } - - Util.inherit(SquigglyAnnotationElement, AnnotationElement, { - /** - * Render the squiggly annotation's HTML element in the empty container. - * - * @public - * @memberof SquigglyAnnotationElement - * @returns {HTMLSectionElement} - */ - render: function SquigglyAnnotationElement_render() { - this.container.className = 'squigglyAnnotation'; - - if (!this.data.hasPopup) { - this._createPopup(this.container, null, this.data); - } - - return this.container; - } - }); - - return SquigglyAnnotationElement; -})(); - -/** - * @class - * @alias StrikeOutAnnotationElement - */ -var StrikeOutAnnotationElement = ( - function StrikeOutAnnotationElementClosure() { - function StrikeOutAnnotationElement(parameters) { - var isRenderable = !!(parameters.data.hasPopup || - parameters.data.title || parameters.data.contents); - AnnotationElement.call(this, parameters, isRenderable); - } - - Util.inherit(StrikeOutAnnotationElement, AnnotationElement, { - /** - * Render the strikeout annotation's HTML element in the empty container. - * - * @public - * @memberof StrikeOutAnnotationElement - * @returns {HTMLSectionElement} - */ - render: function StrikeOutAnnotationElement_render() { - this.container.className = 'strikeoutAnnotation'; - - if (!this.data.hasPopup) { - this._createPopup(this.container, null, this.data); - } - - return this.container; - } - }); - - return StrikeOutAnnotationElement; -})(); - -/** - * @class - * @alias FileAttachmentAnnotationElement - */ -var FileAttachmentAnnotationElement = ( - function FileAttachmentAnnotationElementClosure() { - function FileAttachmentAnnotationElement(parameters) { - AnnotationElement.call(this, parameters, true); - - this.filename = getFilenameFromUrl(parameters.data.file.filename); - this.content = parameters.data.file.content; - } - - Util.inherit(FileAttachmentAnnotationElement, AnnotationElement, { - /** - * Render the file attachment annotation's HTML element in the empty - * container. - * - * @public - * @memberof FileAttachmentAnnotationElement - * @returns {HTMLSectionElement} - */ - render: function FileAttachmentAnnotationElement_render() { - this.container.className = 'fileAttachmentAnnotation'; - - var trigger = document.createElement('div'); - trigger.style.height = this.container.style.height; - trigger.style.width = this.container.style.width; - trigger.addEventListener('dblclick', this._download.bind(this)); - - if (!this.data.hasPopup && (this.data.title || this.data.contents)) { - this._createPopup(this.container, trigger, this.data); - } - - this.container.appendChild(trigger); - return this.container; - }, - - /** - * Download the file attachment associated with this annotation. - * - * @private - * @memberof FileAttachmentAnnotationElement - */ - _download: function FileAttachmentAnnotationElement_download() { - if (!this.downloadManager) { - warn('Download cannot be started due to unavailable download manager'); - return; - } - this.downloadManager.downloadData(this.content, this.filename, ''); - } - }); - - return FileAttachmentAnnotationElement; -})(); - -/** - * @typedef {Object} AnnotationLayerParameters - * @property {PageViewport} viewport - * @property {HTMLDivElement} div - * @property {Array} annotations - * @property {PDFPage} page - * @property {IPDFLinkService} linkService - * @property {string} imageResourcesPath - * @property {boolean} renderInteractiveForms - */ - -/** - * @class - * @alias AnnotationLayer - */ -var AnnotationLayer = (function AnnotationLayerClosure() { - return { - /** - * Render a new annotation layer with all annotation elements. - * - * @public - * @param {AnnotationLayerParameters} parameters - * @memberof AnnotationLayer - */ - render: function AnnotationLayer_render(parameters) { - var annotationElementFactory = new AnnotationElementFactory(); - - for (var i = 0, ii = parameters.annotations.length; i < ii; i++) { - var data = parameters.annotations[i]; - if (!data) { - continue; - } - - var properties = { - data: data, - layer: parameters.div, - page: parameters.page, - viewport: parameters.viewport, - linkService: parameters.linkService, - downloadManager: parameters.downloadManager, - imageResourcesPath: parameters.imageResourcesPath || - getDefaultSetting('imageResourcesPath'), - renderInteractiveForms: parameters.renderInteractiveForms || false, - }; - var element = annotationElementFactory.create(properties); - if (element.isRenderable) { - parameters.div.appendChild(element.render()); - } - } - }, - - /** - * Update the annotation elements on existing annotation layer. - * - * @public - * @param {AnnotationLayerParameters} parameters - * @memberof AnnotationLayer - */ - update: function AnnotationLayer_update(parameters) { - for (var i = 0, ii = parameters.annotations.length; i < ii; i++) { - var data = parameters.annotations[i]; - var element = parameters.div.querySelector( - '[data-annotation-id="' + data.id + '"]'); - if (element) { - CustomStyle.setProp('transform', element, - 'matrix(' + parameters.viewport.transform.join(',') + ')'); - } - } - parameters.div.removeAttribute('hidden'); - } - }; -})(); - -exports.AnnotationLayer = AnnotationLayer; -})); - - -(function (root, factory) { - { - factory((root.pdfjsDisplayTextLayer = {}), root.pdfjsSharedUtil, - root.pdfjsDisplayDOMUtils); - } -}(this, function (exports, sharedUtil, displayDOMUtils) { - -var Util = sharedUtil.Util; -var createPromiseCapability = sharedUtil.createPromiseCapability; -var CustomStyle = displayDOMUtils.CustomStyle; -var getDefaultSetting = displayDOMUtils.getDefaultSetting; - -/** - * Text layer render parameters. - * - * @typedef {Object} TextLayerRenderParameters - * @property {TextContent} textContent - Text content to render (the object is - * returned by the page's getTextContent() method). - * @property {HTMLElement} container - HTML element that will contain text runs. - * @property {PageViewport} viewport - The target viewport to properly - * layout the text runs. - * @property {Array} textDivs - (optional) HTML elements that are correspond - * the text items of the textContent input. This is output and shall be - * initially be set to empty array. - * @property {number} timeout - (optional) Delay in milliseconds before - * rendering of the text runs occurs. - * @property {boolean} enhanceTextSelection - (optional) Whether to turn on the - * text selection enhancement. - */ -var renderTextLayer = (function renderTextLayerClosure() { - var MAX_TEXT_DIVS_TO_RENDER = 100000; - - var NonWhitespaceRegexp = /\S/; - - function isAllWhitespace(str) { - return !NonWhitespaceRegexp.test(str); - } - - // Text layers may contain many thousand div's, and using `styleBuf` avoids - // creating many intermediate strings when building their 'style' properties. - var styleBuf = ['left: ', 0, 'px; top: ', 0, 'px; font-size: ', 0, - 'px; font-family: ', '', ';']; - - function appendText(task, geom, styles) { - // Initialize all used properties to keep the caches monomorphic. - var textDiv = document.createElement('div'); - var textDivProperties = { - style: null, - angle: 0, - canvasWidth: 0, - isWhitespace: false, - originalTransform: null, - paddingBottom: 0, - paddingLeft: 0, - paddingRight: 0, - paddingTop: 0, - scale: 1, - }; - - task._textDivs.push(textDiv); - if (isAllWhitespace(geom.str)) { - textDivProperties.isWhitespace = true; - task._textDivProperties.set(textDiv, textDivProperties); - return; - } - - var tx = Util.transform(task._viewport.transform, geom.transform); - var angle = Math.atan2(tx[1], tx[0]); - var style = styles[geom.fontName]; - if (style.vertical) { - angle += Math.PI / 2; - } - var fontHeight = Math.sqrt((tx[2] * tx[2]) + (tx[3] * tx[3])); - var fontAscent = fontHeight; - if (style.ascent) { - fontAscent = style.ascent * fontAscent; - } else if (style.descent) { - fontAscent = (1 + style.descent) * fontAscent; - } - - var left; - var top; - if (angle === 0) { - left = tx[4]; - top = tx[5] - fontAscent; - } else { - left = tx[4] + (fontAscent * Math.sin(angle)); - top = tx[5] - (fontAscent * Math.cos(angle)); - } - styleBuf[1] = left; - styleBuf[3] = top; - styleBuf[5] = fontHeight; - styleBuf[7] = style.fontFamily; - textDivProperties.style = styleBuf.join(''); - textDiv.setAttribute('style', textDivProperties.style); - - textDiv.textContent = geom.str; - // |fontName| is only used by the Font Inspector. This test will succeed - // when e.g. the Font Inspector is off but the Stepper is on, but it's - // not worth the effort to do a more accurate test. We only use `dataset` - // here to make the font name available for the debugger. - if (getDefaultSetting('pdfBug')) { - textDiv.dataset.fontName = geom.fontName; - } - if (angle !== 0) { - textDivProperties.angle = angle * (180 / Math.PI); - } - // We don't bother scaling single-char text divs, because it has very - // little effect on text highlighting. This makes scrolling on docs with - // lots of such divs a lot faster. - if (geom.str.length > 1) { - if (style.vertical) { - textDivProperties.canvasWidth = geom.height * task._viewport.scale; - } else { - textDivProperties.canvasWidth = geom.width * task._viewport.scale; - } - } - task._textDivProperties.set(textDiv, textDivProperties); - - if (task._enhanceTextSelection) { - var angleCos = 1, angleSin = 0; - if (angle !== 0) { - angleCos = Math.cos(angle); - angleSin = Math.sin(angle); - } - var divWidth = (style.vertical ? geom.height : geom.width) * - task._viewport.scale; - var divHeight = fontHeight; - - var m, b; - if (angle !== 0) { - m = [angleCos, angleSin, -angleSin, angleCos, left, top]; - b = Util.getAxialAlignedBoundingBox([0, 0, divWidth, divHeight], m); - } else { - b = [left, top, left + divWidth, top + divHeight]; - } - - task._bounds.push({ - left: b[0], - top: b[1], - right: b[2], - bottom: b[3], - div: textDiv, - size: [divWidth, divHeight], - m: m - }); - } - } - - function render(task) { - if (task._canceled) { - return; - } - var textLayerFrag = task._container; - var textDivs = task._textDivs; - var capability = task._capability; - var textDivsLength = textDivs.length; - - // No point in rendering many divs as it would make the browser - // unusable even after the divs are rendered. - if (textDivsLength > MAX_TEXT_DIVS_TO_RENDER) { - task._renderingDone = true; - capability.resolve(); - return; - } - - var canvas = document.createElement('canvas'); - canvas.mozOpaque = true; - var ctx = canvas.getContext('2d', {alpha: false}); - - var lastFontSize; - var lastFontFamily; - for (var i = 0; i < textDivsLength; i++) { - var textDiv = textDivs[i]; - var textDivProperties = task._textDivProperties.get(textDiv); - if (textDivProperties.isWhitespace) { - continue; - } - - var fontSize = textDiv.style.fontSize; - var fontFamily = textDiv.style.fontFamily; - - // Only build font string and set to context if different from last. - if (fontSize !== lastFontSize || fontFamily !== lastFontFamily) { - ctx.font = fontSize + ' ' + fontFamily; - lastFontSize = fontSize; - lastFontFamily = fontFamily; - } - - var width = ctx.measureText(textDiv.textContent).width; - textLayerFrag.appendChild(textDiv); - - var transform = ''; - if (textDivProperties.canvasWidth !== 0 && width > 0) { - textDivProperties.scale = textDivProperties.canvasWidth / width; - transform = 'scaleX(' + textDivProperties.scale + ')'; - } - if (textDivProperties.angle !== 0) { - transform = 'rotate(' + textDivProperties.angle + 'deg) ' + transform; - } - if (transform !== '') { - textDivProperties.originalTransform = transform; - CustomStyle.setProp('transform', textDiv, transform); - } - task._textDivProperties.set(textDiv, textDivProperties); - } - task._renderingDone = true; - capability.resolve(); - } - - function expand(task) { - var bounds = task._bounds; - var viewport = task._viewport; - - var expanded = expandBounds(viewport.width, viewport.height, bounds); - for (var i = 0; i < expanded.length; i++) { - var div = bounds[i].div; - var divProperties = task._textDivProperties.get(div); - if (divProperties.angle === 0) { - divProperties.paddingLeft = bounds[i].left - expanded[i].left; - divProperties.paddingTop = bounds[i].top - expanded[i].top; - divProperties.paddingRight = expanded[i].right - bounds[i].right; - divProperties.paddingBottom = expanded[i].bottom - bounds[i].bottom; - task._textDivProperties.set(div, divProperties); - continue; - } - // Box is rotated -- trying to find padding so rotated div will not - // exceed its expanded bounds. - var e = expanded[i], b = bounds[i]; - var m = b.m, c = m[0], s = m[1]; - // Finding intersections with expanded box. - var points = [[0, 0], [0, b.size[1]], [b.size[0], 0], b.size]; - var ts = new Float64Array(64); - points.forEach(function (p, i) { - var t = Util.applyTransform(p, m); - ts[i + 0] = c && (e.left - t[0]) / c; - ts[i + 4] = s && (e.top - t[1]) / s; - ts[i + 8] = c && (e.right - t[0]) / c; - ts[i + 12] = s && (e.bottom - t[1]) / s; - - ts[i + 16] = s && (e.left - t[0]) / -s; - ts[i + 20] = c && (e.top - t[1]) / c; - ts[i + 24] = s && (e.right - t[0]) / -s; - ts[i + 28] = c && (e.bottom - t[1]) / c; - - ts[i + 32] = c && (e.left - t[0]) / -c; - ts[i + 36] = s && (e.top - t[1]) / -s; - ts[i + 40] = c && (e.right - t[0]) / -c; - ts[i + 44] = s && (e.bottom - t[1]) / -s; - - ts[i + 48] = s && (e.left - t[0]) / s; - ts[i + 52] = c && (e.top - t[1]) / -c; - ts[i + 56] = s && (e.right - t[0]) / s; - ts[i + 60] = c && (e.bottom - t[1]) / -c; - }); - var findPositiveMin = function (ts, offset, count) { - var result = 0; - for (var i = 0; i < count; i++) { - var t = ts[offset++]; - if (t > 0) { - result = result ? Math.min(t, result) : t; - } - } - return result; - }; - // Not based on math, but to simplify calculations, using cos and sin - // absolute values to not exceed the box (it can but insignificantly). - var boxScale = 1 + Math.min(Math.abs(c), Math.abs(s)); - divProperties.paddingLeft = findPositiveMin(ts, 32, 16) / boxScale; - divProperties.paddingTop = findPositiveMin(ts, 48, 16) / boxScale; - divProperties.paddingRight = findPositiveMin(ts, 0, 16) / boxScale; - divProperties.paddingBottom = findPositiveMin(ts, 16, 16) / boxScale; - task._textDivProperties.set(div, divProperties); - } - } - - function expandBounds(width, height, boxes) { - var bounds = boxes.map(function (box, i) { - return { - x1: box.left, - y1: box.top, - x2: box.right, - y2: box.bottom, - index: i, - x1New: undefined, - x2New: undefined - }; - }); - expandBoundsLTR(width, bounds); - var expanded = new Array(boxes.length); - bounds.forEach(function (b) { - var i = b.index; - expanded[i] = { - left: b.x1New, - top: 0, - right: b.x2New, - bottom: 0 - }; - }); - - // Rotating on 90 degrees and extending extended boxes. Reusing the bounds - // array and objects. - boxes.map(function (box, i) { - var e = expanded[i], b = bounds[i]; - b.x1 = box.top; - b.y1 = width - e.right; - b.x2 = box.bottom; - b.y2 = width - e.left; - b.index = i; - b.x1New = undefined; - b.x2New = undefined; - }); - expandBoundsLTR(height, bounds); - - bounds.forEach(function (b) { - var i = b.index; - expanded[i].top = b.x1New; - expanded[i].bottom = b.x2New; - }); - return expanded; - } - - function expandBoundsLTR(width, bounds) { - // Sorting by x1 coordinate and walk by the bounds in the same order. - bounds.sort(function (a, b) { return a.x1 - b.x1 || a.index - b.index; }); - - // First we see on the horizon is a fake boundary. - var fakeBoundary = { - x1: -Infinity, - y1: -Infinity, - x2: 0, - y2: Infinity, - index: -1, - x1New: 0, - x2New: 0 - }; - var horizon = [{ - start: -Infinity, - end: Infinity, - boundary: fakeBoundary - }]; - - bounds.forEach(function (boundary) { - // Searching for the affected part of horizon. - // TODO red-black tree or simple binary search - var i = 0; - while (i < horizon.length && horizon[i].end <= boundary.y1) { - i++; - } - var j = horizon.length - 1; - while(j >= 0 && horizon[j].start >= boundary.y2) { - j--; - } - - var horizonPart, affectedBoundary; - var q, k, maxXNew = -Infinity; - for (q = i; q <= j; q++) { - horizonPart = horizon[q]; - affectedBoundary = horizonPart.boundary; - var xNew; - if (affectedBoundary.x2 > boundary.x1) { - // In the middle of the previous element, new x shall be at the - // boundary start. Extending if further if the affected bondary - // placed on top of the current one. - xNew = affectedBoundary.index > boundary.index ? - affectedBoundary.x1New : boundary.x1; - } else if (affectedBoundary.x2New === undefined) { - // We have some space in between, new x in middle will be a fair - // choice. - xNew = (affectedBoundary.x2 + boundary.x1) / 2; - } else { - // Affected boundary has x2new set, using it as new x. - xNew = affectedBoundary.x2New; - } - if (xNew > maxXNew) { - maxXNew = xNew; - } - } - - // Set new x1 for current boundary. - boundary.x1New = maxXNew; - - // Adjusts new x2 for the affected boundaries. - for (q = i; q <= j; q++) { - horizonPart = horizon[q]; - affectedBoundary = horizonPart.boundary; - if (affectedBoundary.x2New === undefined) { - // Was not set yet, choosing new x if possible. - if (affectedBoundary.x2 > boundary.x1) { - // Current and affected boundaries intersect. If affected boundary - // is placed on top of the current, shrinking the affected. - if (affectedBoundary.index > boundary.index) { - affectedBoundary.x2New = affectedBoundary.x2; - } - } else { - affectedBoundary.x2New = maxXNew; - } - } else if (affectedBoundary.x2New > maxXNew) { - // Affected boundary is touching new x, pushing it back. - affectedBoundary.x2New = Math.max(maxXNew, affectedBoundary.x2); - } - } - - // Fixing the horizon. - var changedHorizon = [], lastBoundary = null; - for (q = i; q <= j; q++) { - horizonPart = horizon[q]; - affectedBoundary = horizonPart.boundary; - // Checking which boundary will be visible. - var useBoundary = affectedBoundary.x2 > boundary.x2 ? - affectedBoundary : boundary; - if (lastBoundary === useBoundary) { - // Merging with previous. - changedHorizon[changedHorizon.length - 1].end = horizonPart.end; - } else { - changedHorizon.push({ - start: horizonPart.start, - end: horizonPart.end, - boundary: useBoundary - }); - lastBoundary = useBoundary; - } - } - if (horizon[i].start < boundary.y1) { - changedHorizon[0].start = boundary.y1; - changedHorizon.unshift({ - start: horizon[i].start, - end: boundary.y1, - boundary: horizon[i].boundary - }); - } - if (boundary.y2 < horizon[j].end) { - changedHorizon[changedHorizon.length - 1].end = boundary.y2; - changedHorizon.push({ - start: boundary.y2, - end: horizon[j].end, - boundary: horizon[j].boundary - }); - } - - // Set x2 new of boundary that is no longer visible (see overlapping case - // above). - // TODO more efficient, e.g. via reference counting. - for (q = i; q <= j; q++) { - horizonPart = horizon[q]; - affectedBoundary = horizonPart.boundary; - if (affectedBoundary.x2New !== undefined) { - continue; - } - var used = false; - for (k = i - 1; !used && k >= 0 && - horizon[k].start >= affectedBoundary.y1; k--) { - used = horizon[k].boundary === affectedBoundary; - } - for (k = j + 1; !used && k < horizon.length && - horizon[k].end <= affectedBoundary.y2; k++) { - used = horizon[k].boundary === affectedBoundary; - } - for (k = 0; !used && k < changedHorizon.length; k++) { - used = changedHorizon[k].boundary === affectedBoundary; - } - if (!used) { - affectedBoundary.x2New = maxXNew; - } - } - - Array.prototype.splice.apply(horizon, - [i, j - i + 1].concat(changedHorizon)); - }); - - // Set new x2 for all unset boundaries. - horizon.forEach(function (horizonPart) { - var affectedBoundary = horizonPart.boundary; - if (affectedBoundary.x2New === undefined) { - affectedBoundary.x2New = Math.max(width, affectedBoundary.x2); - } - }); - } - - /** - * Text layer rendering task. - * - * @param {TextContent} textContent - * @param {HTMLElement} container - * @param {PageViewport} viewport - * @param {Array} textDivs - * @param {boolean} enhanceTextSelection - * @private - */ - function TextLayerRenderTask(textContent, container, viewport, textDivs, - enhanceTextSelection) { - this._textContent = textContent; - this._container = container; - this._viewport = viewport; - this._textDivs = textDivs || []; - this._textDivProperties = new WeakMap(); - this._renderingDone = false; - this._canceled = false; - this._capability = createPromiseCapability(); - this._renderTimer = null; - this._bounds = []; - this._enhanceTextSelection = !!enhanceTextSelection; - } - TextLayerRenderTask.prototype = { - get promise() { - return this._capability.promise; - }, - - cancel: function TextLayer_cancel() { - this._canceled = true; - if (this._renderTimer !== null) { - clearTimeout(this._renderTimer); - this._renderTimer = null; - } - this._capability.reject('canceled'); - }, - - _render: function TextLayer_render(timeout) { - var textItems = this._textContent.items; - var textStyles = this._textContent.styles; - for (var i = 0, len = textItems.length; i < len; i++) { - appendText(this, textItems[i], textStyles); - } - - if (!timeout) { // Render right away - render(this); - } else { // Schedule - var self = this; - this._renderTimer = setTimeout(function() { - render(self); - self._renderTimer = null; - }, timeout); - } - }, - - expandTextDivs: function TextLayer_expandTextDivs(expandDivs) { - if (!this._enhanceTextSelection || !this._renderingDone) { - return; - } - if (this._bounds !== null) { - expand(this); - this._bounds = null; - } - - for (var i = 0, ii = this._textDivs.length; i < ii; i++) { - var div = this._textDivs[i]; - var divProperties = this._textDivProperties.get(div); - - if (divProperties.isWhitespace) { - continue; - } - if (expandDivs) { - var transform = '', padding = ''; - - if (divProperties.scale !== 1) { - transform = 'scaleX(' + divProperties.scale + ')'; - } - if (divProperties.angle !== 0) { - transform = 'rotate(' + divProperties.angle + 'deg) ' + transform; - } - if (divProperties.paddingLeft !== 0) { - padding += ' padding-left: ' + - (divProperties.paddingLeft / divProperties.scale) + 'px;'; - transform += ' translateX(' + - (-divProperties.paddingLeft / divProperties.scale) + 'px)'; - } - if (divProperties.paddingTop !== 0) { - padding += ' padding-top: ' + divProperties.paddingTop + 'px;'; - transform += ' translateY(' + (-divProperties.paddingTop) + 'px)'; - } - if (divProperties.paddingRight !== 0) { - padding += ' padding-right: ' + - (divProperties.paddingRight / divProperties.scale) + 'px;'; - } - if (divProperties.paddingBottom !== 0) { - padding += ' padding-bottom: ' + - divProperties.paddingBottom + 'px;'; - } - - if (padding !== '') { - div.setAttribute('style', divProperties.style + padding); - } - if (transform !== '') { - CustomStyle.setProp('transform', div, transform); - } - } else { - div.style.padding = 0; - CustomStyle.setProp('transform', div, - divProperties.originalTransform || ''); - } - } - }, - }; - - /** - * Starts rendering of the text layer. - * - * @param {TextLayerRenderParameters} renderParameters - * @returns {TextLayerRenderTask} - */ - function renderTextLayer(renderParameters) { - var task = new TextLayerRenderTask(renderParameters.textContent, - renderParameters.container, - renderParameters.viewport, - renderParameters.textDivs, - renderParameters.enhanceTextSelection); - task._render(renderParameters.timeout); - return task; - } - - return renderTextLayer; -})(); - -exports.renderTextLayer = renderTextLayer; -})); - - -(function (root, factory) { - { - factory((root.pdfjsDisplayWebGL = {}), root.pdfjsSharedUtil, - root.pdfjsDisplayDOMUtils); - } -}(this, function (exports, sharedUtil, displayDOMUtils) { - -var shadow = sharedUtil.shadow; -var getDefaultSetting = displayDOMUtils.getDefaultSetting; - -var WebGLUtils = (function WebGLUtilsClosure() { - function loadShader(gl, code, shaderType) { - var shader = gl.createShader(shaderType); - gl.shaderSource(shader, code); - gl.compileShader(shader); - var compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS); - if (!compiled) { - var errorMsg = gl.getShaderInfoLog(shader); - throw new Error('Error during shader compilation: ' + errorMsg); - } - return shader; - } - function createVertexShader(gl, code) { - return loadShader(gl, code, gl.VERTEX_SHADER); - } - function createFragmentShader(gl, code) { - return loadShader(gl, code, gl.FRAGMENT_SHADER); - } - function createProgram(gl, shaders) { - var program = gl.createProgram(); - for (var i = 0, ii = shaders.length; i < ii; ++i) { - gl.attachShader(program, shaders[i]); - } - gl.linkProgram(program); - var linked = gl.getProgramParameter(program, gl.LINK_STATUS); - if (!linked) { - var errorMsg = gl.getProgramInfoLog(program); - throw new Error('Error during program linking: ' + errorMsg); - } - return program; - } - function createTexture(gl, image, textureId) { - gl.activeTexture(textureId); - var texture = gl.createTexture(); - gl.bindTexture(gl.TEXTURE_2D, texture); - - // Set the parameters so we can render any size image. - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); - - // Upload the image into the texture. - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image); - return texture; - } - - var currentGL, currentCanvas; - function generateGL() { - if (currentGL) { - return; - } - currentCanvas = document.createElement('canvas'); - currentGL = currentCanvas.getContext('webgl', - { premultipliedalpha: false }); - } - - var smaskVertexShaderCode = '\ - attribute vec2 a_position; \ - attribute vec2 a_texCoord; \ - \ - uniform vec2 u_resolution; \ - \ - varying vec2 v_texCoord; \ - \ - void main() { \ - vec2 clipSpace = (a_position / u_resolution) * 2.0 - 1.0; \ - gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); \ - \ - v_texCoord = a_texCoord; \ - } '; - - var smaskFragmentShaderCode = '\ - precision mediump float; \ - \ - uniform vec4 u_backdrop; \ - uniform int u_subtype; \ - uniform sampler2D u_image; \ - uniform sampler2D u_mask; \ - \ - varying vec2 v_texCoord; \ - \ - void main() { \ - vec4 imageColor = texture2D(u_image, v_texCoord); \ - vec4 maskColor = texture2D(u_mask, v_texCoord); \ - if (u_backdrop.a > 0.0) { \ - maskColor.rgb = maskColor.rgb * maskColor.a + \ - u_backdrop.rgb * (1.0 - maskColor.a); \ - } \ - float lum; \ - if (u_subtype == 0) { \ - lum = maskColor.a; \ - } else { \ - lum = maskColor.r * 0.3 + maskColor.g * 0.59 + \ - maskColor.b * 0.11; \ - } \ - imageColor.a *= lum; \ - imageColor.rgb *= imageColor.a; \ - gl_FragColor = imageColor; \ - } '; - - var smaskCache = null; - - function initSmaskGL() { - var canvas, gl; - - generateGL(); - canvas = currentCanvas; - currentCanvas = null; - gl = currentGL; - currentGL = null; - - // setup a GLSL program - var vertexShader = createVertexShader(gl, smaskVertexShaderCode); - var fragmentShader = createFragmentShader(gl, smaskFragmentShaderCode); - var program = createProgram(gl, [vertexShader, fragmentShader]); - gl.useProgram(program); - - var cache = {}; - cache.gl = gl; - cache.canvas = canvas; - cache.resolutionLocation = gl.getUniformLocation(program, 'u_resolution'); - cache.positionLocation = gl.getAttribLocation(program, 'a_position'); - cache.backdropLocation = gl.getUniformLocation(program, 'u_backdrop'); - cache.subtypeLocation = gl.getUniformLocation(program, 'u_subtype'); - - var texCoordLocation = gl.getAttribLocation(program, 'a_texCoord'); - var texLayerLocation = gl.getUniformLocation(program, 'u_image'); - var texMaskLocation = gl.getUniformLocation(program, 'u_mask'); - - // provide texture coordinates for the rectangle. - var texCoordBuffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, texCoordBuffer); - gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ - 0.0, 0.0, - 1.0, 0.0, - 0.0, 1.0, - 0.0, 1.0, - 1.0, 0.0, - 1.0, 1.0]), gl.STATIC_DRAW); - gl.enableVertexAttribArray(texCoordLocation); - gl.vertexAttribPointer(texCoordLocation, 2, gl.FLOAT, false, 0, 0); - - gl.uniform1i(texLayerLocation, 0); - gl.uniform1i(texMaskLocation, 1); - - smaskCache = cache; - } - - function composeSMask(layer, mask, properties) { - var width = layer.width, height = layer.height; - - if (!smaskCache) { - initSmaskGL(); - } - var cache = smaskCache,canvas = cache.canvas, gl = cache.gl; - canvas.width = width; - canvas.height = height; - gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); - gl.uniform2f(cache.resolutionLocation, width, height); - - if (properties.backdrop) { - gl.uniform4f(cache.resolutionLocation, properties.backdrop[0], - properties.backdrop[1], properties.backdrop[2], 1); - } else { - gl.uniform4f(cache.resolutionLocation, 0, 0, 0, 0); - } - gl.uniform1i(cache.subtypeLocation, - properties.subtype === 'Luminosity' ? 1 : 0); - - // Create a textures - var texture = createTexture(gl, layer, gl.TEXTURE0); - var maskTexture = createTexture(gl, mask, gl.TEXTURE1); - - - // Create a buffer and put a single clipspace rectangle in - // it (2 triangles) - var buffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, buffer); - gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ - 0, 0, - width, 0, - 0, height, - 0, height, - width, 0, - width, height]), gl.STATIC_DRAW); - gl.enableVertexAttribArray(cache.positionLocation); - gl.vertexAttribPointer(cache.positionLocation, 2, gl.FLOAT, false, 0, 0); - - // draw - gl.clearColor(0, 0, 0, 0); - gl.enable(gl.BLEND); - gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); - gl.clear(gl.COLOR_BUFFER_BIT); - - gl.drawArrays(gl.TRIANGLES, 0, 6); - - gl.flush(); - - gl.deleteTexture(texture); - gl.deleteTexture(maskTexture); - gl.deleteBuffer(buffer); - - return canvas; - } - - var figuresVertexShaderCode = '\ - attribute vec2 a_position; \ - attribute vec3 a_color; \ - \ - uniform vec2 u_resolution; \ - uniform vec2 u_scale; \ - uniform vec2 u_offset; \ - \ - varying vec4 v_color; \ - \ - void main() { \ - vec2 position = (a_position + u_offset) * u_scale; \ - vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0; \ - gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); \ - \ - v_color = vec4(a_color / 255.0, 1.0); \ - } '; - - var figuresFragmentShaderCode = '\ - precision mediump float; \ - \ - varying vec4 v_color; \ - \ - void main() { \ - gl_FragColor = v_color; \ - } '; - - var figuresCache = null; - - function initFiguresGL() { - var canvas, gl; - - generateGL(); - canvas = currentCanvas; - currentCanvas = null; - gl = currentGL; - currentGL = null; - - // setup a GLSL program - var vertexShader = createVertexShader(gl, figuresVertexShaderCode); - var fragmentShader = createFragmentShader(gl, figuresFragmentShaderCode); - var program = createProgram(gl, [vertexShader, fragmentShader]); - gl.useProgram(program); - - var cache = {}; - cache.gl = gl; - cache.canvas = canvas; - cache.resolutionLocation = gl.getUniformLocation(program, 'u_resolution'); - cache.scaleLocation = gl.getUniformLocation(program, 'u_scale'); - cache.offsetLocation = gl.getUniformLocation(program, 'u_offset'); - cache.positionLocation = gl.getAttribLocation(program, 'a_position'); - cache.colorLocation = gl.getAttribLocation(program, 'a_color'); - - figuresCache = cache; - } - - function drawFigures(width, height, backgroundColor, figures, context) { - if (!figuresCache) { - initFiguresGL(); - } - var cache = figuresCache, canvas = cache.canvas, gl = cache.gl; - - canvas.width = width; - canvas.height = height; - gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); - gl.uniform2f(cache.resolutionLocation, width, height); - - // count triangle points - var count = 0; - var i, ii, rows; - for (i = 0, ii = figures.length; i < ii; i++) { - switch (figures[i].type) { - case 'lattice': - rows = (figures[i].coords.length / figures[i].verticesPerRow) | 0; - count += (rows - 1) * (figures[i].verticesPerRow - 1) * 6; - break; - case 'triangles': - count += figures[i].coords.length; - break; - } - } - // transfer data - var coords = new Float32Array(count * 2); - var colors = new Uint8Array(count * 3); - var coordsMap = context.coords, colorsMap = context.colors; - var pIndex = 0, cIndex = 0; - for (i = 0, ii = figures.length; i < ii; i++) { - var figure = figures[i], ps = figure.coords, cs = figure.colors; - switch (figure.type) { - case 'lattice': - var cols = figure.verticesPerRow; - rows = (ps.length / cols) | 0; - for (var row = 1; row < rows; row++) { - var offset = row * cols + 1; - for (var col = 1; col < cols; col++, offset++) { - coords[pIndex] = coordsMap[ps[offset - cols - 1]]; - coords[pIndex + 1] = coordsMap[ps[offset - cols - 1] + 1]; - coords[pIndex + 2] = coordsMap[ps[offset - cols]]; - coords[pIndex + 3] = coordsMap[ps[offset - cols] + 1]; - coords[pIndex + 4] = coordsMap[ps[offset - 1]]; - coords[pIndex + 5] = coordsMap[ps[offset - 1] + 1]; - colors[cIndex] = colorsMap[cs[offset - cols - 1]]; - colors[cIndex + 1] = colorsMap[cs[offset - cols - 1] + 1]; - colors[cIndex + 2] = colorsMap[cs[offset - cols - 1] + 2]; - colors[cIndex + 3] = colorsMap[cs[offset - cols]]; - colors[cIndex + 4] = colorsMap[cs[offset - cols] + 1]; - colors[cIndex + 5] = colorsMap[cs[offset - cols] + 2]; - colors[cIndex + 6] = colorsMap[cs[offset - 1]]; - colors[cIndex + 7] = colorsMap[cs[offset - 1] + 1]; - colors[cIndex + 8] = colorsMap[cs[offset - 1] + 2]; - - coords[pIndex + 6] = coords[pIndex + 2]; - coords[pIndex + 7] = coords[pIndex + 3]; - coords[pIndex + 8] = coords[pIndex + 4]; - coords[pIndex + 9] = coords[pIndex + 5]; - coords[pIndex + 10] = coordsMap[ps[offset]]; - coords[pIndex + 11] = coordsMap[ps[offset] + 1]; - colors[cIndex + 9] = colors[cIndex + 3]; - colors[cIndex + 10] = colors[cIndex + 4]; - colors[cIndex + 11] = colors[cIndex + 5]; - colors[cIndex + 12] = colors[cIndex + 6]; - colors[cIndex + 13] = colors[cIndex + 7]; - colors[cIndex + 14] = colors[cIndex + 8]; - colors[cIndex + 15] = colorsMap[cs[offset]]; - colors[cIndex + 16] = colorsMap[cs[offset] + 1]; - colors[cIndex + 17] = colorsMap[cs[offset] + 2]; - pIndex += 12; - cIndex += 18; - } - } - break; - case 'triangles': - for (var j = 0, jj = ps.length; j < jj; j++) { - coords[pIndex] = coordsMap[ps[j]]; - coords[pIndex + 1] = coordsMap[ps[j] + 1]; - colors[cIndex] = colorsMap[cs[j]]; - colors[cIndex + 1] = colorsMap[cs[j] + 1]; - colors[cIndex + 2] = colorsMap[cs[j] + 2]; - pIndex += 2; - cIndex += 3; - } - break; - } - } - - // draw - if (backgroundColor) { - gl.clearColor(backgroundColor[0] / 255, backgroundColor[1] / 255, - backgroundColor[2] / 255, 1.0); - } else { - gl.clearColor(0, 0, 0, 0); - } - gl.clear(gl.COLOR_BUFFER_BIT); - - var coordsBuffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, coordsBuffer); - gl.bufferData(gl.ARRAY_BUFFER, coords, gl.STATIC_DRAW); - gl.enableVertexAttribArray(cache.positionLocation); - gl.vertexAttribPointer(cache.positionLocation, 2, gl.FLOAT, false, 0, 0); - - var colorsBuffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, colorsBuffer); - gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW); - gl.enableVertexAttribArray(cache.colorLocation); - gl.vertexAttribPointer(cache.colorLocation, 3, gl.UNSIGNED_BYTE, false, - 0, 0); - - gl.uniform2f(cache.scaleLocation, context.scaleX, context.scaleY); - gl.uniform2f(cache.offsetLocation, context.offsetX, context.offsetY); - - gl.drawArrays(gl.TRIANGLES, 0, count); - - gl.flush(); - - gl.deleteBuffer(coordsBuffer); - gl.deleteBuffer(colorsBuffer); - - return canvas; - } - - function cleanup() { - if (smaskCache && smaskCache.canvas) { - smaskCache.canvas.width = 0; - smaskCache.canvas.height = 0; - } - if (figuresCache && figuresCache.canvas) { - figuresCache.canvas.width = 0; - figuresCache.canvas.height = 0; - } - smaskCache = null; - figuresCache = null; - } - - return { - get isEnabled() { - if (getDefaultSetting('disableWebGL')) { - return false; - } - var enabled = false; - try { - generateGL(); - enabled = !!currentGL; - } catch (e) { } - return shadow(this, 'isEnabled', enabled); - }, - composeSMask: composeSMask, - drawFigures: drawFigures, - clear: cleanup - }; -})(); - -exports.WebGLUtils = WebGLUtils; -})); - - -(function (root, factory) { - { - factory((root.pdfjsDisplayPatternHelper = {}), root.pdfjsSharedUtil, - root.pdfjsDisplayWebGL); - } -}(this, function (exports, sharedUtil, displayWebGL) { - -var Util = sharedUtil.Util; -var info = sharedUtil.info; -var isArray = sharedUtil.isArray; -var error = sharedUtil.error; -var WebGLUtils = displayWebGL.WebGLUtils; - -var ShadingIRs = {}; - -ShadingIRs.RadialAxial = { - fromIR: function RadialAxial_fromIR(raw) { - var type = raw[1]; - var colorStops = raw[2]; - var p0 = raw[3]; - var p1 = raw[4]; - var r0 = raw[5]; - var r1 = raw[6]; - return { - type: 'Pattern', - getPattern: function RadialAxial_getPattern(ctx) { - var grad; - if (type === 'axial') { - grad = ctx.createLinearGradient(p0[0], p0[1], p1[0], p1[1]); - } else if (type === 'radial') { - grad = ctx.createRadialGradient(p0[0], p0[1], r0, p1[0], p1[1], r1); - } - - for (var i = 0, ii = colorStops.length; i < ii; ++i) { - var c = colorStops[i]; - grad.addColorStop(c[0], c[1]); - } - return grad; - } - }; - } -}; - -var createMeshCanvas = (function createMeshCanvasClosure() { - function drawTriangle(data, context, p1, p2, p3, c1, c2, c3) { - // Very basic Gouraud-shaded triangle rasterization algorithm. - var coords = context.coords, colors = context.colors; - var bytes = data.data, rowSize = data.width * 4; - var tmp; - if (coords[p1 + 1] > coords[p2 + 1]) { - tmp = p1; p1 = p2; p2 = tmp; tmp = c1; c1 = c2; c2 = tmp; - } - if (coords[p2 + 1] > coords[p3 + 1]) { - tmp = p2; p2 = p3; p3 = tmp; tmp = c2; c2 = c3; c3 = tmp; - } - if (coords[p1 + 1] > coords[p2 + 1]) { - tmp = p1; p1 = p2; p2 = tmp; tmp = c1; c1 = c2; c2 = tmp; - } - var x1 = (coords[p1] + context.offsetX) * context.scaleX; - var y1 = (coords[p1 + 1] + context.offsetY) * context.scaleY; - var x2 = (coords[p2] + context.offsetX) * context.scaleX; - var y2 = (coords[p2 + 1] + context.offsetY) * context.scaleY; - var x3 = (coords[p3] + context.offsetX) * context.scaleX; - var y3 = (coords[p3 + 1] + context.offsetY) * context.scaleY; - if (y1 >= y3) { - return; - } - var c1r = colors[c1], c1g = colors[c1 + 1], c1b = colors[c1 + 2]; - var c2r = colors[c2], c2g = colors[c2 + 1], c2b = colors[c2 + 2]; - var c3r = colors[c3], c3g = colors[c3 + 1], c3b = colors[c3 + 2]; - - var minY = Math.round(y1), maxY = Math.round(y3); - var xa, car, cag, cab; - var xb, cbr, cbg, cbb; - var k; - for (var y = minY; y <= maxY; y++) { - if (y < y2) { - k = y < y1 ? 0 : y1 === y2 ? 1 : (y1 - y) / (y1 - y2); - xa = x1 - (x1 - x2) * k; - car = c1r - (c1r - c2r) * k; - cag = c1g - (c1g - c2g) * k; - cab = c1b - (c1b - c2b) * k; - } else { - k = y > y3 ? 1 : y2 === y3 ? 0 : (y2 - y) / (y2 - y3); - xa = x2 - (x2 - x3) * k; - car = c2r - (c2r - c3r) * k; - cag = c2g - (c2g - c3g) * k; - cab = c2b - (c2b - c3b) * k; - } - k = y < y1 ? 0 : y > y3 ? 1 : (y1 - y) / (y1 - y3); - xb = x1 - (x1 - x3) * k; - cbr = c1r - (c1r - c3r) * k; - cbg = c1g - (c1g - c3g) * k; - cbb = c1b - (c1b - c3b) * k; - var x1_ = Math.round(Math.min(xa, xb)); - var x2_ = Math.round(Math.max(xa, xb)); - var j = rowSize * y + x1_ * 4; - for (var x = x1_; x <= x2_; x++) { - k = (xa - x) / (xa - xb); - k = k < 0 ? 0 : k > 1 ? 1 : k; - bytes[j++] = (car - (car - cbr) * k) | 0; - bytes[j++] = (cag - (cag - cbg) * k) | 0; - bytes[j++] = (cab - (cab - cbb) * k) | 0; - bytes[j++] = 255; - } - } - } - - function drawFigure(data, figure, context) { - var ps = figure.coords; - var cs = figure.colors; - var i, ii; - switch (figure.type) { - case 'lattice': - var verticesPerRow = figure.verticesPerRow; - var rows = Math.floor(ps.length / verticesPerRow) - 1; - var cols = verticesPerRow - 1; - for (i = 0; i < rows; i++) { - var q = i * verticesPerRow; - for (var j = 0; j < cols; j++, q++) { - drawTriangle(data, context, - ps[q], ps[q + 1], ps[q + verticesPerRow], - cs[q], cs[q + 1], cs[q + verticesPerRow]); - drawTriangle(data, context, - ps[q + verticesPerRow + 1], ps[q + 1], ps[q + verticesPerRow], - cs[q + verticesPerRow + 1], cs[q + 1], cs[q + verticesPerRow]); - } - } - break; - case 'triangles': - for (i = 0, ii = ps.length; i < ii; i += 3) { - drawTriangle(data, context, - ps[i], ps[i + 1], ps[i + 2], - cs[i], cs[i + 1], cs[i + 2]); - } - break; - default: - error('illigal figure'); - break; - } - } - - function createMeshCanvas(bounds, combinesScale, coords, colors, figures, - backgroundColor, cachedCanvases) { - // we will increase scale on some weird factor to let antialiasing take - // care of "rough" edges - var EXPECTED_SCALE = 1.1; - // MAX_PATTERN_SIZE is used to avoid OOM situation. - var MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough - // We need to keep transparent border around our pattern for fill(): - // createPattern with 'no-repeat' will bleed edges across entire area. - var BORDER_SIZE = 2; - - var offsetX = Math.floor(bounds[0]); - var offsetY = Math.floor(bounds[1]); - var boundsWidth = Math.ceil(bounds[2]) - offsetX; - var boundsHeight = Math.ceil(bounds[3]) - offsetY; - - var width = Math.min(Math.ceil(Math.abs(boundsWidth * combinesScale[0] * - EXPECTED_SCALE)), MAX_PATTERN_SIZE); - var height = Math.min(Math.ceil(Math.abs(boundsHeight * combinesScale[1] * - EXPECTED_SCALE)), MAX_PATTERN_SIZE); - var scaleX = boundsWidth / width; - var scaleY = boundsHeight / height; - - var context = { - coords: coords, - colors: colors, - offsetX: -offsetX, - offsetY: -offsetY, - scaleX: 1 / scaleX, - scaleY: 1 / scaleY - }; - - var paddedWidth = width + BORDER_SIZE * 2; - var paddedHeight = height + BORDER_SIZE * 2; - - var canvas, tmpCanvas, i, ii; - if (WebGLUtils.isEnabled) { - canvas = WebGLUtils.drawFigures(width, height, backgroundColor, - figures, context); - - // https://bugzilla.mozilla.org/show_bug.cgi?id=972126 - tmpCanvas = cachedCanvases.getCanvas('mesh', paddedWidth, paddedHeight, - false); - tmpCanvas.context.drawImage(canvas, BORDER_SIZE, BORDER_SIZE); - canvas = tmpCanvas.canvas; - } else { - tmpCanvas = cachedCanvases.getCanvas('mesh', paddedWidth, paddedHeight, - false); - var tmpCtx = tmpCanvas.context; - - var data = tmpCtx.createImageData(width, height); - if (backgroundColor) { - var bytes = data.data; - for (i = 0, ii = bytes.length; i < ii; i += 4) { - bytes[i] = backgroundColor[0]; - bytes[i + 1] = backgroundColor[1]; - bytes[i + 2] = backgroundColor[2]; - bytes[i + 3] = 255; - } - } - for (i = 0; i < figures.length; i++) { - drawFigure(data, figures[i], context); - } - tmpCtx.putImageData(data, BORDER_SIZE, BORDER_SIZE); - canvas = tmpCanvas.canvas; - } - - return {canvas: canvas, - offsetX: offsetX - BORDER_SIZE * scaleX, - offsetY: offsetY - BORDER_SIZE * scaleY, - scaleX: scaleX, scaleY: scaleY}; - } - return createMeshCanvas; -})(); - -ShadingIRs.Mesh = { - fromIR: function Mesh_fromIR(raw) { - //var type = raw[1]; - var coords = raw[2]; - var colors = raw[3]; - var figures = raw[4]; - var bounds = raw[5]; - var matrix = raw[6]; - //var bbox = raw[7]; - var background = raw[8]; - return { - type: 'Pattern', - getPattern: function Mesh_getPattern(ctx, owner, shadingFill) { - var scale; - if (shadingFill) { - scale = Util.singularValueDecompose2dScale(ctx.mozCurrentTransform); - } else { - // Obtain scale from matrix and current transformation matrix. - scale = Util.singularValueDecompose2dScale(owner.baseTransform); - if (matrix) { - var matrixScale = Util.singularValueDecompose2dScale(matrix); - scale = [scale[0] * matrixScale[0], - scale[1] * matrixScale[1]]; - } - } - - - // Rasterizing on the main thread since sending/queue large canvases - // might cause OOM. - var temporaryPatternCanvas = createMeshCanvas(bounds, scale, coords, - colors, figures, shadingFill ? null : background, - owner.cachedCanvases); - - if (!shadingFill) { - ctx.setTransform.apply(ctx, owner.baseTransform); - if (matrix) { - ctx.transform.apply(ctx, matrix); - } - } - - ctx.translate(temporaryPatternCanvas.offsetX, - temporaryPatternCanvas.offsetY); - ctx.scale(temporaryPatternCanvas.scaleX, - temporaryPatternCanvas.scaleY); - - return ctx.createPattern(temporaryPatternCanvas.canvas, 'no-repeat'); - } - }; - } -}; - -ShadingIRs.Dummy = { - fromIR: function Dummy_fromIR() { - return { - type: 'Pattern', - getPattern: function Dummy_fromIR_getPattern() { - return 'hotpink'; - } - }; - } -}; - -function getShadingPatternFromIR(raw) { - var shadingIR = ShadingIRs[raw[0]]; - if (!shadingIR) { - error('Unknown IR type: ' + raw[0]); - } - return shadingIR.fromIR(raw); -} - -var TilingPattern = (function TilingPatternClosure() { - var PaintType = { - COLORED: 1, - UNCOLORED: 2 - }; - - var MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough - - function TilingPattern(IR, color, ctx, canvasGraphicsFactory, baseTransform) { - this.operatorList = IR[2]; - this.matrix = IR[3] || [1, 0, 0, 1, 0, 0]; - this.bbox = IR[4]; - this.xstep = IR[5]; - this.ystep = IR[6]; - this.paintType = IR[7]; - this.tilingType = IR[8]; - this.color = color; - this.canvasGraphicsFactory = canvasGraphicsFactory; - this.baseTransform = baseTransform; - this.type = 'Pattern'; - this.ctx = ctx; - } - - TilingPattern.prototype = { - createPatternCanvas: function TilinPattern_createPatternCanvas(owner) { - var operatorList = this.operatorList; - var bbox = this.bbox; - var xstep = this.xstep; - var ystep = this.ystep; - var paintType = this.paintType; - var tilingType = this.tilingType; - var color = this.color; - var canvasGraphicsFactory = this.canvasGraphicsFactory; - - info('TilingType: ' + tilingType); - - var x0 = bbox[0], y0 = bbox[1], x1 = bbox[2], y1 = bbox[3]; - - var topLeft = [x0, y0]; - // we want the canvas to be as large as the step size - var botRight = [x0 + xstep, y0 + ystep]; - - var width = botRight[0] - topLeft[0]; - var height = botRight[1] - topLeft[1]; - - // Obtain scale from matrix and current transformation matrix. - var matrixScale = Util.singularValueDecompose2dScale(this.matrix); - var curMatrixScale = Util.singularValueDecompose2dScale( - this.baseTransform); - var combinedScale = [matrixScale[0] * curMatrixScale[0], - matrixScale[1] * curMatrixScale[1]]; - - // MAX_PATTERN_SIZE is used to avoid OOM situation. - // Use width and height values that are as close as possible to the end - // result when the pattern is used. Too low value makes the pattern look - // blurry. Too large value makes it look too crispy. - width = Math.min(Math.ceil(Math.abs(width * combinedScale[0])), - MAX_PATTERN_SIZE); - - height = Math.min(Math.ceil(Math.abs(height * combinedScale[1])), - MAX_PATTERN_SIZE); - - var tmpCanvas = owner.cachedCanvases.getCanvas('pattern', - width, height, true); - var tmpCtx = tmpCanvas.context; - var graphics = canvasGraphicsFactory.createCanvasGraphics(tmpCtx); - graphics.groupLevel = owner.groupLevel; - - this.setFillAndStrokeStyleToContext(tmpCtx, paintType, color); - - this.setScale(width, height, xstep, ystep); - this.transformToScale(graphics); - - // transform coordinates to pattern space - var tmpTranslate = [1, 0, 0, 1, -topLeft[0], -topLeft[1]]; - graphics.transform.apply(graphics, tmpTranslate); - - this.clipBbox(graphics, bbox, x0, y0, x1, y1); - - graphics.executeOperatorList(operatorList); - return tmpCanvas.canvas; - }, - - setScale: function TilingPattern_setScale(width, height, xstep, ystep) { - this.scale = [width / xstep, height / ystep]; - }, - - transformToScale: function TilingPattern_transformToScale(graphics) { - var scale = this.scale; - var tmpScale = [scale[0], 0, 0, scale[1], 0, 0]; - graphics.transform.apply(graphics, tmpScale); - }, - - scaleToContext: function TilingPattern_scaleToContext() { - var scale = this.scale; - this.ctx.scale(1 / scale[0], 1 / scale[1]); - }, - - clipBbox: function clipBbox(graphics, bbox, x0, y0, x1, y1) { - if (bbox && isArray(bbox) && bbox.length === 4) { - var bboxWidth = x1 - x0; - var bboxHeight = y1 - y0; - graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight); - graphics.clip(); - graphics.endPath(); - } - }, - - setFillAndStrokeStyleToContext: - function setFillAndStrokeStyleToContext(context, paintType, color) { - switch (paintType) { - case PaintType.COLORED: - var ctx = this.ctx; - context.fillStyle = ctx.fillStyle; - context.strokeStyle = ctx.strokeStyle; - break; - case PaintType.UNCOLORED: - var cssColor = Util.makeCssRgb(color[0], color[1], color[2]); - context.fillStyle = cssColor; - context.strokeStyle = cssColor; - break; - default: - error('Unsupported paint type: ' + paintType); - } - }, - - getPattern: function TilingPattern_getPattern(ctx, owner) { - var temporaryPatternCanvas = this.createPatternCanvas(owner); - - ctx = this.ctx; - ctx.setTransform.apply(ctx, this.baseTransform); - ctx.transform.apply(ctx, this.matrix); - this.scaleToContext(); - - return ctx.createPattern(temporaryPatternCanvas, 'repeat'); - } - }; - - return TilingPattern; -})(); - -exports.getShadingPatternFromIR = getShadingPatternFromIR; -exports.TilingPattern = TilingPattern; -})); - - -(function (root, factory) { - { - factory((root.pdfjsDisplayCanvas = {}), root.pdfjsSharedUtil, - root.pdfjsDisplayDOMUtils, root.pdfjsDisplayPatternHelper, - root.pdfjsDisplayWebGL); - } -}(this, function (exports, sharedUtil, displayDOMUtils, displayPatternHelper, - displayWebGL) { - -var FONT_IDENTITY_MATRIX = sharedUtil.FONT_IDENTITY_MATRIX; -var IDENTITY_MATRIX = sharedUtil.IDENTITY_MATRIX; -var ImageKind = sharedUtil.ImageKind; -var OPS = sharedUtil.OPS; -var TextRenderingMode = sharedUtil.TextRenderingMode; -var Uint32ArrayView = sharedUtil.Uint32ArrayView; -var Util = sharedUtil.Util; -var assert = sharedUtil.assert; -var info = sharedUtil.info; -var isNum = sharedUtil.isNum; -var isArray = sharedUtil.isArray; -var isLittleEndian = sharedUtil.isLittleEndian; -var error = sharedUtil.error; -var shadow = sharedUtil.shadow; -var warn = sharedUtil.warn; -var TilingPattern = displayPatternHelper.TilingPattern; -var getShadingPatternFromIR = displayPatternHelper.getShadingPatternFromIR; -var WebGLUtils = displayWebGL.WebGLUtils; -var hasCanvasTypedArrays = displayDOMUtils.hasCanvasTypedArrays; - -// contexts store most of the state we need natively. -// However, PDF needs a bit more state, which we store here. - -// Minimal font size that would be used during canvas fillText operations. -var MIN_FONT_SIZE = 16; -// Maximum font size that would be used during canvas fillText operations. -var MAX_FONT_SIZE = 100; -var MAX_GROUP_SIZE = 4096; - -// Heuristic value used when enforcing minimum line widths. -var MIN_WIDTH_FACTOR = 0.65; - -var COMPILE_TYPE3_GLYPHS = true; -var MAX_SIZE_TO_COMPILE = 1000; - -var FULL_CHUNK_HEIGHT = 16; - -var HasCanvasTypedArraysCached = { - get value() { - return shadow(HasCanvasTypedArraysCached, 'value', hasCanvasTypedArrays()); - } -}; - -var IsLittleEndianCached = { - get value() { - return shadow(IsLittleEndianCached, 'value', isLittleEndian()); - } -}; - -function createScratchCanvas(width, height) { - var canvas = document.createElement('canvas'); - canvas.width = width; - canvas.height = height; - return canvas; -} - -function addContextCurrentTransform(ctx) { - // If the context doesn't expose a `mozCurrentTransform`, add a JS based one. - if (!ctx.mozCurrentTransform) { - ctx._originalSave = ctx.save; - ctx._originalRestore = ctx.restore; - ctx._originalRotate = ctx.rotate; - ctx._originalScale = ctx.scale; - ctx._originalTranslate = ctx.translate; - ctx._originalTransform = ctx.transform; - ctx._originalSetTransform = ctx.setTransform; - - ctx._transformMatrix = ctx._transformMatrix || [1, 0, 0, 1, 0, 0]; - ctx._transformStack = []; - - Object.defineProperty(ctx, 'mozCurrentTransform', { - get: function getCurrentTransform() { - return this._transformMatrix; - } - }); - - Object.defineProperty(ctx, 'mozCurrentTransformInverse', { - get: function getCurrentTransformInverse() { - // Calculation done using WolframAlpha: - // http://www.wolframalpha.com/input/? - // i=Inverse+{{a%2C+c%2C+e}%2C+{b%2C+d%2C+f}%2C+{0%2C+0%2C+1}} - - var m = this._transformMatrix; - var a = m[0], b = m[1], c = m[2], d = m[3], e = m[4], f = m[5]; - - var ad_bc = a * d - b * c; - var bc_ad = b * c - a * d; - - return [ - d / ad_bc, - b / bc_ad, - c / bc_ad, - a / ad_bc, - (d * e - c * f) / bc_ad, - (b * e - a * f) / ad_bc - ]; - } - }); - - ctx.save = function ctxSave() { - var old = this._transformMatrix; - this._transformStack.push(old); - this._transformMatrix = old.slice(0, 6); - - this._originalSave(); - }; - - ctx.restore = function ctxRestore() { - var prev = this._transformStack.pop(); - if (prev) { - this._transformMatrix = prev; - this._originalRestore(); - } - }; - - ctx.translate = function ctxTranslate(x, y) { - var m = this._transformMatrix; - m[4] = m[0] * x + m[2] * y + m[4]; - m[5] = m[1] * x + m[3] * y + m[5]; - - this._originalTranslate(x, y); - }; - - ctx.scale = function ctxScale(x, y) { - var m = this._transformMatrix; - m[0] = m[0] * x; - m[1] = m[1] * x; - m[2] = m[2] * y; - m[3] = m[3] * y; - - this._originalScale(x, y); - }; - - ctx.transform = function ctxTransform(a, b, c, d, e, f) { - var m = this._transformMatrix; - this._transformMatrix = [ - m[0] * a + m[2] * b, - m[1] * a + m[3] * b, - m[0] * c + m[2] * d, - m[1] * c + m[3] * d, - m[0] * e + m[2] * f + m[4], - m[1] * e + m[3] * f + m[5] - ]; - - ctx._originalTransform(a, b, c, d, e, f); - }; - - ctx.setTransform = function ctxSetTransform(a, b, c, d, e, f) { - this._transformMatrix = [a, b, c, d, e, f]; - - ctx._originalSetTransform(a, b, c, d, e, f); - }; - - ctx.rotate = function ctxRotate(angle) { - var cosValue = Math.cos(angle); - var sinValue = Math.sin(angle); - - var m = this._transformMatrix; - this._transformMatrix = [ - m[0] * cosValue + m[2] * sinValue, - m[1] * cosValue + m[3] * sinValue, - m[0] * (-sinValue) + m[2] * cosValue, - m[1] * (-sinValue) + m[3] * cosValue, - m[4], - m[5] - ]; - - this._originalRotate(angle); - }; - } -} - -var CachedCanvases = (function CachedCanvasesClosure() { - function CachedCanvases() { - this.cache = Object.create(null); - } - CachedCanvases.prototype = { - getCanvas: function CachedCanvases_getCanvas(id, width, height, - trackTransform) { - var canvasEntry; - if (this.cache[id] !== undefined) { - canvasEntry = this.cache[id]; - canvasEntry.canvas.width = width; - canvasEntry.canvas.height = height; - // reset canvas transform for emulated mozCurrentTransform, if needed - canvasEntry.context.setTransform(1, 0, 0, 1, 0, 0); - } else { - var canvas = createScratchCanvas(width, height); - var ctx = canvas.getContext('2d'); - if (trackTransform) { - addContextCurrentTransform(ctx); - } - this.cache[id] = canvasEntry = {canvas: canvas, context: ctx}; - } - return canvasEntry; - }, - clear: function () { - for (var id in this.cache) { - var canvasEntry = this.cache[id]; - // Zeroing the width and height causes Firefox to release graphics - // resources immediately, which can greatly reduce memory consumption. - canvasEntry.canvas.width = 0; - canvasEntry.canvas.height = 0; - delete this.cache[id]; - } - } - }; - return CachedCanvases; -})(); - -function compileType3Glyph(imgData) { - var POINT_TO_PROCESS_LIMIT = 1000; - - var width = imgData.width, height = imgData.height; - var i, j, j0, width1 = width + 1; - var points = new Uint8Array(width1 * (height + 1)); - var POINT_TYPES = - new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]); - - // decodes bit-packed mask data - var lineSize = (width + 7) & ~7, data0 = imgData.data; - var data = new Uint8Array(lineSize * height), pos = 0, ii; - for (i = 0, ii = data0.length; i < ii; i++) { - var mask = 128, elem = data0[i]; - while (mask > 0) { - data[pos++] = (elem & mask) ? 0 : 255; - mask >>= 1; - } - } - - // finding iteresting points: every point is located between mask pixels, - // so there will be points of the (width + 1)x(height + 1) grid. Every point - // will have flags assigned based on neighboring mask pixels: - // 4 | 8 - // --P-- - // 2 | 1 - // We are interested only in points with the flags: - // - outside corners: 1, 2, 4, 8; - // - inside corners: 7, 11, 13, 14; - // - and, intersections: 5, 10. - var count = 0; - pos = 0; - if (data[pos] !== 0) { - points[0] = 1; - ++count; - } - for (j = 1; j < width; j++) { - if (data[pos] !== data[pos + 1]) { - points[j] = data[pos] ? 2 : 1; - ++count; - } - pos++; - } - if (data[pos] !== 0) { - points[j] = 2; - ++count; - } - for (i = 1; i < height; i++) { - pos = i * lineSize; - j0 = i * width1; - if (data[pos - lineSize] !== data[pos]) { - points[j0] = data[pos] ? 1 : 8; - ++count; - } - // 'sum' is the position of the current pixel configuration in the 'TYPES' - // array (in order 8-1-2-4, so we can use '>>2' to shift the column). - var sum = (data[pos] ? 4 : 0) + (data[pos - lineSize] ? 8 : 0); - for (j = 1; j < width; j++) { - sum = (sum >> 2) + (data[pos + 1] ? 4 : 0) + - (data[pos - lineSize + 1] ? 8 : 0); - if (POINT_TYPES[sum]) { - points[j0 + j] = POINT_TYPES[sum]; - ++count; - } - pos++; - } - if (data[pos - lineSize] !== data[pos]) { - points[j0 + j] = data[pos] ? 2 : 4; - ++count; - } - - if (count > POINT_TO_PROCESS_LIMIT) { - return null; - } - } - - pos = lineSize * (height - 1); - j0 = i * width1; - if (data[pos] !== 0) { - points[j0] = 8; - ++count; - } - for (j = 1; j < width; j++) { - if (data[pos] !== data[pos + 1]) { - points[j0 + j] = data[pos] ? 4 : 8; - ++count; - } - pos++; - } - if (data[pos] !== 0) { - points[j0 + j] = 4; - ++count; - } - if (count > POINT_TO_PROCESS_LIMIT) { - return null; - } - - // building outlines - var steps = new Int32Array([0, width1, -1, 0, -width1, 0, 0, 0, 1]); - var outlines = []; - for (i = 0; count && i <= height; i++) { - var p = i * width1; - var end = p + width; - while (p < end && !points[p]) { - p++; - } - if (p === end) { - continue; - } - var coords = [p % width1, i]; - - var type = points[p], p0 = p, pp; - do { - var step = steps[type]; - do { - p += step; - } while (!points[p]); - - pp = points[p]; - if (pp !== 5 && pp !== 10) { - // set new direction - type = pp; - // delete mark - points[p] = 0; - } else { // type is 5 or 10, ie, a crossing - // set new direction - type = pp & ((0x33 * type) >> 4); - // set new type for "future hit" - points[p] &= (type >> 2 | type << 2); - } - - coords.push(p % width1); - coords.push((p / width1) | 0); - --count; - } while (p0 !== p); - outlines.push(coords); - --i; - } - - var drawOutline = function(c) { - c.save(); - // the path shall be painted in [0..1]x[0..1] space - c.scale(1 / width, -1 / height); - c.translate(0, -height); - c.beginPath(); - for (var i = 0, ii = outlines.length; i < ii; i++) { - var o = outlines[i]; - c.moveTo(o[0], o[1]); - for (var j = 2, jj = o.length; j < jj; j += 2) { - c.lineTo(o[j], o[j+1]); - } - } - c.fill(); - c.beginPath(); - c.restore(); - }; - - return drawOutline; -} - -var CanvasExtraState = (function CanvasExtraStateClosure() { - function CanvasExtraState(old) { - // Are soft masks and alpha values shapes or opacities? - this.alphaIsShape = false; - this.fontSize = 0; - this.fontSizeScale = 1; - this.textMatrix = IDENTITY_MATRIX; - this.textMatrixScale = 1; - this.fontMatrix = FONT_IDENTITY_MATRIX; - this.leading = 0; - // Current point (in user coordinates) - this.x = 0; - this.y = 0; - // Start of text line (in text coordinates) - this.lineX = 0; - this.lineY = 0; - // Character and word spacing - this.charSpacing = 0; - this.wordSpacing = 0; - this.textHScale = 1; - this.textRenderingMode = TextRenderingMode.FILL; - this.textRise = 0; - // Default fore and background colors - this.fillColor = '#000000'; - this.strokeColor = '#000000'; - this.patternFill = false; - // Note: fill alpha applies to all non-stroking operations - this.fillAlpha = 1; - this.strokeAlpha = 1; - this.lineWidth = 1; - this.activeSMask = null; - this.resumeSMaskCtx = null; // nonclonable field (see the save method below) - - this.old = old; - } - - CanvasExtraState.prototype = { - clone: function CanvasExtraState_clone() { - return Object.create(this); - }, - setCurrentPoint: function CanvasExtraState_setCurrentPoint(x, y) { - this.x = x; - this.y = y; - } - }; - return CanvasExtraState; -})(); - -var CanvasGraphics = (function CanvasGraphicsClosure() { - // Defines the time the executeOperatorList is going to be executing - // before it stops and shedules a continue of execution. - var EXECUTION_TIME = 15; - // Defines the number of steps before checking the execution time - var EXECUTION_STEPS = 10; - - function CanvasGraphics(canvasCtx, commonObjs, objs, imageLayer) { - this.ctx = canvasCtx; - this.current = new CanvasExtraState(); - this.stateStack = []; - this.pendingClip = null; - this.pendingEOFill = false; - this.res = null; - this.xobjs = null; - this.commonObjs = commonObjs; - this.objs = objs; - this.imageLayer = imageLayer; - this.groupStack = []; - this.processingType3 = null; - // Patterns are painted relative to the initial page/form transform, see pdf - // spec 8.7.2 NOTE 1. - this.baseTransform = null; - this.baseTransformStack = []; - this.groupLevel = 0; - this.smaskStack = []; - this.smaskCounter = 0; - this.tempSMask = null; - this.cachedCanvases = new CachedCanvases(); - if (canvasCtx) { - // NOTE: if mozCurrentTransform is polyfilled, then the current state of - // the transformation must already be set in canvasCtx._transformMatrix. - addContextCurrentTransform(canvasCtx); - } - this.cachedGetSinglePixelWidth = null; - } - - function putBinaryImageData(ctx, imgData) { - if (typeof ImageData !== 'undefined' && imgData instanceof ImageData) { - ctx.putImageData(imgData, 0, 0); - return; - } - - // Put the image data to the canvas in chunks, rather than putting the - // whole image at once. This saves JS memory, because the ImageData object - // is smaller. It also possibly saves C++ memory within the implementation - // of putImageData(). (E.g. in Firefox we make two short-lived copies of - // the data passed to putImageData()). |n| shouldn't be too small, however, - // because too many putImageData() calls will slow things down. - // - // Note: as written, if the last chunk is partial, the putImageData() call - // will (conceptually) put pixels past the bounds of the canvas. But - // that's ok; any such pixels are ignored. - - var height = imgData.height, width = imgData.width; - var partialChunkHeight = height % FULL_CHUNK_HEIGHT; - var fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT; - var totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1; - - var chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT); - var srcPos = 0, destPos; - var src = imgData.data; - var dest = chunkImgData.data; - var i, j, thisChunkHeight, elemsInThisChunk; - - // There are multiple forms in which the pixel data can be passed, and - // imgData.kind tells us which one this is. - if (imgData.kind === ImageKind.GRAYSCALE_1BPP) { - // Grayscale, 1 bit per pixel (i.e. black-and-white). - var srcLength = src.byteLength; - var dest32 = HasCanvasTypedArraysCached.value ? - new Uint32Array(dest.buffer) : new Uint32ArrayView(dest); - var dest32DataLength = dest32.length; - var fullSrcDiff = (width + 7) >> 3; - var white = 0xFFFFFFFF; - var black = (IsLittleEndianCached.value || - !HasCanvasTypedArraysCached.value) ? 0xFF000000 : 0x000000FF; - for (i = 0; i < totalChunks; i++) { - thisChunkHeight = - (i < fullChunks) ? FULL_CHUNK_HEIGHT : partialChunkHeight; - destPos = 0; - for (j = 0; j < thisChunkHeight; j++) { - var srcDiff = srcLength - srcPos; - var k = 0; - var kEnd = (srcDiff > fullSrcDiff) ? width : srcDiff * 8 - 7; - var kEndUnrolled = kEnd & ~7; - var mask = 0; - var srcByte = 0; - for (; k < kEndUnrolled; k += 8) { - srcByte = src[srcPos++]; - dest32[destPos++] = (srcByte & 128) ? white : black; - dest32[destPos++] = (srcByte & 64) ? white : black; - dest32[destPos++] = (srcByte & 32) ? white : black; - dest32[destPos++] = (srcByte & 16) ? white : black; - dest32[destPos++] = (srcByte & 8) ? white : black; - dest32[destPos++] = (srcByte & 4) ? white : black; - dest32[destPos++] = (srcByte & 2) ? white : black; - dest32[destPos++] = (srcByte & 1) ? white : black; - } - for (; k < kEnd; k++) { - if (mask === 0) { - srcByte = src[srcPos++]; - mask = 128; - } - - dest32[destPos++] = (srcByte & mask) ? white : black; - mask >>= 1; - } - } - // We ran out of input. Make all remaining pixels transparent. - while (destPos < dest32DataLength) { - dest32[destPos++] = 0; - } - - ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); - } - } else if (imgData.kind === ImageKind.RGBA_32BPP) { - // RGBA, 32-bits per pixel. - - j = 0; - elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4; - for (i = 0; i < fullChunks; i++) { - dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); - srcPos += elemsInThisChunk; - - ctx.putImageData(chunkImgData, 0, j); - j += FULL_CHUNK_HEIGHT; - } - if (i < totalChunks) { - elemsInThisChunk = width * partialChunkHeight * 4; - dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); - ctx.putImageData(chunkImgData, 0, j); - } - - } else if (imgData.kind === ImageKind.RGB_24BPP) { - // RGB, 24-bits per pixel. - thisChunkHeight = FULL_CHUNK_HEIGHT; - elemsInThisChunk = width * thisChunkHeight; - for (i = 0; i < totalChunks; i++) { - if (i >= fullChunks) { - thisChunkHeight = partialChunkHeight; - elemsInThisChunk = width * thisChunkHeight; - } - - destPos = 0; - for (j = elemsInThisChunk; j--;) { - dest[destPos++] = src[srcPos++]; - dest[destPos++] = src[srcPos++]; - dest[destPos++] = src[srcPos++]; - dest[destPos++] = 255; - } - ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); - } - } else { - error('bad image kind: ' + imgData.kind); - } - } - - function putBinaryImageMask(ctx, imgData) { - var height = imgData.height, width = imgData.width; - var partialChunkHeight = height % FULL_CHUNK_HEIGHT; - var fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT; - var totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1; - - var chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT); - var srcPos = 0; - var src = imgData.data; - var dest = chunkImgData.data; - - for (var i = 0; i < totalChunks; i++) { - var thisChunkHeight = - (i < fullChunks) ? FULL_CHUNK_HEIGHT : partialChunkHeight; - - // Expand the mask so it can be used by the canvas. Any required - // inversion has already been handled. - var destPos = 3; // alpha component offset - for (var j = 0; j < thisChunkHeight; j++) { - var mask = 0; - for (var k = 0; k < width; k++) { - if (!mask) { - var elem = src[srcPos++]; - mask = 128; - } - dest[destPos] = (elem & mask) ? 0 : 255; - destPos += 4; - mask >>= 1; - } - } - ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); - } - } - - function copyCtxState(sourceCtx, destCtx) { - var properties = ['strokeStyle', 'fillStyle', 'fillRule', 'globalAlpha', - 'lineWidth', 'lineCap', 'lineJoin', 'miterLimit', - 'globalCompositeOperation', 'font']; - for (var i = 0, ii = properties.length; i < ii; i++) { - var property = properties[i]; - if (sourceCtx[property] !== undefined) { - destCtx[property] = sourceCtx[property]; - } - } - if (sourceCtx.setLineDash !== undefined) { - destCtx.setLineDash(sourceCtx.getLineDash()); - destCtx.lineDashOffset = sourceCtx.lineDashOffset; - } - } - - function composeSMaskBackdrop(bytes, r0, g0, b0) { - var length = bytes.length; - for (var i = 3; i < length; i += 4) { - var alpha = bytes[i]; - if (alpha === 0) { - bytes[i - 3] = r0; - bytes[i - 2] = g0; - bytes[i - 1] = b0; - } else if (alpha < 255) { - var alpha_ = 255 - alpha; - bytes[i - 3] = (bytes[i - 3] * alpha + r0 * alpha_) >> 8; - bytes[i - 2] = (bytes[i - 2] * alpha + g0 * alpha_) >> 8; - bytes[i - 1] = (bytes[i - 1] * alpha + b0 * alpha_) >> 8; - } - } - } - - function composeSMaskAlpha(maskData, layerData, transferMap) { - var length = maskData.length; - var scale = 1 / 255; - for (var i = 3; i < length; i += 4) { - var alpha = transferMap ? transferMap[maskData[i]] : maskData[i]; - layerData[i] = (layerData[i] * alpha * scale) | 0; - } - } - - function composeSMaskLuminosity(maskData, layerData, transferMap) { - var length = maskData.length; - for (var i = 3; i < length; i += 4) { - var y = (maskData[i - 3] * 77) + // * 0.3 / 255 * 0x10000 - (maskData[i - 2] * 152) + // * 0.59 .... - (maskData[i - 1] * 28); // * 0.11 .... - layerData[i] = transferMap ? - (layerData[i] * transferMap[y >> 8]) >> 8 : - (layerData[i] * y) >> 16; - } - } - - function genericComposeSMask(maskCtx, layerCtx, width, height, - subtype, backdrop, transferMap) { - var hasBackdrop = !!backdrop; - var r0 = hasBackdrop ? backdrop[0] : 0; - var g0 = hasBackdrop ? backdrop[1] : 0; - var b0 = hasBackdrop ? backdrop[2] : 0; - - var composeFn; - if (subtype === 'Luminosity') { - composeFn = composeSMaskLuminosity; - } else { - composeFn = composeSMaskAlpha; - } - - // processing image in chunks to save memory - var PIXELS_TO_PROCESS = 1048576; - var chunkSize = Math.min(height, Math.ceil(PIXELS_TO_PROCESS / width)); - for (var row = 0; row < height; row += chunkSize) { - var chunkHeight = Math.min(chunkSize, height - row); - var maskData = maskCtx.getImageData(0, row, width, chunkHeight); - var layerData = layerCtx.getImageData(0, row, width, chunkHeight); - - if (hasBackdrop) { - composeSMaskBackdrop(maskData.data, r0, g0, b0); - } - composeFn(maskData.data, layerData.data, transferMap); - - maskCtx.putImageData(layerData, 0, row); - } - } - - function composeSMask(ctx, smask, layerCtx) { - var mask = smask.canvas; - var maskCtx = smask.context; - - ctx.setTransform(smask.scaleX, 0, 0, smask.scaleY, - smask.offsetX, smask.offsetY); - - var backdrop = smask.backdrop || null; - if (!smask.transferMap && WebGLUtils.isEnabled) { - var composed = WebGLUtils.composeSMask(layerCtx.canvas, mask, - {subtype: smask.subtype, backdrop: backdrop}); - ctx.setTransform(1, 0, 0, 1, 0, 0); - ctx.drawImage(composed, smask.offsetX, smask.offsetY); - return; - } - genericComposeSMask(maskCtx, layerCtx, mask.width, mask.height, - smask.subtype, backdrop, smask.transferMap); - ctx.drawImage(mask, 0, 0); - } - - var LINE_CAP_STYLES = ['butt', 'round', 'square']; - var LINE_JOIN_STYLES = ['miter', 'round', 'bevel']; - var NORMAL_CLIP = {}; - var EO_CLIP = {}; - - CanvasGraphics.prototype = { - - beginDrawing: function CanvasGraphics_beginDrawing(transform, viewport, - transparency) { - // For pdfs that use blend modes we have to clear the canvas else certain - // blend modes can look wrong since we'd be blending with a white - // backdrop. The problem with a transparent backdrop though is we then - // don't get sub pixel anti aliasing on text, creating temporary - // transparent canvas when we have blend modes. - var width = this.ctx.canvas.width; - var height = this.ctx.canvas.height; - - this.ctx.save(); - this.ctx.fillStyle = 'rgb(255, 255, 255)'; - this.ctx.fillRect(0, 0, width, height); - this.ctx.restore(); - - if (transparency) { - var transparentCanvas = this.cachedCanvases.getCanvas( - 'transparent', width, height, true); - this.compositeCtx = this.ctx; - this.transparentCanvas = transparentCanvas.canvas; - this.ctx = transparentCanvas.context; - this.ctx.save(); - // The transform can be applied before rendering, transferring it to - // the new canvas. - this.ctx.transform.apply(this.ctx, - this.compositeCtx.mozCurrentTransform); - } - - this.ctx.save(); - if (transform) { - this.ctx.transform.apply(this.ctx, transform); - } - this.ctx.transform.apply(this.ctx, viewport.transform); - - this.baseTransform = this.ctx.mozCurrentTransform.slice(); - - if (this.imageLayer) { - this.imageLayer.beginLayout(); - } - }, - - executeOperatorList: function CanvasGraphics_executeOperatorList( - operatorList, - executionStartIdx, continueCallback, - stepper) { - var argsArray = operatorList.argsArray; - var fnArray = operatorList.fnArray; - var i = executionStartIdx || 0; - var argsArrayLen = argsArray.length; - - // Sometimes the OperatorList to execute is empty. - if (argsArrayLen === i) { - return i; - } - - var chunkOperations = (argsArrayLen - i > EXECUTION_STEPS && - typeof continueCallback === 'function'); - var endTime = chunkOperations ? Date.now() + EXECUTION_TIME : 0; - var steps = 0; - - var commonObjs = this.commonObjs; - var objs = this.objs; - var fnId; - - while (true) { - if (stepper !== undefined && i === stepper.nextBreakPoint) { - stepper.breakIt(i, continueCallback); - return i; - } - - fnId = fnArray[i]; - - if (fnId !== OPS.dependency) { - this[fnId].apply(this, argsArray[i]); - } else { - var deps = argsArray[i]; - for (var n = 0, nn = deps.length; n < nn; n++) { - var depObjId = deps[n]; - var common = depObjId[0] === 'g' && depObjId[1] === '_'; - var objsPool = common ? commonObjs : objs; - - // If the promise isn't resolved yet, add the continueCallback - // to the promise and bail out. - if (!objsPool.isResolved(depObjId)) { - objsPool.get(depObjId, continueCallback); - return i; - } - } - } - - i++; - - // If the entire operatorList was executed, stop as were done. - if (i === argsArrayLen) { - return i; - } - - // If the execution took longer then a certain amount of time and - // `continueCallback` is specified, interrupt the execution. - if (chunkOperations && ++steps > EXECUTION_STEPS) { - if (Date.now() > endTime) { - continueCallback(); - return i; - } - steps = 0; - } - - // If the operatorList isn't executed completely yet OR the execution - // time was short enough, do another execution round. - } - }, - - endDrawing: function CanvasGraphics_endDrawing() { - // Finishing all opened operations such as SMask group painting. - if (this.current.activeSMask !== null) { - this.endSMaskGroup(); - } - - this.ctx.restore(); - - if (this.transparentCanvas) { - this.ctx = this.compositeCtx; - this.ctx.save(); - this.ctx.setTransform(1, 0, 0, 1, 0, 0); // Avoid apply transform twice - this.ctx.drawImage(this.transparentCanvas, 0, 0); - this.ctx.restore(); - this.transparentCanvas = null; - } - - this.cachedCanvases.clear(); - WebGLUtils.clear(); - - if (this.imageLayer) { - this.imageLayer.endLayout(); - } - }, - - // Graphics state - setLineWidth: function CanvasGraphics_setLineWidth(width) { - this.current.lineWidth = width; - this.ctx.lineWidth = width; - }, - setLineCap: function CanvasGraphics_setLineCap(style) { - this.ctx.lineCap = LINE_CAP_STYLES[style]; - }, - setLineJoin: function CanvasGraphics_setLineJoin(style) { - this.ctx.lineJoin = LINE_JOIN_STYLES[style]; - }, - setMiterLimit: function CanvasGraphics_setMiterLimit(limit) { - this.ctx.miterLimit = limit; - }, - setDash: function CanvasGraphics_setDash(dashArray, dashPhase) { - var ctx = this.ctx; - if (ctx.setLineDash !== undefined) { - ctx.setLineDash(dashArray); - ctx.lineDashOffset = dashPhase; - } - }, - setRenderingIntent: function CanvasGraphics_setRenderingIntent(intent) { - // Maybe if we one day fully support color spaces this will be important - // for now we can ignore. - // TODO set rendering intent? - }, - setFlatness: function CanvasGraphics_setFlatness(flatness) { - // There's no way to control this with canvas, but we can safely ignore. - // TODO set flatness? - }, - setGState: function CanvasGraphics_setGState(states) { - for (var i = 0, ii = states.length; i < ii; i++) { - var state = states[i]; - var key = state[0]; - var value = state[1]; - - switch (key) { - case 'LW': - this.setLineWidth(value); - break; - case 'LC': - this.setLineCap(value); - break; - case 'LJ': - this.setLineJoin(value); - break; - case 'ML': - this.setMiterLimit(value); - break; - case 'D': - this.setDash(value[0], value[1]); - break; - case 'RI': - this.setRenderingIntent(value); - break; - case 'FL': - this.setFlatness(value); - break; - case 'Font': - this.setFont(value[0], value[1]); - break; - case 'CA': - this.current.strokeAlpha = state[1]; - break; - case 'ca': - this.current.fillAlpha = state[1]; - this.ctx.globalAlpha = state[1]; - break; - case 'BM': - if (value && value.name && (value.name !== 'Normal')) { - var mode = value.name.replace(/([A-Z])/g, - function(c) { - return '-' + c.toLowerCase(); - } - ).substring(1); - this.ctx.globalCompositeOperation = mode; - if (this.ctx.globalCompositeOperation !== mode) { - warn('globalCompositeOperation "' + mode + - '" is not supported'); - } - } else { - this.ctx.globalCompositeOperation = 'source-over'; - } - break; - case 'SMask': - if (this.current.activeSMask) { - // If SMask is currrenly used, it needs to be suspended or - // finished. Suspend only makes sense when at least one save() - // was performed and state needs to be reverted on restore(). - if (this.stateStack.length > 0 && - (this.stateStack[this.stateStack.length - 1].activeSMask === - this.current.activeSMask)) { - this.suspendSMaskGroup(); - } else { - this.endSMaskGroup(); - } - } - this.current.activeSMask = value ? this.tempSMask : null; - if (this.current.activeSMask) { - this.beginSMaskGroup(); - } - this.tempSMask = null; - break; - } - } - }, - beginSMaskGroup: function CanvasGraphics_beginSMaskGroup() { - - var activeSMask = this.current.activeSMask; - var drawnWidth = activeSMask.canvas.width; - var drawnHeight = activeSMask.canvas.height; - var cacheId = 'smaskGroupAt' + this.groupLevel; - var scratchCanvas = this.cachedCanvases.getCanvas( - cacheId, drawnWidth, drawnHeight, true); - - var currentCtx = this.ctx; - var currentTransform = currentCtx.mozCurrentTransform; - this.ctx.save(); - - var groupCtx = scratchCanvas.context; - groupCtx.scale(1 / activeSMask.scaleX, 1 / activeSMask.scaleY); - groupCtx.translate(-activeSMask.offsetX, -activeSMask.offsetY); - groupCtx.transform.apply(groupCtx, currentTransform); - - activeSMask.startTransformInverse = groupCtx.mozCurrentTransformInverse; - - copyCtxState(currentCtx, groupCtx); - this.ctx = groupCtx; - this.setGState([ - ['BM', 'Normal'], - ['ca', 1], - ['CA', 1] - ]); - this.groupStack.push(currentCtx); - this.groupLevel++; - }, - suspendSMaskGroup: function CanvasGraphics_endSMaskGroup() { - // Similar to endSMaskGroup, the intermediate canvas has to be composed - // and future ctx state restored. - var groupCtx = this.ctx; - this.groupLevel--; - this.ctx = this.groupStack.pop(); - - composeSMask(this.ctx, this.current.activeSMask, groupCtx); - this.ctx.restore(); - this.ctx.save(); // save is needed since SMask will be resumed. - copyCtxState(groupCtx, this.ctx); - - // Saving state for resuming. - this.current.resumeSMaskCtx = groupCtx; - // Transform was changed in the SMask canvas, reflecting this change on - // this.ctx. - var deltaTransform = Util.transform( - this.current.activeSMask.startTransformInverse, - groupCtx.mozCurrentTransform); - this.ctx.transform.apply(this.ctx, deltaTransform); - - // SMask was composed, the results at the groupCtx can be cleared. - groupCtx.save(); - groupCtx.setTransform(1, 0, 0, 1, 0, 0); - groupCtx.clearRect(0, 0, groupCtx.canvas.width, groupCtx.canvas.height); - groupCtx.restore(); - }, - resumeSMaskGroup: function CanvasGraphics_endSMaskGroup() { - // Resuming state saved by suspendSMaskGroup. We don't need to restore - // any groupCtx state since restore() command (the only caller) will do - // that for us. See also beginSMaskGroup. - var groupCtx = this.current.resumeSMaskCtx; - var currentCtx = this.ctx; - this.ctx = groupCtx; - this.groupStack.push(currentCtx); - this.groupLevel++; - }, - endSMaskGroup: function CanvasGraphics_endSMaskGroup() { - var groupCtx = this.ctx; - this.groupLevel--; - this.ctx = this.groupStack.pop(); - - composeSMask(this.ctx, this.current.activeSMask, groupCtx); - this.ctx.restore(); - copyCtxState(groupCtx, this.ctx); - // Transform was changed in the SMask canvas, reflecting this change on - // this.ctx. - var deltaTransform = Util.transform( - this.current.activeSMask.startTransformInverse, - groupCtx.mozCurrentTransform); - this.ctx.transform.apply(this.ctx, deltaTransform); - }, - save: function CanvasGraphics_save() { - this.ctx.save(); - var old = this.current; - this.stateStack.push(old); - this.current = old.clone(); - this.current.resumeSMaskCtx = null; - }, - restore: function CanvasGraphics_restore() { - // SMask was suspended, we just need to resume it. - if (this.current.resumeSMaskCtx) { - this.resumeSMaskGroup(); - } - // SMask has to be finished once there is no states that are using the - // same SMask. - if (this.current.activeSMask !== null && (this.stateStack.length === 0 || - this.stateStack[this.stateStack.length - 1].activeSMask !== - this.current.activeSMask)) { - this.endSMaskGroup(); - } - - if (this.stateStack.length !== 0) { - this.current = this.stateStack.pop(); - this.ctx.restore(); - - // Ensure that the clipping path is reset (fixes issue6413.pdf). - this.pendingClip = null; - - this.cachedGetSinglePixelWidth = null; - } - }, - transform: function CanvasGraphics_transform(a, b, c, d, e, f) { - this.ctx.transform(a, b, c, d, e, f); - - this.cachedGetSinglePixelWidth = null; - }, - - // Path - constructPath: function CanvasGraphics_constructPath(ops, args) { - var ctx = this.ctx; - var current = this.current; - var x = current.x, y = current.y; - for (var i = 0, j = 0, ii = ops.length; i < ii; i++) { - switch (ops[i] | 0) { - case OPS.rectangle: - x = args[j++]; - y = args[j++]; - var width = args[j++]; - var height = args[j++]; - if (width === 0) { - width = this.getSinglePixelWidth(); - } - if (height === 0) { - height = this.getSinglePixelWidth(); - } - var xw = x + width; - var yh = y + height; - this.ctx.moveTo(x, y); - this.ctx.lineTo(xw, y); - this.ctx.lineTo(xw, yh); - this.ctx.lineTo(x, yh); - this.ctx.lineTo(x, y); - this.ctx.closePath(); - break; - case OPS.moveTo: - x = args[j++]; - y = args[j++]; - ctx.moveTo(x, y); - break; - case OPS.lineTo: - x = args[j++]; - y = args[j++]; - ctx.lineTo(x, y); - break; - case OPS.curveTo: - x = args[j + 4]; - y = args[j + 5]; - ctx.bezierCurveTo(args[j], args[j + 1], args[j + 2], args[j + 3], - x, y); - j += 6; - break; - case OPS.curveTo2: - ctx.bezierCurveTo(x, y, args[j], args[j + 1], - args[j + 2], args[j + 3]); - x = args[j + 2]; - y = args[j + 3]; - j += 4; - break; - case OPS.curveTo3: - x = args[j + 2]; - y = args[j + 3]; - ctx.bezierCurveTo(args[j], args[j + 1], x, y, x, y); - j += 4; - break; - case OPS.closePath: - ctx.closePath(); - break; - } - } - current.setCurrentPoint(x, y); - }, - closePath: function CanvasGraphics_closePath() { - this.ctx.closePath(); - }, - stroke: function CanvasGraphics_stroke(consumePath) { - consumePath = typeof consumePath !== 'undefined' ? consumePath : true; - var ctx = this.ctx; - var strokeColor = this.current.strokeColor; - // Prevent drawing too thin lines by enforcing a minimum line width. - ctx.lineWidth = Math.max(this.getSinglePixelWidth() * MIN_WIDTH_FACTOR, - this.current.lineWidth); - // For stroke we want to temporarily change the global alpha to the - // stroking alpha. - ctx.globalAlpha = this.current.strokeAlpha; - if (strokeColor && strokeColor.hasOwnProperty('type') && - strokeColor.type === 'Pattern') { - // for patterns, we transform to pattern space, calculate - // the pattern, call stroke, and restore to user space - ctx.save(); - ctx.strokeStyle = strokeColor.getPattern(ctx, this); - ctx.stroke(); - ctx.restore(); - } else { - ctx.stroke(); - } - if (consumePath) { - this.consumePath(); - } - // Restore the global alpha to the fill alpha - ctx.globalAlpha = this.current.fillAlpha; - }, - closeStroke: function CanvasGraphics_closeStroke() { - this.closePath(); - this.stroke(); - }, - fill: function CanvasGraphics_fill(consumePath) { - consumePath = typeof consumePath !== 'undefined' ? consumePath : true; - var ctx = this.ctx; - var fillColor = this.current.fillColor; - var isPatternFill = this.current.patternFill; - var needRestore = false; - - if (isPatternFill) { - ctx.save(); - if (this.baseTransform) { - ctx.setTransform.apply(ctx, this.baseTransform); - } - ctx.fillStyle = fillColor.getPattern(ctx, this); - needRestore = true; - } - - if (this.pendingEOFill) { - if (ctx.mozFillRule !== undefined) { - ctx.mozFillRule = 'evenodd'; - ctx.fill(); - ctx.mozFillRule = 'nonzero'; - } else { - ctx.fill('evenodd'); - } - this.pendingEOFill = false; - } else { - ctx.fill(); - } - - if (needRestore) { - ctx.restore(); - } - if (consumePath) { - this.consumePath(); - } - }, - eoFill: function CanvasGraphics_eoFill() { - this.pendingEOFill = true; - this.fill(); - }, - fillStroke: function CanvasGraphics_fillStroke() { - this.fill(false); - this.stroke(false); - - this.consumePath(); - }, - eoFillStroke: function CanvasGraphics_eoFillStroke() { - this.pendingEOFill = true; - this.fillStroke(); - }, - closeFillStroke: function CanvasGraphics_closeFillStroke() { - this.closePath(); - this.fillStroke(); - }, - closeEOFillStroke: function CanvasGraphics_closeEOFillStroke() { - this.pendingEOFill = true; - this.closePath(); - this.fillStroke(); - }, - endPath: function CanvasGraphics_endPath() { - this.consumePath(); - }, - - // Clipping - clip: function CanvasGraphics_clip() { - this.pendingClip = NORMAL_CLIP; - }, - eoClip: function CanvasGraphics_eoClip() { - this.pendingClip = EO_CLIP; - }, - - // Text - beginText: function CanvasGraphics_beginText() { - this.current.textMatrix = IDENTITY_MATRIX; - this.current.textMatrixScale = 1; - this.current.x = this.current.lineX = 0; - this.current.y = this.current.lineY = 0; - }, - endText: function CanvasGraphics_endText() { - var paths = this.pendingTextPaths; - var ctx = this.ctx; - if (paths === undefined) { - ctx.beginPath(); - return; - } - - ctx.save(); - ctx.beginPath(); - for (var i = 0; i < paths.length; i++) { - var path = paths[i]; - ctx.setTransform.apply(ctx, path.transform); - ctx.translate(path.x, path.y); - path.addToPath(ctx, path.fontSize); - } - ctx.restore(); - ctx.clip(); - ctx.beginPath(); - delete this.pendingTextPaths; - }, - setCharSpacing: function CanvasGraphics_setCharSpacing(spacing) { - this.current.charSpacing = spacing; - }, - setWordSpacing: function CanvasGraphics_setWordSpacing(spacing) { - this.current.wordSpacing = spacing; - }, - setHScale: function CanvasGraphics_setHScale(scale) { - this.current.textHScale = scale / 100; - }, - setLeading: function CanvasGraphics_setLeading(leading) { - this.current.leading = -leading; - }, - setFont: function CanvasGraphics_setFont(fontRefName, size) { - var fontObj = this.commonObjs.get(fontRefName); - var current = this.current; - - if (!fontObj) { - error('Can\'t find font for ' + fontRefName); - } - - current.fontMatrix = (fontObj.fontMatrix ? - fontObj.fontMatrix : FONT_IDENTITY_MATRIX); - - // A valid matrix needs all main diagonal elements to be non-zero - // This also ensures we bypass FF bugzilla bug #719844. - if (current.fontMatrix[0] === 0 || - current.fontMatrix[3] === 0) { - warn('Invalid font matrix for font ' + fontRefName); - } - - // The spec for Tf (setFont) says that 'size' specifies the font 'scale', - // and in some docs this can be negative (inverted x-y axes). - if (size < 0) { - size = -size; - current.fontDirection = -1; - } else { - current.fontDirection = 1; - } - - this.current.font = fontObj; - this.current.fontSize = size; - - if (fontObj.isType3Font) { - return; // we don't need ctx.font for Type3 fonts - } - - var name = fontObj.loadedName || 'sans-serif'; - var bold = fontObj.black ? (fontObj.bold ? '900' : 'bold') : - (fontObj.bold ? 'bold' : 'normal'); - - var italic = fontObj.italic ? 'italic' : 'normal'; - var typeface = '"' + name + '", ' + fontObj.fallbackName; - - // Some font backends cannot handle fonts below certain size. - // Keeping the font at minimal size and using the fontSizeScale to change - // the current transformation matrix before the fillText/strokeText. - // See https://bugzilla.mozilla.org/show_bug.cgi?id=726227 - var browserFontSize = size < MIN_FONT_SIZE ? MIN_FONT_SIZE : - size > MAX_FONT_SIZE ? MAX_FONT_SIZE : size; - this.current.fontSizeScale = size / browserFontSize; - - var rule = italic + ' ' + bold + ' ' + browserFontSize + 'px ' + typeface; - this.ctx.font = rule; - }, - setTextRenderingMode: function CanvasGraphics_setTextRenderingMode(mode) { - this.current.textRenderingMode = mode; - }, - setTextRise: function CanvasGraphics_setTextRise(rise) { - this.current.textRise = rise; - }, - moveText: function CanvasGraphics_moveText(x, y) { - this.current.x = this.current.lineX += x; - this.current.y = this.current.lineY += y; - }, - setLeadingMoveText: function CanvasGraphics_setLeadingMoveText(x, y) { - this.setLeading(-y); - this.moveText(x, y); - }, - setTextMatrix: function CanvasGraphics_setTextMatrix(a, b, c, d, e, f) { - this.current.textMatrix = [a, b, c, d, e, f]; - this.current.textMatrixScale = Math.sqrt(a * a + b * b); - - this.current.x = this.current.lineX = 0; - this.current.y = this.current.lineY = 0; - }, - nextLine: function CanvasGraphics_nextLine() { - this.moveText(0, this.current.leading); - }, - - paintChar: function CanvasGraphics_paintChar(character, x, y) { - var ctx = this.ctx; - var current = this.current; - var font = current.font; - var textRenderingMode = current.textRenderingMode; - var fontSize = current.fontSize / current.fontSizeScale; - var fillStrokeMode = textRenderingMode & - TextRenderingMode.FILL_STROKE_MASK; - var isAddToPathSet = !!(textRenderingMode & - TextRenderingMode.ADD_TO_PATH_FLAG); - - var addToPath; - if (font.disableFontFace || isAddToPathSet) { - addToPath = font.getPathGenerator(this.commonObjs, character); - } - - if (font.disableFontFace) { - ctx.save(); - ctx.translate(x, y); - ctx.beginPath(); - addToPath(ctx, fontSize); - if (fillStrokeMode === TextRenderingMode.FILL || - fillStrokeMode === TextRenderingMode.FILL_STROKE) { - ctx.fill(); - } - if (fillStrokeMode === TextRenderingMode.STROKE || - fillStrokeMode === TextRenderingMode.FILL_STROKE) { - ctx.stroke(); - } - ctx.restore(); - } else { - if (fillStrokeMode === TextRenderingMode.FILL || - fillStrokeMode === TextRenderingMode.FILL_STROKE) { - ctx.fillText(character, x, y); - } - if (fillStrokeMode === TextRenderingMode.STROKE || - fillStrokeMode === TextRenderingMode.FILL_STROKE) { - ctx.strokeText(character, x, y); - } - } - - if (isAddToPathSet) { - var paths = this.pendingTextPaths || (this.pendingTextPaths = []); - paths.push({ - transform: ctx.mozCurrentTransform, - x: x, - y: y, - fontSize: fontSize, - addToPath: addToPath - }); - } - }, - - get isFontSubpixelAAEnabled() { - // Checks if anti-aliasing is enabled when scaled text is painted. - // On Windows GDI scaled fonts looks bad. - var ctx = document.createElement('canvas').getContext('2d'); - ctx.scale(1.5, 1); - ctx.fillText('I', 0, 10); - var data = ctx.getImageData(0, 0, 10, 10).data; - var enabled = false; - for (var i = 3; i < data.length; i += 4) { - if (data[i] > 0 && data[i] < 255) { - enabled = true; - break; - } - } - return shadow(this, 'isFontSubpixelAAEnabled', enabled); - }, - - showText: function CanvasGraphics_showText(glyphs) { - var current = this.current; - var font = current.font; - if (font.isType3Font) { - return this.showType3Text(glyphs); - } - - var fontSize = current.fontSize; - if (fontSize === 0) { - return; - } - - var ctx = this.ctx; - var fontSizeScale = current.fontSizeScale; - var charSpacing = current.charSpacing; - var wordSpacing = current.wordSpacing; - var fontDirection = current.fontDirection; - var textHScale = current.textHScale * fontDirection; - var glyphsLength = glyphs.length; - var vertical = font.vertical; - var spacingDir = vertical ? 1 : -1; - var defaultVMetrics = font.defaultVMetrics; - var widthAdvanceScale = fontSize * current.fontMatrix[0]; - - var simpleFillText = - current.textRenderingMode === TextRenderingMode.FILL && - !font.disableFontFace; - - ctx.save(); - ctx.transform.apply(ctx, current.textMatrix); - ctx.translate(current.x, current.y + current.textRise); - - if (current.patternFill) { - // TODO: Some shading patterns are not applied correctly to text, - // e.g. issues 3988 and 5432, and ShowText-ShadingPattern.pdf. - ctx.fillStyle = current.fillColor.getPattern(ctx, this); - } - - if (fontDirection > 0) { - ctx.scale(textHScale, -1); - } else { - ctx.scale(textHScale, 1); - } - - var lineWidth = current.lineWidth; - var scale = current.textMatrixScale; - if (scale === 0 || lineWidth === 0) { - var fillStrokeMode = current.textRenderingMode & - TextRenderingMode.FILL_STROKE_MASK; - if (fillStrokeMode === TextRenderingMode.STROKE || - fillStrokeMode === TextRenderingMode.FILL_STROKE) { - this.cachedGetSinglePixelWidth = null; - lineWidth = this.getSinglePixelWidth() * MIN_WIDTH_FACTOR; - } - } else { - lineWidth /= scale; - } - - if (fontSizeScale !== 1.0) { - ctx.scale(fontSizeScale, fontSizeScale); - lineWidth /= fontSizeScale; - } - - ctx.lineWidth = lineWidth; - - var x = 0, i; - for (i = 0; i < glyphsLength; ++i) { - var glyph = glyphs[i]; - if (isNum(glyph)) { - x += spacingDir * glyph * fontSize / 1000; - continue; - } - - var restoreNeeded = false; - var spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; - var character = glyph.fontChar; - var accent = glyph.accent; - var scaledX, scaledY, scaledAccentX, scaledAccentY; - var width = glyph.width; - if (vertical) { - var vmetric, vx, vy; - vmetric = glyph.vmetric || defaultVMetrics; - vx = glyph.vmetric ? vmetric[1] : width * 0.5; - vx = -vx * widthAdvanceScale; - vy = vmetric[2] * widthAdvanceScale; - - width = vmetric ? -vmetric[0] : width; - scaledX = vx / fontSizeScale; - scaledY = (x + vy) / fontSizeScale; - } else { - scaledX = x / fontSizeScale; - scaledY = 0; - } - - if (font.remeasure && width > 0) { - // Some standard fonts may not have the exact width: rescale per - // character if measured width is greater than expected glyph width - // and subpixel-aa is enabled, otherwise just center the glyph. - var measuredWidth = ctx.measureText(character).width * 1000 / - fontSize * fontSizeScale; - if (width < measuredWidth && this.isFontSubpixelAAEnabled) { - var characterScaleX = width / measuredWidth; - restoreNeeded = true; - ctx.save(); - ctx.scale(characterScaleX, 1); - scaledX /= characterScaleX; - } else if (width !== measuredWidth) { - scaledX += (width - measuredWidth) / 2000 * - fontSize / fontSizeScale; - } - } - - // Only attempt to draw the glyph if it is actually in the embedded font - // file or if there isn't a font file so the fallback font is shown. - if (glyph.isInFont || font.missingFile) { - if (simpleFillText && !accent) { - // common case - ctx.fillText(character, scaledX, scaledY); - } else { - this.paintChar(character, scaledX, scaledY); - if (accent) { - scaledAccentX = scaledX + accent.offset.x / fontSizeScale; - scaledAccentY = scaledY - accent.offset.y / fontSizeScale; - this.paintChar(accent.fontChar, scaledAccentX, scaledAccentY); - } - } - } - - var charWidth = width * widthAdvanceScale + spacing * fontDirection; - x += charWidth; - - if (restoreNeeded) { - ctx.restore(); - } - } - if (vertical) { - current.y -= x * textHScale; - } else { - current.x += x * textHScale; - } - ctx.restore(); - }, - - showType3Text: function CanvasGraphics_showType3Text(glyphs) { - // Type3 fonts - each glyph is a "mini-PDF" - var ctx = this.ctx; - var current = this.current; - var font = current.font; - var fontSize = current.fontSize; - var fontDirection = current.fontDirection; - var spacingDir = font.vertical ? 1 : -1; - var charSpacing = current.charSpacing; - var wordSpacing = current.wordSpacing; - var textHScale = current.textHScale * fontDirection; - var fontMatrix = current.fontMatrix || FONT_IDENTITY_MATRIX; - var glyphsLength = glyphs.length; - var isTextInvisible = - current.textRenderingMode === TextRenderingMode.INVISIBLE; - var i, glyph, width, spacingLength; - - if (isTextInvisible || fontSize === 0) { - return; - } - this.cachedGetSinglePixelWidth = null; - - ctx.save(); - ctx.transform.apply(ctx, current.textMatrix); - ctx.translate(current.x, current.y); - - ctx.scale(textHScale, fontDirection); - - for (i = 0; i < glyphsLength; ++i) { - glyph = glyphs[i]; - if (isNum(glyph)) { - spacingLength = spacingDir * glyph * fontSize / 1000; - this.ctx.translate(spacingLength, 0); - current.x += spacingLength * textHScale; - continue; - } - - var spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; - var operatorList = font.charProcOperatorList[glyph.operatorListId]; - if (!operatorList) { - warn('Type3 character \"' + glyph.operatorListId + - '\" is not available'); - continue; - } - this.processingType3 = glyph; - this.save(); - ctx.scale(fontSize, fontSize); - ctx.transform.apply(ctx, fontMatrix); - this.executeOperatorList(operatorList); - this.restore(); - - var transformed = Util.applyTransform([glyph.width, 0], fontMatrix); - width = transformed[0] * fontSize + spacing; - - ctx.translate(width, 0); - current.x += width * textHScale; - } - ctx.restore(); - this.processingType3 = null; - }, - - // Type3 fonts - setCharWidth: function CanvasGraphics_setCharWidth(xWidth, yWidth) { - // We can safely ignore this since the width should be the same - // as the width in the Widths array. - }, - setCharWidthAndBounds: function CanvasGraphics_setCharWidthAndBounds(xWidth, - yWidth, - llx, - lly, - urx, - ury) { - // TODO According to the spec we're also suppose to ignore any operators - // that set color or include images while processing this type3 font. - this.ctx.rect(llx, lly, urx - llx, ury - lly); - this.clip(); - this.endPath(); - }, - - // Color - getColorN_Pattern: function CanvasGraphics_getColorN_Pattern(IR) { - var pattern; - if (IR[0] === 'TilingPattern') { - var color = IR[1]; - var baseTransform = this.baseTransform || - this.ctx.mozCurrentTransform.slice(); - var self = this; - var canvasGraphicsFactory = { - createCanvasGraphics: function (ctx) { - return new CanvasGraphics(ctx, self.commonObjs, self.objs); - } - }; - pattern = new TilingPattern(IR, color, this.ctx, canvasGraphicsFactory, - baseTransform); - } else { - pattern = getShadingPatternFromIR(IR); - } - return pattern; - }, - setStrokeColorN: function CanvasGraphics_setStrokeColorN(/*...*/) { - this.current.strokeColor = this.getColorN_Pattern(arguments); - }, - setFillColorN: function CanvasGraphics_setFillColorN(/*...*/) { - this.current.fillColor = this.getColorN_Pattern(arguments); - this.current.patternFill = true; - }, - setStrokeRGBColor: function CanvasGraphics_setStrokeRGBColor(r, g, b) { - var color = Util.makeCssRgb(r, g, b); - this.ctx.strokeStyle = color; - this.current.strokeColor = color; - }, - setFillRGBColor: function CanvasGraphics_setFillRGBColor(r, g, b) { - var color = Util.makeCssRgb(r, g, b); - this.ctx.fillStyle = color; - this.current.fillColor = color; - this.current.patternFill = false; - }, - - shadingFill: function CanvasGraphics_shadingFill(patternIR) { - var ctx = this.ctx; - - this.save(); - var pattern = getShadingPatternFromIR(patternIR); - ctx.fillStyle = pattern.getPattern(ctx, this, true); - - var inv = ctx.mozCurrentTransformInverse; - if (inv) { - var canvas = ctx.canvas; - var width = canvas.width; - var height = canvas.height; - - var bl = Util.applyTransform([0, 0], inv); - var br = Util.applyTransform([0, height], inv); - var ul = Util.applyTransform([width, 0], inv); - var ur = Util.applyTransform([width, height], inv); - - var x0 = Math.min(bl[0], br[0], ul[0], ur[0]); - var y0 = Math.min(bl[1], br[1], ul[1], ur[1]); - var x1 = Math.max(bl[0], br[0], ul[0], ur[0]); - var y1 = Math.max(bl[1], br[1], ul[1], ur[1]); - - this.ctx.fillRect(x0, y0, x1 - x0, y1 - y0); - } else { - // HACK to draw the gradient onto an infinite rectangle. - // PDF gradients are drawn across the entire image while - // Canvas only allows gradients to be drawn in a rectangle - // The following bug should allow us to remove this. - // https://bugzilla.mozilla.org/show_bug.cgi?id=664884 - - this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10); - } - - this.restore(); - }, - - // Images - beginInlineImage: function CanvasGraphics_beginInlineImage() { - error('Should not call beginInlineImage'); - }, - beginImageData: function CanvasGraphics_beginImageData() { - error('Should not call beginImageData'); - }, - - paintFormXObjectBegin: function CanvasGraphics_paintFormXObjectBegin(matrix, - bbox) { - this.save(); - this.baseTransformStack.push(this.baseTransform); - - if (isArray(matrix) && 6 === matrix.length) { - this.transform.apply(this, matrix); - } - - this.baseTransform = this.ctx.mozCurrentTransform; - - if (isArray(bbox) && 4 === bbox.length) { - var width = bbox[2] - bbox[0]; - var height = bbox[3] - bbox[1]; - this.ctx.rect(bbox[0], bbox[1], width, height); - this.clip(); - this.endPath(); - } - }, - - paintFormXObjectEnd: function CanvasGraphics_paintFormXObjectEnd() { - this.restore(); - this.baseTransform = this.baseTransformStack.pop(); - }, - - beginGroup: function CanvasGraphics_beginGroup(group) { - this.save(); - var currentCtx = this.ctx; - // TODO non-isolated groups - according to Rik at adobe non-isolated - // group results aren't usually that different and they even have tools - // that ignore this setting. Notes from Rik on implementing: - // - When you encounter an transparency group, create a new canvas with - // the dimensions of the bbox - // - copy the content from the previous canvas to the new canvas - // - draw as usual - // - remove the backdrop alpha: - // alphaNew = 1 - (1 - alpha)/(1 - alphaBackdrop) with 'alpha' the alpha - // value of your transparency group and 'alphaBackdrop' the alpha of the - // backdrop - // - remove background color: - // colorNew = color - alphaNew *colorBackdrop /(1 - alphaNew) - if (!group.isolated) { - info('TODO: Support non-isolated groups.'); - } - - // TODO knockout - supposedly possible with the clever use of compositing - // modes. - if (group.knockout) { - warn('Knockout groups not supported.'); - } - - var currentTransform = currentCtx.mozCurrentTransform; - if (group.matrix) { - currentCtx.transform.apply(currentCtx, group.matrix); - } - assert(group.bbox, 'Bounding box is required.'); - - // Based on the current transform figure out how big the bounding box - // will actually be. - var bounds = Util.getAxialAlignedBoundingBox( - group.bbox, - currentCtx.mozCurrentTransform); - // Clip the bounding box to the current canvas. - var canvasBounds = [0, - 0, - currentCtx.canvas.width, - currentCtx.canvas.height]; - bounds = Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0]; - // Use ceil in case we're between sizes so we don't create canvas that is - // too small and make the canvas at least 1x1 pixels. - var offsetX = Math.floor(bounds[0]); - var offsetY = Math.floor(bounds[1]); - var drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1); - var drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1); - var scaleX = 1, scaleY = 1; - if (drawnWidth > MAX_GROUP_SIZE) { - scaleX = drawnWidth / MAX_GROUP_SIZE; - drawnWidth = MAX_GROUP_SIZE; - } - if (drawnHeight > MAX_GROUP_SIZE) { - scaleY = drawnHeight / MAX_GROUP_SIZE; - drawnHeight = MAX_GROUP_SIZE; - } - - var cacheId = 'groupAt' + this.groupLevel; - if (group.smask) { - // Using two cache entries is case if masks are used one after another. - cacheId += '_smask_' + ((this.smaskCounter++) % 2); - } - var scratchCanvas = this.cachedCanvases.getCanvas( - cacheId, drawnWidth, drawnHeight, true); - var groupCtx = scratchCanvas.context; - - // Since we created a new canvas that is just the size of the bounding box - // we have to translate the group ctx. - groupCtx.scale(1 / scaleX, 1 / scaleY); - groupCtx.translate(-offsetX, -offsetY); - groupCtx.transform.apply(groupCtx, currentTransform); - - if (group.smask) { - // Saving state and cached mask to be used in setGState. - this.smaskStack.push({ - canvas: scratchCanvas.canvas, - context: groupCtx, - offsetX: offsetX, - offsetY: offsetY, - scaleX: scaleX, - scaleY: scaleY, - subtype: group.smask.subtype, - backdrop: group.smask.backdrop, - transferMap: group.smask.transferMap || null, - startTransformInverse: null, // used during suspend operation - }); - } else { - // Setup the current ctx so when the group is popped we draw it at the - // right location. - currentCtx.setTransform(1, 0, 0, 1, 0, 0); - currentCtx.translate(offsetX, offsetY); - currentCtx.scale(scaleX, scaleY); - } - // The transparency group inherits all off the current graphics state - // except the blend mode, soft mask, and alpha constants. - copyCtxState(currentCtx, groupCtx); - this.ctx = groupCtx; - this.setGState([ - ['BM', 'Normal'], - ['ca', 1], - ['CA', 1] - ]); - this.groupStack.push(currentCtx); - this.groupLevel++; - - // Reseting mask state, masks will be applied on restore of the group. - this.current.activeSMask = null; - }, - - endGroup: function CanvasGraphics_endGroup(group) { - this.groupLevel--; - var groupCtx = this.ctx; - this.ctx = this.groupStack.pop(); - // Turn off image smoothing to avoid sub pixel interpolation which can - // look kind of blurry for some pdfs. - if (this.ctx.imageSmoothingEnabled !== undefined) { - this.ctx.imageSmoothingEnabled = false; - } else { - this.ctx.mozImageSmoothingEnabled = false; - } - if (group.smask) { - this.tempSMask = this.smaskStack.pop(); - } else { - this.ctx.drawImage(groupCtx.canvas, 0, 0); - } - this.restore(); - }, - - beginAnnotations: function CanvasGraphics_beginAnnotations() { - this.save(); - this.current = new CanvasExtraState(); - - if (this.baseTransform) { - this.ctx.setTransform.apply(this.ctx, this.baseTransform); - } - }, - - endAnnotations: function CanvasGraphics_endAnnotations() { - this.restore(); - }, - - beginAnnotation: function CanvasGraphics_beginAnnotation(rect, transform, - matrix) { - this.save(); - - if (isArray(rect) && 4 === rect.length) { - var width = rect[2] - rect[0]; - var height = rect[3] - rect[1]; - this.ctx.rect(rect[0], rect[1], width, height); - this.clip(); - this.endPath(); - } - - this.transform.apply(this, transform); - this.transform.apply(this, matrix); - }, - - endAnnotation: function CanvasGraphics_endAnnotation() { - this.restore(); - }, - - paintJpegXObject: function CanvasGraphics_paintJpegXObject(objId, w, h) { - var domImage = this.objs.get(objId); - if (!domImage) { - warn('Dependent image isn\'t ready yet'); - return; - } - - this.save(); - - var ctx = this.ctx; - // scale the image to the unit square - ctx.scale(1 / w, -1 / h); - - ctx.drawImage(domImage, 0, 0, domImage.width, domImage.height, - 0, -h, w, h); - if (this.imageLayer) { - var currentTransform = ctx.mozCurrentTransformInverse; - var position = this.getCanvasPosition(0, 0); - this.imageLayer.appendImage({ - objId: objId, - left: position[0], - top: position[1], - width: w / currentTransform[0], - height: h / currentTransform[3] - }); - } - this.restore(); - }, - - paintImageMaskXObject: function CanvasGraphics_paintImageMaskXObject(img) { - var ctx = this.ctx; - var width = img.width, height = img.height; - var fillColor = this.current.fillColor; - var isPatternFill = this.current.patternFill; - - var glyph = this.processingType3; - - if (COMPILE_TYPE3_GLYPHS && glyph && glyph.compiled === undefined) { - if (width <= MAX_SIZE_TO_COMPILE && height <= MAX_SIZE_TO_COMPILE) { - glyph.compiled = - compileType3Glyph({data: img.data, width: width, height: height}); - } else { - glyph.compiled = null; - } - } - - if (glyph && glyph.compiled) { - glyph.compiled(ctx); - return; - } - - var maskCanvas = this.cachedCanvases.getCanvas('maskCanvas', - width, height); - var maskCtx = maskCanvas.context; - maskCtx.save(); - - putBinaryImageMask(maskCtx, img); - - maskCtx.globalCompositeOperation = 'source-in'; - - maskCtx.fillStyle = isPatternFill ? - fillColor.getPattern(maskCtx, this) : fillColor; - maskCtx.fillRect(0, 0, width, height); - - maskCtx.restore(); - - this.paintInlineImageXObject(maskCanvas.canvas); - }, - - paintImageMaskXObjectRepeat: - function CanvasGraphics_paintImageMaskXObjectRepeat(imgData, scaleX, - scaleY, positions) { - var width = imgData.width; - var height = imgData.height; - var fillColor = this.current.fillColor; - var isPatternFill = this.current.patternFill; - - var maskCanvas = this.cachedCanvases.getCanvas('maskCanvas', - width, height); - var maskCtx = maskCanvas.context; - maskCtx.save(); - - putBinaryImageMask(maskCtx, imgData); - - maskCtx.globalCompositeOperation = 'source-in'; - - maskCtx.fillStyle = isPatternFill ? - fillColor.getPattern(maskCtx, this) : fillColor; - maskCtx.fillRect(0, 0, width, height); - - maskCtx.restore(); - - var ctx = this.ctx; - for (var i = 0, ii = positions.length; i < ii; i += 2) { - ctx.save(); - ctx.transform(scaleX, 0, 0, scaleY, positions[i], positions[i + 1]); - ctx.scale(1, -1); - ctx.drawImage(maskCanvas.canvas, 0, 0, width, height, - 0, -1, 1, 1); - ctx.restore(); - } - }, - - paintImageMaskXObjectGroup: - function CanvasGraphics_paintImageMaskXObjectGroup(images) { - var ctx = this.ctx; - - var fillColor = this.current.fillColor; - var isPatternFill = this.current.patternFill; - for (var i = 0, ii = images.length; i < ii; i++) { - var image = images[i]; - var width = image.width, height = image.height; - - var maskCanvas = this.cachedCanvases.getCanvas('maskCanvas', - width, height); - var maskCtx = maskCanvas.context; - maskCtx.save(); - - putBinaryImageMask(maskCtx, image); - - maskCtx.globalCompositeOperation = 'source-in'; - - maskCtx.fillStyle = isPatternFill ? - fillColor.getPattern(maskCtx, this) : fillColor; - maskCtx.fillRect(0, 0, width, height); - - maskCtx.restore(); - - ctx.save(); - ctx.transform.apply(ctx, image.transform); - ctx.scale(1, -1); - ctx.drawImage(maskCanvas.canvas, 0, 0, width, height, - 0, -1, 1, 1); - ctx.restore(); - } - }, - - paintImageXObject: function CanvasGraphics_paintImageXObject(objId) { - var imgData = this.objs.get(objId); - if (!imgData) { - warn('Dependent image isn\'t ready yet'); - return; - } - - this.paintInlineImageXObject(imgData); - }, - - paintImageXObjectRepeat: - function CanvasGraphics_paintImageXObjectRepeat(objId, scaleX, scaleY, - positions) { - var imgData = this.objs.get(objId); - if (!imgData) { - warn('Dependent image isn\'t ready yet'); - return; - } - - var width = imgData.width; - var height = imgData.height; - var map = []; - for (var i = 0, ii = positions.length; i < ii; i += 2) { - map.push({transform: [scaleX, 0, 0, scaleY, positions[i], - positions[i + 1]], x: 0, y: 0, w: width, h: height}); - } - this.paintInlineImageXObjectGroup(imgData, map); - }, - - paintInlineImageXObject: - function CanvasGraphics_paintInlineImageXObject(imgData) { - var width = imgData.width; - var height = imgData.height; - var ctx = this.ctx; - - this.save(); - // scale the image to the unit square - ctx.scale(1 / width, -1 / height); - - var currentTransform = ctx.mozCurrentTransformInverse; - var a = currentTransform[0], b = currentTransform[1]; - var widthScale = Math.max(Math.sqrt(a * a + b * b), 1); - var c = currentTransform[2], d = currentTransform[3]; - var heightScale = Math.max(Math.sqrt(c * c + d * d), 1); - - var imgToPaint, tmpCanvas; - // instanceof HTMLElement does not work in jsdom node.js module - if (imgData instanceof HTMLElement || !imgData.data) { - imgToPaint = imgData; - } else { - tmpCanvas = this.cachedCanvases.getCanvas('inlineImage', - width, height); - var tmpCtx = tmpCanvas.context; - putBinaryImageData(tmpCtx, imgData); - imgToPaint = tmpCanvas.canvas; - } - - var paintWidth = width, paintHeight = height; - var tmpCanvasId = 'prescale1'; - // Vertial or horizontal scaling shall not be more than 2 to not loose the - // pixels during drawImage operation, painting on the temporary canvas(es) - // that are twice smaller in size - while ((widthScale > 2 && paintWidth > 1) || - (heightScale > 2 && paintHeight > 1)) { - var newWidth = paintWidth, newHeight = paintHeight; - if (widthScale > 2 && paintWidth > 1) { - newWidth = Math.ceil(paintWidth / 2); - widthScale /= paintWidth / newWidth; - } - if (heightScale > 2 && paintHeight > 1) { - newHeight = Math.ceil(paintHeight / 2); - heightScale /= paintHeight / newHeight; - } - tmpCanvas = this.cachedCanvases.getCanvas(tmpCanvasId, - newWidth, newHeight); - tmpCtx = tmpCanvas.context; - tmpCtx.clearRect(0, 0, newWidth, newHeight); - tmpCtx.drawImage(imgToPaint, 0, 0, paintWidth, paintHeight, - 0, 0, newWidth, newHeight); - imgToPaint = tmpCanvas.canvas; - paintWidth = newWidth; - paintHeight = newHeight; - tmpCanvasId = tmpCanvasId === 'prescale1' ? 'prescale2' : 'prescale1'; - } - ctx.drawImage(imgToPaint, 0, 0, paintWidth, paintHeight, - 0, -height, width, height); - - if (this.imageLayer) { - var position = this.getCanvasPosition(0, -height); - this.imageLayer.appendImage({ - imgData: imgData, - left: position[0], - top: position[1], - width: width / currentTransform[0], - height: height / currentTransform[3] - }); - } - this.restore(); - }, - - paintInlineImageXObjectGroup: - function CanvasGraphics_paintInlineImageXObjectGroup(imgData, map) { - var ctx = this.ctx; - var w = imgData.width; - var h = imgData.height; - - var tmpCanvas = this.cachedCanvases.getCanvas('inlineImage', w, h); - var tmpCtx = tmpCanvas.context; - putBinaryImageData(tmpCtx, imgData); - - for (var i = 0, ii = map.length; i < ii; i++) { - var entry = map[i]; - ctx.save(); - ctx.transform.apply(ctx, entry.transform); - ctx.scale(1, -1); - ctx.drawImage(tmpCanvas.canvas, entry.x, entry.y, entry.w, entry.h, - 0, -1, 1, 1); - if (this.imageLayer) { - var position = this.getCanvasPosition(entry.x, entry.y); - this.imageLayer.appendImage({ - imgData: imgData, - left: position[0], - top: position[1], - width: w, - height: h - }); - } - ctx.restore(); - } - }, - - paintSolidColorImageMask: - function CanvasGraphics_paintSolidColorImageMask() { - this.ctx.fillRect(0, 0, 1, 1); - }, - - paintXObject: function CanvasGraphics_paintXObject() { - warn('Unsupported \'paintXObject\' command.'); - }, - - // Marked content - - markPoint: function CanvasGraphics_markPoint(tag) { - // TODO Marked content. - }, - markPointProps: function CanvasGraphics_markPointProps(tag, properties) { - // TODO Marked content. - }, - beginMarkedContent: function CanvasGraphics_beginMarkedContent(tag) { - // TODO Marked content. - }, - beginMarkedContentProps: function CanvasGraphics_beginMarkedContentProps( - tag, properties) { - // TODO Marked content. - }, - endMarkedContent: function CanvasGraphics_endMarkedContent() { - // TODO Marked content. - }, - - // Compatibility - - beginCompat: function CanvasGraphics_beginCompat() { - // TODO ignore undefined operators (should we do that anyway?) - }, - endCompat: function CanvasGraphics_endCompat() { - // TODO stop ignoring undefined operators - }, - - // Helper functions - - consumePath: function CanvasGraphics_consumePath() { - var ctx = this.ctx; - if (this.pendingClip) { - if (this.pendingClip === EO_CLIP) { - if (ctx.mozFillRule !== undefined) { - ctx.mozFillRule = 'evenodd'; - ctx.clip(); - ctx.mozFillRule = 'nonzero'; - } else { - ctx.clip('evenodd'); - } - } else { - ctx.clip(); - } - this.pendingClip = null; - } - ctx.beginPath(); - }, - getSinglePixelWidth: function CanvasGraphics_getSinglePixelWidth(scale) { - if (this.cachedGetSinglePixelWidth === null) { - // NOTE: The `save` and `restore` commands used below is a workaround - // that is necessary in order to prevent `mozCurrentTransformInverse` - // from intermittently returning incorrect values in Firefox, see: - // https://github.com/mozilla/pdf.js/issues/7188. - this.ctx.save(); - var inverse = this.ctx.mozCurrentTransformInverse; - this.ctx.restore(); - // max of the current horizontal and vertical scale - this.cachedGetSinglePixelWidth = Math.sqrt(Math.max( - (inverse[0] * inverse[0] + inverse[1] * inverse[1]), - (inverse[2] * inverse[2] + inverse[3] * inverse[3]))); - } - return this.cachedGetSinglePixelWidth; - }, - getCanvasPosition: function CanvasGraphics_getCanvasPosition(x, y) { - var transform = this.ctx.mozCurrentTransform; - return [ - transform[0] * x + transform[2] * y + transform[4], - transform[1] * x + transform[3] * y + transform[5] - ]; - } - }; - - for (var op in OPS) { - CanvasGraphics.prototype[OPS[op]] = CanvasGraphics.prototype[op]; - } - - return CanvasGraphics; -})(); - -exports.CanvasGraphics = CanvasGraphics; -exports.createScratchCanvas = createScratchCanvas; -})); - - -(function (root, factory) { - { - factory((root.pdfjsDisplayAPI = {}), root.pdfjsSharedUtil, - root.pdfjsDisplayFontLoader, root.pdfjsDisplayCanvas, - root.pdfjsDisplayMetadata, root.pdfjsDisplayDOMUtils); - } -}(this, function (exports, sharedUtil, displayFontLoader, displayCanvas, - displayMetadata, displayDOMUtils, amdRequire) { - -var InvalidPDFException = sharedUtil.InvalidPDFException; -var MessageHandler = sharedUtil.MessageHandler; -var MissingPDFException = sharedUtil.MissingPDFException; -var PageViewport = sharedUtil.PageViewport; -var PasswordResponses = sharedUtil.PasswordResponses; -var PasswordException = sharedUtil.PasswordException; -var StatTimer = sharedUtil.StatTimer; -var UnexpectedResponseException = sharedUtil.UnexpectedResponseException; -var UnknownErrorException = sharedUtil.UnknownErrorException; -var Util = sharedUtil.Util; -var createPromiseCapability = sharedUtil.createPromiseCapability; -var error = sharedUtil.error; -var deprecated = sharedUtil.deprecated; -var getVerbosityLevel = sharedUtil.getVerbosityLevel; -var info = sharedUtil.info; -var isInt = sharedUtil.isInt; -var isArray = sharedUtil.isArray; -var isArrayBuffer = sharedUtil.isArrayBuffer; -var isSameOrigin = sharedUtil.isSameOrigin; -var loadJpegStream = sharedUtil.loadJpegStream; -var stringToBytes = sharedUtil.stringToBytes; -var globalScope = sharedUtil.globalScope; -var warn = sharedUtil.warn; -var FontFaceObject = displayFontLoader.FontFaceObject; -var FontLoader = displayFontLoader.FontLoader; -var CanvasGraphics = displayCanvas.CanvasGraphics; -var createScratchCanvas = displayCanvas.createScratchCanvas; -var Metadata = displayMetadata.Metadata; -var getDefaultSetting = displayDOMUtils.getDefaultSetting; - -var DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536 - -var isWorkerDisabled = false; -var workerSrc; -var isPostMessageTransfersDisabled = false; - - -var useRequireEnsure = false; -if (typeof window === 'undefined') { - // node.js - disable worker and set require.ensure. - isWorkerDisabled = true; - if (typeof require.ensure === 'undefined') { - require.ensure = require('node-ensure'); - } - useRequireEnsure = true; -} -if (typeof __webpack_require__ !== 'undefined') { - useRequireEnsure = true; -} -if (typeof requirejs !== 'undefined' && requirejs.toUrl) { - workerSrc = requirejs.toUrl('pdfjs-dist/build/pdf.worker.js'); -} -var dynamicLoaderSupported = typeof requirejs !== 'undefined' && requirejs.load; -var fakeWorkerFilesLoader = useRequireEnsure ? (function (callback) { - require.ensure([], function () { - var worker = require('./pdf.worker.js'); - callback(worker.WorkerMessageHandler); - }); -}) : dynamicLoaderSupported ? (function (callback) { - requirejs(['pdfjs-dist/build/pdf.worker'], function (worker) { - callback(worker.WorkerMessageHandler); - }); -}) : null; - - -/** - * Document initialization / loading parameters object. - * - * @typedef {Object} DocumentInitParameters - * @property {string} url - The URL of the PDF. - * @property {TypedArray|Array|string} data - Binary PDF data. Use typed arrays - * (Uint8Array) to improve the memory usage. If PDF data is BASE64-encoded, - * use atob() to convert it to a binary string first. - * @property {Object} httpHeaders - Basic authentication headers. - * @property {boolean} withCredentials - Indicates whether or not cross-site - * Access-Control requests should be made using credentials such as cookies - * or authorization headers. The default is false. - * @property {string} password - For decrypting password-protected PDFs. - * @property {TypedArray} initialData - A typed array with the first portion or - * all of the pdf data. Used by the extension since some data is already - * loaded before the switch to range requests. - * @property {number} length - The PDF file length. It's used for progress - * reports and range requests operations. - * @property {PDFDataRangeTransport} range - * @property {number} rangeChunkSize - Optional parameter to specify - * maximum number of bytes fetched per range request. The default value is - * 2^16 = 65536. - * @property {PDFWorker} worker - The worker that will be used for the loading - * and parsing of the PDF data. - */ - -/** - * @typedef {Object} PDFDocumentStats - * @property {Array} streamTypes - Used stream types in the document (an item - * is set to true if specific stream ID was used in the document). - * @property {Array} fontTypes - Used font type in the document (an item is set - * to true if specific font ID was used in the document). - */ - -/** - * This is the main entry point for loading a PDF and interacting with it. - * NOTE: If a URL is used to fetch the PDF data a standard XMLHttpRequest(XHR) - * is used, which means it must follow the same origin rules that any XHR does - * e.g. No cross domain requests without CORS. - * - * @param {string|TypedArray|DocumentInitParameters|PDFDataRangeTransport} src - * Can be a url to where a PDF is located, a typed array (Uint8Array) - * already populated with data or parameter object. - * - * @param {PDFDataRangeTransport} pdfDataRangeTransport (deprecated) It is used - * if you want to manually serve range requests for data in the PDF. - * - * @param {function} passwordCallback (deprecated) It is used to request a - * password if wrong or no password was provided. The callback receives two - * parameters: function that needs to be called with new password and reason - * (see {PasswordResponses}). - * - * @param {function} progressCallback (deprecated) It is used to be able to - * monitor the loading progress of the PDF file (necessary to implement e.g. - * a loading bar). The callback receives an {Object} with the properties: - * {number} loaded and {number} total. - * - * @return {PDFDocumentLoadingTask} - */ -function getDocument(src, pdfDataRangeTransport, - passwordCallback, progressCallback) { - var task = new PDFDocumentLoadingTask(); - - // Support of the obsolete arguments (for compatibility with API v1.0) - if (arguments.length > 1) { - deprecated('getDocument is called with pdfDataRangeTransport, ' + - 'passwordCallback or progressCallback argument'); - } - if (pdfDataRangeTransport) { - if (!(pdfDataRangeTransport instanceof PDFDataRangeTransport)) { - // Not a PDFDataRangeTransport instance, trying to add missing properties. - pdfDataRangeTransport = Object.create(pdfDataRangeTransport); - pdfDataRangeTransport.length = src.length; - pdfDataRangeTransport.initialData = src.initialData; - if (!pdfDataRangeTransport.abort) { - pdfDataRangeTransport.abort = function () {}; - } - } - src = Object.create(src); - src.range = pdfDataRangeTransport; - } - task.onPassword = passwordCallback || null; - task.onProgress = progressCallback || null; - - var source; - if (typeof src === 'string') { - source = { url: src }; - } else if (isArrayBuffer(src)) { - source = { data: src }; - } else if (src instanceof PDFDataRangeTransport) { - source = { range: src }; - } else { - if (typeof src !== 'object') { - error('Invalid parameter in getDocument, need either Uint8Array, ' + - 'string or a parameter object'); - } - if (!src.url && !src.data && !src.range) { - error('Invalid parameter object: need either .data, .range or .url'); - } - - source = src; - } - - var params = {}; - var rangeTransport = null; - var worker = null; - for (var key in source) { - if (key === 'url' && typeof window !== 'undefined') { - // The full path is required in the 'url' field. - params[key] = new URL(source[key], window.location).href; - continue; - } else if (key === 'range') { - rangeTransport = source[key]; - continue; - } else if (key === 'worker') { - worker = source[key]; - continue; - } else if (key === 'data' && !(source[key] instanceof Uint8Array)) { - // Converting string or array-like data to Uint8Array. - var pdfBytes = source[key]; - if (typeof pdfBytes === 'string') { - params[key] = stringToBytes(pdfBytes); - } else if (typeof pdfBytes === 'object' && pdfBytes !== null && - !isNaN(pdfBytes.length)) { - params[key] = new Uint8Array(pdfBytes); - } else if (isArrayBuffer(pdfBytes)) { - params[key] = new Uint8Array(pdfBytes); - } else { - error('Invalid PDF binary data: either typed array, string or ' + - 'array-like object is expected in the data property.'); - } - continue; - } - params[key] = source[key]; - } - - params.rangeChunkSize = params.rangeChunkSize || DEFAULT_RANGE_CHUNK_SIZE; - - if (!worker) { - // Worker was not provided -- creating and owning our own. - worker = new PDFWorker(); - task._worker = worker; - } - var docId = task.docId; - worker.promise.then(function () { - if (task.destroyed) { - throw new Error('Loading aborted'); - } - return _fetchDocument(worker, params, rangeTransport, docId).then( - function (workerId) { - if (task.destroyed) { - throw new Error('Loading aborted'); - } - var messageHandler = new MessageHandler(docId, workerId, worker.port); - var transport = new WorkerTransport(messageHandler, task, rangeTransport); - task._transport = transport; - messageHandler.send('Ready', null); - }); - }).catch(task._capability.reject); - - return task; -} - -/** - * Starts fetching of specified PDF document/data. - * @param {PDFWorker} worker - * @param {Object} source - * @param {PDFDataRangeTransport} pdfDataRangeTransport - * @param {string} docId Unique document id, used as MessageHandler id. - * @returns {Promise} The promise, which is resolved when worker id of - * MessageHandler is known. - * @private - */ -function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { - if (worker.destroyed) { - return Promise.reject(new Error('Worker was destroyed')); - } - - source.disableAutoFetch = getDefaultSetting('disableAutoFetch'); - source.disableStream = getDefaultSetting('disableStream'); - source.chunkedViewerLoading = !!pdfDataRangeTransport; - if (pdfDataRangeTransport) { - source.length = pdfDataRangeTransport.length; - source.initialData = pdfDataRangeTransport.initialData; - } - return worker.messageHandler.sendWithPromise('GetDocRequest', { - docId: docId, - source: source, - disableRange: getDefaultSetting('disableRange'), - maxImageSize: getDefaultSetting('maxImageSize'), - cMapUrl: getDefaultSetting('cMapUrl'), - cMapPacked: getDefaultSetting('cMapPacked'), - disableFontFace: getDefaultSetting('disableFontFace'), - disableCreateObjectURL: getDefaultSetting('disableCreateObjectURL'), - postMessageTransfers: getDefaultSetting('postMessageTransfers') && - !isPostMessageTransfersDisabled, - }).then(function (workerId) { - if (worker.destroyed) { - throw new Error('Worker was destroyed'); - } - return workerId; - }); -} - -/** - * PDF document loading operation. - * @class - * @alias PDFDocumentLoadingTask - */ -var PDFDocumentLoadingTask = (function PDFDocumentLoadingTaskClosure() { - var nextDocumentId = 0; - - /** @constructs PDFDocumentLoadingTask */ - function PDFDocumentLoadingTask() { - this._capability = createPromiseCapability(); - this._transport = null; - this._worker = null; - - /** - * Unique document loading task id -- used in MessageHandlers. - * @type {string} - */ - this.docId = 'd' + (nextDocumentId++); - - /** - * Shows if loading task is destroyed. - * @type {boolean} - */ - this.destroyed = false; - - /** - * Callback to request a password if wrong or no password was provided. - * The callback receives two parameters: function that needs to be called - * with new password and reason (see {PasswordResponses}). - */ - this.onPassword = null; - - /** - * Callback to be able to monitor the loading progress of the PDF file - * (necessary to implement e.g. a loading bar). The callback receives - * an {Object} with the properties: {number} loaded and {number} total. - */ - this.onProgress = null; - - /** - * Callback to when unsupported feature is used. The callback receives - * an {UNSUPPORTED_FEATURES} argument. - */ - this.onUnsupportedFeature = null; - } - - PDFDocumentLoadingTask.prototype = - /** @lends PDFDocumentLoadingTask.prototype */ { - /** - * @return {Promise} - */ - get promise() { - return this._capability.promise; - }, - - /** - * Aborts all network requests and destroys worker. - * @return {Promise} A promise that is resolved after destruction activity - * is completed. - */ - destroy: function () { - this.destroyed = true; - - var transportDestroyed = !this._transport ? Promise.resolve() : - this._transport.destroy(); - return transportDestroyed.then(function () { - this._transport = null; - if (this._worker) { - this._worker.destroy(); - this._worker = null; - } - }.bind(this)); - }, - - /** - * Registers callbacks to indicate the document loading completion. - * - * @param {function} onFulfilled The callback for the loading completion. - * @param {function} onRejected The callback for the loading failure. - * @return {Promise} A promise that is resolved after the onFulfilled or - * onRejected callback. - */ - then: function PDFDocumentLoadingTask_then(onFulfilled, onRejected) { - return this.promise.then.apply(this.promise, arguments); - } - }; - - return PDFDocumentLoadingTask; -})(); - -/** - * Abstract class to support range requests file loading. - * @class - * @alias PDFDataRangeTransport - * @param {number} length - * @param {Uint8Array} initialData - */ -var PDFDataRangeTransport = (function pdfDataRangeTransportClosure() { - function PDFDataRangeTransport(length, initialData) { - this.length = length; - this.initialData = initialData; - - this._rangeListeners = []; - this._progressListeners = []; - this._progressiveReadListeners = []; - this._readyCapability = createPromiseCapability(); - } - PDFDataRangeTransport.prototype = - /** @lends PDFDataRangeTransport.prototype */ { - addRangeListener: - function PDFDataRangeTransport_addRangeListener(listener) { - this._rangeListeners.push(listener); - }, - - addProgressListener: - function PDFDataRangeTransport_addProgressListener(listener) { - this._progressListeners.push(listener); - }, - - addProgressiveReadListener: - function PDFDataRangeTransport_addProgressiveReadListener(listener) { - this._progressiveReadListeners.push(listener); - }, - - onDataRange: function PDFDataRangeTransport_onDataRange(begin, chunk) { - var listeners = this._rangeListeners; - for (var i = 0, n = listeners.length; i < n; ++i) { - listeners[i](begin, chunk); - } - }, - - onDataProgress: function PDFDataRangeTransport_onDataProgress(loaded) { - this._readyCapability.promise.then(function () { - var listeners = this._progressListeners; - for (var i = 0, n = listeners.length; i < n; ++i) { - listeners[i](loaded); - } - }.bind(this)); - }, - - onDataProgressiveRead: - function PDFDataRangeTransport_onDataProgress(chunk) { - this._readyCapability.promise.then(function () { - var listeners = this._progressiveReadListeners; - for (var i = 0, n = listeners.length; i < n; ++i) { - listeners[i](chunk); - } - }.bind(this)); - }, - - transportReady: function PDFDataRangeTransport_transportReady() { - this._readyCapability.resolve(); - }, - - requestDataRange: - function PDFDataRangeTransport_requestDataRange(begin, end) { - throw new Error('Abstract method PDFDataRangeTransport.requestDataRange'); - }, - - abort: function PDFDataRangeTransport_abort() { - } - }; - return PDFDataRangeTransport; -})(); - -/** - * Proxy to a PDFDocument in the worker thread. Also, contains commonly used - * properties that can be read synchronously. - * @class - * @alias PDFDocumentProxy - */ -var PDFDocumentProxy = (function PDFDocumentProxyClosure() { - function PDFDocumentProxy(pdfInfo, transport, loadingTask) { - this.pdfInfo = pdfInfo; - this.transport = transport; - this.loadingTask = loadingTask; - } - PDFDocumentProxy.prototype = /** @lends PDFDocumentProxy.prototype */ { - /** - * @return {number} Total number of pages the PDF contains. - */ - get numPages() { - return this.pdfInfo.numPages; - }, - /** - * @return {string} A unique ID to identify a PDF. Not guaranteed to be - * unique. - */ - get fingerprint() { - return this.pdfInfo.fingerprint; - }, - /** - * @param {number} pageNumber The page number to get. The first page is 1. - * @return {Promise} A promise that is resolved with a {@link PDFPageProxy} - * object. - */ - getPage: function PDFDocumentProxy_getPage(pageNumber) { - return this.transport.getPage(pageNumber); - }, - /** - * @param {{num: number, gen: number}} ref The page reference. Must have - * the 'num' and 'gen' properties. - * @return {Promise} A promise that is resolved with the page index that is - * associated with the reference. - */ - getPageIndex: function PDFDocumentProxy_getPageIndex(ref) { - return this.transport.getPageIndex(ref); - }, - /** - * @return {Promise} A promise that is resolved with a lookup table for - * mapping named destinations to reference numbers. - * - * This can be slow for large documents: use getDestination instead - */ - getDestinations: function PDFDocumentProxy_getDestinations() { - return this.transport.getDestinations(); - }, - /** - * @param {string} id The named destination to get. - * @return {Promise} A promise that is resolved with all information - * of the given named destination. - */ - getDestination: function PDFDocumentProxy_getDestination(id) { - return this.transport.getDestination(id); - }, - /** - * @return {Promise} A promise that is resolved with: - * an Array containing the pageLabels that correspond to the pageIndexes, - * or `null` when no pageLabels are present in the PDF file. - */ - getPageLabels: function PDFDocumentProxy_getPageLabels() { - return this.transport.getPageLabels(); - }, - /** - * @return {Promise} A promise that is resolved with a lookup table for - * mapping named attachments to their content. - */ - getAttachments: function PDFDocumentProxy_getAttachments() { - return this.transport.getAttachments(); - }, - /** - * @return {Promise} A promise that is resolved with an array of all the - * JavaScript strings in the name tree. - */ - getJavaScript: function PDFDocumentProxy_getJavaScript() { - return this.transport.getJavaScript(); - }, - /** - * @return {Promise} A promise that is resolved with an {Array} that is a - * tree outline (if it has one) of the PDF. The tree is in the format of: - * [ - * { - * title: string, - * bold: boolean, - * italic: boolean, - * color: rgb Uint8Array, - * dest: dest obj, - * url: string, - * items: array of more items like this - * }, - * ... - * ]. - */ - getOutline: function PDFDocumentProxy_getOutline() { - return this.transport.getOutline(); - }, - /** - * @return {Promise} A promise that is resolved with an {Object} that has - * info and metadata properties. Info is an {Object} filled with anything - * available in the information dictionary and similarly metadata is a - * {Metadata} object with information from the metadata section of the PDF. - */ - getMetadata: function PDFDocumentProxy_getMetadata() { - return this.transport.getMetadata(); - }, - /** - * @return {Promise} A promise that is resolved with a TypedArray that has - * the raw data from the PDF. - */ - getData: function PDFDocumentProxy_getData() { - return this.transport.getData(); - }, - /** - * @return {Promise} A promise that is resolved when the document's data - * is loaded. It is resolved with an {Object} that contains the length - * property that indicates size of the PDF data in bytes. - */ - getDownloadInfo: function PDFDocumentProxy_getDownloadInfo() { - return this.transport.downloadInfoCapability.promise; - }, - /** - * @return {Promise} A promise this is resolved with current stats about - * document structures (see {@link PDFDocumentStats}). - */ - getStats: function PDFDocumentProxy_getStats() { - return this.transport.getStats(); - }, - /** - * Cleans up resources allocated by the document, e.g. created @font-face. - */ - cleanup: function PDFDocumentProxy_cleanup() { - this.transport.startCleanup(); - }, - /** - * Destroys current document instance and terminates worker. - */ - destroy: function PDFDocumentProxy_destroy() { - return this.loadingTask.destroy(); - } - }; - return PDFDocumentProxy; -})(); - -/** - * Page getTextContent parameters. - * - * @typedef {Object} getTextContentParameters - * @param {boolean} normalizeWhitespace - replaces all occurrences of - * whitespace with standard spaces (0x20). The default value is `false`. - * @param {boolean} disableCombineTextItems - do not attempt to combine - * same line {@link TextItem}'s. The default value is `false`. - */ - -/** - * Page text content. - * - * @typedef {Object} TextContent - * @property {array} items - array of {@link TextItem} - * @property {Object} styles - {@link TextStyles} objects, indexed by font - * name. - */ - -/** - * Page text content part. - * - * @typedef {Object} TextItem - * @property {string} str - text content. - * @property {string} dir - text direction: 'ttb', 'ltr' or 'rtl'. - * @property {array} transform - transformation matrix. - * @property {number} width - width in device space. - * @property {number} height - height in device space. - * @property {string} fontName - font name used by pdf.js for converted font. - */ - -/** - * Text style. - * - * @typedef {Object} TextStyle - * @property {number} ascent - font ascent. - * @property {number} descent - font descent. - * @property {boolean} vertical - text is in vertical mode. - * @property {string} fontFamily - possible font family - */ - -/** - * Page annotation parameters. - * - * @typedef {Object} GetAnnotationsParameters - * @param {string} intent - Determines the annotations that will be fetched, - * can be either 'display' (viewable annotations) or 'print' - * (printable annotations). - * If the parameter is omitted, all annotations are fetched. - */ - -/** - * Page render parameters. - * - * @typedef {Object} RenderParameters - * @property {Object} canvasContext - A 2D context of a DOM Canvas object. - * @property {PageViewport} viewport - Rendering viewport obtained by - * calling of PDFPage.getViewport method. - * @property {string} intent - Rendering intent, can be 'display' or 'print' - * (default value is 'display'). - * @property {boolean} renderInteractiveForms - (optional) Whether or not - * interactive form elements are rendered in the display - * layer. If so, we do not render them on canvas as well. - * @property {Array} transform - (optional) Additional transform, applied - * just before viewport transform. - * @property {Object} imageLayer - (optional) An object that has beginLayout, - * endLayout and appendImage functions. - * @property {function} continueCallback - (deprecated) A function that will be - * called each time the rendering is paused. To continue - * rendering call the function that is the first argument - * to the callback. - */ - -/** - * PDF page operator list. - * - * @typedef {Object} PDFOperatorList - * @property {Array} fnArray - Array containing the operator functions. - * @property {Array} argsArray - Array containing the arguments of the - * functions. - */ - -/** - * Proxy to a PDFPage in the worker thread. - * @class - * @alias PDFPageProxy - */ -var PDFPageProxy = (function PDFPageProxyClosure() { - function PDFPageProxy(pageIndex, pageInfo, transport) { - this.pageIndex = pageIndex; - this.pageInfo = pageInfo; - this.transport = transport; - this.stats = new StatTimer(); - this.stats.enabled = getDefaultSetting('enableStats'); - this.commonObjs = transport.commonObjs; - this.objs = new PDFObjects(); - this.cleanupAfterRender = false; - this.pendingCleanup = false; - this.intentStates = Object.create(null); - this.destroyed = false; - } - PDFPageProxy.prototype = /** @lends PDFPageProxy.prototype */ { - /** - * @return {number} Page number of the page. First page is 1. - */ - get pageNumber() { - return this.pageIndex + 1; - }, - /** - * @return {number} The number of degrees the page is rotated clockwise. - */ - get rotate() { - return this.pageInfo.rotate; - }, - /** - * @return {Object} The reference that points to this page. It has 'num' and - * 'gen' properties. - */ - get ref() { - return this.pageInfo.ref; - }, - /** - * @return {Array} An array of the visible portion of the PDF page in the - * user space units - [x1, y1, x2, y2]. - */ - get view() { - return this.pageInfo.view; - }, - /** - * @param {number} scale The desired scale of the viewport. - * @param {number} rotate Degrees to rotate the viewport. If omitted this - * defaults to the page rotation. - * @return {PageViewport} Contains 'width' and 'height' properties - * along with transforms required for rendering. - */ - getViewport: function PDFPageProxy_getViewport(scale, rotate) { - if (arguments.length < 2) { - rotate = this.rotate; - } - return new PageViewport(this.view, scale, rotate, 0, 0); - }, - /** - * @param {GetAnnotationsParameters} params - Annotation parameters. - * @return {Promise} A promise that is resolved with an {Array} of the - * annotation objects. - */ - getAnnotations: function PDFPageProxy_getAnnotations(params) { - var intent = (params && params.intent) || null; - - if (!this.annotationsPromise || this.annotationsIntent !== intent) { - this.annotationsPromise = this.transport.getAnnotations(this.pageIndex, - intent); - this.annotationsIntent = intent; - } - return this.annotationsPromise; - }, - /** - * Begins the process of rendering a page to the desired context. - * @param {RenderParameters} params Page render parameters. - * @return {RenderTask} An object that contains the promise, which - * is resolved when the page finishes rendering. - */ - render: function PDFPageProxy_render(params) { - var stats = this.stats; - stats.time('Overall'); - - // If there was a pending destroy cancel it so no cleanup happens during - // this call to render. - this.pendingCleanup = false; - - var renderingIntent = (params.intent === 'print' ? 'print' : 'display'); - var renderInteractiveForms = (params.renderInteractiveForms === true ? - true : /* Default */ false); - - if (!this.intentStates[renderingIntent]) { - this.intentStates[renderingIntent] = Object.create(null); - } - var intentState = this.intentStates[renderingIntent]; - - // If there's no displayReadyCapability yet, then the operatorList - // was never requested before. Make the request and create the promise. - if (!intentState.displayReadyCapability) { - intentState.receivingOperatorList = true; - intentState.displayReadyCapability = createPromiseCapability(); - intentState.operatorList = { - fnArray: [], - argsArray: [], - lastChunk: false - }; - - this.stats.time('Page Request'); - this.transport.messageHandler.send('RenderPageRequest', { - pageIndex: this.pageNumber - 1, - intent: renderingIntent, - renderInteractiveForms: renderInteractiveForms, - }); - } - - var internalRenderTask = new InternalRenderTask(complete, params, - this.objs, - this.commonObjs, - intentState.operatorList, - this.pageNumber); - internalRenderTask.useRequestAnimationFrame = renderingIntent !== 'print'; - if (!intentState.renderTasks) { - intentState.renderTasks = []; - } - intentState.renderTasks.push(internalRenderTask); - var renderTask = internalRenderTask.task; - - // Obsolete parameter support - if (params.continueCallback) { - deprecated('render is used with continueCallback parameter'); - renderTask.onContinue = params.continueCallback; - } - - var self = this; - intentState.displayReadyCapability.promise.then( - function pageDisplayReadyPromise(transparency) { - if (self.pendingCleanup) { - complete(); - return; - } - stats.time('Rendering'); - internalRenderTask.initializeGraphics(transparency); - internalRenderTask.operatorListChanged(); - }, - function pageDisplayReadPromiseError(reason) { - complete(reason); - } - ); - - function complete(error) { - var i = intentState.renderTasks.indexOf(internalRenderTask); - if (i >= 0) { - intentState.renderTasks.splice(i, 1); - } - - if (self.cleanupAfterRender) { - self.pendingCleanup = true; - } - self._tryCleanup(); - - if (error) { - internalRenderTask.capability.reject(error); - } else { - internalRenderTask.capability.resolve(); - } - stats.timeEnd('Rendering'); - stats.timeEnd('Overall'); - } - - return renderTask; - }, - - /** - * @return {Promise} A promise resolved with an {@link PDFOperatorList} - * object that represents page's operator list. - */ - getOperatorList: function PDFPageProxy_getOperatorList() { - function operatorListChanged() { - if (intentState.operatorList.lastChunk) { - intentState.opListReadCapability.resolve(intentState.operatorList); - - var i = intentState.renderTasks.indexOf(opListTask); - if (i >= 0) { - intentState.renderTasks.splice(i, 1); - } - } - } - - var renderingIntent = 'oplist'; - if (!this.intentStates[renderingIntent]) { - this.intentStates[renderingIntent] = Object.create(null); - } - var intentState = this.intentStates[renderingIntent]; - var opListTask; - - if (!intentState.opListReadCapability) { - opListTask = {}; - opListTask.operatorListChanged = operatorListChanged; - intentState.receivingOperatorList = true; - intentState.opListReadCapability = createPromiseCapability(); - intentState.renderTasks = []; - intentState.renderTasks.push(opListTask); - intentState.operatorList = { - fnArray: [], - argsArray: [], - lastChunk: false - }; - - this.transport.messageHandler.send('RenderPageRequest', { - pageIndex: this.pageIndex, - intent: renderingIntent - }); - } - return intentState.opListReadCapability.promise; - }, - - /** - * @param {getTextContentParameters} params - getTextContent parameters. - * @return {Promise} That is resolved a {@link TextContent} - * object that represent the page text content. - */ - getTextContent: function PDFPageProxy_getTextContent(params) { - return this.transport.messageHandler.sendWithPromise('GetTextContent', { - pageIndex: this.pageNumber - 1, - normalizeWhitespace: (params && params.normalizeWhitespace === true ? - true : /* Default */ false), - combineTextItems: (params && params.disableCombineTextItems === true ? - false : /* Default */ true), - }); - }, - - /** - * Destroys page object. - */ - _destroy: function PDFPageProxy_destroy() { - this.destroyed = true; - this.transport.pageCache[this.pageIndex] = null; - - var waitOn = []; - Object.keys(this.intentStates).forEach(function(intent) { - if (intent === 'oplist') { - // Avoid errors below, since the renderTasks are just stubs. - return; - } - var intentState = this.intentStates[intent]; - intentState.renderTasks.forEach(function(renderTask) { - var renderCompleted = renderTask.capability.promise. - catch(function () {}); // ignoring failures - waitOn.push(renderCompleted); - renderTask.cancel(); - }); - }, this); - this.objs.clear(); - this.annotationsPromise = null; - this.pendingCleanup = false; - return Promise.all(waitOn); - }, - - /** - * Cleans up resources allocated by the page. (deprecated) - */ - destroy: function() { - deprecated('page destroy method, use cleanup() instead'); - this.cleanup(); - }, - - /** - * Cleans up resources allocated by the page. - */ - cleanup: function PDFPageProxy_cleanup() { - this.pendingCleanup = true; - this._tryCleanup(); - }, - /** - * For internal use only. Attempts to clean up if rendering is in a state - * where that's possible. - * @ignore - */ - _tryCleanup: function PDFPageProxy_tryCleanup() { - if (!this.pendingCleanup || - Object.keys(this.intentStates).some(function(intent) { - var intentState = this.intentStates[intent]; - return (intentState.renderTasks.length !== 0 || - intentState.receivingOperatorList); - }, this)) { - return; - } - - Object.keys(this.intentStates).forEach(function(intent) { - delete this.intentStates[intent]; - }, this); - this.objs.clear(); - this.annotationsPromise = null; - this.pendingCleanup = false; - }, - /** - * For internal use only. - * @ignore - */ - _startRenderPage: function PDFPageProxy_startRenderPage(transparency, - intent) { - var intentState = this.intentStates[intent]; - // TODO Refactor RenderPageRequest to separate rendering - // and operator list logic - if (intentState.displayReadyCapability) { - intentState.displayReadyCapability.resolve(transparency); - } - }, - /** - * For internal use only. - * @ignore - */ - _renderPageChunk: function PDFPageProxy_renderPageChunk(operatorListChunk, - intent) { - var intentState = this.intentStates[intent]; - var i, ii; - // Add the new chunk to the current operator list. - for (i = 0, ii = operatorListChunk.length; i < ii; i++) { - intentState.operatorList.fnArray.push(operatorListChunk.fnArray[i]); - intentState.operatorList.argsArray.push( - operatorListChunk.argsArray[i]); - } - intentState.operatorList.lastChunk = operatorListChunk.lastChunk; - - // Notify all the rendering tasks there are more operators to be consumed. - for (i = 0; i < intentState.renderTasks.length; i++) { - intentState.renderTasks[i].operatorListChanged(); - } - - if (operatorListChunk.lastChunk) { - intentState.receivingOperatorList = false; - this._tryCleanup(); - } - } - }; - return PDFPageProxy; -})(); - -/** - * PDF.js web worker abstraction, it controls instantiation of PDF documents and - * WorkerTransport for them. If creation of a web worker is not possible, - * a "fake" worker will be used instead. - * @class - */ -var PDFWorker = (function PDFWorkerClosure() { - var nextFakeWorkerId = 0; - - function getWorkerSrc() { - if (typeof workerSrc !== 'undefined') { - return workerSrc; - } - if (getDefaultSetting('workerSrc')) { - return getDefaultSetting('workerSrc'); - } - if (pdfjsFilePath) { - return pdfjsFilePath.replace(/\.js$/i, '.worker.js'); - } - error('No PDFJS.workerSrc specified'); - } - - var fakeWorkerFilesLoadedCapability; - - // Loads worker code into main thread. - function setupFakeWorkerGlobal() { - var WorkerMessageHandler; - if (!fakeWorkerFilesLoadedCapability) { - fakeWorkerFilesLoadedCapability = createPromiseCapability(); - // In the developer build load worker_loader which in turn loads all the - // other files and resolves the promise. In production only the - // pdf.worker.js file is needed. - var loader = fakeWorkerFilesLoader || function (callback) { - Util.loadScript(getWorkerSrc(), function () { - callback(window.pdfjsDistBuildPdfWorker.WorkerMessageHandler); - }); - }; - loader(fakeWorkerFilesLoadedCapability.resolve); - } - return fakeWorkerFilesLoadedCapability.promise; - } - - function FakeWorkerPort(defer) { - this._listeners = []; - this._defer = defer; - this._deferred = Promise.resolve(undefined); - } - FakeWorkerPort.prototype = { - postMessage: function (obj, transfers) { - function cloneValue(value) { - // Trying to perform a structured clone close to the spec, including - // transfers. - if (typeof value !== 'object' || value === null) { - return value; - } - if (cloned.has(value)) { // already cloned the object - return cloned.get(value); - } - var result; - var buffer; - if ((buffer = value.buffer) && isArrayBuffer(buffer)) { - // We found object with ArrayBuffer (typed array). - var transferable = transfers && transfers.indexOf(buffer) >= 0; - if (value === buffer) { - // Special case when we are faking typed arrays in compatibility.js. - result = value; - } else if (transferable) { - result = new value.constructor(buffer, value.byteOffset, - value.byteLength); - } else { - result = new value.constructor(value); - } - cloned.set(value, result); - return result; - } - result = isArray(value) ? [] : {}; - cloned.set(value, result); // adding to cache now for cyclic references - // Cloning all value and object properties, however ignoring properties - // defined via getter. - for (var i in value) { - var desc, p = value; - while (!(desc = Object.getOwnPropertyDescriptor(p, i))) { - p = Object.getPrototypeOf(p); - } - if (typeof desc.value === 'undefined' || - typeof desc.value === 'function') { - continue; - } - result[i] = cloneValue(desc.value); - } - return result; - } - - if (!this._defer) { - this._listeners.forEach(function (listener) { - listener.call(this, {data: obj}); - }, this); - return; - } - - var cloned = new WeakMap(); - var e = {data: cloneValue(obj)}; - this._deferred.then(function () { - this._listeners.forEach(function (listener) { - listener.call(this, e); - }, this); - }.bind(this)); - }, - addEventListener: function (name, listener) { - this._listeners.push(listener); - }, - removeEventListener: function (name, listener) { - var i = this._listeners.indexOf(listener); - this._listeners.splice(i, 1); - }, - terminate: function () { - this._listeners = []; - } - }; - - function createCDNWrapper(url) { - // We will rely on blob URL's property to specify origin. - // We want this function to fail in case if createObjectURL or Blob do not - // exist or fail for some reason -- our Worker creation will fail anyway. - var wrapper = 'importScripts(\'' + url + '\');'; - return URL.createObjectURL(new Blob([wrapper])); - } - - function PDFWorker(name) { - this.name = name; - this.destroyed = false; - - this._readyCapability = createPromiseCapability(); - this._port = null; - this._webWorker = null; - this._messageHandler = null; - this._initialize(); - } - - PDFWorker.prototype = /** @lends PDFWorker.prototype */ { - get promise() { - return this._readyCapability.promise; - }, - - get port() { - return this._port; - }, - - get messageHandler() { - return this._messageHandler; - }, - - _initialize: function PDFWorker_initialize() { - // If worker support isn't disabled explicit and the browser has worker - // support, create a new web worker and test if it/the browser fulfills - // all requirements to run parts of pdf.js in a web worker. - // Right now, the requirement is, that an Uint8Array is still an - // Uint8Array as it arrives on the worker. (Chrome added this with v.15.) - if (!isWorkerDisabled && !getDefaultSetting('disableWorker') && - typeof Worker !== 'undefined') { - var workerSrc = getWorkerSrc(); - - try { - // Wraps workerSrc path into blob URL, if the former does not belong - // to the same origin. - if (!isSameOrigin(window.location.href, workerSrc)) { - workerSrc = createCDNWrapper( - new URL(workerSrc, window.location).href); - } - // Some versions of FF can't create a worker on localhost, see: - // https://bugzilla.mozilla.org/show_bug.cgi?id=683280 - var worker = new Worker(workerSrc); - var messageHandler = new MessageHandler('main', 'worker', worker); - var terminateEarly = function() { - worker.removeEventListener('error', onWorkerError); - messageHandler.destroy(); - worker.terminate(); - if (this.destroyed) { - this._readyCapability.reject(new Error('Worker was destroyed')); - } else { - // Fall back to fake worker if the termination is caused by an - // error (e.g. NetworkError / SecurityError). - this._setupFakeWorker(); - } - }.bind(this); - - var onWorkerError = function(event) { - if (!this._webWorker) { - // Worker failed to initialize due to an error. Clean up and fall - // back to the fake worker. - terminateEarly(); - } - }.bind(this); - worker.addEventListener('error', onWorkerError); - - messageHandler.on('test', function PDFWorker_test(data) { - worker.removeEventListener('error', onWorkerError); - if (this.destroyed) { - terminateEarly(); - return; // worker was destroyed - } - var supportTypedArray = data && data.supportTypedArray; - if (supportTypedArray) { - this._messageHandler = messageHandler; - this._port = worker; - this._webWorker = worker; - if (!data.supportTransfers) { - isPostMessageTransfersDisabled = true; - } - this._readyCapability.resolve(); - // Send global setting, e.g. verbosity level. - messageHandler.send('configure', { - verbosity: getVerbosityLevel() - }); - } else { - this._setupFakeWorker(); - messageHandler.destroy(); - worker.terminate(); - } - }.bind(this)); - - messageHandler.on('console_log', function (data) { - console.log.apply(console, data); - }); - messageHandler.on('console_error', function (data) { - console.error.apply(console, data); - }); - - messageHandler.on('ready', function (data) { - worker.removeEventListener('error', onWorkerError); - if (this.destroyed) { - terminateEarly(); - return; // worker was destroyed - } - try { - sendTest(); - } catch (e) { - // We need fallback to a faked worker. - this._setupFakeWorker(); - } - }.bind(this)); - - var sendTest = function () { - var postMessageTransfers = - getDefaultSetting('postMessageTransfers') && - !isPostMessageTransfersDisabled; - var testObj = new Uint8Array([postMessageTransfers ? 255 : 0]); - // Some versions of Opera throw a DATA_CLONE_ERR on serializing the - // typed array. Also, checking if we can use transfers. - try { - messageHandler.send('test', testObj, [testObj.buffer]); - } catch (ex) { - info('Cannot use postMessage transfers'); - testObj[0] = 0; - messageHandler.send('test', testObj); - } - }; - - // It might take time for worker to initialize (especially when AMD - // loader is used). We will try to send test immediately, and then - // when 'ready' message will arrive. The worker shall process only - // first received 'test'. - sendTest(); - return; - } catch (e) { - info('The worker has been disabled.'); - } - } - // Either workers are disabled, not supported or have thrown an exception. - // Thus, we fallback to a faked worker. - this._setupFakeWorker(); - }, - - _setupFakeWorker: function PDFWorker_setupFakeWorker() { - if (!isWorkerDisabled && !getDefaultSetting('disableWorker')) { - warn('Setting up fake worker.'); - isWorkerDisabled = true; - } - - setupFakeWorkerGlobal().then(function (WorkerMessageHandler) { - if (this.destroyed) { - this._readyCapability.reject(new Error('Worker was destroyed')); - return; - } - - // We cannot turn on proper fake port simulation (this includes - // structured cloning) when typed arrays are not supported. Relying - // on a chance that messages will be sent in proper order. - var isTypedArraysPresent = Uint8Array !== Float32Array; - var port = new FakeWorkerPort(isTypedArraysPresent); - this._port = port; - - // All fake workers use the same port, making id unique. - var id = 'fake' + (nextFakeWorkerId++); - - // If the main thread is our worker, setup the handling for the - // messages -- the main thread sends to it self. - var workerHandler = new MessageHandler(id + '_worker', id, port); - WorkerMessageHandler.setup(workerHandler, port); - - var messageHandler = new MessageHandler(id, id + '_worker', port); - this._messageHandler = messageHandler; - this._readyCapability.resolve(); - }.bind(this)); - }, - - /** - * Destroys the worker instance. - */ - destroy: function PDFWorker_destroy() { - this.destroyed = true; - if (this._webWorker) { - // We need to terminate only web worker created resource. - this._webWorker.terminate(); - this._webWorker = null; - } - this._port = null; - if (this._messageHandler) { - this._messageHandler.destroy(); - this._messageHandler = null; - } - } - }; - - return PDFWorker; -})(); - -/** - * For internal use only. - * @ignore - */ -var WorkerTransport = (function WorkerTransportClosure() { - function WorkerTransport(messageHandler, loadingTask, pdfDataRangeTransport) { - this.messageHandler = messageHandler; - this.loadingTask = loadingTask; - this.pdfDataRangeTransport = pdfDataRangeTransport; - this.commonObjs = new PDFObjects(); - this.fontLoader = new FontLoader(loadingTask.docId); - - this.destroyed = false; - this.destroyCapability = null; - - this.pageCache = []; - this.pagePromises = []; - this.downloadInfoCapability = createPromiseCapability(); - - this.setupMessageHandler(); - } - WorkerTransport.prototype = { - destroy: function WorkerTransport_destroy() { - if (this.destroyCapability) { - return this.destroyCapability.promise; - } - - this.destroyed = true; - this.destroyCapability = createPromiseCapability(); - - var waitOn = []; - // We need to wait for all renderings to be completed, e.g. - // timeout/rAF can take a long time. - this.pageCache.forEach(function (page) { - if (page) { - waitOn.push(page._destroy()); - } - }); - this.pageCache = []; - this.pagePromises = []; - var self = this; - // We also need to wait for the worker to finish its long running tasks. - var terminated = this.messageHandler.sendWithPromise('Terminate', null); - waitOn.push(terminated); - Promise.all(waitOn).then(function () { - self.fontLoader.clear(); - if (self.pdfDataRangeTransport) { - self.pdfDataRangeTransport.abort(); - self.pdfDataRangeTransport = null; - } - if (self.messageHandler) { - self.messageHandler.destroy(); - self.messageHandler = null; - } - self.destroyCapability.resolve(); - }, this.destroyCapability.reject); - return this.destroyCapability.promise; - }, - - setupMessageHandler: - function WorkerTransport_setupMessageHandler() { - var messageHandler = this.messageHandler; - - function updatePassword(password) { - messageHandler.send('UpdatePassword', password); - } - - var pdfDataRangeTransport = this.pdfDataRangeTransport; - if (pdfDataRangeTransport) { - pdfDataRangeTransport.addRangeListener(function(begin, chunk) { - messageHandler.send('OnDataRange', { - begin: begin, - chunk: chunk - }); - }); - - pdfDataRangeTransport.addProgressListener(function(loaded) { - messageHandler.send('OnDataProgress', { - loaded: loaded - }); - }); - - pdfDataRangeTransport.addProgressiveReadListener(function(chunk) { - messageHandler.send('OnDataRange', { - chunk: chunk - }); - }); - - messageHandler.on('RequestDataRange', - function transportDataRange(data) { - pdfDataRangeTransport.requestDataRange(data.begin, data.end); - }, this); - } - - messageHandler.on('GetDoc', function transportDoc(data) { - var pdfInfo = data.pdfInfo; - this.numPages = data.pdfInfo.numPages; - var loadingTask = this.loadingTask; - var pdfDocument = new PDFDocumentProxy(pdfInfo, this, loadingTask); - this.pdfDocument = pdfDocument; - loadingTask._capability.resolve(pdfDocument); - }, this); - - messageHandler.on('NeedPassword', - function transportNeedPassword(exception) { - var loadingTask = this.loadingTask; - if (loadingTask.onPassword) { - return loadingTask.onPassword(updatePassword, - PasswordResponses.NEED_PASSWORD); - } - loadingTask._capability.reject( - new PasswordException(exception.message, exception.code)); - }, this); - - messageHandler.on('IncorrectPassword', - function transportIncorrectPassword(exception) { - var loadingTask = this.loadingTask; - if (loadingTask.onPassword) { - return loadingTask.onPassword(updatePassword, - PasswordResponses.INCORRECT_PASSWORD); - } - loadingTask._capability.reject( - new PasswordException(exception.message, exception.code)); - }, this); - - messageHandler.on('InvalidPDF', function transportInvalidPDF(exception) { - this.loadingTask._capability.reject( - new InvalidPDFException(exception.message)); - }, this); - - messageHandler.on('MissingPDF', function transportMissingPDF(exception) { - this.loadingTask._capability.reject( - new MissingPDFException(exception.message)); - }, this); - - messageHandler.on('UnexpectedResponse', - function transportUnexpectedResponse(exception) { - this.loadingTask._capability.reject( - new UnexpectedResponseException(exception.message, exception.status)); - }, this); - - messageHandler.on('UnknownError', - function transportUnknownError(exception) { - this.loadingTask._capability.reject( - new UnknownErrorException(exception.message, exception.details)); - }, this); - - messageHandler.on('DataLoaded', function transportPage(data) { - this.downloadInfoCapability.resolve(data); - }, this); - - messageHandler.on('PDFManagerReady', function transportPage(data) { - if (this.pdfDataRangeTransport) { - this.pdfDataRangeTransport.transportReady(); - } - }, this); - - messageHandler.on('StartRenderPage', function transportRender(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - var page = this.pageCache[data.pageIndex]; - - page.stats.timeEnd('Page Request'); - page._startRenderPage(data.transparency, data.intent); - }, this); - - messageHandler.on('RenderPageChunk', function transportRender(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - var page = this.pageCache[data.pageIndex]; - - page._renderPageChunk(data.operatorList, data.intent); - }, this); - - messageHandler.on('commonobj', function transportObj(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - - var id = data[0]; - var type = data[1]; - if (this.commonObjs.hasData(id)) { - return; - } - - switch (type) { - case 'Font': - var exportedData = data[2]; - - if ('error' in exportedData) { - var exportedError = exportedData.error; - warn('Error during font loading: ' + exportedError); - this.commonObjs.resolve(id, exportedError); - break; - } - var fontRegistry = null; - if (getDefaultSetting('pdfBug') && globalScope.FontInspector && - globalScope['FontInspector'].enabled) { - fontRegistry = { - registerFont: function (font, url) { - globalScope['FontInspector'].fontAdded(font, url); - } - }; - } - var font = new FontFaceObject(exportedData, { - isEvalSuported: getDefaultSetting('isEvalSupported'), - disableFontFace: getDefaultSetting('disableFontFace'), - fontRegistry: fontRegistry - }); - - this.fontLoader.bind( - [font], - function fontReady(fontObjs) { - this.commonObjs.resolve(id, font); - }.bind(this) - ); - break; - case 'FontPath': - this.commonObjs.resolve(id, data[2]); - break; - default: - error('Got unknown common object type ' + type); - } - }, this); - - messageHandler.on('obj', function transportObj(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - - var id = data[0]; - var pageIndex = data[1]; - var type = data[2]; - var pageProxy = this.pageCache[pageIndex]; - var imageData; - if (pageProxy.objs.hasData(id)) { - return; - } - - switch (type) { - case 'JpegStream': - imageData = data[3]; - loadJpegStream(id, imageData, pageProxy.objs); - break; - case 'Image': - imageData = data[3]; - pageProxy.objs.resolve(id, imageData); - - // heuristics that will allow not to store large data - var MAX_IMAGE_SIZE_TO_STORE = 8000000; - if (imageData && 'data' in imageData && - imageData.data.length > MAX_IMAGE_SIZE_TO_STORE) { - pageProxy.cleanupAfterRender = true; - } - break; - default: - error('Got unknown object type ' + type); - } - }, this); - - messageHandler.on('DocProgress', function transportDocProgress(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - - var loadingTask = this.loadingTask; - if (loadingTask.onProgress) { - loadingTask.onProgress({ - loaded: data.loaded, - total: data.total - }); - } - }, this); - - messageHandler.on('PageError', function transportError(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - - var page = this.pageCache[data.pageNum - 1]; - var intentState = page.intentStates[data.intent]; - - if (intentState.displayReadyCapability) { - intentState.displayReadyCapability.reject(data.error); - } else { - error(data.error); - } - - if (intentState.operatorList) { - // Mark operator list as complete. - intentState.operatorList.lastChunk = true; - for (var i = 0; i < intentState.renderTasks.length; i++) { - intentState.renderTasks[i].operatorListChanged(); - } - } - }, this); - - messageHandler.on('UnsupportedFeature', - function transportUnsupportedFeature(data) { - if (this.destroyed) { - return; // Ignore any pending requests if the worker was terminated. - } - var featureId = data.featureId; - var loadingTask = this.loadingTask; - if (loadingTask.onUnsupportedFeature) { - loadingTask.onUnsupportedFeature(featureId); - } - _UnsupportedManager.notify(featureId); - }, this); - - messageHandler.on('JpegDecode', function(data) { - if (this.destroyed) { - return Promise.reject(new Error('Worker was destroyed')); - } - - var imageUrl = data[0]; - var components = data[1]; - if (components !== 3 && components !== 1) { - return Promise.reject( - new Error('Only 3 components or 1 component can be returned')); - } - - return new Promise(function (resolve, reject) { - var img = new Image(); - img.onload = function () { - var width = img.width; - var height = img.height; - var size = width * height; - var rgbaLength = size * 4; - var buf = new Uint8Array(size * components); - var tmpCanvas = createScratchCanvas(width, height); - var tmpCtx = tmpCanvas.getContext('2d'); - tmpCtx.drawImage(img, 0, 0); - var data = tmpCtx.getImageData(0, 0, width, height).data; - var i, j; - - if (components === 3) { - for (i = 0, j = 0; i < rgbaLength; i += 4, j += 3) { - buf[j] = data[i]; - buf[j + 1] = data[i + 1]; - buf[j + 2] = data[i + 2]; - } - } else if (components === 1) { - for (i = 0, j = 0; i < rgbaLength; i += 4, j++) { - buf[j] = data[i]; - } - } - resolve({ data: buf, width: width, height: height}); - }; - img.onerror = function () { - reject(new Error('JpegDecode failed to load image')); - }; - img.src = imageUrl; - }); - }, this); - }, - - getData: function WorkerTransport_getData() { - return this.messageHandler.sendWithPromise('GetData', null); - }, - - getPage: function WorkerTransport_getPage(pageNumber, capability) { - if (!isInt(pageNumber) || pageNumber <= 0 || pageNumber > this.numPages) { - return Promise.reject(new Error('Invalid page request')); - } - - var pageIndex = pageNumber - 1; - if (pageIndex in this.pagePromises) { - return this.pagePromises[pageIndex]; - } - var promise = this.messageHandler.sendWithPromise('GetPage', { - pageIndex: pageIndex - }).then(function (pageInfo) { - if (this.destroyed) { - throw new Error('Transport destroyed'); - } - var page = new PDFPageProxy(pageIndex, pageInfo, this); - this.pageCache[pageIndex] = page; - return page; - }.bind(this)); - this.pagePromises[pageIndex] = promise; - return promise; - }, - - getPageIndex: function WorkerTransport_getPageIndexByRef(ref) { - return this.messageHandler.sendWithPromise('GetPageIndex', { - ref: ref, - }).catch(function (reason) { - return Promise.reject(new Error(reason)); - }); - }, - - getAnnotations: function WorkerTransport_getAnnotations(pageIndex, intent) { - return this.messageHandler.sendWithPromise('GetAnnotations', { - pageIndex: pageIndex, - intent: intent, - }); - }, - - getDestinations: function WorkerTransport_getDestinations() { - return this.messageHandler.sendWithPromise('GetDestinations', null); - }, - - getDestination: function WorkerTransport_getDestination(id) { - return this.messageHandler.sendWithPromise('GetDestination', { id: id }); - }, - - getPageLabels: function WorkerTransport_getPageLabels() { - return this.messageHandler.sendWithPromise('GetPageLabels', null); - }, - - getAttachments: function WorkerTransport_getAttachments() { - return this.messageHandler.sendWithPromise('GetAttachments', null); - }, - - getJavaScript: function WorkerTransport_getJavaScript() { - return this.messageHandler.sendWithPromise('GetJavaScript', null); - }, - - getOutline: function WorkerTransport_getOutline() { - return this.messageHandler.sendWithPromise('GetOutline', null); - }, - - getMetadata: function WorkerTransport_getMetadata() { - return this.messageHandler.sendWithPromise('GetMetadata', null). - then(function transportMetadata(results) { - return { - info: results[0], - metadata: (results[1] ? new Metadata(results[1]) : null) - }; - }); - }, - - getStats: function WorkerTransport_getStats() { - return this.messageHandler.sendWithPromise('GetStats', null); - }, - - startCleanup: function WorkerTransport_startCleanup() { - this.messageHandler.sendWithPromise('Cleanup', null). - then(function endCleanup() { - for (var i = 0, ii = this.pageCache.length; i < ii; i++) { - var page = this.pageCache[i]; - if (page) { - page.cleanup(); - } - } - this.commonObjs.clear(); - this.fontLoader.clear(); - }.bind(this)); - } - }; - return WorkerTransport; - -})(); - -/** - * A PDF document and page is built of many objects. E.g. there are objects - * for fonts, images, rendering code and such. These objects might get processed - * inside of a worker. The `PDFObjects` implements some basic functions to - * manage these objects. - * @ignore - */ -var PDFObjects = (function PDFObjectsClosure() { - function PDFObjects() { - this.objs = Object.create(null); - } - - PDFObjects.prototype = { - /** - * Internal function. - * Ensures there is an object defined for `objId`. - */ - ensureObj: function PDFObjects_ensureObj(objId) { - if (this.objs[objId]) { - return this.objs[objId]; - } - - var obj = { - capability: createPromiseCapability(), - data: null, - resolved: false - }; - this.objs[objId] = obj; - - return obj; - }, - - /** - * If called *without* callback, this returns the data of `objId` but the - * object needs to be resolved. If it isn't, this function throws. - * - * If called *with* a callback, the callback is called with the data of the - * object once the object is resolved. That means, if you call this - * function and the object is already resolved, the callback gets called - * right away. - */ - get: function PDFObjects_get(objId, callback) { - // If there is a callback, then the get can be async and the object is - // not required to be resolved right now - if (callback) { - this.ensureObj(objId).capability.promise.then(callback); - return null; - } - - // If there isn't a callback, the user expects to get the resolved data - // directly. - var obj = this.objs[objId]; - - // If there isn't an object yet or the object isn't resolved, then the - // data isn't ready yet! - if (!obj || !obj.resolved) { - error('Requesting object that isn\'t resolved yet ' + objId); - } - - return obj.data; - }, - - /** - * Resolves the object `objId` with optional `data`. - */ - resolve: function PDFObjects_resolve(objId, data) { - var obj = this.ensureObj(objId); - - obj.resolved = true; - obj.data = data; - obj.capability.resolve(data); - }, - - isResolved: function PDFObjects_isResolved(objId) { - var objs = this.objs; - - if (!objs[objId]) { - return false; - } else { - return objs[objId].resolved; - } - }, - - hasData: function PDFObjects_hasData(objId) { - return this.isResolved(objId); - }, - - /** - * Returns the data of `objId` if object exists, null otherwise. - */ - getData: function PDFObjects_getData(objId) { - var objs = this.objs; - if (!objs[objId] || !objs[objId].resolved) { - return null; - } else { - return objs[objId].data; - } - }, - - clear: function PDFObjects_clear() { - this.objs = Object.create(null); - } - }; - return PDFObjects; -})(); - -/** - * Allows controlling of the rendering tasks. - * @class - * @alias RenderTask - */ -var RenderTask = (function RenderTaskClosure() { - function RenderTask(internalRenderTask) { - this._internalRenderTask = internalRenderTask; - - /** - * Callback for incremental rendering -- a function that will be called - * each time the rendering is paused. To continue rendering call the - * function that is the first argument to the callback. - * @type {function} - */ - this.onContinue = null; - } - - RenderTask.prototype = /** @lends RenderTask.prototype */ { - /** - * Promise for rendering task completion. - * @return {Promise} - */ - get promise() { - return this._internalRenderTask.capability.promise; - }, - - /** - * Cancels the rendering task. If the task is currently rendering it will - * not be cancelled until graphics pauses with a timeout. The promise that - * this object extends will resolved when cancelled. - */ - cancel: function RenderTask_cancel() { - this._internalRenderTask.cancel(); - }, - - /** - * Registers callbacks to indicate the rendering task completion. - * - * @param {function} onFulfilled The callback for the rendering completion. - * @param {function} onRejected The callback for the rendering failure. - * @return {Promise} A promise that is resolved after the onFulfilled or - * onRejected callback. - */ - then: function RenderTask_then(onFulfilled, onRejected) { - return this.promise.then.apply(this.promise, arguments); - } - }; - - return RenderTask; -})(); - -/** - * For internal use only. - * @ignore - */ -var InternalRenderTask = (function InternalRenderTaskClosure() { - - function InternalRenderTask(callback, params, objs, commonObjs, operatorList, - pageNumber) { - this.callback = callback; - this.params = params; - this.objs = objs; - this.commonObjs = commonObjs; - this.operatorListIdx = null; - this.operatorList = operatorList; - this.pageNumber = pageNumber; - this.running = false; - this.graphicsReadyCallback = null; - this.graphicsReady = false; - this.useRequestAnimationFrame = false; - this.cancelled = false; - this.capability = createPromiseCapability(); - this.task = new RenderTask(this); - // caching this-bound methods - this._continueBound = this._continue.bind(this); - this._scheduleNextBound = this._scheduleNext.bind(this); - this._nextBound = this._next.bind(this); - } - - InternalRenderTask.prototype = { - - initializeGraphics: - function InternalRenderTask_initializeGraphics(transparency) { - - if (this.cancelled) { - return; - } - if (getDefaultSetting('pdfBug') && globalScope.StepperManager && - globalScope.StepperManager.enabled) { - this.stepper = globalScope.StepperManager.create(this.pageNumber - 1); - this.stepper.init(this.operatorList); - this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint(); - } - - var params = this.params; - this.gfx = new CanvasGraphics(params.canvasContext, this.commonObjs, - this.objs, params.imageLayer); - - this.gfx.beginDrawing(params.transform, params.viewport, transparency); - this.operatorListIdx = 0; - this.graphicsReady = true; - if (this.graphicsReadyCallback) { - this.graphicsReadyCallback(); - } - }, - - cancel: function InternalRenderTask_cancel() { - this.running = false; - this.cancelled = true; - this.callback('cancelled'); - }, - - operatorListChanged: function InternalRenderTask_operatorListChanged() { - if (!this.graphicsReady) { - if (!this.graphicsReadyCallback) { - this.graphicsReadyCallback = this._continueBound; - } - return; - } - - if (this.stepper) { - this.stepper.updateOperatorList(this.operatorList); - } - - if (this.running) { - return; - } - this._continue(); - }, - - _continue: function InternalRenderTask__continue() { - this.running = true; - if (this.cancelled) { - return; - } - if (this.task.onContinue) { - this.task.onContinue.call(this.task, this._scheduleNextBound); - } else { - this._scheduleNext(); - } - }, - - _scheduleNext: function InternalRenderTask__scheduleNext() { - if (this.useRequestAnimationFrame && typeof window !== 'undefined') { - window.requestAnimationFrame(this._nextBound); - } else { - Promise.resolve(undefined).then(this._nextBound); - } - }, - - _next: function InternalRenderTask__next() { - if (this.cancelled) { - return; - } - this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, - this.operatorListIdx, - this._continueBound, - this.stepper); - if (this.operatorListIdx === this.operatorList.argsArray.length) { - this.running = false; - if (this.operatorList.lastChunk) { - this.gfx.endDrawing(); - this.callback(); - } - } - } - - }; - - return InternalRenderTask; -})(); - -/** - * (Deprecated) Global observer of unsupported feature usages. Use - * onUnsupportedFeature callback of the {PDFDocumentLoadingTask} instance. - */ -var _UnsupportedManager = (function UnsupportedManagerClosure() { - var listeners = []; - return { - listen: function (cb) { - deprecated('Global UnsupportedManager.listen is used: ' + - ' use PDFDocumentLoadingTask.onUnsupportedFeature instead'); - listeners.push(cb); - }, - notify: function (featureId) { - for (var i = 0, ii = listeners.length; i < ii; i++) { - listeners[i](featureId); - } - } - }; -})(); - -if (typeof pdfjsVersion !== 'undefined') { - exports.version = pdfjsVersion; -} -if (typeof pdfjsBuild !== 'undefined') { - exports.build = pdfjsBuild; -} - -exports.getDocument = getDocument; -exports.PDFDataRangeTransport = PDFDataRangeTransport; -exports.PDFWorker = PDFWorker; -exports.PDFDocumentProxy = PDFDocumentProxy; -exports.PDFPageProxy = PDFPageProxy; -exports._UnsupportedManager = _UnsupportedManager; -})); - - -(function (root, factory) { - { - factory((root.pdfjsDisplayGlobal = {}), root.pdfjsSharedUtil, - root.pdfjsDisplayDOMUtils, root.pdfjsDisplayAPI, - root.pdfjsDisplayAnnotationLayer, root.pdfjsDisplayTextLayer, - root.pdfjsDisplayMetadata, root.pdfjsDisplaySVG); - } -}(this, function (exports, sharedUtil, displayDOMUtils, displayAPI, - displayAnnotationLayer, displayTextLayer, displayMetadata, - displaySVG) { - - var globalScope = sharedUtil.globalScope; - var deprecated = sharedUtil.deprecated; - var warn = sharedUtil.warn; - var LinkTarget = displayDOMUtils.LinkTarget; - - var isWorker = (typeof window === 'undefined'); - - // The global PDFJS object is now deprecated and will not be supported in - // the future. The members below are maintained for backward compatibility - // and shall not be extended or modified. If the global.js is included as - // a module, we will create a global PDFJS object instance or use existing. - if (!globalScope.PDFJS) { - globalScope.PDFJS = {}; - } - var PDFJS = globalScope.PDFJS; - - if (typeof pdfjsVersion !== 'undefined') { - PDFJS.version = pdfjsVersion; - } - if (typeof pdfjsBuild !== 'undefined') { - PDFJS.build = pdfjsBuild; - } - - PDFJS.pdfBug = false; - - if (PDFJS.verbosity !== undefined) { - sharedUtil.setVerbosityLevel(PDFJS.verbosity); - } - delete PDFJS.verbosity; - Object.defineProperty(PDFJS, 'verbosity', { - get: function () { return sharedUtil.getVerbosityLevel(); }, - set: function (level) { sharedUtil.setVerbosityLevel(level); }, - enumerable: true, - configurable: true - }); - - PDFJS.VERBOSITY_LEVELS = sharedUtil.VERBOSITY_LEVELS; - PDFJS.OPS = sharedUtil.OPS; - PDFJS.UNSUPPORTED_FEATURES = sharedUtil.UNSUPPORTED_FEATURES; - PDFJS.isValidUrl = sharedUtil.isValidUrl; - PDFJS.shadow = sharedUtil.shadow; - PDFJS.createBlob = sharedUtil.createBlob; - PDFJS.createObjectURL = function PDFJS_createObjectURL(data, contentType) { - return sharedUtil.createObjectURL(data, contentType, - PDFJS.disableCreateObjectURL); - }; - Object.defineProperty(PDFJS, 'isLittleEndian', { - configurable: true, - get: function PDFJS_isLittleEndian() { - var value = sharedUtil.isLittleEndian(); - return sharedUtil.shadow(PDFJS, 'isLittleEndian', value); - } - }); - PDFJS.removeNullCharacters = sharedUtil.removeNullCharacters; - PDFJS.PasswordResponses = sharedUtil.PasswordResponses; - PDFJS.PasswordException = sharedUtil.PasswordException; - PDFJS.UnknownErrorException = sharedUtil.UnknownErrorException; - PDFJS.InvalidPDFException = sharedUtil.InvalidPDFException; - PDFJS.MissingPDFException = sharedUtil.MissingPDFException; - PDFJS.UnexpectedResponseException = sharedUtil.UnexpectedResponseException; - PDFJS.Util = sharedUtil.Util; - PDFJS.PageViewport = sharedUtil.PageViewport; - PDFJS.createPromiseCapability = sharedUtil.createPromiseCapability; - - /** - * The maximum allowed image size in total pixels e.g. width * height. Images - * above this value will not be drawn. Use -1 for no limit. - * @var {number} - */ - PDFJS.maxImageSize = (PDFJS.maxImageSize === undefined ? - -1 : PDFJS.maxImageSize); - - /** - * The url of where the predefined Adobe CMaps are located. Include trailing - * slash. - * @var {string} - */ - PDFJS.cMapUrl = (PDFJS.cMapUrl === undefined ? null : PDFJS.cMapUrl); - - /** - * Specifies if CMaps are binary packed. - * @var {boolean} - */ - PDFJS.cMapPacked = PDFJS.cMapPacked === undefined ? false : PDFJS.cMapPacked; - - /** - * By default fonts are converted to OpenType fonts and loaded via font face - * rules. If disabled, the font will be rendered using a built in font - * renderer that constructs the glyphs with primitive path commands. - * @var {boolean} - */ - PDFJS.disableFontFace = (PDFJS.disableFontFace === undefined ? - false : PDFJS.disableFontFace); - - /** - * Path for image resources, mainly for annotation icons. Include trailing - * slash. - * @var {string} - */ - PDFJS.imageResourcesPath = (PDFJS.imageResourcesPath === undefined ? - '' : PDFJS.imageResourcesPath); - - /** - * Disable the web worker and run all code on the main thread. This will - * happen automatically if the browser doesn't support workers or sending - * typed arrays to workers. - * @var {boolean} - */ - PDFJS.disableWorker = (PDFJS.disableWorker === undefined ? - false : PDFJS.disableWorker); - - /** - * Path and filename of the worker file. Required when the worker is enabled - * in development mode. If unspecified in the production build, the worker - * will be loaded based on the location of the pdf.js file. It is recommended - * that the workerSrc is set in a custom application to prevent issues caused - * by third-party frameworks and libraries. - * @var {string} - */ - PDFJS.workerSrc = (PDFJS.workerSrc === undefined ? null : PDFJS.workerSrc); - - /** - * Disable range request loading of PDF files. When enabled and if the server - * supports partial content requests then the PDF will be fetched in chunks. - * Enabled (false) by default. - * @var {boolean} - */ - PDFJS.disableRange = (PDFJS.disableRange === undefined ? - false : PDFJS.disableRange); - - /** - * Disable streaming of PDF file data. By default PDF.js attempts to load PDF - * in chunks. This default behavior can be disabled. - * @var {boolean} - */ - PDFJS.disableStream = (PDFJS.disableStream === undefined ? - false : PDFJS.disableStream); - - /** - * Disable pre-fetching of PDF file data. When range requests are enabled - * PDF.js will automatically keep fetching more data even if it isn't needed - * to display the current page. This default behavior can be disabled. - * - * NOTE: It is also necessary to disable streaming, see above, - * in order for disabling of pre-fetching to work correctly. - * @var {boolean} - */ - PDFJS.disableAutoFetch = (PDFJS.disableAutoFetch === undefined ? - false : PDFJS.disableAutoFetch); - - /** - * Enables special hooks for debugging PDF.js. - * @var {boolean} - */ - PDFJS.pdfBug = (PDFJS.pdfBug === undefined ? false : PDFJS.pdfBug); - - /** - * Enables transfer usage in postMessage for ArrayBuffers. - * @var {boolean} - */ - PDFJS.postMessageTransfers = (PDFJS.postMessageTransfers === undefined ? - true : PDFJS.postMessageTransfers); - - /** - * Disables URL.createObjectURL usage. - * @var {boolean} - */ - PDFJS.disableCreateObjectURL = (PDFJS.disableCreateObjectURL === undefined ? - false : PDFJS.disableCreateObjectURL); - - /** - * Disables WebGL usage. - * @var {boolean} - */ - PDFJS.disableWebGL = (PDFJS.disableWebGL === undefined ? - true : PDFJS.disableWebGL); - - /** - * Specifies the |target| attribute for external links. - * The constants from PDFJS.LinkTarget should be used: - * - NONE [default] - * - SELF - * - BLANK - * - PARENT - * - TOP - * @var {number} - */ - PDFJS.externalLinkTarget = (PDFJS.externalLinkTarget === undefined ? - LinkTarget.NONE : PDFJS.externalLinkTarget); - - /** - * Specifies the |rel| attribute for external links. Defaults to stripping - * the referrer. - * @var {string} - */ - PDFJS.externalLinkRel = (PDFJS.externalLinkRel === undefined ? - 'noreferrer' : PDFJS.externalLinkRel); - - /** - * Determines if we can eval strings as JS. Primarily used to improve - * performance for font rendering. - * @var {boolean} - */ - PDFJS.isEvalSupported = (PDFJS.isEvalSupported === undefined ? - true : PDFJS.isEvalSupported); - - var savedOpenExternalLinksInNewWindow = PDFJS.openExternalLinksInNewWindow; - delete PDFJS.openExternalLinksInNewWindow; - Object.defineProperty(PDFJS, 'openExternalLinksInNewWindow', { - get: function () { - return PDFJS.externalLinkTarget === LinkTarget.BLANK; - }, - set: function (value) { - if (value) { - deprecated('PDFJS.openExternalLinksInNewWindow, please use ' + - '"PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK" instead.'); - } - if (PDFJS.externalLinkTarget !== LinkTarget.NONE) { - warn('PDFJS.externalLinkTarget is already initialized'); - return; - } - PDFJS.externalLinkTarget = value ? LinkTarget.BLANK : LinkTarget.NONE; - }, - enumerable: true, - configurable: true - }); - if (savedOpenExternalLinksInNewWindow) { - /** - * (Deprecated) Opens external links in a new window if enabled. - * The default behavior opens external links in the PDF.js window. - * - * NOTE: This property has been deprecated, please use - * `PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK` instead. - * @var {boolean} - */ - PDFJS.openExternalLinksInNewWindow = savedOpenExternalLinksInNewWindow; - } - - PDFJS.getDocument = displayAPI.getDocument; - PDFJS.PDFDataRangeTransport = displayAPI.PDFDataRangeTransport; - PDFJS.PDFWorker = displayAPI.PDFWorker; - - Object.defineProperty(PDFJS, 'hasCanvasTypedArrays', { - configurable: true, - get: function PDFJS_hasCanvasTypedArrays() { - var value = displayDOMUtils.hasCanvasTypedArrays(); - return sharedUtil.shadow(PDFJS, 'hasCanvasTypedArrays', value); - } - }); - PDFJS.CustomStyle = displayDOMUtils.CustomStyle; - PDFJS.LinkTarget = LinkTarget; - PDFJS.addLinkAttributes = displayDOMUtils.addLinkAttributes; - PDFJS.getFilenameFromUrl = displayDOMUtils.getFilenameFromUrl; - PDFJS.isExternalLinkTargetSet = displayDOMUtils.isExternalLinkTargetSet; - - PDFJS.AnnotationLayer = displayAnnotationLayer.AnnotationLayer; - - PDFJS.renderTextLayer = displayTextLayer.renderTextLayer; - - PDFJS.Metadata = displayMetadata.Metadata; - - PDFJS.SVGGraphics = displaySVG.SVGGraphics; - - PDFJS.UnsupportedManager = displayAPI._UnsupportedManager; - - exports.globalScope = globalScope; - exports.isWorker = isWorker; - exports.PDFJS = globalScope.PDFJS; -})); - }).call(pdfjsLibs); - - exports.PDFJS = pdfjsLibs.pdfjsDisplayGlobal.PDFJS; - exports.build = pdfjsLibs.pdfjsDisplayAPI.build; - exports.version = pdfjsLibs.pdfjsDisplayAPI.version; - exports.getDocument = pdfjsLibs.pdfjsDisplayAPI.getDocument; - exports.PDFDataRangeTransport = - pdfjsLibs.pdfjsDisplayAPI.PDFDataRangeTransport; - exports.PDFWorker = pdfjsLibs.pdfjsDisplayAPI.PDFWorker; - exports.renderTextLayer = pdfjsLibs.pdfjsDisplayTextLayer.renderTextLayer; - exports.AnnotationLayer = - pdfjsLibs.pdfjsDisplayAnnotationLayer.AnnotationLayer; - exports.CustomStyle = pdfjsLibs.pdfjsDisplayDOMUtils.CustomStyle; - exports.PasswordResponses = pdfjsLibs.pdfjsSharedUtil.PasswordResponses; - exports.InvalidPDFException = pdfjsLibs.pdfjsSharedUtil.InvalidPDFException; - exports.MissingPDFException = pdfjsLibs.pdfjsSharedUtil.MissingPDFException; - exports.SVGGraphics = pdfjsLibs.pdfjsDisplaySVG.SVGGraphics; - exports.UnexpectedResponseException = - pdfjsLibs.pdfjsSharedUtil.UnexpectedResponseException; - exports.OPS = pdfjsLibs.pdfjsSharedUtil.OPS; - exports.UNSUPPORTED_FEATURES = pdfjsLibs.pdfjsSharedUtil.UNSUPPORTED_FEATURES; - exports.isValidUrl = pdfjsLibs.pdfjsSharedUtil.isValidUrl; - exports.createObjectURL = pdfjsLibs.pdfjsSharedUtil.createObjectURL; - exports.removeNullCharacters = pdfjsLibs.pdfjsSharedUtil.removeNullCharacters; - exports.shadow = pdfjsLibs.pdfjsSharedUtil.shadow; - exports.createBlob = pdfjsLibs.pdfjsSharedUtil.createBlob; - exports.getFilenameFromUrl = - pdfjsLibs.pdfjsDisplayDOMUtils.getFilenameFromUrl; - exports.addLinkAttributes = pdfjsLibs.pdfjsDisplayDOMUtils.addLinkAttributes; -})); - diff --git a/services/web/public/js/libs/pdfjs-1.6.210p1/pdf.worker.js b/services/web/public/js/libs/pdfjs-1.6.210p1/pdf.worker.js deleted file mode 100644 index 3c9afed587..0000000000 --- a/services/web/public/js/libs/pdfjs-1.6.210p1/pdf.worker.js +++ /dev/null @@ -1,43512 +0,0 @@ -/* Copyright 2012 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* jshint globalstrict: false */ -/* umdutils ignore */ - -(function (root, factory) { - 'use strict'; - if (typeof define === 'function' && define.amd) { -define('pdfjs-dist/build/pdf.worker', ['exports'], factory); - } else if (typeof exports !== 'undefined') { - factory(exports); - } else { -factory((root.pdfjsDistBuildPdfWorker = {})); - } -}(this, function (exports) { - // Use strict in our context only - users might not want it - 'use strict'; - -var pdfjsVersion = '1.6.210'; -var pdfjsBuild = '4ce2356'; - - var pdfjsFilePath = - typeof document !== 'undefined' && document.currentScript ? - document.currentScript.src : null; - - var pdfjsLibs = {}; - - (function pdfjsWrapper() { - - - -(function (root, factory) { - { - factory((root.pdfjsCoreArithmeticDecoder = {})); - } -}(this, function (exports) { - -/* This class implements the QM Coder decoding as defined in - * JPEG 2000 Part I Final Committee Draft Version 1.0 - * Annex C.3 Arithmetic decoding procedure - * available at http://www.jpeg.org/public/fcd15444-1.pdf - * - * The arithmetic decoder is used in conjunction with context models to decode - * JPEG2000 and JBIG2 streams. - */ -var ArithmeticDecoder = (function ArithmeticDecoderClosure() { - // Table C-2 - var QeTable = [ - {qe: 0x5601, nmps: 1, nlps: 1, switchFlag: 1}, - {qe: 0x3401, nmps: 2, nlps: 6, switchFlag: 0}, - {qe: 0x1801, nmps: 3, nlps: 9, switchFlag: 0}, - {qe: 0x0AC1, nmps: 4, nlps: 12, switchFlag: 0}, - {qe: 0x0521, nmps: 5, nlps: 29, switchFlag: 0}, - {qe: 0x0221, nmps: 38, nlps: 33, switchFlag: 0}, - {qe: 0x5601, nmps: 7, nlps: 6, switchFlag: 1}, - {qe: 0x5401, nmps: 8, nlps: 14, switchFlag: 0}, - {qe: 0x4801, nmps: 9, nlps: 14, switchFlag: 0}, - {qe: 0x3801, nmps: 10, nlps: 14, switchFlag: 0}, - {qe: 0x3001, nmps: 11, nlps: 17, switchFlag: 0}, - {qe: 0x2401, nmps: 12, nlps: 18, switchFlag: 0}, - {qe: 0x1C01, nmps: 13, nlps: 20, switchFlag: 0}, - {qe: 0x1601, nmps: 29, nlps: 21, switchFlag: 0}, - {qe: 0x5601, nmps: 15, nlps: 14, switchFlag: 1}, - {qe: 0x5401, nmps: 16, nlps: 14, switchFlag: 0}, - {qe: 0x5101, nmps: 17, nlps: 15, switchFlag: 0}, - {qe: 0x4801, nmps: 18, nlps: 16, switchFlag: 0}, - {qe: 0x3801, nmps: 19, nlps: 17, switchFlag: 0}, - {qe: 0x3401, nmps: 20, nlps: 18, switchFlag: 0}, - {qe: 0x3001, nmps: 21, nlps: 19, switchFlag: 0}, - {qe: 0x2801, nmps: 22, nlps: 19, switchFlag: 0}, - {qe: 0x2401, nmps: 23, nlps: 20, switchFlag: 0}, - {qe: 0x2201, nmps: 24, nlps: 21, switchFlag: 0}, - {qe: 0x1C01, nmps: 25, nlps: 22, switchFlag: 0}, - {qe: 0x1801, nmps: 26, nlps: 23, switchFlag: 0}, - {qe: 0x1601, nmps: 27, nlps: 24, switchFlag: 0}, - {qe: 0x1401, nmps: 28, nlps: 25, switchFlag: 0}, - {qe: 0x1201, nmps: 29, nlps: 26, switchFlag: 0}, - {qe: 0x1101, nmps: 30, nlps: 27, switchFlag: 0}, - {qe: 0x0AC1, nmps: 31, nlps: 28, switchFlag: 0}, - {qe: 0x09C1, nmps: 32, nlps: 29, switchFlag: 0}, - {qe: 0x08A1, nmps: 33, nlps: 30, switchFlag: 0}, - {qe: 0x0521, nmps: 34, nlps: 31, switchFlag: 0}, - {qe: 0x0441, nmps: 35, nlps: 32, switchFlag: 0}, - {qe: 0x02A1, nmps: 36, nlps: 33, switchFlag: 0}, - {qe: 0x0221, nmps: 37, nlps: 34, switchFlag: 0}, - {qe: 0x0141, nmps: 38, nlps: 35, switchFlag: 0}, - {qe: 0x0111, nmps: 39, nlps: 36, switchFlag: 0}, - {qe: 0x0085, nmps: 40, nlps: 37, switchFlag: 0}, - {qe: 0x0049, nmps: 41, nlps: 38, switchFlag: 0}, - {qe: 0x0025, nmps: 42, nlps: 39, switchFlag: 0}, - {qe: 0x0015, nmps: 43, nlps: 40, switchFlag: 0}, - {qe: 0x0009, nmps: 44, nlps: 41, switchFlag: 0}, - {qe: 0x0005, nmps: 45, nlps: 42, switchFlag: 0}, - {qe: 0x0001, nmps: 45, nlps: 43, switchFlag: 0}, - {qe: 0x5601, nmps: 46, nlps: 46, switchFlag: 0} - ]; - - // C.3.5 Initialisation of the decoder (INITDEC) - function ArithmeticDecoder(data, start, end) { - this.data = data; - this.bp = start; - this.dataEnd = end; - - this.chigh = data[start]; - this.clow = 0; - - this.byteIn(); - - this.chigh = ((this.chigh << 7) & 0xFFFF) | ((this.clow >> 9) & 0x7F); - this.clow = (this.clow << 7) & 0xFFFF; - this.ct -= 7; - this.a = 0x8000; - } - - ArithmeticDecoder.prototype = { - // C.3.4 Compressed data input (BYTEIN) - byteIn: function ArithmeticDecoder_byteIn() { - var data = this.data; - var bp = this.bp; - if (data[bp] === 0xFF) { - var b1 = data[bp + 1]; - if (b1 > 0x8F) { - this.clow += 0xFF00; - this.ct = 8; - } else { - bp++; - this.clow += (data[bp] << 9); - this.ct = 7; - this.bp = bp; - } - } else { - bp++; - this.clow += bp < this.dataEnd ? (data[bp] << 8) : 0xFF00; - this.ct = 8; - this.bp = bp; - } - if (this.clow > 0xFFFF) { - this.chigh += (this.clow >> 16); - this.clow &= 0xFFFF; - } - }, - // C.3.2 Decoding a decision (DECODE) - readBit: function ArithmeticDecoder_readBit(contexts, pos) { - // contexts are packed into 1 byte: - // highest 7 bits carry cx.index, lowest bit carries cx.mps - var cx_index = contexts[pos] >> 1, cx_mps = contexts[pos] & 1; - var qeTableIcx = QeTable[cx_index]; - var qeIcx = qeTableIcx.qe; - var d; - var a = this.a - qeIcx; - - if (this.chigh < qeIcx) { - // exchangeLps - if (a < qeIcx) { - a = qeIcx; - d = cx_mps; - cx_index = qeTableIcx.nmps; - } else { - a = qeIcx; - d = 1 ^ cx_mps; - if (qeTableIcx.switchFlag === 1) { - cx_mps = d; - } - cx_index = qeTableIcx.nlps; - } - } else { - this.chigh -= qeIcx; - if ((a & 0x8000) !== 0) { - this.a = a; - return cx_mps; - } - // exchangeMps - if (a < qeIcx) { - d = 1 ^ cx_mps; - if (qeTableIcx.switchFlag === 1) { - cx_mps = d; - } - cx_index = qeTableIcx.nlps; - } else { - d = cx_mps; - cx_index = qeTableIcx.nmps; - } - } - // C.3.3 renormD; - do { - if (this.ct === 0) { - this.byteIn(); - } - - a <<= 1; - this.chigh = ((this.chigh << 1) & 0xFFFF) | ((this.clow >> 15) & 1); - this.clow = (this.clow << 1) & 0xFFFF; - this.ct--; - } while ((a & 0x8000) === 0); - this.a = a; - - contexts[pos] = cx_index << 1 | cx_mps; - return d; - } - }; - - return ArithmeticDecoder; -})(); - -exports.ArithmeticDecoder = ArithmeticDecoder; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreBidi = {})); - } -}(this, function (exports) { - - // Character types for symbols from 0000 to 00FF. - var baseTypes = [ - 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'S', 'B', 'S', 'WS', - 'B', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', - 'BN', 'BN', 'B', 'B', 'B', 'S', 'WS', 'ON', 'ON', 'ET', 'ET', 'ET', 'ON', - 'ON', 'ON', 'ON', 'ON', 'ON', 'CS', 'ON', 'CS', 'ON', 'EN', 'EN', 'EN', - 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'ON', 'ON', 'ON', 'ON', 'ON', - 'ON', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'ON', 'ON', - 'ON', 'ON', 'ON', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'ON', 'ON', 'ON', 'ON', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'B', 'BN', - 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', - 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', - 'BN', 'CS', 'ON', 'ET', 'ET', 'ET', 'ET', 'ON', 'ON', 'ON', 'ON', 'L', 'ON', - 'ON', 'ON', 'ON', 'ON', 'ET', 'ET', 'EN', 'EN', 'ON', 'L', 'ON', 'ON', 'ON', - 'EN', 'L', 'ON', 'ON', 'ON', 'ON', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', - 'L', 'L', 'L', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L' - ]; - - // Character types for symbols from 0600 to 06FF - var arabicTypes = [ - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'CS', 'AL', 'ON', 'ON', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', - 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', - 'AN', 'ET', 'AN', 'AN', 'AL', 'AL', 'AL', 'NSM', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', - 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'ON', 'NSM', - 'NSM', 'NSM', 'NSM', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', - 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL' - ]; - - function isOdd(i) { - return (i & 1) !== 0; - } - - function isEven(i) { - return (i & 1) === 0; - } - - function findUnequal(arr, start, value) { - for (var j = start, jj = arr.length; j < jj; ++j) { - if (arr[j] !== value) { - return j; - } - } - return j; - } - - function setValues(arr, start, end, value) { - for (var j = start; j < end; ++j) { - arr[j] = value; - } - } - - function reverseValues(arr, start, end) { - for (var i = start, j = end - 1; i < j; ++i, --j) { - var temp = arr[i]; - arr[i] = arr[j]; - arr[j] = temp; - } - } - - function createBidiText(str, isLTR, vertical) { - return { - str: str, - dir: (vertical ? 'ttb' : (isLTR ? 'ltr' : 'rtl')) - }; - } - - // These are used in bidi(), which is called frequently. We re-use them on - // each call to avoid unnecessary allocations. - var chars = []; - var types = []; - - function bidi(str, startLevel, vertical) { - var isLTR = true; - var strLength = str.length; - if (strLength === 0 || vertical) { - return createBidiText(str, isLTR, vertical); - } - - // Get types and fill arrays - chars.length = strLength; - types.length = strLength; - var numBidi = 0; - - var i, ii; - for (i = 0; i < strLength; ++i) { - chars[i] = str.charAt(i); - - var charCode = str.charCodeAt(i); - var charType = 'L'; - if (charCode <= 0x00ff) { - charType = baseTypes[charCode]; - } else if (0x0590 <= charCode && charCode <= 0x05f4) { - charType = 'R'; - } else if (0x0600 <= charCode && charCode <= 0x06ff) { - charType = arabicTypes[charCode & 0xff]; - } else if (0x0700 <= charCode && charCode <= 0x08AC) { - charType = 'AL'; - } - if (charType === 'R' || charType === 'AL' || charType === 'AN') { - numBidi++; - } - types[i] = charType; - } - - // Detect the bidi method - // - If there are no rtl characters then no bidi needed - // - If less than 30% chars are rtl then string is primarily ltr - // - If more than 30% chars are rtl then string is primarily rtl - if (numBidi === 0) { - isLTR = true; - return createBidiText(str, isLTR); - } - - if (startLevel === -1) { - if ((strLength / numBidi) < 0.3) { - isLTR = true; - startLevel = 0; - } else { - isLTR = false; - startLevel = 1; - } - } - - var levels = []; - for (i = 0; i < strLength; ++i) { - levels[i] = startLevel; - } - - /* - X1-X10: skip most of this, since we are NOT doing the embeddings. - */ - var e = (isOdd(startLevel) ? 'R' : 'L'); - var sor = e; - var eor = sor; - - /* - W1. Examine each non-spacing mark (NSM) in the level run, and change the - type of the NSM to the type of the previous character. If the NSM is at the - start of the level run, it will get the type of sor. - */ - var lastType = sor; - for (i = 0; i < strLength; ++i) { - if (types[i] === 'NSM') { - types[i] = lastType; - } else { - lastType = types[i]; - } - } - - /* - W2. Search backwards from each instance of a European number until the - first strong type (R, L, AL, or sor) is found. If an AL is found, change - the type of the European number to Arabic number. - */ - lastType = sor; - var t; - for (i = 0; i < strLength; ++i) { - t = types[i]; - if (t === 'EN') { - types[i] = (lastType === 'AL') ? 'AN' : 'EN'; - } else if (t === 'R' || t === 'L' || t === 'AL') { - lastType = t; - } - } - - /* - W3. Change all ALs to R. - */ - for (i = 0; i < strLength; ++i) { - t = types[i]; - if (t === 'AL') { - types[i] = 'R'; - } - } - - /* - W4. A single European separator between two European numbers changes to a - European number. A single common separator between two numbers of the same - type changes to that type: - */ - for (i = 1; i < strLength - 1; ++i) { - if (types[i] === 'ES' && types[i - 1] === 'EN' && types[i + 1] === 'EN') { - types[i] = 'EN'; - } - if (types[i] === 'CS' && - (types[i - 1] === 'EN' || types[i - 1] === 'AN') && - types[i + 1] === types[i - 1]) { - types[i] = types[i - 1]; - } - } - - /* - W5. A sequence of European terminators adjacent to European numbers changes - to all European numbers: - */ - for (i = 0; i < strLength; ++i) { - if (types[i] === 'EN') { - // do before - var j; - for (j = i - 1; j >= 0; --j) { - if (types[j] !== 'ET') { - break; - } - types[j] = 'EN'; - } - // do after - for (j = i + 1; j < strLength; ++j) { - if (types[j] !== 'ET') { - break; - } - types[j] = 'EN'; - } - } - } - - /* - W6. Otherwise, separators and terminators change to Other Neutral: - */ - for (i = 0; i < strLength; ++i) { - t = types[i]; - if (t === 'WS' || t === 'ES' || t === 'ET' || t === 'CS') { - types[i] = 'ON'; - } - } - - /* - W7. Search backwards from each instance of a European number until the - first strong type (R, L, or sor) is found. If an L is found, then change - the type of the European number to L. - */ - lastType = sor; - for (i = 0; i < strLength; ++i) { - t = types[i]; - if (t === 'EN') { - types[i] = ((lastType === 'L') ? 'L' : 'EN'); - } else if (t === 'R' || t === 'L') { - lastType = t; - } - } - - /* - N1. A sequence of neutrals takes the direction of the surrounding strong - text if the text on both sides has the same direction. European and Arabic - numbers are treated as though they were R. Start-of-level-run (sor) and - end-of-level-run (eor) are used at level run boundaries. - */ - for (i = 0; i < strLength; ++i) { - if (types[i] === 'ON') { - var end = findUnequal(types, i + 1, 'ON'); - var before = sor; - if (i > 0) { - before = types[i - 1]; - } - - var after = eor; - if (end + 1 < strLength) { - after = types[end + 1]; - } - if (before !== 'L') { - before = 'R'; - } - if (after !== 'L') { - after = 'R'; - } - if (before === after) { - setValues(types, i, end, before); - } - i = end - 1; // reset to end (-1 so next iteration is ok) - } - } - - /* - N2. Any remaining neutrals take the embedding direction. - */ - for (i = 0; i < strLength; ++i) { - if (types[i] === 'ON') { - types[i] = e; - } - } - - /* - I1. For all characters with an even (left-to-right) embedding direction, - those of type R go up one level and those of type AN or EN go up two - levels. - I2. For all characters with an odd (right-to-left) embedding direction, - those of type L, EN or AN go up one level. - */ - for (i = 0; i < strLength; ++i) { - t = types[i]; - if (isEven(levels[i])) { - if (t === 'R') { - levels[i] += 1; - } else if (t === 'AN' || t === 'EN') { - levels[i] += 2; - } - } else { // isOdd - if (t === 'L' || t === 'AN' || t === 'EN') { - levels[i] += 1; - } - } - } - - /* - L1. On each line, reset the embedding level of the following characters to - the paragraph embedding level: - - segment separators, - paragraph separators, - any sequence of whitespace characters preceding a segment separator or - paragraph separator, and any sequence of white space characters at the end - of the line. - */ - - // don't bother as text is only single line - - /* - L2. From the highest level found in the text to the lowest odd level on - each line, reverse any contiguous sequence of characters that are at that - level or higher. - */ - - // find highest level & lowest odd level - var highestLevel = -1; - var lowestOddLevel = 99; - var level; - for (i = 0, ii = levels.length; i < ii; ++i) { - level = levels[i]; - if (highestLevel < level) { - highestLevel = level; - } - if (lowestOddLevel > level && isOdd(level)) { - lowestOddLevel = level; - } - } - - // now reverse between those limits - for (level = highestLevel; level >= lowestOddLevel; --level) { - // find segments to reverse - var start = -1; - for (i = 0, ii = levels.length; i < ii; ++i) { - if (levels[i] < level) { - if (start >= 0) { - reverseValues(chars, start, i); - start = -1; - } - } else if (start < 0) { - start = i; - } - } - if (start >= 0) { - reverseValues(chars, start, levels.length); - } - } - - /* - L3. Combining marks applied to a right-to-left base character will at this - point precede their base character. If the rendering engine expects them to - follow the base characters in the final display process, then the ordering - of the marks and the base character must be reversed. - */ - - // don't bother for now - - /* - L4. A character that possesses the mirrored property as specified by - Section 4.7, Mirrored, must be depicted by a mirrored glyph if the resolved - directionality of that character is R. - */ - - // don't mirror as characters are already mirrored in the pdf - - // Finally, return string - for (i = 0, ii = chars.length; i < ii; ++i) { - var ch = chars[i]; - if (ch === '<' || ch === '>') { - chars[i] = ''; - } - } - return createBidiText(chars.join(''), isLTR); - } - -exports.bidi = bidi; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreCharsets = {})); - } -}(this, function (exports) { - -var ISOAdobeCharset = [ - '.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', - 'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright', - 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', - 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', - 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', - 'at', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', - 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', - 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', - 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', - 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', - 'braceleft', 'bar', 'braceright', 'asciitilde', 'exclamdown', 'cent', - 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', - 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', - 'guilsinglright', 'fi', 'fl', 'endash', 'dagger', 'daggerdbl', - 'periodcentered', 'paragraph', 'bullet', 'quotesinglbase', - 'quotedblbase', 'quotedblright', 'guillemotright', 'ellipsis', - 'perthousand', 'questiondown', 'grave', 'acute', 'circumflex', 'tilde', - 'macron', 'breve', 'dotaccent', 'dieresis', 'ring', 'cedilla', - 'hungarumlaut', 'ogonek', 'caron', 'emdash', 'AE', 'ordfeminine', - 'Lslash', 'Oslash', 'OE', 'ordmasculine', 'ae', 'dotlessi', 'lslash', - 'oslash', 'oe', 'germandbls', 'onesuperior', 'logicalnot', 'mu', - 'trademark', 'Eth', 'onehalf', 'plusminus', 'Thorn', 'onequarter', - 'divide', 'brokenbar', 'degree', 'thorn', 'threequarters', 'twosuperior', - 'registered', 'minus', 'eth', 'multiply', 'threesuperior', 'copyright', - 'Aacute', 'Acircumflex', 'Adieresis', 'Agrave', 'Aring', 'Atilde', - 'Ccedilla', 'Eacute', 'Ecircumflex', 'Edieresis', 'Egrave', 'Iacute', - 'Icircumflex', 'Idieresis', 'Igrave', 'Ntilde', 'Oacute', 'Ocircumflex', - 'Odieresis', 'Ograve', 'Otilde', 'Scaron', 'Uacute', 'Ucircumflex', - 'Udieresis', 'Ugrave', 'Yacute', 'Ydieresis', 'Zcaron', 'aacute', - 'acircumflex', 'adieresis', 'agrave', 'aring', 'atilde', 'ccedilla', - 'eacute', 'ecircumflex', 'edieresis', 'egrave', 'iacute', 'icircumflex', - 'idieresis', 'igrave', 'ntilde', 'oacute', 'ocircumflex', 'odieresis', - 'ograve', 'otilde', 'scaron', 'uacute', 'ucircumflex', 'udieresis', - 'ugrave', 'yacute', 'ydieresis', 'zcaron' -]; - -var ExpertCharset = [ - '.notdef', 'space', 'exclamsmall', 'Hungarumlautsmall', 'dollaroldstyle', - 'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior', - 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', - 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', - 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', - 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', - 'colon', 'semicolon', 'commasuperior', 'threequartersemdash', - 'periodsuperior', 'questionsmall', 'asuperior', 'bsuperior', - 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', 'lsuperior', - 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', - 'tsuperior', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', - 'parenrightinferior', 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', - 'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', - 'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', - 'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', - 'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', - 'onefitted', 'rupiah', 'Tildesmall', 'exclamdownsmall', 'centoldstyle', - 'Lslashsmall', 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', - 'Brevesmall', 'Caronsmall', 'Dotaccentsmall', 'Macronsmall', - 'figuredash', 'hypheninferior', 'Ogoneksmall', 'Ringsmall', - 'Cedillasmall', 'onequarter', 'onehalf', 'threequarters', - 'questiondownsmall', 'oneeighth', 'threeeighths', 'fiveeighths', - 'seveneighths', 'onethird', 'twothirds', 'zerosuperior', 'onesuperior', - 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', - 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', - 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', - 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', - 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', - 'periodinferior', 'commainferior', 'Agravesmall', 'Aacutesmall', - 'Acircumflexsmall', 'Atildesmall', 'Adieresissmall', 'Aringsmall', - 'AEsmall', 'Ccedillasmall', 'Egravesmall', 'Eacutesmall', - 'Ecircumflexsmall', 'Edieresissmall', 'Igravesmall', 'Iacutesmall', - 'Icircumflexsmall', 'Idieresissmall', 'Ethsmall', 'Ntildesmall', - 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', 'Otildesmall', - 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', 'Uacutesmall', - 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', 'Thornsmall', - 'Ydieresissmall' -]; - -var ExpertSubsetCharset = [ - '.notdef', 'space', 'dollaroldstyle', 'dollarsuperior', - 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', - 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', - 'zerooldstyle', 'oneoldstyle', 'twooldstyle', 'threeoldstyle', - 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', - 'eightoldstyle', 'nineoldstyle', 'colon', 'semicolon', 'commasuperior', - 'threequartersemdash', 'periodsuperior', 'asuperior', 'bsuperior', - 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', 'lsuperior', - 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', - 'tsuperior', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', - 'parenrightinferior', 'hyphensuperior', 'colonmonetary', 'onefitted', - 'rupiah', 'centoldstyle', 'figuredash', 'hypheninferior', 'onequarter', - 'onehalf', 'threequarters', 'oneeighth', 'threeeighths', 'fiveeighths', - 'seveneighths', 'onethird', 'twothirds', 'zerosuperior', 'onesuperior', - 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', - 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', - 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', - 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', - 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', - 'periodinferior', 'commainferior' -]; - -exports.ISOAdobeCharset = ISOAdobeCharset; -exports.ExpertCharset = ExpertCharset; -exports.ExpertSubsetCharset = ExpertSubsetCharset; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreEncodings = {})); - } -}(this, function (exports) { - - var ExpertEncoding = [ - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclamsmall', 'Hungarumlautsmall', '', 'dollaroldstyle', - 'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior', - 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', - 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', - 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', - 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'colon', - 'semicolon', 'commasuperior', 'threequartersemdash', 'periodsuperior', - 'questionsmall', '', 'asuperior', 'bsuperior', 'centsuperior', 'dsuperior', - 'esuperior', '', '', 'isuperior', '', '', 'lsuperior', 'msuperior', - 'nsuperior', 'osuperior', '', '', 'rsuperior', 'ssuperior', 'tsuperior', - '', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', '', - 'parenrightinferior', 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', - 'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', - 'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', - 'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', - 'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', - 'onefitted', 'rupiah', 'Tildesmall', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', 'exclamdownsmall', 'centoldstyle', 'Lslashsmall', - '', '', 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', 'Brevesmall', - 'Caronsmall', '', 'Dotaccentsmall', '', '', 'Macronsmall', '', '', - 'figuredash', 'hypheninferior', '', '', 'Ogoneksmall', 'Ringsmall', - 'Cedillasmall', '', '', '', 'onequarter', 'onehalf', 'threequarters', - 'questiondownsmall', 'oneeighth', 'threeeighths', 'fiveeighths', - 'seveneighths', 'onethird', 'twothirds', '', '', 'zerosuperior', - 'onesuperior', 'twosuperior', 'threesuperior', 'foursuperior', - 'fivesuperior', 'sixsuperior', 'sevensuperior', 'eightsuperior', - 'ninesuperior', 'zeroinferior', 'oneinferior', 'twoinferior', - 'threeinferior', 'fourinferior', 'fiveinferior', 'sixinferior', - 'seveninferior', 'eightinferior', 'nineinferior', 'centinferior', - 'dollarinferior', 'periodinferior', 'commainferior', 'Agravesmall', - 'Aacutesmall', 'Acircumflexsmall', 'Atildesmall', 'Adieresissmall', - 'Aringsmall', 'AEsmall', 'Ccedillasmall', 'Egravesmall', 'Eacutesmall', - 'Ecircumflexsmall', 'Edieresissmall', 'Igravesmall', 'Iacutesmall', - 'Icircumflexsmall', 'Idieresissmall', 'Ethsmall', 'Ntildesmall', - 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', 'Otildesmall', - 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', 'Uacutesmall', - 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', 'Thornsmall', - 'Ydieresissmall']; - - var MacExpertEncoding = [ - '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclamsmall', 'Hungarumlautsmall', 'centoldstyle', - 'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', 'Acutesmall', - 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', - 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', 'zerooldstyle', - 'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle', - 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', - 'nineoldstyle', 'colon', 'semicolon', '', 'threequartersemdash', '', - 'questionsmall', '', '', '', '', 'Ethsmall', '', '', 'onequarter', - 'onehalf', 'threequarters', 'oneeighth', 'threeeighths', 'fiveeighths', - 'seveneighths', 'onethird', 'twothirds', '', '', '', '', '', '', 'ff', - 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', '', 'parenrightinferior', - 'Circumflexsmall', 'hypheninferior', 'Gravesmall', 'Asmall', 'Bsmall', - 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall', - 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall', - 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall', - 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah', - 'Tildesmall', '', '', 'asuperior', 'centsuperior', '', '', '', '', - 'Aacutesmall', 'Agravesmall', 'Acircumflexsmall', 'Adieresissmall', - 'Atildesmall', 'Aringsmall', 'Ccedillasmall', 'Eacutesmall', 'Egravesmall', - 'Ecircumflexsmall', 'Edieresissmall', 'Iacutesmall', 'Igravesmall', - 'Icircumflexsmall', 'Idieresissmall', 'Ntildesmall', 'Oacutesmall', - 'Ogravesmall', 'Ocircumflexsmall', 'Odieresissmall', 'Otildesmall', - 'Uacutesmall', 'Ugravesmall', 'Ucircumflexsmall', 'Udieresissmall', '', - 'eightsuperior', 'fourinferior', 'threeinferior', 'sixinferior', - 'eightinferior', 'seveninferior', 'Scaronsmall', '', 'centinferior', - 'twoinferior', '', 'Dieresissmall', '', 'Caronsmall', 'osuperior', - 'fiveinferior', '', 'commainferior', 'periodinferior', 'Yacutesmall', '', - 'dollarinferior', '', 'Thornsmall', '', 'nineinferior', 'zeroinferior', - 'Zcaronsmall', 'AEsmall', 'Oslashsmall', 'questiondownsmall', - 'oneinferior', 'Lslashsmall', '', '', '', '', '', '', 'Cedillasmall', '', - '', '', '', '', 'OEsmall', 'figuredash', 'hyphensuperior', '', '', '', '', - 'exclamdownsmall', '', 'Ydieresissmall', '', 'onesuperior', 'twosuperior', - 'threesuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', - 'sevensuperior', 'ninesuperior', 'zerosuperior', '', 'esuperior', - 'rsuperior', 'tsuperior', '', '', 'isuperior', 'ssuperior', 'dsuperior', - '', '', '', '', '', 'lsuperior', 'Ogoneksmall', 'Brevesmall', - 'Macronsmall', 'bsuperior', 'nsuperior', 'msuperior', 'commasuperior', - 'periodsuperior', 'Dotaccentsmall', 'Ringsmall']; - - var MacRomanEncoding = [ - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', - 'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus', - 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', - 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', - 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', - 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', - 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', - 'asciicircum', 'underscore', 'grave', 'a', 'b', 'c', 'd', 'e', 'f', 'g', - 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', - 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', '', - 'Adieresis', 'Aring', 'Ccedilla', 'Eacute', 'Ntilde', 'Odieresis', - 'Udieresis', 'aacute', 'agrave', 'acircumflex', 'adieresis', 'atilde', - 'aring', 'ccedilla', 'eacute', 'egrave', 'ecircumflex', 'edieresis', - 'iacute', 'igrave', 'icircumflex', 'idieresis', 'ntilde', 'oacute', - 'ograve', 'ocircumflex', 'odieresis', 'otilde', 'uacute', 'ugrave', - 'ucircumflex', 'udieresis', 'dagger', 'degree', 'cent', 'sterling', - 'section', 'bullet', 'paragraph', 'germandbls', 'registered', 'copyright', - 'trademark', 'acute', 'dieresis', 'notequal', 'AE', 'Oslash', 'infinity', - 'plusminus', 'lessequal', 'greaterequal', 'yen', 'mu', 'partialdiff', - 'summation', 'product', 'pi', 'integral', 'ordfeminine', 'ordmasculine', - 'Omega', 'ae', 'oslash', 'questiondown', 'exclamdown', 'logicalnot', - 'radical', 'florin', 'approxequal', 'Delta', 'guillemotleft', - 'guillemotright', 'ellipsis', 'space', 'Agrave', 'Atilde', 'Otilde', 'OE', - 'oe', 'endash', 'emdash', 'quotedblleft', 'quotedblright', 'quoteleft', - 'quoteright', 'divide', 'lozenge', 'ydieresis', 'Ydieresis', 'fraction', - 'currency', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'daggerdbl', - 'periodcentered', 'quotesinglbase', 'quotedblbase', 'perthousand', - 'Acircumflex', 'Ecircumflex', 'Aacute', 'Edieresis', 'Egrave', 'Iacute', - 'Icircumflex', 'Idieresis', 'Igrave', 'Oacute', 'Ocircumflex', 'apple', - 'Ograve', 'Uacute', 'Ucircumflex', 'Ugrave', 'dotlessi', 'circumflex', - 'tilde', 'macron', 'breve', 'dotaccent', 'ring', 'cedilla', 'hungarumlaut', - 'ogonek', 'caron']; - - var StandardEncoding = [ - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', - 'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus', - 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', - 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', - 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', - 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', - 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', - 'asciicircum', 'underscore', 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f', - 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', - 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'exclamdown', - 'cent', 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', - 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', - 'guilsinglright', 'fi', 'fl', '', 'endash', 'dagger', 'daggerdbl', - 'periodcentered', '', 'paragraph', 'bullet', 'quotesinglbase', - 'quotedblbase', 'quotedblright', 'guillemotright', 'ellipsis', - 'perthousand', '', 'questiondown', '', 'grave', 'acute', 'circumflex', - 'tilde', 'macron', 'breve', 'dotaccent', 'dieresis', '', 'ring', 'cedilla', - '', 'hungarumlaut', 'ogonek', 'caron', 'emdash', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', 'AE', '', 'ordfeminine', '', '', - '', '', 'Lslash', 'Oslash', 'OE', 'ordmasculine', '', '', '', '', '', 'ae', - '', '', '', 'dotlessi', '', '', 'lslash', 'oslash', 'oe', 'germandbls']; - - var WinAnsiEncoding = [ - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', - 'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus', - 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', - 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', - 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', - 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', - 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', - 'asciicircum', 'underscore', 'grave', 'a', 'b', 'c', 'd', 'e', 'f', 'g', - 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', - 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', - 'bullet', 'Euro', 'bullet', 'quotesinglbase', 'florin', 'quotedblbase', - 'ellipsis', 'dagger', 'daggerdbl', 'circumflex', 'perthousand', 'Scaron', - 'guilsinglleft', 'OE', 'bullet', 'Zcaron', 'bullet', 'bullet', 'quoteleft', - 'quoteright', 'quotedblleft', 'quotedblright', 'bullet', 'endash', - 'emdash', 'tilde', 'trademark', 'scaron', 'guilsinglright', 'oe', 'bullet', - 'zcaron', 'Ydieresis', 'space', 'exclamdown', 'cent', 'sterling', - 'currency', 'yen', 'brokenbar', 'section', 'dieresis', 'copyright', - 'ordfeminine', 'guillemotleft', 'logicalnot', 'hyphen', 'registered', - 'macron', 'degree', 'plusminus', 'twosuperior', 'threesuperior', 'acute', - 'mu', 'paragraph', 'periodcentered', 'cedilla', 'onesuperior', - 'ordmasculine', 'guillemotright', 'onequarter', 'onehalf', 'threequarters', - 'questiondown', 'Agrave', 'Aacute', 'Acircumflex', 'Atilde', 'Adieresis', - 'Aring', 'AE', 'Ccedilla', 'Egrave', 'Eacute', 'Ecircumflex', 'Edieresis', - 'Igrave', 'Iacute', 'Icircumflex', 'Idieresis', 'Eth', 'Ntilde', 'Ograve', - 'Oacute', 'Ocircumflex', 'Otilde', 'Odieresis', 'multiply', 'Oslash', - 'Ugrave', 'Uacute', 'Ucircumflex', 'Udieresis', 'Yacute', 'Thorn', - 'germandbls', 'agrave', 'aacute', 'acircumflex', 'atilde', 'adieresis', - 'aring', 'ae', 'ccedilla', 'egrave', 'eacute', 'ecircumflex', 'edieresis', - 'igrave', 'iacute', 'icircumflex', 'idieresis', 'eth', 'ntilde', 'ograve', - 'oacute', 'ocircumflex', 'otilde', 'odieresis', 'divide', 'oslash', - 'ugrave', 'uacute', 'ucircumflex', 'udieresis', 'yacute', 'thorn', - 'ydieresis']; - - var SymbolSetEncoding = [ - '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'exclam', 'universal', 'numbersign', 'existential', 'percent', - 'ampersand', 'suchthat', 'parenleft', 'parenright', 'asteriskmath', 'plus', - 'comma', 'minus', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', - 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', - 'equal', 'greater', 'question', 'congruent', 'Alpha', 'Beta', 'Chi', - 'Delta', 'Epsilon', 'Phi', 'Gamma', 'Eta', 'Iota', 'theta1', 'Kappa', - 'Lambda', 'Mu', 'Nu', 'Omicron', 'Pi', 'Theta', 'Rho', 'Sigma', 'Tau', - 'Upsilon', 'sigma1', 'Omega', 'Xi', 'Psi', 'Zeta', 'bracketleft', - 'therefore', 'bracketright', 'perpendicular', 'underscore', 'radicalex', - 'alpha', 'beta', 'chi', 'delta', 'epsilon', 'phi', 'gamma', 'eta', 'iota', - 'phi1', 'kappa', 'lambda', 'mu', 'nu', 'omicron', 'pi', 'theta', 'rho', - 'sigma', 'tau', 'upsilon', 'omega1', 'omega', 'xi', 'psi', 'zeta', - 'braceleft', 'bar', 'braceright', 'similar', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', 'Euro', 'Upsilon1', 'minute', 'lessequal', - 'fraction', 'infinity', 'florin', 'club', 'diamond', 'heart', 'spade', - 'arrowboth', 'arrowleft', 'arrowup', 'arrowright', 'arrowdown', 'degree', - 'plusminus', 'second', 'greaterequal', 'multiply', 'proportional', - 'partialdiff', 'bullet', 'divide', 'notequal', 'equivalence', - 'approxequal', 'ellipsis', 'arrowvertex', 'arrowhorizex', 'carriagereturn', - 'aleph', 'Ifraktur', 'Rfraktur', 'weierstrass', 'circlemultiply', - 'circleplus', 'emptyset', 'intersection', 'union', 'propersuperset', - 'reflexsuperset', 'notsubset', 'propersubset', 'reflexsubset', 'element', - 'notelement', 'angle', 'gradient', 'registerserif', 'copyrightserif', - 'trademarkserif', 'product', 'radical', 'dotmath', 'logicalnot', - 'logicaland', 'logicalor', 'arrowdblboth', 'arrowdblleft', 'arrowdblup', - 'arrowdblright', 'arrowdbldown', 'lozenge', 'angleleft', 'registersans', - 'copyrightsans', 'trademarksans', 'summation', 'parenlefttp', - 'parenleftex', 'parenleftbt', 'bracketlefttp', 'bracketleftex', - 'bracketleftbt', 'bracelefttp', 'braceleftmid', 'braceleftbt', 'braceex', - '', 'angleright', 'integral', 'integraltp', 'integralex', 'integralbt', - 'parenrighttp', 'parenrightex', 'parenrightbt', 'bracketrighttp', - 'bracketrightex', 'bracketrightbt', 'bracerighttp', 'bracerightmid', - 'bracerightbt']; - - var ZapfDingbatsEncoding = [ - '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - 'space', 'a1', 'a2', 'a202', 'a3', 'a4', 'a5', 'a119', 'a118', 'a117', - 'a11', 'a12', 'a13', 'a14', 'a15', 'a16', 'a105', 'a17', 'a18', 'a19', - 'a20', 'a21', 'a22', 'a23', 'a24', 'a25', 'a26', 'a27', 'a28', 'a6', 'a7', - 'a8', 'a9', 'a10', 'a29', 'a30', 'a31', 'a32', 'a33', 'a34', 'a35', 'a36', - 'a37', 'a38', 'a39', 'a40', 'a41', 'a42', 'a43', 'a44', 'a45', 'a46', - 'a47', 'a48', 'a49', 'a50', 'a51', 'a52', 'a53', 'a54', 'a55', 'a56', - 'a57', 'a58', 'a59', 'a60', 'a61', 'a62', 'a63', 'a64', 'a65', 'a66', - 'a67', 'a68', 'a69', 'a70', 'a71', 'a72', 'a73', 'a74', 'a203', 'a75', - 'a204', 'a76', 'a77', 'a78', 'a79', 'a81', 'a82', 'a83', 'a84', 'a97', - 'a98', 'a99', 'a100', '', 'a89', 'a90', 'a93', 'a94', 'a91', 'a92', 'a205', - 'a85', 'a206', 'a86', 'a87', 'a88', 'a95', 'a96', '', '', '', '', '', '', - '', '', '', '', '', '', '', '', '', '', '', '', '', 'a101', 'a102', 'a103', - 'a104', 'a106', 'a107', 'a108', 'a112', 'a111', 'a110', 'a109', 'a120', - 'a121', 'a122', 'a123', 'a124', 'a125', 'a126', 'a127', 'a128', 'a129', - 'a130', 'a131', 'a132', 'a133', 'a134', 'a135', 'a136', 'a137', 'a138', - 'a139', 'a140', 'a141', 'a142', 'a143', 'a144', 'a145', 'a146', 'a147', - 'a148', 'a149', 'a150', 'a151', 'a152', 'a153', 'a154', 'a155', 'a156', - 'a157', 'a158', 'a159', 'a160', 'a161', 'a163', 'a164', 'a196', 'a165', - 'a192', 'a166', 'a167', 'a168', 'a169', 'a170', 'a171', 'a172', 'a173', - 'a162', 'a174', 'a175', 'a176', 'a177', 'a178', 'a179', 'a193', 'a180', - 'a199', 'a181', 'a200', 'a182', '', 'a201', 'a183', 'a184', 'a197', 'a185', - 'a194', 'a198', 'a186', 'a195', 'a187', 'a188', 'a189', 'a190', 'a191']; - - function getEncoding(encodingName) { - switch (encodingName) { - case 'WinAnsiEncoding': - return WinAnsiEncoding; - case 'StandardEncoding': - return StandardEncoding; - case 'MacRomanEncoding': - return MacRomanEncoding; - case 'SymbolSetEncoding': - return SymbolSetEncoding; - case 'ZapfDingbatsEncoding': - return ZapfDingbatsEncoding; - case 'ExpertEncoding': - return ExpertEncoding; - case 'MacExpertEncoding': - return MacExpertEncoding; - default: - return null; - } - } - - exports.WinAnsiEncoding = WinAnsiEncoding; - exports.StandardEncoding = StandardEncoding; - exports.MacRomanEncoding = MacRomanEncoding; - exports.SymbolSetEncoding = SymbolSetEncoding; - exports.ZapfDingbatsEncoding = ZapfDingbatsEncoding; - exports.ExpertEncoding = ExpertEncoding; - exports.getEncoding = getEncoding; -})); - - -(function (root, factory) { - { - factory((root.pdfjsSharedUtil = {})); - } -}(this, function (exports) { - -var globalScope = (typeof window !== 'undefined') ? window : - (typeof global !== 'undefined') ? global : - (typeof self !== 'undefined') ? self : this; - -var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; - -var TextRenderingMode = { - FILL: 0, - STROKE: 1, - FILL_STROKE: 2, - INVISIBLE: 3, - FILL_ADD_TO_PATH: 4, - STROKE_ADD_TO_PATH: 5, - FILL_STROKE_ADD_TO_PATH: 6, - ADD_TO_PATH: 7, - FILL_STROKE_MASK: 3, - ADD_TO_PATH_FLAG: 4 -}; - -var ImageKind = { - GRAYSCALE_1BPP: 1, - RGB_24BPP: 2, - RGBA_32BPP: 3 -}; - -var AnnotationType = { - TEXT: 1, - LINK: 2, - FREETEXT: 3, - LINE: 4, - SQUARE: 5, - CIRCLE: 6, - POLYGON: 7, - POLYLINE: 8, - HIGHLIGHT: 9, - UNDERLINE: 10, - SQUIGGLY: 11, - STRIKEOUT: 12, - STAMP: 13, - CARET: 14, - INK: 15, - POPUP: 16, - FILEATTACHMENT: 17, - SOUND: 18, - MOVIE: 19, - WIDGET: 20, - SCREEN: 21, - PRINTERMARK: 22, - TRAPNET: 23, - WATERMARK: 24, - THREED: 25, - REDACT: 26 -}; - -var AnnotationFlag = { - INVISIBLE: 0x01, - HIDDEN: 0x02, - PRINT: 0x04, - NOZOOM: 0x08, - NOROTATE: 0x10, - NOVIEW: 0x20, - READONLY: 0x40, - LOCKED: 0x80, - TOGGLENOVIEW: 0x100, - LOCKEDCONTENTS: 0x200 -}; - -var AnnotationFieldFlag = { - READONLY: 0x0000001, - REQUIRED: 0x0000002, - NOEXPORT: 0x0000004, - MULTILINE: 0x0001000, - PASSWORD: 0x0002000, - NOTOGGLETOOFF: 0x0004000, - RADIO: 0x0008000, - PUSHBUTTON: 0x0010000, - COMBO: 0x0020000, - EDIT: 0x0040000, - SORT: 0x0080000, - FILESELECT: 0x0100000, - MULTISELECT: 0x0200000, - DONOTSPELLCHECK: 0x0400000, - DONOTSCROLL: 0x0800000, - COMB: 0x1000000, - RICHTEXT: 0x2000000, - RADIOSINUNISON: 0x2000000, - COMMITONSELCHANGE: 0x4000000, -}; - -var AnnotationBorderStyleType = { - SOLID: 1, - DASHED: 2, - BEVELED: 3, - INSET: 4, - UNDERLINE: 5 -}; - -var StreamType = { - UNKNOWN: 0, - FLATE: 1, - LZW: 2, - DCT: 3, - JPX: 4, - JBIG: 5, - A85: 6, - AHX: 7, - CCF: 8, - RL: 9 -}; - -var FontType = { - UNKNOWN: 0, - TYPE1: 1, - TYPE1C: 2, - CIDFONTTYPE0: 3, - CIDFONTTYPE0C: 4, - TRUETYPE: 5, - CIDFONTTYPE2: 6, - TYPE3: 7, - OPENTYPE: 8, - TYPE0: 9, - MMTYPE1: 10 -}; - -var VERBOSITY_LEVELS = { - errors: 0, - warnings: 1, - infos: 5 -}; - -// All the possible operations for an operator list. -var OPS = { - // Intentionally start from 1 so it is easy to spot bad operators that will be - // 0's. - dependency: 1, - setLineWidth: 2, - setLineCap: 3, - setLineJoin: 4, - setMiterLimit: 5, - setDash: 6, - setRenderingIntent: 7, - setFlatness: 8, - setGState: 9, - save: 10, - restore: 11, - transform: 12, - moveTo: 13, - lineTo: 14, - curveTo: 15, - curveTo2: 16, - curveTo3: 17, - closePath: 18, - rectangle: 19, - stroke: 20, - closeStroke: 21, - fill: 22, - eoFill: 23, - fillStroke: 24, - eoFillStroke: 25, - closeFillStroke: 26, - closeEOFillStroke: 27, - endPath: 28, - clip: 29, - eoClip: 30, - beginText: 31, - endText: 32, - setCharSpacing: 33, - setWordSpacing: 34, - setHScale: 35, - setLeading: 36, - setFont: 37, - setTextRenderingMode: 38, - setTextRise: 39, - moveText: 40, - setLeadingMoveText: 41, - setTextMatrix: 42, - nextLine: 43, - showText: 44, - showSpacedText: 45, - nextLineShowText: 46, - nextLineSetSpacingShowText: 47, - setCharWidth: 48, - setCharWidthAndBounds: 49, - setStrokeColorSpace: 50, - setFillColorSpace: 51, - setStrokeColor: 52, - setStrokeColorN: 53, - setFillColor: 54, - setFillColorN: 55, - setStrokeGray: 56, - setFillGray: 57, - setStrokeRGBColor: 58, - setFillRGBColor: 59, - setStrokeCMYKColor: 60, - setFillCMYKColor: 61, - shadingFill: 62, - beginInlineImage: 63, - beginImageData: 64, - endInlineImage: 65, - paintXObject: 66, - markPoint: 67, - markPointProps: 68, - beginMarkedContent: 69, - beginMarkedContentProps: 70, - endMarkedContent: 71, - beginCompat: 72, - endCompat: 73, - paintFormXObjectBegin: 74, - paintFormXObjectEnd: 75, - beginGroup: 76, - endGroup: 77, - beginAnnotations: 78, - endAnnotations: 79, - beginAnnotation: 80, - endAnnotation: 81, - paintJpegXObject: 82, - paintImageMaskXObject: 83, - paintImageMaskXObjectGroup: 84, - paintImageXObject: 85, - paintInlineImageXObject: 86, - paintInlineImageXObjectGroup: 87, - paintImageXObjectRepeat: 88, - paintImageMaskXObjectRepeat: 89, - paintSolidColorImageMask: 90, - constructPath: 91 -}; - -var verbosity = VERBOSITY_LEVELS.warnings; - -function setVerbosityLevel(level) { - verbosity = level; -} - -function getVerbosityLevel() { - return verbosity; -} - -// A notice for devs. These are good for things that are helpful to devs, such -// as warning that Workers were disabled, which is important to devs but not -// end users. -function info(msg) { - if (verbosity >= VERBOSITY_LEVELS.infos) { - console.log('Info: ' + msg); - } -} - -// Non-fatal warnings. -function warn(msg) { - if (verbosity >= VERBOSITY_LEVELS.warnings) { - console.log('Warning: ' + msg); - } -} - -// Deprecated API function -- display regardless of the PDFJS.verbosity setting. -function deprecated(details) { - console.log('Deprecated API usage: ' + details); -} - -// Fatal errors that should trigger the fallback UI and halt execution by -// throwing an exception. -function error(msg) { - if (verbosity >= VERBOSITY_LEVELS.errors) { - console.log('Error: ' + msg); - console.log(backtrace()); - } - throw new Error(msg); -} - -function backtrace() { - try { - throw new Error(); - } catch (e) { - return e.stack ? e.stack.split('\n').slice(2).join('\n') : ''; - } -} - -function assert(cond, msg) { - if (!cond) { - error(msg); - } -} - -var UNSUPPORTED_FEATURES = { - unknown: 'unknown', - forms: 'forms', - javaScript: 'javaScript', - smask: 'smask', - shadingPattern: 'shadingPattern', - font: 'font' -}; - -// Checks if URLs have the same origin. For non-HTTP based URLs, returns false. -function isSameOrigin(baseUrl, otherUrl) { - try { - var base = new URL(baseUrl); - if (!base.origin || base.origin === 'null') { - return false; // non-HTTP url - } - } catch (e) { - return false; - } - - var other = new URL(otherUrl, base); - return base.origin === other.origin; -} - -// Validates if URL is safe and allowed, e.g. to avoid XSS. -function isValidUrl(url, allowRelative) { - if (!url || typeof url !== 'string') { - return false; - } - // RFC 3986 (http://tools.ietf.org/html/rfc3986#section-3.1) - // scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - var protocol = /^[a-z][a-z0-9+\-.]*(?=:)/i.exec(url); - if (!protocol) { - return allowRelative; - } - protocol = protocol[0].toLowerCase(); - switch (protocol) { - case 'http': - case 'https': - case 'ftp': - case 'mailto': - case 'tel': - return true; - default: - return false; - } -} - -function shadow(obj, prop, value) { - Object.defineProperty(obj, prop, { value: value, - enumerable: true, - configurable: true, - writable: false }); - return value; -} - -function getLookupTableFactory(initializer) { - var lookup; - return function () { - if (initializer) { - lookup = Object.create(null); - initializer(lookup); - initializer = null; - } - return lookup; - }; -} - -var PasswordResponses = { - NEED_PASSWORD: 1, - INCORRECT_PASSWORD: 2 -}; - -var PasswordException = (function PasswordExceptionClosure() { - function PasswordException(msg, code) { - this.name = 'PasswordException'; - this.message = msg; - this.code = code; - } - - PasswordException.prototype = new Error(); - PasswordException.constructor = PasswordException; - - return PasswordException; -})(); - -var UnknownErrorException = (function UnknownErrorExceptionClosure() { - function UnknownErrorException(msg, details) { - this.name = 'UnknownErrorException'; - this.message = msg; - this.details = details; - } - - UnknownErrorException.prototype = new Error(); - UnknownErrorException.constructor = UnknownErrorException; - - return UnknownErrorException; -})(); - -var InvalidPDFException = (function InvalidPDFExceptionClosure() { - function InvalidPDFException(msg) { - this.name = 'InvalidPDFException'; - this.message = msg; - } - - InvalidPDFException.prototype = new Error(); - InvalidPDFException.constructor = InvalidPDFException; - - return InvalidPDFException; -})(); - -var MissingPDFException = (function MissingPDFExceptionClosure() { - function MissingPDFException(msg) { - this.name = 'MissingPDFException'; - this.message = msg; - } - - MissingPDFException.prototype = new Error(); - MissingPDFException.constructor = MissingPDFException; - - return MissingPDFException; -})(); - -var UnexpectedResponseException = - (function UnexpectedResponseExceptionClosure() { - function UnexpectedResponseException(msg, status) { - this.name = 'UnexpectedResponseException'; - this.message = msg; - this.status = status; - } - - UnexpectedResponseException.prototype = new Error(); - UnexpectedResponseException.constructor = UnexpectedResponseException; - - return UnexpectedResponseException; -})(); - -var NotImplementedException = (function NotImplementedExceptionClosure() { - function NotImplementedException(msg) { - this.message = msg; - } - - NotImplementedException.prototype = new Error(); - NotImplementedException.prototype.name = 'NotImplementedException'; - NotImplementedException.constructor = NotImplementedException; - - return NotImplementedException; -})(); - -var MissingDataException = (function MissingDataExceptionClosure() { - function MissingDataException(begin, end) { - this.begin = begin; - this.end = end; - this.message = 'Missing data [' + begin + ', ' + end + ')'; - } - - MissingDataException.prototype = new Error(); - MissingDataException.prototype.name = 'MissingDataException'; - MissingDataException.constructor = MissingDataException; - - return MissingDataException; -})(); - -var XRefParseException = (function XRefParseExceptionClosure() { - function XRefParseException(msg) { - this.message = msg; - } - - XRefParseException.prototype = new Error(); - XRefParseException.prototype.name = 'XRefParseException'; - XRefParseException.constructor = XRefParseException; - - return XRefParseException; -})(); - -var NullCharactersRegExp = /\x00/g; - -function removeNullCharacters(str) { - if (typeof str !== 'string') { - warn('The argument for removeNullCharacters must be a string.'); - return str; - } - return str.replace(NullCharactersRegExp, ''); -} - -function bytesToString(bytes) { - assert(bytes !== null && typeof bytes === 'object' && - bytes.length !== undefined, 'Invalid argument for bytesToString'); - var length = bytes.length; - var MAX_ARGUMENT_COUNT = 8192; - if (length < MAX_ARGUMENT_COUNT) { - return String.fromCharCode.apply(null, bytes); - } - var strBuf = []; - for (var i = 0; i < length; i += MAX_ARGUMENT_COUNT) { - var chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); - var chunk = bytes.subarray(i, chunkEnd); - strBuf.push(String.fromCharCode.apply(null, chunk)); - } - return strBuf.join(''); -} - -function stringToBytes(str) { - assert(typeof str === 'string', 'Invalid argument for stringToBytes'); - var length = str.length; - var bytes = new Uint8Array(length); - for (var i = 0; i < length; ++i) { - bytes[i] = str.charCodeAt(i) & 0xFF; - } - return bytes; -} - -/** - * Gets length of the array (Array, Uint8Array, or string) in bytes. - * @param {Array|Uint8Array|string} arr - * @returns {number} - */ -function arrayByteLength(arr) { - if (arr.length !== undefined) { - return arr.length; - } - assert(arr.byteLength !== undefined); - return arr.byteLength; -} - -/** - * Combines array items (arrays) into single Uint8Array object. - * @param {Array} arr - the array of the arrays (Array, Uint8Array, or string). - * @returns {Uint8Array} - */ -function arraysToBytes(arr) { - // Shortcut: if first and only item is Uint8Array, return it. - if (arr.length === 1 && (arr[0] instanceof Uint8Array)) { - return arr[0]; - } - var resultLength = 0; - var i, ii = arr.length; - var item, itemLength ; - for (i = 0; i < ii; i++) { - item = arr[i]; - itemLength = arrayByteLength(item); - resultLength += itemLength; - } - var pos = 0; - var data = new Uint8Array(resultLength); - for (i = 0; i < ii; i++) { - item = arr[i]; - if (!(item instanceof Uint8Array)) { - if (typeof item === 'string') { - item = stringToBytes(item); - } else { - item = new Uint8Array(item); - } - } - itemLength = item.byteLength; - data.set(item, pos); - pos += itemLength; - } - return data; -} - -function string32(value) { - return String.fromCharCode((value >> 24) & 0xff, (value >> 16) & 0xff, - (value >> 8) & 0xff, value & 0xff); -} - -function log2(x) { - var n = 1, i = 0; - while (x > n) { - n <<= 1; - i++; - } - return i; -} - -function readInt8(data, start) { - return (data[start] << 24) >> 24; -} - -function readUint16(data, offset) { - return (data[offset] << 8) | data[offset + 1]; -} - -function readUint32(data, offset) { - return ((data[offset] << 24) | (data[offset + 1] << 16) | - (data[offset + 2] << 8) | data[offset + 3]) >>> 0; -} - -// Lazy test the endianness of the platform -// NOTE: This will be 'true' for simulated TypedArrays -function isLittleEndian() { - var buffer8 = new Uint8Array(2); - buffer8[0] = 1; - var buffer16 = new Uint16Array(buffer8.buffer); - return (buffer16[0] === 1); -} - -// Checks if it's possible to eval JS expressions. -function isEvalSupported() { - try { - /* jshint evil: true */ - new Function(''); - return true; - } catch (e) { - return false; - } -} - -var Uint32ArrayView = (function Uint32ArrayViewClosure() { - - function Uint32ArrayView(buffer, length) { - this.buffer = buffer; - this.byteLength = buffer.length; - this.length = length === undefined ? (this.byteLength >> 2) : length; - ensureUint32ArrayViewProps(this.length); - } - Uint32ArrayView.prototype = Object.create(null); - - var uint32ArrayViewSetters = 0; - function createUint32ArrayProp(index) { - return { - get: function () { - var buffer = this.buffer, offset = index << 2; - return (buffer[offset] | (buffer[offset + 1] << 8) | - (buffer[offset + 2] << 16) | (buffer[offset + 3] << 24)) >>> 0; - }, - set: function (value) { - var buffer = this.buffer, offset = index << 2; - buffer[offset] = value & 255; - buffer[offset + 1] = (value >> 8) & 255; - buffer[offset + 2] = (value >> 16) & 255; - buffer[offset + 3] = (value >>> 24) & 255; - } - }; - } - - function ensureUint32ArrayViewProps(length) { - while (uint32ArrayViewSetters < length) { - Object.defineProperty(Uint32ArrayView.prototype, - uint32ArrayViewSetters, - createUint32ArrayProp(uint32ArrayViewSetters)); - uint32ArrayViewSetters++; - } - } - - return Uint32ArrayView; -})(); - -exports.Uint32ArrayView = Uint32ArrayView; - -var IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; - -var Util = (function UtilClosure() { - function Util() {} - - var rgbBuf = ['rgb(', 0, ',', 0, ',', 0, ')']; - - // makeCssRgb() can be called thousands of times. Using |rgbBuf| avoids - // creating many intermediate strings. - Util.makeCssRgb = function Util_makeCssRgb(r, g, b) { - rgbBuf[1] = r; - rgbBuf[3] = g; - rgbBuf[5] = b; - return rgbBuf.join(''); - }; - - // Concatenates two transformation matrices together and returns the result. - Util.transform = function Util_transform(m1, m2) { - return [ - m1[0] * m2[0] + m1[2] * m2[1], - m1[1] * m2[0] + m1[3] * m2[1], - m1[0] * m2[2] + m1[2] * m2[3], - m1[1] * m2[2] + m1[3] * m2[3], - m1[0] * m2[4] + m1[2] * m2[5] + m1[4], - m1[1] * m2[4] + m1[3] * m2[5] + m1[5] - ]; - }; - - // For 2d affine transforms - Util.applyTransform = function Util_applyTransform(p, m) { - var xt = p[0] * m[0] + p[1] * m[2] + m[4]; - var yt = p[0] * m[1] + p[1] * m[3] + m[5]; - return [xt, yt]; - }; - - Util.applyInverseTransform = function Util_applyInverseTransform(p, m) { - var d = m[0] * m[3] - m[1] * m[2]; - var xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; - var yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; - return [xt, yt]; - }; - - // Applies the transform to the rectangle and finds the minimum axially - // aligned bounding box. - Util.getAxialAlignedBoundingBox = - function Util_getAxialAlignedBoundingBox(r, m) { - - var p1 = Util.applyTransform(r, m); - var p2 = Util.applyTransform(r.slice(2, 4), m); - var p3 = Util.applyTransform([r[0], r[3]], m); - var p4 = Util.applyTransform([r[2], r[1]], m); - return [ - Math.min(p1[0], p2[0], p3[0], p4[0]), - Math.min(p1[1], p2[1], p3[1], p4[1]), - Math.max(p1[0], p2[0], p3[0], p4[0]), - Math.max(p1[1], p2[1], p3[1], p4[1]) - ]; - }; - - Util.inverseTransform = function Util_inverseTransform(m) { - var d = m[0] * m[3] - m[1] * m[2]; - return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, - (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d]; - }; - - // Apply a generic 3d matrix M on a 3-vector v: - // | a b c | | X | - // | d e f | x | Y | - // | g h i | | Z | - // M is assumed to be serialized as [a,b,c,d,e,f,g,h,i], - // with v as [X,Y,Z] - Util.apply3dTransform = function Util_apply3dTransform(m, v) { - return [ - m[0] * v[0] + m[1] * v[1] + m[2] * v[2], - m[3] * v[0] + m[4] * v[1] + m[5] * v[2], - m[6] * v[0] + m[7] * v[1] + m[8] * v[2] - ]; - }; - - // This calculation uses Singular Value Decomposition. - // The SVD can be represented with formula A = USV. We are interested in the - // matrix S here because it represents the scale values. - Util.singularValueDecompose2dScale = - function Util_singularValueDecompose2dScale(m) { - - var transpose = [m[0], m[2], m[1], m[3]]; - - // Multiply matrix m with its transpose. - var a = m[0] * transpose[0] + m[1] * transpose[2]; - var b = m[0] * transpose[1] + m[1] * transpose[3]; - var c = m[2] * transpose[0] + m[3] * transpose[2]; - var d = m[2] * transpose[1] + m[3] * transpose[3]; - - // Solve the second degree polynomial to get roots. - var first = (a + d) / 2; - var second = Math.sqrt((a + d) * (a + d) - 4 * (a * d - c * b)) / 2; - var sx = first + second || 1; - var sy = first - second || 1; - - // Scale values are the square roots of the eigenvalues. - return [Math.sqrt(sx), Math.sqrt(sy)]; - }; - - // Normalize rectangle rect=[x1, y1, x2, y2] so that (x1,y1) < (x2,y2) - // For coordinate systems whose origin lies in the bottom-left, this - // means normalization to (BL,TR) ordering. For systems with origin in the - // top-left, this means (TL,BR) ordering. - Util.normalizeRect = function Util_normalizeRect(rect) { - var r = rect.slice(0); // clone rect - if (rect[0] > rect[2]) { - r[0] = rect[2]; - r[2] = rect[0]; - } - if (rect[1] > rect[3]) { - r[1] = rect[3]; - r[3] = rect[1]; - } - return r; - }; - - // Returns a rectangle [x1, y1, x2, y2] corresponding to the - // intersection of rect1 and rect2. If no intersection, returns 'false' - // The rectangle coordinates of rect1, rect2 should be [x1, y1, x2, y2] - Util.intersect = function Util_intersect(rect1, rect2) { - function compare(a, b) { - return a - b; - } - - // Order points along the axes - var orderedX = [rect1[0], rect1[2], rect2[0], rect2[2]].sort(compare), - orderedY = [rect1[1], rect1[3], rect2[1], rect2[3]].sort(compare), - result = []; - - rect1 = Util.normalizeRect(rect1); - rect2 = Util.normalizeRect(rect2); - - // X: first and second points belong to different rectangles? - if ((orderedX[0] === rect1[0] && orderedX[1] === rect2[0]) || - (orderedX[0] === rect2[0] && orderedX[1] === rect1[0])) { - // Intersection must be between second and third points - result[0] = orderedX[1]; - result[2] = orderedX[2]; - } else { - return false; - } - - // Y: first and second points belong to different rectangles? - if ((orderedY[0] === rect1[1] && orderedY[1] === rect2[1]) || - (orderedY[0] === rect2[1] && orderedY[1] === rect1[1])) { - // Intersection must be between second and third points - result[1] = orderedY[1]; - result[3] = orderedY[2]; - } else { - return false; - } - - return result; - }; - - Util.sign = function Util_sign(num) { - return num < 0 ? -1 : 1; - }; - - var ROMAN_NUMBER_MAP = [ - '', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM', - '', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC', - '', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX' - ]; - /** - * Converts positive integers to (upper case) Roman numerals. - * @param {integer} number - The number that should be converted. - * @param {boolean} lowerCase - Indicates if the result should be converted - * to lower case letters. The default is false. - * @return {string} The resulting Roman number. - */ - Util.toRoman = function Util_toRoman(number, lowerCase) { - assert(isInt(number) && number > 0, - 'The number should be a positive integer.'); - var pos, romanBuf = []; - // Thousands - while (number >= 1000) { - number -= 1000; - romanBuf.push('M'); - } - // Hundreds - pos = (number / 100) | 0; - number %= 100; - romanBuf.push(ROMAN_NUMBER_MAP[pos]); - // Tens - pos = (number / 10) | 0; - number %= 10; - romanBuf.push(ROMAN_NUMBER_MAP[10 + pos]); - // Ones - romanBuf.push(ROMAN_NUMBER_MAP[20 + number]); - - var romanStr = romanBuf.join(''); - return (lowerCase ? romanStr.toLowerCase() : romanStr); - }; - - Util.appendToArray = function Util_appendToArray(arr1, arr2) { - Array.prototype.push.apply(arr1, arr2); - }; - - Util.prependToArray = function Util_prependToArray(arr1, arr2) { - Array.prototype.unshift.apply(arr1, arr2); - }; - - Util.extendObj = function extendObj(obj1, obj2) { - for (var key in obj2) { - obj1[key] = obj2[key]; - } - }; - - Util.getInheritableProperty = function Util_getInheritableProperty(dict, - name) { - while (dict && !dict.has(name)) { - dict = dict.get('Parent'); - } - if (!dict) { - return null; - } - return dict.get(name); - }; - - Util.inherit = function Util_inherit(sub, base, prototype) { - sub.prototype = Object.create(base.prototype); - sub.prototype.constructor = sub; - for (var prop in prototype) { - sub.prototype[prop] = prototype[prop]; - } - }; - - Util.loadScript = function Util_loadScript(src, callback) { - var script = document.createElement('script'); - var loaded = false; - script.setAttribute('src', src); - if (callback) { - script.onload = function() { - if (!loaded) { - callback(); - } - loaded = true; - }; - } - document.getElementsByTagName('head')[0].appendChild(script); - }; - - return Util; -})(); - -/** - * PDF page viewport created based on scale, rotation and offset. - * @class - * @alias PageViewport - */ -var PageViewport = (function PageViewportClosure() { - /** - * @constructor - * @private - * @param viewBox {Array} xMin, yMin, xMax and yMax coordinates. - * @param scale {number} scale of the viewport. - * @param rotation {number} rotations of the viewport in degrees. - * @param offsetX {number} offset X - * @param offsetY {number} offset Y - * @param dontFlip {boolean} if true, axis Y will not be flipped. - */ - function PageViewport(viewBox, scale, rotation, offsetX, offsetY, dontFlip) { - this.viewBox = viewBox; - this.scale = scale; - this.rotation = rotation; - this.offsetX = offsetX; - this.offsetY = offsetY; - - // creating transform to convert pdf coordinate system to the normal - // canvas like coordinates taking in account scale and rotation - var centerX = (viewBox[2] + viewBox[0]) / 2; - var centerY = (viewBox[3] + viewBox[1]) / 2; - var rotateA, rotateB, rotateC, rotateD; - rotation = rotation % 360; - rotation = rotation < 0 ? rotation + 360 : rotation; - switch (rotation) { - case 180: - rotateA = -1; rotateB = 0; rotateC = 0; rotateD = 1; - break; - case 90: - rotateA = 0; rotateB = 1; rotateC = 1; rotateD = 0; - break; - case 270: - rotateA = 0; rotateB = -1; rotateC = -1; rotateD = 0; - break; - //case 0: - default: - rotateA = 1; rotateB = 0; rotateC = 0; rotateD = -1; - break; - } - - if (dontFlip) { - rotateC = -rotateC; rotateD = -rotateD; - } - - var offsetCanvasX, offsetCanvasY; - var width, height; - if (rotateA === 0) { - offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX; - offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY; - width = Math.abs(viewBox[3] - viewBox[1]) * scale; - height = Math.abs(viewBox[2] - viewBox[0]) * scale; - } else { - offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX; - offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY; - width = Math.abs(viewBox[2] - viewBox[0]) * scale; - height = Math.abs(viewBox[3] - viewBox[1]) * scale; - } - // creating transform for the following operations: - // translate(-centerX, -centerY), rotate and flip vertically, - // scale, and translate(offsetCanvasX, offsetCanvasY) - this.transform = [ - rotateA * scale, - rotateB * scale, - rotateC * scale, - rotateD * scale, - offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY, - offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY - ]; - - this.width = width; - this.height = height; - this.fontScale = scale; - } - PageViewport.prototype = /** @lends PageViewport.prototype */ { - /** - * Clones viewport with additional properties. - * @param args {Object} (optional) If specified, may contain the 'scale' or - * 'rotation' properties to override the corresponding properties in - * the cloned viewport. - * @returns {PageViewport} Cloned viewport. - */ - clone: function PageViewPort_clone(args) { - args = args || {}; - var scale = 'scale' in args ? args.scale : this.scale; - var rotation = 'rotation' in args ? args.rotation : this.rotation; - return new PageViewport(this.viewBox.slice(), scale, rotation, - this.offsetX, this.offsetY, args.dontFlip); - }, - /** - * Converts PDF point to the viewport coordinates. For examples, useful for - * converting PDF location into canvas pixel coordinates. - * @param x {number} X coordinate. - * @param y {number} Y coordinate. - * @returns {Object} Object that contains 'x' and 'y' properties of the - * point in the viewport coordinate space. - * @see {@link convertToPdfPoint} - * @see {@link convertToViewportRectangle} - */ - convertToViewportPoint: function PageViewport_convertToViewportPoint(x, y) { - return Util.applyTransform([x, y], this.transform); - }, - /** - * Converts PDF rectangle to the viewport coordinates. - * @param rect {Array} xMin, yMin, xMax and yMax coordinates. - * @returns {Array} Contains corresponding coordinates of the rectangle - * in the viewport coordinate space. - * @see {@link convertToViewportPoint} - */ - convertToViewportRectangle: - function PageViewport_convertToViewportRectangle(rect) { - var tl = Util.applyTransform([rect[0], rect[1]], this.transform); - var br = Util.applyTransform([rect[2], rect[3]], this.transform); - return [tl[0], tl[1], br[0], br[1]]; - }, - /** - * Converts viewport coordinates to the PDF location. For examples, useful - * for converting canvas pixel location into PDF one. - * @param x {number} X coordinate. - * @param y {number} Y coordinate. - * @returns {Object} Object that contains 'x' and 'y' properties of the - * point in the PDF coordinate space. - * @see {@link convertToViewportPoint} - */ - convertToPdfPoint: function PageViewport_convertToPdfPoint(x, y) { - return Util.applyInverseTransform([x, y], this.transform); - } - }; - return PageViewport; -})(); - -var PDFStringTranslateTable = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0x2D8, 0x2C7, 0x2C6, 0x2D9, 0x2DD, 0x2DB, 0x2DA, 0x2DC, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, - 0x2013, 0x192, 0x2044, 0x2039, 0x203A, 0x2212, 0x2030, 0x201E, 0x201C, - 0x201D, 0x2018, 0x2019, 0x201A, 0x2122, 0xFB01, 0xFB02, 0x141, 0x152, 0x160, - 0x178, 0x17D, 0x131, 0x142, 0x153, 0x161, 0x17E, 0, 0x20AC -]; - -function stringToPDFString(str) { - var i, n = str.length, strBuf = []; - if (str[0] === '\xFE' && str[1] === '\xFF') { - // UTF16BE BOM - for (i = 2; i < n; i += 2) { - strBuf.push(String.fromCharCode( - (str.charCodeAt(i) << 8) | str.charCodeAt(i + 1))); - } - } else { - for (i = 0; i < n; ++i) { - var code = PDFStringTranslateTable[str.charCodeAt(i)]; - strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); - } - } - return strBuf.join(''); -} - -function stringToUTF8String(str) { - return decodeURIComponent(escape(str)); -} - -function utf8StringToString(str) { - return unescape(encodeURIComponent(str)); -} - -function isEmptyObj(obj) { - for (var key in obj) { - return false; - } - return true; -} - -function isBool(v) { - return typeof v === 'boolean'; -} - -function isInt(v) { - return typeof v === 'number' && ((v | 0) === v); -} - -function isNum(v) { - return typeof v === 'number'; -} - -function isString(v) { - return typeof v === 'string'; -} - -function isArray(v) { - return v instanceof Array; -} - -function isArrayBuffer(v) { - return typeof v === 'object' && v !== null && v.byteLength !== undefined; -} - -// Checks if ch is one of the following characters: SPACE, TAB, CR or LF. -function isSpace(ch) { - return (ch === 0x20 || ch === 0x09 || ch === 0x0D || ch === 0x0A); -} - -/** - * Promise Capability object. - * - * @typedef {Object} PromiseCapability - * @property {Promise} promise - A promise object. - * @property {function} resolve - Fulfills the promise. - * @property {function} reject - Rejects the promise. - */ - -/** - * Creates a promise capability object. - * @alias createPromiseCapability - * - * @return {PromiseCapability} A capability object contains: - * - a Promise, resolve and reject methods. - */ -function createPromiseCapability() { - var capability = {}; - capability.promise = new Promise(function (resolve, reject) { - capability.resolve = resolve; - capability.reject = reject; - }); - return capability; -} - -/** - * Polyfill for Promises: - * The following promise implementation tries to generally implement the - * Promise/A+ spec. Some notable differences from other promise libraries are: - * - There currently isn't a separate deferred and promise object. - * - Unhandled rejections eventually show an error if they aren't handled. - * - * Based off of the work in: - * https://bugzilla.mozilla.org/show_bug.cgi?id=810490 - */ -(function PromiseClosure() { - if (globalScope.Promise) { - // Promises existing in the DOM/Worker, checking presence of all/resolve - if (typeof globalScope.Promise.all !== 'function') { - globalScope.Promise.all = function (iterable) { - var count = 0, results = [], resolve, reject; - var promise = new globalScope.Promise(function (resolve_, reject_) { - resolve = resolve_; - reject = reject_; - }); - iterable.forEach(function (p, i) { - count++; - p.then(function (result) { - results[i] = result; - count--; - if (count === 0) { - resolve(results); - } - }, reject); - }); - if (count === 0) { - resolve(results); - } - return promise; - }; - } - if (typeof globalScope.Promise.resolve !== 'function') { - globalScope.Promise.resolve = function (value) { - return new globalScope.Promise(function (resolve) { resolve(value); }); - }; - } - if (typeof globalScope.Promise.reject !== 'function') { - globalScope.Promise.reject = function (reason) { - return new globalScope.Promise(function (resolve, reject) { - reject(reason); - }); - }; - } - if (typeof globalScope.Promise.prototype.catch !== 'function') { - globalScope.Promise.prototype.catch = function (onReject) { - return globalScope.Promise.prototype.then(undefined, onReject); - }; - } - return; - } - var STATUS_PENDING = 0; - var STATUS_RESOLVED = 1; - var STATUS_REJECTED = 2; - - // In an attempt to avoid silent exceptions, unhandled rejections are - // tracked and if they aren't handled in a certain amount of time an - // error is logged. - var REJECTION_TIMEOUT = 500; - - var HandlerManager = { - handlers: [], - running: false, - unhandledRejections: [], - pendingRejectionCheck: false, - - scheduleHandlers: function scheduleHandlers(promise) { - if (promise._status === STATUS_PENDING) { - return; - } - - this.handlers = this.handlers.concat(promise._handlers); - promise._handlers = []; - - if (this.running) { - return; - } - this.running = true; - - setTimeout(this.runHandlers.bind(this), 0); - }, - - runHandlers: function runHandlers() { - var RUN_TIMEOUT = 1; // ms - var timeoutAt = Date.now() + RUN_TIMEOUT; - while (this.handlers.length > 0) { - var handler = this.handlers.shift(); - - var nextStatus = handler.thisPromise._status; - var nextValue = handler.thisPromise._value; - - try { - if (nextStatus === STATUS_RESOLVED) { - if (typeof handler.onResolve === 'function') { - nextValue = handler.onResolve(nextValue); - } - } else if (typeof handler.onReject === 'function') { - nextValue = handler.onReject(nextValue); - nextStatus = STATUS_RESOLVED; - - if (handler.thisPromise._unhandledRejection) { - this.removeUnhandeledRejection(handler.thisPromise); - } - } - } catch (ex) { - nextStatus = STATUS_REJECTED; - nextValue = ex; - } - - handler.nextPromise._updateStatus(nextStatus, nextValue); - if (Date.now() >= timeoutAt) { - break; - } - } - - if (this.handlers.length > 0) { - setTimeout(this.runHandlers.bind(this), 0); - return; - } - - this.running = false; - }, - - addUnhandledRejection: function addUnhandledRejection(promise) { - this.unhandledRejections.push({ - promise: promise, - time: Date.now() - }); - this.scheduleRejectionCheck(); - }, - - removeUnhandeledRejection: function removeUnhandeledRejection(promise) { - promise._unhandledRejection = false; - for (var i = 0; i < this.unhandledRejections.length; i++) { - if (this.unhandledRejections[i].promise === promise) { - this.unhandledRejections.splice(i); - i--; - } - } - }, - - scheduleRejectionCheck: function scheduleRejectionCheck() { - if (this.pendingRejectionCheck) { - return; - } - this.pendingRejectionCheck = true; - setTimeout(function rejectionCheck() { - this.pendingRejectionCheck = false; - var now = Date.now(); - for (var i = 0; i < this.unhandledRejections.length; i++) { - if (now - this.unhandledRejections[i].time > REJECTION_TIMEOUT) { - var unhandled = this.unhandledRejections[i].promise._value; - var msg = 'Unhandled rejection: ' + unhandled; - if (unhandled.stack) { - msg += '\n' + unhandled.stack; - } - warn(msg); - this.unhandledRejections.splice(i); - i--; - } - } - if (this.unhandledRejections.length) { - this.scheduleRejectionCheck(); - } - }.bind(this), REJECTION_TIMEOUT); - } - }; - - function Promise(resolver) { - this._status = STATUS_PENDING; - this._handlers = []; - try { - resolver.call(this, this._resolve.bind(this), this._reject.bind(this)); - } catch (e) { - this._reject(e); - } - } - /** - * Builds a promise that is resolved when all the passed in promises are - * resolved. - * @param {array} promises array of data and/or promises to wait for. - * @return {Promise} New dependent promise. - */ - Promise.all = function Promise_all(promises) { - var resolveAll, rejectAll; - var deferred = new Promise(function (resolve, reject) { - resolveAll = resolve; - rejectAll = reject; - }); - var unresolved = promises.length; - var results = []; - if (unresolved === 0) { - resolveAll(results); - return deferred; - } - function reject(reason) { - if (deferred._status === STATUS_REJECTED) { - return; - } - results = []; - rejectAll(reason); - } - for (var i = 0, ii = promises.length; i < ii; ++i) { - var promise = promises[i]; - var resolve = (function(i) { - return function(value) { - if (deferred._status === STATUS_REJECTED) { - return; - } - results[i] = value; - unresolved--; - if (unresolved === 0) { - resolveAll(results); - } - }; - })(i); - if (Promise.isPromise(promise)) { - promise.then(resolve, reject); - } else { - resolve(promise); - } - } - return deferred; - }; - - /** - * Checks if the value is likely a promise (has a 'then' function). - * @return {boolean} true if value is thenable - */ - Promise.isPromise = function Promise_isPromise(value) { - return value && typeof value.then === 'function'; - }; - - /** - * Creates resolved promise - * @param value resolve value - * @returns {Promise} - */ - Promise.resolve = function Promise_resolve(value) { - return new Promise(function (resolve) { resolve(value); }); - }; - - /** - * Creates rejected promise - * @param reason rejection value - * @returns {Promise} - */ - Promise.reject = function Promise_reject(reason) { - return new Promise(function (resolve, reject) { reject(reason); }); - }; - - Promise.prototype = { - _status: null, - _value: null, - _handlers: null, - _unhandledRejection: null, - - _updateStatus: function Promise__updateStatus(status, value) { - if (this._status === STATUS_RESOLVED || - this._status === STATUS_REJECTED) { - return; - } - - if (status === STATUS_RESOLVED && - Promise.isPromise(value)) { - value.then(this._updateStatus.bind(this, STATUS_RESOLVED), - this._updateStatus.bind(this, STATUS_REJECTED)); - return; - } - - this._status = status; - this._value = value; - - if (status === STATUS_REJECTED && this._handlers.length === 0) { - this._unhandledRejection = true; - HandlerManager.addUnhandledRejection(this); - } - - HandlerManager.scheduleHandlers(this); - }, - - _resolve: function Promise_resolve(value) { - this._updateStatus(STATUS_RESOLVED, value); - }, - - _reject: function Promise_reject(reason) { - this._updateStatus(STATUS_REJECTED, reason); - }, - - then: function Promise_then(onResolve, onReject) { - var nextPromise = new Promise(function (resolve, reject) { - this.resolve = resolve; - this.reject = reject; - }); - this._handlers.push({ - thisPromise: this, - onResolve: onResolve, - onReject: onReject, - nextPromise: nextPromise - }); - HandlerManager.scheduleHandlers(this); - return nextPromise; - }, - - catch: function Promise_catch(onReject) { - return this.then(undefined, onReject); - } - }; - - globalScope.Promise = Promise; -})(); - -(function WeakMapClosure() { - if (globalScope.WeakMap) { - return; - } - - var id = 0; - function WeakMap() { - this.id = '$weakmap' + (id++); - } - WeakMap.prototype = { - has: function(obj) { - return !!Object.getOwnPropertyDescriptor(obj, this.id); - }, - get: function(obj, defaultValue) { - return this.has(obj) ? obj[this.id] : defaultValue; - }, - set: function(obj, value) { - Object.defineProperty(obj, this.id, { - value: value, - enumerable: false, - configurable: true - }); - }, - delete: function(obj) { - delete obj[this.id]; - } - }; - - globalScope.WeakMap = WeakMap; -})(); - -var StatTimer = (function StatTimerClosure() { - function rpad(str, pad, length) { - while (str.length < length) { - str += pad; - } - return str; - } - function StatTimer() { - this.started = Object.create(null); - this.times = []; - this.enabled = true; - } - StatTimer.prototype = { - time: function StatTimer_time(name) { - if (!this.enabled) { - return; - } - if (name in this.started) { - warn('Timer is already running for ' + name); - } - this.started[name] = Date.now(); - }, - timeEnd: function StatTimer_timeEnd(name) { - if (!this.enabled) { - return; - } - if (!(name in this.started)) { - warn('Timer has not been started for ' + name); - } - this.times.push({ - 'name': name, - 'start': this.started[name], - 'end': Date.now() - }); - // Remove timer from started so it can be called again. - delete this.started[name]; - }, - toString: function StatTimer_toString() { - var i, ii; - var times = this.times; - var out = ''; - // Find the longest name for padding purposes. - var longest = 0; - for (i = 0, ii = times.length; i < ii; ++i) { - var name = times[i]['name']; - if (name.length > longest) { - longest = name.length; - } - } - for (i = 0, ii = times.length; i < ii; ++i) { - var span = times[i]; - var duration = span.end - span.start; - out += rpad(span['name'], ' ', longest) + ' ' + duration + 'ms\n'; - } - return out; - } - }; - return StatTimer; -})(); - -var createBlob = function createBlob(data, contentType) { - if (typeof Blob !== 'undefined') { - return new Blob([data], { type: contentType }); - } - warn('The "Blob" constructor is not supported.'); -}; - -var createObjectURL = (function createObjectURLClosure() { - // Blob/createObjectURL is not available, falling back to data schema. - var digits = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - - return function createObjectURL(data, contentType, forceDataSchema) { - if (!forceDataSchema && - typeof URL !== 'undefined' && URL.createObjectURL) { - var blob = createBlob(data, contentType); - return URL.createObjectURL(blob); - } - - var buffer = 'data:' + contentType + ';base64,'; - for (var i = 0, ii = data.length; i < ii; i += 3) { - var b1 = data[i] & 0xFF; - var b2 = data[i + 1] & 0xFF; - var b3 = data[i + 2] & 0xFF; - var d1 = b1 >> 2, d2 = ((b1 & 3) << 4) | (b2 >> 4); - var d3 = i + 1 < ii ? ((b2 & 0xF) << 2) | (b3 >> 6) : 64; - var d4 = i + 2 < ii ? (b3 & 0x3F) : 64; - buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4]; - } - return buffer; - }; -})(); - -function MessageHandler(sourceName, targetName, comObj) { - this.sourceName = sourceName; - this.targetName = targetName; - this.comObj = comObj; - this.callbackIndex = 1; - this.postMessageTransfers = true; - var callbacksCapabilities = this.callbacksCapabilities = Object.create(null); - var ah = this.actionHandler = Object.create(null); - - this._onComObjOnMessage = function messageHandlerComObjOnMessage(event) { - var data = event.data; - if (data.targetName !== this.sourceName) { - return; - } - if (data.isReply) { - var callbackId = data.callbackId; - if (data.callbackId in callbacksCapabilities) { - var callback = callbacksCapabilities[callbackId]; - delete callbacksCapabilities[callbackId]; - if ('error' in data) { - callback.reject(data.error); - } else { - callback.resolve(data.data); - } - } else { - error('Cannot resolve callback ' + callbackId); - } - } else if (data.action in ah) { - var action = ah[data.action]; - if (data.callbackId) { - var sourceName = this.sourceName; - var targetName = data.sourceName; - Promise.resolve().then(function () { - return action[0].call(action[1], data.data); - }).then(function (result) { - comObj.postMessage({ - sourceName: sourceName, - targetName: targetName, - isReply: true, - callbackId: data.callbackId, - data: result - }); - }, function (reason) { - if (reason instanceof Error) { - // Serialize error to avoid "DataCloneError" - reason = reason + ''; - } - comObj.postMessage({ - sourceName: sourceName, - targetName: targetName, - isReply: true, - callbackId: data.callbackId, - error: reason - }); - }); - } else { - action[0].call(action[1], data.data); - } - } else { - error('Unknown action from worker: ' + data.action); - } - }.bind(this); - comObj.addEventListener('message', this._onComObjOnMessage); -} - -MessageHandler.prototype = { - on: function messageHandlerOn(actionName, handler, scope) { - var ah = this.actionHandler; - if (ah[actionName]) { - error('There is already an actionName called "' + actionName + '"'); - } - ah[actionName] = [handler, scope]; - }, - /** - * Sends a message to the comObj to invoke the action with the supplied data. - * @param {String} actionName Action to call. - * @param {JSON} data JSON data to send. - * @param {Array} [transfers] Optional list of transfers/ArrayBuffers - */ - send: function messageHandlerSend(actionName, data, transfers) { - var message = { - sourceName: this.sourceName, - targetName: this.targetName, - action: actionName, - data: data - }; - this.postMessage(message, transfers); - }, - /** - * Sends a message to the comObj to invoke the action with the supplied data. - * Expects that other side will callback with the response. - * @param {String} actionName Action to call. - * @param {JSON} data JSON data to send. - * @param {Array} [transfers] Optional list of transfers/ArrayBuffers. - * @returns {Promise} Promise to be resolved with response data. - */ - sendWithPromise: - function messageHandlerSendWithPromise(actionName, data, transfers) { - var callbackId = this.callbackIndex++; - var message = { - sourceName: this.sourceName, - targetName: this.targetName, - action: actionName, - data: data, - callbackId: callbackId - }; - var capability = createPromiseCapability(); - this.callbacksCapabilities[callbackId] = capability; - try { - this.postMessage(message, transfers); - } catch (e) { - capability.reject(e); - } - return capability.promise; - }, - /** - * Sends raw message to the comObj. - * @private - * @param message {Object} Raw message. - * @param transfers List of transfers/ArrayBuffers, or undefined. - */ - postMessage: function (message, transfers) { - if (transfers && this.postMessageTransfers) { - this.comObj.postMessage(message, transfers); - } else { - this.comObj.postMessage(message); - } - }, - - destroy: function () { - this.comObj.removeEventListener('message', this._onComObjOnMessage); - } -}; - -function loadJpegStream(id, imageUrl, objs) { - var img = new Image(); - img.onload = (function loadJpegStream_onloadClosure() { - objs.resolve(id, img); - }); - img.onerror = (function loadJpegStream_onerrorClosure() { - objs.resolve(id, null); - warn('Error during JPEG image loading'); - }); - img.src = imageUrl; -} - - // Polyfill from https://github.com/Polymer/URL -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ -(function checkURLConstructor(scope) { - // feature detect for URL constructor - var hasWorkingUrl = false; - try { - if (typeof URL === 'function' && - typeof URL.prototype === 'object' && - ('origin' in URL.prototype)) { - var u = new URL('b', 'http://a'); - u.pathname = 'c%20d'; - hasWorkingUrl = u.href === 'http://a/c%20d'; - } - } catch(e) { } - - if (hasWorkingUrl) { - return; - } - - var relative = Object.create(null); - relative['ftp'] = 21; - relative['file'] = 0; - relative['gopher'] = 70; - relative['http'] = 80; - relative['https'] = 443; - relative['ws'] = 80; - relative['wss'] = 443; - - var relativePathDotMapping = Object.create(null); - relativePathDotMapping['%2e'] = '.'; - relativePathDotMapping['.%2e'] = '..'; - relativePathDotMapping['%2e.'] = '..'; - relativePathDotMapping['%2e%2e'] = '..'; - - function isRelativeScheme(scheme) { - return relative[scheme] !== undefined; - } - - function invalid() { - clear.call(this); - this._isInvalid = true; - } - - function IDNAToASCII(h) { - if ('' === h) { - invalid.call(this); - } - // XXX - return h.toLowerCase(); - } - - function percentEscape(c) { - var unicode = c.charCodeAt(0); - if (unicode > 0x20 && - unicode < 0x7F && - // " # < > ? ` - [0x22, 0x23, 0x3C, 0x3E, 0x3F, 0x60].indexOf(unicode) === -1 - ) { - return c; - } - return encodeURIComponent(c); - } - - function percentEscapeQuery(c) { - // XXX This actually needs to encode c using encoding and then - // convert the bytes one-by-one. - - var unicode = c.charCodeAt(0); - if (unicode > 0x20 && - unicode < 0x7F && - // " # < > ` (do not escape '?') - [0x22, 0x23, 0x3C, 0x3E, 0x60].indexOf(unicode) === -1 - ) { - return c; - } - return encodeURIComponent(c); - } - - var EOF, ALPHA = /[a-zA-Z]/, - ALPHANUMERIC = /[a-zA-Z0-9\+\-\.]/; - - function parse(input, stateOverride, base) { - function err(message) { - errors.push(message); - } - - var state = stateOverride || 'scheme start', - cursor = 0, - buffer = '', - seenAt = false, - seenBracket = false, - errors = []; - - loop: while ((input[cursor - 1] !== EOF || cursor === 0) && - !this._isInvalid) { - var c = input[cursor]; - switch (state) { - case 'scheme start': - if (c && ALPHA.test(c)) { - buffer += c.toLowerCase(); // ASCII-safe - state = 'scheme'; - } else if (!stateOverride) { - buffer = ''; - state = 'no scheme'; - continue; - } else { - err('Invalid scheme.'); - break loop; - } - break; - - case 'scheme': - if (c && ALPHANUMERIC.test(c)) { - buffer += c.toLowerCase(); // ASCII-safe - } else if (':' === c) { - this._scheme = buffer; - buffer = ''; - if (stateOverride) { - break loop; - } - if (isRelativeScheme(this._scheme)) { - this._isRelative = true; - } - if ('file' === this._scheme) { - state = 'relative'; - } else if (this._isRelative && base && - base._scheme === this._scheme) { - state = 'relative or authority'; - } else if (this._isRelative) { - state = 'authority first slash'; - } else { - state = 'scheme data'; - } - } else if (!stateOverride) { - buffer = ''; - cursor = 0; - state = 'no scheme'; - continue; - } else if (EOF === c) { - break loop; - } else { - err('Code point not allowed in scheme: ' + c); - break loop; - } - break; - - case 'scheme data': - if ('?' === c) { - this._query = '?'; - state = 'query'; - } else if ('#' === c) { - this._fragment = '#'; - state = 'fragment'; - } else { - // XXX error handling - if (EOF !== c && '\t' !== c && '\n' !== c && '\r' !== c) { - this._schemeData += percentEscape(c); - } - } - break; - - case 'no scheme': - if (!base || !(isRelativeScheme(base._scheme))) { - err('Missing scheme.'); - invalid.call(this); - } else { - state = 'relative'; - continue; - } - break; - - case 'relative or authority': - if ('/' === c && '/' === input[cursor+1]) { - state = 'authority ignore slashes'; - } else { - err('Expected /, got: ' + c); - state = 'relative'; - continue; - } - break; - - case 'relative': - this._isRelative = true; - if ('file' !== this._scheme) { - this._scheme = base._scheme; - } - if (EOF === c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = base._query; - this._username = base._username; - this._password = base._password; - break loop; - } else if ('/' === c || '\\' === c) { - if ('\\' === c) { - err('\\ is an invalid code point.'); - } - state = 'relative slash'; - } else if ('?' === c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = '?'; - this._username = base._username; - this._password = base._password; - state = 'query'; - } else if ('#' === c) { - this._host = base._host; - this._port = base._port; - this._path = base._path.slice(); - this._query = base._query; - this._fragment = '#'; - this._username = base._username; - this._password = base._password; - state = 'fragment'; - } else { - var nextC = input[cursor+1]; - var nextNextC = input[cursor+2]; - if ('file' !== this._scheme || !ALPHA.test(c) || - (nextC !== ':' && nextC !== '|') || - (EOF !== nextNextC && '/' !== nextNextC && '\\' !== nextNextC && - '?' !== nextNextC && '#' !== nextNextC)) { - this._host = base._host; - this._port = base._port; - this._username = base._username; - this._password = base._password; - this._path = base._path.slice(); - this._path.pop(); - } - state = 'relative path'; - continue; - } - break; - - case 'relative slash': - if ('/' === c || '\\' === c) { - if ('\\' === c) { - err('\\ is an invalid code point.'); - } - if ('file' === this._scheme) { - state = 'file host'; - } else { - state = 'authority ignore slashes'; - } - } else { - if ('file' !== this._scheme) { - this._host = base._host; - this._port = base._port; - this._username = base._username; - this._password = base._password; - } - state = 'relative path'; - continue; - } - break; - - case 'authority first slash': - if ('/' === c) { - state = 'authority second slash'; - } else { - err('Expected \'/\', got: ' + c); - state = 'authority ignore slashes'; - continue; - } - break; - - case 'authority second slash': - state = 'authority ignore slashes'; - if ('/' !== c) { - err('Expected \'/\', got: ' + c); - continue; - } - break; - - case 'authority ignore slashes': - if ('/' !== c && '\\' !== c) { - state = 'authority'; - continue; - } else { - err('Expected authority, got: ' + c); - } - break; - - case 'authority': - if ('@' === c) { - if (seenAt) { - err('@ already seen.'); - buffer += '%40'; - } - seenAt = true; - for (var i = 0; i < buffer.length; i++) { - var cp = buffer[i]; - if ('\t' === cp || '\n' === cp || '\r' === cp) { - err('Invalid whitespace in authority.'); - continue; - } - // XXX check URL code points - if (':' === cp && null === this._password) { - this._password = ''; - continue; - } - var tempC = percentEscape(cp); - if (null !== this._password) { - this._password += tempC; - } else { - this._username += tempC; - } - } - buffer = ''; - } else if (EOF === c || '/' === c || '\\' === c || - '?' === c || '#' === c) { - cursor -= buffer.length; - buffer = ''; - state = 'host'; - continue; - } else { - buffer += c; - } - break; - - case 'file host': - if (EOF === c || '/' === c || '\\' === c || '?' === c || '#' === c) { - if (buffer.length === 2 && ALPHA.test(buffer[0]) && - (buffer[1] === ':' || buffer[1] === '|')) { - state = 'relative path'; - } else if (buffer.length === 0) { - state = 'relative path start'; - } else { - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'relative path start'; - } - continue; - } else if ('\t' === c || '\n' === c || '\r' === c) { - err('Invalid whitespace in file host.'); - } else { - buffer += c; - } - break; - - case 'host': - case 'hostname': - if (':' === c && !seenBracket) { - // XXX host parsing - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'port'; - if ('hostname' === stateOverride) { - break loop; - } - } else if (EOF === c || '/' === c || - '\\' === c || '?' === c || '#' === c) { - this._host = IDNAToASCII.call(this, buffer); - buffer = ''; - state = 'relative path start'; - if (stateOverride) { - break loop; - } - continue; - } else if ('\t' !== c && '\n' !== c && '\r' !== c) { - if ('[' === c) { - seenBracket = true; - } else if (']' === c) { - seenBracket = false; - } - buffer += c; - } else { - err('Invalid code point in host/hostname: ' + c); - } - break; - - case 'port': - if (/[0-9]/.test(c)) { - buffer += c; - } else if (EOF === c || '/' === c || '\\' === c || - '?' === c || '#' === c || stateOverride) { - if ('' !== buffer) { - var temp = parseInt(buffer, 10); - if (temp !== relative[this._scheme]) { - this._port = temp + ''; - } - buffer = ''; - } - if (stateOverride) { - break loop; - } - state = 'relative path start'; - continue; - } else if ('\t' === c || '\n' === c || '\r' === c) { - err('Invalid code point in port: ' + c); - } else { - invalid.call(this); - } - break; - - case 'relative path start': - if ('\\' === c) { - err('\'\\\' not allowed in path.'); - } - state = 'relative path'; - if ('/' !== c && '\\' !== c) { - continue; - } - break; - - case 'relative path': - if (EOF === c || '/' === c || '\\' === c || - (!stateOverride && ('?' === c || '#' === c))) { - if ('\\' === c) { - err('\\ not allowed in relative path.'); - } - var tmp; - if (tmp = relativePathDotMapping[buffer.toLowerCase()]) { - buffer = tmp; - } - if ('..' === buffer) { - this._path.pop(); - if ('/' !== c && '\\' !== c) { - this._path.push(''); - } - } else if ('.' === buffer && '/' !== c && '\\' !== c) { - this._path.push(''); - } else if ('.' !== buffer) { - if ('file' === this._scheme && this._path.length === 0 && - buffer.length === 2 && ALPHA.test(buffer[0]) && - buffer[1] === '|') { - buffer = buffer[0] + ':'; - } - this._path.push(buffer); - } - buffer = ''; - if ('?' === c) { - this._query = '?'; - state = 'query'; - } else if ('#' === c) { - this._fragment = '#'; - state = 'fragment'; - } - } else if ('\t' !== c && '\n' !== c && '\r' !== c) { - buffer += percentEscape(c); - } - break; - - case 'query': - if (!stateOverride && '#' === c) { - this._fragment = '#'; - state = 'fragment'; - } else if (EOF !== c && '\t' !== c && '\n' !== c && '\r' !== c) { - this._query += percentEscapeQuery(c); - } - break; - - case 'fragment': - if (EOF !== c && '\t' !== c && '\n' !== c && '\r' !== c) { - this._fragment += c; - } - break; - } - - cursor++; - } - } - - function clear() { - this._scheme = ''; - this._schemeData = ''; - this._username = ''; - this._password = null; - this._host = ''; - this._port = ''; - this._path = []; - this._query = ''; - this._fragment = ''; - this._isInvalid = false; - this._isRelative = false; - } - - // Does not process domain names or IP addresses. - // Does not handle encoding for the query parameter. - function JURL(url, base /* , encoding */) { - if (base !== undefined && !(base instanceof JURL)) { - base = new JURL(String(base)); - } - - this._url = url; - clear.call(this); - - var input = url.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, ''); - // encoding = encoding || 'utf-8' - - parse.call(this, input, null, base); - } - - JURL.prototype = { - toString: function() { - return this.href; - }, - get href() { - if (this._isInvalid) { - return this._url; - } - var authority = ''; - if ('' !== this._username || null !== this._password) { - authority = this._username + - (null !== this._password ? ':' + this._password : '') + '@'; - } - - return this.protocol + - (this._isRelative ? '//' + authority + this.host : '') + - this.pathname + this._query + this._fragment; - }, - set href(href) { - clear.call(this); - parse.call(this, href); - }, - - get protocol() { - return this._scheme + ':'; - }, - set protocol(protocol) { - if (this._isInvalid) { - return; - } - parse.call(this, protocol + ':', 'scheme start'); - }, - - get host() { - return this._isInvalid ? '' : this._port ? - this._host + ':' + this._port : this._host; - }, - set host(host) { - if (this._isInvalid || !this._isRelative) { - return; - } - parse.call(this, host, 'host'); - }, - - get hostname() { - return this._host; - }, - set hostname(hostname) { - if (this._isInvalid || !this._isRelative) { - return; - } - parse.call(this, hostname, 'hostname'); - }, - - get port() { - return this._port; - }, - set port(port) { - if (this._isInvalid || !this._isRelative) { - return; - } - parse.call(this, port, 'port'); - }, - - get pathname() { - return this._isInvalid ? '' : this._isRelative ? - '/' + this._path.join('/') : this._schemeData; - }, - set pathname(pathname) { - if (this._isInvalid || !this._isRelative) { - return; - } - this._path = []; - parse.call(this, pathname, 'relative path start'); - }, - - get search() { - return this._isInvalid || !this._query || '?' === this._query ? - '' : this._query; - }, - set search(search) { - if (this._isInvalid || !this._isRelative) { - return; - } - this._query = '?'; - if ('?' === search[0]) { - search = search.slice(1); - } - parse.call(this, search, 'query'); - }, - - get hash() { - return this._isInvalid || !this._fragment || '#' === this._fragment ? - '' : this._fragment; - }, - set hash(hash) { - if (this._isInvalid) { - return; - } - this._fragment = '#'; - if ('#' === hash[0]) { - hash = hash.slice(1); - } - parse.call(this, hash, 'fragment'); - }, - - get origin() { - var host; - if (this._isInvalid || !this._scheme) { - return ''; - } - // javascript: Gecko returns String(""), WebKit/Blink String("null") - // Gecko throws error for "data://" - // data: Gecko returns "", Blink returns "data://", WebKit returns "null" - // Gecko returns String("") for file: mailto: - // WebKit/Blink returns String("SCHEME://") for file: mailto: - switch (this._scheme) { - case 'data': - case 'file': - case 'javascript': - case 'mailto': - return 'null'; - } - host = this.host; - if (!host) { - return ''; - } - return this._scheme + '://' + host; - } - }; - - // Copy over the static methods - var OriginalURL = scope.URL; - if (OriginalURL) { - JURL.createObjectURL = function(blob) { - // IE extension allows a second optional options argument. - // http://msdn.microsoft.com/en-us/library/ie/hh772302(v=vs.85).aspx - return OriginalURL.createObjectURL.apply(OriginalURL, arguments); - }; - JURL.revokeObjectURL = function(url) { - OriginalURL.revokeObjectURL(url); - }; - } - - scope.URL = JURL; -})(globalScope); - -exports.FONT_IDENTITY_MATRIX = FONT_IDENTITY_MATRIX; -exports.IDENTITY_MATRIX = IDENTITY_MATRIX; -exports.OPS = OPS; -exports.VERBOSITY_LEVELS = VERBOSITY_LEVELS; -exports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES; -exports.AnnotationBorderStyleType = AnnotationBorderStyleType; -exports.AnnotationFieldFlag = AnnotationFieldFlag; -exports.AnnotationFlag = AnnotationFlag; -exports.AnnotationType = AnnotationType; -exports.FontType = FontType; -exports.ImageKind = ImageKind; -exports.InvalidPDFException = InvalidPDFException; -exports.MessageHandler = MessageHandler; -exports.MissingDataException = MissingDataException; -exports.MissingPDFException = MissingPDFException; -exports.NotImplementedException = NotImplementedException; -exports.PageViewport = PageViewport; -exports.PasswordException = PasswordException; -exports.PasswordResponses = PasswordResponses; -exports.StatTimer = StatTimer; -exports.StreamType = StreamType; -exports.TextRenderingMode = TextRenderingMode; -exports.UnexpectedResponseException = UnexpectedResponseException; -exports.UnknownErrorException = UnknownErrorException; -exports.Util = Util; -exports.XRefParseException = XRefParseException; -exports.arrayByteLength = arrayByteLength; -exports.arraysToBytes = arraysToBytes; -exports.assert = assert; -exports.bytesToString = bytesToString; -exports.createBlob = createBlob; -exports.createPromiseCapability = createPromiseCapability; -exports.createObjectURL = createObjectURL; -exports.deprecated = deprecated; -exports.error = error; -exports.getLookupTableFactory = getLookupTableFactory; -exports.getVerbosityLevel = getVerbosityLevel; -exports.globalScope = globalScope; -exports.info = info; -exports.isArray = isArray; -exports.isArrayBuffer = isArrayBuffer; -exports.isBool = isBool; -exports.isEmptyObj = isEmptyObj; -exports.isInt = isInt; -exports.isNum = isNum; -exports.isString = isString; -exports.isSpace = isSpace; -exports.isSameOrigin = isSameOrigin; -exports.isValidUrl = isValidUrl; -exports.isLittleEndian = isLittleEndian; -exports.isEvalSupported = isEvalSupported; -exports.loadJpegStream = loadJpegStream; -exports.log2 = log2; -exports.readInt8 = readInt8; -exports.readUint16 = readUint16; -exports.readUint32 = readUint32; -exports.removeNullCharacters = removeNullCharacters; -exports.setVerbosityLevel = setVerbosityLevel; -exports.shadow = shadow; -exports.string32 = string32; -exports.stringToBytes = stringToBytes; -exports.stringToPDFString = stringToPDFString; -exports.stringToUTF8String = stringToUTF8String; -exports.utf8StringToString = utf8StringToString; -exports.warn = warn; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreCFFParser = {}), root.pdfjsSharedUtil, - root.pdfjsCoreCharsets, root.pdfjsCoreEncodings); - } -}(this, function (exports, sharedUtil, coreCharsets, coreEncodings) { - -var error = sharedUtil.error; -var info = sharedUtil.info; -var bytesToString = sharedUtil.bytesToString; -var warn = sharedUtil.warn; -var isArray = sharedUtil.isArray; -var Util = sharedUtil.Util; -var stringToBytes = sharedUtil.stringToBytes; -var assert = sharedUtil.assert; -var ISOAdobeCharset = coreCharsets.ISOAdobeCharset; -var ExpertCharset = coreCharsets.ExpertCharset; -var ExpertSubsetCharset = coreCharsets.ExpertSubsetCharset; -var StandardEncoding = coreEncodings.StandardEncoding; -var ExpertEncoding = coreEncodings.ExpertEncoding; - -// Maximum subroutine call depth of type 2 chartrings. Matches OTS. -var MAX_SUBR_NESTING = 10; - -/** - * The CFF class takes a Type1 file and wrap it into a - * 'Compact Font Format' which itself embed Type2 charstrings. - */ -var CFFStandardStrings = [ - '.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', - 'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus', - 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', - 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', - 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', - 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', - 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', - 'underscore', 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', - 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', - 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', 'exclamdown', 'cent', - 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', - 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', - 'guilsinglright', 'fi', 'fl', 'endash', 'dagger', 'daggerdbl', - 'periodcentered', 'paragraph', 'bullet', 'quotesinglbase', 'quotedblbase', - 'quotedblright', 'guillemotright', 'ellipsis', 'perthousand', 'questiondown', - 'grave', 'acute', 'circumflex', 'tilde', 'macron', 'breve', 'dotaccent', - 'dieresis', 'ring', 'cedilla', 'hungarumlaut', 'ogonek', 'caron', 'emdash', - 'AE', 'ordfeminine', 'Lslash', 'Oslash', 'OE', 'ordmasculine', 'ae', - 'dotlessi', 'lslash', 'oslash', 'oe', 'germandbls', 'onesuperior', - 'logicalnot', 'mu', 'trademark', 'Eth', 'onehalf', 'plusminus', 'Thorn', - 'onequarter', 'divide', 'brokenbar', 'degree', 'thorn', 'threequarters', - 'twosuperior', 'registered', 'minus', 'eth', 'multiply', 'threesuperior', - 'copyright', 'Aacute', 'Acircumflex', 'Adieresis', 'Agrave', 'Aring', - 'Atilde', 'Ccedilla', 'Eacute', 'Ecircumflex', 'Edieresis', 'Egrave', - 'Iacute', 'Icircumflex', 'Idieresis', 'Igrave', 'Ntilde', 'Oacute', - 'Ocircumflex', 'Odieresis', 'Ograve', 'Otilde', 'Scaron', 'Uacute', - 'Ucircumflex', 'Udieresis', 'Ugrave', 'Yacute', 'Ydieresis', 'Zcaron', - 'aacute', 'acircumflex', 'adieresis', 'agrave', 'aring', 'atilde', - 'ccedilla', 'eacute', 'ecircumflex', 'edieresis', 'egrave', 'iacute', - 'icircumflex', 'idieresis', 'igrave', 'ntilde', 'oacute', 'ocircumflex', - 'odieresis', 'ograve', 'otilde', 'scaron', 'uacute', 'ucircumflex', - 'udieresis', 'ugrave', 'yacute', 'ydieresis', 'zcaron', 'exclamsmall', - 'Hungarumlautsmall', 'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', - 'Acutesmall', 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', - 'onedotenleader', 'zerooldstyle', 'oneoldstyle', 'twooldstyle', - 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', - 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'commasuperior', - 'threequartersemdash', 'periodsuperior', 'questionsmall', 'asuperior', - 'bsuperior', 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', - 'lsuperior', 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', - 'tsuperior', 'ff', 'ffi', 'ffl', 'parenleftinferior', 'parenrightinferior', - 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', 'Asmall', 'Bsmall', - 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall', - 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall', - 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall', - 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah', - 'Tildesmall', 'exclamdownsmall', 'centoldstyle', 'Lslashsmall', - 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', 'Brevesmall', 'Caronsmall', - 'Dotaccentsmall', 'Macronsmall', 'figuredash', 'hypheninferior', - 'Ogoneksmall', 'Ringsmall', 'Cedillasmall', 'questiondownsmall', 'oneeighth', - 'threeeighths', 'fiveeighths', 'seveneighths', 'onethird', 'twothirds', - 'zerosuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', - 'sevensuperior', 'eightsuperior', 'ninesuperior', 'zeroinferior', - 'oneinferior', 'twoinferior', 'threeinferior', 'fourinferior', - 'fiveinferior', 'sixinferior', 'seveninferior', 'eightinferior', - 'nineinferior', 'centinferior', 'dollarinferior', 'periodinferior', - 'commainferior', 'Agravesmall', 'Aacutesmall', 'Acircumflexsmall', - 'Atildesmall', 'Adieresissmall', 'Aringsmall', 'AEsmall', 'Ccedillasmall', - 'Egravesmall', 'Eacutesmall', 'Ecircumflexsmall', 'Edieresissmall', - 'Igravesmall', 'Iacutesmall', 'Icircumflexsmall', 'Idieresissmall', - 'Ethsmall', 'Ntildesmall', 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', - 'Otildesmall', 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', - 'Uacutesmall', 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', - 'Thornsmall', 'Ydieresissmall', '001.000', '001.001', '001.002', '001.003', - 'Black', 'Bold', 'Book', 'Light', 'Medium', 'Regular', 'Roman', 'Semibold' -]; - - -var CFFParser = (function CFFParserClosure() { - var CharstringValidationData = [ - null, - { id: 'hstem', min: 2, stackClearing: true, stem: true }, - null, - { id: 'vstem', min: 2, stackClearing: true, stem: true }, - { id: 'vmoveto', min: 1, stackClearing: true }, - { id: 'rlineto', min: 2, resetStack: true }, - { id: 'hlineto', min: 1, resetStack: true }, - { id: 'vlineto', min: 1, resetStack: true }, - { id: 'rrcurveto', min: 6, resetStack: true }, - null, - { id: 'callsubr', min: 1, undefStack: true }, - { id: 'return', min: 0, undefStack: true }, - null, // 12 - null, - { id: 'endchar', min: 0, stackClearing: true }, - null, - null, - null, - { id: 'hstemhm', min: 2, stackClearing: true, stem: true }, - { id: 'hintmask', min: 0, stackClearing: true }, - { id: 'cntrmask', min: 0, stackClearing: true }, - { id: 'rmoveto', min: 2, stackClearing: true }, - { id: 'hmoveto', min: 1, stackClearing: true }, - { id: 'vstemhm', min: 2, stackClearing: true, stem: true }, - { id: 'rcurveline', min: 8, resetStack: true }, - { id: 'rlinecurve', min: 8, resetStack: true }, - { id: 'vvcurveto', min: 4, resetStack: true }, - { id: 'hhcurveto', min: 4, resetStack: true }, - null, // shortint - { id: 'callgsubr', min: 1, undefStack: true }, - { id: 'vhcurveto', min: 4, resetStack: true }, - { id: 'hvcurveto', min: 4, resetStack: true } - ]; - var CharstringValidationData12 = [ - null, - null, - null, - { id: 'and', min: 2, stackDelta: -1 }, - { id: 'or', min: 2, stackDelta: -1 }, - { id: 'not', min: 1, stackDelta: 0 }, - null, - null, - null, - { id: 'abs', min: 1, stackDelta: 0 }, - { id: 'add', min: 2, stackDelta: -1, - stackFn: function stack_div(stack, index) { - stack[index - 2] = stack[index - 2] + stack[index - 1]; - } - }, - { id: 'sub', min: 2, stackDelta: -1, - stackFn: function stack_div(stack, index) { - stack[index - 2] = stack[index - 2] - stack[index - 1]; - } - }, - { id: 'div', min: 2, stackDelta: -1, - stackFn: function stack_div(stack, index) { - stack[index - 2] = stack[index - 2] / stack[index - 1]; - } - }, - null, - { id: 'neg', min: 1, stackDelta: 0, - stackFn: function stack_div(stack, index) { - stack[index - 1] = -stack[index - 1]; - } - }, - { id: 'eq', min: 2, stackDelta: -1 }, - null, - null, - { id: 'drop', min: 1, stackDelta: -1 }, - null, - { id: 'put', min: 2, stackDelta: -2 }, - { id: 'get', min: 1, stackDelta: 0 }, - { id: 'ifelse', min: 4, stackDelta: -3 }, - { id: 'random', min: 0, stackDelta: 1 }, - { id: 'mul', min: 2, stackDelta: -1, - stackFn: function stack_div(stack, index) { - stack[index - 2] = stack[index - 2] * stack[index - 1]; - } - }, - null, - { id: 'sqrt', min: 1, stackDelta: 0 }, - { id: 'dup', min: 1, stackDelta: 1 }, - { id: 'exch', min: 2, stackDelta: 0 }, - { id: 'index', min: 2, stackDelta: 0 }, - { id: 'roll', min: 3, stackDelta: -2 }, - null, - null, - null, - { id: 'hflex', min: 7, resetStack: true }, - { id: 'flex', min: 13, resetStack: true }, - { id: 'hflex1', min: 9, resetStack: true }, - { id: 'flex1', min: 11, resetStack: true } - ]; - - function CFFParser(file, properties, seacAnalysisEnabled) { - this.bytes = file.getBytes(); - this.properties = properties; - this.seacAnalysisEnabled = !!seacAnalysisEnabled; - } - CFFParser.prototype = { - parse: function CFFParser_parse() { - var properties = this.properties; - var cff = new CFF(); - this.cff = cff; - - // The first five sections must be in order, all the others are reached - // via offsets contained in one of the below. - var header = this.parseHeader(); - var nameIndex = this.parseIndex(header.endPos); - var topDictIndex = this.parseIndex(nameIndex.endPos); - var stringIndex = this.parseIndex(topDictIndex.endPos); - var globalSubrIndex = this.parseIndex(stringIndex.endPos); - - var topDictParsed = this.parseDict(topDictIndex.obj.get(0)); - var topDict = this.createDict(CFFTopDict, topDictParsed, cff.strings); - - cff.header = header.obj; - cff.names = this.parseNameIndex(nameIndex.obj); - cff.strings = this.parseStringIndex(stringIndex.obj); - cff.topDict = topDict; - cff.globalSubrIndex = globalSubrIndex.obj; - - this.parsePrivateDict(cff.topDict); - - cff.isCIDFont = topDict.hasName('ROS'); - - var charStringOffset = topDict.getByName('CharStrings'); - var charStringIndex = this.parseIndex(charStringOffset).obj; - - var fontMatrix = topDict.getByName('FontMatrix'); - if (fontMatrix) { - properties.fontMatrix = fontMatrix; - } - - var fontBBox = topDict.getByName('FontBBox'); - if (fontBBox) { - // adjusting ascent/descent - properties.ascent = fontBBox[3]; - properties.descent = fontBBox[1]; - properties.ascentScaled = true; - } - - var charset, encoding; - if (cff.isCIDFont) { - var fdArrayIndex = this.parseIndex(topDict.getByName('FDArray')).obj; - for (var i = 0, ii = fdArrayIndex.count; i < ii; ++i) { - var dictRaw = fdArrayIndex.get(i); - var fontDict = this.createDict(CFFTopDict, this.parseDict(dictRaw), - cff.strings); - this.parsePrivateDict(fontDict); - cff.fdArray.push(fontDict); - } - // cid fonts don't have an encoding - encoding = null; - charset = this.parseCharsets(topDict.getByName('charset'), - charStringIndex.count, cff.strings, true); - cff.fdSelect = this.parseFDSelect(topDict.getByName('FDSelect'), - charStringIndex.count); - } else { - charset = this.parseCharsets(topDict.getByName('charset'), - charStringIndex.count, cff.strings, false); - encoding = this.parseEncoding(topDict.getByName('Encoding'), - properties, - cff.strings, charset.charset); - } - - cff.charset = charset; - cff.encoding = encoding; - - var charStringsAndSeacs = this.parseCharStrings( - charStringIndex, - topDict.privateDict.subrsIndex, - globalSubrIndex.obj, - cff.fdSelect, - cff.fdArray); - cff.charStrings = charStringsAndSeacs.charStrings; - cff.seacs = charStringsAndSeacs.seacs; - cff.widths = charStringsAndSeacs.widths; - - return cff; - }, - parseHeader: function CFFParser_parseHeader() { - var bytes = this.bytes; - var bytesLength = bytes.length; - var offset = 0; - - // Prevent an infinite loop, by checking that the offset is within the - // bounds of the bytes array. Necessary in empty, or invalid, font files. - while (offset < bytesLength && bytes[offset] !== 1) { - ++offset; - } - if (offset >= bytesLength) { - error('Invalid CFF header'); - } else if (offset !== 0) { - info('cff data is shifted'); - bytes = bytes.subarray(offset); - this.bytes = bytes; - } - var major = bytes[0]; - var minor = bytes[1]; - var hdrSize = bytes[2]; - var offSize = bytes[3]; - var header = new CFFHeader(major, minor, hdrSize, offSize); - return { obj: header, endPos: hdrSize }; - }, - parseDict: function CFFParser_parseDict(dict) { - var pos = 0; - - function parseOperand() { - var value = dict[pos++]; - if (value === 30) { - return parseFloatOperand(); - } else if (value === 28) { - value = dict[pos++]; - value = ((value << 24) | (dict[pos++] << 16)) >> 16; - return value; - } else if (value === 29) { - value = dict[pos++]; - value = (value << 8) | dict[pos++]; - value = (value << 8) | dict[pos++]; - value = (value << 8) | dict[pos++]; - return value; - } else if (value >= 32 && value <= 246) { - return value - 139; - } else if (value >= 247 && value <= 250) { - return ((value - 247) * 256) + dict[pos++] + 108; - } else if (value >= 251 && value <= 254) { - return -((value - 251) * 256) - dict[pos++] - 108; - } else { - error('255 is not a valid DICT command'); - } - return -1; - } - - function parseFloatOperand() { - var str = ''; - var eof = 15; - var lookup = ['0', '1', '2', '3', '4', '5', '6', '7', '8', - '9', '.', 'E', 'E-', null, '-']; - var length = dict.length; - while (pos < length) { - var b = dict[pos++]; - var b1 = b >> 4; - var b2 = b & 15; - - if (b1 === eof) { - break; - } - str += lookup[b1]; - - if (b2 === eof) { - break; - } - str += lookup[b2]; - } - return parseFloat(str); - } - - var operands = []; - var entries = []; - - pos = 0; - var end = dict.length; - while (pos < end) { - var b = dict[pos]; - if (b <= 21) { - if (b === 12) { - b = (b << 8) | dict[++pos]; - } - entries.push([b, operands]); - operands = []; - ++pos; - } else { - operands.push(parseOperand()); - } - } - return entries; - }, - parseIndex: function CFFParser_parseIndex(pos) { - var cffIndex = new CFFIndex(); - var bytes = this.bytes; - var count = (bytes[pos++] << 8) | bytes[pos++]; - var offsets = []; - var end = pos; - var i, ii; - - if (count !== 0) { - var offsetSize = bytes[pos++]; - // add 1 for offset to determine size of last object - var startPos = pos + ((count + 1) * offsetSize) - 1; - - for (i = 0, ii = count + 1; i < ii; ++i) { - var offset = 0; - for (var j = 0; j < offsetSize; ++j) { - offset <<= 8; - offset += bytes[pos++]; - } - offsets.push(startPos + offset); - } - end = offsets[count]; - } - for (i = 0, ii = offsets.length - 1; i < ii; ++i) { - var offsetStart = offsets[i]; - var offsetEnd = offsets[i + 1]; - cffIndex.add(bytes.subarray(offsetStart, offsetEnd)); - } - return {obj: cffIndex, endPos: end}; - }, - parseNameIndex: function CFFParser_parseNameIndex(index) { - var names = []; - for (var i = 0, ii = index.count; i < ii; ++i) { - var name = index.get(i); - // OTS doesn't allow names to be over 127 characters. - var length = Math.min(name.length, 127); - var data = []; - // OTS also only permits certain characters in the name. - for (var j = 0; j < length; ++j) { - var c = name[j]; - if (j === 0 && c === 0) { - data[j] = c; - continue; - } - if ((c < 33 || c > 126) || c === 91 /* [ */ || c === 93 /* ] */ || - c === 40 /* ( */ || c === 41 /* ) */ || c === 123 /* { */ || - c === 125 /* } */ || c === 60 /* < */ || c === 62 /* > */ || - c === 47 /* / */ || c === 37 /* % */ || c === 35 /* # */) { - data[j] = 95; - continue; - } - data[j] = c; - } - names.push(bytesToString(data)); - } - return names; - }, - parseStringIndex: function CFFParser_parseStringIndex(index) { - var strings = new CFFStrings(); - for (var i = 0, ii = index.count; i < ii; ++i) { - var data = index.get(i); - strings.add(bytesToString(data)); - } - return strings; - }, - createDict: function CFFParser_createDict(Type, dict, strings) { - var cffDict = new Type(strings); - for (var i = 0, ii = dict.length; i < ii; ++i) { - var pair = dict[i]; - var key = pair[0]; - var value = pair[1]; - cffDict.setByKey(key, value); - } - return cffDict; - }, - parseCharString: function CFFParser_parseCharString(state, data, - localSubrIndex, - globalSubrIndex) { - if (state.callDepth > MAX_SUBR_NESTING) { - return false; - } - var stackSize = state.stackSize; - var stack = state.stack; - - var length = data.length; - - for (var j = 0; j < length;) { - var value = data[j++]; - var validationCommand = null; - if (value === 12) { - var q = data[j++]; - if (q === 0) { - // The CFF specification state that the 'dotsection' command - // (12, 0) is deprecated and treated as a no-op, but all Type2 - // charstrings processors should support them. Unfortunately - // the font sanitizer don't. As a workaround the sequence (12, 0) - // is replaced by a useless (0, hmoveto). - data[j - 2] = 139; - data[j - 1] = 22; - stackSize = 0; - } else { - validationCommand = CharstringValidationData12[q]; - } - } else if (value === 28) { // number (16 bit) - stack[stackSize] = ((data[j] << 24) | (data[j + 1] << 16)) >> 16; - j += 2; - stackSize++; - } else if (value === 14) { - if (stackSize >= 4) { - stackSize -= 4; - if (this.seacAnalysisEnabled) { - state.seac = stack.slice(stackSize, stackSize + 4); - return false; - } - } - validationCommand = CharstringValidationData[value]; - } else if (value >= 32 && value <= 246) { // number - stack[stackSize] = value - 139; - stackSize++; - } else if (value >= 247 && value <= 254) { // number (+1 bytes) - stack[stackSize] = (value < 251 ? - ((value - 247) << 8) + data[j] + 108 : - -((value - 251) << 8) - data[j] - 108); - j++; - stackSize++; - } else if (value === 255) { // number (32 bit) - stack[stackSize] = ((data[j] << 24) | (data[j + 1] << 16) | - (data[j + 2] << 8) | data[j + 3]) / 65536; - j += 4; - stackSize++; - } else if (value === 19 || value === 20) { - state.hints += stackSize >> 1; - // skipping right amount of hints flag data - j += (state.hints + 7) >> 3; - stackSize %= 2; - validationCommand = CharstringValidationData[value]; - } else if (value === 10 || value === 29) { - var subrsIndex; - if (value === 10) { - subrsIndex = localSubrIndex; - } else { - subrsIndex = globalSubrIndex; - } - if (!subrsIndex) { - validationCommand = CharstringValidationData[value]; - warn('Missing subrsIndex for ' + validationCommand.id); - return false; - } - var bias = 32768; - if (subrsIndex.count < 1240) { - bias = 107; - } else if (subrsIndex.count < 33900) { - bias = 1131; - } - var subrNumber = stack[--stackSize] + bias; - if (subrNumber < 0 || subrNumber >= subrsIndex.count) { - validationCommand = CharstringValidationData[value]; - warn('Out of bounds subrIndex for ' + validationCommand.id); - return false; - } - state.stackSize = stackSize; - state.callDepth++; - var valid = this.parseCharString(state, subrsIndex.get(subrNumber), - localSubrIndex, globalSubrIndex); - if (!valid) { - return false; - } - state.callDepth--; - stackSize = state.stackSize; - continue; - } else if (value === 11) { - state.stackSize = stackSize; - return true; - } else { - validationCommand = CharstringValidationData[value]; - } - if (validationCommand) { - if (validationCommand.stem) { - state.hints += stackSize >> 1; - } - if ('min' in validationCommand) { - if (!state.undefStack && stackSize < validationCommand.min) { - warn('Not enough parameters for ' + validationCommand.id + - '; actual: ' + stackSize + - ', expected: ' + validationCommand.min); - return false; - } - } - if (state.firstStackClearing && validationCommand.stackClearing) { - state.firstStackClearing = false; - // the optional character width can be found before the first - // stack-clearing command arguments - stackSize -= validationCommand.min; - if (stackSize >= 2 && validationCommand.stem) { - // there are even amount of arguments for stem commands - stackSize %= 2; - } else if (stackSize > 1) { - warn('Found too many parameters for stack-clearing command'); - } - if (stackSize > 0 && stack[stackSize - 1] >= 0) { - state.width = stack[stackSize - 1]; - } - } - if ('stackDelta' in validationCommand) { - if ('stackFn' in validationCommand) { - validationCommand.stackFn(stack, stackSize); - } - stackSize += validationCommand.stackDelta; - } else if (validationCommand.stackClearing) { - stackSize = 0; - } else if (validationCommand.resetStack) { - stackSize = 0; - state.undefStack = false; - } else if (validationCommand.undefStack) { - stackSize = 0; - state.undefStack = true; - state.firstStackClearing = false; - } - } - } - state.stackSize = stackSize; - return true; - }, - parseCharStrings: function CFFParser_parseCharStrings(charStrings, - localSubrIndex, - globalSubrIndex, - fdSelect, - fdArray) { - var seacs = []; - var widths = []; - var count = charStrings.count; - for (var i = 0; i < count; i++) { - var charstring = charStrings.get(i); - var state = { - callDepth: 0, - stackSize: 0, - stack: [], - undefStack: true, - hints: 0, - firstStackClearing: true, - seac: null, - width: null - }; - var valid = true; - var localSubrToUse = null; - if (fdSelect && fdArray.length) { - var fdIndex = fdSelect.getFDIndex(i); - if (fdIndex === -1) { - warn('Glyph index is not in fd select.'); - valid = false; - } - if (fdIndex >= fdArray.length) { - warn('Invalid fd index for glyph index.'); - valid = false; - } - if (valid) { - localSubrToUse = fdArray[fdIndex].privateDict.subrsIndex; - } - } else if (localSubrIndex) { - localSubrToUse = localSubrIndex; - } - if (valid) { - valid = this.parseCharString(state, charstring, localSubrToUse, - globalSubrIndex); - } - if (state.width !== null) { - widths[i] = state.width; - } - if (state.seac !== null) { - seacs[i] = state.seac; - } - if (!valid) { - // resetting invalid charstring to single 'endchar' - charStrings.set(i, new Uint8Array([14])); - } - } - return { charStrings: charStrings, seacs: seacs, widths: widths }; - }, - emptyPrivateDictionary: - function CFFParser_emptyPrivateDictionary(parentDict) { - var privateDict = this.createDict(CFFPrivateDict, [], - parentDict.strings); - parentDict.setByKey(18, [0, 0]); - parentDict.privateDict = privateDict; - }, - parsePrivateDict: function CFFParser_parsePrivateDict(parentDict) { - // no private dict, do nothing - if (!parentDict.hasName('Private')) { - this.emptyPrivateDictionary(parentDict); - return; - } - var privateOffset = parentDict.getByName('Private'); - // make sure the params are formatted correctly - if (!isArray(privateOffset) || privateOffset.length !== 2) { - parentDict.removeByName('Private'); - return; - } - var size = privateOffset[0]; - var offset = privateOffset[1]; - // remove empty dicts or ones that refer to invalid location - if (size === 0 || offset >= this.bytes.length) { - this.emptyPrivateDictionary(parentDict); - return; - } - - var privateDictEnd = offset + size; - var dictData = this.bytes.subarray(offset, privateDictEnd); - var dict = this.parseDict(dictData); - var privateDict = this.createDict(CFFPrivateDict, dict, - parentDict.strings); - parentDict.privateDict = privateDict; - - // Parse the Subrs index also since it's relative to the private dict. - if (!privateDict.getByName('Subrs')) { - return; - } - var subrsOffset = privateDict.getByName('Subrs'); - var relativeOffset = offset + subrsOffset; - // Validate the offset. - if (subrsOffset === 0 || relativeOffset >= this.bytes.length) { - this.emptyPrivateDictionary(parentDict); - return; - } - var subrsIndex = this.parseIndex(relativeOffset); - privateDict.subrsIndex = subrsIndex.obj; - }, - parseCharsets: function CFFParser_parseCharsets(pos, length, strings, cid) { - if (pos === 0) { - return new CFFCharset(true, CFFCharsetPredefinedTypes.ISO_ADOBE, - ISOAdobeCharset); - } else if (pos === 1) { - return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT, - ExpertCharset); - } else if (pos === 2) { - return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT_SUBSET, - ExpertSubsetCharset); - } - - var bytes = this.bytes; - var start = pos; - var format = bytes[pos++]; - var charset = ['.notdef']; - var id, count, i; - - // subtract 1 for the .notdef glyph - length -= 1; - - switch (format) { - case 0: - for (i = 0; i < length; i++) { - id = (bytes[pos++] << 8) | bytes[pos++]; - charset.push(cid ? id : strings.get(id)); - } - break; - case 1: - while (charset.length <= length) { - id = (bytes[pos++] << 8) | bytes[pos++]; - count = bytes[pos++]; - for (i = 0; i <= count; i++) { - charset.push(cid ? id++ : strings.get(id++)); - } - } - break; - case 2: - while (charset.length <= length) { - id = (bytes[pos++] << 8) | bytes[pos++]; - count = (bytes[pos++] << 8) | bytes[pos++]; - for (i = 0; i <= count; i++) { - charset.push(cid ? id++ : strings.get(id++)); - } - } - break; - default: - error('Unknown charset format'); - } - // Raw won't be needed if we actually compile the charset. - var end = pos; - var raw = bytes.subarray(start, end); - - return new CFFCharset(false, format, charset, raw); - }, - parseEncoding: function CFFParser_parseEncoding(pos, - properties, - strings, - charset) { - var encoding = Object.create(null); - var bytes = this.bytes; - var predefined = false; - var hasSupplement = false; - var format, i, ii; - var raw = null; - - function readSupplement() { - var supplementsCount = bytes[pos++]; - for (i = 0; i < supplementsCount; i++) { - var code = bytes[pos++]; - var sid = (bytes[pos++] << 8) + (bytes[pos++] & 0xff); - encoding[code] = charset.indexOf(strings.get(sid)); - } - } - - if (pos === 0 || pos === 1) { - predefined = true; - format = pos; - var baseEncoding = pos ? ExpertEncoding : StandardEncoding; - for (i = 0, ii = charset.length; i < ii; i++) { - var index = baseEncoding.indexOf(charset[i]); - if (index !== -1) { - encoding[index] = i; - } - } - } else { - var dataStart = pos; - format = bytes[pos++]; - switch (format & 0x7f) { - case 0: - var glyphsCount = bytes[pos++]; - for (i = 1; i <= glyphsCount; i++) { - encoding[bytes[pos++]] = i; - } - break; - - case 1: - var rangesCount = bytes[pos++]; - var gid = 1; - for (i = 0; i < rangesCount; i++) { - var start = bytes[pos++]; - var left = bytes[pos++]; - for (var j = start; j <= start + left; j++) { - encoding[j] = gid++; - } - } - break; - - default: - error('Unknown encoding format: ' + format + ' in CFF'); - break; - } - var dataEnd = pos; - if (format & 0x80) { - // The font sanitizer does not support CFF encoding with a - // supplement, since the encoding is not really used to map - // between gid to glyph, let's overwrite what is declared in - // the top dictionary to let the sanitizer think the font use - // StandardEncoding, that's a lie but that's ok. - bytes[dataStart] &= 0x7f; - readSupplement(); - hasSupplement = true; - } - raw = bytes.subarray(dataStart, dataEnd); - } - format = format & 0x7f; - return new CFFEncoding(predefined, format, encoding, raw); - }, - parseFDSelect: function CFFParser_parseFDSelect(pos, length) { - var start = pos; - var bytes = this.bytes; - var format = bytes[pos++]; - var fdSelect = [], rawBytes; - var i, invalidFirstGID = false; - - switch (format) { - case 0: - for (i = 0; i < length; ++i) { - var id = bytes[pos++]; - fdSelect.push(id); - } - rawBytes = bytes.subarray(start, pos); - break; - case 3: - var rangesCount = (bytes[pos++] << 8) | bytes[pos++]; - for (i = 0; i < rangesCount; ++i) { - var first = (bytes[pos++] << 8) | bytes[pos++]; - if (i === 0 && first !== 0) { - warn('parseFDSelect: The first range must have a first GID of 0' + - ' -- trying to recover.'); - invalidFirstGID = true; - first = 0; - } - var fdIndex = bytes[pos++]; - var next = (bytes[pos] << 8) | bytes[pos + 1]; - for (var j = first; j < next; ++j) { - fdSelect.push(fdIndex); - } - } - // Advance past the sentinel(next). - pos += 2; - rawBytes = bytes.subarray(start, pos); - - if (invalidFirstGID) { - rawBytes[3] = rawBytes[4] = 0; // Adjust the first range, first GID. - } - break; - default: - error('parseFDSelect: Unknown format "' + format + '".'); - break; - } - assert(fdSelect.length === length, 'parseFDSelect: Invalid font data.'); - - return new CFFFDSelect(fdSelect, rawBytes); - } - }; - return CFFParser; -})(); - -// Compact Font Format -var CFF = (function CFFClosure() { - function CFF() { - this.header = null; - this.names = []; - this.topDict = null; - this.strings = new CFFStrings(); - this.globalSubrIndex = null; - - // The following could really be per font, but since we only have one font - // store them here. - this.encoding = null; - this.charset = null; - this.charStrings = null; - this.fdArray = []; - this.fdSelect = null; - - this.isCIDFont = false; - } - return CFF; -})(); - -var CFFHeader = (function CFFHeaderClosure() { - function CFFHeader(major, minor, hdrSize, offSize) { - this.major = major; - this.minor = minor; - this.hdrSize = hdrSize; - this.offSize = offSize; - } - return CFFHeader; -})(); - -var CFFStrings = (function CFFStringsClosure() { - function CFFStrings() { - this.strings = []; - } - CFFStrings.prototype = { - get: function CFFStrings_get(index) { - if (index >= 0 && index <= 390) { - return CFFStandardStrings[index]; - } - if (index - 391 <= this.strings.length) { - return this.strings[index - 391]; - } - return CFFStandardStrings[0]; - }, - add: function CFFStrings_add(value) { - this.strings.push(value); - }, - get count() { - return this.strings.length; - } - }; - return CFFStrings; -})(); - -var CFFIndex = (function CFFIndexClosure() { - function CFFIndex() { - this.objects = []; - this.length = 0; - } - CFFIndex.prototype = { - add: function CFFIndex_add(data) { - this.length += data.length; - this.objects.push(data); - }, - set: function CFFIndex_set(index, data) { - this.length += data.length - this.objects[index].length; - this.objects[index] = data; - }, - get: function CFFIndex_get(index) { - return this.objects[index]; - }, - get count() { - return this.objects.length; - } - }; - return CFFIndex; -})(); - -var CFFDict = (function CFFDictClosure() { - function CFFDict(tables, strings) { - this.keyToNameMap = tables.keyToNameMap; - this.nameToKeyMap = tables.nameToKeyMap; - this.defaults = tables.defaults; - this.types = tables.types; - this.opcodes = tables.opcodes; - this.order = tables.order; - this.strings = strings; - this.values = Object.create(null); - } - CFFDict.prototype = { - // value should always be an array - setByKey: function CFFDict_setByKey(key, value) { - if (!(key in this.keyToNameMap)) { - return false; - } - // ignore empty values - if (value.length === 0) { - return true; - } - var type = this.types[key]; - // remove the array wrapping these types of values - if (type === 'num' || type === 'sid' || type === 'offset') { - value = value[0]; - // Ignore invalid values (fixes bug 1068432). - if (isNaN(value)) { - warn('Invalid CFFDict value: ' + value + ', for key: ' + key + '.'); - return true; - } - } - this.values[key] = value; - return true; - }, - setByName: function CFFDict_setByName(name, value) { - if (!(name in this.nameToKeyMap)) { - error('Invalid dictionary name "' + name + '"'); - } - this.values[this.nameToKeyMap[name]] = value; - }, - hasName: function CFFDict_hasName(name) { - return this.nameToKeyMap[name] in this.values; - }, - getByName: function CFFDict_getByName(name) { - if (!(name in this.nameToKeyMap)) { - error('Invalid dictionary name "' + name + '"'); - } - var key = this.nameToKeyMap[name]; - if (!(key in this.values)) { - return this.defaults[key]; - } - return this.values[key]; - }, - removeByName: function CFFDict_removeByName(name) { - delete this.values[this.nameToKeyMap[name]]; - } - }; - CFFDict.createTables = function CFFDict_createTables(layout) { - var tables = { - keyToNameMap: {}, - nameToKeyMap: {}, - defaults: {}, - types: {}, - opcodes: {}, - order: [] - }; - for (var i = 0, ii = layout.length; i < ii; ++i) { - var entry = layout[i]; - var key = isArray(entry[0]) ? (entry[0][0] << 8) + entry[0][1] : entry[0]; - tables.keyToNameMap[key] = entry[1]; - tables.nameToKeyMap[entry[1]] = key; - tables.types[key] = entry[2]; - tables.defaults[key] = entry[3]; - tables.opcodes[key] = isArray(entry[0]) ? entry[0] : [entry[0]]; - tables.order.push(key); - } - return tables; - }; - return CFFDict; -})(); - -var CFFTopDict = (function CFFTopDictClosure() { - var layout = [ - [[12, 30], 'ROS', ['sid', 'sid', 'num'], null], - [[12, 20], 'SyntheticBase', 'num', null], - [0, 'version', 'sid', null], - [1, 'Notice', 'sid', null], - [[12, 0], 'Copyright', 'sid', null], - [2, 'FullName', 'sid', null], - [3, 'FamilyName', 'sid', null], - [4, 'Weight', 'sid', null], - [[12, 1], 'isFixedPitch', 'num', 0], - [[12, 2], 'ItalicAngle', 'num', 0], - [[12, 3], 'UnderlinePosition', 'num', -100], - [[12, 4], 'UnderlineThickness', 'num', 50], - [[12, 5], 'PaintType', 'num', 0], - [[12, 6], 'CharstringType', 'num', 2], - [[12, 7], 'FontMatrix', ['num', 'num', 'num', 'num', 'num', 'num'], - [0.001, 0, 0, 0.001, 0, 0]], - [13, 'UniqueID', 'num', null], - [5, 'FontBBox', ['num', 'num', 'num', 'num'], [0, 0, 0, 0]], - [[12, 8], 'StrokeWidth', 'num', 0], - [14, 'XUID', 'array', null], - [15, 'charset', 'offset', 0], - [16, 'Encoding', 'offset', 0], - [17, 'CharStrings', 'offset', 0], - [18, 'Private', ['offset', 'offset'], null], - [[12, 21], 'PostScript', 'sid', null], - [[12, 22], 'BaseFontName', 'sid', null], - [[12, 23], 'BaseFontBlend', 'delta', null], - [[12, 31], 'CIDFontVersion', 'num', 0], - [[12, 32], 'CIDFontRevision', 'num', 0], - [[12, 33], 'CIDFontType', 'num', 0], - [[12, 34], 'CIDCount', 'num', 8720], - [[12, 35], 'UIDBase', 'num', null], - // XXX: CID Fonts on DirectWrite 6.1 only seem to work if FDSelect comes - // before FDArray. - [[12, 37], 'FDSelect', 'offset', null], - [[12, 36], 'FDArray', 'offset', null], - [[12, 38], 'FontName', 'sid', null] - ]; - var tables = null; - function CFFTopDict(strings) { - if (tables === null) { - tables = CFFDict.createTables(layout); - } - CFFDict.call(this, tables, strings); - this.privateDict = null; - } - CFFTopDict.prototype = Object.create(CFFDict.prototype); - return CFFTopDict; -})(); - -var CFFPrivateDict = (function CFFPrivateDictClosure() { - var layout = [ - [6, 'BlueValues', 'delta', null], - [7, 'OtherBlues', 'delta', null], - [8, 'FamilyBlues', 'delta', null], - [9, 'FamilyOtherBlues', 'delta', null], - [[12, 9], 'BlueScale', 'num', 0.039625], - [[12, 10], 'BlueShift', 'num', 7], - [[12, 11], 'BlueFuzz', 'num', 1], - [10, 'StdHW', 'num', null], - [11, 'StdVW', 'num', null], - [[12, 12], 'StemSnapH', 'delta', null], - [[12, 13], 'StemSnapV', 'delta', null], - [[12, 14], 'ForceBold', 'num', 0], - [[12, 17], 'LanguageGroup', 'num', 0], - [[12, 18], 'ExpansionFactor', 'num', 0.06], - [[12, 19], 'initialRandomSeed', 'num', 0], - [20, 'defaultWidthX', 'num', 0], - [21, 'nominalWidthX', 'num', 0], - [19, 'Subrs', 'offset', null] - ]; - var tables = null; - function CFFPrivateDict(strings) { - if (tables === null) { - tables = CFFDict.createTables(layout); - } - CFFDict.call(this, tables, strings); - this.subrsIndex = null; - } - CFFPrivateDict.prototype = Object.create(CFFDict.prototype); - return CFFPrivateDict; -})(); - -var CFFCharsetPredefinedTypes = { - ISO_ADOBE: 0, - EXPERT: 1, - EXPERT_SUBSET: 2 -}; -var CFFCharset = (function CFFCharsetClosure() { - function CFFCharset(predefined, format, charset, raw) { - this.predefined = predefined; - this.format = format; - this.charset = charset; - this.raw = raw; - } - return CFFCharset; -})(); - -var CFFEncoding = (function CFFEncodingClosure() { - function CFFEncoding(predefined, format, encoding, raw) { - this.predefined = predefined; - this.format = format; - this.encoding = encoding; - this.raw = raw; - } - return CFFEncoding; -})(); - -var CFFFDSelect = (function CFFFDSelectClosure() { - function CFFFDSelect(fdSelect, raw) { - this.fdSelect = fdSelect; - this.raw = raw; - } - CFFFDSelect.prototype = { - getFDIndex: function CFFFDSelect_get(glyphIndex) { - if (glyphIndex < 0 || glyphIndex >= this.fdSelect.length) { - return -1; - } - return this.fdSelect[glyphIndex]; - } - }; - return CFFFDSelect; -})(); - -// Helper class to keep track of where an offset is within the data and helps -// filling in that offset once it's known. -var CFFOffsetTracker = (function CFFOffsetTrackerClosure() { - function CFFOffsetTracker() { - this.offsets = Object.create(null); - } - CFFOffsetTracker.prototype = { - isTracking: function CFFOffsetTracker_isTracking(key) { - return key in this.offsets; - }, - track: function CFFOffsetTracker_track(key, location) { - if (key in this.offsets) { - error('Already tracking location of ' + key); - } - this.offsets[key] = location; - }, - offset: function CFFOffsetTracker_offset(value) { - for (var key in this.offsets) { - this.offsets[key] += value; - } - }, - setEntryLocation: function CFFOffsetTracker_setEntryLocation(key, - values, - output) { - if (!(key in this.offsets)) { - error('Not tracking location of ' + key); - } - var data = output.data; - var dataOffset = this.offsets[key]; - var size = 5; - for (var i = 0, ii = values.length; i < ii; ++i) { - var offset0 = i * size + dataOffset; - var offset1 = offset0 + 1; - var offset2 = offset0 + 2; - var offset3 = offset0 + 3; - var offset4 = offset0 + 4; - // It's easy to screw up offsets so perform this sanity check. - if (data[offset0] !== 0x1d || data[offset1] !== 0 || - data[offset2] !== 0 || data[offset3] !== 0 || data[offset4] !== 0) { - error('writing to an offset that is not empty'); - } - var value = values[i]; - data[offset0] = 0x1d; - data[offset1] = (value >> 24) & 0xFF; - data[offset2] = (value >> 16) & 0xFF; - data[offset3] = (value >> 8) & 0xFF; - data[offset4] = value & 0xFF; - } - } - }; - return CFFOffsetTracker; -})(); - -// Takes a CFF and converts it to the binary representation. -var CFFCompiler = (function CFFCompilerClosure() { - function CFFCompiler(cff) { - this.cff = cff; - } - CFFCompiler.prototype = { - compile: function CFFCompiler_compile() { - var cff = this.cff; - var output = { - data: [], - length: 0, - add: function CFFCompiler_add(data) { - this.data = this.data.concat(data); - this.length = this.data.length; - } - }; - - // Compile the five entries that must be in order. - var header = this.compileHeader(cff.header); - output.add(header); - - var nameIndex = this.compileNameIndex(cff.names); - output.add(nameIndex); - - if (cff.isCIDFont) { - // The spec is unclear on how font matrices should relate to each other - // when there is one in the main top dict and the sub top dicts. - // Windows handles this differently than linux and osx so we have to - // normalize to work on all. - // Rules based off of some mailing list discussions: - // - If main font has a matrix and subfont doesn't, use the main matrix. - // - If no main font matrix and there is a subfont matrix, use the - // subfont matrix. - // - If both have matrices, concat together. - // - If neither have matrices, use default. - // To make this work on all platforms we move the top matrix into each - // sub top dict and concat if necessary. - if (cff.topDict.hasName('FontMatrix')) { - var base = cff.topDict.getByName('FontMatrix'); - cff.topDict.removeByName('FontMatrix'); - for (var i = 0, ii = cff.fdArray.length; i < ii; i++) { - var subDict = cff.fdArray[i]; - var matrix = base.slice(0); - if (subDict.hasName('FontMatrix')) { - matrix = Util.transform(matrix, subDict.getByName('FontMatrix')); - } - subDict.setByName('FontMatrix', matrix); - } - } - } - - var compiled = this.compileTopDicts([cff.topDict], - output.length, - cff.isCIDFont); - output.add(compiled.output); - var topDictTracker = compiled.trackers[0]; - - var stringIndex = this.compileStringIndex(cff.strings.strings); - output.add(stringIndex); - - var globalSubrIndex = this.compileIndex(cff.globalSubrIndex); - output.add(globalSubrIndex); - - // Now start on the other entries that have no specific order. - if (cff.encoding && cff.topDict.hasName('Encoding')) { - if (cff.encoding.predefined) { - topDictTracker.setEntryLocation('Encoding', [cff.encoding.format], - output); - } else { - var encoding = this.compileEncoding(cff.encoding); - topDictTracker.setEntryLocation('Encoding', [output.length], output); - output.add(encoding); - } - } - - if (cff.charset && cff.topDict.hasName('charset')) { - if (cff.charset.predefined) { - topDictTracker.setEntryLocation('charset', [cff.charset.format], - output); - } else { - var charset = this.compileCharset(cff.charset); - topDictTracker.setEntryLocation('charset', [output.length], output); - output.add(charset); - } - } - - var charStrings = this.compileCharStrings(cff.charStrings); - topDictTracker.setEntryLocation('CharStrings', [output.length], output); - output.add(charStrings); - - if (cff.isCIDFont) { - // For some reason FDSelect must be in front of FDArray on windows. OSX - // and linux don't seem to care. - topDictTracker.setEntryLocation('FDSelect', [output.length], output); - var fdSelect = this.compileFDSelect(cff.fdSelect.raw); - output.add(fdSelect); - // It is unclear if the sub font dictionary can have CID related - // dictionary keys, but the sanitizer doesn't like them so remove them. - compiled = this.compileTopDicts(cff.fdArray, output.length, true); - topDictTracker.setEntryLocation('FDArray', [output.length], output); - output.add(compiled.output); - var fontDictTrackers = compiled.trackers; - - this.compilePrivateDicts(cff.fdArray, fontDictTrackers, output); - } - - this.compilePrivateDicts([cff.topDict], [topDictTracker], output); - - // If the font data ends with INDEX whose object data is zero-length, - // the sanitizer will bail out. Add a dummy byte to avoid that. - output.add([0]); - - return output.data; - }, - encodeNumber: function CFFCompiler_encodeNumber(value) { - if (parseFloat(value) === parseInt(value, 10) && !isNaN(value)) { // isInt - return this.encodeInteger(value); - } else { - return this.encodeFloat(value); - } - }, - encodeFloat: function CFFCompiler_encodeFloat(num) { - var value = num.toString(); - - // rounding inaccurate doubles - var m = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(value); - if (m) { - var epsilon = parseFloat('1e' + ((m[2] ? +m[2] : 0) + m[1].length)); - value = (Math.round(num * epsilon) / epsilon).toString(); - } - - var nibbles = ''; - var i, ii; - for (i = 0, ii = value.length; i < ii; ++i) { - var a = value[i]; - if (a === 'e') { - nibbles += value[++i] === '-' ? 'c' : 'b'; - } else if (a === '.') { - nibbles += 'a'; - } else if (a === '-') { - nibbles += 'e'; - } else { - nibbles += a; - } - } - nibbles += (nibbles.length & 1) ? 'f' : 'ff'; - var out = [30]; - for (i = 0, ii = nibbles.length; i < ii; i += 2) { - out.push(parseInt(nibbles.substr(i, 2), 16)); - } - return out; - }, - encodeInteger: function CFFCompiler_encodeInteger(value) { - var code; - if (value >= -107 && value <= 107) { - code = [value + 139]; - } else if (value >= 108 && value <= 1131) { - value = value - 108; - code = [(value >> 8) + 247, value & 0xFF]; - } else if (value >= -1131 && value <= -108) { - value = -value - 108; - code = [(value >> 8) + 251, value & 0xFF]; - } else if (value >= -32768 && value <= 32767) { - code = [0x1c, (value >> 8) & 0xFF, value & 0xFF]; - } else { - code = [0x1d, - (value >> 24) & 0xFF, - (value >> 16) & 0xFF, - (value >> 8) & 0xFF, - value & 0xFF]; - } - return code; - }, - compileHeader: function CFFCompiler_compileHeader(header) { - return [ - header.major, - header.minor, - header.hdrSize, - header.offSize - ]; - }, - compileNameIndex: function CFFCompiler_compileNameIndex(names) { - var nameIndex = new CFFIndex(); - for (var i = 0, ii = names.length; i < ii; ++i) { - nameIndex.add(stringToBytes(names[i])); - } - return this.compileIndex(nameIndex); - }, - compileTopDicts: function CFFCompiler_compileTopDicts(dicts, - length, - removeCidKeys) { - var fontDictTrackers = []; - var fdArrayIndex = new CFFIndex(); - for (var i = 0, ii = dicts.length; i < ii; ++i) { - var fontDict = dicts[i]; - if (removeCidKeys) { - fontDict.removeByName('CIDFontVersion'); - fontDict.removeByName('CIDFontRevision'); - fontDict.removeByName('CIDFontType'); - fontDict.removeByName('CIDCount'); - fontDict.removeByName('UIDBase'); - } - var fontDictTracker = new CFFOffsetTracker(); - var fontDictData = this.compileDict(fontDict, fontDictTracker); - fontDictTrackers.push(fontDictTracker); - fdArrayIndex.add(fontDictData); - fontDictTracker.offset(length); - } - fdArrayIndex = this.compileIndex(fdArrayIndex, fontDictTrackers); - return { - trackers: fontDictTrackers, - output: fdArrayIndex - }; - }, - compilePrivateDicts: function CFFCompiler_compilePrivateDicts(dicts, - trackers, - output) { - for (var i = 0, ii = dicts.length; i < ii; ++i) { - var fontDict = dicts[i]; - assert(fontDict.privateDict && fontDict.hasName('Private'), - 'There must be an private dictionary.'); - var privateDict = fontDict.privateDict; - var privateDictTracker = new CFFOffsetTracker(); - var privateDictData = this.compileDict(privateDict, privateDictTracker); - - var outputLength = output.length; - privateDictTracker.offset(outputLength); - if (!privateDictData.length) { - // The private dictionary was empty, set the output length to zero to - // ensure the offset length isn't out of bounds in the eyes of the - // sanitizer. - outputLength = 0; - } - - trackers[i].setEntryLocation('Private', - [privateDictData.length, outputLength], - output); - output.add(privateDictData); - - if (privateDict.subrsIndex && privateDict.hasName('Subrs')) { - var subrs = this.compileIndex(privateDict.subrsIndex); - privateDictTracker.setEntryLocation('Subrs', [privateDictData.length], - output); - output.add(subrs); - } - } - }, - compileDict: function CFFCompiler_compileDict(dict, offsetTracker) { - var out = []; - // The dictionary keys must be in a certain order. - var order = dict.order; - for (var i = 0; i < order.length; ++i) { - var key = order[i]; - if (!(key in dict.values)) { - continue; - } - var values = dict.values[key]; - var types = dict.types[key]; - if (!isArray(types)) { - types = [types]; - } - if (!isArray(values)) { - values = [values]; - } - - // Remove any empty dict values. - if (values.length === 0) { - continue; - } - - for (var j = 0, jj = types.length; j < jj; ++j) { - var type = types[j]; - var value = values[j]; - switch (type) { - case 'num': - case 'sid': - out = out.concat(this.encodeNumber(value)); - break; - case 'offset': - // For offsets we just insert a 32bit integer so we don't have to - // deal with figuring out the length of the offset when it gets - // replaced later on by the compiler. - var name = dict.keyToNameMap[key]; - // Some offsets have the offset and the length, so just record the - // position of the first one. - if (!offsetTracker.isTracking(name)) { - offsetTracker.track(name, out.length); - } - out = out.concat([0x1d, 0, 0, 0, 0]); - break; - case 'array': - case 'delta': - out = out.concat(this.encodeNumber(value)); - for (var k = 1, kk = values.length; k < kk; ++k) { - out = out.concat(this.encodeNumber(values[k])); - } - break; - default: - error('Unknown data type of ' + type); - break; - } - } - out = out.concat(dict.opcodes[key]); - } - return out; - }, - compileStringIndex: function CFFCompiler_compileStringIndex(strings) { - var stringIndex = new CFFIndex(); - for (var i = 0, ii = strings.length; i < ii; ++i) { - stringIndex.add(stringToBytes(strings[i])); - } - return this.compileIndex(stringIndex); - }, - compileGlobalSubrIndex: function CFFCompiler_compileGlobalSubrIndex() { - var globalSubrIndex = this.cff.globalSubrIndex; - this.out.writeByteArray(this.compileIndex(globalSubrIndex)); - }, - compileCharStrings: function CFFCompiler_compileCharStrings(charStrings) { - return this.compileIndex(charStrings); - }, - compileCharset: function CFFCompiler_compileCharset(charset) { - return this.compileTypedArray(charset.raw); - }, - compileEncoding: function CFFCompiler_compileEncoding(encoding) { - return this.compileTypedArray(encoding.raw); - }, - compileFDSelect: function CFFCompiler_compileFDSelect(fdSelect) { - return this.compileTypedArray(fdSelect); - }, - compileTypedArray: function CFFCompiler_compileTypedArray(data) { - var out = []; - for (var i = 0, ii = data.length; i < ii; ++i) { - out[i] = data[i]; - } - return out; - }, - compileIndex: function CFFCompiler_compileIndex(index, trackers) { - trackers = trackers || []; - var objects = index.objects; - // First 2 bytes contains the number of objects contained into this index - var count = objects.length; - - // If there is no object, just create an index. This technically - // should just be [0, 0] but OTS has an issue with that. - if (count === 0) { - return [0, 0, 0]; - } - - var data = [(count >> 8) & 0xFF, count & 0xff]; - - var lastOffset = 1, i; - for (i = 0; i < count; ++i) { - lastOffset += objects[i].length; - } - - var offsetSize; - if (lastOffset < 0x100) { - offsetSize = 1; - } else if (lastOffset < 0x10000) { - offsetSize = 2; - } else if (lastOffset < 0x1000000) { - offsetSize = 3; - } else { - offsetSize = 4; - } - - // Next byte contains the offset size use to reference object in the file - data.push(offsetSize); - - // Add another offset after this one because we need a new offset - var relativeOffset = 1; - for (i = 0; i < count + 1; i++) { - if (offsetSize === 1) { - data.push(relativeOffset & 0xFF); - } else if (offsetSize === 2) { - data.push((relativeOffset >> 8) & 0xFF, - relativeOffset & 0xFF); - } else if (offsetSize === 3) { - data.push((relativeOffset >> 16) & 0xFF, - (relativeOffset >> 8) & 0xFF, - relativeOffset & 0xFF); - } else { - data.push((relativeOffset >>> 24) & 0xFF, - (relativeOffset >> 16) & 0xFF, - (relativeOffset >> 8) & 0xFF, - relativeOffset & 0xFF); - } - - if (objects[i]) { - relativeOffset += objects[i].length; - } - } - - for (i = 0; i < count; i++) { - // Notify the tracker where the object will be offset in the data. - if (trackers[i]) { - trackers[i].offset(data.length); - } - for (var j = 0, jj = objects[i].length; j < jj; j++) { - data.push(objects[i][j]); - } - } - return data; - } - }; - return CFFCompiler; -})(); - -exports.CFFStandardStrings = CFFStandardStrings; -exports.CFFParser = CFFParser; -exports.CFF = CFF; -exports.CFFHeader = CFFHeader; -exports.CFFStrings = CFFStrings; -exports.CFFIndex = CFFIndex; -exports.CFFCharset = CFFCharset; -exports.CFFTopDict = CFFTopDict; -exports.CFFPrivateDict = CFFPrivateDict; -exports.CFFCompiler = CFFCompiler; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreChunkedStream = {}), root.pdfjsSharedUtil); - } -}(this, function (exports, sharedUtil) { - -var MissingDataException = sharedUtil.MissingDataException; -var arrayByteLength = sharedUtil.arrayByteLength; -var arraysToBytes = sharedUtil.arraysToBytes; -var assert = sharedUtil.assert; -var createPromiseCapability = sharedUtil.createPromiseCapability; -var isInt = sharedUtil.isInt; -var isEmptyObj = sharedUtil.isEmptyObj; - -var ChunkedStream = (function ChunkedStreamClosure() { - function ChunkedStream(length, chunkSize, manager) { - this.bytes = new Uint8Array(length); - this.start = 0; - this.pos = 0; - this.end = length; - this.chunkSize = chunkSize; - this.loadedChunks = []; - this.numChunksLoaded = 0; - this.numChunks = Math.ceil(length / chunkSize); - this.manager = manager; - this.progressiveDataLength = 0; - this.lastSuccessfulEnsureByteChunk = -1; // a single-entry cache - } - - // required methods for a stream. if a particular stream does not - // implement these, an error should be thrown - ChunkedStream.prototype = { - - getMissingChunks: function ChunkedStream_getMissingChunks() { - var chunks = []; - for (var chunk = 0, n = this.numChunks; chunk < n; ++chunk) { - if (!this.loadedChunks[chunk]) { - chunks.push(chunk); - } - } - return chunks; - }, - - getBaseStreams: function ChunkedStream_getBaseStreams() { - return [this]; - }, - - allChunksLoaded: function ChunkedStream_allChunksLoaded() { - return this.numChunksLoaded === this.numChunks; - }, - - onReceiveData: function ChunkedStream_onReceiveData(begin, chunk) { - var end = begin + chunk.byteLength; - - assert(begin % this.chunkSize === 0, 'Bad begin offset: ' + begin); - // Using this.length is inaccurate here since this.start can be moved - // See ChunkedStream.moveStart() - var length = this.bytes.length; - assert(end % this.chunkSize === 0 || end === length, - 'Bad end offset: ' + end); - - this.bytes.set(new Uint8Array(chunk), begin); - var chunkSize = this.chunkSize; - var beginChunk = Math.floor(begin / chunkSize); - var endChunk = Math.floor((end - 1) / chunkSize) + 1; - var curChunk; - - for (curChunk = beginChunk; curChunk < endChunk; ++curChunk) { - if (!this.loadedChunks[curChunk]) { - this.loadedChunks[curChunk] = true; - ++this.numChunksLoaded; - } - } - }, - - onReceiveProgressiveData: - function ChunkedStream_onReceiveProgressiveData(data) { - var position = this.progressiveDataLength; - var beginChunk = Math.floor(position / this.chunkSize); - - this.bytes.set(new Uint8Array(data), position); - position += data.byteLength; - this.progressiveDataLength = position; - var endChunk = position >= this.end ? this.numChunks : - Math.floor(position / this.chunkSize); - var curChunk; - for (curChunk = beginChunk; curChunk < endChunk; ++curChunk) { - if (!this.loadedChunks[curChunk]) { - this.loadedChunks[curChunk] = true; - ++this.numChunksLoaded; - } - } - }, - - ensureByte: function ChunkedStream_ensureByte(pos) { - var chunk = Math.floor(pos / this.chunkSize); - if (chunk === this.lastSuccessfulEnsureByteChunk) { - return; - } - - if (!this.loadedChunks[chunk]) { - throw new MissingDataException(pos, pos + 1); - } - this.lastSuccessfulEnsureByteChunk = chunk; - }, - - ensureRange: function ChunkedStream_ensureRange(begin, end) { - if (begin >= end) { - return; - } - - if (end <= this.progressiveDataLength) { - return; - } - - var chunkSize = this.chunkSize; - var beginChunk = Math.floor(begin / chunkSize); - var endChunk = Math.floor((end - 1) / chunkSize) + 1; - for (var chunk = beginChunk; chunk < endChunk; ++chunk) { - if (!this.loadedChunks[chunk]) { - throw new MissingDataException(begin, end); - } - } - }, - - nextEmptyChunk: function ChunkedStream_nextEmptyChunk(beginChunk) { - var chunk, numChunks = this.numChunks; - for (var i = 0; i < numChunks; ++i) { - chunk = (beginChunk + i) % numChunks; // Wrap around to beginning - if (!this.loadedChunks[chunk]) { - return chunk; - } - } - return null; - }, - - hasChunk: function ChunkedStream_hasChunk(chunk) { - return !!this.loadedChunks[chunk]; - }, - - get length() { - return this.end - this.start; - }, - - get isEmpty() { - return this.length === 0; - }, - - getByte: function ChunkedStream_getByte() { - var pos = this.pos; - if (pos >= this.end) { - return -1; - } - this.ensureByte(pos); - return this.bytes[this.pos++]; - }, - - getUint16: function ChunkedStream_getUint16() { - var b0 = this.getByte(); - var b1 = this.getByte(); - if (b0 === -1 || b1 === -1) { - return -1; - } - return (b0 << 8) + b1; - }, - - getInt32: function ChunkedStream_getInt32() { - var b0 = this.getByte(); - var b1 = this.getByte(); - var b2 = this.getByte(); - var b3 = this.getByte(); - return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; - }, - - // returns subarray of original buffer - // should only be read - getBytes: function ChunkedStream_getBytes(length) { - var bytes = this.bytes; - var pos = this.pos; - var strEnd = this.end; - - if (!length) { - this.ensureRange(pos, strEnd); - return bytes.subarray(pos, strEnd); - } - - var end = pos + length; - if (end > strEnd) { - end = strEnd; - } - this.ensureRange(pos, end); - - this.pos = end; - return bytes.subarray(pos, end); - }, - - peekByte: function ChunkedStream_peekByte() { - var peekedByte = this.getByte(); - this.pos--; - return peekedByte; - }, - - peekBytes: function ChunkedStream_peekBytes(length) { - var bytes = this.getBytes(length); - this.pos -= bytes.length; - return bytes; - }, - - getByteRange: function ChunkedStream_getBytes(begin, end) { - this.ensureRange(begin, end); - return this.bytes.subarray(begin, end); - }, - - skip: function ChunkedStream_skip(n) { - if (!n) { - n = 1; - } - this.pos += n; - }, - - reset: function ChunkedStream_reset() { - this.pos = this.start; - }, - - moveStart: function ChunkedStream_moveStart() { - this.start = this.pos; - }, - - makeSubStream: function ChunkedStream_makeSubStream(start, length, dict) { - this.ensureRange(start, start + length); - - function ChunkedStreamSubstream() {} - ChunkedStreamSubstream.prototype = Object.create(this); - ChunkedStreamSubstream.prototype.getMissingChunks = function() { - var chunkSize = this.chunkSize; - var beginChunk = Math.floor(this.start / chunkSize); - var endChunk = Math.floor((this.end - 1) / chunkSize) + 1; - var missingChunks = []; - for (var chunk = beginChunk; chunk < endChunk; ++chunk) { - if (!this.loadedChunks[chunk]) { - missingChunks.push(chunk); - } - } - return missingChunks; - }; - var subStream = new ChunkedStreamSubstream(); - subStream.pos = subStream.start = start; - subStream.end = start + length || this.end; - subStream.dict = dict; - return subStream; - }, - - isStream: true - }; - - return ChunkedStream; -})(); - -var ChunkedStreamManager = (function ChunkedStreamManagerClosure() { - - function ChunkedStreamManager(pdfNetworkStream, args) { - var chunkSize = args.rangeChunkSize; - var length = args.length; - this.stream = new ChunkedStream(length, chunkSize, this); - this.length = length; - this.chunkSize = chunkSize; - this.pdfNetworkStream = pdfNetworkStream; - this.url = args.url; - this.disableAutoFetch = args.disableAutoFetch; - this.msgHandler = args.msgHandler; - - this.currRequestId = 0; - - this.chunksNeededByRequest = Object.create(null); - this.requestsByChunk = Object.create(null); - this.promisesByRequest = Object.create(null); - this.progressiveDataLength = 0; - this.aborted = false; - - this._loadedStreamCapability = createPromiseCapability(); - } - - ChunkedStreamManager.prototype = { - onLoadedStream: function ChunkedStreamManager_getLoadedStream() { - return this._loadedStreamCapability.promise; - }, - - sendRequest: function ChunkedStreamManager_sendRequest(begin, end) { - var rangeReader = this.pdfNetworkStream.getRangeReader(begin, end); - if (!rangeReader.isStreamingSupported) { - rangeReader.onProgress = this.onProgress.bind(this); - } - var chunks = [], loaded = 0; - var manager = this; - var promise = new Promise(function (resolve, reject) { - var readChunk = function (chunk) { - try { - if (!chunk.done) { - var data = chunk.value; - chunks.push(data); - loaded += arrayByteLength(data); - if (rangeReader.isStreamingSupported) { - manager.onProgress({loaded: loaded}); - } - rangeReader.read().then(readChunk, reject); - return; - } - var chunkData = arraysToBytes(chunks); - chunks = null; - resolve(chunkData); - } catch (e) { - reject(e); - } - }; - rangeReader.read().then(readChunk, reject); - }); - promise.then(function (data) { - if (this.aborted) { - return; // ignoring any data after abort - } - this.onReceiveData({chunk: data, begin: begin}); - }.bind(this)); - // TODO check errors - }, - - // Get all the chunks that are not yet loaded and groups them into - // contiguous ranges to load in as few requests as possible - requestAllChunks: function ChunkedStreamManager_requestAllChunks() { - var missingChunks = this.stream.getMissingChunks(); - this._requestChunks(missingChunks); - return this._loadedStreamCapability.promise; - }, - - _requestChunks: function ChunkedStreamManager_requestChunks(chunks) { - var requestId = this.currRequestId++; - - var i, ii; - var chunksNeeded = Object.create(null); - this.chunksNeededByRequest[requestId] = chunksNeeded; - for (i = 0, ii = chunks.length; i < ii; i++) { - if (!this.stream.hasChunk(chunks[i])) { - chunksNeeded[chunks[i]] = true; - } - } - - if (isEmptyObj(chunksNeeded)) { - return Promise.resolve(); - } - - var capability = createPromiseCapability(); - this.promisesByRequest[requestId] = capability; - - var chunksToRequest = []; - for (var chunk in chunksNeeded) { - chunk = chunk | 0; - if (!(chunk in this.requestsByChunk)) { - this.requestsByChunk[chunk] = []; - chunksToRequest.push(chunk); - } - this.requestsByChunk[chunk].push(requestId); - } - - if (!chunksToRequest.length) { - return capability.promise; - } - - var groupedChunksToRequest = this.groupChunks(chunksToRequest); - - for (i = 0; i < groupedChunksToRequest.length; ++i) { - var groupedChunk = groupedChunksToRequest[i]; - var begin = groupedChunk.beginChunk * this.chunkSize; - var end = Math.min(groupedChunk.endChunk * this.chunkSize, this.length); - this.sendRequest(begin, end); - } - - return capability.promise; - }, - - getStream: function ChunkedStreamManager_getStream() { - return this.stream; - }, - - // Loads any chunks in the requested range that are not yet loaded - requestRange: function ChunkedStreamManager_requestRange(begin, end) { - - end = Math.min(end, this.length); - - var beginChunk = this.getBeginChunk(begin); - var endChunk = this.getEndChunk(end); - - var chunks = []; - for (var chunk = beginChunk; chunk < endChunk; ++chunk) { - chunks.push(chunk); - } - - return this._requestChunks(chunks); - }, - - requestRanges: function ChunkedStreamManager_requestRanges(ranges) { - ranges = ranges || []; - var chunksToRequest = []; - - for (var i = 0; i < ranges.length; i++) { - var beginChunk = this.getBeginChunk(ranges[i].begin); - var endChunk = this.getEndChunk(ranges[i].end); - for (var chunk = beginChunk; chunk < endChunk; ++chunk) { - if (chunksToRequest.indexOf(chunk) < 0) { - chunksToRequest.push(chunk); - } - } - } - - chunksToRequest.sort(function(a, b) { return a - b; }); - return this._requestChunks(chunksToRequest); - }, - - // Groups a sorted array of chunks into as few contiguous larger - // chunks as possible - groupChunks: function ChunkedStreamManager_groupChunks(chunks) { - var groupedChunks = []; - var beginChunk = -1; - var prevChunk = -1; - for (var i = 0; i < chunks.length; ++i) { - var chunk = chunks[i]; - - if (beginChunk < 0) { - beginChunk = chunk; - } - - if (prevChunk >= 0 && prevChunk + 1 !== chunk) { - groupedChunks.push({ beginChunk: beginChunk, - endChunk: prevChunk + 1 }); - beginChunk = chunk; - } - if (i + 1 === chunks.length) { - groupedChunks.push({ beginChunk: beginChunk, - endChunk: chunk + 1 }); - } - - prevChunk = chunk; - } - return groupedChunks; - }, - - onProgress: function ChunkedStreamManager_onProgress(args) { - var bytesLoaded = (this.stream.numChunksLoaded * this.chunkSize + - args.loaded); - this.msgHandler.send('DocProgress', { - loaded: bytesLoaded, - total: this.length - }); - }, - - onReceiveData: function ChunkedStreamManager_onReceiveData(args) { - var chunk = args.chunk; - var isProgressive = args.begin === undefined; - var begin = isProgressive ? this.progressiveDataLength : args.begin; - var end = begin + chunk.byteLength; - - var beginChunk = Math.floor(begin / this.chunkSize); - var endChunk = end < this.length ? Math.floor(end / this.chunkSize) : - Math.ceil(end / this.chunkSize); - - if (isProgressive) { - this.stream.onReceiveProgressiveData(chunk); - this.progressiveDataLength = end; - } else { - this.stream.onReceiveData(begin, chunk); - } - - if (this.stream.allChunksLoaded()) { - this._loadedStreamCapability.resolve(this.stream); - } - - var loadedRequests = []; - var i, requestId; - for (chunk = beginChunk; chunk < endChunk; ++chunk) { - // The server might return more chunks than requested - var requestIds = this.requestsByChunk[chunk] || []; - delete this.requestsByChunk[chunk]; - - for (i = 0; i < requestIds.length; ++i) { - requestId = requestIds[i]; - var chunksNeeded = this.chunksNeededByRequest[requestId]; - if (chunk in chunksNeeded) { - delete chunksNeeded[chunk]; - } - - if (!isEmptyObj(chunksNeeded)) { - continue; - } - - loadedRequests.push(requestId); - } - } - - // If there are no pending requests, automatically fetch the next - // unfetched chunk of the PDF - if (!this.disableAutoFetch && isEmptyObj(this.requestsByChunk)) { - var nextEmptyChunk; - if (this.stream.numChunksLoaded === 1) { - // This is a special optimization so that after fetching the first - // chunk, rather than fetching the second chunk, we fetch the last - // chunk. - var lastChunk = this.stream.numChunks - 1; - if (!this.stream.hasChunk(lastChunk)) { - nextEmptyChunk = lastChunk; - } - } else { - nextEmptyChunk = this.stream.nextEmptyChunk(endChunk); - } - if (isInt(nextEmptyChunk)) { - this._requestChunks([nextEmptyChunk]); - } - } - - for (i = 0; i < loadedRequests.length; ++i) { - requestId = loadedRequests[i]; - var capability = this.promisesByRequest[requestId]; - delete this.promisesByRequest[requestId]; - capability.resolve(); - } - - this.msgHandler.send('DocProgress', { - loaded: this.stream.numChunksLoaded * this.chunkSize, - total: this.length - }); - }, - - onError: function ChunkedStreamManager_onError(err) { - this._loadedStreamCapability.reject(err); - }, - - getBeginChunk: function ChunkedStreamManager_getBeginChunk(begin) { - var chunk = Math.floor(begin / this.chunkSize); - return chunk; - }, - - getEndChunk: function ChunkedStreamManager_getEndChunk(end) { - var chunk = Math.floor((end - 1) / this.chunkSize) + 1; - return chunk; - }, - - abort: function ChunkedStreamManager_abort() { - this.aborted = true; - if (this.pdfNetworkStream) { - this.pdfNetworkStream.cancelAllRequests('abort'); - } - for(var requestId in this.promisesByRequest) { - var capability = this.promisesByRequest[requestId]; - capability.reject(new Error('Request was aborted')); - } - } - }; - - return ChunkedStreamManager; -})(); - -exports.ChunkedStream = ChunkedStream; -exports.ChunkedStreamManager = ChunkedStreamManager; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreGlyphList = {}), root.pdfjsSharedUtil); - } -}(this, function (exports, sharedUtil) { -var getLookupTableFactory = sharedUtil.getLookupTableFactory; - -var getGlyphsUnicode = getLookupTableFactory(function (t) { - t['A'] = 0x0041; - t['AE'] = 0x00C6; - t['AEacute'] = 0x01FC; - t['AEmacron'] = 0x01E2; - t['AEsmall'] = 0xF7E6; - t['Aacute'] = 0x00C1; - t['Aacutesmall'] = 0xF7E1; - t['Abreve'] = 0x0102; - t['Abreveacute'] = 0x1EAE; - t['Abrevecyrillic'] = 0x04D0; - t['Abrevedotbelow'] = 0x1EB6; - t['Abrevegrave'] = 0x1EB0; - t['Abrevehookabove'] = 0x1EB2; - t['Abrevetilde'] = 0x1EB4; - t['Acaron'] = 0x01CD; - t['Acircle'] = 0x24B6; - t['Acircumflex'] = 0x00C2; - t['Acircumflexacute'] = 0x1EA4; - t['Acircumflexdotbelow'] = 0x1EAC; - t['Acircumflexgrave'] = 0x1EA6; - t['Acircumflexhookabove'] = 0x1EA8; - t['Acircumflexsmall'] = 0xF7E2; - t['Acircumflextilde'] = 0x1EAA; - t['Acute'] = 0xF6C9; - t['Acutesmall'] = 0xF7B4; - t['Acyrillic'] = 0x0410; - t['Adblgrave'] = 0x0200; - t['Adieresis'] = 0x00C4; - t['Adieresiscyrillic'] = 0x04D2; - t['Adieresismacron'] = 0x01DE; - t['Adieresissmall'] = 0xF7E4; - t['Adotbelow'] = 0x1EA0; - t['Adotmacron'] = 0x01E0; - t['Agrave'] = 0x00C0; - t['Agravesmall'] = 0xF7E0; - t['Ahookabove'] = 0x1EA2; - t['Aiecyrillic'] = 0x04D4; - t['Ainvertedbreve'] = 0x0202; - t['Alpha'] = 0x0391; - t['Alphatonos'] = 0x0386; - t['Amacron'] = 0x0100; - t['Amonospace'] = 0xFF21; - t['Aogonek'] = 0x0104; - t['Aring'] = 0x00C5; - t['Aringacute'] = 0x01FA; - t['Aringbelow'] = 0x1E00; - t['Aringsmall'] = 0xF7E5; - t['Asmall'] = 0xF761; - t['Atilde'] = 0x00C3; - t['Atildesmall'] = 0xF7E3; - t['Aybarmenian'] = 0x0531; - t['B'] = 0x0042; - t['Bcircle'] = 0x24B7; - t['Bdotaccent'] = 0x1E02; - t['Bdotbelow'] = 0x1E04; - t['Becyrillic'] = 0x0411; - t['Benarmenian'] = 0x0532; - t['Beta'] = 0x0392; - t['Bhook'] = 0x0181; - t['Blinebelow'] = 0x1E06; - t['Bmonospace'] = 0xFF22; - t['Brevesmall'] = 0xF6F4; - t['Bsmall'] = 0xF762; - t['Btopbar'] = 0x0182; - t['C'] = 0x0043; - t['Caarmenian'] = 0x053E; - t['Cacute'] = 0x0106; - t['Caron'] = 0xF6CA; - t['Caronsmall'] = 0xF6F5; - t['Ccaron'] = 0x010C; - t['Ccedilla'] = 0x00C7; - t['Ccedillaacute'] = 0x1E08; - t['Ccedillasmall'] = 0xF7E7; - t['Ccircle'] = 0x24B8; - t['Ccircumflex'] = 0x0108; - t['Cdot'] = 0x010A; - t['Cdotaccent'] = 0x010A; - t['Cedillasmall'] = 0xF7B8; - t['Chaarmenian'] = 0x0549; - t['Cheabkhasiancyrillic'] = 0x04BC; - t['Checyrillic'] = 0x0427; - t['Chedescenderabkhasiancyrillic'] = 0x04BE; - t['Chedescendercyrillic'] = 0x04B6; - t['Chedieresiscyrillic'] = 0x04F4; - t['Cheharmenian'] = 0x0543; - t['Chekhakassiancyrillic'] = 0x04CB; - t['Cheverticalstrokecyrillic'] = 0x04B8; - t['Chi'] = 0x03A7; - t['Chook'] = 0x0187; - t['Circumflexsmall'] = 0xF6F6; - t['Cmonospace'] = 0xFF23; - t['Coarmenian'] = 0x0551; - t['Csmall'] = 0xF763; - t['D'] = 0x0044; - t['DZ'] = 0x01F1; - t['DZcaron'] = 0x01C4; - t['Daarmenian'] = 0x0534; - t['Dafrican'] = 0x0189; - t['Dcaron'] = 0x010E; - t['Dcedilla'] = 0x1E10; - t['Dcircle'] = 0x24B9; - t['Dcircumflexbelow'] = 0x1E12; - t['Dcroat'] = 0x0110; - t['Ddotaccent'] = 0x1E0A; - t['Ddotbelow'] = 0x1E0C; - t['Decyrillic'] = 0x0414; - t['Deicoptic'] = 0x03EE; - t['Delta'] = 0x2206; - t['Deltagreek'] = 0x0394; - t['Dhook'] = 0x018A; - t['Dieresis'] = 0xF6CB; - t['DieresisAcute'] = 0xF6CC; - t['DieresisGrave'] = 0xF6CD; - t['Dieresissmall'] = 0xF7A8; - t['Digammagreek'] = 0x03DC; - t['Djecyrillic'] = 0x0402; - t['Dlinebelow'] = 0x1E0E; - t['Dmonospace'] = 0xFF24; - t['Dotaccentsmall'] = 0xF6F7; - t['Dslash'] = 0x0110; - t['Dsmall'] = 0xF764; - t['Dtopbar'] = 0x018B; - t['Dz'] = 0x01F2; - t['Dzcaron'] = 0x01C5; - t['Dzeabkhasiancyrillic'] = 0x04E0; - t['Dzecyrillic'] = 0x0405; - t['Dzhecyrillic'] = 0x040F; - t['E'] = 0x0045; - t['Eacute'] = 0x00C9; - t['Eacutesmall'] = 0xF7E9; - t['Ebreve'] = 0x0114; - t['Ecaron'] = 0x011A; - t['Ecedillabreve'] = 0x1E1C; - t['Echarmenian'] = 0x0535; - t['Ecircle'] = 0x24BA; - t['Ecircumflex'] = 0x00CA; - t['Ecircumflexacute'] = 0x1EBE; - t['Ecircumflexbelow'] = 0x1E18; - t['Ecircumflexdotbelow'] = 0x1EC6; - t['Ecircumflexgrave'] = 0x1EC0; - t['Ecircumflexhookabove'] = 0x1EC2; - t['Ecircumflexsmall'] = 0xF7EA; - t['Ecircumflextilde'] = 0x1EC4; - t['Ecyrillic'] = 0x0404; - t['Edblgrave'] = 0x0204; - t['Edieresis'] = 0x00CB; - t['Edieresissmall'] = 0xF7EB; - t['Edot'] = 0x0116; - t['Edotaccent'] = 0x0116; - t['Edotbelow'] = 0x1EB8; - t['Efcyrillic'] = 0x0424; - t['Egrave'] = 0x00C8; - t['Egravesmall'] = 0xF7E8; - t['Eharmenian'] = 0x0537; - t['Ehookabove'] = 0x1EBA; - t['Eightroman'] = 0x2167; - t['Einvertedbreve'] = 0x0206; - t['Eiotifiedcyrillic'] = 0x0464; - t['Elcyrillic'] = 0x041B; - t['Elevenroman'] = 0x216A; - t['Emacron'] = 0x0112; - t['Emacronacute'] = 0x1E16; - t['Emacrongrave'] = 0x1E14; - t['Emcyrillic'] = 0x041C; - t['Emonospace'] = 0xFF25; - t['Encyrillic'] = 0x041D; - t['Endescendercyrillic'] = 0x04A2; - t['Eng'] = 0x014A; - t['Enghecyrillic'] = 0x04A4; - t['Enhookcyrillic'] = 0x04C7; - t['Eogonek'] = 0x0118; - t['Eopen'] = 0x0190; - t['Epsilon'] = 0x0395; - t['Epsilontonos'] = 0x0388; - t['Ercyrillic'] = 0x0420; - t['Ereversed'] = 0x018E; - t['Ereversedcyrillic'] = 0x042D; - t['Escyrillic'] = 0x0421; - t['Esdescendercyrillic'] = 0x04AA; - t['Esh'] = 0x01A9; - t['Esmall'] = 0xF765; - t['Eta'] = 0x0397; - t['Etarmenian'] = 0x0538; - t['Etatonos'] = 0x0389; - t['Eth'] = 0x00D0; - t['Ethsmall'] = 0xF7F0; - t['Etilde'] = 0x1EBC; - t['Etildebelow'] = 0x1E1A; - t['Euro'] = 0x20AC; - t['Ezh'] = 0x01B7; - t['Ezhcaron'] = 0x01EE; - t['Ezhreversed'] = 0x01B8; - t['F'] = 0x0046; - t['Fcircle'] = 0x24BB; - t['Fdotaccent'] = 0x1E1E; - t['Feharmenian'] = 0x0556; - t['Feicoptic'] = 0x03E4; - t['Fhook'] = 0x0191; - t['Fitacyrillic'] = 0x0472; - t['Fiveroman'] = 0x2164; - t['Fmonospace'] = 0xFF26; - t['Fourroman'] = 0x2163; - t['Fsmall'] = 0xF766; - t['G'] = 0x0047; - t['GBsquare'] = 0x3387; - t['Gacute'] = 0x01F4; - t['Gamma'] = 0x0393; - t['Gammaafrican'] = 0x0194; - t['Gangiacoptic'] = 0x03EA; - t['Gbreve'] = 0x011E; - t['Gcaron'] = 0x01E6; - t['Gcedilla'] = 0x0122; - t['Gcircle'] = 0x24BC; - t['Gcircumflex'] = 0x011C; - t['Gcommaaccent'] = 0x0122; - t['Gdot'] = 0x0120; - t['Gdotaccent'] = 0x0120; - t['Gecyrillic'] = 0x0413; - t['Ghadarmenian'] = 0x0542; - t['Ghemiddlehookcyrillic'] = 0x0494; - t['Ghestrokecyrillic'] = 0x0492; - t['Gheupturncyrillic'] = 0x0490; - t['Ghook'] = 0x0193; - t['Gimarmenian'] = 0x0533; - t['Gjecyrillic'] = 0x0403; - t['Gmacron'] = 0x1E20; - t['Gmonospace'] = 0xFF27; - t['Grave'] = 0xF6CE; - t['Gravesmall'] = 0xF760; - t['Gsmall'] = 0xF767; - t['Gsmallhook'] = 0x029B; - t['Gstroke'] = 0x01E4; - t['H'] = 0x0048; - t['H18533'] = 0x25CF; - t['H18543'] = 0x25AA; - t['H18551'] = 0x25AB; - t['H22073'] = 0x25A1; - t['HPsquare'] = 0x33CB; - t['Haabkhasiancyrillic'] = 0x04A8; - t['Hadescendercyrillic'] = 0x04B2; - t['Hardsigncyrillic'] = 0x042A; - t['Hbar'] = 0x0126; - t['Hbrevebelow'] = 0x1E2A; - t['Hcedilla'] = 0x1E28; - t['Hcircle'] = 0x24BD; - t['Hcircumflex'] = 0x0124; - t['Hdieresis'] = 0x1E26; - t['Hdotaccent'] = 0x1E22; - t['Hdotbelow'] = 0x1E24; - t['Hmonospace'] = 0xFF28; - t['Hoarmenian'] = 0x0540; - t['Horicoptic'] = 0x03E8; - t['Hsmall'] = 0xF768; - t['Hungarumlaut'] = 0xF6CF; - t['Hungarumlautsmall'] = 0xF6F8; - t['Hzsquare'] = 0x3390; - t['I'] = 0x0049; - t['IAcyrillic'] = 0x042F; - t['IJ'] = 0x0132; - t['IUcyrillic'] = 0x042E; - t['Iacute'] = 0x00CD; - t['Iacutesmall'] = 0xF7ED; - t['Ibreve'] = 0x012C; - t['Icaron'] = 0x01CF; - t['Icircle'] = 0x24BE; - t['Icircumflex'] = 0x00CE; - t['Icircumflexsmall'] = 0xF7EE; - t['Icyrillic'] = 0x0406; - t['Idblgrave'] = 0x0208; - t['Idieresis'] = 0x00CF; - t['Idieresisacute'] = 0x1E2E; - t['Idieresiscyrillic'] = 0x04E4; - t['Idieresissmall'] = 0xF7EF; - t['Idot'] = 0x0130; - t['Idotaccent'] = 0x0130; - t['Idotbelow'] = 0x1ECA; - t['Iebrevecyrillic'] = 0x04D6; - t['Iecyrillic'] = 0x0415; - t['Ifraktur'] = 0x2111; - t['Igrave'] = 0x00CC; - t['Igravesmall'] = 0xF7EC; - t['Ihookabove'] = 0x1EC8; - t['Iicyrillic'] = 0x0418; - t['Iinvertedbreve'] = 0x020A; - t['Iishortcyrillic'] = 0x0419; - t['Imacron'] = 0x012A; - t['Imacroncyrillic'] = 0x04E2; - t['Imonospace'] = 0xFF29; - t['Iniarmenian'] = 0x053B; - t['Iocyrillic'] = 0x0401; - t['Iogonek'] = 0x012E; - t['Iota'] = 0x0399; - t['Iotaafrican'] = 0x0196; - t['Iotadieresis'] = 0x03AA; - t['Iotatonos'] = 0x038A; - t['Ismall'] = 0xF769; - t['Istroke'] = 0x0197; - t['Itilde'] = 0x0128; - t['Itildebelow'] = 0x1E2C; - t['Izhitsacyrillic'] = 0x0474; - t['Izhitsadblgravecyrillic'] = 0x0476; - t['J'] = 0x004A; - t['Jaarmenian'] = 0x0541; - t['Jcircle'] = 0x24BF; - t['Jcircumflex'] = 0x0134; - t['Jecyrillic'] = 0x0408; - t['Jheharmenian'] = 0x054B; - t['Jmonospace'] = 0xFF2A; - t['Jsmall'] = 0xF76A; - t['K'] = 0x004B; - t['KBsquare'] = 0x3385; - t['KKsquare'] = 0x33CD; - t['Kabashkircyrillic'] = 0x04A0; - t['Kacute'] = 0x1E30; - t['Kacyrillic'] = 0x041A; - t['Kadescendercyrillic'] = 0x049A; - t['Kahookcyrillic'] = 0x04C3; - t['Kappa'] = 0x039A; - t['Kastrokecyrillic'] = 0x049E; - t['Kaverticalstrokecyrillic'] = 0x049C; - t['Kcaron'] = 0x01E8; - t['Kcedilla'] = 0x0136; - t['Kcircle'] = 0x24C0; - t['Kcommaaccent'] = 0x0136; - t['Kdotbelow'] = 0x1E32; - t['Keharmenian'] = 0x0554; - t['Kenarmenian'] = 0x053F; - t['Khacyrillic'] = 0x0425; - t['Kheicoptic'] = 0x03E6; - t['Khook'] = 0x0198; - t['Kjecyrillic'] = 0x040C; - t['Klinebelow'] = 0x1E34; - t['Kmonospace'] = 0xFF2B; - t['Koppacyrillic'] = 0x0480; - t['Koppagreek'] = 0x03DE; - t['Ksicyrillic'] = 0x046E; - t['Ksmall'] = 0xF76B; - t['L'] = 0x004C; - t['LJ'] = 0x01C7; - t['LL'] = 0xF6BF; - t['Lacute'] = 0x0139; - t['Lambda'] = 0x039B; - t['Lcaron'] = 0x013D; - t['Lcedilla'] = 0x013B; - t['Lcircle'] = 0x24C1; - t['Lcircumflexbelow'] = 0x1E3C; - t['Lcommaaccent'] = 0x013B; - t['Ldot'] = 0x013F; - t['Ldotaccent'] = 0x013F; - t['Ldotbelow'] = 0x1E36; - t['Ldotbelowmacron'] = 0x1E38; - t['Liwnarmenian'] = 0x053C; - t['Lj'] = 0x01C8; - t['Ljecyrillic'] = 0x0409; - t['Llinebelow'] = 0x1E3A; - t['Lmonospace'] = 0xFF2C; - t['Lslash'] = 0x0141; - t['Lslashsmall'] = 0xF6F9; - t['Lsmall'] = 0xF76C; - t['M'] = 0x004D; - t['MBsquare'] = 0x3386; - t['Macron'] = 0xF6D0; - t['Macronsmall'] = 0xF7AF; - t['Macute'] = 0x1E3E; - t['Mcircle'] = 0x24C2; - t['Mdotaccent'] = 0x1E40; - t['Mdotbelow'] = 0x1E42; - t['Menarmenian'] = 0x0544; - t['Mmonospace'] = 0xFF2D; - t['Msmall'] = 0xF76D; - t['Mturned'] = 0x019C; - t['Mu'] = 0x039C; - t['N'] = 0x004E; - t['NJ'] = 0x01CA; - t['Nacute'] = 0x0143; - t['Ncaron'] = 0x0147; - t['Ncedilla'] = 0x0145; - t['Ncircle'] = 0x24C3; - t['Ncircumflexbelow'] = 0x1E4A; - t['Ncommaaccent'] = 0x0145; - t['Ndotaccent'] = 0x1E44; - t['Ndotbelow'] = 0x1E46; - t['Nhookleft'] = 0x019D; - t['Nineroman'] = 0x2168; - t['Nj'] = 0x01CB; - t['Njecyrillic'] = 0x040A; - t['Nlinebelow'] = 0x1E48; - t['Nmonospace'] = 0xFF2E; - t['Nowarmenian'] = 0x0546; - t['Nsmall'] = 0xF76E; - t['Ntilde'] = 0x00D1; - t['Ntildesmall'] = 0xF7F1; - t['Nu'] = 0x039D; - t['O'] = 0x004F; - t['OE'] = 0x0152; - t['OEsmall'] = 0xF6FA; - t['Oacute'] = 0x00D3; - t['Oacutesmall'] = 0xF7F3; - t['Obarredcyrillic'] = 0x04E8; - t['Obarreddieresiscyrillic'] = 0x04EA; - t['Obreve'] = 0x014E; - t['Ocaron'] = 0x01D1; - t['Ocenteredtilde'] = 0x019F; - t['Ocircle'] = 0x24C4; - t['Ocircumflex'] = 0x00D4; - t['Ocircumflexacute'] = 0x1ED0; - t['Ocircumflexdotbelow'] = 0x1ED8; - t['Ocircumflexgrave'] = 0x1ED2; - t['Ocircumflexhookabove'] = 0x1ED4; - t['Ocircumflexsmall'] = 0xF7F4; - t['Ocircumflextilde'] = 0x1ED6; - t['Ocyrillic'] = 0x041E; - t['Odblacute'] = 0x0150; - t['Odblgrave'] = 0x020C; - t['Odieresis'] = 0x00D6; - t['Odieresiscyrillic'] = 0x04E6; - t['Odieresissmall'] = 0xF7F6; - t['Odotbelow'] = 0x1ECC; - t['Ogoneksmall'] = 0xF6FB; - t['Ograve'] = 0x00D2; - t['Ogravesmall'] = 0xF7F2; - t['Oharmenian'] = 0x0555; - t['Ohm'] = 0x2126; - t['Ohookabove'] = 0x1ECE; - t['Ohorn'] = 0x01A0; - t['Ohornacute'] = 0x1EDA; - t['Ohorndotbelow'] = 0x1EE2; - t['Ohorngrave'] = 0x1EDC; - t['Ohornhookabove'] = 0x1EDE; - t['Ohorntilde'] = 0x1EE0; - t['Ohungarumlaut'] = 0x0150; - t['Oi'] = 0x01A2; - t['Oinvertedbreve'] = 0x020E; - t['Omacron'] = 0x014C; - t['Omacronacute'] = 0x1E52; - t['Omacrongrave'] = 0x1E50; - t['Omega'] = 0x2126; - t['Omegacyrillic'] = 0x0460; - t['Omegagreek'] = 0x03A9; - t['Omegaroundcyrillic'] = 0x047A; - t['Omegatitlocyrillic'] = 0x047C; - t['Omegatonos'] = 0x038F; - t['Omicron'] = 0x039F; - t['Omicrontonos'] = 0x038C; - t['Omonospace'] = 0xFF2F; - t['Oneroman'] = 0x2160; - t['Oogonek'] = 0x01EA; - t['Oogonekmacron'] = 0x01EC; - t['Oopen'] = 0x0186; - t['Oslash'] = 0x00D8; - t['Oslashacute'] = 0x01FE; - t['Oslashsmall'] = 0xF7F8; - t['Osmall'] = 0xF76F; - t['Ostrokeacute'] = 0x01FE; - t['Otcyrillic'] = 0x047E; - t['Otilde'] = 0x00D5; - t['Otildeacute'] = 0x1E4C; - t['Otildedieresis'] = 0x1E4E; - t['Otildesmall'] = 0xF7F5; - t['P'] = 0x0050; - t['Pacute'] = 0x1E54; - t['Pcircle'] = 0x24C5; - t['Pdotaccent'] = 0x1E56; - t['Pecyrillic'] = 0x041F; - t['Peharmenian'] = 0x054A; - t['Pemiddlehookcyrillic'] = 0x04A6; - t['Phi'] = 0x03A6; - t['Phook'] = 0x01A4; - t['Pi'] = 0x03A0; - t['Piwrarmenian'] = 0x0553; - t['Pmonospace'] = 0xFF30; - t['Psi'] = 0x03A8; - t['Psicyrillic'] = 0x0470; - t['Psmall'] = 0xF770; - t['Q'] = 0x0051; - t['Qcircle'] = 0x24C6; - t['Qmonospace'] = 0xFF31; - t['Qsmall'] = 0xF771; - t['R'] = 0x0052; - t['Raarmenian'] = 0x054C; - t['Racute'] = 0x0154; - t['Rcaron'] = 0x0158; - t['Rcedilla'] = 0x0156; - t['Rcircle'] = 0x24C7; - t['Rcommaaccent'] = 0x0156; - t['Rdblgrave'] = 0x0210; - t['Rdotaccent'] = 0x1E58; - t['Rdotbelow'] = 0x1E5A; - t['Rdotbelowmacron'] = 0x1E5C; - t['Reharmenian'] = 0x0550; - t['Rfraktur'] = 0x211C; - t['Rho'] = 0x03A1; - t['Ringsmall'] = 0xF6FC; - t['Rinvertedbreve'] = 0x0212; - t['Rlinebelow'] = 0x1E5E; - t['Rmonospace'] = 0xFF32; - t['Rsmall'] = 0xF772; - t['Rsmallinverted'] = 0x0281; - t['Rsmallinvertedsuperior'] = 0x02B6; - t['S'] = 0x0053; - t['SF010000'] = 0x250C; - t['SF020000'] = 0x2514; - t['SF030000'] = 0x2510; - t['SF040000'] = 0x2518; - t['SF050000'] = 0x253C; - t['SF060000'] = 0x252C; - t['SF070000'] = 0x2534; - t['SF080000'] = 0x251C; - t['SF090000'] = 0x2524; - t['SF100000'] = 0x2500; - t['SF110000'] = 0x2502; - t['SF190000'] = 0x2561; - t['SF200000'] = 0x2562; - t['SF210000'] = 0x2556; - t['SF220000'] = 0x2555; - t['SF230000'] = 0x2563; - t['SF240000'] = 0x2551; - t['SF250000'] = 0x2557; - t['SF260000'] = 0x255D; - t['SF270000'] = 0x255C; - t['SF280000'] = 0x255B; - t['SF360000'] = 0x255E; - t['SF370000'] = 0x255F; - t['SF380000'] = 0x255A; - t['SF390000'] = 0x2554; - t['SF400000'] = 0x2569; - t['SF410000'] = 0x2566; - t['SF420000'] = 0x2560; - t['SF430000'] = 0x2550; - t['SF440000'] = 0x256C; - t['SF450000'] = 0x2567; - t['SF460000'] = 0x2568; - t['SF470000'] = 0x2564; - t['SF480000'] = 0x2565; - t['SF490000'] = 0x2559; - t['SF500000'] = 0x2558; - t['SF510000'] = 0x2552; - t['SF520000'] = 0x2553; - t['SF530000'] = 0x256B; - t['SF540000'] = 0x256A; - t['Sacute'] = 0x015A; - t['Sacutedotaccent'] = 0x1E64; - t['Sampigreek'] = 0x03E0; - t['Scaron'] = 0x0160; - t['Scarondotaccent'] = 0x1E66; - t['Scaronsmall'] = 0xF6FD; - t['Scedilla'] = 0x015E; - t['Schwa'] = 0x018F; - t['Schwacyrillic'] = 0x04D8; - t['Schwadieresiscyrillic'] = 0x04DA; - t['Scircle'] = 0x24C8; - t['Scircumflex'] = 0x015C; - t['Scommaaccent'] = 0x0218; - t['Sdotaccent'] = 0x1E60; - t['Sdotbelow'] = 0x1E62; - t['Sdotbelowdotaccent'] = 0x1E68; - t['Seharmenian'] = 0x054D; - t['Sevenroman'] = 0x2166; - t['Shaarmenian'] = 0x0547; - t['Shacyrillic'] = 0x0428; - t['Shchacyrillic'] = 0x0429; - t['Sheicoptic'] = 0x03E2; - t['Shhacyrillic'] = 0x04BA; - t['Shimacoptic'] = 0x03EC; - t['Sigma'] = 0x03A3; - t['Sixroman'] = 0x2165; - t['Smonospace'] = 0xFF33; - t['Softsigncyrillic'] = 0x042C; - t['Ssmall'] = 0xF773; - t['Stigmagreek'] = 0x03DA; - t['T'] = 0x0054; - t['Tau'] = 0x03A4; - t['Tbar'] = 0x0166; - t['Tcaron'] = 0x0164; - t['Tcedilla'] = 0x0162; - t['Tcircle'] = 0x24C9; - t['Tcircumflexbelow'] = 0x1E70; - t['Tcommaaccent'] = 0x0162; - t['Tdotaccent'] = 0x1E6A; - t['Tdotbelow'] = 0x1E6C; - t['Tecyrillic'] = 0x0422; - t['Tedescendercyrillic'] = 0x04AC; - t['Tenroman'] = 0x2169; - t['Tetsecyrillic'] = 0x04B4; - t['Theta'] = 0x0398; - t['Thook'] = 0x01AC; - t['Thorn'] = 0x00DE; - t['Thornsmall'] = 0xF7FE; - t['Threeroman'] = 0x2162; - t['Tildesmall'] = 0xF6FE; - t['Tiwnarmenian'] = 0x054F; - t['Tlinebelow'] = 0x1E6E; - t['Tmonospace'] = 0xFF34; - t['Toarmenian'] = 0x0539; - t['Tonefive'] = 0x01BC; - t['Tonesix'] = 0x0184; - t['Tonetwo'] = 0x01A7; - t['Tretroflexhook'] = 0x01AE; - t['Tsecyrillic'] = 0x0426; - t['Tshecyrillic'] = 0x040B; - t['Tsmall'] = 0xF774; - t['Twelveroman'] = 0x216B; - t['Tworoman'] = 0x2161; - t['U'] = 0x0055; - t['Uacute'] = 0x00DA; - t['Uacutesmall'] = 0xF7FA; - t['Ubreve'] = 0x016C; - t['Ucaron'] = 0x01D3; - t['Ucircle'] = 0x24CA; - t['Ucircumflex'] = 0x00DB; - t['Ucircumflexbelow'] = 0x1E76; - t['Ucircumflexsmall'] = 0xF7FB; - t['Ucyrillic'] = 0x0423; - t['Udblacute'] = 0x0170; - t['Udblgrave'] = 0x0214; - t['Udieresis'] = 0x00DC; - t['Udieresisacute'] = 0x01D7; - t['Udieresisbelow'] = 0x1E72; - t['Udieresiscaron'] = 0x01D9; - t['Udieresiscyrillic'] = 0x04F0; - t['Udieresisgrave'] = 0x01DB; - t['Udieresismacron'] = 0x01D5; - t['Udieresissmall'] = 0xF7FC; - t['Udotbelow'] = 0x1EE4; - t['Ugrave'] = 0x00D9; - t['Ugravesmall'] = 0xF7F9; - t['Uhookabove'] = 0x1EE6; - t['Uhorn'] = 0x01AF; - t['Uhornacute'] = 0x1EE8; - t['Uhorndotbelow'] = 0x1EF0; - t['Uhorngrave'] = 0x1EEA; - t['Uhornhookabove'] = 0x1EEC; - t['Uhorntilde'] = 0x1EEE; - t['Uhungarumlaut'] = 0x0170; - t['Uhungarumlautcyrillic'] = 0x04F2; - t['Uinvertedbreve'] = 0x0216; - t['Ukcyrillic'] = 0x0478; - t['Umacron'] = 0x016A; - t['Umacroncyrillic'] = 0x04EE; - t['Umacrondieresis'] = 0x1E7A; - t['Umonospace'] = 0xFF35; - t['Uogonek'] = 0x0172; - t['Upsilon'] = 0x03A5; - t['Upsilon1'] = 0x03D2; - t['Upsilonacutehooksymbolgreek'] = 0x03D3; - t['Upsilonafrican'] = 0x01B1; - t['Upsilondieresis'] = 0x03AB; - t['Upsilondieresishooksymbolgreek'] = 0x03D4; - t['Upsilonhooksymbol'] = 0x03D2; - t['Upsilontonos'] = 0x038E; - t['Uring'] = 0x016E; - t['Ushortcyrillic'] = 0x040E; - t['Usmall'] = 0xF775; - t['Ustraightcyrillic'] = 0x04AE; - t['Ustraightstrokecyrillic'] = 0x04B0; - t['Utilde'] = 0x0168; - t['Utildeacute'] = 0x1E78; - t['Utildebelow'] = 0x1E74; - t['V'] = 0x0056; - t['Vcircle'] = 0x24CB; - t['Vdotbelow'] = 0x1E7E; - t['Vecyrillic'] = 0x0412; - t['Vewarmenian'] = 0x054E; - t['Vhook'] = 0x01B2; - t['Vmonospace'] = 0xFF36; - t['Voarmenian'] = 0x0548; - t['Vsmall'] = 0xF776; - t['Vtilde'] = 0x1E7C; - t['W'] = 0x0057; - t['Wacute'] = 0x1E82; - t['Wcircle'] = 0x24CC; - t['Wcircumflex'] = 0x0174; - t['Wdieresis'] = 0x1E84; - t['Wdotaccent'] = 0x1E86; - t['Wdotbelow'] = 0x1E88; - t['Wgrave'] = 0x1E80; - t['Wmonospace'] = 0xFF37; - t['Wsmall'] = 0xF777; - t['X'] = 0x0058; - t['Xcircle'] = 0x24CD; - t['Xdieresis'] = 0x1E8C; - t['Xdotaccent'] = 0x1E8A; - t['Xeharmenian'] = 0x053D; - t['Xi'] = 0x039E; - t['Xmonospace'] = 0xFF38; - t['Xsmall'] = 0xF778; - t['Y'] = 0x0059; - t['Yacute'] = 0x00DD; - t['Yacutesmall'] = 0xF7FD; - t['Yatcyrillic'] = 0x0462; - t['Ycircle'] = 0x24CE; - t['Ycircumflex'] = 0x0176; - t['Ydieresis'] = 0x0178; - t['Ydieresissmall'] = 0xF7FF; - t['Ydotaccent'] = 0x1E8E; - t['Ydotbelow'] = 0x1EF4; - t['Yericyrillic'] = 0x042B; - t['Yerudieresiscyrillic'] = 0x04F8; - t['Ygrave'] = 0x1EF2; - t['Yhook'] = 0x01B3; - t['Yhookabove'] = 0x1EF6; - t['Yiarmenian'] = 0x0545; - t['Yicyrillic'] = 0x0407; - t['Yiwnarmenian'] = 0x0552; - t['Ymonospace'] = 0xFF39; - t['Ysmall'] = 0xF779; - t['Ytilde'] = 0x1EF8; - t['Yusbigcyrillic'] = 0x046A; - t['Yusbigiotifiedcyrillic'] = 0x046C; - t['Yuslittlecyrillic'] = 0x0466; - t['Yuslittleiotifiedcyrillic'] = 0x0468; - t['Z'] = 0x005A; - t['Zaarmenian'] = 0x0536; - t['Zacute'] = 0x0179; - t['Zcaron'] = 0x017D; - t['Zcaronsmall'] = 0xF6FF; - t['Zcircle'] = 0x24CF; - t['Zcircumflex'] = 0x1E90; - t['Zdot'] = 0x017B; - t['Zdotaccent'] = 0x017B; - t['Zdotbelow'] = 0x1E92; - t['Zecyrillic'] = 0x0417; - t['Zedescendercyrillic'] = 0x0498; - t['Zedieresiscyrillic'] = 0x04DE; - t['Zeta'] = 0x0396; - t['Zhearmenian'] = 0x053A; - t['Zhebrevecyrillic'] = 0x04C1; - t['Zhecyrillic'] = 0x0416; - t['Zhedescendercyrillic'] = 0x0496; - t['Zhedieresiscyrillic'] = 0x04DC; - t['Zlinebelow'] = 0x1E94; - t['Zmonospace'] = 0xFF3A; - t['Zsmall'] = 0xF77A; - t['Zstroke'] = 0x01B5; - t['a'] = 0x0061; - t['aabengali'] = 0x0986; - t['aacute'] = 0x00E1; - t['aadeva'] = 0x0906; - t['aagujarati'] = 0x0A86; - t['aagurmukhi'] = 0x0A06; - t['aamatragurmukhi'] = 0x0A3E; - t['aarusquare'] = 0x3303; - t['aavowelsignbengali'] = 0x09BE; - t['aavowelsigndeva'] = 0x093E; - t['aavowelsigngujarati'] = 0x0ABE; - t['abbreviationmarkarmenian'] = 0x055F; - t['abbreviationsigndeva'] = 0x0970; - t['abengali'] = 0x0985; - t['abopomofo'] = 0x311A; - t['abreve'] = 0x0103; - t['abreveacute'] = 0x1EAF; - t['abrevecyrillic'] = 0x04D1; - t['abrevedotbelow'] = 0x1EB7; - t['abrevegrave'] = 0x1EB1; - t['abrevehookabove'] = 0x1EB3; - t['abrevetilde'] = 0x1EB5; - t['acaron'] = 0x01CE; - t['acircle'] = 0x24D0; - t['acircumflex'] = 0x00E2; - t['acircumflexacute'] = 0x1EA5; - t['acircumflexdotbelow'] = 0x1EAD; - t['acircumflexgrave'] = 0x1EA7; - t['acircumflexhookabove'] = 0x1EA9; - t['acircumflextilde'] = 0x1EAB; - t['acute'] = 0x00B4; - t['acutebelowcmb'] = 0x0317; - t['acutecmb'] = 0x0301; - t['acutecomb'] = 0x0301; - t['acutedeva'] = 0x0954; - t['acutelowmod'] = 0x02CF; - t['acutetonecmb'] = 0x0341; - t['acyrillic'] = 0x0430; - t['adblgrave'] = 0x0201; - t['addakgurmukhi'] = 0x0A71; - t['adeva'] = 0x0905; - t['adieresis'] = 0x00E4; - t['adieresiscyrillic'] = 0x04D3; - t['adieresismacron'] = 0x01DF; - t['adotbelow'] = 0x1EA1; - t['adotmacron'] = 0x01E1; - t['ae'] = 0x00E6; - t['aeacute'] = 0x01FD; - t['aekorean'] = 0x3150; - t['aemacron'] = 0x01E3; - t['afii00208'] = 0x2015; - t['afii08941'] = 0x20A4; - t['afii10017'] = 0x0410; - t['afii10018'] = 0x0411; - t['afii10019'] = 0x0412; - t['afii10020'] = 0x0413; - t['afii10021'] = 0x0414; - t['afii10022'] = 0x0415; - t['afii10023'] = 0x0401; - t['afii10024'] = 0x0416; - t['afii10025'] = 0x0417; - t['afii10026'] = 0x0418; - t['afii10027'] = 0x0419; - t['afii10028'] = 0x041A; - t['afii10029'] = 0x041B; - t['afii10030'] = 0x041C; - t['afii10031'] = 0x041D; - t['afii10032'] = 0x041E; - t['afii10033'] = 0x041F; - t['afii10034'] = 0x0420; - t['afii10035'] = 0x0421; - t['afii10036'] = 0x0422; - t['afii10037'] = 0x0423; - t['afii10038'] = 0x0424; - t['afii10039'] = 0x0425; - t['afii10040'] = 0x0426; - t['afii10041'] = 0x0427; - t['afii10042'] = 0x0428; - t['afii10043'] = 0x0429; - t['afii10044'] = 0x042A; - t['afii10045'] = 0x042B; - t['afii10046'] = 0x042C; - t['afii10047'] = 0x042D; - t['afii10048'] = 0x042E; - t['afii10049'] = 0x042F; - t['afii10050'] = 0x0490; - t['afii10051'] = 0x0402; - t['afii10052'] = 0x0403; - t['afii10053'] = 0x0404; - t['afii10054'] = 0x0405; - t['afii10055'] = 0x0406; - t['afii10056'] = 0x0407; - t['afii10057'] = 0x0408; - t['afii10058'] = 0x0409; - t['afii10059'] = 0x040A; - t['afii10060'] = 0x040B; - t['afii10061'] = 0x040C; - t['afii10062'] = 0x040E; - t['afii10063'] = 0xF6C4; - t['afii10064'] = 0xF6C5; - t['afii10065'] = 0x0430; - t['afii10066'] = 0x0431; - t['afii10067'] = 0x0432; - t['afii10068'] = 0x0433; - t['afii10069'] = 0x0434; - t['afii10070'] = 0x0435; - t['afii10071'] = 0x0451; - t['afii10072'] = 0x0436; - t['afii10073'] = 0x0437; - t['afii10074'] = 0x0438; - t['afii10075'] = 0x0439; - t['afii10076'] = 0x043A; - t['afii10077'] = 0x043B; - t['afii10078'] = 0x043C; - t['afii10079'] = 0x043D; - t['afii10080'] = 0x043E; - t['afii10081'] = 0x043F; - t['afii10082'] = 0x0440; - t['afii10083'] = 0x0441; - t['afii10084'] = 0x0442; - t['afii10085'] = 0x0443; - t['afii10086'] = 0x0444; - t['afii10087'] = 0x0445; - t['afii10088'] = 0x0446; - t['afii10089'] = 0x0447; - t['afii10090'] = 0x0448; - t['afii10091'] = 0x0449; - t['afii10092'] = 0x044A; - t['afii10093'] = 0x044B; - t['afii10094'] = 0x044C; - t['afii10095'] = 0x044D; - t['afii10096'] = 0x044E; - t['afii10097'] = 0x044F; - t['afii10098'] = 0x0491; - t['afii10099'] = 0x0452; - t['afii10100'] = 0x0453; - t['afii10101'] = 0x0454; - t['afii10102'] = 0x0455; - t['afii10103'] = 0x0456; - t['afii10104'] = 0x0457; - t['afii10105'] = 0x0458; - t['afii10106'] = 0x0459; - t['afii10107'] = 0x045A; - t['afii10108'] = 0x045B; - t['afii10109'] = 0x045C; - t['afii10110'] = 0x045E; - t['afii10145'] = 0x040F; - t['afii10146'] = 0x0462; - t['afii10147'] = 0x0472; - t['afii10148'] = 0x0474; - t['afii10192'] = 0xF6C6; - t['afii10193'] = 0x045F; - t['afii10194'] = 0x0463; - t['afii10195'] = 0x0473; - t['afii10196'] = 0x0475; - t['afii10831'] = 0xF6C7; - t['afii10832'] = 0xF6C8; - t['afii10846'] = 0x04D9; - t['afii299'] = 0x200E; - t['afii300'] = 0x200F; - t['afii301'] = 0x200D; - t['afii57381'] = 0x066A; - t['afii57388'] = 0x060C; - t['afii57392'] = 0x0660; - t['afii57393'] = 0x0661; - t['afii57394'] = 0x0662; - t['afii57395'] = 0x0663; - t['afii57396'] = 0x0664; - t['afii57397'] = 0x0665; - t['afii57398'] = 0x0666; - t['afii57399'] = 0x0667; - t['afii57400'] = 0x0668; - t['afii57401'] = 0x0669; - t['afii57403'] = 0x061B; - t['afii57407'] = 0x061F; - t['afii57409'] = 0x0621; - t['afii57410'] = 0x0622; - t['afii57411'] = 0x0623; - t['afii57412'] = 0x0624; - t['afii57413'] = 0x0625; - t['afii57414'] = 0x0626; - t['afii57415'] = 0x0627; - t['afii57416'] = 0x0628; - t['afii57417'] = 0x0629; - t['afii57418'] = 0x062A; - t['afii57419'] = 0x062B; - t['afii57420'] = 0x062C; - t['afii57421'] = 0x062D; - t['afii57422'] = 0x062E; - t['afii57423'] = 0x062F; - t['afii57424'] = 0x0630; - t['afii57425'] = 0x0631; - t['afii57426'] = 0x0632; - t['afii57427'] = 0x0633; - t['afii57428'] = 0x0634; - t['afii57429'] = 0x0635; - t['afii57430'] = 0x0636; - t['afii57431'] = 0x0637; - t['afii57432'] = 0x0638; - t['afii57433'] = 0x0639; - t['afii57434'] = 0x063A; - t['afii57440'] = 0x0640; - t['afii57441'] = 0x0641; - t['afii57442'] = 0x0642; - t['afii57443'] = 0x0643; - t['afii57444'] = 0x0644; - t['afii57445'] = 0x0645; - t['afii57446'] = 0x0646; - t['afii57448'] = 0x0648; - t['afii57449'] = 0x0649; - t['afii57450'] = 0x064A; - t['afii57451'] = 0x064B; - t['afii57452'] = 0x064C; - t['afii57453'] = 0x064D; - t['afii57454'] = 0x064E; - t['afii57455'] = 0x064F; - t['afii57456'] = 0x0650; - t['afii57457'] = 0x0651; - t['afii57458'] = 0x0652; - t['afii57470'] = 0x0647; - t['afii57505'] = 0x06A4; - t['afii57506'] = 0x067E; - t['afii57507'] = 0x0686; - t['afii57508'] = 0x0698; - t['afii57509'] = 0x06AF; - t['afii57511'] = 0x0679; - t['afii57512'] = 0x0688; - t['afii57513'] = 0x0691; - t['afii57514'] = 0x06BA; - t['afii57519'] = 0x06D2; - t['afii57534'] = 0x06D5; - t['afii57636'] = 0x20AA; - t['afii57645'] = 0x05BE; - t['afii57658'] = 0x05C3; - t['afii57664'] = 0x05D0; - t['afii57665'] = 0x05D1; - t['afii57666'] = 0x05D2; - t['afii57667'] = 0x05D3; - t['afii57668'] = 0x05D4; - t['afii57669'] = 0x05D5; - t['afii57670'] = 0x05D6; - t['afii57671'] = 0x05D7; - t['afii57672'] = 0x05D8; - t['afii57673'] = 0x05D9; - t['afii57674'] = 0x05DA; - t['afii57675'] = 0x05DB; - t['afii57676'] = 0x05DC; - t['afii57677'] = 0x05DD; - t['afii57678'] = 0x05DE; - t['afii57679'] = 0x05DF; - t['afii57680'] = 0x05E0; - t['afii57681'] = 0x05E1; - t['afii57682'] = 0x05E2; - t['afii57683'] = 0x05E3; - t['afii57684'] = 0x05E4; - t['afii57685'] = 0x05E5; - t['afii57686'] = 0x05E6; - t['afii57687'] = 0x05E7; - t['afii57688'] = 0x05E8; - t['afii57689'] = 0x05E9; - t['afii57690'] = 0x05EA; - t['afii57694'] = 0xFB2A; - t['afii57695'] = 0xFB2B; - t['afii57700'] = 0xFB4B; - t['afii57705'] = 0xFB1F; - t['afii57716'] = 0x05F0; - t['afii57717'] = 0x05F1; - t['afii57718'] = 0x05F2; - t['afii57723'] = 0xFB35; - t['afii57793'] = 0x05B4; - t['afii57794'] = 0x05B5; - t['afii57795'] = 0x05B6; - t['afii57796'] = 0x05BB; - t['afii57797'] = 0x05B8; - t['afii57798'] = 0x05B7; - t['afii57799'] = 0x05B0; - t['afii57800'] = 0x05B2; - t['afii57801'] = 0x05B1; - t['afii57802'] = 0x05B3; - t['afii57803'] = 0x05C2; - t['afii57804'] = 0x05C1; - t['afii57806'] = 0x05B9; - t['afii57807'] = 0x05BC; - t['afii57839'] = 0x05BD; - t['afii57841'] = 0x05BF; - t['afii57842'] = 0x05C0; - t['afii57929'] = 0x02BC; - t['afii61248'] = 0x2105; - t['afii61289'] = 0x2113; - t['afii61352'] = 0x2116; - t['afii61573'] = 0x202C; - t['afii61574'] = 0x202D; - t['afii61575'] = 0x202E; - t['afii61664'] = 0x200C; - t['afii63167'] = 0x066D; - t['afii64937'] = 0x02BD; - t['agrave'] = 0x00E0; - t['agujarati'] = 0x0A85; - t['agurmukhi'] = 0x0A05; - t['ahiragana'] = 0x3042; - t['ahookabove'] = 0x1EA3; - t['aibengali'] = 0x0990; - t['aibopomofo'] = 0x311E; - t['aideva'] = 0x0910; - t['aiecyrillic'] = 0x04D5; - t['aigujarati'] = 0x0A90; - t['aigurmukhi'] = 0x0A10; - t['aimatragurmukhi'] = 0x0A48; - t['ainarabic'] = 0x0639; - t['ainfinalarabic'] = 0xFECA; - t['aininitialarabic'] = 0xFECB; - t['ainmedialarabic'] = 0xFECC; - t['ainvertedbreve'] = 0x0203; - t['aivowelsignbengali'] = 0x09C8; - t['aivowelsigndeva'] = 0x0948; - t['aivowelsigngujarati'] = 0x0AC8; - t['akatakana'] = 0x30A2; - t['akatakanahalfwidth'] = 0xFF71; - t['akorean'] = 0x314F; - t['alef'] = 0x05D0; - t['alefarabic'] = 0x0627; - t['alefdageshhebrew'] = 0xFB30; - t['aleffinalarabic'] = 0xFE8E; - t['alefhamzaabovearabic'] = 0x0623; - t['alefhamzaabovefinalarabic'] = 0xFE84; - t['alefhamzabelowarabic'] = 0x0625; - t['alefhamzabelowfinalarabic'] = 0xFE88; - t['alefhebrew'] = 0x05D0; - t['aleflamedhebrew'] = 0xFB4F; - t['alefmaddaabovearabic'] = 0x0622; - t['alefmaddaabovefinalarabic'] = 0xFE82; - t['alefmaksuraarabic'] = 0x0649; - t['alefmaksurafinalarabic'] = 0xFEF0; - t['alefmaksurainitialarabic'] = 0xFEF3; - t['alefmaksuramedialarabic'] = 0xFEF4; - t['alefpatahhebrew'] = 0xFB2E; - t['alefqamatshebrew'] = 0xFB2F; - t['aleph'] = 0x2135; - t['allequal'] = 0x224C; - t['alpha'] = 0x03B1; - t['alphatonos'] = 0x03AC; - t['amacron'] = 0x0101; - t['amonospace'] = 0xFF41; - t['ampersand'] = 0x0026; - t['ampersandmonospace'] = 0xFF06; - t['ampersandsmall'] = 0xF726; - t['amsquare'] = 0x33C2; - t['anbopomofo'] = 0x3122; - t['angbopomofo'] = 0x3124; - t['angbracketleft'] = 0x3008; // Glyph is missing from Adobe's original list. - t['angbracketright'] = 0x3009; // Glyph is missing from Adobe's original list. - t['angkhankhuthai'] = 0x0E5A; - t['angle'] = 0x2220; - t['anglebracketleft'] = 0x3008; - t['anglebracketleftvertical'] = 0xFE3F; - t['anglebracketright'] = 0x3009; - t['anglebracketrightvertical'] = 0xFE40; - t['angleleft'] = 0x2329; - t['angleright'] = 0x232A; - t['angstrom'] = 0x212B; - t['anoteleia'] = 0x0387; - t['anudattadeva'] = 0x0952; - t['anusvarabengali'] = 0x0982; - t['anusvaradeva'] = 0x0902; - t['anusvaragujarati'] = 0x0A82; - t['aogonek'] = 0x0105; - t['apaatosquare'] = 0x3300; - t['aparen'] = 0x249C; - t['apostrophearmenian'] = 0x055A; - t['apostrophemod'] = 0x02BC; - t['apple'] = 0xF8FF; - t['approaches'] = 0x2250; - t['approxequal'] = 0x2248; - t['approxequalorimage'] = 0x2252; - t['approximatelyequal'] = 0x2245; - t['araeaekorean'] = 0x318E; - t['araeakorean'] = 0x318D; - t['arc'] = 0x2312; - t['arighthalfring'] = 0x1E9A; - t['aring'] = 0x00E5; - t['aringacute'] = 0x01FB; - t['aringbelow'] = 0x1E01; - t['arrowboth'] = 0x2194; - t['arrowdashdown'] = 0x21E3; - t['arrowdashleft'] = 0x21E0; - t['arrowdashright'] = 0x21E2; - t['arrowdashup'] = 0x21E1; - t['arrowdblboth'] = 0x21D4; - t['arrowdbldown'] = 0x21D3; - t['arrowdblleft'] = 0x21D0; - t['arrowdblright'] = 0x21D2; - t['arrowdblup'] = 0x21D1; - t['arrowdown'] = 0x2193; - t['arrowdownleft'] = 0x2199; - t['arrowdownright'] = 0x2198; - t['arrowdownwhite'] = 0x21E9; - t['arrowheaddownmod'] = 0x02C5; - t['arrowheadleftmod'] = 0x02C2; - t['arrowheadrightmod'] = 0x02C3; - t['arrowheadupmod'] = 0x02C4; - t['arrowhorizex'] = 0xF8E7; - t['arrowleft'] = 0x2190; - t['arrowleftdbl'] = 0x21D0; - t['arrowleftdblstroke'] = 0x21CD; - t['arrowleftoverright'] = 0x21C6; - t['arrowleftwhite'] = 0x21E6; - t['arrowright'] = 0x2192; - t['arrowrightdblstroke'] = 0x21CF; - t['arrowrightheavy'] = 0x279E; - t['arrowrightoverleft'] = 0x21C4; - t['arrowrightwhite'] = 0x21E8; - t['arrowtableft'] = 0x21E4; - t['arrowtabright'] = 0x21E5; - t['arrowup'] = 0x2191; - t['arrowupdn'] = 0x2195; - t['arrowupdnbse'] = 0x21A8; - t['arrowupdownbase'] = 0x21A8; - t['arrowupleft'] = 0x2196; - t['arrowupleftofdown'] = 0x21C5; - t['arrowupright'] = 0x2197; - t['arrowupwhite'] = 0x21E7; - t['arrowvertex'] = 0xF8E6; - t['asciicircum'] = 0x005E; - t['asciicircummonospace'] = 0xFF3E; - t['asciitilde'] = 0x007E; - t['asciitildemonospace'] = 0xFF5E; - t['ascript'] = 0x0251; - t['ascriptturned'] = 0x0252; - t['asmallhiragana'] = 0x3041; - t['asmallkatakana'] = 0x30A1; - t['asmallkatakanahalfwidth'] = 0xFF67; - t['asterisk'] = 0x002A; - t['asteriskaltonearabic'] = 0x066D; - t['asteriskarabic'] = 0x066D; - t['asteriskmath'] = 0x2217; - t['asteriskmonospace'] = 0xFF0A; - t['asterisksmall'] = 0xFE61; - t['asterism'] = 0x2042; - t['asuperior'] = 0xF6E9; - t['asymptoticallyequal'] = 0x2243; - t['at'] = 0x0040; - t['atilde'] = 0x00E3; - t['atmonospace'] = 0xFF20; - t['atsmall'] = 0xFE6B; - t['aturned'] = 0x0250; - t['aubengali'] = 0x0994; - t['aubopomofo'] = 0x3120; - t['audeva'] = 0x0914; - t['augujarati'] = 0x0A94; - t['augurmukhi'] = 0x0A14; - t['aulengthmarkbengali'] = 0x09D7; - t['aumatragurmukhi'] = 0x0A4C; - t['auvowelsignbengali'] = 0x09CC; - t['auvowelsigndeva'] = 0x094C; - t['auvowelsigngujarati'] = 0x0ACC; - t['avagrahadeva'] = 0x093D; - t['aybarmenian'] = 0x0561; - t['ayin'] = 0x05E2; - t['ayinaltonehebrew'] = 0xFB20; - t['ayinhebrew'] = 0x05E2; - t['b'] = 0x0062; - t['babengali'] = 0x09AC; - t['backslash'] = 0x005C; - t['backslashmonospace'] = 0xFF3C; - t['badeva'] = 0x092C; - t['bagujarati'] = 0x0AAC; - t['bagurmukhi'] = 0x0A2C; - t['bahiragana'] = 0x3070; - t['bahtthai'] = 0x0E3F; - t['bakatakana'] = 0x30D0; - t['bar'] = 0x007C; - t['barmonospace'] = 0xFF5C; - t['bbopomofo'] = 0x3105; - t['bcircle'] = 0x24D1; - t['bdotaccent'] = 0x1E03; - t['bdotbelow'] = 0x1E05; - t['beamedsixteenthnotes'] = 0x266C; - t['because'] = 0x2235; - t['becyrillic'] = 0x0431; - t['beharabic'] = 0x0628; - t['behfinalarabic'] = 0xFE90; - t['behinitialarabic'] = 0xFE91; - t['behiragana'] = 0x3079; - t['behmedialarabic'] = 0xFE92; - t['behmeeminitialarabic'] = 0xFC9F; - t['behmeemisolatedarabic'] = 0xFC08; - t['behnoonfinalarabic'] = 0xFC6D; - t['bekatakana'] = 0x30D9; - t['benarmenian'] = 0x0562; - t['bet'] = 0x05D1; - t['beta'] = 0x03B2; - t['betasymbolgreek'] = 0x03D0; - t['betdagesh'] = 0xFB31; - t['betdageshhebrew'] = 0xFB31; - t['bethebrew'] = 0x05D1; - t['betrafehebrew'] = 0xFB4C; - t['bhabengali'] = 0x09AD; - t['bhadeva'] = 0x092D; - t['bhagujarati'] = 0x0AAD; - t['bhagurmukhi'] = 0x0A2D; - t['bhook'] = 0x0253; - t['bihiragana'] = 0x3073; - t['bikatakana'] = 0x30D3; - t['bilabialclick'] = 0x0298; - t['bindigurmukhi'] = 0x0A02; - t['birusquare'] = 0x3331; - t['blackcircle'] = 0x25CF; - t['blackdiamond'] = 0x25C6; - t['blackdownpointingtriangle'] = 0x25BC; - t['blackleftpointingpointer'] = 0x25C4; - t['blackleftpointingtriangle'] = 0x25C0; - t['blacklenticularbracketleft'] = 0x3010; - t['blacklenticularbracketleftvertical'] = 0xFE3B; - t['blacklenticularbracketright'] = 0x3011; - t['blacklenticularbracketrightvertical'] = 0xFE3C; - t['blacklowerlefttriangle'] = 0x25E3; - t['blacklowerrighttriangle'] = 0x25E2; - t['blackrectangle'] = 0x25AC; - t['blackrightpointingpointer'] = 0x25BA; - t['blackrightpointingtriangle'] = 0x25B6; - t['blacksmallsquare'] = 0x25AA; - t['blacksmilingface'] = 0x263B; - t['blacksquare'] = 0x25A0; - t['blackstar'] = 0x2605; - t['blackupperlefttriangle'] = 0x25E4; - t['blackupperrighttriangle'] = 0x25E5; - t['blackuppointingsmalltriangle'] = 0x25B4; - t['blackuppointingtriangle'] = 0x25B2; - t['blank'] = 0x2423; - t['blinebelow'] = 0x1E07; - t['block'] = 0x2588; - t['bmonospace'] = 0xFF42; - t['bobaimaithai'] = 0x0E1A; - t['bohiragana'] = 0x307C; - t['bokatakana'] = 0x30DC; - t['bparen'] = 0x249D; - t['bqsquare'] = 0x33C3; - t['braceex'] = 0xF8F4; - t['braceleft'] = 0x007B; - t['braceleftbt'] = 0xF8F3; - t['braceleftmid'] = 0xF8F2; - t['braceleftmonospace'] = 0xFF5B; - t['braceleftsmall'] = 0xFE5B; - t['bracelefttp'] = 0xF8F1; - t['braceleftvertical'] = 0xFE37; - t['braceright'] = 0x007D; - t['bracerightbt'] = 0xF8FE; - t['bracerightmid'] = 0xF8FD; - t['bracerightmonospace'] = 0xFF5D; - t['bracerightsmall'] = 0xFE5C; - t['bracerighttp'] = 0xF8FC; - t['bracerightvertical'] = 0xFE38; - t['bracketleft'] = 0x005B; - t['bracketleftbt'] = 0xF8F0; - t['bracketleftex'] = 0xF8EF; - t['bracketleftmonospace'] = 0xFF3B; - t['bracketlefttp'] = 0xF8EE; - t['bracketright'] = 0x005D; - t['bracketrightbt'] = 0xF8FB; - t['bracketrightex'] = 0xF8FA; - t['bracketrightmonospace'] = 0xFF3D; - t['bracketrighttp'] = 0xF8F9; - t['breve'] = 0x02D8; - t['brevebelowcmb'] = 0x032E; - t['brevecmb'] = 0x0306; - t['breveinvertedbelowcmb'] = 0x032F; - t['breveinvertedcmb'] = 0x0311; - t['breveinverteddoublecmb'] = 0x0361; - t['bridgebelowcmb'] = 0x032A; - t['bridgeinvertedbelowcmb'] = 0x033A; - t['brokenbar'] = 0x00A6; - t['bstroke'] = 0x0180; - t['bsuperior'] = 0xF6EA; - t['btopbar'] = 0x0183; - t['buhiragana'] = 0x3076; - t['bukatakana'] = 0x30D6; - t['bullet'] = 0x2022; - t['bulletinverse'] = 0x25D8; - t['bulletoperator'] = 0x2219; - t['bullseye'] = 0x25CE; - t['c'] = 0x0063; - t['caarmenian'] = 0x056E; - t['cabengali'] = 0x099A; - t['cacute'] = 0x0107; - t['cadeva'] = 0x091A; - t['cagujarati'] = 0x0A9A; - t['cagurmukhi'] = 0x0A1A; - t['calsquare'] = 0x3388; - t['candrabindubengali'] = 0x0981; - t['candrabinducmb'] = 0x0310; - t['candrabindudeva'] = 0x0901; - t['candrabindugujarati'] = 0x0A81; - t['capslock'] = 0x21EA; - t['careof'] = 0x2105; - t['caron'] = 0x02C7; - t['caronbelowcmb'] = 0x032C; - t['caroncmb'] = 0x030C; - t['carriagereturn'] = 0x21B5; - t['cbopomofo'] = 0x3118; - t['ccaron'] = 0x010D; - t['ccedilla'] = 0x00E7; - t['ccedillaacute'] = 0x1E09; - t['ccircle'] = 0x24D2; - t['ccircumflex'] = 0x0109; - t['ccurl'] = 0x0255; - t['cdot'] = 0x010B; - t['cdotaccent'] = 0x010B; - t['cdsquare'] = 0x33C5; - t['cedilla'] = 0x00B8; - t['cedillacmb'] = 0x0327; - t['cent'] = 0x00A2; - t['centigrade'] = 0x2103; - t['centinferior'] = 0xF6DF; - t['centmonospace'] = 0xFFE0; - t['centoldstyle'] = 0xF7A2; - t['centsuperior'] = 0xF6E0; - t['chaarmenian'] = 0x0579; - t['chabengali'] = 0x099B; - t['chadeva'] = 0x091B; - t['chagujarati'] = 0x0A9B; - t['chagurmukhi'] = 0x0A1B; - t['chbopomofo'] = 0x3114; - t['cheabkhasiancyrillic'] = 0x04BD; - t['checkmark'] = 0x2713; - t['checyrillic'] = 0x0447; - t['chedescenderabkhasiancyrillic'] = 0x04BF; - t['chedescendercyrillic'] = 0x04B7; - t['chedieresiscyrillic'] = 0x04F5; - t['cheharmenian'] = 0x0573; - t['chekhakassiancyrillic'] = 0x04CC; - t['cheverticalstrokecyrillic'] = 0x04B9; - t['chi'] = 0x03C7; - t['chieuchacirclekorean'] = 0x3277; - t['chieuchaparenkorean'] = 0x3217; - t['chieuchcirclekorean'] = 0x3269; - t['chieuchkorean'] = 0x314A; - t['chieuchparenkorean'] = 0x3209; - t['chochangthai'] = 0x0E0A; - t['chochanthai'] = 0x0E08; - t['chochingthai'] = 0x0E09; - t['chochoethai'] = 0x0E0C; - t['chook'] = 0x0188; - t['cieucacirclekorean'] = 0x3276; - t['cieucaparenkorean'] = 0x3216; - t['cieuccirclekorean'] = 0x3268; - t['cieuckorean'] = 0x3148; - t['cieucparenkorean'] = 0x3208; - t['cieucuparenkorean'] = 0x321C; - t['circle'] = 0x25CB; - t['circlecopyrt'] = 0x00A9; // Glyph is missing from Adobe's original list. - t['circlemultiply'] = 0x2297; - t['circleot'] = 0x2299; - t['circleplus'] = 0x2295; - t['circlepostalmark'] = 0x3036; - t['circlewithlefthalfblack'] = 0x25D0; - t['circlewithrighthalfblack'] = 0x25D1; - t['circumflex'] = 0x02C6; - t['circumflexbelowcmb'] = 0x032D; - t['circumflexcmb'] = 0x0302; - t['clear'] = 0x2327; - t['clickalveolar'] = 0x01C2; - t['clickdental'] = 0x01C0; - t['clicklateral'] = 0x01C1; - t['clickretroflex'] = 0x01C3; - t['club'] = 0x2663; - t['clubsuitblack'] = 0x2663; - t['clubsuitwhite'] = 0x2667; - t['cmcubedsquare'] = 0x33A4; - t['cmonospace'] = 0xFF43; - t['cmsquaredsquare'] = 0x33A0; - t['coarmenian'] = 0x0581; - t['colon'] = 0x003A; - t['colonmonetary'] = 0x20A1; - t['colonmonospace'] = 0xFF1A; - t['colonsign'] = 0x20A1; - t['colonsmall'] = 0xFE55; - t['colontriangularhalfmod'] = 0x02D1; - t['colontriangularmod'] = 0x02D0; - t['comma'] = 0x002C; - t['commaabovecmb'] = 0x0313; - t['commaaboverightcmb'] = 0x0315; - t['commaaccent'] = 0xF6C3; - t['commaarabic'] = 0x060C; - t['commaarmenian'] = 0x055D; - t['commainferior'] = 0xF6E1; - t['commamonospace'] = 0xFF0C; - t['commareversedabovecmb'] = 0x0314; - t['commareversedmod'] = 0x02BD; - t['commasmall'] = 0xFE50; - t['commasuperior'] = 0xF6E2; - t['commaturnedabovecmb'] = 0x0312; - t['commaturnedmod'] = 0x02BB; - t['compass'] = 0x263C; - t['congruent'] = 0x2245; - t['contourintegral'] = 0x222E; - t['control'] = 0x2303; - t['controlACK'] = 0x0006; - t['controlBEL'] = 0x0007; - t['controlBS'] = 0x0008; - t['controlCAN'] = 0x0018; - t['controlCR'] = 0x000D; - t['controlDC1'] = 0x0011; - t['controlDC2'] = 0x0012; - t['controlDC3'] = 0x0013; - t['controlDC4'] = 0x0014; - t['controlDEL'] = 0x007F; - t['controlDLE'] = 0x0010; - t['controlEM'] = 0x0019; - t['controlENQ'] = 0x0005; - t['controlEOT'] = 0x0004; - t['controlESC'] = 0x001B; - t['controlETB'] = 0x0017; - t['controlETX'] = 0x0003; - t['controlFF'] = 0x000C; - t['controlFS'] = 0x001C; - t['controlGS'] = 0x001D; - t['controlHT'] = 0x0009; - t['controlLF'] = 0x000A; - t['controlNAK'] = 0x0015; - t['controlRS'] = 0x001E; - t['controlSI'] = 0x000F; - t['controlSO'] = 0x000E; - t['controlSOT'] = 0x0002; - t['controlSTX'] = 0x0001; - t['controlSUB'] = 0x001A; - t['controlSYN'] = 0x0016; - t['controlUS'] = 0x001F; - t['controlVT'] = 0x000B; - t['copyright'] = 0x00A9; - t['copyrightsans'] = 0xF8E9; - t['copyrightserif'] = 0xF6D9; - t['cornerbracketleft'] = 0x300C; - t['cornerbracketlefthalfwidth'] = 0xFF62; - t['cornerbracketleftvertical'] = 0xFE41; - t['cornerbracketright'] = 0x300D; - t['cornerbracketrighthalfwidth'] = 0xFF63; - t['cornerbracketrightvertical'] = 0xFE42; - t['corporationsquare'] = 0x337F; - t['cosquare'] = 0x33C7; - t['coverkgsquare'] = 0x33C6; - t['cparen'] = 0x249E; - t['cruzeiro'] = 0x20A2; - t['cstretched'] = 0x0297; - t['curlyand'] = 0x22CF; - t['curlyor'] = 0x22CE; - t['currency'] = 0x00A4; - t['cyrBreve'] = 0xF6D1; - t['cyrFlex'] = 0xF6D2; - t['cyrbreve'] = 0xF6D4; - t['cyrflex'] = 0xF6D5; - t['d'] = 0x0064; - t['daarmenian'] = 0x0564; - t['dabengali'] = 0x09A6; - t['dadarabic'] = 0x0636; - t['dadeva'] = 0x0926; - t['dadfinalarabic'] = 0xFEBE; - t['dadinitialarabic'] = 0xFEBF; - t['dadmedialarabic'] = 0xFEC0; - t['dagesh'] = 0x05BC; - t['dageshhebrew'] = 0x05BC; - t['dagger'] = 0x2020; - t['daggerdbl'] = 0x2021; - t['dagujarati'] = 0x0AA6; - t['dagurmukhi'] = 0x0A26; - t['dahiragana'] = 0x3060; - t['dakatakana'] = 0x30C0; - t['dalarabic'] = 0x062F; - t['dalet'] = 0x05D3; - t['daletdagesh'] = 0xFB33; - t['daletdageshhebrew'] = 0xFB33; - t['dalethebrew'] = 0x05D3; - t['dalfinalarabic'] = 0xFEAA; - t['dammaarabic'] = 0x064F; - t['dammalowarabic'] = 0x064F; - t['dammatanaltonearabic'] = 0x064C; - t['dammatanarabic'] = 0x064C; - t['danda'] = 0x0964; - t['dargahebrew'] = 0x05A7; - t['dargalefthebrew'] = 0x05A7; - t['dasiapneumatacyrilliccmb'] = 0x0485; - t['dblGrave'] = 0xF6D3; - t['dblanglebracketleft'] = 0x300A; - t['dblanglebracketleftvertical'] = 0xFE3D; - t['dblanglebracketright'] = 0x300B; - t['dblanglebracketrightvertical'] = 0xFE3E; - t['dblarchinvertedbelowcmb'] = 0x032B; - t['dblarrowleft'] = 0x21D4; - t['dblarrowright'] = 0x21D2; - t['dbldanda'] = 0x0965; - t['dblgrave'] = 0xF6D6; - t['dblgravecmb'] = 0x030F; - t['dblintegral'] = 0x222C; - t['dbllowline'] = 0x2017; - t['dbllowlinecmb'] = 0x0333; - t['dbloverlinecmb'] = 0x033F; - t['dblprimemod'] = 0x02BA; - t['dblverticalbar'] = 0x2016; - t['dblverticallineabovecmb'] = 0x030E; - t['dbopomofo'] = 0x3109; - t['dbsquare'] = 0x33C8; - t['dcaron'] = 0x010F; - t['dcedilla'] = 0x1E11; - t['dcircle'] = 0x24D3; - t['dcircumflexbelow'] = 0x1E13; - t['dcroat'] = 0x0111; - t['ddabengali'] = 0x09A1; - t['ddadeva'] = 0x0921; - t['ddagujarati'] = 0x0AA1; - t['ddagurmukhi'] = 0x0A21; - t['ddalarabic'] = 0x0688; - t['ddalfinalarabic'] = 0xFB89; - t['dddhadeva'] = 0x095C; - t['ddhabengali'] = 0x09A2; - t['ddhadeva'] = 0x0922; - t['ddhagujarati'] = 0x0AA2; - t['ddhagurmukhi'] = 0x0A22; - t['ddotaccent'] = 0x1E0B; - t['ddotbelow'] = 0x1E0D; - t['decimalseparatorarabic'] = 0x066B; - t['decimalseparatorpersian'] = 0x066B; - t['decyrillic'] = 0x0434; - t['degree'] = 0x00B0; - t['dehihebrew'] = 0x05AD; - t['dehiragana'] = 0x3067; - t['deicoptic'] = 0x03EF; - t['dekatakana'] = 0x30C7; - t['deleteleft'] = 0x232B; - t['deleteright'] = 0x2326; - t['delta'] = 0x03B4; - t['deltaturned'] = 0x018D; - t['denominatorminusonenumeratorbengali'] = 0x09F8; - t['dezh'] = 0x02A4; - t['dhabengali'] = 0x09A7; - t['dhadeva'] = 0x0927; - t['dhagujarati'] = 0x0AA7; - t['dhagurmukhi'] = 0x0A27; - t['dhook'] = 0x0257; - t['dialytikatonos'] = 0x0385; - t['dialytikatonoscmb'] = 0x0344; - t['diamond'] = 0x2666; - t['diamondsuitwhite'] = 0x2662; - t['dieresis'] = 0x00A8; - t['dieresisacute'] = 0xF6D7; - t['dieresisbelowcmb'] = 0x0324; - t['dieresiscmb'] = 0x0308; - t['dieresisgrave'] = 0xF6D8; - t['dieresistonos'] = 0x0385; - t['dihiragana'] = 0x3062; - t['dikatakana'] = 0x30C2; - t['dittomark'] = 0x3003; - t['divide'] = 0x00F7; - t['divides'] = 0x2223; - t['divisionslash'] = 0x2215; - t['djecyrillic'] = 0x0452; - t['dkshade'] = 0x2593; - t['dlinebelow'] = 0x1E0F; - t['dlsquare'] = 0x3397; - t['dmacron'] = 0x0111; - t['dmonospace'] = 0xFF44; - t['dnblock'] = 0x2584; - t['dochadathai'] = 0x0E0E; - t['dodekthai'] = 0x0E14; - t['dohiragana'] = 0x3069; - t['dokatakana'] = 0x30C9; - t['dollar'] = 0x0024; - t['dollarinferior'] = 0xF6E3; - t['dollarmonospace'] = 0xFF04; - t['dollaroldstyle'] = 0xF724; - t['dollarsmall'] = 0xFE69; - t['dollarsuperior'] = 0xF6E4; - t['dong'] = 0x20AB; - t['dorusquare'] = 0x3326; - t['dotaccent'] = 0x02D9; - t['dotaccentcmb'] = 0x0307; - t['dotbelowcmb'] = 0x0323; - t['dotbelowcomb'] = 0x0323; - t['dotkatakana'] = 0x30FB; - t['dotlessi'] = 0x0131; - t['dotlessj'] = 0xF6BE; - t['dotlessjstrokehook'] = 0x0284; - t['dotmath'] = 0x22C5; - t['dottedcircle'] = 0x25CC; - t['doubleyodpatah'] = 0xFB1F; - t['doubleyodpatahhebrew'] = 0xFB1F; - t['downtackbelowcmb'] = 0x031E; - t['downtackmod'] = 0x02D5; - t['dparen'] = 0x249F; - t['dsuperior'] = 0xF6EB; - t['dtail'] = 0x0256; - t['dtopbar'] = 0x018C; - t['duhiragana'] = 0x3065; - t['dukatakana'] = 0x30C5; - t['dz'] = 0x01F3; - t['dzaltone'] = 0x02A3; - t['dzcaron'] = 0x01C6; - t['dzcurl'] = 0x02A5; - t['dzeabkhasiancyrillic'] = 0x04E1; - t['dzecyrillic'] = 0x0455; - t['dzhecyrillic'] = 0x045F; - t['e'] = 0x0065; - t['eacute'] = 0x00E9; - t['earth'] = 0x2641; - t['ebengali'] = 0x098F; - t['ebopomofo'] = 0x311C; - t['ebreve'] = 0x0115; - t['ecandradeva'] = 0x090D; - t['ecandragujarati'] = 0x0A8D; - t['ecandravowelsigndeva'] = 0x0945; - t['ecandravowelsigngujarati'] = 0x0AC5; - t['ecaron'] = 0x011B; - t['ecedillabreve'] = 0x1E1D; - t['echarmenian'] = 0x0565; - t['echyiwnarmenian'] = 0x0587; - t['ecircle'] = 0x24D4; - t['ecircumflex'] = 0x00EA; - t['ecircumflexacute'] = 0x1EBF; - t['ecircumflexbelow'] = 0x1E19; - t['ecircumflexdotbelow'] = 0x1EC7; - t['ecircumflexgrave'] = 0x1EC1; - t['ecircumflexhookabove'] = 0x1EC3; - t['ecircumflextilde'] = 0x1EC5; - t['ecyrillic'] = 0x0454; - t['edblgrave'] = 0x0205; - t['edeva'] = 0x090F; - t['edieresis'] = 0x00EB; - t['edot'] = 0x0117; - t['edotaccent'] = 0x0117; - t['edotbelow'] = 0x1EB9; - t['eegurmukhi'] = 0x0A0F; - t['eematragurmukhi'] = 0x0A47; - t['efcyrillic'] = 0x0444; - t['egrave'] = 0x00E8; - t['egujarati'] = 0x0A8F; - t['eharmenian'] = 0x0567; - t['ehbopomofo'] = 0x311D; - t['ehiragana'] = 0x3048; - t['ehookabove'] = 0x1EBB; - t['eibopomofo'] = 0x311F; - t['eight'] = 0x0038; - t['eightarabic'] = 0x0668; - t['eightbengali'] = 0x09EE; - t['eightcircle'] = 0x2467; - t['eightcircleinversesansserif'] = 0x2791; - t['eightdeva'] = 0x096E; - t['eighteencircle'] = 0x2471; - t['eighteenparen'] = 0x2485; - t['eighteenperiod'] = 0x2499; - t['eightgujarati'] = 0x0AEE; - t['eightgurmukhi'] = 0x0A6E; - t['eighthackarabic'] = 0x0668; - t['eighthangzhou'] = 0x3028; - t['eighthnotebeamed'] = 0x266B; - t['eightideographicparen'] = 0x3227; - t['eightinferior'] = 0x2088; - t['eightmonospace'] = 0xFF18; - t['eightoldstyle'] = 0xF738; - t['eightparen'] = 0x247B; - t['eightperiod'] = 0x248F; - t['eightpersian'] = 0x06F8; - t['eightroman'] = 0x2177; - t['eightsuperior'] = 0x2078; - t['eightthai'] = 0x0E58; - t['einvertedbreve'] = 0x0207; - t['eiotifiedcyrillic'] = 0x0465; - t['ekatakana'] = 0x30A8; - t['ekatakanahalfwidth'] = 0xFF74; - t['ekonkargurmukhi'] = 0x0A74; - t['ekorean'] = 0x3154; - t['elcyrillic'] = 0x043B; - t['element'] = 0x2208; - t['elevencircle'] = 0x246A; - t['elevenparen'] = 0x247E; - t['elevenperiod'] = 0x2492; - t['elevenroman'] = 0x217A; - t['ellipsis'] = 0x2026; - t['ellipsisvertical'] = 0x22EE; - t['emacron'] = 0x0113; - t['emacronacute'] = 0x1E17; - t['emacrongrave'] = 0x1E15; - t['emcyrillic'] = 0x043C; - t['emdash'] = 0x2014; - t['emdashvertical'] = 0xFE31; - t['emonospace'] = 0xFF45; - t['emphasismarkarmenian'] = 0x055B; - t['emptyset'] = 0x2205; - t['enbopomofo'] = 0x3123; - t['encyrillic'] = 0x043D; - t['endash'] = 0x2013; - t['endashvertical'] = 0xFE32; - t['endescendercyrillic'] = 0x04A3; - t['eng'] = 0x014B; - t['engbopomofo'] = 0x3125; - t['enghecyrillic'] = 0x04A5; - t['enhookcyrillic'] = 0x04C8; - t['enspace'] = 0x2002; - t['eogonek'] = 0x0119; - t['eokorean'] = 0x3153; - t['eopen'] = 0x025B; - t['eopenclosed'] = 0x029A; - t['eopenreversed'] = 0x025C; - t['eopenreversedclosed'] = 0x025E; - t['eopenreversedhook'] = 0x025D; - t['eparen'] = 0x24A0; - t['epsilon'] = 0x03B5; - t['epsilontonos'] = 0x03AD; - t['equal'] = 0x003D; - t['equalmonospace'] = 0xFF1D; - t['equalsmall'] = 0xFE66; - t['equalsuperior'] = 0x207C; - t['equivalence'] = 0x2261; - t['erbopomofo'] = 0x3126; - t['ercyrillic'] = 0x0440; - t['ereversed'] = 0x0258; - t['ereversedcyrillic'] = 0x044D; - t['escyrillic'] = 0x0441; - t['esdescendercyrillic'] = 0x04AB; - t['esh'] = 0x0283; - t['eshcurl'] = 0x0286; - t['eshortdeva'] = 0x090E; - t['eshortvowelsigndeva'] = 0x0946; - t['eshreversedloop'] = 0x01AA; - t['eshsquatreversed'] = 0x0285; - t['esmallhiragana'] = 0x3047; - t['esmallkatakana'] = 0x30A7; - t['esmallkatakanahalfwidth'] = 0xFF6A; - t['estimated'] = 0x212E; - t['esuperior'] = 0xF6EC; - t['eta'] = 0x03B7; - t['etarmenian'] = 0x0568; - t['etatonos'] = 0x03AE; - t['eth'] = 0x00F0; - t['etilde'] = 0x1EBD; - t['etildebelow'] = 0x1E1B; - t['etnahtafoukhhebrew'] = 0x0591; - t['etnahtafoukhlefthebrew'] = 0x0591; - t['etnahtahebrew'] = 0x0591; - t['etnahtalefthebrew'] = 0x0591; - t['eturned'] = 0x01DD; - t['eukorean'] = 0x3161; - t['euro'] = 0x20AC; - t['evowelsignbengali'] = 0x09C7; - t['evowelsigndeva'] = 0x0947; - t['evowelsigngujarati'] = 0x0AC7; - t['exclam'] = 0x0021; - t['exclamarmenian'] = 0x055C; - t['exclamdbl'] = 0x203C; - t['exclamdown'] = 0x00A1; - t['exclamdownsmall'] = 0xF7A1; - t['exclammonospace'] = 0xFF01; - t['exclamsmall'] = 0xF721; - t['existential'] = 0x2203; - t['ezh'] = 0x0292; - t['ezhcaron'] = 0x01EF; - t['ezhcurl'] = 0x0293; - t['ezhreversed'] = 0x01B9; - t['ezhtail'] = 0x01BA; - t['f'] = 0x0066; - t['fadeva'] = 0x095E; - t['fagurmukhi'] = 0x0A5E; - t['fahrenheit'] = 0x2109; - t['fathaarabic'] = 0x064E; - t['fathalowarabic'] = 0x064E; - t['fathatanarabic'] = 0x064B; - t['fbopomofo'] = 0x3108; - t['fcircle'] = 0x24D5; - t['fdotaccent'] = 0x1E1F; - t['feharabic'] = 0x0641; - t['feharmenian'] = 0x0586; - t['fehfinalarabic'] = 0xFED2; - t['fehinitialarabic'] = 0xFED3; - t['fehmedialarabic'] = 0xFED4; - t['feicoptic'] = 0x03E5; - t['female'] = 0x2640; - t['ff'] = 0xFB00; - t['ffi'] = 0xFB03; - t['ffl'] = 0xFB04; - t['fi'] = 0xFB01; - t['fifteencircle'] = 0x246E; - t['fifteenparen'] = 0x2482; - t['fifteenperiod'] = 0x2496; - t['figuredash'] = 0x2012; - t['filledbox'] = 0x25A0; - t['filledrect'] = 0x25AC; - t['finalkaf'] = 0x05DA; - t['finalkafdagesh'] = 0xFB3A; - t['finalkafdageshhebrew'] = 0xFB3A; - t['finalkafhebrew'] = 0x05DA; - t['finalmem'] = 0x05DD; - t['finalmemhebrew'] = 0x05DD; - t['finalnun'] = 0x05DF; - t['finalnunhebrew'] = 0x05DF; - t['finalpe'] = 0x05E3; - t['finalpehebrew'] = 0x05E3; - t['finaltsadi'] = 0x05E5; - t['finaltsadihebrew'] = 0x05E5; - t['firsttonechinese'] = 0x02C9; - t['fisheye'] = 0x25C9; - t['fitacyrillic'] = 0x0473; - t['five'] = 0x0035; - t['fivearabic'] = 0x0665; - t['fivebengali'] = 0x09EB; - t['fivecircle'] = 0x2464; - t['fivecircleinversesansserif'] = 0x278E; - t['fivedeva'] = 0x096B; - t['fiveeighths'] = 0x215D; - t['fivegujarati'] = 0x0AEB; - t['fivegurmukhi'] = 0x0A6B; - t['fivehackarabic'] = 0x0665; - t['fivehangzhou'] = 0x3025; - t['fiveideographicparen'] = 0x3224; - t['fiveinferior'] = 0x2085; - t['fivemonospace'] = 0xFF15; - t['fiveoldstyle'] = 0xF735; - t['fiveparen'] = 0x2478; - t['fiveperiod'] = 0x248C; - t['fivepersian'] = 0x06F5; - t['fiveroman'] = 0x2174; - t['fivesuperior'] = 0x2075; - t['fivethai'] = 0x0E55; - t['fl'] = 0xFB02; - t['florin'] = 0x0192; - t['fmonospace'] = 0xFF46; - t['fmsquare'] = 0x3399; - t['fofanthai'] = 0x0E1F; - t['fofathai'] = 0x0E1D; - t['fongmanthai'] = 0x0E4F; - t['forall'] = 0x2200; - t['four'] = 0x0034; - t['fourarabic'] = 0x0664; - t['fourbengali'] = 0x09EA; - t['fourcircle'] = 0x2463; - t['fourcircleinversesansserif'] = 0x278D; - t['fourdeva'] = 0x096A; - t['fourgujarati'] = 0x0AEA; - t['fourgurmukhi'] = 0x0A6A; - t['fourhackarabic'] = 0x0664; - t['fourhangzhou'] = 0x3024; - t['fourideographicparen'] = 0x3223; - t['fourinferior'] = 0x2084; - t['fourmonospace'] = 0xFF14; - t['fournumeratorbengali'] = 0x09F7; - t['fouroldstyle'] = 0xF734; - t['fourparen'] = 0x2477; - t['fourperiod'] = 0x248B; - t['fourpersian'] = 0x06F4; - t['fourroman'] = 0x2173; - t['foursuperior'] = 0x2074; - t['fourteencircle'] = 0x246D; - t['fourteenparen'] = 0x2481; - t['fourteenperiod'] = 0x2495; - t['fourthai'] = 0x0E54; - t['fourthtonechinese'] = 0x02CB; - t['fparen'] = 0x24A1; - t['fraction'] = 0x2044; - t['franc'] = 0x20A3; - t['g'] = 0x0067; - t['gabengali'] = 0x0997; - t['gacute'] = 0x01F5; - t['gadeva'] = 0x0917; - t['gafarabic'] = 0x06AF; - t['gaffinalarabic'] = 0xFB93; - t['gafinitialarabic'] = 0xFB94; - t['gafmedialarabic'] = 0xFB95; - t['gagujarati'] = 0x0A97; - t['gagurmukhi'] = 0x0A17; - t['gahiragana'] = 0x304C; - t['gakatakana'] = 0x30AC; - t['gamma'] = 0x03B3; - t['gammalatinsmall'] = 0x0263; - t['gammasuperior'] = 0x02E0; - t['gangiacoptic'] = 0x03EB; - t['gbopomofo'] = 0x310D; - t['gbreve'] = 0x011F; - t['gcaron'] = 0x01E7; - t['gcedilla'] = 0x0123; - t['gcircle'] = 0x24D6; - t['gcircumflex'] = 0x011D; - t['gcommaaccent'] = 0x0123; - t['gdot'] = 0x0121; - t['gdotaccent'] = 0x0121; - t['gecyrillic'] = 0x0433; - t['gehiragana'] = 0x3052; - t['gekatakana'] = 0x30B2; - t['geometricallyequal'] = 0x2251; - t['gereshaccenthebrew'] = 0x059C; - t['gereshhebrew'] = 0x05F3; - t['gereshmuqdamhebrew'] = 0x059D; - t['germandbls'] = 0x00DF; - t['gershayimaccenthebrew'] = 0x059E; - t['gershayimhebrew'] = 0x05F4; - t['getamark'] = 0x3013; - t['ghabengali'] = 0x0998; - t['ghadarmenian'] = 0x0572; - t['ghadeva'] = 0x0918; - t['ghagujarati'] = 0x0A98; - t['ghagurmukhi'] = 0x0A18; - t['ghainarabic'] = 0x063A; - t['ghainfinalarabic'] = 0xFECE; - t['ghaininitialarabic'] = 0xFECF; - t['ghainmedialarabic'] = 0xFED0; - t['ghemiddlehookcyrillic'] = 0x0495; - t['ghestrokecyrillic'] = 0x0493; - t['gheupturncyrillic'] = 0x0491; - t['ghhadeva'] = 0x095A; - t['ghhagurmukhi'] = 0x0A5A; - t['ghook'] = 0x0260; - t['ghzsquare'] = 0x3393; - t['gihiragana'] = 0x304E; - t['gikatakana'] = 0x30AE; - t['gimarmenian'] = 0x0563; - t['gimel'] = 0x05D2; - t['gimeldagesh'] = 0xFB32; - t['gimeldageshhebrew'] = 0xFB32; - t['gimelhebrew'] = 0x05D2; - t['gjecyrillic'] = 0x0453; - t['glottalinvertedstroke'] = 0x01BE; - t['glottalstop'] = 0x0294; - t['glottalstopinverted'] = 0x0296; - t['glottalstopmod'] = 0x02C0; - t['glottalstopreversed'] = 0x0295; - t['glottalstopreversedmod'] = 0x02C1; - t['glottalstopreversedsuperior'] = 0x02E4; - t['glottalstopstroke'] = 0x02A1; - t['glottalstopstrokereversed'] = 0x02A2; - t['gmacron'] = 0x1E21; - t['gmonospace'] = 0xFF47; - t['gohiragana'] = 0x3054; - t['gokatakana'] = 0x30B4; - t['gparen'] = 0x24A2; - t['gpasquare'] = 0x33AC; - t['gradient'] = 0x2207; - t['grave'] = 0x0060; - t['gravebelowcmb'] = 0x0316; - t['gravecmb'] = 0x0300; - t['gravecomb'] = 0x0300; - t['gravedeva'] = 0x0953; - t['gravelowmod'] = 0x02CE; - t['gravemonospace'] = 0xFF40; - t['gravetonecmb'] = 0x0340; - t['greater'] = 0x003E; - t['greaterequal'] = 0x2265; - t['greaterequalorless'] = 0x22DB; - t['greatermonospace'] = 0xFF1E; - t['greaterorequivalent'] = 0x2273; - t['greaterorless'] = 0x2277; - t['greateroverequal'] = 0x2267; - t['greatersmall'] = 0xFE65; - t['gscript'] = 0x0261; - t['gstroke'] = 0x01E5; - t['guhiragana'] = 0x3050; - t['guillemotleft'] = 0x00AB; - t['guillemotright'] = 0x00BB; - t['guilsinglleft'] = 0x2039; - t['guilsinglright'] = 0x203A; - t['gukatakana'] = 0x30B0; - t['guramusquare'] = 0x3318; - t['gysquare'] = 0x33C9; - t['h'] = 0x0068; - t['haabkhasiancyrillic'] = 0x04A9; - t['haaltonearabic'] = 0x06C1; - t['habengali'] = 0x09B9; - t['hadescendercyrillic'] = 0x04B3; - t['hadeva'] = 0x0939; - t['hagujarati'] = 0x0AB9; - t['hagurmukhi'] = 0x0A39; - t['haharabic'] = 0x062D; - t['hahfinalarabic'] = 0xFEA2; - t['hahinitialarabic'] = 0xFEA3; - t['hahiragana'] = 0x306F; - t['hahmedialarabic'] = 0xFEA4; - t['haitusquare'] = 0x332A; - t['hakatakana'] = 0x30CF; - t['hakatakanahalfwidth'] = 0xFF8A; - t['halantgurmukhi'] = 0x0A4D; - t['hamzaarabic'] = 0x0621; - t['hamzalowarabic'] = 0x0621; - t['hangulfiller'] = 0x3164; - t['hardsigncyrillic'] = 0x044A; - t['harpoonleftbarbup'] = 0x21BC; - t['harpoonrightbarbup'] = 0x21C0; - t['hasquare'] = 0x33CA; - t['hatafpatah'] = 0x05B2; - t['hatafpatah16'] = 0x05B2; - t['hatafpatah23'] = 0x05B2; - t['hatafpatah2f'] = 0x05B2; - t['hatafpatahhebrew'] = 0x05B2; - t['hatafpatahnarrowhebrew'] = 0x05B2; - t['hatafpatahquarterhebrew'] = 0x05B2; - t['hatafpatahwidehebrew'] = 0x05B2; - t['hatafqamats'] = 0x05B3; - t['hatafqamats1b'] = 0x05B3; - t['hatafqamats28'] = 0x05B3; - t['hatafqamats34'] = 0x05B3; - t['hatafqamatshebrew'] = 0x05B3; - t['hatafqamatsnarrowhebrew'] = 0x05B3; - t['hatafqamatsquarterhebrew'] = 0x05B3; - t['hatafqamatswidehebrew'] = 0x05B3; - t['hatafsegol'] = 0x05B1; - t['hatafsegol17'] = 0x05B1; - t['hatafsegol24'] = 0x05B1; - t['hatafsegol30'] = 0x05B1; - t['hatafsegolhebrew'] = 0x05B1; - t['hatafsegolnarrowhebrew'] = 0x05B1; - t['hatafsegolquarterhebrew'] = 0x05B1; - t['hatafsegolwidehebrew'] = 0x05B1; - t['hbar'] = 0x0127; - t['hbopomofo'] = 0x310F; - t['hbrevebelow'] = 0x1E2B; - t['hcedilla'] = 0x1E29; - t['hcircle'] = 0x24D7; - t['hcircumflex'] = 0x0125; - t['hdieresis'] = 0x1E27; - t['hdotaccent'] = 0x1E23; - t['hdotbelow'] = 0x1E25; - t['he'] = 0x05D4; - t['heart'] = 0x2665; - t['heartsuitblack'] = 0x2665; - t['heartsuitwhite'] = 0x2661; - t['hedagesh'] = 0xFB34; - t['hedageshhebrew'] = 0xFB34; - t['hehaltonearabic'] = 0x06C1; - t['heharabic'] = 0x0647; - t['hehebrew'] = 0x05D4; - t['hehfinalaltonearabic'] = 0xFBA7; - t['hehfinalalttwoarabic'] = 0xFEEA; - t['hehfinalarabic'] = 0xFEEA; - t['hehhamzaabovefinalarabic'] = 0xFBA5; - t['hehhamzaaboveisolatedarabic'] = 0xFBA4; - t['hehinitialaltonearabic'] = 0xFBA8; - t['hehinitialarabic'] = 0xFEEB; - t['hehiragana'] = 0x3078; - t['hehmedialaltonearabic'] = 0xFBA9; - t['hehmedialarabic'] = 0xFEEC; - t['heiseierasquare'] = 0x337B; - t['hekatakana'] = 0x30D8; - t['hekatakanahalfwidth'] = 0xFF8D; - t['hekutaarusquare'] = 0x3336; - t['henghook'] = 0x0267; - t['herutusquare'] = 0x3339; - t['het'] = 0x05D7; - t['hethebrew'] = 0x05D7; - t['hhook'] = 0x0266; - t['hhooksuperior'] = 0x02B1; - t['hieuhacirclekorean'] = 0x327B; - t['hieuhaparenkorean'] = 0x321B; - t['hieuhcirclekorean'] = 0x326D; - t['hieuhkorean'] = 0x314E; - t['hieuhparenkorean'] = 0x320D; - t['hihiragana'] = 0x3072; - t['hikatakana'] = 0x30D2; - t['hikatakanahalfwidth'] = 0xFF8B; - t['hiriq'] = 0x05B4; - t['hiriq14'] = 0x05B4; - t['hiriq21'] = 0x05B4; - t['hiriq2d'] = 0x05B4; - t['hiriqhebrew'] = 0x05B4; - t['hiriqnarrowhebrew'] = 0x05B4; - t['hiriqquarterhebrew'] = 0x05B4; - t['hiriqwidehebrew'] = 0x05B4; - t['hlinebelow'] = 0x1E96; - t['hmonospace'] = 0xFF48; - t['hoarmenian'] = 0x0570; - t['hohipthai'] = 0x0E2B; - t['hohiragana'] = 0x307B; - t['hokatakana'] = 0x30DB; - t['hokatakanahalfwidth'] = 0xFF8E; - t['holam'] = 0x05B9; - t['holam19'] = 0x05B9; - t['holam26'] = 0x05B9; - t['holam32'] = 0x05B9; - t['holamhebrew'] = 0x05B9; - t['holamnarrowhebrew'] = 0x05B9; - t['holamquarterhebrew'] = 0x05B9; - t['holamwidehebrew'] = 0x05B9; - t['honokhukthai'] = 0x0E2E; - t['hookabovecomb'] = 0x0309; - t['hookcmb'] = 0x0309; - t['hookpalatalizedbelowcmb'] = 0x0321; - t['hookretroflexbelowcmb'] = 0x0322; - t['hoonsquare'] = 0x3342; - t['horicoptic'] = 0x03E9; - t['horizontalbar'] = 0x2015; - t['horncmb'] = 0x031B; - t['hotsprings'] = 0x2668; - t['house'] = 0x2302; - t['hparen'] = 0x24A3; - t['hsuperior'] = 0x02B0; - t['hturned'] = 0x0265; - t['huhiragana'] = 0x3075; - t['huiitosquare'] = 0x3333; - t['hukatakana'] = 0x30D5; - t['hukatakanahalfwidth'] = 0xFF8C; - t['hungarumlaut'] = 0x02DD; - t['hungarumlautcmb'] = 0x030B; - t['hv'] = 0x0195; - t['hyphen'] = 0x002D; - t['hypheninferior'] = 0xF6E5; - t['hyphenmonospace'] = 0xFF0D; - t['hyphensmall'] = 0xFE63; - t['hyphensuperior'] = 0xF6E6; - t['hyphentwo'] = 0x2010; - t['i'] = 0x0069; - t['iacute'] = 0x00ED; - t['iacyrillic'] = 0x044F; - t['ibengali'] = 0x0987; - t['ibopomofo'] = 0x3127; - t['ibreve'] = 0x012D; - t['icaron'] = 0x01D0; - t['icircle'] = 0x24D8; - t['icircumflex'] = 0x00EE; - t['icyrillic'] = 0x0456; - t['idblgrave'] = 0x0209; - t['ideographearthcircle'] = 0x328F; - t['ideographfirecircle'] = 0x328B; - t['ideographicallianceparen'] = 0x323F; - t['ideographiccallparen'] = 0x323A; - t['ideographiccentrecircle'] = 0x32A5; - t['ideographicclose'] = 0x3006; - t['ideographiccomma'] = 0x3001; - t['ideographiccommaleft'] = 0xFF64; - t['ideographiccongratulationparen'] = 0x3237; - t['ideographiccorrectcircle'] = 0x32A3; - t['ideographicearthparen'] = 0x322F; - t['ideographicenterpriseparen'] = 0x323D; - t['ideographicexcellentcircle'] = 0x329D; - t['ideographicfestivalparen'] = 0x3240; - t['ideographicfinancialcircle'] = 0x3296; - t['ideographicfinancialparen'] = 0x3236; - t['ideographicfireparen'] = 0x322B; - t['ideographichaveparen'] = 0x3232; - t['ideographichighcircle'] = 0x32A4; - t['ideographiciterationmark'] = 0x3005; - t['ideographiclaborcircle'] = 0x3298; - t['ideographiclaborparen'] = 0x3238; - t['ideographicleftcircle'] = 0x32A7; - t['ideographiclowcircle'] = 0x32A6; - t['ideographicmedicinecircle'] = 0x32A9; - t['ideographicmetalparen'] = 0x322E; - t['ideographicmoonparen'] = 0x322A; - t['ideographicnameparen'] = 0x3234; - t['ideographicperiod'] = 0x3002; - t['ideographicprintcircle'] = 0x329E; - t['ideographicreachparen'] = 0x3243; - t['ideographicrepresentparen'] = 0x3239; - t['ideographicresourceparen'] = 0x323E; - t['ideographicrightcircle'] = 0x32A8; - t['ideographicsecretcircle'] = 0x3299; - t['ideographicselfparen'] = 0x3242; - t['ideographicsocietyparen'] = 0x3233; - t['ideographicspace'] = 0x3000; - t['ideographicspecialparen'] = 0x3235; - t['ideographicstockparen'] = 0x3231; - t['ideographicstudyparen'] = 0x323B; - t['ideographicsunparen'] = 0x3230; - t['ideographicsuperviseparen'] = 0x323C; - t['ideographicwaterparen'] = 0x322C; - t['ideographicwoodparen'] = 0x322D; - t['ideographiczero'] = 0x3007; - t['ideographmetalcircle'] = 0x328E; - t['ideographmooncircle'] = 0x328A; - t['ideographnamecircle'] = 0x3294; - t['ideographsuncircle'] = 0x3290; - t['ideographwatercircle'] = 0x328C; - t['ideographwoodcircle'] = 0x328D; - t['ideva'] = 0x0907; - t['idieresis'] = 0x00EF; - t['idieresisacute'] = 0x1E2F; - t['idieresiscyrillic'] = 0x04E5; - t['idotbelow'] = 0x1ECB; - t['iebrevecyrillic'] = 0x04D7; - t['iecyrillic'] = 0x0435; - t['ieungacirclekorean'] = 0x3275; - t['ieungaparenkorean'] = 0x3215; - t['ieungcirclekorean'] = 0x3267; - t['ieungkorean'] = 0x3147; - t['ieungparenkorean'] = 0x3207; - t['igrave'] = 0x00EC; - t['igujarati'] = 0x0A87; - t['igurmukhi'] = 0x0A07; - t['ihiragana'] = 0x3044; - t['ihookabove'] = 0x1EC9; - t['iibengali'] = 0x0988; - t['iicyrillic'] = 0x0438; - t['iideva'] = 0x0908; - t['iigujarati'] = 0x0A88; - t['iigurmukhi'] = 0x0A08; - t['iimatragurmukhi'] = 0x0A40; - t['iinvertedbreve'] = 0x020B; - t['iishortcyrillic'] = 0x0439; - t['iivowelsignbengali'] = 0x09C0; - t['iivowelsigndeva'] = 0x0940; - t['iivowelsigngujarati'] = 0x0AC0; - t['ij'] = 0x0133; - t['ikatakana'] = 0x30A4; - t['ikatakanahalfwidth'] = 0xFF72; - t['ikorean'] = 0x3163; - t['ilde'] = 0x02DC; - t['iluyhebrew'] = 0x05AC; - t['imacron'] = 0x012B; - t['imacroncyrillic'] = 0x04E3; - t['imageorapproximatelyequal'] = 0x2253; - t['imatragurmukhi'] = 0x0A3F; - t['imonospace'] = 0xFF49; - t['increment'] = 0x2206; - t['infinity'] = 0x221E; - t['iniarmenian'] = 0x056B; - t['integral'] = 0x222B; - t['integralbottom'] = 0x2321; - t['integralbt'] = 0x2321; - t['integralex'] = 0xF8F5; - t['integraltop'] = 0x2320; - t['integraltp'] = 0x2320; - t['intersection'] = 0x2229; - t['intisquare'] = 0x3305; - t['invbullet'] = 0x25D8; - t['invcircle'] = 0x25D9; - t['invsmileface'] = 0x263B; - t['iocyrillic'] = 0x0451; - t['iogonek'] = 0x012F; - t['iota'] = 0x03B9; - t['iotadieresis'] = 0x03CA; - t['iotadieresistonos'] = 0x0390; - t['iotalatin'] = 0x0269; - t['iotatonos'] = 0x03AF; - t['iparen'] = 0x24A4; - t['irigurmukhi'] = 0x0A72; - t['ismallhiragana'] = 0x3043; - t['ismallkatakana'] = 0x30A3; - t['ismallkatakanahalfwidth'] = 0xFF68; - t['issharbengali'] = 0x09FA; - t['istroke'] = 0x0268; - t['isuperior'] = 0xF6ED; - t['iterationhiragana'] = 0x309D; - t['iterationkatakana'] = 0x30FD; - t['itilde'] = 0x0129; - t['itildebelow'] = 0x1E2D; - t['iubopomofo'] = 0x3129; - t['iucyrillic'] = 0x044E; - t['ivowelsignbengali'] = 0x09BF; - t['ivowelsigndeva'] = 0x093F; - t['ivowelsigngujarati'] = 0x0ABF; - t['izhitsacyrillic'] = 0x0475; - t['izhitsadblgravecyrillic'] = 0x0477; - t['j'] = 0x006A; - t['jaarmenian'] = 0x0571; - t['jabengali'] = 0x099C; - t['jadeva'] = 0x091C; - t['jagujarati'] = 0x0A9C; - t['jagurmukhi'] = 0x0A1C; - t['jbopomofo'] = 0x3110; - t['jcaron'] = 0x01F0; - t['jcircle'] = 0x24D9; - t['jcircumflex'] = 0x0135; - t['jcrossedtail'] = 0x029D; - t['jdotlessstroke'] = 0x025F; - t['jecyrillic'] = 0x0458; - t['jeemarabic'] = 0x062C; - t['jeemfinalarabic'] = 0xFE9E; - t['jeeminitialarabic'] = 0xFE9F; - t['jeemmedialarabic'] = 0xFEA0; - t['jeharabic'] = 0x0698; - t['jehfinalarabic'] = 0xFB8B; - t['jhabengali'] = 0x099D; - t['jhadeva'] = 0x091D; - t['jhagujarati'] = 0x0A9D; - t['jhagurmukhi'] = 0x0A1D; - t['jheharmenian'] = 0x057B; - t['jis'] = 0x3004; - t['jmonospace'] = 0xFF4A; - t['jparen'] = 0x24A5; - t['jsuperior'] = 0x02B2; - t['k'] = 0x006B; - t['kabashkircyrillic'] = 0x04A1; - t['kabengali'] = 0x0995; - t['kacute'] = 0x1E31; - t['kacyrillic'] = 0x043A; - t['kadescendercyrillic'] = 0x049B; - t['kadeva'] = 0x0915; - t['kaf'] = 0x05DB; - t['kafarabic'] = 0x0643; - t['kafdagesh'] = 0xFB3B; - t['kafdageshhebrew'] = 0xFB3B; - t['kaffinalarabic'] = 0xFEDA; - t['kafhebrew'] = 0x05DB; - t['kafinitialarabic'] = 0xFEDB; - t['kafmedialarabic'] = 0xFEDC; - t['kafrafehebrew'] = 0xFB4D; - t['kagujarati'] = 0x0A95; - t['kagurmukhi'] = 0x0A15; - t['kahiragana'] = 0x304B; - t['kahookcyrillic'] = 0x04C4; - t['kakatakana'] = 0x30AB; - t['kakatakanahalfwidth'] = 0xFF76; - t['kappa'] = 0x03BA; - t['kappasymbolgreek'] = 0x03F0; - t['kapyeounmieumkorean'] = 0x3171; - t['kapyeounphieuphkorean'] = 0x3184; - t['kapyeounpieupkorean'] = 0x3178; - t['kapyeounssangpieupkorean'] = 0x3179; - t['karoriisquare'] = 0x330D; - t['kashidaautoarabic'] = 0x0640; - t['kashidaautonosidebearingarabic'] = 0x0640; - t['kasmallkatakana'] = 0x30F5; - t['kasquare'] = 0x3384; - t['kasraarabic'] = 0x0650; - t['kasratanarabic'] = 0x064D; - t['kastrokecyrillic'] = 0x049F; - t['katahiraprolongmarkhalfwidth'] = 0xFF70; - t['kaverticalstrokecyrillic'] = 0x049D; - t['kbopomofo'] = 0x310E; - t['kcalsquare'] = 0x3389; - t['kcaron'] = 0x01E9; - t['kcedilla'] = 0x0137; - t['kcircle'] = 0x24DA; - t['kcommaaccent'] = 0x0137; - t['kdotbelow'] = 0x1E33; - t['keharmenian'] = 0x0584; - t['kehiragana'] = 0x3051; - t['kekatakana'] = 0x30B1; - t['kekatakanahalfwidth'] = 0xFF79; - t['kenarmenian'] = 0x056F; - t['kesmallkatakana'] = 0x30F6; - t['kgreenlandic'] = 0x0138; - t['khabengali'] = 0x0996; - t['khacyrillic'] = 0x0445; - t['khadeva'] = 0x0916; - t['khagujarati'] = 0x0A96; - t['khagurmukhi'] = 0x0A16; - t['khaharabic'] = 0x062E; - t['khahfinalarabic'] = 0xFEA6; - t['khahinitialarabic'] = 0xFEA7; - t['khahmedialarabic'] = 0xFEA8; - t['kheicoptic'] = 0x03E7; - t['khhadeva'] = 0x0959; - t['khhagurmukhi'] = 0x0A59; - t['khieukhacirclekorean'] = 0x3278; - t['khieukhaparenkorean'] = 0x3218; - t['khieukhcirclekorean'] = 0x326A; - t['khieukhkorean'] = 0x314B; - t['khieukhparenkorean'] = 0x320A; - t['khokhaithai'] = 0x0E02; - t['khokhonthai'] = 0x0E05; - t['khokhuatthai'] = 0x0E03; - t['khokhwaithai'] = 0x0E04; - t['khomutthai'] = 0x0E5B; - t['khook'] = 0x0199; - t['khorakhangthai'] = 0x0E06; - t['khzsquare'] = 0x3391; - t['kihiragana'] = 0x304D; - t['kikatakana'] = 0x30AD; - t['kikatakanahalfwidth'] = 0xFF77; - t['kiroguramusquare'] = 0x3315; - t['kiromeetorusquare'] = 0x3316; - t['kirosquare'] = 0x3314; - t['kiyeokacirclekorean'] = 0x326E; - t['kiyeokaparenkorean'] = 0x320E; - t['kiyeokcirclekorean'] = 0x3260; - t['kiyeokkorean'] = 0x3131; - t['kiyeokparenkorean'] = 0x3200; - t['kiyeoksioskorean'] = 0x3133; - t['kjecyrillic'] = 0x045C; - t['klinebelow'] = 0x1E35; - t['klsquare'] = 0x3398; - t['kmcubedsquare'] = 0x33A6; - t['kmonospace'] = 0xFF4B; - t['kmsquaredsquare'] = 0x33A2; - t['kohiragana'] = 0x3053; - t['kohmsquare'] = 0x33C0; - t['kokaithai'] = 0x0E01; - t['kokatakana'] = 0x30B3; - t['kokatakanahalfwidth'] = 0xFF7A; - t['kooposquare'] = 0x331E; - t['koppacyrillic'] = 0x0481; - t['koreanstandardsymbol'] = 0x327F; - t['koroniscmb'] = 0x0343; - t['kparen'] = 0x24A6; - t['kpasquare'] = 0x33AA; - t['ksicyrillic'] = 0x046F; - t['ktsquare'] = 0x33CF; - t['kturned'] = 0x029E; - t['kuhiragana'] = 0x304F; - t['kukatakana'] = 0x30AF; - t['kukatakanahalfwidth'] = 0xFF78; - t['kvsquare'] = 0x33B8; - t['kwsquare'] = 0x33BE; - t['l'] = 0x006C; - t['labengali'] = 0x09B2; - t['lacute'] = 0x013A; - t['ladeva'] = 0x0932; - t['lagujarati'] = 0x0AB2; - t['lagurmukhi'] = 0x0A32; - t['lakkhangyaothai'] = 0x0E45; - t['lamaleffinalarabic'] = 0xFEFC; - t['lamalefhamzaabovefinalarabic'] = 0xFEF8; - t['lamalefhamzaaboveisolatedarabic'] = 0xFEF7; - t['lamalefhamzabelowfinalarabic'] = 0xFEFA; - t['lamalefhamzabelowisolatedarabic'] = 0xFEF9; - t['lamalefisolatedarabic'] = 0xFEFB; - t['lamalefmaddaabovefinalarabic'] = 0xFEF6; - t['lamalefmaddaaboveisolatedarabic'] = 0xFEF5; - t['lamarabic'] = 0x0644; - t['lambda'] = 0x03BB; - t['lambdastroke'] = 0x019B; - t['lamed'] = 0x05DC; - t['lameddagesh'] = 0xFB3C; - t['lameddageshhebrew'] = 0xFB3C; - t['lamedhebrew'] = 0x05DC; - t['lamfinalarabic'] = 0xFEDE; - t['lamhahinitialarabic'] = 0xFCCA; - t['laminitialarabic'] = 0xFEDF; - t['lamjeeminitialarabic'] = 0xFCC9; - t['lamkhahinitialarabic'] = 0xFCCB; - t['lamlamhehisolatedarabic'] = 0xFDF2; - t['lammedialarabic'] = 0xFEE0; - t['lammeemhahinitialarabic'] = 0xFD88; - t['lammeeminitialarabic'] = 0xFCCC; - t['largecircle'] = 0x25EF; - t['lbar'] = 0x019A; - t['lbelt'] = 0x026C; - t['lbopomofo'] = 0x310C; - t['lcaron'] = 0x013E; - t['lcedilla'] = 0x013C; - t['lcircle'] = 0x24DB; - t['lcircumflexbelow'] = 0x1E3D; - t['lcommaaccent'] = 0x013C; - t['ldot'] = 0x0140; - t['ldotaccent'] = 0x0140; - t['ldotbelow'] = 0x1E37; - t['ldotbelowmacron'] = 0x1E39; - t['leftangleabovecmb'] = 0x031A; - t['lefttackbelowcmb'] = 0x0318; - t['less'] = 0x003C; - t['lessequal'] = 0x2264; - t['lessequalorgreater'] = 0x22DA; - t['lessmonospace'] = 0xFF1C; - t['lessorequivalent'] = 0x2272; - t['lessorgreater'] = 0x2276; - t['lessoverequal'] = 0x2266; - t['lesssmall'] = 0xFE64; - t['lezh'] = 0x026E; - t['lfblock'] = 0x258C; - t['lhookretroflex'] = 0x026D; - t['lira'] = 0x20A4; - t['liwnarmenian'] = 0x056C; - t['lj'] = 0x01C9; - t['ljecyrillic'] = 0x0459; - t['ll'] = 0xF6C0; - t['lladeva'] = 0x0933; - t['llagujarati'] = 0x0AB3; - t['llinebelow'] = 0x1E3B; - t['llladeva'] = 0x0934; - t['llvocalicbengali'] = 0x09E1; - t['llvocalicdeva'] = 0x0961; - t['llvocalicvowelsignbengali'] = 0x09E3; - t['llvocalicvowelsigndeva'] = 0x0963; - t['lmiddletilde'] = 0x026B; - t['lmonospace'] = 0xFF4C; - t['lmsquare'] = 0x33D0; - t['lochulathai'] = 0x0E2C; - t['logicaland'] = 0x2227; - t['logicalnot'] = 0x00AC; - t['logicalnotreversed'] = 0x2310; - t['logicalor'] = 0x2228; - t['lolingthai'] = 0x0E25; - t['longs'] = 0x017F; - t['lowlinecenterline'] = 0xFE4E; - t['lowlinecmb'] = 0x0332; - t['lowlinedashed'] = 0xFE4D; - t['lozenge'] = 0x25CA; - t['lparen'] = 0x24A7; - t['lslash'] = 0x0142; - t['lsquare'] = 0x2113; - t['lsuperior'] = 0xF6EE; - t['ltshade'] = 0x2591; - t['luthai'] = 0x0E26; - t['lvocalicbengali'] = 0x098C; - t['lvocalicdeva'] = 0x090C; - t['lvocalicvowelsignbengali'] = 0x09E2; - t['lvocalicvowelsigndeva'] = 0x0962; - t['lxsquare'] = 0x33D3; - t['m'] = 0x006D; - t['mabengali'] = 0x09AE; - t['macron'] = 0x00AF; - t['macronbelowcmb'] = 0x0331; - t['macroncmb'] = 0x0304; - t['macronlowmod'] = 0x02CD; - t['macronmonospace'] = 0xFFE3; - t['macute'] = 0x1E3F; - t['madeva'] = 0x092E; - t['magujarati'] = 0x0AAE; - t['magurmukhi'] = 0x0A2E; - t['mahapakhhebrew'] = 0x05A4; - t['mahapakhlefthebrew'] = 0x05A4; - t['mahiragana'] = 0x307E; - t['maichattawalowleftthai'] = 0xF895; - t['maichattawalowrightthai'] = 0xF894; - t['maichattawathai'] = 0x0E4B; - t['maichattawaupperleftthai'] = 0xF893; - t['maieklowleftthai'] = 0xF88C; - t['maieklowrightthai'] = 0xF88B; - t['maiekthai'] = 0x0E48; - t['maiekupperleftthai'] = 0xF88A; - t['maihanakatleftthai'] = 0xF884; - t['maihanakatthai'] = 0x0E31; - t['maitaikhuleftthai'] = 0xF889; - t['maitaikhuthai'] = 0x0E47; - t['maitholowleftthai'] = 0xF88F; - t['maitholowrightthai'] = 0xF88E; - t['maithothai'] = 0x0E49; - t['maithoupperleftthai'] = 0xF88D; - t['maitrilowleftthai'] = 0xF892; - t['maitrilowrightthai'] = 0xF891; - t['maitrithai'] = 0x0E4A; - t['maitriupperleftthai'] = 0xF890; - t['maiyamokthai'] = 0x0E46; - t['makatakana'] = 0x30DE; - t['makatakanahalfwidth'] = 0xFF8F; - t['male'] = 0x2642; - t['mansyonsquare'] = 0x3347; - t['maqafhebrew'] = 0x05BE; - t['mars'] = 0x2642; - t['masoracirclehebrew'] = 0x05AF; - t['masquare'] = 0x3383; - t['mbopomofo'] = 0x3107; - t['mbsquare'] = 0x33D4; - t['mcircle'] = 0x24DC; - t['mcubedsquare'] = 0x33A5; - t['mdotaccent'] = 0x1E41; - t['mdotbelow'] = 0x1E43; - t['meemarabic'] = 0x0645; - t['meemfinalarabic'] = 0xFEE2; - t['meeminitialarabic'] = 0xFEE3; - t['meemmedialarabic'] = 0xFEE4; - t['meemmeeminitialarabic'] = 0xFCD1; - t['meemmeemisolatedarabic'] = 0xFC48; - t['meetorusquare'] = 0x334D; - t['mehiragana'] = 0x3081; - t['meizierasquare'] = 0x337E; - t['mekatakana'] = 0x30E1; - t['mekatakanahalfwidth'] = 0xFF92; - t['mem'] = 0x05DE; - t['memdagesh'] = 0xFB3E; - t['memdageshhebrew'] = 0xFB3E; - t['memhebrew'] = 0x05DE; - t['menarmenian'] = 0x0574; - t['merkhahebrew'] = 0x05A5; - t['merkhakefulahebrew'] = 0x05A6; - t['merkhakefulalefthebrew'] = 0x05A6; - t['merkhalefthebrew'] = 0x05A5; - t['mhook'] = 0x0271; - t['mhzsquare'] = 0x3392; - t['middledotkatakanahalfwidth'] = 0xFF65; - t['middot'] = 0x00B7; - t['mieumacirclekorean'] = 0x3272; - t['mieumaparenkorean'] = 0x3212; - t['mieumcirclekorean'] = 0x3264; - t['mieumkorean'] = 0x3141; - t['mieumpansioskorean'] = 0x3170; - t['mieumparenkorean'] = 0x3204; - t['mieumpieupkorean'] = 0x316E; - t['mieumsioskorean'] = 0x316F; - t['mihiragana'] = 0x307F; - t['mikatakana'] = 0x30DF; - t['mikatakanahalfwidth'] = 0xFF90; - t['minus'] = 0x2212; - t['minusbelowcmb'] = 0x0320; - t['minuscircle'] = 0x2296; - t['minusmod'] = 0x02D7; - t['minusplus'] = 0x2213; - t['minute'] = 0x2032; - t['miribaarusquare'] = 0x334A; - t['mirisquare'] = 0x3349; - t['mlonglegturned'] = 0x0270; - t['mlsquare'] = 0x3396; - t['mmcubedsquare'] = 0x33A3; - t['mmonospace'] = 0xFF4D; - t['mmsquaredsquare'] = 0x339F; - t['mohiragana'] = 0x3082; - t['mohmsquare'] = 0x33C1; - t['mokatakana'] = 0x30E2; - t['mokatakanahalfwidth'] = 0xFF93; - t['molsquare'] = 0x33D6; - t['momathai'] = 0x0E21; - t['moverssquare'] = 0x33A7; - t['moverssquaredsquare'] = 0x33A8; - t['mparen'] = 0x24A8; - t['mpasquare'] = 0x33AB; - t['mssquare'] = 0x33B3; - t['msuperior'] = 0xF6EF; - t['mturned'] = 0x026F; - t['mu'] = 0x00B5; - t['mu1'] = 0x00B5; - t['muasquare'] = 0x3382; - t['muchgreater'] = 0x226B; - t['muchless'] = 0x226A; - t['mufsquare'] = 0x338C; - t['mugreek'] = 0x03BC; - t['mugsquare'] = 0x338D; - t['muhiragana'] = 0x3080; - t['mukatakana'] = 0x30E0; - t['mukatakanahalfwidth'] = 0xFF91; - t['mulsquare'] = 0x3395; - t['multiply'] = 0x00D7; - t['mumsquare'] = 0x339B; - t['munahhebrew'] = 0x05A3; - t['munahlefthebrew'] = 0x05A3; - t['musicalnote'] = 0x266A; - t['musicalnotedbl'] = 0x266B; - t['musicflatsign'] = 0x266D; - t['musicsharpsign'] = 0x266F; - t['mussquare'] = 0x33B2; - t['muvsquare'] = 0x33B6; - t['muwsquare'] = 0x33BC; - t['mvmegasquare'] = 0x33B9; - t['mvsquare'] = 0x33B7; - t['mwmegasquare'] = 0x33BF; - t['mwsquare'] = 0x33BD; - t['n'] = 0x006E; - t['nabengali'] = 0x09A8; - t['nabla'] = 0x2207; - t['nacute'] = 0x0144; - t['nadeva'] = 0x0928; - t['nagujarati'] = 0x0AA8; - t['nagurmukhi'] = 0x0A28; - t['nahiragana'] = 0x306A; - t['nakatakana'] = 0x30CA; - t['nakatakanahalfwidth'] = 0xFF85; - t['napostrophe'] = 0x0149; - t['nasquare'] = 0x3381; - t['nbopomofo'] = 0x310B; - t['nbspace'] = 0x00A0; - t['ncaron'] = 0x0148; - t['ncedilla'] = 0x0146; - t['ncircle'] = 0x24DD; - t['ncircumflexbelow'] = 0x1E4B; - t['ncommaaccent'] = 0x0146; - t['ndotaccent'] = 0x1E45; - t['ndotbelow'] = 0x1E47; - t['nehiragana'] = 0x306D; - t['nekatakana'] = 0x30CD; - t['nekatakanahalfwidth'] = 0xFF88; - t['newsheqelsign'] = 0x20AA; - t['nfsquare'] = 0x338B; - t['ngabengali'] = 0x0999; - t['ngadeva'] = 0x0919; - t['ngagujarati'] = 0x0A99; - t['ngagurmukhi'] = 0x0A19; - t['ngonguthai'] = 0x0E07; - t['nhiragana'] = 0x3093; - t['nhookleft'] = 0x0272; - t['nhookretroflex'] = 0x0273; - t['nieunacirclekorean'] = 0x326F; - t['nieunaparenkorean'] = 0x320F; - t['nieuncieuckorean'] = 0x3135; - t['nieuncirclekorean'] = 0x3261; - t['nieunhieuhkorean'] = 0x3136; - t['nieunkorean'] = 0x3134; - t['nieunpansioskorean'] = 0x3168; - t['nieunparenkorean'] = 0x3201; - t['nieunsioskorean'] = 0x3167; - t['nieuntikeutkorean'] = 0x3166; - t['nihiragana'] = 0x306B; - t['nikatakana'] = 0x30CB; - t['nikatakanahalfwidth'] = 0xFF86; - t['nikhahitleftthai'] = 0xF899; - t['nikhahitthai'] = 0x0E4D; - t['nine'] = 0x0039; - t['ninearabic'] = 0x0669; - t['ninebengali'] = 0x09EF; - t['ninecircle'] = 0x2468; - t['ninecircleinversesansserif'] = 0x2792; - t['ninedeva'] = 0x096F; - t['ninegujarati'] = 0x0AEF; - t['ninegurmukhi'] = 0x0A6F; - t['ninehackarabic'] = 0x0669; - t['ninehangzhou'] = 0x3029; - t['nineideographicparen'] = 0x3228; - t['nineinferior'] = 0x2089; - t['ninemonospace'] = 0xFF19; - t['nineoldstyle'] = 0xF739; - t['nineparen'] = 0x247C; - t['nineperiod'] = 0x2490; - t['ninepersian'] = 0x06F9; - t['nineroman'] = 0x2178; - t['ninesuperior'] = 0x2079; - t['nineteencircle'] = 0x2472; - t['nineteenparen'] = 0x2486; - t['nineteenperiod'] = 0x249A; - t['ninethai'] = 0x0E59; - t['nj'] = 0x01CC; - t['njecyrillic'] = 0x045A; - t['nkatakana'] = 0x30F3; - t['nkatakanahalfwidth'] = 0xFF9D; - t['nlegrightlong'] = 0x019E; - t['nlinebelow'] = 0x1E49; - t['nmonospace'] = 0xFF4E; - t['nmsquare'] = 0x339A; - t['nnabengali'] = 0x09A3; - t['nnadeva'] = 0x0923; - t['nnagujarati'] = 0x0AA3; - t['nnagurmukhi'] = 0x0A23; - t['nnnadeva'] = 0x0929; - t['nohiragana'] = 0x306E; - t['nokatakana'] = 0x30CE; - t['nokatakanahalfwidth'] = 0xFF89; - t['nonbreakingspace'] = 0x00A0; - t['nonenthai'] = 0x0E13; - t['nonuthai'] = 0x0E19; - t['noonarabic'] = 0x0646; - t['noonfinalarabic'] = 0xFEE6; - t['noonghunnaarabic'] = 0x06BA; - t['noonghunnafinalarabic'] = 0xFB9F; - t['nooninitialarabic'] = 0xFEE7; - t['noonjeeminitialarabic'] = 0xFCD2; - t['noonjeemisolatedarabic'] = 0xFC4B; - t['noonmedialarabic'] = 0xFEE8; - t['noonmeeminitialarabic'] = 0xFCD5; - t['noonmeemisolatedarabic'] = 0xFC4E; - t['noonnoonfinalarabic'] = 0xFC8D; - t['notcontains'] = 0x220C; - t['notelement'] = 0x2209; - t['notelementof'] = 0x2209; - t['notequal'] = 0x2260; - t['notgreater'] = 0x226F; - t['notgreaternorequal'] = 0x2271; - t['notgreaternorless'] = 0x2279; - t['notidentical'] = 0x2262; - t['notless'] = 0x226E; - t['notlessnorequal'] = 0x2270; - t['notparallel'] = 0x2226; - t['notprecedes'] = 0x2280; - t['notsubset'] = 0x2284; - t['notsucceeds'] = 0x2281; - t['notsuperset'] = 0x2285; - t['nowarmenian'] = 0x0576; - t['nparen'] = 0x24A9; - t['nssquare'] = 0x33B1; - t['nsuperior'] = 0x207F; - t['ntilde'] = 0x00F1; - t['nu'] = 0x03BD; - t['nuhiragana'] = 0x306C; - t['nukatakana'] = 0x30CC; - t['nukatakanahalfwidth'] = 0xFF87; - t['nuktabengali'] = 0x09BC; - t['nuktadeva'] = 0x093C; - t['nuktagujarati'] = 0x0ABC; - t['nuktagurmukhi'] = 0x0A3C; - t['numbersign'] = 0x0023; - t['numbersignmonospace'] = 0xFF03; - t['numbersignsmall'] = 0xFE5F; - t['numeralsigngreek'] = 0x0374; - t['numeralsignlowergreek'] = 0x0375; - t['numero'] = 0x2116; - t['nun'] = 0x05E0; - t['nundagesh'] = 0xFB40; - t['nundageshhebrew'] = 0xFB40; - t['nunhebrew'] = 0x05E0; - t['nvsquare'] = 0x33B5; - t['nwsquare'] = 0x33BB; - t['nyabengali'] = 0x099E; - t['nyadeva'] = 0x091E; - t['nyagujarati'] = 0x0A9E; - t['nyagurmukhi'] = 0x0A1E; - t['o'] = 0x006F; - t['oacute'] = 0x00F3; - t['oangthai'] = 0x0E2D; - t['obarred'] = 0x0275; - t['obarredcyrillic'] = 0x04E9; - t['obarreddieresiscyrillic'] = 0x04EB; - t['obengali'] = 0x0993; - t['obopomofo'] = 0x311B; - t['obreve'] = 0x014F; - t['ocandradeva'] = 0x0911; - t['ocandragujarati'] = 0x0A91; - t['ocandravowelsigndeva'] = 0x0949; - t['ocandravowelsigngujarati'] = 0x0AC9; - t['ocaron'] = 0x01D2; - t['ocircle'] = 0x24DE; - t['ocircumflex'] = 0x00F4; - t['ocircumflexacute'] = 0x1ED1; - t['ocircumflexdotbelow'] = 0x1ED9; - t['ocircumflexgrave'] = 0x1ED3; - t['ocircumflexhookabove'] = 0x1ED5; - t['ocircumflextilde'] = 0x1ED7; - t['ocyrillic'] = 0x043E; - t['odblacute'] = 0x0151; - t['odblgrave'] = 0x020D; - t['odeva'] = 0x0913; - t['odieresis'] = 0x00F6; - t['odieresiscyrillic'] = 0x04E7; - t['odotbelow'] = 0x1ECD; - t['oe'] = 0x0153; - t['oekorean'] = 0x315A; - t['ogonek'] = 0x02DB; - t['ogonekcmb'] = 0x0328; - t['ograve'] = 0x00F2; - t['ogujarati'] = 0x0A93; - t['oharmenian'] = 0x0585; - t['ohiragana'] = 0x304A; - t['ohookabove'] = 0x1ECF; - t['ohorn'] = 0x01A1; - t['ohornacute'] = 0x1EDB; - t['ohorndotbelow'] = 0x1EE3; - t['ohorngrave'] = 0x1EDD; - t['ohornhookabove'] = 0x1EDF; - t['ohorntilde'] = 0x1EE1; - t['ohungarumlaut'] = 0x0151; - t['oi'] = 0x01A3; - t['oinvertedbreve'] = 0x020F; - t['okatakana'] = 0x30AA; - t['okatakanahalfwidth'] = 0xFF75; - t['okorean'] = 0x3157; - t['olehebrew'] = 0x05AB; - t['omacron'] = 0x014D; - t['omacronacute'] = 0x1E53; - t['omacrongrave'] = 0x1E51; - t['omdeva'] = 0x0950; - t['omega'] = 0x03C9; - t['omega1'] = 0x03D6; - t['omegacyrillic'] = 0x0461; - t['omegalatinclosed'] = 0x0277; - t['omegaroundcyrillic'] = 0x047B; - t['omegatitlocyrillic'] = 0x047D; - t['omegatonos'] = 0x03CE; - t['omgujarati'] = 0x0AD0; - t['omicron'] = 0x03BF; - t['omicrontonos'] = 0x03CC; - t['omonospace'] = 0xFF4F; - t['one'] = 0x0031; - t['onearabic'] = 0x0661; - t['onebengali'] = 0x09E7; - t['onecircle'] = 0x2460; - t['onecircleinversesansserif'] = 0x278A; - t['onedeva'] = 0x0967; - t['onedotenleader'] = 0x2024; - t['oneeighth'] = 0x215B; - t['onefitted'] = 0xF6DC; - t['onegujarati'] = 0x0AE7; - t['onegurmukhi'] = 0x0A67; - t['onehackarabic'] = 0x0661; - t['onehalf'] = 0x00BD; - t['onehangzhou'] = 0x3021; - t['oneideographicparen'] = 0x3220; - t['oneinferior'] = 0x2081; - t['onemonospace'] = 0xFF11; - t['onenumeratorbengali'] = 0x09F4; - t['oneoldstyle'] = 0xF731; - t['oneparen'] = 0x2474; - t['oneperiod'] = 0x2488; - t['onepersian'] = 0x06F1; - t['onequarter'] = 0x00BC; - t['oneroman'] = 0x2170; - t['onesuperior'] = 0x00B9; - t['onethai'] = 0x0E51; - t['onethird'] = 0x2153; - t['oogonek'] = 0x01EB; - t['oogonekmacron'] = 0x01ED; - t['oogurmukhi'] = 0x0A13; - t['oomatragurmukhi'] = 0x0A4B; - t['oopen'] = 0x0254; - t['oparen'] = 0x24AA; - t['openbullet'] = 0x25E6; - t['option'] = 0x2325; - t['ordfeminine'] = 0x00AA; - t['ordmasculine'] = 0x00BA; - t['orthogonal'] = 0x221F; - t['oshortdeva'] = 0x0912; - t['oshortvowelsigndeva'] = 0x094A; - t['oslash'] = 0x00F8; - t['oslashacute'] = 0x01FF; - t['osmallhiragana'] = 0x3049; - t['osmallkatakana'] = 0x30A9; - t['osmallkatakanahalfwidth'] = 0xFF6B; - t['ostrokeacute'] = 0x01FF; - t['osuperior'] = 0xF6F0; - t['otcyrillic'] = 0x047F; - t['otilde'] = 0x00F5; - t['otildeacute'] = 0x1E4D; - t['otildedieresis'] = 0x1E4F; - t['oubopomofo'] = 0x3121; - t['overline'] = 0x203E; - t['overlinecenterline'] = 0xFE4A; - t['overlinecmb'] = 0x0305; - t['overlinedashed'] = 0xFE49; - t['overlinedblwavy'] = 0xFE4C; - t['overlinewavy'] = 0xFE4B; - t['overscore'] = 0x00AF; - t['ovowelsignbengali'] = 0x09CB; - t['ovowelsigndeva'] = 0x094B; - t['ovowelsigngujarati'] = 0x0ACB; - t['p'] = 0x0070; - t['paampssquare'] = 0x3380; - t['paasentosquare'] = 0x332B; - t['pabengali'] = 0x09AA; - t['pacute'] = 0x1E55; - t['padeva'] = 0x092A; - t['pagedown'] = 0x21DF; - t['pageup'] = 0x21DE; - t['pagujarati'] = 0x0AAA; - t['pagurmukhi'] = 0x0A2A; - t['pahiragana'] = 0x3071; - t['paiyannoithai'] = 0x0E2F; - t['pakatakana'] = 0x30D1; - t['palatalizationcyrilliccmb'] = 0x0484; - t['palochkacyrillic'] = 0x04C0; - t['pansioskorean'] = 0x317F; - t['paragraph'] = 0x00B6; - t['parallel'] = 0x2225; - t['parenleft'] = 0x0028; - t['parenleftaltonearabic'] = 0xFD3E; - t['parenleftbt'] = 0xF8ED; - t['parenleftex'] = 0xF8EC; - t['parenleftinferior'] = 0x208D; - t['parenleftmonospace'] = 0xFF08; - t['parenleftsmall'] = 0xFE59; - t['parenleftsuperior'] = 0x207D; - t['parenlefttp'] = 0xF8EB; - t['parenleftvertical'] = 0xFE35; - t['parenright'] = 0x0029; - t['parenrightaltonearabic'] = 0xFD3F; - t['parenrightbt'] = 0xF8F8; - t['parenrightex'] = 0xF8F7; - t['parenrightinferior'] = 0x208E; - t['parenrightmonospace'] = 0xFF09; - t['parenrightsmall'] = 0xFE5A; - t['parenrightsuperior'] = 0x207E; - t['parenrighttp'] = 0xF8F6; - t['parenrightvertical'] = 0xFE36; - t['partialdiff'] = 0x2202; - t['paseqhebrew'] = 0x05C0; - t['pashtahebrew'] = 0x0599; - t['pasquare'] = 0x33A9; - t['patah'] = 0x05B7; - t['patah11'] = 0x05B7; - t['patah1d'] = 0x05B7; - t['patah2a'] = 0x05B7; - t['patahhebrew'] = 0x05B7; - t['patahnarrowhebrew'] = 0x05B7; - t['patahquarterhebrew'] = 0x05B7; - t['patahwidehebrew'] = 0x05B7; - t['pazerhebrew'] = 0x05A1; - t['pbopomofo'] = 0x3106; - t['pcircle'] = 0x24DF; - t['pdotaccent'] = 0x1E57; - t['pe'] = 0x05E4; - t['pecyrillic'] = 0x043F; - t['pedagesh'] = 0xFB44; - t['pedageshhebrew'] = 0xFB44; - t['peezisquare'] = 0x333B; - t['pefinaldageshhebrew'] = 0xFB43; - t['peharabic'] = 0x067E; - t['peharmenian'] = 0x057A; - t['pehebrew'] = 0x05E4; - t['pehfinalarabic'] = 0xFB57; - t['pehinitialarabic'] = 0xFB58; - t['pehiragana'] = 0x307A; - t['pehmedialarabic'] = 0xFB59; - t['pekatakana'] = 0x30DA; - t['pemiddlehookcyrillic'] = 0x04A7; - t['perafehebrew'] = 0xFB4E; - t['percent'] = 0x0025; - t['percentarabic'] = 0x066A; - t['percentmonospace'] = 0xFF05; - t['percentsmall'] = 0xFE6A; - t['period'] = 0x002E; - t['periodarmenian'] = 0x0589; - t['periodcentered'] = 0x00B7; - t['periodhalfwidth'] = 0xFF61; - t['periodinferior'] = 0xF6E7; - t['periodmonospace'] = 0xFF0E; - t['periodsmall'] = 0xFE52; - t['periodsuperior'] = 0xF6E8; - t['perispomenigreekcmb'] = 0x0342; - t['perpendicular'] = 0x22A5; - t['perthousand'] = 0x2030; - t['peseta'] = 0x20A7; - t['pfsquare'] = 0x338A; - t['phabengali'] = 0x09AB; - t['phadeva'] = 0x092B; - t['phagujarati'] = 0x0AAB; - t['phagurmukhi'] = 0x0A2B; - t['phi'] = 0x03C6; - t['phi1'] = 0x03D5; - t['phieuphacirclekorean'] = 0x327A; - t['phieuphaparenkorean'] = 0x321A; - t['phieuphcirclekorean'] = 0x326C; - t['phieuphkorean'] = 0x314D; - t['phieuphparenkorean'] = 0x320C; - t['philatin'] = 0x0278; - t['phinthuthai'] = 0x0E3A; - t['phisymbolgreek'] = 0x03D5; - t['phook'] = 0x01A5; - t['phophanthai'] = 0x0E1E; - t['phophungthai'] = 0x0E1C; - t['phosamphaothai'] = 0x0E20; - t['pi'] = 0x03C0; - t['pieupacirclekorean'] = 0x3273; - t['pieupaparenkorean'] = 0x3213; - t['pieupcieuckorean'] = 0x3176; - t['pieupcirclekorean'] = 0x3265; - t['pieupkiyeokkorean'] = 0x3172; - t['pieupkorean'] = 0x3142; - t['pieupparenkorean'] = 0x3205; - t['pieupsioskiyeokkorean'] = 0x3174; - t['pieupsioskorean'] = 0x3144; - t['pieupsiostikeutkorean'] = 0x3175; - t['pieupthieuthkorean'] = 0x3177; - t['pieuptikeutkorean'] = 0x3173; - t['pihiragana'] = 0x3074; - t['pikatakana'] = 0x30D4; - t['pisymbolgreek'] = 0x03D6; - t['piwrarmenian'] = 0x0583; - t['plus'] = 0x002B; - t['plusbelowcmb'] = 0x031F; - t['pluscircle'] = 0x2295; - t['plusminus'] = 0x00B1; - t['plusmod'] = 0x02D6; - t['plusmonospace'] = 0xFF0B; - t['plussmall'] = 0xFE62; - t['plussuperior'] = 0x207A; - t['pmonospace'] = 0xFF50; - t['pmsquare'] = 0x33D8; - t['pohiragana'] = 0x307D; - t['pointingindexdownwhite'] = 0x261F; - t['pointingindexleftwhite'] = 0x261C; - t['pointingindexrightwhite'] = 0x261E; - t['pointingindexupwhite'] = 0x261D; - t['pokatakana'] = 0x30DD; - t['poplathai'] = 0x0E1B; - t['postalmark'] = 0x3012; - t['postalmarkface'] = 0x3020; - t['pparen'] = 0x24AB; - t['precedes'] = 0x227A; - t['prescription'] = 0x211E; - t['primemod'] = 0x02B9; - t['primereversed'] = 0x2035; - t['product'] = 0x220F; - t['projective'] = 0x2305; - t['prolongedkana'] = 0x30FC; - t['propellor'] = 0x2318; - t['propersubset'] = 0x2282; - t['propersuperset'] = 0x2283; - t['proportion'] = 0x2237; - t['proportional'] = 0x221D; - t['psi'] = 0x03C8; - t['psicyrillic'] = 0x0471; - t['psilipneumatacyrilliccmb'] = 0x0486; - t['pssquare'] = 0x33B0; - t['puhiragana'] = 0x3077; - t['pukatakana'] = 0x30D7; - t['pvsquare'] = 0x33B4; - t['pwsquare'] = 0x33BA; - t['q'] = 0x0071; - t['qadeva'] = 0x0958; - t['qadmahebrew'] = 0x05A8; - t['qafarabic'] = 0x0642; - t['qaffinalarabic'] = 0xFED6; - t['qafinitialarabic'] = 0xFED7; - t['qafmedialarabic'] = 0xFED8; - t['qamats'] = 0x05B8; - t['qamats10'] = 0x05B8; - t['qamats1a'] = 0x05B8; - t['qamats1c'] = 0x05B8; - t['qamats27'] = 0x05B8; - t['qamats29'] = 0x05B8; - t['qamats33'] = 0x05B8; - t['qamatsde'] = 0x05B8; - t['qamatshebrew'] = 0x05B8; - t['qamatsnarrowhebrew'] = 0x05B8; - t['qamatsqatanhebrew'] = 0x05B8; - t['qamatsqatannarrowhebrew'] = 0x05B8; - t['qamatsqatanquarterhebrew'] = 0x05B8; - t['qamatsqatanwidehebrew'] = 0x05B8; - t['qamatsquarterhebrew'] = 0x05B8; - t['qamatswidehebrew'] = 0x05B8; - t['qarneyparahebrew'] = 0x059F; - t['qbopomofo'] = 0x3111; - t['qcircle'] = 0x24E0; - t['qhook'] = 0x02A0; - t['qmonospace'] = 0xFF51; - t['qof'] = 0x05E7; - t['qofdagesh'] = 0xFB47; - t['qofdageshhebrew'] = 0xFB47; - t['qofhebrew'] = 0x05E7; - t['qparen'] = 0x24AC; - t['quarternote'] = 0x2669; - t['qubuts'] = 0x05BB; - t['qubuts18'] = 0x05BB; - t['qubuts25'] = 0x05BB; - t['qubuts31'] = 0x05BB; - t['qubutshebrew'] = 0x05BB; - t['qubutsnarrowhebrew'] = 0x05BB; - t['qubutsquarterhebrew'] = 0x05BB; - t['qubutswidehebrew'] = 0x05BB; - t['question'] = 0x003F; - t['questionarabic'] = 0x061F; - t['questionarmenian'] = 0x055E; - t['questiondown'] = 0x00BF; - t['questiondownsmall'] = 0xF7BF; - t['questiongreek'] = 0x037E; - t['questionmonospace'] = 0xFF1F; - t['questionsmall'] = 0xF73F; - t['quotedbl'] = 0x0022; - t['quotedblbase'] = 0x201E; - t['quotedblleft'] = 0x201C; - t['quotedblmonospace'] = 0xFF02; - t['quotedblprime'] = 0x301E; - t['quotedblprimereversed'] = 0x301D; - t['quotedblright'] = 0x201D; - t['quoteleft'] = 0x2018; - t['quoteleftreversed'] = 0x201B; - t['quotereversed'] = 0x201B; - t['quoteright'] = 0x2019; - t['quoterightn'] = 0x0149; - t['quotesinglbase'] = 0x201A; - t['quotesingle'] = 0x0027; - t['quotesinglemonospace'] = 0xFF07; - t['r'] = 0x0072; - t['raarmenian'] = 0x057C; - t['rabengali'] = 0x09B0; - t['racute'] = 0x0155; - t['radeva'] = 0x0930; - t['radical'] = 0x221A; - t['radicalex'] = 0xF8E5; - t['radoverssquare'] = 0x33AE; - t['radoverssquaredsquare'] = 0x33AF; - t['radsquare'] = 0x33AD; - t['rafe'] = 0x05BF; - t['rafehebrew'] = 0x05BF; - t['ragujarati'] = 0x0AB0; - t['ragurmukhi'] = 0x0A30; - t['rahiragana'] = 0x3089; - t['rakatakana'] = 0x30E9; - t['rakatakanahalfwidth'] = 0xFF97; - t['ralowerdiagonalbengali'] = 0x09F1; - t['ramiddlediagonalbengali'] = 0x09F0; - t['ramshorn'] = 0x0264; - t['ratio'] = 0x2236; - t['rbopomofo'] = 0x3116; - t['rcaron'] = 0x0159; - t['rcedilla'] = 0x0157; - t['rcircle'] = 0x24E1; - t['rcommaaccent'] = 0x0157; - t['rdblgrave'] = 0x0211; - t['rdotaccent'] = 0x1E59; - t['rdotbelow'] = 0x1E5B; - t['rdotbelowmacron'] = 0x1E5D; - t['referencemark'] = 0x203B; - t['reflexsubset'] = 0x2286; - t['reflexsuperset'] = 0x2287; - t['registered'] = 0x00AE; - t['registersans'] = 0xF8E8; - t['registerserif'] = 0xF6DA; - t['reharabic'] = 0x0631; - t['reharmenian'] = 0x0580; - t['rehfinalarabic'] = 0xFEAE; - t['rehiragana'] = 0x308C; - t['rekatakana'] = 0x30EC; - t['rekatakanahalfwidth'] = 0xFF9A; - t['resh'] = 0x05E8; - t['reshdageshhebrew'] = 0xFB48; - t['reshhebrew'] = 0x05E8; - t['reversedtilde'] = 0x223D; - t['reviahebrew'] = 0x0597; - t['reviamugrashhebrew'] = 0x0597; - t['revlogicalnot'] = 0x2310; - t['rfishhook'] = 0x027E; - t['rfishhookreversed'] = 0x027F; - t['rhabengali'] = 0x09DD; - t['rhadeva'] = 0x095D; - t['rho'] = 0x03C1; - t['rhook'] = 0x027D; - t['rhookturned'] = 0x027B; - t['rhookturnedsuperior'] = 0x02B5; - t['rhosymbolgreek'] = 0x03F1; - t['rhotichookmod'] = 0x02DE; - t['rieulacirclekorean'] = 0x3271; - t['rieulaparenkorean'] = 0x3211; - t['rieulcirclekorean'] = 0x3263; - t['rieulhieuhkorean'] = 0x3140; - t['rieulkiyeokkorean'] = 0x313A; - t['rieulkiyeoksioskorean'] = 0x3169; - t['rieulkorean'] = 0x3139; - t['rieulmieumkorean'] = 0x313B; - t['rieulpansioskorean'] = 0x316C; - t['rieulparenkorean'] = 0x3203; - t['rieulphieuphkorean'] = 0x313F; - t['rieulpieupkorean'] = 0x313C; - t['rieulpieupsioskorean'] = 0x316B; - t['rieulsioskorean'] = 0x313D; - t['rieulthieuthkorean'] = 0x313E; - t['rieultikeutkorean'] = 0x316A; - t['rieulyeorinhieuhkorean'] = 0x316D; - t['rightangle'] = 0x221F; - t['righttackbelowcmb'] = 0x0319; - t['righttriangle'] = 0x22BF; - t['rihiragana'] = 0x308A; - t['rikatakana'] = 0x30EA; - t['rikatakanahalfwidth'] = 0xFF98; - t['ring'] = 0x02DA; - t['ringbelowcmb'] = 0x0325; - t['ringcmb'] = 0x030A; - t['ringhalfleft'] = 0x02BF; - t['ringhalfleftarmenian'] = 0x0559; - t['ringhalfleftbelowcmb'] = 0x031C; - t['ringhalfleftcentered'] = 0x02D3; - t['ringhalfright'] = 0x02BE; - t['ringhalfrightbelowcmb'] = 0x0339; - t['ringhalfrightcentered'] = 0x02D2; - t['rinvertedbreve'] = 0x0213; - t['rittorusquare'] = 0x3351; - t['rlinebelow'] = 0x1E5F; - t['rlongleg'] = 0x027C; - t['rlonglegturned'] = 0x027A; - t['rmonospace'] = 0xFF52; - t['rohiragana'] = 0x308D; - t['rokatakana'] = 0x30ED; - t['rokatakanahalfwidth'] = 0xFF9B; - t['roruathai'] = 0x0E23; - t['rparen'] = 0x24AD; - t['rrabengali'] = 0x09DC; - t['rradeva'] = 0x0931; - t['rragurmukhi'] = 0x0A5C; - t['rreharabic'] = 0x0691; - t['rrehfinalarabic'] = 0xFB8D; - t['rrvocalicbengali'] = 0x09E0; - t['rrvocalicdeva'] = 0x0960; - t['rrvocalicgujarati'] = 0x0AE0; - t['rrvocalicvowelsignbengali'] = 0x09C4; - t['rrvocalicvowelsigndeva'] = 0x0944; - t['rrvocalicvowelsigngujarati'] = 0x0AC4; - t['rsuperior'] = 0xF6F1; - t['rtblock'] = 0x2590; - t['rturned'] = 0x0279; - t['rturnedsuperior'] = 0x02B4; - t['ruhiragana'] = 0x308B; - t['rukatakana'] = 0x30EB; - t['rukatakanahalfwidth'] = 0xFF99; - t['rupeemarkbengali'] = 0x09F2; - t['rupeesignbengali'] = 0x09F3; - t['rupiah'] = 0xF6DD; - t['ruthai'] = 0x0E24; - t['rvocalicbengali'] = 0x098B; - t['rvocalicdeva'] = 0x090B; - t['rvocalicgujarati'] = 0x0A8B; - t['rvocalicvowelsignbengali'] = 0x09C3; - t['rvocalicvowelsigndeva'] = 0x0943; - t['rvocalicvowelsigngujarati'] = 0x0AC3; - t['s'] = 0x0073; - t['sabengali'] = 0x09B8; - t['sacute'] = 0x015B; - t['sacutedotaccent'] = 0x1E65; - t['sadarabic'] = 0x0635; - t['sadeva'] = 0x0938; - t['sadfinalarabic'] = 0xFEBA; - t['sadinitialarabic'] = 0xFEBB; - t['sadmedialarabic'] = 0xFEBC; - t['sagujarati'] = 0x0AB8; - t['sagurmukhi'] = 0x0A38; - t['sahiragana'] = 0x3055; - t['sakatakana'] = 0x30B5; - t['sakatakanahalfwidth'] = 0xFF7B; - t['sallallahoualayhewasallamarabic'] = 0xFDFA; - t['samekh'] = 0x05E1; - t['samekhdagesh'] = 0xFB41; - t['samekhdageshhebrew'] = 0xFB41; - t['samekhhebrew'] = 0x05E1; - t['saraaathai'] = 0x0E32; - t['saraaethai'] = 0x0E41; - t['saraaimaimalaithai'] = 0x0E44; - t['saraaimaimuanthai'] = 0x0E43; - t['saraamthai'] = 0x0E33; - t['saraathai'] = 0x0E30; - t['saraethai'] = 0x0E40; - t['saraiileftthai'] = 0xF886; - t['saraiithai'] = 0x0E35; - t['saraileftthai'] = 0xF885; - t['saraithai'] = 0x0E34; - t['saraothai'] = 0x0E42; - t['saraueeleftthai'] = 0xF888; - t['saraueethai'] = 0x0E37; - t['saraueleftthai'] = 0xF887; - t['sarauethai'] = 0x0E36; - t['sarauthai'] = 0x0E38; - t['sarauuthai'] = 0x0E39; - t['sbopomofo'] = 0x3119; - t['scaron'] = 0x0161; - t['scarondotaccent'] = 0x1E67; - t['scedilla'] = 0x015F; - t['schwa'] = 0x0259; - t['schwacyrillic'] = 0x04D9; - t['schwadieresiscyrillic'] = 0x04DB; - t['schwahook'] = 0x025A; - t['scircle'] = 0x24E2; - t['scircumflex'] = 0x015D; - t['scommaaccent'] = 0x0219; - t['sdotaccent'] = 0x1E61; - t['sdotbelow'] = 0x1E63; - t['sdotbelowdotaccent'] = 0x1E69; - t['seagullbelowcmb'] = 0x033C; - t['second'] = 0x2033; - t['secondtonechinese'] = 0x02CA; - t['section'] = 0x00A7; - t['seenarabic'] = 0x0633; - t['seenfinalarabic'] = 0xFEB2; - t['seeninitialarabic'] = 0xFEB3; - t['seenmedialarabic'] = 0xFEB4; - t['segol'] = 0x05B6; - t['segol13'] = 0x05B6; - t['segol1f'] = 0x05B6; - t['segol2c'] = 0x05B6; - t['segolhebrew'] = 0x05B6; - t['segolnarrowhebrew'] = 0x05B6; - t['segolquarterhebrew'] = 0x05B6; - t['segoltahebrew'] = 0x0592; - t['segolwidehebrew'] = 0x05B6; - t['seharmenian'] = 0x057D; - t['sehiragana'] = 0x305B; - t['sekatakana'] = 0x30BB; - t['sekatakanahalfwidth'] = 0xFF7E; - t['semicolon'] = 0x003B; - t['semicolonarabic'] = 0x061B; - t['semicolonmonospace'] = 0xFF1B; - t['semicolonsmall'] = 0xFE54; - t['semivoicedmarkkana'] = 0x309C; - t['semivoicedmarkkanahalfwidth'] = 0xFF9F; - t['sentisquare'] = 0x3322; - t['sentosquare'] = 0x3323; - t['seven'] = 0x0037; - t['sevenarabic'] = 0x0667; - t['sevenbengali'] = 0x09ED; - t['sevencircle'] = 0x2466; - t['sevencircleinversesansserif'] = 0x2790; - t['sevendeva'] = 0x096D; - t['seveneighths'] = 0x215E; - t['sevengujarati'] = 0x0AED; - t['sevengurmukhi'] = 0x0A6D; - t['sevenhackarabic'] = 0x0667; - t['sevenhangzhou'] = 0x3027; - t['sevenideographicparen'] = 0x3226; - t['seveninferior'] = 0x2087; - t['sevenmonospace'] = 0xFF17; - t['sevenoldstyle'] = 0xF737; - t['sevenparen'] = 0x247A; - t['sevenperiod'] = 0x248E; - t['sevenpersian'] = 0x06F7; - t['sevenroman'] = 0x2176; - t['sevensuperior'] = 0x2077; - t['seventeencircle'] = 0x2470; - t['seventeenparen'] = 0x2484; - t['seventeenperiod'] = 0x2498; - t['seventhai'] = 0x0E57; - t['sfthyphen'] = 0x00AD; - t['shaarmenian'] = 0x0577; - t['shabengali'] = 0x09B6; - t['shacyrillic'] = 0x0448; - t['shaddaarabic'] = 0x0651; - t['shaddadammaarabic'] = 0xFC61; - t['shaddadammatanarabic'] = 0xFC5E; - t['shaddafathaarabic'] = 0xFC60; - t['shaddakasraarabic'] = 0xFC62; - t['shaddakasratanarabic'] = 0xFC5F; - t['shade'] = 0x2592; - t['shadedark'] = 0x2593; - t['shadelight'] = 0x2591; - t['shademedium'] = 0x2592; - t['shadeva'] = 0x0936; - t['shagujarati'] = 0x0AB6; - t['shagurmukhi'] = 0x0A36; - t['shalshelethebrew'] = 0x0593; - t['shbopomofo'] = 0x3115; - t['shchacyrillic'] = 0x0449; - t['sheenarabic'] = 0x0634; - t['sheenfinalarabic'] = 0xFEB6; - t['sheeninitialarabic'] = 0xFEB7; - t['sheenmedialarabic'] = 0xFEB8; - t['sheicoptic'] = 0x03E3; - t['sheqel'] = 0x20AA; - t['sheqelhebrew'] = 0x20AA; - t['sheva'] = 0x05B0; - t['sheva115'] = 0x05B0; - t['sheva15'] = 0x05B0; - t['sheva22'] = 0x05B0; - t['sheva2e'] = 0x05B0; - t['shevahebrew'] = 0x05B0; - t['shevanarrowhebrew'] = 0x05B0; - t['shevaquarterhebrew'] = 0x05B0; - t['shevawidehebrew'] = 0x05B0; - t['shhacyrillic'] = 0x04BB; - t['shimacoptic'] = 0x03ED; - t['shin'] = 0x05E9; - t['shindagesh'] = 0xFB49; - t['shindageshhebrew'] = 0xFB49; - t['shindageshshindot'] = 0xFB2C; - t['shindageshshindothebrew'] = 0xFB2C; - t['shindageshsindot'] = 0xFB2D; - t['shindageshsindothebrew'] = 0xFB2D; - t['shindothebrew'] = 0x05C1; - t['shinhebrew'] = 0x05E9; - t['shinshindot'] = 0xFB2A; - t['shinshindothebrew'] = 0xFB2A; - t['shinsindot'] = 0xFB2B; - t['shinsindothebrew'] = 0xFB2B; - t['shook'] = 0x0282; - t['sigma'] = 0x03C3; - t['sigma1'] = 0x03C2; - t['sigmafinal'] = 0x03C2; - t['sigmalunatesymbolgreek'] = 0x03F2; - t['sihiragana'] = 0x3057; - t['sikatakana'] = 0x30B7; - t['sikatakanahalfwidth'] = 0xFF7C; - t['siluqhebrew'] = 0x05BD; - t['siluqlefthebrew'] = 0x05BD; - t['similar'] = 0x223C; - t['sindothebrew'] = 0x05C2; - t['siosacirclekorean'] = 0x3274; - t['siosaparenkorean'] = 0x3214; - t['sioscieuckorean'] = 0x317E; - t['sioscirclekorean'] = 0x3266; - t['sioskiyeokkorean'] = 0x317A; - t['sioskorean'] = 0x3145; - t['siosnieunkorean'] = 0x317B; - t['siosparenkorean'] = 0x3206; - t['siospieupkorean'] = 0x317D; - t['siostikeutkorean'] = 0x317C; - t['six'] = 0x0036; - t['sixarabic'] = 0x0666; - t['sixbengali'] = 0x09EC; - t['sixcircle'] = 0x2465; - t['sixcircleinversesansserif'] = 0x278F; - t['sixdeva'] = 0x096C; - t['sixgujarati'] = 0x0AEC; - t['sixgurmukhi'] = 0x0A6C; - t['sixhackarabic'] = 0x0666; - t['sixhangzhou'] = 0x3026; - t['sixideographicparen'] = 0x3225; - t['sixinferior'] = 0x2086; - t['sixmonospace'] = 0xFF16; - t['sixoldstyle'] = 0xF736; - t['sixparen'] = 0x2479; - t['sixperiod'] = 0x248D; - t['sixpersian'] = 0x06F6; - t['sixroman'] = 0x2175; - t['sixsuperior'] = 0x2076; - t['sixteencircle'] = 0x246F; - t['sixteencurrencydenominatorbengali'] = 0x09F9; - t['sixteenparen'] = 0x2483; - t['sixteenperiod'] = 0x2497; - t['sixthai'] = 0x0E56; - t['slash'] = 0x002F; - t['slashmonospace'] = 0xFF0F; - t['slong'] = 0x017F; - t['slongdotaccent'] = 0x1E9B; - t['smileface'] = 0x263A; - t['smonospace'] = 0xFF53; - t['sofpasuqhebrew'] = 0x05C3; - t['softhyphen'] = 0x00AD; - t['softsigncyrillic'] = 0x044C; - t['sohiragana'] = 0x305D; - t['sokatakana'] = 0x30BD; - t['sokatakanahalfwidth'] = 0xFF7F; - t['soliduslongoverlaycmb'] = 0x0338; - t['solidusshortoverlaycmb'] = 0x0337; - t['sorusithai'] = 0x0E29; - t['sosalathai'] = 0x0E28; - t['sosothai'] = 0x0E0B; - t['sosuathai'] = 0x0E2A; - t['space'] = 0x0020; - t['spacehackarabic'] = 0x0020; - t['spade'] = 0x2660; - t['spadesuitblack'] = 0x2660; - t['spadesuitwhite'] = 0x2664; - t['sparen'] = 0x24AE; - t['squarebelowcmb'] = 0x033B; - t['squarecc'] = 0x33C4; - t['squarecm'] = 0x339D; - t['squarediagonalcrosshatchfill'] = 0x25A9; - t['squarehorizontalfill'] = 0x25A4; - t['squarekg'] = 0x338F; - t['squarekm'] = 0x339E; - t['squarekmcapital'] = 0x33CE; - t['squareln'] = 0x33D1; - t['squarelog'] = 0x33D2; - t['squaremg'] = 0x338E; - t['squaremil'] = 0x33D5; - t['squaremm'] = 0x339C; - t['squaremsquared'] = 0x33A1; - t['squareorthogonalcrosshatchfill'] = 0x25A6; - t['squareupperlefttolowerrightfill'] = 0x25A7; - t['squareupperrighttolowerleftfill'] = 0x25A8; - t['squareverticalfill'] = 0x25A5; - t['squarewhitewithsmallblack'] = 0x25A3; - t['srsquare'] = 0x33DB; - t['ssabengali'] = 0x09B7; - t['ssadeva'] = 0x0937; - t['ssagujarati'] = 0x0AB7; - t['ssangcieuckorean'] = 0x3149; - t['ssanghieuhkorean'] = 0x3185; - t['ssangieungkorean'] = 0x3180; - t['ssangkiyeokkorean'] = 0x3132; - t['ssangnieunkorean'] = 0x3165; - t['ssangpieupkorean'] = 0x3143; - t['ssangsioskorean'] = 0x3146; - t['ssangtikeutkorean'] = 0x3138; - t['ssuperior'] = 0xF6F2; - t['sterling'] = 0x00A3; - t['sterlingmonospace'] = 0xFFE1; - t['strokelongoverlaycmb'] = 0x0336; - t['strokeshortoverlaycmb'] = 0x0335; - t['subset'] = 0x2282; - t['subsetnotequal'] = 0x228A; - t['subsetorequal'] = 0x2286; - t['succeeds'] = 0x227B; - t['suchthat'] = 0x220B; - t['suhiragana'] = 0x3059; - t['sukatakana'] = 0x30B9; - t['sukatakanahalfwidth'] = 0xFF7D; - t['sukunarabic'] = 0x0652; - t['summation'] = 0x2211; - t['sun'] = 0x263C; - t['superset'] = 0x2283; - t['supersetnotequal'] = 0x228B; - t['supersetorequal'] = 0x2287; - t['svsquare'] = 0x33DC; - t['syouwaerasquare'] = 0x337C; - t['t'] = 0x0074; - t['tabengali'] = 0x09A4; - t['tackdown'] = 0x22A4; - t['tackleft'] = 0x22A3; - t['tadeva'] = 0x0924; - t['tagujarati'] = 0x0AA4; - t['tagurmukhi'] = 0x0A24; - t['taharabic'] = 0x0637; - t['tahfinalarabic'] = 0xFEC2; - t['tahinitialarabic'] = 0xFEC3; - t['tahiragana'] = 0x305F; - t['tahmedialarabic'] = 0xFEC4; - t['taisyouerasquare'] = 0x337D; - t['takatakana'] = 0x30BF; - t['takatakanahalfwidth'] = 0xFF80; - t['tatweelarabic'] = 0x0640; - t['tau'] = 0x03C4; - t['tav'] = 0x05EA; - t['tavdages'] = 0xFB4A; - t['tavdagesh'] = 0xFB4A; - t['tavdageshhebrew'] = 0xFB4A; - t['tavhebrew'] = 0x05EA; - t['tbar'] = 0x0167; - t['tbopomofo'] = 0x310A; - t['tcaron'] = 0x0165; - t['tccurl'] = 0x02A8; - t['tcedilla'] = 0x0163; - t['tcheharabic'] = 0x0686; - t['tchehfinalarabic'] = 0xFB7B; - t['tchehinitialarabic'] = 0xFB7C; - t['tchehmedialarabic'] = 0xFB7D; - t['tcircle'] = 0x24E3; - t['tcircumflexbelow'] = 0x1E71; - t['tcommaaccent'] = 0x0163; - t['tdieresis'] = 0x1E97; - t['tdotaccent'] = 0x1E6B; - t['tdotbelow'] = 0x1E6D; - t['tecyrillic'] = 0x0442; - t['tedescendercyrillic'] = 0x04AD; - t['teharabic'] = 0x062A; - t['tehfinalarabic'] = 0xFE96; - t['tehhahinitialarabic'] = 0xFCA2; - t['tehhahisolatedarabic'] = 0xFC0C; - t['tehinitialarabic'] = 0xFE97; - t['tehiragana'] = 0x3066; - t['tehjeeminitialarabic'] = 0xFCA1; - t['tehjeemisolatedarabic'] = 0xFC0B; - t['tehmarbutaarabic'] = 0x0629; - t['tehmarbutafinalarabic'] = 0xFE94; - t['tehmedialarabic'] = 0xFE98; - t['tehmeeminitialarabic'] = 0xFCA4; - t['tehmeemisolatedarabic'] = 0xFC0E; - t['tehnoonfinalarabic'] = 0xFC73; - t['tekatakana'] = 0x30C6; - t['tekatakanahalfwidth'] = 0xFF83; - t['telephone'] = 0x2121; - t['telephoneblack'] = 0x260E; - t['telishagedolahebrew'] = 0x05A0; - t['telishaqetanahebrew'] = 0x05A9; - t['tencircle'] = 0x2469; - t['tenideographicparen'] = 0x3229; - t['tenparen'] = 0x247D; - t['tenperiod'] = 0x2491; - t['tenroman'] = 0x2179; - t['tesh'] = 0x02A7; - t['tet'] = 0x05D8; - t['tetdagesh'] = 0xFB38; - t['tetdageshhebrew'] = 0xFB38; - t['tethebrew'] = 0x05D8; - t['tetsecyrillic'] = 0x04B5; - t['tevirhebrew'] = 0x059B; - t['tevirlefthebrew'] = 0x059B; - t['thabengali'] = 0x09A5; - t['thadeva'] = 0x0925; - t['thagujarati'] = 0x0AA5; - t['thagurmukhi'] = 0x0A25; - t['thalarabic'] = 0x0630; - t['thalfinalarabic'] = 0xFEAC; - t['thanthakhatlowleftthai'] = 0xF898; - t['thanthakhatlowrightthai'] = 0xF897; - t['thanthakhatthai'] = 0x0E4C; - t['thanthakhatupperleftthai'] = 0xF896; - t['theharabic'] = 0x062B; - t['thehfinalarabic'] = 0xFE9A; - t['thehinitialarabic'] = 0xFE9B; - t['thehmedialarabic'] = 0xFE9C; - t['thereexists'] = 0x2203; - t['therefore'] = 0x2234; - t['theta'] = 0x03B8; - t['theta1'] = 0x03D1; - t['thetasymbolgreek'] = 0x03D1; - t['thieuthacirclekorean'] = 0x3279; - t['thieuthaparenkorean'] = 0x3219; - t['thieuthcirclekorean'] = 0x326B; - t['thieuthkorean'] = 0x314C; - t['thieuthparenkorean'] = 0x320B; - t['thirteencircle'] = 0x246C; - t['thirteenparen'] = 0x2480; - t['thirteenperiod'] = 0x2494; - t['thonangmonthothai'] = 0x0E11; - t['thook'] = 0x01AD; - t['thophuthaothai'] = 0x0E12; - t['thorn'] = 0x00FE; - t['thothahanthai'] = 0x0E17; - t['thothanthai'] = 0x0E10; - t['thothongthai'] = 0x0E18; - t['thothungthai'] = 0x0E16; - t['thousandcyrillic'] = 0x0482; - t['thousandsseparatorarabic'] = 0x066C; - t['thousandsseparatorpersian'] = 0x066C; - t['three'] = 0x0033; - t['threearabic'] = 0x0663; - t['threebengali'] = 0x09E9; - t['threecircle'] = 0x2462; - t['threecircleinversesansserif'] = 0x278C; - t['threedeva'] = 0x0969; - t['threeeighths'] = 0x215C; - t['threegujarati'] = 0x0AE9; - t['threegurmukhi'] = 0x0A69; - t['threehackarabic'] = 0x0663; - t['threehangzhou'] = 0x3023; - t['threeideographicparen'] = 0x3222; - t['threeinferior'] = 0x2083; - t['threemonospace'] = 0xFF13; - t['threenumeratorbengali'] = 0x09F6; - t['threeoldstyle'] = 0xF733; - t['threeparen'] = 0x2476; - t['threeperiod'] = 0x248A; - t['threepersian'] = 0x06F3; - t['threequarters'] = 0x00BE; - t['threequartersemdash'] = 0xF6DE; - t['threeroman'] = 0x2172; - t['threesuperior'] = 0x00B3; - t['threethai'] = 0x0E53; - t['thzsquare'] = 0x3394; - t['tihiragana'] = 0x3061; - t['tikatakana'] = 0x30C1; - t['tikatakanahalfwidth'] = 0xFF81; - t['tikeutacirclekorean'] = 0x3270; - t['tikeutaparenkorean'] = 0x3210; - t['tikeutcirclekorean'] = 0x3262; - t['tikeutkorean'] = 0x3137; - t['tikeutparenkorean'] = 0x3202; - t['tilde'] = 0x02DC; - t['tildebelowcmb'] = 0x0330; - t['tildecmb'] = 0x0303; - t['tildecomb'] = 0x0303; - t['tildedoublecmb'] = 0x0360; - t['tildeoperator'] = 0x223C; - t['tildeoverlaycmb'] = 0x0334; - t['tildeverticalcmb'] = 0x033E; - t['timescircle'] = 0x2297; - t['tipehahebrew'] = 0x0596; - t['tipehalefthebrew'] = 0x0596; - t['tippigurmukhi'] = 0x0A70; - t['titlocyrilliccmb'] = 0x0483; - t['tiwnarmenian'] = 0x057F; - t['tlinebelow'] = 0x1E6F; - t['tmonospace'] = 0xFF54; - t['toarmenian'] = 0x0569; - t['tohiragana'] = 0x3068; - t['tokatakana'] = 0x30C8; - t['tokatakanahalfwidth'] = 0xFF84; - t['tonebarextrahighmod'] = 0x02E5; - t['tonebarextralowmod'] = 0x02E9; - t['tonebarhighmod'] = 0x02E6; - t['tonebarlowmod'] = 0x02E8; - t['tonebarmidmod'] = 0x02E7; - t['tonefive'] = 0x01BD; - t['tonesix'] = 0x0185; - t['tonetwo'] = 0x01A8; - t['tonos'] = 0x0384; - t['tonsquare'] = 0x3327; - t['topatakthai'] = 0x0E0F; - t['tortoiseshellbracketleft'] = 0x3014; - t['tortoiseshellbracketleftsmall'] = 0xFE5D; - t['tortoiseshellbracketleftvertical'] = 0xFE39; - t['tortoiseshellbracketright'] = 0x3015; - t['tortoiseshellbracketrightsmall'] = 0xFE5E; - t['tortoiseshellbracketrightvertical'] = 0xFE3A; - t['totaothai'] = 0x0E15; - t['tpalatalhook'] = 0x01AB; - t['tparen'] = 0x24AF; - t['trademark'] = 0x2122; - t['trademarksans'] = 0xF8EA; - t['trademarkserif'] = 0xF6DB; - t['tretroflexhook'] = 0x0288; - t['triagdn'] = 0x25BC; - t['triaglf'] = 0x25C4; - t['triagrt'] = 0x25BA; - t['triagup'] = 0x25B2; - t['ts'] = 0x02A6; - t['tsadi'] = 0x05E6; - t['tsadidagesh'] = 0xFB46; - t['tsadidageshhebrew'] = 0xFB46; - t['tsadihebrew'] = 0x05E6; - t['tsecyrillic'] = 0x0446; - t['tsere'] = 0x05B5; - t['tsere12'] = 0x05B5; - t['tsere1e'] = 0x05B5; - t['tsere2b'] = 0x05B5; - t['tserehebrew'] = 0x05B5; - t['tserenarrowhebrew'] = 0x05B5; - t['tserequarterhebrew'] = 0x05B5; - t['tserewidehebrew'] = 0x05B5; - t['tshecyrillic'] = 0x045B; - t['tsuperior'] = 0xF6F3; - t['ttabengali'] = 0x099F; - t['ttadeva'] = 0x091F; - t['ttagujarati'] = 0x0A9F; - t['ttagurmukhi'] = 0x0A1F; - t['tteharabic'] = 0x0679; - t['ttehfinalarabic'] = 0xFB67; - t['ttehinitialarabic'] = 0xFB68; - t['ttehmedialarabic'] = 0xFB69; - t['tthabengali'] = 0x09A0; - t['tthadeva'] = 0x0920; - t['tthagujarati'] = 0x0AA0; - t['tthagurmukhi'] = 0x0A20; - t['tturned'] = 0x0287; - t['tuhiragana'] = 0x3064; - t['tukatakana'] = 0x30C4; - t['tukatakanahalfwidth'] = 0xFF82; - t['tusmallhiragana'] = 0x3063; - t['tusmallkatakana'] = 0x30C3; - t['tusmallkatakanahalfwidth'] = 0xFF6F; - t['twelvecircle'] = 0x246B; - t['twelveparen'] = 0x247F; - t['twelveperiod'] = 0x2493; - t['twelveroman'] = 0x217B; - t['twentycircle'] = 0x2473; - t['twentyhangzhou'] = 0x5344; - t['twentyparen'] = 0x2487; - t['twentyperiod'] = 0x249B; - t['two'] = 0x0032; - t['twoarabic'] = 0x0662; - t['twobengali'] = 0x09E8; - t['twocircle'] = 0x2461; - t['twocircleinversesansserif'] = 0x278B; - t['twodeva'] = 0x0968; - t['twodotenleader'] = 0x2025; - t['twodotleader'] = 0x2025; - t['twodotleadervertical'] = 0xFE30; - t['twogujarati'] = 0x0AE8; - t['twogurmukhi'] = 0x0A68; - t['twohackarabic'] = 0x0662; - t['twohangzhou'] = 0x3022; - t['twoideographicparen'] = 0x3221; - t['twoinferior'] = 0x2082; - t['twomonospace'] = 0xFF12; - t['twonumeratorbengali'] = 0x09F5; - t['twooldstyle'] = 0xF732; - t['twoparen'] = 0x2475; - t['twoperiod'] = 0x2489; - t['twopersian'] = 0x06F2; - t['tworoman'] = 0x2171; - t['twostroke'] = 0x01BB; - t['twosuperior'] = 0x00B2; - t['twothai'] = 0x0E52; - t['twothirds'] = 0x2154; - t['u'] = 0x0075; - t['uacute'] = 0x00FA; - t['ubar'] = 0x0289; - t['ubengali'] = 0x0989; - t['ubopomofo'] = 0x3128; - t['ubreve'] = 0x016D; - t['ucaron'] = 0x01D4; - t['ucircle'] = 0x24E4; - t['ucircumflex'] = 0x00FB; - t['ucircumflexbelow'] = 0x1E77; - t['ucyrillic'] = 0x0443; - t['udattadeva'] = 0x0951; - t['udblacute'] = 0x0171; - t['udblgrave'] = 0x0215; - t['udeva'] = 0x0909; - t['udieresis'] = 0x00FC; - t['udieresisacute'] = 0x01D8; - t['udieresisbelow'] = 0x1E73; - t['udieresiscaron'] = 0x01DA; - t['udieresiscyrillic'] = 0x04F1; - t['udieresisgrave'] = 0x01DC; - t['udieresismacron'] = 0x01D6; - t['udotbelow'] = 0x1EE5; - t['ugrave'] = 0x00F9; - t['ugujarati'] = 0x0A89; - t['ugurmukhi'] = 0x0A09; - t['uhiragana'] = 0x3046; - t['uhookabove'] = 0x1EE7; - t['uhorn'] = 0x01B0; - t['uhornacute'] = 0x1EE9; - t['uhorndotbelow'] = 0x1EF1; - t['uhorngrave'] = 0x1EEB; - t['uhornhookabove'] = 0x1EED; - t['uhorntilde'] = 0x1EEF; - t['uhungarumlaut'] = 0x0171; - t['uhungarumlautcyrillic'] = 0x04F3; - t['uinvertedbreve'] = 0x0217; - t['ukatakana'] = 0x30A6; - t['ukatakanahalfwidth'] = 0xFF73; - t['ukcyrillic'] = 0x0479; - t['ukorean'] = 0x315C; - t['umacron'] = 0x016B; - t['umacroncyrillic'] = 0x04EF; - t['umacrondieresis'] = 0x1E7B; - t['umatragurmukhi'] = 0x0A41; - t['umonospace'] = 0xFF55; - t['underscore'] = 0x005F; - t['underscoredbl'] = 0x2017; - t['underscoremonospace'] = 0xFF3F; - t['underscorevertical'] = 0xFE33; - t['underscorewavy'] = 0xFE4F; - t['union'] = 0x222A; - t['universal'] = 0x2200; - t['uogonek'] = 0x0173; - t['uparen'] = 0x24B0; - t['upblock'] = 0x2580; - t['upperdothebrew'] = 0x05C4; - t['upsilon'] = 0x03C5; - t['upsilondieresis'] = 0x03CB; - t['upsilondieresistonos'] = 0x03B0; - t['upsilonlatin'] = 0x028A; - t['upsilontonos'] = 0x03CD; - t['uptackbelowcmb'] = 0x031D; - t['uptackmod'] = 0x02D4; - t['uragurmukhi'] = 0x0A73; - t['uring'] = 0x016F; - t['ushortcyrillic'] = 0x045E; - t['usmallhiragana'] = 0x3045; - t['usmallkatakana'] = 0x30A5; - t['usmallkatakanahalfwidth'] = 0xFF69; - t['ustraightcyrillic'] = 0x04AF; - t['ustraightstrokecyrillic'] = 0x04B1; - t['utilde'] = 0x0169; - t['utildeacute'] = 0x1E79; - t['utildebelow'] = 0x1E75; - t['uubengali'] = 0x098A; - t['uudeva'] = 0x090A; - t['uugujarati'] = 0x0A8A; - t['uugurmukhi'] = 0x0A0A; - t['uumatragurmukhi'] = 0x0A42; - t['uuvowelsignbengali'] = 0x09C2; - t['uuvowelsigndeva'] = 0x0942; - t['uuvowelsigngujarati'] = 0x0AC2; - t['uvowelsignbengali'] = 0x09C1; - t['uvowelsigndeva'] = 0x0941; - t['uvowelsigngujarati'] = 0x0AC1; - t['v'] = 0x0076; - t['vadeva'] = 0x0935; - t['vagujarati'] = 0x0AB5; - t['vagurmukhi'] = 0x0A35; - t['vakatakana'] = 0x30F7; - t['vav'] = 0x05D5; - t['vavdagesh'] = 0xFB35; - t['vavdagesh65'] = 0xFB35; - t['vavdageshhebrew'] = 0xFB35; - t['vavhebrew'] = 0x05D5; - t['vavholam'] = 0xFB4B; - t['vavholamhebrew'] = 0xFB4B; - t['vavvavhebrew'] = 0x05F0; - t['vavyodhebrew'] = 0x05F1; - t['vcircle'] = 0x24E5; - t['vdotbelow'] = 0x1E7F; - t['vecyrillic'] = 0x0432; - t['veharabic'] = 0x06A4; - t['vehfinalarabic'] = 0xFB6B; - t['vehinitialarabic'] = 0xFB6C; - t['vehmedialarabic'] = 0xFB6D; - t['vekatakana'] = 0x30F9; - t['venus'] = 0x2640; - t['verticalbar'] = 0x007C; - t['verticallineabovecmb'] = 0x030D; - t['verticallinebelowcmb'] = 0x0329; - t['verticallinelowmod'] = 0x02CC; - t['verticallinemod'] = 0x02C8; - t['vewarmenian'] = 0x057E; - t['vhook'] = 0x028B; - t['vikatakana'] = 0x30F8; - t['viramabengali'] = 0x09CD; - t['viramadeva'] = 0x094D; - t['viramagujarati'] = 0x0ACD; - t['visargabengali'] = 0x0983; - t['visargadeva'] = 0x0903; - t['visargagujarati'] = 0x0A83; - t['vmonospace'] = 0xFF56; - t['voarmenian'] = 0x0578; - t['voicediterationhiragana'] = 0x309E; - t['voicediterationkatakana'] = 0x30FE; - t['voicedmarkkana'] = 0x309B; - t['voicedmarkkanahalfwidth'] = 0xFF9E; - t['vokatakana'] = 0x30FA; - t['vparen'] = 0x24B1; - t['vtilde'] = 0x1E7D; - t['vturned'] = 0x028C; - t['vuhiragana'] = 0x3094; - t['vukatakana'] = 0x30F4; - t['w'] = 0x0077; - t['wacute'] = 0x1E83; - t['waekorean'] = 0x3159; - t['wahiragana'] = 0x308F; - t['wakatakana'] = 0x30EF; - t['wakatakanahalfwidth'] = 0xFF9C; - t['wakorean'] = 0x3158; - t['wasmallhiragana'] = 0x308E; - t['wasmallkatakana'] = 0x30EE; - t['wattosquare'] = 0x3357; - t['wavedash'] = 0x301C; - t['wavyunderscorevertical'] = 0xFE34; - t['wawarabic'] = 0x0648; - t['wawfinalarabic'] = 0xFEEE; - t['wawhamzaabovearabic'] = 0x0624; - t['wawhamzaabovefinalarabic'] = 0xFE86; - t['wbsquare'] = 0x33DD; - t['wcircle'] = 0x24E6; - t['wcircumflex'] = 0x0175; - t['wdieresis'] = 0x1E85; - t['wdotaccent'] = 0x1E87; - t['wdotbelow'] = 0x1E89; - t['wehiragana'] = 0x3091; - t['weierstrass'] = 0x2118; - t['wekatakana'] = 0x30F1; - t['wekorean'] = 0x315E; - t['weokorean'] = 0x315D; - t['wgrave'] = 0x1E81; - t['whitebullet'] = 0x25E6; - t['whitecircle'] = 0x25CB; - t['whitecircleinverse'] = 0x25D9; - t['whitecornerbracketleft'] = 0x300E; - t['whitecornerbracketleftvertical'] = 0xFE43; - t['whitecornerbracketright'] = 0x300F; - t['whitecornerbracketrightvertical'] = 0xFE44; - t['whitediamond'] = 0x25C7; - t['whitediamondcontainingblacksmalldiamond'] = 0x25C8; - t['whitedownpointingsmalltriangle'] = 0x25BF; - t['whitedownpointingtriangle'] = 0x25BD; - t['whiteleftpointingsmalltriangle'] = 0x25C3; - t['whiteleftpointingtriangle'] = 0x25C1; - t['whitelenticularbracketleft'] = 0x3016; - t['whitelenticularbracketright'] = 0x3017; - t['whiterightpointingsmalltriangle'] = 0x25B9; - t['whiterightpointingtriangle'] = 0x25B7; - t['whitesmallsquare'] = 0x25AB; - t['whitesmilingface'] = 0x263A; - t['whitesquare'] = 0x25A1; - t['whitestar'] = 0x2606; - t['whitetelephone'] = 0x260F; - t['whitetortoiseshellbracketleft'] = 0x3018; - t['whitetortoiseshellbracketright'] = 0x3019; - t['whiteuppointingsmalltriangle'] = 0x25B5; - t['whiteuppointingtriangle'] = 0x25B3; - t['wihiragana'] = 0x3090; - t['wikatakana'] = 0x30F0; - t['wikorean'] = 0x315F; - t['wmonospace'] = 0xFF57; - t['wohiragana'] = 0x3092; - t['wokatakana'] = 0x30F2; - t['wokatakanahalfwidth'] = 0xFF66; - t['won'] = 0x20A9; - t['wonmonospace'] = 0xFFE6; - t['wowaenthai'] = 0x0E27; - t['wparen'] = 0x24B2; - t['wring'] = 0x1E98; - t['wsuperior'] = 0x02B7; - t['wturned'] = 0x028D; - t['wynn'] = 0x01BF; - t['x'] = 0x0078; - t['xabovecmb'] = 0x033D; - t['xbopomofo'] = 0x3112; - t['xcircle'] = 0x24E7; - t['xdieresis'] = 0x1E8D; - t['xdotaccent'] = 0x1E8B; - t['xeharmenian'] = 0x056D; - t['xi'] = 0x03BE; - t['xmonospace'] = 0xFF58; - t['xparen'] = 0x24B3; - t['xsuperior'] = 0x02E3; - t['y'] = 0x0079; - t['yaadosquare'] = 0x334E; - t['yabengali'] = 0x09AF; - t['yacute'] = 0x00FD; - t['yadeva'] = 0x092F; - t['yaekorean'] = 0x3152; - t['yagujarati'] = 0x0AAF; - t['yagurmukhi'] = 0x0A2F; - t['yahiragana'] = 0x3084; - t['yakatakana'] = 0x30E4; - t['yakatakanahalfwidth'] = 0xFF94; - t['yakorean'] = 0x3151; - t['yamakkanthai'] = 0x0E4E; - t['yasmallhiragana'] = 0x3083; - t['yasmallkatakana'] = 0x30E3; - t['yasmallkatakanahalfwidth'] = 0xFF6C; - t['yatcyrillic'] = 0x0463; - t['ycircle'] = 0x24E8; - t['ycircumflex'] = 0x0177; - t['ydieresis'] = 0x00FF; - t['ydotaccent'] = 0x1E8F; - t['ydotbelow'] = 0x1EF5; - t['yeharabic'] = 0x064A; - t['yehbarreearabic'] = 0x06D2; - t['yehbarreefinalarabic'] = 0xFBAF; - t['yehfinalarabic'] = 0xFEF2; - t['yehhamzaabovearabic'] = 0x0626; - t['yehhamzaabovefinalarabic'] = 0xFE8A; - t['yehhamzaaboveinitialarabic'] = 0xFE8B; - t['yehhamzaabovemedialarabic'] = 0xFE8C; - t['yehinitialarabic'] = 0xFEF3; - t['yehmedialarabic'] = 0xFEF4; - t['yehmeeminitialarabic'] = 0xFCDD; - t['yehmeemisolatedarabic'] = 0xFC58; - t['yehnoonfinalarabic'] = 0xFC94; - t['yehthreedotsbelowarabic'] = 0x06D1; - t['yekorean'] = 0x3156; - t['yen'] = 0x00A5; - t['yenmonospace'] = 0xFFE5; - t['yeokorean'] = 0x3155; - t['yeorinhieuhkorean'] = 0x3186; - t['yerahbenyomohebrew'] = 0x05AA; - t['yerahbenyomolefthebrew'] = 0x05AA; - t['yericyrillic'] = 0x044B; - t['yerudieresiscyrillic'] = 0x04F9; - t['yesieungkorean'] = 0x3181; - t['yesieungpansioskorean'] = 0x3183; - t['yesieungsioskorean'] = 0x3182; - t['yetivhebrew'] = 0x059A; - t['ygrave'] = 0x1EF3; - t['yhook'] = 0x01B4; - t['yhookabove'] = 0x1EF7; - t['yiarmenian'] = 0x0575; - t['yicyrillic'] = 0x0457; - t['yikorean'] = 0x3162; - t['yinyang'] = 0x262F; - t['yiwnarmenian'] = 0x0582; - t['ymonospace'] = 0xFF59; - t['yod'] = 0x05D9; - t['yoddagesh'] = 0xFB39; - t['yoddageshhebrew'] = 0xFB39; - t['yodhebrew'] = 0x05D9; - t['yodyodhebrew'] = 0x05F2; - t['yodyodpatahhebrew'] = 0xFB1F; - t['yohiragana'] = 0x3088; - t['yoikorean'] = 0x3189; - t['yokatakana'] = 0x30E8; - t['yokatakanahalfwidth'] = 0xFF96; - t['yokorean'] = 0x315B; - t['yosmallhiragana'] = 0x3087; - t['yosmallkatakana'] = 0x30E7; - t['yosmallkatakanahalfwidth'] = 0xFF6E; - t['yotgreek'] = 0x03F3; - t['yoyaekorean'] = 0x3188; - t['yoyakorean'] = 0x3187; - t['yoyakthai'] = 0x0E22; - t['yoyingthai'] = 0x0E0D; - t['yparen'] = 0x24B4; - t['ypogegrammeni'] = 0x037A; - t['ypogegrammenigreekcmb'] = 0x0345; - t['yr'] = 0x01A6; - t['yring'] = 0x1E99; - t['ysuperior'] = 0x02B8; - t['ytilde'] = 0x1EF9; - t['yturned'] = 0x028E; - t['yuhiragana'] = 0x3086; - t['yuikorean'] = 0x318C; - t['yukatakana'] = 0x30E6; - t['yukatakanahalfwidth'] = 0xFF95; - t['yukorean'] = 0x3160; - t['yusbigcyrillic'] = 0x046B; - t['yusbigiotifiedcyrillic'] = 0x046D; - t['yuslittlecyrillic'] = 0x0467; - t['yuslittleiotifiedcyrillic'] = 0x0469; - t['yusmallhiragana'] = 0x3085; - t['yusmallkatakana'] = 0x30E5; - t['yusmallkatakanahalfwidth'] = 0xFF6D; - t['yuyekorean'] = 0x318B; - t['yuyeokorean'] = 0x318A; - t['yyabengali'] = 0x09DF; - t['yyadeva'] = 0x095F; - t['z'] = 0x007A; - t['zaarmenian'] = 0x0566; - t['zacute'] = 0x017A; - t['zadeva'] = 0x095B; - t['zagurmukhi'] = 0x0A5B; - t['zaharabic'] = 0x0638; - t['zahfinalarabic'] = 0xFEC6; - t['zahinitialarabic'] = 0xFEC7; - t['zahiragana'] = 0x3056; - t['zahmedialarabic'] = 0xFEC8; - t['zainarabic'] = 0x0632; - t['zainfinalarabic'] = 0xFEB0; - t['zakatakana'] = 0x30B6; - t['zaqefgadolhebrew'] = 0x0595; - t['zaqefqatanhebrew'] = 0x0594; - t['zarqahebrew'] = 0x0598; - t['zayin'] = 0x05D6; - t['zayindagesh'] = 0xFB36; - t['zayindageshhebrew'] = 0xFB36; - t['zayinhebrew'] = 0x05D6; - t['zbopomofo'] = 0x3117; - t['zcaron'] = 0x017E; - t['zcircle'] = 0x24E9; - t['zcircumflex'] = 0x1E91; - t['zcurl'] = 0x0291; - t['zdot'] = 0x017C; - t['zdotaccent'] = 0x017C; - t['zdotbelow'] = 0x1E93; - t['zecyrillic'] = 0x0437; - t['zedescendercyrillic'] = 0x0499; - t['zedieresiscyrillic'] = 0x04DF; - t['zehiragana'] = 0x305C; - t['zekatakana'] = 0x30BC; - t['zero'] = 0x0030; - t['zeroarabic'] = 0x0660; - t['zerobengali'] = 0x09E6; - t['zerodeva'] = 0x0966; - t['zerogujarati'] = 0x0AE6; - t['zerogurmukhi'] = 0x0A66; - t['zerohackarabic'] = 0x0660; - t['zeroinferior'] = 0x2080; - t['zeromonospace'] = 0xFF10; - t['zerooldstyle'] = 0xF730; - t['zeropersian'] = 0x06F0; - t['zerosuperior'] = 0x2070; - t['zerothai'] = 0x0E50; - t['zerowidthjoiner'] = 0xFEFF; - t['zerowidthnonjoiner'] = 0x200C; - t['zerowidthspace'] = 0x200B; - t['zeta'] = 0x03B6; - t['zhbopomofo'] = 0x3113; - t['zhearmenian'] = 0x056A; - t['zhebrevecyrillic'] = 0x04C2; - t['zhecyrillic'] = 0x0436; - t['zhedescendercyrillic'] = 0x0497; - t['zhedieresiscyrillic'] = 0x04DD; - t['zihiragana'] = 0x3058; - t['zikatakana'] = 0x30B8; - t['zinorhebrew'] = 0x05AE; - t['zlinebelow'] = 0x1E95; - t['zmonospace'] = 0xFF5A; - t['zohiragana'] = 0x305E; - t['zokatakana'] = 0x30BE; - t['zparen'] = 0x24B5; - t['zretroflexhook'] = 0x0290; - t['zstroke'] = 0x01B6; - t['zuhiragana'] = 0x305A; - t['zukatakana'] = 0x30BA; - t['.notdef'] = 0x0000; -}); - -var getDingbatsGlyphsUnicode = getLookupTableFactory(function (t) { - t['space'] = 0x0020; - t['a1'] = 0x2701; - t['a2'] = 0x2702; - t['a202'] = 0x2703; - t['a3'] = 0x2704; - t['a4'] = 0x260E; - t['a5'] = 0x2706; - t['a119'] = 0x2707; - t['a118'] = 0x2708; - t['a117'] = 0x2709; - t['a11'] = 0x261B; - t['a12'] = 0x261E; - t['a13'] = 0x270C; - t['a14'] = 0x270D; - t['a15'] = 0x270E; - t['a16'] = 0x270F; - t['a105'] = 0x2710; - t['a17'] = 0x2711; - t['a18'] = 0x2712; - t['a19'] = 0x2713; - t['a20'] = 0x2714; - t['a21'] = 0x2715; - t['a22'] = 0x2716; - t['a23'] = 0x2717; - t['a24'] = 0x2718; - t['a25'] = 0x2719; - t['a26'] = 0x271A; - t['a27'] = 0x271B; - t['a28'] = 0x271C; - t['a6'] = 0x271D; - t['a7'] = 0x271E; - t['a8'] = 0x271F; - t['a9'] = 0x2720; - t['a10'] = 0x2721; - t['a29'] = 0x2722; - t['a30'] = 0x2723; - t['a31'] = 0x2724; - t['a32'] = 0x2725; - t['a33'] = 0x2726; - t['a34'] = 0x2727; - t['a35'] = 0x2605; - t['a36'] = 0x2729; - t['a37'] = 0x272A; - t['a38'] = 0x272B; - t['a39'] = 0x272C; - t['a40'] = 0x272D; - t['a41'] = 0x272E; - t['a42'] = 0x272F; - t['a43'] = 0x2730; - t['a44'] = 0x2731; - t['a45'] = 0x2732; - t['a46'] = 0x2733; - t['a47'] = 0x2734; - t['a48'] = 0x2735; - t['a49'] = 0x2736; - t['a50'] = 0x2737; - t['a51'] = 0x2738; - t['a52'] = 0x2739; - t['a53'] = 0x273A; - t['a54'] = 0x273B; - t['a55'] = 0x273C; - t['a56'] = 0x273D; - t['a57'] = 0x273E; - t['a58'] = 0x273F; - t['a59'] = 0x2740; - t['a60'] = 0x2741; - t['a61'] = 0x2742; - t['a62'] = 0x2743; - t['a63'] = 0x2744; - t['a64'] = 0x2745; - t['a65'] = 0x2746; - t['a66'] = 0x2747; - t['a67'] = 0x2748; - t['a68'] = 0x2749; - t['a69'] = 0x274A; - t['a70'] = 0x274B; - t['a71'] = 0x25CF; - t['a72'] = 0x274D; - t['a73'] = 0x25A0; - t['a74'] = 0x274F; - t['a203'] = 0x2750; - t['a75'] = 0x2751; - t['a204'] = 0x2752; - t['a76'] = 0x25B2; - t['a77'] = 0x25BC; - t['a78'] = 0x25C6; - t['a79'] = 0x2756; - t['a81'] = 0x25D7; - t['a82'] = 0x2758; - t['a83'] = 0x2759; - t['a84'] = 0x275A; - t['a97'] = 0x275B; - t['a98'] = 0x275C; - t['a99'] = 0x275D; - t['a100'] = 0x275E; - t['a101'] = 0x2761; - t['a102'] = 0x2762; - t['a103'] = 0x2763; - t['a104'] = 0x2764; - t['a106'] = 0x2765; - t['a107'] = 0x2766; - t['a108'] = 0x2767; - t['a112'] = 0x2663; - t['a111'] = 0x2666; - t['a110'] = 0x2665; - t['a109'] = 0x2660; - t['a120'] = 0x2460; - t['a121'] = 0x2461; - t['a122'] = 0x2462; - t['a123'] = 0x2463; - t['a124'] = 0x2464; - t['a125'] = 0x2465; - t['a126'] = 0x2466; - t['a127'] = 0x2467; - t['a128'] = 0x2468; - t['a129'] = 0x2469; - t['a130'] = 0x2776; - t['a131'] = 0x2777; - t['a132'] = 0x2778; - t['a133'] = 0x2779; - t['a134'] = 0x277A; - t['a135'] = 0x277B; - t['a136'] = 0x277C; - t['a137'] = 0x277D; - t['a138'] = 0x277E; - t['a139'] = 0x277F; - t['a140'] = 0x2780; - t['a141'] = 0x2781; - t['a142'] = 0x2782; - t['a143'] = 0x2783; - t['a144'] = 0x2784; - t['a145'] = 0x2785; - t['a146'] = 0x2786; - t['a147'] = 0x2787; - t['a148'] = 0x2788; - t['a149'] = 0x2789; - t['a150'] = 0x278A; - t['a151'] = 0x278B; - t['a152'] = 0x278C; - t['a153'] = 0x278D; - t['a154'] = 0x278E; - t['a155'] = 0x278F; - t['a156'] = 0x2790; - t['a157'] = 0x2791; - t['a158'] = 0x2792; - t['a159'] = 0x2793; - t['a160'] = 0x2794; - t['a161'] = 0x2192; - t['a163'] = 0x2194; - t['a164'] = 0x2195; - t['a196'] = 0x2798; - t['a165'] = 0x2799; - t['a192'] = 0x279A; - t['a166'] = 0x279B; - t['a167'] = 0x279C; - t['a168'] = 0x279D; - t['a169'] = 0x279E; - t['a170'] = 0x279F; - t['a171'] = 0x27A0; - t['a172'] = 0x27A1; - t['a173'] = 0x27A2; - t['a162'] = 0x27A3; - t['a174'] = 0x27A4; - t['a175'] = 0x27A5; - t['a176'] = 0x27A6; - t['a177'] = 0x27A7; - t['a178'] = 0x27A8; - t['a179'] = 0x27A9; - t['a193'] = 0x27AA; - t['a180'] = 0x27AB; - t['a199'] = 0x27AC; - t['a181'] = 0x27AD; - t['a200'] = 0x27AE; - t['a182'] = 0x27AF; - t['a201'] = 0x27B1; - t['a183'] = 0x27B2; - t['a184'] = 0x27B3; - t['a197'] = 0x27B4; - t['a185'] = 0x27B5; - t['a194'] = 0x27B6; - t['a198'] = 0x27B7; - t['a186'] = 0x27B8; - t['a195'] = 0x27B9; - t['a187'] = 0x27BA; - t['a188'] = 0x27BB; - t['a189'] = 0x27BC; - t['a190'] = 0x27BD; - t['a191'] = 0x27BE; - t['a89'] = 0x2768; // 0xF8D7 - t['a90'] = 0x2769; // 0xF8D8 - t['a93'] = 0x276A; // 0xF8D9 - t['a94'] = 0x276B; // 0xF8DA - t['a91'] = 0x276C; // 0xF8DB - t['a92'] = 0x276D; // 0xF8DC - t['a205'] = 0x276E; // 0xF8DD - t['a85'] = 0x276F; // 0xF8DE - t['a206'] = 0x2770; // 0xF8DF - t['a86'] = 0x2771; // 0xF8E0 - t['a87'] = 0x2772; // 0xF8E1 - t['a88'] = 0x2773; // 0xF8E2 - t['a95'] = 0x2774; // 0xF8E3 - t['a96'] = 0x2775; // 0xF8E4 - t['.notdef'] = 0x0000; -}); - -exports.getGlyphsUnicode = getGlyphsUnicode; -exports.getDingbatsGlyphsUnicode = getDingbatsGlyphsUnicode; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreJbig2 = {}), root.pdfjsSharedUtil, - root.pdfjsCoreArithmeticDecoder); - } -}(this, function (exports, sharedUtil, coreArithmeticDecoder) { - -var error = sharedUtil.error; -var log2 = sharedUtil.log2; -var readInt8 = sharedUtil.readInt8; -var readUint16 = sharedUtil.readUint16; -var readUint32 = sharedUtil.readUint32; -var shadow = sharedUtil.shadow; -var ArithmeticDecoder = coreArithmeticDecoder.ArithmeticDecoder; - -var Jbig2Image = (function Jbig2ImageClosure() { - // Utility data structures - function ContextCache() {} - - ContextCache.prototype = { - getContexts: function(id) { - if (id in this) { - return this[id]; - } - return (this[id] = new Int8Array(1 << 16)); - } - }; - - function DecodingContext(data, start, end) { - this.data = data; - this.start = start; - this.end = end; - } - - DecodingContext.prototype = { - get decoder() { - var decoder = new ArithmeticDecoder(this.data, this.start, this.end); - return shadow(this, 'decoder', decoder); - }, - get contextCache() { - var cache = new ContextCache(); - return shadow(this, 'contextCache', cache); - } - }; - - // Annex A. Arithmetic Integer Decoding Procedure - // A.2 Procedure for decoding values - function decodeInteger(contextCache, procedure, decoder) { - var contexts = contextCache.getContexts(procedure); - var prev = 1; - - function readBits(length) { - var v = 0; - for (var i = 0; i < length; i++) { - var bit = decoder.readBit(contexts, prev); - prev = (prev < 256 ? (prev << 1) | bit : - (((prev << 1) | bit) & 511) | 256); - v = (v << 1) | bit; - } - return v >>> 0; - } - - var sign = readBits(1); - var value = readBits(1) ? - (readBits(1) ? - (readBits(1) ? - (readBits(1) ? - (readBits(1) ? - (readBits(32) + 4436) : - readBits(12) + 340) : - readBits(8) + 84) : - readBits(6) + 20) : - readBits(4) + 4) : - readBits(2); - return (sign === 0 ? value : (value > 0 ? -value : null)); - } - - // A.3 The IAID decoding procedure - function decodeIAID(contextCache, decoder, codeLength) { - var contexts = contextCache.getContexts('IAID'); - - var prev = 1; - for (var i = 0; i < codeLength; i++) { - var bit = decoder.readBit(contexts, prev); - prev = (prev << 1) | bit; - } - if (codeLength < 31) { - return prev & ((1 << codeLength) - 1); - } - return prev & 0x7FFFFFFF; - } - - // 7.3 Segment types - var SegmentTypes = [ - 'SymbolDictionary', null, null, null, 'IntermediateTextRegion', null, - 'ImmediateTextRegion', 'ImmediateLosslessTextRegion', null, null, null, - null, null, null, null, null, 'patternDictionary', null, null, null, - 'IntermediateHalftoneRegion', null, 'ImmediateHalftoneRegion', - 'ImmediateLosslessHalftoneRegion', null, null, null, null, null, null, null, - null, null, null, null, null, 'IntermediateGenericRegion', null, - 'ImmediateGenericRegion', 'ImmediateLosslessGenericRegion', - 'IntermediateGenericRefinementRegion', null, - 'ImmediateGenericRefinementRegion', - 'ImmediateLosslessGenericRefinementRegion', null, null, null, null, - 'PageInformation', 'EndOfPage', 'EndOfStripe', 'EndOfFile', 'Profiles', - 'Tables', null, null, null, null, null, null, null, null, - 'Extension' - ]; - - var CodingTemplates = [ - [{x: -1, y: -2}, {x: 0, y: -2}, {x: 1, y: -2}, {x: -2, y: -1}, - {x: -1, y: -1}, {x: 0, y: -1}, {x: 1, y: -1}, {x: 2, y: -1}, - {x: -4, y: 0}, {x: -3, y: 0}, {x: -2, y: 0}, {x: -1, y: 0}], - [{x: -1, y: -2}, {x: 0, y: -2}, {x: 1, y: -2}, {x: 2, y: -2}, - {x: -2, y: -1}, {x: -1, y: -1}, {x: 0, y: -1}, {x: 1, y: -1}, - {x: 2, y: -1}, {x: -3, y: 0}, {x: -2, y: 0}, {x: -1, y: 0}], - [{x: -1, y: -2}, {x: 0, y: -2}, {x: 1, y: -2}, {x: -2, y: -1}, - {x: -1, y: -1}, {x: 0, y: -1}, {x: 1, y: -1}, {x: -2, y: 0}, - {x: -1, y: 0}], - [{x: -3, y: -1}, {x: -2, y: -1}, {x: -1, y: -1}, {x: 0, y: -1}, - {x: 1, y: -1}, {x: -4, y: 0}, {x: -3, y: 0}, {x: -2, y: 0}, {x: -1, y: 0}] - ]; - - var RefinementTemplates = [ - { - coding: [{x: 0, y: -1}, {x: 1, y: -1}, {x: -1, y: 0}], - reference: [{x: 0, y: -1}, {x: 1, y: -1}, {x: -1, y: 0}, {x: 0, y: 0}, - {x: 1, y: 0}, {x: -1, y: 1}, {x: 0, y: 1}, {x: 1, y: 1}] - }, - { - coding: [{x: -1, y: -1}, {x: 0, y: -1}, {x: 1, y: -1}, {x: -1, y: 0}], - reference: [{x: 0, y: -1}, {x: -1, y: 0}, {x: 0, y: 0}, {x: 1, y: 0}, - {x: 0, y: 1}, {x: 1, y: 1}] - } - ]; - - // See 6.2.5.7 Decoding the bitmap. - var ReusedContexts = [ - 0x9B25, // 10011 0110010 0101 - 0x0795, // 0011 110010 101 - 0x00E5, // 001 11001 01 - 0x0195 // 011001 0101 - ]; - - var RefinementReusedContexts = [ - 0x0020, // '000' + '0' (coding) + '00010000' + '0' (reference) - 0x0008 // '0000' + '001000' - ]; - - function decodeBitmapTemplate0(width, height, decodingContext) { - var decoder = decodingContext.decoder; - var contexts = decodingContext.contextCache.getContexts('GB'); - var contextLabel, i, j, pixel, row, row1, row2, bitmap = []; - - // ...ooooo.... - // ..ooooooo... Context template for current pixel (X) - // .ooooX...... (concatenate values of 'o'-pixels to get contextLabel) - var OLD_PIXEL_MASK = 0x7BF7; // 01111 0111111 0111 - - for (i = 0; i < height; i++) { - row = bitmap[i] = new Uint8Array(width); - row1 = (i < 1) ? row : bitmap[i - 1]; - row2 = (i < 2) ? row : bitmap[i - 2]; - - // At the beginning of each row: - // Fill contextLabel with pixels that are above/right of (X) - contextLabel = (row2[0] << 13) | (row2[1] << 12) | (row2[2] << 11) | - (row1[0] << 7) | (row1[1] << 6) | (row1[2] << 5) | - (row1[3] << 4); - - for (j = 0; j < width; j++) { - row[j] = pixel = decoder.readBit(contexts, contextLabel); - - // At each pixel: Clear contextLabel pixels that are shifted - // out of the context, then add new ones. - contextLabel = ((contextLabel & OLD_PIXEL_MASK) << 1) | - (j + 3 < width ? row2[j + 3] << 11 : 0) | - (j + 4 < width ? row1[j + 4] << 4 : 0) | pixel; - } - } - - return bitmap; - } - - // 6.2 Generic Region Decoding Procedure - function decodeBitmap(mmr, width, height, templateIndex, prediction, skip, at, - decodingContext) { - if (mmr) { - error('JBIG2 error: MMR encoding is not supported'); - } - - // Use optimized version for the most common case - if (templateIndex === 0 && !skip && !prediction && at.length === 4 && - at[0].x === 3 && at[0].y === -1 && at[1].x === -3 && at[1].y === -1 && - at[2].x === 2 && at[2].y === -2 && at[3].x === -2 && at[3].y === -2) { - return decodeBitmapTemplate0(width, height, decodingContext); - } - - var useskip = !!skip; - var template = CodingTemplates[templateIndex].concat(at); - - // Sorting is non-standard, and it is not required. But sorting increases - // the number of template bits that can be reused from the previous - // contextLabel in the main loop. - template.sort(function (a, b) { - return (a.y - b.y) || (a.x - b.x); - }); - - var templateLength = template.length; - var templateX = new Int8Array(templateLength); - var templateY = new Int8Array(templateLength); - var changingTemplateEntries = []; - var reuseMask = 0, minX = 0, maxX = 0, minY = 0; - var c, k; - - for (k = 0; k < templateLength; k++) { - templateX[k] = template[k].x; - templateY[k] = template[k].y; - minX = Math.min(minX, template[k].x); - maxX = Math.max(maxX, template[k].x); - minY = Math.min(minY, template[k].y); - // Check if the template pixel appears in two consecutive context labels, - // so it can be reused. Otherwise, we add it to the list of changing - // template entries. - if (k < templateLength - 1 && - template[k].y === template[k + 1].y && - template[k].x === template[k + 1].x - 1) { - reuseMask |= 1 << (templateLength - 1 - k); - } else { - changingTemplateEntries.push(k); - } - } - var changingEntriesLength = changingTemplateEntries.length; - - var changingTemplateX = new Int8Array(changingEntriesLength); - var changingTemplateY = new Int8Array(changingEntriesLength); - var changingTemplateBit = new Uint16Array(changingEntriesLength); - for (c = 0; c < changingEntriesLength; c++) { - k = changingTemplateEntries[c]; - changingTemplateX[c] = template[k].x; - changingTemplateY[c] = template[k].y; - changingTemplateBit[c] = 1 << (templateLength - 1 - k); - } - - // Get the safe bounding box edges from the width, height, minX, maxX, minY - var sbb_left = -minX; - var sbb_top = -minY; - var sbb_right = width - maxX; - - var pseudoPixelContext = ReusedContexts[templateIndex]; - var row = new Uint8Array(width); - var bitmap = []; - - var decoder = decodingContext.decoder; - var contexts = decodingContext.contextCache.getContexts('GB'); - - var ltp = 0, j, i0, j0, contextLabel = 0, bit, shift; - for (var i = 0; i < height; i++) { - if (prediction) { - var sltp = decoder.readBit(contexts, pseudoPixelContext); - ltp ^= sltp; - if (ltp) { - bitmap.push(row); // duplicate previous row - continue; - } - } - row = new Uint8Array(row); - bitmap.push(row); - for (j = 0; j < width; j++) { - if (useskip && skip[i][j]) { - row[j] = 0; - continue; - } - // Are we in the middle of a scanline, so we can reuse contextLabel - // bits? - if (j >= sbb_left && j < sbb_right && i >= sbb_top) { - // If yes, we can just shift the bits that are reusable and only - // fetch the remaining ones. - contextLabel = (contextLabel << 1) & reuseMask; - for (k = 0; k < changingEntriesLength; k++) { - i0 = i + changingTemplateY[k]; - j0 = j + changingTemplateX[k]; - bit = bitmap[i0][j0]; - if (bit) { - bit = changingTemplateBit[k]; - contextLabel |= bit; - } - } - } else { - // compute the contextLabel from scratch - contextLabel = 0; - shift = templateLength - 1; - for (k = 0; k < templateLength; k++, shift--) { - j0 = j + templateX[k]; - if (j0 >= 0 && j0 < width) { - i0 = i + templateY[k]; - if (i0 >= 0) { - bit = bitmap[i0][j0]; - if (bit) { - contextLabel |= bit << shift; - } - } - } - } - } - var pixel = decoder.readBit(contexts, contextLabel); - row[j] = pixel; - } - } - return bitmap; - } - - // 6.3.2 Generic Refinement Region Decoding Procedure - function decodeRefinement(width, height, templateIndex, referenceBitmap, - offsetX, offsetY, prediction, at, - decodingContext) { - var codingTemplate = RefinementTemplates[templateIndex].coding; - if (templateIndex === 0) { - codingTemplate = codingTemplate.concat([at[0]]); - } - var codingTemplateLength = codingTemplate.length; - var codingTemplateX = new Int32Array(codingTemplateLength); - var codingTemplateY = new Int32Array(codingTemplateLength); - var k; - for (k = 0; k < codingTemplateLength; k++) { - codingTemplateX[k] = codingTemplate[k].x; - codingTemplateY[k] = codingTemplate[k].y; - } - - var referenceTemplate = RefinementTemplates[templateIndex].reference; - if (templateIndex === 0) { - referenceTemplate = referenceTemplate.concat([at[1]]); - } - var referenceTemplateLength = referenceTemplate.length; - var referenceTemplateX = new Int32Array(referenceTemplateLength); - var referenceTemplateY = new Int32Array(referenceTemplateLength); - for (k = 0; k < referenceTemplateLength; k++) { - referenceTemplateX[k] = referenceTemplate[k].x; - referenceTemplateY[k] = referenceTemplate[k].y; - } - var referenceWidth = referenceBitmap[0].length; - var referenceHeight = referenceBitmap.length; - - var pseudoPixelContext = RefinementReusedContexts[templateIndex]; - var bitmap = []; - - var decoder = decodingContext.decoder; - var contexts = decodingContext.contextCache.getContexts('GR'); - - var ltp = 0; - for (var i = 0; i < height; i++) { - if (prediction) { - var sltp = decoder.readBit(contexts, pseudoPixelContext); - ltp ^= sltp; - if (ltp) { - error('JBIG2 error: prediction is not supported'); - } - } - var row = new Uint8Array(width); - bitmap.push(row); - for (var j = 0; j < width; j++) { - var i0, j0; - var contextLabel = 0; - for (k = 0; k < codingTemplateLength; k++) { - i0 = i + codingTemplateY[k]; - j0 = j + codingTemplateX[k]; - if (i0 < 0 || j0 < 0 || j0 >= width) { - contextLabel <<= 1; // out of bound pixel - } else { - contextLabel = (contextLabel << 1) | bitmap[i0][j0]; - } - } - for (k = 0; k < referenceTemplateLength; k++) { - i0 = i + referenceTemplateY[k] + offsetY; - j0 = j + referenceTemplateX[k] + offsetX; - if (i0 < 0 || i0 >= referenceHeight || j0 < 0 || - j0 >= referenceWidth) { - contextLabel <<= 1; // out of bound pixel - } else { - contextLabel = (contextLabel << 1) | referenceBitmap[i0][j0]; - } - } - var pixel = decoder.readBit(contexts, contextLabel); - row[j] = pixel; - } - } - - return bitmap; - } - - // 6.5.5 Decoding the symbol dictionary - function decodeSymbolDictionary(huffman, refinement, symbols, - numberOfNewSymbols, numberOfExportedSymbols, - huffmanTables, templateIndex, at, - refinementTemplateIndex, refinementAt, - decodingContext) { - if (huffman) { - error('JBIG2 error: huffman is not supported'); - } - - var newSymbols = []; - var currentHeight = 0; - var symbolCodeLength = log2(symbols.length + numberOfNewSymbols); - - var decoder = decodingContext.decoder; - var contextCache = decodingContext.contextCache; - - while (newSymbols.length < numberOfNewSymbols) { - var deltaHeight = decodeInteger(contextCache, 'IADH', decoder); // 6.5.6 - currentHeight += deltaHeight; - var currentWidth = 0; - var totalWidth = 0; - while (true) { - var deltaWidth = decodeInteger(contextCache, 'IADW', decoder); // 6.5.7 - if (deltaWidth === null) { - break; // OOB - } - currentWidth += deltaWidth; - totalWidth += currentWidth; - var bitmap; - if (refinement) { - // 6.5.8.2 Refinement/aggregate-coded symbol bitmap - var numberOfInstances = decodeInteger(contextCache, 'IAAI', decoder); - if (numberOfInstances > 1) { - bitmap = decodeTextRegion(huffman, refinement, - currentWidth, currentHeight, 0, - numberOfInstances, 1, //strip size - symbols.concat(newSymbols), - symbolCodeLength, - 0, //transposed - 0, //ds offset - 1, //top left 7.4.3.1.1 - 0, //OR operator - huffmanTables, - refinementTemplateIndex, refinementAt, - decodingContext); - } else { - var symbolId = decodeIAID(contextCache, decoder, symbolCodeLength); - var rdx = decodeInteger(contextCache, 'IARDX', decoder); // 6.4.11.3 - var rdy = decodeInteger(contextCache, 'IARDY', decoder); // 6.4.11.4 - var symbol = (symbolId < symbols.length ? symbols[symbolId] : - newSymbols[symbolId - symbols.length]); - bitmap = decodeRefinement(currentWidth, currentHeight, - refinementTemplateIndex, symbol, rdx, rdy, false, refinementAt, - decodingContext); - } - } else { - // 6.5.8.1 Direct-coded symbol bitmap - bitmap = decodeBitmap(false, currentWidth, currentHeight, - templateIndex, false, null, at, decodingContext); - } - newSymbols.push(bitmap); - } - } - // 6.5.10 Exported symbols - var exportedSymbols = []; - var flags = [], currentFlag = false; - var totalSymbolsLength = symbols.length + numberOfNewSymbols; - while (flags.length < totalSymbolsLength) { - var runLength = decodeInteger(contextCache, 'IAEX', decoder); - while (runLength--) { - flags.push(currentFlag); - } - currentFlag = !currentFlag; - } - for (var i = 0, ii = symbols.length; i < ii; i++) { - if (flags[i]) { - exportedSymbols.push(symbols[i]); - } - } - for (var j = 0; j < numberOfNewSymbols; i++, j++) { - if (flags[i]) { - exportedSymbols.push(newSymbols[j]); - } - } - return exportedSymbols; - } - - function decodeTextRegion(huffman, refinement, width, height, - defaultPixelValue, numberOfSymbolInstances, - stripSize, inputSymbols, symbolCodeLength, - transposed, dsOffset, referenceCorner, - combinationOperator, huffmanTables, - refinementTemplateIndex, refinementAt, - decodingContext) { - if (huffman) { - error('JBIG2 error: huffman is not supported'); - } - - // Prepare bitmap - var bitmap = []; - var i, row; - for (i = 0; i < height; i++) { - row = new Uint8Array(width); - if (defaultPixelValue) { - for (var j = 0; j < width; j++) { - row[j] = defaultPixelValue; - } - } - bitmap.push(row); - } - - var decoder = decodingContext.decoder; - var contextCache = decodingContext.contextCache; - var stripT = -decodeInteger(contextCache, 'IADT', decoder); // 6.4.6 - var firstS = 0; - i = 0; - while (i < numberOfSymbolInstances) { - var deltaT = decodeInteger(contextCache, 'IADT', decoder); // 6.4.6 - stripT += deltaT; - - var deltaFirstS = decodeInteger(contextCache, 'IAFS', decoder); // 6.4.7 - firstS += deltaFirstS; - var currentS = firstS; - do { - var currentT = (stripSize === 1 ? 0 : - decodeInteger(contextCache, 'IAIT', decoder)); // 6.4.9 - var t = stripSize * stripT + currentT; - var symbolId = decodeIAID(contextCache, decoder, symbolCodeLength); - var applyRefinement = (refinement && - decodeInteger(contextCache, 'IARI', decoder)); - var symbolBitmap = inputSymbols[symbolId]; - var symbolWidth = symbolBitmap[0].length; - var symbolHeight = symbolBitmap.length; - if (applyRefinement) { - var rdw = decodeInteger(contextCache, 'IARDW', decoder); // 6.4.11.1 - var rdh = decodeInteger(contextCache, 'IARDH', decoder); // 6.4.11.2 - var rdx = decodeInteger(contextCache, 'IARDX', decoder); // 6.4.11.3 - var rdy = decodeInteger(contextCache, 'IARDY', decoder); // 6.4.11.4 - symbolWidth += rdw; - symbolHeight += rdh; - symbolBitmap = decodeRefinement(symbolWidth, symbolHeight, - refinementTemplateIndex, symbolBitmap, (rdw >> 1) + rdx, - (rdh >> 1) + rdy, false, refinementAt, - decodingContext); - } - var offsetT = t - ((referenceCorner & 1) ? 0 : symbolHeight); - var offsetS = currentS - ((referenceCorner & 2) ? symbolWidth : 0); - var s2, t2, symbolRow; - if (transposed) { - // Place Symbol Bitmap from T1,S1 - for (s2 = 0; s2 < symbolHeight; s2++) { - row = bitmap[offsetS + s2]; - if (!row) { - continue; - } - symbolRow = symbolBitmap[s2]; - // To ignore Parts of Symbol bitmap which goes - // outside bitmap region - var maxWidth = Math.min(width - offsetT, symbolWidth); - switch (combinationOperator) { - case 0: // OR - for (t2 = 0; t2 < maxWidth; t2++) { - row[offsetT + t2] |= symbolRow[t2]; - } - break; - case 2: // XOR - for (t2 = 0; t2 < maxWidth; t2++) { - row[offsetT + t2] ^= symbolRow[t2]; - } - break; - default: - error('JBIG2 error: operator ' + combinationOperator + - ' is not supported'); - } - } - currentS += symbolHeight - 1; - } else { - for (t2 = 0; t2 < symbolHeight; t2++) { - row = bitmap[offsetT + t2]; - if (!row) { - continue; - } - symbolRow = symbolBitmap[t2]; - switch (combinationOperator) { - case 0: // OR - for (s2 = 0; s2 < symbolWidth; s2++) { - row[offsetS + s2] |= symbolRow[s2]; - } - break; - case 2: // XOR - for (s2 = 0; s2 < symbolWidth; s2++) { - row[offsetS + s2] ^= symbolRow[s2]; - } - break; - default: - error('JBIG2 error: operator ' + combinationOperator + - ' is not supported'); - } - } - currentS += symbolWidth - 1; - } - i++; - var deltaS = decodeInteger(contextCache, 'IADS', decoder); // 6.4.8 - if (deltaS === null) { - break; // OOB - } - currentS += deltaS + dsOffset; - } while (true); - } - return bitmap; - } - - function readSegmentHeader(data, start) { - var segmentHeader = {}; - segmentHeader.number = readUint32(data, start); - var flags = data[start + 4]; - var segmentType = flags & 0x3F; - if (!SegmentTypes[segmentType]) { - error('JBIG2 error: invalid segment type: ' + segmentType); - } - segmentHeader.type = segmentType; - segmentHeader.typeName = SegmentTypes[segmentType]; - segmentHeader.deferredNonRetain = !!(flags & 0x80); - - var pageAssociationFieldSize = !!(flags & 0x40); - var referredFlags = data[start + 5]; - var referredToCount = (referredFlags >> 5) & 7; - var retainBits = [referredFlags & 31]; - var position = start + 6; - if (referredFlags === 7) { - referredToCount = readUint32(data, position - 1) & 0x1FFFFFFF; - position += 3; - var bytes = (referredToCount + 7) >> 3; - retainBits[0] = data[position++]; - while (--bytes > 0) { - retainBits.push(data[position++]); - } - } else if (referredFlags === 5 || referredFlags === 6) { - error('JBIG2 error: invalid referred-to flags'); - } - - segmentHeader.retainBits = retainBits; - var referredToSegmentNumberSize = (segmentHeader.number <= 256 ? 1 : - (segmentHeader.number <= 65536 ? 2 : 4)); - var referredTo = []; - var i, ii; - for (i = 0; i < referredToCount; i++) { - var number = (referredToSegmentNumberSize === 1 ? data[position] : - (referredToSegmentNumberSize === 2 ? readUint16(data, position) : - readUint32(data, position))); - referredTo.push(number); - position += referredToSegmentNumberSize; - } - segmentHeader.referredTo = referredTo; - if (!pageAssociationFieldSize) { - segmentHeader.pageAssociation = data[position++]; - } else { - segmentHeader.pageAssociation = readUint32(data, position); - position += 4; - } - segmentHeader.length = readUint32(data, position); - position += 4; - - if (segmentHeader.length === 0xFFFFFFFF) { - // 7.2.7 Segment data length, unknown segment length - if (segmentType === 38) { // ImmediateGenericRegion - var genericRegionInfo = readRegionSegmentInformation(data, position); - var genericRegionSegmentFlags = data[position + - RegionSegmentInformationFieldLength]; - var genericRegionMmr = !!(genericRegionSegmentFlags & 1); - // searching for the segment end - var searchPatternLength = 6; - var searchPattern = new Uint8Array(searchPatternLength); - if (!genericRegionMmr) { - searchPattern[0] = 0xFF; - searchPattern[1] = 0xAC; - } - searchPattern[2] = (genericRegionInfo.height >>> 24) & 0xFF; - searchPattern[3] = (genericRegionInfo.height >> 16) & 0xFF; - searchPattern[4] = (genericRegionInfo.height >> 8) & 0xFF; - searchPattern[5] = genericRegionInfo.height & 0xFF; - for (i = position, ii = data.length; i < ii; i++) { - var j = 0; - while (j < searchPatternLength && searchPattern[j] === data[i + j]) { - j++; - } - if (j === searchPatternLength) { - segmentHeader.length = i + searchPatternLength; - break; - } - } - if (segmentHeader.length === 0xFFFFFFFF) { - error('JBIG2 error: segment end was not found'); - } - } else { - error('JBIG2 error: invalid unknown segment length'); - } - } - segmentHeader.headerEnd = position; - return segmentHeader; - } - - function readSegments(header, data, start, end) { - var segments = []; - var position = start; - while (position < end) { - var segmentHeader = readSegmentHeader(data, position); - position = segmentHeader.headerEnd; - var segment = { - header: segmentHeader, - data: data - }; - if (!header.randomAccess) { - segment.start = position; - position += segmentHeader.length; - segment.end = position; - } - segments.push(segment); - if (segmentHeader.type === 51) { - break; // end of file is found - } - } - if (header.randomAccess) { - for (var i = 0, ii = segments.length; i < ii; i++) { - segments[i].start = position; - position += segments[i].header.length; - segments[i].end = position; - } - } - return segments; - } - - // 7.4.1 Region segment information field - function readRegionSegmentInformation(data, start) { - return { - width: readUint32(data, start), - height: readUint32(data, start + 4), - x: readUint32(data, start + 8), - y: readUint32(data, start + 12), - combinationOperator: data[start + 16] & 7 - }; - } - var RegionSegmentInformationFieldLength = 17; - - function processSegment(segment, visitor) { - var header = segment.header; - - var data = segment.data, position = segment.start, end = segment.end; - var args, at, i, atLength; - switch (header.type) { - case 0: // SymbolDictionary - // 7.4.2 Symbol dictionary segment syntax - var dictionary = {}; - var dictionaryFlags = readUint16(data, position); // 7.4.2.1.1 - dictionary.huffman = !!(dictionaryFlags & 1); - dictionary.refinement = !!(dictionaryFlags & 2); - dictionary.huffmanDHSelector = (dictionaryFlags >> 2) & 3; - dictionary.huffmanDWSelector = (dictionaryFlags >> 4) & 3; - dictionary.bitmapSizeSelector = (dictionaryFlags >> 6) & 1; - dictionary.aggregationInstancesSelector = (dictionaryFlags >> 7) & 1; - dictionary.bitmapCodingContextUsed = !!(dictionaryFlags & 256); - dictionary.bitmapCodingContextRetained = !!(dictionaryFlags & 512); - dictionary.template = (dictionaryFlags >> 10) & 3; - dictionary.refinementTemplate = (dictionaryFlags >> 12) & 1; - position += 2; - if (!dictionary.huffman) { - atLength = dictionary.template === 0 ? 4 : 1; - at = []; - for (i = 0; i < atLength; i++) { - at.push({ - x: readInt8(data, position), - y: readInt8(data, position + 1) - }); - position += 2; - } - dictionary.at = at; - } - if (dictionary.refinement && !dictionary.refinementTemplate) { - at = []; - for (i = 0; i < 2; i++) { - at.push({ - x: readInt8(data, position), - y: readInt8(data, position + 1) - }); - position += 2; - } - dictionary.refinementAt = at; - } - dictionary.numberOfExportedSymbols = readUint32(data, position); - position += 4; - dictionary.numberOfNewSymbols = readUint32(data, position); - position += 4; - args = [dictionary, header.number, header.referredTo, - data, position, end]; - break; - case 6: // ImmediateTextRegion - case 7: // ImmediateLosslessTextRegion - var textRegion = {}; - textRegion.info = readRegionSegmentInformation(data, position); - position += RegionSegmentInformationFieldLength; - var textRegionSegmentFlags = readUint16(data, position); - position += 2; - textRegion.huffman = !!(textRegionSegmentFlags & 1); - textRegion.refinement = !!(textRegionSegmentFlags & 2); - textRegion.stripSize = 1 << ((textRegionSegmentFlags >> 2) & 3); - textRegion.referenceCorner = (textRegionSegmentFlags >> 4) & 3; - textRegion.transposed = !!(textRegionSegmentFlags & 64); - textRegion.combinationOperator = (textRegionSegmentFlags >> 7) & 3; - textRegion.defaultPixelValue = (textRegionSegmentFlags >> 9) & 1; - textRegion.dsOffset = (textRegionSegmentFlags << 17) >> 27; - textRegion.refinementTemplate = (textRegionSegmentFlags >> 15) & 1; - if (textRegion.huffman) { - var textRegionHuffmanFlags = readUint16(data, position); - position += 2; - textRegion.huffmanFS = (textRegionHuffmanFlags) & 3; - textRegion.huffmanDS = (textRegionHuffmanFlags >> 2) & 3; - textRegion.huffmanDT = (textRegionHuffmanFlags >> 4) & 3; - textRegion.huffmanRefinementDW = (textRegionHuffmanFlags >> 6) & 3; - textRegion.huffmanRefinementDH = (textRegionHuffmanFlags >> 8) & 3; - textRegion.huffmanRefinementDX = (textRegionHuffmanFlags >> 10) & 3; - textRegion.huffmanRefinementDY = (textRegionHuffmanFlags >> 12) & 3; - textRegion.huffmanRefinementSizeSelector = - !!(textRegionHuffmanFlags & 14); - } - if (textRegion.refinement && !textRegion.refinementTemplate) { - at = []; - for (i = 0; i < 2; i++) { - at.push({ - x: readInt8(data, position), - y: readInt8(data, position + 1) - }); - position += 2; - } - textRegion.refinementAt = at; - } - textRegion.numberOfSymbolInstances = readUint32(data, position); - position += 4; - // TODO 7.4.3.1.7 Symbol ID Huffman table decoding - if (textRegion.huffman) { - error('JBIG2 error: huffman is not supported'); - } - args = [textRegion, header.referredTo, data, position, end]; - break; - case 38: // ImmediateGenericRegion - case 39: // ImmediateLosslessGenericRegion - var genericRegion = {}; - genericRegion.info = readRegionSegmentInformation(data, position); - position += RegionSegmentInformationFieldLength; - var genericRegionSegmentFlags = data[position++]; - genericRegion.mmr = !!(genericRegionSegmentFlags & 1); - genericRegion.template = (genericRegionSegmentFlags >> 1) & 3; - genericRegion.prediction = !!(genericRegionSegmentFlags & 8); - if (!genericRegion.mmr) { - atLength = genericRegion.template === 0 ? 4 : 1; - at = []; - for (i = 0; i < atLength; i++) { - at.push({ - x: readInt8(data, position), - y: readInt8(data, position + 1) - }); - position += 2; - } - genericRegion.at = at; - } - args = [genericRegion, data, position, end]; - break; - case 48: // PageInformation - var pageInfo = { - width: readUint32(data, position), - height: readUint32(data, position + 4), - resolutionX: readUint32(data, position + 8), - resolutionY: readUint32(data, position + 12) - }; - if (pageInfo.height === 0xFFFFFFFF) { - delete pageInfo.height; - } - var pageSegmentFlags = data[position + 16]; - var pageStripingInformation = readUint16(data, position + 17); - pageInfo.lossless = !!(pageSegmentFlags & 1); - pageInfo.refinement = !!(pageSegmentFlags & 2); - pageInfo.defaultPixelValue = (pageSegmentFlags >> 2) & 1; - pageInfo.combinationOperator = (pageSegmentFlags >> 3) & 3; - pageInfo.requiresBuffer = !!(pageSegmentFlags & 32); - pageInfo.combinationOperatorOverride = !!(pageSegmentFlags & 64); - args = [pageInfo]; - break; - case 49: // EndOfPage - break; - case 50: // EndOfStripe - break; - case 51: // EndOfFile - break; - case 62: // 7.4.15 defines 2 extension types which - // are comments and can be ignored. - break; - default: - error('JBIG2 error: segment type ' + header.typeName + '(' + - header.type + ') is not implemented'); - } - var callbackName = 'on' + header.typeName; - if (callbackName in visitor) { - visitor[callbackName].apply(visitor, args); - } - } - - function processSegments(segments, visitor) { - for (var i = 0, ii = segments.length; i < ii; i++) { - processSegment(segments[i], visitor); - } - } - - function parseJbig2(data, start, end) { - var position = start; - if (data[position] !== 0x97 || data[position + 1] !== 0x4A || - data[position + 2] !== 0x42 || data[position + 3] !== 0x32 || - data[position + 4] !== 0x0D || data[position + 5] !== 0x0A || - data[position + 6] !== 0x1A || data[position + 7] !== 0x0A) { - error('JBIG2 error: invalid header'); - } - var header = {}; - position += 8; - var flags = data[position++]; - header.randomAccess = !(flags & 1); - if (!(flags & 2)) { - header.numberOfPages = readUint32(data, position); - position += 4; - } - var segments = readSegments(header, data, position, end); - error('Not implemented'); - // processSegments(segments, new SimpleSegmentVisitor()); - } - - function parseJbig2Chunks(chunks) { - var visitor = new SimpleSegmentVisitor(); - for (var i = 0, ii = chunks.length; i < ii; i++) { - var chunk = chunks[i]; - var segments = readSegments({}, chunk.data, chunk.start, chunk.end); - processSegments(segments, visitor); - } - return visitor.buffer; - } - - function SimpleSegmentVisitor() {} - - SimpleSegmentVisitor.prototype = { - onPageInformation: function SimpleSegmentVisitor_onPageInformation(info) { - this.currentPageInfo = info; - var rowSize = (info.width + 7) >> 3; - var buffer = new Uint8Array(rowSize * info.height); - // The contents of ArrayBuffers are initialized to 0. - // Fill the buffer with 0xFF only if info.defaultPixelValue is set - if (info.defaultPixelValue) { - for (var i = 0, ii = buffer.length; i < ii; i++) { - buffer[i] = 0xFF; - } - } - this.buffer = buffer; - }, - drawBitmap: function SimpleSegmentVisitor_drawBitmap(regionInfo, bitmap) { - var pageInfo = this.currentPageInfo; - var width = regionInfo.width, height = regionInfo.height; - var rowSize = (pageInfo.width + 7) >> 3; - var combinationOperator = pageInfo.combinationOperatorOverride ? - regionInfo.combinationOperator : pageInfo.combinationOperator; - var buffer = this.buffer; - var mask0 = 128 >> (regionInfo.x & 7); - var offset0 = regionInfo.y * rowSize + (regionInfo.x >> 3); - var i, j, mask, offset; - switch (combinationOperator) { - case 0: // OR - for (i = 0; i < height; i++) { - mask = mask0; - offset = offset0; - for (j = 0; j < width; j++) { - if (bitmap[i][j]) { - buffer[offset] |= mask; - } - mask >>= 1; - if (!mask) { - mask = 128; - offset++; - } - } - offset0 += rowSize; - } - break; - case 2: // XOR - for (i = 0; i < height; i++) { - mask = mask0; - offset = offset0; - for (j = 0; j < width; j++) { - if (bitmap[i][j]) { - buffer[offset] ^= mask; - } - mask >>= 1; - if (!mask) { - mask = 128; - offset++; - } - } - offset0 += rowSize; - } - break; - default: - error('JBIG2 error: operator ' + combinationOperator + - ' is not supported'); - } - }, - onImmediateGenericRegion: - function SimpleSegmentVisitor_onImmediateGenericRegion(region, data, - start, end) { - var regionInfo = region.info; - var decodingContext = new DecodingContext(data, start, end); - var bitmap = decodeBitmap(region.mmr, regionInfo.width, regionInfo.height, - region.template, region.prediction, null, - region.at, decodingContext); - this.drawBitmap(regionInfo, bitmap); - }, - onImmediateLosslessGenericRegion: - function SimpleSegmentVisitor_onImmediateLosslessGenericRegion() { - this.onImmediateGenericRegion.apply(this, arguments); - }, - onSymbolDictionary: - function SimpleSegmentVisitor_onSymbolDictionary(dictionary, - currentSegment, - referredSegments, - data, start, end) { - var huffmanTables; - if (dictionary.huffman) { - error('JBIG2 error: huffman is not supported'); - } - - // Combines exported symbols from all referred segments - var symbols = this.symbols; - if (!symbols) { - this.symbols = symbols = {}; - } - - var inputSymbols = []; - for (var i = 0, ii = referredSegments.length; i < ii; i++) { - inputSymbols = inputSymbols.concat(symbols[referredSegments[i]]); - } - - var decodingContext = new DecodingContext(data, start, end); - symbols[currentSegment] = decodeSymbolDictionary(dictionary.huffman, - dictionary.refinement, inputSymbols, dictionary.numberOfNewSymbols, - dictionary.numberOfExportedSymbols, huffmanTables, - dictionary.template, dictionary.at, - dictionary.refinementTemplate, dictionary.refinementAt, - decodingContext); - }, - onImmediateTextRegion: - function SimpleSegmentVisitor_onImmediateTextRegion(region, - referredSegments, - data, start, end) { - var regionInfo = region.info; - var huffmanTables; - - // Combines exported symbols from all referred segments - var symbols = this.symbols; - var inputSymbols = []; - for (var i = 0, ii = referredSegments.length; i < ii; i++) { - inputSymbols = inputSymbols.concat(symbols[referredSegments[i]]); - } - var symbolCodeLength = log2(inputSymbols.length); - - var decodingContext = new DecodingContext(data, start, end); - var bitmap = decodeTextRegion(region.huffman, region.refinement, - regionInfo.width, regionInfo.height, region.defaultPixelValue, - region.numberOfSymbolInstances, region.stripSize, inputSymbols, - symbolCodeLength, region.transposed, region.dsOffset, - region.referenceCorner, region.combinationOperator, huffmanTables, - region.refinementTemplate, region.refinementAt, decodingContext); - this.drawBitmap(regionInfo, bitmap); - }, - onImmediateLosslessTextRegion: - function SimpleSegmentVisitor_onImmediateLosslessTextRegion() { - this.onImmediateTextRegion.apply(this, arguments); - } - }; - - function Jbig2Image() {} - - Jbig2Image.prototype = { - parseChunks: function Jbig2Image_parseChunks(chunks) { - return parseJbig2Chunks(chunks); - } - }; - - return Jbig2Image; -})(); - -exports.Jbig2Image = Jbig2Image; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreJpg = {}), root.pdfjsSharedUtil); - } -}(this, function (exports, sharedUtil) { - -var error = sharedUtil.error; - -/** - * This code was forked from https://github.com/notmasteryet/jpgjs. - * The original version was created by GitHub user notmasteryet. - * - * - The JPEG specification can be found in the ITU CCITT Recommendation T.81 - * (www.w3.org/Graphics/JPEG/itu-t81.pdf) - * - The JFIF specification can be found in the JPEG File Interchange Format - * (www.w3.org/Graphics/JPEG/jfif3.pdf) - * - The Adobe Application-Specific JPEG markers in the - * Supporting the DCT Filters in PostScript Level 2, Technical Note #5116 - * (partners.adobe.com/public/developer/en/ps/sdk/5116.DCT_Filter.pdf) - */ - -var JpegImage = (function JpegImageClosure() { - var dctZigZag = new Uint8Array([ - 0, - 1, 8, - 16, 9, 2, - 3, 10, 17, 24, - 32, 25, 18, 11, 4, - 5, 12, 19, 26, 33, 40, - 48, 41, 34, 27, 20, 13, 6, - 7, 14, 21, 28, 35, 42, 49, 56, - 57, 50, 43, 36, 29, 22, 15, - 23, 30, 37, 44, 51, 58, - 59, 52, 45, 38, 31, - 39, 46, 53, 60, - 61, 54, 47, - 55, 62, - 63 - ]); - - var dctCos1 = 4017; // cos(pi/16) - var dctSin1 = 799; // sin(pi/16) - var dctCos3 = 3406; // cos(3*pi/16) - var dctSin3 = 2276; // sin(3*pi/16) - var dctCos6 = 1567; // cos(6*pi/16) - var dctSin6 = 3784; // sin(6*pi/16) - var dctSqrt2 = 5793; // sqrt(2) - var dctSqrt1d2 = 2896; // sqrt(2) / 2 - - function JpegImage() { - this.decodeTransform = null; - this.colorTransform = -1; - } - - function buildHuffmanTable(codeLengths, values) { - var k = 0, code = [], i, j, length = 16; - while (length > 0 && !codeLengths[length - 1]) { - length--; - } - code.push({children: [], index: 0}); - var p = code[0], q; - for (i = 0; i < length; i++) { - for (j = 0; j < codeLengths[i]; j++) { - p = code.pop(); - p.children[p.index] = values[k]; - while (p.index > 0) { - p = code.pop(); - } - p.index++; - code.push(p); - while (code.length <= i) { - code.push(q = {children: [], index: 0}); - p.children[p.index] = q.children; - p = q; - } - k++; - } - if (i + 1 < length) { - // p here points to last code - code.push(q = {children: [], index: 0}); - p.children[p.index] = q.children; - p = q; - } - } - return code[0].children; - } - - function getBlockBufferOffset(component, row, col) { - return 64 * ((component.blocksPerLine + 1) * row + col); - } - - function decodeScan(data, offset, frame, components, resetInterval, - spectralStart, spectralEnd, successivePrev, successive) { - var mcusPerLine = frame.mcusPerLine; - var progressive = frame.progressive; - - var startOffset = offset, bitsData = 0, bitsCount = 0; - - function readBit() { - if (bitsCount > 0) { - bitsCount--; - return (bitsData >> bitsCount) & 1; - } - bitsData = data[offset++]; - if (bitsData === 0xFF) { - var nextByte = data[offset++]; - if (nextByte) { - error('JPEG error: unexpected marker ' + - ((bitsData << 8) | nextByte).toString(16)); - } - // unstuff 0 - } - bitsCount = 7; - return bitsData >>> 7; - } - - function decodeHuffman(tree) { - var node = tree; - while (true) { - node = node[readBit()]; - if (typeof node === 'number') { - return node; - } - if (typeof node !== 'object') { - error('JPEG error: invalid huffman sequence'); - } - } - } - - function receive(length) { - var n = 0; - while (length > 0) { - n = (n << 1) | readBit(); - length--; - } - return n; - } - - function receiveAndExtend(length) { - if (length === 1) { - return readBit() === 1 ? 1 : -1; - } - var n = receive(length); - if (n >= 1 << (length - 1)) { - return n; - } - return n + (-1 << length) + 1; - } - - function decodeBaseline(component, offset) { - var t = decodeHuffman(component.huffmanTableDC); - var diff = t === 0 ? 0 : receiveAndExtend(t); - component.blockData[offset] = (component.pred += diff); - var k = 1; - while (k < 64) { - var rs = decodeHuffman(component.huffmanTableAC); - var s = rs & 15, r = rs >> 4; - if (s === 0) { - if (r < 15) { - break; - } - k += 16; - continue; - } - k += r; - var z = dctZigZag[k]; - component.blockData[offset + z] = receiveAndExtend(s); - k++; - } - } - - function decodeDCFirst(component, offset) { - var t = decodeHuffman(component.huffmanTableDC); - var diff = t === 0 ? 0 : (receiveAndExtend(t) << successive); - component.blockData[offset] = (component.pred += diff); - } - - function decodeDCSuccessive(component, offset) { - component.blockData[offset] |= readBit() << successive; - } - - var eobrun = 0; - function decodeACFirst(component, offset) { - if (eobrun > 0) { - eobrun--; - return; - } - var k = spectralStart, e = spectralEnd; - while (k <= e) { - var rs = decodeHuffman(component.huffmanTableAC); - var s = rs & 15, r = rs >> 4; - if (s === 0) { - if (r < 15) { - eobrun = receive(r) + (1 << r) - 1; - break; - } - k += 16; - continue; - } - k += r; - var z = dctZigZag[k]; - component.blockData[offset + z] = - receiveAndExtend(s) * (1 << successive); - k++; - } - } - - var successiveACState = 0, successiveACNextValue; - function decodeACSuccessive(component, offset) { - var k = spectralStart; - var e = spectralEnd; - var r = 0; - var s; - var rs; - while (k <= e) { - var z = dctZigZag[k]; - switch (successiveACState) { - case 0: // initial state - rs = decodeHuffman(component.huffmanTableAC); - s = rs & 15; - r = rs >> 4; - if (s === 0) { - if (r < 15) { - eobrun = receive(r) + (1 << r); - successiveACState = 4; - } else { - r = 16; - successiveACState = 1; - } - } else { - if (s !== 1) { - error('JPEG error: invalid ACn encoding'); - } - successiveACNextValue = receiveAndExtend(s); - successiveACState = r ? 2 : 3; - } - continue; - case 1: // skipping r zero items - case 2: - if (component.blockData[offset + z]) { - component.blockData[offset + z] += (readBit() << successive); - } else { - r--; - if (r === 0) { - successiveACState = successiveACState === 2 ? 3 : 0; - } - } - break; - case 3: // set value for a zero item - if (component.blockData[offset + z]) { - component.blockData[offset + z] += (readBit() << successive); - } else { - component.blockData[offset + z] = - successiveACNextValue << successive; - successiveACState = 0; - } - break; - case 4: // eob - if (component.blockData[offset + z]) { - component.blockData[offset + z] += (readBit() << successive); - } - break; - } - k++; - } - if (successiveACState === 4) { - eobrun--; - if (eobrun === 0) { - successiveACState = 0; - } - } - } - - function decodeMcu(component, decode, mcu, row, col) { - var mcuRow = (mcu / mcusPerLine) | 0; - var mcuCol = mcu % mcusPerLine; - var blockRow = mcuRow * component.v + row; - var blockCol = mcuCol * component.h + col; - var offset = getBlockBufferOffset(component, blockRow, blockCol); - decode(component, offset); - } - - function decodeBlock(component, decode, mcu) { - var blockRow = (mcu / component.blocksPerLine) | 0; - var blockCol = mcu % component.blocksPerLine; - var offset = getBlockBufferOffset(component, blockRow, blockCol); - decode(component, offset); - } - - var componentsLength = components.length; - var component, i, j, k, n; - var decodeFn; - if (progressive) { - if (spectralStart === 0) { - decodeFn = successivePrev === 0 ? decodeDCFirst : decodeDCSuccessive; - } else { - decodeFn = successivePrev === 0 ? decodeACFirst : decodeACSuccessive; - } - } else { - decodeFn = decodeBaseline; - } - - var mcu = 0, marker; - var mcuExpected; - if (componentsLength === 1) { - mcuExpected = components[0].blocksPerLine * components[0].blocksPerColumn; - } else { - mcuExpected = mcusPerLine * frame.mcusPerColumn; - } - if (!resetInterval) { - resetInterval = mcuExpected; - } - - var h, v; - while (mcu < mcuExpected) { - // reset interval stuff - for (i = 0; i < componentsLength; i++) { - components[i].pred = 0; - } - eobrun = 0; - - if (componentsLength === 1) { - component = components[0]; - for (n = 0; n < resetInterval; n++) { - decodeBlock(component, decodeFn, mcu); - mcu++; - } - } else { - for (n = 0; n < resetInterval; n++) { - for (i = 0; i < componentsLength; i++) { - component = components[i]; - h = component.h; - v = component.v; - for (j = 0; j < v; j++) { - for (k = 0; k < h; k++) { - decodeMcu(component, decodeFn, mcu, j, k); - } - } - } - mcu++; - } - } - - // find marker - bitsCount = 0; - marker = (data[offset] << 8) | data[offset + 1]; - // Some bad images seem to pad Scan blocks with zero bytes, skip past - // those to attempt to find a valid marker (fixes issue4090.pdf). - while (data[offset] === 0x00 && offset < data.length - 1) { - offset++; - marker = (data[offset] << 8) | data[offset + 1]; - } - if (marker <= 0xFF00) { - error('JPEG error: marker was not found'); - } - - if (marker >= 0xFFD0 && marker <= 0xFFD7) { // RSTx - offset += 2; - } else { - break; - } - } - - return offset - startOffset; - } - - // A port of poppler's IDCT method which in turn is taken from: - // Christoph Loeffler, Adriaan Ligtenberg, George S. Moschytz, - // 'Practical Fast 1-D DCT Algorithms with 11 Multiplications', - // IEEE Intl. Conf. on Acoustics, Speech & Signal Processing, 1989, - // 988-991. - function quantizeAndInverse(component, blockBufferOffset, p) { - var qt = component.quantizationTable, blockData = component.blockData; - var v0, v1, v2, v3, v4, v5, v6, v7; - var p0, p1, p2, p3, p4, p5, p6, p7; - var t; - - if (!qt) { - error('JPEG error: missing required Quantization Table.'); - } - - // inverse DCT on rows - for (var row = 0; row < 64; row += 8) { - // gather block data - p0 = blockData[blockBufferOffset + row]; - p1 = blockData[blockBufferOffset + row + 1]; - p2 = blockData[blockBufferOffset + row + 2]; - p3 = blockData[blockBufferOffset + row + 3]; - p4 = blockData[blockBufferOffset + row + 4]; - p5 = blockData[blockBufferOffset + row + 5]; - p6 = blockData[blockBufferOffset + row + 6]; - p7 = blockData[blockBufferOffset + row + 7]; - - // dequant p0 - p0 *= qt[row]; - - // check for all-zero AC coefficients - if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { - t = (dctSqrt2 * p0 + 512) >> 10; - p[row] = t; - p[row + 1] = t; - p[row + 2] = t; - p[row + 3] = t; - p[row + 4] = t; - p[row + 5] = t; - p[row + 6] = t; - p[row + 7] = t; - continue; - } - // dequant p1 ... p7 - p1 *= qt[row + 1]; - p2 *= qt[row + 2]; - p3 *= qt[row + 3]; - p4 *= qt[row + 4]; - p5 *= qt[row + 5]; - p6 *= qt[row + 6]; - p7 *= qt[row + 7]; - - // stage 4 - v0 = (dctSqrt2 * p0 + 128) >> 8; - v1 = (dctSqrt2 * p4 + 128) >> 8; - v2 = p2; - v3 = p6; - v4 = (dctSqrt1d2 * (p1 - p7) + 128) >> 8; - v7 = (dctSqrt1d2 * (p1 + p7) + 128) >> 8; - v5 = p3 << 4; - v6 = p5 << 4; - - // stage 3 - v0 = (v0 + v1 + 1) >> 1; - v1 = v0 - v1; - t = (v2 * dctSin6 + v3 * dctCos6 + 128) >> 8; - v2 = (v2 * dctCos6 - v3 * dctSin6 + 128) >> 8; - v3 = t; - v4 = (v4 + v6 + 1) >> 1; - v6 = v4 - v6; - v7 = (v7 + v5 + 1) >> 1; - v5 = v7 - v5; - - // stage 2 - v0 = (v0 + v3 + 1) >> 1; - v3 = v0 - v3; - v1 = (v1 + v2 + 1) >> 1; - v2 = v1 - v2; - t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12; - v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12; - v7 = t; - t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12; - v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12; - v6 = t; - - // stage 1 - p[row] = v0 + v7; - p[row + 7] = v0 - v7; - p[row + 1] = v1 + v6; - p[row + 6] = v1 - v6; - p[row + 2] = v2 + v5; - p[row + 5] = v2 - v5; - p[row + 3] = v3 + v4; - p[row + 4] = v3 - v4; - } - - // inverse DCT on columns - for (var col = 0; col < 8; ++col) { - p0 = p[col]; - p1 = p[col + 8]; - p2 = p[col + 16]; - p3 = p[col + 24]; - p4 = p[col + 32]; - p5 = p[col + 40]; - p6 = p[col + 48]; - p7 = p[col + 56]; - - // check for all-zero AC coefficients - if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { - t = (dctSqrt2 * p0 + 8192) >> 14; - // convert to 8 bit - t = (t < -2040) ? 0 : (t >= 2024) ? 255 : (t + 2056) >> 4; - blockData[blockBufferOffset + col] = t; - blockData[blockBufferOffset + col + 8] = t; - blockData[blockBufferOffset + col + 16] = t; - blockData[blockBufferOffset + col + 24] = t; - blockData[blockBufferOffset + col + 32] = t; - blockData[blockBufferOffset + col + 40] = t; - blockData[blockBufferOffset + col + 48] = t; - blockData[blockBufferOffset + col + 56] = t; - continue; - } - - // stage 4 - v0 = (dctSqrt2 * p0 + 2048) >> 12; - v1 = (dctSqrt2 * p4 + 2048) >> 12; - v2 = p2; - v3 = p6; - v4 = (dctSqrt1d2 * (p1 - p7) + 2048) >> 12; - v7 = (dctSqrt1d2 * (p1 + p7) + 2048) >> 12; - v5 = p3; - v6 = p5; - - // stage 3 - // Shift v0 by 128.5 << 5 here, so we don't need to shift p0...p7 when - // converting to UInt8 range later. - v0 = ((v0 + v1 + 1) >> 1) + 4112; - v1 = v0 - v1; - t = (v2 * dctSin6 + v3 * dctCos6 + 2048) >> 12; - v2 = (v2 * dctCos6 - v3 * dctSin6 + 2048) >> 12; - v3 = t; - v4 = (v4 + v6 + 1) >> 1; - v6 = v4 - v6; - v7 = (v7 + v5 + 1) >> 1; - v5 = v7 - v5; - - // stage 2 - v0 = (v0 + v3 + 1) >> 1; - v3 = v0 - v3; - v1 = (v1 + v2 + 1) >> 1; - v2 = v1 - v2; - t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12; - v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12; - v7 = t; - t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12; - v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12; - v6 = t; - - // stage 1 - p0 = v0 + v7; - p7 = v0 - v7; - p1 = v1 + v6; - p6 = v1 - v6; - p2 = v2 + v5; - p5 = v2 - v5; - p3 = v3 + v4; - p4 = v3 - v4; - - // convert to 8-bit integers - p0 = (p0 < 16) ? 0 : (p0 >= 4080) ? 255 : p0 >> 4; - p1 = (p1 < 16) ? 0 : (p1 >= 4080) ? 255 : p1 >> 4; - p2 = (p2 < 16) ? 0 : (p2 >= 4080) ? 255 : p2 >> 4; - p3 = (p3 < 16) ? 0 : (p3 >= 4080) ? 255 : p3 >> 4; - p4 = (p4 < 16) ? 0 : (p4 >= 4080) ? 255 : p4 >> 4; - p5 = (p5 < 16) ? 0 : (p5 >= 4080) ? 255 : p5 >> 4; - p6 = (p6 < 16) ? 0 : (p6 >= 4080) ? 255 : p6 >> 4; - p7 = (p7 < 16) ? 0 : (p7 >= 4080) ? 255 : p7 >> 4; - - // store block data - blockData[blockBufferOffset + col] = p0; - blockData[blockBufferOffset + col + 8] = p1; - blockData[blockBufferOffset + col + 16] = p2; - blockData[blockBufferOffset + col + 24] = p3; - blockData[blockBufferOffset + col + 32] = p4; - blockData[blockBufferOffset + col + 40] = p5; - blockData[blockBufferOffset + col + 48] = p6; - blockData[blockBufferOffset + col + 56] = p7; - } - } - - function buildComponentData(frame, component) { - var blocksPerLine = component.blocksPerLine; - var blocksPerColumn = component.blocksPerColumn; - var computationBuffer = new Int16Array(64); - - for (var blockRow = 0; blockRow < blocksPerColumn; blockRow++) { - for (var blockCol = 0; blockCol < blocksPerLine; blockCol++) { - var offset = getBlockBufferOffset(component, blockRow, blockCol); - quantizeAndInverse(component, offset, computationBuffer); - } - } - return component.blockData; - } - - function clamp0to255(a) { - return a <= 0 ? 0 : a >= 255 ? 255 : a; - } - - JpegImage.prototype = { - parse: function parse(data) { - - function readUint16() { - var value = (data[offset] << 8) | data[offset + 1]; - offset += 2; - return value; - } - - function readDataBlock() { - var length = readUint16(); - var array = data.subarray(offset, offset + length - 2); - offset += array.length; - return array; - } - - function prepareComponents(frame) { - var mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / frame.maxH); - var mcusPerColumn = Math.ceil(frame.scanLines / 8 / frame.maxV); - for (var i = 0; i < frame.components.length; i++) { - component = frame.components[i]; - var blocksPerLine = Math.ceil(Math.ceil(frame.samplesPerLine / 8) * - component.h / frame.maxH); - var blocksPerColumn = Math.ceil(Math.ceil(frame.scanLines / 8) * - component.v / frame.maxV); - var blocksPerLineForMcu = mcusPerLine * component.h; - var blocksPerColumnForMcu = mcusPerColumn * component.v; - - var blocksBufferSize = 64 * blocksPerColumnForMcu * - (blocksPerLineForMcu + 1); - component.blockData = new Int16Array(blocksBufferSize); - component.blocksPerLine = blocksPerLine; - component.blocksPerColumn = blocksPerColumn; - } - frame.mcusPerLine = mcusPerLine; - frame.mcusPerColumn = mcusPerColumn; - } - - var offset = 0; - var jfif = null; - var adobe = null; - var frame, resetInterval; - var quantizationTables = []; - var huffmanTablesAC = [], huffmanTablesDC = []; - var fileMarker = readUint16(); - if (fileMarker !== 0xFFD8) { // SOI (Start of Image) - error('JPEG error: SOI not found'); - } - - fileMarker = readUint16(); - while (fileMarker !== 0xFFD9) { // EOI (End of image) - var i, j, l; - switch(fileMarker) { - case 0xFFE0: // APP0 (Application Specific) - case 0xFFE1: // APP1 - case 0xFFE2: // APP2 - case 0xFFE3: // APP3 - case 0xFFE4: // APP4 - case 0xFFE5: // APP5 - case 0xFFE6: // APP6 - case 0xFFE7: // APP7 - case 0xFFE8: // APP8 - case 0xFFE9: // APP9 - case 0xFFEA: // APP10 - case 0xFFEB: // APP11 - case 0xFFEC: // APP12 - case 0xFFED: // APP13 - case 0xFFEE: // APP14 - case 0xFFEF: // APP15 - case 0xFFFE: // COM (Comment) - var appData = readDataBlock(); - - if (fileMarker === 0xFFE0) { - if (appData[0] === 0x4A && appData[1] === 0x46 && - appData[2] === 0x49 && appData[3] === 0x46 && - appData[4] === 0) { // 'JFIF\x00' - jfif = { - version: { major: appData[5], minor: appData[6] }, - densityUnits: appData[7], - xDensity: (appData[8] << 8) | appData[9], - yDensity: (appData[10] << 8) | appData[11], - thumbWidth: appData[12], - thumbHeight: appData[13], - thumbData: appData.subarray(14, 14 + - 3 * appData[12] * appData[13]) - }; - } - } - // TODO APP1 - Exif - if (fileMarker === 0xFFEE) { - if (appData[0] === 0x41 && appData[1] === 0x64 && - appData[2] === 0x6F && appData[3] === 0x62 && - appData[4] === 0x65) { // 'Adobe' - adobe = { - version: (appData[5] << 8) | appData[6], - flags0: (appData[7] << 8) | appData[8], - flags1: (appData[9] << 8) | appData[10], - transformCode: appData[11] - }; - } - } - break; - - case 0xFFDB: // DQT (Define Quantization Tables) - var quantizationTablesLength = readUint16(); - var quantizationTablesEnd = quantizationTablesLength + offset - 2; - var z; - while (offset < quantizationTablesEnd) { - var quantizationTableSpec = data[offset++]; - var tableData = new Uint16Array(64); - if ((quantizationTableSpec >> 4) === 0) { // 8 bit values - for (j = 0; j < 64; j++) { - z = dctZigZag[j]; - tableData[z] = data[offset++]; - } - } else if ((quantizationTableSpec >> 4) === 1) { //16 bit - for (j = 0; j < 64; j++) { - z = dctZigZag[j]; - tableData[z] = readUint16(); - } - } else { - error('JPEG error: DQT - invalid table spec'); - } - quantizationTables[quantizationTableSpec & 15] = tableData; - } - break; - - case 0xFFC0: // SOF0 (Start of Frame, Baseline DCT) - case 0xFFC1: // SOF1 (Start of Frame, Extended DCT) - case 0xFFC2: // SOF2 (Start of Frame, Progressive DCT) - if (frame) { - error('JPEG error: Only single frame JPEGs supported'); - } - readUint16(); // skip data length - frame = {}; - frame.extended = (fileMarker === 0xFFC1); - frame.progressive = (fileMarker === 0xFFC2); - frame.precision = data[offset++]; - frame.scanLines = readUint16(); - frame.samplesPerLine = readUint16(); - frame.components = []; - frame.componentIds = {}; - var componentsCount = data[offset++], componentId; - var maxH = 0, maxV = 0; - for (i = 0; i < componentsCount; i++) { - componentId = data[offset]; - var h = data[offset + 1] >> 4; - var v = data[offset + 1] & 15; - if (maxH < h) { - maxH = h; - } - if (maxV < v) { - maxV = v; - } - var qId = data[offset + 2]; - l = frame.components.push({ - h: h, - v: v, - quantizationId: qId, - quantizationTable: null, // See comment below. - }); - frame.componentIds[componentId] = l - 1; - offset += 3; - } - frame.maxH = maxH; - frame.maxV = maxV; - prepareComponents(frame); - break; - - case 0xFFC4: // DHT (Define Huffman Tables) - var huffmanLength = readUint16(); - for (i = 2; i < huffmanLength;) { - var huffmanTableSpec = data[offset++]; - var codeLengths = new Uint8Array(16); - var codeLengthSum = 0; - for (j = 0; j < 16; j++, offset++) { - codeLengthSum += (codeLengths[j] = data[offset]); - } - var huffmanValues = new Uint8Array(codeLengthSum); - for (j = 0; j < codeLengthSum; j++, offset++) { - huffmanValues[j] = data[offset]; - } - i += 17 + codeLengthSum; - - ((huffmanTableSpec >> 4) === 0 ? - huffmanTablesDC : huffmanTablesAC)[huffmanTableSpec & 15] = - buildHuffmanTable(codeLengths, huffmanValues); - } - break; - - case 0xFFDD: // DRI (Define Restart Interval) - readUint16(); // skip data length - resetInterval = readUint16(); - break; - - case 0xFFDA: // SOS (Start of Scan) - var scanLength = readUint16(); - var selectorsCount = data[offset++]; - var components = [], component; - for (i = 0; i < selectorsCount; i++) { - var componentIndex = frame.componentIds[data[offset++]]; - component = frame.components[componentIndex]; - var tableSpec = data[offset++]; - component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4]; - component.huffmanTableAC = huffmanTablesAC[tableSpec & 15]; - components.push(component); - } - var spectralStart = data[offset++]; - var spectralEnd = data[offset++]; - var successiveApproximation = data[offset++]; - var processed = decodeScan(data, offset, - frame, components, resetInterval, - spectralStart, spectralEnd, - successiveApproximation >> 4, successiveApproximation & 15); - offset += processed; - break; - - case 0xFFFF: // Fill bytes - if (data[offset] !== 0xFF) { // Avoid skipping a valid marker. - offset--; - } - break; - - default: - if (data[offset - 3] === 0xFF && - data[offset - 2] >= 0xC0 && data[offset - 2] <= 0xFE) { - // could be incorrect encoding -- last 0xFF byte of the previous - // block was eaten by the encoder - offset -= 3; - break; - } - error('JPEG error: unknown marker ' + fileMarker.toString(16)); - } - fileMarker = readUint16(); - } - - this.width = frame.samplesPerLine; - this.height = frame.scanLines; - this.jfif = jfif; - this.adobe = adobe; - this.components = []; - for (i = 0; i < frame.components.length; i++) { - component = frame.components[i]; - - // Prevent errors when DQT markers are placed after SOF{n} markers, - // by assigning the `quantizationTable` entry after the entire image - // has been parsed (fixes issue7406.pdf). - var quantizationTable = quantizationTables[component.quantizationId]; - if (quantizationTable) { - component.quantizationTable = quantizationTable; - } - - this.components.push({ - output: buildComponentData(frame, component), - scaleX: component.h / frame.maxH, - scaleY: component.v / frame.maxV, - blocksPerLine: component.blocksPerLine, - blocksPerColumn: component.blocksPerColumn - }); - } - this.numComponents = this.components.length; - }, - - _getLinearizedBlockData: function getLinearizedBlockData(width, height) { - var scaleX = this.width / width, scaleY = this.height / height; - - var component, componentScaleX, componentScaleY, blocksPerScanline; - var x, y, i, j, k; - var index; - var offset = 0; - var output; - var numComponents = this.components.length; - var dataLength = width * height * numComponents; - var data = new Uint8Array(dataLength); - var xScaleBlockOffset = new Uint32Array(width); - var mask3LSB = 0xfffffff8; // used to clear the 3 LSBs - - for (i = 0; i < numComponents; i++) { - component = this.components[i]; - componentScaleX = component.scaleX * scaleX; - componentScaleY = component.scaleY * scaleY; - offset = i; - output = component.output; - blocksPerScanline = (component.blocksPerLine + 1) << 3; - // precalculate the xScaleBlockOffset - for (x = 0; x < width; x++) { - j = 0 | (x * componentScaleX); - xScaleBlockOffset[x] = ((j & mask3LSB) << 3) | (j & 7); - } - // linearize the blocks of the component - for (y = 0; y < height; y++) { - j = 0 | (y * componentScaleY); - index = blocksPerScanline * (j & mask3LSB) | ((j & 7) << 3); - for (x = 0; x < width; x++) { - data[offset] = output[index + xScaleBlockOffset[x]]; - offset += numComponents; - } - } - } - - // decodeTransform contains pairs of multiplier (-256..256) and additive - var transform = this.decodeTransform; - if (transform) { - for (i = 0; i < dataLength;) { - for (j = 0, k = 0; j < numComponents; j++, i++, k += 2) { - data[i] = ((data[i] * transform[k]) >> 8) + transform[k + 1]; - } - } - } - return data; - }, - - _isColorConversionNeeded: function isColorConversionNeeded() { - if (this.adobe && this.adobe.transformCode) { - // The adobe transform marker overrides any previous setting - return true; - } else if (this.numComponents === 3) { - if (!this.adobe && this.colorTransform === 0) { - // If the Adobe transform marker is not present and the image - // dictionary has a 'ColorTransform' entry, explicitly set to `0`, - // then the colours should *not* be transformed. - return false; - } - return true; - } else { // `this.numComponents !== 3` - if (!this.adobe && this.colorTransform === 1) { - // If the Adobe transform marker is not present and the image - // dictionary has a 'ColorTransform' entry, explicitly set to `1`, - // then the colours should be transformed. - return true; - } - return false; - } - }, - - _convertYccToRgb: function convertYccToRgb(data) { - var Y, Cb, Cr; - for (var i = 0, length = data.length; i < length; i += 3) { - Y = data[i ]; - Cb = data[i + 1]; - Cr = data[i + 2]; - data[i ] = clamp0to255(Y - 179.456 + 1.402 * Cr); - data[i + 1] = clamp0to255(Y + 135.459 - 0.344 * Cb - 0.714 * Cr); - data[i + 2] = clamp0to255(Y - 226.816 + 1.772 * Cb); - } - return data; - }, - - _convertYcckToRgb: function convertYcckToRgb(data) { - var Y, Cb, Cr, k; - var offset = 0; - for (var i = 0, length = data.length; i < length; i += 4) { - Y = data[i]; - Cb = data[i + 1]; - Cr = data[i + 2]; - k = data[i + 3]; - - var r = -122.67195406894 + - Cb * (-6.60635669420364e-5 * Cb + 0.000437130475926232 * Cr - - 5.4080610064599e-5 * Y + 0.00048449797120281 * k - - 0.154362151871126) + - Cr * (-0.000957964378445773 * Cr + 0.000817076911346625 * Y - - 0.00477271405408747 * k + 1.53380253221734) + - Y * (0.000961250184130688 * Y - 0.00266257332283933 * k + - 0.48357088451265) + - k * (-0.000336197177618394 * k + 0.484791561490776); - - var g = 107.268039397724 + - Cb * (2.19927104525741e-5 * Cb - 0.000640992018297945 * Cr + - 0.000659397001245577 * Y + 0.000426105652938837 * k - - 0.176491792462875) + - Cr * (-0.000778269941513683 * Cr + 0.00130872261408275 * Y + - 0.000770482631801132 * k - 0.151051492775562) + - Y * (0.00126935368114843 * Y - 0.00265090189010898 * k + - 0.25802910206845) + - k * (-0.000318913117588328 * k - 0.213742400323665); - - var b = -20.810012546947 + - Cb * (-0.000570115196973677 * Cb - 2.63409051004589e-5 * Cr + - 0.0020741088115012 * Y - 0.00288260236853442 * k + - 0.814272968359295) + - Cr * (-1.53496057440975e-5 * Cr - 0.000132689043961446 * Y + - 0.000560833691242812 * k - 0.195152027534049) + - Y * (0.00174418132927582 * Y - 0.00255243321439347 * k + - 0.116935020465145) + - k * (-0.000343531996510555 * k + 0.24165260232407); - - data[offset++] = clamp0to255(r); - data[offset++] = clamp0to255(g); - data[offset++] = clamp0to255(b); - } - return data; - }, - - _convertYcckToCmyk: function convertYcckToCmyk(data) { - var Y, Cb, Cr; - for (var i = 0, length = data.length; i < length; i += 4) { - Y = data[i]; - Cb = data[i + 1]; - Cr = data[i + 2]; - data[i ] = clamp0to255(434.456 - Y - 1.402 * Cr); - data[i + 1] = clamp0to255(119.541 - Y + 0.344 * Cb + 0.714 * Cr); - data[i + 2] = clamp0to255(481.816 - Y - 1.772 * Cb); - // K in data[i + 3] is unchanged - } - return data; - }, - - _convertCmykToRgb: function convertCmykToRgb(data) { - var c, m, y, k; - var offset = 0; - var min = -255 * 255 * 255; - var scale = 1 / 255 / 255; - for (var i = 0, length = data.length; i < length; i += 4) { - c = data[i]; - m = data[i + 1]; - y = data[i + 2]; - k = data[i + 3]; - - var r = - c * (-4.387332384609988 * c + 54.48615194189176 * m + - 18.82290502165302 * y + 212.25662451639585 * k - - 72734.4411664936) + - m * (1.7149763477362134 * m - 5.6096736904047315 * y - - 17.873870861415444 * k - 1401.7366389350734) + - y * (-2.5217340131683033 * y - 21.248923337353073 * k + - 4465.541406466231) - - k * (21.86122147463605 * k + 48317.86113160301); - var g = - c * (8.841041422036149 * c + 60.118027045597366 * m + - 6.871425592049007 * y + 31.159100130055922 * k - - 20220.756542821975) + - m * (-15.310361306967817 * m + 17.575251261109482 * y + - 131.35250912493976 * k - 48691.05921601825) + - y * (4.444339102852739 * y + 9.8632861493405 * k - - 6341.191035517494) - - k * (20.737325471181034 * k + 47890.15695978492); - var b = - c * (0.8842522430003296 * c + 8.078677503112928 * m + - 30.89978309703729 * y - 0.23883238689178934 * k - - 3616.812083916688) + - m * (10.49593273432072 * m + 63.02378494754052 * y + - 50.606957656360734 * k - 28620.90484698408) + - y * (0.03296041114873217 * y + 115.60384449646641 * k - - 49363.43385999684) - - k * (22.33816807309886 * k + 45932.16563550634); - - data[offset++] = r >= 0 ? 255 : r <= min ? 0 : 255 + r * scale | 0; - data[offset++] = g >= 0 ? 255 : g <= min ? 0 : 255 + g * scale | 0; - data[offset++] = b >= 0 ? 255 : b <= min ? 0 : 255 + b * scale | 0; - } - return data; - }, - - getData: function getData(width, height, forceRGBoutput) { - if (this.numComponents > 4) { - error('JPEG error: Unsupported color mode'); - } - // type of data: Uint8Array(width * height * numComponents) - var data = this._getLinearizedBlockData(width, height); - - if (this.numComponents === 1 && forceRGBoutput) { - var dataLength = data.length; - var rgbData = new Uint8Array(dataLength * 3); - var offset = 0; - for (var i = 0; i < dataLength; i++) { - var grayColor = data[i]; - rgbData[offset++] = grayColor; - rgbData[offset++] = grayColor; - rgbData[offset++] = grayColor; - } - return rgbData; - } else if (this.numComponents === 3 && this._isColorConversionNeeded()) { - return this._convertYccToRgb(data); - } else if (this.numComponents === 4) { - if (this._isColorConversionNeeded()) { - if (forceRGBoutput) { - return this._convertYcckToRgb(data); - } else { - return this._convertYcckToCmyk(data); - } - } else if (forceRGBoutput) { - return this._convertCmykToRgb(data); - } - } - return data; - } - }; - - return JpegImage; -})(); - -exports.JpegImage = JpegImage; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreJpx = {}), root.pdfjsSharedUtil, - root.pdfjsCoreArithmeticDecoder); - } -}(this, function (exports, sharedUtil, coreArithmeticDecoder) { - -var info = sharedUtil.info; -var warn = sharedUtil.warn; -var error = sharedUtil.error; -var log2 = sharedUtil.log2; -var readUint16 = sharedUtil.readUint16; -var readUint32 = sharedUtil.readUint32; -var ArithmeticDecoder = coreArithmeticDecoder.ArithmeticDecoder; - -var JpxImage = (function JpxImageClosure() { - // Table E.1 - var SubbandsGainLog2 = { - 'LL': 0, - 'LH': 1, - 'HL': 1, - 'HH': 2 - }; - function JpxImage() { - this.failOnCorruptedImage = false; - } - JpxImage.prototype = { - parse: function JpxImage_parse(data) { - - var head = readUint16(data, 0); - // No box header, immediate start of codestream (SOC) - if (head === 0xFF4F) { - this.parseCodestream(data, 0, data.length); - return; - } - - var position = 0, length = data.length; - while (position < length) { - var headerSize = 8; - var lbox = readUint32(data, position); - var tbox = readUint32(data, position + 4); - position += headerSize; - if (lbox === 1) { - // XLBox: read UInt64 according to spec. - // JavaScript's int precision of 53 bit should be sufficient here. - lbox = readUint32(data, position) * 4294967296 + - readUint32(data, position + 4); - position += 8; - headerSize += 8; - } - if (lbox === 0) { - lbox = length - position + headerSize; - } - if (lbox < headerSize) { - error('JPX Error: Invalid box field size'); - } - var dataLength = lbox - headerSize; - var jumpDataLength = true; - switch (tbox) { - case 0x6A703268: // 'jp2h' - jumpDataLength = false; // parsing child boxes - break; - case 0x636F6C72: // 'colr' - // Colorspaces are not used, the CS from the PDF is used. - var method = data[position]; - if (method === 1) { - // enumerated colorspace - var colorspace = readUint32(data, position + 3); - switch (colorspace) { - case 16: // this indicates a sRGB colorspace - case 17: // this indicates a grayscale colorspace - case 18: // this indicates a YUV colorspace - break; - default: - warn('Unknown colorspace ' + colorspace); - break; - } - } else if (method === 2) { - info('ICC profile not supported'); - } - break; - case 0x6A703263: // 'jp2c' - this.parseCodestream(data, position, position + dataLength); - break; - case 0x6A502020: // 'jP\024\024' - if (0x0d0a870a !== readUint32(data, position)) { - warn('Invalid JP2 signature'); - } - break; - // The following header types are valid but currently not used: - case 0x6A501A1A: // 'jP\032\032' - case 0x66747970: // 'ftyp' - case 0x72726571: // 'rreq' - case 0x72657320: // 'res ' - case 0x69686472: // 'ihdr' - break; - default: - var headerType = String.fromCharCode((tbox >> 24) & 0xFF, - (tbox >> 16) & 0xFF, - (tbox >> 8) & 0xFF, - tbox & 0xFF); - warn('Unsupported header type ' + tbox + ' (' + headerType + ')'); - break; - } - if (jumpDataLength) { - position += dataLength; - } - } - }, - parseImageProperties: function JpxImage_parseImageProperties(stream) { - var newByte = stream.getByte(); - while (newByte >= 0) { - var oldByte = newByte; - newByte = stream.getByte(); - var code = (oldByte << 8) | newByte; - // Image and tile size (SIZ) - if (code === 0xFF51) { - stream.skip(4); - var Xsiz = stream.getInt32() >>> 0; // Byte 4 - var Ysiz = stream.getInt32() >>> 0; // Byte 8 - var XOsiz = stream.getInt32() >>> 0; // Byte 12 - var YOsiz = stream.getInt32() >>> 0; // Byte 16 - stream.skip(16); - var Csiz = stream.getUint16(); // Byte 36 - this.width = Xsiz - XOsiz; - this.height = Ysiz - YOsiz; - this.componentsCount = Csiz; - // Results are always returned as Uint8Arrays - this.bitsPerComponent = 8; - return; - } - } - error('JPX Error: No size marker found in JPX stream'); - }, - parseCodestream: function JpxImage_parseCodestream(data, start, end) { - var context = {}; - var doNotRecover = false; - try { - var position = start; - while (position + 1 < end) { - var code = readUint16(data, position); - position += 2; - - var length = 0, j, sqcd, spqcds, spqcdSize, scalarExpounded, tile; - switch (code) { - case 0xFF4F: // Start of codestream (SOC) - context.mainHeader = true; - break; - case 0xFFD9: // End of codestream (EOC) - break; - case 0xFF51: // Image and tile size (SIZ) - length = readUint16(data, position); - var siz = {}; - siz.Xsiz = readUint32(data, position + 4); - siz.Ysiz = readUint32(data, position + 8); - siz.XOsiz = readUint32(data, position + 12); - siz.YOsiz = readUint32(data, position + 16); - siz.XTsiz = readUint32(data, position + 20); - siz.YTsiz = readUint32(data, position + 24); - siz.XTOsiz = readUint32(data, position + 28); - siz.YTOsiz = readUint32(data, position + 32); - var componentsCount = readUint16(data, position + 36); - siz.Csiz = componentsCount; - var components = []; - j = position + 38; - for (var i = 0; i < componentsCount; i++) { - var component = { - precision: (data[j] & 0x7F) + 1, - isSigned: !!(data[j] & 0x80), - XRsiz: data[j + 1], - YRsiz: data[j + 1] - }; - calculateComponentDimensions(component, siz); - components.push(component); - } - context.SIZ = siz; - context.components = components; - calculateTileGrids(context, components); - context.QCC = []; - context.COC = []; - break; - case 0xFF5C: // Quantization default (QCD) - length = readUint16(data, position); - var qcd = {}; - j = position + 2; - sqcd = data[j++]; - switch (sqcd & 0x1F) { - case 0: - spqcdSize = 8; - scalarExpounded = true; - break; - case 1: - spqcdSize = 16; - scalarExpounded = false; - break; - case 2: - spqcdSize = 16; - scalarExpounded = true; - break; - default: - throw new Error('Invalid SQcd value ' + sqcd); - } - qcd.noQuantization = (spqcdSize === 8); - qcd.scalarExpounded = scalarExpounded; - qcd.guardBits = sqcd >> 5; - spqcds = []; - while (j < length + position) { - var spqcd = {}; - if (spqcdSize === 8) { - spqcd.epsilon = data[j++] >> 3; - spqcd.mu = 0; - } else { - spqcd.epsilon = data[j] >> 3; - spqcd.mu = ((data[j] & 0x7) << 8) | data[j + 1]; - j += 2; - } - spqcds.push(spqcd); - } - qcd.SPqcds = spqcds; - if (context.mainHeader) { - context.QCD = qcd; - } else { - context.currentTile.QCD = qcd; - context.currentTile.QCC = []; - } - break; - case 0xFF5D: // Quantization component (QCC) - length = readUint16(data, position); - var qcc = {}; - j = position + 2; - var cqcc; - if (context.SIZ.Csiz < 257) { - cqcc = data[j++]; - } else { - cqcc = readUint16(data, j); - j += 2; - } - sqcd = data[j++]; - switch (sqcd & 0x1F) { - case 0: - spqcdSize = 8; - scalarExpounded = true; - break; - case 1: - spqcdSize = 16; - scalarExpounded = false; - break; - case 2: - spqcdSize = 16; - scalarExpounded = true; - break; - default: - throw new Error('Invalid SQcd value ' + sqcd); - } - qcc.noQuantization = (spqcdSize === 8); - qcc.scalarExpounded = scalarExpounded; - qcc.guardBits = sqcd >> 5; - spqcds = []; - while (j < (length + position)) { - spqcd = {}; - if (spqcdSize === 8) { - spqcd.epsilon = data[j++] >> 3; - spqcd.mu = 0; - } else { - spqcd.epsilon = data[j] >> 3; - spqcd.mu = ((data[j] & 0x7) << 8) | data[j + 1]; - j += 2; - } - spqcds.push(spqcd); - } - qcc.SPqcds = spqcds; - if (context.mainHeader) { - context.QCC[cqcc] = qcc; - } else { - context.currentTile.QCC[cqcc] = qcc; - } - break; - case 0xFF52: // Coding style default (COD) - length = readUint16(data, position); - var cod = {}; - j = position + 2; - var scod = data[j++]; - cod.entropyCoderWithCustomPrecincts = !!(scod & 1); - cod.sopMarkerUsed = !!(scod & 2); - cod.ephMarkerUsed = !!(scod & 4); - cod.progressionOrder = data[j++]; - cod.layersCount = readUint16(data, j); - j += 2; - cod.multipleComponentTransform = data[j++]; - - cod.decompositionLevelsCount = data[j++]; - cod.xcb = (data[j++] & 0xF) + 2; - cod.ycb = (data[j++] & 0xF) + 2; - var blockStyle = data[j++]; - cod.selectiveArithmeticCodingBypass = !!(blockStyle & 1); - cod.resetContextProbabilities = !!(blockStyle & 2); - cod.terminationOnEachCodingPass = !!(blockStyle & 4); - cod.verticalyStripe = !!(blockStyle & 8); - cod.predictableTermination = !!(blockStyle & 16); - cod.segmentationSymbolUsed = !!(blockStyle & 32); - cod.reversibleTransformation = data[j++]; - if (cod.entropyCoderWithCustomPrecincts) { - var precinctsSizes = []; - while (j < length + position) { - var precinctsSize = data[j++]; - precinctsSizes.push({ - PPx: precinctsSize & 0xF, - PPy: precinctsSize >> 4 - }); - } - cod.precinctsSizes = precinctsSizes; - } - var unsupported = []; - if (cod.selectiveArithmeticCodingBypass) { - unsupported.push('selectiveArithmeticCodingBypass'); - } - if (cod.resetContextProbabilities) { - unsupported.push('resetContextProbabilities'); - } - if (cod.terminationOnEachCodingPass) { - unsupported.push('terminationOnEachCodingPass'); - } - if (cod.verticalyStripe) { - unsupported.push('verticalyStripe'); - } - if (cod.predictableTermination) { - unsupported.push('predictableTermination'); - } - if (unsupported.length > 0) { - doNotRecover = true; - throw new Error('Unsupported COD options (' + - unsupported.join(', ') + ')'); - } - if (context.mainHeader) { - context.COD = cod; - } else { - context.currentTile.COD = cod; - context.currentTile.COC = []; - } - break; - case 0xFF90: // Start of tile-part (SOT) - length = readUint16(data, position); - tile = {}; - tile.index = readUint16(data, position + 2); - tile.length = readUint32(data, position + 4); - tile.dataEnd = tile.length + position - 2; - tile.partIndex = data[position + 8]; - tile.partsCount = data[position + 9]; - - context.mainHeader = false; - if (tile.partIndex === 0) { - // reset component specific settings - tile.COD = context.COD; - tile.COC = context.COC.slice(0); // clone of the global COC - tile.QCD = context.QCD; - tile.QCC = context.QCC.slice(0); // clone of the global COC - } - context.currentTile = tile; - break; - case 0xFF93: // Start of data (SOD) - tile = context.currentTile; - if (tile.partIndex === 0) { - initializeTile(context, tile.index); - buildPackets(context); - } - - // moving to the end of the data - length = tile.dataEnd - position; - parseTilePackets(context, data, position, length); - break; - case 0xFF55: // Tile-part lengths, main header (TLM) - case 0xFF57: // Packet length, main header (PLM) - case 0xFF58: // Packet length, tile-part header (PLT) - case 0xFF64: // Comment (COM) - length = readUint16(data, position); - // skipping content - break; - case 0xFF53: // Coding style component (COC) - throw new Error('Codestream code 0xFF53 (COC) is ' + - 'not implemented'); - default: - throw new Error('Unknown codestream code: ' + code.toString(16)); - } - position += length; - } - } catch (e) { - if (doNotRecover || this.failOnCorruptedImage) { - error('JPX Error: ' + e.message); - } else { - warn('JPX: Trying to recover from: ' + e.message); - } - } - this.tiles = transformComponents(context); - this.width = context.SIZ.Xsiz - context.SIZ.XOsiz; - this.height = context.SIZ.Ysiz - context.SIZ.YOsiz; - this.componentsCount = context.SIZ.Csiz; - } - }; - function calculateComponentDimensions(component, siz) { - // Section B.2 Component mapping - component.x0 = Math.ceil(siz.XOsiz / component.XRsiz); - component.x1 = Math.ceil(siz.Xsiz / component.XRsiz); - component.y0 = Math.ceil(siz.YOsiz / component.YRsiz); - component.y1 = Math.ceil(siz.Ysiz / component.YRsiz); - component.width = component.x1 - component.x0; - component.height = component.y1 - component.y0; - } - function calculateTileGrids(context, components) { - var siz = context.SIZ; - // Section B.3 Division into tile and tile-components - var tile, tiles = []; - var numXtiles = Math.ceil((siz.Xsiz - siz.XTOsiz) / siz.XTsiz); - var numYtiles = Math.ceil((siz.Ysiz - siz.YTOsiz) / siz.YTsiz); - for (var q = 0; q < numYtiles; q++) { - for (var p = 0; p < numXtiles; p++) { - tile = {}; - tile.tx0 = Math.max(siz.XTOsiz + p * siz.XTsiz, siz.XOsiz); - tile.ty0 = Math.max(siz.YTOsiz + q * siz.YTsiz, siz.YOsiz); - tile.tx1 = Math.min(siz.XTOsiz + (p + 1) * siz.XTsiz, siz.Xsiz); - tile.ty1 = Math.min(siz.YTOsiz + (q + 1) * siz.YTsiz, siz.Ysiz); - tile.width = tile.tx1 - tile.tx0; - tile.height = tile.ty1 - tile.ty0; - tile.components = []; - tiles.push(tile); - } - } - context.tiles = tiles; - - var componentsCount = siz.Csiz; - for (var i = 0, ii = componentsCount; i < ii; i++) { - var component = components[i]; - for (var j = 0, jj = tiles.length; j < jj; j++) { - var tileComponent = {}; - tile = tiles[j]; - tileComponent.tcx0 = Math.ceil(tile.tx0 / component.XRsiz); - tileComponent.tcy0 = Math.ceil(tile.ty0 / component.YRsiz); - tileComponent.tcx1 = Math.ceil(tile.tx1 / component.XRsiz); - tileComponent.tcy1 = Math.ceil(tile.ty1 / component.YRsiz); - tileComponent.width = tileComponent.tcx1 - tileComponent.tcx0; - tileComponent.height = tileComponent.tcy1 - tileComponent.tcy0; - tile.components[i] = tileComponent; - } - } - } - function getBlocksDimensions(context, component, r) { - var codOrCoc = component.codingStyleParameters; - var result = {}; - if (!codOrCoc.entropyCoderWithCustomPrecincts) { - result.PPx = 15; - result.PPy = 15; - } else { - result.PPx = codOrCoc.precinctsSizes[r].PPx; - result.PPy = codOrCoc.precinctsSizes[r].PPy; - } - // calculate codeblock size as described in section B.7 - result.xcb_ = (r > 0 ? Math.min(codOrCoc.xcb, result.PPx - 1) : - Math.min(codOrCoc.xcb, result.PPx)); - result.ycb_ = (r > 0 ? Math.min(codOrCoc.ycb, result.PPy - 1) : - Math.min(codOrCoc.ycb, result.PPy)); - return result; - } - function buildPrecincts(context, resolution, dimensions) { - // Section B.6 Division resolution to precincts - var precinctWidth = 1 << dimensions.PPx; - var precinctHeight = 1 << dimensions.PPy; - // Jasper introduces codeblock groups for mapping each subband codeblocks - // to precincts. Precinct partition divides a resolution according to width - // and height parameters. The subband that belongs to the resolution level - // has a different size than the level, unless it is the zero resolution. - - // From Jasper documentation: jpeg2000.pdf, section K: Tier-2 coding: - // The precinct partitioning for a particular subband is derived from a - // partitioning of its parent LL band (i.e., the LL band at the next higher - // resolution level)... The LL band associated with each resolution level is - // divided into precincts... Each of the resulting precinct regions is then - // mapped into its child subbands (if any) at the next lower resolution - // level. This is accomplished by using the coordinate transformation - // (u, v) = (ceil(x/2), ceil(y/2)) where (x, y) and (u, v) are the - // coordinates of a point in the LL band and child subband, respectively. - var isZeroRes = resolution.resLevel === 0; - var precinctWidthInSubband = 1 << (dimensions.PPx + (isZeroRes ? 0 : -1)); - var precinctHeightInSubband = 1 << (dimensions.PPy + (isZeroRes ? 0 : -1)); - var numprecinctswide = (resolution.trx1 > resolution.trx0 ? - Math.ceil(resolution.trx1 / precinctWidth) - - Math.floor(resolution.trx0 / precinctWidth) : 0); - var numprecinctshigh = (resolution.try1 > resolution.try0 ? - Math.ceil(resolution.try1 / precinctHeight) - - Math.floor(resolution.try0 / precinctHeight) : 0); - var numprecincts = numprecinctswide * numprecinctshigh; - - resolution.precinctParameters = { - precinctWidth: precinctWidth, - precinctHeight: precinctHeight, - numprecinctswide: numprecinctswide, - numprecinctshigh: numprecinctshigh, - numprecincts: numprecincts, - precinctWidthInSubband: precinctWidthInSubband, - precinctHeightInSubband: precinctHeightInSubband - }; - } - function buildCodeblocks(context, subband, dimensions) { - // Section B.7 Division sub-band into code-blocks - var xcb_ = dimensions.xcb_; - var ycb_ = dimensions.ycb_; - var codeblockWidth = 1 << xcb_; - var codeblockHeight = 1 << ycb_; - var cbx0 = subband.tbx0 >> xcb_; - var cby0 = subband.tby0 >> ycb_; - var cbx1 = (subband.tbx1 + codeblockWidth - 1) >> xcb_; - var cby1 = (subband.tby1 + codeblockHeight - 1) >> ycb_; - var precinctParameters = subband.resolution.precinctParameters; - var codeblocks = []; - var precincts = []; - var i, j, codeblock, precinctNumber; - for (j = cby0; j < cby1; j++) { - for (i = cbx0; i < cbx1; i++) { - codeblock = { - cbx: i, - cby: j, - tbx0: codeblockWidth * i, - tby0: codeblockHeight * j, - tbx1: codeblockWidth * (i + 1), - tby1: codeblockHeight * (j + 1) - }; - - codeblock.tbx0_ = Math.max(subband.tbx0, codeblock.tbx0); - codeblock.tby0_ = Math.max(subband.tby0, codeblock.tby0); - codeblock.tbx1_ = Math.min(subband.tbx1, codeblock.tbx1); - codeblock.tby1_ = Math.min(subband.tby1, codeblock.tby1); - - // Calculate precinct number for this codeblock, codeblock position - // should be relative to its subband, use actual dimension and position - // See comment about codeblock group width and height - var pi = Math.floor((codeblock.tbx0_ - subband.tbx0) / - precinctParameters.precinctWidthInSubband); - var pj = Math.floor((codeblock.tby0_ - subband.tby0) / - precinctParameters.precinctHeightInSubband); - precinctNumber = pi + (pj * precinctParameters.numprecinctswide); - - codeblock.precinctNumber = precinctNumber; - codeblock.subbandType = subband.type; - codeblock.Lblock = 3; - - if (codeblock.tbx1_ <= codeblock.tbx0_ || - codeblock.tby1_ <= codeblock.tby0_) { - continue; - } - codeblocks.push(codeblock); - // building precinct for the sub-band - var precinct = precincts[precinctNumber]; - if (precinct !== undefined) { - if (i < precinct.cbxMin) { - precinct.cbxMin = i; - } else if (i > precinct.cbxMax) { - precinct.cbxMax = i; - } - if (j < precinct.cbyMin) { - precinct.cbxMin = j; - } else if (j > precinct.cbyMax) { - precinct.cbyMax = j; - } - } else { - precincts[precinctNumber] = precinct = { - cbxMin: i, - cbyMin: j, - cbxMax: i, - cbyMax: j - }; - } - codeblock.precinct = precinct; - } - } - subband.codeblockParameters = { - codeblockWidth: xcb_, - codeblockHeight: ycb_, - numcodeblockwide: cbx1 - cbx0 + 1, - numcodeblockhigh: cby1 - cby0 + 1 - }; - subband.codeblocks = codeblocks; - subband.precincts = precincts; - } - function createPacket(resolution, precinctNumber, layerNumber) { - var precinctCodeblocks = []; - // Section B.10.8 Order of info in packet - var subbands = resolution.subbands; - // sub-bands already ordered in 'LL', 'HL', 'LH', and 'HH' sequence - for (var i = 0, ii = subbands.length; i < ii; i++) { - var subband = subbands[i]; - var codeblocks = subband.codeblocks; - for (var j = 0, jj = codeblocks.length; j < jj; j++) { - var codeblock = codeblocks[j]; - if (codeblock.precinctNumber !== precinctNumber) { - continue; - } - precinctCodeblocks.push(codeblock); - } - } - return { - layerNumber: layerNumber, - codeblocks: precinctCodeblocks - }; - } - function LayerResolutionComponentPositionIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var maxDecompositionLevelsCount = 0; - for (var q = 0; q < componentsCount; q++) { - maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, - tile.components[q].codingStyleParameters.decompositionLevelsCount); - } - - var l = 0, r = 0, i = 0, k = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.1 Layer-resolution-component-position - for (; l < layersCount; l++) { - for (; r <= maxDecompositionLevelsCount; r++) { - for (; i < componentsCount; i++) { - var component = tile.components[i]; - if (r > component.codingStyleParameters.decompositionLevelsCount) { - continue; - } - - var resolution = component.resolutions[r]; - var numprecincts = resolution.precinctParameters.numprecincts; - for (; k < numprecincts;) { - var packet = createPacket(resolution, k, l); - k++; - return packet; - } - k = 0; - } - i = 0; - } - r = 0; - } - error('JPX Error: Out of packets'); - }; - } - function ResolutionLayerComponentPositionIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var maxDecompositionLevelsCount = 0; - for (var q = 0; q < componentsCount; q++) { - maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, - tile.components[q].codingStyleParameters.decompositionLevelsCount); - } - - var r = 0, l = 0, i = 0, k = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.2 Resolution-layer-component-position - for (; r <= maxDecompositionLevelsCount; r++) { - for (; l < layersCount; l++) { - for (; i < componentsCount; i++) { - var component = tile.components[i]; - if (r > component.codingStyleParameters.decompositionLevelsCount) { - continue; - } - - var resolution = component.resolutions[r]; - var numprecincts = resolution.precinctParameters.numprecincts; - for (; k < numprecincts;) { - var packet = createPacket(resolution, k, l); - k++; - return packet; - } - k = 0; - } - i = 0; - } - l = 0; - } - error('JPX Error: Out of packets'); - }; - } - function ResolutionPositionComponentLayerIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var l, r, c, p; - var maxDecompositionLevelsCount = 0; - for (c = 0; c < componentsCount; c++) { - var component = tile.components[c]; - maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, - component.codingStyleParameters.decompositionLevelsCount); - } - var maxNumPrecinctsInLevel = new Int32Array( - maxDecompositionLevelsCount + 1); - for (r = 0; r <= maxDecompositionLevelsCount; ++r) { - var maxNumPrecincts = 0; - for (c = 0; c < componentsCount; ++c) { - var resolutions = tile.components[c].resolutions; - if (r < resolutions.length) { - maxNumPrecincts = Math.max(maxNumPrecincts, - resolutions[r].precinctParameters.numprecincts); - } - } - maxNumPrecinctsInLevel[r] = maxNumPrecincts; - } - l = 0; - r = 0; - c = 0; - p = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.3 Resolution-position-component-layer - for (; r <= maxDecompositionLevelsCount; r++) { - for (; p < maxNumPrecinctsInLevel[r]; p++) { - for (; c < componentsCount; c++) { - var component = tile.components[c]; - if (r > component.codingStyleParameters.decompositionLevelsCount) { - continue; - } - var resolution = component.resolutions[r]; - var numprecincts = resolution.precinctParameters.numprecincts; - if (p >= numprecincts) { - continue; - } - for (; l < layersCount;) { - var packet = createPacket(resolution, p, l); - l++; - return packet; - } - l = 0; - } - c = 0; - } - p = 0; - } - error('JPX Error: Out of packets'); - }; - } - function PositionComponentResolutionLayerIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var precinctsSizes = getPrecinctSizesInImageScale(tile); - var precinctsIterationSizes = precinctsSizes; - var l = 0, r = 0, c = 0, px = 0, py = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.4 Position-component-resolution-layer - for (; py < precinctsIterationSizes.maxNumHigh; py++) { - for (; px < precinctsIterationSizes.maxNumWide; px++) { - for (; c < componentsCount; c++) { - var component = tile.components[c]; - var decompositionLevelsCount = - component.codingStyleParameters.decompositionLevelsCount; - for (; r <= decompositionLevelsCount; r++) { - var resolution = component.resolutions[r]; - var sizeInImageScale = - precinctsSizes.components[c].resolutions[r]; - var k = getPrecinctIndexIfExist( - px, - py, - sizeInImageScale, - precinctsIterationSizes, - resolution); - if (k === null) { - continue; - } - for (; l < layersCount;) { - var packet = createPacket(resolution, k, l); - l++; - return packet; - } - l = 0; - } - r = 0; - } - c = 0; - } - px = 0; - } - error('JPX Error: Out of packets'); - }; - } - function ComponentPositionResolutionLayerIterator(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var layersCount = tile.codingStyleDefaultParameters.layersCount; - var componentsCount = siz.Csiz; - var precinctsSizes = getPrecinctSizesInImageScale(tile); - var l = 0, r = 0, c = 0, px = 0, py = 0; - - this.nextPacket = function JpxImage_nextPacket() { - // Section B.12.1.5 Component-position-resolution-layer - for (; c < componentsCount; ++c) { - var component = tile.components[c]; - var precinctsIterationSizes = precinctsSizes.components[c]; - var decompositionLevelsCount = - component.codingStyleParameters.decompositionLevelsCount; - for (; py < precinctsIterationSizes.maxNumHigh; py++) { - for (; px < precinctsIterationSizes.maxNumWide; px++) { - for (; r <= decompositionLevelsCount; r++) { - var resolution = component.resolutions[r]; - var sizeInImageScale = precinctsIterationSizes.resolutions[r]; - var k = getPrecinctIndexIfExist( - px, - py, - sizeInImageScale, - precinctsIterationSizes, - resolution); - if (k === null) { - continue; - } - for (; l < layersCount;) { - var packet = createPacket(resolution, k, l); - l++; - return packet; - } - l = 0; - } - r = 0; - } - px = 0; - } - py = 0; - } - error('JPX Error: Out of packets'); - }; - } - function getPrecinctIndexIfExist( - pxIndex, pyIndex, sizeInImageScale, precinctIterationSizes, resolution) { - var posX = pxIndex * precinctIterationSizes.minWidth; - var posY = pyIndex * precinctIterationSizes.minHeight; - if (posX % sizeInImageScale.width !== 0 || - posY % sizeInImageScale.height !== 0) { - return null; - } - var startPrecinctRowIndex = - (posY / sizeInImageScale.width) * - resolution.precinctParameters.numprecinctswide; - return (posX / sizeInImageScale.height) + startPrecinctRowIndex; - } - function getPrecinctSizesInImageScale(tile) { - var componentsCount = tile.components.length; - var minWidth = Number.MAX_VALUE; - var minHeight = Number.MAX_VALUE; - var maxNumWide = 0; - var maxNumHigh = 0; - var sizePerComponent = new Array(componentsCount); - for (var c = 0; c < componentsCount; c++) { - var component = tile.components[c]; - var decompositionLevelsCount = - component.codingStyleParameters.decompositionLevelsCount; - var sizePerResolution = new Array(decompositionLevelsCount + 1); - var minWidthCurrentComponent = Number.MAX_VALUE; - var minHeightCurrentComponent = Number.MAX_VALUE; - var maxNumWideCurrentComponent = 0; - var maxNumHighCurrentComponent = 0; - var scale = 1; - for (var r = decompositionLevelsCount; r >= 0; --r) { - var resolution = component.resolutions[r]; - var widthCurrentResolution = - scale * resolution.precinctParameters.precinctWidth; - var heightCurrentResolution = - scale * resolution.precinctParameters.precinctHeight; - minWidthCurrentComponent = Math.min( - minWidthCurrentComponent, - widthCurrentResolution); - minHeightCurrentComponent = Math.min( - minHeightCurrentComponent, - heightCurrentResolution); - maxNumWideCurrentComponent = Math.max(maxNumWideCurrentComponent, - resolution.precinctParameters.numprecinctswide); - maxNumHighCurrentComponent = Math.max(maxNumHighCurrentComponent, - resolution.precinctParameters.numprecinctshigh); - sizePerResolution[r] = { - width: widthCurrentResolution, - height: heightCurrentResolution - }; - scale <<= 1; - } - minWidth = Math.min(minWidth, minWidthCurrentComponent); - minHeight = Math.min(minHeight, minHeightCurrentComponent); - maxNumWide = Math.max(maxNumWide, maxNumWideCurrentComponent); - maxNumHigh = Math.max(maxNumHigh, maxNumHighCurrentComponent); - sizePerComponent[c] = { - resolutions: sizePerResolution, - minWidth: minWidthCurrentComponent, - minHeight: minHeightCurrentComponent, - maxNumWide: maxNumWideCurrentComponent, - maxNumHigh: maxNumHighCurrentComponent - }; - } - return { - components: sizePerComponent, - minWidth: minWidth, - minHeight: minHeight, - maxNumWide: maxNumWide, - maxNumHigh: maxNumHigh - }; - } - function buildPackets(context) { - var siz = context.SIZ; - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var componentsCount = siz.Csiz; - // Creating resolutions and sub-bands for each component - for (var c = 0; c < componentsCount; c++) { - var component = tile.components[c]; - var decompositionLevelsCount = - component.codingStyleParameters.decompositionLevelsCount; - // Section B.5 Resolution levels and sub-bands - var resolutions = []; - var subbands = []; - for (var r = 0; r <= decompositionLevelsCount; r++) { - var blocksDimensions = getBlocksDimensions(context, component, r); - var resolution = {}; - var scale = 1 << (decompositionLevelsCount - r); - resolution.trx0 = Math.ceil(component.tcx0 / scale); - resolution.try0 = Math.ceil(component.tcy0 / scale); - resolution.trx1 = Math.ceil(component.tcx1 / scale); - resolution.try1 = Math.ceil(component.tcy1 / scale); - resolution.resLevel = r; - buildPrecincts(context, resolution, blocksDimensions); - resolutions.push(resolution); - - var subband; - if (r === 0) { - // one sub-band (LL) with last decomposition - subband = {}; - subband.type = 'LL'; - subband.tbx0 = Math.ceil(component.tcx0 / scale); - subband.tby0 = Math.ceil(component.tcy0 / scale); - subband.tbx1 = Math.ceil(component.tcx1 / scale); - subband.tby1 = Math.ceil(component.tcy1 / scale); - subband.resolution = resolution; - buildCodeblocks(context, subband, blocksDimensions); - subbands.push(subband); - resolution.subbands = [subband]; - } else { - var bscale = 1 << (decompositionLevelsCount - r + 1); - var resolutionSubbands = []; - // three sub-bands (HL, LH and HH) with rest of decompositions - subband = {}; - subband.type = 'HL'; - subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5); - subband.tby0 = Math.ceil(component.tcy0 / bscale); - subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5); - subband.tby1 = Math.ceil(component.tcy1 / bscale); - subband.resolution = resolution; - buildCodeblocks(context, subband, blocksDimensions); - subbands.push(subband); - resolutionSubbands.push(subband); - - subband = {}; - subband.type = 'LH'; - subband.tbx0 = Math.ceil(component.tcx0 / bscale); - subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5); - subband.tbx1 = Math.ceil(component.tcx1 / bscale); - subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5); - subband.resolution = resolution; - buildCodeblocks(context, subband, blocksDimensions); - subbands.push(subband); - resolutionSubbands.push(subband); - - subband = {}; - subband.type = 'HH'; - subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5); - subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5); - subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5); - subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5); - subband.resolution = resolution; - buildCodeblocks(context, subband, blocksDimensions); - subbands.push(subband); - resolutionSubbands.push(subband); - - resolution.subbands = resolutionSubbands; - } - } - component.resolutions = resolutions; - component.subbands = subbands; - } - // Generate the packets sequence - var progressionOrder = tile.codingStyleDefaultParameters.progressionOrder; - switch (progressionOrder) { - case 0: - tile.packetsIterator = - new LayerResolutionComponentPositionIterator(context); - break; - case 1: - tile.packetsIterator = - new ResolutionLayerComponentPositionIterator(context); - break; - case 2: - tile.packetsIterator = - new ResolutionPositionComponentLayerIterator(context); - break; - case 3: - tile.packetsIterator = - new PositionComponentResolutionLayerIterator(context); - break; - case 4: - tile.packetsIterator = - new ComponentPositionResolutionLayerIterator(context); - break; - default: - error('JPX Error: Unsupported progression order ' + progressionOrder); - } - } - function parseTilePackets(context, data, offset, dataLength) { - var position = 0; - var buffer, bufferSize = 0, skipNextBit = false; - function readBits(count) { - while (bufferSize < count) { - var b = data[offset + position]; - position++; - if (skipNextBit) { - buffer = (buffer << 7) | b; - bufferSize += 7; - skipNextBit = false; - } else { - buffer = (buffer << 8) | b; - bufferSize += 8; - } - if (b === 0xFF) { - skipNextBit = true; - } - } - bufferSize -= count; - return (buffer >>> bufferSize) & ((1 << count) - 1); - } - function skipMarkerIfEqual(value) { - if (data[offset + position - 1] === 0xFF && - data[offset + position] === value) { - skipBytes(1); - return true; - } else if (data[offset + position] === 0xFF && - data[offset + position + 1] === value) { - skipBytes(2); - return true; - } - return false; - } - function skipBytes(count) { - position += count; - } - function alignToByte() { - bufferSize = 0; - if (skipNextBit) { - position++; - skipNextBit = false; - } - } - function readCodingpasses() { - if (readBits(1) === 0) { - return 1; - } - if (readBits(1) === 0) { - return 2; - } - var value = readBits(2); - if (value < 3) { - return value + 3; - } - value = readBits(5); - if (value < 31) { - return value + 6; - } - value = readBits(7); - return value + 37; - } - var tileIndex = context.currentTile.index; - var tile = context.tiles[tileIndex]; - var sopMarkerUsed = context.COD.sopMarkerUsed; - var ephMarkerUsed = context.COD.ephMarkerUsed; - var packetsIterator = tile.packetsIterator; - while (position < dataLength) { - alignToByte(); - if (sopMarkerUsed && skipMarkerIfEqual(0x91)) { - // Skip also marker segment length and packet sequence ID - skipBytes(4); - } - var packet = packetsIterator.nextPacket(); - if (!readBits(1)) { - continue; - } - var layerNumber = packet.layerNumber; - var queue = [], codeblock; - for (var i = 0, ii = packet.codeblocks.length; i < ii; i++) { - codeblock = packet.codeblocks[i]; - var precinct = codeblock.precinct; - var codeblockColumn = codeblock.cbx - precinct.cbxMin; - var codeblockRow = codeblock.cby - precinct.cbyMin; - var codeblockIncluded = false; - var firstTimeInclusion = false; - var valueReady; - if (codeblock['included'] !== undefined) { - codeblockIncluded = !!readBits(1); - } else { - // reading inclusion tree - precinct = codeblock.precinct; - var inclusionTree, zeroBitPlanesTree; - if (precinct['inclusionTree'] !== undefined) { - inclusionTree = precinct.inclusionTree; - } else { - // building inclusion and zero bit-planes trees - var width = precinct.cbxMax - precinct.cbxMin + 1; - var height = precinct.cbyMax - precinct.cbyMin + 1; - inclusionTree = new InclusionTree(width, height, layerNumber); - zeroBitPlanesTree = new TagTree(width, height); - precinct.inclusionTree = inclusionTree; - precinct.zeroBitPlanesTree = zeroBitPlanesTree; - } - - if (inclusionTree.reset(codeblockColumn, codeblockRow, layerNumber)) { - while (true) { - if (readBits(1)) { - valueReady = !inclusionTree.nextLevel(); - if (valueReady) { - codeblock.included = true; - codeblockIncluded = firstTimeInclusion = true; - break; - } - } else { - inclusionTree.incrementValue(layerNumber); - break; - } - } - } - } - if (!codeblockIncluded) { - continue; - } - if (firstTimeInclusion) { - zeroBitPlanesTree = precinct.zeroBitPlanesTree; - zeroBitPlanesTree.reset(codeblockColumn, codeblockRow); - while (true) { - if (readBits(1)) { - valueReady = !zeroBitPlanesTree.nextLevel(); - if (valueReady) { - break; - } - } else { - zeroBitPlanesTree.incrementValue(); - } - } - codeblock.zeroBitPlanes = zeroBitPlanesTree.value; - } - var codingpasses = readCodingpasses(); - while (readBits(1)) { - codeblock.Lblock++; - } - var codingpassesLog2 = log2(codingpasses); - // rounding down log2 - var bits = ((codingpasses < (1 << codingpassesLog2)) ? - codingpassesLog2 - 1 : codingpassesLog2) + codeblock.Lblock; - var codedDataLength = readBits(bits); - queue.push({ - codeblock: codeblock, - codingpasses: codingpasses, - dataLength: codedDataLength - }); - } - alignToByte(); - if (ephMarkerUsed) { - skipMarkerIfEqual(0x92); - } - while (queue.length > 0) { - var packetItem = queue.shift(); - codeblock = packetItem.codeblock; - if (codeblock['data'] === undefined) { - codeblock.data = []; - } - codeblock.data.push({ - data: data, - start: offset + position, - end: offset + position + packetItem.dataLength, - codingpasses: packetItem.codingpasses - }); - position += packetItem.dataLength; - } - } - return position; - } - function copyCoefficients(coefficients, levelWidth, levelHeight, subband, - delta, mb, reversible, segmentationSymbolUsed) { - var x0 = subband.tbx0; - var y0 = subband.tby0; - var width = subband.tbx1 - subband.tbx0; - var codeblocks = subband.codeblocks; - var right = subband.type.charAt(0) === 'H' ? 1 : 0; - var bottom = subband.type.charAt(1) === 'H' ? levelWidth : 0; - - for (var i = 0, ii = codeblocks.length; i < ii; ++i) { - var codeblock = codeblocks[i]; - var blockWidth = codeblock.tbx1_ - codeblock.tbx0_; - var blockHeight = codeblock.tby1_ - codeblock.tby0_; - if (blockWidth === 0 || blockHeight === 0) { - continue; - } - if (codeblock['data'] === undefined) { - continue; - } - - var bitModel, currentCodingpassType; - bitModel = new BitModel(blockWidth, blockHeight, codeblock.subbandType, - codeblock.zeroBitPlanes, mb); - currentCodingpassType = 2; // first bit plane starts from cleanup - - // collect data - var data = codeblock.data, totalLength = 0, codingpasses = 0; - var j, jj, dataItem; - for (j = 0, jj = data.length; j < jj; j++) { - dataItem = data[j]; - totalLength += dataItem.end - dataItem.start; - codingpasses += dataItem.codingpasses; - } - var encodedData = new Uint8Array(totalLength); - var position = 0; - for (j = 0, jj = data.length; j < jj; j++) { - dataItem = data[j]; - var chunk = dataItem.data.subarray(dataItem.start, dataItem.end); - encodedData.set(chunk, position); - position += chunk.length; - } - // decoding the item - var decoder = new ArithmeticDecoder(encodedData, 0, totalLength); - bitModel.setDecoder(decoder); - - for (j = 0; j < codingpasses; j++) { - switch (currentCodingpassType) { - case 0: - bitModel.runSignificancePropagationPass(); - break; - case 1: - bitModel.runMagnitudeRefinementPass(); - break; - case 2: - bitModel.runCleanupPass(); - if (segmentationSymbolUsed) { - bitModel.checkSegmentationSymbol(); - } - break; - } - currentCodingpassType = (currentCodingpassType + 1) % 3; - } - - var offset = (codeblock.tbx0_ - x0) + (codeblock.tby0_ - y0) * width; - var sign = bitModel.coefficentsSign; - var magnitude = bitModel.coefficentsMagnitude; - var bitsDecoded = bitModel.bitsDecoded; - var magnitudeCorrection = reversible ? 0 : 0.5; - var k, n, nb; - position = 0; - // Do the interleaving of Section F.3.3 here, so we do not need - // to copy later. LL level is not interleaved, just copied. - var interleave = (subband.type !== 'LL'); - for (j = 0; j < blockHeight; j++) { - var row = (offset / width) | 0; // row in the non-interleaved subband - var levelOffset = 2 * row * (levelWidth - width) + right + bottom; - for (k = 0; k < blockWidth; k++) { - n = magnitude[position]; - if (n !== 0) { - n = (n + magnitudeCorrection) * delta; - if (sign[position] !== 0) { - n = -n; - } - nb = bitsDecoded[position]; - var pos = interleave ? (levelOffset + (offset << 1)) : offset; - if (reversible && (nb >= mb)) { - coefficients[pos] = n; - } else { - coefficients[pos] = n * (1 << (mb - nb)); - } - } - offset++; - position++; - } - offset += width - blockWidth; - } - } - } - function transformTile(context, tile, c) { - var component = tile.components[c]; - var codingStyleParameters = component.codingStyleParameters; - var quantizationParameters = component.quantizationParameters; - var decompositionLevelsCount = - codingStyleParameters.decompositionLevelsCount; - var spqcds = quantizationParameters.SPqcds; - var scalarExpounded = quantizationParameters.scalarExpounded; - var guardBits = quantizationParameters.guardBits; - var segmentationSymbolUsed = codingStyleParameters.segmentationSymbolUsed; - var precision = context.components[c].precision; - - var reversible = codingStyleParameters.reversibleTransformation; - var transform = (reversible ? new ReversibleTransform() : - new IrreversibleTransform()); - - var subbandCoefficients = []; - var b = 0; - for (var i = 0; i <= decompositionLevelsCount; i++) { - var resolution = component.resolutions[i]; - - var width = resolution.trx1 - resolution.trx0; - var height = resolution.try1 - resolution.try0; - // Allocate space for the whole sublevel. - var coefficients = new Float32Array(width * height); - - for (var j = 0, jj = resolution.subbands.length; j < jj; j++) { - var mu, epsilon; - if (!scalarExpounded) { - // formula E-5 - mu = spqcds[0].mu; - epsilon = spqcds[0].epsilon + (i > 0 ? 1 - i : 0); - } else { - mu = spqcds[b].mu; - epsilon = spqcds[b].epsilon; - b++; - } - - var subband = resolution.subbands[j]; - var gainLog2 = SubbandsGainLog2[subband.type]; - - // calculate quantization coefficient (Section E.1.1.1) - var delta = (reversible ? 1 : - Math.pow(2, precision + gainLog2 - epsilon) * (1 + mu / 2048)); - var mb = (guardBits + epsilon - 1); - - // In the first resolution level, copyCoefficients will fill the - // whole array with coefficients. In the succeeding passes, - // copyCoefficients will consecutively fill in the values that belong - // to the interleaved positions of the HL, LH, and HH coefficients. - // The LL coefficients will then be interleaved in Transform.iterate(). - copyCoefficients(coefficients, width, height, subband, delta, mb, - reversible, segmentationSymbolUsed); - } - subbandCoefficients.push({ - width: width, - height: height, - items: coefficients - }); - } - - var result = transform.calculate(subbandCoefficients, - component.tcx0, component.tcy0); - return { - left: component.tcx0, - top: component.tcy0, - width: result.width, - height: result.height, - items: result.items - }; - } - function transformComponents(context) { - var siz = context.SIZ; - var components = context.components; - var componentsCount = siz.Csiz; - var resultImages = []; - for (var i = 0, ii = context.tiles.length; i < ii; i++) { - var tile = context.tiles[i]; - var transformedTiles = []; - var c; - for (c = 0; c < componentsCount; c++) { - transformedTiles[c] = transformTile(context, tile, c); - } - var tile0 = transformedTiles[0]; - var out = new Uint8Array(tile0.items.length * componentsCount); - var result = { - left: tile0.left, - top: tile0.top, - width: tile0.width, - height: tile0.height, - items: out - }; - - // Section G.2.2 Inverse multi component transform - var shift, offset, max, min, maxK; - var pos = 0, j, jj, y0, y1, y2, r, g, b, k, val; - if (tile.codingStyleDefaultParameters.multipleComponentTransform) { - var fourComponents = componentsCount === 4; - var y0items = transformedTiles[0].items; - var y1items = transformedTiles[1].items; - var y2items = transformedTiles[2].items; - var y3items = fourComponents ? transformedTiles[3].items : null; - - // HACK: The multiple component transform formulas below assume that - // all components have the same precision. With this in mind, we - // compute shift and offset only once. - shift = components[0].precision - 8; - offset = (128 << shift) + 0.5; - max = 255 * (1 << shift); - maxK = max * 0.5; - min = -maxK; - - var component0 = tile.components[0]; - var alpha01 = componentsCount - 3; - jj = y0items.length; - if (!component0.codingStyleParameters.reversibleTransformation) { - // inverse irreversible multiple component transform - for (j = 0; j < jj; j++, pos += alpha01) { - y0 = y0items[j] + offset; - y1 = y1items[j]; - y2 = y2items[j]; - r = y0 + 1.402 * y2; - g = y0 - 0.34413 * y1 - 0.71414 * y2; - b = y0 + 1.772 * y1; - out[pos++] = r <= 0 ? 0 : r >= max ? 255 : r >> shift; - out[pos++] = g <= 0 ? 0 : g >= max ? 255 : g >> shift; - out[pos++] = b <= 0 ? 0 : b >= max ? 255 : b >> shift; - } - } else { - // inverse reversible multiple component transform - for (j = 0; j < jj; j++, pos += alpha01) { - y0 = y0items[j] + offset; - y1 = y1items[j]; - y2 = y2items[j]; - g = y0 - ((y2 + y1) >> 2); - r = g + y2; - b = g + y1; - out[pos++] = r <= 0 ? 0 : r >= max ? 255 : r >> shift; - out[pos++] = g <= 0 ? 0 : g >= max ? 255 : g >> shift; - out[pos++] = b <= 0 ? 0 : b >= max ? 255 : b >> shift; - } - } - if (fourComponents) { - for (j = 0, pos = 3; j < jj; j++, pos += 4) { - k = y3items[j]; - out[pos] = k <= min ? 0 : k >= maxK ? 255 : (k + offset) >> shift; - } - } - } else { // no multi-component transform - for (c = 0; c < componentsCount; c++) { - var items = transformedTiles[c].items; - shift = components[c].precision - 8; - offset = (128 << shift) + 0.5; - max = (127.5 * (1 << shift)); - min = -max; - for (pos = c, j = 0, jj = items.length; j < jj; j++) { - val = items[j]; - out[pos] = val <= min ? 0 : - val >= max ? 255 : (val + offset) >> shift; - pos += componentsCount; - } - } - } - resultImages.push(result); - } - return resultImages; - } - function initializeTile(context, tileIndex) { - var siz = context.SIZ; - var componentsCount = siz.Csiz; - var tile = context.tiles[tileIndex]; - for (var c = 0; c < componentsCount; c++) { - var component = tile.components[c]; - var qcdOrQcc = (context.currentTile.QCC[c] !== undefined ? - context.currentTile.QCC[c] : context.currentTile.QCD); - component.quantizationParameters = qcdOrQcc; - var codOrCoc = (context.currentTile.COC[c] !== undefined ? - context.currentTile.COC[c] : context.currentTile.COD); - component.codingStyleParameters = codOrCoc; - } - tile.codingStyleDefaultParameters = context.currentTile.COD; - } - - // Section B.10.2 Tag trees - var TagTree = (function TagTreeClosure() { - function TagTree(width, height) { - var levelsLength = log2(Math.max(width, height)) + 1; - this.levels = []; - for (var i = 0; i < levelsLength; i++) { - var level = { - width: width, - height: height, - items: [] - }; - this.levels.push(level); - width = Math.ceil(width / 2); - height = Math.ceil(height / 2); - } - } - TagTree.prototype = { - reset: function TagTree_reset(i, j) { - var currentLevel = 0, value = 0, level; - while (currentLevel < this.levels.length) { - level = this.levels[currentLevel]; - var index = i + j * level.width; - if (level.items[index] !== undefined) { - value = level.items[index]; - break; - } - level.index = index; - i >>= 1; - j >>= 1; - currentLevel++; - } - currentLevel--; - level = this.levels[currentLevel]; - level.items[level.index] = value; - this.currentLevel = currentLevel; - delete this.value; - }, - incrementValue: function TagTree_incrementValue() { - var level = this.levels[this.currentLevel]; - level.items[level.index]++; - }, - nextLevel: function TagTree_nextLevel() { - var currentLevel = this.currentLevel; - var level = this.levels[currentLevel]; - var value = level.items[level.index]; - currentLevel--; - if (currentLevel < 0) { - this.value = value; - return false; - } - - this.currentLevel = currentLevel; - level = this.levels[currentLevel]; - level.items[level.index] = value; - return true; - } - }; - return TagTree; - })(); - - var InclusionTree = (function InclusionTreeClosure() { - function InclusionTree(width, height, defaultValue) { - var levelsLength = log2(Math.max(width, height)) + 1; - this.levels = []; - for (var i = 0; i < levelsLength; i++) { - var items = new Uint8Array(width * height); - for (var j = 0, jj = items.length; j < jj; j++) { - items[j] = defaultValue; - } - - var level = { - width: width, - height: height, - items: items - }; - this.levels.push(level); - - width = Math.ceil(width / 2); - height = Math.ceil(height / 2); - } - } - InclusionTree.prototype = { - reset: function InclusionTree_reset(i, j, stopValue) { - var currentLevel = 0; - while (currentLevel < this.levels.length) { - var level = this.levels[currentLevel]; - var index = i + j * level.width; - level.index = index; - var value = level.items[index]; - - if (value === 0xFF) { - break; - } - - if (value > stopValue) { - this.currentLevel = currentLevel; - // already know about this one, propagating the value to top levels - this.propagateValues(); - return false; - } - - i >>= 1; - j >>= 1; - currentLevel++; - } - this.currentLevel = currentLevel - 1; - return true; - }, - incrementValue: function InclusionTree_incrementValue(stopValue) { - var level = this.levels[this.currentLevel]; - level.items[level.index] = stopValue + 1; - this.propagateValues(); - }, - propagateValues: function InclusionTree_propagateValues() { - var levelIndex = this.currentLevel; - var level = this.levels[levelIndex]; - var currentValue = level.items[level.index]; - while (--levelIndex >= 0) { - level = this.levels[levelIndex]; - level.items[level.index] = currentValue; - } - }, - nextLevel: function InclusionTree_nextLevel() { - var currentLevel = this.currentLevel; - var level = this.levels[currentLevel]; - var value = level.items[level.index]; - level.items[level.index] = 0xFF; - currentLevel--; - if (currentLevel < 0) { - return false; - } - - this.currentLevel = currentLevel; - level = this.levels[currentLevel]; - level.items[level.index] = value; - return true; - } - }; - return InclusionTree; - })(); - - // Section D. Coefficient bit modeling - var BitModel = (function BitModelClosure() { - var UNIFORM_CONTEXT = 17; - var RUNLENGTH_CONTEXT = 18; - // Table D-1 - // The index is binary presentation: 0dddvvhh, ddd - sum of Di (0..4), - // vv - sum of Vi (0..2), and hh - sum of Hi (0..2) - var LLAndLHContextsLabel = new Uint8Array([ - 0, 5, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 1, 6, 8, 0, 3, 7, 8, 0, 4, - 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6, - 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8 - ]); - var HLContextLabel = new Uint8Array([ - 0, 3, 4, 0, 5, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 1, 3, 4, 0, 6, 7, 7, 0, 8, - 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, - 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8 - ]); - var HHContextLabel = new Uint8Array([ - 0, 1, 2, 0, 1, 2, 2, 0, 2, 2, 2, 0, 0, 0, 0, 0, 3, 4, 5, 0, 4, 5, 5, 0, 5, - 5, 5, 0, 0, 0, 0, 0, 6, 7, 7, 0, 7, 7, 7, 0, 7, 7, 7, 0, 0, 0, 0, 0, 8, 8, - 8, 0, 8, 8, 8, 0, 8, 8, 8, 0, 0, 0, 0, 0, 8, 8, 8, 0, 8, 8, 8, 0, 8, 8, 8 - ]); - - function BitModel(width, height, subband, zeroBitPlanes, mb) { - this.width = width; - this.height = height; - - this.contextLabelTable = (subband === 'HH' ? HHContextLabel : - (subband === 'HL' ? HLContextLabel : LLAndLHContextsLabel)); - - var coefficientCount = width * height; - - // coefficients outside the encoding region treated as insignificant - // add border state cells for significanceState - this.neighborsSignificance = new Uint8Array(coefficientCount); - this.coefficentsSign = new Uint8Array(coefficientCount); - this.coefficentsMagnitude = mb > 14 ? new Uint32Array(coefficientCount) : - mb > 6 ? new Uint16Array(coefficientCount) : - new Uint8Array(coefficientCount); - this.processingFlags = new Uint8Array(coefficientCount); - - var bitsDecoded = new Uint8Array(coefficientCount); - if (zeroBitPlanes !== 0) { - for (var i = 0; i < coefficientCount; i++) { - bitsDecoded[i] = zeroBitPlanes; - } - } - this.bitsDecoded = bitsDecoded; - - this.reset(); - } - - BitModel.prototype = { - setDecoder: function BitModel_setDecoder(decoder) { - this.decoder = decoder; - }, - reset: function BitModel_reset() { - // We have 17 contexts that are accessed via context labels, - // plus the uniform and runlength context. - this.contexts = new Int8Array(19); - - // Contexts are packed into 1 byte: - // highest 7 bits carry the index, lowest bit carries mps - this.contexts[0] = (4 << 1) | 0; - this.contexts[UNIFORM_CONTEXT] = (46 << 1) | 0; - this.contexts[RUNLENGTH_CONTEXT] = (3 << 1) | 0; - }, - setNeighborsSignificance: - function BitModel_setNeighborsSignificance(row, column, index) { - var neighborsSignificance = this.neighborsSignificance; - var width = this.width, height = this.height; - var left = (column > 0); - var right = (column + 1 < width); - var i; - - if (row > 0) { - i = index - width; - if (left) { - neighborsSignificance[i - 1] += 0x10; - } - if (right) { - neighborsSignificance[i + 1] += 0x10; - } - neighborsSignificance[i] += 0x04; - } - - if (row + 1 < height) { - i = index + width; - if (left) { - neighborsSignificance[i - 1] += 0x10; - } - if (right) { - neighborsSignificance[i + 1] += 0x10; - } - neighborsSignificance[i] += 0x04; - } - - if (left) { - neighborsSignificance[index - 1] += 0x01; - } - if (right) { - neighborsSignificance[index + 1] += 0x01; - } - neighborsSignificance[index] |= 0x80; - }, - runSignificancePropagationPass: - function BitModel_runSignificancePropagationPass() { - var decoder = this.decoder; - var width = this.width, height = this.height; - var coefficentsMagnitude = this.coefficentsMagnitude; - var coefficentsSign = this.coefficentsSign; - var neighborsSignificance = this.neighborsSignificance; - var processingFlags = this.processingFlags; - var contexts = this.contexts; - var labels = this.contextLabelTable; - var bitsDecoded = this.bitsDecoded; - var processedInverseMask = ~1; - var processedMask = 1; - var firstMagnitudeBitMask = 2; - - for (var i0 = 0; i0 < height; i0 += 4) { - for (var j = 0; j < width; j++) { - var index = i0 * width + j; - for (var i1 = 0; i1 < 4; i1++, index += width) { - var i = i0 + i1; - if (i >= height) { - break; - } - // clear processed flag first - processingFlags[index] &= processedInverseMask; - - if (coefficentsMagnitude[index] || - !neighborsSignificance[index]) { - continue; - } - - var contextLabel = labels[neighborsSignificance[index]]; - var decision = decoder.readBit(contexts, contextLabel); - if (decision) { - var sign = this.decodeSignBit(i, j, index); - coefficentsSign[index] = sign; - coefficentsMagnitude[index] = 1; - this.setNeighborsSignificance(i, j, index); - processingFlags[index] |= firstMagnitudeBitMask; - } - bitsDecoded[index]++; - processingFlags[index] |= processedMask; - } - } - } - }, - decodeSignBit: function BitModel_decodeSignBit(row, column, index) { - var width = this.width, height = this.height; - var coefficentsMagnitude = this.coefficentsMagnitude; - var coefficentsSign = this.coefficentsSign; - var contribution, sign0, sign1, significance1; - var contextLabel, decoded; - - // calculate horizontal contribution - significance1 = (column > 0 && coefficentsMagnitude[index - 1] !== 0); - if (column + 1 < width && coefficentsMagnitude[index + 1] !== 0) { - sign1 = coefficentsSign[index + 1]; - if (significance1) { - sign0 = coefficentsSign[index - 1]; - contribution = 1 - sign1 - sign0; - } else { - contribution = 1 - sign1 - sign1; - } - } else if (significance1) { - sign0 = coefficentsSign[index - 1]; - contribution = 1 - sign0 - sign0; - } else { - contribution = 0; - } - var horizontalContribution = 3 * contribution; - - // calculate vertical contribution and combine with the horizontal - significance1 = (row > 0 && coefficentsMagnitude[index - width] !== 0); - if (row + 1 < height && coefficentsMagnitude[index + width] !== 0) { - sign1 = coefficentsSign[index + width]; - if (significance1) { - sign0 = coefficentsSign[index - width]; - contribution = 1 - sign1 - sign0 + horizontalContribution; - } else { - contribution = 1 - sign1 - sign1 + horizontalContribution; - } - } else if (significance1) { - sign0 = coefficentsSign[index - width]; - contribution = 1 - sign0 - sign0 + horizontalContribution; - } else { - contribution = horizontalContribution; - } - - if (contribution >= 0) { - contextLabel = 9 + contribution; - decoded = this.decoder.readBit(this.contexts, contextLabel); - } else { - contextLabel = 9 - contribution; - decoded = this.decoder.readBit(this.contexts, contextLabel) ^ 1; - } - return decoded; - }, - runMagnitudeRefinementPass: - function BitModel_runMagnitudeRefinementPass() { - var decoder = this.decoder; - var width = this.width, height = this.height; - var coefficentsMagnitude = this.coefficentsMagnitude; - var neighborsSignificance = this.neighborsSignificance; - var contexts = this.contexts; - var bitsDecoded = this.bitsDecoded; - var processingFlags = this.processingFlags; - var processedMask = 1; - var firstMagnitudeBitMask = 2; - var length = width * height; - var width4 = width * 4; - - for (var index0 = 0, indexNext; index0 < length; index0 = indexNext) { - indexNext = Math.min(length, index0 + width4); - for (var j = 0; j < width; j++) { - for (var index = index0 + j; index < indexNext; index += width) { - - // significant but not those that have just become - if (!coefficentsMagnitude[index] || - (processingFlags[index] & processedMask) !== 0) { - continue; - } - - var contextLabel = 16; - if ((processingFlags[index] & firstMagnitudeBitMask) !== 0) { - processingFlags[index] ^= firstMagnitudeBitMask; - // first refinement - var significance = neighborsSignificance[index] & 127; - contextLabel = significance === 0 ? 15 : 14; - } - - var bit = decoder.readBit(contexts, contextLabel); - coefficentsMagnitude[index] = - (coefficentsMagnitude[index] << 1) | bit; - bitsDecoded[index]++; - processingFlags[index] |= processedMask; - } - } - } - }, - runCleanupPass: function BitModel_runCleanupPass() { - var decoder = this.decoder; - var width = this.width, height = this.height; - var neighborsSignificance = this.neighborsSignificance; - var coefficentsMagnitude = this.coefficentsMagnitude; - var coefficentsSign = this.coefficentsSign; - var contexts = this.contexts; - var labels = this.contextLabelTable; - var bitsDecoded = this.bitsDecoded; - var processingFlags = this.processingFlags; - var processedMask = 1; - var firstMagnitudeBitMask = 2; - var oneRowDown = width; - var twoRowsDown = width * 2; - var threeRowsDown = width * 3; - var iNext; - for (var i0 = 0; i0 < height; i0 = iNext) { - iNext = Math.min(i0 + 4, height); - var indexBase = i0 * width; - var checkAllEmpty = i0 + 3 < height; - for (var j = 0; j < width; j++) { - var index0 = indexBase + j; - // using the property: labels[neighborsSignificance[index]] === 0 - // when neighborsSignificance[index] === 0 - var allEmpty = (checkAllEmpty && - processingFlags[index0] === 0 && - processingFlags[index0 + oneRowDown] === 0 && - processingFlags[index0 + twoRowsDown] === 0 && - processingFlags[index0 + threeRowsDown] === 0 && - neighborsSignificance[index0] === 0 && - neighborsSignificance[index0 + oneRowDown] === 0 && - neighborsSignificance[index0 + twoRowsDown] === 0 && - neighborsSignificance[index0 + threeRowsDown] === 0); - var i1 = 0, index = index0; - var i = i0, sign; - if (allEmpty) { - var hasSignificantCoefficent = - decoder.readBit(contexts, RUNLENGTH_CONTEXT); - if (!hasSignificantCoefficent) { - bitsDecoded[index0]++; - bitsDecoded[index0 + oneRowDown]++; - bitsDecoded[index0 + twoRowsDown]++; - bitsDecoded[index0 + threeRowsDown]++; - continue; // next column - } - i1 = (decoder.readBit(contexts, UNIFORM_CONTEXT) << 1) | - decoder.readBit(contexts, UNIFORM_CONTEXT); - if (i1 !== 0) { - i = i0 + i1; - index += i1 * width; - } - - sign = this.decodeSignBit(i, j, index); - coefficentsSign[index] = sign; - coefficentsMagnitude[index] = 1; - this.setNeighborsSignificance(i, j, index); - processingFlags[index] |= firstMagnitudeBitMask; - - index = index0; - for (var i2 = i0; i2 <= i; i2++, index += width) { - bitsDecoded[index]++; - } - - i1++; - } - for (i = i0 + i1; i < iNext; i++, index += width) { - if (coefficentsMagnitude[index] || - (processingFlags[index] & processedMask) !== 0) { - continue; - } - - var contextLabel = labels[neighborsSignificance[index]]; - var decision = decoder.readBit(contexts, contextLabel); - if (decision === 1) { - sign = this.decodeSignBit(i, j, index); - coefficentsSign[index] = sign; - coefficentsMagnitude[index] = 1; - this.setNeighborsSignificance(i, j, index); - processingFlags[index] |= firstMagnitudeBitMask; - } - bitsDecoded[index]++; - } - } - } - }, - checkSegmentationSymbol: function BitModel_checkSegmentationSymbol() { - var decoder = this.decoder; - var contexts = this.contexts; - var symbol = (decoder.readBit(contexts, UNIFORM_CONTEXT) << 3) | - (decoder.readBit(contexts, UNIFORM_CONTEXT) << 2) | - (decoder.readBit(contexts, UNIFORM_CONTEXT) << 1) | - decoder.readBit(contexts, UNIFORM_CONTEXT); - if (symbol !== 0xA) { - error('JPX Error: Invalid segmentation symbol'); - } - } - }; - - return BitModel; - })(); - - // Section F, Discrete wavelet transformation - var Transform = (function TransformClosure() { - function Transform() {} - - Transform.prototype.calculate = - function transformCalculate(subbands, u0, v0) { - var ll = subbands[0]; - for (var i = 1, ii = subbands.length; i < ii; i++) { - ll = this.iterate(ll, subbands[i], u0, v0); - } - return ll; - }; - Transform.prototype.extend = function extend(buffer, offset, size) { - // Section F.3.7 extending... using max extension of 4 - var i1 = offset - 1, j1 = offset + 1; - var i2 = offset + size - 2, j2 = offset + size; - buffer[i1--] = buffer[j1++]; - buffer[j2++] = buffer[i2--]; - buffer[i1--] = buffer[j1++]; - buffer[j2++] = buffer[i2--]; - buffer[i1--] = buffer[j1++]; - buffer[j2++] = buffer[i2--]; - buffer[i1] = buffer[j1]; - buffer[j2] = buffer[i2]; - }; - Transform.prototype.iterate = function Transform_iterate(ll, hl_lh_hh, - u0, v0) { - var llWidth = ll.width, llHeight = ll.height, llItems = ll.items; - var width = hl_lh_hh.width; - var height = hl_lh_hh.height; - var items = hl_lh_hh.items; - var i, j, k, l, u, v; - - // Interleave LL according to Section F.3.3 - for (k = 0, i = 0; i < llHeight; i++) { - l = i * 2 * width; - for (j = 0; j < llWidth; j++, k++, l += 2) { - items[l] = llItems[k]; - } - } - // The LL band is not needed anymore. - llItems = ll.items = null; - - var bufferPadding = 4; - var rowBuffer = new Float32Array(width + 2 * bufferPadding); - - // Section F.3.4 HOR_SR - if (width === 1) { - // if width = 1, when u0 even keep items as is, when odd divide by 2 - if ((u0 & 1) !== 0) { - for (v = 0, k = 0; v < height; v++, k += width) { - items[k] *= 0.5; - } - } - } else { - for (v = 0, k = 0; v < height; v++, k += width) { - rowBuffer.set(items.subarray(k, k + width), bufferPadding); - - this.extend(rowBuffer, bufferPadding, width); - this.filter(rowBuffer, bufferPadding, width); - - items.set( - rowBuffer.subarray(bufferPadding, bufferPadding + width), - k); - } - } - - // Accesses to the items array can take long, because it may not fit into - // CPU cache and has to be fetched from main memory. Since subsequent - // accesses to the items array are not local when reading columns, we - // have a cache miss every time. To reduce cache misses, get up to - // 'numBuffers' items at a time and store them into the individual - // buffers. The colBuffers should be small enough to fit into CPU cache. - var numBuffers = 16; - var colBuffers = []; - for (i = 0; i < numBuffers; i++) { - colBuffers.push(new Float32Array(height + 2 * bufferPadding)); - } - var b, currentBuffer = 0; - ll = bufferPadding + height; - - // Section F.3.5 VER_SR - if (height === 1) { - // if height = 1, when v0 even keep items as is, when odd divide by 2 - if ((v0 & 1) !== 0) { - for (u = 0; u < width; u++) { - items[u] *= 0.5; - } - } - } else { - for (u = 0; u < width; u++) { - // if we ran out of buffers, copy several image columns at once - if (currentBuffer === 0) { - numBuffers = Math.min(width - u, numBuffers); - for (k = u, l = bufferPadding; l < ll; k += width, l++) { - for (b = 0; b < numBuffers; b++) { - colBuffers[b][l] = items[k + b]; - } - } - currentBuffer = numBuffers; - } - - currentBuffer--; - var buffer = colBuffers[currentBuffer]; - this.extend(buffer, bufferPadding, height); - this.filter(buffer, bufferPadding, height); - - // If this is last buffer in this group of buffers, flush all buffers. - if (currentBuffer === 0) { - k = u - numBuffers + 1; - for (l = bufferPadding; l < ll; k += width, l++) { - for (b = 0; b < numBuffers; b++) { - items[k + b] = colBuffers[b][l]; - } - } - } - } - } - - return { - width: width, - height: height, - items: items - }; - }; - return Transform; - })(); - - // Section 3.8.2 Irreversible 9-7 filter - var IrreversibleTransform = (function IrreversibleTransformClosure() { - function IrreversibleTransform() { - Transform.call(this); - } - - IrreversibleTransform.prototype = Object.create(Transform.prototype); - IrreversibleTransform.prototype.filter = - function irreversibleTransformFilter(x, offset, length) { - var len = length >> 1; - offset = offset | 0; - var j, n, current, next; - - var alpha = -1.586134342059924; - var beta = -0.052980118572961; - var gamma = 0.882911075530934; - var delta = 0.443506852043971; - var K = 1.230174104914001; - var K_ = 1 / K; - - // step 1 is combined with step 3 - - // step 2 - j = offset - 3; - for (n = len + 4; n--; j += 2) { - x[j] *= K_; - } - - // step 1 & 3 - j = offset - 2; - current = delta * x[j -1]; - for (n = len + 3; n--; j += 2) { - next = delta * x[j + 1]; - x[j] = K * x[j] - current - next; - if (n--) { - j += 2; - current = delta * x[j + 1]; - x[j] = K * x[j] - current - next; - } else { - break; - } - } - - // step 4 - j = offset - 1; - current = gamma * x[j - 1]; - for (n = len + 2; n--; j += 2) { - next = gamma * x[j + 1]; - x[j] -= current + next; - if (n--) { - j += 2; - current = gamma * x[j + 1]; - x[j] -= current + next; - } else { - break; - } - } - - // step 5 - j = offset; - current = beta * x[j - 1]; - for (n = len + 1; n--; j += 2) { - next = beta * x[j + 1]; - x[j] -= current + next; - if (n--) { - j += 2; - current = beta * x[j + 1]; - x[j] -= current + next; - } else { - break; - } - } - - // step 6 - if (len !== 0) { - j = offset + 1; - current = alpha * x[j - 1]; - for (n = len; n--; j += 2) { - next = alpha * x[j + 1]; - x[j] -= current + next; - if (n--) { - j += 2; - current = alpha * x[j + 1]; - x[j] -= current + next; - } else { - break; - } - } - } - }; - - return IrreversibleTransform; - })(); - - // Section 3.8.1 Reversible 5-3 filter - var ReversibleTransform = (function ReversibleTransformClosure() { - function ReversibleTransform() { - Transform.call(this); - } - - ReversibleTransform.prototype = Object.create(Transform.prototype); - ReversibleTransform.prototype.filter = - function reversibleTransformFilter(x, offset, length) { - var len = length >> 1; - offset = offset | 0; - var j, n; - - for (j = offset, n = len + 1; n--; j += 2) { - x[j] -= (x[j - 1] + x[j + 1] + 2) >> 2; - } - - for (j = offset + 1, n = len; n--; j += 2) { - x[j] += (x[j - 1] + x[j + 1]) >> 1; - } - }; - - return ReversibleTransform; - })(); - - return JpxImage; -})(); - -exports.JpxImage = JpxImage; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreMetrics = {}), root.pdfjsSharedUtil); - } -}(this, function (exports, sharedUtil) { -var getLookupTableFactory = sharedUtil.getLookupTableFactory; - -// The Metrics object contains glyph widths (in glyph space units). -// As per PDF spec, for most fonts (Type 3 being an exception) a glyph -// space unit corresponds to 1/1000th of text space unit. -var getMetrics = getLookupTableFactory(function (t) { - t['Courier'] = 600; - t['Courier-Bold'] = 600; - t['Courier-BoldOblique'] = 600; - t['Courier-Oblique'] = 600; - t['Helvetica'] = getLookupTableFactory(function (t) { - t['space'] = 278; - t['exclam'] = 278; - t['quotedbl'] = 355; - t['numbersign'] = 556; - t['dollar'] = 556; - t['percent'] = 889; - t['ampersand'] = 667; - t['quoteright'] = 222; - t['parenleft'] = 333; - t['parenright'] = 333; - t['asterisk'] = 389; - t['plus'] = 584; - t['comma'] = 278; - t['hyphen'] = 333; - t['period'] = 278; - t['slash'] = 278; - t['zero'] = 556; - t['one'] = 556; - t['two'] = 556; - t['three'] = 556; - t['four'] = 556; - t['five'] = 556; - t['six'] = 556; - t['seven'] = 556; - t['eight'] = 556; - t['nine'] = 556; - t['colon'] = 278; - t['semicolon'] = 278; - t['less'] = 584; - t['equal'] = 584; - t['greater'] = 584; - t['question'] = 556; - t['at'] = 1015; - t['A'] = 667; - t['B'] = 667; - t['C'] = 722; - t['D'] = 722; - t['E'] = 667; - t['F'] = 611; - t['G'] = 778; - t['H'] = 722; - t['I'] = 278; - t['J'] = 500; - t['K'] = 667; - t['L'] = 556; - t['M'] = 833; - t['N'] = 722; - t['O'] = 778; - t['P'] = 667; - t['Q'] = 778; - t['R'] = 722; - t['S'] = 667; - t['T'] = 611; - t['U'] = 722; - t['V'] = 667; - t['W'] = 944; - t['X'] = 667; - t['Y'] = 667; - t['Z'] = 611; - t['bracketleft'] = 278; - t['backslash'] = 278; - t['bracketright'] = 278; - t['asciicircum'] = 469; - t['underscore'] = 556; - t['quoteleft'] = 222; - t['a'] = 556; - t['b'] = 556; - t['c'] = 500; - t['d'] = 556; - t['e'] = 556; - t['f'] = 278; - t['g'] = 556; - t['h'] = 556; - t['i'] = 222; - t['j'] = 222; - t['k'] = 500; - t['l'] = 222; - t['m'] = 833; - t['n'] = 556; - t['o'] = 556; - t['p'] = 556; - t['q'] = 556; - t['r'] = 333; - t['s'] = 500; - t['t'] = 278; - t['u'] = 556; - t['v'] = 500; - t['w'] = 722; - t['x'] = 500; - t['y'] = 500; - t['z'] = 500; - t['braceleft'] = 334; - t['bar'] = 260; - t['braceright'] = 334; - t['asciitilde'] = 584; - t['exclamdown'] = 333; - t['cent'] = 556; - t['sterling'] = 556; - t['fraction'] = 167; - t['yen'] = 556; - t['florin'] = 556; - t['section'] = 556; - t['currency'] = 556; - t['quotesingle'] = 191; - t['quotedblleft'] = 333; - t['guillemotleft'] = 556; - t['guilsinglleft'] = 333; - t['guilsinglright'] = 333; - t['fi'] = 500; - t['fl'] = 500; - t['endash'] = 556; - t['dagger'] = 556; - t['daggerdbl'] = 556; - t['periodcentered'] = 278; - t['paragraph'] = 537; - t['bullet'] = 350; - t['quotesinglbase'] = 222; - t['quotedblbase'] = 333; - t['quotedblright'] = 333; - t['guillemotright'] = 556; - t['ellipsis'] = 1000; - t['perthousand'] = 1000; - t['questiondown'] = 611; - t['grave'] = 333; - t['acute'] = 333; - t['circumflex'] = 333; - t['tilde'] = 333; - t['macron'] = 333; - t['breve'] = 333; - t['dotaccent'] = 333; - t['dieresis'] = 333; - t['ring'] = 333; - t['cedilla'] = 333; - t['hungarumlaut'] = 333; - t['ogonek'] = 333; - t['caron'] = 333; - t['emdash'] = 1000; - t['AE'] = 1000; - t['ordfeminine'] = 370; - t['Lslash'] = 556; - t['Oslash'] = 778; - t['OE'] = 1000; - t['ordmasculine'] = 365; - t['ae'] = 889; - t['dotlessi'] = 278; - t['lslash'] = 222; - t['oslash'] = 611; - t['oe'] = 944; - t['germandbls'] = 611; - t['Idieresis'] = 278; - t['eacute'] = 556; - t['abreve'] = 556; - t['uhungarumlaut'] = 556; - t['ecaron'] = 556; - t['Ydieresis'] = 667; - t['divide'] = 584; - t['Yacute'] = 667; - t['Acircumflex'] = 667; - t['aacute'] = 556; - t['Ucircumflex'] = 722; - t['yacute'] = 500; - t['scommaaccent'] = 500; - t['ecircumflex'] = 556; - t['Uring'] = 722; - t['Udieresis'] = 722; - t['aogonek'] = 556; - t['Uacute'] = 722; - t['uogonek'] = 556; - t['Edieresis'] = 667; - t['Dcroat'] = 722; - t['commaaccent'] = 250; - t['copyright'] = 737; - t['Emacron'] = 667; - t['ccaron'] = 500; - t['aring'] = 556; - t['Ncommaaccent'] = 722; - t['lacute'] = 222; - t['agrave'] = 556; - t['Tcommaaccent'] = 611; - t['Cacute'] = 722; - t['atilde'] = 556; - t['Edotaccent'] = 667; - t['scaron'] = 500; - t['scedilla'] = 500; - t['iacute'] = 278; - t['lozenge'] = 471; - t['Rcaron'] = 722; - t['Gcommaaccent'] = 778; - t['ucircumflex'] = 556; - t['acircumflex'] = 556; - t['Amacron'] = 667; - t['rcaron'] = 333; - t['ccedilla'] = 500; - t['Zdotaccent'] = 611; - t['Thorn'] = 667; - t['Omacron'] = 778; - t['Racute'] = 722; - t['Sacute'] = 667; - t['dcaron'] = 643; - t['Umacron'] = 722; - t['uring'] = 556; - t['threesuperior'] = 333; - t['Ograve'] = 778; - t['Agrave'] = 667; - t['Abreve'] = 667; - t['multiply'] = 584; - t['uacute'] = 556; - t['Tcaron'] = 611; - t['partialdiff'] = 476; - t['ydieresis'] = 500; - t['Nacute'] = 722; - t['icircumflex'] = 278; - t['Ecircumflex'] = 667; - t['adieresis'] = 556; - t['edieresis'] = 556; - t['cacute'] = 500; - t['nacute'] = 556; - t['umacron'] = 556; - t['Ncaron'] = 722; - t['Iacute'] = 278; - t['plusminus'] = 584; - t['brokenbar'] = 260; - t['registered'] = 737; - t['Gbreve'] = 778; - t['Idotaccent'] = 278; - t['summation'] = 600; - t['Egrave'] = 667; - t['racute'] = 333; - t['omacron'] = 556; - t['Zacute'] = 611; - t['Zcaron'] = 611; - t['greaterequal'] = 549; - t['Eth'] = 722; - t['Ccedilla'] = 722; - t['lcommaaccent'] = 222; - t['tcaron'] = 317; - t['eogonek'] = 556; - t['Uogonek'] = 722; - t['Aacute'] = 667; - t['Adieresis'] = 667; - t['egrave'] = 556; - t['zacute'] = 500; - t['iogonek'] = 222; - t['Oacute'] = 778; - t['oacute'] = 556; - t['amacron'] = 556; - t['sacute'] = 500; - t['idieresis'] = 278; - t['Ocircumflex'] = 778; - t['Ugrave'] = 722; - t['Delta'] = 612; - t['thorn'] = 556; - t['twosuperior'] = 333; - t['Odieresis'] = 778; - t['mu'] = 556; - t['igrave'] = 278; - t['ohungarumlaut'] = 556; - t['Eogonek'] = 667; - t['dcroat'] = 556; - t['threequarters'] = 834; - t['Scedilla'] = 667; - t['lcaron'] = 299; - t['Kcommaaccent'] = 667; - t['Lacute'] = 556; - t['trademark'] = 1000; - t['edotaccent'] = 556; - t['Igrave'] = 278; - t['Imacron'] = 278; - t['Lcaron'] = 556; - t['onehalf'] = 834; - t['lessequal'] = 549; - t['ocircumflex'] = 556; - t['ntilde'] = 556; - t['Uhungarumlaut'] = 722; - t['Eacute'] = 667; - t['emacron'] = 556; - t['gbreve'] = 556; - t['onequarter'] = 834; - t['Scaron'] = 667; - t['Scommaaccent'] = 667; - t['Ohungarumlaut'] = 778; - t['degree'] = 400; - t['ograve'] = 556; - t['Ccaron'] = 722; - t['ugrave'] = 556; - t['radical'] = 453; - t['Dcaron'] = 722; - t['rcommaaccent'] = 333; - t['Ntilde'] = 722; - t['otilde'] = 556; - t['Rcommaaccent'] = 722; - t['Lcommaaccent'] = 556; - t['Atilde'] = 667; - t['Aogonek'] = 667; - t['Aring'] = 667; - t['Otilde'] = 778; - t['zdotaccent'] = 500; - t['Ecaron'] = 667; - t['Iogonek'] = 278; - t['kcommaaccent'] = 500; - t['minus'] = 584; - t['Icircumflex'] = 278; - t['ncaron'] = 556; - t['tcommaaccent'] = 278; - t['logicalnot'] = 584; - t['odieresis'] = 556; - t['udieresis'] = 556; - t['notequal'] = 549; - t['gcommaaccent'] = 556; - t['eth'] = 556; - t['zcaron'] = 500; - t['ncommaaccent'] = 556; - t['onesuperior'] = 333; - t['imacron'] = 278; - t['Euro'] = 556; - }); - t['Helvetica-Bold'] = getLookupTableFactory(function (t) { - t['space'] = 278; - t['exclam'] = 333; - t['quotedbl'] = 474; - t['numbersign'] = 556; - t['dollar'] = 556; - t['percent'] = 889; - t['ampersand'] = 722; - t['quoteright'] = 278; - t['parenleft'] = 333; - t['parenright'] = 333; - t['asterisk'] = 389; - t['plus'] = 584; - t['comma'] = 278; - t['hyphen'] = 333; - t['period'] = 278; - t['slash'] = 278; - t['zero'] = 556; - t['one'] = 556; - t['two'] = 556; - t['three'] = 556; - t['four'] = 556; - t['five'] = 556; - t['six'] = 556; - t['seven'] = 556; - t['eight'] = 556; - t['nine'] = 556; - t['colon'] = 333; - t['semicolon'] = 333; - t['less'] = 584; - t['equal'] = 584; - t['greater'] = 584; - t['question'] = 611; - t['at'] = 975; - t['A'] = 722; - t['B'] = 722; - t['C'] = 722; - t['D'] = 722; - t['E'] = 667; - t['F'] = 611; - t['G'] = 778; - t['H'] = 722; - t['I'] = 278; - t['J'] = 556; - t['K'] = 722; - t['L'] = 611; - t['M'] = 833; - t['N'] = 722; - t['O'] = 778; - t['P'] = 667; - t['Q'] = 778; - t['R'] = 722; - t['S'] = 667; - t['T'] = 611; - t['U'] = 722; - t['V'] = 667; - t['W'] = 944; - t['X'] = 667; - t['Y'] = 667; - t['Z'] = 611; - t['bracketleft'] = 333; - t['backslash'] = 278; - t['bracketright'] = 333; - t['asciicircum'] = 584; - t['underscore'] = 556; - t['quoteleft'] = 278; - t['a'] = 556; - t['b'] = 611; - t['c'] = 556; - t['d'] = 611; - t['e'] = 556; - t['f'] = 333; - t['g'] = 611; - t['h'] = 611; - t['i'] = 278; - t['j'] = 278; - t['k'] = 556; - t['l'] = 278; - t['m'] = 889; - t['n'] = 611; - t['o'] = 611; - t['p'] = 611; - t['q'] = 611; - t['r'] = 389; - t['s'] = 556; - t['t'] = 333; - t['u'] = 611; - t['v'] = 556; - t['w'] = 778; - t['x'] = 556; - t['y'] = 556; - t['z'] = 500; - t['braceleft'] = 389; - t['bar'] = 280; - t['braceright'] = 389; - t['asciitilde'] = 584; - t['exclamdown'] = 333; - t['cent'] = 556; - t['sterling'] = 556; - t['fraction'] = 167; - t['yen'] = 556; - t['florin'] = 556; - t['section'] = 556; - t['currency'] = 556; - t['quotesingle'] = 238; - t['quotedblleft'] = 500; - t['guillemotleft'] = 556; - t['guilsinglleft'] = 333; - t['guilsinglright'] = 333; - t['fi'] = 611; - t['fl'] = 611; - t['endash'] = 556; - t['dagger'] = 556; - t['daggerdbl'] = 556; - t['periodcentered'] = 278; - t['paragraph'] = 556; - t['bullet'] = 350; - t['quotesinglbase'] = 278; - t['quotedblbase'] = 500; - t['quotedblright'] = 500; - t['guillemotright'] = 556; - t['ellipsis'] = 1000; - t['perthousand'] = 1000; - t['questiondown'] = 611; - t['grave'] = 333; - t['acute'] = 333; - t['circumflex'] = 333; - t['tilde'] = 333; - t['macron'] = 333; - t['breve'] = 333; - t['dotaccent'] = 333; - t['dieresis'] = 333; - t['ring'] = 333; - t['cedilla'] = 333; - t['hungarumlaut'] = 333; - t['ogonek'] = 333; - t['caron'] = 333; - t['emdash'] = 1000; - t['AE'] = 1000; - t['ordfeminine'] = 370; - t['Lslash'] = 611; - t['Oslash'] = 778; - t['OE'] = 1000; - t['ordmasculine'] = 365; - t['ae'] = 889; - t['dotlessi'] = 278; - t['lslash'] = 278; - t['oslash'] = 611; - t['oe'] = 944; - t['germandbls'] = 611; - t['Idieresis'] = 278; - t['eacute'] = 556; - t['abreve'] = 556; - t['uhungarumlaut'] = 611; - t['ecaron'] = 556; - t['Ydieresis'] = 667; - t['divide'] = 584; - t['Yacute'] = 667; - t['Acircumflex'] = 722; - t['aacute'] = 556; - t['Ucircumflex'] = 722; - t['yacute'] = 556; - t['scommaaccent'] = 556; - t['ecircumflex'] = 556; - t['Uring'] = 722; - t['Udieresis'] = 722; - t['aogonek'] = 556; - t['Uacute'] = 722; - t['uogonek'] = 611; - t['Edieresis'] = 667; - t['Dcroat'] = 722; - t['commaaccent'] = 250; - t['copyright'] = 737; - t['Emacron'] = 667; - t['ccaron'] = 556; - t['aring'] = 556; - t['Ncommaaccent'] = 722; - t['lacute'] = 278; - t['agrave'] = 556; - t['Tcommaaccent'] = 611; - t['Cacute'] = 722; - t['atilde'] = 556; - t['Edotaccent'] = 667; - t['scaron'] = 556; - t['scedilla'] = 556; - t['iacute'] = 278; - t['lozenge'] = 494; - t['Rcaron'] = 722; - t['Gcommaaccent'] = 778; - t['ucircumflex'] = 611; - t['acircumflex'] = 556; - t['Amacron'] = 722; - t['rcaron'] = 389; - t['ccedilla'] = 556; - t['Zdotaccent'] = 611; - t['Thorn'] = 667; - t['Omacron'] = 778; - t['Racute'] = 722; - t['Sacute'] = 667; - t['dcaron'] = 743; - t['Umacron'] = 722; - t['uring'] = 611; - t['threesuperior'] = 333; - t['Ograve'] = 778; - t['Agrave'] = 722; - t['Abreve'] = 722; - t['multiply'] = 584; - t['uacute'] = 611; - t['Tcaron'] = 611; - t['partialdiff'] = 494; - t['ydieresis'] = 556; - t['Nacute'] = 722; - t['icircumflex'] = 278; - t['Ecircumflex'] = 667; - t['adieresis'] = 556; - t['edieresis'] = 556; - t['cacute'] = 556; - t['nacute'] = 611; - t['umacron'] = 611; - t['Ncaron'] = 722; - t['Iacute'] = 278; - t['plusminus'] = 584; - t['brokenbar'] = 280; - t['registered'] = 737; - t['Gbreve'] = 778; - t['Idotaccent'] = 278; - t['summation'] = 600; - t['Egrave'] = 667; - t['racute'] = 389; - t['omacron'] = 611; - t['Zacute'] = 611; - t['Zcaron'] = 611; - t['greaterequal'] = 549; - t['Eth'] = 722; - t['Ccedilla'] = 722; - t['lcommaaccent'] = 278; - t['tcaron'] = 389; - t['eogonek'] = 556; - t['Uogonek'] = 722; - t['Aacute'] = 722; - t['Adieresis'] = 722; - t['egrave'] = 556; - t['zacute'] = 500; - t['iogonek'] = 278; - t['Oacute'] = 778; - t['oacute'] = 611; - t['amacron'] = 556; - t['sacute'] = 556; - t['idieresis'] = 278; - t['Ocircumflex'] = 778; - t['Ugrave'] = 722; - t['Delta'] = 612; - t['thorn'] = 611; - t['twosuperior'] = 333; - t['Odieresis'] = 778; - t['mu'] = 611; - t['igrave'] = 278; - t['ohungarumlaut'] = 611; - t['Eogonek'] = 667; - t['dcroat'] = 611; - t['threequarters'] = 834; - t['Scedilla'] = 667; - t['lcaron'] = 400; - t['Kcommaaccent'] = 722; - t['Lacute'] = 611; - t['trademark'] = 1000; - t['edotaccent'] = 556; - t['Igrave'] = 278; - t['Imacron'] = 278; - t['Lcaron'] = 611; - t['onehalf'] = 834; - t['lessequal'] = 549; - t['ocircumflex'] = 611; - t['ntilde'] = 611; - t['Uhungarumlaut'] = 722; - t['Eacute'] = 667; - t['emacron'] = 556; - t['gbreve'] = 611; - t['onequarter'] = 834; - t['Scaron'] = 667; - t['Scommaaccent'] = 667; - t['Ohungarumlaut'] = 778; - t['degree'] = 400; - t['ograve'] = 611; - t['Ccaron'] = 722; - t['ugrave'] = 611; - t['radical'] = 549; - t['Dcaron'] = 722; - t['rcommaaccent'] = 389; - t['Ntilde'] = 722; - t['otilde'] = 611; - t['Rcommaaccent'] = 722; - t['Lcommaaccent'] = 611; - t['Atilde'] = 722; - t['Aogonek'] = 722; - t['Aring'] = 722; - t['Otilde'] = 778; - t['zdotaccent'] = 500; - t['Ecaron'] = 667; - t['Iogonek'] = 278; - t['kcommaaccent'] = 556; - t['minus'] = 584; - t['Icircumflex'] = 278; - t['ncaron'] = 611; - t['tcommaaccent'] = 333; - t['logicalnot'] = 584; - t['odieresis'] = 611; - t['udieresis'] = 611; - t['notequal'] = 549; - t['gcommaaccent'] = 611; - t['eth'] = 611; - t['zcaron'] = 500; - t['ncommaaccent'] = 611; - t['onesuperior'] = 333; - t['imacron'] = 278; - t['Euro'] = 556; - }); - t['Helvetica-BoldOblique'] = getLookupTableFactory(function (t) { - t['space'] = 278; - t['exclam'] = 333; - t['quotedbl'] = 474; - t['numbersign'] = 556; - t['dollar'] = 556; - t['percent'] = 889; - t['ampersand'] = 722; - t['quoteright'] = 278; - t['parenleft'] = 333; - t['parenright'] = 333; - t['asterisk'] = 389; - t['plus'] = 584; - t['comma'] = 278; - t['hyphen'] = 333; - t['period'] = 278; - t['slash'] = 278; - t['zero'] = 556; - t['one'] = 556; - t['two'] = 556; - t['three'] = 556; - t['four'] = 556; - t['five'] = 556; - t['six'] = 556; - t['seven'] = 556; - t['eight'] = 556; - t['nine'] = 556; - t['colon'] = 333; - t['semicolon'] = 333; - t['less'] = 584; - t['equal'] = 584; - t['greater'] = 584; - t['question'] = 611; - t['at'] = 975; - t['A'] = 722; - t['B'] = 722; - t['C'] = 722; - t['D'] = 722; - t['E'] = 667; - t['F'] = 611; - t['G'] = 778; - t['H'] = 722; - t['I'] = 278; - t['J'] = 556; - t['K'] = 722; - t['L'] = 611; - t['M'] = 833; - t['N'] = 722; - t['O'] = 778; - t['P'] = 667; - t['Q'] = 778; - t['R'] = 722; - t['S'] = 667; - t['T'] = 611; - t['U'] = 722; - t['V'] = 667; - t['W'] = 944; - t['X'] = 667; - t['Y'] = 667; - t['Z'] = 611; - t['bracketleft'] = 333; - t['backslash'] = 278; - t['bracketright'] = 333; - t['asciicircum'] = 584; - t['underscore'] = 556; - t['quoteleft'] = 278; - t['a'] = 556; - t['b'] = 611; - t['c'] = 556; - t['d'] = 611; - t['e'] = 556; - t['f'] = 333; - t['g'] = 611; - t['h'] = 611; - t['i'] = 278; - t['j'] = 278; - t['k'] = 556; - t['l'] = 278; - t['m'] = 889; - t['n'] = 611; - t['o'] = 611; - t['p'] = 611; - t['q'] = 611; - t['r'] = 389; - t['s'] = 556; - t['t'] = 333; - t['u'] = 611; - t['v'] = 556; - t['w'] = 778; - t['x'] = 556; - t['y'] = 556; - t['z'] = 500; - t['braceleft'] = 389; - t['bar'] = 280; - t['braceright'] = 389; - t['asciitilde'] = 584; - t['exclamdown'] = 333; - t['cent'] = 556; - t['sterling'] = 556; - t['fraction'] = 167; - t['yen'] = 556; - t['florin'] = 556; - t['section'] = 556; - t['currency'] = 556; - t['quotesingle'] = 238; - t['quotedblleft'] = 500; - t['guillemotleft'] = 556; - t['guilsinglleft'] = 333; - t['guilsinglright'] = 333; - t['fi'] = 611; - t['fl'] = 611; - t['endash'] = 556; - t['dagger'] = 556; - t['daggerdbl'] = 556; - t['periodcentered'] = 278; - t['paragraph'] = 556; - t['bullet'] = 350; - t['quotesinglbase'] = 278; - t['quotedblbase'] = 500; - t['quotedblright'] = 500; - t['guillemotright'] = 556; - t['ellipsis'] = 1000; - t['perthousand'] = 1000; - t['questiondown'] = 611; - t['grave'] = 333; - t['acute'] = 333; - t['circumflex'] = 333; - t['tilde'] = 333; - t['macron'] = 333; - t['breve'] = 333; - t['dotaccent'] = 333; - t['dieresis'] = 333; - t['ring'] = 333; - t['cedilla'] = 333; - t['hungarumlaut'] = 333; - t['ogonek'] = 333; - t['caron'] = 333; - t['emdash'] = 1000; - t['AE'] = 1000; - t['ordfeminine'] = 370; - t['Lslash'] = 611; - t['Oslash'] = 778; - t['OE'] = 1000; - t['ordmasculine'] = 365; - t['ae'] = 889; - t['dotlessi'] = 278; - t['lslash'] = 278; - t['oslash'] = 611; - t['oe'] = 944; - t['germandbls'] = 611; - t['Idieresis'] = 278; - t['eacute'] = 556; - t['abreve'] = 556; - t['uhungarumlaut'] = 611; - t['ecaron'] = 556; - t['Ydieresis'] = 667; - t['divide'] = 584; - t['Yacute'] = 667; - t['Acircumflex'] = 722; - t['aacute'] = 556; - t['Ucircumflex'] = 722; - t['yacute'] = 556; - t['scommaaccent'] = 556; - t['ecircumflex'] = 556; - t['Uring'] = 722; - t['Udieresis'] = 722; - t['aogonek'] = 556; - t['Uacute'] = 722; - t['uogonek'] = 611; - t['Edieresis'] = 667; - t['Dcroat'] = 722; - t['commaaccent'] = 250; - t['copyright'] = 737; - t['Emacron'] = 667; - t['ccaron'] = 556; - t['aring'] = 556; - t['Ncommaaccent'] = 722; - t['lacute'] = 278; - t['agrave'] = 556; - t['Tcommaaccent'] = 611; - t['Cacute'] = 722; - t['atilde'] = 556; - t['Edotaccent'] = 667; - t['scaron'] = 556; - t['scedilla'] = 556; - t['iacute'] = 278; - t['lozenge'] = 494; - t['Rcaron'] = 722; - t['Gcommaaccent'] = 778; - t['ucircumflex'] = 611; - t['acircumflex'] = 556; - t['Amacron'] = 722; - t['rcaron'] = 389; - t['ccedilla'] = 556; - t['Zdotaccent'] = 611; - t['Thorn'] = 667; - t['Omacron'] = 778; - t['Racute'] = 722; - t['Sacute'] = 667; - t['dcaron'] = 743; - t['Umacron'] = 722; - t['uring'] = 611; - t['threesuperior'] = 333; - t['Ograve'] = 778; - t['Agrave'] = 722; - t['Abreve'] = 722; - t['multiply'] = 584; - t['uacute'] = 611; - t['Tcaron'] = 611; - t['partialdiff'] = 494; - t['ydieresis'] = 556; - t['Nacute'] = 722; - t['icircumflex'] = 278; - t['Ecircumflex'] = 667; - t['adieresis'] = 556; - t['edieresis'] = 556; - t['cacute'] = 556; - t['nacute'] = 611; - t['umacron'] = 611; - t['Ncaron'] = 722; - t['Iacute'] = 278; - t['plusminus'] = 584; - t['brokenbar'] = 280; - t['registered'] = 737; - t['Gbreve'] = 778; - t['Idotaccent'] = 278; - t['summation'] = 600; - t['Egrave'] = 667; - t['racute'] = 389; - t['omacron'] = 611; - t['Zacute'] = 611; - t['Zcaron'] = 611; - t['greaterequal'] = 549; - t['Eth'] = 722; - t['Ccedilla'] = 722; - t['lcommaaccent'] = 278; - t['tcaron'] = 389; - t['eogonek'] = 556; - t['Uogonek'] = 722; - t['Aacute'] = 722; - t['Adieresis'] = 722; - t['egrave'] = 556; - t['zacute'] = 500; - t['iogonek'] = 278; - t['Oacute'] = 778; - t['oacute'] = 611; - t['amacron'] = 556; - t['sacute'] = 556; - t['idieresis'] = 278; - t['Ocircumflex'] = 778; - t['Ugrave'] = 722; - t['Delta'] = 612; - t['thorn'] = 611; - t['twosuperior'] = 333; - t['Odieresis'] = 778; - t['mu'] = 611; - t['igrave'] = 278; - t['ohungarumlaut'] = 611; - t['Eogonek'] = 667; - t['dcroat'] = 611; - t['threequarters'] = 834; - t['Scedilla'] = 667; - t['lcaron'] = 400; - t['Kcommaaccent'] = 722; - t['Lacute'] = 611; - t['trademark'] = 1000; - t['edotaccent'] = 556; - t['Igrave'] = 278; - t['Imacron'] = 278; - t['Lcaron'] = 611; - t['onehalf'] = 834; - t['lessequal'] = 549; - t['ocircumflex'] = 611; - t['ntilde'] = 611; - t['Uhungarumlaut'] = 722; - t['Eacute'] = 667; - t['emacron'] = 556; - t['gbreve'] = 611; - t['onequarter'] = 834; - t['Scaron'] = 667; - t['Scommaaccent'] = 667; - t['Ohungarumlaut'] = 778; - t['degree'] = 400; - t['ograve'] = 611; - t['Ccaron'] = 722; - t['ugrave'] = 611; - t['radical'] = 549; - t['Dcaron'] = 722; - t['rcommaaccent'] = 389; - t['Ntilde'] = 722; - t['otilde'] = 611; - t['Rcommaaccent'] = 722; - t['Lcommaaccent'] = 611; - t['Atilde'] = 722; - t['Aogonek'] = 722; - t['Aring'] = 722; - t['Otilde'] = 778; - t['zdotaccent'] = 500; - t['Ecaron'] = 667; - t['Iogonek'] = 278; - t['kcommaaccent'] = 556; - t['minus'] = 584; - t['Icircumflex'] = 278; - t['ncaron'] = 611; - t['tcommaaccent'] = 333; - t['logicalnot'] = 584; - t['odieresis'] = 611; - t['udieresis'] = 611; - t['notequal'] = 549; - t['gcommaaccent'] = 611; - t['eth'] = 611; - t['zcaron'] = 500; - t['ncommaaccent'] = 611; - t['onesuperior'] = 333; - t['imacron'] = 278; - t['Euro'] = 556; - }); - t['Helvetica-Oblique'] = getLookupTableFactory(function (t) { - t['space'] = 278; - t['exclam'] = 278; - t['quotedbl'] = 355; - t['numbersign'] = 556; - t['dollar'] = 556; - t['percent'] = 889; - t['ampersand'] = 667; - t['quoteright'] = 222; - t['parenleft'] = 333; - t['parenright'] = 333; - t['asterisk'] = 389; - t['plus'] = 584; - t['comma'] = 278; - t['hyphen'] = 333; - t['period'] = 278; - t['slash'] = 278; - t['zero'] = 556; - t['one'] = 556; - t['two'] = 556; - t['three'] = 556; - t['four'] = 556; - t['five'] = 556; - t['six'] = 556; - t['seven'] = 556; - t['eight'] = 556; - t['nine'] = 556; - t['colon'] = 278; - t['semicolon'] = 278; - t['less'] = 584; - t['equal'] = 584; - t['greater'] = 584; - t['question'] = 556; - t['at'] = 1015; - t['A'] = 667; - t['B'] = 667; - t['C'] = 722; - t['D'] = 722; - t['E'] = 667; - t['F'] = 611; - t['G'] = 778; - t['H'] = 722; - t['I'] = 278; - t['J'] = 500; - t['K'] = 667; - t['L'] = 556; - t['M'] = 833; - t['N'] = 722; - t['O'] = 778; - t['P'] = 667; - t['Q'] = 778; - t['R'] = 722; - t['S'] = 667; - t['T'] = 611; - t['U'] = 722; - t['V'] = 667; - t['W'] = 944; - t['X'] = 667; - t['Y'] = 667; - t['Z'] = 611; - t['bracketleft'] = 278; - t['backslash'] = 278; - t['bracketright'] = 278; - t['asciicircum'] = 469; - t['underscore'] = 556; - t['quoteleft'] = 222; - t['a'] = 556; - t['b'] = 556; - t['c'] = 500; - t['d'] = 556; - t['e'] = 556; - t['f'] = 278; - t['g'] = 556; - t['h'] = 556; - t['i'] = 222; - t['j'] = 222; - t['k'] = 500; - t['l'] = 222; - t['m'] = 833; - t['n'] = 556; - t['o'] = 556; - t['p'] = 556; - t['q'] = 556; - t['r'] = 333; - t['s'] = 500; - t['t'] = 278; - t['u'] = 556; - t['v'] = 500; - t['w'] = 722; - t['x'] = 500; - t['y'] = 500; - t['z'] = 500; - t['braceleft'] = 334; - t['bar'] = 260; - t['braceright'] = 334; - t['asciitilde'] = 584; - t['exclamdown'] = 333; - t['cent'] = 556; - t['sterling'] = 556; - t['fraction'] = 167; - t['yen'] = 556; - t['florin'] = 556; - t['section'] = 556; - t['currency'] = 556; - t['quotesingle'] = 191; - t['quotedblleft'] = 333; - t['guillemotleft'] = 556; - t['guilsinglleft'] = 333; - t['guilsinglright'] = 333; - t['fi'] = 500; - t['fl'] = 500; - t['endash'] = 556; - t['dagger'] = 556; - t['daggerdbl'] = 556; - t['periodcentered'] = 278; - t['paragraph'] = 537; - t['bullet'] = 350; - t['quotesinglbase'] = 222; - t['quotedblbase'] = 333; - t['quotedblright'] = 333; - t['guillemotright'] = 556; - t['ellipsis'] = 1000; - t['perthousand'] = 1000; - t['questiondown'] = 611; - t['grave'] = 333; - t['acute'] = 333; - t['circumflex'] = 333; - t['tilde'] = 333; - t['macron'] = 333; - t['breve'] = 333; - t['dotaccent'] = 333; - t['dieresis'] = 333; - t['ring'] = 333; - t['cedilla'] = 333; - t['hungarumlaut'] = 333; - t['ogonek'] = 333; - t['caron'] = 333; - t['emdash'] = 1000; - t['AE'] = 1000; - t['ordfeminine'] = 370; - t['Lslash'] = 556; - t['Oslash'] = 778; - t['OE'] = 1000; - t['ordmasculine'] = 365; - t['ae'] = 889; - t['dotlessi'] = 278; - t['lslash'] = 222; - t['oslash'] = 611; - t['oe'] = 944; - t['germandbls'] = 611; - t['Idieresis'] = 278; - t['eacute'] = 556; - t['abreve'] = 556; - t['uhungarumlaut'] = 556; - t['ecaron'] = 556; - t['Ydieresis'] = 667; - t['divide'] = 584; - t['Yacute'] = 667; - t['Acircumflex'] = 667; - t['aacute'] = 556; - t['Ucircumflex'] = 722; - t['yacute'] = 500; - t['scommaaccent'] = 500; - t['ecircumflex'] = 556; - t['Uring'] = 722; - t['Udieresis'] = 722; - t['aogonek'] = 556; - t['Uacute'] = 722; - t['uogonek'] = 556; - t['Edieresis'] = 667; - t['Dcroat'] = 722; - t['commaaccent'] = 250; - t['copyright'] = 737; - t['Emacron'] = 667; - t['ccaron'] = 500; - t['aring'] = 556; - t['Ncommaaccent'] = 722; - t['lacute'] = 222; - t['agrave'] = 556; - t['Tcommaaccent'] = 611; - t['Cacute'] = 722; - t['atilde'] = 556; - t['Edotaccent'] = 667; - t['scaron'] = 500; - t['scedilla'] = 500; - t['iacute'] = 278; - t['lozenge'] = 471; - t['Rcaron'] = 722; - t['Gcommaaccent'] = 778; - t['ucircumflex'] = 556; - t['acircumflex'] = 556; - t['Amacron'] = 667; - t['rcaron'] = 333; - t['ccedilla'] = 500; - t['Zdotaccent'] = 611; - t['Thorn'] = 667; - t['Omacron'] = 778; - t['Racute'] = 722; - t['Sacute'] = 667; - t['dcaron'] = 643; - t['Umacron'] = 722; - t['uring'] = 556; - t['threesuperior'] = 333; - t['Ograve'] = 778; - t['Agrave'] = 667; - t['Abreve'] = 667; - t['multiply'] = 584; - t['uacute'] = 556; - t['Tcaron'] = 611; - t['partialdiff'] = 476; - t['ydieresis'] = 500; - t['Nacute'] = 722; - t['icircumflex'] = 278; - t['Ecircumflex'] = 667; - t['adieresis'] = 556; - t['edieresis'] = 556; - t['cacute'] = 500; - t['nacute'] = 556; - t['umacron'] = 556; - t['Ncaron'] = 722; - t['Iacute'] = 278; - t['plusminus'] = 584; - t['brokenbar'] = 260; - t['registered'] = 737; - t['Gbreve'] = 778; - t['Idotaccent'] = 278; - t['summation'] = 600; - t['Egrave'] = 667; - t['racute'] = 333; - t['omacron'] = 556; - t['Zacute'] = 611; - t['Zcaron'] = 611; - t['greaterequal'] = 549; - t['Eth'] = 722; - t['Ccedilla'] = 722; - t['lcommaaccent'] = 222; - t['tcaron'] = 317; - t['eogonek'] = 556; - t['Uogonek'] = 722; - t['Aacute'] = 667; - t['Adieresis'] = 667; - t['egrave'] = 556; - t['zacute'] = 500; - t['iogonek'] = 222; - t['Oacute'] = 778; - t['oacute'] = 556; - t['amacron'] = 556; - t['sacute'] = 500; - t['idieresis'] = 278; - t['Ocircumflex'] = 778; - t['Ugrave'] = 722; - t['Delta'] = 612; - t['thorn'] = 556; - t['twosuperior'] = 333; - t['Odieresis'] = 778; - t['mu'] = 556; - t['igrave'] = 278; - t['ohungarumlaut'] = 556; - t['Eogonek'] = 667; - t['dcroat'] = 556; - t['threequarters'] = 834; - t['Scedilla'] = 667; - t['lcaron'] = 299; - t['Kcommaaccent'] = 667; - t['Lacute'] = 556; - t['trademark'] = 1000; - t['edotaccent'] = 556; - t['Igrave'] = 278; - t['Imacron'] = 278; - t['Lcaron'] = 556; - t['onehalf'] = 834; - t['lessequal'] = 549; - t['ocircumflex'] = 556; - t['ntilde'] = 556; - t['Uhungarumlaut'] = 722; - t['Eacute'] = 667; - t['emacron'] = 556; - t['gbreve'] = 556; - t['onequarter'] = 834; - t['Scaron'] = 667; - t['Scommaaccent'] = 667; - t['Ohungarumlaut'] = 778; - t['degree'] = 400; - t['ograve'] = 556; - t['Ccaron'] = 722; - t['ugrave'] = 556; - t['radical'] = 453; - t['Dcaron'] = 722; - t['rcommaaccent'] = 333; - t['Ntilde'] = 722; - t['otilde'] = 556; - t['Rcommaaccent'] = 722; - t['Lcommaaccent'] = 556; - t['Atilde'] = 667; - t['Aogonek'] = 667; - t['Aring'] = 667; - t['Otilde'] = 778; - t['zdotaccent'] = 500; - t['Ecaron'] = 667; - t['Iogonek'] = 278; - t['kcommaaccent'] = 500; - t['minus'] = 584; - t['Icircumflex'] = 278; - t['ncaron'] = 556; - t['tcommaaccent'] = 278; - t['logicalnot'] = 584; - t['odieresis'] = 556; - t['udieresis'] = 556; - t['notequal'] = 549; - t['gcommaaccent'] = 556; - t['eth'] = 556; - t['zcaron'] = 500; - t['ncommaaccent'] = 556; - t['onesuperior'] = 333; - t['imacron'] = 278; - t['Euro'] = 556; - }); - t['Symbol'] = getLookupTableFactory(function (t) { - t['space'] = 250; - t['exclam'] = 333; - t['universal'] = 713; - t['numbersign'] = 500; - t['existential'] = 549; - t['percent'] = 833; - t['ampersand'] = 778; - t['suchthat'] = 439; - t['parenleft'] = 333; - t['parenright'] = 333; - t['asteriskmath'] = 500; - t['plus'] = 549; - t['comma'] = 250; - t['minus'] = 549; - t['period'] = 250; - t['slash'] = 278; - t['zero'] = 500; - t['one'] = 500; - t['two'] = 500; - t['three'] = 500; - t['four'] = 500; - t['five'] = 500; - t['six'] = 500; - t['seven'] = 500; - t['eight'] = 500; - t['nine'] = 500; - t['colon'] = 278; - t['semicolon'] = 278; - t['less'] = 549; - t['equal'] = 549; - t['greater'] = 549; - t['question'] = 444; - t['congruent'] = 549; - t['Alpha'] = 722; - t['Beta'] = 667; - t['Chi'] = 722; - t['Delta'] = 612; - t['Epsilon'] = 611; - t['Phi'] = 763; - t['Gamma'] = 603; - t['Eta'] = 722; - t['Iota'] = 333; - t['theta1'] = 631; - t['Kappa'] = 722; - t['Lambda'] = 686; - t['Mu'] = 889; - t['Nu'] = 722; - t['Omicron'] = 722; - t['Pi'] = 768; - t['Theta'] = 741; - t['Rho'] = 556; - t['Sigma'] = 592; - t['Tau'] = 611; - t['Upsilon'] = 690; - t['sigma1'] = 439; - t['Omega'] = 768; - t['Xi'] = 645; - t['Psi'] = 795; - t['Zeta'] = 611; - t['bracketleft'] = 333; - t['therefore'] = 863; - t['bracketright'] = 333; - t['perpendicular'] = 658; - t['underscore'] = 500; - t['radicalex'] = 500; - t['alpha'] = 631; - t['beta'] = 549; - t['chi'] = 549; - t['delta'] = 494; - t['epsilon'] = 439; - t['phi'] = 521; - t['gamma'] = 411; - t['eta'] = 603; - t['iota'] = 329; - t['phi1'] = 603; - t['kappa'] = 549; - t['lambda'] = 549; - t['mu'] = 576; - t['nu'] = 521; - t['omicron'] = 549; - t['pi'] = 549; - t['theta'] = 521; - t['rho'] = 549; - t['sigma'] = 603; - t['tau'] = 439; - t['upsilon'] = 576; - t['omega1'] = 713; - t['omega'] = 686; - t['xi'] = 493; - t['psi'] = 686; - t['zeta'] = 494; - t['braceleft'] = 480; - t['bar'] = 200; - t['braceright'] = 480; - t['similar'] = 549; - t['Euro'] = 750; - t['Upsilon1'] = 620; - t['minute'] = 247; - t['lessequal'] = 549; - t['fraction'] = 167; - t['infinity'] = 713; - t['florin'] = 500; - t['club'] = 753; - t['diamond'] = 753; - t['heart'] = 753; - t['spade'] = 753; - t['arrowboth'] = 1042; - t['arrowleft'] = 987; - t['arrowup'] = 603; - t['arrowright'] = 987; - t['arrowdown'] = 603; - t['degree'] = 400; - t['plusminus'] = 549; - t['second'] = 411; - t['greaterequal'] = 549; - t['multiply'] = 549; - t['proportional'] = 713; - t['partialdiff'] = 494; - t['bullet'] = 460; - t['divide'] = 549; - t['notequal'] = 549; - t['equivalence'] = 549; - t['approxequal'] = 549; - t['ellipsis'] = 1000; - t['arrowvertex'] = 603; - t['arrowhorizex'] = 1000; - t['carriagereturn'] = 658; - t['aleph'] = 823; - t['Ifraktur'] = 686; - t['Rfraktur'] = 795; - t['weierstrass'] = 987; - t['circlemultiply'] = 768; - t['circleplus'] = 768; - t['emptyset'] = 823; - t['intersection'] = 768; - t['union'] = 768; - t['propersuperset'] = 713; - t['reflexsuperset'] = 713; - t['notsubset'] = 713; - t['propersubset'] = 713; - t['reflexsubset'] = 713; - t['element'] = 713; - t['notelement'] = 713; - t['angle'] = 768; - t['gradient'] = 713; - t['registerserif'] = 790; - t['copyrightserif'] = 790; - t['trademarkserif'] = 890; - t['product'] = 823; - t['radical'] = 549; - t['dotmath'] = 250; - t['logicalnot'] = 713; - t['logicaland'] = 603; - t['logicalor'] = 603; - t['arrowdblboth'] = 1042; - t['arrowdblleft'] = 987; - t['arrowdblup'] = 603; - t['arrowdblright'] = 987; - t['arrowdbldown'] = 603; - t['lozenge'] = 494; - t['angleleft'] = 329; - t['registersans'] = 790; - t['copyrightsans'] = 790; - t['trademarksans'] = 786; - t['summation'] = 713; - t['parenlefttp'] = 384; - t['parenleftex'] = 384; - t['parenleftbt'] = 384; - t['bracketlefttp'] = 384; - t['bracketleftex'] = 384; - t['bracketleftbt'] = 384; - t['bracelefttp'] = 494; - t['braceleftmid'] = 494; - t['braceleftbt'] = 494; - t['braceex'] = 494; - t['angleright'] = 329; - t['integral'] = 274; - t['integraltp'] = 686; - t['integralex'] = 686; - t['integralbt'] = 686; - t['parenrighttp'] = 384; - t['parenrightex'] = 384; - t['parenrightbt'] = 384; - t['bracketrighttp'] = 384; - t['bracketrightex'] = 384; - t['bracketrightbt'] = 384; - t['bracerighttp'] = 494; - t['bracerightmid'] = 494; - t['bracerightbt'] = 494; - t['apple'] = 790; - }); - t['Times-Roman'] = getLookupTableFactory(function (t) { - t['space'] = 250; - t['exclam'] = 333; - t['quotedbl'] = 408; - t['numbersign'] = 500; - t['dollar'] = 500; - t['percent'] = 833; - t['ampersand'] = 778; - t['quoteright'] = 333; - t['parenleft'] = 333; - t['parenright'] = 333; - t['asterisk'] = 500; - t['plus'] = 564; - t['comma'] = 250; - t['hyphen'] = 333; - t['period'] = 250; - t['slash'] = 278; - t['zero'] = 500; - t['one'] = 500; - t['two'] = 500; - t['three'] = 500; - t['four'] = 500; - t['five'] = 500; - t['six'] = 500; - t['seven'] = 500; - t['eight'] = 500; - t['nine'] = 500; - t['colon'] = 278; - t['semicolon'] = 278; - t['less'] = 564; - t['equal'] = 564; - t['greater'] = 564; - t['question'] = 444; - t['at'] = 921; - t['A'] = 722; - t['B'] = 667; - t['C'] = 667; - t['D'] = 722; - t['E'] = 611; - t['F'] = 556; - t['G'] = 722; - t['H'] = 722; - t['I'] = 333; - t['J'] = 389; - t['K'] = 722; - t['L'] = 611; - t['M'] = 889; - t['N'] = 722; - t['O'] = 722; - t['P'] = 556; - t['Q'] = 722; - t['R'] = 667; - t['S'] = 556; - t['T'] = 611; - t['U'] = 722; - t['V'] = 722; - t['W'] = 944; - t['X'] = 722; - t['Y'] = 722; - t['Z'] = 611; - t['bracketleft'] = 333; - t['backslash'] = 278; - t['bracketright'] = 333; - t['asciicircum'] = 469; - t['underscore'] = 500; - t['quoteleft'] = 333; - t['a'] = 444; - t['b'] = 500; - t['c'] = 444; - t['d'] = 500; - t['e'] = 444; - t['f'] = 333; - t['g'] = 500; - t['h'] = 500; - t['i'] = 278; - t['j'] = 278; - t['k'] = 500; - t['l'] = 278; - t['m'] = 778; - t['n'] = 500; - t['o'] = 500; - t['p'] = 500; - t['q'] = 500; - t['r'] = 333; - t['s'] = 389; - t['t'] = 278; - t['u'] = 500; - t['v'] = 500; - t['w'] = 722; - t['x'] = 500; - t['y'] = 500; - t['z'] = 444; - t['braceleft'] = 480; - t['bar'] = 200; - t['braceright'] = 480; - t['asciitilde'] = 541; - t['exclamdown'] = 333; - t['cent'] = 500; - t['sterling'] = 500; - t['fraction'] = 167; - t['yen'] = 500; - t['florin'] = 500; - t['section'] = 500; - t['currency'] = 500; - t['quotesingle'] = 180; - t['quotedblleft'] = 444; - t['guillemotleft'] = 500; - t['guilsinglleft'] = 333; - t['guilsinglright'] = 333; - t['fi'] = 556; - t['fl'] = 556; - t['endash'] = 500; - t['dagger'] = 500; - t['daggerdbl'] = 500; - t['periodcentered'] = 250; - t['paragraph'] = 453; - t['bullet'] = 350; - t['quotesinglbase'] = 333; - t['quotedblbase'] = 444; - t['quotedblright'] = 444; - t['guillemotright'] = 500; - t['ellipsis'] = 1000; - t['perthousand'] = 1000; - t['questiondown'] = 444; - t['grave'] = 333; - t['acute'] = 333; - t['circumflex'] = 333; - t['tilde'] = 333; - t['macron'] = 333; - t['breve'] = 333; - t['dotaccent'] = 333; - t['dieresis'] = 333; - t['ring'] = 333; - t['cedilla'] = 333; - t['hungarumlaut'] = 333; - t['ogonek'] = 333; - t['caron'] = 333; - t['emdash'] = 1000; - t['AE'] = 889; - t['ordfeminine'] = 276; - t['Lslash'] = 611; - t['Oslash'] = 722; - t['OE'] = 889; - t['ordmasculine'] = 310; - t['ae'] = 667; - t['dotlessi'] = 278; - t['lslash'] = 278; - t['oslash'] = 500; - t['oe'] = 722; - t['germandbls'] = 500; - t['Idieresis'] = 333; - t['eacute'] = 444; - t['abreve'] = 444; - t['uhungarumlaut'] = 500; - t['ecaron'] = 444; - t['Ydieresis'] = 722; - t['divide'] = 564; - t['Yacute'] = 722; - t['Acircumflex'] = 722; - t['aacute'] = 444; - t['Ucircumflex'] = 722; - t['yacute'] = 500; - t['scommaaccent'] = 389; - t['ecircumflex'] = 444; - t['Uring'] = 722; - t['Udieresis'] = 722; - t['aogonek'] = 444; - t['Uacute'] = 722; - t['uogonek'] = 500; - t['Edieresis'] = 611; - t['Dcroat'] = 722; - t['commaaccent'] = 250; - t['copyright'] = 760; - t['Emacron'] = 611; - t['ccaron'] = 444; - t['aring'] = 444; - t['Ncommaaccent'] = 722; - t['lacute'] = 278; - t['agrave'] = 444; - t['Tcommaaccent'] = 611; - t['Cacute'] = 667; - t['atilde'] = 444; - t['Edotaccent'] = 611; - t['scaron'] = 389; - t['scedilla'] = 389; - t['iacute'] = 278; - t['lozenge'] = 471; - t['Rcaron'] = 667; - t['Gcommaaccent'] = 722; - t['ucircumflex'] = 500; - t['acircumflex'] = 444; - t['Amacron'] = 722; - t['rcaron'] = 333; - t['ccedilla'] = 444; - t['Zdotaccent'] = 611; - t['Thorn'] = 556; - t['Omacron'] = 722; - t['Racute'] = 667; - t['Sacute'] = 556; - t['dcaron'] = 588; - t['Umacron'] = 722; - t['uring'] = 500; - t['threesuperior'] = 300; - t['Ograve'] = 722; - t['Agrave'] = 722; - t['Abreve'] = 722; - t['multiply'] = 564; - t['uacute'] = 500; - t['Tcaron'] = 611; - t['partialdiff'] = 476; - t['ydieresis'] = 500; - t['Nacute'] = 722; - t['icircumflex'] = 278; - t['Ecircumflex'] = 611; - t['adieresis'] = 444; - t['edieresis'] = 444; - t['cacute'] = 444; - t['nacute'] = 500; - t['umacron'] = 500; - t['Ncaron'] = 722; - t['Iacute'] = 333; - t['plusminus'] = 564; - t['brokenbar'] = 200; - t['registered'] = 760; - t['Gbreve'] = 722; - t['Idotaccent'] = 333; - t['summation'] = 600; - t['Egrave'] = 611; - t['racute'] = 333; - t['omacron'] = 500; - t['Zacute'] = 611; - t['Zcaron'] = 611; - t['greaterequal'] = 549; - t['Eth'] = 722; - t['Ccedilla'] = 667; - t['lcommaaccent'] = 278; - t['tcaron'] = 326; - t['eogonek'] = 444; - t['Uogonek'] = 722; - t['Aacute'] = 722; - t['Adieresis'] = 722; - t['egrave'] = 444; - t['zacute'] = 444; - t['iogonek'] = 278; - t['Oacute'] = 722; - t['oacute'] = 500; - t['amacron'] = 444; - t['sacute'] = 389; - t['idieresis'] = 278; - t['Ocircumflex'] = 722; - t['Ugrave'] = 722; - t['Delta'] = 612; - t['thorn'] = 500; - t['twosuperior'] = 300; - t['Odieresis'] = 722; - t['mu'] = 500; - t['igrave'] = 278; - t['ohungarumlaut'] = 500; - t['Eogonek'] = 611; - t['dcroat'] = 500; - t['threequarters'] = 750; - t['Scedilla'] = 556; - t['lcaron'] = 344; - t['Kcommaaccent'] = 722; - t['Lacute'] = 611; - t['trademark'] = 980; - t['edotaccent'] = 444; - t['Igrave'] = 333; - t['Imacron'] = 333; - t['Lcaron'] = 611; - t['onehalf'] = 750; - t['lessequal'] = 549; - t['ocircumflex'] = 500; - t['ntilde'] = 500; - t['Uhungarumlaut'] = 722; - t['Eacute'] = 611; - t['emacron'] = 444; - t['gbreve'] = 500; - t['onequarter'] = 750; - t['Scaron'] = 556; - t['Scommaaccent'] = 556; - t['Ohungarumlaut'] = 722; - t['degree'] = 400; - t['ograve'] = 500; - t['Ccaron'] = 667; - t['ugrave'] = 500; - t['radical'] = 453; - t['Dcaron'] = 722; - t['rcommaaccent'] = 333; - t['Ntilde'] = 722; - t['otilde'] = 500; - t['Rcommaaccent'] = 667; - t['Lcommaaccent'] = 611; - t['Atilde'] = 722; - t['Aogonek'] = 722; - t['Aring'] = 722; - t['Otilde'] = 722; - t['zdotaccent'] = 444; - t['Ecaron'] = 611; - t['Iogonek'] = 333; - t['kcommaaccent'] = 500; - t['minus'] = 564; - t['Icircumflex'] = 333; - t['ncaron'] = 500; - t['tcommaaccent'] = 278; - t['logicalnot'] = 564; - t['odieresis'] = 500; - t['udieresis'] = 500; - t['notequal'] = 549; - t['gcommaaccent'] = 500; - t['eth'] = 500; - t['zcaron'] = 444; - t['ncommaaccent'] = 500; - t['onesuperior'] = 300; - t['imacron'] = 278; - t['Euro'] = 500; - }); - t['Times-Bold'] = getLookupTableFactory(function (t) { - t['space'] = 250; - t['exclam'] = 333; - t['quotedbl'] = 555; - t['numbersign'] = 500; - t['dollar'] = 500; - t['percent'] = 1000; - t['ampersand'] = 833; - t['quoteright'] = 333; - t['parenleft'] = 333; - t['parenright'] = 333; - t['asterisk'] = 500; - t['plus'] = 570; - t['comma'] = 250; - t['hyphen'] = 333; - t['period'] = 250; - t['slash'] = 278; - t['zero'] = 500; - t['one'] = 500; - t['two'] = 500; - t['three'] = 500; - t['four'] = 500; - t['five'] = 500; - t['six'] = 500; - t['seven'] = 500; - t['eight'] = 500; - t['nine'] = 500; - t['colon'] = 333; - t['semicolon'] = 333; - t['less'] = 570; - t['equal'] = 570; - t['greater'] = 570; - t['question'] = 500; - t['at'] = 930; - t['A'] = 722; - t['B'] = 667; - t['C'] = 722; - t['D'] = 722; - t['E'] = 667; - t['F'] = 611; - t['G'] = 778; - t['H'] = 778; - t['I'] = 389; - t['J'] = 500; - t['K'] = 778; - t['L'] = 667; - t['M'] = 944; - t['N'] = 722; - t['O'] = 778; - t['P'] = 611; - t['Q'] = 778; - t['R'] = 722; - t['S'] = 556; - t['T'] = 667; - t['U'] = 722; - t['V'] = 722; - t['W'] = 1000; - t['X'] = 722; - t['Y'] = 722; - t['Z'] = 667; - t['bracketleft'] = 333; - t['backslash'] = 278; - t['bracketright'] = 333; - t['asciicircum'] = 581; - t['underscore'] = 500; - t['quoteleft'] = 333; - t['a'] = 500; - t['b'] = 556; - t['c'] = 444; - t['d'] = 556; - t['e'] = 444; - t['f'] = 333; - t['g'] = 500; - t['h'] = 556; - t['i'] = 278; - t['j'] = 333; - t['k'] = 556; - t['l'] = 278; - t['m'] = 833; - t['n'] = 556; - t['o'] = 500; - t['p'] = 556; - t['q'] = 556; - t['r'] = 444; - t['s'] = 389; - t['t'] = 333; - t['u'] = 556; - t['v'] = 500; - t['w'] = 722; - t['x'] = 500; - t['y'] = 500; - t['z'] = 444; - t['braceleft'] = 394; - t['bar'] = 220; - t['braceright'] = 394; - t['asciitilde'] = 520; - t['exclamdown'] = 333; - t['cent'] = 500; - t['sterling'] = 500; - t['fraction'] = 167; - t['yen'] = 500; - t['florin'] = 500; - t['section'] = 500; - t['currency'] = 500; - t['quotesingle'] = 278; - t['quotedblleft'] = 500; - t['guillemotleft'] = 500; - t['guilsinglleft'] = 333; - t['guilsinglright'] = 333; - t['fi'] = 556; - t['fl'] = 556; - t['endash'] = 500; - t['dagger'] = 500; - t['daggerdbl'] = 500; - t['periodcentered'] = 250; - t['paragraph'] = 540; - t['bullet'] = 350; - t['quotesinglbase'] = 333; - t['quotedblbase'] = 500; - t['quotedblright'] = 500; - t['guillemotright'] = 500; - t['ellipsis'] = 1000; - t['perthousand'] = 1000; - t['questiondown'] = 500; - t['grave'] = 333; - t['acute'] = 333; - t['circumflex'] = 333; - t['tilde'] = 333; - t['macron'] = 333; - t['breve'] = 333; - t['dotaccent'] = 333; - t['dieresis'] = 333; - t['ring'] = 333; - t['cedilla'] = 333; - t['hungarumlaut'] = 333; - t['ogonek'] = 333; - t['caron'] = 333; - t['emdash'] = 1000; - t['AE'] = 1000; - t['ordfeminine'] = 300; - t['Lslash'] = 667; - t['Oslash'] = 778; - t['OE'] = 1000; - t['ordmasculine'] = 330; - t['ae'] = 722; - t['dotlessi'] = 278; - t['lslash'] = 278; - t['oslash'] = 500; - t['oe'] = 722; - t['germandbls'] = 556; - t['Idieresis'] = 389; - t['eacute'] = 444; - t['abreve'] = 500; - t['uhungarumlaut'] = 556; - t['ecaron'] = 444; - t['Ydieresis'] = 722; - t['divide'] = 570; - t['Yacute'] = 722; - t['Acircumflex'] = 722; - t['aacute'] = 500; - t['Ucircumflex'] = 722; - t['yacute'] = 500; - t['scommaaccent'] = 389; - t['ecircumflex'] = 444; - t['Uring'] = 722; - t['Udieresis'] = 722; - t['aogonek'] = 500; - t['Uacute'] = 722; - t['uogonek'] = 556; - t['Edieresis'] = 667; - t['Dcroat'] = 722; - t['commaaccent'] = 250; - t['copyright'] = 747; - t['Emacron'] = 667; - t['ccaron'] = 444; - t['aring'] = 500; - t['Ncommaaccent'] = 722; - t['lacute'] = 278; - t['agrave'] = 500; - t['Tcommaaccent'] = 667; - t['Cacute'] = 722; - t['atilde'] = 500; - t['Edotaccent'] = 667; - t['scaron'] = 389; - t['scedilla'] = 389; - t['iacute'] = 278; - t['lozenge'] = 494; - t['Rcaron'] = 722; - t['Gcommaaccent'] = 778; - t['ucircumflex'] = 556; - t['acircumflex'] = 500; - t['Amacron'] = 722; - t['rcaron'] = 444; - t['ccedilla'] = 444; - t['Zdotaccent'] = 667; - t['Thorn'] = 611; - t['Omacron'] = 778; - t['Racute'] = 722; - t['Sacute'] = 556; - t['dcaron'] = 672; - t['Umacron'] = 722; - t['uring'] = 556; - t['threesuperior'] = 300; - t['Ograve'] = 778; - t['Agrave'] = 722; - t['Abreve'] = 722; - t['multiply'] = 570; - t['uacute'] = 556; - t['Tcaron'] = 667; - t['partialdiff'] = 494; - t['ydieresis'] = 500; - t['Nacute'] = 722; - t['icircumflex'] = 278; - t['Ecircumflex'] = 667; - t['adieresis'] = 500; - t['edieresis'] = 444; - t['cacute'] = 444; - t['nacute'] = 556; - t['umacron'] = 556; - t['Ncaron'] = 722; - t['Iacute'] = 389; - t['plusminus'] = 570; - t['brokenbar'] = 220; - t['registered'] = 747; - t['Gbreve'] = 778; - t['Idotaccent'] = 389; - t['summation'] = 600; - t['Egrave'] = 667; - t['racute'] = 444; - t['omacron'] = 500; - t['Zacute'] = 667; - t['Zcaron'] = 667; - t['greaterequal'] = 549; - t['Eth'] = 722; - t['Ccedilla'] = 722; - t['lcommaaccent'] = 278; - t['tcaron'] = 416; - t['eogonek'] = 444; - t['Uogonek'] = 722; - t['Aacute'] = 722; - t['Adieresis'] = 722; - t['egrave'] = 444; - t['zacute'] = 444; - t['iogonek'] = 278; - t['Oacute'] = 778; - t['oacute'] = 500; - t['amacron'] = 500; - t['sacute'] = 389; - t['idieresis'] = 278; - t['Ocircumflex'] = 778; - t['Ugrave'] = 722; - t['Delta'] = 612; - t['thorn'] = 556; - t['twosuperior'] = 300; - t['Odieresis'] = 778; - t['mu'] = 556; - t['igrave'] = 278; - t['ohungarumlaut'] = 500; - t['Eogonek'] = 667; - t['dcroat'] = 556; - t['threequarters'] = 750; - t['Scedilla'] = 556; - t['lcaron'] = 394; - t['Kcommaaccent'] = 778; - t['Lacute'] = 667; - t['trademark'] = 1000; - t['edotaccent'] = 444; - t['Igrave'] = 389; - t['Imacron'] = 389; - t['Lcaron'] = 667; - t['onehalf'] = 750; - t['lessequal'] = 549; - t['ocircumflex'] = 500; - t['ntilde'] = 556; - t['Uhungarumlaut'] = 722; - t['Eacute'] = 667; - t['emacron'] = 444; - t['gbreve'] = 500; - t['onequarter'] = 750; - t['Scaron'] = 556; - t['Scommaaccent'] = 556; - t['Ohungarumlaut'] = 778; - t['degree'] = 400; - t['ograve'] = 500; - t['Ccaron'] = 722; - t['ugrave'] = 556; - t['radical'] = 549; - t['Dcaron'] = 722; - t['rcommaaccent'] = 444; - t['Ntilde'] = 722; - t['otilde'] = 500; - t['Rcommaaccent'] = 722; - t['Lcommaaccent'] = 667; - t['Atilde'] = 722; - t['Aogonek'] = 722; - t['Aring'] = 722; - t['Otilde'] = 778; - t['zdotaccent'] = 444; - t['Ecaron'] = 667; - t['Iogonek'] = 389; - t['kcommaaccent'] = 556; - t['minus'] = 570; - t['Icircumflex'] = 389; - t['ncaron'] = 556; - t['tcommaaccent'] = 333; - t['logicalnot'] = 570; - t['odieresis'] = 500; - t['udieresis'] = 556; - t['notequal'] = 549; - t['gcommaaccent'] = 500; - t['eth'] = 500; - t['zcaron'] = 444; - t['ncommaaccent'] = 556; - t['onesuperior'] = 300; - t['imacron'] = 278; - t['Euro'] = 500; - }); - t['Times-BoldItalic'] = getLookupTableFactory(function (t) { - t['space'] = 250; - t['exclam'] = 389; - t['quotedbl'] = 555; - t['numbersign'] = 500; - t['dollar'] = 500; - t['percent'] = 833; - t['ampersand'] = 778; - t['quoteright'] = 333; - t['parenleft'] = 333; - t['parenright'] = 333; - t['asterisk'] = 500; - t['plus'] = 570; - t['comma'] = 250; - t['hyphen'] = 333; - t['period'] = 250; - t['slash'] = 278; - t['zero'] = 500; - t['one'] = 500; - t['two'] = 500; - t['three'] = 500; - t['four'] = 500; - t['five'] = 500; - t['six'] = 500; - t['seven'] = 500; - t['eight'] = 500; - t['nine'] = 500; - t['colon'] = 333; - t['semicolon'] = 333; - t['less'] = 570; - t['equal'] = 570; - t['greater'] = 570; - t['question'] = 500; - t['at'] = 832; - t['A'] = 667; - t['B'] = 667; - t['C'] = 667; - t['D'] = 722; - t['E'] = 667; - t['F'] = 667; - t['G'] = 722; - t['H'] = 778; - t['I'] = 389; - t['J'] = 500; - t['K'] = 667; - t['L'] = 611; - t['M'] = 889; - t['N'] = 722; - t['O'] = 722; - t['P'] = 611; - t['Q'] = 722; - t['R'] = 667; - t['S'] = 556; - t['T'] = 611; - t['U'] = 722; - t['V'] = 667; - t['W'] = 889; - t['X'] = 667; - t['Y'] = 611; - t['Z'] = 611; - t['bracketleft'] = 333; - t['backslash'] = 278; - t['bracketright'] = 333; - t['asciicircum'] = 570; - t['underscore'] = 500; - t['quoteleft'] = 333; - t['a'] = 500; - t['b'] = 500; - t['c'] = 444; - t['d'] = 500; - t['e'] = 444; - t['f'] = 333; - t['g'] = 500; - t['h'] = 556; - t['i'] = 278; - t['j'] = 278; - t['k'] = 500; - t['l'] = 278; - t['m'] = 778; - t['n'] = 556; - t['o'] = 500; - t['p'] = 500; - t['q'] = 500; - t['r'] = 389; - t['s'] = 389; - t['t'] = 278; - t['u'] = 556; - t['v'] = 444; - t['w'] = 667; - t['x'] = 500; - t['y'] = 444; - t['z'] = 389; - t['braceleft'] = 348; - t['bar'] = 220; - t['braceright'] = 348; - t['asciitilde'] = 570; - t['exclamdown'] = 389; - t['cent'] = 500; - t['sterling'] = 500; - t['fraction'] = 167; - t['yen'] = 500; - t['florin'] = 500; - t['section'] = 500; - t['currency'] = 500; - t['quotesingle'] = 278; - t['quotedblleft'] = 500; - t['guillemotleft'] = 500; - t['guilsinglleft'] = 333; - t['guilsinglright'] = 333; - t['fi'] = 556; - t['fl'] = 556; - t['endash'] = 500; - t['dagger'] = 500; - t['daggerdbl'] = 500; - t['periodcentered'] = 250; - t['paragraph'] = 500; - t['bullet'] = 350; - t['quotesinglbase'] = 333; - t['quotedblbase'] = 500; - t['quotedblright'] = 500; - t['guillemotright'] = 500; - t['ellipsis'] = 1000; - t['perthousand'] = 1000; - t['questiondown'] = 500; - t['grave'] = 333; - t['acute'] = 333; - t['circumflex'] = 333; - t['tilde'] = 333; - t['macron'] = 333; - t['breve'] = 333; - t['dotaccent'] = 333; - t['dieresis'] = 333; - t['ring'] = 333; - t['cedilla'] = 333; - t['hungarumlaut'] = 333; - t['ogonek'] = 333; - t['caron'] = 333; - t['emdash'] = 1000; - t['AE'] = 944; - t['ordfeminine'] = 266; - t['Lslash'] = 611; - t['Oslash'] = 722; - t['OE'] = 944; - t['ordmasculine'] = 300; - t['ae'] = 722; - t['dotlessi'] = 278; - t['lslash'] = 278; - t['oslash'] = 500; - t['oe'] = 722; - t['germandbls'] = 500; - t['Idieresis'] = 389; - t['eacute'] = 444; - t['abreve'] = 500; - t['uhungarumlaut'] = 556; - t['ecaron'] = 444; - t['Ydieresis'] = 611; - t['divide'] = 570; - t['Yacute'] = 611; - t['Acircumflex'] = 667; - t['aacute'] = 500; - t['Ucircumflex'] = 722; - t['yacute'] = 444; - t['scommaaccent'] = 389; - t['ecircumflex'] = 444; - t['Uring'] = 722; - t['Udieresis'] = 722; - t['aogonek'] = 500; - t['Uacute'] = 722; - t['uogonek'] = 556; - t['Edieresis'] = 667; - t['Dcroat'] = 722; - t['commaaccent'] = 250; - t['copyright'] = 747; - t['Emacron'] = 667; - t['ccaron'] = 444; - t['aring'] = 500; - t['Ncommaaccent'] = 722; - t['lacute'] = 278; - t['agrave'] = 500; - t['Tcommaaccent'] = 611; - t['Cacute'] = 667; - t['atilde'] = 500; - t['Edotaccent'] = 667; - t['scaron'] = 389; - t['scedilla'] = 389; - t['iacute'] = 278; - t['lozenge'] = 494; - t['Rcaron'] = 667; - t['Gcommaaccent'] = 722; - t['ucircumflex'] = 556; - t['acircumflex'] = 500; - t['Amacron'] = 667; - t['rcaron'] = 389; - t['ccedilla'] = 444; - t['Zdotaccent'] = 611; - t['Thorn'] = 611; - t['Omacron'] = 722; - t['Racute'] = 667; - t['Sacute'] = 556; - t['dcaron'] = 608; - t['Umacron'] = 722; - t['uring'] = 556; - t['threesuperior'] = 300; - t['Ograve'] = 722; - t['Agrave'] = 667; - t['Abreve'] = 667; - t['multiply'] = 570; - t['uacute'] = 556; - t['Tcaron'] = 611; - t['partialdiff'] = 494; - t['ydieresis'] = 444; - t['Nacute'] = 722; - t['icircumflex'] = 278; - t['Ecircumflex'] = 667; - t['adieresis'] = 500; - t['edieresis'] = 444; - t['cacute'] = 444; - t['nacute'] = 556; - t['umacron'] = 556; - t['Ncaron'] = 722; - t['Iacute'] = 389; - t['plusminus'] = 570; - t['brokenbar'] = 220; - t['registered'] = 747; - t['Gbreve'] = 722; - t['Idotaccent'] = 389; - t['summation'] = 600; - t['Egrave'] = 667; - t['racute'] = 389; - t['omacron'] = 500; - t['Zacute'] = 611; - t['Zcaron'] = 611; - t['greaterequal'] = 549; - t['Eth'] = 722; - t['Ccedilla'] = 667; - t['lcommaaccent'] = 278; - t['tcaron'] = 366; - t['eogonek'] = 444; - t['Uogonek'] = 722; - t['Aacute'] = 667; - t['Adieresis'] = 667; - t['egrave'] = 444; - t['zacute'] = 389; - t['iogonek'] = 278; - t['Oacute'] = 722; - t['oacute'] = 500; - t['amacron'] = 500; - t['sacute'] = 389; - t['idieresis'] = 278; - t['Ocircumflex'] = 722; - t['Ugrave'] = 722; - t['Delta'] = 612; - t['thorn'] = 500; - t['twosuperior'] = 300; - t['Odieresis'] = 722; - t['mu'] = 576; - t['igrave'] = 278; - t['ohungarumlaut'] = 500; - t['Eogonek'] = 667; - t['dcroat'] = 500; - t['threequarters'] = 750; - t['Scedilla'] = 556; - t['lcaron'] = 382; - t['Kcommaaccent'] = 667; - t['Lacute'] = 611; - t['trademark'] = 1000; - t['edotaccent'] = 444; - t['Igrave'] = 389; - t['Imacron'] = 389; - t['Lcaron'] = 611; - t['onehalf'] = 750; - t['lessequal'] = 549; - t['ocircumflex'] = 500; - t['ntilde'] = 556; - t['Uhungarumlaut'] = 722; - t['Eacute'] = 667; - t['emacron'] = 444; - t['gbreve'] = 500; - t['onequarter'] = 750; - t['Scaron'] = 556; - t['Scommaaccent'] = 556; - t['Ohungarumlaut'] = 722; - t['degree'] = 400; - t['ograve'] = 500; - t['Ccaron'] = 667; - t['ugrave'] = 556; - t['radical'] = 549; - t['Dcaron'] = 722; - t['rcommaaccent'] = 389; - t['Ntilde'] = 722; - t['otilde'] = 500; - t['Rcommaaccent'] = 667; - t['Lcommaaccent'] = 611; - t['Atilde'] = 667; - t['Aogonek'] = 667; - t['Aring'] = 667; - t['Otilde'] = 722; - t['zdotaccent'] = 389; - t['Ecaron'] = 667; - t['Iogonek'] = 389; - t['kcommaaccent'] = 500; - t['minus'] = 606; - t['Icircumflex'] = 389; - t['ncaron'] = 556; - t['tcommaaccent'] = 278; - t['logicalnot'] = 606; - t['odieresis'] = 500; - t['udieresis'] = 556; - t['notequal'] = 549; - t['gcommaaccent'] = 500; - t['eth'] = 500; - t['zcaron'] = 389; - t['ncommaaccent'] = 556; - t['onesuperior'] = 300; - t['imacron'] = 278; - t['Euro'] = 500; - }); - t['Times-Italic'] = getLookupTableFactory(function (t) { - t['space'] = 250; - t['exclam'] = 333; - t['quotedbl'] = 420; - t['numbersign'] = 500; - t['dollar'] = 500; - t['percent'] = 833; - t['ampersand'] = 778; - t['quoteright'] = 333; - t['parenleft'] = 333; - t['parenright'] = 333; - t['asterisk'] = 500; - t['plus'] = 675; - t['comma'] = 250; - t['hyphen'] = 333; - t['period'] = 250; - t['slash'] = 278; - t['zero'] = 500; - t['one'] = 500; - t['two'] = 500; - t['three'] = 500; - t['four'] = 500; - t['five'] = 500; - t['six'] = 500; - t['seven'] = 500; - t['eight'] = 500; - t['nine'] = 500; - t['colon'] = 333; - t['semicolon'] = 333; - t['less'] = 675; - t['equal'] = 675; - t['greater'] = 675; - t['question'] = 500; - t['at'] = 920; - t['A'] = 611; - t['B'] = 611; - t['C'] = 667; - t['D'] = 722; - t['E'] = 611; - t['F'] = 611; - t['G'] = 722; - t['H'] = 722; - t['I'] = 333; - t['J'] = 444; - t['K'] = 667; - t['L'] = 556; - t['M'] = 833; - t['N'] = 667; - t['O'] = 722; - t['P'] = 611; - t['Q'] = 722; - t['R'] = 611; - t['S'] = 500; - t['T'] = 556; - t['U'] = 722; - t['V'] = 611; - t['W'] = 833; - t['X'] = 611; - t['Y'] = 556; - t['Z'] = 556; - t['bracketleft'] = 389; - t['backslash'] = 278; - t['bracketright'] = 389; - t['asciicircum'] = 422; - t['underscore'] = 500; - t['quoteleft'] = 333; - t['a'] = 500; - t['b'] = 500; - t['c'] = 444; - t['d'] = 500; - t['e'] = 444; - t['f'] = 278; - t['g'] = 500; - t['h'] = 500; - t['i'] = 278; - t['j'] = 278; - t['k'] = 444; - t['l'] = 278; - t['m'] = 722; - t['n'] = 500; - t['o'] = 500; - t['p'] = 500; - t['q'] = 500; - t['r'] = 389; - t['s'] = 389; - t['t'] = 278; - t['u'] = 500; - t['v'] = 444; - t['w'] = 667; - t['x'] = 444; - t['y'] = 444; - t['z'] = 389; - t['braceleft'] = 400; - t['bar'] = 275; - t['braceright'] = 400; - t['asciitilde'] = 541; - t['exclamdown'] = 389; - t['cent'] = 500; - t['sterling'] = 500; - t['fraction'] = 167; - t['yen'] = 500; - t['florin'] = 500; - t['section'] = 500; - t['currency'] = 500; - t['quotesingle'] = 214; - t['quotedblleft'] = 556; - t['guillemotleft'] = 500; - t['guilsinglleft'] = 333; - t['guilsinglright'] = 333; - t['fi'] = 500; - t['fl'] = 500; - t['endash'] = 500; - t['dagger'] = 500; - t['daggerdbl'] = 500; - t['periodcentered'] = 250; - t['paragraph'] = 523; - t['bullet'] = 350; - t['quotesinglbase'] = 333; - t['quotedblbase'] = 556; - t['quotedblright'] = 556; - t['guillemotright'] = 500; - t['ellipsis'] = 889; - t['perthousand'] = 1000; - t['questiondown'] = 500; - t['grave'] = 333; - t['acute'] = 333; - t['circumflex'] = 333; - t['tilde'] = 333; - t['macron'] = 333; - t['breve'] = 333; - t['dotaccent'] = 333; - t['dieresis'] = 333; - t['ring'] = 333; - t['cedilla'] = 333; - t['hungarumlaut'] = 333; - t['ogonek'] = 333; - t['caron'] = 333; - t['emdash'] = 889; - t['AE'] = 889; - t['ordfeminine'] = 276; - t['Lslash'] = 556; - t['Oslash'] = 722; - t['OE'] = 944; - t['ordmasculine'] = 310; - t['ae'] = 667; - t['dotlessi'] = 278; - t['lslash'] = 278; - t['oslash'] = 500; - t['oe'] = 667; - t['germandbls'] = 500; - t['Idieresis'] = 333; - t['eacute'] = 444; - t['abreve'] = 500; - t['uhungarumlaut'] = 500; - t['ecaron'] = 444; - t['Ydieresis'] = 556; - t['divide'] = 675; - t['Yacute'] = 556; - t['Acircumflex'] = 611; - t['aacute'] = 500; - t['Ucircumflex'] = 722; - t['yacute'] = 444; - t['scommaaccent'] = 389; - t['ecircumflex'] = 444; - t['Uring'] = 722; - t['Udieresis'] = 722; - t['aogonek'] = 500; - t['Uacute'] = 722; - t['uogonek'] = 500; - t['Edieresis'] = 611; - t['Dcroat'] = 722; - t['commaaccent'] = 250; - t['copyright'] = 760; - t['Emacron'] = 611; - t['ccaron'] = 444; - t['aring'] = 500; - t['Ncommaaccent'] = 667; - t['lacute'] = 278; - t['agrave'] = 500; - t['Tcommaaccent'] = 556; - t['Cacute'] = 667; - t['atilde'] = 500; - t['Edotaccent'] = 611; - t['scaron'] = 389; - t['scedilla'] = 389; - t['iacute'] = 278; - t['lozenge'] = 471; - t['Rcaron'] = 611; - t['Gcommaaccent'] = 722; - t['ucircumflex'] = 500; - t['acircumflex'] = 500; - t['Amacron'] = 611; - t['rcaron'] = 389; - t['ccedilla'] = 444; - t['Zdotaccent'] = 556; - t['Thorn'] = 611; - t['Omacron'] = 722; - t['Racute'] = 611; - t['Sacute'] = 500; - t['dcaron'] = 544; - t['Umacron'] = 722; - t['uring'] = 500; - t['threesuperior'] = 300; - t['Ograve'] = 722; - t['Agrave'] = 611; - t['Abreve'] = 611; - t['multiply'] = 675; - t['uacute'] = 500; - t['Tcaron'] = 556; - t['partialdiff'] = 476; - t['ydieresis'] = 444; - t['Nacute'] = 667; - t['icircumflex'] = 278; - t['Ecircumflex'] = 611; - t['adieresis'] = 500; - t['edieresis'] = 444; - t['cacute'] = 444; - t['nacute'] = 500; - t['umacron'] = 500; - t['Ncaron'] = 667; - t['Iacute'] = 333; - t['plusminus'] = 675; - t['brokenbar'] = 275; - t['registered'] = 760; - t['Gbreve'] = 722; - t['Idotaccent'] = 333; - t['summation'] = 600; - t['Egrave'] = 611; - t['racute'] = 389; - t['omacron'] = 500; - t['Zacute'] = 556; - t['Zcaron'] = 556; - t['greaterequal'] = 549; - t['Eth'] = 722; - t['Ccedilla'] = 667; - t['lcommaaccent'] = 278; - t['tcaron'] = 300; - t['eogonek'] = 444; - t['Uogonek'] = 722; - t['Aacute'] = 611; - t['Adieresis'] = 611; - t['egrave'] = 444; - t['zacute'] = 389; - t['iogonek'] = 278; - t['Oacute'] = 722; - t['oacute'] = 500; - t['amacron'] = 500; - t['sacute'] = 389; - t['idieresis'] = 278; - t['Ocircumflex'] = 722; - t['Ugrave'] = 722; - t['Delta'] = 612; - t['thorn'] = 500; - t['twosuperior'] = 300; - t['Odieresis'] = 722; - t['mu'] = 500; - t['igrave'] = 278; - t['ohungarumlaut'] = 500; - t['Eogonek'] = 611; - t['dcroat'] = 500; - t['threequarters'] = 750; - t['Scedilla'] = 500; - t['lcaron'] = 300; - t['Kcommaaccent'] = 667; - t['Lacute'] = 556; - t['trademark'] = 980; - t['edotaccent'] = 444; - t['Igrave'] = 333; - t['Imacron'] = 333; - t['Lcaron'] = 611; - t['onehalf'] = 750; - t['lessequal'] = 549; - t['ocircumflex'] = 500; - t['ntilde'] = 500; - t['Uhungarumlaut'] = 722; - t['Eacute'] = 611; - t['emacron'] = 444; - t['gbreve'] = 500; - t['onequarter'] = 750; - t['Scaron'] = 500; - t['Scommaaccent'] = 500; - t['Ohungarumlaut'] = 722; - t['degree'] = 400; - t['ograve'] = 500; - t['Ccaron'] = 667; - t['ugrave'] = 500; - t['radical'] = 453; - t['Dcaron'] = 722; - t['rcommaaccent'] = 389; - t['Ntilde'] = 667; - t['otilde'] = 500; - t['Rcommaaccent'] = 611; - t['Lcommaaccent'] = 556; - t['Atilde'] = 611; - t['Aogonek'] = 611; - t['Aring'] = 611; - t['Otilde'] = 722; - t['zdotaccent'] = 389; - t['Ecaron'] = 611; - t['Iogonek'] = 333; - t['kcommaaccent'] = 444; - t['minus'] = 675; - t['Icircumflex'] = 333; - t['ncaron'] = 500; - t['tcommaaccent'] = 278; - t['logicalnot'] = 675; - t['odieresis'] = 500; - t['udieresis'] = 500; - t['notequal'] = 549; - t['gcommaaccent'] = 500; - t['eth'] = 500; - t['zcaron'] = 389; - t['ncommaaccent'] = 500; - t['onesuperior'] = 300; - t['imacron'] = 278; - t['Euro'] = 500; - }); - t['ZapfDingbats'] = getLookupTableFactory(function (t) { - t['space'] = 278; - t['a1'] = 974; - t['a2'] = 961; - t['a202'] = 974; - t['a3'] = 980; - t['a4'] = 719; - t['a5'] = 789; - t['a119'] = 790; - t['a118'] = 791; - t['a117'] = 690; - t['a11'] = 960; - t['a12'] = 939; - t['a13'] = 549; - t['a14'] = 855; - t['a15'] = 911; - t['a16'] = 933; - t['a105'] = 911; - t['a17'] = 945; - t['a18'] = 974; - t['a19'] = 755; - t['a20'] = 846; - t['a21'] = 762; - t['a22'] = 761; - t['a23'] = 571; - t['a24'] = 677; - t['a25'] = 763; - t['a26'] = 760; - t['a27'] = 759; - t['a28'] = 754; - t['a6'] = 494; - t['a7'] = 552; - t['a8'] = 537; - t['a9'] = 577; - t['a10'] = 692; - t['a29'] = 786; - t['a30'] = 788; - t['a31'] = 788; - t['a32'] = 790; - t['a33'] = 793; - t['a34'] = 794; - t['a35'] = 816; - t['a36'] = 823; - t['a37'] = 789; - t['a38'] = 841; - t['a39'] = 823; - t['a40'] = 833; - t['a41'] = 816; - t['a42'] = 831; - t['a43'] = 923; - t['a44'] = 744; - t['a45'] = 723; - t['a46'] = 749; - t['a47'] = 790; - t['a48'] = 792; - t['a49'] = 695; - t['a50'] = 776; - t['a51'] = 768; - t['a52'] = 792; - t['a53'] = 759; - t['a54'] = 707; - t['a55'] = 708; - t['a56'] = 682; - t['a57'] = 701; - t['a58'] = 826; - t['a59'] = 815; - t['a60'] = 789; - t['a61'] = 789; - t['a62'] = 707; - t['a63'] = 687; - t['a64'] = 696; - t['a65'] = 689; - t['a66'] = 786; - t['a67'] = 787; - t['a68'] = 713; - t['a69'] = 791; - t['a70'] = 785; - t['a71'] = 791; - t['a72'] = 873; - t['a73'] = 761; - t['a74'] = 762; - t['a203'] = 762; - t['a75'] = 759; - t['a204'] = 759; - t['a76'] = 892; - t['a77'] = 892; - t['a78'] = 788; - t['a79'] = 784; - t['a81'] = 438; - t['a82'] = 138; - t['a83'] = 277; - t['a84'] = 415; - t['a97'] = 392; - t['a98'] = 392; - t['a99'] = 668; - t['a100'] = 668; - t['a89'] = 390; - t['a90'] = 390; - t['a93'] = 317; - t['a94'] = 317; - t['a91'] = 276; - t['a92'] = 276; - t['a205'] = 509; - t['a85'] = 509; - t['a206'] = 410; - t['a86'] = 410; - t['a87'] = 234; - t['a88'] = 234; - t['a95'] = 334; - t['a96'] = 334; - t['a101'] = 732; - t['a102'] = 544; - t['a103'] = 544; - t['a104'] = 910; - t['a106'] = 667; - t['a107'] = 760; - t['a108'] = 760; - t['a112'] = 776; - t['a111'] = 595; - t['a110'] = 694; - t['a109'] = 626; - t['a120'] = 788; - t['a121'] = 788; - t['a122'] = 788; - t['a123'] = 788; - t['a124'] = 788; - t['a125'] = 788; - t['a126'] = 788; - t['a127'] = 788; - t['a128'] = 788; - t['a129'] = 788; - t['a130'] = 788; - t['a131'] = 788; - t['a132'] = 788; - t['a133'] = 788; - t['a134'] = 788; - t['a135'] = 788; - t['a136'] = 788; - t['a137'] = 788; - t['a138'] = 788; - t['a139'] = 788; - t['a140'] = 788; - t['a141'] = 788; - t['a142'] = 788; - t['a143'] = 788; - t['a144'] = 788; - t['a145'] = 788; - t['a146'] = 788; - t['a147'] = 788; - t['a148'] = 788; - t['a149'] = 788; - t['a150'] = 788; - t['a151'] = 788; - t['a152'] = 788; - t['a153'] = 788; - t['a154'] = 788; - t['a155'] = 788; - t['a156'] = 788; - t['a157'] = 788; - t['a158'] = 788; - t['a159'] = 788; - t['a160'] = 894; - t['a161'] = 838; - t['a163'] = 1016; - t['a164'] = 458; - t['a196'] = 748; - t['a165'] = 924; - t['a192'] = 748; - t['a166'] = 918; - t['a167'] = 927; - t['a168'] = 928; - t['a169'] = 928; - t['a170'] = 834; - t['a171'] = 873; - t['a172'] = 828; - t['a173'] = 924; - t['a162'] = 924; - t['a174'] = 917; - t['a175'] = 930; - t['a176'] = 931; - t['a177'] = 463; - t['a178'] = 883; - t['a179'] = 836; - t['a193'] = 836; - t['a180'] = 867; - t['a199'] = 867; - t['a181'] = 696; - t['a200'] = 696; - t['a182'] = 874; - t['a201'] = 874; - t['a183'] = 760; - t['a184'] = 946; - t['a197'] = 771; - t['a185'] = 865; - t['a194'] = 771; - t['a198'] = 888; - t['a186'] = 967; - t['a195'] = 888; - t['a187'] = 831; - t['a188'] = 873; - t['a189'] = 927; - t['a190'] = 970; - t['a191'] = 918; - }); -}); - -exports.getMetrics = getMetrics; -})); - - - -(function (root, factory) { - { - factory((root.pdfjsCoreMurmurHash3 = {}), root.pdfjsSharedUtil); - } -}(this, function (exports, sharedUtil) { - -var Uint32ArrayView = sharedUtil.Uint32ArrayView; - -var MurmurHash3_64 = (function MurmurHash3_64Closure (seed) { - // Workaround for missing math precision in JS. - var MASK_HIGH = 0xffff0000; - var MASK_LOW = 0xffff; - - function MurmurHash3_64 (seed) { - var SEED = 0xc3d2e1f0; - this.h1 = seed ? seed & 0xffffffff : SEED; - this.h2 = seed ? seed & 0xffffffff : SEED; - } - - var alwaysUseUint32ArrayView = false; - // old webkits have issues with non-aligned arrays - try { - new Uint32Array(new Uint8Array(5).buffer, 0, 1); - } catch (e) { - alwaysUseUint32ArrayView = true; - } - - MurmurHash3_64.prototype = { - update: function MurmurHash3_64_update(input) { - var useUint32ArrayView = alwaysUseUint32ArrayView; - var i; - if (typeof input === 'string') { - var data = new Uint8Array(input.length * 2); - var length = 0; - for (i = 0; i < input.length; i++) { - var code = input.charCodeAt(i); - if (code <= 0xff) { - data[length++] = code; - } - else { - data[length++] = code >>> 8; - data[length++] = code & 0xff; - } - } - } else if (input instanceof Uint8Array) { - data = input; - length = data.length; - } else if (typeof input === 'object' && ('length' in input)) { - // processing regular arrays as well, e.g. for IE9 - data = input; - length = data.length; - useUint32ArrayView = true; - } else { - throw new Error('Wrong data format in MurmurHash3_64_update. ' + - 'Input must be a string or array.'); - } - - var blockCounts = length >> 2; - var tailLength = length - blockCounts * 4; - // we don't care about endianness here - var dataUint32 = useUint32ArrayView ? - new Uint32ArrayView(data, blockCounts) : - new Uint32Array(data.buffer, 0, blockCounts); - var k1 = 0; - var k2 = 0; - var h1 = this.h1; - var h2 = this.h2; - var C1 = 0xcc9e2d51; - var C2 = 0x1b873593; - var C1_LOW = C1 & MASK_LOW; - var C2_LOW = C2 & MASK_LOW; - - for (i = 0; i < blockCounts; i++) { - if (i & 1) { - k1 = dataUint32[i]; - k1 = (k1 * C1 & MASK_HIGH) | (k1 * C1_LOW & MASK_LOW); - k1 = k1 << 15 | k1 >>> 17; - k1 = (k1 * C2 & MASK_HIGH) | (k1 * C2_LOW & MASK_LOW); - h1 ^= k1; - h1 = h1 << 13 | h1 >>> 19; - h1 = h1 * 5 + 0xe6546b64; - } else { - k2 = dataUint32[i]; - k2 = (k2 * C1 & MASK_HIGH) | (k2 * C1_LOW & MASK_LOW); - k2 = k2 << 15 | k2 >>> 17; - k2 = (k2 * C2 & MASK_HIGH) | (k2 * C2_LOW & MASK_LOW); - h2 ^= k2; - h2 = h2 << 13 | h2 >>> 19; - h2 = h2 * 5 + 0xe6546b64; - } - } - - k1 = 0; - - switch (tailLength) { - case 3: - k1 ^= data[blockCounts * 4 + 2] << 16; - /* falls through */ - case 2: - k1 ^= data[blockCounts * 4 + 1] << 8; - /* falls through */ - case 1: - k1 ^= data[blockCounts * 4]; - /* falls through */ - k1 = (k1 * C1 & MASK_HIGH) | (k1 * C1_LOW & MASK_LOW); - k1 = k1 << 15 | k1 >>> 17; - k1 = (k1 * C2 & MASK_HIGH) | (k1 * C2_LOW & MASK_LOW); - if (blockCounts & 1) { - h1 ^= k1; - } else { - h2 ^= k1; - } - } - - this.h1 = h1; - this.h2 = h2; - return this; - }, - - hexdigest: function MurmurHash3_64_hexdigest () { - var h1 = this.h1; - var h2 = this.h2; - - h1 ^= h2 >>> 1; - h1 = (h1 * 0xed558ccd & MASK_HIGH) | (h1 * 0x8ccd & MASK_LOW); - h2 = (h2 * 0xff51afd7 & MASK_HIGH) | - (((h2 << 16 | h1 >>> 16) * 0xafd7ed55 & MASK_HIGH) >>> 16); - h1 ^= h2 >>> 1; - h1 = (h1 * 0x1a85ec53 & MASK_HIGH) | (h1 * 0xec53 & MASK_LOW); - h2 = (h2 * 0xc4ceb9fe & MASK_HIGH) | - (((h2 << 16 | h1 >>> 16) * 0xb9fe1a85 & MASK_HIGH) >>> 16); - h1 ^= h2 >>> 1; - - for (var i = 0, arr = [h1, h2], str = ''; i < arr.length; i++) { - var hex = (arr[i] >>> 0).toString(16); - while (hex.length < 8) { - hex = '0' + hex; - } - str += hex; - } - - return str; - } - }; - - return MurmurHash3_64; -})(); - -exports.MurmurHash3_64 = MurmurHash3_64; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCorePrimitives = {}), root.pdfjsSharedUtil); - } -}(this, function (exports, sharedUtil) { - -var isArray = sharedUtil.isArray; - -var Name = (function NameClosure() { - function Name(name) { - this.name = name; - } - - Name.prototype = {}; - - var nameCache = Object.create(null); - - Name.get = function Name_get(name) { - var nameValue = nameCache[name]; - return (nameValue ? nameValue : (nameCache[name] = new Name(name))); - }; - - return Name; -})(); - -var Cmd = (function CmdClosure() { - function Cmd(cmd) { - this.cmd = cmd; - } - - Cmd.prototype = {}; - - var cmdCache = Object.create(null); - - Cmd.get = function Cmd_get(cmd) { - var cmdValue = cmdCache[cmd]; - return (cmdValue ? cmdValue : (cmdCache[cmd] = new Cmd(cmd))); - }; - - return Cmd; -})(); - -var Dict = (function DictClosure() { - var nonSerializable = function nonSerializableClosure() { - return nonSerializable; // creating closure on some variable - }; - - // xref is optional - function Dict(xref) { - // Map should only be used internally, use functions below to access. - this.map = Object.create(null); - this.xref = xref; - this.objId = null; - this.__nonSerializable__ = nonSerializable; // disable cloning of the Dict - } - - Dict.prototype = { - assignXref: function Dict_assignXref(newXref) { - this.xref = newXref; - }, - - // automatically dereferences Ref objects - get: function Dict_get(key1, key2, key3) { - var value; - var xref = this.xref; - if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map || - typeof key2 === 'undefined') { - return xref ? xref.fetchIfRef(value) : value; - } - if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map || - typeof key3 === 'undefined') { - return xref ? xref.fetchIfRef(value) : value; - } - value = this.map[key3] || null; - return xref ? xref.fetchIfRef(value) : value; - }, - - // Same as get(), but returns a promise and uses fetchIfRefAsync(). - getAsync: function Dict_getAsync(key1, key2, key3) { - var value; - var xref = this.xref; - if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map || - typeof key2 === 'undefined') { - if (xref) { - return xref.fetchIfRefAsync(value); - } - return Promise.resolve(value); - } - if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map || - typeof key3 === 'undefined') { - if (xref) { - return xref.fetchIfRefAsync(value); - } - return Promise.resolve(value); - } - value = this.map[key3] || null; - if (xref) { - return xref.fetchIfRefAsync(value); - } - return Promise.resolve(value); - }, - - // Same as get(), but dereferences all elements if the result is an Array. - getArray: function Dict_getArray(key1, key2, key3) { - var value = this.get(key1, key2, key3); - var xref = this.xref; - if (!isArray(value) || !xref) { - return value; - } - value = value.slice(); // Ensure that we don't modify the Dict data. - for (var i = 0, ii = value.length; i < ii; i++) { - if (!isRef(value[i])) { - continue; - } - value[i] = xref.fetch(value[i]); - } - return value; - }, - - // no dereferencing - getRaw: function Dict_getRaw(key) { - return this.map[key]; - }, - - getKeys: function Dict_getKeys() { - return Object.keys(this.map); - }, - - set: function Dict_set(key, value) { - this.map[key] = value; - }, - - has: function Dict_has(key) { - return key in this.map; - }, - - forEach: function Dict_forEach(callback) { - for (var key in this.map) { - callback(key, this.get(key)); - } - } - }; - - Dict.empty = new Dict(null); - - Dict.merge = function Dict_merge(xref, dictArray) { - var mergedDict = new Dict(xref); - - for (var i = 0, ii = dictArray.length; i < ii; i++) { - var dict = dictArray[i]; - if (!isDict(dict)) { - continue; - } - for (var keyName in dict.map) { - if (mergedDict.map[keyName]) { - continue; - } - mergedDict.map[keyName] = dict.map[keyName]; - } - } - return mergedDict; - }; - - return Dict; -})(); - -var Ref = (function RefClosure() { - function Ref(num, gen) { - this.num = num; - this.gen = gen; - } - - Ref.prototype = { - toString: function Ref_toString() { - // This function is hot, so we make the string as compact as possible. - // |this.gen| is almost always zero, so we treat that case specially. - var str = this.num + 'R'; - if (this.gen !== 0) { - str += this.gen; - } - return str; - } - }; - - return Ref; -})(); - -// The reference is identified by number and generation. -// This structure stores only one instance of the reference. -var RefSet = (function RefSetClosure() { - function RefSet() { - this.dict = Object.create(null); - } - - RefSet.prototype = { - has: function RefSet_has(ref) { - return ref.toString() in this.dict; - }, - - put: function RefSet_put(ref) { - this.dict[ref.toString()] = true; - }, - - remove: function RefSet_remove(ref) { - delete this.dict[ref.toString()]; - } - }; - - return RefSet; -})(); - -var RefSetCache = (function RefSetCacheClosure() { - function RefSetCache() { - this.dict = Object.create(null); - } - - RefSetCache.prototype = { - get: function RefSetCache_get(ref) { - return this.dict[ref.toString()]; - }, - - has: function RefSetCache_has(ref) { - return ref.toString() in this.dict; - }, - - put: function RefSetCache_put(ref, obj) { - this.dict[ref.toString()] = obj; - }, - - putAlias: function RefSetCache_putAlias(ref, aliasRef) { - this.dict[ref.toString()] = this.get(aliasRef); - }, - - forEach: function RefSetCache_forEach(fn, thisArg) { - for (var i in this.dict) { - fn.call(thisArg, this.dict[i]); - } - }, - - clear: function RefSetCache_clear() { - this.dict = Object.create(null); - } - }; - - return RefSetCache; -})(); - -function isName(v, name) { - return v instanceof Name && (name === undefined || v.name === name); -} - -function isCmd(v, cmd) { - return v instanceof Cmd && (cmd === undefined || v.cmd === cmd); -} - -function isDict(v, type) { - return v instanceof Dict && - (type === undefined || isName(v.get('Type'), type)); -} - -function isRef(v) { - return v instanceof Ref; -} - -function isRefsEqual(v1, v2) { - return v1.num === v2.num && v1.gen === v2.gen; -} - -function isStream(v) { - return typeof v === 'object' && v !== null && v.getBytes !== undefined; -} - -exports.Cmd = Cmd; -exports.Dict = Dict; -exports.Name = Name; -exports.Ref = Ref; -exports.RefSet = RefSet; -exports.RefSetCache = RefSetCache; -exports.isCmd = isCmd; -exports.isDict = isDict; -exports.isName = isName; -exports.isRef = isRef; -exports.isRefsEqual = isRefsEqual; -exports.isStream = isStream; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreStandardFonts = {}), root.pdfjsSharedUtil); - } -}(this, function (exports, sharedUtil) { - var getLookupTableFactory = sharedUtil.getLookupTableFactory; - - /** - * Hold a map of decoded fonts and of the standard fourteen Type1 - * fonts and their acronyms. - */ - var getStdFontMap = getLookupTableFactory(function (t) { - t['ArialNarrow'] = 'Helvetica'; - t['ArialNarrow-Bold'] = 'Helvetica-Bold'; - t['ArialNarrow-BoldItalic'] = 'Helvetica-BoldOblique'; - t['ArialNarrow-Italic'] = 'Helvetica-Oblique'; - t['ArialBlack'] = 'Helvetica'; - t['ArialBlack-Bold'] = 'Helvetica-Bold'; - t['ArialBlack-BoldItalic'] = 'Helvetica-BoldOblique'; - t['ArialBlack-Italic'] = 'Helvetica-Oblique'; - t['Arial'] = 'Helvetica'; - t['Arial-Bold'] = 'Helvetica-Bold'; - t['Arial-BoldItalic'] = 'Helvetica-BoldOblique'; - t['Arial-Italic'] = 'Helvetica-Oblique'; - t['Arial-BoldItalicMT'] = 'Helvetica-BoldOblique'; - t['Arial-BoldMT'] = 'Helvetica-Bold'; - t['Arial-ItalicMT'] = 'Helvetica-Oblique'; - t['ArialMT'] = 'Helvetica'; - t['Courier-Bold'] = 'Courier-Bold'; - t['Courier-BoldItalic'] = 'Courier-BoldOblique'; - t['Courier-Italic'] = 'Courier-Oblique'; - t['CourierNew'] = 'Courier'; - t['CourierNew-Bold'] = 'Courier-Bold'; - t['CourierNew-BoldItalic'] = 'Courier-BoldOblique'; - t['CourierNew-Italic'] = 'Courier-Oblique'; - t['CourierNewPS-BoldItalicMT'] = 'Courier-BoldOblique'; - t['CourierNewPS-BoldMT'] = 'Courier-Bold'; - t['CourierNewPS-ItalicMT'] = 'Courier-Oblique'; - t['CourierNewPSMT'] = 'Courier'; - t['Helvetica'] = 'Helvetica'; - t['Helvetica-Bold'] = 'Helvetica-Bold'; - t['Helvetica-BoldItalic'] = 'Helvetica-BoldOblique'; - t['Helvetica-BoldOblique'] = 'Helvetica-BoldOblique'; - t['Helvetica-Italic'] = 'Helvetica-Oblique'; - t['Helvetica-Oblique'] = 'Helvetica-Oblique'; - t['Symbol-Bold'] = 'Symbol'; - t['Symbol-BoldItalic'] = 'Symbol'; - t['Symbol-Italic'] = 'Symbol'; - t['TimesNewRoman'] = 'Times-Roman'; - t['TimesNewRoman-Bold'] = 'Times-Bold'; - t['TimesNewRoman-BoldItalic'] = 'Times-BoldItalic'; - t['TimesNewRoman-Italic'] = 'Times-Italic'; - t['TimesNewRomanPS'] = 'Times-Roman'; - t['TimesNewRomanPS-Bold'] = 'Times-Bold'; - t['TimesNewRomanPS-BoldItalic'] = 'Times-BoldItalic'; - t['TimesNewRomanPS-BoldItalicMT'] = 'Times-BoldItalic'; - t['TimesNewRomanPS-BoldMT'] = 'Times-Bold'; - t['TimesNewRomanPS-Italic'] = 'Times-Italic'; - t['TimesNewRomanPS-ItalicMT'] = 'Times-Italic'; - t['TimesNewRomanPSMT'] = 'Times-Roman'; - t['TimesNewRomanPSMT-Bold'] = 'Times-Bold'; - t['TimesNewRomanPSMT-BoldItalic'] = 'Times-BoldItalic'; - t['TimesNewRomanPSMT-Italic'] = 'Times-Italic'; - }); - - /** - * Holds the map of the non-standard fonts that might be included as - * a standard fonts without glyph data. - */ - var getNonStdFontMap = getLookupTableFactory(function (t) { - t['CenturyGothic'] = 'Helvetica'; - t['CenturyGothic-Bold'] = 'Helvetica-Bold'; - t['CenturyGothic-BoldItalic'] = 'Helvetica-BoldOblique'; - t['CenturyGothic-Italic'] = 'Helvetica-Oblique'; - t['ComicSansMS'] = 'Comic Sans MS'; - t['ComicSansMS-Bold'] = 'Comic Sans MS-Bold'; - t['ComicSansMS-BoldItalic'] = 'Comic Sans MS-BoldItalic'; - t['ComicSansMS-Italic'] = 'Comic Sans MS-Italic'; - t['LucidaConsole'] = 'Courier'; - t['LucidaConsole-Bold'] = 'Courier-Bold'; - t['LucidaConsole-BoldItalic'] = 'Courier-BoldOblique'; - t['LucidaConsole-Italic'] = 'Courier-Oblique'; - t['MS-Gothic'] = 'MS Gothic'; - t['MS-Gothic-Bold'] = 'MS Gothic-Bold'; - t['MS-Gothic-BoldItalic'] = 'MS Gothic-BoldItalic'; - t['MS-Gothic-Italic'] = 'MS Gothic-Italic'; - t['MS-Mincho'] = 'MS Mincho'; - t['MS-Mincho-Bold'] = 'MS Mincho-Bold'; - t['MS-Mincho-BoldItalic'] = 'MS Mincho-BoldItalic'; - t['MS-Mincho-Italic'] = 'MS Mincho-Italic'; - t['MS-PGothic'] = 'MS PGothic'; - t['MS-PGothic-Bold'] = 'MS PGothic-Bold'; - t['MS-PGothic-BoldItalic'] = 'MS PGothic-BoldItalic'; - t['MS-PGothic-Italic'] = 'MS PGothic-Italic'; - t['MS-PMincho'] = 'MS PMincho'; - t['MS-PMincho-Bold'] = 'MS PMincho-Bold'; - t['MS-PMincho-BoldItalic'] = 'MS PMincho-BoldItalic'; - t['MS-PMincho-Italic'] = 'MS PMincho-Italic'; - t['Wingdings'] = 'ZapfDingbats'; - }); - - var getSerifFonts = getLookupTableFactory(function (t) { - t['Adobe Jenson'] = true; - t['Adobe Text'] = true; - t['Albertus'] = true; - t['Aldus'] = true; - t['Alexandria'] = true; - t['Algerian'] = true; - t['American Typewriter'] = true; - t['Antiqua'] = true; - t['Apex'] = true; - t['Arno'] = true; - t['Aster'] = true; - t['Aurora'] = true; - t['Baskerville'] = true; - t['Bell'] = true; - t['Bembo'] = true; - t['Bembo Schoolbook'] = true; - t['Benguiat'] = true; - t['Berkeley Old Style'] = true; - t['Bernhard Modern'] = true; - t['Berthold City'] = true; - t['Bodoni'] = true; - t['Bauer Bodoni'] = true; - t['Book Antiqua'] = true; - t['Bookman'] = true; - t['Bordeaux Roman'] = true; - t['Californian FB'] = true; - t['Calisto'] = true; - t['Calvert'] = true; - t['Capitals'] = true; - t['Cambria'] = true; - t['Cartier'] = true; - t['Caslon'] = true; - t['Catull'] = true; - t['Centaur'] = true; - t['Century Old Style'] = true; - t['Century Schoolbook'] = true; - t['Chaparral'] = true; - t['Charis SIL'] = true; - t['Cheltenham'] = true; - t['Cholla Slab'] = true; - t['Clarendon'] = true; - t['Clearface'] = true; - t['Cochin'] = true; - t['Colonna'] = true; - t['Computer Modern'] = true; - t['Concrete Roman'] = true; - t['Constantia'] = true; - t['Cooper Black'] = true; - t['Corona'] = true; - t['Ecotype'] = true; - t['Egyptienne'] = true; - t['Elephant'] = true; - t['Excelsior'] = true; - t['Fairfield'] = true; - t['FF Scala'] = true; - t['Folkard'] = true; - t['Footlight'] = true; - t['FreeSerif'] = true; - t['Friz Quadrata'] = true; - t['Garamond'] = true; - t['Gentium'] = true; - t['Georgia'] = true; - t['Gloucester'] = true; - t['Goudy Old Style'] = true; - t['Goudy Schoolbook'] = true; - t['Goudy Pro Font'] = true; - t['Granjon'] = true; - t['Guardian Egyptian'] = true; - t['Heather'] = true; - t['Hercules'] = true; - t['High Tower Text'] = true; - t['Hiroshige'] = true; - t['Hoefler Text'] = true; - t['Humana Serif'] = true; - t['Imprint'] = true; - t['Ionic No. 5'] = true; - t['Janson'] = true; - t['Joanna'] = true; - t['Korinna'] = true; - t['Lexicon'] = true; - t['Liberation Serif'] = true; - t['Linux Libertine'] = true; - t['Literaturnaya'] = true; - t['Lucida'] = true; - t['Lucida Bright'] = true; - t['Melior'] = true; - t['Memphis'] = true; - t['Miller'] = true; - t['Minion'] = true; - t['Modern'] = true; - t['Mona Lisa'] = true; - t['Mrs Eaves'] = true; - t['MS Serif'] = true; - t['Museo Slab'] = true; - t['New York'] = true; - t['Nimbus Roman'] = true; - t['NPS Rawlinson Roadway'] = true; - t['Palatino'] = true; - t['Perpetua'] = true; - t['Plantin'] = true; - t['Plantin Schoolbook'] = true; - t['Playbill'] = true; - t['Poor Richard'] = true; - t['Rawlinson Roadway'] = true; - t['Renault'] = true; - t['Requiem'] = true; - t['Rockwell'] = true; - t['Roman'] = true; - t['Rotis Serif'] = true; - t['Sabon'] = true; - t['Scala'] = true; - t['Seagull'] = true; - t['Sistina'] = true; - t['Souvenir'] = true; - t['STIX'] = true; - t['Stone Informal'] = true; - t['Stone Serif'] = true; - t['Sylfaen'] = true; - t['Times'] = true; - t['Trajan'] = true; - t['Trinité'] = true; - t['Trump Mediaeval'] = true; - t['Utopia'] = true; - t['Vale Type'] = true; - t['Bitstream Vera'] = true; - t['Vera Serif'] = true; - t['Versailles'] = true; - t['Wanted'] = true; - t['Weiss'] = true; - t['Wide Latin'] = true; - t['Windsor'] = true; - t['XITS'] = true; - }); - - var getSymbolsFonts = getLookupTableFactory(function (t) { - t['Dingbats'] = true; - t['Symbol'] = true; - t['ZapfDingbats'] = true; - }); - - // Glyph map for well-known standard fonts. Sometimes Ghostscript uses CID - // fonts, but does not embed the CID to GID mapping. The mapping is incomplete - // for all glyphs, but common for some set of the standard fonts. - var getGlyphMapForStandardFonts = getLookupTableFactory(function (t) { - t[2] = 10; t[3] = 32; t[4] = 33; t[5] = 34; t[6] = 35; t[7] = 36; t[8] = 37; - t[9] = 38; t[10] = 39; t[11] = 40; t[12] = 41; t[13] = 42; t[14] = 43; - t[15] = 44; t[16] = 45; t[17] = 46; t[18] = 47; t[19] = 48; t[20] = 49; - t[21] = 50; t[22] = 51; t[23] = 52; t[24] = 53; t[25] = 54; t[26] = 55; - t[27] = 56; t[28] = 57; t[29] = 58; t[30] = 894; t[31] = 60; t[32] = 61; - t[33] = 62; t[34] = 63; t[35] = 64; t[36] = 65; t[37] = 66; t[38] = 67; - t[39] = 68; t[40] = 69; t[41] = 70; t[42] = 71; t[43] = 72; t[44] = 73; - t[45] = 74; t[46] = 75; t[47] = 76; t[48] = 77; t[49] = 78; t[50] = 79; - t[51] = 80; t[52] = 81; t[53] = 82; t[54] = 83; t[55] = 84; t[56] = 85; - t[57] = 86; t[58] = 87; t[59] = 88; t[60] = 89; t[61] = 90; t[62] = 91; - t[63] = 92; t[64] = 93; t[65] = 94; t[66] = 95; t[67] = 96; t[68] = 97; - t[69] = 98; t[70] = 99; t[71] = 100; t[72] = 101; t[73] = 102; t[74] = 103; - t[75] = 104; t[76] = 105; t[77] = 106; t[78] = 107; t[79] = 108; - t[80] = 109; t[81] = 110; t[82] = 111; t[83] = 112; t[84] = 113; - t[85] = 114; t[86] = 115; t[87] = 116; t[88] = 117; t[89] = 118; - t[90] = 119; t[91] = 120; t[92] = 121; t[93] = 122; t[94] = 123; - t[95] = 124; t[96] = 125; t[97] = 126; t[98] = 196; t[99] = 197; - t[100] = 199; t[101] = 201; t[102] = 209; t[103] = 214; t[104] = 220; - t[105] = 225; t[106] = 224; t[107] = 226; t[108] = 228; t[109] = 227; - t[110] = 229; t[111] = 231; t[112] = 233; t[113] = 232; t[114] = 234; - t[115] = 235; t[116] = 237; t[117] = 236; t[118] = 238; t[119] = 239; - t[120] = 241; t[121] = 243; t[122] = 242; t[123] = 244; t[124] = 246; - t[125] = 245; t[126] = 250; t[127] = 249; t[128] = 251; t[129] = 252; - t[130] = 8224; t[131] = 176; t[132] = 162; t[133] = 163; t[134] = 167; - t[135] = 8226; t[136] = 182; t[137] = 223; t[138] = 174; t[139] = 169; - t[140] = 8482; t[141] = 180; t[142] = 168; t[143] = 8800; t[144] = 198; - t[145] = 216; t[146] = 8734; t[147] = 177; t[148] = 8804; t[149] = 8805; - t[150] = 165; t[151] = 181; t[152] = 8706; t[153] = 8721; t[154] = 8719; - t[156] = 8747; t[157] = 170; t[158] = 186; t[159] = 8486; t[160] = 230; - t[161] = 248; t[162] = 191; t[163] = 161; t[164] = 172; t[165] = 8730; - t[166] = 402; t[167] = 8776; t[168] = 8710; t[169] = 171; t[170] = 187; - t[171] = 8230; t[210] = 218; t[223] = 711; t[224] = 321; t[225] = 322; - t[227] = 353; t[229] = 382; t[234] = 253; t[252] = 263; t[253] = 268; - t[254] = 269; t[258] = 258; t[260] = 260; t[261] = 261; t[265] = 280; - t[266] = 281; t[268] = 283; t[269] = 313; t[275] = 323; t[276] = 324; - t[278] = 328; t[284] = 345; t[285] = 346; t[286] = 347; t[292] = 367; - t[295] = 377; t[296] = 378; t[298] = 380; t[305] = 963; t[306] = 964; - t[307] = 966; t[308] = 8215; t[309] = 8252; t[310] = 8319; t[311] = 8359; - t[312] = 8592; t[313] = 8593; t[337] = 9552; t[493] = 1039; - t[494] = 1040; t[705] = 1524; t[706] = 8362; t[710] = 64288; t[711] = 64298; - t[759] = 1617; t[761] = 1776; t[763] = 1778; t[775] = 1652; t[777] = 1764; - t[778] = 1780; t[779] = 1781; t[780] = 1782; t[782] = 771; t[783] = 64726; - t[786] = 8363; t[788] = 8532; t[790] = 768; t[791] = 769; t[792] = 768; - t[795] = 803; t[797] = 64336; t[798] = 64337; t[799] = 64342; - t[800] = 64343; t[801] = 64344; t[802] = 64345; t[803] = 64362; - t[804] = 64363; t[805] = 64364; t[2424] = 7821; t[2425] = 7822; - t[2426] = 7823; t[2427] = 7824; t[2428] = 7825; t[2429] = 7826; - t[2430] = 7827; t[2433] = 7682; t[2678] = 8045; t[2679] = 8046; - t[2830] = 1552; t[2838] = 686; t[2840] = 751; t[2842] = 753; t[2843] = 754; - t[2844] = 755; t[2846] = 757; t[2856] = 767; t[2857] = 848; t[2858] = 849; - t[2862] = 853; t[2863] = 854; t[2864] = 855; t[2865] = 861; t[2866] = 862; - t[2906] = 7460; t[2908] = 7462; t[2909] = 7463; t[2910] = 7464; - t[2912] = 7466; t[2913] = 7467; t[2914] = 7468; t[2916] = 7470; - t[2917] = 7471; t[2918] = 7472; t[2920] = 7474; t[2921] = 7475; - t[2922] = 7476; t[2924] = 7478; t[2925] = 7479; t[2926] = 7480; - t[2928] = 7482; t[2929] = 7483; t[2930] = 7484; t[2932] = 7486; - t[2933] = 7487; t[2934] = 7488; t[2936] = 7490; t[2937] = 7491; - t[2938] = 7492; t[2940] = 7494; t[2941] = 7495; t[2942] = 7496; - t[2944] = 7498; t[2946] = 7500; t[2948] = 7502; t[2950] = 7504; - t[2951] = 7505; t[2952] = 7506; t[2954] = 7508; t[2955] = 7509; - t[2956] = 7510; t[2958] = 7512; t[2959] = 7513; t[2960] = 7514; - t[2962] = 7516; t[2963] = 7517; t[2964] = 7518; t[2966] = 7520; - t[2967] = 7521; t[2968] = 7522; t[2970] = 7524; t[2971] = 7525; - t[2972] = 7526; t[2974] = 7528; t[2975] = 7529; t[2976] = 7530; - t[2978] = 1537; t[2979] = 1538; t[2980] = 1539; t[2982] = 1549; - t[2983] = 1551; t[2984] = 1552; t[2986] = 1554; t[2987] = 1555; - t[2988] = 1556; t[2990] = 1623; t[2991] = 1624; t[2995] = 1775; - t[2999] = 1791; t[3002] = 64290; t[3003] = 64291; t[3004] = 64292; - t[3006] = 64294; t[3007] = 64295; t[3008] = 64296; t[3011] = 1900; - t[3014] = 8223; t[3015] = 8244; t[3017] = 7532; t[3018] = 7533; - t[3019] = 7534; t[3075] = 7590; t[3076] = 7591; t[3079] = 7594; - t[3080] = 7595; t[3083] = 7598; t[3084] = 7599; t[3087] = 7602; - t[3088] = 7603; t[3091] = 7606; t[3092] = 7607; t[3095] = 7610; - t[3096] = 7611; t[3099] = 7614; t[3100] = 7615; t[3103] = 7618; - t[3104] = 7619; t[3107] = 8337; t[3108] = 8338; t[3116] = 1884; - t[3119] = 1885; t[3120] = 1885; t[3123] = 1886; t[3124] = 1886; - t[3127] = 1887; t[3128] = 1887; t[3131] = 1888; t[3132] = 1888; - t[3135] = 1889; t[3136] = 1889; t[3139] = 1890; t[3140] = 1890; - t[3143] = 1891; t[3144] = 1891; t[3147] = 1892; t[3148] = 1892; - t[3153] = 580; t[3154] = 581; t[3157] = 584; t[3158] = 585; t[3161] = 588; - t[3162] = 589; t[3165] = 891; t[3166] = 892; t[3169] = 1274; t[3170] = 1275; - t[3173] = 1278; t[3174] = 1279; t[3181] = 7622; t[3182] = 7623; - t[3282] = 11799; t[3316] = 578; t[3379] = 42785; t[3393] = 1159; - t[3416] = 8377; - }); - - // The glyph map for ArialBlack differs slightly from the glyph map used for - // other well-known standard fonts. Hence we use this (incomplete) CID to GID - // mapping to adjust the glyph map for non-embedded ArialBlack fonts. - var getSupplementalGlyphMapForArialBlack = - getLookupTableFactory(function (t) { - t[227] = 322; t[264] = 261; t[291] = 346; - }); - - exports.getStdFontMap = getStdFontMap; - exports.getNonStdFontMap = getNonStdFontMap; - exports.getSerifFonts = getSerifFonts; - exports.getSymbolsFonts = getSymbolsFonts; - exports.getGlyphMapForStandardFonts = getGlyphMapForStandardFonts; - exports.getSupplementalGlyphMapForArialBlack = - getSupplementalGlyphMapForArialBlack; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreUnicode = {}), root.pdfjsSharedUtil); - } -}(this, function (exports, sharedUtil) { - var getLookupTableFactory = sharedUtil.getLookupTableFactory; - - // Some characters, e.g. copyrightserif, are mapped to the private use area - // and might not be displayed using standard fonts. Mapping/hacking well-known - // chars to the similar equivalents in the normal characters range. - var getSpecialPUASymbols = getLookupTableFactory(function (t) { - t[63721] = 0x00A9; // copyrightsans (0xF8E9) => copyright - t[63193] = 0x00A9; // copyrightserif (0xF6D9) => copyright - t[63720] = 0x00AE; // registersans (0xF8E8) => registered - t[63194] = 0x00AE; // registerserif (0xF6DA) => registered - t[63722] = 0x2122; // trademarksans (0xF8EA) => trademark - t[63195] = 0x2122; // trademarkserif (0xF6DB) => trademark - t[63729] = 0x23A7; // bracelefttp (0xF8F1) - t[63730] = 0x23A8; // braceleftmid (0xF8F2) - t[63731] = 0x23A9; // braceleftbt (0xF8F3) - t[63740] = 0x23AB; // bracerighttp (0xF8FC) - t[63741] = 0x23AC; // bracerightmid (0xF8FD) - t[63742] = 0x23AD; // bracerightbt (0xF8FE) - t[63726] = 0x23A1; // bracketlefttp (0xF8EE) - t[63727] = 0x23A2; // bracketleftex (0xF8EF) - t[63728] = 0x23A3; // bracketleftbt (0xF8F0) - t[63737] = 0x23A4; // bracketrighttp (0xF8F9) - t[63738] = 0x23A5; // bracketrightex (0xF8FA) - t[63739] = 0x23A6; // bracketrightbt (0xF8FB) - t[63723] = 0x239B; // parenlefttp (0xF8EB) - t[63724] = 0x239C; // parenleftex (0xF8EC) - t[63725] = 0x239D; // parenleftbt (0xF8ED) - t[63734] = 0x239E; // parenrighttp (0xF8F6) - t[63735] = 0x239F; // parenrightex (0xF8F7) - t[63736] = 0x23A0; // parenrightbt (0xF8F8) - }); - - function mapSpecialUnicodeValues(code) { - if (code >= 0xFFF0 && code <= 0xFFFF) { // Specials unicode block. - return 0; - } else if (code >= 0xF600 && code <= 0xF8FF) { - return (getSpecialPUASymbols()[code] || code); - } - return code; - } - - function getUnicodeForGlyph(name, glyphsUnicodeMap) { - var unicode = glyphsUnicodeMap[name]; - if (unicode !== undefined) { - return unicode; - } - if (!name) { - return -1; - } - // Try to recover valid Unicode values from 'uniXXXX'/'uXXXX{XX}' glyphs. - if (name[0] === 'u') { - var nameLen = name.length, hexStr; - - if (nameLen === 7 && name[1] === 'n' && name[2] === 'i') { // 'uniXXXX' - hexStr = name.substr(3); - } else if (nameLen >= 5 && nameLen <= 7) { // 'uXXXX{XX}' - hexStr = name.substr(1); - } else { - return -1; - } - // Check for upper-case hexadecimal characters, to avoid false positives. - if (hexStr === hexStr.toUpperCase()) { - unicode = parseInt(hexStr, 16); - if (unicode >= 0) { - return unicode; - } - } - } - return -1; - } - - var UnicodeRanges = [ - { 'begin': 0x0000, 'end': 0x007F }, // Basic Latin - { 'begin': 0x0080, 'end': 0x00FF }, // Latin-1 Supplement - { 'begin': 0x0100, 'end': 0x017F }, // Latin Extended-A - { 'begin': 0x0180, 'end': 0x024F }, // Latin Extended-B - { 'begin': 0x0250, 'end': 0x02AF }, // IPA Extensions - { 'begin': 0x02B0, 'end': 0x02FF }, // Spacing Modifier Letters - { 'begin': 0x0300, 'end': 0x036F }, // Combining Diacritical Marks - { 'begin': 0x0370, 'end': 0x03FF }, // Greek and Coptic - { 'begin': 0x2C80, 'end': 0x2CFF }, // Coptic - { 'begin': 0x0400, 'end': 0x04FF }, // Cyrillic - { 'begin': 0x0530, 'end': 0x058F }, // Armenian - { 'begin': 0x0590, 'end': 0x05FF }, // Hebrew - { 'begin': 0xA500, 'end': 0xA63F }, // Vai - { 'begin': 0x0600, 'end': 0x06FF }, // Arabic - { 'begin': 0x07C0, 'end': 0x07FF }, // NKo - { 'begin': 0x0900, 'end': 0x097F }, // Devanagari - { 'begin': 0x0980, 'end': 0x09FF }, // Bengali - { 'begin': 0x0A00, 'end': 0x0A7F }, // Gurmukhi - { 'begin': 0x0A80, 'end': 0x0AFF }, // Gujarati - { 'begin': 0x0B00, 'end': 0x0B7F }, // Oriya - { 'begin': 0x0B80, 'end': 0x0BFF }, // Tamil - { 'begin': 0x0C00, 'end': 0x0C7F }, // Telugu - { 'begin': 0x0C80, 'end': 0x0CFF }, // Kannada - { 'begin': 0x0D00, 'end': 0x0D7F }, // Malayalam - { 'begin': 0x0E00, 'end': 0x0E7F }, // Thai - { 'begin': 0x0E80, 'end': 0x0EFF }, // Lao - { 'begin': 0x10A0, 'end': 0x10FF }, // Georgian - { 'begin': 0x1B00, 'end': 0x1B7F }, // Balinese - { 'begin': 0x1100, 'end': 0x11FF }, // Hangul Jamo - { 'begin': 0x1E00, 'end': 0x1EFF }, // Latin Extended Additional - { 'begin': 0x1F00, 'end': 0x1FFF }, // Greek Extended - { 'begin': 0x2000, 'end': 0x206F }, // General Punctuation - { 'begin': 0x2070, 'end': 0x209F }, // Superscripts And Subscripts - { 'begin': 0x20A0, 'end': 0x20CF }, // Currency Symbol - { 'begin': 0x20D0, 'end': 0x20FF }, // Combining Diacritical Marks - { 'begin': 0x2100, 'end': 0x214F }, // Letterlike Symbols - { 'begin': 0x2150, 'end': 0x218F }, // Number Forms - { 'begin': 0x2190, 'end': 0x21FF }, // Arrows - { 'begin': 0x2200, 'end': 0x22FF }, // Mathematical Operators - { 'begin': 0x2300, 'end': 0x23FF }, // Miscellaneous Technical - { 'begin': 0x2400, 'end': 0x243F }, // Control Pictures - { 'begin': 0x2440, 'end': 0x245F }, // Optical Character Recognition - { 'begin': 0x2460, 'end': 0x24FF }, // Enclosed Alphanumerics - { 'begin': 0x2500, 'end': 0x257F }, // Box Drawing - { 'begin': 0x2580, 'end': 0x259F }, // Block Elements - { 'begin': 0x25A0, 'end': 0x25FF }, // Geometric Shapes - { 'begin': 0x2600, 'end': 0x26FF }, // Miscellaneous Symbols - { 'begin': 0x2700, 'end': 0x27BF }, // Dingbats - { 'begin': 0x3000, 'end': 0x303F }, // CJK Symbols And Punctuation - { 'begin': 0x3040, 'end': 0x309F }, // Hiragana - { 'begin': 0x30A0, 'end': 0x30FF }, // Katakana - { 'begin': 0x3100, 'end': 0x312F }, // Bopomofo - { 'begin': 0x3130, 'end': 0x318F }, // Hangul Compatibility Jamo - { 'begin': 0xA840, 'end': 0xA87F }, // Phags-pa - { 'begin': 0x3200, 'end': 0x32FF }, // Enclosed CJK Letters And Months - { 'begin': 0x3300, 'end': 0x33FF }, // CJK Compatibility - { 'begin': 0xAC00, 'end': 0xD7AF }, // Hangul Syllables - { 'begin': 0xD800, 'end': 0xDFFF }, // Non-Plane 0 * - { 'begin': 0x10900, 'end': 0x1091F }, // Phoenicia - { 'begin': 0x4E00, 'end': 0x9FFF }, // CJK Unified Ideographs - { 'begin': 0xE000, 'end': 0xF8FF }, // Private Use Area (plane 0) - { 'begin': 0x31C0, 'end': 0x31EF }, // CJK Strokes - { 'begin': 0xFB00, 'end': 0xFB4F }, // Alphabetic Presentation Forms - { 'begin': 0xFB50, 'end': 0xFDFF }, // Arabic Presentation Forms-A - { 'begin': 0xFE20, 'end': 0xFE2F }, // Combining Half Marks - { 'begin': 0xFE10, 'end': 0xFE1F }, // Vertical Forms - { 'begin': 0xFE50, 'end': 0xFE6F }, // Small Form Variants - { 'begin': 0xFE70, 'end': 0xFEFF }, // Arabic Presentation Forms-B - { 'begin': 0xFF00, 'end': 0xFFEF }, // Halfwidth And Fullwidth Forms - { 'begin': 0xFFF0, 'end': 0xFFFF }, // Specials - { 'begin': 0x0F00, 'end': 0x0FFF }, // Tibetan - { 'begin': 0x0700, 'end': 0x074F }, // Syriac - { 'begin': 0x0780, 'end': 0x07BF }, // Thaana - { 'begin': 0x0D80, 'end': 0x0DFF }, // Sinhala - { 'begin': 0x1000, 'end': 0x109F }, // Myanmar - { 'begin': 0x1200, 'end': 0x137F }, // Ethiopic - { 'begin': 0x13A0, 'end': 0x13FF }, // Cherokee - { 'begin': 0x1400, 'end': 0x167F }, // Unified Canadian Aboriginal Syllabics - { 'begin': 0x1680, 'end': 0x169F }, // Ogham - { 'begin': 0x16A0, 'end': 0x16FF }, // Runic - { 'begin': 0x1780, 'end': 0x17FF }, // Khmer - { 'begin': 0x1800, 'end': 0x18AF }, // Mongolian - { 'begin': 0x2800, 'end': 0x28FF }, // Braille Patterns - { 'begin': 0xA000, 'end': 0xA48F }, // Yi Syllables - { 'begin': 0x1700, 'end': 0x171F }, // Tagalog - { 'begin': 0x10300, 'end': 0x1032F }, // Old Italic - { 'begin': 0x10330, 'end': 0x1034F }, // Gothic - { 'begin': 0x10400, 'end': 0x1044F }, // Deseret - { 'begin': 0x1D000, 'end': 0x1D0FF }, // Byzantine Musical Symbols - { 'begin': 0x1D400, 'end': 0x1D7FF }, // Mathematical Alphanumeric Symbols - { 'begin': 0xFF000, 'end': 0xFFFFD }, // Private Use (plane 15) - { 'begin': 0xFE00, 'end': 0xFE0F }, // Variation Selectors - { 'begin': 0xE0000, 'end': 0xE007F }, // Tags - { 'begin': 0x1900, 'end': 0x194F }, // Limbu - { 'begin': 0x1950, 'end': 0x197F }, // Tai Le - { 'begin': 0x1980, 'end': 0x19DF }, // New Tai Lue - { 'begin': 0x1A00, 'end': 0x1A1F }, // Buginese - { 'begin': 0x2C00, 'end': 0x2C5F }, // Glagolitic - { 'begin': 0x2D30, 'end': 0x2D7F }, // Tifinagh - { 'begin': 0x4DC0, 'end': 0x4DFF }, // Yijing Hexagram Symbols - { 'begin': 0xA800, 'end': 0xA82F }, // Syloti Nagri - { 'begin': 0x10000, 'end': 0x1007F }, // Linear B Syllabary - { 'begin': 0x10140, 'end': 0x1018F }, // Ancient Greek Numbers - { 'begin': 0x10380, 'end': 0x1039F }, // Ugaritic - { 'begin': 0x103A0, 'end': 0x103DF }, // Old Persian - { 'begin': 0x10450, 'end': 0x1047F }, // Shavian - { 'begin': 0x10480, 'end': 0x104AF }, // Osmanya - { 'begin': 0x10800, 'end': 0x1083F }, // Cypriot Syllabary - { 'begin': 0x10A00, 'end': 0x10A5F }, // Kharoshthi - { 'begin': 0x1D300, 'end': 0x1D35F }, // Tai Xuan Jing Symbols - { 'begin': 0x12000, 'end': 0x123FF }, // Cuneiform - { 'begin': 0x1D360, 'end': 0x1D37F }, // Counting Rod Numerals - { 'begin': 0x1B80, 'end': 0x1BBF }, // Sundanese - { 'begin': 0x1C00, 'end': 0x1C4F }, // Lepcha - { 'begin': 0x1C50, 'end': 0x1C7F }, // Ol Chiki - { 'begin': 0xA880, 'end': 0xA8DF }, // Saurashtra - { 'begin': 0xA900, 'end': 0xA92F }, // Kayah Li - { 'begin': 0xA930, 'end': 0xA95F }, // Rejang - { 'begin': 0xAA00, 'end': 0xAA5F }, // Cham - { 'begin': 0x10190, 'end': 0x101CF }, // Ancient Symbols - { 'begin': 0x101D0, 'end': 0x101FF }, // Phaistos Disc - { 'begin': 0x102A0, 'end': 0x102DF }, // Carian - { 'begin': 0x1F030, 'end': 0x1F09F } // Domino Tiles - ]; - - function getUnicodeRangeFor(value) { - for (var i = 0, ii = UnicodeRanges.length; i < ii; i++) { - var range = UnicodeRanges[i]; - if (value >= range.begin && value < range.end) { - return i; - } - } - return -1; - } - - function isRTLRangeFor(value) { - var range = UnicodeRanges[13]; - if (value >= range.begin && value < range.end) { - return true; - } - range = UnicodeRanges[11]; - if (value >= range.begin && value < range.end) { - return true; - } - return false; - } - - // The normalization table is obtained by filtering the Unicode characters - // database with entries. - var getNormalizedUnicodes = getLookupTableFactory(function (t) { - t['\u00A8'] = '\u0020\u0308'; - t['\u00AF'] = '\u0020\u0304'; - t['\u00B4'] = '\u0020\u0301'; - t['\u00B5'] = '\u03BC'; - t['\u00B8'] = '\u0020\u0327'; - t['\u0132'] = '\u0049\u004A'; - t['\u0133'] = '\u0069\u006A'; - t['\u013F'] = '\u004C\u00B7'; - t['\u0140'] = '\u006C\u00B7'; - t['\u0149'] = '\u02BC\u006E'; - t['\u017F'] = '\u0073'; - t['\u01C4'] = '\u0044\u017D'; - t['\u01C5'] = '\u0044\u017E'; - t['\u01C6'] = '\u0064\u017E'; - t['\u01C7'] = '\u004C\u004A'; - t['\u01C8'] = '\u004C\u006A'; - t['\u01C9'] = '\u006C\u006A'; - t['\u01CA'] = '\u004E\u004A'; - t['\u01CB'] = '\u004E\u006A'; - t['\u01CC'] = '\u006E\u006A'; - t['\u01F1'] = '\u0044\u005A'; - t['\u01F2'] = '\u0044\u007A'; - t['\u01F3'] = '\u0064\u007A'; - t['\u02D8'] = '\u0020\u0306'; - t['\u02D9'] = '\u0020\u0307'; - t['\u02DA'] = '\u0020\u030A'; - t['\u02DB'] = '\u0020\u0328'; - t['\u02DC'] = '\u0020\u0303'; - t['\u02DD'] = '\u0020\u030B'; - t['\u037A'] = '\u0020\u0345'; - t['\u0384'] = '\u0020\u0301'; - t['\u03D0'] = '\u03B2'; - t['\u03D1'] = '\u03B8'; - t['\u03D2'] = '\u03A5'; - t['\u03D5'] = '\u03C6'; - t['\u03D6'] = '\u03C0'; - t['\u03F0'] = '\u03BA'; - t['\u03F1'] = '\u03C1'; - t['\u03F2'] = '\u03C2'; - t['\u03F4'] = '\u0398'; - t['\u03F5'] = '\u03B5'; - t['\u03F9'] = '\u03A3'; - t['\u0587'] = '\u0565\u0582'; - t['\u0675'] = '\u0627\u0674'; - t['\u0676'] = '\u0648\u0674'; - t['\u0677'] = '\u06C7\u0674'; - t['\u0678'] = '\u064A\u0674'; - t['\u0E33'] = '\u0E4D\u0E32'; - t['\u0EB3'] = '\u0ECD\u0EB2'; - t['\u0EDC'] = '\u0EAB\u0E99'; - t['\u0EDD'] = '\u0EAB\u0EA1'; - t['\u0F77'] = '\u0FB2\u0F81'; - t['\u0F79'] = '\u0FB3\u0F81'; - t['\u1E9A'] = '\u0061\u02BE'; - t['\u1FBD'] = '\u0020\u0313'; - t['\u1FBF'] = '\u0020\u0313'; - t['\u1FC0'] = '\u0020\u0342'; - t['\u1FFE'] = '\u0020\u0314'; - t['\u2002'] = '\u0020'; - t['\u2003'] = '\u0020'; - t['\u2004'] = '\u0020'; - t['\u2005'] = '\u0020'; - t['\u2006'] = '\u0020'; - t['\u2008'] = '\u0020'; - t['\u2009'] = '\u0020'; - t['\u200A'] = '\u0020'; - t['\u2017'] = '\u0020\u0333'; - t['\u2024'] = '\u002E'; - t['\u2025'] = '\u002E\u002E'; - t['\u2026'] = '\u002E\u002E\u002E'; - t['\u2033'] = '\u2032\u2032'; - t['\u2034'] = '\u2032\u2032\u2032'; - t['\u2036'] = '\u2035\u2035'; - t['\u2037'] = '\u2035\u2035\u2035'; - t['\u203C'] = '\u0021\u0021'; - t['\u203E'] = '\u0020\u0305'; - t['\u2047'] = '\u003F\u003F'; - t['\u2048'] = '\u003F\u0021'; - t['\u2049'] = '\u0021\u003F'; - t['\u2057'] = '\u2032\u2032\u2032\u2032'; - t['\u205F'] = '\u0020'; - t['\u20A8'] = '\u0052\u0073'; - t['\u2100'] = '\u0061\u002F\u0063'; - t['\u2101'] = '\u0061\u002F\u0073'; - t['\u2103'] = '\u00B0\u0043'; - t['\u2105'] = '\u0063\u002F\u006F'; - t['\u2106'] = '\u0063\u002F\u0075'; - t['\u2107'] = '\u0190'; - t['\u2109'] = '\u00B0\u0046'; - t['\u2116'] = '\u004E\u006F'; - t['\u2121'] = '\u0054\u0045\u004C'; - t['\u2135'] = '\u05D0'; - t['\u2136'] = '\u05D1'; - t['\u2137'] = '\u05D2'; - t['\u2138'] = '\u05D3'; - t['\u213B'] = '\u0046\u0041\u0058'; - t['\u2160'] = '\u0049'; - t['\u2161'] = '\u0049\u0049'; - t['\u2162'] = '\u0049\u0049\u0049'; - t['\u2163'] = '\u0049\u0056'; - t['\u2164'] = '\u0056'; - t['\u2165'] = '\u0056\u0049'; - t['\u2166'] = '\u0056\u0049\u0049'; - t['\u2167'] = '\u0056\u0049\u0049\u0049'; - t['\u2168'] = '\u0049\u0058'; - t['\u2169'] = '\u0058'; - t['\u216A'] = '\u0058\u0049'; - t['\u216B'] = '\u0058\u0049\u0049'; - t['\u216C'] = '\u004C'; - t['\u216D'] = '\u0043'; - t['\u216E'] = '\u0044'; - t['\u216F'] = '\u004D'; - t['\u2170'] = '\u0069'; - t['\u2171'] = '\u0069\u0069'; - t['\u2172'] = '\u0069\u0069\u0069'; - t['\u2173'] = '\u0069\u0076'; - t['\u2174'] = '\u0076'; - t['\u2175'] = '\u0076\u0069'; - t['\u2176'] = '\u0076\u0069\u0069'; - t['\u2177'] = '\u0076\u0069\u0069\u0069'; - t['\u2178'] = '\u0069\u0078'; - t['\u2179'] = '\u0078'; - t['\u217A'] = '\u0078\u0069'; - t['\u217B'] = '\u0078\u0069\u0069'; - t['\u217C'] = '\u006C'; - t['\u217D'] = '\u0063'; - t['\u217E'] = '\u0064'; - t['\u217F'] = '\u006D'; - t['\u222C'] = '\u222B\u222B'; - t['\u222D'] = '\u222B\u222B\u222B'; - t['\u222F'] = '\u222E\u222E'; - t['\u2230'] = '\u222E\u222E\u222E'; - t['\u2474'] = '\u0028\u0031\u0029'; - t['\u2475'] = '\u0028\u0032\u0029'; - t['\u2476'] = '\u0028\u0033\u0029'; - t['\u2477'] = '\u0028\u0034\u0029'; - t['\u2478'] = '\u0028\u0035\u0029'; - t['\u2479'] = '\u0028\u0036\u0029'; - t['\u247A'] = '\u0028\u0037\u0029'; - t['\u247B'] = '\u0028\u0038\u0029'; - t['\u247C'] = '\u0028\u0039\u0029'; - t['\u247D'] = '\u0028\u0031\u0030\u0029'; - t['\u247E'] = '\u0028\u0031\u0031\u0029'; - t['\u247F'] = '\u0028\u0031\u0032\u0029'; - t['\u2480'] = '\u0028\u0031\u0033\u0029'; - t['\u2481'] = '\u0028\u0031\u0034\u0029'; - t['\u2482'] = '\u0028\u0031\u0035\u0029'; - t['\u2483'] = '\u0028\u0031\u0036\u0029'; - t['\u2484'] = '\u0028\u0031\u0037\u0029'; - t['\u2485'] = '\u0028\u0031\u0038\u0029'; - t['\u2486'] = '\u0028\u0031\u0039\u0029'; - t['\u2487'] = '\u0028\u0032\u0030\u0029'; - t['\u2488'] = '\u0031\u002E'; - t['\u2489'] = '\u0032\u002E'; - t['\u248A'] = '\u0033\u002E'; - t['\u248B'] = '\u0034\u002E'; - t['\u248C'] = '\u0035\u002E'; - t['\u248D'] = '\u0036\u002E'; - t['\u248E'] = '\u0037\u002E'; - t['\u248F'] = '\u0038\u002E'; - t['\u2490'] = '\u0039\u002E'; - t['\u2491'] = '\u0031\u0030\u002E'; - t['\u2492'] = '\u0031\u0031\u002E'; - t['\u2493'] = '\u0031\u0032\u002E'; - t['\u2494'] = '\u0031\u0033\u002E'; - t['\u2495'] = '\u0031\u0034\u002E'; - t['\u2496'] = '\u0031\u0035\u002E'; - t['\u2497'] = '\u0031\u0036\u002E'; - t['\u2498'] = '\u0031\u0037\u002E'; - t['\u2499'] = '\u0031\u0038\u002E'; - t['\u249A'] = '\u0031\u0039\u002E'; - t['\u249B'] = '\u0032\u0030\u002E'; - t['\u249C'] = '\u0028\u0061\u0029'; - t['\u249D'] = '\u0028\u0062\u0029'; - t['\u249E'] = '\u0028\u0063\u0029'; - t['\u249F'] = '\u0028\u0064\u0029'; - t['\u24A0'] = '\u0028\u0065\u0029'; - t['\u24A1'] = '\u0028\u0066\u0029'; - t['\u24A2'] = '\u0028\u0067\u0029'; - t['\u24A3'] = '\u0028\u0068\u0029'; - t['\u24A4'] = '\u0028\u0069\u0029'; - t['\u24A5'] = '\u0028\u006A\u0029'; - t['\u24A6'] = '\u0028\u006B\u0029'; - t['\u24A7'] = '\u0028\u006C\u0029'; - t['\u24A8'] = '\u0028\u006D\u0029'; - t['\u24A9'] = '\u0028\u006E\u0029'; - t['\u24AA'] = '\u0028\u006F\u0029'; - t['\u24AB'] = '\u0028\u0070\u0029'; - t['\u24AC'] = '\u0028\u0071\u0029'; - t['\u24AD'] = '\u0028\u0072\u0029'; - t['\u24AE'] = '\u0028\u0073\u0029'; - t['\u24AF'] = '\u0028\u0074\u0029'; - t['\u24B0'] = '\u0028\u0075\u0029'; - t['\u24B1'] = '\u0028\u0076\u0029'; - t['\u24B2'] = '\u0028\u0077\u0029'; - t['\u24B3'] = '\u0028\u0078\u0029'; - t['\u24B4'] = '\u0028\u0079\u0029'; - t['\u24B5'] = '\u0028\u007A\u0029'; - t['\u2A0C'] = '\u222B\u222B\u222B\u222B'; - t['\u2A74'] = '\u003A\u003A\u003D'; - t['\u2A75'] = '\u003D\u003D'; - t['\u2A76'] = '\u003D\u003D\u003D'; - t['\u2E9F'] = '\u6BCD'; - t['\u2EF3'] = '\u9F9F'; - t['\u2F00'] = '\u4E00'; - t['\u2F01'] = '\u4E28'; - t['\u2F02'] = '\u4E36'; - t['\u2F03'] = '\u4E3F'; - t['\u2F04'] = '\u4E59'; - t['\u2F05'] = '\u4E85'; - t['\u2F06'] = '\u4E8C'; - t['\u2F07'] = '\u4EA0'; - t['\u2F08'] = '\u4EBA'; - t['\u2F09'] = '\u513F'; - t['\u2F0A'] = '\u5165'; - t['\u2F0B'] = '\u516B'; - t['\u2F0C'] = '\u5182'; - t['\u2F0D'] = '\u5196'; - t['\u2F0E'] = '\u51AB'; - t['\u2F0F'] = '\u51E0'; - t['\u2F10'] = '\u51F5'; - t['\u2F11'] = '\u5200'; - t['\u2F12'] = '\u529B'; - t['\u2F13'] = '\u52F9'; - t['\u2F14'] = '\u5315'; - t['\u2F15'] = '\u531A'; - t['\u2F16'] = '\u5338'; - t['\u2F17'] = '\u5341'; - t['\u2F18'] = '\u535C'; - t['\u2F19'] = '\u5369'; - t['\u2F1A'] = '\u5382'; - t['\u2F1B'] = '\u53B6'; - t['\u2F1C'] = '\u53C8'; - t['\u2F1D'] = '\u53E3'; - t['\u2F1E'] = '\u56D7'; - t['\u2F1F'] = '\u571F'; - t['\u2F20'] = '\u58EB'; - t['\u2F21'] = '\u5902'; - t['\u2F22'] = '\u590A'; - t['\u2F23'] = '\u5915'; - t['\u2F24'] = '\u5927'; - t['\u2F25'] = '\u5973'; - t['\u2F26'] = '\u5B50'; - t['\u2F27'] = '\u5B80'; - t['\u2F28'] = '\u5BF8'; - t['\u2F29'] = '\u5C0F'; - t['\u2F2A'] = '\u5C22'; - t['\u2F2B'] = '\u5C38'; - t['\u2F2C'] = '\u5C6E'; - t['\u2F2D'] = '\u5C71'; - t['\u2F2E'] = '\u5DDB'; - t['\u2F2F'] = '\u5DE5'; - t['\u2F30'] = '\u5DF1'; - t['\u2F31'] = '\u5DFE'; - t['\u2F32'] = '\u5E72'; - t['\u2F33'] = '\u5E7A'; - t['\u2F34'] = '\u5E7F'; - t['\u2F35'] = '\u5EF4'; - t['\u2F36'] = '\u5EFE'; - t['\u2F37'] = '\u5F0B'; - t['\u2F38'] = '\u5F13'; - t['\u2F39'] = '\u5F50'; - t['\u2F3A'] = '\u5F61'; - t['\u2F3B'] = '\u5F73'; - t['\u2F3C'] = '\u5FC3'; - t['\u2F3D'] = '\u6208'; - t['\u2F3E'] = '\u6236'; - t['\u2F3F'] = '\u624B'; - t['\u2F40'] = '\u652F'; - t['\u2F41'] = '\u6534'; - t['\u2F42'] = '\u6587'; - t['\u2F43'] = '\u6597'; - t['\u2F44'] = '\u65A4'; - t['\u2F45'] = '\u65B9'; - t['\u2F46'] = '\u65E0'; - t['\u2F47'] = '\u65E5'; - t['\u2F48'] = '\u66F0'; - t['\u2F49'] = '\u6708'; - t['\u2F4A'] = '\u6728'; - t['\u2F4B'] = '\u6B20'; - t['\u2F4C'] = '\u6B62'; - t['\u2F4D'] = '\u6B79'; - t['\u2F4E'] = '\u6BB3'; - t['\u2F4F'] = '\u6BCB'; - t['\u2F50'] = '\u6BD4'; - t['\u2F51'] = '\u6BDB'; - t['\u2F52'] = '\u6C0F'; - t['\u2F53'] = '\u6C14'; - t['\u2F54'] = '\u6C34'; - t['\u2F55'] = '\u706B'; - t['\u2F56'] = '\u722A'; - t['\u2F57'] = '\u7236'; - t['\u2F58'] = '\u723B'; - t['\u2F59'] = '\u723F'; - t['\u2F5A'] = '\u7247'; - t['\u2F5B'] = '\u7259'; - t['\u2F5C'] = '\u725B'; - t['\u2F5D'] = '\u72AC'; - t['\u2F5E'] = '\u7384'; - t['\u2F5F'] = '\u7389'; - t['\u2F60'] = '\u74DC'; - t['\u2F61'] = '\u74E6'; - t['\u2F62'] = '\u7518'; - t['\u2F63'] = '\u751F'; - t['\u2F64'] = '\u7528'; - t['\u2F65'] = '\u7530'; - t['\u2F66'] = '\u758B'; - t['\u2F67'] = '\u7592'; - t['\u2F68'] = '\u7676'; - t['\u2F69'] = '\u767D'; - t['\u2F6A'] = '\u76AE'; - t['\u2F6B'] = '\u76BF'; - t['\u2F6C'] = '\u76EE'; - t['\u2F6D'] = '\u77DB'; - t['\u2F6E'] = '\u77E2'; - t['\u2F6F'] = '\u77F3'; - t['\u2F70'] = '\u793A'; - t['\u2F71'] = '\u79B8'; - t['\u2F72'] = '\u79BE'; - t['\u2F73'] = '\u7A74'; - t['\u2F74'] = '\u7ACB'; - t['\u2F75'] = '\u7AF9'; - t['\u2F76'] = '\u7C73'; - t['\u2F77'] = '\u7CF8'; - t['\u2F78'] = '\u7F36'; - t['\u2F79'] = '\u7F51'; - t['\u2F7A'] = '\u7F8A'; - t['\u2F7B'] = '\u7FBD'; - t['\u2F7C'] = '\u8001'; - t['\u2F7D'] = '\u800C'; - t['\u2F7E'] = '\u8012'; - t['\u2F7F'] = '\u8033'; - t['\u2F80'] = '\u807F'; - t['\u2F81'] = '\u8089'; - t['\u2F82'] = '\u81E3'; - t['\u2F83'] = '\u81EA'; - t['\u2F84'] = '\u81F3'; - t['\u2F85'] = '\u81FC'; - t['\u2F86'] = '\u820C'; - t['\u2F87'] = '\u821B'; - t['\u2F88'] = '\u821F'; - t['\u2F89'] = '\u826E'; - t['\u2F8A'] = '\u8272'; - t['\u2F8B'] = '\u8278'; - t['\u2F8C'] = '\u864D'; - t['\u2F8D'] = '\u866B'; - t['\u2F8E'] = '\u8840'; - t['\u2F8F'] = '\u884C'; - t['\u2F90'] = '\u8863'; - t['\u2F91'] = '\u897E'; - t['\u2F92'] = '\u898B'; - t['\u2F93'] = '\u89D2'; - t['\u2F94'] = '\u8A00'; - t['\u2F95'] = '\u8C37'; - t['\u2F96'] = '\u8C46'; - t['\u2F97'] = '\u8C55'; - t['\u2F98'] = '\u8C78'; - t['\u2F99'] = '\u8C9D'; - t['\u2F9A'] = '\u8D64'; - t['\u2F9B'] = '\u8D70'; - t['\u2F9C'] = '\u8DB3'; - t['\u2F9D'] = '\u8EAB'; - t['\u2F9E'] = '\u8ECA'; - t['\u2F9F'] = '\u8F9B'; - t['\u2FA0'] = '\u8FB0'; - t['\u2FA1'] = '\u8FB5'; - t['\u2FA2'] = '\u9091'; - t['\u2FA3'] = '\u9149'; - t['\u2FA4'] = '\u91C6'; - t['\u2FA5'] = '\u91CC'; - t['\u2FA6'] = '\u91D1'; - t['\u2FA7'] = '\u9577'; - t['\u2FA8'] = '\u9580'; - t['\u2FA9'] = '\u961C'; - t['\u2FAA'] = '\u96B6'; - t['\u2FAB'] = '\u96B9'; - t['\u2FAC'] = '\u96E8'; - t['\u2FAD'] = '\u9751'; - t['\u2FAE'] = '\u975E'; - t['\u2FAF'] = '\u9762'; - t['\u2FB0'] = '\u9769'; - t['\u2FB1'] = '\u97CB'; - t['\u2FB2'] = '\u97ED'; - t['\u2FB3'] = '\u97F3'; - t['\u2FB4'] = '\u9801'; - t['\u2FB5'] = '\u98A8'; - t['\u2FB6'] = '\u98DB'; - t['\u2FB7'] = '\u98DF'; - t['\u2FB8'] = '\u9996'; - t['\u2FB9'] = '\u9999'; - t['\u2FBA'] = '\u99AC'; - t['\u2FBB'] = '\u9AA8'; - t['\u2FBC'] = '\u9AD8'; - t['\u2FBD'] = '\u9ADF'; - t['\u2FBE'] = '\u9B25'; - t['\u2FBF'] = '\u9B2F'; - t['\u2FC0'] = '\u9B32'; - t['\u2FC1'] = '\u9B3C'; - t['\u2FC2'] = '\u9B5A'; - t['\u2FC3'] = '\u9CE5'; - t['\u2FC4'] = '\u9E75'; - t['\u2FC5'] = '\u9E7F'; - t['\u2FC6'] = '\u9EA5'; - t['\u2FC7'] = '\u9EBB'; - t['\u2FC8'] = '\u9EC3'; - t['\u2FC9'] = '\u9ECD'; - t['\u2FCA'] = '\u9ED1'; - t['\u2FCB'] = '\u9EF9'; - t['\u2FCC'] = '\u9EFD'; - t['\u2FCD'] = '\u9F0E'; - t['\u2FCE'] = '\u9F13'; - t['\u2FCF'] = '\u9F20'; - t['\u2FD0'] = '\u9F3B'; - t['\u2FD1'] = '\u9F4A'; - t['\u2FD2'] = '\u9F52'; - t['\u2FD3'] = '\u9F8D'; - t['\u2FD4'] = '\u9F9C'; - t['\u2FD5'] = '\u9FA0'; - t['\u3036'] = '\u3012'; - t['\u3038'] = '\u5341'; - t['\u3039'] = '\u5344'; - t['\u303A'] = '\u5345'; - t['\u309B'] = '\u0020\u3099'; - t['\u309C'] = '\u0020\u309A'; - t['\u3131'] = '\u1100'; - t['\u3132'] = '\u1101'; - t['\u3133'] = '\u11AA'; - t['\u3134'] = '\u1102'; - t['\u3135'] = '\u11AC'; - t['\u3136'] = '\u11AD'; - t['\u3137'] = '\u1103'; - t['\u3138'] = '\u1104'; - t['\u3139'] = '\u1105'; - t['\u313A'] = '\u11B0'; - t['\u313B'] = '\u11B1'; - t['\u313C'] = '\u11B2'; - t['\u313D'] = '\u11B3'; - t['\u313E'] = '\u11B4'; - t['\u313F'] = '\u11B5'; - t['\u3140'] = '\u111A'; - t['\u3141'] = '\u1106'; - t['\u3142'] = '\u1107'; - t['\u3143'] = '\u1108'; - t['\u3144'] = '\u1121'; - t['\u3145'] = '\u1109'; - t['\u3146'] = '\u110A'; - t['\u3147'] = '\u110B'; - t['\u3148'] = '\u110C'; - t['\u3149'] = '\u110D'; - t['\u314A'] = '\u110E'; - t['\u314B'] = '\u110F'; - t['\u314C'] = '\u1110'; - t['\u314D'] = '\u1111'; - t['\u314E'] = '\u1112'; - t['\u314F'] = '\u1161'; - t['\u3150'] = '\u1162'; - t['\u3151'] = '\u1163'; - t['\u3152'] = '\u1164'; - t['\u3153'] = '\u1165'; - t['\u3154'] = '\u1166'; - t['\u3155'] = '\u1167'; - t['\u3156'] = '\u1168'; - t['\u3157'] = '\u1169'; - t['\u3158'] = '\u116A'; - t['\u3159'] = '\u116B'; - t['\u315A'] = '\u116C'; - t['\u315B'] = '\u116D'; - t['\u315C'] = '\u116E'; - t['\u315D'] = '\u116F'; - t['\u315E'] = '\u1170'; - t['\u315F'] = '\u1171'; - t['\u3160'] = '\u1172'; - t['\u3161'] = '\u1173'; - t['\u3162'] = '\u1174'; - t['\u3163'] = '\u1175'; - t['\u3164'] = '\u1160'; - t['\u3165'] = '\u1114'; - t['\u3166'] = '\u1115'; - t['\u3167'] = '\u11C7'; - t['\u3168'] = '\u11C8'; - t['\u3169'] = '\u11CC'; - t['\u316A'] = '\u11CE'; - t['\u316B'] = '\u11D3'; - t['\u316C'] = '\u11D7'; - t['\u316D'] = '\u11D9'; - t['\u316E'] = '\u111C'; - t['\u316F'] = '\u11DD'; - t['\u3170'] = '\u11DF'; - t['\u3171'] = '\u111D'; - t['\u3172'] = '\u111E'; - t['\u3173'] = '\u1120'; - t['\u3174'] = '\u1122'; - t['\u3175'] = '\u1123'; - t['\u3176'] = '\u1127'; - t['\u3177'] = '\u1129'; - t['\u3178'] = '\u112B'; - t['\u3179'] = '\u112C'; - t['\u317A'] = '\u112D'; - t['\u317B'] = '\u112E'; - t['\u317C'] = '\u112F'; - t['\u317D'] = '\u1132'; - t['\u317E'] = '\u1136'; - t['\u317F'] = '\u1140'; - t['\u3180'] = '\u1147'; - t['\u3181'] = '\u114C'; - t['\u3182'] = '\u11F1'; - t['\u3183'] = '\u11F2'; - t['\u3184'] = '\u1157'; - t['\u3185'] = '\u1158'; - t['\u3186'] = '\u1159'; - t['\u3187'] = '\u1184'; - t['\u3188'] = '\u1185'; - t['\u3189'] = '\u1188'; - t['\u318A'] = '\u1191'; - t['\u318B'] = '\u1192'; - t['\u318C'] = '\u1194'; - t['\u318D'] = '\u119E'; - t['\u318E'] = '\u11A1'; - t['\u3200'] = '\u0028\u1100\u0029'; - t['\u3201'] = '\u0028\u1102\u0029'; - t['\u3202'] = '\u0028\u1103\u0029'; - t['\u3203'] = '\u0028\u1105\u0029'; - t['\u3204'] = '\u0028\u1106\u0029'; - t['\u3205'] = '\u0028\u1107\u0029'; - t['\u3206'] = '\u0028\u1109\u0029'; - t['\u3207'] = '\u0028\u110B\u0029'; - t['\u3208'] = '\u0028\u110C\u0029'; - t['\u3209'] = '\u0028\u110E\u0029'; - t['\u320A'] = '\u0028\u110F\u0029'; - t['\u320B'] = '\u0028\u1110\u0029'; - t['\u320C'] = '\u0028\u1111\u0029'; - t['\u320D'] = '\u0028\u1112\u0029'; - t['\u320E'] = '\u0028\u1100\u1161\u0029'; - t['\u320F'] = '\u0028\u1102\u1161\u0029'; - t['\u3210'] = '\u0028\u1103\u1161\u0029'; - t['\u3211'] = '\u0028\u1105\u1161\u0029'; - t['\u3212'] = '\u0028\u1106\u1161\u0029'; - t['\u3213'] = '\u0028\u1107\u1161\u0029'; - t['\u3214'] = '\u0028\u1109\u1161\u0029'; - t['\u3215'] = '\u0028\u110B\u1161\u0029'; - t['\u3216'] = '\u0028\u110C\u1161\u0029'; - t['\u3217'] = '\u0028\u110E\u1161\u0029'; - t['\u3218'] = '\u0028\u110F\u1161\u0029'; - t['\u3219'] = '\u0028\u1110\u1161\u0029'; - t['\u321A'] = '\u0028\u1111\u1161\u0029'; - t['\u321B'] = '\u0028\u1112\u1161\u0029'; - t['\u321C'] = '\u0028\u110C\u116E\u0029'; - t['\u321D'] = '\u0028\u110B\u1169\u110C\u1165\u11AB\u0029'; - t['\u321E'] = '\u0028\u110B\u1169\u1112\u116E\u0029'; - t['\u3220'] = '\u0028\u4E00\u0029'; - t['\u3221'] = '\u0028\u4E8C\u0029'; - t['\u3222'] = '\u0028\u4E09\u0029'; - t['\u3223'] = '\u0028\u56DB\u0029'; - t['\u3224'] = '\u0028\u4E94\u0029'; - t['\u3225'] = '\u0028\u516D\u0029'; - t['\u3226'] = '\u0028\u4E03\u0029'; - t['\u3227'] = '\u0028\u516B\u0029'; - t['\u3228'] = '\u0028\u4E5D\u0029'; - t['\u3229'] = '\u0028\u5341\u0029'; - t['\u322A'] = '\u0028\u6708\u0029'; - t['\u322B'] = '\u0028\u706B\u0029'; - t['\u322C'] = '\u0028\u6C34\u0029'; - t['\u322D'] = '\u0028\u6728\u0029'; - t['\u322E'] = '\u0028\u91D1\u0029'; - t['\u322F'] = '\u0028\u571F\u0029'; - t['\u3230'] = '\u0028\u65E5\u0029'; - t['\u3231'] = '\u0028\u682A\u0029'; - t['\u3232'] = '\u0028\u6709\u0029'; - t['\u3233'] = '\u0028\u793E\u0029'; - t['\u3234'] = '\u0028\u540D\u0029'; - t['\u3235'] = '\u0028\u7279\u0029'; - t['\u3236'] = '\u0028\u8CA1\u0029'; - t['\u3237'] = '\u0028\u795D\u0029'; - t['\u3238'] = '\u0028\u52B4\u0029'; - t['\u3239'] = '\u0028\u4EE3\u0029'; - t['\u323A'] = '\u0028\u547C\u0029'; - t['\u323B'] = '\u0028\u5B66\u0029'; - t['\u323C'] = '\u0028\u76E3\u0029'; - t['\u323D'] = '\u0028\u4F01\u0029'; - t['\u323E'] = '\u0028\u8CC7\u0029'; - t['\u323F'] = '\u0028\u5354\u0029'; - t['\u3240'] = '\u0028\u796D\u0029'; - t['\u3241'] = '\u0028\u4F11\u0029'; - t['\u3242'] = '\u0028\u81EA\u0029'; - t['\u3243'] = '\u0028\u81F3\u0029'; - t['\u32C0'] = '\u0031\u6708'; - t['\u32C1'] = '\u0032\u6708'; - t['\u32C2'] = '\u0033\u6708'; - t['\u32C3'] = '\u0034\u6708'; - t['\u32C4'] = '\u0035\u6708'; - t['\u32C5'] = '\u0036\u6708'; - t['\u32C6'] = '\u0037\u6708'; - t['\u32C7'] = '\u0038\u6708'; - t['\u32C8'] = '\u0039\u6708'; - t['\u32C9'] = '\u0031\u0030\u6708'; - t['\u32CA'] = '\u0031\u0031\u6708'; - t['\u32CB'] = '\u0031\u0032\u6708'; - t['\u3358'] = '\u0030\u70B9'; - t['\u3359'] = '\u0031\u70B9'; - t['\u335A'] = '\u0032\u70B9'; - t['\u335B'] = '\u0033\u70B9'; - t['\u335C'] = '\u0034\u70B9'; - t['\u335D'] = '\u0035\u70B9'; - t['\u335E'] = '\u0036\u70B9'; - t['\u335F'] = '\u0037\u70B9'; - t['\u3360'] = '\u0038\u70B9'; - t['\u3361'] = '\u0039\u70B9'; - t['\u3362'] = '\u0031\u0030\u70B9'; - t['\u3363'] = '\u0031\u0031\u70B9'; - t['\u3364'] = '\u0031\u0032\u70B9'; - t['\u3365'] = '\u0031\u0033\u70B9'; - t['\u3366'] = '\u0031\u0034\u70B9'; - t['\u3367'] = '\u0031\u0035\u70B9'; - t['\u3368'] = '\u0031\u0036\u70B9'; - t['\u3369'] = '\u0031\u0037\u70B9'; - t['\u336A'] = '\u0031\u0038\u70B9'; - t['\u336B'] = '\u0031\u0039\u70B9'; - t['\u336C'] = '\u0032\u0030\u70B9'; - t['\u336D'] = '\u0032\u0031\u70B9'; - t['\u336E'] = '\u0032\u0032\u70B9'; - t['\u336F'] = '\u0032\u0033\u70B9'; - t['\u3370'] = '\u0032\u0034\u70B9'; - t['\u33E0'] = '\u0031\u65E5'; - t['\u33E1'] = '\u0032\u65E5'; - t['\u33E2'] = '\u0033\u65E5'; - t['\u33E3'] = '\u0034\u65E5'; - t['\u33E4'] = '\u0035\u65E5'; - t['\u33E5'] = '\u0036\u65E5'; - t['\u33E6'] = '\u0037\u65E5'; - t['\u33E7'] = '\u0038\u65E5'; - t['\u33E8'] = '\u0039\u65E5'; - t['\u33E9'] = '\u0031\u0030\u65E5'; - t['\u33EA'] = '\u0031\u0031\u65E5'; - t['\u33EB'] = '\u0031\u0032\u65E5'; - t['\u33EC'] = '\u0031\u0033\u65E5'; - t['\u33ED'] = '\u0031\u0034\u65E5'; - t['\u33EE'] = '\u0031\u0035\u65E5'; - t['\u33EF'] = '\u0031\u0036\u65E5'; - t['\u33F0'] = '\u0031\u0037\u65E5'; - t['\u33F1'] = '\u0031\u0038\u65E5'; - t['\u33F2'] = '\u0031\u0039\u65E5'; - t['\u33F3'] = '\u0032\u0030\u65E5'; - t['\u33F4'] = '\u0032\u0031\u65E5'; - t['\u33F5'] = '\u0032\u0032\u65E5'; - t['\u33F6'] = '\u0032\u0033\u65E5'; - t['\u33F7'] = '\u0032\u0034\u65E5'; - t['\u33F8'] = '\u0032\u0035\u65E5'; - t['\u33F9'] = '\u0032\u0036\u65E5'; - t['\u33FA'] = '\u0032\u0037\u65E5'; - t['\u33FB'] = '\u0032\u0038\u65E5'; - t['\u33FC'] = '\u0032\u0039\u65E5'; - t['\u33FD'] = '\u0033\u0030\u65E5'; - t['\u33FE'] = '\u0033\u0031\u65E5'; - t['\uFB00'] = '\u0066\u0066'; - t['\uFB01'] = '\u0066\u0069'; - t['\uFB02'] = '\u0066\u006C'; - t['\uFB03'] = '\u0066\u0066\u0069'; - t['\uFB04'] = '\u0066\u0066\u006C'; - t['\uFB05'] = '\u017F\u0074'; - t['\uFB06'] = '\u0073\u0074'; - t['\uFB13'] = '\u0574\u0576'; - t['\uFB14'] = '\u0574\u0565'; - t['\uFB15'] = '\u0574\u056B'; - t['\uFB16'] = '\u057E\u0576'; - t['\uFB17'] = '\u0574\u056D'; - t['\uFB4F'] = '\u05D0\u05DC'; - t['\uFB50'] = '\u0671'; - t['\uFB51'] = '\u0671'; - t['\uFB52'] = '\u067B'; - t['\uFB53'] = '\u067B'; - t['\uFB54'] = '\u067B'; - t['\uFB55'] = '\u067B'; - t['\uFB56'] = '\u067E'; - t['\uFB57'] = '\u067E'; - t['\uFB58'] = '\u067E'; - t['\uFB59'] = '\u067E'; - t['\uFB5A'] = '\u0680'; - t['\uFB5B'] = '\u0680'; - t['\uFB5C'] = '\u0680'; - t['\uFB5D'] = '\u0680'; - t['\uFB5E'] = '\u067A'; - t['\uFB5F'] = '\u067A'; - t['\uFB60'] = '\u067A'; - t['\uFB61'] = '\u067A'; - t['\uFB62'] = '\u067F'; - t['\uFB63'] = '\u067F'; - t['\uFB64'] = '\u067F'; - t['\uFB65'] = '\u067F'; - t['\uFB66'] = '\u0679'; - t['\uFB67'] = '\u0679'; - t['\uFB68'] = '\u0679'; - t['\uFB69'] = '\u0679'; - t['\uFB6A'] = '\u06A4'; - t['\uFB6B'] = '\u06A4'; - t['\uFB6C'] = '\u06A4'; - t['\uFB6D'] = '\u06A4'; - t['\uFB6E'] = '\u06A6'; - t['\uFB6F'] = '\u06A6'; - t['\uFB70'] = '\u06A6'; - t['\uFB71'] = '\u06A6'; - t['\uFB72'] = '\u0684'; - t['\uFB73'] = '\u0684'; - t['\uFB74'] = '\u0684'; - t['\uFB75'] = '\u0684'; - t['\uFB76'] = '\u0683'; - t['\uFB77'] = '\u0683'; - t['\uFB78'] = '\u0683'; - t['\uFB79'] = '\u0683'; - t['\uFB7A'] = '\u0686'; - t['\uFB7B'] = '\u0686'; - t['\uFB7C'] = '\u0686'; - t['\uFB7D'] = '\u0686'; - t['\uFB7E'] = '\u0687'; - t['\uFB7F'] = '\u0687'; - t['\uFB80'] = '\u0687'; - t['\uFB81'] = '\u0687'; - t['\uFB82'] = '\u068D'; - t['\uFB83'] = '\u068D'; - t['\uFB84'] = '\u068C'; - t['\uFB85'] = '\u068C'; - t['\uFB86'] = '\u068E'; - t['\uFB87'] = '\u068E'; - t['\uFB88'] = '\u0688'; - t['\uFB89'] = '\u0688'; - t['\uFB8A'] = '\u0698'; - t['\uFB8B'] = '\u0698'; - t['\uFB8C'] = '\u0691'; - t['\uFB8D'] = '\u0691'; - t['\uFB8E'] = '\u06A9'; - t['\uFB8F'] = '\u06A9'; - t['\uFB90'] = '\u06A9'; - t['\uFB91'] = '\u06A9'; - t['\uFB92'] = '\u06AF'; - t['\uFB93'] = '\u06AF'; - t['\uFB94'] = '\u06AF'; - t['\uFB95'] = '\u06AF'; - t['\uFB96'] = '\u06B3'; - t['\uFB97'] = '\u06B3'; - t['\uFB98'] = '\u06B3'; - t['\uFB99'] = '\u06B3'; - t['\uFB9A'] = '\u06B1'; - t['\uFB9B'] = '\u06B1'; - t['\uFB9C'] = '\u06B1'; - t['\uFB9D'] = '\u06B1'; - t['\uFB9E'] = '\u06BA'; - t['\uFB9F'] = '\u06BA'; - t['\uFBA0'] = '\u06BB'; - t['\uFBA1'] = '\u06BB'; - t['\uFBA2'] = '\u06BB'; - t['\uFBA3'] = '\u06BB'; - t['\uFBA4'] = '\u06C0'; - t['\uFBA5'] = '\u06C0'; - t['\uFBA6'] = '\u06C1'; - t['\uFBA7'] = '\u06C1'; - t['\uFBA8'] = '\u06C1'; - t['\uFBA9'] = '\u06C1'; - t['\uFBAA'] = '\u06BE'; - t['\uFBAB'] = '\u06BE'; - t['\uFBAC'] = '\u06BE'; - t['\uFBAD'] = '\u06BE'; - t['\uFBAE'] = '\u06D2'; - t['\uFBAF'] = '\u06D2'; - t['\uFBB0'] = '\u06D3'; - t['\uFBB1'] = '\u06D3'; - t['\uFBD3'] = '\u06AD'; - t['\uFBD4'] = '\u06AD'; - t['\uFBD5'] = '\u06AD'; - t['\uFBD6'] = '\u06AD'; - t['\uFBD7'] = '\u06C7'; - t['\uFBD8'] = '\u06C7'; - t['\uFBD9'] = '\u06C6'; - t['\uFBDA'] = '\u06C6'; - t['\uFBDB'] = '\u06C8'; - t['\uFBDC'] = '\u06C8'; - t['\uFBDD'] = '\u0677'; - t['\uFBDE'] = '\u06CB'; - t['\uFBDF'] = '\u06CB'; - t['\uFBE0'] = '\u06C5'; - t['\uFBE1'] = '\u06C5'; - t['\uFBE2'] = '\u06C9'; - t['\uFBE3'] = '\u06C9'; - t['\uFBE4'] = '\u06D0'; - t['\uFBE5'] = '\u06D0'; - t['\uFBE6'] = '\u06D0'; - t['\uFBE7'] = '\u06D0'; - t['\uFBE8'] = '\u0649'; - t['\uFBE9'] = '\u0649'; - t['\uFBEA'] = '\u0626\u0627'; - t['\uFBEB'] = '\u0626\u0627'; - t['\uFBEC'] = '\u0626\u06D5'; - t['\uFBED'] = '\u0626\u06D5'; - t['\uFBEE'] = '\u0626\u0648'; - t['\uFBEF'] = '\u0626\u0648'; - t['\uFBF0'] = '\u0626\u06C7'; - t['\uFBF1'] = '\u0626\u06C7'; - t['\uFBF2'] = '\u0626\u06C6'; - t['\uFBF3'] = '\u0626\u06C6'; - t['\uFBF4'] = '\u0626\u06C8'; - t['\uFBF5'] = '\u0626\u06C8'; - t['\uFBF6'] = '\u0626\u06D0'; - t['\uFBF7'] = '\u0626\u06D0'; - t['\uFBF8'] = '\u0626\u06D0'; - t['\uFBF9'] = '\u0626\u0649'; - t['\uFBFA'] = '\u0626\u0649'; - t['\uFBFB'] = '\u0626\u0649'; - t['\uFBFC'] = '\u06CC'; - t['\uFBFD'] = '\u06CC'; - t['\uFBFE'] = '\u06CC'; - t['\uFBFF'] = '\u06CC'; - t['\uFC00'] = '\u0626\u062C'; - t['\uFC01'] = '\u0626\u062D'; - t['\uFC02'] = '\u0626\u0645'; - t['\uFC03'] = '\u0626\u0649'; - t['\uFC04'] = '\u0626\u064A'; - t['\uFC05'] = '\u0628\u062C'; - t['\uFC06'] = '\u0628\u062D'; - t['\uFC07'] = '\u0628\u062E'; - t['\uFC08'] = '\u0628\u0645'; - t['\uFC09'] = '\u0628\u0649'; - t['\uFC0A'] = '\u0628\u064A'; - t['\uFC0B'] = '\u062A\u062C'; - t['\uFC0C'] = '\u062A\u062D'; - t['\uFC0D'] = '\u062A\u062E'; - t['\uFC0E'] = '\u062A\u0645'; - t['\uFC0F'] = '\u062A\u0649'; - t['\uFC10'] = '\u062A\u064A'; - t['\uFC11'] = '\u062B\u062C'; - t['\uFC12'] = '\u062B\u0645'; - t['\uFC13'] = '\u062B\u0649'; - t['\uFC14'] = '\u062B\u064A'; - t['\uFC15'] = '\u062C\u062D'; - t['\uFC16'] = '\u062C\u0645'; - t['\uFC17'] = '\u062D\u062C'; - t['\uFC18'] = '\u062D\u0645'; - t['\uFC19'] = '\u062E\u062C'; - t['\uFC1A'] = '\u062E\u062D'; - t['\uFC1B'] = '\u062E\u0645'; - t['\uFC1C'] = '\u0633\u062C'; - t['\uFC1D'] = '\u0633\u062D'; - t['\uFC1E'] = '\u0633\u062E'; - t['\uFC1F'] = '\u0633\u0645'; - t['\uFC20'] = '\u0635\u062D'; - t['\uFC21'] = '\u0635\u0645'; - t['\uFC22'] = '\u0636\u062C'; - t['\uFC23'] = '\u0636\u062D'; - t['\uFC24'] = '\u0636\u062E'; - t['\uFC25'] = '\u0636\u0645'; - t['\uFC26'] = '\u0637\u062D'; - t['\uFC27'] = '\u0637\u0645'; - t['\uFC28'] = '\u0638\u0645'; - t['\uFC29'] = '\u0639\u062C'; - t['\uFC2A'] = '\u0639\u0645'; - t['\uFC2B'] = '\u063A\u062C'; - t['\uFC2C'] = '\u063A\u0645'; - t['\uFC2D'] = '\u0641\u062C'; - t['\uFC2E'] = '\u0641\u062D'; - t['\uFC2F'] = '\u0641\u062E'; - t['\uFC30'] = '\u0641\u0645'; - t['\uFC31'] = '\u0641\u0649'; - t['\uFC32'] = '\u0641\u064A'; - t['\uFC33'] = '\u0642\u062D'; - t['\uFC34'] = '\u0642\u0645'; - t['\uFC35'] = '\u0642\u0649'; - t['\uFC36'] = '\u0642\u064A'; - t['\uFC37'] = '\u0643\u0627'; - t['\uFC38'] = '\u0643\u062C'; - t['\uFC39'] = '\u0643\u062D'; - t['\uFC3A'] = '\u0643\u062E'; - t['\uFC3B'] = '\u0643\u0644'; - t['\uFC3C'] = '\u0643\u0645'; - t['\uFC3D'] = '\u0643\u0649'; - t['\uFC3E'] = '\u0643\u064A'; - t['\uFC3F'] = '\u0644\u062C'; - t['\uFC40'] = '\u0644\u062D'; - t['\uFC41'] = '\u0644\u062E'; - t['\uFC42'] = '\u0644\u0645'; - t['\uFC43'] = '\u0644\u0649'; - t['\uFC44'] = '\u0644\u064A'; - t['\uFC45'] = '\u0645\u062C'; - t['\uFC46'] = '\u0645\u062D'; - t['\uFC47'] = '\u0645\u062E'; - t['\uFC48'] = '\u0645\u0645'; - t['\uFC49'] = '\u0645\u0649'; - t['\uFC4A'] = '\u0645\u064A'; - t['\uFC4B'] = '\u0646\u062C'; - t['\uFC4C'] = '\u0646\u062D'; - t['\uFC4D'] = '\u0646\u062E'; - t['\uFC4E'] = '\u0646\u0645'; - t['\uFC4F'] = '\u0646\u0649'; - t['\uFC50'] = '\u0646\u064A'; - t['\uFC51'] = '\u0647\u062C'; - t['\uFC52'] = '\u0647\u0645'; - t['\uFC53'] = '\u0647\u0649'; - t['\uFC54'] = '\u0647\u064A'; - t['\uFC55'] = '\u064A\u062C'; - t['\uFC56'] = '\u064A\u062D'; - t['\uFC57'] = '\u064A\u062E'; - t['\uFC58'] = '\u064A\u0645'; - t['\uFC59'] = '\u064A\u0649'; - t['\uFC5A'] = '\u064A\u064A'; - t['\uFC5B'] = '\u0630\u0670'; - t['\uFC5C'] = '\u0631\u0670'; - t['\uFC5D'] = '\u0649\u0670'; - t['\uFC5E'] = '\u0020\u064C\u0651'; - t['\uFC5F'] = '\u0020\u064D\u0651'; - t['\uFC60'] = '\u0020\u064E\u0651'; - t['\uFC61'] = '\u0020\u064F\u0651'; - t['\uFC62'] = '\u0020\u0650\u0651'; - t['\uFC63'] = '\u0020\u0651\u0670'; - t['\uFC64'] = '\u0626\u0631'; - t['\uFC65'] = '\u0626\u0632'; - t['\uFC66'] = '\u0626\u0645'; - t['\uFC67'] = '\u0626\u0646'; - t['\uFC68'] = '\u0626\u0649'; - t['\uFC69'] = '\u0626\u064A'; - t['\uFC6A'] = '\u0628\u0631'; - t['\uFC6B'] = '\u0628\u0632'; - t['\uFC6C'] = '\u0628\u0645'; - t['\uFC6D'] = '\u0628\u0646'; - t['\uFC6E'] = '\u0628\u0649'; - t['\uFC6F'] = '\u0628\u064A'; - t['\uFC70'] = '\u062A\u0631'; - t['\uFC71'] = '\u062A\u0632'; - t['\uFC72'] = '\u062A\u0645'; - t['\uFC73'] = '\u062A\u0646'; - t['\uFC74'] = '\u062A\u0649'; - t['\uFC75'] = '\u062A\u064A'; - t['\uFC76'] = '\u062B\u0631'; - t['\uFC77'] = '\u062B\u0632'; - t['\uFC78'] = '\u062B\u0645'; - t['\uFC79'] = '\u062B\u0646'; - t['\uFC7A'] = '\u062B\u0649'; - t['\uFC7B'] = '\u062B\u064A'; - t['\uFC7C'] = '\u0641\u0649'; - t['\uFC7D'] = '\u0641\u064A'; - t['\uFC7E'] = '\u0642\u0649'; - t['\uFC7F'] = '\u0642\u064A'; - t['\uFC80'] = '\u0643\u0627'; - t['\uFC81'] = '\u0643\u0644'; - t['\uFC82'] = '\u0643\u0645'; - t['\uFC83'] = '\u0643\u0649'; - t['\uFC84'] = '\u0643\u064A'; - t['\uFC85'] = '\u0644\u0645'; - t['\uFC86'] = '\u0644\u0649'; - t['\uFC87'] = '\u0644\u064A'; - t['\uFC88'] = '\u0645\u0627'; - t['\uFC89'] = '\u0645\u0645'; - t['\uFC8A'] = '\u0646\u0631'; - t['\uFC8B'] = '\u0646\u0632'; - t['\uFC8C'] = '\u0646\u0645'; - t['\uFC8D'] = '\u0646\u0646'; - t['\uFC8E'] = '\u0646\u0649'; - t['\uFC8F'] = '\u0646\u064A'; - t['\uFC90'] = '\u0649\u0670'; - t['\uFC91'] = '\u064A\u0631'; - t['\uFC92'] = '\u064A\u0632'; - t['\uFC93'] = '\u064A\u0645'; - t['\uFC94'] = '\u064A\u0646'; - t['\uFC95'] = '\u064A\u0649'; - t['\uFC96'] = '\u064A\u064A'; - t['\uFC97'] = '\u0626\u062C'; - t['\uFC98'] = '\u0626\u062D'; - t['\uFC99'] = '\u0626\u062E'; - t['\uFC9A'] = '\u0626\u0645'; - t['\uFC9B'] = '\u0626\u0647'; - t['\uFC9C'] = '\u0628\u062C'; - t['\uFC9D'] = '\u0628\u062D'; - t['\uFC9E'] = '\u0628\u062E'; - t['\uFC9F'] = '\u0628\u0645'; - t['\uFCA0'] = '\u0628\u0647'; - t['\uFCA1'] = '\u062A\u062C'; - t['\uFCA2'] = '\u062A\u062D'; - t['\uFCA3'] = '\u062A\u062E'; - t['\uFCA4'] = '\u062A\u0645'; - t['\uFCA5'] = '\u062A\u0647'; - t['\uFCA6'] = '\u062B\u0645'; - t['\uFCA7'] = '\u062C\u062D'; - t['\uFCA8'] = '\u062C\u0645'; - t['\uFCA9'] = '\u062D\u062C'; - t['\uFCAA'] = '\u062D\u0645'; - t['\uFCAB'] = '\u062E\u062C'; - t['\uFCAC'] = '\u062E\u0645'; - t['\uFCAD'] = '\u0633\u062C'; - t['\uFCAE'] = '\u0633\u062D'; - t['\uFCAF'] = '\u0633\u062E'; - t['\uFCB0'] = '\u0633\u0645'; - t['\uFCB1'] = '\u0635\u062D'; - t['\uFCB2'] = '\u0635\u062E'; - t['\uFCB3'] = '\u0635\u0645'; - t['\uFCB4'] = '\u0636\u062C'; - t['\uFCB5'] = '\u0636\u062D'; - t['\uFCB6'] = '\u0636\u062E'; - t['\uFCB7'] = '\u0636\u0645'; - t['\uFCB8'] = '\u0637\u062D'; - t['\uFCB9'] = '\u0638\u0645'; - t['\uFCBA'] = '\u0639\u062C'; - t['\uFCBB'] = '\u0639\u0645'; - t['\uFCBC'] = '\u063A\u062C'; - t['\uFCBD'] = '\u063A\u0645'; - t['\uFCBE'] = '\u0641\u062C'; - t['\uFCBF'] = '\u0641\u062D'; - t['\uFCC0'] = '\u0641\u062E'; - t['\uFCC1'] = '\u0641\u0645'; - t['\uFCC2'] = '\u0642\u062D'; - t['\uFCC3'] = '\u0642\u0645'; - t['\uFCC4'] = '\u0643\u062C'; - t['\uFCC5'] = '\u0643\u062D'; - t['\uFCC6'] = '\u0643\u062E'; - t['\uFCC7'] = '\u0643\u0644'; - t['\uFCC8'] = '\u0643\u0645'; - t['\uFCC9'] = '\u0644\u062C'; - t['\uFCCA'] = '\u0644\u062D'; - t['\uFCCB'] = '\u0644\u062E'; - t['\uFCCC'] = '\u0644\u0645'; - t['\uFCCD'] = '\u0644\u0647'; - t['\uFCCE'] = '\u0645\u062C'; - t['\uFCCF'] = '\u0645\u062D'; - t['\uFCD0'] = '\u0645\u062E'; - t['\uFCD1'] = '\u0645\u0645'; - t['\uFCD2'] = '\u0646\u062C'; - t['\uFCD3'] = '\u0646\u062D'; - t['\uFCD4'] = '\u0646\u062E'; - t['\uFCD5'] = '\u0646\u0645'; - t['\uFCD6'] = '\u0646\u0647'; - t['\uFCD7'] = '\u0647\u062C'; - t['\uFCD8'] = '\u0647\u0645'; - t['\uFCD9'] = '\u0647\u0670'; - t['\uFCDA'] = '\u064A\u062C'; - t['\uFCDB'] = '\u064A\u062D'; - t['\uFCDC'] = '\u064A\u062E'; - t['\uFCDD'] = '\u064A\u0645'; - t['\uFCDE'] = '\u064A\u0647'; - t['\uFCDF'] = '\u0626\u0645'; - t['\uFCE0'] = '\u0626\u0647'; - t['\uFCE1'] = '\u0628\u0645'; - t['\uFCE2'] = '\u0628\u0647'; - t['\uFCE3'] = '\u062A\u0645'; - t['\uFCE4'] = '\u062A\u0647'; - t['\uFCE5'] = '\u062B\u0645'; - t['\uFCE6'] = '\u062B\u0647'; - t['\uFCE7'] = '\u0633\u0645'; - t['\uFCE8'] = '\u0633\u0647'; - t['\uFCE9'] = '\u0634\u0645'; - t['\uFCEA'] = '\u0634\u0647'; - t['\uFCEB'] = '\u0643\u0644'; - t['\uFCEC'] = '\u0643\u0645'; - t['\uFCED'] = '\u0644\u0645'; - t['\uFCEE'] = '\u0646\u0645'; - t['\uFCEF'] = '\u0646\u0647'; - t['\uFCF0'] = '\u064A\u0645'; - t['\uFCF1'] = '\u064A\u0647'; - t['\uFCF2'] = '\u0640\u064E\u0651'; - t['\uFCF3'] = '\u0640\u064F\u0651'; - t['\uFCF4'] = '\u0640\u0650\u0651'; - t['\uFCF5'] = '\u0637\u0649'; - t['\uFCF6'] = '\u0637\u064A'; - t['\uFCF7'] = '\u0639\u0649'; - t['\uFCF8'] = '\u0639\u064A'; - t['\uFCF9'] = '\u063A\u0649'; - t['\uFCFA'] = '\u063A\u064A'; - t['\uFCFB'] = '\u0633\u0649'; - t['\uFCFC'] = '\u0633\u064A'; - t['\uFCFD'] = '\u0634\u0649'; - t['\uFCFE'] = '\u0634\u064A'; - t['\uFCFF'] = '\u062D\u0649'; - t['\uFD00'] = '\u062D\u064A'; - t['\uFD01'] = '\u062C\u0649'; - t['\uFD02'] = '\u062C\u064A'; - t['\uFD03'] = '\u062E\u0649'; - t['\uFD04'] = '\u062E\u064A'; - t['\uFD05'] = '\u0635\u0649'; - t['\uFD06'] = '\u0635\u064A'; - t['\uFD07'] = '\u0636\u0649'; - t['\uFD08'] = '\u0636\u064A'; - t['\uFD09'] = '\u0634\u062C'; - t['\uFD0A'] = '\u0634\u062D'; - t['\uFD0B'] = '\u0634\u062E'; - t['\uFD0C'] = '\u0634\u0645'; - t['\uFD0D'] = '\u0634\u0631'; - t['\uFD0E'] = '\u0633\u0631'; - t['\uFD0F'] = '\u0635\u0631'; - t['\uFD10'] = '\u0636\u0631'; - t['\uFD11'] = '\u0637\u0649'; - t['\uFD12'] = '\u0637\u064A'; - t['\uFD13'] = '\u0639\u0649'; - t['\uFD14'] = '\u0639\u064A'; - t['\uFD15'] = '\u063A\u0649'; - t['\uFD16'] = '\u063A\u064A'; - t['\uFD17'] = '\u0633\u0649'; - t['\uFD18'] = '\u0633\u064A'; - t['\uFD19'] = '\u0634\u0649'; - t['\uFD1A'] = '\u0634\u064A'; - t['\uFD1B'] = '\u062D\u0649'; - t['\uFD1C'] = '\u062D\u064A'; - t['\uFD1D'] = '\u062C\u0649'; - t['\uFD1E'] = '\u062C\u064A'; - t['\uFD1F'] = '\u062E\u0649'; - t['\uFD20'] = '\u062E\u064A'; - t['\uFD21'] = '\u0635\u0649'; - t['\uFD22'] = '\u0635\u064A'; - t['\uFD23'] = '\u0636\u0649'; - t['\uFD24'] = '\u0636\u064A'; - t['\uFD25'] = '\u0634\u062C'; - t['\uFD26'] = '\u0634\u062D'; - t['\uFD27'] = '\u0634\u062E'; - t['\uFD28'] = '\u0634\u0645'; - t['\uFD29'] = '\u0634\u0631'; - t['\uFD2A'] = '\u0633\u0631'; - t['\uFD2B'] = '\u0635\u0631'; - t['\uFD2C'] = '\u0636\u0631'; - t['\uFD2D'] = '\u0634\u062C'; - t['\uFD2E'] = '\u0634\u062D'; - t['\uFD2F'] = '\u0634\u062E'; - t['\uFD30'] = '\u0634\u0645'; - t['\uFD31'] = '\u0633\u0647'; - t['\uFD32'] = '\u0634\u0647'; - t['\uFD33'] = '\u0637\u0645'; - t['\uFD34'] = '\u0633\u062C'; - t['\uFD35'] = '\u0633\u062D'; - t['\uFD36'] = '\u0633\u062E'; - t['\uFD37'] = '\u0634\u062C'; - t['\uFD38'] = '\u0634\u062D'; - t['\uFD39'] = '\u0634\u062E'; - t['\uFD3A'] = '\u0637\u0645'; - t['\uFD3B'] = '\u0638\u0645'; - t['\uFD3C'] = '\u0627\u064B'; - t['\uFD3D'] = '\u0627\u064B'; - t['\uFD50'] = '\u062A\u062C\u0645'; - t['\uFD51'] = '\u062A\u062D\u062C'; - t['\uFD52'] = '\u062A\u062D\u062C'; - t['\uFD53'] = '\u062A\u062D\u0645'; - t['\uFD54'] = '\u062A\u062E\u0645'; - t['\uFD55'] = '\u062A\u0645\u062C'; - t['\uFD56'] = '\u062A\u0645\u062D'; - t['\uFD57'] = '\u062A\u0645\u062E'; - t['\uFD58'] = '\u062C\u0645\u062D'; - t['\uFD59'] = '\u062C\u0645\u062D'; - t['\uFD5A'] = '\u062D\u0645\u064A'; - t['\uFD5B'] = '\u062D\u0645\u0649'; - t['\uFD5C'] = '\u0633\u062D\u062C'; - t['\uFD5D'] = '\u0633\u062C\u062D'; - t['\uFD5E'] = '\u0633\u062C\u0649'; - t['\uFD5F'] = '\u0633\u0645\u062D'; - t['\uFD60'] = '\u0633\u0645\u062D'; - t['\uFD61'] = '\u0633\u0645\u062C'; - t['\uFD62'] = '\u0633\u0645\u0645'; - t['\uFD63'] = '\u0633\u0645\u0645'; - t['\uFD64'] = '\u0635\u062D\u062D'; - t['\uFD65'] = '\u0635\u062D\u062D'; - t['\uFD66'] = '\u0635\u0645\u0645'; - t['\uFD67'] = '\u0634\u062D\u0645'; - t['\uFD68'] = '\u0634\u062D\u0645'; - t['\uFD69'] = '\u0634\u062C\u064A'; - t['\uFD6A'] = '\u0634\u0645\u062E'; - t['\uFD6B'] = '\u0634\u0645\u062E'; - t['\uFD6C'] = '\u0634\u0645\u0645'; - t['\uFD6D'] = '\u0634\u0645\u0645'; - t['\uFD6E'] = '\u0636\u062D\u0649'; - t['\uFD6F'] = '\u0636\u062E\u0645'; - t['\uFD70'] = '\u0636\u062E\u0645'; - t['\uFD71'] = '\u0637\u0645\u062D'; - t['\uFD72'] = '\u0637\u0645\u062D'; - t['\uFD73'] = '\u0637\u0645\u0645'; - t['\uFD74'] = '\u0637\u0645\u064A'; - t['\uFD75'] = '\u0639\u062C\u0645'; - t['\uFD76'] = '\u0639\u0645\u0645'; - t['\uFD77'] = '\u0639\u0645\u0645'; - t['\uFD78'] = '\u0639\u0645\u0649'; - t['\uFD79'] = '\u063A\u0645\u0645'; - t['\uFD7A'] = '\u063A\u0645\u064A'; - t['\uFD7B'] = '\u063A\u0645\u0649'; - t['\uFD7C'] = '\u0641\u062E\u0645'; - t['\uFD7D'] = '\u0641\u062E\u0645'; - t['\uFD7E'] = '\u0642\u0645\u062D'; - t['\uFD7F'] = '\u0642\u0645\u0645'; - t['\uFD80'] = '\u0644\u062D\u0645'; - t['\uFD81'] = '\u0644\u062D\u064A'; - t['\uFD82'] = '\u0644\u062D\u0649'; - t['\uFD83'] = '\u0644\u062C\u062C'; - t['\uFD84'] = '\u0644\u062C\u062C'; - t['\uFD85'] = '\u0644\u062E\u0645'; - t['\uFD86'] = '\u0644\u062E\u0645'; - t['\uFD87'] = '\u0644\u0645\u062D'; - t['\uFD88'] = '\u0644\u0645\u062D'; - t['\uFD89'] = '\u0645\u062D\u062C'; - t['\uFD8A'] = '\u0645\u062D\u0645'; - t['\uFD8B'] = '\u0645\u062D\u064A'; - t['\uFD8C'] = '\u0645\u062C\u062D'; - t['\uFD8D'] = '\u0645\u062C\u0645'; - t['\uFD8E'] = '\u0645\u062E\u062C'; - t['\uFD8F'] = '\u0645\u062E\u0645'; - t['\uFD92'] = '\u0645\u062C\u062E'; - t['\uFD93'] = '\u0647\u0645\u062C'; - t['\uFD94'] = '\u0647\u0645\u0645'; - t['\uFD95'] = '\u0646\u062D\u0645'; - t['\uFD96'] = '\u0646\u062D\u0649'; - t['\uFD97'] = '\u0646\u062C\u0645'; - t['\uFD98'] = '\u0646\u062C\u0645'; - t['\uFD99'] = '\u0646\u062C\u0649'; - t['\uFD9A'] = '\u0646\u0645\u064A'; - t['\uFD9B'] = '\u0646\u0645\u0649'; - t['\uFD9C'] = '\u064A\u0645\u0645'; - t['\uFD9D'] = '\u064A\u0645\u0645'; - t['\uFD9E'] = '\u0628\u062E\u064A'; - t['\uFD9F'] = '\u062A\u062C\u064A'; - t['\uFDA0'] = '\u062A\u062C\u0649'; - t['\uFDA1'] = '\u062A\u062E\u064A'; - t['\uFDA2'] = '\u062A\u062E\u0649'; - t['\uFDA3'] = '\u062A\u0645\u064A'; - t['\uFDA4'] = '\u062A\u0645\u0649'; - t['\uFDA5'] = '\u062C\u0645\u064A'; - t['\uFDA6'] = '\u062C\u062D\u0649'; - t['\uFDA7'] = '\u062C\u0645\u0649'; - t['\uFDA8'] = '\u0633\u062E\u0649'; - t['\uFDA9'] = '\u0635\u062D\u064A'; - t['\uFDAA'] = '\u0634\u062D\u064A'; - t['\uFDAB'] = '\u0636\u062D\u064A'; - t['\uFDAC'] = '\u0644\u062C\u064A'; - t['\uFDAD'] = '\u0644\u0645\u064A'; - t['\uFDAE'] = '\u064A\u062D\u064A'; - t['\uFDAF'] = '\u064A\u062C\u064A'; - t['\uFDB0'] = '\u064A\u0645\u064A'; - t['\uFDB1'] = '\u0645\u0645\u064A'; - t['\uFDB2'] = '\u0642\u0645\u064A'; - t['\uFDB3'] = '\u0646\u062D\u064A'; - t['\uFDB4'] = '\u0642\u0645\u062D'; - t['\uFDB5'] = '\u0644\u062D\u0645'; - t['\uFDB6'] = '\u0639\u0645\u064A'; - t['\uFDB7'] = '\u0643\u0645\u064A'; - t['\uFDB8'] = '\u0646\u062C\u062D'; - t['\uFDB9'] = '\u0645\u062E\u064A'; - t['\uFDBA'] = '\u0644\u062C\u0645'; - t['\uFDBB'] = '\u0643\u0645\u0645'; - t['\uFDBC'] = '\u0644\u062C\u0645'; - t['\uFDBD'] = '\u0646\u062C\u062D'; - t['\uFDBE'] = '\u062C\u062D\u064A'; - t['\uFDBF'] = '\u062D\u062C\u064A'; - t['\uFDC0'] = '\u0645\u062C\u064A'; - t['\uFDC1'] = '\u0641\u0645\u064A'; - t['\uFDC2'] = '\u0628\u062D\u064A'; - t['\uFDC3'] = '\u0643\u0645\u0645'; - t['\uFDC4'] = '\u0639\u062C\u0645'; - t['\uFDC5'] = '\u0635\u0645\u0645'; - t['\uFDC6'] = '\u0633\u062E\u064A'; - t['\uFDC7'] = '\u0646\u062C\u064A'; - t['\uFE49'] = '\u203E'; - t['\uFE4A'] = '\u203E'; - t['\uFE4B'] = '\u203E'; - t['\uFE4C'] = '\u203E'; - t['\uFE4D'] = '\u005F'; - t['\uFE4E'] = '\u005F'; - t['\uFE4F'] = '\u005F'; - t['\uFE80'] = '\u0621'; - t['\uFE81'] = '\u0622'; - t['\uFE82'] = '\u0622'; - t['\uFE83'] = '\u0623'; - t['\uFE84'] = '\u0623'; - t['\uFE85'] = '\u0624'; - t['\uFE86'] = '\u0624'; - t['\uFE87'] = '\u0625'; - t['\uFE88'] = '\u0625'; - t['\uFE89'] = '\u0626'; - t['\uFE8A'] = '\u0626'; - t['\uFE8B'] = '\u0626'; - t['\uFE8C'] = '\u0626'; - t['\uFE8D'] = '\u0627'; - t['\uFE8E'] = '\u0627'; - t['\uFE8F'] = '\u0628'; - t['\uFE90'] = '\u0628'; - t['\uFE91'] = '\u0628'; - t['\uFE92'] = '\u0628'; - t['\uFE93'] = '\u0629'; - t['\uFE94'] = '\u0629'; - t['\uFE95'] = '\u062A'; - t['\uFE96'] = '\u062A'; - t['\uFE97'] = '\u062A'; - t['\uFE98'] = '\u062A'; - t['\uFE99'] = '\u062B'; - t['\uFE9A'] = '\u062B'; - t['\uFE9B'] = '\u062B'; - t['\uFE9C'] = '\u062B'; - t['\uFE9D'] = '\u062C'; - t['\uFE9E'] = '\u062C'; - t['\uFE9F'] = '\u062C'; - t['\uFEA0'] = '\u062C'; - t['\uFEA1'] = '\u062D'; - t['\uFEA2'] = '\u062D'; - t['\uFEA3'] = '\u062D'; - t['\uFEA4'] = '\u062D'; - t['\uFEA5'] = '\u062E'; - t['\uFEA6'] = '\u062E'; - t['\uFEA7'] = '\u062E'; - t['\uFEA8'] = '\u062E'; - t['\uFEA9'] = '\u062F'; - t['\uFEAA'] = '\u062F'; - t['\uFEAB'] = '\u0630'; - t['\uFEAC'] = '\u0630'; - t['\uFEAD'] = '\u0631'; - t['\uFEAE'] = '\u0631'; - t['\uFEAF'] = '\u0632'; - t['\uFEB0'] = '\u0632'; - t['\uFEB1'] = '\u0633'; - t['\uFEB2'] = '\u0633'; - t['\uFEB3'] = '\u0633'; - t['\uFEB4'] = '\u0633'; - t['\uFEB5'] = '\u0634'; - t['\uFEB6'] = '\u0634'; - t['\uFEB7'] = '\u0634'; - t['\uFEB8'] = '\u0634'; - t['\uFEB9'] = '\u0635'; - t['\uFEBA'] = '\u0635'; - t['\uFEBB'] = '\u0635'; - t['\uFEBC'] = '\u0635'; - t['\uFEBD'] = '\u0636'; - t['\uFEBE'] = '\u0636'; - t['\uFEBF'] = '\u0636'; - t['\uFEC0'] = '\u0636'; - t['\uFEC1'] = '\u0637'; - t['\uFEC2'] = '\u0637'; - t['\uFEC3'] = '\u0637'; - t['\uFEC4'] = '\u0637'; - t['\uFEC5'] = '\u0638'; - t['\uFEC6'] = '\u0638'; - t['\uFEC7'] = '\u0638'; - t['\uFEC8'] = '\u0638'; - t['\uFEC9'] = '\u0639'; - t['\uFECA'] = '\u0639'; - t['\uFECB'] = '\u0639'; - t['\uFECC'] = '\u0639'; - t['\uFECD'] = '\u063A'; - t['\uFECE'] = '\u063A'; - t['\uFECF'] = '\u063A'; - t['\uFED0'] = '\u063A'; - t['\uFED1'] = '\u0641'; - t['\uFED2'] = '\u0641'; - t['\uFED3'] = '\u0641'; - t['\uFED4'] = '\u0641'; - t['\uFED5'] = '\u0642'; - t['\uFED6'] = '\u0642'; - t['\uFED7'] = '\u0642'; - t['\uFED8'] = '\u0642'; - t['\uFED9'] = '\u0643'; - t['\uFEDA'] = '\u0643'; - t['\uFEDB'] = '\u0643'; - t['\uFEDC'] = '\u0643'; - t['\uFEDD'] = '\u0644'; - t['\uFEDE'] = '\u0644'; - t['\uFEDF'] = '\u0644'; - t['\uFEE0'] = '\u0644'; - t['\uFEE1'] = '\u0645'; - t['\uFEE2'] = '\u0645'; - t['\uFEE3'] = '\u0645'; - t['\uFEE4'] = '\u0645'; - t['\uFEE5'] = '\u0646'; - t['\uFEE6'] = '\u0646'; - t['\uFEE7'] = '\u0646'; - t['\uFEE8'] = '\u0646'; - t['\uFEE9'] = '\u0647'; - t['\uFEEA'] = '\u0647'; - t['\uFEEB'] = '\u0647'; - t['\uFEEC'] = '\u0647'; - t['\uFEED'] = '\u0648'; - t['\uFEEE'] = '\u0648'; - t['\uFEEF'] = '\u0649'; - t['\uFEF0'] = '\u0649'; - t['\uFEF1'] = '\u064A'; - t['\uFEF2'] = '\u064A'; - t['\uFEF3'] = '\u064A'; - t['\uFEF4'] = '\u064A'; - t['\uFEF5'] = '\u0644\u0622'; - t['\uFEF6'] = '\u0644\u0622'; - t['\uFEF7'] = '\u0644\u0623'; - t['\uFEF8'] = '\u0644\u0623'; - t['\uFEF9'] = '\u0644\u0625'; - t['\uFEFA'] = '\u0644\u0625'; - t['\uFEFB'] = '\u0644\u0627'; - t['\uFEFC'] = '\u0644\u0627'; - }); - - function reverseIfRtl(chars) { - var charsLength = chars.length; - //reverse an arabic ligature - if (charsLength <= 1 || !isRTLRangeFor(chars.charCodeAt(0))) { - return chars; - } - var s = ''; - for (var ii = charsLength - 1; ii >= 0; ii--) { - s += chars[ii]; - } - return s; - } - - exports.mapSpecialUnicodeValues = mapSpecialUnicodeValues; - exports.reverseIfRtl = reverseIfRtl; - exports.getUnicodeRangeFor = getUnicodeRangeFor; - exports.getNormalizedUnicodes = getNormalizedUnicodes; - exports.getUnicodeForGlyph = getUnicodeForGlyph; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreStream = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreJbig2, root.pdfjsCoreJpg, - root.pdfjsCoreJpx); - } -}(this, function (exports, sharedUtil, corePrimitives, coreJbig2, coreJpg, - coreJpx) { - -var Util = sharedUtil.Util; -var error = sharedUtil.error; -var info = sharedUtil.info; -var isInt = sharedUtil.isInt; -var isArray = sharedUtil.isArray; -var createObjectURL = sharedUtil.createObjectURL; -var shadow = sharedUtil.shadow; -var warn = sharedUtil.warn; -var isSpace = sharedUtil.isSpace; -var Dict = corePrimitives.Dict; -var isDict = corePrimitives.isDict; -var Jbig2Image = coreJbig2.Jbig2Image; -var JpegImage = coreJpg.JpegImage; -var JpxImage = coreJpx.JpxImage; - -var Stream = (function StreamClosure() { - function Stream(arrayBuffer, start, length, dict) { - this.bytes = (arrayBuffer instanceof Uint8Array ? - arrayBuffer : new Uint8Array(arrayBuffer)); - this.start = start || 0; - this.pos = this.start; - this.end = (start + length) || this.bytes.length; - this.dict = dict; - } - - // required methods for a stream. if a particular stream does not - // implement these, an error should be thrown - Stream.prototype = { - get length() { - return this.end - this.start; - }, - get isEmpty() { - return this.length === 0; - }, - getByte: function Stream_getByte() { - if (this.pos >= this.end) { - return -1; - } - return this.bytes[this.pos++]; - }, - getUint16: function Stream_getUint16() { - var b0 = this.getByte(); - var b1 = this.getByte(); - if (b0 === -1 || b1 === -1) { - return -1; - } - return (b0 << 8) + b1; - }, - getInt32: function Stream_getInt32() { - var b0 = this.getByte(); - var b1 = this.getByte(); - var b2 = this.getByte(); - var b3 = this.getByte(); - return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; - }, - // returns subarray of original buffer - // should only be read - getBytes: function Stream_getBytes(length) { - var bytes = this.bytes; - var pos = this.pos; - var strEnd = this.end; - - if (!length) { - return bytes.subarray(pos, strEnd); - } - var end = pos + length; - if (end > strEnd) { - end = strEnd; - } - this.pos = end; - return bytes.subarray(pos, end); - }, - peekByte: function Stream_peekByte() { - var peekedByte = this.getByte(); - this.pos--; - return peekedByte; - }, - peekBytes: function Stream_peekBytes(length) { - var bytes = this.getBytes(length); - this.pos -= bytes.length; - return bytes; - }, - skip: function Stream_skip(n) { - if (!n) { - n = 1; - } - this.pos += n; - }, - reset: function Stream_reset() { - this.pos = this.start; - }, - moveStart: function Stream_moveStart() { - this.start = this.pos; - }, - makeSubStream: function Stream_makeSubStream(start, length, dict) { - return new Stream(this.bytes.buffer, start, length, dict); - }, - isStream: true - }; - - return Stream; -})(); - -var StringStream = (function StringStreamClosure() { - function StringStream(str) { - var length = str.length; - var bytes = new Uint8Array(length); - for (var n = 0; n < length; ++n) { - bytes[n] = str.charCodeAt(n); - } - Stream.call(this, bytes); - } - - StringStream.prototype = Stream.prototype; - - return StringStream; -})(); - -// super class for the decoding streams -var DecodeStream = (function DecodeStreamClosure() { - // Lots of DecodeStreams are created whose buffers are never used. For these - // we share a single empty buffer. This is (a) space-efficient and (b) avoids - // having special cases that would be required if we used |null| for an empty - // buffer. - var emptyBuffer = new Uint8Array(0); - - function DecodeStream(maybeMinBufferLength) { - this.pos = 0; - this.bufferLength = 0; - this.eof = false; - this.buffer = emptyBuffer; - this.minBufferLength = 512; - if (maybeMinBufferLength) { - // Compute the first power of two that is as big as maybeMinBufferLength. - while (this.minBufferLength < maybeMinBufferLength) { - this.minBufferLength *= 2; - } - } - } - - DecodeStream.prototype = { - get isEmpty() { - while (!this.eof && this.bufferLength === 0) { - this.readBlock(); - } - return this.bufferLength === 0; - }, - ensureBuffer: function DecodeStream_ensureBuffer(requested) { - var buffer = this.buffer; - if (requested <= buffer.byteLength) { - return buffer; - } - var size = this.minBufferLength; - while (size < requested) { - size *= 2; - } - var buffer2 = new Uint8Array(size); - buffer2.set(buffer); - return (this.buffer = buffer2); - }, - getByte: function DecodeStream_getByte() { - var pos = this.pos; - while (this.bufferLength <= pos) { - if (this.eof) { - return -1; - } - this.readBlock(); - } - return this.buffer[this.pos++]; - }, - getUint16: function DecodeStream_getUint16() { - var b0 = this.getByte(); - var b1 = this.getByte(); - if (b0 === -1 || b1 === -1) { - return -1; - } - return (b0 << 8) + b1; - }, - getInt32: function DecodeStream_getInt32() { - var b0 = this.getByte(); - var b1 = this.getByte(); - var b2 = this.getByte(); - var b3 = this.getByte(); - return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; - }, - getBytes: function DecodeStream_getBytes(length) { - var end, pos = this.pos; - - if (length) { - this.ensureBuffer(pos + length); - end = pos + length; - - while (!this.eof && this.bufferLength < end) { - this.readBlock(); - } - var bufEnd = this.bufferLength; - if (end > bufEnd) { - end = bufEnd; - } - } else { - while (!this.eof) { - this.readBlock(); - } - end = this.bufferLength; - } - - this.pos = end; - return this.buffer.subarray(pos, end); - }, - peekByte: function DecodeStream_peekByte() { - var peekedByte = this.getByte(); - this.pos--; - return peekedByte; - }, - peekBytes: function DecodeStream_peekBytes(length) { - var bytes = this.getBytes(length); - this.pos -= bytes.length; - return bytes; - }, - makeSubStream: function DecodeStream_makeSubStream(start, length, dict) { - var end = start + length; - while (this.bufferLength <= end && !this.eof) { - this.readBlock(); - } - return new Stream(this.buffer, start, length, dict); - }, - skip: function DecodeStream_skip(n) { - if (!n) { - n = 1; - } - this.pos += n; - }, - reset: function DecodeStream_reset() { - this.pos = 0; - }, - getBaseStreams: function DecodeStream_getBaseStreams() { - if (this.str && this.str.getBaseStreams) { - return this.str.getBaseStreams(); - } - return []; - } - }; - - return DecodeStream; -})(); - -var StreamsSequenceStream = (function StreamsSequenceStreamClosure() { - function StreamsSequenceStream(streams) { - this.streams = streams; - DecodeStream.call(this, /* maybeLength = */ null); - } - - StreamsSequenceStream.prototype = Object.create(DecodeStream.prototype); - - StreamsSequenceStream.prototype.readBlock = - function streamSequenceStreamReadBlock() { - - var streams = this.streams; - if (streams.length === 0) { - this.eof = true; - return; - } - var stream = streams.shift(); - var chunk = stream.getBytes(); - var bufferLength = this.bufferLength; - var newLength = bufferLength + chunk.length; - var buffer = this.ensureBuffer(newLength); - buffer.set(chunk, bufferLength); - this.bufferLength = newLength; - }; - - StreamsSequenceStream.prototype.getBaseStreams = - function StreamsSequenceStream_getBaseStreams() { - - var baseStreams = []; - for (var i = 0, ii = this.streams.length; i < ii; i++) { - var stream = this.streams[i]; - if (stream.getBaseStreams) { - Util.appendToArray(baseStreams, stream.getBaseStreams()); - } - } - return baseStreams; - }; - - return StreamsSequenceStream; -})(); - -var FlateStream = (function FlateStreamClosure() { - var codeLenCodeMap = new Int32Array([ - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 - ]); - - var lengthDecode = new Int32Array([ - 0x00003, 0x00004, 0x00005, 0x00006, 0x00007, 0x00008, 0x00009, 0x0000a, - 0x1000b, 0x1000d, 0x1000f, 0x10011, 0x20013, 0x20017, 0x2001b, 0x2001f, - 0x30023, 0x3002b, 0x30033, 0x3003b, 0x40043, 0x40053, 0x40063, 0x40073, - 0x50083, 0x500a3, 0x500c3, 0x500e3, 0x00102, 0x00102, 0x00102 - ]); - - var distDecode = new Int32Array([ - 0x00001, 0x00002, 0x00003, 0x00004, 0x10005, 0x10007, 0x20009, 0x2000d, - 0x30011, 0x30019, 0x40021, 0x40031, 0x50041, 0x50061, 0x60081, 0x600c1, - 0x70101, 0x70181, 0x80201, 0x80301, 0x90401, 0x90601, 0xa0801, 0xa0c01, - 0xb1001, 0xb1801, 0xc2001, 0xc3001, 0xd4001, 0xd6001 - ]); - - var fixedLitCodeTab = [new Int32Array([ - 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c0, - 0x70108, 0x80060, 0x80020, 0x900a0, 0x80000, 0x80080, 0x80040, 0x900e0, - 0x70104, 0x80058, 0x80018, 0x90090, 0x70114, 0x80078, 0x80038, 0x900d0, - 0x7010c, 0x80068, 0x80028, 0x900b0, 0x80008, 0x80088, 0x80048, 0x900f0, - 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c8, - 0x7010a, 0x80064, 0x80024, 0x900a8, 0x80004, 0x80084, 0x80044, 0x900e8, - 0x70106, 0x8005c, 0x8001c, 0x90098, 0x70116, 0x8007c, 0x8003c, 0x900d8, - 0x7010e, 0x8006c, 0x8002c, 0x900b8, 0x8000c, 0x8008c, 0x8004c, 0x900f8, - 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c4, - 0x70109, 0x80062, 0x80022, 0x900a4, 0x80002, 0x80082, 0x80042, 0x900e4, - 0x70105, 0x8005a, 0x8001a, 0x90094, 0x70115, 0x8007a, 0x8003a, 0x900d4, - 0x7010d, 0x8006a, 0x8002a, 0x900b4, 0x8000a, 0x8008a, 0x8004a, 0x900f4, - 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cc, - 0x7010b, 0x80066, 0x80026, 0x900ac, 0x80006, 0x80086, 0x80046, 0x900ec, - 0x70107, 0x8005e, 0x8001e, 0x9009c, 0x70117, 0x8007e, 0x8003e, 0x900dc, - 0x7010f, 0x8006e, 0x8002e, 0x900bc, 0x8000e, 0x8008e, 0x8004e, 0x900fc, - 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c2, - 0x70108, 0x80061, 0x80021, 0x900a2, 0x80001, 0x80081, 0x80041, 0x900e2, - 0x70104, 0x80059, 0x80019, 0x90092, 0x70114, 0x80079, 0x80039, 0x900d2, - 0x7010c, 0x80069, 0x80029, 0x900b2, 0x80009, 0x80089, 0x80049, 0x900f2, - 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900ca, - 0x7010a, 0x80065, 0x80025, 0x900aa, 0x80005, 0x80085, 0x80045, 0x900ea, - 0x70106, 0x8005d, 0x8001d, 0x9009a, 0x70116, 0x8007d, 0x8003d, 0x900da, - 0x7010e, 0x8006d, 0x8002d, 0x900ba, 0x8000d, 0x8008d, 0x8004d, 0x900fa, - 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c6, - 0x70109, 0x80063, 0x80023, 0x900a6, 0x80003, 0x80083, 0x80043, 0x900e6, - 0x70105, 0x8005b, 0x8001b, 0x90096, 0x70115, 0x8007b, 0x8003b, 0x900d6, - 0x7010d, 0x8006b, 0x8002b, 0x900b6, 0x8000b, 0x8008b, 0x8004b, 0x900f6, - 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900ce, - 0x7010b, 0x80067, 0x80027, 0x900ae, 0x80007, 0x80087, 0x80047, 0x900ee, - 0x70107, 0x8005f, 0x8001f, 0x9009e, 0x70117, 0x8007f, 0x8003f, 0x900de, - 0x7010f, 0x8006f, 0x8002f, 0x900be, 0x8000f, 0x8008f, 0x8004f, 0x900fe, - 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c1, - 0x70108, 0x80060, 0x80020, 0x900a1, 0x80000, 0x80080, 0x80040, 0x900e1, - 0x70104, 0x80058, 0x80018, 0x90091, 0x70114, 0x80078, 0x80038, 0x900d1, - 0x7010c, 0x80068, 0x80028, 0x900b1, 0x80008, 0x80088, 0x80048, 0x900f1, - 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c9, - 0x7010a, 0x80064, 0x80024, 0x900a9, 0x80004, 0x80084, 0x80044, 0x900e9, - 0x70106, 0x8005c, 0x8001c, 0x90099, 0x70116, 0x8007c, 0x8003c, 0x900d9, - 0x7010e, 0x8006c, 0x8002c, 0x900b9, 0x8000c, 0x8008c, 0x8004c, 0x900f9, - 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c5, - 0x70109, 0x80062, 0x80022, 0x900a5, 0x80002, 0x80082, 0x80042, 0x900e5, - 0x70105, 0x8005a, 0x8001a, 0x90095, 0x70115, 0x8007a, 0x8003a, 0x900d5, - 0x7010d, 0x8006a, 0x8002a, 0x900b5, 0x8000a, 0x8008a, 0x8004a, 0x900f5, - 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cd, - 0x7010b, 0x80066, 0x80026, 0x900ad, 0x80006, 0x80086, 0x80046, 0x900ed, - 0x70107, 0x8005e, 0x8001e, 0x9009d, 0x70117, 0x8007e, 0x8003e, 0x900dd, - 0x7010f, 0x8006e, 0x8002e, 0x900bd, 0x8000e, 0x8008e, 0x8004e, 0x900fd, - 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c3, - 0x70108, 0x80061, 0x80021, 0x900a3, 0x80001, 0x80081, 0x80041, 0x900e3, - 0x70104, 0x80059, 0x80019, 0x90093, 0x70114, 0x80079, 0x80039, 0x900d3, - 0x7010c, 0x80069, 0x80029, 0x900b3, 0x80009, 0x80089, 0x80049, 0x900f3, - 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900cb, - 0x7010a, 0x80065, 0x80025, 0x900ab, 0x80005, 0x80085, 0x80045, 0x900eb, - 0x70106, 0x8005d, 0x8001d, 0x9009b, 0x70116, 0x8007d, 0x8003d, 0x900db, - 0x7010e, 0x8006d, 0x8002d, 0x900bb, 0x8000d, 0x8008d, 0x8004d, 0x900fb, - 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c7, - 0x70109, 0x80063, 0x80023, 0x900a7, 0x80003, 0x80083, 0x80043, 0x900e7, - 0x70105, 0x8005b, 0x8001b, 0x90097, 0x70115, 0x8007b, 0x8003b, 0x900d7, - 0x7010d, 0x8006b, 0x8002b, 0x900b7, 0x8000b, 0x8008b, 0x8004b, 0x900f7, - 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900cf, - 0x7010b, 0x80067, 0x80027, 0x900af, 0x80007, 0x80087, 0x80047, 0x900ef, - 0x70107, 0x8005f, 0x8001f, 0x9009f, 0x70117, 0x8007f, 0x8003f, 0x900df, - 0x7010f, 0x8006f, 0x8002f, 0x900bf, 0x8000f, 0x8008f, 0x8004f, 0x900ff - ]), 9]; - - var fixedDistCodeTab = [new Int32Array([ - 0x50000, 0x50010, 0x50008, 0x50018, 0x50004, 0x50014, 0x5000c, 0x5001c, - 0x50002, 0x50012, 0x5000a, 0x5001a, 0x50006, 0x50016, 0x5000e, 0x00000, - 0x50001, 0x50011, 0x50009, 0x50019, 0x50005, 0x50015, 0x5000d, 0x5001d, - 0x50003, 0x50013, 0x5000b, 0x5001b, 0x50007, 0x50017, 0x5000f, 0x00000 - ]), 5]; - - function FlateStream(str, maybeLength) { - this.str = str; - this.dict = str.dict; - - var cmf = str.getByte(); - var flg = str.getByte(); - if (cmf === -1 || flg === -1) { - error('Invalid header in flate stream: ' + cmf + ', ' + flg); - } - if ((cmf & 0x0f) !== 0x08) { - error('Unknown compression method in flate stream: ' + cmf + ', ' + flg); - } - if ((((cmf << 8) + flg) % 31) !== 0) { - error('Bad FCHECK in flate stream: ' + cmf + ', ' + flg); - } - if (flg & 0x20) { - error('FDICT bit set in flate stream: ' + cmf + ', ' + flg); - } - - this.codeSize = 0; - this.codeBuf = 0; - - DecodeStream.call(this, maybeLength); - } - - FlateStream.prototype = Object.create(DecodeStream.prototype); - - FlateStream.prototype.getBits = function FlateStream_getBits(bits) { - var str = this.str; - var codeSize = this.codeSize; - var codeBuf = this.codeBuf; - - var b; - while (codeSize < bits) { - if ((b = str.getByte()) === -1) { - error('Bad encoding in flate stream'); - } - codeBuf |= b << codeSize; - codeSize += 8; - } - b = codeBuf & ((1 << bits) - 1); - this.codeBuf = codeBuf >> bits; - this.codeSize = codeSize -= bits; - - return b; - }; - - FlateStream.prototype.getCode = function FlateStream_getCode(table) { - var str = this.str; - var codes = table[0]; - var maxLen = table[1]; - var codeSize = this.codeSize; - var codeBuf = this.codeBuf; - - var b; - while (codeSize < maxLen) { - if ((b = str.getByte()) === -1) { - // premature end of stream. code might however still be valid. - // codeSize < codeLen check below guards against incomplete codeVal. - break; - } - codeBuf |= (b << codeSize); - codeSize += 8; - } - var code = codes[codeBuf & ((1 << maxLen) - 1)]; - var codeLen = code >> 16; - var codeVal = code & 0xffff; - if (codeLen < 1 || codeSize < codeLen) { - error('Bad encoding in flate stream'); - } - this.codeBuf = (codeBuf >> codeLen); - this.codeSize = (codeSize - codeLen); - return codeVal; - }; - - FlateStream.prototype.generateHuffmanTable = - function flateStreamGenerateHuffmanTable(lengths) { - var n = lengths.length; - - // find max code length - var maxLen = 0; - var i; - for (i = 0; i < n; ++i) { - if (lengths[i] > maxLen) { - maxLen = lengths[i]; - } - } - - // build the table - var size = 1 << maxLen; - var codes = new Int32Array(size); - for (var len = 1, code = 0, skip = 2; - len <= maxLen; - ++len, code <<= 1, skip <<= 1) { - for (var val = 0; val < n; ++val) { - if (lengths[val] === len) { - // bit-reverse the code - var code2 = 0; - var t = code; - for (i = 0; i < len; ++i) { - code2 = (code2 << 1) | (t & 1); - t >>= 1; - } - - // fill the table entries - for (i = code2; i < size; i += skip) { - codes[i] = (len << 16) | val; - } - ++code; - } - } - } - - return [codes, maxLen]; - }; - - FlateStream.prototype.readBlock = function FlateStream_readBlock() { - var buffer, len; - var str = this.str; - // read block header - var hdr = this.getBits(3); - if (hdr & 1) { - this.eof = true; - } - hdr >>= 1; - - if (hdr === 0) { // uncompressed block - var b; - - if ((b = str.getByte()) === -1) { - error('Bad block header in flate stream'); - } - var blockLen = b; - if ((b = str.getByte()) === -1) { - error('Bad block header in flate stream'); - } - blockLen |= (b << 8); - if ((b = str.getByte()) === -1) { - error('Bad block header in flate stream'); - } - var check = b; - if ((b = str.getByte()) === -1) { - error('Bad block header in flate stream'); - } - check |= (b << 8); - if (check !== (~blockLen & 0xffff) && - (blockLen !== 0 || check !== 0)) { - // Ignoring error for bad "empty" block (see issue 1277) - error('Bad uncompressed block length in flate stream'); - } - - this.codeBuf = 0; - this.codeSize = 0; - - var bufferLength = this.bufferLength; - buffer = this.ensureBuffer(bufferLength + blockLen); - var end = bufferLength + blockLen; - this.bufferLength = end; - if (blockLen === 0) { - if (str.peekByte() === -1) { - this.eof = true; - } - } else { - for (var n = bufferLength; n < end; ++n) { - if ((b = str.getByte()) === -1) { - this.eof = true; - break; - } - buffer[n] = b; - } - } - return; - } - - var litCodeTable; - var distCodeTable; - if (hdr === 1) { // compressed block, fixed codes - litCodeTable = fixedLitCodeTab; - distCodeTable = fixedDistCodeTab; - } else if (hdr === 2) { // compressed block, dynamic codes - var numLitCodes = this.getBits(5) + 257; - var numDistCodes = this.getBits(5) + 1; - var numCodeLenCodes = this.getBits(4) + 4; - - // build the code lengths code table - var codeLenCodeLengths = new Uint8Array(codeLenCodeMap.length); - - var i; - for (i = 0; i < numCodeLenCodes; ++i) { - codeLenCodeLengths[codeLenCodeMap[i]] = this.getBits(3); - } - var codeLenCodeTab = this.generateHuffmanTable(codeLenCodeLengths); - - // build the literal and distance code tables - len = 0; - i = 0; - var codes = numLitCodes + numDistCodes; - var codeLengths = new Uint8Array(codes); - var bitsLength, bitsOffset, what; - while (i < codes) { - var code = this.getCode(codeLenCodeTab); - if (code === 16) { - bitsLength = 2; bitsOffset = 3; what = len; - } else if (code === 17) { - bitsLength = 3; bitsOffset = 3; what = (len = 0); - } else if (code === 18) { - bitsLength = 7; bitsOffset = 11; what = (len = 0); - } else { - codeLengths[i++] = len = code; - continue; - } - - var repeatLength = this.getBits(bitsLength) + bitsOffset; - while (repeatLength-- > 0) { - codeLengths[i++] = what; - } - } - - litCodeTable = - this.generateHuffmanTable(codeLengths.subarray(0, numLitCodes)); - distCodeTable = - this.generateHuffmanTable(codeLengths.subarray(numLitCodes, codes)); - } else { - error('Unknown block type in flate stream'); - } - - buffer = this.buffer; - var limit = buffer ? buffer.length : 0; - var pos = this.bufferLength; - while (true) { - var code1 = this.getCode(litCodeTable); - if (code1 < 256) { - if (pos + 1 >= limit) { - buffer = this.ensureBuffer(pos + 1); - limit = buffer.length; - } - buffer[pos++] = code1; - continue; - } - if (code1 === 256) { - this.bufferLength = pos; - return; - } - code1 -= 257; - code1 = lengthDecode[code1]; - var code2 = code1 >> 16; - if (code2 > 0) { - code2 = this.getBits(code2); - } - len = (code1 & 0xffff) + code2; - code1 = this.getCode(distCodeTable); - code1 = distDecode[code1]; - code2 = code1 >> 16; - if (code2 > 0) { - code2 = this.getBits(code2); - } - var dist = (code1 & 0xffff) + code2; - if (pos + len >= limit) { - buffer = this.ensureBuffer(pos + len); - limit = buffer.length; - } - for (var k = 0; k < len; ++k, ++pos) { - buffer[pos] = buffer[pos - dist]; - } - } - }; - - return FlateStream; -})(); - -var PredictorStream = (function PredictorStreamClosure() { - function PredictorStream(str, maybeLength, params) { - if (!isDict(params)) { - return str; // no prediction - } - var predictor = this.predictor = params.get('Predictor') || 1; - - if (predictor <= 1) { - return str; // no prediction - } - if (predictor !== 2 && (predictor < 10 || predictor > 15)) { - error('Unsupported predictor: ' + predictor); - } - - if (predictor === 2) { - this.readBlock = this.readBlockTiff; - } else { - this.readBlock = this.readBlockPng; - } - - this.str = str; - this.dict = str.dict; - - var colors = this.colors = params.get('Colors') || 1; - var bits = this.bits = params.get('BitsPerComponent') || 8; - var columns = this.columns = params.get('Columns') || 1; - - this.pixBytes = (colors * bits + 7) >> 3; - this.rowBytes = (columns * colors * bits + 7) >> 3; - - DecodeStream.call(this, maybeLength); - return this; - } - - PredictorStream.prototype = Object.create(DecodeStream.prototype); - - PredictorStream.prototype.readBlockTiff = - function predictorStreamReadBlockTiff() { - var rowBytes = this.rowBytes; - - var bufferLength = this.bufferLength; - var buffer = this.ensureBuffer(bufferLength + rowBytes); - - var bits = this.bits; - var colors = this.colors; - - var rawBytes = this.str.getBytes(rowBytes); - this.eof = !rawBytes.length; - if (this.eof) { - return; - } - - var inbuf = 0, outbuf = 0; - var inbits = 0, outbits = 0; - var pos = bufferLength; - var i; - - if (bits === 1) { - for (i = 0; i < rowBytes; ++i) { - var c = rawBytes[i]; - inbuf = (inbuf << 8) | c; - // bitwise addition is exclusive or - // first shift inbuf and then add - buffer[pos++] = (c ^ (inbuf >> colors)) & 0xFF; - // truncate inbuf (assumes colors < 16) - inbuf &= 0xFFFF; - } - } else if (bits === 8) { - for (i = 0; i < colors; ++i) { - buffer[pos++] = rawBytes[i]; - } - for (; i < rowBytes; ++i) { - buffer[pos] = buffer[pos - colors] + rawBytes[i]; - pos++; - } - } else { - var compArray = new Uint8Array(colors + 1); - var bitMask = (1 << bits) - 1; - var j = 0, k = bufferLength; - var columns = this.columns; - for (i = 0; i < columns; ++i) { - for (var kk = 0; kk < colors; ++kk) { - if (inbits < bits) { - inbuf = (inbuf << 8) | (rawBytes[j++] & 0xFF); - inbits += 8; - } - compArray[kk] = (compArray[kk] + - (inbuf >> (inbits - bits))) & bitMask; - inbits -= bits; - outbuf = (outbuf << bits) | compArray[kk]; - outbits += bits; - if (outbits >= 8) { - buffer[k++] = (outbuf >> (outbits - 8)) & 0xFF; - outbits -= 8; - } - } - } - if (outbits > 0) { - buffer[k++] = (outbuf << (8 - outbits)) + - (inbuf & ((1 << (8 - outbits)) - 1)); - } - } - this.bufferLength += rowBytes; - }; - - PredictorStream.prototype.readBlockPng = - function predictorStreamReadBlockPng() { - - var rowBytes = this.rowBytes; - var pixBytes = this.pixBytes; - - var predictor = this.str.getByte(); - var rawBytes = this.str.getBytes(rowBytes); - this.eof = !rawBytes.length; - if (this.eof) { - return; - } - - var bufferLength = this.bufferLength; - var buffer = this.ensureBuffer(bufferLength + rowBytes); - - var prevRow = buffer.subarray(bufferLength - rowBytes, bufferLength); - if (prevRow.length === 0) { - prevRow = new Uint8Array(rowBytes); - } - - var i, j = bufferLength, up, c; - switch (predictor) { - case 0: - for (i = 0; i < rowBytes; ++i) { - buffer[j++] = rawBytes[i]; - } - break; - case 1: - for (i = 0; i < pixBytes; ++i) { - buffer[j++] = rawBytes[i]; - } - for (; i < rowBytes; ++i) { - buffer[j] = (buffer[j - pixBytes] + rawBytes[i]) & 0xFF; - j++; - } - break; - case 2: - for (i = 0; i < rowBytes; ++i) { - buffer[j++] = (prevRow[i] + rawBytes[i]) & 0xFF; - } - break; - case 3: - for (i = 0; i < pixBytes; ++i) { - buffer[j++] = (prevRow[i] >> 1) + rawBytes[i]; - } - for (; i < rowBytes; ++i) { - buffer[j] = (((prevRow[i] + buffer[j - pixBytes]) >> 1) + - rawBytes[i]) & 0xFF; - j++; - } - break; - case 4: - // we need to save the up left pixels values. the simplest way - // is to create a new buffer - for (i = 0; i < pixBytes; ++i) { - up = prevRow[i]; - c = rawBytes[i]; - buffer[j++] = up + c; - } - for (; i < rowBytes; ++i) { - up = prevRow[i]; - var upLeft = prevRow[i - pixBytes]; - var left = buffer[j - pixBytes]; - var p = left + up - upLeft; - - var pa = p - left; - if (pa < 0) { - pa = -pa; - } - var pb = p - up; - if (pb < 0) { - pb = -pb; - } - var pc = p - upLeft; - if (pc < 0) { - pc = -pc; - } - - c = rawBytes[i]; - if (pa <= pb && pa <= pc) { - buffer[j++] = left + c; - } else if (pb <= pc) { - buffer[j++] = up + c; - } else { - buffer[j++] = upLeft + c; - } - } - break; - default: - error('Unsupported predictor: ' + predictor); - } - this.bufferLength += rowBytes; - }; - - return PredictorStream; -})(); - -/** - * Depending on the type of JPEG a JpegStream is handled in different ways. For - * JPEG's that are supported natively such as DeviceGray and DeviceRGB the image - * data is stored and then loaded by the browser. For unsupported JPEG's we use - * a library to decode these images and the stream behaves like all the other - * DecodeStreams. - */ -var JpegStream = (function JpegStreamClosure() { - function JpegStream(stream, maybeLength, dict) { - // Some images may contain 'junk' before the SOI (start-of-image) marker. - // Note: this seems to mainly affect inline images. - var ch; - while ((ch = stream.getByte()) !== -1) { - if (ch === 0xFF) { // Find the first byte of the SOI marker (0xFFD8). - stream.skip(-1); // Reset the stream position to the SOI. - break; - } - } - this.stream = stream; - this.maybeLength = maybeLength; - this.dict = dict; - - DecodeStream.call(this, maybeLength); - } - - JpegStream.prototype = Object.create(DecodeStream.prototype); - - Object.defineProperty(JpegStream.prototype, 'bytes', { - get: function JpegStream_bytes() { - // If this.maybeLength is null, we'll get the entire stream. - return shadow(this, 'bytes', this.stream.getBytes(this.maybeLength)); - }, - configurable: true - }); - - JpegStream.prototype.ensureBuffer = function JpegStream_ensureBuffer(req) { - if (this.bufferLength) { - return; - } - var jpegImage = new JpegImage(); - - // Checking if values need to be transformed before conversion. - var decodeArr = this.dict.getArray('Decode', 'D'); - if (this.forceRGB && isArray(decodeArr)) { - var bitsPerComponent = this.dict.get('BitsPerComponent') || 8; - var decodeArrLength = decodeArr.length; - var transform = new Int32Array(decodeArrLength); - var transformNeeded = false; - var maxValue = (1 << bitsPerComponent) - 1; - for (var i = 0; i < decodeArrLength; i += 2) { - transform[i] = ((decodeArr[i + 1] - decodeArr[i]) * 256) | 0; - transform[i + 1] = (decodeArr[i] * maxValue) | 0; - if (transform[i] !== 256 || transform[i + 1] !== 0) { - transformNeeded = true; - } - } - if (transformNeeded) { - jpegImage.decodeTransform = transform; - } - } - // Fetching the 'ColorTransform' entry, if it exists. - var decodeParams = this.dict.get('DecodeParms', 'DP'); - if (isDict(decodeParams)) { - var colorTransform = decodeParams.get('ColorTransform'); - if (isInt(colorTransform)) { - jpegImage.colorTransform = colorTransform; - } - } - - jpegImage.parse(this.bytes); - var data = jpegImage.getData(this.drawWidth, this.drawHeight, - this.forceRGB); - this.buffer = data; - this.bufferLength = data.length; - this.eof = true; - }; - - JpegStream.prototype.getBytes = function JpegStream_getBytes(length) { - this.ensureBuffer(); - return this.buffer; - }; - - JpegStream.prototype.getIR = function JpegStream_getIR(forceDataSchema) { - return createObjectURL(this.bytes, 'image/jpeg', forceDataSchema); - }; - - return JpegStream; -})(); - -/** - * For JPEG 2000's we use a library to decode these images and - * the stream behaves like all the other DecodeStreams. - */ -var JpxStream = (function JpxStreamClosure() { - function JpxStream(stream, maybeLength, dict) { - this.stream = stream; - this.maybeLength = maybeLength; - this.dict = dict; - - DecodeStream.call(this, maybeLength); - } - - JpxStream.prototype = Object.create(DecodeStream.prototype); - - Object.defineProperty(JpxStream.prototype, 'bytes', { - get: function JpxStream_bytes() { - // If this.maybeLength is null, we'll get the entire stream. - return shadow(this, 'bytes', this.stream.getBytes(this.maybeLength)); - }, - configurable: true - }); - - JpxStream.prototype.ensureBuffer = function JpxStream_ensureBuffer(req) { - if (this.bufferLength) { - return; - } - - var jpxImage = new JpxImage(); - jpxImage.parse(this.bytes); - - var width = jpxImage.width; - var height = jpxImage.height; - var componentsCount = jpxImage.componentsCount; - var tileCount = jpxImage.tiles.length; - if (tileCount === 1) { - this.buffer = jpxImage.tiles[0].items; - } else { - var data = new Uint8Array(width * height * componentsCount); - - for (var k = 0; k < tileCount; k++) { - var tileComponents = jpxImage.tiles[k]; - var tileWidth = tileComponents.width; - var tileHeight = tileComponents.height; - var tileLeft = tileComponents.left; - var tileTop = tileComponents.top; - - var src = tileComponents.items; - var srcPosition = 0; - var dataPosition = (width * tileTop + tileLeft) * componentsCount; - var imgRowSize = width * componentsCount; - var tileRowSize = tileWidth * componentsCount; - - for (var j = 0; j < tileHeight; j++) { - var rowBytes = src.subarray(srcPosition, srcPosition + tileRowSize); - data.set(rowBytes, dataPosition); - srcPosition += tileRowSize; - dataPosition += imgRowSize; - } - } - this.buffer = data; - } - this.bufferLength = this.buffer.length; - this.eof = true; - }; - - return JpxStream; -})(); - -/** - * For JBIG2's we use a library to decode these images and - * the stream behaves like all the other DecodeStreams. - */ -var Jbig2Stream = (function Jbig2StreamClosure() { - function Jbig2Stream(stream, maybeLength, dict) { - this.stream = stream; - this.maybeLength = maybeLength; - this.dict = dict; - - DecodeStream.call(this, maybeLength); - } - - Jbig2Stream.prototype = Object.create(DecodeStream.prototype); - - Object.defineProperty(Jbig2Stream.prototype, 'bytes', { - get: function Jbig2Stream_bytes() { - // If this.maybeLength is null, we'll get the entire stream. - return shadow(this, 'bytes', this.stream.getBytes(this.maybeLength)); - }, - configurable: true - }); - - Jbig2Stream.prototype.ensureBuffer = function Jbig2Stream_ensureBuffer(req) { - if (this.bufferLength) { - return; - } - - var jbig2Image = new Jbig2Image(); - - var chunks = []; - var decodeParams = this.dict.getArray('DecodeParms', 'DP'); - - // According to the PDF specification, DecodeParms can be either - // a dictionary, or an array whose elements are dictionaries. - if (isArray(decodeParams)) { - if (decodeParams.length > 1) { - warn('JBIG2 - \'DecodeParms\' array with multiple elements ' + - 'not supported.'); - } - decodeParams = decodeParams[0]; - } - if (decodeParams && decodeParams.has('JBIG2Globals')) { - var globalsStream = decodeParams.get('JBIG2Globals'); - var globals = globalsStream.getBytes(); - chunks.push({data: globals, start: 0, end: globals.length}); - } - chunks.push({data: this.bytes, start: 0, end: this.bytes.length}); - var data = jbig2Image.parseChunks(chunks); - var dataLength = data.length; - - // JBIG2 had black as 1 and white as 0, inverting the colors - for (var i = 0; i < dataLength; i++) { - data[i] ^= 0xFF; - } - - this.buffer = data; - this.bufferLength = dataLength; - this.eof = true; - }; - - return Jbig2Stream; -})(); - -var DecryptStream = (function DecryptStreamClosure() { - function DecryptStream(str, maybeLength, decrypt) { - this.str = str; - this.dict = str.dict; - this.decrypt = decrypt; - this.nextChunk = null; - this.initialized = false; - - DecodeStream.call(this, maybeLength); - } - - var chunkSize = 512; - - DecryptStream.prototype = Object.create(DecodeStream.prototype); - - DecryptStream.prototype.readBlock = function DecryptStream_readBlock() { - var chunk; - if (this.initialized) { - chunk = this.nextChunk; - } else { - chunk = this.str.getBytes(chunkSize); - this.initialized = true; - } - if (!chunk || chunk.length === 0) { - this.eof = true; - return; - } - this.nextChunk = this.str.getBytes(chunkSize); - var hasMoreData = this.nextChunk && this.nextChunk.length > 0; - - var decrypt = this.decrypt; - chunk = decrypt(chunk, !hasMoreData); - - var bufferLength = this.bufferLength; - var i, n = chunk.length; - var buffer = this.ensureBuffer(bufferLength + n); - for (i = 0; i < n; i++) { - buffer[bufferLength++] = chunk[i]; - } - this.bufferLength = bufferLength; - }; - - return DecryptStream; -})(); - -var Ascii85Stream = (function Ascii85StreamClosure() { - function Ascii85Stream(str, maybeLength) { - this.str = str; - this.dict = str.dict; - this.input = new Uint8Array(5); - - // Most streams increase in size when decoded, but Ascii85 streams - // typically shrink by ~20%. - if (maybeLength) { - maybeLength = 0.8 * maybeLength; - } - DecodeStream.call(this, maybeLength); - } - - Ascii85Stream.prototype = Object.create(DecodeStream.prototype); - - Ascii85Stream.prototype.readBlock = function Ascii85Stream_readBlock() { - var TILDA_CHAR = 0x7E; // '~' - var Z_LOWER_CHAR = 0x7A; // 'z' - var EOF = -1; - - var str = this.str; - - var c = str.getByte(); - while (isSpace(c)) { - c = str.getByte(); - } - - if (c === EOF || c === TILDA_CHAR) { - this.eof = true; - return; - } - - var bufferLength = this.bufferLength, buffer; - var i; - - // special code for z - if (c === Z_LOWER_CHAR) { - buffer = this.ensureBuffer(bufferLength + 4); - for (i = 0; i < 4; ++i) { - buffer[bufferLength + i] = 0; - } - this.bufferLength += 4; - } else { - var input = this.input; - input[0] = c; - for (i = 1; i < 5; ++i) { - c = str.getByte(); - while (isSpace(c)) { - c = str.getByte(); - } - - input[i] = c; - - if (c === EOF || c === TILDA_CHAR) { - break; - } - } - buffer = this.ensureBuffer(bufferLength + i - 1); - this.bufferLength += i - 1; - - // partial ending; - if (i < 5) { - for (; i < 5; ++i) { - input[i] = 0x21 + 84; - } - this.eof = true; - } - var t = 0; - for (i = 0; i < 5; ++i) { - t = t * 85 + (input[i] - 0x21); - } - - for (i = 3; i >= 0; --i) { - buffer[bufferLength + i] = t & 0xFF; - t >>= 8; - } - } - }; - - return Ascii85Stream; -})(); - -var AsciiHexStream = (function AsciiHexStreamClosure() { - function AsciiHexStream(str, maybeLength) { - this.str = str; - this.dict = str.dict; - - this.firstDigit = -1; - - // Most streams increase in size when decoded, but AsciiHex streams shrink - // by 50%. - if (maybeLength) { - maybeLength = 0.5 * maybeLength; - } - DecodeStream.call(this, maybeLength); - } - - AsciiHexStream.prototype = Object.create(DecodeStream.prototype); - - AsciiHexStream.prototype.readBlock = function AsciiHexStream_readBlock() { - var UPSTREAM_BLOCK_SIZE = 8000; - var bytes = this.str.getBytes(UPSTREAM_BLOCK_SIZE); - if (!bytes.length) { - this.eof = true; - return; - } - - var maxDecodeLength = (bytes.length + 1) >> 1; - var buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength); - var bufferLength = this.bufferLength; - - var firstDigit = this.firstDigit; - for (var i = 0, ii = bytes.length; i < ii; i++) { - var ch = bytes[i], digit; - if (ch >= 0x30 && ch <= 0x39) { // '0'-'9' - digit = ch & 0x0F; - } else if ((ch >= 0x41 && ch <= 0x46) || (ch >= 0x61 && ch <= 0x66)) { - // 'A'-'Z', 'a'-'z' - digit = (ch & 0x0F) + 9; - } else if (ch === 0x3E) { // '>' - this.eof = true; - break; - } else { // probably whitespace - continue; // ignoring - } - if (firstDigit < 0) { - firstDigit = digit; - } else { - buffer[bufferLength++] = (firstDigit << 4) | digit; - firstDigit = -1; - } - } - if (firstDigit >= 0 && this.eof) { - // incomplete byte - buffer[bufferLength++] = (firstDigit << 4); - firstDigit = -1; - } - this.firstDigit = firstDigit; - this.bufferLength = bufferLength; - }; - - return AsciiHexStream; -})(); - -var RunLengthStream = (function RunLengthStreamClosure() { - function RunLengthStream(str, maybeLength) { - this.str = str; - this.dict = str.dict; - - DecodeStream.call(this, maybeLength); - } - - RunLengthStream.prototype = Object.create(DecodeStream.prototype); - - RunLengthStream.prototype.readBlock = function RunLengthStream_readBlock() { - // The repeatHeader has following format. The first byte defines type of run - // and amount of bytes to repeat/copy: n = 0 through 127 - copy next n bytes - // (in addition to the second byte from the header), n = 129 through 255 - - // duplicate the second byte from the header (257 - n) times, n = 128 - end. - var repeatHeader = this.str.getBytes(2); - if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) { - this.eof = true; - return; - } - - var buffer; - var bufferLength = this.bufferLength; - var n = repeatHeader[0]; - if (n < 128) { - // copy n bytes - buffer = this.ensureBuffer(bufferLength + n + 1); - buffer[bufferLength++] = repeatHeader[1]; - if (n > 0) { - var source = this.str.getBytes(n); - buffer.set(source, bufferLength); - bufferLength += n; - } - } else { - n = 257 - n; - var b = repeatHeader[1]; - buffer = this.ensureBuffer(bufferLength + n + 1); - for (var i = 0; i < n; i++) { - buffer[bufferLength++] = b; - } - } - this.bufferLength = bufferLength; - }; - - return RunLengthStream; -})(); - -var CCITTFaxStream = (function CCITTFaxStreamClosure() { - - var ccittEOL = -2; - var ccittEOF = -1; - var twoDimPass = 0; - var twoDimHoriz = 1; - var twoDimVert0 = 2; - var twoDimVertR1 = 3; - var twoDimVertL1 = 4; - var twoDimVertR2 = 5; - var twoDimVertL2 = 6; - var twoDimVertR3 = 7; - var twoDimVertL3 = 8; - - var twoDimTable = [ - [-1, -1], [-1, -1], // 000000x - [7, twoDimVertL3], // 0000010 - [7, twoDimVertR3], // 0000011 - [6, twoDimVertL2], [6, twoDimVertL2], // 000010x - [6, twoDimVertR2], [6, twoDimVertR2], // 000011x - [4, twoDimPass], [4, twoDimPass], // 0001xxx - [4, twoDimPass], [4, twoDimPass], - [4, twoDimPass], [4, twoDimPass], - [4, twoDimPass], [4, twoDimPass], - [3, twoDimHoriz], [3, twoDimHoriz], // 001xxxx - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimHoriz], [3, twoDimHoriz], - [3, twoDimVertL1], [3, twoDimVertL1], // 010xxxx - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertL1], [3, twoDimVertL1], - [3, twoDimVertR1], [3, twoDimVertR1], // 011xxxx - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [3, twoDimVertR1], [3, twoDimVertR1], - [1, twoDimVert0], [1, twoDimVert0], // 1xxxxxx - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0], - [1, twoDimVert0], [1, twoDimVert0] - ]; - - var whiteTable1 = [ - [-1, -1], // 00000 - [12, ccittEOL], // 00001 - [-1, -1], [-1, -1], // 0001x - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 001xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 010xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 011xx - [11, 1792], [11, 1792], // 1000x - [12, 1984], // 10010 - [12, 2048], // 10011 - [12, 2112], // 10100 - [12, 2176], // 10101 - [12, 2240], // 10110 - [12, 2304], // 10111 - [11, 1856], [11, 1856], // 1100x - [11, 1920], [11, 1920], // 1101x - [12, 2368], // 11100 - [12, 2432], // 11101 - [12, 2496], // 11110 - [12, 2560] // 11111 - ]; - - var whiteTable2 = [ - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 0000000xx - [8, 29], [8, 29], // 00000010x - [8, 30], [8, 30], // 00000011x - [8, 45], [8, 45], // 00000100x - [8, 46], [8, 46], // 00000101x - [7, 22], [7, 22], [7, 22], [7, 22], // 0000011xx - [7, 23], [7, 23], [7, 23], [7, 23], // 0000100xx - [8, 47], [8, 47], // 00001010x - [8, 48], [8, 48], // 00001011x - [6, 13], [6, 13], [6, 13], [6, 13], // 000011xxx - [6, 13], [6, 13], [6, 13], [6, 13], - [7, 20], [7, 20], [7, 20], [7, 20], // 0001000xx - [8, 33], [8, 33], // 00010010x - [8, 34], [8, 34], // 00010011x - [8, 35], [8, 35], // 00010100x - [8, 36], [8, 36], // 00010101x - [8, 37], [8, 37], // 00010110x - [8, 38], [8, 38], // 00010111x - [7, 19], [7, 19], [7, 19], [7, 19], // 0001100xx - [8, 31], [8, 31], // 00011010x - [8, 32], [8, 32], // 00011011x - [6, 1], [6, 1], [6, 1], [6, 1], // 000111xxx - [6, 1], [6, 1], [6, 1], [6, 1], - [6, 12], [6, 12], [6, 12], [6, 12], // 001000xxx - [6, 12], [6, 12], [6, 12], [6, 12], - [8, 53], [8, 53], // 00100100x - [8, 54], [8, 54], // 00100101x - [7, 26], [7, 26], [7, 26], [7, 26], // 0010011xx - [8, 39], [8, 39], // 00101000x - [8, 40], [8, 40], // 00101001x - [8, 41], [8, 41], // 00101010x - [8, 42], [8, 42], // 00101011x - [8, 43], [8, 43], // 00101100x - [8, 44], [8, 44], // 00101101x - [7, 21], [7, 21], [7, 21], [7, 21], // 0010111xx - [7, 28], [7, 28], [7, 28], [7, 28], // 0011000xx - [8, 61], [8, 61], // 00110010x - [8, 62], [8, 62], // 00110011x - [8, 63], [8, 63], // 00110100x - [8, 0], [8, 0], // 00110101x - [8, 320], [8, 320], // 00110110x - [8, 384], [8, 384], // 00110111x - [5, 10], [5, 10], [5, 10], [5, 10], // 00111xxxx - [5, 10], [5, 10], [5, 10], [5, 10], - [5, 10], [5, 10], [5, 10], [5, 10], - [5, 10], [5, 10], [5, 10], [5, 10], - [5, 11], [5, 11], [5, 11], [5, 11], // 01000xxxx - [5, 11], [5, 11], [5, 11], [5, 11], - [5, 11], [5, 11], [5, 11], [5, 11], - [5, 11], [5, 11], [5, 11], [5, 11], - [7, 27], [7, 27], [7, 27], [7, 27], // 0100100xx - [8, 59], [8, 59], // 01001010x - [8, 60], [8, 60], // 01001011x - [9, 1472], // 010011000 - [9, 1536], // 010011001 - [9, 1600], // 010011010 - [9, 1728], // 010011011 - [7, 18], [7, 18], [7, 18], [7, 18], // 0100111xx - [7, 24], [7, 24], [7, 24], [7, 24], // 0101000xx - [8, 49], [8, 49], // 01010010x - [8, 50], [8, 50], // 01010011x - [8, 51], [8, 51], // 01010100x - [8, 52], [8, 52], // 01010101x - [7, 25], [7, 25], [7, 25], [7, 25], // 0101011xx - [8, 55], [8, 55], // 01011000x - [8, 56], [8, 56], // 01011001x - [8, 57], [8, 57], // 01011010x - [8, 58], [8, 58], // 01011011x - [6, 192], [6, 192], [6, 192], [6, 192], // 010111xxx - [6, 192], [6, 192], [6, 192], [6, 192], - [6, 1664], [6, 1664], [6, 1664], [6, 1664], // 011000xxx - [6, 1664], [6, 1664], [6, 1664], [6, 1664], - [8, 448], [8, 448], // 01100100x - [8, 512], [8, 512], // 01100101x - [9, 704], // 011001100 - [9, 768], // 011001101 - [8, 640], [8, 640], // 01100111x - [8, 576], [8, 576], // 01101000x - [9, 832], // 011010010 - [9, 896], // 011010011 - [9, 960], // 011010100 - [9, 1024], // 011010101 - [9, 1088], // 011010110 - [9, 1152], // 011010111 - [9, 1216], // 011011000 - [9, 1280], // 011011001 - [9, 1344], // 011011010 - [9, 1408], // 011011011 - [7, 256], [7, 256], [7, 256], [7, 256], // 0110111xx - [4, 2], [4, 2], [4, 2], [4, 2], // 0111xxxxx - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 2], [4, 2], [4, 2], [4, 2], - [4, 3], [4, 3], [4, 3], [4, 3], // 1000xxxxx - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [4, 3], [4, 3], [4, 3], [4, 3], - [5, 128], [5, 128], [5, 128], [5, 128], // 10010xxxx - [5, 128], [5, 128], [5, 128], [5, 128], - [5, 128], [5, 128], [5, 128], [5, 128], - [5, 128], [5, 128], [5, 128], [5, 128], - [5, 8], [5, 8], [5, 8], [5, 8], // 10011xxxx - [5, 8], [5, 8], [5, 8], [5, 8], - [5, 8], [5, 8], [5, 8], [5, 8], - [5, 8], [5, 8], [5, 8], [5, 8], - [5, 9], [5, 9], [5, 9], [5, 9], // 10100xxxx - [5, 9], [5, 9], [5, 9], [5, 9], - [5, 9], [5, 9], [5, 9], [5, 9], - [5, 9], [5, 9], [5, 9], [5, 9], - [6, 16], [6, 16], [6, 16], [6, 16], // 101010xxx - [6, 16], [6, 16], [6, 16], [6, 16], - [6, 17], [6, 17], [6, 17], [6, 17], // 101011xxx - [6, 17], [6, 17], [6, 17], [6, 17], - [4, 4], [4, 4], [4, 4], [4, 4], // 1011xxxxx - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 4], [4, 4], [4, 4], [4, 4], - [4, 5], [4, 5], [4, 5], [4, 5], // 1100xxxxx - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [4, 5], [4, 5], [4, 5], [4, 5], - [6, 14], [6, 14], [6, 14], [6, 14], // 110100xxx - [6, 14], [6, 14], [6, 14], [6, 14], - [6, 15], [6, 15], [6, 15], [6, 15], // 110101xxx - [6, 15], [6, 15], [6, 15], [6, 15], - [5, 64], [5, 64], [5, 64], [5, 64], // 11011xxxx - [5, 64], [5, 64], [5, 64], [5, 64], - [5, 64], [5, 64], [5, 64], [5, 64], - [5, 64], [5, 64], [5, 64], [5, 64], - [4, 6], [4, 6], [4, 6], [4, 6], // 1110xxxxx - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 6], [4, 6], [4, 6], [4, 6], - [4, 7], [4, 7], [4, 7], [4, 7], // 1111xxxxx - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7], - [4, 7], [4, 7], [4, 7], [4, 7] - ]; - - var blackTable1 = [ - [-1, -1], [-1, -1], // 000000000000x - [12, ccittEOL], [12, ccittEOL], // 000000000001x - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000001xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000010xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000011xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000100xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000101xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000110xx - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000111xx - [11, 1792], [11, 1792], [11, 1792], [11, 1792], // 00000001000xx - [12, 1984], [12, 1984], // 000000010010x - [12, 2048], [12, 2048], // 000000010011x - [12, 2112], [12, 2112], // 000000010100x - [12, 2176], [12, 2176], // 000000010101x - [12, 2240], [12, 2240], // 000000010110x - [12, 2304], [12, 2304], // 000000010111x - [11, 1856], [11, 1856], [11, 1856], [11, 1856], // 00000001100xx - [11, 1920], [11, 1920], [11, 1920], [11, 1920], // 00000001101xx - [12, 2368], [12, 2368], // 000000011100x - [12, 2432], [12, 2432], // 000000011101x - [12, 2496], [12, 2496], // 000000011110x - [12, 2560], [12, 2560], // 000000011111x - [10, 18], [10, 18], [10, 18], [10, 18], // 0000001000xxx - [10, 18], [10, 18], [10, 18], [10, 18], - [12, 52], [12, 52], // 000000100100x - [13, 640], // 0000001001010 - [13, 704], // 0000001001011 - [13, 768], // 0000001001100 - [13, 832], // 0000001001101 - [12, 55], [12, 55], // 000000100111x - [12, 56], [12, 56], // 000000101000x - [13, 1280], // 0000001010010 - [13, 1344], // 0000001010011 - [13, 1408], // 0000001010100 - [13, 1472], // 0000001010101 - [12, 59], [12, 59], // 000000101011x - [12, 60], [12, 60], // 000000101100x - [13, 1536], // 0000001011010 - [13, 1600], // 0000001011011 - [11, 24], [11, 24], [11, 24], [11, 24], // 00000010111xx - [11, 25], [11, 25], [11, 25], [11, 25], // 00000011000xx - [13, 1664], // 0000001100100 - [13, 1728], // 0000001100101 - [12, 320], [12, 320], // 000000110011x - [12, 384], [12, 384], // 000000110100x - [12, 448], [12, 448], // 000000110101x - [13, 512], // 0000001101100 - [13, 576], // 0000001101101 - [12, 53], [12, 53], // 000000110111x - [12, 54], [12, 54], // 000000111000x - [13, 896], // 0000001110010 - [13, 960], // 0000001110011 - [13, 1024], // 0000001110100 - [13, 1088], // 0000001110101 - [13, 1152], // 0000001110110 - [13, 1216], // 0000001110111 - [10, 64], [10, 64], [10, 64], [10, 64], // 0000001111xxx - [10, 64], [10, 64], [10, 64], [10, 64] - ]; - - var blackTable2 = [ - [8, 13], [8, 13], [8, 13], [8, 13], // 00000100xxxx - [8, 13], [8, 13], [8, 13], [8, 13], - [8, 13], [8, 13], [8, 13], [8, 13], - [8, 13], [8, 13], [8, 13], [8, 13], - [11, 23], [11, 23], // 00000101000x - [12, 50], // 000001010010 - [12, 51], // 000001010011 - [12, 44], // 000001010100 - [12, 45], // 000001010101 - [12, 46], // 000001010110 - [12, 47], // 000001010111 - [12, 57], // 000001011000 - [12, 58], // 000001011001 - [12, 61], // 000001011010 - [12, 256], // 000001011011 - [10, 16], [10, 16], [10, 16], [10, 16], // 0000010111xx - [10, 17], [10, 17], [10, 17], [10, 17], // 0000011000xx - [12, 48], // 000001100100 - [12, 49], // 000001100101 - [12, 62], // 000001100110 - [12, 63], // 000001100111 - [12, 30], // 000001101000 - [12, 31], // 000001101001 - [12, 32], // 000001101010 - [12, 33], // 000001101011 - [12, 40], // 000001101100 - [12, 41], // 000001101101 - [11, 22], [11, 22], // 00000110111x - [8, 14], [8, 14], [8, 14], [8, 14], // 00000111xxxx - [8, 14], [8, 14], [8, 14], [8, 14], - [8, 14], [8, 14], [8, 14], [8, 14], - [8, 14], [8, 14], [8, 14], [8, 14], - [7, 10], [7, 10], [7, 10], [7, 10], // 0000100xxxxx - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 10], [7, 10], [7, 10], [7, 10], - [7, 11], [7, 11], [7, 11], [7, 11], // 0000101xxxxx - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [7, 11], [7, 11], [7, 11], [7, 11], - [9, 15], [9, 15], [9, 15], [9, 15], // 000011000xxx - [9, 15], [9, 15], [9, 15], [9, 15], - [12, 128], // 000011001000 - [12, 192], // 000011001001 - [12, 26], // 000011001010 - [12, 27], // 000011001011 - [12, 28], // 000011001100 - [12, 29], // 000011001101 - [11, 19], [11, 19], // 00001100111x - [11, 20], [11, 20], // 00001101000x - [12, 34], // 000011010010 - [12, 35], // 000011010011 - [12, 36], // 000011010100 - [12, 37], // 000011010101 - [12, 38], // 000011010110 - [12, 39], // 000011010111 - [11, 21], [11, 21], // 00001101100x - [12, 42], // 000011011010 - [12, 43], // 000011011011 - [10, 0], [10, 0], [10, 0], [10, 0], // 0000110111xx - [7, 12], [7, 12], [7, 12], [7, 12], // 0000111xxxxx - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12], - [7, 12], [7, 12], [7, 12], [7, 12] - ]; - - var blackTable3 = [ - [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 0000xx - [6, 9], // 000100 - [6, 8], // 000101 - [5, 7], [5, 7], // 00011x - [4, 6], [4, 6], [4, 6], [4, 6], // 0010xx - [4, 5], [4, 5], [4, 5], [4, 5], // 0011xx - [3, 1], [3, 1], [3, 1], [3, 1], // 010xxx - [3, 1], [3, 1], [3, 1], [3, 1], - [3, 4], [3, 4], [3, 4], [3, 4], // 011xxx - [3, 4], [3, 4], [3, 4], [3, 4], - [2, 3], [2, 3], [2, 3], [2, 3], // 10xxxx - [2, 3], [2, 3], [2, 3], [2, 3], - [2, 3], [2, 3], [2, 3], [2, 3], - [2, 3], [2, 3], [2, 3], [2, 3], - [2, 2], [2, 2], [2, 2], [2, 2], // 11xxxx - [2, 2], [2, 2], [2, 2], [2, 2], - [2, 2], [2, 2], [2, 2], [2, 2], - [2, 2], [2, 2], [2, 2], [2, 2] - ]; - - function CCITTFaxStream(str, maybeLength, params) { - this.str = str; - this.dict = str.dict; - - params = params || Dict.empty; - - this.encoding = params.get('K') || 0; - this.eoline = params.get('EndOfLine') || false; - this.byteAlign = params.get('EncodedByteAlign') || false; - this.columns = params.get('Columns') || 1728; - this.rows = params.get('Rows') || 0; - var eoblock = params.get('EndOfBlock'); - if (eoblock === null || eoblock === undefined) { - eoblock = true; - } - this.eoblock = eoblock; - this.black = params.get('BlackIs1') || false; - - this.codingLine = new Uint32Array(this.columns + 1); - this.refLine = new Uint32Array(this.columns + 2); - - this.codingLine[0] = this.columns; - this.codingPos = 0; - - this.row = 0; - this.nextLine2D = this.encoding < 0; - this.inputBits = 0; - this.inputBuf = 0; - this.outputBits = 0; - - var code1; - while ((code1 = this.lookBits(12)) === 0) { - this.eatBits(1); - } - if (code1 === 1) { - this.eatBits(12); - } - if (this.encoding > 0) { - this.nextLine2D = !this.lookBits(1); - this.eatBits(1); - } - - DecodeStream.call(this, maybeLength); - } - - CCITTFaxStream.prototype = Object.create(DecodeStream.prototype); - - CCITTFaxStream.prototype.readBlock = function CCITTFaxStream_readBlock() { - while (!this.eof) { - var c = this.lookChar(); - this.ensureBuffer(this.bufferLength + 1); - this.buffer[this.bufferLength++] = c; - } - }; - - CCITTFaxStream.prototype.addPixels = - function ccittFaxStreamAddPixels(a1, blackPixels) { - var codingLine = this.codingLine; - var codingPos = this.codingPos; - - if (a1 > codingLine[codingPos]) { - if (a1 > this.columns) { - info('row is wrong length'); - this.err = true; - a1 = this.columns; - } - if ((codingPos & 1) ^ blackPixels) { - ++codingPos; - } - - codingLine[codingPos] = a1; - } - this.codingPos = codingPos; - }; - - CCITTFaxStream.prototype.addPixelsNeg = - function ccittFaxStreamAddPixelsNeg(a1, blackPixels) { - var codingLine = this.codingLine; - var codingPos = this.codingPos; - - if (a1 > codingLine[codingPos]) { - if (a1 > this.columns) { - info('row is wrong length'); - this.err = true; - a1 = this.columns; - } - if ((codingPos & 1) ^ blackPixels) { - ++codingPos; - } - - codingLine[codingPos] = a1; - } else if (a1 < codingLine[codingPos]) { - if (a1 < 0) { - info('invalid code'); - this.err = true; - a1 = 0; - } - while (codingPos > 0 && a1 < codingLine[codingPos - 1]) { - --codingPos; - } - codingLine[codingPos] = a1; - } - - this.codingPos = codingPos; - }; - - CCITTFaxStream.prototype.lookChar = function CCITTFaxStream_lookChar() { - var refLine = this.refLine; - var codingLine = this.codingLine; - var columns = this.columns; - - var refPos, blackPixels, bits, i; - - if (this.outputBits === 0) { - if (this.eof) { - return null; - } - this.err = false; - - var code1, code2, code3; - if (this.nextLine2D) { - for (i = 0; codingLine[i] < columns; ++i) { - refLine[i] = codingLine[i]; - } - refLine[i++] = columns; - refLine[i] = columns; - codingLine[0] = 0; - this.codingPos = 0; - refPos = 0; - blackPixels = 0; - - while (codingLine[this.codingPos] < columns) { - code1 = this.getTwoDimCode(); - switch (code1) { - case twoDimPass: - this.addPixels(refLine[refPos + 1], blackPixels); - if (refLine[refPos + 1] < columns) { - refPos += 2; - } - break; - case twoDimHoriz: - code1 = code2 = 0; - if (blackPixels) { - do { - code1 += (code3 = this.getBlackCode()); - } while (code3 >= 64); - do { - code2 += (code3 = this.getWhiteCode()); - } while (code3 >= 64); - } else { - do { - code1 += (code3 = this.getWhiteCode()); - } while (code3 >= 64); - do { - code2 += (code3 = this.getBlackCode()); - } while (code3 >= 64); - } - this.addPixels(codingLine[this.codingPos] + - code1, blackPixels); - if (codingLine[this.codingPos] < columns) { - this.addPixels(codingLine[this.codingPos] + code2, - blackPixels ^ 1); - } - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - break; - case twoDimVertR3: - this.addPixels(refLine[refPos] + 3, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - ++refPos; - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVertR2: - this.addPixels(refLine[refPos] + 2, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - ++refPos; - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVertR1: - this.addPixels(refLine[refPos] + 1, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - ++refPos; - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVert0: - this.addPixels(refLine[refPos], blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - ++refPos; - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVertL3: - this.addPixelsNeg(refLine[refPos] - 3, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - if (refPos > 0) { - --refPos; - } else { - ++refPos; - } - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVertL2: - this.addPixelsNeg(refLine[refPos] - 2, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - if (refPos > 0) { - --refPos; - } else { - ++refPos; - } - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case twoDimVertL1: - this.addPixelsNeg(refLine[refPos] - 1, blackPixels); - blackPixels ^= 1; - if (codingLine[this.codingPos] < columns) { - if (refPos > 0) { - --refPos; - } else { - ++refPos; - } - while (refLine[refPos] <= codingLine[this.codingPos] && - refLine[refPos] < columns) { - refPos += 2; - } - } - break; - case ccittEOF: - this.addPixels(columns, 0); - this.eof = true; - break; - default: - info('bad 2d code'); - this.addPixels(columns, 0); - this.err = true; - } - } - } else { - codingLine[0] = 0; - this.codingPos = 0; - blackPixels = 0; - while (codingLine[this.codingPos] < columns) { - code1 = 0; - if (blackPixels) { - do { - code1 += (code3 = this.getBlackCode()); - } while (code3 >= 64); - } else { - do { - code1 += (code3 = this.getWhiteCode()); - } while (code3 >= 64); - } - this.addPixels(codingLine[this.codingPos] + code1, blackPixels); - blackPixels ^= 1; - } - } - - var gotEOL = false; - - if (this.byteAlign) { - this.inputBits &= ~7; - } - - if (!this.eoblock && this.row === this.rows - 1) { - this.eof = true; - } else { - code1 = this.lookBits(12); - if (this.eoline) { - while (code1 !== ccittEOF && code1 !== 1) { - this.eatBits(1); - code1 = this.lookBits(12); - } - } else { - while (code1 === 0) { - this.eatBits(1); - code1 = this.lookBits(12); - } - } - if (code1 === 1) { - this.eatBits(12); - gotEOL = true; - } else if (code1 === ccittEOF) { - this.eof = true; - } - } - - if (!this.eof && this.encoding > 0) { - this.nextLine2D = !this.lookBits(1); - this.eatBits(1); - } - - if (this.eoblock && gotEOL && this.byteAlign) { - code1 = this.lookBits(12); - if (code1 === 1) { - this.eatBits(12); - if (this.encoding > 0) { - this.lookBits(1); - this.eatBits(1); - } - if (this.encoding >= 0) { - for (i = 0; i < 4; ++i) { - code1 = this.lookBits(12); - if (code1 !== 1) { - info('bad rtc code: ' + code1); - } - this.eatBits(12); - if (this.encoding > 0) { - this.lookBits(1); - this.eatBits(1); - } - } - } - this.eof = true; - } - } else if (this.err && this.eoline) { - while (true) { - code1 = this.lookBits(13); - if (code1 === ccittEOF) { - this.eof = true; - return null; - } - if ((code1 >> 1) === 1) { - break; - } - this.eatBits(1); - } - this.eatBits(12); - if (this.encoding > 0) { - this.eatBits(1); - this.nextLine2D = !(code1 & 1); - } - } - - if (codingLine[0] > 0) { - this.outputBits = codingLine[this.codingPos = 0]; - } else { - this.outputBits = codingLine[this.codingPos = 1]; - } - this.row++; - } - - var c; - if (this.outputBits >= 8) { - c = (this.codingPos & 1) ? 0 : 0xFF; - this.outputBits -= 8; - if (this.outputBits === 0 && codingLine[this.codingPos] < columns) { - this.codingPos++; - this.outputBits = (codingLine[this.codingPos] - - codingLine[this.codingPos - 1]); - } - } else { - bits = 8; - c = 0; - do { - if (this.outputBits > bits) { - c <<= bits; - if (!(this.codingPos & 1)) { - c |= 0xFF >> (8 - bits); - } - this.outputBits -= bits; - bits = 0; - } else { - c <<= this.outputBits; - if (!(this.codingPos & 1)) { - c |= 0xFF >> (8 - this.outputBits); - } - bits -= this.outputBits; - this.outputBits = 0; - if (codingLine[this.codingPos] < columns) { - this.codingPos++; - this.outputBits = (codingLine[this.codingPos] - - codingLine[this.codingPos - 1]); - } else if (bits > 0) { - c <<= bits; - bits = 0; - } - } - } while (bits); - } - if (this.black) { - c ^= 0xFF; - } - return c; - }; - - // This functions returns the code found from the table. - // The start and end parameters set the boundaries for searching the table. - // The limit parameter is optional. Function returns an array with three - // values. The first array element indicates whether a valid code is being - // returned. The second array element is the actual code. The third array - // element indicates whether EOF was reached. - CCITTFaxStream.prototype.findTableCode = - function ccittFaxStreamFindTableCode(start, end, table, limit) { - - var limitValue = limit || 0; - for (var i = start; i <= end; ++i) { - var code = this.lookBits(i); - if (code === ccittEOF) { - return [true, 1, false]; - } - if (i < end) { - code <<= end - i; - } - if (!limitValue || code >= limitValue) { - var p = table[code - limitValue]; - if (p[0] === i) { - this.eatBits(i); - return [true, p[1], true]; - } - } - } - return [false, 0, false]; - }; - - CCITTFaxStream.prototype.getTwoDimCode = - function ccittFaxStreamGetTwoDimCode() { - - var code = 0; - var p; - if (this.eoblock) { - code = this.lookBits(7); - p = twoDimTable[code]; - if (p && p[0] > 0) { - this.eatBits(p[0]); - return p[1]; - } - } else { - var result = this.findTableCode(1, 7, twoDimTable); - if (result[0] && result[2]) { - return result[1]; - } - } - info('Bad two dim code'); - return ccittEOF; - }; - - CCITTFaxStream.prototype.getWhiteCode = - function ccittFaxStreamGetWhiteCode() { - - var code = 0; - var p; - if (this.eoblock) { - code = this.lookBits(12); - if (code === ccittEOF) { - return 1; - } - - if ((code >> 5) === 0) { - p = whiteTable1[code]; - } else { - p = whiteTable2[code >> 3]; - } - - if (p[0] > 0) { - this.eatBits(p[0]); - return p[1]; - } - } else { - var result = this.findTableCode(1, 9, whiteTable2); - if (result[0]) { - return result[1]; - } - - result = this.findTableCode(11, 12, whiteTable1); - if (result[0]) { - return result[1]; - } - } - info('bad white code'); - this.eatBits(1); - return 1; - }; - - CCITTFaxStream.prototype.getBlackCode = - function ccittFaxStreamGetBlackCode() { - - var code, p; - if (this.eoblock) { - code = this.lookBits(13); - if (code === ccittEOF) { - return 1; - } - if ((code >> 7) === 0) { - p = blackTable1[code]; - } else if ((code >> 9) === 0 && (code >> 7) !== 0) { - p = blackTable2[(code >> 1) - 64]; - } else { - p = blackTable3[code >> 7]; - } - - if (p[0] > 0) { - this.eatBits(p[0]); - return p[1]; - } - } else { - var result = this.findTableCode(2, 6, blackTable3); - if (result[0]) { - return result[1]; - } - - result = this.findTableCode(7, 12, blackTable2, 64); - if (result[0]) { - return result[1]; - } - - result = this.findTableCode(10, 13, blackTable1); - if (result[0]) { - return result[1]; - } - } - info('bad black code'); - this.eatBits(1); - return 1; - }; - - CCITTFaxStream.prototype.lookBits = function CCITTFaxStream_lookBits(n) { - var c; - while (this.inputBits < n) { - if ((c = this.str.getByte()) === -1) { - if (this.inputBits === 0) { - return ccittEOF; - } - return ((this.inputBuf << (n - this.inputBits)) & - (0xFFFF >> (16 - n))); - } - this.inputBuf = (this.inputBuf << 8) | c; - this.inputBits += 8; - } - return (this.inputBuf >> (this.inputBits - n)) & (0xFFFF >> (16 - n)); - }; - - CCITTFaxStream.prototype.eatBits = function CCITTFaxStream_eatBits(n) { - if ((this.inputBits -= n) < 0) { - this.inputBits = 0; - } - }; - - return CCITTFaxStream; -})(); - -var LZWStream = (function LZWStreamClosure() { - function LZWStream(str, maybeLength, earlyChange) { - this.str = str; - this.dict = str.dict; - this.cachedData = 0; - this.bitsCached = 0; - - var maxLzwDictionarySize = 4096; - var lzwState = { - earlyChange: earlyChange, - codeLength: 9, - nextCode: 258, - dictionaryValues: new Uint8Array(maxLzwDictionarySize), - dictionaryLengths: new Uint16Array(maxLzwDictionarySize), - dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize), - currentSequence: new Uint8Array(maxLzwDictionarySize), - currentSequenceLength: 0 - }; - for (var i = 0; i < 256; ++i) { - lzwState.dictionaryValues[i] = i; - lzwState.dictionaryLengths[i] = 1; - } - this.lzwState = lzwState; - - DecodeStream.call(this, maybeLength); - } - - LZWStream.prototype = Object.create(DecodeStream.prototype); - - LZWStream.prototype.readBits = function LZWStream_readBits(n) { - var bitsCached = this.bitsCached; - var cachedData = this.cachedData; - while (bitsCached < n) { - var c = this.str.getByte(); - if (c === -1) { - this.eof = true; - return null; - } - cachedData = (cachedData << 8) | c; - bitsCached += 8; - } - this.bitsCached = (bitsCached -= n); - this.cachedData = cachedData; - this.lastCode = null; - return (cachedData >>> bitsCached) & ((1 << n) - 1); - }; - - LZWStream.prototype.readBlock = function LZWStream_readBlock() { - var blockSize = 512; - var estimatedDecodedSize = blockSize * 2, decodedSizeDelta = blockSize; - var i, j, q; - - var lzwState = this.lzwState; - if (!lzwState) { - return; // eof was found - } - - var earlyChange = lzwState.earlyChange; - var nextCode = lzwState.nextCode; - var dictionaryValues = lzwState.dictionaryValues; - var dictionaryLengths = lzwState.dictionaryLengths; - var dictionaryPrevCodes = lzwState.dictionaryPrevCodes; - var codeLength = lzwState.codeLength; - var prevCode = lzwState.prevCode; - var currentSequence = lzwState.currentSequence; - var currentSequenceLength = lzwState.currentSequenceLength; - - var decodedLength = 0; - var currentBufferLength = this.bufferLength; - var buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); - - for (i = 0; i < blockSize; i++) { - var code = this.readBits(codeLength); - var hasPrev = currentSequenceLength > 0; - if (code < 256) { - currentSequence[0] = code; - currentSequenceLength = 1; - } else if (code >= 258) { - if (code < nextCode) { - currentSequenceLength = dictionaryLengths[code]; - for (j = currentSequenceLength - 1, q = code; j >= 0; j--) { - currentSequence[j] = dictionaryValues[q]; - q = dictionaryPrevCodes[q]; - } - } else { - currentSequence[currentSequenceLength++] = currentSequence[0]; - } - } else if (code === 256) { - codeLength = 9; - nextCode = 258; - currentSequenceLength = 0; - continue; - } else { - this.eof = true; - delete this.lzwState; - break; - } - - if (hasPrev) { - dictionaryPrevCodes[nextCode] = prevCode; - dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1; - dictionaryValues[nextCode] = currentSequence[0]; - nextCode++; - codeLength = (nextCode + earlyChange) & (nextCode + earlyChange - 1) ? - codeLength : Math.min(Math.log(nextCode + earlyChange) / - 0.6931471805599453 + 1, 12) | 0; - } - prevCode = code; - - decodedLength += currentSequenceLength; - if (estimatedDecodedSize < decodedLength) { - do { - estimatedDecodedSize += decodedSizeDelta; - } while (estimatedDecodedSize < decodedLength); - buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); - } - for (j = 0; j < currentSequenceLength; j++) { - buffer[currentBufferLength++] = currentSequence[j]; - } - } - lzwState.nextCode = nextCode; - lzwState.codeLength = codeLength; - lzwState.prevCode = prevCode; - lzwState.currentSequenceLength = currentSequenceLength; - - this.bufferLength = currentBufferLength; - }; - - return LZWStream; -})(); - -var NullStream = (function NullStreamClosure() { - function NullStream() { - Stream.call(this, new Uint8Array(0)); - } - - NullStream.prototype = Stream.prototype; - - return NullStream; -})(); - -exports.Ascii85Stream = Ascii85Stream; -exports.AsciiHexStream = AsciiHexStream; -exports.CCITTFaxStream = CCITTFaxStream; -exports.DecryptStream = DecryptStream; -exports.DecodeStream = DecodeStream; -exports.FlateStream = FlateStream; -exports.Jbig2Stream = Jbig2Stream; -exports.JpegStream = JpegStream; -exports.JpxStream = JpxStream; -exports.NullStream = NullStream; -exports.PredictorStream = PredictorStream; -exports.RunLengthStream = RunLengthStream; -exports.Stream = Stream; -exports.StreamsSequenceStream = StreamsSequenceStream; -exports.StringStream = StringStream; -exports.LZWStream = LZWStream; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreCrypto = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreStream); - } -}(this, function (exports, sharedUtil, corePrimitives, coreStream) { - -var PasswordException = sharedUtil.PasswordException; -var PasswordResponses = sharedUtil.PasswordResponses; -var bytesToString = sharedUtil.bytesToString; -var error = sharedUtil.error; -var isInt = sharedUtil.isInt; -var stringToBytes = sharedUtil.stringToBytes; -var utf8StringToString = sharedUtil.utf8StringToString; -var warn = sharedUtil.warn; -var Name = corePrimitives.Name; -var isName = corePrimitives.isName; -var isDict = corePrimitives.isDict; -var DecryptStream = coreStream.DecryptStream; - -var ARCFourCipher = (function ARCFourCipherClosure() { - function ARCFourCipher(key) { - this.a = 0; - this.b = 0; - var s = new Uint8Array(256); - var i, j = 0, tmp, keyLength = key.length; - for (i = 0; i < 256; ++i) { - s[i] = i; - } - for (i = 0; i < 256; ++i) { - tmp = s[i]; - j = (j + tmp + key[i % keyLength]) & 0xFF; - s[i] = s[j]; - s[j] = tmp; - } - this.s = s; - } - - ARCFourCipher.prototype = { - encryptBlock: function ARCFourCipher_encryptBlock(data) { - var i, n = data.length, tmp, tmp2; - var a = this.a, b = this.b, s = this.s; - var output = new Uint8Array(n); - for (i = 0; i < n; ++i) { - a = (a + 1) & 0xFF; - tmp = s[a]; - b = (b + tmp) & 0xFF; - tmp2 = s[b]; - s[a] = tmp2; - s[b] = tmp; - output[i] = data[i] ^ s[(tmp + tmp2) & 0xFF]; - } - this.a = a; - this.b = b; - return output; - } - }; - ARCFourCipher.prototype.decryptBlock = ARCFourCipher.prototype.encryptBlock; - - return ARCFourCipher; -})(); - -var calculateMD5 = (function calculateMD5Closure() { - var r = new Uint8Array([ - 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, - 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, - 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, - 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21]); - - var k = new Int32Array([ - -680876936, -389564586, 606105819, -1044525330, -176418897, 1200080426, - -1473231341, -45705983, 1770035416, -1958414417, -42063, -1990404162, - 1804603682, -40341101, -1502002290, 1236535329, -165796510, -1069501632, - 643717713, -373897302, -701558691, 38016083, -660478335, -405537848, - 568446438, -1019803690, -187363961, 1163531501, -1444681467, -51403784, - 1735328473, -1926607734, -378558, -2022574463, 1839030562, -35309556, - -1530992060, 1272893353, -155497632, -1094730640, 681279174, -358537222, - -722521979, 76029189, -640364487, -421815835, 530742520, -995338651, - -198630844, 1126891415, -1416354905, -57434055, 1700485571, -1894986606, - -1051523, -2054922799, 1873313359, -30611744, -1560198380, 1309151649, - -145523070, -1120210379, 718787259, -343485551]); - - function hash(data, offset, length) { - var h0 = 1732584193, h1 = -271733879, h2 = -1732584194, h3 = 271733878; - // pre-processing - var paddedLength = (length + 72) & ~63; // data + 9 extra bytes - var padded = new Uint8Array(paddedLength); - var i, j, n; - for (i = 0; i < length; ++i) { - padded[i] = data[offset++]; - } - padded[i++] = 0x80; - n = paddedLength - 8; - while (i < n) { - padded[i++] = 0; - } - padded[i++] = (length << 3) & 0xFF; - padded[i++] = (length >> 5) & 0xFF; - padded[i++] = (length >> 13) & 0xFF; - padded[i++] = (length >> 21) & 0xFF; - padded[i++] = (length >>> 29) & 0xFF; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - var w = new Int32Array(16); - for (i = 0; i < paddedLength;) { - for (j = 0; j < 16; ++j, i += 4) { - w[j] = (padded[i] | (padded[i + 1] << 8) | - (padded[i + 2] << 16) | (padded[i + 3] << 24)); - } - var a = h0, b = h1, c = h2, d = h3, f, g; - for (j = 0; j < 64; ++j) { - if (j < 16) { - f = (b & c) | ((~b) & d); - g = j; - } else if (j < 32) { - f = (d & b) | ((~d) & c); - g = (5 * j + 1) & 15; - } else if (j < 48) { - f = b ^ c ^ d; - g = (3 * j + 5) & 15; - } else { - f = c ^ (b | (~d)); - g = (7 * j) & 15; - } - var tmp = d, rotateArg = (a + f + k[j] + w[g]) | 0, rotate = r[j]; - d = c; - c = b; - b = (b + ((rotateArg << rotate) | (rotateArg >>> (32 - rotate)))) | 0; - a = tmp; - } - h0 = (h0 + a) | 0; - h1 = (h1 + b) | 0; - h2 = (h2 + c) | 0; - h3 = (h3 + d) | 0; - } - return new Uint8Array([ - h0 & 0xFF, (h0 >> 8) & 0xFF, (h0 >> 16) & 0xFF, (h0 >>> 24) & 0xFF, - h1 & 0xFF, (h1 >> 8) & 0xFF, (h1 >> 16) & 0xFF, (h1 >>> 24) & 0xFF, - h2 & 0xFF, (h2 >> 8) & 0xFF, (h2 >> 16) & 0xFF, (h2 >>> 24) & 0xFF, - h3 & 0xFF, (h3 >> 8) & 0xFF, (h3 >> 16) & 0xFF, (h3 >>> 24) & 0xFF - ]); - } - - return hash; -})(); -var Word64 = (function Word64Closure() { - function Word64(highInteger, lowInteger) { - this.high = highInteger | 0; - this.low = lowInteger | 0; - } - Word64.prototype = { - and: function Word64_and(word) { - this.high &= word.high; - this.low &= word.low; - }, - xor: function Word64_xor(word) { - this.high ^= word.high; - this.low ^= word.low; - }, - - or: function Word64_or(word) { - this.high |= word.high; - this.low |= word.low; - }, - - shiftRight: function Word64_shiftRight(places) { - if (places >= 32) { - this.low = (this.high >>> (places - 32)) | 0; - this.high = 0; - } else { - this.low = (this.low >>> places) | (this.high << (32 - places)); - this.high = (this.high >>> places) | 0; - } - }, - - shiftLeft: function Word64_shiftLeft(places) { - if (places >= 32) { - this.high = this.low << (places - 32); - this.low = 0; - } else { - this.high = (this.high << places) | (this.low >>> (32 - places)); - this.low = this.low << places; - } - }, - - rotateRight: function Word64_rotateRight(places) { - var low, high; - if (places & 32) { - high = this.low; - low = this.high; - } else { - low = this.low; - high = this.high; - } - places &= 31; - this.low = (low >>> places) | (high << (32 - places)); - this.high = (high >>> places) | (low << (32 - places)); - }, - - not: function Word64_not() { - this.high = ~this.high; - this.low = ~this.low; - }, - - add: function Word64_add(word) { - var lowAdd = (this.low >>> 0) + (word.low >>> 0); - var highAdd = (this.high >>> 0) + (word.high >>> 0); - if (lowAdd > 0xFFFFFFFF) { - highAdd += 1; - } - this.low = lowAdd | 0; - this.high = highAdd | 0; - }, - - copyTo: function Word64_copyTo(bytes, offset) { - bytes[offset] = (this.high >>> 24) & 0xFF; - bytes[offset + 1] = (this.high >> 16) & 0xFF; - bytes[offset + 2] = (this.high >> 8) & 0xFF; - bytes[offset + 3] = this.high & 0xFF; - bytes[offset + 4] = (this.low >>> 24) & 0xFF; - bytes[offset + 5] = (this.low >> 16) & 0xFF; - bytes[offset + 6] = (this.low >> 8) & 0xFF; - bytes[offset + 7] = this.low & 0xFF; - }, - - assign: function Word64_assign(word) { - this.high = word.high; - this.low = word.low; - } - }; - return Word64; -})(); - -var calculateSHA256 = (function calculateSHA256Closure() { - function rotr(x, n) { - return (x >>> n) | (x << 32 - n); - } - - function ch(x, y, z) { - return (x & y) ^ (~x & z); - } - - function maj(x, y, z) { - return (x & y) ^ (x & z) ^ (y & z); - } - - function sigma(x) { - return rotr(x, 2) ^ rotr(x, 13) ^ rotr(x, 22); - } - - function sigmaPrime(x) { - return rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25); - } - - function littleSigma(x) { - return rotr(x, 7) ^ rotr(x, 18) ^ x >>> 3; - } - - function littleSigmaPrime(x) { - return rotr(x, 17) ^ rotr(x, 19) ^ x >>> 10; - } - - var k = [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, - 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, - 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, - 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, - 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, - 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, - 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, - 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, - 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2]; - - function hash(data, offset, length) { - // initial hash values - var h0 = 0x6a09e667, h1 = 0xbb67ae85, h2 = 0x3c6ef372, - h3 = 0xa54ff53a, h4 = 0x510e527f, h5 = 0x9b05688c, - h6 = 0x1f83d9ab, h7 = 0x5be0cd19; - // pre-processing - var paddedLength = Math.ceil((length + 9) / 64) * 64; - var padded = new Uint8Array(paddedLength); - var i, j, n; - for (i = 0; i < length; ++i) { - padded[i] = data[offset++]; - } - padded[i++] = 0x80; - n = paddedLength - 8; - while (i < n) { - padded[i++] = 0; - } - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = (length >>> 29) & 0xFF; - padded[i++] = (length >> 21) & 0xFF; - padded[i++] = (length >> 13) & 0xFF; - padded[i++] = (length >> 5) & 0xFF; - padded[i++] = (length << 3) & 0xFF; - var w = new Uint32Array(64); - // for each 512 bit block - for (i = 0; i < paddedLength;) { - for (j = 0; j < 16; ++j) { - w[j] = (padded[i] << 24 | (padded[i + 1] << 16) | - (padded[i + 2] << 8) | (padded[i + 3])); - i += 4; - } - - for (j = 16; j < 64; ++j) { - w[j] = littleSigmaPrime(w[j - 2]) + w[j - 7] + - littleSigma(w[j - 15]) + w[j - 16] | 0; - } - var a = h0, b = h1, c = h2, d = h3, e = h4, - f = h5, g = h6, h = h7, t1, t2; - for (j = 0; j < 64; ++j) { - t1 = h + sigmaPrime(e) + ch(e, f, g) + k[j] + w[j]; - t2 = sigma(a) + maj(a, b, c); - h = g; - g = f; - f = e; - e = (d + t1) | 0; - d = c; - c = b; - b = a; - a = (t1 + t2) | 0; - } - h0 = (h0 + a) | 0; - h1 = (h1 + b) | 0; - h2 = (h2 + c) | 0; - h3 = (h3 + d) | 0; - h4 = (h4 + e) | 0; - h5 = (h5 + f) | 0; - h6 = (h6 + g) | 0; - h7 = (h7 + h) | 0; - } - return new Uint8Array([ - (h0 >> 24) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 8) & 0xFF, (h0) & 0xFF, - (h1 >> 24) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 8) & 0xFF, (h1) & 0xFF, - (h2 >> 24) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 8) & 0xFF, (h2) & 0xFF, - (h3 >> 24) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 8) & 0xFF, (h3) & 0xFF, - (h4 >> 24) & 0xFF, (h4 >> 16) & 0xFF, (h4 >> 8) & 0xFF, (h4) & 0xFF, - (h5 >> 24) & 0xFF, (h5 >> 16) & 0xFF, (h5 >> 8) & 0xFF, (h5) & 0xFF, - (h6 >> 24) & 0xFF, (h6 >> 16) & 0xFF, (h6 >> 8) & 0xFF, (h6) & 0xFF, - (h7 >> 24) & 0xFF, (h7 >> 16) & 0xFF, (h7 >> 8) & 0xFF, (h7) & 0xFF - ]); - } - - return hash; -})(); - -var calculateSHA512 = (function calculateSHA512Closure() { - function ch(result, x, y, z, tmp) { - result.assign(x); - result.and(y); - tmp.assign(x); - tmp.not(); - tmp.and(z); - result.xor(tmp); - } - - function maj(result, x, y, z, tmp) { - result.assign(x); - result.and(y); - tmp.assign(x); - tmp.and(z); - result.xor(tmp); - tmp.assign(y); - tmp.and(z); - result.xor(tmp); - } - - function sigma(result, x, tmp) { - result.assign(x); - result.rotateRight(28); - tmp.assign(x); - tmp.rotateRight(34); - result.xor(tmp); - tmp.assign(x); - tmp.rotateRight(39); - result.xor(tmp); - } - - function sigmaPrime(result, x, tmp) { - result.assign(x); - result.rotateRight(14); - tmp.assign(x); - tmp.rotateRight(18); - result.xor(tmp); - tmp.assign(x); - tmp.rotateRight(41); - result.xor(tmp); - } - - function littleSigma(result, x, tmp) { - result.assign(x); - result.rotateRight(1); - tmp.assign(x); - tmp.rotateRight(8); - result.xor(tmp); - tmp.assign(x); - tmp.shiftRight(7); - result.xor(tmp); - } - - function littleSigmaPrime(result, x, tmp) { - result.assign(x); - result.rotateRight(19); - tmp.assign(x); - tmp.rotateRight(61); - result.xor(tmp); - tmp.assign(x); - tmp.shiftRight(6); - result.xor(tmp); - } - - var k = [ - new Word64(0x428a2f98, 0xd728ae22), new Word64(0x71374491, 0x23ef65cd), - new Word64(0xb5c0fbcf, 0xec4d3b2f), new Word64(0xe9b5dba5, 0x8189dbbc), - new Word64(0x3956c25b, 0xf348b538), new Word64(0x59f111f1, 0xb605d019), - new Word64(0x923f82a4, 0xaf194f9b), new Word64(0xab1c5ed5, 0xda6d8118), - new Word64(0xd807aa98, 0xa3030242), new Word64(0x12835b01, 0x45706fbe), - new Word64(0x243185be, 0x4ee4b28c), new Word64(0x550c7dc3, 0xd5ffb4e2), - new Word64(0x72be5d74, 0xf27b896f), new Word64(0x80deb1fe, 0x3b1696b1), - new Word64(0x9bdc06a7, 0x25c71235), new Word64(0xc19bf174, 0xcf692694), - new Word64(0xe49b69c1, 0x9ef14ad2), new Word64(0xefbe4786, 0x384f25e3), - new Word64(0x0fc19dc6, 0x8b8cd5b5), new Word64(0x240ca1cc, 0x77ac9c65), - new Word64(0x2de92c6f, 0x592b0275), new Word64(0x4a7484aa, 0x6ea6e483), - new Word64(0x5cb0a9dc, 0xbd41fbd4), new Word64(0x76f988da, 0x831153b5), - new Word64(0x983e5152, 0xee66dfab), new Word64(0xa831c66d, 0x2db43210), - new Word64(0xb00327c8, 0x98fb213f), new Word64(0xbf597fc7, 0xbeef0ee4), - new Word64(0xc6e00bf3, 0x3da88fc2), new Word64(0xd5a79147, 0x930aa725), - new Word64(0x06ca6351, 0xe003826f), new Word64(0x14292967, 0x0a0e6e70), - new Word64(0x27b70a85, 0x46d22ffc), new Word64(0x2e1b2138, 0x5c26c926), - new Word64(0x4d2c6dfc, 0x5ac42aed), new Word64(0x53380d13, 0x9d95b3df), - new Word64(0x650a7354, 0x8baf63de), new Word64(0x766a0abb, 0x3c77b2a8), - new Word64(0x81c2c92e, 0x47edaee6), new Word64(0x92722c85, 0x1482353b), - new Word64(0xa2bfe8a1, 0x4cf10364), new Word64(0xa81a664b, 0xbc423001), - new Word64(0xc24b8b70, 0xd0f89791), new Word64(0xc76c51a3, 0x0654be30), - new Word64(0xd192e819, 0xd6ef5218), new Word64(0xd6990624, 0x5565a910), - new Word64(0xf40e3585, 0x5771202a), new Word64(0x106aa070, 0x32bbd1b8), - new Word64(0x19a4c116, 0xb8d2d0c8), new Word64(0x1e376c08, 0x5141ab53), - new Word64(0x2748774c, 0xdf8eeb99), new Word64(0x34b0bcb5, 0xe19b48a8), - new Word64(0x391c0cb3, 0xc5c95a63), new Word64(0x4ed8aa4a, 0xe3418acb), - new Word64(0x5b9cca4f, 0x7763e373), new Word64(0x682e6ff3, 0xd6b2b8a3), - new Word64(0x748f82ee, 0x5defb2fc), new Word64(0x78a5636f, 0x43172f60), - new Word64(0x84c87814, 0xa1f0ab72), new Word64(0x8cc70208, 0x1a6439ec), - new Word64(0x90befffa, 0x23631e28), new Word64(0xa4506ceb, 0xde82bde9), - new Word64(0xbef9a3f7, 0xb2c67915), new Word64(0xc67178f2, 0xe372532b), - new Word64(0xca273ece, 0xea26619c), new Word64(0xd186b8c7, 0x21c0c207), - new Word64(0xeada7dd6, 0xcde0eb1e), new Word64(0xf57d4f7f, 0xee6ed178), - new Word64(0x06f067aa, 0x72176fba), new Word64(0x0a637dc5, 0xa2c898a6), - new Word64(0x113f9804, 0xbef90dae), new Word64(0x1b710b35, 0x131c471b), - new Word64(0x28db77f5, 0x23047d84), new Word64(0x32caab7b, 0x40c72493), - new Word64(0x3c9ebe0a, 0x15c9bebc), new Word64(0x431d67c4, 0x9c100d4c), - new Word64(0x4cc5d4be, 0xcb3e42b6), new Word64(0x597f299c, 0xfc657e2a), - new Word64(0x5fcb6fab, 0x3ad6faec), new Word64(0x6c44198c, 0x4a475817)]; - - function hash(data, offset, length, mode384) { - mode384 = !!mode384; - // initial hash values - var h0, h1, h2, h3, h4, h5, h6, h7; - if (!mode384) { - h0 = new Word64(0x6a09e667, 0xf3bcc908); - h1 = new Word64(0xbb67ae85, 0x84caa73b); - h2 = new Word64(0x3c6ef372, 0xfe94f82b); - h3 = new Word64(0xa54ff53a, 0x5f1d36f1); - h4 = new Word64(0x510e527f, 0xade682d1); - h5 = new Word64(0x9b05688c, 0x2b3e6c1f); - h6 = new Word64(0x1f83d9ab, 0xfb41bd6b); - h7 = new Word64(0x5be0cd19, 0x137e2179); - } - else { - // SHA384 is exactly the same - // except with different starting values and a trimmed result - h0 = new Word64(0xcbbb9d5d, 0xc1059ed8); - h1 = new Word64(0x629a292a, 0x367cd507); - h2 = new Word64(0x9159015a, 0x3070dd17); - h3 = new Word64(0x152fecd8, 0xf70e5939); - h4 = new Word64(0x67332667, 0xffc00b31); - h5 = new Word64(0x8eb44a87, 0x68581511); - h6 = new Word64(0xdb0c2e0d, 0x64f98fa7); - h7 = new Word64(0x47b5481d, 0xbefa4fa4); - } - - // pre-processing - var paddedLength = Math.ceil((length + 17) / 128) * 128; - var padded = new Uint8Array(paddedLength); - var i, j, n; - for (i = 0; i < length; ++i) { - padded[i] = data[offset++]; - } - padded[i++] = 0x80; - n = paddedLength - 16; - while (i < n) { - padded[i++] = 0; - } - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = 0; - padded[i++] = (length >>> 29) & 0xFF; - padded[i++] = (length >> 21) & 0xFF; - padded[i++] = (length >> 13) & 0xFF; - padded[i++] = (length >> 5) & 0xFF; - padded[i++] = (length << 3) & 0xFF; - - var w = new Array(80); - for (i = 0; i < 80; i++) { - w[i] = new Word64(0, 0); - } - var a = new Word64(0, 0), b = new Word64(0, 0), c = new Word64(0, 0); - var d = new Word64(0, 0), e = new Word64(0, 0), f = new Word64(0, 0); - var g = new Word64(0, 0), h = new Word64(0, 0); - var t1 = new Word64(0, 0), t2 = new Word64(0, 0); - var tmp1 = new Word64(0, 0), tmp2 = new Word64(0, 0), tmp3; - - // for each 1024 bit block - for (i = 0; i < paddedLength;) { - for (j = 0; j < 16; ++j) { - w[j].high = (padded[i] << 24) | (padded[i + 1] << 16) | - (padded[i + 2] << 8) | (padded[i + 3]); - w[j].low = (padded[i + 4]) << 24 | (padded[i + 5]) << 16 | - (padded[i + 6]) << 8 | (padded[i + 7]); - i += 8; - } - for (j = 16; j < 80; ++j) { - tmp3 = w[j]; - littleSigmaPrime(tmp3, w[j - 2], tmp2); - tmp3.add(w[j - 7]); - littleSigma(tmp1, w[j - 15], tmp2); - tmp3.add(tmp1); - tmp3.add(w[j - 16]); - } - - a.assign(h0); b.assign(h1); c.assign(h2); d.assign(h3); - e.assign(h4); f.assign(h5); g.assign(h6); h.assign(h7); - for (j = 0; j < 80; ++j) { - t1.assign(h); - sigmaPrime(tmp1, e, tmp2); - t1.add(tmp1); - ch(tmp1, e, f, g, tmp2); - t1.add(tmp1); - t1.add(k[j]); - t1.add(w[j]); - - sigma(t2, a, tmp2); - maj(tmp1, a, b, c, tmp2); - t2.add(tmp1); - - tmp3 = h; - h = g; - g = f; - f = e; - d.add(t1); - e = d; - d = c; - c = b; - b = a; - tmp3.assign(t1); - tmp3.add(t2); - a = tmp3; - } - h0.add(a); - h1.add(b); - h2.add(c); - h3.add(d); - h4.add(e); - h5.add(f); - h6.add(g); - h7.add(h); - } - - var result; - if (!mode384) { - result = new Uint8Array(64); - h0.copyTo(result,0); - h1.copyTo(result,8); - h2.copyTo(result,16); - h3.copyTo(result,24); - h4.copyTo(result,32); - h5.copyTo(result,40); - h6.copyTo(result,48); - h7.copyTo(result,56); - } - else { - result = new Uint8Array(48); - h0.copyTo(result,0); - h1.copyTo(result,8); - h2.copyTo(result,16); - h3.copyTo(result,24); - h4.copyTo(result,32); - h5.copyTo(result,40); - } - return result; - } - - return hash; -})(); -var calculateSHA384 = (function calculateSHA384Closure() { - function hash(data, offset, length) { - return calculateSHA512(data, offset, length, true); - } - - return hash; -})(); -var NullCipher = (function NullCipherClosure() { - function NullCipher() { - } - - NullCipher.prototype = { - decryptBlock: function NullCipher_decryptBlock(data) { - return data; - } - }; - - return NullCipher; -})(); - -var AES128Cipher = (function AES128CipherClosure() { - var rcon = new Uint8Array([ - 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, - 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, - 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, - 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, - 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, - 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, - 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, - 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, - 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, - 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, - 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, - 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, - 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, - 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, - 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, - 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, - 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, - 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, - 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, - 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, - 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, - 0x74, 0xe8, 0xcb, 0x8d]); - - var s = new Uint8Array([ - 0x63, 0x7c, 0x77, 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, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, - 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, - 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, - 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, - 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, - 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, - 0xb0, 0x54, 0xbb, 0x16]); - - var inv_s = new Uint8Array([ - 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, - 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, - 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, - 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, - 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, - 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, - 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, - 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, - 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, - 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, - 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, - 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, - 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, - 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, - 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, - 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, - 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, - 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, - 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, - 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, - 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, - 0x55, 0x21, 0x0c, 0x7d]); - var mixCol = new Uint8Array(256); - for (var i = 0; i < 256; i++) { - if (i < 128) { - mixCol[i] = i << 1; - } else { - mixCol[i] = (i << 1) ^ 0x1b; - } - } - var mix = new Uint32Array([ - 0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, - 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, - 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, - 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, - 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, - 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, - 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, - 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, - 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, - 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, - 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, - 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, - 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, - 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, - 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, - 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, - 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, - 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, - 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, - 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, - 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, - 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, - 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, - 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, - 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, - 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, - 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, - 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, - 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, - 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, - 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, - 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, - 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, - 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, - 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, - 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, - 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, - 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, - 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, - 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, - 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, - 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, - 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]); - - function expandKey128(cipherKey) { - var b = 176, result = new Uint8Array(b); - result.set(cipherKey); - for (var j = 16, i = 1; j < b; ++i) { - // RotWord - var t1 = result[j - 3], t2 = result[j - 2], - t3 = result[j - 1], t4 = result[j - 4]; - // SubWord - t1 = s[t1]; - t2 = s[t2]; - t3 = s[t3]; - t4 = s[t4]; - // Rcon - t1 = t1 ^ rcon[i]; - for (var n = 0; n < 4; ++n) { - result[j] = (t1 ^= result[j - 16]); - j++; - result[j] = (t2 ^= result[j - 16]); - j++; - result[j] = (t3 ^= result[j - 16]); - j++; - result[j] = (t4 ^= result[j - 16]); - j++; - } - } - return result; - } - - function decrypt128(input, key) { - var state = new Uint8Array(16); - state.set(input); - var i, j, k; - var t, u, v; - // AddRoundKey - for (j = 0, k = 160; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - for (i = 9; i >= 1; --i) { - // InvShiftRows - t = state[13]; - state[13] = state[9]; - state[9] = state[5]; - state[5] = state[1]; - state[1] = t; - t = state[14]; - u = state[10]; - state[14] = state[6]; - state[10] = state[2]; - state[6] = t; - state[2] = u; - t = state[15]; - u = state[11]; - v = state[7]; - state[15] = state[3]; - state[11] = t; - state[7] = u; - state[3] = v; - // InvSubBytes - for (j = 0; j < 16; ++j) { - state[j] = inv_s[state[j]]; - } - // AddRoundKey - for (j = 0, k = i * 16; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - // InvMixColumns - for (j = 0; j < 16; j += 4) { - var s0 = mix[state[j]], s1 = mix[state[j + 1]], - s2 = mix[state[j + 2]], s3 = mix[state[j + 3]]; - t = (s0 ^ (s1 >>> 8) ^ (s1 << 24) ^ (s2 >>> 16) ^ (s2 << 16) ^ - (s3 >>> 24) ^ (s3 << 8)); - state[j] = (t >>> 24) & 0xFF; - state[j + 1] = (t >> 16) & 0xFF; - state[j + 2] = (t >> 8) & 0xFF; - state[j + 3] = t & 0xFF; - } - } - // InvShiftRows - t = state[13]; - state[13] = state[9]; - state[9] = state[5]; - state[5] = state[1]; - state[1] = t; - t = state[14]; - u = state[10]; - state[14] = state[6]; - state[10] = state[2]; - state[6] = t; - state[2] = u; - t = state[15]; - u = state[11]; - v = state[7]; - state[15] = state[3]; - state[11] = t; - state[7] = u; - state[3] = v; - for (j = 0; j < 16; ++j) { - // InvSubBytes - state[j] = inv_s[state[j]]; - // AddRoundKey - state[j] ^= key[j]; - } - return state; - } - - function encrypt128(input, key) { - var t, u, v, k; - var state = new Uint8Array(16); - state.set(input); - for (j = 0; j < 16; ++j) { - // AddRoundKey - state[j] ^= key[j]; - } - - for (i = 1; i < 10; i++) { - //SubBytes - for (j = 0; j < 16; ++j) { - state[j] = s[state[j]]; - } - //ShiftRows - v = state[1]; - state[1] = state[5]; - state[5] = state[9]; - state[9] = state[13]; - state[13] = v; - v = state[2]; - u = state[6]; - state[2] = state[10]; - state[6] = state[14]; - state[10] = v; - state[14] = u; - v = state[3]; - u = state[7]; - t = state[11]; - state[3] = state[15]; - state[7] = v; - state[11] = u; - state[15] = t; - //MixColumns - for (var j = 0; j < 16; j += 4) { - var s0 = state[j + 0], s1 = state[j + 1]; - var s2 = state[j + 2], s3 = state[j + 3]; - t = s0 ^ s1 ^ s2 ^ s3; - state[j + 0] ^= t ^ mixCol[s0 ^ s1]; - state[j + 1] ^= t ^ mixCol[s1 ^ s2]; - state[j + 2] ^= t ^ mixCol[s2 ^ s3]; - state[j + 3] ^= t ^ mixCol[s3 ^ s0]; - } - //AddRoundKey - for (j = 0, k = i * 16; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - } - - //SubBytes - for (j = 0; j < 16; ++j) { - state[j] = s[state[j]]; - } - //ShiftRows - v = state[1]; - state[1] = state[5]; - state[5] = state[9]; - state[9] = state[13]; - state[13] = v; - v = state[2]; - u = state[6]; - state[2] = state[10]; - state[6] = state[14]; - state[10] = v; - state[14] = u; - v = state[3]; - u = state[7]; - t = state[11]; - state[3] = state[15]; - state[7] = v; - state[11] = u; - state[15] = t; - //AddRoundKey - for (j = 0, k = 160; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - return state; - } - - function AES128Cipher(key) { - this.key = expandKey128(key); - this.buffer = new Uint8Array(16); - this.bufferPosition = 0; - } - - function decryptBlock2(data, finalize) { - var i, j, ii, sourceLength = data.length, - buffer = this.buffer, bufferLength = this.bufferPosition, - result = [], iv = this.iv; - for (i = 0; i < sourceLength; ++i) { - buffer[bufferLength] = data[i]; - ++bufferLength; - if (bufferLength < 16) { - continue; - } - // buffer is full, decrypting - var plain = decrypt128(buffer, this.key); - // xor-ing the IV vector to get plain text - for (j = 0; j < 16; ++j) { - plain[j] ^= iv[j]; - } - iv = buffer; - result.push(plain); - buffer = new Uint8Array(16); - bufferLength = 0; - } - // saving incomplete buffer - this.buffer = buffer; - this.bufferLength = bufferLength; - this.iv = iv; - if (result.length === 0) { - return new Uint8Array([]); - } - // combining plain text blocks into one - var outputLength = 16 * result.length; - if (finalize) { - // undo a padding that is described in RFC 2898 - var lastBlock = result[result.length - 1]; - var psLen = lastBlock[15]; - if (psLen <= 16) { - for (i = 15, ii = 16 - psLen; i >= ii; --i) { - if (lastBlock[i] !== psLen) { - // Invalid padding, assume that the block has no padding. - psLen = 0; - break; - } - } - outputLength -= psLen; - result[result.length - 1] = lastBlock.subarray(0, 16 - psLen); - } - } - var output = new Uint8Array(outputLength); - for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { - output.set(result[i], j); - } - return output; - } - - AES128Cipher.prototype = { - decryptBlock: function AES128Cipher_decryptBlock(data, finalize) { - var i, sourceLength = data.length; - var buffer = this.buffer, bufferLength = this.bufferPosition; - // waiting for IV values -- they are at the start of the stream - for (i = 0; bufferLength < 16 && i < sourceLength; ++i, ++bufferLength) { - buffer[bufferLength] = data[i]; - } - if (bufferLength < 16) { - // need more data - this.bufferLength = bufferLength; - return new Uint8Array([]); - } - this.iv = buffer; - this.buffer = new Uint8Array(16); - this.bufferLength = 0; - // starting decryption - this.decryptBlock = decryptBlock2; - return this.decryptBlock(data.subarray(16), finalize); - }, - encrypt: function AES128Cipher_encrypt(data, iv) { - var i, j, ii, sourceLength = data.length, - buffer = this.buffer, bufferLength = this.bufferPosition, - result = []; - if (!iv) { - iv = new Uint8Array(16); - } - for (i = 0; i < sourceLength; ++i) { - buffer[bufferLength] = data[i]; - ++bufferLength; - if (bufferLength < 16) { - continue; - } - for (j = 0; j < 16; ++j) { - buffer[j] ^= iv[j]; - } - - // buffer is full, encrypting - var cipher = encrypt128(buffer, this.key); - iv = cipher; - result.push(cipher); - buffer = new Uint8Array(16); - bufferLength = 0; - } - // saving incomplete buffer - this.buffer = buffer; - this.bufferLength = bufferLength; - this.iv = iv; - if (result.length === 0) { - return new Uint8Array([]); - } - // combining plain text blocks into one - var outputLength = 16 * result.length; - var output = new Uint8Array(outputLength); - for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { - output.set(result[i], j); - } - return output; - } - }; - - return AES128Cipher; -})(); - -var AES256Cipher = (function AES256CipherClosure() { - var rcon = new Uint8Array([ - 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, - 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, - 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, - 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, - 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, - 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, - 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, - 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, - 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, - 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, - 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, - 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, - 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, - 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, - 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, - 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, - 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, - 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, - 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, - 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, - 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, - 0x74, 0xe8, 0xcb, 0x8d]); - - var s = new Uint8Array([ - 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, - 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, - 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, - 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, - 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, - 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, - 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, - 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, - 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, - 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, - 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, - 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, - 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, - 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, - 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, - 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, - 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, - 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, - 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, - 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, - 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, - 0xb0, 0x54, 0xbb, 0x16]); - - var inv_s = new Uint8Array([ - 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, - 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, - 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, - 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, - 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, - 0x6d, 0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04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, - 0x55, 0x21, 0x0c, 0x7d]); - - var mixCol = new Uint8Array(256); - for (var i = 0; i < 256; i++) { - if (i < 128) { - mixCol[i] = i << 1; - } else { - mixCol[i] = (i << 1) ^ 0x1b; - } - } - var mix = new Uint32Array([ - 0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, - 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, - 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, - 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, - 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, - 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, - 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, - 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, - 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, - 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, - 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, - 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, - 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, - 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, - 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, - 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, - 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, - 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, - 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, - 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, - 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, - 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, - 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, - 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, - 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, - 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, - 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, - 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, - 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, - 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, - 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, - 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, - 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, - 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, - 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, - 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, - 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, - 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, - 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, - 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, - 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, - 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, - 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]); - - function expandKey256(cipherKey) { - var b = 240, result = new Uint8Array(b); - var r = 1; - - result.set(cipherKey); - for (var j = 32, i = 1; j < b; ++i) { - if (j % 32 === 16) { - t1 = s[t1]; - t2 = s[t2]; - t3 = s[t3]; - t4 = s[t4]; - } else if (j % 32 === 0) { - // RotWord - var t1 = result[j - 3], t2 = result[j - 2], - t3 = result[j - 1], t4 = result[j - 4]; - // SubWord - t1 = s[t1]; - t2 = s[t2]; - t3 = s[t3]; - t4 = s[t4]; - // Rcon - t1 = t1 ^ r; - if ((r <<= 1) >= 256) { - r = (r ^ 0x1b) & 0xFF; - } - } - - for (var n = 0; n < 4; ++n) { - result[j] = (t1 ^= result[j - 32]); - j++; - result[j] = (t2 ^= result[j - 32]); - j++; - result[j] = (t3 ^= result[j - 32]); - j++; - result[j] = (t4 ^= result[j - 32]); - j++; - } - } - return result; - } - - function decrypt256(input, key) { - var state = new Uint8Array(16); - state.set(input); - var i, j, k; - var t, u, v; - // AddRoundKey - for (j = 0, k = 224; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - for (i = 13; i >= 1; --i) { - // InvShiftRows - t = state[13]; - state[13] = state[9]; - state[9] = state[5]; - state[5] = state[1]; - state[1] = t; - t = state[14]; - u = state[10]; - state[14] = state[6]; - state[10] = state[2]; - state[6] = t; - state[2] = u; - t = state[15]; - u = state[11]; - v = state[7]; - state[15] = state[3]; - state[11] = t; - state[7] = u; - state[3] = v; - // InvSubBytes - for (j = 0; j < 16; ++j) { - state[j] = inv_s[state[j]]; - } - // AddRoundKey - for (j = 0, k = i * 16; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - // InvMixColumns - for (j = 0; j < 16; j += 4) { - var s0 = mix[state[j]], s1 = mix[state[j + 1]], - s2 = mix[state[j + 2]], s3 = mix[state[j + 3]]; - t = (s0 ^ (s1 >>> 8) ^ (s1 << 24) ^ (s2 >>> 16) ^ (s2 << 16) ^ - (s3 >>> 24) ^ (s3 << 8)); - state[j] = (t >>> 24) & 0xFF; - state[j + 1] = (t >> 16) & 0xFF; - state[j + 2] = (t >> 8) & 0xFF; - state[j + 3] = t & 0xFF; - } - } - // InvShiftRows - t = state[13]; - state[13] = state[9]; - state[9] = state[5]; - state[5] = state[1]; - state[1] = t; - t = state[14]; - u = state[10]; - state[14] = state[6]; - state[10] = state[2]; - state[6] = t; - state[2] = u; - t = state[15]; - u = state[11]; - v = state[7]; - state[15] = state[3]; - state[11] = t; - state[7] = u; - state[3] = v; - for (j = 0; j < 16; ++j) { - // InvSubBytes - state[j] = inv_s[state[j]]; - // AddRoundKey - state[j] ^= key[j]; - } - return state; - } - - function encrypt256(input, key) { - var t, u, v, k; - var state = new Uint8Array(16); - state.set(input); - for (j = 0; j < 16; ++j) { - // AddRoundKey - state[j] ^= key[j]; - } - - for (i = 1; i < 14; i++) { - //SubBytes - for (j = 0; j < 16; ++j) { - state[j] = s[state[j]]; - } - //ShiftRows - v = state[1]; - state[1] = state[5]; - state[5] = state[9]; - state[9] = state[13]; - state[13] = v; - v = state[2]; - u = state[6]; - state[2] = state[10]; - state[6] = state[14]; - state[10] = v; - state[14] = u; - v = state[3]; - u = state[7]; - t = state[11]; - state[3] = state[15]; - state[7] = v; - state[11] = u; - state[15] = t; - //MixColumns - for (var j = 0; j < 16; j += 4) { - var s0 = state[j + 0], s1 = state[j + 1]; - var s2 = state[j + 2], s3 = state[j + 3]; - t = s0 ^ s1 ^ s2 ^ s3; - state[j + 0] ^= t ^ mixCol[s0 ^ s1]; - state[j + 1] ^= t ^ mixCol[s1 ^ s2]; - state[j + 2] ^= t ^ mixCol[s2 ^ s3]; - state[j + 3] ^= t ^ mixCol[s3 ^ s0]; - } - //AddRoundKey - for (j = 0, k = i * 16; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - } - - //SubBytes - for (j = 0; j < 16; ++j) { - state[j] = s[state[j]]; - } - //ShiftRows - v = state[1]; - state[1] = state[5]; - state[5] = state[9]; - state[9] = state[13]; - state[13] = v; - v = state[2]; - u = state[6]; - state[2] = state[10]; - state[6] = state[14]; - state[10] = v; - state[14] = u; - v = state[3]; - u = state[7]; - t = state[11]; - state[3] = state[15]; - state[7] = v; - state[11] = u; - state[15] = t; - //AddRoundKey - for (j = 0, k = 224; j < 16; ++j, ++k) { - state[j] ^= key[k]; - } - - return state; - - } - - function AES256Cipher(key) { - this.key = expandKey256(key); - this.buffer = new Uint8Array(16); - this.bufferPosition = 0; - } - - function decryptBlock2(data, finalize) { - var i, j, ii, sourceLength = data.length, - buffer = this.buffer, bufferLength = this.bufferPosition, - result = [], iv = this.iv; - - for (i = 0; i < sourceLength; ++i) { - buffer[bufferLength] = data[i]; - ++bufferLength; - if (bufferLength < 16) { - continue; - } - // buffer is full, decrypting - var plain = decrypt256(buffer, this.key); - // xor-ing the IV vector to get plain text - for (j = 0; j < 16; ++j) { - plain[j] ^= iv[j]; - } - iv = buffer; - result.push(plain); - buffer = new Uint8Array(16); - bufferLength = 0; - } - // saving incomplete buffer - this.buffer = buffer; - this.bufferLength = bufferLength; - this.iv = iv; - if (result.length === 0) { - return new Uint8Array([]); - } - // combining plain text blocks into one - var outputLength = 16 * result.length; - if (finalize) { - // undo a padding that is described in RFC 2898 - var lastBlock = result[result.length - 1]; - var psLen = lastBlock[15]; - if (psLen <= 16) { - for (i = 15, ii = 16 - psLen; i >= ii; --i) { - if (lastBlock[i] !== psLen) { - // Invalid padding, assume that the block has no padding. - psLen = 0; - break; - } - } - outputLength -= psLen; - result[result.length - 1] = lastBlock.subarray(0, 16 - psLen); - } - } - var output = new Uint8Array(outputLength); - for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { - output.set(result[i], j); - } - return output; - - } - - AES256Cipher.prototype = { - decryptBlock: function AES256Cipher_decryptBlock(data, finalize, iv) { - var i, sourceLength = data.length; - var buffer = this.buffer, bufferLength = this.bufferPosition; - // if not supplied an IV wait for IV values - // they are at the start of the stream - if (iv) { - this.iv = iv; - } else { - for (i = 0; bufferLength < 16 && - i < sourceLength; ++i, ++bufferLength) { - buffer[bufferLength] = data[i]; - } - if (bufferLength < 16) { - //need more data - this.bufferLength = bufferLength; - return new Uint8Array([]); - } - this.iv = buffer; - data = data.subarray(16); - } - this.buffer = new Uint8Array(16); - this.bufferLength = 0; - // starting decryption - this.decryptBlock = decryptBlock2; - return this.decryptBlock(data, finalize); - }, - encrypt: function AES256Cipher_encrypt(data, iv) { - var i, j, ii, sourceLength = data.length, - buffer = this.buffer, bufferLength = this.bufferPosition, - result = []; - if (!iv) { - iv = new Uint8Array(16); - } - for (i = 0; i < sourceLength; ++i) { - buffer[bufferLength] = data[i]; - ++bufferLength; - if (bufferLength < 16) { - continue; - } - for (j = 0; j < 16; ++j) { - buffer[j] ^= iv[j]; - } - - // buffer is full, encrypting - var cipher = encrypt256(buffer, this.key); - this.iv = cipher; - result.push(cipher); - buffer = new Uint8Array(16); - bufferLength = 0; - } - // saving incomplete buffer - this.buffer = buffer; - this.bufferLength = bufferLength; - this.iv = iv; - if (result.length === 0) { - return new Uint8Array([]); - } - // combining plain text blocks into one - var outputLength = 16 * result.length; - var output = new Uint8Array(outputLength); - for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { - output.set(result[i], j); - } - return output; - } - }; - - return AES256Cipher; -})(); - -var PDF17 = (function PDF17Closure() { - - function compareByteArrays(array1, array2) { - if (array1.length !== array2.length) { - return false; - } - for (var i = 0; i < array1.length; i++) { - if (array1[i] !== array2[i]) { - return false; - } - } - return true; - } - - function PDF17() { - } - - PDF17.prototype = { - checkOwnerPassword: function PDF17_checkOwnerPassword(password, - ownerValidationSalt, - userBytes, - ownerPassword) { - var hashData = new Uint8Array(password.length + 56); - hashData.set(password, 0); - hashData.set(ownerValidationSalt, password.length); - hashData.set(userBytes, password.length + ownerValidationSalt.length); - var result = calculateSHA256(hashData, 0, hashData.length); - return compareByteArrays(result, ownerPassword); - }, - checkUserPassword: function PDF17_checkUserPassword(password, - userValidationSalt, - userPassword) { - var hashData = new Uint8Array(password.length + 8); - hashData.set(password, 0); - hashData.set(userValidationSalt, password.length); - var result = calculateSHA256(hashData, 0, hashData.length); - return compareByteArrays(result, userPassword); - }, - getOwnerKey: function PDF17_getOwnerKey(password, ownerKeySalt, userBytes, - ownerEncryption) { - var hashData = new Uint8Array(password.length + 56); - hashData.set(password, 0); - hashData.set(ownerKeySalt, password.length); - hashData.set(userBytes, password.length + ownerKeySalt.length); - var key = calculateSHA256(hashData, 0, hashData.length); - var cipher = new AES256Cipher(key); - return cipher.decryptBlock(ownerEncryption, - false, - new Uint8Array(16)); - - }, - getUserKey: function PDF17_getUserKey(password, userKeySalt, - userEncryption) { - var hashData = new Uint8Array(password.length + 8); - hashData.set(password, 0); - hashData.set(userKeySalt, password.length); - //key is the decryption key for the UE string - var key = calculateSHA256(hashData, 0, hashData.length); - var cipher = new AES256Cipher(key); - return cipher.decryptBlock(userEncryption, - false, - new Uint8Array(16)); - } - }; - return PDF17; -})(); - -var PDF20 = (function PDF20Closure() { - - function concatArrays(array1, array2) { - var t = new Uint8Array(array1.length + array2.length); - t.set(array1, 0); - t.set(array2, array1.length); - return t; - } - - function calculatePDF20Hash(password, input, userBytes) { - //This refers to Algorithm 2.B as defined in ISO 32000-2 - var k = calculateSHA256(input, 0, input.length).subarray(0, 32); - var e = [0]; - var i = 0; - while (i < 64 || e[e.length - 1] > i - 32) { - var arrayLength = password.length + k.length + userBytes.length; - - var k1 = new Uint8Array(arrayLength * 64); - var array = concatArrays(password, k); - array = concatArrays(array, userBytes); - for (var j = 0, pos = 0; j < 64; j++, pos += arrayLength) { - k1.set(array, pos); - } - //AES128 CBC NO PADDING with - //first 16 bytes of k as the key and the second 16 as the iv. - var cipher = new AES128Cipher(k.subarray(0, 16)); - e = cipher.encrypt(k1, k.subarray(16, 32)); - //Now we have to take the first 16 bytes of an unsigned - //big endian integer... and compute the remainder - //modulo 3.... That is a fairly large number and - //JavaScript isn't going to handle that well... - //So we're using a trick that allows us to perform - //modulo math byte by byte - var remainder = 0; - for (var z = 0; z < 16; z++) { - remainder *= (256 % 3); - remainder %= 3; - remainder += ((e[z] >>> 0) % 3); - remainder %= 3; - } - if (remainder === 0) { - k = calculateSHA256(e, 0, e.length); - } - else if (remainder === 1) { - k = calculateSHA384(e, 0, e.length); - } - else if (remainder === 2) { - k = calculateSHA512(e, 0, e.length); - } - i++; - } - return k.subarray(0, 32); - } - - function PDF20() { - } - - function compareByteArrays(array1, array2) { - if (array1.length !== array2.length) { - return false; - } - for (var i = 0; i < array1.length; i++) { - if (array1[i] !== array2[i]) { - return false; - } - } - return true; - } - - PDF20.prototype = { - hash: function PDF20_hash(password, concatBytes, userBytes) { - return calculatePDF20Hash(password, concatBytes, userBytes); - }, - checkOwnerPassword: function PDF20_checkOwnerPassword(password, - ownerValidationSalt, - userBytes, - ownerPassword) { - var hashData = new Uint8Array(password.length + 56); - hashData.set(password, 0); - hashData.set(ownerValidationSalt, password.length); - hashData.set(userBytes, password.length + ownerValidationSalt.length); - var result = calculatePDF20Hash(password, hashData, userBytes); - return compareByteArrays(result, ownerPassword); - }, - checkUserPassword: function PDF20_checkUserPassword(password, - userValidationSalt, - userPassword) { - var hashData = new Uint8Array(password.length + 8); - hashData.set(password, 0); - hashData.set(userValidationSalt, password.length); - var result = calculatePDF20Hash(password, hashData, []); - return compareByteArrays(result, userPassword); - }, - getOwnerKey: function PDF20_getOwnerKey(password, ownerKeySalt, userBytes, - ownerEncryption) { - var hashData = new Uint8Array(password.length + 56); - hashData.set(password, 0); - hashData.set(ownerKeySalt, password.length); - hashData.set(userBytes, password.length + ownerKeySalt.length); - var key = calculatePDF20Hash(password, hashData, userBytes); - var cipher = new AES256Cipher(key); - return cipher.decryptBlock(ownerEncryption, - false, - new Uint8Array(16)); - - }, - getUserKey: function PDF20_getUserKey(password, userKeySalt, - userEncryption) { - var hashData = new Uint8Array(password.length + 8); - hashData.set(password, 0); - hashData.set(userKeySalt, password.length); - //key is the decryption key for the UE string - var key = calculatePDF20Hash(password, hashData, []); - var cipher = new AES256Cipher(key); - return cipher.decryptBlock(userEncryption, - false, - new Uint8Array(16)); - } - }; - return PDF20; -})(); - -var CipherTransform = (function CipherTransformClosure() { - function CipherTransform(stringCipherConstructor, streamCipherConstructor) { - this.stringCipherConstructor = stringCipherConstructor; - this.streamCipherConstructor = streamCipherConstructor; - } - - CipherTransform.prototype = { - createStream: function CipherTransform_createStream(stream, length) { - var cipher = new this.streamCipherConstructor(); - return new DecryptStream(stream, length, - function cipherTransformDecryptStream(data, finalize) { - return cipher.decryptBlock(data, finalize); - } - ); - }, - decryptString: function CipherTransform_decryptString(s) { - var cipher = new this.stringCipherConstructor(); - var data = stringToBytes(s); - data = cipher.decryptBlock(data, true); - return bytesToString(data); - } - }; - return CipherTransform; -})(); - -var CipherTransformFactory = (function CipherTransformFactoryClosure() { - var defaultPasswordBytes = new Uint8Array([ - 0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41, - 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08, - 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80, - 0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A]); - - function createEncryptionKey20(revision, password, ownerPassword, - ownerValidationSalt, ownerKeySalt, uBytes, - userPassword, userValidationSalt, userKeySalt, - ownerEncryption, userEncryption, perms) { - if (password) { - var passwordLength = Math.min(127, password.length); - password = password.subarray(0, passwordLength); - } else { - password = []; - } - var pdfAlgorithm; - if (revision === 6) { - pdfAlgorithm = new PDF20(); - } else { - pdfAlgorithm = new PDF17(); - } - - if (pdfAlgorithm.checkUserPassword(password, userValidationSalt, - userPassword)) { - return pdfAlgorithm.getUserKey(password, userKeySalt, userEncryption); - } else if (password.length && pdfAlgorithm.checkOwnerPassword(password, - ownerValidationSalt, - uBytes, - ownerPassword)) { - return pdfAlgorithm.getOwnerKey(password, ownerKeySalt, uBytes, - ownerEncryption); - } - - return null; - } - - function prepareKeyData(fileId, password, ownerPassword, userPassword, - flags, revision, keyLength, encryptMetadata) { - var hashDataSize = 40 + ownerPassword.length + fileId.length; - var hashData = new Uint8Array(hashDataSize), i = 0, j, n; - if (password) { - n = Math.min(32, password.length); - for (; i < n; ++i) { - hashData[i] = password[i]; - } - } - j = 0; - while (i < 32) { - hashData[i++] = defaultPasswordBytes[j++]; - } - // as now the padded password in the hashData[0..i] - for (j = 0, n = ownerPassword.length; j < n; ++j) { - hashData[i++] = ownerPassword[j]; - } - hashData[i++] = flags & 0xFF; - hashData[i++] = (flags >> 8) & 0xFF; - hashData[i++] = (flags >> 16) & 0xFF; - hashData[i++] = (flags >>> 24) & 0xFF; - for (j = 0, n = fileId.length; j < n; ++j) { - hashData[i++] = fileId[j]; - } - if (revision >= 4 && !encryptMetadata) { - hashData[i++] = 0xFF; - hashData[i++] = 0xFF; - hashData[i++] = 0xFF; - hashData[i++] = 0xFF; - } - var hash = calculateMD5(hashData, 0, i); - var keyLengthInBytes = keyLength >> 3; - if (revision >= 3) { - for (j = 0; j < 50; ++j) { - hash = calculateMD5(hash, 0, keyLengthInBytes); - } - } - var encryptionKey = hash.subarray(0, keyLengthInBytes); - var cipher, checkData; - - if (revision >= 3) { - for (i = 0; i < 32; ++i) { - hashData[i] = defaultPasswordBytes[i]; - } - for (j = 0, n = fileId.length; j < n; ++j) { - hashData[i++] = fileId[j]; - } - cipher = new ARCFourCipher(encryptionKey); - checkData = cipher.encryptBlock(calculateMD5(hashData, 0, i)); - n = encryptionKey.length; - var derivedKey = new Uint8Array(n), k; - for (j = 1; j <= 19; ++j) { - for (k = 0; k < n; ++k) { - derivedKey[k] = encryptionKey[k] ^ j; - } - cipher = new ARCFourCipher(derivedKey); - checkData = cipher.encryptBlock(checkData); - } - for (j = 0, n = checkData.length; j < n; ++j) { - if (userPassword[j] !== checkData[j]) { - return null; - } - } - } else { - cipher = new ARCFourCipher(encryptionKey); - checkData = cipher.encryptBlock(defaultPasswordBytes); - for (j = 0, n = checkData.length; j < n; ++j) { - if (userPassword[j] !== checkData[j]) { - return null; - } - } - } - return encryptionKey; - } - - function decodeUserPassword(password, ownerPassword, revision, keyLength) { - var hashData = new Uint8Array(32), i = 0, j, n; - n = Math.min(32, password.length); - for (; i < n; ++i) { - hashData[i] = password[i]; - } - j = 0; - while (i < 32) { - hashData[i++] = defaultPasswordBytes[j++]; - } - var hash = calculateMD5(hashData, 0, i); - var keyLengthInBytes = keyLength >> 3; - if (revision >= 3) { - for (j = 0; j < 50; ++j) { - hash = calculateMD5(hash, 0, hash.length); - } - } - - var cipher, userPassword; - if (revision >= 3) { - userPassword = ownerPassword; - var derivedKey = new Uint8Array(keyLengthInBytes), k; - for (j = 19; j >= 0; j--) { - for (k = 0; k < keyLengthInBytes; ++k) { - derivedKey[k] = hash[k] ^ j; - } - cipher = new ARCFourCipher(derivedKey); - userPassword = cipher.encryptBlock(userPassword); - } - } else { - cipher = new ARCFourCipher(hash.subarray(0, keyLengthInBytes)); - userPassword = cipher.encryptBlock(ownerPassword); - } - return userPassword; - } - - var identityName = Name.get('Identity'); - - function CipherTransformFactory(dict, fileId, password) { - var filter = dict.get('Filter'); - if (!isName(filter, 'Standard')) { - error('unknown encryption method'); - } - this.dict = dict; - var algorithm = dict.get('V'); - if (!isInt(algorithm) || - (algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && - algorithm !== 5)) { - error('unsupported encryption algorithm'); - } - this.algorithm = algorithm; - var keyLength = dict.get('Length'); - if (!keyLength) { - // Spec asks to rely on encryption dictionary's Length entry, however - // some PDFs don't have it. Trying to recover. - if (algorithm <= 3) { - // For 1 and 2 it's fixed to 40-bit, for 3 40-bit is a minimal value. - keyLength = 40; - } else { - // Trying to find default handler -- it usually has Length. - var cfDict = dict.get('CF'); - var streamCryptoName = dict.get('StmF'); - if (isDict(cfDict) && isName(streamCryptoName)) { - var handlerDict = cfDict.get(streamCryptoName.name); - keyLength = (handlerDict && handlerDict.get('Length')) || 128; - if (keyLength < 40) { - // Sometimes it's incorrect value of bits, generators specify bytes. - keyLength <<= 3; - } - } - } - } - if (!isInt(keyLength) || - keyLength < 40 || (keyLength % 8) !== 0) { - error('invalid key length'); - } - - // prepare keys - var ownerPassword = stringToBytes(dict.get('O')).subarray(0, 32); - var userPassword = stringToBytes(dict.get('U')).subarray(0, 32); - var flags = dict.get('P'); - var revision = dict.get('R'); - // meaningful when V is 4 or 5 - var encryptMetadata = ((algorithm === 4 || algorithm === 5) && - dict.get('EncryptMetadata') !== false); - this.encryptMetadata = encryptMetadata; - - var fileIdBytes = stringToBytes(fileId); - var passwordBytes; - if (password) { - if (revision === 6) { - try { - password = utf8StringToString(password); - } catch (ex) { - warn('CipherTransformFactory: ' + - 'Unable to convert UTF8 encoded password.'); - } - } - passwordBytes = stringToBytes(password); - } - - var encryptionKey; - if (algorithm !== 5) { - encryptionKey = prepareKeyData(fileIdBytes, passwordBytes, - ownerPassword, userPassword, flags, - revision, keyLength, encryptMetadata); - } - else { - var ownerValidationSalt = stringToBytes(dict.get('O')).subarray(32, 40); - var ownerKeySalt = stringToBytes(dict.get('O')).subarray(40, 48); - var uBytes = stringToBytes(dict.get('U')).subarray(0, 48); - var userValidationSalt = stringToBytes(dict.get('U')).subarray(32, 40); - var userKeySalt = stringToBytes(dict.get('U')).subarray(40, 48); - var ownerEncryption = stringToBytes(dict.get('OE')); - var userEncryption = stringToBytes(dict.get('UE')); - var perms = stringToBytes(dict.get('Perms')); - encryptionKey = - createEncryptionKey20(revision, passwordBytes, - ownerPassword, ownerValidationSalt, - ownerKeySalt, uBytes, - userPassword, userValidationSalt, - userKeySalt, ownerEncryption, - userEncryption, perms); - } - if (!encryptionKey && !password) { - throw new PasswordException('No password given', - PasswordResponses.NEED_PASSWORD); - } else if (!encryptionKey && password) { - // Attempting use the password as an owner password - var decodedPassword = decodeUserPassword(passwordBytes, ownerPassword, - revision, keyLength); - encryptionKey = prepareKeyData(fileIdBytes, decodedPassword, - ownerPassword, userPassword, flags, - revision, keyLength, encryptMetadata); - } - - if (!encryptionKey) { - throw new PasswordException('Incorrect Password', - PasswordResponses.INCORRECT_PASSWORD); - } - - this.encryptionKey = encryptionKey; - - if (algorithm >= 4) { - this.cf = dict.get('CF'); - this.stmf = dict.get('StmF') || identityName; - this.strf = dict.get('StrF') || identityName; - this.eff = dict.get('EFF') || this.stmf; - } - } - - function buildObjectKey(num, gen, encryptionKey, isAes) { - var key = new Uint8Array(encryptionKey.length + 9), i, n; - for (i = 0, n = encryptionKey.length; i < n; ++i) { - key[i] = encryptionKey[i]; - } - key[i++] = num & 0xFF; - key[i++] = (num >> 8) & 0xFF; - key[i++] = (num >> 16) & 0xFF; - key[i++] = gen & 0xFF; - key[i++] = (gen >> 8) & 0xFF; - if (isAes) { - key[i++] = 0x73; - key[i++] = 0x41; - key[i++] = 0x6C; - key[i++] = 0x54; - } - var hash = calculateMD5(key, 0, i); - return hash.subarray(0, Math.min(encryptionKey.length + 5, 16)); - } - - function buildCipherConstructor(cf, name, num, gen, key) { - var cryptFilter = cf.get(name.name); - var cfm; - if (cryptFilter !== null && cryptFilter !== undefined) { - cfm = cryptFilter.get('CFM'); - } - if (!cfm || cfm.name === 'None') { - return function cipherTransformFactoryBuildCipherConstructorNone() { - return new NullCipher(); - }; - } - if ('V2' === cfm.name) { - return function cipherTransformFactoryBuildCipherConstructorV2() { - return new ARCFourCipher(buildObjectKey(num, gen, key, false)); - }; - } - if ('AESV2' === cfm.name) { - return function cipherTransformFactoryBuildCipherConstructorAESV2() { - return new AES128Cipher(buildObjectKey(num, gen, key, true)); - }; - } - if ('AESV3' === cfm.name) { - return function cipherTransformFactoryBuildCipherConstructorAESV3() { - return new AES256Cipher(key); - }; - } - error('Unknown crypto method'); - } - - CipherTransformFactory.prototype = { - createCipherTransform: - function CipherTransformFactory_createCipherTransform(num, gen) { - if (this.algorithm === 4 || this.algorithm === 5) { - return new CipherTransform( - buildCipherConstructor(this.cf, this.stmf, - num, gen, this.encryptionKey), - buildCipherConstructor(this.cf, this.strf, - num, gen, this.encryptionKey)); - } - // algorithms 1 and 2 - var key = buildObjectKey(num, gen, this.encryptionKey, false); - var cipherConstructor = function buildCipherCipherConstructor() { - return new ARCFourCipher(key); - }; - return new CipherTransform(cipherConstructor, cipherConstructor); - } - }; - - return CipherTransformFactory; -})(); - -exports.AES128Cipher = AES128Cipher; -exports.AES256Cipher = AES256Cipher; -exports.ARCFourCipher = ARCFourCipher; -exports.CipherTransformFactory = CipherTransformFactory; -exports.PDF17 = PDF17; -exports.PDF20 = PDF20; -exports.calculateMD5 = calculateMD5; -exports.calculateSHA256 = calculateSHA256; -exports.calculateSHA384 = calculateSHA384; -exports.calculateSHA512 = calculateSHA512; -})); - -(function (root, factory) { - { - factory((root.pdfjsCoreFontRenderer = {}), root.pdfjsSharedUtil, - root.pdfjsCoreStream, root.pdfjsCoreGlyphList, root.pdfjsCoreEncodings, - root.pdfjsCoreCFFParser); - } -}(this, function (exports, sharedUtil, coreStream, coreGlyphList, - coreEncodings, coreCFFParser) { - -var Util = sharedUtil.Util; -var bytesToString = sharedUtil.bytesToString; -var error = sharedUtil.error; -var Stream = coreStream.Stream; -var getGlyphsUnicode = coreGlyphList.getGlyphsUnicode; -var StandardEncoding = coreEncodings.StandardEncoding; -var CFFParser = coreCFFParser.CFFParser; - -var FontRendererFactory = (function FontRendererFactoryClosure() { - function getLong(data, offset) { - return (data[offset] << 24) | (data[offset + 1] << 16) | - (data[offset + 2] << 8) | data[offset + 3]; - } - - function getUshort(data, offset) { - return (data[offset] << 8) | data[offset + 1]; - } - - function parseCmap(data, start, end) { - var offset = (getUshort(data, start + 2) === 1 ? - getLong(data, start + 8) : getLong(data, start + 16)); - var format = getUshort(data, start + offset); - var length, ranges, p, i; - if (format === 4) { - length = getUshort(data, start + offset + 2); - var segCount = getUshort(data, start + offset + 6) >> 1; - p = start + offset + 14; - ranges = []; - for (i = 0; i < segCount; i++, p += 2) { - ranges[i] = {end: getUshort(data, p)}; - } - p += 2; - for (i = 0; i < segCount; i++, p += 2) { - ranges[i].start = getUshort(data, p); - } - for (i = 0; i < segCount; i++, p += 2) { - ranges[i].idDelta = getUshort(data, p); - } - for (i = 0; i < segCount; i++, p += 2) { - var idOffset = getUshort(data, p); - if (idOffset === 0) { - continue; - } - ranges[i].ids = []; - for (var j = 0, jj = ranges[i].end - ranges[i].start + 1; j < jj; j++) { - ranges[i].ids[j] = getUshort(data, p + idOffset); - idOffset += 2; - } - } - return ranges; - } else if (format === 12) { - length = getLong(data, start + offset + 4); - var groups = getLong(data, start + offset + 12); - p = start + offset + 16; - ranges = []; - for (i = 0; i < groups; i++) { - ranges.push({ - start: getLong(data, p), - end: getLong(data, p + 4), - idDelta: getLong(data, p + 8) - getLong(data, p) - }); - p += 12; - } - return ranges; - } - error('not supported cmap: ' + format); - } - - function parseCff(data, start, end, seacAnalysisEnabled) { - var properties = {}; - var parser = new CFFParser(new Stream(data, start, end - start), - properties, seacAnalysisEnabled); - var cff = parser.parse(); - return { - glyphs: cff.charStrings.objects, - subrs: (cff.topDict.privateDict && cff.topDict.privateDict.subrsIndex && - cff.topDict.privateDict.subrsIndex.objects), - gsubrs: cff.globalSubrIndex && cff.globalSubrIndex.objects - }; - } - - function parseGlyfTable(glyf, loca, isGlyphLocationsLong) { - var itemSize, itemDecode; - if (isGlyphLocationsLong) { - itemSize = 4; - itemDecode = function fontItemDecodeLong(data, offset) { - return (data[offset] << 24) | (data[offset + 1] << 16) | - (data[offset + 2] << 8) | data[offset + 3]; - }; - } else { - itemSize = 2; - itemDecode = function fontItemDecode(data, offset) { - return (data[offset] << 9) | (data[offset + 1] << 1); - }; - } - var glyphs = []; - var startOffset = itemDecode(loca, 0); - for (var j = itemSize; j < loca.length; j += itemSize) { - var endOffset = itemDecode(loca, j); - glyphs.push(glyf.subarray(startOffset, endOffset)); - startOffset = endOffset; - } - return glyphs; - } - - function lookupCmap(ranges, unicode) { - var code = unicode.charCodeAt(0), gid = 0; - var l = 0, r = ranges.length - 1; - while (l < r) { - var c = (l + r + 1) >> 1; - if (code < ranges[c].start) { - r = c - 1; - } else { - l = c; - } - } - if (ranges[l].start <= code && code <= ranges[l].end) { - gid = (ranges[l].idDelta + (ranges[l].ids ? - ranges[l].ids[code - ranges[l].start] : code)) & 0xFFFF; - } - return { - charCode: code, - glyphId: gid, - }; - } - - function compileGlyf(code, cmds, font) { - function moveTo(x, y) { - cmds.push({cmd: 'moveTo', args: [x, y]}); - } - function lineTo(x, y) { - cmds.push({cmd: 'lineTo', args: [x, y]}); - } - function quadraticCurveTo(xa, ya, x, y) { - cmds.push({cmd: 'quadraticCurveTo', args: [xa, ya, x, y]}); - } - - var i = 0; - var numberOfContours = ((code[i] << 24) | (code[i + 1] << 16)) >> 16; - var flags; - var x = 0, y = 0; - i += 10; - if (numberOfContours < 0) { - // composite glyph - do { - flags = (code[i] << 8) | code[i + 1]; - var glyphIndex = (code[i + 2] << 8) | code[i + 3]; - i += 4; - var arg1, arg2; - if ((flags & 0x01)) { - arg1 = ((code[i] << 24) | (code[i + 1] << 16)) >> 16; - arg2 = ((code[i + 2] << 24) | (code[i + 3] << 16)) >> 16; - i += 4; - } else { - arg1 = code[i++]; arg2 = code[i++]; - } - if ((flags & 0x02)) { - x = arg1; - y = arg2; - } else { - x = 0; y = 0; // TODO "they are points" ? - } - var scaleX = 1, scaleY = 1, scale01 = 0, scale10 = 0; - if ((flags & 0x08)) { - scaleX = - scaleY = ((code[i] << 24) | (code[i + 1] << 16)) / 1073741824; - i += 2; - } else if ((flags & 0x40)) { - scaleX = ((code[i] << 24) | (code[i + 1] << 16)) / 1073741824; - scaleY = ((code[i + 2] << 24) | (code[i + 3] << 16)) / 1073741824; - i += 4; - } else if ((flags & 0x80)) { - scaleX = ((code[i] << 24) | (code[i + 1] << 16)) / 1073741824; - scale01 = ((code[i + 2] << 24) | (code[i + 3] << 16)) / 1073741824; - scale10 = ((code[i + 4] << 24) | (code[i + 5] << 16)) / 1073741824; - scaleY = ((code[i + 6] << 24) | (code[i + 7] << 16)) / 1073741824; - i += 8; - } - var subglyph = font.glyphs[glyphIndex]; - if (subglyph) { - cmds.push({cmd: 'save'}); - cmds.push({cmd: 'transform', - args: [scaleX, scale01, scale10, scaleY, x, y]}); - compileGlyf(subglyph, cmds, font); - cmds.push({cmd: 'restore'}); - } - } while ((flags & 0x20)); - } else { - // simple glyph - var endPtsOfContours = []; - var j, jj; - for (j = 0; j < numberOfContours; j++) { - endPtsOfContours.push((code[i] << 8) | code[i + 1]); - i += 2; - } - var instructionLength = (code[i] << 8) | code[i + 1]; - i += 2 + instructionLength; // skipping the instructions - var numberOfPoints = endPtsOfContours[endPtsOfContours.length - 1] + 1; - var points = []; - while (points.length < numberOfPoints) { - flags = code[i++]; - var repeat = 1; - if ((flags & 0x08)) { - repeat += code[i++]; - } - while (repeat-- > 0) { - points.push({flags: flags}); - } - } - for (j = 0; j < numberOfPoints; j++) { - switch (points[j].flags & 0x12) { - case 0x00: - x += ((code[i] << 24) | (code[i + 1] << 16)) >> 16; - i += 2; - break; - case 0x02: - x -= code[i++]; - break; - case 0x12: - x += code[i++]; - break; - } - points[j].x = x; - } - for (j = 0; j < numberOfPoints; j++) { - switch (points[j].flags & 0x24) { - case 0x00: - y += ((code[i] << 24) | (code[i + 1] << 16)) >> 16; - i += 2; - break; - case 0x04: - y -= code[i++]; - break; - case 0x24: - y += code[i++]; - break; - } - points[j].y = y; - } - - var startPoint = 0; - for (i = 0; i < numberOfContours; i++) { - var endPoint = endPtsOfContours[i]; - // contours might have implicit points, which is located in the middle - // between two neighboring off-curve points - var contour = points.slice(startPoint, endPoint + 1); - if ((contour[0].flags & 1)) { - contour.push(contour[0]); // using start point at the contour end - } else if ((contour[contour.length - 1].flags & 1)) { - // first is off-curve point, trying to use one from the end - contour.unshift(contour[contour.length - 1]); - } else { - // start and end are off-curve points, creating implicit one - var p = { - flags: 1, - x: (contour[0].x + contour[contour.length - 1].x) / 2, - y: (contour[0].y + contour[contour.length - 1].y) / 2 - }; - contour.unshift(p); - contour.push(p); - } - moveTo(contour[0].x, contour[0].y); - for (j = 1, jj = contour.length; j < jj; j++) { - if ((contour[j].flags & 1)) { - lineTo(contour[j].x, contour[j].y); - } else if ((contour[j + 1].flags & 1)){ - quadraticCurveTo(contour[j].x, contour[j].y, - contour[j + 1].x, contour[j + 1].y); - j++; - } else { - quadraticCurveTo(contour[j].x, contour[j].y, - (contour[j].x + contour[j + 1].x) / 2, - (contour[j].y + contour[j + 1].y) / 2); - } - } - startPoint = endPoint + 1; - } - } - } - - function compileCharString(code, cmds, font) { - var stack = []; - var x = 0, y = 0; - var stems = 0; - - function moveTo(x, y) { - cmds.push({cmd: 'moveTo', args: [x, y]}); - } - function lineTo(x, y) { - cmds.push({cmd: 'lineTo', args: [x, y]}); - } - function bezierCurveTo(x1, y1, x2, y2, x, y) { - cmds.push({cmd: 'bezierCurveTo', args: [x1, y1, x2, y2, x, y]}); - } - - function parse(code) { - var i = 0; - while (i < code.length) { - var stackClean = false; - var v = code[i++]; - var xa, xb, ya, yb, y1, y2, y3, n, subrCode; - switch (v) { - case 1: // hstem - stems += stack.length >> 1; - stackClean = true; - break; - case 3: // vstem - stems += stack.length >> 1; - stackClean = true; - break; - case 4: // vmoveto - y += stack.pop(); - moveTo(x, y); - stackClean = true; - break; - case 5: // rlineto - while (stack.length > 0) { - x += stack.shift(); - y += stack.shift(); - lineTo(x, y); - } - break; - case 6: // hlineto - while (stack.length > 0) { - x += stack.shift(); - lineTo(x, y); - if (stack.length === 0) { - break; - } - y += stack.shift(); - lineTo(x, y); - } - break; - case 7: // vlineto - while (stack.length > 0) { - y += stack.shift(); - lineTo(x, y); - if (stack.length === 0) { - break; - } - x += stack.shift(); - lineTo(x, y); - } - break; - case 8: // rrcurveto - while (stack.length > 0) { - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - } - break; - case 10: // callsubr - n = stack.pop() + font.subrsBias; - subrCode = font.subrs[n]; - if (subrCode) { - parse(subrCode); - } - break; - case 11: // return - return; - case 12: - v = code[i++]; - switch (v) { - case 34: // flex - xa = x + stack.shift(); - xb = xa + stack.shift(); y1 = y + stack.shift(); - x = xb + stack.shift(); - bezierCurveTo(xa, y, xb, y1, x, y1); - xa = x + stack.shift(); - xb = xa + stack.shift(); - x = xb + stack.shift(); - bezierCurveTo(xa, y1, xb, y, x, y); - break; - case 35: // flex - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - stack.pop(); // fd - break; - case 36: // hflex1 - xa = x + stack.shift(); y1 = y + stack.shift(); - xb = xa + stack.shift(); y2 = y1 + stack.shift(); - x = xb + stack.shift(); - bezierCurveTo(xa, y1, xb, y2, x, y2); - xa = x + stack.shift(); - xb = xa + stack.shift(); y3 = y2 + stack.shift(); - x = xb + stack.shift(); - bezierCurveTo(xa, y2, xb, y3, x, y); - break; - case 37: // flex1 - var x0 = x, y0 = y; - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb; y = yb; - if (Math.abs(x - x0) > Math.abs(y - y0)) { - x += stack.shift(); - } else { - y += stack.shift(); - } - bezierCurveTo(xa, ya, xb, yb, x, y); - break; - default: - error('unknown operator: 12 ' + v); - } - break; - case 14: // endchar - if (stack.length >= 4) { - var achar = stack.pop(); - var bchar = stack.pop(); - y = stack.pop(); - x = stack.pop(); - cmds.push({cmd: 'save'}); - cmds.push({cmd: 'translate', args: [x, y]}); - var cmap = lookupCmap(font.cmap, String.fromCharCode( - font.glyphNameMap[StandardEncoding[achar]])); - compileCharString(font.glyphs[cmap.glyphId], cmds, font); - cmds.push({cmd: 'restore'}); - - cmap = lookupCmap(font.cmap, String.fromCharCode( - font.glyphNameMap[StandardEncoding[bchar]])); - compileCharString(font.glyphs[cmap.glyphId], cmds, font); - } - return; - case 18: // hstemhm - stems += stack.length >> 1; - stackClean = true; - break; - case 19: // hintmask - stems += stack.length >> 1; - i += (stems + 7) >> 3; - stackClean = true; - break; - case 20: // cntrmask - stems += stack.length >> 1; - i += (stems + 7) >> 3; - stackClean = true; - break; - case 21: // rmoveto - y += stack.pop(); - x += stack.pop(); - moveTo(x, y); - stackClean = true; - break; - case 22: // hmoveto - x += stack.pop(); - moveTo(x, y); - stackClean = true; - break; - case 23: // vstemhm - stems += stack.length >> 1; - stackClean = true; - break; - case 24: // rcurveline - while (stack.length > 2) { - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - } - x += stack.shift(); - y += stack.shift(); - lineTo(x, y); - break; - case 25: // rlinecurve - while (stack.length > 6) { - x += stack.shift(); - y += stack.shift(); - lineTo(x, y); - } - xa = x + stack.shift(); ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - break; - case 26: // vvcurveto - if (stack.length % 2) { - x += stack.shift(); - } - while (stack.length > 0) { - xa = x; ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb; y = yb + stack.shift(); - bezierCurveTo(xa, ya, xb, yb, x, y); - } - break; - case 27: // hhcurveto - if (stack.length % 2) { - y += stack.shift(); - } - while (stack.length > 0) { - xa = x + stack.shift(); ya = y; - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); y = yb; - bezierCurveTo(xa, ya, xb, yb, x, y); - } - break; - case 28: - stack.push(((code[i] << 24) | (code[i + 1] << 16)) >> 16); - i += 2; - break; - case 29: // callgsubr - n = stack.pop() + font.gsubrsBias; - subrCode = font.gsubrs[n]; - if (subrCode) { - parse(subrCode); - } - break; - case 30: // vhcurveto - while (stack.length > 0) { - xa = x; ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); - y = yb + (stack.length === 1 ? stack.shift() : 0); - bezierCurveTo(xa, ya, xb, yb, x, y); - if (stack.length === 0) { - break; - } - - xa = x + stack.shift(); ya = y; - xb = xa + stack.shift(); yb = ya + stack.shift(); - y = yb + stack.shift(); - x = xb + (stack.length === 1 ? stack.shift() : 0); - bezierCurveTo(xa, ya, xb, yb, x, y); - } - break; - case 31: // hvcurveto - while (stack.length > 0) { - xa = x + stack.shift(); ya = y; - xb = xa + stack.shift(); yb = ya + stack.shift(); - y = yb + stack.shift(); - x = xb + (stack.length === 1 ? stack.shift() : 0); - bezierCurveTo(xa, ya, xb, yb, x, y); - if (stack.length === 0) { - break; - } - - xa = x; ya = y + stack.shift(); - xb = xa + stack.shift(); yb = ya + stack.shift(); - x = xb + stack.shift(); - y = yb + (stack.length === 1 ? stack.shift() : 0); - bezierCurveTo(xa, ya, xb, yb, x, y); - } - break; - default: - if (v < 32) { - error('unknown operator: ' + v); - } - if (v < 247) { - stack.push(v - 139); - } else if (v < 251) { - stack.push((v - 247) * 256 + code[i++] + 108); - } else if (v < 255) { - stack.push(-(v - 251) * 256 - code[i++] - 108); - } else { - stack.push(((code[i] << 24) | (code[i + 1] << 16) | - (code[i + 2] << 8) | code[i + 3]) / 65536); - i += 4; - } - break; - } - if (stackClean) { - stack.length = 0; - } - } - } - parse(code); - } - - var noop = ''; - - function CompiledFont(fontMatrix) { - this.compiledGlyphs = Object.create(null); - this.compiledCharCodeToGlyphId = Object.create(null); - this.fontMatrix = fontMatrix; - } - CompiledFont.prototype = { - getPathJs: function (unicode) { - var cmap = lookupCmap(this.cmap, unicode); - var fn = this.compiledGlyphs[cmap.glyphId]; - if (!fn) { - fn = this.compileGlyph(this.glyphs[cmap.glyphId]); - this.compiledGlyphs[cmap.glyphId] = fn; - } - if (this.compiledCharCodeToGlyphId[cmap.charCode] === undefined) { - this.compiledCharCodeToGlyphId[cmap.charCode] = cmap.glyphId; - } - return fn; - }, - - compileGlyph: function (code) { - if (!code || code.length === 0 || code[0] === 14) { - return noop; - } - - var cmds = []; - cmds.push({cmd: 'save'}); - cmds.push({cmd: 'transform', args: this.fontMatrix.slice()}); - cmds.push({cmd: 'scale', args: ['size', '-size']}); - - this.compileGlyphImpl(code, cmds); - - cmds.push({cmd: 'restore'}); - - return cmds; - }, - - compileGlyphImpl: function () { - error('Children classes should implement this.'); - }, - - hasBuiltPath: function (unicode) { - var cmap = lookupCmap(this.cmap, unicode); - return (this.compiledGlyphs[cmap.glyphId] !== undefined && - this.compiledCharCodeToGlyphId[cmap.charCode] !== undefined); - } - }; - - function TrueTypeCompiled(glyphs, cmap, fontMatrix) { - fontMatrix = fontMatrix || [0.000488, 0, 0, 0.000488, 0, 0]; - CompiledFont.call(this, fontMatrix); - - this.glyphs = glyphs; - this.cmap = cmap; - } - - Util.inherit(TrueTypeCompiled, CompiledFont, { - compileGlyphImpl: function (code, cmds) { - compileGlyf(code, cmds, this); - } - }); - - function Type2Compiled(cffInfo, cmap, fontMatrix, glyphNameMap) { - fontMatrix = fontMatrix || [0.001, 0, 0, 0.001, 0, 0]; - CompiledFont.call(this, fontMatrix); - - this.glyphs = cffInfo.glyphs; - this.gsubrs = cffInfo.gsubrs || []; - this.subrs = cffInfo.subrs || []; - this.cmap = cmap; - this.glyphNameMap = glyphNameMap || getGlyphsUnicode(); - - this.gsubrsBias = (this.gsubrs.length < 1240 ? - 107 : (this.gsubrs.length < 33900 ? 1131 : 32768)); - this.subrsBias = (this.subrs.length < 1240 ? - 107 : (this.subrs.length < 33900 ? 1131 : 32768)); - } - - Util.inherit(Type2Compiled, CompiledFont, { - compileGlyphImpl: function (code, cmds) { - compileCharString(code, cmds, this); - } - }); - - - return { - create: function FontRendererFactory_create(font, seacAnalysisEnabled) { - var data = new Uint8Array(font.data); - var cmap, glyf, loca, cff, indexToLocFormat, unitsPerEm; - var numTables = getUshort(data, 4); - for (var i = 0, p = 12; i < numTables; i++, p += 16) { - var tag = bytesToString(data.subarray(p, p + 4)); - var offset = getLong(data, p + 8); - var length = getLong(data, p + 12); - switch (tag) { - case 'cmap': - cmap = parseCmap(data, offset, offset + length); - break; - case 'glyf': - glyf = data.subarray(offset, offset + length); - break; - case 'loca': - loca = data.subarray(offset, offset + length); - break; - case 'head': - unitsPerEm = getUshort(data, offset + 18); - indexToLocFormat = getUshort(data, offset + 50); - break; - case 'CFF ': - cff = parseCff(data, offset, offset + length, seacAnalysisEnabled); - break; - } - } - - if (glyf) { - var fontMatrix = (!unitsPerEm ? font.fontMatrix : - [1 / unitsPerEm, 0, 0, 1 / unitsPerEm, 0, 0]); - return new TrueTypeCompiled( - parseGlyfTable(glyf, loca, indexToLocFormat), cmap, fontMatrix); - } else { - return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap); - } - } - }; -})(); - -exports.FontRendererFactory = FontRendererFactory; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreParser = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreStream); - } -}(this, function (exports, sharedUtil, corePrimitives, coreStream) { - -var MissingDataException = sharedUtil.MissingDataException; -var StreamType = sharedUtil.StreamType; -var assert = sharedUtil.assert; -var error = sharedUtil.error; -var info = sharedUtil.info; -var isArray = sharedUtil.isArray; -var isInt = sharedUtil.isInt; -var isNum = sharedUtil.isNum; -var isString = sharedUtil.isString; -var warn = sharedUtil.warn; -var Cmd = corePrimitives.Cmd; -var Dict = corePrimitives.Dict; -var Name = corePrimitives.Name; -var Ref = corePrimitives.Ref; -var isCmd = corePrimitives.isCmd; -var isDict = corePrimitives.isDict; -var isName = corePrimitives.isName; -var Ascii85Stream = coreStream.Ascii85Stream; -var AsciiHexStream = coreStream.AsciiHexStream; -var CCITTFaxStream = coreStream.CCITTFaxStream; -var FlateStream = coreStream.FlateStream; -var Jbig2Stream = coreStream.Jbig2Stream; -var JpegStream = coreStream.JpegStream; -var JpxStream = coreStream.JpxStream; -var LZWStream = coreStream.LZWStream; -var NullStream = coreStream.NullStream; -var PredictorStream = coreStream.PredictorStream; -var RunLengthStream = coreStream.RunLengthStream; - -var EOF = {}; - -function isEOF(v) { - return (v === EOF); -} - -var MAX_LENGTH_TO_CACHE = 1000; - -var Parser = (function ParserClosure() { - function Parser(lexer, allowStreams, xref, recoveryMode) { - this.lexer = lexer; - this.allowStreams = allowStreams; - this.xref = xref; - this.recoveryMode = recoveryMode || false; - this.imageCache = Object.create(null); - this.refill(); - } - - Parser.prototype = { - refill: function Parser_refill() { - this.buf1 = this.lexer.getObj(); - this.buf2 = this.lexer.getObj(); - }, - shift: function Parser_shift() { - if (isCmd(this.buf2, 'ID')) { - this.buf1 = this.buf2; - this.buf2 = null; - } else { - this.buf1 = this.buf2; - this.buf2 = this.lexer.getObj(); - } - }, - tryShift: function Parser_tryShift() { - try { - this.shift(); - return true; - } catch (e) { - if (e instanceof MissingDataException) { - throw e; - } - // Upon failure, the caller should reset this.lexer.pos to a known good - // state and call this.shift() twice to reset the buffers. - return false; - } - }, - getObj: function Parser_getObj(cipherTransform) { - var buf1 = this.buf1; - this.shift(); - - if (buf1 instanceof Cmd) { - switch (buf1.cmd) { - case 'BI': // inline image - return this.makeInlineImage(cipherTransform); - case '[': // array - var array = []; - while (!isCmd(this.buf1, ']') && !isEOF(this.buf1)) { - array.push(this.getObj(cipherTransform)); - } - if (isEOF(this.buf1)) { - if (!this.recoveryMode) { - error('End of file inside array'); - } - return array; - } - this.shift(); - return array; - case '<<': // dictionary or stream - var dict = new Dict(this.xref); - while (!isCmd(this.buf1, '>>') && !isEOF(this.buf1)) { - if (!isName(this.buf1)) { - info('Malformed dictionary: key must be a name object'); - this.shift(); - continue; - } - - var key = this.buf1.name; - this.shift(); - if (isEOF(this.buf1)) { - break; - } - dict.set(key, this.getObj(cipherTransform)); - } - if (isEOF(this.buf1)) { - if (!this.recoveryMode) { - error('End of file inside dictionary'); - } - return dict; - } - - // Stream objects are not allowed inside content streams or - // object streams. - if (isCmd(this.buf2, 'stream')) { - return (this.allowStreams ? - this.makeStream(dict, cipherTransform) : dict); - } - this.shift(); - return dict; - default: // simple object - return buf1; - } - } - - if (isInt(buf1)) { // indirect reference or integer - var num = buf1; - if (isInt(this.buf1) && isCmd(this.buf2, 'R')) { - var ref = new Ref(num, this.buf1); - this.shift(); - this.shift(); - return ref; - } - return num; - } - - if (isString(buf1)) { // string - var str = buf1; - if (cipherTransform) { - str = cipherTransform.decryptString(str); - } - return str; - } - - // simple object - return buf1; - }, - /** - * Find the end of the stream by searching for the /EI\s/. - * @returns {number} The inline stream length. - */ - findDefaultInlineStreamEnd: - function Parser_findDefaultInlineStreamEnd(stream) { - var E = 0x45, I = 0x49, SPACE = 0x20, LF = 0xA, CR = 0xD; - var startPos = stream.pos, state = 0, ch, i, n, followingBytes; - while ((ch = stream.getByte()) !== -1) { - if (state === 0) { - state = (ch === E) ? 1 : 0; - } else if (state === 1) { - state = (ch === I) ? 2 : 0; - } else { - assert(state === 2); - if (ch === SPACE || ch === LF || ch === CR) { - // Let's check the next five bytes are ASCII... just be sure. - n = 5; - followingBytes = stream.peekBytes(n); - for (i = 0; i < n; i++) { - ch = followingBytes[i]; - if (ch !== LF && ch !== CR && (ch < SPACE || ch > 0x7F)) { - // Not a LF, CR, SPACE or any visible ASCII character, i.e. - // it's binary stuff. Resetting the state. - state = 0; - break; - } - } - if (state === 2) { - break; // Finished! - } - } else { - state = 0; - } - } - } - return ((stream.pos - 4) - startPos); - }, - /** - * Find the EOI (end-of-image) marker 0xFFD9 of the stream. - * @returns {number} The inline stream length. - */ - findDCTDecodeInlineStreamEnd: - function Parser_findDCTDecodeInlineStreamEnd(stream) { - var startPos = stream.pos, foundEOI = false, b, markerLength, length; - while ((b = stream.getByte()) !== -1) { - if (b !== 0xFF) { // Not a valid marker. - continue; - } - switch (stream.getByte()) { - case 0x00: // Byte stuffing. - // 0xFF00 appears to be a very common byte sequence in JPEG images. - break; - - case 0xFF: // Fill byte. - // Avoid skipping a valid marker, resetting the stream position. - stream.skip(-1); - break; - - case 0xD9: // EOI - foundEOI = true; - break; - - case 0xC0: // SOF0 - case 0xC1: // SOF1 - case 0xC2: // SOF2 - case 0xC3: // SOF3 - - case 0xC5: // SOF5 - case 0xC6: // SOF6 - case 0xC7: // SOF7 - - case 0xC9: // SOF9 - case 0xCA: // SOF10 - case 0xCB: // SOF11 - - case 0xCD: // SOF13 - case 0xCE: // SOF14 - case 0xCF: // SOF15 - - case 0xC4: // DHT - case 0xCC: // DAC - - case 0xDA: // SOS - case 0xDB: // DQT - case 0xDC: // DNL - case 0xDD: // DRI - case 0xDE: // DHP - case 0xDF: // EXP - - case 0xE0: // APP0 - case 0xE1: // APP1 - case 0xE2: // APP2 - case 0xE3: // APP3 - case 0xE4: // APP4 - case 0xE5: // APP5 - case 0xE6: // APP6 - case 0xE7: // APP7 - case 0xE8: // APP8 - case 0xE9: // APP9 - case 0xEA: // APP10 - case 0xEB: // APP11 - case 0xEC: // APP12 - case 0xED: // APP13 - case 0xEE: // APP14 - case 0xEF: // APP15 - - case 0xFE: // COM - // The marker should be followed by the length of the segment. - markerLength = stream.getUint16(); - if (markerLength > 2) { - // |markerLength| contains the byte length of the marker segment, - // including its own length (2 bytes) and excluding the marker. - stream.skip(markerLength - 2); // Jump to the next marker. - } else { - // The marker length is invalid, resetting the stream position. - stream.skip(-2); - } - break; - } - if (foundEOI) { - break; - } - } - length = stream.pos - startPos; - if (b === -1) { - warn('Inline DCTDecode image stream: ' + - 'EOI marker not found, searching for /EI/ instead.'); - stream.skip(-length); // Reset the stream position. - return this.findDefaultInlineStreamEnd(stream); - } - this.inlineStreamSkipEI(stream); - return length; - }, - /** - * Find the EOD (end-of-data) marker '~>' (i.e. TILDE + GT) of the stream. - * @returns {number} The inline stream length. - */ - findASCII85DecodeInlineStreamEnd: - function Parser_findASCII85DecodeInlineStreamEnd(stream) { - var TILDE = 0x7E, GT = 0x3E; - var startPos = stream.pos, ch, length; - while ((ch = stream.getByte()) !== -1) { - if (ch === TILDE && stream.peekByte() === GT) { - stream.skip(); - break; - } - } - length = stream.pos - startPos; - if (ch === -1) { - warn('Inline ASCII85Decode image stream: ' + - 'EOD marker not found, searching for /EI/ instead.'); - stream.skip(-length); // Reset the stream position. - return this.findDefaultInlineStreamEnd(stream); - } - this.inlineStreamSkipEI(stream); - return length; - }, - /** - * Find the EOD (end-of-data) marker '>' (i.e. GT) of the stream. - * @returns {number} The inline stream length. - */ - findASCIIHexDecodeInlineStreamEnd: - function Parser_findASCIIHexDecodeInlineStreamEnd(stream) { - var GT = 0x3E; - var startPos = stream.pos, ch, length; - while ((ch = stream.getByte()) !== -1) { - if (ch === GT) { - break; - } - } - length = stream.pos - startPos; - if (ch === -1) { - warn('Inline ASCIIHexDecode image stream: ' + - 'EOD marker not found, searching for /EI/ instead.'); - stream.skip(-length); // Reset the stream position. - return this.findDefaultInlineStreamEnd(stream); - } - this.inlineStreamSkipEI(stream); - return length; - }, - /** - * Skip over the /EI/ for streams where we search for an EOD marker. - */ - inlineStreamSkipEI: function Parser_inlineStreamSkipEI(stream) { - var E = 0x45, I = 0x49; - var state = 0, ch; - while ((ch = stream.getByte()) !== -1) { - if (state === 0) { - state = (ch === E) ? 1 : 0; - } else if (state === 1) { - state = (ch === I) ? 2 : 0; - } else if (state === 2) { - break; - } - } - }, - makeInlineImage: function Parser_makeInlineImage(cipherTransform) { - var lexer = this.lexer; - var stream = lexer.stream; - - // Parse dictionary. - var dict = new Dict(this.xref); - while (!isCmd(this.buf1, 'ID') && !isEOF(this.buf1)) { - if (!isName(this.buf1)) { - error('Dictionary key must be a name object'); - } - var key = this.buf1.name; - this.shift(); - if (isEOF(this.buf1)) { - break; - } - dict.set(key, this.getObj(cipherTransform)); - } - - // Extract the name of the first (i.e. the current) image filter. - var filter = dict.get('Filter', 'F'), filterName; - if (isName(filter)) { - filterName = filter.name; - } else if (isArray(filter) && isName(filter[0])) { - filterName = filter[0].name; - } - - // Parse image stream. - var startPos = stream.pos, length, i, ii; - if (filterName === 'DCTDecode' || filterName === 'DCT') { - length = this.findDCTDecodeInlineStreamEnd(stream); - } else if (filterName === 'ASCII85Decide' || filterName === 'A85') { - length = this.findASCII85DecodeInlineStreamEnd(stream); - } else if (filterName === 'ASCIIHexDecode' || filterName === 'AHx') { - length = this.findASCIIHexDecodeInlineStreamEnd(stream); - } else { - length = this.findDefaultInlineStreamEnd(stream); - } - var imageStream = stream.makeSubStream(startPos, length, dict); - - // Cache all images below the MAX_LENGTH_TO_CACHE threshold by their - // adler32 checksum. - var adler32; - if (length < MAX_LENGTH_TO_CACHE) { - var imageBytes = imageStream.getBytes(); - imageStream.reset(); - - var a = 1; - var b = 0; - for (i = 0, ii = imageBytes.length; i < ii; ++i) { - // No modulo required in the loop if imageBytes.length < 5552. - a += imageBytes[i] & 0xff; - b += a; - } - adler32 = ((b % 65521) << 16) | (a % 65521); - - if (this.imageCache.adler32 === adler32) { - this.buf2 = Cmd.get('EI'); - this.shift(); - - this.imageCache[adler32].reset(); - return this.imageCache[adler32]; - } - } - - if (cipherTransform) { - imageStream = cipherTransform.createStream(imageStream, length); - } - - imageStream = this.filter(imageStream, dict, length); - imageStream.dict = dict; - if (adler32 !== undefined) { - imageStream.cacheKey = 'inline_' + length + '_' + adler32; - this.imageCache[adler32] = imageStream; - } - - this.buf2 = Cmd.get('EI'); - this.shift(); - - return imageStream; - }, - makeStream: function Parser_makeStream(dict, cipherTransform) { - var lexer = this.lexer; - var stream = lexer.stream; - - // get stream start position - lexer.skipToNextLine(); - var pos = stream.pos - 1; - - // get length - var length = dict.get('Length'); - if (!isInt(length)) { - info('Bad ' + length + ' attribute in stream'); - length = 0; - } - - // skip over the stream data - stream.pos = pos + length; - lexer.nextChar(); - - // Shift '>>' and check whether the new object marks the end of the stream - if (this.tryShift() && isCmd(this.buf2, 'endstream')) { - this.shift(); // 'stream' - } else { - // bad stream length, scanning for endstream - stream.pos = pos; - var SCAN_BLOCK_SIZE = 2048; - var ENDSTREAM_SIGNATURE_LENGTH = 9; - var ENDSTREAM_SIGNATURE = [0x65, 0x6E, 0x64, 0x73, 0x74, 0x72, 0x65, - 0x61, 0x6D]; - var skipped = 0, found = false, i, j; - while (stream.pos < stream.end) { - var scanBytes = stream.peekBytes(SCAN_BLOCK_SIZE); - var scanLength = scanBytes.length - ENDSTREAM_SIGNATURE_LENGTH; - if (scanLength <= 0) { - break; - } - found = false; - i = 0; - while (i < scanLength) { - j = 0; - while (j < ENDSTREAM_SIGNATURE_LENGTH && - scanBytes[i + j] === ENDSTREAM_SIGNATURE[j]) { - j++; - } - if (j >= ENDSTREAM_SIGNATURE_LENGTH) { - found = true; - break; - } - i++; - } - if (found) { - skipped += i; - stream.pos += i; - break; - } - skipped += scanLength; - stream.pos += scanLength; - } - if (!found) { - error('Missing endstream'); - } - length = skipped; - - lexer.nextChar(); - this.shift(); - this.shift(); - } - this.shift(); // 'endstream' - - stream = stream.makeSubStream(pos, length, dict); - if (cipherTransform) { - stream = cipherTransform.createStream(stream, length); - } - stream = this.filter(stream, dict, length); - stream.dict = dict; - return stream; - }, - filter: function Parser_filter(stream, dict, length) { - var filter = dict.get('Filter', 'F'); - var params = dict.get('DecodeParms', 'DP'); - if (isName(filter)) { - return this.makeFilter(stream, filter.name, length, params); - } - - var maybeLength = length; - if (isArray(filter)) { - var filterArray = filter; - var paramsArray = params; - for (var i = 0, ii = filterArray.length; i < ii; ++i) { - filter = filterArray[i]; - if (!isName(filter)) { - error('Bad filter name: ' + filter); - } - - params = null; - if (isArray(paramsArray) && (i in paramsArray)) { - params = paramsArray[i]; - } - stream = this.makeFilter(stream, filter.name, maybeLength, params); - // after the first stream the length variable is invalid - maybeLength = null; - } - } - return stream; - }, - makeFilter: function Parser_makeFilter(stream, name, maybeLength, params) { - if (stream.dict.get('Length') === 0 && !maybeLength) { - warn('Empty "' + name + '" stream.'); - return new NullStream(stream); - } - try { - if (params && this.xref) { - params = this.xref.fetchIfRef(params); - } - var xrefStreamStats = this.xref.stats.streamTypes; - if (name === 'FlateDecode' || name === 'Fl') { - xrefStreamStats[StreamType.FLATE] = true; - if (params) { - return new PredictorStream(new FlateStream(stream, maybeLength), - maybeLength, params); - } - return new FlateStream(stream, maybeLength); - } - if (name === 'LZWDecode' || name === 'LZW') { - xrefStreamStats[StreamType.LZW] = true; - var earlyChange = 1; - if (params) { - if (params.has('EarlyChange')) { - earlyChange = params.get('EarlyChange'); - } - return new PredictorStream( - new LZWStream(stream, maybeLength, earlyChange), - maybeLength, params); - } - return new LZWStream(stream, maybeLength, earlyChange); - } - if (name === 'DCTDecode' || name === 'DCT') { - xrefStreamStats[StreamType.DCT] = true; - return new JpegStream(stream, maybeLength, stream.dict); - } - if (name === 'JPXDecode' || name === 'JPX') { - xrefStreamStats[StreamType.JPX] = true; - return new JpxStream(stream, maybeLength, stream.dict); - } - if (name === 'ASCII85Decode' || name === 'A85') { - xrefStreamStats[StreamType.A85] = true; - return new Ascii85Stream(stream, maybeLength); - } - if (name === 'ASCIIHexDecode' || name === 'AHx') { - xrefStreamStats[StreamType.AHX] = true; - return new AsciiHexStream(stream, maybeLength); - } - if (name === 'CCITTFaxDecode' || name === 'CCF') { - xrefStreamStats[StreamType.CCF] = true; - return new CCITTFaxStream(stream, maybeLength, params); - } - if (name === 'RunLengthDecode' || name === 'RL') { - xrefStreamStats[StreamType.RL] = true; - return new RunLengthStream(stream, maybeLength); - } - if (name === 'JBIG2Decode') { - xrefStreamStats[StreamType.JBIG] = true; - return new Jbig2Stream(stream, maybeLength, stream.dict); - } - warn('filter "' + name + '" not supported yet'); - return stream; - } catch (ex) { - if (ex instanceof MissingDataException) { - throw ex; - } - warn('Invalid stream: \"' + ex + '\"'); - return new NullStream(stream); - } - } - }; - - return Parser; -})(); - -var Lexer = (function LexerClosure() { - function Lexer(stream, knownCommands) { - this.stream = stream; - this.nextChar(); - - // While lexing, we build up many strings one char at a time. Using += for - // this can result in lots of garbage strings. It's better to build an - // array of single-char strings and then join() them together at the end. - // And reusing a single array (i.e. |this.strBuf|) over and over for this - // purpose uses less memory than using a new array for each string. - this.strBuf = []; - - // The PDFs might have "glued" commands with other commands, operands or - // literals, e.g. "q1". The knownCommands is a dictionary of the valid - // commands and their prefixes. The prefixes are built the following way: - // if there a command that is a prefix of the other valid command or - // literal (e.g. 'f' and 'false') the following prefixes must be included, - // 'fa', 'fal', 'fals'. The prefixes are not needed, if the command has no - // other commands or literals as a prefix. The knowCommands is optional. - this.knownCommands = knownCommands; - } - - // A '1' in this array means the character is white space. A '1' or - // '2' means the character ends a name or command. - var specialChars = [ - 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, // 0x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1x - 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, // 2x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, // 3x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 4x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 5x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 6x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 7x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 8x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 9x - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ax - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // bx - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // cx - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // dx - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ex - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // fx - ]; - - function toHexDigit(ch) { - if (ch >= 0x30 && ch <= 0x39) { // '0'-'9' - return ch & 0x0F; - } - if ((ch >= 0x41 && ch <= 0x46) || (ch >= 0x61 && ch <= 0x66)) { - // 'A'-'F', 'a'-'f' - return (ch & 0x0F) + 9; - } - return -1; - } - - Lexer.prototype = { - nextChar: function Lexer_nextChar() { - return (this.currentChar = this.stream.getByte()); - }, - peekChar: function Lexer_peekChar() { - return this.stream.peekByte(); - }, - getNumber: function Lexer_getNumber() { - var ch = this.currentChar; - var eNotation = false; - var divideBy = 0; // different from 0 if it's a floating point value - var sign = 1; - - if (ch === 0x2D) { // '-' - sign = -1; - ch = this.nextChar(); - - if (ch === 0x2D) { // '-' - // Ignore double negative (this is consistent with Adobe Reader). - ch = this.nextChar(); - } - } else if (ch === 0x2B) { // '+' - ch = this.nextChar(); - } - if (ch === 0x2E) { // '.' - divideBy = 10; - ch = this.nextChar(); - } - if (ch < 0x30 || ch > 0x39) { // '0' - '9' - error('Invalid number: ' + String.fromCharCode(ch)); - return 0; - } - - var baseValue = ch - 0x30; // '0' - var powerValue = 0; - var powerValueSign = 1; - - while ((ch = this.nextChar()) >= 0) { - if (0x30 <= ch && ch <= 0x39) { // '0' - '9' - var currentDigit = ch - 0x30; // '0' - if (eNotation) { // We are after an 'e' or 'E' - powerValue = powerValue * 10 + currentDigit; - } else { - if (divideBy !== 0) { // We are after a point - divideBy *= 10; - } - baseValue = baseValue * 10 + currentDigit; - } - } else if (ch === 0x2E) { // '.' - if (divideBy === 0) { - divideBy = 1; - } else { - // A number can have only one '.' - break; - } - } else if (ch === 0x2D) { // '-' - // ignore minus signs in the middle of numbers to match - // Adobe's behavior - warn('Badly formatted number'); - } else if (ch === 0x45 || ch === 0x65) { // 'E', 'e' - // 'E' can be either a scientific notation or the beginning of a new - // operator - ch = this.peekChar(); - if (ch === 0x2B || ch === 0x2D) { // '+', '-' - powerValueSign = (ch === 0x2D) ? -1 : 1; - this.nextChar(); // Consume the sign character - } else if (ch < 0x30 || ch > 0x39) { // '0' - '9' - // The 'E' must be the beginning of a new operator - break; - } - eNotation = true; - } else { - // the last character doesn't belong to us - break; - } - } - - if (divideBy !== 0) { - baseValue /= divideBy; - } - if (eNotation) { - baseValue *= Math.pow(10, powerValueSign * powerValue); - } - return sign * baseValue; - }, - getString: function Lexer_getString() { - var numParen = 1; - var done = false; - var strBuf = this.strBuf; - strBuf.length = 0; - - var ch = this.nextChar(); - while (true) { - var charBuffered = false; - switch (ch | 0) { - case -1: - warn('Unterminated string'); - done = true; - break; - case 0x28: // '(' - ++numParen; - strBuf.push('('); - break; - case 0x29: // ')' - if (--numParen === 0) { - this.nextChar(); // consume strings ')' - done = true; - } else { - strBuf.push(')'); - } - break; - case 0x5C: // '\\' - ch = this.nextChar(); - switch (ch) { - case -1: - warn('Unterminated string'); - done = true; - break; - case 0x6E: // 'n' - strBuf.push('\n'); - break; - case 0x72: // 'r' - strBuf.push('\r'); - break; - case 0x74: // 't' - strBuf.push('\t'); - break; - case 0x62: // 'b' - strBuf.push('\b'); - break; - case 0x66: // 'f' - strBuf.push('\f'); - break; - case 0x5C: // '\' - case 0x28: // '(' - case 0x29: // ')' - strBuf.push(String.fromCharCode(ch)); - break; - case 0x30: case 0x31: case 0x32: case 0x33: // '0'-'3' - case 0x34: case 0x35: case 0x36: case 0x37: // '4'-'7' - var x = ch & 0x0F; - ch = this.nextChar(); - charBuffered = true; - if (ch >= 0x30 && ch <= 0x37) { // '0'-'7' - x = (x << 3) + (ch & 0x0F); - ch = this.nextChar(); - if (ch >= 0x30 && ch <= 0x37) { // '0'-'7' - charBuffered = false; - x = (x << 3) + (ch & 0x0F); - } - } - strBuf.push(String.fromCharCode(x)); - break; - case 0x0D: // CR - if (this.peekChar() === 0x0A) { // LF - this.nextChar(); - } - break; - case 0x0A: // LF - break; - default: - strBuf.push(String.fromCharCode(ch)); - break; - } - break; - default: - strBuf.push(String.fromCharCode(ch)); - break; - } - if (done) { - break; - } - if (!charBuffered) { - ch = this.nextChar(); - } - } - return strBuf.join(''); - }, - getName: function Lexer_getName() { - var ch, previousCh; - var strBuf = this.strBuf; - strBuf.length = 0; - while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { - if (ch === 0x23) { // '#' - ch = this.nextChar(); - if (specialChars[ch]) { - warn('Lexer_getName: ' + - 'NUMBER SIGN (#) should be followed by a hexadecimal number.'); - strBuf.push('#'); - break; - } - var x = toHexDigit(ch); - if (x !== -1) { - previousCh = ch; - ch = this.nextChar(); - var x2 = toHexDigit(ch); - if (x2 === -1) { - warn('Lexer_getName: Illegal digit (' + - String.fromCharCode(ch) +') in hexadecimal number.'); - strBuf.push('#', String.fromCharCode(previousCh)); - if (specialChars[ch]) { - break; - } - strBuf.push(String.fromCharCode(ch)); - continue; - } - strBuf.push(String.fromCharCode((x << 4) | x2)); - } else { - strBuf.push('#', String.fromCharCode(ch)); - } - } else { - strBuf.push(String.fromCharCode(ch)); - } - } - if (strBuf.length > 127) { - warn('name token is longer than allowed by the spec: ' + strBuf.length); - } - return Name.get(strBuf.join('')); - }, - getHexString: function Lexer_getHexString() { - var strBuf = this.strBuf; - strBuf.length = 0; - var ch = this.currentChar; - var isFirstHex = true; - var firstDigit; - var secondDigit; - while (true) { - if (ch < 0) { - warn('Unterminated hex string'); - break; - } else if (ch === 0x3E) { // '>' - this.nextChar(); - break; - } else if (specialChars[ch] === 1) { - ch = this.nextChar(); - continue; - } else { - if (isFirstHex) { - firstDigit = toHexDigit(ch); - if (firstDigit === -1) { - warn('Ignoring invalid character "' + ch + '" in hex string'); - ch = this.nextChar(); - continue; - } - } else { - secondDigit = toHexDigit(ch); - if (secondDigit === -1) { - warn('Ignoring invalid character "' + ch + '" in hex string'); - ch = this.nextChar(); - continue; - } - strBuf.push(String.fromCharCode((firstDigit << 4) | secondDigit)); - } - isFirstHex = !isFirstHex; - ch = this.nextChar(); - } - } - return strBuf.join(''); - }, - getObj: function Lexer_getObj() { - // skip whitespace and comments - var comment = false; - var ch = this.currentChar; - while (true) { - if (ch < 0) { - return EOF; - } - if (comment) { - if (ch === 0x0A || ch === 0x0D) { // LF, CR - comment = false; - } - } else if (ch === 0x25) { // '%' - comment = true; - } else if (specialChars[ch] !== 1) { - break; - } - ch = this.nextChar(); - } - - // start reading token - switch (ch | 0) { - case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: // '0'-'4' - case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: // '5'-'9' - case 0x2B: case 0x2D: case 0x2E: // '+', '-', '.' - return this.getNumber(); - case 0x28: // '(' - return this.getString(); - case 0x2F: // '/' - return this.getName(); - // array punctuation - case 0x5B: // '[' - this.nextChar(); - return Cmd.get('['); - case 0x5D: // ']' - this.nextChar(); - return Cmd.get(']'); - // hex string or dict punctuation - case 0x3C: // '<' - ch = this.nextChar(); - if (ch === 0x3C) { - // dict punctuation - this.nextChar(); - return Cmd.get('<<'); - } - return this.getHexString(); - // dict punctuation - case 0x3E: // '>' - ch = this.nextChar(); - if (ch === 0x3E) { - this.nextChar(); - return Cmd.get('>>'); - } - return Cmd.get('>'); - case 0x7B: // '{' - this.nextChar(); - return Cmd.get('{'); - case 0x7D: // '}' - this.nextChar(); - return Cmd.get('}'); - case 0x29: // ')' - error('Illegal character: ' + ch); - break; - } - - // command - var str = String.fromCharCode(ch); - var knownCommands = this.knownCommands; - var knownCommandFound = knownCommands && knownCommands[str] !== undefined; - while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { - // stop if known command is found and next character does not make - // the str a command - var possibleCommand = str + String.fromCharCode(ch); - if (knownCommandFound && knownCommands[possibleCommand] === undefined) { - break; - } - if (str.length === 128) { - error('Command token too long: ' + str.length); - } - str = possibleCommand; - knownCommandFound = knownCommands && knownCommands[str] !== undefined; - } - if (str === 'true') { - return true; - } - if (str === 'false') { - return false; - } - if (str === 'null') { - return null; - } - return Cmd.get(str); - }, - skipToNextLine: function Lexer_skipToNextLine() { - var ch = this.currentChar; - while (ch >= 0) { - if (ch === 0x0D) { // CR - ch = this.nextChar(); - if (ch === 0x0A) { // LF - this.nextChar(); - } - break; - } else if (ch === 0x0A) { // LF - this.nextChar(); - break; - } - ch = this.nextChar(); - } - } - }; - - return Lexer; -})(); - -var Linearization = { - create: function LinearizationCreate(stream) { - function getInt(name, allowZeroValue) { - var obj = linDict.get(name); - if (isInt(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) { - return obj; - } - throw new Error('The "' + name + '" parameter in the linearization ' + - 'dictionary is invalid.'); - } - function getHints() { - var hints = linDict.get('H'), hintsLength, item; - if (isArray(hints) && - ((hintsLength = hints.length) === 2 || hintsLength === 4)) { - for (var index = 0; index < hintsLength; index++) { - if (!(isInt(item = hints[index]) && item > 0)) { - throw new Error('Hint (' + index + - ') in the linearization dictionary is invalid.'); - } - } - return hints; - } - throw new Error('Hint array in the linearization dictionary is invalid.'); - } - var parser = new Parser(new Lexer(stream), false, null); - var obj1 = parser.getObj(); - var obj2 = parser.getObj(); - var obj3 = parser.getObj(); - var linDict = parser.getObj(); - var obj, length; - if (!(isInt(obj1) && isInt(obj2) && isCmd(obj3, 'obj') && isDict(linDict) && - isNum(obj = linDict.get('Linearized')) && obj > 0)) { - return null; // No valid linearization dictionary found. - } else if ((length = getInt('L')) !== stream.length) { - throw new Error('The "L" parameter in the linearization dictionary ' + - 'does not equal the stream length.'); - } - return { - length: length, - hints: getHints(), - objectNumberFirst: getInt('O'), - endFirst: getInt('E'), - numPages: getInt('N'), - mainXRefEntriesOffset: getInt('T'), - pageFirst: (linDict.has('P') ? getInt('P', true) : 0) - }; - } -}; - -exports.EOF = EOF; -exports.Lexer = Lexer; -exports.Linearization = Linearization; -exports.Parser = Parser; -exports.isEOF = isEOF; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreType1Parser = {}), root.pdfjsSharedUtil, - root.pdfjsCoreStream, root.pdfjsCoreEncodings); - } -}(this, function (exports, sharedUtil, coreStream, coreEncodings) { - -var warn = sharedUtil.warn; -var isSpace = sharedUtil.isSpace; -var Stream = coreStream.Stream; -var getEncoding = coreEncodings.getEncoding; - -// Hinting is currently disabled due to unknown problems on windows -// in tracemonkey and various other pdfs with type1 fonts. -var HINTING_ENABLED = false; - -/* - * CharStrings are encoded following the the CharString Encoding sequence - * describe in Chapter 6 of the "Adobe Type1 Font Format" specification. - * The value in a byte indicates a command, a number, or subsequent bytes - * that are to be interpreted in a special way. - * - * CharString Number Encoding: - * A CharString byte containing the values from 32 through 255 inclusive - * indicate an integer. These values are decoded in four ranges. - * - * 1. A CharString byte containing a value, v, between 32 and 246 inclusive, - * indicate the integer v - 139. Thus, the integer values from -107 through - * 107 inclusive may be encoded in single byte. - * - * 2. A CharString byte containing a value, v, between 247 and 250 inclusive, - * indicates an integer involving the next byte, w, according to the formula: - * [(v - 247) x 256] + w + 108 - * - * 3. A CharString byte containing a value, v, between 251 and 254 inclusive, - * indicates an integer involving the next byte, w, according to the formula: - * -[(v - 251) * 256] - w - 108 - * - * 4. A CharString containing the value 255 indicates that the next 4 bytes - * are a two complement signed integer. The first of these bytes contains the - * highest order bits, the second byte contains the next higher order bits - * and the fourth byte contain the lowest order bits. - * - * - * CharString Command Encoding: - * CharStrings commands are encoded in 1 or 2 bytes. - * - * Single byte commands are encoded in 1 byte that contains a value between - * 0 and 31 inclusive. - * If a command byte contains the value 12, then the value in the next byte - * indicates a command. This "escape" mechanism allows many extra commands - * to be encoded and this encoding technique helps to minimize the length of - * the charStrings. - */ -var Type1CharString = (function Type1CharStringClosure() { - var COMMAND_MAP = { - 'hstem': [1], - 'vstem': [3], - 'vmoveto': [4], - 'rlineto': [5], - 'hlineto': [6], - 'vlineto': [7], - 'rrcurveto': [8], - 'callsubr': [10], - 'flex': [12, 35], - 'drop' : [12, 18], - 'endchar': [14], - 'rmoveto': [21], - 'hmoveto': [22], - 'vhcurveto': [30], - 'hvcurveto': [31] - }; - - function Type1CharString() { - this.width = 0; - this.lsb = 0; - this.flexing = false; - this.output = []; - this.stack = []; - } - - Type1CharString.prototype = { - convert: function Type1CharString_convert(encoded, subrs, - seacAnalysisEnabled) { - var count = encoded.length; - var error = false; - var wx, sbx, subrNumber; - for (var i = 0; i < count; i++) { - var value = encoded[i]; - if (value < 32) { - if (value === 12) { - value = (value << 8) + encoded[++i]; - } - switch (value) { - case 1: // hstem - if (!HINTING_ENABLED) { - this.stack = []; - break; - } - error = this.executeCommand(2, COMMAND_MAP.hstem); - break; - case 3: // vstem - if (!HINTING_ENABLED) { - this.stack = []; - break; - } - error = this.executeCommand(2, COMMAND_MAP.vstem); - break; - case 4: // vmoveto - if (this.flexing) { - if (this.stack.length < 1) { - error = true; - break; - } - // Add the dx for flex and but also swap the values so they are - // the right order. - var dy = this.stack.pop(); - this.stack.push(0, dy); - break; - } - error = this.executeCommand(1, COMMAND_MAP.vmoveto); - break; - case 5: // rlineto - error = this.executeCommand(2, COMMAND_MAP.rlineto); - break; - case 6: // hlineto - error = this.executeCommand(1, COMMAND_MAP.hlineto); - break; - case 7: // vlineto - error = this.executeCommand(1, COMMAND_MAP.vlineto); - break; - case 8: // rrcurveto - error = this.executeCommand(6, COMMAND_MAP.rrcurveto); - break; - case 9: // closepath - // closepath is a Type1 command that does not take argument and is - // useless in Type2 and it can simply be ignored. - this.stack = []; - break; - case 10: // callsubr - if (this.stack.length < 1) { - error = true; - break; - } - subrNumber = this.stack.pop(); - error = this.convert(subrs[subrNumber], subrs, - seacAnalysisEnabled); - break; - case 11: // return - return error; - case 13: // hsbw - if (this.stack.length < 2) { - error = true; - break; - } - // To convert to type2 we have to move the width value to the - // first part of the charstring and then use hmoveto with lsb. - wx = this.stack.pop(); - sbx = this.stack.pop(); - this.lsb = sbx; - this.width = wx; - this.stack.push(wx, sbx); - error = this.executeCommand(2, COMMAND_MAP.hmoveto); - break; - case 14: // endchar - this.output.push(COMMAND_MAP.endchar[0]); - break; - case 21: // rmoveto - if (this.flexing) { - break; - } - error = this.executeCommand(2, COMMAND_MAP.rmoveto); - break; - case 22: // hmoveto - if (this.flexing) { - // Add the dy for flex. - this.stack.push(0); - break; - } - error = this.executeCommand(1, COMMAND_MAP.hmoveto); - break; - case 30: // vhcurveto - error = this.executeCommand(4, COMMAND_MAP.vhcurveto); - break; - case 31: // hvcurveto - error = this.executeCommand(4, COMMAND_MAP.hvcurveto); - break; - case (12 << 8) + 0: // dotsection - // dotsection is a Type1 command to specify some hinting feature - // for dots that do not take a parameter and it can safely be - // ignored for Type2. - this.stack = []; - break; - case (12 << 8) + 1: // vstem3 - if (!HINTING_ENABLED) { - this.stack = []; - break; - } - // [vh]stem3 are Type1 only and Type2 supports [vh]stem with - // multiple parameters, so instead of returning [vh]stem3 take a - // shortcut and return [vhstem] instead. - error = this.executeCommand(2, COMMAND_MAP.vstem); - break; - case (12 << 8) + 2: // hstem3 - if (!HINTING_ENABLED) { - this.stack = []; - break; - } - // See vstem3. - error = this.executeCommand(2, COMMAND_MAP.hstem); - break; - case (12 << 8) + 6: // seac - // seac is like type 2's special endchar but it doesn't use the - // first argument asb, so remove it. - if (seacAnalysisEnabled) { - this.seac = this.stack.splice(-4, 4); - error = this.executeCommand(0, COMMAND_MAP.endchar); - } else { - error = this.executeCommand(4, COMMAND_MAP.endchar); - } - break; - case (12 << 8) + 7: // sbw - if (this.stack.length < 4) { - error = true; - break; - } - // To convert to type2 we have to move the width value to the - // first part of the charstring and then use rmoveto with - // (dx, dy). The height argument will not be used for vmtx and - // vhea tables reconstruction -- ignoring it. - var wy = this.stack.pop(); - wx = this.stack.pop(); - var sby = this.stack.pop(); - sbx = this.stack.pop(); - this.lsb = sbx; - this.width = wx; - this.stack.push(wx, sbx, sby); - error = this.executeCommand(3, COMMAND_MAP.rmoveto); - break; - case (12 << 8) + 12: // div - if (this.stack.length < 2) { - error = true; - break; - } - var num2 = this.stack.pop(); - var num1 = this.stack.pop(); - this.stack.push(num1 / num2); - break; - case (12 << 8) + 16: // callothersubr - if (this.stack.length < 2) { - error = true; - break; - } - subrNumber = this.stack.pop(); - var numArgs = this.stack.pop(); - if (subrNumber === 0 && numArgs === 3) { - var flexArgs = this.stack.splice(this.stack.length - 17, 17); - this.stack.push( - flexArgs[2] + flexArgs[0], // bcp1x + rpx - flexArgs[3] + flexArgs[1], // bcp1y + rpy - flexArgs[4], // bcp2x - flexArgs[5], // bcp2y - flexArgs[6], // p2x - flexArgs[7], // p2y - flexArgs[8], // bcp3x - flexArgs[9], // bcp3y - flexArgs[10], // bcp4x - flexArgs[11], // bcp4y - flexArgs[12], // p3x - flexArgs[13], // p3y - flexArgs[14] // flexDepth - // 15 = finalx unused by flex - // 16 = finaly unused by flex - ); - error = this.executeCommand(13, COMMAND_MAP.flex, true); - this.flexing = false; - this.stack.push(flexArgs[15], flexArgs[16]); - } else if (subrNumber === 1 && numArgs === 0) { - this.flexing = true; - } - break; - case (12 << 8) + 17: // pop - // Ignore this since it is only used with othersubr. - break; - case (12 << 8) + 33: // setcurrentpoint - // Ignore for now. - this.stack = []; - break; - default: - warn('Unknown type 1 charstring command of "' + value + '"'); - break; - } - if (error) { - break; - } - continue; - } else if (value <= 246) { - value = value - 139; - } else if (value <= 250) { - value = ((value - 247) * 256) + encoded[++i] + 108; - } else if (value <= 254) { - value = -((value - 251) * 256) - encoded[++i] - 108; - } else { - value = (encoded[++i] & 0xff) << 24 | (encoded[++i] & 0xff) << 16 | - (encoded[++i] & 0xff) << 8 | (encoded[++i] & 0xff) << 0; - } - this.stack.push(value); - } - return error; - }, - - executeCommand: function(howManyArgs, command, keepStack) { - var stackLength = this.stack.length; - if (howManyArgs > stackLength) { - return true; - } - var start = stackLength - howManyArgs; - for (var i = start; i < stackLength; i++) { - var value = this.stack[i]; - if (value === (value | 0)) { // int - this.output.push(28, (value >> 8) & 0xff, value & 0xff); - } else { // fixed point - value = (65536 * value) | 0; - this.output.push(255, - (value >> 24) & 0xFF, - (value >> 16) & 0xFF, - (value >> 8) & 0xFF, - value & 0xFF); - } - } - this.output.push.apply(this.output, command); - if (keepStack) { - this.stack.splice(start, howManyArgs); - } else { - this.stack.length = 0; - } - return false; - } - }; - - return Type1CharString; -})(); - -/* - * Type1Parser encapsulate the needed code for parsing a Type1 font - * program. Some of its logic depends on the Type2 charstrings - * structure. - * Note: this doesn't really parse the font since that would require evaluation - * of PostScript, but it is possible in most cases to extract what we need - * without a full parse. - */ -var Type1Parser = (function Type1ParserClosure() { - /* - * Decrypt a Sequence of Ciphertext Bytes to Produce the Original Sequence - * of Plaintext Bytes. The function took a key as a parameter which can be - * for decrypting the eexec block of for decoding charStrings. - */ - var EEXEC_ENCRYPT_KEY = 55665; - var CHAR_STRS_ENCRYPT_KEY = 4330; - - function isHexDigit(code) { - return code >= 48 && code <= 57 || // '0'-'9' - code >= 65 && code <= 70 || // 'A'-'F' - code >= 97 && code <= 102; // 'a'-'f' - } - - function decrypt(data, key, discardNumber) { - if (discardNumber >= data.length) { - return new Uint8Array(0); - } - var r = key | 0, c1 = 52845, c2 = 22719, i, j; - for (i = 0; i < discardNumber; i++) { - r = ((data[i] + r) * c1 + c2) & ((1 << 16) - 1); - } - var count = data.length - discardNumber; - var decrypted = new Uint8Array(count); - for (i = discardNumber, j = 0; j < count; i++, j++) { - var value = data[i]; - decrypted[j] = value ^ (r >> 8); - r = ((value + r) * c1 + c2) & ((1 << 16) - 1); - } - return decrypted; - } - - function decryptAscii(data, key, discardNumber) { - var r = key | 0, c1 = 52845, c2 = 22719; - var count = data.length, maybeLength = count >>> 1; - var decrypted = new Uint8Array(maybeLength); - var i, j; - for (i = 0, j = 0; i < count; i++) { - var digit1 = data[i]; - if (!isHexDigit(digit1)) { - continue; - } - i++; - var digit2; - while (i < count && !isHexDigit(digit2 = data[i])) { - i++; - } - if (i < count) { - var value = parseInt(String.fromCharCode(digit1, digit2), 16); - decrypted[j++] = value ^ (r >> 8); - r = ((value + r) * c1 + c2) & ((1 << 16) - 1); - } - } - return Array.prototype.slice.call(decrypted, discardNumber, j); - } - - function isSpecial(c) { - return c === 0x2F || // '/' - c === 0x5B || c === 0x5D || // '[', ']' - c === 0x7B || c === 0x7D || // '{', '}' - c === 0x28 || c === 0x29; // '(', ')' - } - - function Type1Parser(stream, encrypted, seacAnalysisEnabled) { - if (encrypted) { - var data = stream.getBytes(); - var isBinary = !(isHexDigit(data[0]) && isHexDigit(data[1]) && - isHexDigit(data[2]) && isHexDigit(data[3])); - stream = new Stream(isBinary ? decrypt(data, EEXEC_ENCRYPT_KEY, 4) : - decryptAscii(data, EEXEC_ENCRYPT_KEY, 4)); - } - this.seacAnalysisEnabled = !!seacAnalysisEnabled; - - this.stream = stream; - this.nextChar(); - } - - Type1Parser.prototype = { - readNumberArray: function Type1Parser_readNumberArray() { - this.getToken(); // read '[' or '{' (arrays can start with either) - var array = []; - while (true) { - var token = this.getToken(); - if (token === null || token === ']' || token === '}') { - break; - } - array.push(parseFloat(token || 0)); - } - return array; - }, - - readNumber: function Type1Parser_readNumber() { - var token = this.getToken(); - return parseFloat(token || 0); - }, - - readInt: function Type1Parser_readInt() { - // Use '| 0' to prevent setting a double into length such as the double - // does not flow into the loop variable. - var token = this.getToken(); - return parseInt(token || 0, 10) | 0; - }, - - readBoolean: function Type1Parser_readBoolean() { - var token = this.getToken(); - - // Use 1 and 0 since that's what type2 charstrings use. - return token === 'true' ? 1 : 0; - }, - - nextChar : function Type1_nextChar() { - return (this.currentChar = this.stream.getByte()); - }, - - getToken: function Type1Parser_getToken() { - // Eat whitespace and comments. - var comment = false; - var ch = this.currentChar; - while (true) { - if (ch === -1) { - return null; - } - - if (comment) { - if (ch === 0x0A || ch === 0x0D) { - comment = false; - } - } else if (ch === 0x25) { // '%' - comment = true; - } else if (!isSpace(ch)) { - break; - } - ch = this.nextChar(); - } - if (isSpecial(ch)) { - this.nextChar(); - return String.fromCharCode(ch); - } - var token = ''; - do { - token += String.fromCharCode(ch); - ch = this.nextChar(); - } while (ch >= 0 && !isSpace(ch) && !isSpecial(ch)); - return token; - }, - - /* - * Returns an object containing a Subrs array and a CharStrings - * array extracted from and eexec encrypted block of data - */ - extractFontProgram: function Type1Parser_extractFontProgram() { - var stream = this.stream; - - var subrs = [], charstrings = []; - var privateData = Object.create(null); - privateData['lenIV'] = 4; - var program = { - subrs: [], - charstrings: [], - properties: { - 'privateData': privateData - } - }; - var token, length, data, lenIV, encoded; - while ((token = this.getToken()) !== null) { - if (token !== '/') { - continue; - } - token = this.getToken(); - switch (token) { - case 'CharStrings': - // The number immediately following CharStrings must be greater or - // equal to the number of CharStrings. - this.getToken(); - this.getToken(); // read in 'dict' - this.getToken(); // read in 'dup' - this.getToken(); // read in 'begin' - while(true) { - token = this.getToken(); - if (token === null || token === 'end') { - break; - } - - if (token !== '/') { - continue; - } - var glyph = this.getToken(); - length = this.readInt(); - this.getToken(); // read in 'RD' or '-|' - data = stream.makeSubStream(stream.pos, length); - lenIV = program.properties.privateData['lenIV']; - encoded = decrypt(data.getBytes(), CHAR_STRS_ENCRYPT_KEY, lenIV); - // Skip past the required space and binary data. - stream.skip(length); - this.nextChar(); - token = this.getToken(); // read in 'ND' or '|-' - if (token === 'noaccess') { - this.getToken(); // read in 'def' - } - charstrings.push({ - glyph: glyph, - encoded: encoded - }); - } - break; - case 'Subrs': - var num = this.readInt(); - this.getToken(); // read in 'array' - while ((token = this.getToken()) === 'dup') { - var index = this.readInt(); - length = this.readInt(); - this.getToken(); // read in 'RD' or '-|' - data = stream.makeSubStream(stream.pos, length); - lenIV = program.properties.privateData['lenIV']; - encoded = decrypt(data.getBytes(), CHAR_STRS_ENCRYPT_KEY, lenIV); - // Skip past the required space and binary data. - stream.skip(length); - this.nextChar(); - token = this.getToken(); // read in 'NP' or '|' - if (token === 'noaccess') { - this.getToken(); // read in 'put' - } - subrs[index] = encoded; - } - break; - case 'BlueValues': - case 'OtherBlues': - case 'FamilyBlues': - case 'FamilyOtherBlues': - var blueArray = this.readNumberArray(); - // *Blue* values may contain invalid data: disables reading of - // those values when hinting is disabled. - if (blueArray.length > 0 && (blueArray.length % 2) === 0 && - HINTING_ENABLED) { - program.properties.privateData[token] = blueArray; - } - break; - case 'StemSnapH': - case 'StemSnapV': - program.properties.privateData[token] = this.readNumberArray(); - break; - case 'StdHW': - case 'StdVW': - program.properties.privateData[token] = - this.readNumberArray()[0]; - break; - case 'BlueShift': - case 'lenIV': - case 'BlueFuzz': - case 'BlueScale': - case 'LanguageGroup': - case 'ExpansionFactor': - program.properties.privateData[token] = this.readNumber(); - break; - case 'ForceBold': - program.properties.privateData[token] = this.readBoolean(); - break; - } - } - - for (var i = 0; i < charstrings.length; i++) { - glyph = charstrings[i].glyph; - encoded = charstrings[i].encoded; - var charString = new Type1CharString(); - var error = charString.convert(encoded, subrs, - this.seacAnalysisEnabled); - var output = charString.output; - if (error) { - // It seems when FreeType encounters an error while evaluating a glyph - // that it completely ignores the glyph so we'll mimic that behaviour - // here and put an endchar to make the validator happy. - output = [14]; - } - program.charstrings.push({ - glyphName: glyph, - charstring: output, - width: charString.width, - lsb: charString.lsb, - seac: charString.seac - }); - } - - return program; - }, - - extractFontHeader: function Type1Parser_extractFontHeader(properties) { - var token; - while ((token = this.getToken()) !== null) { - if (token !== '/') { - continue; - } - token = this.getToken(); - switch (token) { - case 'FontMatrix': - var matrix = this.readNumberArray(); - properties.fontMatrix = matrix; - break; - case 'Encoding': - var encodingArg = this.getToken(); - var encoding; - if (!/^\d+$/.test(encodingArg)) { - // encoding name is specified - encoding = getEncoding(encodingArg); - } else { - encoding = []; - var size = parseInt(encodingArg, 10) | 0; - this.getToken(); // read in 'array' - - for (var j = 0; j < size; j++) { - token = this.getToken(); - // skipping till first dup or def (e.g. ignoring for statement) - while (token !== 'dup' && token !== 'def') { - token = this.getToken(); - if (token === null) { - return; // invalid header - } - } - if (token === 'def') { - break; // read all array data - } - var index = this.readInt(); - this.getToken(); // read in '/' - var glyph = this.getToken(); - encoding[index] = glyph; - this.getToken(); // read the in 'put' - } - } - properties.builtInEncoding = encoding; - break; - case 'FontBBox': - var fontBBox = this.readNumberArray(); - // adjusting ascent/descent - properties.ascent = fontBBox[3]; - properties.descent = fontBBox[1]; - properties.ascentScaled = true; - break; - } - } - } - }; - - return Type1Parser; -})(); - -exports.Type1Parser = Type1Parser; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreCMap = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreStream, root.pdfjsCoreParser); - } -}(this, function (exports, sharedUtil, corePrimitives, coreStream, coreParser) { - -var Util = sharedUtil.Util; -var assert = sharedUtil.assert; -var warn = sharedUtil.warn; -var error = sharedUtil.error; -var isInt = sharedUtil.isInt; -var isString = sharedUtil.isString; -var MissingDataException = sharedUtil.MissingDataException; -var isName = corePrimitives.isName; -var isCmd = corePrimitives.isCmd; -var isStream = corePrimitives.isStream; -var StringStream = coreStream.StringStream; -var Lexer = coreParser.Lexer; -var isEOF = coreParser.isEOF; - -var BUILT_IN_CMAPS = [ -// << Start unicode maps. -'Adobe-GB1-UCS2', -'Adobe-CNS1-UCS2', -'Adobe-Japan1-UCS2', -'Adobe-Korea1-UCS2', -// >> End unicode maps. -'78-EUC-H', -'78-EUC-V', -'78-H', -'78-RKSJ-H', -'78-RKSJ-V', -'78-V', -'78ms-RKSJ-H', -'78ms-RKSJ-V', -'83pv-RKSJ-H', -'90ms-RKSJ-H', -'90ms-RKSJ-V', -'90msp-RKSJ-H', -'90msp-RKSJ-V', -'90pv-RKSJ-H', -'90pv-RKSJ-V', -'Add-H', -'Add-RKSJ-H', -'Add-RKSJ-V', -'Add-V', -'Adobe-CNS1-0', -'Adobe-CNS1-1', -'Adobe-CNS1-2', -'Adobe-CNS1-3', -'Adobe-CNS1-4', -'Adobe-CNS1-5', -'Adobe-CNS1-6', -'Adobe-GB1-0', -'Adobe-GB1-1', -'Adobe-GB1-2', -'Adobe-GB1-3', -'Adobe-GB1-4', -'Adobe-GB1-5', -'Adobe-Japan1-0', -'Adobe-Japan1-1', -'Adobe-Japan1-2', -'Adobe-Japan1-3', -'Adobe-Japan1-4', -'Adobe-Japan1-5', -'Adobe-Japan1-6', -'Adobe-Korea1-0', -'Adobe-Korea1-1', -'Adobe-Korea1-2', -'B5-H', -'B5-V', -'B5pc-H', -'B5pc-V', -'CNS-EUC-H', -'CNS-EUC-V', -'CNS1-H', -'CNS1-V', -'CNS2-H', -'CNS2-V', -'ETHK-B5-H', -'ETHK-B5-V', -'ETen-B5-H', -'ETen-B5-V', -'ETenms-B5-H', -'ETenms-B5-V', -'EUC-H', -'EUC-V', -'Ext-H', -'Ext-RKSJ-H', -'Ext-RKSJ-V', -'Ext-V', -'GB-EUC-H', -'GB-EUC-V', -'GB-H', -'GB-V', -'GBK-EUC-H', -'GBK-EUC-V', -'GBK2K-H', -'GBK2K-V', -'GBKp-EUC-H', -'GBKp-EUC-V', -'GBT-EUC-H', -'GBT-EUC-V', -'GBT-H', -'GBT-V', -'GBTpc-EUC-H', -'GBTpc-EUC-V', -'GBpc-EUC-H', -'GBpc-EUC-V', -'H', -'HKdla-B5-H', -'HKdla-B5-V', -'HKdlb-B5-H', -'HKdlb-B5-V', -'HKgccs-B5-H', -'HKgccs-B5-V', -'HKm314-B5-H', -'HKm314-B5-V', -'HKm471-B5-H', -'HKm471-B5-V', -'HKscs-B5-H', -'HKscs-B5-V', -'Hankaku', -'Hiragana', -'KSC-EUC-H', -'KSC-EUC-V', -'KSC-H', -'KSC-Johab-H', -'KSC-Johab-V', -'KSC-V', -'KSCms-UHC-H', -'KSCms-UHC-HW-H', -'KSCms-UHC-HW-V', -'KSCms-UHC-V', -'KSCpc-EUC-H', -'KSCpc-EUC-V', -'Katakana', -'NWP-H', -'NWP-V', -'RKSJ-H', -'RKSJ-V', -'Roman', -'UniCNS-UCS2-H', -'UniCNS-UCS2-V', -'UniCNS-UTF16-H', -'UniCNS-UTF16-V', -'UniCNS-UTF32-H', -'UniCNS-UTF32-V', -'UniCNS-UTF8-H', -'UniCNS-UTF8-V', -'UniGB-UCS2-H', -'UniGB-UCS2-V', -'UniGB-UTF16-H', -'UniGB-UTF16-V', -'UniGB-UTF32-H', -'UniGB-UTF32-V', -'UniGB-UTF8-H', -'UniGB-UTF8-V', -'UniJIS-UCS2-H', -'UniJIS-UCS2-HW-H', -'UniJIS-UCS2-HW-V', -'UniJIS-UCS2-V', -'UniJIS-UTF16-H', -'UniJIS-UTF16-V', -'UniJIS-UTF32-H', -'UniJIS-UTF32-V', -'UniJIS-UTF8-H', -'UniJIS-UTF8-V', -'UniJIS2004-UTF16-H', -'UniJIS2004-UTF16-V', -'UniJIS2004-UTF32-H', -'UniJIS2004-UTF32-V', -'UniJIS2004-UTF8-H', -'UniJIS2004-UTF8-V', -'UniJISPro-UCS2-HW-V', -'UniJISPro-UCS2-V', -'UniJISPro-UTF8-V', -'UniJISX0213-UTF32-H', -'UniJISX0213-UTF32-V', -'UniJISX02132004-UTF32-H', -'UniJISX02132004-UTF32-V', -'UniKS-UCS2-H', -'UniKS-UCS2-V', -'UniKS-UTF16-H', -'UniKS-UTF16-V', -'UniKS-UTF32-H', -'UniKS-UTF32-V', -'UniKS-UTF8-H', -'UniKS-UTF8-V', -'V', -'WP-Symbol']; - -// CMap, not to be confused with TrueType's cmap. -var CMap = (function CMapClosure() { - function CMap(builtInCMap) { - // Codespace ranges are stored as follows: - // [[1BytePairs], [2BytePairs], [3BytePairs], [4BytePairs]] - // where nBytePairs are ranges e.g. [low1, high1, low2, high2, ...] - this.codespaceRanges = [[], [], [], []]; - this.numCodespaceRanges = 0; - // Map entries have one of two forms. - // - cid chars are 16-bit unsigned integers, stored as integers. - // - bf chars are variable-length byte sequences, stored as strings, with - // one byte per character. - this._map = []; - this.name = ''; - this.vertical = false; - this.useCMap = null; - this.builtInCMap = builtInCMap; - } - CMap.prototype = { - addCodespaceRange: function(n, low, high) { - this.codespaceRanges[n - 1].push(low, high); - this.numCodespaceRanges++; - }, - - mapCidRange: function(low, high, dstLow) { - while (low <= high) { - this._map[low++] = dstLow++; - } - }, - - mapBfRange: function(low, high, dstLow) { - var lastByte = dstLow.length - 1; - while (low <= high) { - this._map[low++] = dstLow; - // Only the last byte has to be incremented. - dstLow = dstLow.substr(0, lastByte) + - String.fromCharCode(dstLow.charCodeAt(lastByte) + 1); - } - }, - - mapBfRangeToArray: function(low, high, array) { - var i = 0, ii = array.length; - while (low <= high && i < ii) { - this._map[low] = array[i++]; - ++low; - } - }, - - // This is used for both bf and cid chars. - mapOne: function(src, dst) { - this._map[src] = dst; - }, - - lookup: function(code) { - return this._map[code]; - }, - - contains: function(code) { - return this._map[code] !== undefined; - }, - - forEach: function(callback) { - // Most maps have fewer than 65536 entries, and for those we use normal - // array iteration. But really sparse tables are possible -- e.g. with - // indices in the *billions*. For such tables we use for..in, which isn't - // ideal because it stringifies the indices for all present elements, but - // it does avoid iterating over every undefined entry. - var map = this._map; - var length = map.length; - var i; - if (length <= 0x10000) { - for (i = 0; i < length; i++) { - if (map[i] !== undefined) { - callback(i, map[i]); - } - } - } else { - for (i in this._map) { - callback(i, map[i]); - } - } - }, - - charCodeOf: function(value) { - return this._map.indexOf(value); - }, - - getMap: function() { - return this._map; - }, - - readCharCode: function(str, offset, out) { - var c = 0; - var codespaceRanges = this.codespaceRanges; - var codespaceRangesLen = this.codespaceRanges.length; - // 9.7.6.2 CMap Mapping - // The code length is at most 4. - for (var n = 0; n < codespaceRangesLen; n++) { - c = ((c << 8) | str.charCodeAt(offset + n)) >>> 0; - // Check each codespace range to see if it falls within. - var codespaceRange = codespaceRanges[n]; - for (var k = 0, kk = codespaceRange.length; k < kk;) { - var low = codespaceRange[k++]; - var high = codespaceRange[k++]; - if (c >= low && c <= high) { - out.charcode = c; - out.length = n + 1; - return; - } - } - } - out.charcode = 0; - out.length = 1; - }, - - get length() { - return this._map.length; - }, - - get isIdentityCMap() { - if (!(this.name === 'Identity-H' || this.name === 'Identity-V')) { - return false; - } - if (this._map.length !== 0x10000) { - return false; - } - for (var i = 0; i < 0x10000; i++) { - if (this._map[i] !== i) { - return false; - } - } - return true; - } - }; - return CMap; -})(); - -// A special case of CMap, where the _map array implicitly has a length of -// 65536 and each element is equal to its index. -var IdentityCMap = (function IdentityCMapClosure() { - function IdentityCMap(vertical, n) { - CMap.call(this); - this.vertical = vertical; - this.addCodespaceRange(n, 0, 0xffff); - } - Util.inherit(IdentityCMap, CMap, {}); - - IdentityCMap.prototype = { - addCodespaceRange: CMap.prototype.addCodespaceRange, - - mapCidRange: function(low, high, dstLow) { - error('should not call mapCidRange'); - }, - - mapBfRange: function(low, high, dstLow) { - error('should not call mapBfRange'); - }, - - mapBfRangeToArray: function(low, high, array) { - error('should not call mapBfRangeToArray'); - }, - - mapOne: function(src, dst) { - error('should not call mapCidOne'); - }, - - lookup: function(code) { - return (isInt(code) && code <= 0xffff) ? code : undefined; - }, - - contains: function(code) { - return isInt(code) && code <= 0xffff; - }, - - forEach: function(callback) { - for (var i = 0; i <= 0xffff; i++) { - callback(i, i); - } - }, - - charCodeOf: function(value) { - return (isInt(value) && value <= 0xffff) ? value : -1; - }, - - getMap: function() { - // Sometimes identity maps must be instantiated, but it's rare. - var map = new Array(0x10000); - for (var i = 0; i <= 0xffff; i++) { - map[i] = i; - } - return map; - }, - - readCharCode: CMap.prototype.readCharCode, - - get length() { - return 0x10000; - }, - - get isIdentityCMap() { - error('should not access .isIdentityCMap'); - } - }; - - return IdentityCMap; -})(); - -var BinaryCMapReader = (function BinaryCMapReaderClosure() { - function fetchBinaryData(url) { - return new Promise(function (resolve, reject) { - var request = new XMLHttpRequest(); - request.open('GET', url, true); - request.responseType = 'arraybuffer'; - request.onreadystatechange = function () { - if (request.readyState === XMLHttpRequest.DONE) { - if (!request.response || request.status !== 200 && - request.status !== 0) { - reject(new Error('Unable to get binary cMap at: ' + url)); - } else { - resolve(new Uint8Array(request.response)); - } - } - }; - request.send(null); - }); - } - - function hexToInt(a, size) { - var n = 0; - for (var i = 0; i <= size; i++) { - n = (n << 8) | a[i]; - } - return n >>> 0; - } - - function hexToStr(a, size) { - // This code is hot. Special-case some common values to avoid creating an - // object with subarray(). - if (size === 1) { - return String.fromCharCode(a[0], a[1]); - } - if (size === 3) { - return String.fromCharCode(a[0], a[1], a[2], a[3]); - } - return String.fromCharCode.apply(null, a.subarray(0, size + 1)); - } - - function addHex(a, b, size) { - var c = 0; - for (var i = size; i >= 0; i--) { - c += a[i] + b[i]; - a[i] = c & 255; - c >>= 8; - } - } - - function incHex(a, size) { - var c = 1; - for (var i = size; i >= 0 && c > 0; i--) { - c += a[i]; - a[i] = c & 255; - c >>= 8; - } - } - - var MAX_NUM_SIZE = 16; - var MAX_ENCODED_NUM_SIZE = 19; // ceil(MAX_NUM_SIZE * 7 / 8) - - function BinaryCMapStream(data) { - this.buffer = data; - this.pos = 0; - this.end = data.length; - this.tmpBuf = new Uint8Array(MAX_ENCODED_NUM_SIZE); - } - - BinaryCMapStream.prototype = { - readByte: function () { - if (this.pos >= this.end) { - return -1; - } - return this.buffer[this.pos++]; - }, - readNumber: function () { - var n = 0; - var last; - do { - var b = this.readByte(); - if (b < 0) { - error('unexpected EOF in bcmap'); - } - last = !(b & 0x80); - n = (n << 7) | (b & 0x7F); - } while (!last); - return n; - }, - readSigned: function () { - var n = this.readNumber(); - return (n & 1) ? ~(n >>> 1) : n >>> 1; - }, - readHex: function (num, size) { - num.set(this.buffer.subarray(this.pos, - this.pos + size + 1)); - this.pos += size + 1; - }, - readHexNumber: function (num, size) { - var last; - var stack = this.tmpBuf, sp = 0; - do { - var b = this.readByte(); - if (b < 0) { - error('unexpected EOF in bcmap'); - } - last = !(b & 0x80); - stack[sp++] = b & 0x7F; - } while (!last); - var i = size, buffer = 0, bufferSize = 0; - while (i >= 0) { - while (bufferSize < 8 && stack.length > 0) { - buffer = (stack[--sp] << bufferSize) | buffer; - bufferSize += 7; - } - num[i] = buffer & 255; - i--; - buffer >>= 8; - bufferSize -= 8; - } - }, - readHexSigned: function (num, size) { - this.readHexNumber(num, size); - var sign = num[size] & 1 ? 255 : 0; - var c = 0; - for (var i = 0; i <= size; i++) { - c = ((c & 1) << 8) | num[i]; - num[i] = (c >> 1) ^ sign; - } - }, - readString: function () { - var len = this.readNumber(); - var s = ''; - for (var i = 0; i < len; i++) { - s += String.fromCharCode(this.readNumber()); - } - return s; - } - }; - - function processBinaryCMap(url, cMap, extend) { - return fetchBinaryData(url).then(function (data) { - var stream = new BinaryCMapStream(data); - var header = stream.readByte(); - cMap.vertical = !!(header & 1); - - var useCMap = null; - var start = new Uint8Array(MAX_NUM_SIZE); - var end = new Uint8Array(MAX_NUM_SIZE); - var char = new Uint8Array(MAX_NUM_SIZE); - var charCode = new Uint8Array(MAX_NUM_SIZE); - var tmp = new Uint8Array(MAX_NUM_SIZE); - var code; - - var b; - while ((b = stream.readByte()) >= 0) { - var type = b >> 5; - if (type === 7) { // metadata, e.g. comment or usecmap - switch (b & 0x1F) { - case 0: - stream.readString(); // skipping comment - break; - case 1: - useCMap = stream.readString(); - break; - } - continue; - } - var sequence = !!(b & 0x10); - var dataSize = b & 15; - - assert(dataSize + 1 <= MAX_NUM_SIZE); - - var ucs2DataSize = 1; - var subitemsCount = stream.readNumber(); - var i; - switch (type) { - case 0: // codespacerange - stream.readHex(start, dataSize); - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), - hexToInt(end, dataSize)); - for (i = 1; i < subitemsCount; i++) { - incHex(end, dataSize); - stream.readHexNumber(start, dataSize); - addHex(start, end, dataSize); - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), - hexToInt(end, dataSize)); - } - break; - case 1: // notdefrange - stream.readHex(start, dataSize); - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - code = stream.readNumber(); - // undefined range, skipping - for (i = 1; i < subitemsCount; i++) { - incHex(end, dataSize); - stream.readHexNumber(start, dataSize); - addHex(start, end, dataSize); - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - code = stream.readNumber(); - // nop - } - break; - case 2: // cidchar - stream.readHex(char, dataSize); - code = stream.readNumber(); - cMap.mapOne(hexToInt(char, dataSize), code); - for (i = 1; i < subitemsCount; i++) { - incHex(char, dataSize); - if (!sequence) { - stream.readHexNumber(tmp, dataSize); - addHex(char, tmp, dataSize); - } - code = stream.readSigned() + (code + 1); - cMap.mapOne(hexToInt(char, dataSize), code); - } - break; - case 3: // cidrange - stream.readHex(start, dataSize); - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - code = stream.readNumber(); - cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), - code); - for (i = 1; i < subitemsCount; i++) { - incHex(end, dataSize); - if (!sequence) { - stream.readHexNumber(start, dataSize); - addHex(start, end, dataSize); - } else { - start.set(end); - } - stream.readHexNumber(end, dataSize); - addHex(end, start, dataSize); - code = stream.readNumber(); - cMap.mapCidRange(hexToInt(start, dataSize), - hexToInt(end, dataSize), code); - } - break; - case 4: // bfchar - stream.readHex(char, ucs2DataSize); - stream.readHex(charCode, dataSize); - cMap.mapOne(hexToInt(char, ucs2DataSize), - hexToStr(charCode, dataSize)); - for (i = 1; i < subitemsCount; i++) { - incHex(char, ucs2DataSize); - if (!sequence) { - stream.readHexNumber(tmp, ucs2DataSize); - addHex(char, tmp, ucs2DataSize); - } - incHex(charCode, dataSize); - stream.readHexSigned(tmp, dataSize); - addHex(charCode, tmp, dataSize); - cMap.mapOne(hexToInt(char, ucs2DataSize), - hexToStr(charCode, dataSize)); - } - break; - case 5: // bfrange - stream.readHex(start, ucs2DataSize); - stream.readHexNumber(end, ucs2DataSize); - addHex(end, start, ucs2DataSize); - stream.readHex(charCode, dataSize); - cMap.mapBfRange(hexToInt(start, ucs2DataSize), - hexToInt(end, ucs2DataSize), - hexToStr(charCode, dataSize)); - for (i = 1; i < subitemsCount; i++) { - incHex(end, ucs2DataSize); - if (!sequence) { - stream.readHexNumber(start, ucs2DataSize); - addHex(start, end, ucs2DataSize); - } else { - start.set(end); - } - stream.readHexNumber(end, ucs2DataSize); - addHex(end, start, ucs2DataSize); - stream.readHex(charCode, dataSize); - cMap.mapBfRange(hexToInt(start, ucs2DataSize), - hexToInt(end, ucs2DataSize), - hexToStr(charCode, dataSize)); - } - break; - default: - error('Unknown type: ' + type); - break; - } - } - - if (useCMap) { - return extend(useCMap); - } - return cMap; - }); - } - - function BinaryCMapReader() {} - - BinaryCMapReader.prototype = { - read: processBinaryCMap - }; - - return BinaryCMapReader; -})(); - -var CMapFactory = (function CMapFactoryClosure() { - function strToInt(str) { - var a = 0; - for (var i = 0; i < str.length; i++) { - a = (a << 8) | str.charCodeAt(i); - } - return a >>> 0; - } - - function expectString(obj) { - if (!isString(obj)) { - error('Malformed CMap: expected string.'); - } - } - - function expectInt(obj) { - if (!isInt(obj)) { - error('Malformed CMap: expected int.'); - } - } - - function parseBfChar(cMap, lexer) { - while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } - if (isCmd(obj, 'endbfchar')) { - return; - } - expectString(obj); - var src = strToInt(obj); - obj = lexer.getObj(); - // TODO are /dstName used? - expectString(obj); - var dst = obj; - cMap.mapOne(src, dst); - } - } - - function parseBfRange(cMap, lexer) { - while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } - if (isCmd(obj, 'endbfrange')) { - return; - } - expectString(obj); - var low = strToInt(obj); - obj = lexer.getObj(); - expectString(obj); - var high = strToInt(obj); - obj = lexer.getObj(); - if (isInt(obj) || isString(obj)) { - var dstLow = isInt(obj) ? String.fromCharCode(obj) : obj; - cMap.mapBfRange(low, high, dstLow); - } else if (isCmd(obj, '[')) { - obj = lexer.getObj(); - var array = []; - while (!isCmd(obj, ']') && !isEOF(obj)) { - array.push(obj); - obj = lexer.getObj(); - } - cMap.mapBfRangeToArray(low, high, array); - } else { - break; - } - } - error('Invalid bf range.'); - } - - function parseCidChar(cMap, lexer) { - while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } - if (isCmd(obj, 'endcidchar')) { - return; - } - expectString(obj); - var src = strToInt(obj); - obj = lexer.getObj(); - expectInt(obj); - var dst = obj; - cMap.mapOne(src, dst); - } - } - - function parseCidRange(cMap, lexer) { - while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } - if (isCmd(obj, 'endcidrange')) { - return; - } - expectString(obj); - var low = strToInt(obj); - obj = lexer.getObj(); - expectString(obj); - var high = strToInt(obj); - obj = lexer.getObj(); - expectInt(obj); - var dstLow = obj; - cMap.mapCidRange(low, high, dstLow); - } - } - - function parseCodespaceRange(cMap, lexer) { - while (true) { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } - if (isCmd(obj, 'endcodespacerange')) { - return; - } - if (!isString(obj)) { - break; - } - var low = strToInt(obj); - obj = lexer.getObj(); - if (!isString(obj)) { - break; - } - var high = strToInt(obj); - cMap.addCodespaceRange(obj.length, low, high); - } - error('Invalid codespace range.'); - } - - function parseWMode(cMap, lexer) { - var obj = lexer.getObj(); - if (isInt(obj)) { - cMap.vertical = !!obj; - } - } - - function parseCMapName(cMap, lexer) { - var obj = lexer.getObj(); - if (isName(obj) && isString(obj.name)) { - cMap.name = obj.name; - } - } - - function parseCMap(cMap, lexer, builtInCMapParams, useCMap) { - var previous; - var embededUseCMap; - objLoop: while (true) { - try { - var obj = lexer.getObj(); - if (isEOF(obj)) { - break; - } else if (isName(obj)) { - if (obj.name === 'WMode') { - parseWMode(cMap, lexer); - } else if (obj.name === 'CMapName') { - parseCMapName(cMap, lexer); - } - previous = obj; - } else if (isCmd(obj)) { - switch (obj.cmd) { - case 'endcmap': - break objLoop; - case 'usecmap': - if (isName(previous)) { - embededUseCMap = previous.name; - } - break; - case 'begincodespacerange': - parseCodespaceRange(cMap, lexer); - break; - case 'beginbfchar': - parseBfChar(cMap, lexer); - break; - case 'begincidchar': - parseCidChar(cMap, lexer); - break; - case 'beginbfrange': - parseBfRange(cMap, lexer); - break; - case 'begincidrange': - parseCidRange(cMap, lexer); - break; - } - } - } catch (ex) { - if (ex instanceof MissingDataException) { - throw ex; - } - warn('Invalid cMap data: ' + ex); - continue; - } - } - - if (!useCMap && embededUseCMap) { - // Load the usecmap definition from the file only if there wasn't one - // specified. - useCMap = embededUseCMap; - } - if (useCMap) { - return extendCMap(cMap, builtInCMapParams, useCMap); - } - return Promise.resolve(cMap); - } - - function extendCMap(cMap, builtInCMapParams, useCMap) { - return createBuiltInCMap(useCMap, builtInCMapParams).then( - function(newCMap) { - cMap.useCMap = newCMap; - // If there aren't any code space ranges defined clone all the parent ones - // into this cMap. - if (cMap.numCodespaceRanges === 0) { - var useCodespaceRanges = cMap.useCMap.codespaceRanges; - for (var i = 0; i < useCodespaceRanges.length; i++) { - cMap.codespaceRanges[i] = useCodespaceRanges[i].slice(); - } - cMap.numCodespaceRanges = cMap.useCMap.numCodespaceRanges; - } - // Merge the map into the current one, making sure not to override - // any previously defined entries. - cMap.useCMap.forEach(function(key, value) { - if (!cMap.contains(key)) { - cMap.mapOne(key, cMap.useCMap.lookup(key)); - } - }); - - return cMap; - }); - } - - function parseBinaryCMap(name, builtInCMapParams) { - var url = builtInCMapParams.url + name + '.bcmap'; - var cMap = new CMap(true); - return new BinaryCMapReader().read(url, cMap, function (useCMap) { - return extendCMap(cMap, builtInCMapParams, useCMap); - }); - } - - function createBuiltInCMap(name, builtInCMapParams) { - if (name === 'Identity-H') { - return Promise.resolve(new IdentityCMap(false, 2)); - } else if (name === 'Identity-V') { - return Promise.resolve(new IdentityCMap(true, 2)); - } - if (BUILT_IN_CMAPS.indexOf(name) === -1) { - return Promise.reject(new Error('Unknown cMap name: ' + name)); - } - assert(builtInCMapParams, 'built-in cMap parameters are not provided'); - - if (builtInCMapParams.packed) { - return parseBinaryCMap(name, builtInCMapParams); - } - - return new Promise(function (resolve, reject) { - var url = builtInCMapParams.url + name; - var request = new XMLHttpRequest(); - request.onreadystatechange = function () { - if (request.readyState === XMLHttpRequest.DONE) { - if (request.status === 200 || request.status === 0) { - var cMap = new CMap(true); - var lexer = new Lexer(new StringStream(request.responseText)); - parseCMap(cMap, lexer, builtInCMapParams, null).then( - function (parsedCMap) { - resolve(parsedCMap); - }); - } else { - reject(new Error('Unable to get cMap at: ' + url)); - } - } - }; - request.open('GET', url, true); - request.send(null); - }); - } - - return { - create: function (encoding, builtInCMapParams, useCMap) { - if (isName(encoding)) { - return createBuiltInCMap(encoding.name, builtInCMapParams); - } else if (isStream(encoding)) { - var cMap = new CMap(); - var lexer = new Lexer(encoding); - return parseCMap(cMap, lexer, builtInCMapParams, useCMap).then( - function (parsedCMap) { - if (parsedCMap.isIdentityCMap) { - return createBuiltInCMap(parsedCMap.name, builtInCMapParams); - } - return parsedCMap; - }); - } - return Promise.reject(new Error('Encoding required.')); - } - }; -})(); - -exports.CMap = CMap; -exports.CMapFactory = CMapFactory; -exports.IdentityCMap = IdentityCMap; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreFonts = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreStream, root.pdfjsCoreGlyphList, - root.pdfjsCoreFontRenderer, root.pdfjsCoreEncodings, - root.pdfjsCoreStandardFonts, root.pdfjsCoreUnicode, - root.pdfjsCoreType1Parser, root.pdfjsCoreCFFParser); - } -}(this, function (exports, sharedUtil, corePrimitives, coreStream, - coreGlyphList, coreFontRenderer, coreEncodings, - coreStandardFonts, coreUnicode, coreType1Parser, - coreCFFParser) { - -var FONT_IDENTITY_MATRIX = sharedUtil.FONT_IDENTITY_MATRIX; -var FontType = sharedUtil.FontType; -var assert = sharedUtil.assert; -var bytesToString = sharedUtil.bytesToString; -var error = sharedUtil.error; -var info = sharedUtil.info; -var isArray = sharedUtil.isArray; -var isInt = sharedUtil.isInt; -var isNum = sharedUtil.isNum; -var readUint32 = sharedUtil.readUint32; -var shadow = sharedUtil.shadow; -var string32 = sharedUtil.string32; -var warn = sharedUtil.warn; -var MissingDataException = sharedUtil.MissingDataException; -var isSpace = sharedUtil.isSpace; -var Stream = coreStream.Stream; -var getGlyphsUnicode = coreGlyphList.getGlyphsUnicode; -var getDingbatsGlyphsUnicode = coreGlyphList.getDingbatsGlyphsUnicode; -var FontRendererFactory = coreFontRenderer.FontRendererFactory; -var StandardEncoding = coreEncodings.StandardEncoding; -var MacRomanEncoding = coreEncodings.MacRomanEncoding; -var SymbolSetEncoding = coreEncodings.SymbolSetEncoding; -var ZapfDingbatsEncoding = coreEncodings.ZapfDingbatsEncoding; -var getEncoding = coreEncodings.getEncoding; -var getStdFontMap = coreStandardFonts.getStdFontMap; -var getNonStdFontMap = coreStandardFonts.getNonStdFontMap; -var getGlyphMapForStandardFonts = coreStandardFonts.getGlyphMapForStandardFonts; -var getSupplementalGlyphMapForArialBlack = - coreStandardFonts.getSupplementalGlyphMapForArialBlack; -var getUnicodeRangeFor = coreUnicode.getUnicodeRangeFor; -var mapSpecialUnicodeValues = coreUnicode.mapSpecialUnicodeValues; -var getUnicodeForGlyph = coreUnicode.getUnicodeForGlyph; -var Type1Parser = coreType1Parser.Type1Parser; -var CFFStandardStrings = coreCFFParser.CFFStandardStrings; -var CFFParser = coreCFFParser.CFFParser; -var CFFCompiler = coreCFFParser.CFFCompiler; -var CFF = coreCFFParser.CFF; -var CFFHeader = coreCFFParser.CFFHeader; -var CFFTopDict = coreCFFParser.CFFTopDict; -var CFFPrivateDict = coreCFFParser.CFFPrivateDict; -var CFFStrings = coreCFFParser.CFFStrings; -var CFFIndex = coreCFFParser.CFFIndex; -var CFFCharset = coreCFFParser.CFFCharset; - -// Unicode Private Use Area -var PRIVATE_USE_OFFSET_START = 0xE000; -var PRIVATE_USE_OFFSET_END = 0xF8FF; -var SKIP_PRIVATE_USE_RANGE_F000_TO_F01F = false; - -// PDF Glyph Space Units are one Thousandth of a TextSpace Unit -// except for Type 3 fonts -var PDF_GLYPH_SPACE_UNITS = 1000; - -// Accented charactars are not displayed properly on Windows, using this flag -// to control analysis of seac charstrings. -var SEAC_ANALYSIS_ENABLED = false; - -var FontFlags = { - FixedPitch: 1, - Serif: 2, - Symbolic: 4, - Script: 8, - Nonsymbolic: 32, - Italic: 64, - AllCap: 65536, - SmallCap: 131072, - ForceBold: 262144 -}; - -var MacStandardGlyphOrdering = [ - '.notdef', '.null', 'nonmarkingreturn', 'space', 'exclam', 'quotedbl', - 'numbersign', 'dollar', 'percent', 'ampersand', 'quotesingle', 'parenleft', - 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', - 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', - 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', 'at', - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', - 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', - 'backslash', 'bracketright', 'asciicircum', 'underscore', 'grave', 'a', 'b', - 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', - 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', - 'asciitilde', 'Adieresis', 'Aring', 'Ccedilla', 'Eacute', 'Ntilde', - 'Odieresis', 'Udieresis', 'aacute', 'agrave', 'acircumflex', 'adieresis', - 'atilde', 'aring', 'ccedilla', 'eacute', 'egrave', 'ecircumflex', 'edieresis', - 'iacute', 'igrave', 'icircumflex', 'idieresis', 'ntilde', 'oacute', 'ograve', - 'ocircumflex', 'odieresis', 'otilde', 'uacute', 'ugrave', 'ucircumflex', - 'udieresis', 'dagger', 'degree', 'cent', 'sterling', 'section', 'bullet', - 'paragraph', 'germandbls', 'registered', 'copyright', 'trademark', 'acute', - 'dieresis', 'notequal', 'AE', 'Oslash', 'infinity', 'plusminus', 'lessequal', - 'greaterequal', 'yen', 'mu', 'partialdiff', 'summation', 'product', 'pi', - 'integral', 'ordfeminine', 'ordmasculine', 'Omega', 'ae', 'oslash', - 'questiondown', 'exclamdown', 'logicalnot', 'radical', 'florin', - 'approxequal', 'Delta', 'guillemotleft', 'guillemotright', 'ellipsis', - 'nonbreakingspace', 'Agrave', 'Atilde', 'Otilde', 'OE', 'oe', 'endash', - 'emdash', 'quotedblleft', 'quotedblright', 'quoteleft', 'quoteright', - 'divide', 'lozenge', 'ydieresis', 'Ydieresis', 'fraction', 'currency', - 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'daggerdbl', 'periodcentered', - 'quotesinglbase', 'quotedblbase', 'perthousand', 'Acircumflex', - 'Ecircumflex', 'Aacute', 'Edieresis', 'Egrave', 'Iacute', 'Icircumflex', - 'Idieresis', 'Igrave', 'Oacute', 'Ocircumflex', 'apple', 'Ograve', 'Uacute', - 'Ucircumflex', 'Ugrave', 'dotlessi', 'circumflex', 'tilde', 'macron', - 'breve', 'dotaccent', 'ring', 'cedilla', 'hungarumlaut', 'ogonek', 'caron', - 'Lslash', 'lslash', 'Scaron', 'scaron', 'Zcaron', 'zcaron', 'brokenbar', - 'Eth', 'eth', 'Yacute', 'yacute', 'Thorn', 'thorn', 'minus', 'multiply', - 'onesuperior', 'twosuperior', 'threesuperior', 'onehalf', 'onequarter', - 'threequarters', 'franc', 'Gbreve', 'gbreve', 'Idotaccent', 'Scedilla', - 'scedilla', 'Cacute', 'cacute', 'Ccaron', 'ccaron', 'dcroat']; - -function adjustWidths(properties) { - if (!properties.fontMatrix) { - return; - } - if (properties.fontMatrix[0] === FONT_IDENTITY_MATRIX[0]) { - return; - } - // adjusting width to fontMatrix scale - var scale = 0.001 / properties.fontMatrix[0]; - var glyphsWidths = properties.widths; - for (var glyph in glyphsWidths) { - glyphsWidths[glyph] *= scale; - } - properties.defaultWidth *= scale; -} - -function adjustToUnicode(properties, builtInEncoding) { - if (properties.hasIncludedToUnicodeMap) { - return; // The font dictionary has a `ToUnicode` entry. - } - if (properties.hasEncoding) { - return; // The font dictionary has an `Encoding` entry. - } - if (builtInEncoding === properties.defaultEncoding) { - return; // No point in trying to adjust `toUnicode` if the encodings match. - } - if (properties.toUnicode instanceof IdentityToUnicodeMap) { - return; - } - var toUnicode = [], glyphsUnicodeMap = getGlyphsUnicode(); - for (var charCode in builtInEncoding) { - var glyphName = builtInEncoding[charCode]; - var unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); - if (unicode !== -1) { - toUnicode[charCode] = String.fromCharCode(unicode); - } - } - properties.toUnicode.amend(toUnicode); -} - -function getFontType(type, subtype) { - switch (type) { - case 'Type1': - return subtype === 'Type1C' ? FontType.TYPE1C : FontType.TYPE1; - case 'CIDFontType0': - return subtype === 'CIDFontType0C' ? FontType.CIDFONTTYPE0C : - FontType.CIDFONTTYPE0; - case 'OpenType': - return FontType.OPENTYPE; - case 'TrueType': - return FontType.TRUETYPE; - case 'CIDFontType2': - return FontType.CIDFONTTYPE2; - case 'MMType1': - return FontType.MMTYPE1; - case 'Type0': - return FontType.TYPE0; - default: - return FontType.UNKNOWN; - } -} - -// Some bad PDF generators, e.g. Scribus PDF, include glyph names -// in a 'uniXXXX' format -- attempting to recover proper ones. -function recoverGlyphName(name, glyphsUnicodeMap) { - if (glyphsUnicodeMap[name] !== undefined) { - return name; - } - // The glyph name is non-standard, trying to recover. - var unicode = getUnicodeForGlyph(name, glyphsUnicodeMap); - if (unicode !== -1) { - for (var key in glyphsUnicodeMap) { - if (glyphsUnicodeMap[key] === unicode) { - return key; - } - } - } - info('Unable to recover a standard glyph name for: ' + name); - return name; -} - -var Glyph = (function GlyphClosure() { - function Glyph(fontChar, unicode, accent, width, vmetric, operatorListId, - isSpace, isInFont) { - this.fontChar = fontChar; - this.unicode = unicode; - this.accent = accent; - this.width = width; - this.vmetric = vmetric; - this.operatorListId = operatorListId; - this.isSpace = isSpace; - this.isInFont = isInFont; - } - - Glyph.prototype.matchesForCache = function(fontChar, unicode, accent, width, - vmetric, operatorListId, isSpace, - isInFont) { - return this.fontChar === fontChar && - this.unicode === unicode && - this.accent === accent && - this.width === width && - this.vmetric === vmetric && - this.operatorListId === operatorListId && - this.isSpace === isSpace && - this.isInFont === isInFont; - }; - - return Glyph; -})(); - -var ToUnicodeMap = (function ToUnicodeMapClosure() { - function ToUnicodeMap(cmap) { - // The elements of this._map can be integers or strings, depending on how - // |cmap| was created. - this._map = cmap; - } - - ToUnicodeMap.prototype = { - get length() { - return this._map.length; - }, - - forEach: function(callback) { - for (var charCode in this._map) { - callback(charCode, this._map[charCode].charCodeAt(0)); - } - }, - - has: function(i) { - return this._map[i] !== undefined; - }, - - get: function(i) { - return this._map[i]; - }, - - charCodeOf: function(v) { - return this._map.indexOf(v); - }, - - amend: function (map) { - for (var charCode in map) { - this._map[charCode] = map[charCode]; - } - }, - }; - - return ToUnicodeMap; -})(); - -var IdentityToUnicodeMap = (function IdentityToUnicodeMapClosure() { - function IdentityToUnicodeMap(firstChar, lastChar) { - this.firstChar = firstChar; - this.lastChar = lastChar; - } - - IdentityToUnicodeMap.prototype = { - get length() { - return (this.lastChar + 1) - this.firstChar; - }, - - forEach: function (callback) { - for (var i = this.firstChar, ii = this.lastChar; i <= ii; i++) { - callback(i, i); - } - }, - - has: function (i) { - return this.firstChar <= i && i <= this.lastChar; - }, - - get: function (i) { - if (this.firstChar <= i && i <= this.lastChar) { - return String.fromCharCode(i); - } - return undefined; - }, - - charCodeOf: function (v) { - return (isInt(v) && v >= this.firstChar && v <= this.lastChar) ? v : -1; - }, - - amend: function (map) { - error('Should not call amend()'); - }, - }; - - return IdentityToUnicodeMap; -})(); - -var OpenTypeFileBuilder = (function OpenTypeFileBuilderClosure() { - function writeInt16(dest, offset, num) { - dest[offset] = (num >> 8) & 0xFF; - dest[offset + 1] = num & 0xFF; - } - - function writeInt32(dest, offset, num) { - dest[offset] = (num >> 24) & 0xFF; - dest[offset + 1] = (num >> 16) & 0xFF; - dest[offset + 2] = (num >> 8) & 0xFF; - dest[offset + 3] = num & 0xFF; - } - - function writeData(dest, offset, data) { - var i, ii; - if (data instanceof Uint8Array) { - dest.set(data, offset); - } else if (typeof data === 'string') { - for (i = 0, ii = data.length; i < ii; i++) { - dest[offset++] = data.charCodeAt(i) & 0xFF; - } - } else { - // treating everything else as array - for (i = 0, ii = data.length; i < ii; i++) { - dest[offset++] = data[i] & 0xFF; - } - } - } - - function OpenTypeFileBuilder(sfnt) { - this.sfnt = sfnt; - this.tables = Object.create(null); - } - - OpenTypeFileBuilder.getSearchParams = - function OpenTypeFileBuilder_getSearchParams(entriesCount, entrySize) { - var maxPower2 = 1, log2 = 0; - while ((maxPower2 ^ entriesCount) > maxPower2) { - maxPower2 <<= 1; - log2++; - } - var searchRange = maxPower2 * entrySize; - return { - range: searchRange, - entry: log2, - rangeShift: entrySize * entriesCount - searchRange - }; - }; - - var OTF_HEADER_SIZE = 12; - var OTF_TABLE_ENTRY_SIZE = 16; - - OpenTypeFileBuilder.prototype = { - toArray: function OpenTypeFileBuilder_toArray() { - var sfnt = this.sfnt; - - // Tables needs to be written by ascendant alphabetic order - var tables = this.tables; - var tablesNames = Object.keys(tables); - tablesNames.sort(); - var numTables = tablesNames.length; - - var i, j, jj, table, tableName; - // layout the tables data - var offset = OTF_HEADER_SIZE + numTables * OTF_TABLE_ENTRY_SIZE; - var tableOffsets = [offset]; - for (i = 0; i < numTables; i++) { - table = tables[tablesNames[i]]; - var paddedLength = ((table.length + 3) & ~3) >>> 0; - offset += paddedLength; - tableOffsets.push(offset); - } - - var file = new Uint8Array(offset); - // write the table data first (mostly for checksum) - for (i = 0; i < numTables; i++) { - table = tables[tablesNames[i]]; - writeData(file, tableOffsets[i], table); - } - - // sfnt version (4 bytes) - if (sfnt === 'true') { - // Windows hates the Mac TrueType sfnt version number - sfnt = string32(0x00010000); - } - file[0] = sfnt.charCodeAt(0) & 0xFF; - file[1] = sfnt.charCodeAt(1) & 0xFF; - file[2] = sfnt.charCodeAt(2) & 0xFF; - file[3] = sfnt.charCodeAt(3) & 0xFF; - - // numTables (2 bytes) - writeInt16(file, 4, numTables); - - var searchParams = OpenTypeFileBuilder.getSearchParams(numTables, 16); - - // searchRange (2 bytes) - writeInt16(file, 6, searchParams.range); - // entrySelector (2 bytes) - writeInt16(file, 8, searchParams.entry); - // rangeShift (2 bytes) - writeInt16(file, 10, searchParams.rangeShift); - - offset = OTF_HEADER_SIZE; - // writing table entries - for (i = 0; i < numTables; i++) { - tableName = tablesNames[i]; - file[offset] = tableName.charCodeAt(0) & 0xFF; - file[offset + 1] = tableName.charCodeAt(1) & 0xFF; - file[offset + 2] = tableName.charCodeAt(2) & 0xFF; - file[offset + 3] = tableName.charCodeAt(3) & 0xFF; - - // checksum - var checksum = 0; - for (j = tableOffsets[i], jj = tableOffsets[i + 1]; j < jj; j += 4) { - var quad = readUint32(file, j); - checksum = (checksum + quad) >>> 0; - } - writeInt32(file, offset + 4, checksum); - - // offset - writeInt32(file, offset + 8, tableOffsets[i]); - // length - writeInt32(file, offset + 12, tables[tableName].length); - - offset += OTF_TABLE_ENTRY_SIZE; - } - return file; - }, - - addTable: function OpenTypeFileBuilder_addTable(tag, data) { - if (tag in this.tables) { - throw new Error('Table ' + tag + ' already exists'); - } - this.tables[tag] = data; - } - }; - - return OpenTypeFileBuilder; -})(); - -// Problematic Unicode characters in the fonts that needs to be moved to avoid -// issues when they are painted on the canvas, e.g. complex-script shaping or -// control/whitespace characters. The ranges are listed in pairs: the first item -// is a code of the first problematic code, the second one is the next -// non-problematic code. The ranges must be in sorted order. -var ProblematicCharRanges = new Int32Array([ - // Control characters. - 0x0000, 0x0020, - 0x007F, 0x00A1, - 0x00AD, 0x00AE, - // Chars that is used in complex-script shaping. - 0x0600, 0x0780, - 0x08A0, 0x10A0, - 0x1780, 0x1800, - 0x1C00, 0x1C50, - // General punctuation chars. - 0x2000, 0x2010, - 0x2011, 0x2012, - 0x2028, 0x2030, - 0x205F, 0x2070, - 0x25CC, 0x25CD, - 0x3000, 0x3001, - // Chars that is used in complex-script shaping. - 0xAA60, 0xAA80, - // Specials Unicode block. - 0xFFF0, 0x10000 -]); - - -/** - * 'Font' is the class the outside world should use, it encapsulate all the font - * decoding logics whatever type it is (assuming the font type is supported). - * - * For example to read a Type1 font and to attach it to the document: - * var type1Font = new Font("MyFontName", binaryFile, propertiesObject); - * type1Font.bind(); - */ -var Font = (function FontClosure() { - function Font(name, file, properties) { - var charCode, glyphName, unicode; - - this.name = name; - this.loadedName = properties.loadedName; - this.isType3Font = properties.isType3Font; - this.sizes = []; - this.missingFile = false; - - this.glyphCache = Object.create(null); - - var names = name.split('+'); - names = names.length > 1 ? names[1] : names[0]; - names = names.split(/[-,_]/g)[0]; - this.isSerifFont = !!(properties.flags & FontFlags.Serif); - this.isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); - this.isMonospace = !!(properties.flags & FontFlags.FixedPitch); - - var type = properties.type; - var subtype = properties.subtype; - this.type = type; - - this.fallbackName = (this.isMonospace ? 'monospace' : - (this.isSerifFont ? 'serif' : 'sans-serif')); - - this.differences = properties.differences; - this.widths = properties.widths; - this.defaultWidth = properties.defaultWidth; - this.composite = properties.composite; - this.wideChars = properties.wideChars; - this.cMap = properties.cMap; - this.ascent = properties.ascent / PDF_GLYPH_SPACE_UNITS; - this.descent = properties.descent / PDF_GLYPH_SPACE_UNITS; - this.fontMatrix = properties.fontMatrix; - this.bbox = properties.bbox; - - this.toUnicode = properties.toUnicode; - - this.toFontChar = []; - - if (properties.type === 'Type3') { - for (charCode = 0; charCode < 256; charCode++) { - this.toFontChar[charCode] = (this.differences[charCode] || - properties.defaultEncoding[charCode]); - } - this.fontType = FontType.TYPE3; - return; - } - - this.cidEncoding = properties.cidEncoding; - this.vertical = properties.vertical; - if (this.vertical) { - this.vmetrics = properties.vmetrics; - this.defaultVMetrics = properties.defaultVMetrics; - } - var glyphsUnicodeMap; - if (!file || file.isEmpty) { - if (file) { - // Some bad PDF generators will include empty font files, - // attempting to recover by assuming that no file exists. - warn('Font file is empty in "' + name + '" (' + this.loadedName + ')'); - } - - this.missingFile = true; - // The file data is not specified. Trying to fix the font name - // to be used with the canvas.font. - var fontName = name.replace(/[,_]/g, '-'); - var stdFontMap = getStdFontMap(), nonStdFontMap = getNonStdFontMap(); - var isStandardFont = !!stdFontMap[fontName] || - !!(nonStdFontMap[fontName] && stdFontMap[nonStdFontMap[fontName]]); - fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName; - - this.bold = (fontName.search(/bold/gi) !== -1); - this.italic = ((fontName.search(/oblique/gi) !== -1) || - (fontName.search(/italic/gi) !== -1)); - - // Use 'name' instead of 'fontName' here because the original - // name ArialBlack for example will be replaced by Helvetica. - this.black = (name.search(/Black/g) !== -1); - - // if at least one width is present, remeasure all chars when exists - this.remeasure = Object.keys(this.widths).length > 0; - if (isStandardFont && type === 'CIDFontType2' && - properties.cidEncoding.indexOf('Identity-') === 0) { - var GlyphMapForStandardFonts = getGlyphMapForStandardFonts(); - // Standard fonts might be embedded as CID font without glyph mapping. - // Building one based on GlyphMapForStandardFonts. - var map = []; - for (charCode in GlyphMapForStandardFonts) { - map[+charCode] = GlyphMapForStandardFonts[charCode]; - } - if (/ArialBlack/i.test(name)) { - var SupplementalGlyphMapForArialBlack = - getSupplementalGlyphMapForArialBlack(); - for (charCode in SupplementalGlyphMapForArialBlack) { - map[+charCode] = SupplementalGlyphMapForArialBlack[charCode]; - } - } - var isIdentityUnicode = this.toUnicode instanceof IdentityToUnicodeMap; - if (!isIdentityUnicode) { - this.toUnicode.forEach(function(charCode, unicodeCharCode) { - map[+charCode] = unicodeCharCode; - }); - } - this.toFontChar = map; - this.toUnicode = new ToUnicodeMap(map); - } else if (/Symbol/i.test(fontName)) { - this.toFontChar = buildToFontChar(SymbolSetEncoding, getGlyphsUnicode(), - properties.differences); - } else if (/Dingbats/i.test(fontName)) { - if (/Wingdings/i.test(name)) { - warn('Non-embedded Wingdings font, falling back to ZapfDingbats.'); - } - this.toFontChar = buildToFontChar(ZapfDingbatsEncoding, - getDingbatsGlyphsUnicode(), - properties.differences); - } else if (isStandardFont) { - this.toFontChar = buildToFontChar(properties.defaultEncoding, - getGlyphsUnicode(), - properties.differences); - } else { - glyphsUnicodeMap = getGlyphsUnicode(); - this.toUnicode.forEach(function(charCode, unicodeCharCode) { - if (!this.composite) { - glyphName = (properties.differences[charCode] || - properties.defaultEncoding[charCode]); - unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); - if (unicode !== -1) { - unicodeCharCode = unicode; - } - } - this.toFontChar[charCode] = unicodeCharCode; - }.bind(this)); - } - this.loadedName = fontName.split('-')[0]; - this.loading = false; - this.fontType = getFontType(type, subtype); - return; - } - - // Some fonts might use wrong font types for Type1C or CIDFontType0C - if (subtype === 'Type1C') { - if (type !== 'Type1' && type !== 'MMType1') { - // Some TrueType fonts by mistake claim Type1C - if (isTrueTypeFile(file)) { - subtype = 'TrueType'; - } else { - type = 'Type1'; - } - } else if (isOpenTypeFile(file)) { - // Sometimes the type/subtype can be a complete lie (see issue7598.pdf). - type = subtype = 'OpenType'; - } - } - if (subtype === 'CIDFontType0C' && type !== 'CIDFontType0') { - type = 'CIDFontType0'; - } - if (subtype === 'OpenType') { - type = 'OpenType'; - } - // Some CIDFontType0C fonts by mistake claim CIDFontType0. - if (type === 'CIDFontType0') { - if (isType1File(file)) { - subtype = 'CIDFontType0'; - } else if (isOpenTypeFile(file)) { - // Sometimes the type/subtype can be a complete lie (see issue6782.pdf). - type = subtype = 'OpenType'; - } else { - subtype = 'CIDFontType0C'; - } - } - - var data; - switch (type) { - case 'MMType1': - info('MMType1 font (' + name + '), falling back to Type1.'); - /* falls through */ - case 'Type1': - case 'CIDFontType0': - this.mimetype = 'font/opentype'; - - var cff = (subtype === 'Type1C' || subtype === 'CIDFontType0C') ? - new CFFFont(file, properties) : new Type1Font(name, file, properties); - - adjustWidths(properties); - - // Wrap the CFF data inside an OTF font file - data = this.convert(name, cff, properties); - break; - - case 'OpenType': - case 'TrueType': - case 'CIDFontType2': - this.mimetype = 'font/opentype'; - - // Repair the TrueType file. It is can be damaged in the point of - // view of the sanitizer - data = this.checkAndRepair(name, file, properties); - if (this.isOpenType) { - adjustWidths(properties); - - type = 'OpenType'; - } - break; - - default: - error('Font ' + type + ' is not supported'); - break; - } - - this.data = data; - this.fontType = getFontType(type, subtype); - - // Transfer some properties again that could change during font conversion - this.fontMatrix = properties.fontMatrix; - this.widths = properties.widths; - this.defaultWidth = properties.defaultWidth; - this.toUnicode = properties.toUnicode; - this.encoding = properties.baseEncoding; - this.seacMap = properties.seacMap; - - this.loading = true; - } - - Font.getFontID = (function () { - var ID = 1; - return function Font_getFontID() { - return String(ID++); - }; - })(); - - function int16(b0, b1) { - return (b0 << 8) + b1; - } - - function signedInt16(b0, b1) { - var value = (b0 << 8) + b1; - return value & (1 << 15) ? value - 0x10000 : value; - } - - function int32(b0, b1, b2, b3) { - return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; - } - - function string16(value) { - return String.fromCharCode((value >> 8) & 0xff, value & 0xff); - } - - function safeString16(value) { - // clamp value to the 16-bit int range - value = (value > 0x7FFF ? 0x7FFF : (value < -0x8000 ? -0x8000 : value)); - return String.fromCharCode((value >> 8) & 0xff, value & 0xff); - } - - function isTrueTypeFile(file) { - var header = file.peekBytes(4); - return readUint32(header, 0) === 0x00010000; - } - - function isOpenTypeFile(file) { - var header = file.peekBytes(4); - return bytesToString(header) === 'OTTO'; - } - - function isType1File(file) { - var header = file.peekBytes(2); - // All Type1 font programs must begin with the comment '%!' (0x25 + 0x21). - if (header[0] === 0x25 && header[1] === 0x21) { - return true; - } - // ... obviously some fonts violate that part of the specification, - // please refer to the comment in |Type1Font| below. - if (header[0] === 0x80 && header[1] === 0x01) { // pfb file header. - return true; - } - return false; - } - - function buildToFontChar(encoding, glyphsUnicodeMap, differences) { - var toFontChar = [], unicode; - for (var i = 0, ii = encoding.length; i < ii; i++) { - unicode = getUnicodeForGlyph(encoding[i], glyphsUnicodeMap); - if (unicode !== -1) { - toFontChar[i] = unicode; - } - } - for (var charCode in differences) { - unicode = getUnicodeForGlyph(differences[charCode], glyphsUnicodeMap); - if (unicode !== -1) { - toFontChar[+charCode] = unicode; - } - } - return toFontChar; - } - - /** - * Helper function for `adjustMapping`. - * @return {boolean} - */ - function isProblematicUnicodeLocation(code) { - // Using binary search to find a range start. - var i = 0, j = ProblematicCharRanges.length - 1; - while (i < j) { - var c = (i + j + 1) >> 1; - if (code < ProblematicCharRanges[c]) { - j = c - 1; - } else { - i = c; - } - } - // Even index means code in problematic range. - return !(i & 1); - } - - /** - * Rebuilds the char code to glyph ID map by trying to replace the char codes - * with their unicode value. It also moves char codes that are in known - * problematic locations. - * @return {Object} Two properties: - * 'toFontChar' - maps original char codes(the value that will be read - * from commands such as show text) to the char codes that will be used in the - * font that we build - * 'charCodeToGlyphId' - maps the new font char codes to glyph ids - */ - function adjustMapping(charCodeToGlyphId, properties) { - var toUnicode = properties.toUnicode; - var isSymbolic = !!(properties.flags & FontFlags.Symbolic); - var isIdentityUnicode = - properties.toUnicode instanceof IdentityToUnicodeMap; - var newMap = Object.create(null); - var toFontChar = []; - var usedFontCharCodes = []; - var nextAvailableFontCharCode = PRIVATE_USE_OFFSET_START; - for (var originalCharCode in charCodeToGlyphId) { - originalCharCode |= 0; - var glyphId = charCodeToGlyphId[originalCharCode]; - var fontCharCode = originalCharCode; - // First try to map the value to a unicode position if a non identity map - // was created. - var hasUnicodeValue = false; - if (!isIdentityUnicode && toUnicode.has(originalCharCode)) { - var unicode = toUnicode.get(fontCharCode); - // TODO: Try to map ligatures to the correct spot. - if (unicode.length === 1) { - fontCharCode = unicode.charCodeAt(0); - } - // For Symbolic fonts, we trust the `unicode` value if and only if the - // font includes either `ToUnicode` or `Encoding` data, since otherwise - // `toUnicode` may not be correct. - hasUnicodeValue = properties.hasIncludedToUnicodeMap || - properties.hasEncoding; - } - // Try to move control characters, special characters and already mapped - // characters to the private use area since they will not be drawn by - // canvas if left in their current position. Also, move characters if the - // font was symbolic and there is only an identity unicode map since the - // characters probably aren't in the correct position (fixes an issue - // with firefox and thuluthfont). - if ((usedFontCharCodes[fontCharCode] !== undefined || - isProblematicUnicodeLocation(fontCharCode) || - (isSymbolic && !hasUnicodeValue)) && - nextAvailableFontCharCode <= PRIVATE_USE_OFFSET_END) { // Room left. - // Loop to try and find a free spot in the private use area. - do { - fontCharCode = nextAvailableFontCharCode++; - - if (SKIP_PRIVATE_USE_RANGE_F000_TO_F01F && fontCharCode === 0xF000) { - fontCharCode = 0xF020; - nextAvailableFontCharCode = fontCharCode + 1; - } - - } while (usedFontCharCodes[fontCharCode] !== undefined && - nextAvailableFontCharCode <= PRIVATE_USE_OFFSET_END); - } - - newMap[fontCharCode] = glyphId; - toFontChar[originalCharCode] = fontCharCode; - usedFontCharCodes[fontCharCode] = true; - } - return { - toFontChar: toFontChar, - charCodeToGlyphId: newMap, - nextAvailableFontCharCode: nextAvailableFontCharCode - }; - } - - function getRanges(glyphs, numGlyphs) { - // Array.sort() sorts by characters, not numerically, so convert to an - // array of characters. - var codes = []; - for (var charCode in glyphs) { - // Remove an invalid glyph ID mappings to make OTS happy. - if (glyphs[charCode] >= numGlyphs) { - continue; - } - codes.push({ fontCharCode: charCode | 0, glyphId: glyphs[charCode] }); - } - codes.sort(function fontGetRangesSort(a, b) { - return a.fontCharCode - b.fontCharCode; - }); - - // Split the sorted codes into ranges. - var ranges = []; - var length = codes.length; - for (var n = 0; n < length; ) { - var start = codes[n].fontCharCode; - var codeIndices = [codes[n].glyphId]; - ++n; - var end = start; - while (n < length && end + 1 === codes[n].fontCharCode) { - codeIndices.push(codes[n].glyphId); - ++end; - ++n; - if (end === 0xFFFF) { - break; - } - } - ranges.push([start, end, codeIndices]); - } - - return ranges; - } - - function createCmapTable(glyphs, numGlyphs) { - var ranges = getRanges(glyphs, numGlyphs); - var numTables = ranges[ranges.length - 1][1] > 0xFFFF ? 2 : 1; - var cmap = '\x00\x00' + // version - string16(numTables) + // numTables - '\x00\x03' + // platformID - '\x00\x01' + // encodingID - string32(4 + numTables * 8); // start of the table record - - var i, ii, j, jj; - for (i = ranges.length - 1; i >= 0; --i) { - if (ranges[i][0] <= 0xFFFF) { break; } - } - var bmpLength = i + 1; - - if (ranges[i][0] < 0xFFFF && ranges[i][1] === 0xFFFF) { - ranges[i][1] = 0xFFFE; - } - var trailingRangesCount = ranges[i][1] < 0xFFFF ? 1 : 0; - var segCount = bmpLength + trailingRangesCount; - var searchParams = OpenTypeFileBuilder.getSearchParams(segCount, 2); - - // Fill up the 4 parallel arrays describing the segments. - var startCount = ''; - var endCount = ''; - var idDeltas = ''; - var idRangeOffsets = ''; - var glyphsIds = ''; - var bias = 0; - - var range, start, end, codes; - for (i = 0, ii = bmpLength; i < ii; i++) { - range = ranges[i]; - start = range[0]; - end = range[1]; - startCount += string16(start); - endCount += string16(end); - codes = range[2]; - var contiguous = true; - for (j = 1, jj = codes.length; j < jj; ++j) { - if (codes[j] !== codes[j - 1] + 1) { - contiguous = false; - break; - } - } - if (!contiguous) { - var offset = (segCount - i) * 2 + bias * 2; - bias += (end - start + 1); - - idDeltas += string16(0); - idRangeOffsets += string16(offset); - - for (j = 0, jj = codes.length; j < jj; ++j) { - glyphsIds += string16(codes[j]); - } - } else { - var startCode = codes[0]; - - idDeltas += string16((startCode - start) & 0xFFFF); - idRangeOffsets += string16(0); - } - } - - if (trailingRangesCount > 0) { - endCount += '\xFF\xFF'; - startCount += '\xFF\xFF'; - idDeltas += '\x00\x01'; - idRangeOffsets += '\x00\x00'; - } - - var format314 = '\x00\x00' + // language - string16(2 * segCount) + - string16(searchParams.range) + - string16(searchParams.entry) + - string16(searchParams.rangeShift) + - endCount + '\x00\x00' + startCount + - idDeltas + idRangeOffsets + glyphsIds; - - var format31012 = ''; - var header31012 = ''; - if (numTables > 1) { - cmap += '\x00\x03' + // platformID - '\x00\x0A' + // encodingID - string32(4 + numTables * 8 + - 4 + format314.length); // start of the table record - format31012 = ''; - for (i = 0, ii = ranges.length; i < ii; i++) { - range = ranges[i]; - start = range[0]; - codes = range[2]; - var code = codes[0]; - for (j = 1, jj = codes.length; j < jj; ++j) { - if (codes[j] !== codes[j - 1] + 1) { - end = range[0] + j - 1; - format31012 += string32(start) + // startCharCode - string32(end) + // endCharCode - string32(code); // startGlyphID - start = end + 1; - code = codes[j]; - } - } - format31012 += string32(start) + // startCharCode - string32(range[1]) + // endCharCode - string32(code); // startGlyphID - } - header31012 = '\x00\x0C' + // format - '\x00\x00' + // reserved - string32(format31012.length + 16) + // length - '\x00\x00\x00\x00' + // language - string32(format31012.length / 12); // nGroups - } - - return cmap + '\x00\x04' + // format - string16(format314.length + 4) + // length - format314 + header31012 + format31012; - } - - function validateOS2Table(os2) { - var stream = new Stream(os2.data); - var version = stream.getUint16(); - // TODO verify all OS/2 tables fields, but currently we validate only those - // that give us issues - stream.getBytes(60); // skipping type, misc sizes, panose, unicode ranges - var selection = stream.getUint16(); - if (version < 4 && (selection & 0x0300)) { - return false; - } - var firstChar = stream.getUint16(); - var lastChar = stream.getUint16(); - if (firstChar > lastChar) { - return false; - } - stream.getBytes(6); // skipping sTypoAscender/Descender/LineGap - var usWinAscent = stream.getUint16(); - if (usWinAscent === 0) { // makes font unreadable by windows - return false; - } - - // OS/2 appears to be valid, resetting some fields - os2.data[8] = os2.data[9] = 0; // IE rejects fonts if fsType != 0 - return true; - } - - function createOS2Table(properties, charstrings, override) { - override = override || { - unitsPerEm: 0, - yMax: 0, - yMin: 0, - ascent: 0, - descent: 0 - }; - - var ulUnicodeRange1 = 0; - var ulUnicodeRange2 = 0; - var ulUnicodeRange3 = 0; - var ulUnicodeRange4 = 0; - - var firstCharIndex = null; - var lastCharIndex = 0; - - if (charstrings) { - for (var code in charstrings) { - code |= 0; - if (firstCharIndex > code || !firstCharIndex) { - firstCharIndex = code; - } - if (lastCharIndex < code) { - lastCharIndex = code; - } - - var position = getUnicodeRangeFor(code); - if (position < 32) { - ulUnicodeRange1 |= 1 << position; - } else if (position < 64) { - ulUnicodeRange2 |= 1 << position - 32; - } else if (position < 96) { - ulUnicodeRange3 |= 1 << position - 64; - } else if (position < 123) { - ulUnicodeRange4 |= 1 << position - 96; - } else { - error('Unicode ranges Bits > 123 are reserved for internal usage'); - } - } - } else { - // TODO - firstCharIndex = 0; - lastCharIndex = 255; - } - - var bbox = properties.bbox || [0, 0, 0, 0]; - var unitsPerEm = (override.unitsPerEm || - 1 / (properties.fontMatrix || FONT_IDENTITY_MATRIX)[0]); - - // if the font units differ to the PDF glyph space units - // then scale up the values - var scale = (properties.ascentScaled ? 1.0 : - unitsPerEm / PDF_GLYPH_SPACE_UNITS); - - var typoAscent = (override.ascent || - Math.round(scale * (properties.ascent || bbox[3]))); - var typoDescent = (override.descent || - Math.round(scale * (properties.descent || bbox[1]))); - if (typoDescent > 0 && properties.descent > 0 && bbox[1] < 0) { - typoDescent = -typoDescent; // fixing incorrect descent - } - var winAscent = override.yMax || typoAscent; - var winDescent = -override.yMin || -typoDescent; - - return '\x00\x03' + // version - '\x02\x24' + // xAvgCharWidth - '\x01\xF4' + // usWeightClass - '\x00\x05' + // usWidthClass - '\x00\x00' + // fstype (0 to let the font loads via font-face on IE) - '\x02\x8A' + // ySubscriptXSize - '\x02\xBB' + // ySubscriptYSize - '\x00\x00' + // ySubscriptXOffset - '\x00\x8C' + // ySubscriptYOffset - '\x02\x8A' + // ySuperScriptXSize - '\x02\xBB' + // ySuperScriptYSize - '\x00\x00' + // ySuperScriptXOffset - '\x01\xDF' + // ySuperScriptYOffset - '\x00\x31' + // yStrikeOutSize - '\x01\x02' + // yStrikeOutPosition - '\x00\x00' + // sFamilyClass - '\x00\x00\x06' + - String.fromCharCode(properties.fixedPitch ? 0x09 : 0x00) + - '\x00\x00\x00\x00\x00\x00' + // Panose - string32(ulUnicodeRange1) + // ulUnicodeRange1 (Bits 0-31) - string32(ulUnicodeRange2) + // ulUnicodeRange2 (Bits 32-63) - string32(ulUnicodeRange3) + // ulUnicodeRange3 (Bits 64-95) - string32(ulUnicodeRange4) + // ulUnicodeRange4 (Bits 96-127) - '\x2A\x32\x31\x2A' + // achVendID - string16(properties.italicAngle ? 1 : 0) + // fsSelection - string16(firstCharIndex || - properties.firstChar) + // usFirstCharIndex - string16(lastCharIndex || properties.lastChar) + // usLastCharIndex - string16(typoAscent) + // sTypoAscender - string16(typoDescent) + // sTypoDescender - '\x00\x64' + // sTypoLineGap (7%-10% of the unitsPerEM value) - string16(winAscent) + // usWinAscent - string16(winDescent) + // usWinDescent - '\x00\x00\x00\x00' + // ulCodePageRange1 (Bits 0-31) - '\x00\x00\x00\x00' + // ulCodePageRange2 (Bits 32-63) - string16(properties.xHeight) + // sxHeight - string16(properties.capHeight) + // sCapHeight - string16(0) + // usDefaultChar - string16(firstCharIndex || properties.firstChar) + // usBreakChar - '\x00\x03'; // usMaxContext - } - - function createPostTable(properties) { - var angle = Math.floor(properties.italicAngle * (Math.pow(2, 16))); - return ('\x00\x03\x00\x00' + // Version number - string32(angle) + // italicAngle - '\x00\x00' + // underlinePosition - '\x00\x00' + // underlineThickness - string32(properties.fixedPitch) + // isFixedPitch - '\x00\x00\x00\x00' + // minMemType42 - '\x00\x00\x00\x00' + // maxMemType42 - '\x00\x00\x00\x00' + // minMemType1 - '\x00\x00\x00\x00'); // maxMemType1 - } - - function createNameTable(name, proto) { - if (!proto) { - proto = [[], []]; // no strings and unicode strings - } - - var strings = [ - proto[0][0] || 'Original licence', // 0.Copyright - proto[0][1] || name, // 1.Font family - proto[0][2] || 'Unknown', // 2.Font subfamily (font weight) - proto[0][3] || 'uniqueID', // 3.Unique ID - proto[0][4] || name, // 4.Full font name - proto[0][5] || 'Version 0.11', // 5.Version - proto[0][6] || '', // 6.Postscript name - proto[0][7] || 'Unknown', // 7.Trademark - proto[0][8] || 'Unknown', // 8.Manufacturer - proto[0][9] || 'Unknown' // 9.Designer - ]; - - // Mac want 1-byte per character strings while Windows want - // 2-bytes per character, so duplicate the names table - var stringsUnicode = []; - var i, ii, j, jj, str; - for (i = 0, ii = strings.length; i < ii; i++) { - str = proto[1][i] || strings[i]; - - var strBufUnicode = []; - for (j = 0, jj = str.length; j < jj; j++) { - strBufUnicode.push(string16(str.charCodeAt(j))); - } - stringsUnicode.push(strBufUnicode.join('')); - } - - var names = [strings, stringsUnicode]; - var platforms = ['\x00\x01', '\x00\x03']; - var encodings = ['\x00\x00', '\x00\x01']; - var languages = ['\x00\x00', '\x04\x09']; - - var namesRecordCount = strings.length * platforms.length; - var nameTable = - '\x00\x00' + // format - string16(namesRecordCount) + // Number of names Record - string16(namesRecordCount * 12 + 6); // Storage - - // Build the name records field - var strOffset = 0; - for (i = 0, ii = platforms.length; i < ii; i++) { - var strs = names[i]; - for (j = 0, jj = strs.length; j < jj; j++) { - str = strs[j]; - var nameRecord = - platforms[i] + // platform ID - encodings[i] + // encoding ID - languages[i] + // language ID - string16(j) + // name ID - string16(str.length) + - string16(strOffset); - nameTable += nameRecord; - strOffset += str.length; - } - } - - nameTable += strings.join('') + stringsUnicode.join(''); - return nameTable; - } - - Font.prototype = { - name: null, - font: null, - mimetype: null, - encoding: null, - get renderer() { - var renderer = FontRendererFactory.create(this, SEAC_ANALYSIS_ENABLED); - return shadow(this, 'renderer', renderer); - }, - - exportData: function Font_exportData() { - // TODO remove enumerating of the properties, e.g. hardcode exact names. - var data = {}; - for (var i in this) { - if (this.hasOwnProperty(i)) { - data[i] = this[i]; - } - } - return data; - }, - - checkAndRepair: function Font_checkAndRepair(name, font, properties) { - function readTableEntry(file) { - var tag = bytesToString(file.getBytes(4)); - - var checksum = file.getInt32() >>> 0; - var offset = file.getInt32() >>> 0; - var length = file.getInt32() >>> 0; - - // Read the table associated data - var previousPosition = file.pos; - file.pos = file.start ? file.start : 0; - file.skip(offset); - var data = file.getBytes(length); - file.pos = previousPosition; - - if (tag === 'head') { - // clearing checksum adjustment - data[8] = data[9] = data[10] = data[11] = 0; - data[17] |= 0x20; //Set font optimized for cleartype flag - } - - return { - tag: tag, - checksum: checksum, - length: length, - offset: offset, - data: data - }; - } - - function readOpenTypeHeader(ttf) { - return { - version: bytesToString(ttf.getBytes(4)), - numTables: ttf.getUint16(), - searchRange: ttf.getUint16(), - entrySelector: ttf.getUint16(), - rangeShift: ttf.getUint16() - }; - } - - /** - * Read the appropriate subtable from the cmap according to 9.6.6.4 from - * PDF spec - */ - function readCmapTable(cmap, font, isSymbolicFont, hasEncoding) { - if (!cmap) { - warn('No cmap table available.'); - return { - platformId: -1, - encodingId: -1, - mappings: [], - hasShortCmap: false - }; - } - var segment; - var start = (font.start ? font.start : 0) + cmap.offset; - font.pos = start; - - var version = font.getUint16(); - var numTables = font.getUint16(); - - var potentialTable; - var canBreak = false; - // There's an order of preference in terms of which cmap subtable to - // use: - // - non-symbolic fonts the preference is a 3,1 table then a 1,0 table - // - symbolic fonts the preference is a 3,0 table then a 1,0 table - // The following takes advantage of the fact that the tables are sorted - // to work. - for (var i = 0; i < numTables; i++) { - var platformId = font.getUint16(); - var encodingId = font.getUint16(); - var offset = font.getInt32() >>> 0; - var useTable = false; - - if (platformId === 0 && encodingId === 0) { - useTable = true; - // Continue the loop since there still may be a higher priority - // table. - } else if (platformId === 1 && encodingId === 0) { - useTable = true; - // Continue the loop since there still may be a higher priority - // table. - } else if (platformId === 3 && encodingId === 1 && - ((!isSymbolicFont && hasEncoding) || !potentialTable)) { - useTable = true; - if (!isSymbolicFont) { - canBreak = true; - } - } else if (isSymbolicFont && platformId === 3 && encodingId === 0) { - useTable = true; - canBreak = true; - } - - if (useTable) { - potentialTable = { - platformId: platformId, - encodingId: encodingId, - offset: offset - }; - } - if (canBreak) { - break; - } - } - - if (potentialTable) { - font.pos = start + potentialTable.offset; - } - if (!potentialTable || font.peekByte() === -1) { - warn('Could not find a preferred cmap table.'); - return { - platformId: -1, - encodingId: -1, - mappings: [], - hasShortCmap: false - }; - } - - var format = font.getUint16(); - var length = font.getUint16(); - var language = font.getUint16(); - - var hasShortCmap = false; - var mappings = []; - var j, glyphId; - - // TODO(mack): refactor this cmap subtable reading logic out - if (format === 0) { - for (j = 0; j < 256; j++) { - var index = font.getByte(); - if (!index) { - continue; - } - mappings.push({ - charCode: j, - glyphId: index - }); - } - hasShortCmap = true; - } else if (format === 4) { - // re-creating the table in format 4 since the encoding - // might be changed - var segCount = (font.getUint16() >> 1); - font.getBytes(6); // skipping range fields - var segIndex, segments = []; - for (segIndex = 0; segIndex < segCount; segIndex++) { - segments.push({ end: font.getUint16() }); - } - font.getUint16(); - for (segIndex = 0; segIndex < segCount; segIndex++) { - segments[segIndex].start = font.getUint16(); - } - - for (segIndex = 0; segIndex < segCount; segIndex++) { - segments[segIndex].delta = font.getUint16(); - } - - var offsetsCount = 0; - for (segIndex = 0; segIndex < segCount; segIndex++) { - segment = segments[segIndex]; - var rangeOffset = font.getUint16(); - if (!rangeOffset) { - segment.offsetIndex = -1; - continue; - } - - var offsetIndex = (rangeOffset >> 1) - (segCount - segIndex); - segment.offsetIndex = offsetIndex; - offsetsCount = Math.max(offsetsCount, offsetIndex + - segment.end - segment.start + 1); - } - - var offsets = []; - for (j = 0; j < offsetsCount; j++) { - offsets.push(font.getUint16()); - } - - for (segIndex = 0; segIndex < segCount; segIndex++) { - segment = segments[segIndex]; - start = segment.start; - var end = segment.end; - var delta = segment.delta; - offsetIndex = segment.offsetIndex; - - for (j = start; j <= end; j++) { - if (j === 0xFFFF) { - continue; - } - - glyphId = (offsetIndex < 0 ? - j : offsets[offsetIndex + j - start]); - glyphId = (glyphId + delta) & 0xFFFF; - if (glyphId === 0) { - continue; - } - mappings.push({ - charCode: j, - glyphId: glyphId - }); - } - } - } else if (format === 6) { - // Format 6 is a 2-bytes dense mapping, which means the font data - // lives glue together even if they are pretty far in the unicode - // table. (This looks weird, so I can have missed something), this - // works on Linux but seems to fails on Mac so let's rewrite the - // cmap table to a 3-1-4 style - var firstCode = font.getUint16(); - var entryCount = font.getUint16(); - - for (j = 0; j < entryCount; j++) { - glyphId = font.getUint16(); - var charCode = firstCode + j; - - mappings.push({ - charCode: charCode, - glyphId: glyphId - }); - } - } else { - warn('cmap table has unsupported format: ' + format); - return { - platformId: -1, - encodingId: -1, - mappings: [], - hasShortCmap: false - }; - } - - // removing duplicate entries - mappings.sort(function (a, b) { - return a.charCode - b.charCode; - }); - for (i = 1; i < mappings.length; i++) { - if (mappings[i - 1].charCode === mappings[i].charCode) { - mappings.splice(i, 1); - i--; - } - } - - return { - platformId: potentialTable.platformId, - encodingId: potentialTable.encodingId, - mappings: mappings, - hasShortCmap: hasShortCmap - }; - } - - function sanitizeMetrics(font, header, metrics, numGlyphs) { - if (!header) { - if (metrics) { - metrics.data = null; - } - return; - } - - font.pos = (font.start ? font.start : 0) + header.offset; - font.pos += header.length - 2; - var numOfMetrics = font.getUint16(); - - if (numOfMetrics > numGlyphs) { - info('The numOfMetrics (' + numOfMetrics + ') should not be ' + - 'greater than the numGlyphs (' + numGlyphs + ')'); - // Reduce numOfMetrics if it is greater than numGlyphs - numOfMetrics = numGlyphs; - header.data[34] = (numOfMetrics & 0xff00) >> 8; - header.data[35] = numOfMetrics & 0x00ff; - } - - var numOfSidebearings = numGlyphs - numOfMetrics; - var numMissing = numOfSidebearings - - ((metrics.length - numOfMetrics * 4) >> 1); - - if (numMissing > 0) { - // For each missing glyph, we set both the width and lsb to 0 (zero). - // Since we need to add two properties for each glyph, this explains - // the use of |numMissing * 2| when initializing the typed array. - var entries = new Uint8Array(metrics.length + numMissing * 2); - entries.set(metrics.data); - metrics.data = entries; - } - } - - function sanitizeGlyph(source, sourceStart, sourceEnd, dest, destStart, - hintsValid) { - if (sourceEnd - sourceStart <= 12) { - // glyph with data less than 12 is invalid one - return 0; - } - var glyf = source.subarray(sourceStart, sourceEnd); - var contoursCount = (glyf[0] << 8) | glyf[1]; - if (contoursCount & 0x8000) { - // complex glyph, writing as is - dest.set(glyf, destStart); - return glyf.length; - } - - var i, j = 10, flagsCount = 0; - for (i = 0; i < contoursCount; i++) { - var endPoint = (glyf[j] << 8) | glyf[j + 1]; - flagsCount = endPoint + 1; - j += 2; - } - // skipping instructions - var instructionsStart = j; - var instructionsLength = (glyf[j] << 8) | glyf[j + 1]; - j += 2 + instructionsLength; - var instructionsEnd = j; - // validating flags - var coordinatesLength = 0; - for (i = 0; i < flagsCount; i++) { - var flag = glyf[j++]; - if (flag & 0xC0) { - // reserved flags must be zero, cleaning up - glyf[j - 1] = flag & 0x3F; - } - var xyLength = ((flag & 2) ? 1 : (flag & 16) ? 0 : 2) + - ((flag & 4) ? 1 : (flag & 32) ? 0 : 2); - coordinatesLength += xyLength; - if (flag & 8) { - var repeat = glyf[j++]; - i += repeat; - coordinatesLength += repeat * xyLength; - } - } - // glyph without coordinates will be rejected - if (coordinatesLength === 0) { - return 0; - } - var glyphDataLength = j + coordinatesLength; - if (glyphDataLength > glyf.length) { - // not enough data for coordinates - return 0; - } - if (!hintsValid && instructionsLength > 0) { - dest.set(glyf.subarray(0, instructionsStart), destStart); - dest.set([0, 0], destStart + instructionsStart); - dest.set(glyf.subarray(instructionsEnd, glyphDataLength), - destStart + instructionsStart + 2); - glyphDataLength -= instructionsLength; - if (glyf.length - glyphDataLength > 3) { - glyphDataLength = (glyphDataLength + 3) & ~3; - } - return glyphDataLength; - } - if (glyf.length - glyphDataLength > 3) { - // truncating and aligning to 4 bytes the long glyph data - glyphDataLength = (glyphDataLength + 3) & ~3; - dest.set(glyf.subarray(0, glyphDataLength), destStart); - return glyphDataLength; - } - // glyph data is fine - dest.set(glyf, destStart); - return glyf.length; - } - - function sanitizeHead(head, numGlyphs, locaLength) { - var data = head.data; - - // Validate version: - // Should always be 0x00010000 - var version = int32(data[0], data[1], data[2], data[3]); - if (version >> 16 !== 1) { - info('Attempting to fix invalid version in head table: ' + version); - data[0] = 0; - data[1] = 1; - data[2] = 0; - data[3] = 0; - } - - var indexToLocFormat = int16(data[50], data[51]); - if (indexToLocFormat < 0 || indexToLocFormat > 1) { - info('Attempting to fix invalid indexToLocFormat in head table: ' + - indexToLocFormat); - - // The value of indexToLocFormat should be 0 if the loca table - // consists of short offsets, and should be 1 if the loca table - // consists of long offsets. - // - // The number of entries in the loca table should be numGlyphs + 1. - // - // Using this information, we can work backwards to deduce if the - // size of each offset in the loca table, and thus figure out the - // appropriate value for indexToLocFormat. - - var numGlyphsPlusOne = numGlyphs + 1; - if (locaLength === numGlyphsPlusOne << 1) { - // 0x0000 indicates the loca table consists of short offsets - data[50] = 0; - data[51] = 0; - } else if (locaLength === numGlyphsPlusOne << 2) { - // 0x0001 indicates the loca table consists of long offsets - data[50] = 0; - data[51] = 1; - } else { - warn('Could not fix indexToLocFormat: ' + indexToLocFormat); - } - } - } - - function sanitizeGlyphLocations(loca, glyf, numGlyphs, - isGlyphLocationsLong, hintsValid, - dupFirstEntry) { - var itemSize, itemDecode, itemEncode; - if (isGlyphLocationsLong) { - itemSize = 4; - itemDecode = function fontItemDecodeLong(data, offset) { - return (data[offset] << 24) | (data[offset + 1] << 16) | - (data[offset + 2] << 8) | data[offset + 3]; - }; - itemEncode = function fontItemEncodeLong(data, offset, value) { - data[offset] = (value >>> 24) & 0xFF; - data[offset + 1] = (value >> 16) & 0xFF; - data[offset + 2] = (value >> 8) & 0xFF; - data[offset + 3] = value & 0xFF; - }; - } else { - itemSize = 2; - itemDecode = function fontItemDecode(data, offset) { - return (data[offset] << 9) | (data[offset + 1] << 1); - }; - itemEncode = function fontItemEncode(data, offset, value) { - data[offset] = (value >> 9) & 0xFF; - data[offset + 1] = (value >> 1) & 0xFF; - }; - } - var locaData = loca.data; - var locaDataSize = itemSize * (1 + numGlyphs); - // is loca.data too short or long? - if (locaData.length !== locaDataSize) { - locaData = new Uint8Array(locaDataSize); - locaData.set(loca.data.subarray(0, locaDataSize)); - loca.data = locaData; - } - // removing the invalid glyphs - var oldGlyfData = glyf.data; - var oldGlyfDataLength = oldGlyfData.length; - var newGlyfData = new Uint8Array(oldGlyfDataLength); - var startOffset = itemDecode(locaData, 0); - var writeOffset = 0; - var missingGlyphData = Object.create(null); - itemEncode(locaData, 0, writeOffset); - var i, j; - for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) { - var endOffset = itemDecode(locaData, j); - if (endOffset > oldGlyfDataLength && - ((oldGlyfDataLength + 3) & ~3) === endOffset) { - // Aspose breaks fonts by aligning the glyphs to the qword, but not - // the glyf table size, which makes last glyph out of range. - endOffset = oldGlyfDataLength; - } - if (endOffset > oldGlyfDataLength) { - // glyph end offset points outside glyf data, rejecting the glyph - itemEncode(locaData, j, writeOffset); - startOffset = endOffset; - continue; - } - - if (startOffset === endOffset) { - missingGlyphData[i] = true; - } - - var newLength = sanitizeGlyph(oldGlyfData, startOffset, endOffset, - newGlyfData, writeOffset, hintsValid); - writeOffset += newLength; - itemEncode(locaData, j, writeOffset); - startOffset = endOffset; - } - - if (writeOffset === 0) { - // glyf table cannot be empty -- redoing the glyf and loca tables - // to have single glyph with one point - var simpleGlyph = new Uint8Array( - [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0]); - for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) { - itemEncode(locaData, j, simpleGlyph.length); - } - glyf.data = simpleGlyph; - return missingGlyphData; - } - - if (dupFirstEntry) { - var firstEntryLength = itemDecode(locaData, itemSize); - if (newGlyfData.length > firstEntryLength + writeOffset) { - glyf.data = newGlyfData.subarray(0, firstEntryLength + writeOffset); - } else { - glyf.data = new Uint8Array(firstEntryLength + writeOffset); - glyf.data.set(newGlyfData.subarray(0, writeOffset)); - } - glyf.data.set(newGlyfData.subarray(0, firstEntryLength), writeOffset); - itemEncode(loca.data, locaData.length - itemSize, - writeOffset + firstEntryLength); - } else { - glyf.data = newGlyfData.subarray(0, writeOffset); - } - return missingGlyphData; - } - - function readPostScriptTable(post, properties, maxpNumGlyphs) { - var start = (font.start ? font.start : 0) + post.offset; - font.pos = start; - - var length = post.length, end = start + length; - var version = font.getInt32(); - // skip rest to the tables - font.getBytes(28); - - var glyphNames; - var valid = true; - var i; - - switch (version) { - case 0x00010000: - glyphNames = MacStandardGlyphOrdering; - break; - case 0x00020000: - var numGlyphs = font.getUint16(); - if (numGlyphs !== maxpNumGlyphs) { - valid = false; - break; - } - var glyphNameIndexes = []; - for (i = 0; i < numGlyphs; ++i) { - var index = font.getUint16(); - if (index >= 32768) { - valid = false; - break; - } - glyphNameIndexes.push(index); - } - if (!valid) { - break; - } - var customNames = []; - var strBuf = []; - while (font.pos < end) { - var stringLength = font.getByte(); - strBuf.length = stringLength; - for (i = 0; i < stringLength; ++i) { - strBuf[i] = String.fromCharCode(font.getByte()); - } - customNames.push(strBuf.join('')); - } - glyphNames = []; - for (i = 0; i < numGlyphs; ++i) { - var j = glyphNameIndexes[i]; - if (j < 258) { - glyphNames.push(MacStandardGlyphOrdering[j]); - continue; - } - glyphNames.push(customNames[j - 258]); - } - break; - case 0x00030000: - break; - default: - warn('Unknown/unsupported post table version ' + version); - valid = false; - if (properties.defaultEncoding) { - glyphNames = properties.defaultEncoding; - } - break; - } - properties.glyphNames = glyphNames; - return valid; - } - - function readNameTable(nameTable) { - var start = (font.start ? font.start : 0) + nameTable.offset; - font.pos = start; - - var names = [[], []]; - var length = nameTable.length, end = start + length; - var format = font.getUint16(); - var FORMAT_0_HEADER_LENGTH = 6; - if (format !== 0 || length < FORMAT_0_HEADER_LENGTH) { - // unsupported name table format or table "too" small - return names; - } - var numRecords = font.getUint16(); - var stringsStart = font.getUint16(); - var records = []; - var NAME_RECORD_LENGTH = 12; - var i, ii; - - for (i = 0; i < numRecords && - font.pos + NAME_RECORD_LENGTH <= end; i++) { - var r = { - platform: font.getUint16(), - encoding: font.getUint16(), - language: font.getUint16(), - name: font.getUint16(), - length: font.getUint16(), - offset: font.getUint16() - }; - // using only Macintosh and Windows platform/encoding names - if ((r.platform === 1 && r.encoding === 0 && r.language === 0) || - (r.platform === 3 && r.encoding === 1 && r.language === 0x409)) { - records.push(r); - } - } - for (i = 0, ii = records.length; i < ii; i++) { - var record = records[i]; - if (record.length <= 0) { - continue; // Nothing to process, ignoring. - } - var pos = start + stringsStart + record.offset; - if (pos + record.length > end) { - continue; // outside of name table, ignoring - } - font.pos = pos; - var nameIndex = record.name; - if (record.encoding) { - // unicode - var str = ''; - for (var j = 0, jj = record.length; j < jj; j += 2) { - str += String.fromCharCode(font.getUint16()); - } - names[1][nameIndex] = str; - } else { - names[0][nameIndex] = bytesToString(font.getBytes(record.length)); - } - } - return names; - } - - var TTOpsStackDeltas = [ - 0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, 0, 0, -2, -5, - -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, -1, -1, - 1, -1, -999, 0, 1, 0, -1, -2, 0, -1, -2, -1, -1, 0, -1, -1, - 0, 0, -999, -999, -1, -1, -1, -1, -2, -999, -2, -2, -999, 0, -2, -2, - 0, 0, -2, 0, -2, 0, 0, 0, -2, -1, -1, 1, 1, 0, 0, -1, - -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, 0, -999, -1, -1, - -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -2, -999, -999, -999, -999, -999, -1, -1, -2, -2, 0, 0, 0, 0, -1, -1, - -999, -2, -2, 0, 0, -1, -2, -2, 0, 0, 0, -1, -1, -1, -2]; - // 0xC0-DF == -1 and 0xE0-FF == -2 - - function sanitizeTTProgram(table, ttContext) { - var data = table.data; - var i = 0, j, n, b, funcId, pc, lastEndf = 0, lastDeff = 0; - var stack = []; - var callstack = []; - var functionsCalled = []; - var tooComplexToFollowFunctions = - ttContext.tooComplexToFollowFunctions; - var inFDEF = false, ifLevel = 0, inELSE = 0; - for (var ii = data.length; i < ii;) { - var op = data[i++]; - // The TrueType instruction set docs can be found at - // https://developer.apple.com/fonts/TTRefMan/RM05/Chap5.html - if (op === 0x40) { // NPUSHB - pushes n bytes - n = data[i++]; - if (inFDEF || inELSE) { - i += n; - } else { - for (j = 0; j < n; j++) { - stack.push(data[i++]); - } - } - } else if (op === 0x41) { // NPUSHW - pushes n words - n = data[i++]; - if (inFDEF || inELSE) { - i += n * 2; - } else { - for (j = 0; j < n; j++) { - b = data[i++]; - stack.push((b << 8) | data[i++]); - } - } - } else if ((op & 0xF8) === 0xB0) { // PUSHB - pushes bytes - n = op - 0xB0 + 1; - if (inFDEF || inELSE) { - i += n; - } else { - for (j = 0; j < n; j++) { - stack.push(data[i++]); - } - } - } else if ((op & 0xF8) === 0xB8) { // PUSHW - pushes words - n = op - 0xB8 + 1; - if (inFDEF || inELSE) { - i += n * 2; - } else { - for (j = 0; j < n; j++) { - b = data[i++]; - stack.push((b << 8) | data[i++]); - } - } - } else if (op === 0x2B && !tooComplexToFollowFunctions) { // CALL - if (!inFDEF && !inELSE) { - // collecting inforamtion about which functions are used - funcId = stack[stack.length - 1]; - ttContext.functionsUsed[funcId] = true; - if (funcId in ttContext.functionsStackDeltas) { - stack.length += ttContext.functionsStackDeltas[funcId]; - } else if (funcId in ttContext.functionsDefined && - functionsCalled.indexOf(funcId) < 0) { - callstack.push({data: data, i: i, stackTop: stack.length - 1}); - functionsCalled.push(funcId); - pc = ttContext.functionsDefined[funcId]; - if (!pc) { - warn('TT: CALL non-existent function'); - ttContext.hintsValid = false; - return; - } - data = pc.data; - i = pc.i; - } - } - } else if (op === 0x2C && !tooComplexToFollowFunctions) { // FDEF - if (inFDEF || inELSE) { - warn('TT: nested FDEFs not allowed'); - tooComplexToFollowFunctions = true; - } - inFDEF = true; - // collecting inforamtion about which functions are defined - lastDeff = i; - funcId = stack.pop(); - ttContext.functionsDefined[funcId] = {data: data, i: i}; - } else if (op === 0x2D) { // ENDF - end of function - if (inFDEF) { - inFDEF = false; - lastEndf = i; - } else { - pc = callstack.pop(); - if (!pc) { - warn('TT: ENDF bad stack'); - ttContext.hintsValid = false; - return; - } - funcId = functionsCalled.pop(); - data = pc.data; - i = pc.i; - ttContext.functionsStackDeltas[funcId] = - stack.length - pc.stackTop; - } - } else if (op === 0x89) { // IDEF - instruction definition - if (inFDEF || inELSE) { - warn('TT: nested IDEFs not allowed'); - tooComplexToFollowFunctions = true; - } - inFDEF = true; - // recording it as a function to track ENDF - lastDeff = i; - } else if (op === 0x58) { // IF - ++ifLevel; - } else if (op === 0x1B) { // ELSE - inELSE = ifLevel; - } else if (op === 0x59) { // EIF - if (inELSE === ifLevel) { - inELSE = 0; - } - --ifLevel; - } else if (op === 0x1C) { // JMPR - if (!inFDEF && !inELSE) { - var offset = stack[stack.length - 1]; - // only jumping forward to prevent infinite loop - if (offset > 0) { - i += offset - 1; - } - } - } - // Adjusting stack not extactly, but just enough to get function id - if (!inFDEF && !inELSE) { - var stackDelta = op <= 0x8E ? TTOpsStackDeltas[op] : - op >= 0xC0 && op <= 0xDF ? -1 : op >= 0xE0 ? -2 : 0; - if (op >= 0x71 && op <= 0x75) { - n = stack.pop(); - if (n === n) { - stackDelta = -n * 2; - } - } - while (stackDelta < 0 && stack.length > 0) { - stack.pop(); - stackDelta++; - } - while (stackDelta > 0) { - stack.push(NaN); // pushing any number into stack - stackDelta--; - } - } - } - ttContext.tooComplexToFollowFunctions = tooComplexToFollowFunctions; - var content = [data]; - if (i > data.length) { - content.push(new Uint8Array(i - data.length)); - } - if (lastDeff > lastEndf) { - warn('TT: complementing a missing function tail'); - // new function definition started, but not finished - // complete function by [CLEAR, ENDF] - content.push(new Uint8Array([0x22, 0x2D])); - } - foldTTTable(table, content); - } - - function checkInvalidFunctions(ttContext, maxFunctionDefs) { - if (ttContext.tooComplexToFollowFunctions) { - return; - } - if (ttContext.functionsDefined.length > maxFunctionDefs) { - warn('TT: more functions defined than expected'); - ttContext.hintsValid = false; - return; - } - for (var j = 0, jj = ttContext.functionsUsed.length; j < jj; j++) { - if (j > maxFunctionDefs) { - warn('TT: invalid function id: ' + j); - ttContext.hintsValid = false; - return; - } - if (ttContext.functionsUsed[j] && !ttContext.functionsDefined[j]) { - warn('TT: undefined function: ' + j); - ttContext.hintsValid = false; - return; - } - } - } - - function foldTTTable(table, content) { - if (content.length > 1) { - // concatenating the content items - var newLength = 0; - var j, jj; - for (j = 0, jj = content.length; j < jj; j++) { - newLength += content[j].length; - } - newLength = (newLength + 3) & ~3; - var result = new Uint8Array(newLength); - var pos = 0; - for (j = 0, jj = content.length; j < jj; j++) { - result.set(content[j], pos); - pos += content[j].length; - } - table.data = result; - table.length = newLength; - } - } - - function sanitizeTTPrograms(fpgm, prep, cvt, maxFunctionDefs) { - var ttContext = { - functionsDefined: [], - functionsUsed: [], - functionsStackDeltas: [], - tooComplexToFollowFunctions: false, - hintsValid: true - }; - if (fpgm) { - sanitizeTTProgram(fpgm, ttContext); - } - if (prep) { - sanitizeTTProgram(prep, ttContext); - } - if (fpgm) { - checkInvalidFunctions(ttContext, maxFunctionDefs); - } - if (cvt && (cvt.length & 1)) { - var cvtData = new Uint8Array(cvt.length + 1); - cvtData.set(cvt.data); - cvt.data = cvtData; - } - return ttContext.hintsValid; - } - - // The following steps modify the original font data, making copy - font = new Stream(new Uint8Array(font.getBytes())); - - var VALID_TABLES = ['OS/2', 'cmap', 'head', 'hhea', 'hmtx', 'maxp', - 'name', 'post', 'loca', 'glyf', 'fpgm', 'prep', 'cvt ', 'CFF ']; - - var header = readOpenTypeHeader(font); - var numTables = header.numTables; - var cff, cffFile; - - var tables = Object.create(null); - tables['OS/2'] = null; - tables['cmap'] = null; - tables['head'] = null; - tables['hhea'] = null; - tables['hmtx'] = null; - tables['maxp'] = null; - tables['name'] = null; - tables['post'] = null; - - var table; - for (var i = 0; i < numTables; i++) { - table = readTableEntry(font); - if (VALID_TABLES.indexOf(table.tag) < 0) { - continue; // skipping table if it's not a required or optional table - } - if (table.length === 0) { - continue; // skipping empty tables - } - tables[table.tag] = table; - } - - var isTrueType = !tables['CFF ']; - if (!isTrueType) { - // OpenType font - if ((header.version === 'OTTO' && properties.type !== 'CIDFontType2') || - !tables['head'] || !tables['hhea'] || !tables['maxp'] || - !tables['post']) { - // no major tables: throwing everything at CFFFont - cffFile = new Stream(tables['CFF '].data); - cff = new CFFFont(cffFile, properties); - - adjustWidths(properties); - - return this.convert(name, cff, properties); - } - - delete tables['glyf']; - delete tables['loca']; - delete tables['fpgm']; - delete tables['prep']; - delete tables['cvt ']; - this.isOpenType = true; - } else { - if (!tables['loca']) { - error('Required "loca" table is not found'); - } - if (!tables['glyf']) { - warn('Required "glyf" table is not found -- trying to recover.'); - // Note: We use `sanitizeGlyphLocations` to add dummy glyf data below. - tables['glyf'] = { - tag: 'glyf', - data: new Uint8Array(0), - }; - } - this.isOpenType = false; - } - - if (!tables['maxp']) { - error('Required "maxp" table is not found'); - } - - font.pos = (font.start || 0) + tables['maxp'].offset; - var version = font.getInt32(); - var numGlyphs = font.getUint16(); - var maxFunctionDefs = 0; - if (version >= 0x00010000 && tables['maxp'].length >= 22) { - // maxZones can be invalid - font.pos += 8; - var maxZones = font.getUint16(); - if (maxZones > 2) { // reset to 2 if font has invalid maxZones - tables['maxp'].data[14] = 0; - tables['maxp'].data[15] = 2; - } - font.pos += 4; - maxFunctionDefs = font.getUint16(); - } - - var dupFirstEntry = false; - if (properties.type === 'CIDFontType2' && properties.toUnicode && - properties.toUnicode.get(0) > '\u0000') { - // oracle's defect (see 3427), duplicating first entry - dupFirstEntry = true; - numGlyphs++; - tables['maxp'].data[4] = numGlyphs >> 8; - tables['maxp'].data[5] = numGlyphs & 255; - } - - var hintsValid = sanitizeTTPrograms(tables['fpgm'], tables['prep'], - tables['cvt '], maxFunctionDefs); - if (!hintsValid) { - delete tables['fpgm']; - delete tables['prep']; - delete tables['cvt ']; - } - - // Ensure the hmtx table contains the advance width and - // sidebearings information for numGlyphs in the maxp table - sanitizeMetrics(font, tables['hhea'], tables['hmtx'], numGlyphs); - - if (!tables['head']) { - error('Required "head" table is not found'); - } - - sanitizeHead(tables['head'], numGlyphs, - isTrueType ? tables['loca'].length : 0); - - var missingGlyphs = Object.create(null); - if (isTrueType) { - var isGlyphLocationsLong = int16(tables['head'].data[50], - tables['head'].data[51]); - missingGlyphs = sanitizeGlyphLocations(tables['loca'], tables['glyf'], - numGlyphs, isGlyphLocationsLong, - hintsValid, dupFirstEntry); - } - - if (!tables['hhea']) { - error('Required "hhea" table is not found'); - } - - // Sanitizer reduces the glyph advanceWidth to the maxAdvanceWidth - // Sometimes it's 0. That needs to be fixed - if (tables['hhea'].data[10] === 0 && tables['hhea'].data[11] === 0) { - tables['hhea'].data[10] = 0xFF; - tables['hhea'].data[11] = 0xFF; - } - - // Extract some more font properties from the OpenType head and - // hhea tables; yMin and descent value are always negative. - var metricsOverride = { - unitsPerEm: int16(tables['head'].data[18], tables['head'].data[19]), - yMax: int16(tables['head'].data[42], tables['head'].data[43]), - yMin: signedInt16(tables['head'].data[38], tables['head'].data[39]), - ascent: int16(tables['hhea'].data[4], tables['hhea'].data[5]), - descent: signedInt16(tables['hhea'].data[6], tables['hhea'].data[7]) - }; - - // PDF FontDescriptor metrics lie -- using data from actual font. - this.ascent = metricsOverride.ascent / metricsOverride.unitsPerEm; - this.descent = metricsOverride.descent / metricsOverride.unitsPerEm; - - // The 'post' table has glyphs names. - if (tables['post']) { - var valid = readPostScriptTable(tables['post'], properties, numGlyphs); - if (!valid) { - tables['post'] = null; - } - } - - var charCodeToGlyphId = [], charCode; - var toUnicode = properties.toUnicode, widths = properties.widths; - var skipToUnicode = (toUnicode instanceof IdentityToUnicodeMap || - toUnicode.length === 0x10000); - - // Helper function to try to skip mapping of empty glyphs. - // Note: In some cases, just relying on the glyph data doesn't work, - // hence we also use a few heuristics to fix various PDF files. - function hasGlyph(glyphId, charCode, widthCode) { - if (!missingGlyphs[glyphId]) { - return true; - } - if (!skipToUnicode && charCode >= 0 && toUnicode.has(charCode)) { - return true; - } - if (widths && widthCode >= 0 && isNum(widths[widthCode])) { - return true; - } - return false; - } - - if (properties.type === 'CIDFontType2') { - var cidToGidMap = properties.cidToGidMap || []; - var isCidToGidMapEmpty = cidToGidMap.length === 0; - - properties.cMap.forEach(function(charCode, cid) { - assert(cid <= 0xffff, 'Max size of CID is 65,535'); - var glyphId = -1; - if (isCidToGidMapEmpty) { - glyphId = cid; - } else if (cidToGidMap[cid] !== undefined) { - glyphId = cidToGidMap[cid]; - } - - if (glyphId >= 0 && glyphId < numGlyphs && - hasGlyph(glyphId, charCode, cid)) { - charCodeToGlyphId[charCode] = glyphId; - } - }); - if (dupFirstEntry && (isCidToGidMapEmpty || !charCodeToGlyphId[0])) { - // We don't duplicate the first entry in the `charCodeToGlyphId` map - // if the font has a `CIDToGIDMap` which has already mapped the first - // entry to a non-zero `glyphId` (fixes issue7544.pdf). - charCodeToGlyphId[0] = numGlyphs - 1; - } - } else { - // Most of the following logic in this code branch is based on the - // 9.6.6.4 of the PDF spec. - var cmapTable = readCmapTable(tables['cmap'], font, this.isSymbolicFont, - properties.hasEncoding); - var cmapPlatformId = cmapTable.platformId; - var cmapEncodingId = cmapTable.encodingId; - var cmapMappings = cmapTable.mappings; - var cmapMappingsLength = cmapMappings.length; - - // The spec seems to imply that if the font is symbolic the encoding - // should be ignored, this doesn't appear to work for 'preistabelle.pdf' - // where the the font is symbolic and it has an encoding. - if (properties.hasEncoding && - (cmapPlatformId === 3 && cmapEncodingId === 1 || - cmapPlatformId === 1 && cmapEncodingId === 0) || - (cmapPlatformId === -1 && cmapEncodingId === -1 && // Temporary hack - !!getEncoding(properties.baseEncodingName))) { // Temporary hack - // When no preferred cmap table was found and |baseEncodingName| is - // one of the predefined encodings, we seem to obtain a better - // |charCodeToGlyphId| map from the code below (fixes bug 1057544). - // TODO: Note that this is a hack which should be removed as soon as - // we have proper support for more exotic cmap tables. - - var baseEncoding = []; - if (properties.baseEncodingName === 'MacRomanEncoding' || - properties.baseEncodingName === 'WinAnsiEncoding') { - baseEncoding = getEncoding(properties.baseEncodingName); - } - var glyphsUnicodeMap = getGlyphsUnicode(); - for (charCode = 0; charCode < 256; charCode++) { - var glyphName, standardGlyphName; - if (this.differences && charCode in this.differences) { - glyphName = this.differences[charCode]; - } else if (charCode in baseEncoding && - baseEncoding[charCode] !== '') { - glyphName = baseEncoding[charCode]; - } else { - glyphName = StandardEncoding[charCode]; - } - if (!glyphName) { - continue; - } - // Ensure that non-standard glyph names are resolved to valid ones. - standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap); - - var unicodeOrCharCode, isUnicode = false; - if (cmapPlatformId === 3 && cmapEncodingId === 1) { - unicodeOrCharCode = glyphsUnicodeMap[standardGlyphName]; - isUnicode = true; - } else if (cmapPlatformId === 1 && cmapEncodingId === 0) { - // TODO: the encoding needs to be updated with mac os table. - unicodeOrCharCode = MacRomanEncoding.indexOf(standardGlyphName); - } - - var found = false; - for (i = 0; i < cmapMappingsLength; ++i) { - if (cmapMappings[i].charCode !== unicodeOrCharCode) { - continue; - } - var code = isUnicode ? charCode : unicodeOrCharCode; - if (hasGlyph(cmapMappings[i].glyphId, code, -1)) { - charCodeToGlyphId[charCode] = cmapMappings[i].glyphId; - found = true; - break; - } - } - if (!found && properties.glyphNames) { - // Try to map using the post table. - var glyphId = properties.glyphNames.indexOf(glyphName); - // The post table ought to use the same kind of glyph names as the - // `differences` array, but check the standard ones as a fallback. - if (glyphId === -1 && standardGlyphName !== glyphName) { - glyphId = properties.glyphNames.indexOf(standardGlyphName); - } - if (glyphId > 0 && hasGlyph(glyphId, -1, -1)) { - charCodeToGlyphId[charCode] = glyphId; - found = true; - } - } - if (!found) { - charCodeToGlyphId[charCode] = 0; // notdef - } - } - } else if (cmapPlatformId === 0 && cmapEncodingId === 0) { - // Default Unicode semantics, use the charcodes as is. - for (i = 0; i < cmapMappingsLength; ++i) { - charCodeToGlyphId[cmapMappings[i].charCode] = - cmapMappings[i].glyphId; - } - } else { - // For (3, 0) cmap tables: - // The charcode key being stored in charCodeToGlyphId is the lower - // byte of the two-byte charcodes of the cmap table since according to - // the spec: 'each byte from the string shall be prepended with the - // high byte of the range [of charcodes in the cmap table], to form - // a two-byte character, which shall be used to select the - // associated glyph description from the subtable'. - // - // For (1, 0) cmap tables: - // 'single bytes from the string shall be used to look up the - // associated glyph descriptions from the subtable'. This means - // charcodes in the cmap will be single bytes, so no-op since - // glyph.charCode & 0xFF === glyph.charCode - for (i = 0; i < cmapMappingsLength; ++i) { - charCode = cmapMappings[i].charCode & 0xFF; - charCodeToGlyphId[charCode] = cmapMappings[i].glyphId; - } - } - } - - if (charCodeToGlyphId.length === 0) { - // defines at least one glyph - charCodeToGlyphId[0] = 0; - } - - // Converting glyphs and ids into font's cmap table - var newMapping = adjustMapping(charCodeToGlyphId, properties); - this.toFontChar = newMapping.toFontChar; - tables['cmap'] = { - tag: 'cmap', - data: createCmapTable(newMapping.charCodeToGlyphId, numGlyphs) - }; - - if (!tables['OS/2'] || !validateOS2Table(tables['OS/2'])) { - tables['OS/2'] = { - tag: 'OS/2', - data: createOS2Table(properties, newMapping.charCodeToGlyphId, - metricsOverride) - }; - } - - // Rewrite the 'post' table if needed - if (!tables['post']) { - tables['post'] = { - tag: 'post', - data: createPostTable(properties) - }; - } - - if (!isTrueType) { - try { - // Trying to repair CFF file - cffFile = new Stream(tables['CFF '].data); - var parser = new CFFParser(cffFile, properties, - SEAC_ANALYSIS_ENABLED); - cff = parser.parse(); - var compiler = new CFFCompiler(cff); - tables['CFF '].data = compiler.compile(); - } catch (e) { - warn('Failed to compile font ' + properties.loadedName); - } - } - - // Re-creating 'name' table - if (!tables['name']) { - tables['name'] = { - tag: 'name', - data: createNameTable(this.name) - }; - } else { - // ... using existing 'name' table as prototype - var namePrototype = readNameTable(tables['name']); - tables['name'].data = createNameTable(name, namePrototype); - } - - var builder = new OpenTypeFileBuilder(header.version); - for (var tableTag in tables) { - builder.addTable(tableTag, tables[tableTag].data); - } - return builder.toArray(); - }, - - convert: function Font_convert(fontName, font, properties) { - // TODO: Check the charstring widths to determine this. - properties.fixedPitch = false; - - if (properties.builtInEncoding) { - // For Type1 fonts that do not include either `ToUnicode` or `Encoding` - // data, attempt to use the `builtInEncoding` to improve text selection. - adjustToUnicode(properties, properties.builtInEncoding); - } - - var mapping = font.getGlyphMapping(properties); - var newMapping = adjustMapping(mapping, properties); - this.toFontChar = newMapping.toFontChar; - var numGlyphs = font.numGlyphs; - - function getCharCodes(charCodeToGlyphId, glyphId) { - var charCodes = null; - for (var charCode in charCodeToGlyphId) { - if (glyphId === charCodeToGlyphId[charCode]) { - if (!charCodes) { - charCodes = []; - } - charCodes.push(charCode | 0); - } - } - return charCodes; - } - - function createCharCode(charCodeToGlyphId, glyphId) { - for (var charCode in charCodeToGlyphId) { - if (glyphId === charCodeToGlyphId[charCode]) { - return charCode | 0; - } - } - newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode] = - glyphId; - return newMapping.nextAvailableFontCharCode++; - } - - var seacs = font.seacs; - if (SEAC_ANALYSIS_ENABLED && seacs && seacs.length) { - var matrix = properties.fontMatrix || FONT_IDENTITY_MATRIX; - var charset = font.getCharset(); - var seacMap = Object.create(null); - for (var glyphId in seacs) { - glyphId |= 0; - var seac = seacs[glyphId]; - var baseGlyphName = StandardEncoding[seac[2]]; - var accentGlyphName = StandardEncoding[seac[3]]; - var baseGlyphId = charset.indexOf(baseGlyphName); - var accentGlyphId = charset.indexOf(accentGlyphName); - if (baseGlyphId < 0 || accentGlyphId < 0) { - continue; - } - var accentOffset = { - x: seac[0] * matrix[0] + seac[1] * matrix[2] + matrix[4], - y: seac[0] * matrix[1] + seac[1] * matrix[3] + matrix[5] - }; - - var charCodes = getCharCodes(mapping, glyphId); - if (!charCodes) { - // There's no point in mapping it if the char code was never mapped - // to begin with. - continue; - } - for (var i = 0, ii = charCodes.length; i < ii; i++) { - var charCode = charCodes[i]; - // Find a fontCharCode that maps to the base and accent glyphs. - // If one doesn't exists, create it. - var charCodeToGlyphId = newMapping.charCodeToGlyphId; - var baseFontCharCode = createCharCode(charCodeToGlyphId, - baseGlyphId); - var accentFontCharCode = createCharCode(charCodeToGlyphId, - accentGlyphId); - seacMap[charCode] = { - baseFontCharCode: baseFontCharCode, - accentFontCharCode: accentFontCharCode, - accentOffset: accentOffset - }; - } - } - properties.seacMap = seacMap; - } - - var unitsPerEm = 1 / (properties.fontMatrix || FONT_IDENTITY_MATRIX)[0]; - - var builder = new OpenTypeFileBuilder('\x4F\x54\x54\x4F'); - // PostScript Font Program - builder.addTable('CFF ', font.data); - // OS/2 and Windows Specific metrics - builder.addTable('OS/2', createOS2Table(properties, - newMapping.charCodeToGlyphId)); - // Character to glyphs mapping - builder.addTable('cmap', createCmapTable(newMapping.charCodeToGlyphId, - numGlyphs)); - // Font header - builder.addTable('head', - '\x00\x01\x00\x00' + // Version number - '\x00\x00\x10\x00' + // fontRevision - '\x00\x00\x00\x00' + // checksumAdjustement - '\x5F\x0F\x3C\xF5' + // magicNumber - '\x00\x00' + // Flags - safeString16(unitsPerEm) + // unitsPerEM - '\x00\x00\x00\x00\x9e\x0b\x7e\x27' + // creation date - '\x00\x00\x00\x00\x9e\x0b\x7e\x27' + // modifification date - '\x00\x00' + // xMin - safeString16(properties.descent) + // yMin - '\x0F\xFF' + // xMax - safeString16(properties.ascent) + // yMax - string16(properties.italicAngle ? 2 : 0) + // macStyle - '\x00\x11' + // lowestRecPPEM - '\x00\x00' + // fontDirectionHint - '\x00\x00' + // indexToLocFormat - '\x00\x00'); // glyphDataFormat - - // Horizontal header - builder.addTable('hhea', - '\x00\x01\x00\x00' + // Version number - safeString16(properties.ascent) + // Typographic Ascent - safeString16(properties.descent) + // Typographic Descent - '\x00\x00' + // Line Gap - '\xFF\xFF' + // advanceWidthMax - '\x00\x00' + // minLeftSidebearing - '\x00\x00' + // minRightSidebearing - '\x00\x00' + // xMaxExtent - safeString16(properties.capHeight) + // caretSlopeRise - safeString16(Math.tan(properties.italicAngle) * - properties.xHeight) + // caretSlopeRun - '\x00\x00' + // caretOffset - '\x00\x00' + // -reserved- - '\x00\x00' + // -reserved- - '\x00\x00' + // -reserved- - '\x00\x00' + // -reserved- - '\x00\x00' + // metricDataFormat - string16(numGlyphs)); // Number of HMetrics - - // Horizontal metrics - builder.addTable('hmtx', (function fontFieldsHmtx() { - var charstrings = font.charstrings; - var cffWidths = font.cff ? font.cff.widths : null; - var hmtx = '\x00\x00\x00\x00'; // Fake .notdef - for (var i = 1, ii = numGlyphs; i < ii; i++) { - var width = 0; - if (charstrings) { - var charstring = charstrings[i - 1]; - width = 'width' in charstring ? charstring.width : 0; - } else if (cffWidths) { - width = Math.ceil(cffWidths[i] || 0); - } - hmtx += string16(width) + string16(0); - } - return hmtx; - })()); - - // Maximum profile - builder.addTable('maxp', - '\x00\x00\x50\x00' + // Version number - string16(numGlyphs)); // Num of glyphs - - // Naming tables - builder.addTable('name', createNameTable(fontName)); - - // PostScript information - builder.addTable('post', createPostTable(properties)); - - return builder.toArray(); - }, - - get spaceWidth() { - if ('_shadowWidth' in this) { - return this._shadowWidth; - } - - // trying to estimate space character width - var possibleSpaceReplacements = ['space', 'minus', 'one', 'i', 'I']; - var width; - for (var i = 0, ii = possibleSpaceReplacements.length; i < ii; i++) { - var glyphName = possibleSpaceReplacements[i]; - // if possible, getting width by glyph name - if (glyphName in this.widths) { - width = this.widths[glyphName]; - break; - } - var glyphsUnicodeMap = getGlyphsUnicode(); - var glyphUnicode = glyphsUnicodeMap[glyphName]; - // finding the charcode via unicodeToCID map - var charcode = 0; - if (this.composite) { - if (this.cMap.contains(glyphUnicode)) { - charcode = this.cMap.lookup(glyphUnicode); - } - } - // ... via toUnicode map - if (!charcode && this.toUnicode) { - charcode = this.toUnicode.charCodeOf(glyphUnicode); - } - // setting it to unicode if negative or undefined - if (charcode <= 0) { - charcode = glyphUnicode; - } - // trying to get width via charcode - width = this.widths[charcode]; - if (width) { - break; // the non-zero width found - } - } - width = width || this.defaultWidth; - // Do not shadow the property here. See discussion: - // https://github.com/mozilla/pdf.js/pull/2127#discussion_r1662280 - this._shadowWidth = width; - return width; - }, - - charToGlyph: function Font_charToGlyph(charcode, isSpace) { - var fontCharCode, width, operatorListId; - - var widthCode = charcode; - if (this.cMap && this.cMap.contains(charcode)) { - widthCode = this.cMap.lookup(charcode); - } - width = this.widths[widthCode]; - width = isNum(width) ? width : this.defaultWidth; - var vmetric = this.vmetrics && this.vmetrics[widthCode]; - - var unicode = this.toUnicode.get(charcode) || charcode; - if (typeof unicode === 'number') { - unicode = String.fromCharCode(unicode); - } - - var isInFont = charcode in this.toFontChar; - // First try the toFontChar map, if it's not there then try falling - // back to the char code. - fontCharCode = this.toFontChar[charcode] || charcode; - if (this.missingFile) { - fontCharCode = mapSpecialUnicodeValues(fontCharCode); - } - - if (this.isType3Font) { - // Font char code in this case is actually a glyph name. - operatorListId = fontCharCode; - } - - var accent = null; - if (this.seacMap && this.seacMap[charcode]) { - isInFont = true; - var seac = this.seacMap[charcode]; - fontCharCode = seac.baseFontCharCode; - accent = { - fontChar: String.fromCharCode(seac.accentFontCharCode), - offset: seac.accentOffset - }; - } - - var fontChar = String.fromCharCode(fontCharCode); - - var glyph = this.glyphCache[charcode]; - if (!glyph || - !glyph.matchesForCache(fontChar, unicode, accent, width, vmetric, - operatorListId, isSpace, isInFont)) { - glyph = new Glyph(fontChar, unicode, accent, width, vmetric, - operatorListId, isSpace, isInFont); - this.glyphCache[charcode] = glyph; - } - return glyph; - }, - - charsToGlyphs: function Font_charsToGlyphs(chars) { - var charsCache = this.charsCache; - var glyphs, glyph, charcode; - - // if we translated this string before, just grab it from the cache - if (charsCache) { - glyphs = charsCache[chars]; - if (glyphs) { - return glyphs; - } - } - - // lazily create the translation cache - if (!charsCache) { - charsCache = this.charsCache = Object.create(null); - } - - glyphs = []; - var charsCacheKey = chars; - var i = 0, ii; - - if (this.cMap) { - // composite fonts have multi-byte strings convert the string from - // single-byte to multi-byte - var c = Object.create(null); - while (i < chars.length) { - this.cMap.readCharCode(chars, i, c); - charcode = c.charcode; - var length = c.length; - i += length; - // Space is char with code 0x20 and length 1 in multiple-byte codes. - var isSpace = length === 1 && chars.charCodeAt(i - 1) === 0x20; - glyph = this.charToGlyph(charcode, isSpace); - glyphs.push(glyph); - } - } else { - for (i = 0, ii = chars.length; i < ii; ++i) { - charcode = chars.charCodeAt(i); - glyph = this.charToGlyph(charcode, charcode === 0x20); - glyphs.push(glyph); - } - } - - // Enter the translated string into the cache - return (charsCache[charsCacheKey] = glyphs); - } - }; - - return Font; -})(); - -var ErrorFont = (function ErrorFontClosure() { - function ErrorFont(error) { - this.error = error; - this.loadedName = 'g_font_error'; - this.loading = false; - } - - ErrorFont.prototype = { - charsToGlyphs: function ErrorFont_charsToGlyphs() { - return []; - }, - exportData: function ErrorFont_exportData() { - return {error: this.error}; - } - }; - - return ErrorFont; -})(); - -/** - * Shared logic for building a char code to glyph id mapping for Type1 and - * simple CFF fonts. See section 9.6.6.2 of the spec. - * @param {Object} properties Font properties object. - * @param {Object} builtInEncoding The encoding contained within the actual font - * data. - * @param {Array} glyphNames Array of glyph names where the index is the - * glyph ID. - * @returns {Object} A char code to glyph ID map. - */ -function type1FontGlyphMapping(properties, builtInEncoding, glyphNames) { - var charCodeToGlyphId = Object.create(null); - var glyphId, charCode, baseEncoding; - - if (properties.baseEncodingName) { - // If a valid base encoding name was used, the mapping is initialized with - // that. - baseEncoding = getEncoding(properties.baseEncodingName); - for (charCode = 0; charCode < baseEncoding.length; charCode++) { - glyphId = glyphNames.indexOf(baseEncoding[charCode]); - if (glyphId >= 0) { - charCodeToGlyphId[charCode] = glyphId; - } else { - charCodeToGlyphId[charCode] = 0; // notdef - } - } - } else if (!!(properties.flags & FontFlags.Symbolic)) { - // For a symbolic font the encoding should be the fonts built-in - // encoding. - for (charCode in builtInEncoding) { - charCodeToGlyphId[charCode] = builtInEncoding[charCode]; - } - } else { - // For non-symbolic fonts that don't have a base encoding the standard - // encoding should be used. - baseEncoding = StandardEncoding; - for (charCode = 0; charCode < baseEncoding.length; charCode++) { - glyphId = glyphNames.indexOf(baseEncoding[charCode]); - if (glyphId >= 0) { - charCodeToGlyphId[charCode] = glyphId; - } else { - charCodeToGlyphId[charCode] = 0; // notdef - } - } - } - - // Lastly, merge in the differences. - var differences = properties.differences, glyphsUnicodeMap; - if (differences) { - for (charCode in differences) { - var glyphName = differences[charCode]; - glyphId = glyphNames.indexOf(glyphName); - - if (glyphId === -1) { - if (!glyphsUnicodeMap) { - glyphsUnicodeMap = getGlyphsUnicode(); - } - var standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap); - if (standardGlyphName !== glyphName) { - glyphId = glyphNames.indexOf(standardGlyphName); - } - } - if (glyphId >= 0) { - charCodeToGlyphId[charCode] = glyphId; - } else { - charCodeToGlyphId[charCode] = 0; // notdef - } - } - } - return charCodeToGlyphId; -} - -// Type1Font is also a CIDFontType0. -var Type1Font = (function Type1FontClosure() { - function findBlock(streamBytes, signature, startIndex) { - var streamBytesLength = streamBytes.length; - var signatureLength = signature.length; - var scanLength = streamBytesLength - signatureLength; - - var i = startIndex, j, found = false; - while (i < scanLength) { - j = 0; - while (j < signatureLength && streamBytes[i + j] === signature[j]) { - j++; - } - if (j >= signatureLength) { // `signature` found, skip over whitespace. - i += j; - while (i < streamBytesLength && isSpace(streamBytes[i])) { - i++; - } - found = true; - break; - } - i++; - } - return { - found: found, - length: i, - }; - } - - function getHeaderBlock(stream, suggestedLength) { - var EEXEC_SIGNATURE = [0x65, 0x65, 0x78, 0x65, 0x63]; - - var streamStartPos = stream.pos; // Save the initial stream position. - var headerBytes, headerBytesLength, block; - try { - headerBytes = stream.getBytes(suggestedLength); - headerBytesLength = headerBytes.length; - } catch (ex) { - if (ex instanceof MissingDataException) { - throw ex; - } - // Ignore errors if the `suggestedLength` is huge enough that a Uint8Array - // cannot hold the result of `getBytes`, and fallback to simply checking - // the entire stream (fixes issue3928.pdf). - } - - if (headerBytesLength === suggestedLength) { - // Most of the time `suggestedLength` is correct, so to speed things up we - // initially only check the last few bytes to see if the header was found. - // Otherwise we (potentially) check the entire stream to prevent errors in - // `Type1Parser` (fixes issue5686.pdf). - block = findBlock(headerBytes, EEXEC_SIGNATURE, - suggestedLength - 2 * EEXEC_SIGNATURE.length); - - if (block.found && block.length === suggestedLength) { - return { - stream: new Stream(headerBytes), - length: suggestedLength, - }; - } - } - warn('Invalid "Length1" property in Type1 font -- trying to recover.'); - stream.pos = streamStartPos; // Reset the stream position. - - var SCAN_BLOCK_LENGTH = 2048; - var actualLength; - while (true) { - var scanBytes = stream.peekBytes(SCAN_BLOCK_LENGTH); - block = findBlock(scanBytes, EEXEC_SIGNATURE, 0); - - if (block.length === 0) { - break; - } - stream.pos += block.length; // Update the stream position. - - if (block.found) { - actualLength = stream.pos - streamStartPos; - break; - } - } - stream.pos = streamStartPos; // Reset the stream position. - - if (actualLength) { - return { - stream: new Stream(stream.getBytes(actualLength)), - length: actualLength, - }; - } - warn('Unable to recover "Length1" property in Type1 font -- using as is.'); - return { - stream: new Stream(stream.getBytes(suggestedLength)), - length: suggestedLength, - }; - } - - function getEexecBlock(stream, suggestedLength) { - // We should ideally parse the eexec block to ensure that `suggestedLength` - // is correct, so we don't truncate the block data if it's too small. - // However, this would also require checking if the fixed-content portion - // exists (using the 'Length3' property), and ensuring that it's valid. - // - // Given that `suggestedLength` almost always is correct, all the validation - // would require a great deal of unnecessary parsing for most fonts. - // To save time, we always fetch the entire stream instead, which also avoid - // issues if `suggestedLength` is huge (see comment in `getHeaderBlock`). - // - // NOTE: This means that the function can include the fixed-content portion - // in the returned eexec block. In practice this does *not* seem to matter, - // since `Type1Parser_extractFontProgram` will skip over any non-commands. - var eexecBytes = stream.getBytes(); - return { - stream: new Stream(eexecBytes), - length: eexecBytes.length, - }; - } - - function Type1Font(name, file, properties) { - // Some bad generators embed pfb file as is, we have to strip 6-byte header. - // Also, length1 and length2 might be off by 6 bytes as well. - // http://www.math.ubc.ca/~cass/piscript/type1.pdf - var PFB_HEADER_SIZE = 6; - var headerBlockLength = properties.length1; - var eexecBlockLength = properties.length2; - var pfbHeader = file.peekBytes(PFB_HEADER_SIZE); - var pfbHeaderPresent = pfbHeader[0] === 0x80 && pfbHeader[1] === 0x01; - if (pfbHeaderPresent) { - file.skip(PFB_HEADER_SIZE); - headerBlockLength = (pfbHeader[5] << 24) | (pfbHeader[4] << 16) | - (pfbHeader[3] << 8) | pfbHeader[2]; - } - - // Get the data block containing glyphs and subrs information - var headerBlock = getHeaderBlock(file, headerBlockLength); - headerBlockLength = headerBlock.length; - var headerBlockParser = new Type1Parser(headerBlock.stream, false, - SEAC_ANALYSIS_ENABLED); - headerBlockParser.extractFontHeader(properties); - - if (pfbHeaderPresent) { - pfbHeader = file.getBytes(PFB_HEADER_SIZE); - eexecBlockLength = (pfbHeader[5] << 24) | (pfbHeader[4] << 16) | - (pfbHeader[3] << 8) | pfbHeader[2]; - } - - // Decrypt the data blocks and retrieve it's content - var eexecBlock = getEexecBlock(file, eexecBlockLength); - eexecBlockLength = eexecBlock.length; - var eexecBlockParser = new Type1Parser(eexecBlock.stream, true, - SEAC_ANALYSIS_ENABLED); - var data = eexecBlockParser.extractFontProgram(); - for (var info in data.properties) { - properties[info] = data.properties[info]; - } - - var charstrings = data.charstrings; - var type2Charstrings = this.getType2Charstrings(charstrings); - var subrs = this.getType2Subrs(data.subrs); - - this.charstrings = charstrings; - this.data = this.wrap(name, type2Charstrings, this.charstrings, - subrs, properties); - this.seacs = this.getSeacs(data.charstrings); - } - - Type1Font.prototype = { - get numGlyphs() { - return this.charstrings.length + 1; - }, - - getCharset: function Type1Font_getCharset() { - var charset = ['.notdef']; - var charstrings = this.charstrings; - for (var glyphId = 0; glyphId < charstrings.length; glyphId++) { - charset.push(charstrings[glyphId].glyphName); - } - return charset; - }, - - getGlyphMapping: function Type1Font_getGlyphMapping(properties) { - var charstrings = this.charstrings; - var glyphNames = ['.notdef'], glyphId; - for (glyphId = 0; glyphId < charstrings.length; glyphId++) { - glyphNames.push(charstrings[glyphId].glyphName); - } - var encoding = properties.builtInEncoding; - if (encoding) { - var builtInEncoding = Object.create(null); - for (var charCode in encoding) { - glyphId = glyphNames.indexOf(encoding[charCode]); - if (glyphId >= 0) { - builtInEncoding[charCode] = glyphId; - } - } - } - - return type1FontGlyphMapping(properties, builtInEncoding, glyphNames); - }, - - getSeacs: function Type1Font_getSeacs(charstrings) { - var i, ii; - var seacMap = []; - for (i = 0, ii = charstrings.length; i < ii; i++) { - var charstring = charstrings[i]; - if (charstring.seac) { - // Offset by 1 for .notdef - seacMap[i + 1] = charstring.seac; - } - } - return seacMap; - }, - - getType2Charstrings: function Type1Font_getType2Charstrings( - type1Charstrings) { - var type2Charstrings = []; - for (var i = 0, ii = type1Charstrings.length; i < ii; i++) { - type2Charstrings.push(type1Charstrings[i].charstring); - } - return type2Charstrings; - }, - - getType2Subrs: function Type1Font_getType2Subrs(type1Subrs) { - var bias = 0; - var count = type1Subrs.length; - if (count < 1133) { - bias = 107; - } else if (count < 33769) { - bias = 1131; - } else { - bias = 32768; - } - - // Add a bunch of empty subrs to deal with the Type2 bias - var type2Subrs = []; - var i; - for (i = 0; i < bias; i++) { - type2Subrs.push([0x0B]); - } - - for (i = 0; i < count; i++) { - type2Subrs.push(type1Subrs[i]); - } - - return type2Subrs; - }, - - wrap: function Type1Font_wrap(name, glyphs, charstrings, subrs, - properties) { - var cff = new CFF(); - cff.header = new CFFHeader(1, 0, 4, 4); - - cff.names = [name]; - - var topDict = new CFFTopDict(); - // CFF strings IDs 0...390 are predefined names, so refering - // to entries in our own String INDEX starts at SID 391. - topDict.setByName('version', 391); - topDict.setByName('Notice', 392); - topDict.setByName('FullName', 393); - topDict.setByName('FamilyName', 394); - topDict.setByName('Weight', 395); - topDict.setByName('Encoding', null); // placeholder - topDict.setByName('FontMatrix', properties.fontMatrix); - topDict.setByName('FontBBox', properties.bbox); - topDict.setByName('charset', null); // placeholder - topDict.setByName('CharStrings', null); // placeholder - topDict.setByName('Private', null); // placeholder - cff.topDict = topDict; - - var strings = new CFFStrings(); - strings.add('Version 0.11'); // Version - strings.add('See original notice'); // Notice - strings.add(name); // FullName - strings.add(name); // FamilyName - strings.add('Medium'); // Weight - cff.strings = strings; - - cff.globalSubrIndex = new CFFIndex(); - - var count = glyphs.length; - var charsetArray = [0]; - var i, ii; - for (i = 0; i < count; i++) { - var index = CFFStandardStrings.indexOf(charstrings[i].glyphName); - // TODO: Insert the string and correctly map it. Previously it was - // thought mapping names that aren't in the standard strings to .notdef - // was fine, however in issue818 when mapping them all to .notdef the - // adieresis glyph no longer worked. - if (index === -1) { - index = 0; - } - charsetArray.push((index >> 8) & 0xff, index & 0xff); - } - cff.charset = new CFFCharset(false, 0, [], charsetArray); - - var charStringsIndex = new CFFIndex(); - charStringsIndex.add([0x8B, 0x0E]); // .notdef - for (i = 0; i < count; i++) { - var glyph = glyphs[i]; - // If the CharString outline is empty, replace it with .notdef to - // prevent OTS from rejecting the font (fixes bug1252420.pdf). - if (glyph.length === 0) { - charStringsIndex.add([0x8B, 0x0E]); // .notdef - continue; - } - charStringsIndex.add(glyph); - } - cff.charStrings = charStringsIndex; - - var privateDict = new CFFPrivateDict(); - privateDict.setByName('Subrs', null); // placeholder - var fields = [ - 'BlueValues', - 'OtherBlues', - 'FamilyBlues', - 'FamilyOtherBlues', - 'StemSnapH', - 'StemSnapV', - 'BlueShift', - 'BlueFuzz', - 'BlueScale', - 'LanguageGroup', - 'ExpansionFactor', - 'ForceBold', - 'StdHW', - 'StdVW' - ]; - for (i = 0, ii = fields.length; i < ii; i++) { - var field = fields[i]; - if (!(field in properties.privateData)) { - continue; - } - var value = properties.privateData[field]; - if (isArray(value)) { - // All of the private dictionary array data in CFF must be stored as - // "delta-encoded" numbers. - for (var j = value.length - 1; j > 0; j--) { - value[j] -= value[j - 1]; // ... difference from previous value - } - } - privateDict.setByName(field, value); - } - cff.topDict.privateDict = privateDict; - - var subrIndex = new CFFIndex(); - for (i = 0, ii = subrs.length; i < ii; i++) { - subrIndex.add(subrs[i]); - } - privateDict.subrsIndex = subrIndex; - - var compiler = new CFFCompiler(cff); - return compiler.compile(); - } - }; - - return Type1Font; -})(); - -var CFFFont = (function CFFFontClosure() { - function CFFFont(file, properties) { - this.properties = properties; - - var parser = new CFFParser(file, properties, SEAC_ANALYSIS_ENABLED); - this.cff = parser.parse(); - var compiler = new CFFCompiler(this.cff); - this.seacs = this.cff.seacs; - try { - this.data = compiler.compile(); - } catch (e) { - warn('Failed to compile font ' + properties.loadedName); - // There may have just been an issue with the compiler, set the data - // anyway and hope the font loaded. - this.data = file; - } - } - - CFFFont.prototype = { - get numGlyphs() { - return this.cff.charStrings.count; - }, - getCharset: function CFFFont_getCharset() { - return this.cff.charset.charset; - }, - getGlyphMapping: function CFFFont_getGlyphMapping() { - var cff = this.cff; - var properties = this.properties; - var charsets = cff.charset.charset; - var charCodeToGlyphId; - var glyphId; - - if (properties.composite) { - charCodeToGlyphId = Object.create(null); - if (cff.isCIDFont) { - // If the font is actually a CID font then we should use the charset - // to map CIDs to GIDs. - for (glyphId = 0; glyphId < charsets.length; glyphId++) { - var cid = charsets[glyphId]; - var charCode = properties.cMap.charCodeOf(cid); - charCodeToGlyphId[charCode] = glyphId; - } - } else { - // If it is NOT actually a CID font then CIDs should be mapped - // directly to GIDs. - for (glyphId = 0; glyphId < cff.charStrings.count; glyphId++) { - charCodeToGlyphId[glyphId] = glyphId; - } - } - return charCodeToGlyphId; - } - - var encoding = cff.encoding ? cff.encoding.encoding : null; - charCodeToGlyphId = type1FontGlyphMapping(properties, encoding, charsets); - return charCodeToGlyphId; - } - }; - - return CFFFont; -})(); - -// Workaround for seac on Windows. -(function checkSeacSupport() { - if (typeof navigator !== 'undefined' && /Windows/.test(navigator.userAgent)) { - SEAC_ANALYSIS_ENABLED = true; - } -})(); - -// Workaround for Private Use Area characters in Chrome on Windows -// http://code.google.com/p/chromium/issues/detail?id=122465 -// https://github.com/mozilla/pdf.js/issues/1689 -(function checkChromeWindows() { - if (typeof navigator !== 'undefined' && - /Windows.*Chrome/.test(navigator.userAgent)) { - SKIP_PRIVATE_USE_RANGE_F000_TO_F01F = true; - } -})(); - -exports.SEAC_ANALYSIS_ENABLED = SEAC_ANALYSIS_ENABLED; -exports.ErrorFont = ErrorFont; -exports.Font = Font; -exports.FontFlags = FontFlags; -exports.IdentityToUnicodeMap = IdentityToUnicodeMap; -exports.ToUnicodeMap = ToUnicodeMap; -exports.getFontType = getFontType; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCorePsParser = {}), root.pdfjsSharedUtil, - root.pdfjsCoreParser); - } -}(this, function (exports, sharedUtil, coreParser) { - -var error = sharedUtil.error; -var isSpace = sharedUtil.isSpace; -var EOF = coreParser.EOF; - -var PostScriptParser = (function PostScriptParserClosure() { - function PostScriptParser(lexer) { - this.lexer = lexer; - this.operators = []; - this.token = null; - this.prev = null; - } - PostScriptParser.prototype = { - nextToken: function PostScriptParser_nextToken() { - this.prev = this.token; - this.token = this.lexer.getToken(); - }, - accept: function PostScriptParser_accept(type) { - if (this.token.type === type) { - this.nextToken(); - return true; - } - return false; - }, - expect: function PostScriptParser_expect(type) { - if (this.accept(type)) { - return true; - } - error('Unexpected symbol: found ' + this.token.type + ' expected ' + - type + '.'); - }, - parse: function PostScriptParser_parse() { - this.nextToken(); - this.expect(PostScriptTokenTypes.LBRACE); - this.parseBlock(); - this.expect(PostScriptTokenTypes.RBRACE); - return this.operators; - }, - parseBlock: function PostScriptParser_parseBlock() { - while (true) { - if (this.accept(PostScriptTokenTypes.NUMBER)) { - this.operators.push(this.prev.value); - } else if (this.accept(PostScriptTokenTypes.OPERATOR)) { - this.operators.push(this.prev.value); - } else if (this.accept(PostScriptTokenTypes.LBRACE)) { - this.parseCondition(); - } else { - return; - } - } - }, - parseCondition: function PostScriptParser_parseCondition() { - // Add two place holders that will be updated later - var conditionLocation = this.operators.length; - this.operators.push(null, null); - - this.parseBlock(); - this.expect(PostScriptTokenTypes.RBRACE); - if (this.accept(PostScriptTokenTypes.IF)) { - // The true block is right after the 'if' so it just falls through on - // true else it jumps and skips the true block. - this.operators[conditionLocation] = this.operators.length; - this.operators[conditionLocation + 1] = 'jz'; - } else if (this.accept(PostScriptTokenTypes.LBRACE)) { - var jumpLocation = this.operators.length; - this.operators.push(null, null); - var endOfTrue = this.operators.length; - this.parseBlock(); - this.expect(PostScriptTokenTypes.RBRACE); - this.expect(PostScriptTokenTypes.IFELSE); - // The jump is added at the end of the true block to skip the false - // block. - this.operators[jumpLocation] = this.operators.length; - this.operators[jumpLocation + 1] = 'j'; - - this.operators[conditionLocation] = endOfTrue; - this.operators[conditionLocation + 1] = 'jz'; - } else { - error('PS Function: error parsing conditional.'); - } - } - }; - return PostScriptParser; -})(); - -var PostScriptTokenTypes = { - LBRACE: 0, - RBRACE: 1, - NUMBER: 2, - OPERATOR: 3, - IF: 4, - IFELSE: 5 -}; - -var PostScriptToken = (function PostScriptTokenClosure() { - function PostScriptToken(type, value) { - this.type = type; - this.value = value; - } - - var opCache = Object.create(null); - - PostScriptToken.getOperator = function PostScriptToken_getOperator(op) { - var opValue = opCache[op]; - if (opValue) { - return opValue; - } - return opCache[op] = new PostScriptToken(PostScriptTokenTypes.OPERATOR, op); - }; - - PostScriptToken.LBRACE = new PostScriptToken(PostScriptTokenTypes.LBRACE, - '{'); - PostScriptToken.RBRACE = new PostScriptToken(PostScriptTokenTypes.RBRACE, - '}'); - PostScriptToken.IF = new PostScriptToken(PostScriptTokenTypes.IF, 'IF'); - PostScriptToken.IFELSE = new PostScriptToken(PostScriptTokenTypes.IFELSE, - 'IFELSE'); - return PostScriptToken; -})(); - -var PostScriptLexer = (function PostScriptLexerClosure() { - function PostScriptLexer(stream) { - this.stream = stream; - this.nextChar(); - - this.strBuf = []; - } - PostScriptLexer.prototype = { - nextChar: function PostScriptLexer_nextChar() { - return (this.currentChar = this.stream.getByte()); - }, - getToken: function PostScriptLexer_getToken() { - var comment = false; - var ch = this.currentChar; - - // skip comments - while (true) { - if (ch < 0) { - return EOF; - } - - if (comment) { - if (ch === 0x0A || ch === 0x0D) { - comment = false; - } - } else if (ch === 0x25) { // '%' - comment = true; - } else if (!isSpace(ch)) { - break; - } - ch = this.nextChar(); - } - switch (ch | 0) { - case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: // '0'-'4' - case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: // '5'-'9' - case 0x2B: case 0x2D: case 0x2E: // '+', '-', '.' - return new PostScriptToken(PostScriptTokenTypes.NUMBER, - this.getNumber()); - case 0x7B: // '{' - this.nextChar(); - return PostScriptToken.LBRACE; - case 0x7D: // '}' - this.nextChar(); - return PostScriptToken.RBRACE; - } - // operator - var strBuf = this.strBuf; - strBuf.length = 0; - strBuf[0] = String.fromCharCode(ch); - - while ((ch = this.nextChar()) >= 0 && // and 'A'-'Z', 'a'-'z' - ((ch >= 0x41 && ch <= 0x5A) || (ch >= 0x61 && ch <= 0x7A))) { - strBuf.push(String.fromCharCode(ch)); - } - var str = strBuf.join(''); - switch (str.toLowerCase()) { - case 'if': - return PostScriptToken.IF; - case 'ifelse': - return PostScriptToken.IFELSE; - default: - return PostScriptToken.getOperator(str); - } - }, - getNumber: function PostScriptLexer_getNumber() { - var ch = this.currentChar; - var strBuf = this.strBuf; - strBuf.length = 0; - strBuf[0] = String.fromCharCode(ch); - - while ((ch = this.nextChar()) >= 0) { - if ((ch >= 0x30 && ch <= 0x39) || // '0'-'9' - ch === 0x2D || ch === 0x2E) { // '-', '.' - strBuf.push(String.fromCharCode(ch)); - } else { - break; - } - } - var value = parseFloat(strBuf.join('')); - if (isNaN(value)) { - error('Invalid floating point number: ' + value); - } - return value; - } - }; - return PostScriptLexer; -})(); - -exports.PostScriptLexer = PostScriptLexer; -exports.PostScriptParser = PostScriptParser; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreFunction = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCorePsParser); - } -}(this, function (exports, sharedUtil, corePrimitives, corePsParser) { - -var error = sharedUtil.error; -var info = sharedUtil.info; -var isArray = sharedUtil.isArray; -var isBool = sharedUtil.isBool; -var isDict = corePrimitives.isDict; -var isStream = corePrimitives.isStream; -var PostScriptLexer = corePsParser.PostScriptLexer; -var PostScriptParser = corePsParser.PostScriptParser; - -var PDFFunction = (function PDFFunctionClosure() { - var CONSTRUCT_SAMPLED = 0; - var CONSTRUCT_INTERPOLATED = 2; - var CONSTRUCT_STICHED = 3; - var CONSTRUCT_POSTSCRIPT = 4; - - return { - getSampleArray: function PDFFunction_getSampleArray(size, outputSize, bps, - str) { - var i, ii; - var length = 1; - for (i = 0, ii = size.length; i < ii; i++) { - length *= size[i]; - } - length *= outputSize; - - var array = new Array(length); - var codeSize = 0; - var codeBuf = 0; - // 32 is a valid bps so shifting won't work - var sampleMul = 1.0 / (Math.pow(2.0, bps) - 1); - - var strBytes = str.getBytes((length * bps + 7) / 8); - var strIdx = 0; - for (i = 0; i < length; i++) { - while (codeSize < bps) { - codeBuf <<= 8; - codeBuf |= strBytes[strIdx++]; - codeSize += 8; - } - codeSize -= bps; - array[i] = (codeBuf >> codeSize) * sampleMul; - codeBuf &= (1 << codeSize) - 1; - } - return array; - }, - - getIR: function PDFFunction_getIR(xref, fn) { - var dict = fn.dict; - if (!dict) { - dict = fn; - } - - var types = [this.constructSampled, - null, - this.constructInterpolated, - this.constructStiched, - this.constructPostScript]; - - var typeNum = dict.get('FunctionType'); - var typeFn = types[typeNum]; - if (!typeFn) { - error('Unknown type of function'); - } - - return typeFn.call(this, fn, dict, xref); - }, - - fromIR: function PDFFunction_fromIR(IR) { - var type = IR[0]; - switch (type) { - case CONSTRUCT_SAMPLED: - return this.constructSampledFromIR(IR); - case CONSTRUCT_INTERPOLATED: - return this.constructInterpolatedFromIR(IR); - case CONSTRUCT_STICHED: - return this.constructStichedFromIR(IR); - //case CONSTRUCT_POSTSCRIPT: - default: - return this.constructPostScriptFromIR(IR); - } - }, - - parse: function PDFFunction_parse(xref, fn) { - var IR = this.getIR(xref, fn); - return this.fromIR(IR); - }, - - parseArray: function PDFFunction_parseArray(xref, fnObj) { - if (!isArray(fnObj)) { - // not an array -- parsing as regular function - return this.parse(xref, fnObj); - } - - var fnArray = []; - for (var j = 0, jj = fnObj.length; j < jj; j++) { - var obj = xref.fetchIfRef(fnObj[j]); - fnArray.push(PDFFunction.parse(xref, obj)); - } - return function (src, srcOffset, dest, destOffset) { - for (var i = 0, ii = fnArray.length; i < ii; i++) { - fnArray[i](src, srcOffset, dest, destOffset + i); - } - }; - }, - - constructSampled: function PDFFunction_constructSampled(str, dict) { - function toMultiArray(arr) { - var inputLength = arr.length; - var out = []; - var index = 0; - for (var i = 0; i < inputLength; i += 2) { - out[index] = [arr[i], arr[i + 1]]; - ++index; - } - return out; - } - var domain = dict.getArray('Domain'); - var range = dict.getArray('Range'); - - if (!domain || !range) { - error('No domain or range'); - } - - var inputSize = domain.length / 2; - var outputSize = range.length / 2; - - domain = toMultiArray(domain); - range = toMultiArray(range); - - var size = dict.get('Size'); - var bps = dict.get('BitsPerSample'); - var order = dict.get('Order') || 1; - if (order !== 1) { - // No description how cubic spline interpolation works in PDF32000:2008 - // As in poppler, ignoring order, linear interpolation may work as good - info('No support for cubic spline interpolation: ' + order); - } - - var encode = dict.getArray('Encode'); - if (!encode) { - encode = []; - for (var i = 0; i < inputSize; ++i) { - encode.push(0); - encode.push(size[i] - 1); - } - } - encode = toMultiArray(encode); - - var decode = dict.getArray('Decode'); - if (!decode) { - decode = range; - } else { - decode = toMultiArray(decode); - } - - var samples = this.getSampleArray(size, outputSize, bps, str); - - return [ - CONSTRUCT_SAMPLED, inputSize, domain, encode, decode, samples, size, - outputSize, Math.pow(2, bps) - 1, range - ]; - }, - - constructSampledFromIR: function PDFFunction_constructSampledFromIR(IR) { - // See chapter 3, page 109 of the PDF reference - function interpolate(x, xmin, xmax, ymin, ymax) { - return ymin + ((x - xmin) * ((ymax - ymin) / (xmax - xmin))); - } - - return function constructSampledFromIRResult(src, srcOffset, - dest, destOffset) { - // See chapter 3, page 110 of the PDF reference. - var m = IR[1]; - var domain = IR[2]; - var encode = IR[3]; - var decode = IR[4]; - var samples = IR[5]; - var size = IR[6]; - var n = IR[7]; - //var mask = IR[8]; - var range = IR[9]; - - // Building the cube vertices: its part and sample index - // http://rjwagner49.com/Mathematics/Interpolation.pdf - var cubeVertices = 1 << m; - var cubeN = new Float64Array(cubeVertices); - var cubeVertex = new Uint32Array(cubeVertices); - var i, j; - for (j = 0; j < cubeVertices; j++) { - cubeN[j] = 1; - } - - var k = n, pos = 1; - // Map x_i to y_j for 0 <= i < m using the sampled function. - for (i = 0; i < m; ++i) { - // x_i' = min(max(x_i, Domain_2i), Domain_2i+1) - var domain_2i = domain[i][0]; - var domain_2i_1 = domain[i][1]; - var xi = Math.min(Math.max(src[srcOffset +i], domain_2i), - domain_2i_1); - - // e_i = Interpolate(x_i', Domain_2i, Domain_2i+1, - // Encode_2i, Encode_2i+1) - var e = interpolate(xi, domain_2i, domain_2i_1, - encode[i][0], encode[i][1]); - - // e_i' = min(max(e_i, 0), Size_i - 1) - var size_i = size[i]; - e = Math.min(Math.max(e, 0), size_i - 1); - - // Adjusting the cube: N and vertex sample index - var e0 = e < size_i - 1 ? Math.floor(e) : e - 1; // e1 = e0 + 1; - var n0 = e0 + 1 - e; // (e1 - e) / (e1 - e0); - var n1 = e - e0; // (e - e0) / (e1 - e0); - var offset0 = e0 * k; - var offset1 = offset0 + k; // e1 * k - for (j = 0; j < cubeVertices; j++) { - if (j & pos) { - cubeN[j] *= n1; - cubeVertex[j] += offset1; - } else { - cubeN[j] *= n0; - cubeVertex[j] += offset0; - } - } - - k *= size_i; - pos <<= 1; - } - - for (j = 0; j < n; ++j) { - // Sum all cube vertices' samples portions - var rj = 0; - for (i = 0; i < cubeVertices; i++) { - rj += samples[cubeVertex[i] + j] * cubeN[i]; - } - - // r_j' = Interpolate(r_j, 0, 2^BitsPerSample - 1, - // Decode_2j, Decode_2j+1) - rj = interpolate(rj, 0, 1, decode[j][0], decode[j][1]); - - // y_j = min(max(r_j, range_2j), range_2j+1) - dest[destOffset + j] = Math.min(Math.max(rj, range[j][0]), - range[j][1]); - } - }; - }, - - constructInterpolated: function PDFFunction_constructInterpolated(str, - dict) { - var c0 = dict.getArray('C0') || [0]; - var c1 = dict.getArray('C1') || [1]; - var n = dict.get('N'); - - if (!isArray(c0) || !isArray(c1)) { - error('Illegal dictionary for interpolated function'); - } - - var length = c0.length; - var diff = []; - for (var i = 0; i < length; ++i) { - diff.push(c1[i] - c0[i]); - } - - return [CONSTRUCT_INTERPOLATED, c0, diff, n]; - }, - - constructInterpolatedFromIR: - function PDFFunction_constructInterpolatedFromIR(IR) { - var c0 = IR[1]; - var diff = IR[2]; - var n = IR[3]; - - var length = diff.length; - - return function constructInterpolatedFromIRResult(src, srcOffset, - dest, destOffset) { - var x = n === 1 ? src[srcOffset] : Math.pow(src[srcOffset], n); - - for (var j = 0; j < length; ++j) { - dest[destOffset + j] = c0[j] + (x * diff[j]); - } - }; - }, - - constructStiched: function PDFFunction_constructStiched(fn, dict, xref) { - var domain = dict.getArray('Domain'); - - if (!domain) { - error('No domain'); - } - - var inputSize = domain.length / 2; - if (inputSize !== 1) { - error('Bad domain for stiched function'); - } - - var fnRefs = dict.get('Functions'); - var fns = []; - for (var i = 0, ii = fnRefs.length; i < ii; ++i) { - fns.push(PDFFunction.getIR(xref, xref.fetchIfRef(fnRefs[i]))); - } - - var bounds = dict.getArray('Bounds'); - var encode = dict.getArray('Encode'); - - return [CONSTRUCT_STICHED, domain, bounds, encode, fns]; - }, - - constructStichedFromIR: function PDFFunction_constructStichedFromIR(IR) { - var domain = IR[1]; - var bounds = IR[2]; - var encode = IR[3]; - var fnsIR = IR[4]; - var fns = []; - var tmpBuf = new Float32Array(1); - - for (var i = 0, ii = fnsIR.length; i < ii; i++) { - fns.push(PDFFunction.fromIR(fnsIR[i])); - } - - return function constructStichedFromIRResult(src, srcOffset, - dest, destOffset) { - var clip = function constructStichedFromIRClip(v, min, max) { - if (v > max) { - v = max; - } else if (v < min) { - v = min; - } - return v; - }; - - // clip to domain - var v = clip(src[srcOffset], domain[0], domain[1]); - // calculate which bound the value is in - for (var i = 0, ii = bounds.length; i < ii; ++i) { - if (v < bounds[i]) { - break; - } - } - - // encode value into domain of function - var dmin = domain[0]; - if (i > 0) { - dmin = bounds[i - 1]; - } - var dmax = domain[1]; - if (i < bounds.length) { - dmax = bounds[i]; - } - - var rmin = encode[2 * i]; - var rmax = encode[2 * i + 1]; - - // Prevent the value from becoming NaN as a result - // of division by zero (fixes issue6113.pdf). - tmpBuf[0] = dmin === dmax ? rmin : - rmin + (v - dmin) * (rmax - rmin) / (dmax - dmin); - - // call the appropriate function - fns[i](tmpBuf, 0, dest, destOffset); - }; - }, - - constructPostScript: function PDFFunction_constructPostScript(fn, dict, - xref) { - var domain = dict.getArray('Domain'); - var range = dict.getArray('Range'); - - if (!domain) { - error('No domain.'); - } - - if (!range) { - error('No range.'); - } - - var lexer = new PostScriptLexer(fn); - var parser = new PostScriptParser(lexer); - var code = parser.parse(); - - return [CONSTRUCT_POSTSCRIPT, domain, range, code]; - }, - - constructPostScriptFromIR: function PDFFunction_constructPostScriptFromIR( - IR) { - var domain = IR[1]; - var range = IR[2]; - var code = IR[3]; - - var compiled = (new PostScriptCompiler()).compile(code, domain, range); - if (compiled) { - // Compiled function consists of simple expressions such as addition, - // subtraction, Math.max, and also contains 'var' and 'return' - // statements. See the generation in the PostScriptCompiler below. - /*jshint -W054 */ - return new Function('src', 'srcOffset', 'dest', 'destOffset', compiled); - } - - info('Unable to compile PS function'); - - var numOutputs = range.length >> 1; - var numInputs = domain.length >> 1; - var evaluator = new PostScriptEvaluator(code); - // Cache the values for a big speed up, the cache size is limited though - // since the number of possible values can be huge from a PS function. - var cache = Object.create(null); - // The MAX_CACHE_SIZE is set to ~4x the maximum number of distinct values - // seen in our tests. - var MAX_CACHE_SIZE = 2048 * 4; - var cache_available = MAX_CACHE_SIZE; - var tmpBuf = new Float32Array(numInputs); - - return function constructPostScriptFromIRResult(src, srcOffset, - dest, destOffset) { - var i, value; - var key = ''; - var input = tmpBuf; - for (i = 0; i < numInputs; i++) { - value = src[srcOffset + i]; - input[i] = value; - key += value + '_'; - } - - var cachedValue = cache[key]; - if (cachedValue !== undefined) { - dest.set(cachedValue, destOffset); - return; - } - - var output = new Float32Array(numOutputs); - var stack = evaluator.execute(input); - var stackIndex = stack.length - numOutputs; - for (i = 0; i < numOutputs; i++) { - value = stack[stackIndex + i]; - var bound = range[i * 2]; - if (value < bound) { - value = bound; - } else { - bound = range[i * 2 +1]; - if (value > bound) { - value = bound; - } - } - output[i] = value; - } - if (cache_available > 0) { - cache_available--; - cache[key] = output; - } - dest.set(output, destOffset); - }; - } - }; -})(); - -function isPDFFunction(v) { - var fnDict; - if (typeof v !== 'object') { - return false; - } else if (isDict(v)) { - fnDict = v; - } else if (isStream(v)) { - fnDict = v.dict; - } else { - return false; - } - return fnDict.has('FunctionType'); -} - -var PostScriptStack = (function PostScriptStackClosure() { - var MAX_STACK_SIZE = 100; - function PostScriptStack(initialStack) { - this.stack = !initialStack ? [] : - Array.prototype.slice.call(initialStack, 0); - } - - PostScriptStack.prototype = { - push: function PostScriptStack_push(value) { - if (this.stack.length >= MAX_STACK_SIZE) { - error('PostScript function stack overflow.'); - } - this.stack.push(value); - }, - pop: function PostScriptStack_pop() { - if (this.stack.length <= 0) { - error('PostScript function stack underflow.'); - } - return this.stack.pop(); - }, - copy: function PostScriptStack_copy(n) { - if (this.stack.length + n >= MAX_STACK_SIZE) { - error('PostScript function stack overflow.'); - } - var stack = this.stack; - for (var i = stack.length - n, j = n - 1; j >= 0; j--, i++) { - stack.push(stack[i]); - } - }, - index: function PostScriptStack_index(n) { - this.push(this.stack[this.stack.length - n - 1]); - }, - // rotate the last n stack elements p times - roll: function PostScriptStack_roll(n, p) { - var stack = this.stack; - var l = stack.length - n; - var r = stack.length - 1, c = l + (p - Math.floor(p / n) * n), i, j, t; - for (i = l, j = r; i < j; i++, j--) { - t = stack[i]; stack[i] = stack[j]; stack[j] = t; - } - for (i = l, j = c - 1; i < j; i++, j--) { - t = stack[i]; stack[i] = stack[j]; stack[j] = t; - } - for (i = c, j = r; i < j; i++, j--) { - t = stack[i]; stack[i] = stack[j]; stack[j] = t; - } - } - }; - return PostScriptStack; -})(); -var PostScriptEvaluator = (function PostScriptEvaluatorClosure() { - function PostScriptEvaluator(operators) { - this.operators = operators; - } - PostScriptEvaluator.prototype = { - execute: function PostScriptEvaluator_execute(initialStack) { - var stack = new PostScriptStack(initialStack); - var counter = 0; - var operators = this.operators; - var length = operators.length; - var operator, a, b; - while (counter < length) { - operator = operators[counter++]; - if (typeof operator === 'number') { - // Operator is really an operand and should be pushed to the stack. - stack.push(operator); - continue; - } - switch (operator) { - // non standard ps operators - case 'jz': // jump if false - b = stack.pop(); - a = stack.pop(); - if (!a) { - counter = b; - } - break; - case 'j': // jump - a = stack.pop(); - counter = a; - break; - - // all ps operators in alphabetical order (excluding if/ifelse) - case 'abs': - a = stack.pop(); - stack.push(Math.abs(a)); - break; - case 'add': - b = stack.pop(); - a = stack.pop(); - stack.push(a + b); - break; - case 'and': - b = stack.pop(); - a = stack.pop(); - if (isBool(a) && isBool(b)) { - stack.push(a && b); - } else { - stack.push(a & b); - } - break; - case 'atan': - a = stack.pop(); - stack.push(Math.atan(a)); - break; - case 'bitshift': - b = stack.pop(); - a = stack.pop(); - if (a > 0) { - stack.push(a << b); - } else { - stack.push(a >> b); - } - break; - case 'ceiling': - a = stack.pop(); - stack.push(Math.ceil(a)); - break; - case 'copy': - a = stack.pop(); - stack.copy(a); - break; - case 'cos': - a = stack.pop(); - stack.push(Math.cos(a)); - break; - case 'cvi': - a = stack.pop() | 0; - stack.push(a); - break; - case 'cvr': - // noop - break; - case 'div': - b = stack.pop(); - a = stack.pop(); - stack.push(a / b); - break; - case 'dup': - stack.copy(1); - break; - case 'eq': - b = stack.pop(); - a = stack.pop(); - stack.push(a === b); - break; - case 'exch': - stack.roll(2, 1); - break; - case 'exp': - b = stack.pop(); - a = stack.pop(); - stack.push(Math.pow(a, b)); - break; - case 'false': - stack.push(false); - break; - case 'floor': - a = stack.pop(); - stack.push(Math.floor(a)); - break; - case 'ge': - b = stack.pop(); - a = stack.pop(); - stack.push(a >= b); - break; - case 'gt': - b = stack.pop(); - a = stack.pop(); - stack.push(a > b); - break; - case 'idiv': - b = stack.pop(); - a = stack.pop(); - stack.push((a / b) | 0); - break; - case 'index': - a = stack.pop(); - stack.index(a); - break; - case 'le': - b = stack.pop(); - a = stack.pop(); - stack.push(a <= b); - break; - case 'ln': - a = stack.pop(); - stack.push(Math.log(a)); - break; - case 'log': - a = stack.pop(); - stack.push(Math.log(a) / Math.LN10); - break; - case 'lt': - b = stack.pop(); - a = stack.pop(); - stack.push(a < b); - break; - case 'mod': - b = stack.pop(); - a = stack.pop(); - stack.push(a % b); - break; - case 'mul': - b = stack.pop(); - a = stack.pop(); - stack.push(a * b); - break; - case 'ne': - b = stack.pop(); - a = stack.pop(); - stack.push(a !== b); - break; - case 'neg': - a = stack.pop(); - stack.push(-a); - break; - case 'not': - a = stack.pop(); - if (isBool(a)) { - stack.push(!a); - } else { - stack.push(~a); - } - break; - case 'or': - b = stack.pop(); - a = stack.pop(); - if (isBool(a) && isBool(b)) { - stack.push(a || b); - } else { - stack.push(a | b); - } - break; - case 'pop': - stack.pop(); - break; - case 'roll': - b = stack.pop(); - a = stack.pop(); - stack.roll(a, b); - break; - case 'round': - a = stack.pop(); - stack.push(Math.round(a)); - break; - case 'sin': - a = stack.pop(); - stack.push(Math.sin(a)); - break; - case 'sqrt': - a = stack.pop(); - stack.push(Math.sqrt(a)); - break; - case 'sub': - b = stack.pop(); - a = stack.pop(); - stack.push(a - b); - break; - case 'true': - stack.push(true); - break; - case 'truncate': - a = stack.pop(); - a = a < 0 ? Math.ceil(a) : Math.floor(a); - stack.push(a); - break; - case 'xor': - b = stack.pop(); - a = stack.pop(); - if (isBool(a) && isBool(b)) { - stack.push(a !== b); - } else { - stack.push(a ^ b); - } - break; - default: - error('Unknown operator ' + operator); - break; - } - } - return stack.stack; - } - }; - return PostScriptEvaluator; -})(); - -// Most of the PDFs functions consist of simple operations such as: -// roll, exch, sub, cvr, pop, index, dup, mul, if, gt, add. -// -// We can compile most of such programs, and at the same moment, we can -// optimize some expressions using basic math properties. Keeping track of -// min/max values will allow us to avoid extra Math.min/Math.max calls. -var PostScriptCompiler = (function PostScriptCompilerClosure() { - function AstNode(type) { - this.type = type; - } - AstNode.prototype.visit = function (visitor) { - throw new Error('abstract method'); - }; - - function AstArgument(index, min, max) { - AstNode.call(this, 'args'); - this.index = index; - this.min = min; - this.max = max; - } - AstArgument.prototype = Object.create(AstNode.prototype); - AstArgument.prototype.visit = function (visitor) { - visitor.visitArgument(this); - }; - - function AstLiteral(number) { - AstNode.call(this, 'literal'); - this.number = number; - this.min = number; - this.max = number; - } - AstLiteral.prototype = Object.create(AstNode.prototype); - AstLiteral.prototype.visit = function (visitor) { - visitor.visitLiteral(this); - }; - - function AstBinaryOperation(op, arg1, arg2, min, max) { - AstNode.call(this, 'binary'); - this.op = op; - this.arg1 = arg1; - this.arg2 = arg2; - this.min = min; - this.max = max; - } - AstBinaryOperation.prototype = Object.create(AstNode.prototype); - AstBinaryOperation.prototype.visit = function (visitor) { - visitor.visitBinaryOperation(this); - }; - - function AstMin(arg, max) { - AstNode.call(this, 'max'); - this.arg = arg; - this.min = arg.min; - this.max = max; - } - AstMin.prototype = Object.create(AstNode.prototype); - AstMin.prototype.visit = function (visitor) { - visitor.visitMin(this); - }; - - function AstVariable(index, min, max) { - AstNode.call(this, 'var'); - this.index = index; - this.min = min; - this.max = max; - } - AstVariable.prototype = Object.create(AstNode.prototype); - AstVariable.prototype.visit = function (visitor) { - visitor.visitVariable(this); - }; - - function AstVariableDefinition(variable, arg) { - AstNode.call(this, 'definition'); - this.variable = variable; - this.arg = arg; - } - AstVariableDefinition.prototype = Object.create(AstNode.prototype); - AstVariableDefinition.prototype.visit = function (visitor) { - visitor.visitVariableDefinition(this); - }; - - function ExpressionBuilderVisitor() { - this.parts = []; - } - ExpressionBuilderVisitor.prototype = { - visitArgument: function (arg) { - this.parts.push('Math.max(', arg.min, ', Math.min(', - arg.max, ', src[srcOffset + ', arg.index, ']))'); - }, - visitVariable: function (variable) { - this.parts.push('v', variable.index); - }, - visitLiteral: function (literal) { - this.parts.push(literal.number); - }, - visitBinaryOperation: function (operation) { - this.parts.push('('); - operation.arg1.visit(this); - this.parts.push(' ', operation.op, ' '); - operation.arg2.visit(this); - this.parts.push(')'); - }, - visitVariableDefinition: function (definition) { - this.parts.push('var '); - definition.variable.visit(this); - this.parts.push(' = '); - definition.arg.visit(this); - this.parts.push(';'); - }, - visitMin: function (max) { - this.parts.push('Math.min('); - max.arg.visit(this); - this.parts.push(', ', max.max, ')'); - }, - toString: function () { - return this.parts.join(''); - } - }; - - function buildAddOperation(num1, num2) { - if (num2.type === 'literal' && num2.number === 0) { - // optimization: second operand is 0 - return num1; - } - if (num1.type === 'literal' && num1.number === 0) { - // optimization: first operand is 0 - return num2; - } - if (num2.type === 'literal' && num1.type === 'literal') { - // optimization: operands operand are literals - return new AstLiteral(num1.number + num2.number); - } - return new AstBinaryOperation('+', num1, num2, - num1.min + num2.min, num1.max + num2.max); - } - - function buildMulOperation(num1, num2) { - if (num2.type === 'literal') { - // optimization: second operands is a literal... - if (num2.number === 0) { - return new AstLiteral(0); // and it's 0 - } else if (num2.number === 1) { - return num1; // and it's 1 - } else if (num1.type === 'literal') { - // ... and first operands is a literal too - return new AstLiteral(num1.number * num2.number); - } - } - if (num1.type === 'literal') { - // optimization: first operands is a literal... - if (num1.number === 0) { - return new AstLiteral(0); // and it's 0 - } else if (num1.number === 1) { - return num2; // and it's 1 - } - } - var min = Math.min(num1.min * num2.min, num1.min * num2.max, - num1.max * num2.min, num1.max * num2.max); - var max = Math.max(num1.min * num2.min, num1.min * num2.max, - num1.max * num2.min, num1.max * num2.max); - return new AstBinaryOperation('*', num1, num2, min, max); - } - - function buildSubOperation(num1, num2) { - if (num2.type === 'literal') { - // optimization: second operands is a literal... - if (num2.number === 0) { - return num1; // ... and it's 0 - } else if (num1.type === 'literal') { - // ... and first operands is a literal too - return new AstLiteral(num1.number - num2.number); - } - } - if (num2.type === 'binary' && num2.op === '-' && - num1.type === 'literal' && num1.number === 1 && - num2.arg1.type === 'literal' && num2.arg1.number === 1) { - // optimization for case: 1 - (1 - x) - return num2.arg2; - } - return new AstBinaryOperation('-', num1, num2, - num1.min - num2.max, num1.max - num2.min); - } - - function buildMinOperation(num1, max) { - if (num1.min >= max) { - // optimization: num1 min value is not less than required max - return new AstLiteral(max); // just returning max - } else if (num1.max <= max) { - // optimization: num1 max value is not greater than required max - return num1; // just returning an argument - } - return new AstMin(num1, max); - } - - function PostScriptCompiler() {} - PostScriptCompiler.prototype = { - compile: function PostScriptCompiler_compile(code, domain, range) { - var stack = []; - var i, ii; - var instructions = []; - var inputSize = domain.length >> 1, outputSize = range.length >> 1; - var lastRegister = 0; - var n, j; - var num1, num2, ast1, ast2, tmpVar, item; - for (i = 0; i < inputSize; i++) { - stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1])); - } - - for (i = 0, ii = code.length; i < ii; i++) { - item = code[i]; - if (typeof item === 'number') { - stack.push(new AstLiteral(item)); - continue; - } - - switch (item) { - case 'add': - if (stack.length < 2) { - return null; - } - num2 = stack.pop(); - num1 = stack.pop(); - stack.push(buildAddOperation(num1, num2)); - break; - case 'cvr': - if (stack.length < 1) { - return null; - } - break; - case 'mul': - if (stack.length < 2) { - return null; - } - num2 = stack.pop(); - num1 = stack.pop(); - stack.push(buildMulOperation(num1, num2)); - break; - case 'sub': - if (stack.length < 2) { - return null; - } - num2 = stack.pop(); - num1 = stack.pop(); - stack.push(buildSubOperation(num1, num2)); - break; - case 'exch': - if (stack.length < 2) { - return null; - } - ast1 = stack.pop(); ast2 = stack.pop(); - stack.push(ast1, ast2); - break; - case 'pop': - if (stack.length < 1) { - return null; - } - stack.pop(); - break; - case 'index': - if (stack.length < 1) { - return null; - } - num1 = stack.pop(); - if (num1.type !== 'literal') { - return null; - } - n = num1.number; - if (n < 0 || (n|0) !== n || stack.length < n) { - return null; - } - ast1 = stack[stack.length - n - 1]; - if (ast1.type === 'literal' || ast1.type === 'var') { - stack.push(ast1); - break; - } - tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); - stack[stack.length - n - 1] = tmpVar; - stack.push(tmpVar); - instructions.push(new AstVariableDefinition(tmpVar, ast1)); - break; - case 'dup': - if (stack.length < 1) { - return null; - } - if (typeof code[i + 1] === 'number' && code[i + 2] === 'gt' && - code[i + 3] === i + 7 && code[i + 4] === 'jz' && - code[i + 5] === 'pop' && code[i + 6] === code[i + 1]) { - // special case of the commands sequence for the min operation - num1 = stack.pop(); - stack.push(buildMinOperation(num1, code[i + 1])); - i += 6; - break; - } - ast1 = stack[stack.length - 1]; - if (ast1.type === 'literal' || ast1.type === 'var') { - // we don't have to save into intermediate variable a literal or - // variable. - stack.push(ast1); - break; - } - tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); - stack[stack.length - 1] = tmpVar; - stack.push(tmpVar); - instructions.push(new AstVariableDefinition(tmpVar, ast1)); - break; - case 'roll': - if (stack.length < 2) { - return null; - } - num2 = stack.pop(); - num1 = stack.pop(); - if (num2.type !== 'literal' || num1.type !== 'literal') { - // both roll operands must be numbers - return null; - } - j = num2.number; - n = num1.number; - if (n <= 0 || (n|0) !== n || (j|0) !== j || stack.length < n) { - // ... and integers - return null; - } - j = ((j % n) + n) % n; - if (j === 0) { - break; // just skipping -- there are nothing to rotate - } - Array.prototype.push.apply(stack, - stack.splice(stack.length - n, n - j)); - break; - default: - return null; // unsupported operator - } - } - - if (stack.length !== outputSize) { - return null; - } - - var result = []; - instructions.forEach(function (instruction) { - var statementBuilder = new ExpressionBuilderVisitor(); - instruction.visit(statementBuilder); - result.push(statementBuilder.toString()); - }); - stack.forEach(function (expr, i) { - var statementBuilder = new ExpressionBuilderVisitor(); - expr.visit(statementBuilder); - var min = range[i * 2], max = range[i * 2 + 1]; - var out = [statementBuilder.toString()]; - if (min > expr.min) { - out.unshift('Math.max(', min, ', '); - out.push(')'); - } - if (max < expr.max) { - out.unshift('Math.min(', max, ', '); - out.push(')'); - } - out.unshift('dest[destOffset + ', i, '] = '); - out.push(';'); - result.push(out.join('')); - }); - return result.join('\n'); - } - }; - - return PostScriptCompiler; -})(); - -exports.isPDFFunction = isPDFFunction; -exports.PDFFunction = PDFFunction; -exports.PostScriptEvaluator = PostScriptEvaluator; -exports.PostScriptCompiler = PostScriptCompiler; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreColorSpace = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreFunction); - } -}(this, function (exports, sharedUtil, corePrimitives, coreFunction) { - -var error = sharedUtil.error; -var info = sharedUtil.info; -var isArray = sharedUtil.isArray; -var isString = sharedUtil.isString; -var shadow = sharedUtil.shadow; -var warn = sharedUtil.warn; -var isDict = corePrimitives.isDict; -var isName = corePrimitives.isName; -var isStream = corePrimitives.isStream; -var PDFFunction = coreFunction.PDFFunction; - -var ColorSpace = (function ColorSpaceClosure() { - /** - * Resizes an RGB image with 3 components. - * @param {TypedArray} src - The source buffer. - * @param {Number} bpc - Number of bits per component. - * @param {Number} w1 - Original width. - * @param {Number} h1 - Original height. - * @param {Number} w2 - New width. - * @param {Number} h2 - New height. - * @param {Number} alpha01 - Size reserved for the alpha channel. - * @param {TypedArray} dest - The destination buffer. - */ - function resizeRgbImage(src, bpc, w1, h1, w2, h2, alpha01, dest) { - var COMPONENTS = 3; - alpha01 = alpha01 !== 1 ? 0 : alpha01; - var xRatio = w1 / w2; - var yRatio = h1 / h2; - var i, j, py, newIndex = 0, oldIndex; - var xScaled = new Uint16Array(w2); - var w1Scanline = w1 * COMPONENTS; - - for (i = 0; i < w2; i++) { - xScaled[i] = Math.floor(i * xRatio) * COMPONENTS; - } - for (i = 0; i < h2; i++) { - py = Math.floor(i * yRatio) * w1Scanline; - for (j = 0; j < w2; j++) { - oldIndex = py + xScaled[j]; - dest[newIndex++] = src[oldIndex++]; - dest[newIndex++] = src[oldIndex++]; - dest[newIndex++] = src[oldIndex++]; - newIndex += alpha01; - } - } - } - - // Constructor should define this.numComps, this.defaultColor, this.name - function ColorSpace() { - error('should not call ColorSpace constructor'); - } - - ColorSpace.prototype = { - /** - * Converts the color value to the RGB color. The color components are - * located in the src array starting from the srcOffset. Returns the array - * of the rgb components, each value ranging from [0,255]. - */ - getRgb: function ColorSpace_getRgb(src, srcOffset) { - var rgb = new Uint8Array(3); - this.getRgbItem(src, srcOffset, rgb, 0); - return rgb; - }, - /** - * Converts the color value to the RGB color, similar to the getRgb method. - * The result placed into the dest array starting from the destOffset. - */ - getRgbItem: function ColorSpace_getRgbItem(src, srcOffset, - dest, destOffset) { - error('Should not call ColorSpace.getRgbItem'); - }, - /** - * Converts the specified number of the color values to the RGB colors. - * The colors are located in the src array starting from the srcOffset. - * The result is placed into the dest array starting from the destOffset. - * The src array items shall be in [0,2^bits) range, the dest array items - * will be in [0,255] range. alpha01 indicates how many alpha components - * there are in the dest array; it will be either 0 (RGB array) or 1 (RGBA - * array). - */ - getRgbBuffer: function ColorSpace_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - error('Should not call ColorSpace.getRgbBuffer'); - }, - /** - * Determines the number of bytes required to store the result of the - * conversion done by the getRgbBuffer method. As in getRgbBuffer, - * |alpha01| is either 0 (RGB output) or 1 (RGBA output). - */ - getOutputLength: function ColorSpace_getOutputLength(inputLength, - alpha01) { - error('Should not call ColorSpace.getOutputLength'); - }, - /** - * Returns true if source data will be equal the result/output data. - */ - isPassthrough: function ColorSpace_isPassthrough(bits) { - return false; - }, - /** - * Fills in the RGB colors in the destination buffer. alpha01 indicates - * how many alpha components there are in the dest array; it will be either - * 0 (RGB array) or 1 (RGBA array). - */ - fillRgb: function ColorSpace_fillRgb(dest, originalWidth, - originalHeight, width, height, - actualHeight, bpc, comps, alpha01) { - var count = originalWidth * originalHeight; - var rgbBuf = null; - var numComponentColors = 1 << bpc; - var needsResizing = originalHeight !== height || originalWidth !== width; - var i, ii; - - if (this.isPassthrough(bpc)) { - rgbBuf = comps; - } else if (this.numComps === 1 && count > numComponentColors && - this.name !== 'DeviceGray' && this.name !== 'DeviceRGB') { - // Optimization: create a color map when there is just one component and - // we are converting more colors than the size of the color map. We - // don't build the map if the colorspace is gray or rgb since those - // methods are faster than building a map. This mainly offers big speed - // ups for indexed and alternate colorspaces. - // - // TODO it may be worth while to cache the color map. While running - // testing I never hit a cache so I will leave that out for now (perhaps - // we are reparsing colorspaces too much?). - var allColors = bpc <= 8 ? new Uint8Array(numComponentColors) : - new Uint16Array(numComponentColors); - var key; - for (i = 0; i < numComponentColors; i++) { - allColors[i] = i; - } - var colorMap = new Uint8Array(numComponentColors * 3); - this.getRgbBuffer(allColors, 0, numComponentColors, colorMap, 0, bpc, - /* alpha01 = */ 0); - - var destPos, rgbPos; - if (!needsResizing) { - // Fill in the RGB values directly into |dest|. - destPos = 0; - for (i = 0; i < count; ++i) { - key = comps[i] * 3; - dest[destPos++] = colorMap[key]; - dest[destPos++] = colorMap[key + 1]; - dest[destPos++] = colorMap[key + 2]; - destPos += alpha01; - } - } else { - rgbBuf = new Uint8Array(count * 3); - rgbPos = 0; - for (i = 0; i < count; ++i) { - key = comps[i] * 3; - rgbBuf[rgbPos++] = colorMap[key]; - rgbBuf[rgbPos++] = colorMap[key + 1]; - rgbBuf[rgbPos++] = colorMap[key + 2]; - } - } - } else { - if (!needsResizing) { - // Fill in the RGB values directly into |dest|. - this.getRgbBuffer(comps, 0, width * actualHeight, dest, 0, bpc, - alpha01); - } else { - rgbBuf = new Uint8Array(count * 3); - this.getRgbBuffer(comps, 0, count, rgbBuf, 0, bpc, - /* alpha01 = */ 0); - } - } - - if (rgbBuf) { - if (needsResizing) { - resizeRgbImage(rgbBuf, bpc, originalWidth, originalHeight, - width, height, alpha01, dest); - } else { - rgbPos = 0; - destPos = 0; - for (i = 0, ii = width * actualHeight; i < ii; i++) { - dest[destPos++] = rgbBuf[rgbPos++]; - dest[destPos++] = rgbBuf[rgbPos++]; - dest[destPos++] = rgbBuf[rgbPos++]; - destPos += alpha01; - } - } - } - }, - /** - * True if the colorspace has components in the default range of [0, 1]. - * This should be true for all colorspaces except for lab color spaces - * which are [0,100], [-128, 127], [-128, 127]. - */ - usesZeroToOneRange: true - }; - - ColorSpace.parse = function ColorSpace_parse(cs, xref, res) { - var IR = ColorSpace.parseToIR(cs, xref, res); - if (IR instanceof AlternateCS) { - return IR; - } - return ColorSpace.fromIR(IR); - }; - - ColorSpace.fromIR = function ColorSpace_fromIR(IR) { - var name = isArray(IR) ? IR[0] : IR; - var whitePoint, blackPoint, gamma; - - switch (name) { - case 'DeviceGrayCS': - return this.singletons.gray; - case 'DeviceRgbCS': - return this.singletons.rgb; - case 'DeviceCmykCS': - return this.singletons.cmyk; - case 'CalGrayCS': - whitePoint = IR[1]; - blackPoint = IR[2]; - gamma = IR[3]; - return new CalGrayCS(whitePoint, blackPoint, gamma); - case 'CalRGBCS': - whitePoint = IR[1]; - blackPoint = IR[2]; - gamma = IR[3]; - var matrix = IR[4]; - return new CalRGBCS(whitePoint, blackPoint, gamma, matrix); - case 'PatternCS': - var basePatternCS = IR[1]; - if (basePatternCS) { - basePatternCS = ColorSpace.fromIR(basePatternCS); - } - return new PatternCS(basePatternCS); - case 'IndexedCS': - var baseIndexedCS = IR[1]; - var hiVal = IR[2]; - var lookup = IR[3]; - return new IndexedCS(ColorSpace.fromIR(baseIndexedCS), hiVal, lookup); - case 'AlternateCS': - var numComps = IR[1]; - var alt = IR[2]; - var tintFnIR = IR[3]; - - return new AlternateCS(numComps, ColorSpace.fromIR(alt), - PDFFunction.fromIR(tintFnIR)); - case 'LabCS': - whitePoint = IR[1]; - blackPoint = IR[2]; - var range = IR[3]; - return new LabCS(whitePoint, blackPoint, range); - default: - error('Unknown name ' + name); - } - return null; - }; - - ColorSpace.parseToIR = function ColorSpace_parseToIR(cs, xref, res) { - if (isName(cs)) { - var colorSpaces = res.get('ColorSpace'); - if (isDict(colorSpaces)) { - var refcs = colorSpaces.get(cs.name); - if (refcs) { - cs = refcs; - } - } - } - - cs = xref.fetchIfRef(cs); - var mode; - - if (isName(cs)) { - mode = cs.name; - this.mode = mode; - - switch (mode) { - case 'DeviceGray': - case 'G': - return 'DeviceGrayCS'; - case 'DeviceRGB': - case 'RGB': - return 'DeviceRgbCS'; - case 'DeviceCMYK': - case 'CMYK': - return 'DeviceCmykCS'; - case 'Pattern': - return ['PatternCS', null]; - default: - error('unrecognized colorspace ' + mode); - } - } else if (isArray(cs)) { - mode = xref.fetchIfRef(cs[0]).name; - this.mode = mode; - var numComps, params, alt, whitePoint, blackPoint, gamma; - - switch (mode) { - case 'DeviceGray': - case 'G': - return 'DeviceGrayCS'; - case 'DeviceRGB': - case 'RGB': - return 'DeviceRgbCS'; - case 'DeviceCMYK': - case 'CMYK': - return 'DeviceCmykCS'; - case 'CalGray': - params = xref.fetchIfRef(cs[1]); - whitePoint = params.getArray('WhitePoint'); - blackPoint = params.getArray('BlackPoint'); - gamma = params.get('Gamma'); - return ['CalGrayCS', whitePoint, blackPoint, gamma]; - case 'CalRGB': - params = xref.fetchIfRef(cs[1]); - whitePoint = params.getArray('WhitePoint'); - blackPoint = params.getArray('BlackPoint'); - gamma = params.getArray('Gamma'); - var matrix = params.getArray('Matrix'); - return ['CalRGBCS', whitePoint, blackPoint, gamma, matrix]; - case 'ICCBased': - var stream = xref.fetchIfRef(cs[1]); - var dict = stream.dict; - numComps = dict.get('N'); - alt = dict.get('Alternate'); - if (alt) { - var altIR = ColorSpace.parseToIR(alt, xref, res); - // Parse the /Alternate CS to ensure that the number of components - // are correct, and also (indirectly) that it is not a PatternCS. - var altCS = ColorSpace.fromIR(altIR); - if (altCS.numComps === numComps) { - return altIR; - } - warn('ICCBased color space: Ignoring incorrect /Alternate entry.'); - } - if (numComps === 1) { - return 'DeviceGrayCS'; - } else if (numComps === 3) { - return 'DeviceRgbCS'; - } else if (numComps === 4) { - return 'DeviceCmykCS'; - } - break; - case 'Pattern': - var basePatternCS = cs[1] || null; - if (basePatternCS) { - basePatternCS = ColorSpace.parseToIR(basePatternCS, xref, res); - } - return ['PatternCS', basePatternCS]; - case 'Indexed': - case 'I': - var baseIndexedCS = ColorSpace.parseToIR(cs[1], xref, res); - var hiVal = xref.fetchIfRef(cs[2]) + 1; - var lookup = xref.fetchIfRef(cs[3]); - if (isStream(lookup)) { - lookup = lookup.getBytes(); - } - return ['IndexedCS', baseIndexedCS, hiVal, lookup]; - case 'Separation': - case 'DeviceN': - var name = xref.fetchIfRef(cs[1]); - numComps = 1; - if (isName(name)) { - numComps = 1; - } else if (isArray(name)) { - numComps = name.length; - } - alt = ColorSpace.parseToIR(cs[2], xref, res); - var tintFnIR = PDFFunction.getIR(xref, xref.fetchIfRef(cs[3])); - return ['AlternateCS', numComps, alt, tintFnIR]; - case 'Lab': - params = xref.fetchIfRef(cs[1]); - whitePoint = params.getArray('WhitePoint'); - blackPoint = params.getArray('BlackPoint'); - var range = params.getArray('Range'); - return ['LabCS', whitePoint, blackPoint, range]; - default: - error('unimplemented color space object "' + mode + '"'); - } - } else { - error('unrecognized color space object: "' + cs + '"'); - } - return null; - }; - /** - * Checks if a decode map matches the default decode map for a color space. - * This handles the general decode maps where there are two values per - * component. e.g. [0, 1, 0, 1, 0, 1] for a RGB color. - * This does not handle Lab, Indexed, or Pattern decode maps since they are - * slightly different. - * @param {Array} decode Decode map (usually from an image). - * @param {Number} n Number of components the color space has. - */ - ColorSpace.isDefaultDecode = function ColorSpace_isDefaultDecode(decode, n) { - if (!isArray(decode)) { - return true; - } - - if (n * 2 !== decode.length) { - warn('The decode map is not the correct length'); - return true; - } - for (var i = 0, ii = decode.length; i < ii; i += 2) { - if (decode[i] !== 0 || decode[i + 1] !== 1) { - return false; - } - } - return true; - }; - - ColorSpace.singletons = { - get gray() { - return shadow(this, 'gray', new DeviceGrayCS()); - }, - get rgb() { - return shadow(this, 'rgb', new DeviceRgbCS()); - }, - get cmyk() { - return shadow(this, 'cmyk', new DeviceCmykCS()); - } - }; - - return ColorSpace; -})(); - -/** - * Alternate color space handles both Separation and DeviceN color spaces. A - * Separation color space is actually just a DeviceN with one color component. - * Both color spaces use a tinting function to convert colors to a base color - * space. - */ -var AlternateCS = (function AlternateCSClosure() { - function AlternateCS(numComps, base, tintFn) { - this.name = 'Alternate'; - this.numComps = numComps; - this.defaultColor = new Float32Array(numComps); - for (var i = 0; i < numComps; ++i) { - this.defaultColor[i] = 1; - } - this.base = base; - this.tintFn = tintFn; - this.tmpBuf = new Float32Array(base.numComps); - } - - AlternateCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function AlternateCS_getRgbItem(src, srcOffset, - dest, destOffset) { - var tmpBuf = this.tmpBuf; - this.tintFn(src, srcOffset, tmpBuf, 0); - this.base.getRgbItem(tmpBuf, 0, dest, destOffset); - }, - getRgbBuffer: function AlternateCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var tintFn = this.tintFn; - var base = this.base; - var scale = 1 / ((1 << bits) - 1); - var baseNumComps = base.numComps; - var usesZeroToOneRange = base.usesZeroToOneRange; - var isPassthrough = (base.isPassthrough(8) || !usesZeroToOneRange) && - alpha01 === 0; - var pos = isPassthrough ? destOffset : 0; - var baseBuf = isPassthrough ? dest : new Uint8Array(baseNumComps * count); - var numComps = this.numComps; - - var scaled = new Float32Array(numComps); - var tinted = new Float32Array(baseNumComps); - var i, j; - if (usesZeroToOneRange) { - for (i = 0; i < count; i++) { - for (j = 0; j < numComps; j++) { - scaled[j] = src[srcOffset++] * scale; - } - tintFn(scaled, 0, tinted, 0); - for (j = 0; j < baseNumComps; j++) { - baseBuf[pos++] = tinted[j] * 255; - } - } - } else { - for (i = 0; i < count; i++) { - for (j = 0; j < numComps; j++) { - scaled[j] = src[srcOffset++] * scale; - } - tintFn(scaled, 0, tinted, 0); - base.getRgbItem(tinted, 0, baseBuf, pos); - pos += baseNumComps; - } - } - if (!isPassthrough) { - base.getRgbBuffer(baseBuf, 0, count, dest, destOffset, 8, alpha01); - } - }, - getOutputLength: function AlternateCS_getOutputLength(inputLength, - alpha01) { - return this.base.getOutputLength(inputLength * - this.base.numComps / this.numComps, - alpha01); - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function AlternateCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - - return AlternateCS; -})(); - -var PatternCS = (function PatternCSClosure() { - function PatternCS(baseCS) { - this.name = 'Pattern'; - this.base = baseCS; - } - PatternCS.prototype = {}; - - return PatternCS; -})(); - -var IndexedCS = (function IndexedCSClosure() { - function IndexedCS(base, highVal, lookup) { - this.name = 'Indexed'; - this.numComps = 1; - this.defaultColor = new Uint8Array([0]); - this.base = base; - this.highVal = highVal; - - var baseNumComps = base.numComps; - var length = baseNumComps * highVal; - var lookupArray; - - if (isStream(lookup)) { - lookupArray = new Uint8Array(length); - var bytes = lookup.getBytes(length); - lookupArray.set(bytes); - } else if (isString(lookup)) { - lookupArray = new Uint8Array(length); - for (var i = 0; i < length; ++i) { - lookupArray[i] = lookup.charCodeAt(i); - } - } else if (lookup instanceof Uint8Array || lookup instanceof Array) { - lookupArray = lookup; - } else { - error('Unrecognized lookup table: ' + lookup); - } - this.lookup = lookupArray; - } - - IndexedCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function IndexedCS_getRgbItem(src, srcOffset, - dest, destOffset) { - var numComps = this.base.numComps; - var start = src[srcOffset] * numComps; - this.base.getRgbItem(this.lookup, start, dest, destOffset); - }, - getRgbBuffer: function IndexedCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var base = this.base; - var numComps = base.numComps; - var outputDelta = base.getOutputLength(numComps, alpha01); - var lookup = this.lookup; - - for (var i = 0; i < count; ++i) { - var lookupPos = src[srcOffset++] * numComps; - base.getRgbBuffer(lookup, lookupPos, 1, dest, destOffset, 8, alpha01); - destOffset += outputDelta; - } - }, - getOutputLength: function IndexedCS_getOutputLength(inputLength, alpha01) { - return this.base.getOutputLength(inputLength * this.base.numComps, - alpha01); - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function IndexedCS_isDefaultDecode(decodeMap) { - // indexed color maps shouldn't be changed - return true; - }, - usesZeroToOneRange: true - }; - return IndexedCS; -})(); - -var DeviceGrayCS = (function DeviceGrayCSClosure() { - function DeviceGrayCS() { - this.name = 'DeviceGray'; - this.numComps = 1; - this.defaultColor = new Float32Array([0]); - } - - DeviceGrayCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function DeviceGrayCS_getRgbItem(src, srcOffset, - dest, destOffset) { - var c = (src[srcOffset] * 255) | 0; - c = c < 0 ? 0 : c > 255 ? 255 : c; - dest[destOffset] = dest[destOffset + 1] = dest[destOffset + 2] = c; - }, - getRgbBuffer: function DeviceGrayCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var scale = 255 / ((1 << bits) - 1); - var j = srcOffset, q = destOffset; - for (var i = 0; i < count; ++i) { - var c = (scale * src[j++]) | 0; - dest[q++] = c; - dest[q++] = c; - dest[q++] = c; - q += alpha01; - } - }, - getOutputLength: function DeviceGrayCS_getOutputLength(inputLength, - alpha01) { - return inputLength * (3 + alpha01); - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function DeviceGrayCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - return DeviceGrayCS; -})(); - -var DeviceRgbCS = (function DeviceRgbCSClosure() { - function DeviceRgbCS() { - this.name = 'DeviceRGB'; - this.numComps = 3; - this.defaultColor = new Float32Array([0, 0, 0]); - } - DeviceRgbCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function DeviceRgbCS_getRgbItem(src, srcOffset, - dest, destOffset) { - var r = (src[srcOffset] * 255) | 0; - var g = (src[srcOffset + 1] * 255) | 0; - var b = (src[srcOffset + 2] * 255) | 0; - dest[destOffset] = r < 0 ? 0 : r > 255 ? 255 : r; - dest[destOffset + 1] = g < 0 ? 0 : g > 255 ? 255 : g; - dest[destOffset + 2] = b < 0 ? 0 : b > 255 ? 255 : b; - }, - getRgbBuffer: function DeviceRgbCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - if (bits === 8 && alpha01 === 0) { - dest.set(src.subarray(srcOffset, srcOffset + count * 3), destOffset); - return; - } - var scale = 255 / ((1 << bits) - 1); - var j = srcOffset, q = destOffset; - for (var i = 0; i < count; ++i) { - dest[q++] = (scale * src[j++]) | 0; - dest[q++] = (scale * src[j++]) | 0; - dest[q++] = (scale * src[j++]) | 0; - q += alpha01; - } - }, - getOutputLength: function DeviceRgbCS_getOutputLength(inputLength, - alpha01) { - return (inputLength * (3 + alpha01) / 3) | 0; - }, - isPassthrough: function DeviceRgbCS_isPassthrough(bits) { - return bits === 8; - }, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function DeviceRgbCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - return DeviceRgbCS; -})(); - -var DeviceCmykCS = (function DeviceCmykCSClosure() { - // The coefficients below was found using numerical analysis: the method of - // steepest descent for the sum((f_i - color_value_i)^2) for r/g/b colors, - // where color_value is the tabular value from the table of sampled RGB colors - // from CMYK US Web Coated (SWOP) colorspace, and f_i is the corresponding - // CMYK color conversion using the estimation below: - // f(A, B,.. N) = Acc+Bcm+Ccy+Dck+c+Fmm+Gmy+Hmk+Im+Jyy+Kyk+Ly+Mkk+Nk+255 - function convertToRgb(src, srcOffset, srcScale, dest, destOffset) { - var c = src[srcOffset + 0] * srcScale; - var m = src[srcOffset + 1] * srcScale; - var y = src[srcOffset + 2] * srcScale; - var k = src[srcOffset + 3] * srcScale; - - var r = - (c * (-4.387332384609988 * c + 54.48615194189176 * m + - 18.82290502165302 * y + 212.25662451639585 * k + - -285.2331026137004) + - m * (1.7149763477362134 * m - 5.6096736904047315 * y + - -17.873870861415444 * k - 5.497006427196366) + - y * (-2.5217340131683033 * y - 21.248923337353073 * k + - 17.5119270841813) + - k * (-21.86122147463605 * k - 189.48180835922747) + 255) | 0; - var g = - (c * (8.841041422036149 * c + 60.118027045597366 * m + - 6.871425592049007 * y + 31.159100130055922 * k + - -79.2970844816548) + - m * (-15.310361306967817 * m + 17.575251261109482 * y + - 131.35250912493976 * k - 190.9453302588951) + - y * (4.444339102852739 * y + 9.8632861493405 * k - 24.86741582555878) + - k * (-20.737325471181034 * k - 187.80453709719578) + 255) | 0; - var b = - (c * (0.8842522430003296 * c + 8.078677503112928 * m + - 30.89978309703729 * y - 0.23883238689178934 * k + - -14.183576799673286) + - m * (10.49593273432072 * m + 63.02378494754052 * y + - 50.606957656360734 * k - 112.23884253719248) + - y * (0.03296041114873217 * y + 115.60384449646641 * k + - -193.58209356861505) + - k * (-22.33816807309886 * k - 180.12613974708367) + 255) | 0; - - dest[destOffset] = r > 255 ? 255 : r < 0 ? 0 : r; - dest[destOffset + 1] = g > 255 ? 255 : g < 0 ? 0 : g; - dest[destOffset + 2] = b > 255 ? 255 : b < 0 ? 0 : b; - } - - function DeviceCmykCS() { - this.name = 'DeviceCMYK'; - this.numComps = 4; - this.defaultColor = new Float32Array([0, 0, 0, 1]); - } - DeviceCmykCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function DeviceCmykCS_getRgbItem(src, srcOffset, - dest, destOffset) { - convertToRgb(src, srcOffset, 1, dest, destOffset); - }, - getRgbBuffer: function DeviceCmykCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var scale = 1 / ((1 << bits) - 1); - for (var i = 0; i < count; i++) { - convertToRgb(src, srcOffset, scale, dest, destOffset); - srcOffset += 4; - destOffset += 3 + alpha01; - } - }, - getOutputLength: function DeviceCmykCS_getOutputLength(inputLength, - alpha01) { - return (inputLength / 4 * (3 + alpha01)) | 0; - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function DeviceCmykCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - - return DeviceCmykCS; -})(); - -// -// CalGrayCS: Based on "PDF Reference, Sixth Ed", p.245 -// -var CalGrayCS = (function CalGrayCSClosure() { - function CalGrayCS(whitePoint, blackPoint, gamma) { - this.name = 'CalGray'; - this.numComps = 1; - this.defaultColor = new Float32Array([0]); - - if (!whitePoint) { - error('WhitePoint missing - required for color space CalGray'); - } - blackPoint = blackPoint || [0, 0, 0]; - gamma = gamma || 1; - - // Translate arguments to spec variables. - this.XW = whitePoint[0]; - this.YW = whitePoint[1]; - this.ZW = whitePoint[2]; - - this.XB = blackPoint[0]; - this.YB = blackPoint[1]; - this.ZB = blackPoint[2]; - - this.G = gamma; - - // Validate variables as per spec. - if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { - error('Invalid WhitePoint components for ' + this.name + - ', no fallback available'); - } - - if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { - info('Invalid BlackPoint for ' + this.name + ', falling back to default'); - this.XB = this.YB = this.ZB = 0; - } - - if (this.XB !== 0 || this.YB !== 0 || this.ZB !== 0) { - warn(this.name + ', BlackPoint: XB: ' + this.XB + ', YB: ' + this.YB + - ', ZB: ' + this.ZB + ', only default values are supported.'); - } - - if (this.G < 1) { - info('Invalid Gamma: ' + this.G + ' for ' + this.name + - ', falling back to default'); - this.G = 1; - } - } - - function convertToRgb(cs, src, srcOffset, dest, destOffset, scale) { - // A represents a gray component of a calibrated gray space. - // A <---> AG in the spec - var A = src[srcOffset] * scale; - var AG = Math.pow(A, cs.G); - - // Computes L as per spec. ( = cs.YW * AG ) - // Except if other than default BlackPoint values are used. - var L = cs.YW * AG; - // http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html, Ch 4. - // Convert values to rgb range [0, 255]. - var val = Math.max(295.8 * Math.pow(L, 0.333333333333333333) - 40.8, 0) | 0; - dest[destOffset] = val; - dest[destOffset + 1] = val; - dest[destOffset + 2] = val; - } - - CalGrayCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function CalGrayCS_getRgbItem(src, srcOffset, - dest, destOffset) { - convertToRgb(this, src, srcOffset, dest, destOffset, 1); - }, - getRgbBuffer: function CalGrayCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var scale = 1 / ((1 << bits) - 1); - - for (var i = 0; i < count; ++i) { - convertToRgb(this, src, srcOffset, dest, destOffset, scale); - srcOffset += 1; - destOffset += 3 + alpha01; - } - }, - getOutputLength: function CalGrayCS_getOutputLength(inputLength, alpha01) { - return inputLength * (3 + alpha01); - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function CalGrayCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - return CalGrayCS; -})(); - -// -// CalRGBCS: Based on "PDF Reference, Sixth Ed", p.247 -// -var CalRGBCS = (function CalRGBCSClosure() { - - // See http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html for these - // matrices. - var BRADFORD_SCALE_MATRIX = new Float32Array([ - 0.8951, 0.2664, -0.1614, - -0.7502, 1.7135, 0.0367, - 0.0389, -0.0685, 1.0296]); - - var BRADFORD_SCALE_INVERSE_MATRIX = new Float32Array([ - 0.9869929, -0.1470543, 0.1599627, - 0.4323053, 0.5183603, 0.0492912, - -0.0085287, 0.0400428, 0.9684867]); - - // See http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html. - var SRGB_D65_XYZ_TO_RGB_MATRIX = new Float32Array([ - 3.2404542, -1.5371385, -0.4985314, - -0.9692660, 1.8760108, 0.0415560, - 0.0556434, -0.2040259, 1.0572252]); - - var FLAT_WHITEPOINT_MATRIX = new Float32Array([1, 1, 1]); - - var tempNormalizeMatrix = new Float32Array(3); - var tempConvertMatrix1 = new Float32Array(3); - var tempConvertMatrix2 = new Float32Array(3); - - var DECODE_L_CONSTANT = Math.pow(((8 + 16) / 116), 3) / 8.0; - - function CalRGBCS(whitePoint, blackPoint, gamma, matrix) { - this.name = 'CalRGB'; - this.numComps = 3; - this.defaultColor = new Float32Array(3); - - if (!whitePoint) { - error('WhitePoint missing - required for color space CalRGB'); - } - blackPoint = blackPoint || new Float32Array(3); - gamma = gamma || new Float32Array([1, 1, 1]); - matrix = matrix || new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]); - - // Translate arguments to spec variables. - var XW = whitePoint[0]; - var YW = whitePoint[1]; - var ZW = whitePoint[2]; - this.whitePoint = whitePoint; - - var XB = blackPoint[0]; - var YB = blackPoint[1]; - var ZB = blackPoint[2]; - this.blackPoint = blackPoint; - - this.GR = gamma[0]; - this.GG = gamma[1]; - this.GB = gamma[2]; - - this.MXA = matrix[0]; - this.MYA = matrix[1]; - this.MZA = matrix[2]; - this.MXB = matrix[3]; - this.MYB = matrix[4]; - this.MZB = matrix[5]; - this.MXC = matrix[6]; - this.MYC = matrix[7]; - this.MZC = matrix[8]; - - // Validate variables as per spec. - if (XW < 0 || ZW < 0 || YW !== 1) { - error('Invalid WhitePoint components for ' + this.name + - ', no fallback available'); - } - - if (XB < 0 || YB < 0 || ZB < 0) { - info('Invalid BlackPoint for ' + this.name + ' [' + XB + ', ' + YB + - ', ' + ZB + '], falling back to default'); - this.blackPoint = new Float32Array(3); - } - - if (this.GR < 0 || this.GG < 0 || this.GB < 0) { - info('Invalid Gamma [' + this.GR + ', ' + this.GG + ', ' + this.GB + - '] for ' + this.name + ', falling back to default'); - this.GR = this.GG = this.GB = 1; - } - - if (this.MXA < 0 || this.MYA < 0 || this.MZA < 0 || - this.MXB < 0 || this.MYB < 0 || this.MZB < 0 || - this.MXC < 0 || this.MYC < 0 || this.MZC < 0) { - info('Invalid Matrix for ' + this.name + ' [' + - this.MXA + ', ' + this.MYA + ', ' + this.MZA + - this.MXB + ', ' + this.MYB + ', ' + this.MZB + - this.MXC + ', ' + this.MYC + ', ' + this.MZC + - '], falling back to default'); - this.MXA = this.MYB = this.MZC = 1; - this.MXB = this.MYA = this.MZA = this.MXC = this.MYC = this.MZB = 0; - } - } - - function matrixProduct(a, b, result) { - result[0] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; - result[1] = a[3] * b[0] + a[4] * b[1] + a[5] * b[2]; - result[2] = a[6] * b[0] + a[7] * b[1] + a[8] * b[2]; - } - - function convertToFlat(sourceWhitePoint, LMS, result) { - result[0] = LMS[0] * 1 / sourceWhitePoint[0]; - result[1] = LMS[1] * 1 / sourceWhitePoint[1]; - result[2] = LMS[2] * 1 / sourceWhitePoint[2]; - } - - function convertToD65(sourceWhitePoint, LMS, result) { - var D65X = 0.95047; - var D65Y = 1; - var D65Z = 1.08883; - - result[0] = LMS[0] * D65X / sourceWhitePoint[0]; - result[1] = LMS[1] * D65Y / sourceWhitePoint[1]; - result[2] = LMS[2] * D65Z / sourceWhitePoint[2]; - } - - function sRGBTransferFunction(color) { - // See http://en.wikipedia.org/wiki/SRGB. - if (color <= 0.0031308){ - return adjustToRange(0, 1, 12.92 * color); - } - - return adjustToRange(0, 1, (1 + 0.055) * Math.pow(color, 1 / 2.4) - 0.055); - } - - function adjustToRange(min, max, value) { - return Math.max(min, Math.min(max, value)); - } - - function decodeL(L) { - if (L < 0) { - return -decodeL(-L); - } - - if (L > 8.0) { - return Math.pow(((L + 16) / 116), 3); - } - - return L * DECODE_L_CONSTANT; - } - - function compensateBlackPoint(sourceBlackPoint, XYZ_Flat, result) { - - // In case the blackPoint is already the default blackPoint then there is - // no need to do compensation. - if (sourceBlackPoint[0] === 0 && - sourceBlackPoint[1] === 0 && - sourceBlackPoint[2] === 0) { - result[0] = XYZ_Flat[0]; - result[1] = XYZ_Flat[1]; - result[2] = XYZ_Flat[2]; - return; - } - - // For the blackPoint calculation details, please see - // http://www.adobe.com/content/dam/Adobe/en/devnet/photoshop/sdk/ - // AdobeBPC.pdf. - // The destination blackPoint is the default blackPoint [0, 0, 0]. - var zeroDecodeL = decodeL(0); - - var X_DST = zeroDecodeL; - var X_SRC = decodeL(sourceBlackPoint[0]); - - var Y_DST = zeroDecodeL; - var Y_SRC = decodeL(sourceBlackPoint[1]); - - var Z_DST = zeroDecodeL; - var Z_SRC = decodeL(sourceBlackPoint[2]); - - var X_Scale = (1 - X_DST) / (1 - X_SRC); - var X_Offset = 1 - X_Scale; - - var Y_Scale = (1 - Y_DST) / (1 - Y_SRC); - var Y_Offset = 1 - Y_Scale; - - var Z_Scale = (1 - Z_DST) / (1 - Z_SRC); - var Z_Offset = 1 - Z_Scale; - - result[0] = XYZ_Flat[0] * X_Scale + X_Offset; - result[1] = XYZ_Flat[1] * Y_Scale + Y_Offset; - result[2] = XYZ_Flat[2] * Z_Scale + Z_Offset; - } - - function normalizeWhitePointToFlat(sourceWhitePoint, XYZ_In, result) { - - // In case the whitePoint is already flat then there is no need to do - // normalization. - if (sourceWhitePoint[0] === 1 && sourceWhitePoint[2] === 1) { - result[0] = XYZ_In[0]; - result[1] = XYZ_In[1]; - result[2] = XYZ_In[2]; - return; - } - - var LMS = result; - matrixProduct(BRADFORD_SCALE_MATRIX, XYZ_In, LMS); - - var LMS_Flat = tempNormalizeMatrix; - convertToFlat(sourceWhitePoint, LMS, LMS_Flat); - - matrixProduct(BRADFORD_SCALE_INVERSE_MATRIX, LMS_Flat, result); - } - - function normalizeWhitePointToD65(sourceWhitePoint, XYZ_In, result) { - - var LMS = result; - matrixProduct(BRADFORD_SCALE_MATRIX, XYZ_In, LMS); - - var LMS_D65 = tempNormalizeMatrix; - convertToD65(sourceWhitePoint, LMS, LMS_D65); - - matrixProduct(BRADFORD_SCALE_INVERSE_MATRIX, LMS_D65, result); - } - - function convertToRgb(cs, src, srcOffset, dest, destOffset, scale) { - // A, B and C represent a red, green and blue components of a calibrated - // rgb space. - var A = adjustToRange(0, 1, src[srcOffset] * scale); - var B = adjustToRange(0, 1, src[srcOffset + 1] * scale); - var C = adjustToRange(0, 1, src[srcOffset + 2] * scale); - - // A <---> AGR in the spec - // B <---> BGG in the spec - // C <---> CGB in the spec - var AGR = Math.pow(A, cs.GR); - var BGG = Math.pow(B, cs.GG); - var CGB = Math.pow(C, cs.GB); - - // Computes intermediate variables L, M, N as per spec. - // To decode X, Y, Z values map L, M, N directly to them. - var X = cs.MXA * AGR + cs.MXB * BGG + cs.MXC * CGB; - var Y = cs.MYA * AGR + cs.MYB * BGG + cs.MYC * CGB; - var Z = cs.MZA * AGR + cs.MZB * BGG + cs.MZC * CGB; - - // The following calculations are based on this document: - // http://www.adobe.com/content/dam/Adobe/en/devnet/photoshop/sdk/ - // AdobeBPC.pdf. - var XYZ = tempConvertMatrix1; - XYZ[0] = X; - XYZ[1] = Y; - XYZ[2] = Z; - var XYZ_Flat = tempConvertMatrix2; - - normalizeWhitePointToFlat(cs.whitePoint, XYZ, XYZ_Flat); - - var XYZ_Black = tempConvertMatrix1; - compensateBlackPoint(cs.blackPoint, XYZ_Flat, XYZ_Black); - - var XYZ_D65 = tempConvertMatrix2; - normalizeWhitePointToD65(FLAT_WHITEPOINT_MATRIX, XYZ_Black, XYZ_D65); - - var SRGB = tempConvertMatrix1; - matrixProduct(SRGB_D65_XYZ_TO_RGB_MATRIX, XYZ_D65, SRGB); - - var sR = sRGBTransferFunction(SRGB[0]); - var sG = sRGBTransferFunction(SRGB[1]); - var sB = sRGBTransferFunction(SRGB[2]); - - // Convert the values to rgb range [0, 255]. - dest[destOffset] = Math.round(sR * 255); - dest[destOffset + 1] = Math.round(sG * 255); - dest[destOffset + 2] = Math.round(sB * 255); - } - - CalRGBCS.prototype = { - getRgb: function CalRGBCS_getRgb(src, srcOffset) { - var rgb = new Uint8Array(3); - this.getRgbItem(src, srcOffset, rgb, 0); - return rgb; - }, - getRgbItem: function CalRGBCS_getRgbItem(src, srcOffset, - dest, destOffset) { - convertToRgb(this, src, srcOffset, dest, destOffset, 1); - }, - getRgbBuffer: function CalRGBCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var scale = 1 / ((1 << bits) - 1); - - for (var i = 0; i < count; ++i) { - convertToRgb(this, src, srcOffset, dest, destOffset, scale); - srcOffset += 3; - destOffset += 3 + alpha01; - } - }, - getOutputLength: function CalRGBCS_getOutputLength(inputLength, alpha01) { - return (inputLength * (3 + alpha01) / 3) | 0; - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function CalRGBCS_isDefaultDecode(decodeMap) { - return ColorSpace.isDefaultDecode(decodeMap, this.numComps); - }, - usesZeroToOneRange: true - }; - return CalRGBCS; -})(); - -// -// LabCS: Based on "PDF Reference, Sixth Ed", p.250 -// -var LabCS = (function LabCSClosure() { - function LabCS(whitePoint, blackPoint, range) { - this.name = 'Lab'; - this.numComps = 3; - this.defaultColor = new Float32Array([0, 0, 0]); - - if (!whitePoint) { - error('WhitePoint missing - required for color space Lab'); - } - blackPoint = blackPoint || [0, 0, 0]; - range = range || [-100, 100, -100, 100]; - - // Translate args to spec variables - this.XW = whitePoint[0]; - this.YW = whitePoint[1]; - this.ZW = whitePoint[2]; - this.amin = range[0]; - this.amax = range[1]; - this.bmin = range[2]; - this.bmax = range[3]; - - // These are here just for completeness - the spec doesn't offer any - // formulas that use BlackPoint in Lab - this.XB = blackPoint[0]; - this.YB = blackPoint[1]; - this.ZB = blackPoint[2]; - - // Validate vars as per spec - if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { - error('Invalid WhitePoint components, no fallback available'); - } - - if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { - info('Invalid BlackPoint, falling back to default'); - this.XB = this.YB = this.ZB = 0; - } - - if (this.amin > this.amax || this.bmin > this.bmax) { - info('Invalid Range, falling back to defaults'); - this.amin = -100; - this.amax = 100; - this.bmin = -100; - this.bmax = 100; - } - } - - // Function g(x) from spec - function fn_g(x) { - if (x >= 6 / 29) { - return x * x * x; - } else { - return (108 / 841) * (x - 4 / 29); - } - } - - function decode(value, high1, low2, high2) { - return low2 + (value) * (high2 - low2) / (high1); - } - - // If decoding is needed maxVal should be 2^bits per component - 1. - function convertToRgb(cs, src, srcOffset, maxVal, dest, destOffset) { - // XXX: Lab input is in the range of [0, 100], [amin, amax], [bmin, bmax] - // not the usual [0, 1]. If a command like setFillColor is used the src - // values will already be within the correct range. However, if we are - // converting an image we have to map the values to the correct range given - // above. - // Ls,as,bs <---> L*,a*,b* in the spec - var Ls = src[srcOffset]; - var as = src[srcOffset + 1]; - var bs = src[srcOffset + 2]; - if (maxVal !== false) { - Ls = decode(Ls, maxVal, 0, 100); - as = decode(as, maxVal, cs.amin, cs.amax); - bs = decode(bs, maxVal, cs.bmin, cs.bmax); - } - - // Adjust limits of 'as' and 'bs' - as = as > cs.amax ? cs.amax : as < cs.amin ? cs.amin : as; - bs = bs > cs.bmax ? cs.bmax : bs < cs.bmin ? cs.bmin : bs; - - // Computes intermediate variables X,Y,Z as per spec - var M = (Ls + 16) / 116; - var L = M + (as / 500); - var N = M - (bs / 200); - - var X = cs.XW * fn_g(L); - var Y = cs.YW * fn_g(M); - var Z = cs.ZW * fn_g(N); - - var r, g, b; - // Using different conversions for D50 and D65 white points, - // per http://www.color.org/srgb.pdf - if (cs.ZW < 1) { - // Assuming D50 (X=0.9642, Y=1.00, Z=0.8249) - r = X * 3.1339 + Y * -1.6170 + Z * -0.4906; - g = X * -0.9785 + Y * 1.9160 + Z * 0.0333; - b = X * 0.0720 + Y * -0.2290 + Z * 1.4057; - } else { - // Assuming D65 (X=0.9505, Y=1.00, Z=1.0888) - r = X * 3.2406 + Y * -1.5372 + Z * -0.4986; - g = X * -0.9689 + Y * 1.8758 + Z * 0.0415; - b = X * 0.0557 + Y * -0.2040 + Z * 1.0570; - } - // clamp color values to [0,1] range then convert to [0,255] range. - dest[destOffset] = r <= 0 ? 0 : r >= 1 ? 255 : Math.sqrt(r) * 255 | 0; - dest[destOffset + 1] = g <= 0 ? 0 : g >= 1 ? 255 : Math.sqrt(g) * 255 | 0; - dest[destOffset + 2] = b <= 0 ? 0 : b >= 1 ? 255 : Math.sqrt(b) * 255 | 0; - } - - LabCS.prototype = { - getRgb: ColorSpace.prototype.getRgb, - getRgbItem: function LabCS_getRgbItem(src, srcOffset, dest, destOffset) { - convertToRgb(this, src, srcOffset, false, dest, destOffset); - }, - getRgbBuffer: function LabCS_getRgbBuffer(src, srcOffset, count, - dest, destOffset, bits, - alpha01) { - var maxVal = (1 << bits) - 1; - for (var i = 0; i < count; i++) { - convertToRgb(this, src, srcOffset, maxVal, dest, destOffset); - srcOffset += 3; - destOffset += 3 + alpha01; - } - }, - getOutputLength: function LabCS_getOutputLength(inputLength, alpha01) { - return (inputLength * (3 + alpha01) / 3) | 0; - }, - isPassthrough: ColorSpace.prototype.isPassthrough, - fillRgb: ColorSpace.prototype.fillRgb, - isDefaultDecode: function LabCS_isDefaultDecode(decodeMap) { - // XXX: Decoding is handled with the lab conversion because of the strange - // ranges that are used. - return true; - }, - usesZeroToOneRange: false - }; - return LabCS; -})(); - -exports.ColorSpace = ColorSpace; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreImage = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreColorSpace, root.pdfjsCoreStream, - root.pdfjsCoreJpx); - } -}(this, function (exports, sharedUtil, corePrimitives, coreColorSpace, - coreStream, coreJpx) { - -var ImageKind = sharedUtil.ImageKind; -var assert = sharedUtil.assert; -var error = sharedUtil.error; -var info = sharedUtil.info; -var isArray = sharedUtil.isArray; -var warn = sharedUtil.warn; -var Name = corePrimitives.Name; -var isStream = corePrimitives.isStream; -var ColorSpace = coreColorSpace.ColorSpace; -var DecodeStream = coreStream.DecodeStream; -var JpegStream = coreStream.JpegStream; -var JpxImage = coreJpx.JpxImage; - -var PDFImage = (function PDFImageClosure() { - /** - * Decodes the image using native decoder if possible. Resolves the promise - * when the image data is ready. - */ - function handleImageData(image, nativeDecoder) { - if (nativeDecoder && nativeDecoder.canDecode(image)) { - return nativeDecoder.decode(image); - } else { - return Promise.resolve(image); - } - } - - /** - * Decode and clamp a value. The formula is different from the spec because we - * don't decode to float range [0,1], we decode it in the [0,max] range. - */ - function decodeAndClamp(value, addend, coefficient, max) { - value = addend + value * coefficient; - // Clamp the value to the range - return (value < 0 ? 0 : (value > max ? max : value)); - } - - /** - * Resizes an image mask with 1 component. - * @param {TypedArray} src - The source buffer. - * @param {Number} bpc - Number of bits per component. - * @param {Number} w1 - Original width. - * @param {Number} h1 - Original height. - * @param {Number} w2 - New width. - * @param {Number} h2 - New height. - * @returns {TypedArray} The resized image mask buffer. - */ - function resizeImageMask(src, bpc, w1, h1, w2, h2) { - var length = w2 * h2; - var dest = (bpc <= 8 ? new Uint8Array(length) : - (bpc <= 16 ? new Uint16Array(length) : new Uint32Array(length))); - var xRatio = w1 / w2; - var yRatio = h1 / h2; - var i, j, py, newIndex = 0, oldIndex; - var xScaled = new Uint16Array(w2); - var w1Scanline = w1; - - for (i = 0; i < w2; i++) { - xScaled[i] = Math.floor(i * xRatio); - } - for (i = 0; i < h2; i++) { - py = Math.floor(i * yRatio) * w1Scanline; - for (j = 0; j < w2; j++) { - oldIndex = py + xScaled[j]; - dest[newIndex++] = src[oldIndex]; - } - } - return dest; - } - - function PDFImage(xref, res, image, inline, smask, mask, isMask) { - this.image = image; - var dict = image.dict; - if (dict.has('Filter')) { - var filter = dict.get('Filter').name; - if (filter === 'JPXDecode') { - var jpxImage = new JpxImage(); - jpxImage.parseImageProperties(image.stream); - image.stream.reset(); - image.bitsPerComponent = jpxImage.bitsPerComponent; - image.numComps = jpxImage.componentsCount; - } else if (filter === 'JBIG2Decode') { - image.bitsPerComponent = 1; - image.numComps = 1; - } - } - // TODO cache rendered images? - - this.width = dict.get('Width', 'W'); - this.height = dict.get('Height', 'H'); - - if (this.width < 1 || this.height < 1) { - error('Invalid image width: ' + this.width + ' or height: ' + - this.height); - } - - this.interpolate = dict.get('Interpolate', 'I') || false; - this.imageMask = dict.get('ImageMask', 'IM') || false; - this.matte = dict.get('Matte') || false; - - var bitsPerComponent = image.bitsPerComponent; - if (!bitsPerComponent) { - bitsPerComponent = dict.get('BitsPerComponent', 'BPC'); - if (!bitsPerComponent) { - if (this.imageMask) { - bitsPerComponent = 1; - } else { - error('Bits per component missing in image: ' + this.imageMask); - } - } - } - this.bpc = bitsPerComponent; - - if (!this.imageMask) { - var colorSpace = dict.get('ColorSpace', 'CS'); - if (!colorSpace) { - info('JPX images (which do not require color spaces)'); - switch (image.numComps) { - case 1: - colorSpace = Name.get('DeviceGray'); - break; - case 3: - colorSpace = Name.get('DeviceRGB'); - break; - case 4: - colorSpace = Name.get('DeviceCMYK'); - break; - default: - error('JPX images with ' + this.numComps + - ' color components not supported.'); - } - } - this.colorSpace = ColorSpace.parse(colorSpace, xref, res); - this.numComps = this.colorSpace.numComps; - } - - this.decode = dict.getArray('Decode', 'D'); - this.needsDecode = false; - if (this.decode && - ((this.colorSpace && !this.colorSpace.isDefaultDecode(this.decode)) || - (isMask && !ColorSpace.isDefaultDecode(this.decode, 1)))) { - this.needsDecode = true; - // Do some preprocessing to avoid more math. - var max = (1 << bitsPerComponent) - 1; - this.decodeCoefficients = []; - this.decodeAddends = []; - for (var i = 0, j = 0; i < this.decode.length; i += 2, ++j) { - var dmin = this.decode[i]; - var dmax = this.decode[i + 1]; - this.decodeCoefficients[j] = dmax - dmin; - this.decodeAddends[j] = max * dmin; - } - } - - if (smask) { - this.smask = new PDFImage(xref, res, smask, false); - } else if (mask) { - if (isStream(mask)) { - var maskDict = mask.dict, imageMask = maskDict.get('ImageMask', 'IM'); - if (!imageMask) { - warn('Ignoring /Mask in image without /ImageMask.'); - } else { - this.mask = new PDFImage(xref, res, mask, false, null, null, true); - } - } else { - // Color key mask (just an array). - this.mask = mask; - } - } - } - /** - * Handles processing of image data and returns the Promise that is resolved - * with a PDFImage when the image is ready to be used. - */ - PDFImage.buildImage = function PDFImage_buildImage(handler, xref, - res, image, inline, - nativeDecoder) { - var imagePromise = handleImageData(image, nativeDecoder); - var smaskPromise; - var maskPromise; - - var smask = image.dict.get('SMask'); - var mask = image.dict.get('Mask'); - - if (smask) { - smaskPromise = handleImageData(smask, nativeDecoder); - maskPromise = Promise.resolve(null); - } else { - smaskPromise = Promise.resolve(null); - if (mask) { - if (isStream(mask)) { - maskPromise = handleImageData(mask, nativeDecoder); - } else if (isArray(mask)) { - maskPromise = Promise.resolve(mask); - } else { - warn('Unsupported mask format.'); - maskPromise = Promise.resolve(null); - } - } else { - maskPromise = Promise.resolve(null); - } - } - return Promise.all([imagePromise, smaskPromise, maskPromise]).then( - function(results) { - var imageData = results[0]; - var smaskData = results[1]; - var maskData = results[2]; - return new PDFImage(xref, res, imageData, inline, smaskData, maskData); - }); - }; - - PDFImage.createMask = - function PDFImage_createMask(imgArray, width, height, - imageIsFromDecodeStream, inverseDecode) { - - // |imgArray| might not contain full data for every pixel of the mask, so - // we need to distinguish between |computedLength| and |actualLength|. - // In particular, if inverseDecode is true, then the array we return must - // have a length of |computedLength|. - - var computedLength = ((width + 7) >> 3) * height; - var actualLength = imgArray.byteLength; - var haveFullData = computedLength === actualLength; - var data, i; - - if (imageIsFromDecodeStream && (!inverseDecode || haveFullData)) { - // imgArray came from a DecodeStream and its data is in an appropriate - // form, so we can just transfer it. - data = imgArray; - } else if (!inverseDecode) { - data = new Uint8Array(actualLength); - data.set(imgArray); - } else { - data = new Uint8Array(computedLength); - data.set(imgArray); - for (i = actualLength; i < computedLength; i++) { - data[i] = 0xff; - } - } - - // If necessary, invert the original mask data (but not any extra we might - // have added above). It's safe to modify the array -- whether it's the - // original or a copy, we're about to transfer it anyway, so nothing else - // in this thread can be relying on its contents. - if (inverseDecode) { - for (i = 0; i < actualLength; i++) { - data[i] = ~data[i]; - } - } - - return {data: data, width: width, height: height}; - }; - - PDFImage.prototype = { - get drawWidth() { - return Math.max(this.width, - this.smask && this.smask.width || 0, - this.mask && this.mask.width || 0); - }, - - get drawHeight() { - return Math.max(this.height, - this.smask && this.smask.height || 0, - this.mask && this.mask.height || 0); - }, - - decodeBuffer: function PDFImage_decodeBuffer(buffer) { - var bpc = this.bpc; - var numComps = this.numComps; - - var decodeAddends = this.decodeAddends; - var decodeCoefficients = this.decodeCoefficients; - var max = (1 << bpc) - 1; - var i, ii; - - if (bpc === 1) { - // If the buffer needed decode that means it just needs to be inverted. - for (i = 0, ii = buffer.length; i < ii; i++) { - buffer[i] = +!(buffer[i]); - } - return; - } - var index = 0; - for (i = 0, ii = this.width * this.height; i < ii; i++) { - for (var j = 0; j < numComps; j++) { - buffer[index] = decodeAndClamp(buffer[index], decodeAddends[j], - decodeCoefficients[j], max); - index++; - } - } - }, - - getComponents: function PDFImage_getComponents(buffer) { - var bpc = this.bpc; - - // This image doesn't require any extra work. - if (bpc === 8) { - return buffer; - } - - var width = this.width; - var height = this.height; - var numComps = this.numComps; - - var length = width * height * numComps; - var bufferPos = 0; - var output = (bpc <= 8 ? new Uint8Array(length) : - (bpc <= 16 ? new Uint16Array(length) : new Uint32Array(length))); - var rowComps = width * numComps; - - var max = (1 << bpc) - 1; - var i = 0, ii, buf; - - if (bpc === 1) { - // Optimization for reading 1 bpc images. - var mask, loop1End, loop2End; - for (var j = 0; j < height; j++) { - loop1End = i + (rowComps & ~7); - loop2End = i + rowComps; - - // unroll loop for all full bytes - while (i < loop1End) { - buf = buffer[bufferPos++]; - output[i] = (buf >> 7) & 1; - output[i + 1] = (buf >> 6) & 1; - output[i + 2] = (buf >> 5) & 1; - output[i + 3] = (buf >> 4) & 1; - output[i + 4] = (buf >> 3) & 1; - output[i + 5] = (buf >> 2) & 1; - output[i + 6] = (buf >> 1) & 1; - output[i + 7] = buf & 1; - i += 8; - } - - // handle remaining bits - if (i < loop2End) { - buf = buffer[bufferPos++]; - mask = 128; - while (i < loop2End) { - output[i++] = +!!(buf & mask); - mask >>= 1; - } - } - } - } else { - // The general case that handles all other bpc values. - var bits = 0; - buf = 0; - for (i = 0, ii = length; i < ii; ++i) { - if (i % rowComps === 0) { - buf = 0; - bits = 0; - } - - while (bits < bpc) { - buf = (buf << 8) | buffer[bufferPos++]; - bits += 8; - } - - var remainingBits = bits - bpc; - var value = buf >> remainingBits; - output[i] = (value < 0 ? 0 : (value > max ? max : value)); - buf = buf & ((1 << remainingBits) - 1); - bits = remainingBits; - } - } - return output; - }, - - fillOpacity: function PDFImage_fillOpacity(rgbaBuf, width, height, - actualHeight, image) { - var smask = this.smask; - var mask = this.mask; - var alphaBuf, sw, sh, i, ii, j; - - if (smask) { - sw = smask.width; - sh = smask.height; - alphaBuf = new Uint8Array(sw * sh); - smask.fillGrayBuffer(alphaBuf); - if (sw !== width || sh !== height) { - alphaBuf = resizeImageMask(alphaBuf, smask.bpc, sw, sh, - width, height); - } - } else if (mask) { - if (mask instanceof PDFImage) { - sw = mask.width; - sh = mask.height; - alphaBuf = new Uint8Array(sw * sh); - mask.numComps = 1; - mask.fillGrayBuffer(alphaBuf); - - // Need to invert values in rgbaBuf - for (i = 0, ii = sw * sh; i < ii; ++i) { - alphaBuf[i] = 255 - alphaBuf[i]; - } - - if (sw !== width || sh !== height) { - alphaBuf = resizeImageMask(alphaBuf, mask.bpc, sw, sh, - width, height); - } - } else if (isArray(mask)) { - // Color key mask: if any of the components are outside the range - // then they should be painted. - alphaBuf = new Uint8Array(width * height); - var numComps = this.numComps; - for (i = 0, ii = width * height; i < ii; ++i) { - var opacity = 0; - var imageOffset = i * numComps; - for (j = 0; j < numComps; ++j) { - var color = image[imageOffset + j]; - var maskOffset = j * 2; - if (color < mask[maskOffset] || color > mask[maskOffset + 1]) { - opacity = 255; - break; - } - } - alphaBuf[i] = opacity; - } - } else { - error('Unknown mask format.'); - } - } - - if (alphaBuf) { - for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { - rgbaBuf[j] = alphaBuf[i]; - } - } else { - // No mask. - for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { - rgbaBuf[j] = 255; - } - } - }, - - undoPreblend: function PDFImage_undoPreblend(buffer, width, height) { - var matte = this.smask && this.smask.matte; - if (!matte) { - return; - } - var matteRgb = this.colorSpace.getRgb(matte, 0); - var matteR = matteRgb[0]; - var matteG = matteRgb[1]; - var matteB = matteRgb[2]; - var length = width * height * 4; - var r, g, b; - for (var i = 0; i < length; i += 4) { - var alpha = buffer[i + 3]; - if (alpha === 0) { - // according formula we have to get Infinity in all components - // making it white (typical paper color) should be okay - buffer[i] = 255; - buffer[i + 1] = 255; - buffer[i + 2] = 255; - continue; - } - var k = 255 / alpha; - r = (buffer[i] - matteR) * k + matteR; - g = (buffer[i + 1] - matteG) * k + matteG; - b = (buffer[i + 2] - matteB) * k + matteB; - buffer[i] = r <= 0 ? 0 : r >= 255 ? 255 : r | 0; - buffer[i + 1] = g <= 0 ? 0 : g >= 255 ? 255 : g | 0; - buffer[i + 2] = b <= 0 ? 0 : b >= 255 ? 255 : b | 0; - } - }, - - createImageData: function PDFImage_createImageData(forceRGBA) { - var drawWidth = this.drawWidth; - var drawHeight = this.drawHeight; - var imgData = { // other fields are filled in below - width: drawWidth, - height: drawHeight - }; - - var numComps = this.numComps; - var originalWidth = this.width; - var originalHeight = this.height; - var bpc = this.bpc; - - // Rows start at byte boundary. - var rowBytes = (originalWidth * numComps * bpc + 7) >> 3; - var imgArray; - - if (!forceRGBA) { - // If it is a 1-bit-per-pixel grayscale (i.e. black-and-white) image - // without any complications, we pass a same-sized copy to the main - // thread rather than expanding by 32x to RGBA form. This saves *lots* - // of memory for many scanned documents. It's also much faster. - // - // Similarly, if it is a 24-bit-per pixel RGB image without any - // complications, we avoid expanding by 1.333x to RGBA form. - var kind; - if (this.colorSpace.name === 'DeviceGray' && bpc === 1) { - kind = ImageKind.GRAYSCALE_1BPP; - } else if (this.colorSpace.name === 'DeviceRGB' && bpc === 8 && - !this.needsDecode) { - kind = ImageKind.RGB_24BPP; - } - if (kind && !this.smask && !this.mask && - drawWidth === originalWidth && drawHeight === originalHeight) { - imgData.kind = kind; - - imgArray = this.getImageBytes(originalHeight * rowBytes); - // If imgArray came from a DecodeStream, we're safe to transfer it - // (and thus detach its underlying buffer) because it will constitute - // the entire DecodeStream's data. But if it came from a Stream, we - // need to copy it because it'll only be a portion of the Stream's - // data, and the rest will be read later on. - if (this.image instanceof DecodeStream) { - imgData.data = imgArray; - } else { - var newArray = new Uint8Array(imgArray.length); - newArray.set(imgArray); - imgData.data = newArray; - } - if (this.needsDecode) { - // Invert the buffer (which must be grayscale if we reached here). - assert(kind === ImageKind.GRAYSCALE_1BPP); - var buffer = imgData.data; - for (var i = 0, ii = buffer.length; i < ii; i++) { - buffer[i] ^= 0xff; - } - } - return imgData; - } - if (this.image instanceof JpegStream && !this.smask && !this.mask && - (this.colorSpace.name === 'DeviceGray' || - this.colorSpace.name === 'DeviceRGB' || - this.colorSpace.name === 'DeviceCMYK')) { - imgData.kind = ImageKind.RGB_24BPP; - imgData.data = this.getImageBytes(originalHeight * rowBytes, - drawWidth, drawHeight, true); - return imgData; - } - } - - imgArray = this.getImageBytes(originalHeight * rowBytes); - // imgArray can be incomplete (e.g. after CCITT fax encoding). - var actualHeight = 0 | (imgArray.length / rowBytes * - drawHeight / originalHeight); - - var comps = this.getComponents(imgArray); - - // If opacity data is present, use RGBA_32BPP form. Otherwise, use the - // more compact RGB_24BPP form if allowable. - var alpha01, maybeUndoPreblend; - if (!forceRGBA && !this.smask && !this.mask) { - imgData.kind = ImageKind.RGB_24BPP; - imgData.data = new Uint8Array(drawWidth * drawHeight * 3); - alpha01 = 0; - maybeUndoPreblend = false; - } else { - imgData.kind = ImageKind.RGBA_32BPP; - imgData.data = new Uint8Array(drawWidth * drawHeight * 4); - alpha01 = 1; - maybeUndoPreblend = true; - - // Color key masking (opacity) must be performed before decoding. - this.fillOpacity(imgData.data, drawWidth, drawHeight, actualHeight, - comps); - } - - if (this.needsDecode) { - this.decodeBuffer(comps); - } - this.colorSpace.fillRgb(imgData.data, originalWidth, originalHeight, - drawWidth, drawHeight, actualHeight, bpc, comps, - alpha01); - if (maybeUndoPreblend) { - this.undoPreblend(imgData.data, drawWidth, actualHeight); - } - - return imgData; - }, - - fillGrayBuffer: function PDFImage_fillGrayBuffer(buffer) { - var numComps = this.numComps; - if (numComps !== 1) { - error('Reading gray scale from a color image: ' + numComps); - } - - var width = this.width; - var height = this.height; - var bpc = this.bpc; - - // rows start at byte boundary - var rowBytes = (width * numComps * bpc + 7) >> 3; - var imgArray = this.getImageBytes(height * rowBytes); - - var comps = this.getComponents(imgArray); - var i, length; - - if (bpc === 1) { - // inline decoding (= inversion) for 1 bpc images - length = width * height; - if (this.needsDecode) { - // invert and scale to {0, 255} - for (i = 0; i < length; ++i) { - buffer[i] = (comps[i] - 1) & 255; - } - } else { - // scale to {0, 255} - for (i = 0; i < length; ++i) { - buffer[i] = (-comps[i]) & 255; - } - } - return; - } - - if (this.needsDecode) { - this.decodeBuffer(comps); - } - length = width * height; - // we aren't using a colorspace so we need to scale the value - var scale = 255 / ((1 << bpc) - 1); - for (i = 0; i < length; ++i) { - buffer[i] = (scale * comps[i]) | 0; - } - }, - - getImageBytes: function PDFImage_getImageBytes(length, - drawWidth, drawHeight, - forceRGB) { - this.image.reset(); - this.image.drawWidth = drawWidth || this.width; - this.image.drawHeight = drawHeight || this.height; - this.image.forceRGB = !!forceRGB; - return this.image.getBytes(length); - } - }; - return PDFImage; -})(); - -exports.PDFImage = PDFImage; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreObj = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreCrypto, root.pdfjsCoreParser, - root.pdfjsCoreChunkedStream, root.pdfjsCoreColorSpace); - } -}(this, function (exports, sharedUtil, corePrimitives, coreCrypto, coreParser, - coreChunkedStream, coreColorSpace) { - -var InvalidPDFException = sharedUtil.InvalidPDFException; -var MissingDataException = sharedUtil.MissingDataException; -var XRefParseException = sharedUtil.XRefParseException; -var assert = sharedUtil.assert; -var bytesToString = sharedUtil.bytesToString; -var createPromiseCapability = sharedUtil.createPromiseCapability; -var error = sharedUtil.error; -var info = sharedUtil.info; -var isArray = sharedUtil.isArray; -var isInt = sharedUtil.isInt; -var isString = sharedUtil.isString; -var shadow = sharedUtil.shadow; -var stringToPDFString = sharedUtil.stringToPDFString; -var stringToUTF8String = sharedUtil.stringToUTF8String; -var warn = sharedUtil.warn; -var isValidUrl = sharedUtil.isValidUrl; -var Util = sharedUtil.Util; -var Ref = corePrimitives.Ref; -var RefSet = corePrimitives.RefSet; -var RefSetCache = corePrimitives.RefSetCache; -var isName = corePrimitives.isName; -var isCmd = corePrimitives.isCmd; -var isDict = corePrimitives.isDict; -var isRef = corePrimitives.isRef; -var isRefsEqual = corePrimitives.isRefsEqual; -var isStream = corePrimitives.isStream; -var CipherTransformFactory = coreCrypto.CipherTransformFactory; -var Lexer = coreParser.Lexer; -var Parser = coreParser.Parser; -var ChunkedStream = coreChunkedStream.ChunkedStream; -var ColorSpace = coreColorSpace.ColorSpace; - -var Catalog = (function CatalogClosure() { - function Catalog(pdfManager, xref, pageFactory) { - this.pdfManager = pdfManager; - this.xref = xref; - this.catDict = xref.getCatalogObj(); - this.fontCache = new RefSetCache(); - assert(isDict(this.catDict), - 'catalog object is not a dictionary'); - - // TODO refactor to move getPage() to the PDFDocument. - this.pageFactory = pageFactory; - this.pagePromises = []; - } - - Catalog.prototype = { - get metadata() { - var streamRef = this.catDict.getRaw('Metadata'); - if (!isRef(streamRef)) { - return shadow(this, 'metadata', null); - } - - var encryptMetadata = (!this.xref.encrypt ? false : - this.xref.encrypt.encryptMetadata); - - var stream = this.xref.fetch(streamRef, !encryptMetadata); - var metadata; - if (stream && isDict(stream.dict)) { - var type = stream.dict.get('Type'); - var subtype = stream.dict.get('Subtype'); - - if (isName(type, 'Metadata') && isName(subtype, 'XML')) { - // XXX: This should examine the charset the XML document defines, - // however since there are currently no real means to decode - // arbitrary charsets, let's just hope that the author of the PDF - // was reasonable enough to stick with the XML default charset, - // which is UTF-8. - try { - metadata = stringToUTF8String(bytesToString(stream.getBytes())); - } catch (e) { - info('Skipping invalid metadata.'); - } - } - } - - return shadow(this, 'metadata', metadata); - }, - get toplevelPagesDict() { - var pagesObj = this.catDict.get('Pages'); - assert(isDict(pagesObj), 'invalid top-level pages dictionary'); - // shadow the prototype getter - return shadow(this, 'toplevelPagesDict', pagesObj); - }, - get documentOutline() { - var obj = null; - try { - obj = this.readDocumentOutline(); - } catch (ex) { - if (ex instanceof MissingDataException) { - throw ex; - } - warn('Unable to read document outline'); - } - return shadow(this, 'documentOutline', obj); - }, - readDocumentOutline: function Catalog_readDocumentOutline() { - var obj = this.catDict.get('Outlines'); - if (!isDict(obj)) { - return null; - } - obj = obj.getRaw('First'); - if (!isRef(obj)) { - return null; - } - var root = { items: [] }; - var queue = [{obj: obj, parent: root}]; - // To avoid recursion, keep track of the already processed items. - var processed = new RefSet(); - processed.put(obj); - var xref = this.xref, blackColor = new Uint8Array(3); - - while (queue.length > 0) { - var i = queue.shift(); - var outlineDict = xref.fetchIfRef(i.obj); - if (outlineDict === null) { - continue; - } - assert(outlineDict.has('Title'), 'Invalid outline item'); - - var actionDict = outlineDict.get('A'), dest = null, url = null; - if (actionDict) { - var destEntry = actionDict.get('D'); - if (destEntry) { - dest = destEntry; - } else { - var uriEntry = actionDict.get('URI'); - if (isString(uriEntry) && isValidUrl(uriEntry, false)) { - url = uriEntry; - } - } - } else if (outlineDict.has('Dest')) { - dest = outlineDict.getRaw('Dest'); - if (isName(dest)) { - dest = dest.name; - } - } - var title = outlineDict.get('Title'); - var flags = outlineDict.get('F') || 0; - - var color = outlineDict.getArray('C'), rgbColor = blackColor; - // We only need to parse the color when it's valid, and non-default. - if (isArray(color) && color.length === 3 && - (color[0] !== 0 || color[1] !== 0 || color[2] !== 0)) { - rgbColor = ColorSpace.singletons.rgb.getRgb(color, 0); - } - var outlineItem = { - dest: dest, - url: url, - title: stringToPDFString(title), - color: rgbColor, - count: outlineDict.get('Count'), - bold: !!(flags & 2), - italic: !!(flags & 1), - items: [] - }; - i.parent.items.push(outlineItem); - obj = outlineDict.getRaw('First'); - if (isRef(obj) && !processed.has(obj)) { - queue.push({obj: obj, parent: outlineItem}); - processed.put(obj); - } - obj = outlineDict.getRaw('Next'); - if (isRef(obj) && !processed.has(obj)) { - queue.push({obj: obj, parent: i.parent}); - processed.put(obj); - } - } - return (root.items.length > 0 ? root.items : null); - }, - get numPages() { - var obj = this.toplevelPagesDict.get('Count'); - assert( - isInt(obj), - 'page count in top level pages object is not an integer' - ); - // shadow the prototype getter - return shadow(this, 'num', obj); - }, - get destinations() { - function fetchDestination(dest) { - return isDict(dest) ? dest.get('D') : dest; - } - - var xref = this.xref; - var dests = {}, nameTreeRef, nameDictionaryRef; - var obj = this.catDict.get('Names'); - if (obj && obj.has('Dests')) { - nameTreeRef = obj.getRaw('Dests'); - } else if (this.catDict.has('Dests')) { - nameDictionaryRef = this.catDict.get('Dests'); - } - - if (nameDictionaryRef) { - // reading simple destination dictionary - obj = nameDictionaryRef; - obj.forEach(function catalogForEach(key, value) { - if (!value) { - return; - } - dests[key] = fetchDestination(value); - }); - } - if (nameTreeRef) { - var nameTree = new NameTree(nameTreeRef, xref); - var names = nameTree.getAll(); - for (var name in names) { - dests[name] = fetchDestination(names[name]); - } - } - return shadow(this, 'destinations', dests); - }, - getDestination: function Catalog_getDestination(destinationId) { - function fetchDestination(dest) { - return isDict(dest) ? dest.get('D') : dest; - } - - var xref = this.xref; - var dest = null, nameTreeRef, nameDictionaryRef; - var obj = this.catDict.get('Names'); - if (obj && obj.has('Dests')) { - nameTreeRef = obj.getRaw('Dests'); - } else if (this.catDict.has('Dests')) { - nameDictionaryRef = this.catDict.get('Dests'); - } - - if (nameDictionaryRef) { // Simple destination dictionary. - var value = nameDictionaryRef.get(destinationId); - if (value) { - dest = fetchDestination(value); - } - } - if (nameTreeRef) { - var nameTree = new NameTree(nameTreeRef, xref); - dest = fetchDestination(nameTree.get(destinationId)); - } - return dest; - }, - - get pageLabels() { - var obj = null; - try { - obj = this.readPageLabels(); - } catch (ex) { - if (ex instanceof MissingDataException) { - throw ex; - } - warn('Unable to read page labels.'); - } - return shadow(this, 'pageLabels', obj); - }, - readPageLabels: function Catalog_readPageLabels() { - var obj = this.catDict.getRaw('PageLabels'); - if (!obj) { - return null; - } - var pageLabels = new Array(this.numPages); - var style = null; - var prefix = ''; - var start = 1; - - var numberTree = new NumberTree(obj, this.xref); - var nums = numberTree.getAll(); - var currentLabel = '', currentIndex = 1; - - for (var i = 0, ii = this.numPages; i < ii; i++) { - if (i in nums) { - var labelDict = nums[i]; - assert(isDict(labelDict), 'The PageLabel is not a dictionary.'); - - var type = labelDict.get('Type'); - assert(!type || isName(type, 'PageLabel'), - 'Invalid type in PageLabel dictionary.'); - - var s = labelDict.get('S'); - assert(!s || isName(s), 'Invalid style in PageLabel dictionary.'); - style = (s ? s.name : null); - - prefix = labelDict.get('P') || ''; - assert(isString(prefix), 'Invalid prefix in PageLabel dictionary.'); - - start = labelDict.get('St') || 1; - assert(isInt(start), 'Invalid start in PageLabel dictionary.'); - currentIndex = start; - } - - switch (style) { - case 'D': - currentLabel = currentIndex; - break; - case 'R': - case 'r': - currentLabel = Util.toRoman(currentIndex, style === 'r'); - break; - case 'A': - case 'a': - var LIMIT = 26; // Use only the characters A--Z, or a--z. - var A_UPPER_CASE = 0x41, A_LOWER_CASE = 0x61; - - var baseCharCode = (style === 'a' ? A_LOWER_CASE : A_UPPER_CASE); - var letterIndex = currentIndex - 1; - var character = String.fromCharCode(baseCharCode + - (letterIndex % LIMIT)); - var charBuf = []; - for (var j = 0, jj = (letterIndex / LIMIT) | 0; j <= jj; j++) { - charBuf.push(character); - } - currentLabel = charBuf.join(''); - break; - default: - assert(!style, - 'Invalid style "' + style + '" in PageLabel dictionary.'); - } - pageLabels[i] = prefix + currentLabel; - - currentLabel = ''; - currentIndex++; - } - return pageLabels; - }, - - get attachments() { - var xref = this.xref; - var attachments = null, nameTreeRef; - var obj = this.catDict.get('Names'); - if (obj) { - nameTreeRef = obj.getRaw('EmbeddedFiles'); - } - - if (nameTreeRef) { - var nameTree = new NameTree(nameTreeRef, xref); - var names = nameTree.getAll(); - for (var name in names) { - var fs = new FileSpec(names[name], xref); - if (!attachments) { - attachments = Object.create(null); - } - attachments[stringToPDFString(name)] = fs.serializable; - } - } - return shadow(this, 'attachments', attachments); - }, - get javaScript() { - var xref = this.xref; - var obj = this.catDict.get('Names'); - - var javaScript = []; - function appendIfJavaScriptDict(jsDict) { - var type = jsDict.get('S'); - if (!isName(type, 'JavaScript')) { - return; - } - var js = jsDict.get('JS'); - if (isStream(js)) { - js = bytesToString(js.getBytes()); - } else if (!isString(js)) { - return; - } - javaScript.push(stringToPDFString(js)); - } - if (obj && obj.has('JavaScript')) { - var nameTree = new NameTree(obj.getRaw('JavaScript'), xref); - var names = nameTree.getAll(); - for (var name in names) { - // We don't really use the JavaScript right now. This code is - // defensive so we don't cause errors on document load. - var jsDict = names[name]; - if (isDict(jsDict)) { - appendIfJavaScriptDict(jsDict); - } - } - } - - // Append OpenAction actions to javaScript array - var openactionDict = this.catDict.get('OpenAction'); - if (isDict(openactionDict, 'Action')) { - var actionType = openactionDict.get('S'); - if (isName(actionType, 'Named')) { - // The named Print action is not a part of the PDF 1.7 specification, - // but is supported by many PDF readers/writers (including Adobe's). - var action = openactionDict.get('N'); - if (isName(action, 'Print')) { - javaScript.push('print({});'); - } - } else { - appendIfJavaScriptDict(openactionDict); - } - } - - return shadow(this, 'javaScript', javaScript); - }, - - cleanup: function Catalog_cleanup() { - var promises = []; - this.fontCache.forEach(function (promise) { - promises.push(promise); - }); - return Promise.all(promises).then(function (translatedFonts) { - for (var i = 0, ii = translatedFonts.length; i < ii; i++) { - var font = translatedFonts[i].dict; - delete font.translated; - } - this.fontCache.clear(); - }.bind(this)); - }, - - getPage: function Catalog_getPage(pageIndex) { - if (!(pageIndex in this.pagePromises)) { - this.pagePromises[pageIndex] = this.getPageDict(pageIndex).then( - function (a) { - var dict = a[0]; - var ref = a[1]; - return this.pageFactory.createPage(pageIndex, dict, ref, - this.fontCache); - }.bind(this) - ); - } - return this.pagePromises[pageIndex]; - }, - - getPageDict: function Catalog_getPageDict(pageIndex) { - var capability = createPromiseCapability(); - var nodesToVisit = [this.catDict.getRaw('Pages')]; - var currentPageIndex = 0; - var xref = this.xref; - var checkAllKids = false; - - function next() { - while (nodesToVisit.length) { - var currentNode = nodesToVisit.pop(); - - if (isRef(currentNode)) { - xref.fetchAsync(currentNode).then(function (obj) { - if (isDict(obj, 'Page') || (isDict(obj) && !obj.has('Kids'))) { - if (pageIndex === currentPageIndex) { - capability.resolve([obj, currentNode]); - } else { - currentPageIndex++; - next(); - } - return; - } - nodesToVisit.push(obj); - next(); - }, capability.reject); - return; - } - - // Must be a child page dictionary. - assert( - isDict(currentNode), - 'page dictionary kid reference points to wrong type of object' - ); - var count = currentNode.get('Count'); - // If the current node doesn't have any children, avoid getting stuck - // in an empty node further down in the tree (see issue5644.pdf). - if (count === 0) { - checkAllKids = true; - } - // Skip nodes where the page can't be. - if (currentPageIndex + count <= pageIndex) { - currentPageIndex += count; - continue; - } - - var kids = currentNode.get('Kids'); - assert(isArray(kids), 'page dictionary kids object is not an array'); - if (!checkAllKids && count === kids.length) { - // Nodes that don't have the page have been skipped and this is the - // bottom of the tree which means the page requested must be a - // descendant of this pages node. Ideally we would just resolve the - // promise with the page ref here, but there is the case where more - // pages nodes could link to single a page (see issue 3666 pdf). To - // handle this push it back on the queue so if it is a pages node it - // will be descended into. - nodesToVisit = [kids[pageIndex - currentPageIndex]]; - currentPageIndex = pageIndex; - continue; - } else { - for (var last = kids.length - 1; last >= 0; last--) { - nodesToVisit.push(kids[last]); - } - } - } - capability.reject('Page index ' + pageIndex + ' not found.'); - } - next(); - return capability.promise; - }, - - getPageIndex: function Catalog_getPageIndex(pageRef) { - // The page tree nodes have the count of all the leaves below them. To get - // how many pages are before we just have to walk up the tree and keep - // adding the count of siblings to the left of the node. - var xref = this.xref; - function pagesBeforeRef(kidRef) { - var total = 0; - var parentRef; - return xref.fetchAsync(kidRef).then(function (node) { - if (isRefsEqual(kidRef, pageRef) && !isDict(node, 'Page') && - !(isDict(node) && !node.has('Type') && node.has('Contents'))) { - throw new Error('The reference does not point to a /Page Dict.'); - } - if (!node) { - return null; - } - assert(isDict(node), 'node must be a Dict.'); - parentRef = node.getRaw('Parent'); - return node.getAsync('Parent'); - }).then(function (parent) { - if (!parent) { - return null; - } - assert(isDict(parent), 'parent must be a Dict.'); - return parent.getAsync('Kids'); - }).then(function (kids) { - if (!kids) { - return null; - } - var kidPromises = []; - var found = false; - for (var i = 0; i < kids.length; i++) { - var kid = kids[i]; - assert(isRef(kid), 'kid must be a Ref.'); - if (kid.num === kidRef.num) { - found = true; - break; - } - kidPromises.push(xref.fetchAsync(kid).then(function (kid) { - if (kid.has('Count')) { - var count = kid.get('Count'); - total += count; - } else { // page leaf node - total++; - } - })); - } - if (!found) { - error('kid ref not found in parents kids'); - } - return Promise.all(kidPromises).then(function () { - return [total, parentRef]; - }); - }); - } - - var total = 0; - function next(ref) { - return pagesBeforeRef(ref).then(function (args) { - if (!args) { - return total; - } - var count = args[0]; - var parentRef = args[1]; - total += count; - return next(parentRef); - }); - } - - return next(pageRef); - } - }; - - return Catalog; -})(); - -var XRef = (function XRefClosure() { - function XRef(stream, password) { - this.stream = stream; - this.entries = []; - this.xrefstms = Object.create(null); - // prepare the XRef cache - this.cache = []; - this.password = password; - this.stats = { - streamTypes: [], - fontTypes: [] - }; - } - - XRef.prototype = { - setStartXRef: function XRef_setStartXRef(startXRef) { - // Store the starting positions of xref tables as we process them - // so we can recover from missing data errors - this.startXRefQueue = [startXRef]; - }, - - parse: function XRef_parse(recoveryMode) { - var trailerDict; - if (!recoveryMode) { - trailerDict = this.readXRef(); - } else { - warn('Indexing all PDF objects'); - trailerDict = this.indexObjects(); - } - trailerDict.assignXref(this); - this.trailer = trailerDict; - var encrypt = trailerDict.get('Encrypt'); - if (encrypt) { - var ids = trailerDict.get('ID'); - var fileId = (ids && ids.length) ? ids[0] : ''; - this.encrypt = new CipherTransformFactory(encrypt, fileId, - this.password); - } - - // get the root dictionary (catalog) object - if (!(this.root = trailerDict.get('Root'))) { - error('Invalid root reference'); - } - }, - - processXRefTable: function XRef_processXRefTable(parser) { - if (!('tableState' in this)) { - // Stores state of the table as we process it so we can resume - // from middle of table in case of missing data error - this.tableState = { - entryNum: 0, - streamPos: parser.lexer.stream.pos, - parserBuf1: parser.buf1, - parserBuf2: parser.buf2 - }; - } - - var obj = this.readXRefTable(parser); - - // Sanity check - if (!isCmd(obj, 'trailer')) { - error('Invalid XRef table: could not find trailer dictionary'); - } - // Read trailer dictionary, e.g. - // trailer - // << /Size 22 - // /Root 20R - // /Info 10R - // /ID [ <81b14aafa313db63dbd6f981e49f94f4> ] - // >> - // The parser goes through the entire stream << ... >> and provides - // a getter interface for the key-value table - var dict = parser.getObj(); - - // The pdflib PDF generator can generate a nested trailer dictionary - if (!isDict(dict) && dict.dict) { - dict = dict.dict; - } - if (!isDict(dict)) { - error('Invalid XRef table: could not parse trailer dictionary'); - } - delete this.tableState; - - return dict; - }, - - readXRefTable: function XRef_readXRefTable(parser) { - // Example of cross-reference table: - // xref - // 0 1 <-- subsection header (first obj #, obj count) - // 0000000000 65535 f <-- actual object (offset, generation #, f/n) - // 23 2 <-- subsection header ... and so on ... - // 0000025518 00002 n - // 0000025635 00000 n - // trailer - // ... - - var stream = parser.lexer.stream; - var tableState = this.tableState; - stream.pos = tableState.streamPos; - parser.buf1 = tableState.parserBuf1; - parser.buf2 = tableState.parserBuf2; - - // Outer loop is over subsection headers - var obj; - - while (true) { - if (!('firstEntryNum' in tableState) || !('entryCount' in tableState)) { - if (isCmd(obj = parser.getObj(), 'trailer')) { - break; - } - tableState.firstEntryNum = obj; - tableState.entryCount = parser.getObj(); - } - - var first = tableState.firstEntryNum; - var count = tableState.entryCount; - if (!isInt(first) || !isInt(count)) { - error('Invalid XRef table: wrong types in subsection header'); - } - // Inner loop is over objects themselves - for (var i = tableState.entryNum; i < count; i++) { - tableState.streamPos = stream.pos; - tableState.entryNum = i; - tableState.parserBuf1 = parser.buf1; - tableState.parserBuf2 = parser.buf2; - - var entry = {}; - entry.offset = parser.getObj(); - entry.gen = parser.getObj(); - var type = parser.getObj(); - - if (isCmd(type, 'f')) { - entry.free = true; - } else if (isCmd(type, 'n')) { - entry.uncompressed = true; - } - - // Validate entry obj - if (!isInt(entry.offset) || !isInt(entry.gen) || - !(entry.free || entry.uncompressed)) { - error('Invalid entry in XRef subsection: ' + first + ', ' + count); - } - - // The first xref table entry, i.e. obj 0, should be free. Attempting - // to adjust an incorrect first obj # (fixes issue 3248 and 7229). - if (i === 0 && entry.free && first === 1) { - first = 0; - } - - if (!this.entries[i + first]) { - this.entries[i + first] = entry; - } - } - - tableState.entryNum = 0; - tableState.streamPos = stream.pos; - tableState.parserBuf1 = parser.buf1; - tableState.parserBuf2 = parser.buf2; - delete tableState.firstEntryNum; - delete tableState.entryCount; - } - - // Sanity check: as per spec, first object must be free - if (this.entries[0] && !this.entries[0].free) { - error('Invalid XRef table: unexpected first object'); - } - return obj; - }, - - processXRefStream: function XRef_processXRefStream(stream) { - if (!('streamState' in this)) { - // Stores state of the stream as we process it so we can resume - // from middle of stream in case of missing data error - var streamParameters = stream.dict; - var byteWidths = streamParameters.get('W'); - var range = streamParameters.get('Index'); - if (!range) { - range = [0, streamParameters.get('Size')]; - } - - this.streamState = { - entryRanges: range, - byteWidths: byteWidths, - entryNum: 0, - streamPos: stream.pos - }; - } - this.readXRefStream(stream); - delete this.streamState; - - return stream.dict; - }, - - readXRefStream: function XRef_readXRefStream(stream) { - var i, j; - var streamState = this.streamState; - stream.pos = streamState.streamPos; - - var byteWidths = streamState.byteWidths; - var typeFieldWidth = byteWidths[0]; - var offsetFieldWidth = byteWidths[1]; - var generationFieldWidth = byteWidths[2]; - - var entryRanges = streamState.entryRanges; - while (entryRanges.length > 0) { - var first = entryRanges[0]; - var n = entryRanges[1]; - - if (!isInt(first) || !isInt(n)) { - error('Invalid XRef range fields: ' + first + ', ' + n); - } - if (!isInt(typeFieldWidth) || !isInt(offsetFieldWidth) || - !isInt(generationFieldWidth)) { - error('Invalid XRef entry fields length: ' + first + ', ' + n); - } - for (i = streamState.entryNum; i < n; ++i) { - streamState.entryNum = i; - streamState.streamPos = stream.pos; - - var type = 0, offset = 0, generation = 0; - for (j = 0; j < typeFieldWidth; ++j) { - type = (type << 8) | stream.getByte(); - } - // if type field is absent, its default value is 1 - if (typeFieldWidth === 0) { - type = 1; - } - for (j = 0; j < offsetFieldWidth; ++j) { - offset = (offset << 8) | stream.getByte(); - } - for (j = 0; j < generationFieldWidth; ++j) { - generation = (generation << 8) | stream.getByte(); - } - var entry = {}; - entry.offset = offset; - entry.gen = generation; - switch (type) { - case 0: - entry.free = true; - break; - case 1: - entry.uncompressed = true; - break; - case 2: - break; - default: - error('Invalid XRef entry type: ' + type); - } - if (!this.entries[first + i]) { - this.entries[first + i] = entry; - } - } - - streamState.entryNum = 0; - streamState.streamPos = stream.pos; - entryRanges.splice(0, 2); - } - }, - - indexObjects: function XRef_indexObjects() { - // Simple scan through the PDF content to find objects, - // trailers and XRef streams. - var TAB = 0x9, LF = 0xA, CR = 0xD, SPACE = 0x20; - var PERCENT = 0x25, LT = 0x3C; - - function readToken(data, offset) { - var token = '', ch = data[offset]; - while (ch !== LF && ch !== CR && ch !== LT) { - if (++offset >= data.length) { - break; - } - token += String.fromCharCode(ch); - ch = data[offset]; - } - return token; - } - function skipUntil(data, offset, what) { - var length = what.length, dataLength = data.length; - var skipped = 0; - // finding byte sequence - while (offset < dataLength) { - var i = 0; - while (i < length && data[offset + i] === what[i]) { - ++i; - } - if (i >= length) { - break; // sequence found - } - offset++; - skipped++; - } - return skipped; - } - var objRegExp = /^(\d+)\s+(\d+)\s+obj\b/; - var trailerBytes = new Uint8Array([116, 114, 97, 105, 108, 101, 114]); - var startxrefBytes = new Uint8Array([115, 116, 97, 114, 116, 120, 114, - 101, 102]); - var endobjBytes = new Uint8Array([101, 110, 100, 111, 98, 106]); - var xrefBytes = new Uint8Array([47, 88, 82, 101, 102]); - - // Clear out any existing entries, since they may be bogus. - this.entries.length = 0; - - var stream = this.stream; - stream.pos = 0; - var buffer = stream.getBytes(); - var position = stream.start, length = buffer.length; - var trailers = [], xrefStms = []; - while (position < length) { - var ch = buffer[position]; - if (ch === TAB || ch === LF || ch === CR || ch === SPACE) { - ++position; - continue; - } - if (ch === PERCENT) { // %-comment - do { - ++position; - if (position >= length) { - break; - } - ch = buffer[position]; - } while (ch !== LF && ch !== CR); - continue; - } - var token = readToken(buffer, position); - var m; - if (token.indexOf('xref') === 0 && - (token.length === 4 || /\s/.test(token[4]))) { - position += skipUntil(buffer, position, trailerBytes); - trailers.push(position); - position += skipUntil(buffer, position, startxrefBytes); - } else if ((m = objRegExp.exec(token))) { - if (typeof this.entries[m[1]] === 'undefined') { - this.entries[m[1]] = { - offset: position - stream.start, - gen: m[2] | 0, - uncompressed: true - }; - } - var contentLength = skipUntil(buffer, position, endobjBytes) + 7; - var content = buffer.subarray(position, position + contentLength); - - // checking XRef stream suspect - // (it shall have '/XRef' and next char is not a letter) - var xrefTagOffset = skipUntil(content, 0, xrefBytes); - if (xrefTagOffset < contentLength && - content[xrefTagOffset + 5] < 64) { - xrefStms.push(position - stream.start); - this.xrefstms[position - stream.start] = 1; // Avoid recursion - } - - position += contentLength; - } else if (token.indexOf('trailer') === 0 && - (token.length === 7 || /\s/.test(token[7]))) { - trailers.push(position); - position += skipUntil(buffer, position, startxrefBytes); - } else { - position += token.length + 1; - } - } - // reading XRef streams - var i, ii; - for (i = 0, ii = xrefStms.length; i < ii; ++i) { - this.startXRefQueue.push(xrefStms[i]); - this.readXRef(/* recoveryMode */ true); - } - // finding main trailer - var dict; - for (i = 0, ii = trailers.length; i < ii; ++i) { - stream.pos = trailers[i]; - var parser = new Parser(new Lexer(stream), /* allowStreams = */ true, - /* xref = */ this, /* recoveryMode = */ true); - var obj = parser.getObj(); - if (!isCmd(obj, 'trailer')) { - continue; - } - // read the trailer dictionary - dict = parser.getObj(); - if (!isDict(dict)) { - continue; - } - // taking the first one with 'ID' - if (dict.has('ID')) { - return dict; - } - } - // no tailer with 'ID', taking last one (if exists) - if (dict) { - return dict; - } - // nothing helps - // calling error() would reject worker with an UnknownErrorException. - throw new InvalidPDFException('Invalid PDF structure'); - }, - - readXRef: function XRef_readXRef(recoveryMode) { - var stream = this.stream; - - try { - while (this.startXRefQueue.length) { - var startXRef = this.startXRefQueue[0]; - - stream.pos = startXRef + stream.start; - - var parser = new Parser(new Lexer(stream), true, this); - var obj = parser.getObj(); - var dict; - - // Get dictionary - if (isCmd(obj, 'xref')) { - // Parse end-of-file XRef - dict = this.processXRefTable(parser); - if (!this.topDict) { - this.topDict = dict; - } - - // Recursively get other XRefs 'XRefStm', if any - obj = dict.get('XRefStm'); - if (isInt(obj)) { - var pos = obj; - // ignore previously loaded xref streams - // (possible infinite recursion) - if (!(pos in this.xrefstms)) { - this.xrefstms[pos] = 1; - this.startXRefQueue.push(pos); - } - } - } else if (isInt(obj)) { - // Parse in-stream XRef - if (!isInt(parser.getObj()) || - !isCmd(parser.getObj(), 'obj') || - !isStream(obj = parser.getObj())) { - error('Invalid XRef stream'); - } - dict = this.processXRefStream(obj); - if (!this.topDict) { - this.topDict = dict; - } - if (!dict) { - error('Failed to read XRef stream'); - } - } else { - error('Invalid XRef stream header'); - } - - // Recursively get previous dictionary, if any - obj = dict.get('Prev'); - if (isInt(obj)) { - this.startXRefQueue.push(obj); - } else if (isRef(obj)) { - // The spec says Prev must not be a reference, i.e. "/Prev NNN" - // This is a fallback for non-compliant PDFs, i.e. "/Prev NNN 0 R" - this.startXRefQueue.push(obj.num); - } - - this.startXRefQueue.shift(); - } - - return this.topDict; - } catch (e) { - if (e instanceof MissingDataException) { - throw e; - } - info('(while reading XRef): ' + e); - } - - if (recoveryMode) { - return; - } - throw new XRefParseException(); - }, - - getEntry: function XRef_getEntry(i) { - var xrefEntry = this.entries[i]; - if (xrefEntry && !xrefEntry.free && xrefEntry.offset) { - return xrefEntry; - } - return null; - }, - - fetchIfRef: function XRef_fetchIfRef(obj) { - if (!isRef(obj)) { - return obj; - } - return this.fetch(obj); - }, - - fetch: function XRef_fetch(ref, suppressEncryption) { - assert(isRef(ref), 'ref object is not a reference'); - var num = ref.num; - if (num in this.cache) { - var cacheEntry = this.cache[num]; - return cacheEntry; - } - - var xrefEntry = this.getEntry(num); - - // the referenced entry can be free - if (xrefEntry === null) { - return (this.cache[num] = null); - } - - if (xrefEntry.uncompressed) { - xrefEntry = this.fetchUncompressed(ref, xrefEntry, suppressEncryption); - } else { - xrefEntry = this.fetchCompressed(xrefEntry, suppressEncryption); - } - if (isDict(xrefEntry)){ - xrefEntry.objId = ref.toString(); - } else if (isStream(xrefEntry)) { - xrefEntry.dict.objId = ref.toString(); - } - return xrefEntry; - }, - - fetchUncompressed: function XRef_fetchUncompressed(ref, xrefEntry, - suppressEncryption) { - var gen = ref.gen; - var num = ref.num; - if (xrefEntry.gen !== gen) { - error('inconsistent generation in XRef'); - } - var stream = this.stream.makeSubStream(xrefEntry.offset + - this.stream.start); - var parser = new Parser(new Lexer(stream), true, this); - var obj1 = parser.getObj(); - var obj2 = parser.getObj(); - var obj3 = parser.getObj(); - if (!isInt(obj1) || parseInt(obj1, 10) !== num || - !isInt(obj2) || parseInt(obj2, 10) !== gen || - !isCmd(obj3)) { - error('bad XRef entry'); - } - if (!isCmd(obj3, 'obj')) { - // some bad PDFs use "obj1234" and really mean 1234 - if (obj3.cmd.indexOf('obj') === 0) { - num = parseInt(obj3.cmd.substring(3), 10); - if (!isNaN(num)) { - return num; - } - } - error('bad XRef entry'); - } - if (this.encrypt && !suppressEncryption) { - xrefEntry = parser.getObj(this.encrypt.createCipherTransform(num, gen)); - } else { - xrefEntry = parser.getObj(); - } - if (!isStream(xrefEntry)) { - this.cache[num] = xrefEntry; - } - return xrefEntry; - }, - - fetchCompressed: function XRef_fetchCompressed(xrefEntry, - suppressEncryption) { - var tableOffset = xrefEntry.offset; - var stream = this.fetch(new Ref(tableOffset, 0)); - if (!isStream(stream)) { - error('bad ObjStm stream'); - } - var first = stream.dict.get('First'); - var n = stream.dict.get('N'); - if (!isInt(first) || !isInt(n)) { - error('invalid first and n parameters for ObjStm stream'); - } - var parser = new Parser(new Lexer(stream), false, this); - parser.allowStreams = true; - var i, entries = [], num, nums = []; - // read the object numbers to populate cache - for (i = 0; i < n; ++i) { - num = parser.getObj(); - if (!isInt(num)) { - error('invalid object number in the ObjStm stream: ' + num); - } - nums.push(num); - var offset = parser.getObj(); - if (!isInt(offset)) { - error('invalid object offset in the ObjStm stream: ' + offset); - } - } - // read stream objects for cache - for (i = 0; i < n; ++i) { - entries.push(parser.getObj()); - // The ObjStm should not contain 'endobj'. If it's present, skip over it - // to support corrupt PDFs (fixes issue 5241, bug 898610, bug 1037816). - if (isCmd(parser.buf1, 'endobj')) { - parser.shift(); - } - num = nums[i]; - var entry = this.entries[num]; - if (entry && entry.offset === tableOffset && entry.gen === i) { - this.cache[num] = entries[i]; - } - } - xrefEntry = entries[xrefEntry.gen]; - if (xrefEntry === undefined) { - error('bad XRef entry for compressed object'); - } - return xrefEntry; - }, - - fetchIfRefAsync: function XRef_fetchIfRefAsync(obj) { - if (!isRef(obj)) { - return Promise.resolve(obj); - } - return this.fetchAsync(obj); - }, - - fetchAsync: function XRef_fetchAsync(ref, suppressEncryption) { - var streamManager = this.stream.manager; - var xref = this; - return new Promise(function tryFetch(resolve, reject) { - try { - resolve(xref.fetch(ref, suppressEncryption)); - } catch (e) { - if (e instanceof MissingDataException) { - streamManager.requestRange(e.begin, e.end).then(function () { - tryFetch(resolve, reject); - }, reject); - return; - } - reject(e); - } - }); - }, - - getCatalogObj: function XRef_getCatalogObj() { - return this.root; - } - }; - - return XRef; -})(); - -/** - * A NameTree/NumberTree is like a Dict but has some advantageous properties, - * see the specification (7.9.6 and 7.9.7) for additional details. - * TODO: implement all the Dict functions and make this more efficient. - */ -var NameOrNumberTree = (function NameOrNumberTreeClosure() { - function NameOrNumberTree(root, xref) { - throw new Error('Cannot initialize NameOrNumberTree.'); - } - - NameOrNumberTree.prototype = { - getAll: function NameOrNumberTree_getAll() { - var dict = Object.create(null); - if (!this.root) { - return dict; - } - var xref = this.xref; - // Reading Name/Number tree. - var processed = new RefSet(); - processed.put(this.root); - var queue = [this.root]; - while (queue.length > 0) { - var i, n; - var obj = xref.fetchIfRef(queue.shift()); - if (!isDict(obj)) { - continue; - } - if (obj.has('Kids')) { - var kids = obj.get('Kids'); - for (i = 0, n = kids.length; i < n; i++) { - var kid = kids[i]; - assert(!processed.has(kid), - 'Duplicate entry in "' + this._type + '" tree.'); - queue.push(kid); - processed.put(kid); - } - continue; - } - var entries = obj.get(this._type); - if (isArray(entries)) { - for (i = 0, n = entries.length; i < n; i += 2) { - dict[xref.fetchIfRef(entries[i])] = xref.fetchIfRef(entries[i + 1]); - } - } - } - return dict; - }, - - get: function NameOrNumberTree_get(key) { - if (!this.root) { - return null; - } - - var xref = this.xref; - var kidsOrEntries = xref.fetchIfRef(this.root); - var loopCount = 0; - var MAX_LEVELS = 10; - var l, r, m; - - // Perform a binary search to quickly find the entry that - // contains the key we are looking for. - while (kidsOrEntries.has('Kids')) { - if (++loopCount > MAX_LEVELS) { - warn('Search depth limit reached for "' + this._type + '" tree.'); - return null; - } - - var kids = kidsOrEntries.get('Kids'); - if (!isArray(kids)) { - return null; - } - - l = 0; - r = kids.length - 1; - while (l <= r) { - m = (l + r) >> 1; - var kid = xref.fetchIfRef(kids[m]); - var limits = kid.get('Limits'); - - if (key < xref.fetchIfRef(limits[0])) { - r = m - 1; - } else if (key > xref.fetchIfRef(limits[1])) { - l = m + 1; - } else { - kidsOrEntries = xref.fetchIfRef(kids[m]); - break; - } - } - if (l > r) { - return null; - } - } - - // If we get here, then we have found the right entry. Now go through the - // entries in the dictionary until we find the key we're looking for. - var entries = kidsOrEntries.get(this._type); - if (isArray(entries)) { - // Perform a binary search to reduce the lookup time. - l = 0; - r = entries.length - 2; - while (l <= r) { - // Check only even indices (0, 2, 4, ...) because the - // odd indices contain the actual data. - m = (l + r) & ~1; - var currentKey = xref.fetchIfRef(entries[m]); - if (key < currentKey) { - r = m - 2; - } else if (key > currentKey) { - l = m + 2; - } else { - return xref.fetchIfRef(entries[m + 1]); - } - } - } - return null; - } - }; - return NameOrNumberTree; -})(); - -var NameTree = (function NameTreeClosure() { - function NameTree(root, xref) { - this.root = root; - this.xref = xref; - this._type = 'Names'; - } - - Util.inherit(NameTree, NameOrNumberTree, {}); - - return NameTree; -})(); - -var NumberTree = (function NumberTreeClosure() { - function NumberTree(root, xref) { - this.root = root; - this.xref = xref; - this._type = 'Nums'; - } - - Util.inherit(NumberTree, NameOrNumberTree, {}); - - return NumberTree; -})(); - -/** - * "A PDF file can refer to the contents of another file by using a File - * Specification (PDF 1.1)", see the spec (7.11) for more details. - * NOTE: Only embedded files are supported (as part of the attachments support) - * TODO: support the 'URL' file system (with caching if !/V), portable - * collections attributes and related files (/RF) - */ -var FileSpec = (function FileSpecClosure() { - function FileSpec(root, xref) { - if (!root || !isDict(root)) { - return; - } - this.xref = xref; - this.root = root; - if (root.has('FS')) { - this.fs = root.get('FS'); - } - this.description = root.has('Desc') ? - stringToPDFString(root.get('Desc')) : - ''; - if (root.has('RF')) { - warn('Related file specifications are not supported'); - } - this.contentAvailable = true; - if (!root.has('EF')) { - this.contentAvailable = false; - warn('Non-embedded file specifications are not supported'); - } - } - - function pickPlatformItem(dict) { - // Look for the filename in this order: - // UF, F, Unix, Mac, DOS - if (dict.has('UF')) { - return dict.get('UF'); - } else if (dict.has('F')) { - return dict.get('F'); - } else if (dict.has('Unix')) { - return dict.get('Unix'); - } else if (dict.has('Mac')) { - return dict.get('Mac'); - } else if (dict.has('DOS')) { - return dict.get('DOS'); - } else { - return null; - } - } - - FileSpec.prototype = { - get filename() { - if (!this._filename && this.root) { - var filename = pickPlatformItem(this.root) || 'unnamed'; - this._filename = stringToPDFString(filename). - replace(/\\\\/g, '\\'). - replace(/\\\//g, '/'). - replace(/\\/g, '/'); - } - return this._filename; - }, - get content() { - if (!this.contentAvailable) { - return null; - } - if (!this.contentRef && this.root) { - this.contentRef = pickPlatformItem(this.root.get('EF')); - } - var content = null; - if (this.contentRef) { - var xref = this.xref; - var fileObj = xref.fetchIfRef(this.contentRef); - if (fileObj && isStream(fileObj)) { - content = fileObj.getBytes(); - } else { - warn('Embedded file specification points to non-existing/invalid ' + - 'content'); - } - } else { - warn('Embedded file specification does not have a content'); - } - return content; - }, - get serializable() { - return { - filename: this.filename, - content: this.content - }; - } - }; - return FileSpec; -})(); - -/** - * A helper for loading missing data in object graphs. It traverses the graph - * depth first and queues up any objects that have missing data. Once it has - * has traversed as many objects that are available it attempts to bundle the - * missing data requests and then resume from the nodes that weren't ready. - * - * NOTE: It provides protection from circular references by keeping track of - * of loaded references. However, you must be careful not to load any graphs - * that have references to the catalog or other pages since that will cause the - * entire PDF document object graph to be traversed. - */ -var ObjectLoader = (function() { - function mayHaveChildren(value) { - return isRef(value) || isDict(value) || isArray(value) || isStream(value); - } - - function addChildren(node, nodesToVisit) { - var value; - if (isDict(node) || isStream(node)) { - var map; - if (isDict(node)) { - map = node.map; - } else { - map = node.dict.map; - } - for (var key in map) { - value = map[key]; - if (mayHaveChildren(value)) { - nodesToVisit.push(value); - } - } - } else if (isArray(node)) { - for (var i = 0, ii = node.length; i < ii; i++) { - value = node[i]; - if (mayHaveChildren(value)) { - nodesToVisit.push(value); - } - } - } - } - - function ObjectLoader(obj, keys, xref) { - this.obj = obj; - this.keys = keys; - this.xref = xref; - this.refSet = null; - this.capability = null; - } - - ObjectLoader.prototype = { - load: function ObjectLoader_load() { - var keys = this.keys; - this.capability = createPromiseCapability(); - // Don't walk the graph if all the data is already loaded. - if (!(this.xref.stream instanceof ChunkedStream) || - this.xref.stream.getMissingChunks().length === 0) { - this.capability.resolve(); - return this.capability.promise; - } - - this.refSet = new RefSet(); - // Setup the initial nodes to visit. - var nodesToVisit = []; - for (var i = 0; i < keys.length; i++) { - nodesToVisit.push(this.obj[keys[i]]); - } - - this._walk(nodesToVisit); - return this.capability.promise; - }, - - _walk: function ObjectLoader_walk(nodesToVisit) { - var nodesToRevisit = []; - var pendingRequests = []; - // DFS walk of the object graph. - while (nodesToVisit.length) { - var currentNode = nodesToVisit.pop(); - - // Only references or chunked streams can cause missing data exceptions. - if (isRef(currentNode)) { - // Skip nodes that have already been visited. - if (this.refSet.has(currentNode)) { - continue; - } - try { - var ref = currentNode; - this.refSet.put(ref); - currentNode = this.xref.fetch(currentNode); - } catch (e) { - if (!(e instanceof MissingDataException)) { - throw e; - } - nodesToRevisit.push(currentNode); - pendingRequests.push({ begin: e.begin, end: e.end }); - } - } - if (currentNode && currentNode.getBaseStreams) { - var baseStreams = currentNode.getBaseStreams(); - var foundMissingData = false; - for (var i = 0; i < baseStreams.length; i++) { - var stream = baseStreams[i]; - if (stream.getMissingChunks && stream.getMissingChunks().length) { - foundMissingData = true; - pendingRequests.push({ - begin: stream.start, - end: stream.end - }); - } - } - if (foundMissingData) { - nodesToRevisit.push(currentNode); - } - } - - addChildren(currentNode, nodesToVisit); - } - - if (pendingRequests.length) { - this.xref.stream.manager.requestRanges(pendingRequests).then( - function pendingRequestCallback() { - nodesToVisit = nodesToRevisit; - for (var i = 0; i < nodesToRevisit.length; i++) { - var node = nodesToRevisit[i]; - // Remove any reference nodes from the currrent refset so they - // aren't skipped when we revist them. - if (isRef(node)) { - this.refSet.remove(node); - } - } - this._walk(nodesToVisit); - }.bind(this), this.capability.reject); - return; - } - // Everything is loaded. - this.refSet = null; - this.capability.resolve(); - } - }; - - return ObjectLoader; -})(); - -exports.Catalog = Catalog; -exports.ObjectLoader = ObjectLoader; -exports.XRef = XRef; -exports.FileSpec = FileSpec; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCorePattern = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreFunction, - root.pdfjsCoreColorSpace); - } -}(this, function (exports, sharedUtil, corePrimitives, coreFunction, - coreColorSpace) { - -var UNSUPPORTED_FEATURES = sharedUtil.UNSUPPORTED_FEATURES; -var MissingDataException = sharedUtil.MissingDataException; -var Util = sharedUtil.Util; -var assert = sharedUtil.assert; -var error = sharedUtil.error; -var info = sharedUtil.info; -var warn = sharedUtil.warn; -var isStream = corePrimitives.isStream; -var PDFFunction = coreFunction.PDFFunction; -var ColorSpace = coreColorSpace.ColorSpace; - -var ShadingType = { - FUNCTION_BASED: 1, - AXIAL: 2, - RADIAL: 3, - FREE_FORM_MESH: 4, - LATTICE_FORM_MESH: 5, - COONS_PATCH_MESH: 6, - TENSOR_PATCH_MESH: 7 -}; - -var Pattern = (function PatternClosure() { - // Constructor should define this.getPattern - function Pattern() { - error('should not call Pattern constructor'); - } - - Pattern.prototype = { - // Input: current Canvas context - // Output: the appropriate fillStyle or strokeStyle - getPattern: function Pattern_getPattern(ctx) { - error('Should not call Pattern.getStyle: ' + ctx); - } - }; - - Pattern.parseShading = function Pattern_parseShading(shading, matrix, xref, - res, handler) { - - var dict = isStream(shading) ? shading.dict : shading; - var type = dict.get('ShadingType'); - - try { - switch (type) { - case ShadingType.AXIAL: - case ShadingType.RADIAL: - // Both radial and axial shadings are handled by RadialAxial shading. - return new Shadings.RadialAxial(dict, matrix, xref, res); - case ShadingType.FREE_FORM_MESH: - case ShadingType.LATTICE_FORM_MESH: - case ShadingType.COONS_PATCH_MESH: - case ShadingType.TENSOR_PATCH_MESH: - return new Shadings.Mesh(shading, matrix, xref, res); - default: - throw new Error('Unsupported ShadingType: ' + type); - } - } catch (ex) { - if (ex instanceof MissingDataException) { - throw ex; - } - handler.send('UnsupportedFeature', - {featureId: UNSUPPORTED_FEATURES.shadingPattern}); - warn(ex); - return new Shadings.Dummy(); - } - }; - return Pattern; -})(); - -var Shadings = {}; - -// A small number to offset the first/last color stops so we can insert ones to -// support extend. Number.MIN_VALUE is too small and breaks the extend. -Shadings.SMALL_NUMBER = 1e-6; - -// Radial and axial shading have very similar implementations -// If needed, the implementations can be broken into two classes -Shadings.RadialAxial = (function RadialAxialClosure() { - function RadialAxial(dict, matrix, xref, res) { - this.matrix = matrix; - this.coordsArr = dict.getArray('Coords'); - this.shadingType = dict.get('ShadingType'); - this.type = 'Pattern'; - var cs = dict.get('ColorSpace', 'CS'); - cs = ColorSpace.parse(cs, xref, res); - this.cs = cs; - - var t0 = 0.0, t1 = 1.0; - if (dict.has('Domain')) { - var domainArr = dict.getArray('Domain'); - t0 = domainArr[0]; - t1 = domainArr[1]; - } - - var extendStart = false, extendEnd = false; - if (dict.has('Extend')) { - var extendArr = dict.getArray('Extend'); - extendStart = extendArr[0]; - extendEnd = extendArr[1]; - } - - if (this.shadingType === ShadingType.RADIAL && - (!extendStart || !extendEnd)) { - // Radial gradient only currently works if either circle is fully within - // the other circle. - var x1 = this.coordsArr[0]; - var y1 = this.coordsArr[1]; - var r1 = this.coordsArr[2]; - var x2 = this.coordsArr[3]; - var y2 = this.coordsArr[4]; - var r2 = this.coordsArr[5]; - var distance = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); - if (r1 <= r2 + distance && - r2 <= r1 + distance) { - warn('Unsupported radial gradient.'); - } - } - - this.extendStart = extendStart; - this.extendEnd = extendEnd; - - var fnObj = dict.get('Function'); - var fn = PDFFunction.parseArray(xref, fnObj); - - // 10 samples seems good enough for now, but probably won't work - // if there are sharp color changes. Ideally, we would implement - // the spec faithfully and add lossless optimizations. - var diff = t1 - t0; - var step = diff / 10; - - var colorStops = this.colorStops = []; - - // Protect against bad domains so we don't end up in an infinte loop below. - if (t0 >= t1 || step <= 0) { - // Acrobat doesn't seem to handle these cases so we'll ignore for - // now. - info('Bad shading domain.'); - return; - } - - var color = new Float32Array(cs.numComps), ratio = new Float32Array(1); - var rgbColor; - for (var i = t0; i <= t1; i += step) { - ratio[0] = i; - fn(ratio, 0, color, 0); - rgbColor = cs.getRgb(color, 0); - var cssColor = Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]); - colorStops.push([(i - t0) / diff, cssColor]); - } - - var background = 'transparent'; - if (dict.has('Background')) { - rgbColor = cs.getRgb(dict.get('Background'), 0); - background = Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]); - } - - if (!extendStart) { - // Insert a color stop at the front and offset the first real color stop - // so it doesn't conflict with the one we insert. - colorStops.unshift([0, background]); - colorStops[1][0] += Shadings.SMALL_NUMBER; - } - if (!extendEnd) { - // Same idea as above in extendStart but for the end. - colorStops[colorStops.length - 1][0] -= Shadings.SMALL_NUMBER; - colorStops.push([1, background]); - } - - this.colorStops = colorStops; - } - - RadialAxial.prototype = { - getIR: function RadialAxial_getIR() { - var coordsArr = this.coordsArr; - var shadingType = this.shadingType; - var type, p0, p1, r0, r1; - if (shadingType === ShadingType.AXIAL) { - p0 = [coordsArr[0], coordsArr[1]]; - p1 = [coordsArr[2], coordsArr[3]]; - r0 = null; - r1 = null; - type = 'axial'; - } else if (shadingType === ShadingType.RADIAL) { - p0 = [coordsArr[0], coordsArr[1]]; - p1 = [coordsArr[3], coordsArr[4]]; - r0 = coordsArr[2]; - r1 = coordsArr[5]; - type = 'radial'; - } else { - error('getPattern type unknown: ' + shadingType); - } - - var matrix = this.matrix; - if (matrix) { - p0 = Util.applyTransform(p0, matrix); - p1 = Util.applyTransform(p1, matrix); - if (shadingType === ShadingType.RADIAL) { - var scale = Util.singularValueDecompose2dScale(matrix); - r0 *= scale[0]; - r1 *= scale[1]; - } - } - - return ['RadialAxial', type, this.colorStops, p0, p1, r0, r1]; - } - }; - - return RadialAxial; -})(); - -// All mesh shading. For now, they will be presented as set of the triangles -// to be drawn on the canvas and rgb color for each vertex. -Shadings.Mesh = (function MeshClosure() { - function MeshStreamReader(stream, context) { - this.stream = stream; - this.context = context; - this.buffer = 0; - this.bufferLength = 0; - - var numComps = context.numComps; - this.tmpCompsBuf = new Float32Array(numComps); - var csNumComps = context.colorSpace.numComps; - this.tmpCsCompsBuf = context.colorFn ? new Float32Array(csNumComps) : - this.tmpCompsBuf; - } - MeshStreamReader.prototype = { - get hasData() { - if (this.stream.end) { - return this.stream.pos < this.stream.end; - } - if (this.bufferLength > 0) { - return true; - } - var nextByte = this.stream.getByte(); - if (nextByte < 0) { - return false; - } - this.buffer = nextByte; - this.bufferLength = 8; - return true; - }, - readBits: function MeshStreamReader_readBits(n) { - var buffer = this.buffer; - var bufferLength = this.bufferLength; - if (n === 32) { - if (bufferLength === 0) { - return ((this.stream.getByte() << 24) | - (this.stream.getByte() << 16) | (this.stream.getByte() << 8) | - this.stream.getByte()) >>> 0; - } - buffer = (buffer << 24) | (this.stream.getByte() << 16) | - (this.stream.getByte() << 8) | this.stream.getByte(); - var nextByte = this.stream.getByte(); - this.buffer = nextByte & ((1 << bufferLength) - 1); - return ((buffer << (8 - bufferLength)) | - ((nextByte & 0xFF) >> bufferLength)) >>> 0; - } - if (n === 8 && bufferLength === 0) { - return this.stream.getByte(); - } - while (bufferLength < n) { - buffer = (buffer << 8) | this.stream.getByte(); - bufferLength += 8; - } - bufferLength -= n; - this.bufferLength = bufferLength; - this.buffer = buffer & ((1 << bufferLength) - 1); - return buffer >> bufferLength; - }, - align: function MeshStreamReader_align() { - this.buffer = 0; - this.bufferLength = 0; - }, - readFlag: function MeshStreamReader_readFlag() { - return this.readBits(this.context.bitsPerFlag); - }, - readCoordinate: function MeshStreamReader_readCoordinate() { - var bitsPerCoordinate = this.context.bitsPerCoordinate; - var xi = this.readBits(bitsPerCoordinate); - var yi = this.readBits(bitsPerCoordinate); - var decode = this.context.decode; - var scale = bitsPerCoordinate < 32 ? 1 / ((1 << bitsPerCoordinate) - 1) : - 2.3283064365386963e-10; // 2 ^ -32 - return [ - xi * scale * (decode[1] - decode[0]) + decode[0], - yi * scale * (decode[3] - decode[2]) + decode[2] - ]; - }, - readComponents: function MeshStreamReader_readComponents() { - var numComps = this.context.numComps; - var bitsPerComponent = this.context.bitsPerComponent; - var scale = bitsPerComponent < 32 ? 1 / ((1 << bitsPerComponent) - 1) : - 2.3283064365386963e-10; // 2 ^ -32 - var decode = this.context.decode; - var components = this.tmpCompsBuf; - for (var i = 0, j = 4; i < numComps; i++, j += 2) { - var ci = this.readBits(bitsPerComponent); - components[i] = ci * scale * (decode[j + 1] - decode[j]) + decode[j]; - } - var color = this.tmpCsCompsBuf; - if (this.context.colorFn) { - this.context.colorFn(components, 0, color, 0); - } - return this.context.colorSpace.getRgb(color, 0); - } - }; - - function decodeType4Shading(mesh, reader) { - var coords = mesh.coords; - var colors = mesh.colors; - var operators = []; - var ps = []; // not maintaining cs since that will match ps - var verticesLeft = 0; // assuming we have all data to start a new triangle - while (reader.hasData) { - var f = reader.readFlag(); - var coord = reader.readCoordinate(); - var color = reader.readComponents(); - if (verticesLeft === 0) { // ignoring flags if we started a triangle - assert(0 <= f && f <= 2, 'Unknown type4 flag'); - switch (f) { - case 0: - verticesLeft = 3; - break; - case 1: - ps.push(ps[ps.length - 2], ps[ps.length - 1]); - verticesLeft = 1; - break; - case 2: - ps.push(ps[ps.length - 3], ps[ps.length - 1]); - verticesLeft = 1; - break; - } - operators.push(f); - } - ps.push(coords.length); - coords.push(coord); - colors.push(color); - verticesLeft--; - - reader.align(); - } - mesh.figures.push({ - type: 'triangles', - coords: new Int32Array(ps), - colors: new Int32Array(ps), - }); - } - - function decodeType5Shading(mesh, reader, verticesPerRow) { - var coords = mesh.coords; - var colors = mesh.colors; - var ps = []; // not maintaining cs since that will match ps - while (reader.hasData) { - var coord = reader.readCoordinate(); - var color = reader.readComponents(); - ps.push(coords.length); - coords.push(coord); - colors.push(color); - } - mesh.figures.push({ - type: 'lattice', - coords: new Int32Array(ps), - colors: new Int32Array(ps), - verticesPerRow: verticesPerRow - }); - } - - var MIN_SPLIT_PATCH_CHUNKS_AMOUNT = 3; - var MAX_SPLIT_PATCH_CHUNKS_AMOUNT = 20; - - var TRIANGLE_DENSITY = 20; // count of triangles per entire mesh bounds - - var getB = (function getBClosure() { - function buildB(count) { - var lut = []; - for (var i = 0; i <= count; i++) { - var t = i / count, t_ = 1 - t; - lut.push(new Float32Array([t_ * t_ * t_, 3 * t * t_ * t_, - 3 * t * t * t_, t * t * t])); - } - return lut; - } - var cache = []; - return function getB(count) { - if (!cache[count]) { - cache[count] = buildB(count); - } - return cache[count]; - }; - })(); - - function buildFigureFromPatch(mesh, index) { - var figure = mesh.figures[index]; - assert(figure.type === 'patch', 'Unexpected patch mesh figure'); - - var coords = mesh.coords, colors = mesh.colors; - var pi = figure.coords; - var ci = figure.colors; - - var figureMinX = Math.min(coords[pi[0]][0], coords[pi[3]][0], - coords[pi[12]][0], coords[pi[15]][0]); - var figureMinY = Math.min(coords[pi[0]][1], coords[pi[3]][1], - coords[pi[12]][1], coords[pi[15]][1]); - var figureMaxX = Math.max(coords[pi[0]][0], coords[pi[3]][0], - coords[pi[12]][0], coords[pi[15]][0]); - var figureMaxY = Math.max(coords[pi[0]][1], coords[pi[3]][1], - coords[pi[12]][1], coords[pi[15]][1]); - var splitXBy = Math.ceil((figureMaxX - figureMinX) * TRIANGLE_DENSITY / - (mesh.bounds[2] - mesh.bounds[0])); - splitXBy = Math.max(MIN_SPLIT_PATCH_CHUNKS_AMOUNT, - Math.min(MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitXBy)); - var splitYBy = Math.ceil((figureMaxY - figureMinY) * TRIANGLE_DENSITY / - (mesh.bounds[3] - mesh.bounds[1])); - splitYBy = Math.max(MIN_SPLIT_PATCH_CHUNKS_AMOUNT, - Math.min(MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitYBy)); - - var verticesPerRow = splitXBy + 1; - var figureCoords = new Int32Array((splitYBy + 1) * verticesPerRow); - var figureColors = new Int32Array((splitYBy + 1) * verticesPerRow); - var k = 0; - var cl = new Uint8Array(3), cr = new Uint8Array(3); - var c0 = colors[ci[0]], c1 = colors[ci[1]], - c2 = colors[ci[2]], c3 = colors[ci[3]]; - var bRow = getB(splitYBy), bCol = getB(splitXBy); - for (var row = 0; row <= splitYBy; row++) { - cl[0] = ((c0[0] * (splitYBy - row) + c2[0] * row) / splitYBy) | 0; - cl[1] = ((c0[1] * (splitYBy - row) + c2[1] * row) / splitYBy) | 0; - cl[2] = ((c0[2] * (splitYBy - row) + c2[2] * row) / splitYBy) | 0; - - cr[0] = ((c1[0] * (splitYBy - row) + c3[0] * row) / splitYBy) | 0; - cr[1] = ((c1[1] * (splitYBy - row) + c3[1] * row) / splitYBy) | 0; - cr[2] = ((c1[2] * (splitYBy - row) + c3[2] * row) / splitYBy) | 0; - - for (var col = 0; col <= splitXBy; col++, k++) { - if ((row === 0 || row === splitYBy) && - (col === 0 || col === splitXBy)) { - continue; - } - var x = 0, y = 0; - var q = 0; - for (var i = 0; i <= 3; i++) { - for (var j = 0; j <= 3; j++, q++) { - var m = bRow[row][i] * bCol[col][j]; - x += coords[pi[q]][0] * m; - y += coords[pi[q]][1] * m; - } - } - figureCoords[k] = coords.length; - coords.push([x, y]); - figureColors[k] = colors.length; - var newColor = new Uint8Array(3); - newColor[0] = ((cl[0] * (splitXBy - col) + cr[0] * col) / splitXBy) | 0; - newColor[1] = ((cl[1] * (splitXBy - col) + cr[1] * col) / splitXBy) | 0; - newColor[2] = ((cl[2] * (splitXBy - col) + cr[2] * col) / splitXBy) | 0; - colors.push(newColor); - } - } - figureCoords[0] = pi[0]; - figureColors[0] = ci[0]; - figureCoords[splitXBy] = pi[3]; - figureColors[splitXBy] = ci[1]; - figureCoords[verticesPerRow * splitYBy] = pi[12]; - figureColors[verticesPerRow * splitYBy] = ci[2]; - figureCoords[verticesPerRow * splitYBy + splitXBy] = pi[15]; - figureColors[verticesPerRow * splitYBy + splitXBy] = ci[3]; - - mesh.figures[index] = { - type: 'lattice', - coords: figureCoords, - colors: figureColors, - verticesPerRow: verticesPerRow - }; - } - - function decodeType6Shading(mesh, reader) { - // A special case of Type 7. The p11, p12, p21, p22 automatically filled - var coords = mesh.coords; - var colors = mesh.colors; - var ps = new Int32Array(16); // p00, p10, ..., p30, p01, ..., p33 - var cs = new Int32Array(4); // c00, c30, c03, c33 - while (reader.hasData) { - var f = reader.readFlag(); - assert(0 <= f && f <= 3, 'Unknown type6 flag'); - var i, ii; - var pi = coords.length; - for (i = 0, ii = (f !== 0 ? 8 : 12); i < ii; i++) { - coords.push(reader.readCoordinate()); - } - var ci = colors.length; - for (i = 0, ii = (f !== 0 ? 2 : 4); i < ii; i++) { - colors.push(reader.readComponents()); - } - var tmp1, tmp2, tmp3, tmp4; - switch (f) { - case 0: - ps[12] = pi + 3; ps[13] = pi + 4; ps[14] = pi + 5; ps[15] = pi + 6; - ps[ 8] = pi + 2; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 7; - ps[ 4] = pi + 1; /* calculated below */ ps[ 7] = pi + 8; - ps[ 0] = pi; ps[ 1] = pi + 11; ps[ 2] = pi + 10; ps[ 3] = pi + 9; - cs[2] = ci + 1; cs[3] = ci + 2; - cs[0] = ci; cs[1] = ci + 3; - break; - case 1: - tmp1 = ps[12]; tmp2 = ps[13]; tmp3 = ps[14]; tmp4 = ps[15]; - ps[12] = tmp4; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = tmp3; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 3; - ps[ 4] = tmp2; /* calculated below */ ps[ 7] = pi + 4; - ps[ 0] = tmp1; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - tmp1 = cs[2]; tmp2 = cs[3]; - cs[2] = tmp2; cs[3] = ci; - cs[0] = tmp1; cs[1] = ci + 1; - break; - case 2: - tmp1 = ps[15]; - tmp2 = ps[11]; - ps[12] = ps[3]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = ps[7]; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 3; - ps[ 4] = tmp2; /* calculated below */ ps[ 7] = pi + 4; - ps[ 0] = tmp1; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - tmp1 = cs[3]; - cs[2] = cs[1]; cs[3] = ci; - cs[0] = tmp1; cs[1] = ci + 1; - break; - case 3: - ps[12] = ps[0]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = ps[1]; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 3; - ps[ 4] = ps[2]; /* calculated below */ ps[ 7] = pi + 4; - ps[ 0] = ps[3]; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - cs[2] = cs[0]; cs[3] = ci; - cs[0] = cs[1]; cs[1] = ci + 1; - break; - } - // set p11, p12, p21, p22 - ps[5] = coords.length; - coords.push([ - (-4 * coords[ps[0]][0] - coords[ps[15]][0] + - 6 * (coords[ps[4]][0] + coords[ps[1]][0]) - - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + - 3 * (coords[ps[13]][0] + coords[ps[7]][0])) / 9, - (-4 * coords[ps[0]][1] - coords[ps[15]][1] + - 6 * (coords[ps[4]][1] + coords[ps[1]][1]) - - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + - 3 * (coords[ps[13]][1] + coords[ps[7]][1])) / 9 - ]); - ps[6] = coords.length; - coords.push([ - (-4 * coords[ps[3]][0] - coords[ps[12]][0] + - 6 * (coords[ps[2]][0] + coords[ps[7]][0]) - - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + - 3 * (coords[ps[4]][0] + coords[ps[14]][0])) / 9, - (-4 * coords[ps[3]][1] - coords[ps[12]][1] + - 6 * (coords[ps[2]][1] + coords[ps[7]][1]) - - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + - 3 * (coords[ps[4]][1] + coords[ps[14]][1])) / 9 - ]); - ps[9] = coords.length; - coords.push([ - (-4 * coords[ps[12]][0] - coords[ps[3]][0] + - 6 * (coords[ps[8]][0] + coords[ps[13]][0]) - - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + - 3 * (coords[ps[11]][0] + coords[ps[1]][0])) / 9, - (-4 * coords[ps[12]][1] - coords[ps[3]][1] + - 6 * (coords[ps[8]][1] + coords[ps[13]][1]) - - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + - 3 * (coords[ps[11]][1] + coords[ps[1]][1])) / 9 - ]); - ps[10] = coords.length; - coords.push([ - (-4 * coords[ps[15]][0] - coords[ps[0]][0] + - 6 * (coords[ps[11]][0] + coords[ps[14]][0]) - - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + - 3 * (coords[ps[2]][0] + coords[ps[8]][0])) / 9, - (-4 * coords[ps[15]][1] - coords[ps[0]][1] + - 6 * (coords[ps[11]][1] + coords[ps[14]][1]) - - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + - 3 * (coords[ps[2]][1] + coords[ps[8]][1])) / 9 - ]); - mesh.figures.push({ - type: 'patch', - coords: new Int32Array(ps), // making copies of ps and cs - colors: new Int32Array(cs) - }); - } - } - - function decodeType7Shading(mesh, reader) { - var coords = mesh.coords; - var colors = mesh.colors; - var ps = new Int32Array(16); // p00, p10, ..., p30, p01, ..., p33 - var cs = new Int32Array(4); // c00, c30, c03, c33 - while (reader.hasData) { - var f = reader.readFlag(); - assert(0 <= f && f <= 3, 'Unknown type7 flag'); - var i, ii; - var pi = coords.length; - for (i = 0, ii = (f !== 0 ? 12 : 16); i < ii; i++) { - coords.push(reader.readCoordinate()); - } - var ci = colors.length; - for (i = 0, ii = (f !== 0 ? 2 : 4); i < ii; i++) { - colors.push(reader.readComponents()); - } - var tmp1, tmp2, tmp3, tmp4; - switch (f) { - case 0: - ps[12] = pi + 3; ps[13] = pi + 4; ps[14] = pi + 5; ps[15] = pi + 6; - ps[ 8] = pi + 2; ps[ 9] = pi + 13; ps[10] = pi + 14; ps[11] = pi + 7; - ps[ 4] = pi + 1; ps[ 5] = pi + 12; ps[ 6] = pi + 15; ps[ 7] = pi + 8; - ps[ 0] = pi; ps[ 1] = pi + 11; ps[ 2] = pi + 10; ps[ 3] = pi + 9; - cs[2] = ci + 1; cs[3] = ci + 2; - cs[0] = ci; cs[1] = ci + 3; - break; - case 1: - tmp1 = ps[12]; tmp2 = ps[13]; tmp3 = ps[14]; tmp4 = ps[15]; - ps[12] = tmp4; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = tmp3; ps[ 9] = pi + 9; ps[10] = pi + 10; ps[11] = pi + 3; - ps[ 4] = tmp2; ps[ 5] = pi + 8; ps[ 6] = pi + 11; ps[ 7] = pi + 4; - ps[ 0] = tmp1; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - tmp1 = cs[2]; tmp2 = cs[3]; - cs[2] = tmp2; cs[3] = ci; - cs[0] = tmp1; cs[1] = ci + 1; - break; - case 2: - tmp1 = ps[15]; - tmp2 = ps[11]; - ps[12] = ps[3]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = ps[7]; ps[ 9] = pi + 9; ps[10] = pi + 10; ps[11] = pi + 3; - ps[ 4] = tmp2; ps[ 5] = pi + 8; ps[ 6] = pi + 11; ps[ 7] = pi + 4; - ps[ 0] = tmp1; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - tmp1 = cs[3]; - cs[2] = cs[1]; cs[3] = ci; - cs[0] = tmp1; cs[1] = ci + 1; - break; - case 3: - ps[12] = ps[0]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2; - ps[ 8] = ps[1]; ps[ 9] = pi + 9; ps[10] = pi + 10; ps[11] = pi + 3; - ps[ 4] = ps[2]; ps[ 5] = pi + 8; ps[ 6] = pi + 11; ps[ 7] = pi + 4; - ps[ 0] = ps[3]; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5; - cs[2] = cs[0]; cs[3] = ci; - cs[0] = cs[1]; cs[1] = ci + 1; - break; - } - mesh.figures.push({ - type: 'patch', - coords: new Int32Array(ps), // making copies of ps and cs - colors: new Int32Array(cs) - }); - } - } - - function updateBounds(mesh) { - var minX = mesh.coords[0][0], minY = mesh.coords[0][1], - maxX = minX, maxY = minY; - for (var i = 1, ii = mesh.coords.length; i < ii; i++) { - var x = mesh.coords[i][0], y = mesh.coords[i][1]; - minX = minX > x ? x : minX; - minY = minY > y ? y : minY; - maxX = maxX < x ? x : maxX; - maxY = maxY < y ? y : maxY; - } - mesh.bounds = [minX, minY, maxX, maxY]; - } - - function packData(mesh) { - var i, ii, j, jj; - - var coords = mesh.coords; - var coordsPacked = new Float32Array(coords.length * 2); - for (i = 0, j = 0, ii = coords.length; i < ii; i++) { - var xy = coords[i]; - coordsPacked[j++] = xy[0]; - coordsPacked[j++] = xy[1]; - } - mesh.coords = coordsPacked; - - var colors = mesh.colors; - var colorsPacked = new Uint8Array(colors.length * 3); - for (i = 0, j = 0, ii = colors.length; i < ii; i++) { - var c = colors[i]; - colorsPacked[j++] = c[0]; - colorsPacked[j++] = c[1]; - colorsPacked[j++] = c[2]; - } - mesh.colors = colorsPacked; - - var figures = mesh.figures; - for (i = 0, ii = figures.length; i < ii; i++) { - var figure = figures[i], ps = figure.coords, cs = figure.colors; - for (j = 0, jj = ps.length; j < jj; j++) { - ps[j] *= 2; - cs[j] *= 3; - } - } - } - - function Mesh(stream, matrix, xref, res) { - assert(isStream(stream), 'Mesh data is not a stream'); - var dict = stream.dict; - this.matrix = matrix; - this.shadingType = dict.get('ShadingType'); - this.type = 'Pattern'; - this.bbox = dict.getArray('BBox'); - var cs = dict.get('ColorSpace', 'CS'); - cs = ColorSpace.parse(cs, xref, res); - this.cs = cs; - this.background = dict.has('Background') ? - cs.getRgb(dict.get('Background'), 0) : null; - - var fnObj = dict.get('Function'); - var fn = fnObj ? PDFFunction.parseArray(xref, fnObj) : null; - - this.coords = []; - this.colors = []; - this.figures = []; - - var decodeContext = { - bitsPerCoordinate: dict.get('BitsPerCoordinate'), - bitsPerComponent: dict.get('BitsPerComponent'), - bitsPerFlag: dict.get('BitsPerFlag'), - decode: dict.getArray('Decode'), - colorFn: fn, - colorSpace: cs, - numComps: fn ? 1 : cs.numComps - }; - var reader = new MeshStreamReader(stream, decodeContext); - - var patchMesh = false; - switch (this.shadingType) { - case ShadingType.FREE_FORM_MESH: - decodeType4Shading(this, reader); - break; - case ShadingType.LATTICE_FORM_MESH: - var verticesPerRow = dict.get('VerticesPerRow') | 0; - assert(verticesPerRow >= 2, 'Invalid VerticesPerRow'); - decodeType5Shading(this, reader, verticesPerRow); - break; - case ShadingType.COONS_PATCH_MESH: - decodeType6Shading(this, reader); - patchMesh = true; - break; - case ShadingType.TENSOR_PATCH_MESH: - decodeType7Shading(this, reader); - patchMesh = true; - break; - default: - error('Unsupported mesh type.'); - break; - } - - if (patchMesh) { - // dirty bounds calculation for determining, how dense shall be triangles - updateBounds(this); - for (var i = 0, ii = this.figures.length; i < ii; i++) { - buildFigureFromPatch(this, i); - } - } - // calculate bounds - updateBounds(this); - - packData(this); - } - - Mesh.prototype = { - getIR: function Mesh_getIR() { - return ['Mesh', this.shadingType, this.coords, this.colors, this.figures, - this.bounds, this.matrix, this.bbox, this.background]; - } - }; - - return Mesh; -})(); - -Shadings.Dummy = (function DummyClosure() { - function Dummy() { - this.type = 'Pattern'; - } - - Dummy.prototype = { - getIR: function Dummy_getIR() { - return ['Dummy']; - } - }; - return Dummy; -})(); - -function getTilingPatternIR(operatorList, dict, args) { - var matrix = dict.getArray('Matrix'); - var bbox = dict.getArray('BBox'); - var xstep = dict.get('XStep'); - var ystep = dict.get('YStep'); - var paintType = dict.get('PaintType'); - var tilingType = dict.get('TilingType'); - - return [ - 'TilingPattern', args, operatorList, matrix, bbox, xstep, ystep, - paintType, tilingType - ]; -} - -exports.Pattern = Pattern; -exports.getTilingPatternIR = getTilingPatternIR; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreEvaluator = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreStream, root.pdfjsCoreParser, - root.pdfjsCoreImage, root.pdfjsCoreColorSpace, root.pdfjsCoreMurmurHash3, - root.pdfjsCoreFonts, root.pdfjsCoreFunction, root.pdfjsCorePattern, - root.pdfjsCoreCMap, root.pdfjsCoreMetrics, root.pdfjsCoreBidi, - root.pdfjsCoreEncodings, root.pdfjsCoreStandardFonts, - root.pdfjsCoreUnicode, root.pdfjsCoreGlyphList); - } -}(this, function (exports, sharedUtil, corePrimitives, coreStream, coreParser, - coreImage, coreColorSpace, coreMurmurHash3, coreFonts, - coreFunction, corePattern, coreCMap, coreMetrics, coreBidi, - coreEncodings, coreStandardFonts, coreUnicode, - coreGlyphList) { - -var FONT_IDENTITY_MATRIX = sharedUtil.FONT_IDENTITY_MATRIX; -var IDENTITY_MATRIX = sharedUtil.IDENTITY_MATRIX; -var UNSUPPORTED_FEATURES = sharedUtil.UNSUPPORTED_FEATURES; -var ImageKind = sharedUtil.ImageKind; -var OPS = sharedUtil.OPS; -var TextRenderingMode = sharedUtil.TextRenderingMode; -var Util = sharedUtil.Util; -var assert = sharedUtil.assert; -var createPromiseCapability = sharedUtil.createPromiseCapability; -var error = sharedUtil.error; -var info = sharedUtil.info; -var isArray = sharedUtil.isArray; -var isNum = sharedUtil.isNum; -var isString = sharedUtil.isString; -var getLookupTableFactory = sharedUtil.getLookupTableFactory; -var warn = sharedUtil.warn; -var Dict = corePrimitives.Dict; -var Name = corePrimitives.Name; -var isCmd = corePrimitives.isCmd; -var isDict = corePrimitives.isDict; -var isName = corePrimitives.isName; -var isRef = corePrimitives.isRef; -var isStream = corePrimitives.isStream; -var DecodeStream = coreStream.DecodeStream; -var JpegStream = coreStream.JpegStream; -var Stream = coreStream.Stream; -var Lexer = coreParser.Lexer; -var Parser = coreParser.Parser; -var isEOF = coreParser.isEOF; -var PDFImage = coreImage.PDFImage; -var ColorSpace = coreColorSpace.ColorSpace; -var MurmurHash3_64 = coreMurmurHash3.MurmurHash3_64; -var ErrorFont = coreFonts.ErrorFont; -var FontFlags = coreFonts.FontFlags; -var Font = coreFonts.Font; -var IdentityToUnicodeMap = coreFonts.IdentityToUnicodeMap; -var ToUnicodeMap = coreFonts.ToUnicodeMap; -var getFontType = coreFonts.getFontType; -var isPDFFunction = coreFunction.isPDFFunction; -var PDFFunction = coreFunction.PDFFunction; -var Pattern = corePattern.Pattern; -var getTilingPatternIR = corePattern.getTilingPatternIR; -var CMapFactory = coreCMap.CMapFactory; -var IdentityCMap = coreCMap.IdentityCMap; -var getMetrics = coreMetrics.getMetrics; -var bidi = coreBidi.bidi; -var WinAnsiEncoding = coreEncodings.WinAnsiEncoding; -var StandardEncoding = coreEncodings.StandardEncoding; -var MacRomanEncoding = coreEncodings.MacRomanEncoding; -var SymbolSetEncoding = coreEncodings.SymbolSetEncoding; -var ZapfDingbatsEncoding = coreEncodings.ZapfDingbatsEncoding; -var getEncoding = coreEncodings.getEncoding; -var getStdFontMap = coreStandardFonts.getStdFontMap; -var getSerifFonts = coreStandardFonts.getSerifFonts; -var getSymbolsFonts = coreStandardFonts.getSymbolsFonts; -var getNormalizedUnicodes = coreUnicode.getNormalizedUnicodes; -var reverseIfRtl = coreUnicode.reverseIfRtl; -var getUnicodeForGlyph = coreUnicode.getUnicodeForGlyph; -var getGlyphsUnicode = coreGlyphList.getGlyphsUnicode; - -var PartialEvaluator = (function PartialEvaluatorClosure() { - var DefaultPartialEvaluatorOptions = { - forceDataSchema: false, - maxImageSize: -1, - disableFontFace: false, - cMapOptions: { url: null, packed: false } - }; - - function NativeImageDecoder(xref, resources, handler, forceDataSchema) { - this.xref = xref; - this.resources = resources; - this.handler = handler; - this.forceDataSchema = forceDataSchema; - } - NativeImageDecoder.prototype = { - canDecode: function (image) { - return image instanceof JpegStream && - NativeImageDecoder.isDecodable(image, this.xref, this.resources); - }, - decode: function (image) { - // For natively supported JPEGs send them to the main thread for decoding. - var dict = image.dict; - var colorSpace = dict.get('ColorSpace', 'CS'); - colorSpace = ColorSpace.parse(colorSpace, this.xref, this.resources); - var numComps = colorSpace.numComps; - var decodePromise = this.handler.sendWithPromise('JpegDecode', - [image.getIR(this.forceDataSchema), numComps]); - return decodePromise.then(function (message) { - var data = message.data; - return new Stream(data, 0, data.length, image.dict); - }); - } - }; - /** - * Checks if the image can be decoded and displayed by the browser without any - * further processing such as color space conversions. - */ - NativeImageDecoder.isSupported = - function NativeImageDecoder_isSupported(image, xref, res) { - var dict = image.dict; - if (dict.has('DecodeParms') || dict.has('DP')) { - return false; - } - var cs = ColorSpace.parse(dict.get('ColorSpace', 'CS'), xref, res); - return (cs.name === 'DeviceGray' || cs.name === 'DeviceRGB') && - cs.isDefaultDecode(dict.getArray('Decode', 'D')); - }; - /** - * Checks if the image can be decoded by the browser. - */ - NativeImageDecoder.isDecodable = - function NativeImageDecoder_isDecodable(image, xref, res) { - var dict = image.dict; - if (dict.has('DecodeParms') || dict.has('DP')) { - return false; - } - var cs = ColorSpace.parse(dict.get('ColorSpace', 'CS'), xref, res); - return (cs.numComps === 1 || cs.numComps === 3) && - cs.isDefaultDecode(dict.getArray('Decode', 'D')); - }; - - function PartialEvaluator(pdfManager, xref, handler, pageIndex, - uniquePrefix, idCounters, fontCache, options) { - this.pdfManager = pdfManager; - this.xref = xref; - this.handler = handler; - this.pageIndex = pageIndex; - this.uniquePrefix = uniquePrefix; - this.idCounters = idCounters; - this.fontCache = fontCache; - this.options = options || DefaultPartialEvaluatorOptions; - } - - // Trying to minimize Date.now() usage and check every 100 time - var TIME_SLOT_DURATION_MS = 20; - var CHECK_TIME_EVERY = 100; - function TimeSlotManager() { - this.reset(); - } - TimeSlotManager.prototype = { - check: function TimeSlotManager_check() { - if (++this.checked < CHECK_TIME_EVERY) { - return false; - } - this.checked = 0; - return this.endTime <= Date.now(); - }, - reset: function TimeSlotManager_reset() { - this.endTime = Date.now() + TIME_SLOT_DURATION_MS; - this.checked = 0; - } - }; - - var deferred = Promise.resolve(); - - var TILING_PATTERN = 1, SHADING_PATTERN = 2; - - PartialEvaluator.prototype = { - hasBlendModes: function PartialEvaluator_hasBlendModes(resources) { - if (!isDict(resources)) { - return false; - } - - var processed = Object.create(null); - if (resources.objId) { - processed[resources.objId] = true; - } - - var nodes = [resources], xref = this.xref; - while (nodes.length) { - var key, i, ii; - var node = nodes.shift(); - // First check the current resources for blend modes. - var graphicStates = node.get('ExtGState'); - if (isDict(graphicStates)) { - var graphicStatesKeys = graphicStates.getKeys(); - for (i = 0, ii = graphicStatesKeys.length; i < ii; i++) { - key = graphicStatesKeys[i]; - - var graphicState = graphicStates.get(key); - var bm = graphicState.get('BM'); - if (isName(bm) && bm.name !== 'Normal') { - return true; - } - } - } - // Descend into the XObjects to look for more resources and blend modes. - var xObjects = node.get('XObject'); - if (!isDict(xObjects)) { - continue; - } - var xObjectsKeys = xObjects.getKeys(); - for (i = 0, ii = xObjectsKeys.length; i < ii; i++) { - key = xObjectsKeys[i]; - - var xObject = xObjects.getRaw(key); - if (isRef(xObject)) { - if (processed[xObject.toString()]) { - // The XObject has already been processed, and by avoiding a - // redundant `xref.fetch` we can *significantly* reduce the load - // time for badly generated PDF files (fixes issue6961.pdf). - continue; - } - xObject = xref.fetch(xObject); - } - if (!isStream(xObject)) { - continue; - } - if (xObject.dict.objId) { - if (processed[xObject.dict.objId]) { - // stream has objId and is processed already - continue; - } - processed[xObject.dict.objId] = true; - } - var xResources = xObject.dict.get('Resources'); - // Checking objId to detect an infinite loop. - if (isDict(xResources) && - (!xResources.objId || !processed[xResources.objId])) { - nodes.push(xResources); - if (xResources.objId) { - processed[xResources.objId] = true; - } - } - } - } - return false; - }, - - buildFormXObject: function PartialEvaluator_buildFormXObject(resources, - xobj, smask, - operatorList, - task, - initialState) { - var matrix = xobj.dict.getArray('Matrix'); - var bbox = xobj.dict.getArray('BBox'); - var group = xobj.dict.get('Group'); - if (group) { - var groupOptions = { - matrix: matrix, - bbox: bbox, - smask: smask, - isolated: false, - knockout: false - }; - - var groupSubtype = group.get('S'); - var colorSpace; - if (isName(groupSubtype, 'Transparency')) { - groupOptions.isolated = (group.get('I') || false); - groupOptions.knockout = (group.get('K') || false); - colorSpace = (group.has('CS') ? - ColorSpace.parse(group.get('CS'), this.xref, resources) : null); - } - - if (smask && smask.backdrop) { - colorSpace = colorSpace || ColorSpace.singletons.rgb; - smask.backdrop = colorSpace.getRgb(smask.backdrop, 0); - } - - operatorList.addOp(OPS.beginGroup, [groupOptions]); - } - - operatorList.addOp(OPS.paintFormXObjectBegin, [matrix, bbox]); - - return this.getOperatorList(xobj, task, - (xobj.dict.get('Resources') || resources), operatorList, initialState). - then(function () { - operatorList.addOp(OPS.paintFormXObjectEnd, []); - - if (group) { - operatorList.addOp(OPS.endGroup, [groupOptions]); - } - }); - }, - - buildPaintImageXObject: - function PartialEvaluator_buildPaintImageXObject(resources, image, - inline, operatorList, - cacheKey, imageCache) { - var self = this; - var dict = image.dict; - var w = dict.get('Width', 'W'); - var h = dict.get('Height', 'H'); - - if (!(w && isNum(w)) || !(h && isNum(h))) { - warn('Image dimensions are missing, or not numbers.'); - return; - } - var maxImageSize = this.options.maxImageSize; - if (maxImageSize !== -1 && w * h > maxImageSize) { - warn('Image exceeded maximum allowed size and was removed.'); - return; - } - - var imageMask = (dict.get('ImageMask', 'IM') || false); - var imgData, args; - if (imageMask) { - // This depends on a tmpCanvas being filled with the - // current fillStyle, such that processing the pixel - // data can't be done here. Instead of creating a - // complete PDFImage, only read the information needed - // for later. - - var width = dict.get('Width', 'W'); - var height = dict.get('Height', 'H'); - var bitStrideLength = (width + 7) >> 3; - var imgArray = image.getBytes(bitStrideLength * height); - var decode = dict.getArray('Decode', 'D'); - var inverseDecode = (!!decode && decode[0] > 0); - - imgData = PDFImage.createMask(imgArray, width, height, - image instanceof DecodeStream, - inverseDecode); - imgData.cached = true; - args = [imgData]; - operatorList.addOp(OPS.paintImageMaskXObject, args); - if (cacheKey) { - imageCache[cacheKey] = { - fn: OPS.paintImageMaskXObject, - args: args - }; - } - return; - } - - var softMask = (dict.get('SMask', 'SM') || false); - var mask = (dict.get('Mask') || false); - - var SMALL_IMAGE_DIMENSIONS = 200; - // Inlining small images into the queue as RGB data - if (inline && !softMask && !mask && !(image instanceof JpegStream) && - (w + h) < SMALL_IMAGE_DIMENSIONS) { - var imageObj = new PDFImage(this.xref, resources, image, - inline, null, null); - // We force the use of RGBA_32BPP images here, because we can't handle - // any other kind. - imgData = imageObj.createImageData(/* forceRGBA = */ true); - operatorList.addOp(OPS.paintInlineImageXObject, [imgData]); - return; - } - - // If there is no imageMask, create the PDFImage and a lot - // of image processing can be done here. - var uniquePrefix = (this.uniquePrefix || ''); - var objId = 'img_' + uniquePrefix + (++this.idCounters.obj); - operatorList.addDependency(objId); - args = [objId, w, h]; - - if (!softMask && !mask && image instanceof JpegStream && - NativeImageDecoder.isSupported(image, this.xref, resources)) { - // These JPEGs don't need any more processing so we can just send it. - operatorList.addOp(OPS.paintJpegXObject, args); - this.handler.send('obj', - [objId, this.pageIndex, 'JpegStream', - image.getIR(this.options.forceDataSchema)]); - return; - } - - // Creates native image decoder only if a JPEG image or mask is present. - var nativeImageDecoder = null; - if (image instanceof JpegStream || mask instanceof JpegStream || - softMask instanceof JpegStream) { - nativeImageDecoder = new NativeImageDecoder(self.xref, resources, - self.handler, self.options.forceDataSchema); - } - - PDFImage.buildImage(self.handler, self.xref, resources, image, inline, - nativeImageDecoder). - then(function(imageObj) { - var imgData = imageObj.createImageData(/* forceRGBA = */ false); - self.handler.send('obj', [objId, self.pageIndex, 'Image', imgData], - [imgData.data.buffer]); - }).then(undefined, function (reason) { - warn('Unable to decode image: ' + reason); - self.handler.send('obj', [objId, self.pageIndex, 'Image', null]); - }); - - operatorList.addOp(OPS.paintImageXObject, args); - if (cacheKey) { - imageCache[cacheKey] = { - fn: OPS.paintImageXObject, - args: args - }; - } - }, - - handleSMask: function PartialEvaluator_handleSmask(smask, resources, - operatorList, task, - stateManager) { - var smaskContent = smask.get('G'); - var smaskOptions = { - subtype: smask.get('S').name, - backdrop: smask.get('BC') - }; - - // The SMask might have a alpha/luminosity value transfer function -- - // we will build a map of integer values in range 0..255 to be fast. - var transferObj = smask.get('TR'); - if (isPDFFunction(transferObj)) { - var transferFn = PDFFunction.parse(this.xref, transferObj); - var transferMap = new Uint8Array(256); - var tmp = new Float32Array(1); - for (var i = 0; i < 256; i++) { - tmp[0] = i / 255; - transferFn(tmp, 0, tmp, 0); - transferMap[i] = (tmp[0] * 255) | 0; - } - smaskOptions.transferMap = transferMap; - } - - return this.buildFormXObject(resources, smaskContent, smaskOptions, - operatorList, task, stateManager.state.clone()); - }, - - handleTilingType: - function PartialEvaluator_handleTilingType(fn, args, resources, - pattern, patternDict, - operatorList, task) { - // Create an IR of the pattern code. - var tilingOpList = new OperatorList(); - // Merge the available resources, to prevent issues when the patternDict - // is missing some /Resources entries (fixes issue6541.pdf). - var resourcesArray = [patternDict.get('Resources'), resources]; - var patternResources = Dict.merge(this.xref, resourcesArray); - - return this.getOperatorList(pattern, task, patternResources, - tilingOpList).then(function () { - // Add the dependencies to the parent operator list so they are - // resolved before sub operator list is executed synchronously. - operatorList.addDependencies(tilingOpList.dependencies); - operatorList.addOp(fn, getTilingPatternIR({ - fnArray: tilingOpList.fnArray, - argsArray: tilingOpList.argsArray - }, patternDict, args)); - }); - }, - - handleSetFont: - function PartialEvaluator_handleSetFont(resources, fontArgs, fontRef, - operatorList, task, state) { - // TODO(mack): Not needed? - var fontName; - if (fontArgs) { - fontArgs = fontArgs.slice(); - fontName = fontArgs[0].name; - } - - var self = this; - return this.loadFont(fontName, fontRef, this.xref, resources).then( - function (translated) { - if (!translated.font.isType3Font) { - return translated; - } - return translated.loadType3Data(self, resources, operatorList, task). - then(function () { - return translated; - }, function (reason) { - // Error in the font data -- sending unsupported feature notification. - self.handler.send('UnsupportedFeature', - {featureId: UNSUPPORTED_FEATURES.font}); - return new TranslatedFont('g_font_error', - new ErrorFont('Type3 font load error: ' + reason), translated.font); - }); - }).then(function (translated) { - state.font = translated.font; - translated.send(self.handler); - return translated.loadedName; - }); - }, - - handleText: function PartialEvaluator_handleText(chars, state) { - var font = state.font; - var glyphs = font.charsToGlyphs(chars); - var isAddToPathSet = !!(state.textRenderingMode & - TextRenderingMode.ADD_TO_PATH_FLAG); - if (font.data && (isAddToPathSet || this.options.disableFontFace)) { - var buildPath = function (fontChar) { - if (!font.renderer.hasBuiltPath(fontChar)) { - var path = font.renderer.getPathJs(fontChar); - this.handler.send('commonobj', [ - font.loadedName + '_path_' + fontChar, - 'FontPath', - path - ]); - } - }.bind(this); - - for (var i = 0, ii = glyphs.length; i < ii; i++) { - var glyph = glyphs[i]; - buildPath(glyph.fontChar); - - // If the glyph has an accent we need to build a path for its - // fontChar too, otherwise CanvasGraphics_paintChar will fail. - var accent = glyph.accent; - if (accent && accent.fontChar) { - buildPath(accent.fontChar); - } - } - } - - return glyphs; - }, - - setGState: function PartialEvaluator_setGState(resources, gState, - operatorList, task, - xref, stateManager) { - // This array holds the converted/processed state data. - var gStateObj = []; - var gStateKeys = gState.getKeys(); - var self = this; - var promise = Promise.resolve(); - for (var i = 0, ii = gStateKeys.length; i < ii; i++) { - var key = gStateKeys[i]; - var value = gState.get(key); - switch (key) { - case 'Type': - break; - case 'LW': - case 'LC': - case 'LJ': - case 'ML': - case 'D': - case 'RI': - case 'FL': - case 'CA': - case 'ca': - gStateObj.push([key, value]); - break; - case 'Font': - promise = promise.then(function () { - return self.handleSetFont(resources, null, value[0], operatorList, - task, stateManager.state). - then(function (loadedName) { - operatorList.addDependency(loadedName); - gStateObj.push([key, [loadedName, value[1]]]); - }); - }); - break; - case 'BM': - gStateObj.push([key, value]); - break; - case 'SMask': - if (isName(value, 'None')) { - gStateObj.push([key, false]); - break; - } - if (isDict(value)) { - promise = promise.then(function (dict) { - return self.handleSMask(dict, resources, operatorList, - task, stateManager); - }.bind(this, value)); - gStateObj.push([key, true]); - } else { - warn('Unsupported SMask type'); - } - - break; - // Only generate info log messages for the following since - // they are unlikely to have a big impact on the rendering. - case 'OP': - case 'op': - case 'OPM': - case 'BG': - case 'BG2': - case 'UCR': - case 'UCR2': - case 'TR': - case 'TR2': - case 'HT': - case 'SM': - case 'SA': - case 'AIS': - case 'TK': - // TODO implement these operators. - info('graphic state operator ' + key); - break; - default: - info('Unknown graphic state operator ' + key); - break; - } - } - return promise.then(function () { - if (gStateObj.length > 0) { - operatorList.addOp(OPS.setGState, [gStateObj]); - } - }); - }, - - loadFont: function PartialEvaluator_loadFont(fontName, font, xref, - resources) { - - function errorFont() { - return Promise.resolve(new TranslatedFont('g_font_error', - new ErrorFont('Font ' + fontName + ' is not available'), font)); - } - var fontRef; - if (font) { // Loading by ref. - assert(isRef(font)); - fontRef = font; - } else { // Loading by name. - var fontRes = resources.get('Font'); - if (fontRes) { - fontRef = fontRes.getRaw(fontName); - } else { - warn('fontRes not available'); - return errorFont(); - } - } - if (!fontRef) { - warn('fontRef not available'); - return errorFont(); - } - - if (this.fontCache.has(fontRef)) { - return this.fontCache.get(fontRef); - } - - font = xref.fetchIfRef(fontRef); - if (!isDict(font)) { - return errorFont(); - } - - // We are holding `font.translated` references just for `fontRef`s that - // are not actually `Ref`s, but rather `Dict`s. See explanation below. - if (font.translated) { - return font.translated; - } - - var fontCapability = createPromiseCapability(); - - var preEvaluatedFont = this.preEvaluateFont(font, xref); - var descriptor = preEvaluatedFont.descriptor; - - var fontRefIsRef = isRef(fontRef), fontID; - if (fontRefIsRef) { - fontID = fontRef.toString(); - } - - if (isDict(descriptor)) { - if (!descriptor.fontAliases) { - descriptor.fontAliases = Object.create(null); - } - - var fontAliases = descriptor.fontAliases; - var hash = preEvaluatedFont.hash; - if (fontAliases[hash]) { - var aliasFontRef = fontAliases[hash].aliasRef; - if (fontRefIsRef && aliasFontRef && - this.fontCache.has(aliasFontRef)) { - this.fontCache.putAlias(fontRef, aliasFontRef); - return this.fontCache.get(fontRef); - } - } else { - fontAliases[hash] = { - fontID: Font.getFontID() - }; - } - - if (fontRefIsRef) { - fontAliases[hash].aliasRef = fontRef; - } - fontID = fontAliases[hash].fontID; - } - - // Workaround for bad PDF generators that reference fonts incorrectly, - // where `fontRef` is a `Dict` rather than a `Ref` (fixes bug946506.pdf). - // In this case we should not put the font into `this.fontCache` (which is - // a `RefSetCache`), since it's not meaningful to use a `Dict` as a key. - // - // However, if we don't cache the font it's not possible to remove it - // when `cleanup` is triggered from the API, which causes issues on - // subsequent rendering operations (see issue7403.pdf). - // A simple workaround would be to just not hold `font.translated` - // references in this case, but this would force us to unnecessarily load - // the same fonts over and over. - // - // Instead, we cheat a bit by attempting to use a modified `fontID` as a - // key in `this.fontCache`, to allow the font to be cached. - // NOTE: This works because `RefSetCache` calls `toString()` on provided - // keys. Also, since `fontRef` is used when getting cached fonts, - // we'll not accidentally match fonts cached with the `fontID`. - if (fontRefIsRef) { - this.fontCache.put(fontRef, fontCapability.promise); - } else { - if (!fontID) { - fontID = (this.uniquePrefix || 'F_') + (++this.idCounters.obj); - } - this.fontCache.put('id_' + fontID, fontCapability.promise); - } - assert(fontID, 'The "fontID" must be defined.'); - - // Keep track of each font we translated so the caller can - // load them asynchronously before calling display on a page. - font.loadedName = 'g_' + this.pdfManager.docId + '_f' + fontID; - - font.translated = fontCapability.promise; - - // TODO move promises into translate font - var translatedPromise; - try { - translatedPromise = this.translateFont(preEvaluatedFont, xref); - } catch (e) { - translatedPromise = Promise.reject(e); - } - - var self = this; - translatedPromise.then(function (translatedFont) { - if (translatedFont.fontType !== undefined) { - var xrefFontStats = xref.stats.fontTypes; - xrefFontStats[translatedFont.fontType] = true; - } - - fontCapability.resolve(new TranslatedFont(font.loadedName, - translatedFont, font)); - }, function (reason) { - // TODO fontCapability.reject? - // Error in the font data -- sending unsupported feature notification. - self.handler.send('UnsupportedFeature', - {featureId: UNSUPPORTED_FEATURES.font}); - - try { - // error, but it's still nice to have font type reported - var descriptor = preEvaluatedFont.descriptor; - var fontFile3 = descriptor && descriptor.get('FontFile3'); - var subtype = fontFile3 && fontFile3.get('Subtype'); - var fontType = getFontType(preEvaluatedFont.type, - subtype && subtype.name); - var xrefFontStats = xref.stats.fontTypes; - xrefFontStats[fontType] = true; - } catch (ex) { } - - fontCapability.resolve(new TranslatedFont(font.loadedName, - new ErrorFont(reason instanceof Error ? reason.message : reason), - font)); - }); - return fontCapability.promise; - }, - - buildPath: function PartialEvaluator_buildPath(operatorList, fn, args) { - var lastIndex = operatorList.length - 1; - if (!args) { - args = []; - } - if (lastIndex < 0 || - operatorList.fnArray[lastIndex] !== OPS.constructPath) { - operatorList.addOp(OPS.constructPath, [[fn], args]); - } else { - var opArgs = operatorList.argsArray[lastIndex]; - opArgs[0].push(fn); - Array.prototype.push.apply(opArgs[1], args); - } - }, - - handleColorN: function PartialEvaluator_handleColorN(operatorList, fn, args, - cs, patterns, resources, task, xref) { - // compile tiling patterns - var patternName = args[args.length - 1]; - // SCN/scn applies patterns along with normal colors - var pattern; - if (isName(patternName) && - (pattern = patterns.get(patternName.name))) { - var dict = (isStream(pattern) ? pattern.dict : pattern); - var typeNum = dict.get('PatternType'); - - if (typeNum === TILING_PATTERN) { - var color = cs.base ? cs.base.getRgb(args, 0) : null; - return this.handleTilingType(fn, color, resources, pattern, - dict, operatorList, task); - } else if (typeNum === SHADING_PATTERN) { - var shading = dict.get('Shading'); - var matrix = dict.getArray('Matrix'); - pattern = Pattern.parseShading(shading, matrix, xref, resources, - this.handler); - operatorList.addOp(fn, pattern.getIR()); - return Promise.resolve(); - } else { - return Promise.reject('Unknown PatternType: ' + typeNum); - } - } - // TODO shall we fail here? - operatorList.addOp(fn, args); - return Promise.resolve(); - }, - - getOperatorList: function PartialEvaluator_getOperatorList(stream, - task, - resources, - operatorList, - initialState) { - - var self = this; - var xref = this.xref; - var imageCache = Object.create(null); - - assert(operatorList); - - resources = (resources || Dict.empty); - var xobjs = (resources.get('XObject') || Dict.empty); - var patterns = (resources.get('Pattern') || Dict.empty); - var stateManager = new StateManager(initialState || new EvalState()); - var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); - var timeSlotManager = new TimeSlotManager(); - - return new Promise(function promiseBody(resolve, reject) { - var next = function (promise) { - promise.then(function () { - try { - promiseBody(resolve, reject); - } catch (ex) { - reject(ex); - } - }, reject); - }; - task.ensureNotTerminated(); - timeSlotManager.reset(); - var stop, operation = {}, i, ii, cs; - while (!(stop = timeSlotManager.check())) { - // The arguments parsed by read() are used beyond this loop, so we - // cannot reuse the same array on each iteration. Therefore we pass - // in |null| as the initial value (see the comment on - // EvaluatorPreprocessor_read() for why). - operation.args = null; - if (!(preprocessor.read(operation))) { - break; - } - var args = operation.args; - var fn = operation.fn; - - switch (fn | 0) { - case OPS.paintXObject: - if (args[0].code) { - break; - } - // eagerly compile XForm objects - var name = args[0].name; - if (!name) { - warn('XObject must be referred to by name.'); - continue; - } - if (imageCache[name] !== undefined) { - operatorList.addOp(imageCache[name].fn, imageCache[name].args); - args = null; - continue; - } - - var xobj = xobjs.get(name); - if (xobj) { - assert(isStream(xobj), 'XObject should be a stream'); - - var type = xobj.dict.get('Subtype'); - assert(isName(type), 'XObject should have a Name subtype'); - - if (type.name === 'Form') { - stateManager.save(); - next(self.buildFormXObject(resources, xobj, null, - operatorList, task, - stateManager.state.clone()). - then(function () { - stateManager.restore(); - })); - return; - } else if (type.name === 'Image') { - self.buildPaintImageXObject(resources, xobj, false, - operatorList, name, imageCache); - args = null; - continue; - } else if (type.name === 'PS') { - // PostScript XObjects are unused when viewing documents. - // See section 4.7.1 of Adobe's PDF reference. - info('Ignored XObject subtype PS'); - continue; - } else { - error('Unhandled XObject subtype ' + type.name); - } - } - break; - case OPS.setFont: - var fontSize = args[1]; - // eagerly collect all fonts - next(self.handleSetFont(resources, args, null, operatorList, - task, stateManager.state). - then(function (loadedName) { - operatorList.addDependency(loadedName); - operatorList.addOp(OPS.setFont, [loadedName, fontSize]); - })); - return; - case OPS.endInlineImage: - var cacheKey = args[0].cacheKey; - if (cacheKey) { - var cacheEntry = imageCache[cacheKey]; - if (cacheEntry !== undefined) { - operatorList.addOp(cacheEntry.fn, cacheEntry.args); - args = null; - continue; - } - } - self.buildPaintImageXObject(resources, args[0], true, - operatorList, cacheKey, imageCache); - args = null; - continue; - case OPS.showText: - args[0] = self.handleText(args[0], stateManager.state); - break; - case OPS.showSpacedText: - var arr = args[0]; - var combinedGlyphs = []; - var arrLength = arr.length; - var state = stateManager.state; - for (i = 0; i < arrLength; ++i) { - var arrItem = arr[i]; - if (isString(arrItem)) { - Array.prototype.push.apply(combinedGlyphs, - self.handleText(arrItem, state)); - } else if (isNum(arrItem)) { - combinedGlyphs.push(arrItem); - } - } - args[0] = combinedGlyphs; - fn = OPS.showText; - break; - case OPS.nextLineShowText: - operatorList.addOp(OPS.nextLine); - args[0] = self.handleText(args[0], stateManager.state); - fn = OPS.showText; - break; - case OPS.nextLineSetSpacingShowText: - operatorList.addOp(OPS.nextLine); - operatorList.addOp(OPS.setWordSpacing, [args.shift()]); - operatorList.addOp(OPS.setCharSpacing, [args.shift()]); - args[0] = self.handleText(args[0], stateManager.state); - fn = OPS.showText; - break; - case OPS.setTextRenderingMode: - stateManager.state.textRenderingMode = args[0]; - break; - - case OPS.setFillColorSpace: - stateManager.state.fillColorSpace = - ColorSpace.parse(args[0], xref, resources); - continue; - case OPS.setStrokeColorSpace: - stateManager.state.strokeColorSpace = - ColorSpace.parse(args[0], xref, resources); - continue; - case OPS.setFillColor: - cs = stateManager.state.fillColorSpace; - args = cs.getRgb(args, 0); - fn = OPS.setFillRGBColor; - break; - case OPS.setStrokeColor: - cs = stateManager.state.strokeColorSpace; - args = cs.getRgb(args, 0); - fn = OPS.setStrokeRGBColor; - break; - case OPS.setFillGray: - stateManager.state.fillColorSpace = ColorSpace.singletons.gray; - args = ColorSpace.singletons.gray.getRgb(args, 0); - fn = OPS.setFillRGBColor; - break; - case OPS.setStrokeGray: - stateManager.state.strokeColorSpace = ColorSpace.singletons.gray; - args = ColorSpace.singletons.gray.getRgb(args, 0); - fn = OPS.setStrokeRGBColor; - break; - case OPS.setFillCMYKColor: - stateManager.state.fillColorSpace = ColorSpace.singletons.cmyk; - args = ColorSpace.singletons.cmyk.getRgb(args, 0); - fn = OPS.setFillRGBColor; - break; - case OPS.setStrokeCMYKColor: - stateManager.state.strokeColorSpace = ColorSpace.singletons.cmyk; - args = ColorSpace.singletons.cmyk.getRgb(args, 0); - fn = OPS.setStrokeRGBColor; - break; - case OPS.setFillRGBColor: - stateManager.state.fillColorSpace = ColorSpace.singletons.rgb; - args = ColorSpace.singletons.rgb.getRgb(args, 0); - break; - case OPS.setStrokeRGBColor: - stateManager.state.strokeColorSpace = ColorSpace.singletons.rgb; - args = ColorSpace.singletons.rgb.getRgb(args, 0); - break; - case OPS.setFillColorN: - cs = stateManager.state.fillColorSpace; - if (cs.name === 'Pattern') { - next(self.handleColorN(operatorList, OPS.setFillColorN, args, - cs, patterns, resources, task, xref)); - return; - } - args = cs.getRgb(args, 0); - fn = OPS.setFillRGBColor; - break; - case OPS.setStrokeColorN: - cs = stateManager.state.strokeColorSpace; - if (cs.name === 'Pattern') { - next(self.handleColorN(operatorList, OPS.setStrokeColorN, args, - cs, patterns, resources, task, xref)); - return; - } - args = cs.getRgb(args, 0); - fn = OPS.setStrokeRGBColor; - break; - - case OPS.shadingFill: - var shadingRes = resources.get('Shading'); - if (!shadingRes) { - error('No shading resource found'); - } - - var shading = shadingRes.get(args[0].name); - if (!shading) { - error('No shading object found'); - } - - var shadingFill = Pattern.parseShading(shading, null, xref, - resources, self.handler); - var patternIR = shadingFill.getIR(); - args = [patternIR]; - fn = OPS.shadingFill; - break; - case OPS.setGState: - var dictName = args[0]; - var extGState = resources.get('ExtGState'); - - if (!isDict(extGState) || !extGState.has(dictName.name)) { - break; - } - - var gState = extGState.get(dictName.name); - next(self.setGState(resources, gState, operatorList, task, xref, - stateManager)); - return; - case OPS.moveTo: - case OPS.lineTo: - case OPS.curveTo: - case OPS.curveTo2: - case OPS.curveTo3: - case OPS.closePath: - self.buildPath(operatorList, fn, args); - continue; - case OPS.rectangle: - self.buildPath(operatorList, fn, args); - continue; - case OPS.markPoint: - case OPS.markPointProps: - case OPS.beginMarkedContent: - case OPS.beginMarkedContentProps: - case OPS.endMarkedContent: - case OPS.beginCompat: - case OPS.endCompat: - // Ignore operators where the corresponding handlers are known to - // be no-op in CanvasGraphics (display/canvas.js). This prevents - // serialization errors and is also a bit more efficient. - // We could also try to serialize all objects in a general way, - // e.g. as done in https://github.com/mozilla/pdf.js/pull/6266, - // but doing so is meaningless without knowing the semantics. - continue; - default: - // Note: Ignore the operator if it has `Dict` arguments, since - // those are non-serializable, otherwise postMessage will throw - // "An object could not be cloned.". - if (args !== null) { - for (i = 0, ii = args.length; i < ii; i++) { - if (args[i] instanceof Dict) { - break; - } - } - if (i < ii) { - warn('getOperatorList - ignoring operator: ' + fn); - continue; - } - } - } - operatorList.addOp(fn, args); - } - if (stop) { - next(deferred); - return; - } - // Some PDFs don't close all restores inside object/form. - // Closing those for them. - for (i = 0, ii = preprocessor.savedStatesDepth; i < ii; i++) { - operatorList.addOp(OPS.restore, []); - } - resolve(); - }); - }, - - getTextContent: - function PartialEvaluator_getTextContent(stream, task, resources, - stateManager, - normalizeWhitespace, - combineTextItems) { - - stateManager = (stateManager || new StateManager(new TextState())); - - var WhitespaceRegexp = /\s/g; - - var textContent = { - items: [], - styles: Object.create(null) - }; - var textContentItem = { - initialized: false, - str: [], - width: 0, - height: 0, - vertical: false, - lastAdvanceWidth: 0, - lastAdvanceHeight: 0, - textAdvanceScale: 0, - spaceWidth: 0, - fakeSpaceMin: Infinity, - fakeMultiSpaceMin: Infinity, - fakeMultiSpaceMax: -0, - textRunBreakAllowed: false, - transform: null, - fontName: null - }; - var SPACE_FACTOR = 0.3; - var MULTI_SPACE_FACTOR = 1.5; - var MULTI_SPACE_FACTOR_MAX = 4; - - var self = this; - var xref = this.xref; - - resources = (xref.fetchIfRef(resources) || Dict.empty); - - // The xobj is parsed iff it's needed, e.g. if there is a `DO` cmd. - var xobjs = null; - var xobjsCache = Object.create(null); - - var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); - - var textState; - - function ensureTextContentItem() { - if (textContentItem.initialized) { - return textContentItem; - } - var font = textState.font; - if (!(font.loadedName in textContent.styles)) { - textContent.styles[font.loadedName] = { - fontFamily: font.fallbackName, - ascent: font.ascent, - descent: font.descent, - vertical: font.vertical - }; - } - textContentItem.fontName = font.loadedName; - - // 9.4.4 Text Space Details - var tsm = [textState.fontSize * textState.textHScale, 0, - 0, textState.fontSize, - 0, textState.textRise]; - - if (font.isType3Font && - textState.fontMatrix !== FONT_IDENTITY_MATRIX && - textState.fontSize === 1) { - var glyphHeight = font.bbox[3] - font.bbox[1]; - if (glyphHeight > 0) { - glyphHeight = glyphHeight * textState.fontMatrix[3]; - tsm[3] *= glyphHeight; - } - } - - var trm = Util.transform(textState.ctm, - Util.transform(textState.textMatrix, tsm)); - textContentItem.transform = trm; - if (!font.vertical) { - textContentItem.width = 0; - textContentItem.height = Math.sqrt(trm[2] * trm[2] + trm[3] * trm[3]); - textContentItem.vertical = false; - } else { - textContentItem.width = Math.sqrt(trm[0] * trm[0] + trm[1] * trm[1]); - textContentItem.height = 0; - textContentItem.vertical = true; - } - - var a = textState.textLineMatrix[0]; - var b = textState.textLineMatrix[1]; - var scaleLineX = Math.sqrt(a * a + b * b); - a = textState.ctm[0]; - b = textState.ctm[1]; - var scaleCtmX = Math.sqrt(a * a + b * b); - textContentItem.textAdvanceScale = scaleCtmX * scaleLineX; - textContentItem.lastAdvanceWidth = 0; - textContentItem.lastAdvanceHeight = 0; - - var spaceWidth = font.spaceWidth / 1000 * textState.fontSize; - if (spaceWidth) { - textContentItem.spaceWidth = spaceWidth; - textContentItem.fakeSpaceMin = spaceWidth * SPACE_FACTOR; - textContentItem.fakeMultiSpaceMin = spaceWidth * MULTI_SPACE_FACTOR; - textContentItem.fakeMultiSpaceMax = - spaceWidth * MULTI_SPACE_FACTOR_MAX; - // It's okay for monospace fonts to fake as much space as needed. - textContentItem.textRunBreakAllowed = !font.isMonospace; - } else { - textContentItem.spaceWidth = 0; - textContentItem.fakeSpaceMin = Infinity; - textContentItem.fakeMultiSpaceMin = Infinity; - textContentItem.fakeMultiSpaceMax = 0; - textContentItem.textRunBreakAllowed = false; - } - - - textContentItem.initialized = true; - return textContentItem; - } - - function replaceWhitespace(str) { - // Replaces all whitespaces with standard spaces (0x20), to avoid - // alignment issues between the textLayer and the canvas if the text - // contains e.g. tabs (fixes issue6612.pdf). - var i = 0, ii = str.length, code; - while (i < ii && (code = str.charCodeAt(i)) >= 0x20 && code <= 0x7F) { - i++; - } - return (i < ii ? str.replace(WhitespaceRegexp, ' ') : str); - } - - function runBidiTransform(textChunk) { - var str = textChunk.str.join(''); - var bidiResult = bidi(str, -1, textChunk.vertical); - return { - str: (normalizeWhitespace ? replaceWhitespace(bidiResult.str) : - bidiResult.str), - dir: bidiResult.dir, - width: textChunk.width, - height: textChunk.height, - transform: textChunk.transform, - fontName: textChunk.fontName - }; - } - - function handleSetFont(fontName, fontRef) { - return self.loadFont(fontName, fontRef, xref, resources). - then(function (translated) { - textState.font = translated.font; - textState.fontMatrix = translated.font.fontMatrix || - FONT_IDENTITY_MATRIX; - }); - } - - function buildTextContentItem(chars) { - var font = textState.font; - var textChunk = ensureTextContentItem(); - var width = 0; - var height = 0; - var glyphs = font.charsToGlyphs(chars); - var defaultVMetrics = font.defaultVMetrics; - for (var i = 0; i < glyphs.length; i++) { - var glyph = glyphs[i]; - var vMetricX = null; - var vMetricY = null; - var glyphWidth = null; - if (font.vertical) { - if (glyph.vmetric) { - glyphWidth = glyph.vmetric[0]; - vMetricX = glyph.vmetric[1]; - vMetricY = glyph.vmetric[2]; - } else { - glyphWidth = glyph.width; - vMetricX = glyph.width * 0.5; - vMetricY = defaultVMetrics[2]; - } - } else { - glyphWidth = glyph.width; - } - - var glyphUnicode = glyph.unicode; - var NormalizedUnicodes = getNormalizedUnicodes(); - if (NormalizedUnicodes[glyphUnicode] !== undefined) { - glyphUnicode = NormalizedUnicodes[glyphUnicode]; - } - glyphUnicode = reverseIfRtl(glyphUnicode); - - // The following will calculate the x and y of the individual glyphs. - // if (font.vertical) { - // tsm[4] -= vMetricX * Math.abs(textState.fontSize) * - // textState.fontMatrix[0]; - // tsm[5] -= vMetricY * textState.fontSize * - // textState.fontMatrix[0]; - // } - // var trm = Util.transform(textState.textMatrix, tsm); - // var pt = Util.applyTransform([trm[4], trm[5]], textState.ctm); - // var x = pt[0]; - // var y = pt[1]; - - var charSpacing = textState.charSpacing; - if (glyph.isSpace) { - var wordSpacing = textState.wordSpacing; - charSpacing += wordSpacing; - if (wordSpacing > 0) { - addFakeSpaces(wordSpacing, textChunk.str); - } - } - - var tx = 0; - var ty = 0; - if (!font.vertical) { - var w0 = glyphWidth * textState.fontMatrix[0]; - tx = (w0 * textState.fontSize + charSpacing) * - textState.textHScale; - width += tx; - } else { - var w1 = glyphWidth * textState.fontMatrix[0]; - ty = w1 * textState.fontSize + charSpacing; - height += ty; - } - textState.translateTextMatrix(tx, ty); - - textChunk.str.push(glyphUnicode); - } - - if (!font.vertical) { - textChunk.lastAdvanceWidth = width; - textChunk.width += width * textChunk.textAdvanceScale; - } else { - textChunk.lastAdvanceHeight = height; - textChunk.height += Math.abs(height * textChunk.textAdvanceScale); - } - - return textChunk; - } - - function addFakeSpaces(width, strBuf) { - if (width < textContentItem.fakeSpaceMin) { - return; - } - if (width < textContentItem.fakeMultiSpaceMin) { - strBuf.push(' '); - return; - } - var fakeSpaces = Math.round(width / textContentItem.spaceWidth); - while (fakeSpaces-- > 0) { - strBuf.push(' '); - } - } - - function flushTextContentItem() { - if (!textContentItem.initialized) { - return; - } - textContent.items.push(runBidiTransform(textContentItem)); - - textContentItem.initialized = false; - textContentItem.str.length = 0; - } - - var timeSlotManager = new TimeSlotManager(); - - return new Promise(function promiseBody(resolve, reject) { - var next = function (promise) { - promise.then(function () { - try { - promiseBody(resolve, reject); - } catch (ex) { - reject(ex); - } - }, reject); - }; - task.ensureNotTerminated(); - timeSlotManager.reset(); - var stop, operation = {}, args = []; - while (!(stop = timeSlotManager.check())) { - // The arguments parsed by read() are not used beyond this loop, so - // we can reuse the same array on every iteration, thus avoiding - // unnecessary allocations. - args.length = 0; - operation.args = args; - if (!(preprocessor.read(operation))) { - break; - } - textState = stateManager.state; - var fn = operation.fn; - args = operation.args; - var advance, diff; - - switch (fn | 0) { - case OPS.setFont: - // Optimization to ignore multiple identical Tf commands. - var fontNameArg = args[0].name, fontSizeArg = args[1]; - if (textState.font && fontNameArg === textState.fontName && - fontSizeArg === textState.fontSize) { - break; - } - - flushTextContentItem(); - textState.fontName = fontNameArg; - textState.fontSize = fontSizeArg; - next(handleSetFont(fontNameArg, null)); - return; - case OPS.setTextRise: - flushTextContentItem(); - textState.textRise = args[0]; - break; - case OPS.setHScale: - flushTextContentItem(); - textState.textHScale = args[0] / 100; - break; - case OPS.setLeading: - flushTextContentItem(); - textState.leading = args[0]; - break; - case OPS.moveText: - // Optimization to treat same line movement as advance - var isSameTextLine = !textState.font ? false : - ((textState.font.vertical ? args[0] : args[1]) === 0); - advance = args[0] - args[1]; - if (combineTextItems && - isSameTextLine && textContentItem.initialized && - advance > 0 && - advance <= textContentItem.fakeMultiSpaceMax) { - textState.translateTextLineMatrix(args[0], args[1]); - textContentItem.width += - (args[0] - textContentItem.lastAdvanceWidth); - textContentItem.height += - (args[1] - textContentItem.lastAdvanceHeight); - diff = (args[0] - textContentItem.lastAdvanceWidth) - - (args[1] - textContentItem.lastAdvanceHeight); - addFakeSpaces(diff, textContentItem.str); - break; - } - - flushTextContentItem(); - textState.translateTextLineMatrix(args[0], args[1]); - textState.textMatrix = textState.textLineMatrix.slice(); - break; - case OPS.setLeadingMoveText: - flushTextContentItem(); - textState.leading = -args[1]; - textState.translateTextLineMatrix(args[0], args[1]); - textState.textMatrix = textState.textLineMatrix.slice(); - break; - case OPS.nextLine: - flushTextContentItem(); - textState.carriageReturn(); - break; - case OPS.setTextMatrix: - // Optimization to treat same line movement as advance. - advance = textState.calcTextLineMatrixAdvance( - args[0], args[1], args[2], args[3], args[4], args[5]); - if (combineTextItems && - advance !== null && textContentItem.initialized && - advance.value > 0 && - advance.value <= textContentItem.fakeMultiSpaceMax) { - textState.translateTextLineMatrix(advance.width, - advance.height); - textContentItem.width += - (advance.width - textContentItem.lastAdvanceWidth); - textContentItem.height += - (advance.height - textContentItem.lastAdvanceHeight); - diff = (advance.width - textContentItem.lastAdvanceWidth) - - (advance.height - textContentItem.lastAdvanceHeight); - addFakeSpaces(diff, textContentItem.str); - break; - } - - flushTextContentItem(); - textState.setTextMatrix(args[0], args[1], args[2], args[3], - args[4], args[5]); - textState.setTextLineMatrix(args[0], args[1], args[2], args[3], - args[4], args[5]); - break; - case OPS.setCharSpacing: - textState.charSpacing = args[0]; - break; - case OPS.setWordSpacing: - textState.wordSpacing = args[0]; - break; - case OPS.beginText: - flushTextContentItem(); - textState.textMatrix = IDENTITY_MATRIX.slice(); - textState.textLineMatrix = IDENTITY_MATRIX.slice(); - break; - case OPS.showSpacedText: - var items = args[0]; - var offset; - for (var j = 0, jj = items.length; j < jj; j++) { - if (typeof items[j] === 'string') { - buildTextContentItem(items[j]); - } else { - ensureTextContentItem(); - - // PDF Specification 5.3.2 states: - // The number is expressed in thousandths of a unit of text - // space. - // This amount is subtracted from the current horizontal or - // vertical coordinate, depending on the writing mode. - // In the default coordinate system, a positive adjustment - // has the effect of moving the next glyph painted either to - // the left or down by the given amount. - advance = items[j] * textState.fontSize / 1000; - var breakTextRun = false; - if (textState.font.vertical) { - offset = advance * - (textState.textHScale * textState.textMatrix[2] + - textState.textMatrix[3]); - textState.translateTextMatrix(0, advance); - breakTextRun = textContentItem.textRunBreakAllowed && - advance > textContentItem.fakeMultiSpaceMax; - if (!breakTextRun) { - // Value needs to be added to height to paint down. - textContentItem.height += offset; - } - } else { - advance = -advance; - offset = advance * ( - textState.textHScale * textState.textMatrix[0] + - textState.textMatrix[1]); - textState.translateTextMatrix(advance, 0); - breakTextRun = textContentItem.textRunBreakAllowed && - advance > textContentItem.fakeMultiSpaceMax; - if (!breakTextRun) { - // Value needs to be subtracted from width to paint left. - textContentItem.width += offset; - } - } - if (breakTextRun) { - flushTextContentItem(); - } else if (advance > 0) { - addFakeSpaces(advance, textContentItem.str); - } - } - } - break; - case OPS.showText: - buildTextContentItem(args[0]); - break; - case OPS.nextLineShowText: - flushTextContentItem(); - textState.carriageReturn(); - buildTextContentItem(args[0]); - break; - case OPS.nextLineSetSpacingShowText: - flushTextContentItem(); - textState.wordSpacing = args[0]; - textState.charSpacing = args[1]; - textState.carriageReturn(); - buildTextContentItem(args[2]); - break; - case OPS.paintXObject: - flushTextContentItem(); - if (args[0].code) { - break; - } - - if (!xobjs) { - xobjs = (resources.get('XObject') || Dict.empty); - } - - var name = args[0].name; - if (xobjsCache.key === name) { - if (xobjsCache.texts) { - Util.appendToArray(textContent.items, xobjsCache.texts.items); - Util.extendObj(textContent.styles, xobjsCache.texts.styles); - } - break; - } - - var xobj = xobjs.get(name); - if (!xobj) { - break; - } - assert(isStream(xobj), 'XObject should be a stream'); - - var type = xobj.dict.get('Subtype'); - assert(isName(type), 'XObject should have a Name subtype'); - - if ('Form' !== type.name) { - xobjsCache.key = name; - xobjsCache.texts = null; - break; - } - - stateManager.save(); - var matrix = xobj.dict.getArray('Matrix'); - if (isArray(matrix) && matrix.length === 6) { - stateManager.transform(matrix); - } - - next(self.getTextContent(xobj, task, - xobj.dict.get('Resources') || resources, stateManager, - normalizeWhitespace, combineTextItems).then( - function (formTextContent) { - Util.appendToArray(textContent.items, formTextContent.items); - Util.extendObj(textContent.styles, formTextContent.styles); - stateManager.restore(); - - xobjsCache.key = name; - xobjsCache.texts = formTextContent; - })); - return; - case OPS.setGState: - flushTextContentItem(); - var dictName = args[0]; - var extGState = resources.get('ExtGState'); - - if (!isDict(extGState) || !isName(dictName)) { - break; - } - var gState = extGState.get(dictName.name); - if (!isDict(gState)) { - break; - } - var gStateFont = gState.get('Font'); - if (gStateFont) { - textState.fontName = null; - textState.fontSize = gStateFont[1]; - next(handleSetFont(null, gStateFont[0])); - return; - } - break; - } // switch - } // while - if (stop) { - next(deferred); - return; - } - flushTextContentItem(); - resolve(textContent); - }); - }, - - extractDataStructures: - function PartialEvaluator_extractDataStructures(dict, baseDict, - xref, properties) { - // 9.10.2 - var toUnicode = (dict.get('ToUnicode') || baseDict.get('ToUnicode')); - var toUnicodePromise = toUnicode ? - this.readToUnicode(toUnicode) : Promise.resolve(undefined); - - if (properties.composite) { - // CIDSystemInfo helps to match CID to glyphs - var cidSystemInfo = dict.get('CIDSystemInfo'); - if (isDict(cidSystemInfo)) { - properties.cidSystemInfo = { - registry: cidSystemInfo.get('Registry'), - ordering: cidSystemInfo.get('Ordering'), - supplement: cidSystemInfo.get('Supplement') - }; - } - - var cidToGidMap = dict.get('CIDToGIDMap'); - if (isStream(cidToGidMap)) { - properties.cidToGidMap = this.readCidToGidMap(cidToGidMap); - } - } - - // Based on 9.6.6 of the spec the encoding can come from multiple places - // and depends on the font type. The base encoding and differences are - // read here, but the encoding that is actually used is chosen during - // glyph mapping in the font. - // TODO: Loading the built in encoding in the font would allow the - // differences to be merged in here not require us to hold on to it. - var differences = []; - var baseEncodingName = null; - var encoding; - if (dict.has('Encoding')) { - encoding = dict.get('Encoding'); - if (isDict(encoding)) { - baseEncodingName = encoding.get('BaseEncoding'); - baseEncodingName = (isName(baseEncodingName) ? - baseEncodingName.name : null); - // Load the differences between the base and original - if (encoding.has('Differences')) { - var diffEncoding = encoding.get('Differences'); - var index = 0; - for (var j = 0, jj = diffEncoding.length; j < jj; j++) { - var data = xref.fetchIfRef(diffEncoding[j]); - if (isNum(data)) { - index = data; - } else if (isName(data)) { - differences[index++] = data.name; - } else { - error('Invalid entry in \'Differences\' array: ' + data); - } - } - } - } else if (isName(encoding)) { - baseEncodingName = encoding.name; - } else { - error('Encoding is not a Name nor a Dict'); - } - // According to table 114 if the encoding is a named encoding it must be - // one of these predefined encodings. - if ((baseEncodingName !== 'MacRomanEncoding' && - baseEncodingName !== 'MacExpertEncoding' && - baseEncodingName !== 'WinAnsiEncoding')) { - baseEncodingName = null; - } - } - - if (baseEncodingName) { - properties.defaultEncoding = getEncoding(baseEncodingName).slice(); - } else { - encoding = (properties.type === 'TrueType' ? - WinAnsiEncoding : StandardEncoding); - // The Symbolic attribute can be misused for regular fonts - // Heuristic: we have to check if the font is a standard one also - if (!!(properties.flags & FontFlags.Symbolic)) { - encoding = MacRomanEncoding; - if (!properties.file) { - if (/Symbol/i.test(properties.name)) { - encoding = SymbolSetEncoding; - } else if (/Dingbats/i.test(properties.name)) { - encoding = ZapfDingbatsEncoding; - } - } - } - properties.defaultEncoding = encoding; - } - - properties.differences = differences; - properties.baseEncodingName = baseEncodingName; - properties.hasEncoding = !!baseEncodingName || differences.length > 0; - properties.dict = dict; - return toUnicodePromise.then(function(toUnicode) { - properties.toUnicode = toUnicode; - return this.buildToUnicode(properties); - }.bind(this)).then(function (toUnicode) { - properties.toUnicode = toUnicode; - return properties; - }); - }, - - /** - * Builds a char code to unicode map based on section 9.10 of the spec. - * @param {Object} properties Font properties object. - * @return {Promise} A Promise that is resolved with a - * {ToUnicodeMap|IdentityToUnicodeMap} object. - */ - buildToUnicode: function PartialEvaluator_buildToUnicode(properties) { - properties.hasIncludedToUnicodeMap = - !!properties.toUnicode && properties.toUnicode.length > 0; - // Section 9.10.2 Mapping Character Codes to Unicode Values - if (properties.hasIncludedToUnicodeMap) { - return Promise.resolve(properties.toUnicode); - } - // According to the spec if the font is a simple font we should only map - // to unicode if the base encoding is MacRoman, MacExpert, or WinAnsi or - // the differences array only contains adobe standard or symbol set names, - // in pratice it seems better to always try to create a toUnicode - // map based of the default encoding. - var toUnicode, charcode, glyphName; - if (!properties.composite /* is simple font */) { - toUnicode = []; - var encoding = properties.defaultEncoding.slice(); - var baseEncodingName = properties.baseEncodingName; - // Merge in the differences array. - var differences = properties.differences; - for (charcode in differences) { - glyphName = differences[charcode]; - if (glyphName === '.notdef') { - // Skip .notdef to prevent rendering errors, e.g. boxes appearing - // where there should be spaces (fixes issue5256.pdf). - continue; - } - encoding[charcode] = glyphName; - } - var glyphsUnicodeMap = getGlyphsUnicode(); - for (charcode in encoding) { - // a) Map the character code to a character name. - glyphName = encoding[charcode]; - // b) Look up the character name in the Adobe Glyph List (see the - // Bibliography) to obtain the corresponding Unicode value. - if (glyphName === '') { - continue; - } else if (glyphsUnicodeMap[glyphName] === undefined) { - // (undocumented) c) Few heuristics to recognize unknown glyphs - // NOTE: Adobe Reader does not do this step, but OSX Preview does - var code = 0; - switch (glyphName[0]) { - case 'G': // Gxx glyph - if (glyphName.length === 3) { - code = parseInt(glyphName.substr(1), 16); - } - break; - case 'g': // g00xx glyph - if (glyphName.length === 5) { - code = parseInt(glyphName.substr(1), 16); - } - break; - case 'C': // Cddd glyph - case 'c': // cddd glyph - if (glyphName.length >= 3) { - code = +glyphName.substr(1); - } - break; - default: - // 'uniXXXX'/'uXXXX{XX}' glyphs - var unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); - if (unicode !== -1) { - code = unicode; - } - } - if (code) { - // If |baseEncodingName| is one the predefined encodings, - // and |code| equals |charcode|, using the glyph defined in the - // baseEncoding seems to yield a better |toUnicode| mapping - // (fixes issue 5070). - if (baseEncodingName && code === +charcode) { - var baseEncoding = getEncoding(baseEncodingName); - if (baseEncoding && (glyphName = baseEncoding[charcode])) { - toUnicode[charcode] = - String.fromCharCode(glyphsUnicodeMap[glyphName]); - continue; - } - } - toUnicode[charcode] = String.fromCharCode(code); - } - continue; - } - toUnicode[charcode] = - String.fromCharCode(glyphsUnicodeMap[glyphName]); - } - return Promise.resolve(new ToUnicodeMap(toUnicode)); - } - // If the font is a composite font that uses one of the predefined CMaps - // listed in Table 118 (except Identity–H and Identity–V) or whose - // descendant CIDFont uses the Adobe-GB1, Adobe-CNS1, Adobe-Japan1, or - // Adobe-Korea1 character collection: - if (properties.composite && ( - (properties.cMap.builtInCMap && - !(properties.cMap instanceof IdentityCMap)) || - (properties.cidSystemInfo.registry === 'Adobe' && - (properties.cidSystemInfo.ordering === 'GB1' || - properties.cidSystemInfo.ordering === 'CNS1' || - properties.cidSystemInfo.ordering === 'Japan1' || - properties.cidSystemInfo.ordering === 'Korea1')))) { - // Then: - // a) Map the character code to a character identifier (CID) according - // to the font’s CMap. - // b) Obtain the registry and ordering of the character collection used - // by the font’s CMap (for example, Adobe and Japan1) from its - // CIDSystemInfo dictionary. - var registry = properties.cidSystemInfo.registry; - var ordering = properties.cidSystemInfo.ordering; - // c) Construct a second CMap name by concatenating the registry and - // ordering obtained in step (b) in the format registry–ordering–UCS2 - // (for example, Adobe–Japan1–UCS2). - var ucs2CMapName = Name.get(registry + '-' + ordering + '-UCS2'); - // d) Obtain the CMap with the name constructed in step (c) (available - // from the ASN Web site; see the Bibliography). - return CMapFactory.create(ucs2CMapName, this.options.cMapOptions, - null).then( - function (ucs2CMap) { - var cMap = properties.cMap; - toUnicode = []; - cMap.forEach(function(charcode, cid) { - assert(cid <= 0xffff, 'Max size of CID is 65,535'); - // e) Map the CID obtained in step (a) according to the CMap - // obtained in step (d), producing a Unicode value. - var ucs2 = ucs2CMap.lookup(cid); - if (ucs2) { - toUnicode[charcode] = - String.fromCharCode((ucs2.charCodeAt(0) << 8) + - ucs2.charCodeAt(1)); - } - }); - return new ToUnicodeMap(toUnicode); - }); - } - - // The viewer's choice, just use an identity map. - return Promise.resolve(new IdentityToUnicodeMap(properties.firstChar, - properties.lastChar)); - }, - - readToUnicode: function PartialEvaluator_readToUnicode(toUnicode) { - var cmapObj = toUnicode; - if (isName(cmapObj)) { - return CMapFactory.create(cmapObj, this.options.cMapOptions, null).then( - function (cmap) { - if (cmap instanceof IdentityCMap) { - return new IdentityToUnicodeMap(0, 0xFFFF); - } - return new ToUnicodeMap(cmap.getMap()); - }); - } else if (isStream(cmapObj)) { - return CMapFactory.create(cmapObj, this.options.cMapOptions, null).then( - function (cmap) { - if (cmap instanceof IdentityCMap) { - return new IdentityToUnicodeMap(0, 0xFFFF); - } - var map = new Array(cmap.length); - // Convert UTF-16BE - // NOTE: cmap can be a sparse array, so use forEach instead of for(;;) - // to iterate over all keys. - cmap.forEach(function(charCode, token) { - var str = []; - for (var k = 0; k < token.length; k += 2) { - var w1 = (token.charCodeAt(k) << 8) | token.charCodeAt(k + 1); - if ((w1 & 0xF800) !== 0xD800) { // w1 < 0xD800 || w1 > 0xDFFF - str.push(w1); - continue; - } - k += 2; - var w2 = (token.charCodeAt(k) << 8) | token.charCodeAt(k + 1); - str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000); - } - map[charCode] = String.fromCharCode.apply(String, str); - }); - return new ToUnicodeMap(map); - }); - } - return Promise.resolve(null); - }, - - readCidToGidMap: function PartialEvaluator_readCidToGidMap(cidToGidStream) { - // Extract the encoding from the CIDToGIDMap - var glyphsData = cidToGidStream.getBytes(); - - // Set encoding 0 to later verify the font has an encoding - var result = []; - for (var j = 0, jj = glyphsData.length; j < jj; j++) { - var glyphID = (glyphsData[j++] << 8) | glyphsData[j]; - if (glyphID === 0) { - continue; - } - var code = j >> 1; - result[code] = glyphID; - } - return result; - }, - - extractWidths: function PartialEvaluator_extractWidths(dict, xref, - descriptor, - properties) { - var glyphsWidths = []; - var defaultWidth = 0; - var glyphsVMetrics = []; - var defaultVMetrics; - var i, ii, j, jj, start, code, widths; - if (properties.composite) { - defaultWidth = dict.get('DW') || 1000; - - widths = dict.get('W'); - if (widths) { - for (i = 0, ii = widths.length; i < ii; i++) { - start = widths[i++]; - code = xref.fetchIfRef(widths[i]); - if (isArray(code)) { - for (j = 0, jj = code.length; j < jj; j++) { - glyphsWidths[start++] = code[j]; - } - } else { - var width = widths[++i]; - for (j = start; j <= code; j++) { - glyphsWidths[j] = width; - } - } - } - } - - if (properties.vertical) { - var vmetrics = (dict.get('DW2') || [880, -1000]); - defaultVMetrics = [vmetrics[1], defaultWidth * 0.5, vmetrics[0]]; - vmetrics = dict.get('W2'); - if (vmetrics) { - for (i = 0, ii = vmetrics.length; i < ii; i++) { - start = vmetrics[i++]; - code = xref.fetchIfRef(vmetrics[i]); - if (isArray(code)) { - for (j = 0, jj = code.length; j < jj; j++) { - glyphsVMetrics[start++] = [code[j++], code[j++], code[j]]; - } - } else { - var vmetric = [vmetrics[++i], vmetrics[++i], vmetrics[++i]]; - for (j = start; j <= code; j++) { - glyphsVMetrics[j] = vmetric; - } - } - } - } - } - } else { - var firstChar = properties.firstChar; - widths = dict.get('Widths'); - if (widths) { - j = firstChar; - for (i = 0, ii = widths.length; i < ii; i++) { - glyphsWidths[j++] = widths[i]; - } - defaultWidth = (parseFloat(descriptor.get('MissingWidth')) || 0); - } else { - // Trying get the BaseFont metrics (see comment above). - var baseFontName = dict.get('BaseFont'); - if (isName(baseFontName)) { - var metrics = this.getBaseFontMetrics(baseFontName.name); - - glyphsWidths = this.buildCharCodeToWidth(metrics.widths, - properties); - defaultWidth = metrics.defaultWidth; - } - } - } - - // Heuristic: detection of monospace font by checking all non-zero widths - var isMonospace = true; - var firstWidth = defaultWidth; - for (var glyph in glyphsWidths) { - var glyphWidth = glyphsWidths[glyph]; - if (!glyphWidth) { - continue; - } - if (!firstWidth) { - firstWidth = glyphWidth; - continue; - } - if (firstWidth !== glyphWidth) { - isMonospace = false; - break; - } - } - if (isMonospace) { - properties.flags |= FontFlags.FixedPitch; - } - - properties.defaultWidth = defaultWidth; - properties.widths = glyphsWidths; - properties.defaultVMetrics = defaultVMetrics; - properties.vmetrics = glyphsVMetrics; - }, - - isSerifFont: function PartialEvaluator_isSerifFont(baseFontName) { - // Simulating descriptor flags attribute - var fontNameWoStyle = baseFontName.split('-')[0]; - return (fontNameWoStyle in getSerifFonts()) || - (fontNameWoStyle.search(/serif/gi) !== -1); - }, - - getBaseFontMetrics: function PartialEvaluator_getBaseFontMetrics(name) { - var defaultWidth = 0; - var widths = []; - var monospace = false; - var stdFontMap = getStdFontMap(); - var lookupName = (stdFontMap[name] || name); - var Metrics = getMetrics(); - - if (!(lookupName in Metrics)) { - // Use default fonts for looking up font metrics if the passed - // font is not a base font - if (this.isSerifFont(name)) { - lookupName = 'Times-Roman'; - } else { - lookupName = 'Helvetica'; - } - } - var glyphWidths = Metrics[lookupName]; - - if (isNum(glyphWidths)) { - defaultWidth = glyphWidths; - monospace = true; - } else { - widths = glyphWidths(); // expand lazy widths array - } - - return { - defaultWidth: defaultWidth, - monospace: monospace, - widths: widths - }; - }, - - buildCharCodeToWidth: - function PartialEvaluator_bulildCharCodeToWidth(widthsByGlyphName, - properties) { - var widths = Object.create(null); - var differences = properties.differences; - var encoding = properties.defaultEncoding; - for (var charCode = 0; charCode < 256; charCode++) { - if (charCode in differences && - widthsByGlyphName[differences[charCode]]) { - widths[charCode] = widthsByGlyphName[differences[charCode]]; - continue; - } - if (charCode in encoding && widthsByGlyphName[encoding[charCode]]) { - widths[charCode] = widthsByGlyphName[encoding[charCode]]; - continue; - } - } - return widths; - }, - - preEvaluateFont: function PartialEvaluator_preEvaluateFont(dict, xref) { - var baseDict = dict; - var type = dict.get('Subtype'); - assert(isName(type), 'invalid font Subtype'); - - var composite = false; - var uint8array; - if (type.name === 'Type0') { - // If font is a composite - // - get the descendant font - // - set the type according to the descendant font - // - get the FontDescriptor from the descendant font - var df = dict.get('DescendantFonts'); - if (!df) { - error('Descendant fonts are not specified'); - } - dict = (isArray(df) ? xref.fetchIfRef(df[0]) : df); - - type = dict.get('Subtype'); - assert(isName(type), 'invalid font Subtype'); - composite = true; - } - - var descriptor = dict.get('FontDescriptor'); - if (descriptor) { - var hash = new MurmurHash3_64(); - var encoding = baseDict.getRaw('Encoding'); - if (isName(encoding)) { - hash.update(encoding.name); - } else if (isRef(encoding)) { - hash.update(encoding.toString()); - } else if (isDict(encoding)) { - var keys = encoding.getKeys(); - for (var i = 0, ii = keys.length; i < ii; i++) { - var entry = encoding.getRaw(keys[i]); - if (isName(entry)) { - hash.update(entry.name); - } else if (isRef(entry)) { - hash.update(entry.toString()); - } else if (isArray(entry)) { // 'Differences' entry. - // Ideally we should check the contents of the array, but to avoid - // parsing it here and then again in |extractDataStructures|, - // we only use the array length for now (fixes bug1157493.pdf). - hash.update(entry.length.toString()); - } - } - } - - var toUnicode = dict.get('ToUnicode') || baseDict.get('ToUnicode'); - if (isStream(toUnicode)) { - var stream = toUnicode.str || toUnicode; - uint8array = stream.buffer ? - new Uint8Array(stream.buffer.buffer, 0, stream.bufferLength) : - new Uint8Array(stream.bytes.buffer, - stream.start, stream.end - stream.start); - hash.update(uint8array); - - } else if (isName(toUnicode)) { - hash.update(toUnicode.name); - } - - var widths = dict.get('Widths') || baseDict.get('Widths'); - if (widths) { - uint8array = new Uint8Array(new Uint32Array(widths).buffer); - hash.update(uint8array); - } - } - - return { - descriptor: descriptor, - dict: dict, - baseDict: baseDict, - composite: composite, - type: type.name, - hash: hash ? hash.hexdigest() : '' - }; - }, - - translateFont: function PartialEvaluator_translateFont(preEvaluatedFont, - xref) { - var baseDict = preEvaluatedFont.baseDict; - var dict = preEvaluatedFont.dict; - var composite = preEvaluatedFont.composite; - var descriptor = preEvaluatedFont.descriptor; - var type = preEvaluatedFont.type; - var maxCharIndex = (composite ? 0xFFFF : 0xFF); - var cMapOptions = this.options.cMapOptions; - var properties; - - if (!descriptor) { - if (type === 'Type3') { - // FontDescriptor is only required for Type3 fonts when the document - // is a tagged pdf. Create a barbebones one to get by. - descriptor = new Dict(null); - descriptor.set('FontName', Name.get(type)); - descriptor.set('FontBBox', dict.getArray('FontBBox')); - } else { - // Before PDF 1.5 if the font was one of the base 14 fonts, having a - // FontDescriptor was not required. - // This case is here for compatibility. - var baseFontName = dict.get('BaseFont'); - if (!isName(baseFontName)) { - error('Base font is not specified'); - } - - // Using base font name as a font name. - baseFontName = baseFontName.name.replace(/[,_]/g, '-'); - var metrics = this.getBaseFontMetrics(baseFontName); - - // Simulating descriptor flags attribute - var fontNameWoStyle = baseFontName.split('-')[0]; - var flags = - (this.isSerifFont(fontNameWoStyle) ? FontFlags.Serif : 0) | - (metrics.monospace ? FontFlags.FixedPitch : 0) | - (getSymbolsFonts()[fontNameWoStyle] ? FontFlags.Symbolic : - FontFlags.Nonsymbolic); - - properties = { - type: type, - name: baseFontName, - widths: metrics.widths, - defaultWidth: metrics.defaultWidth, - flags: flags, - firstChar: 0, - lastChar: maxCharIndex - }; - return this.extractDataStructures(dict, dict, xref, properties).then( - function (properties) { - properties.widths = this.buildCharCodeToWidth(metrics.widths, - properties); - return new Font(baseFontName, null, properties); - }.bind(this)); - } - } - - // According to the spec if 'FontDescriptor' is declared, 'FirstChar', - // 'LastChar' and 'Widths' should exist too, but some PDF encoders seem - // to ignore this rule when a variant of a standard font is used. - // TODO Fill the width array depending on which of the base font this is - // a variant. - var firstChar = (dict.get('FirstChar') || 0); - var lastChar = (dict.get('LastChar') || maxCharIndex); - - var fontName = descriptor.get('FontName'); - var baseFont = dict.get('BaseFont'); - // Some bad PDFs have a string as the font name. - if (isString(fontName)) { - fontName = Name.get(fontName); - } - if (isString(baseFont)) { - baseFont = Name.get(baseFont); - } - - if (type !== 'Type3') { - var fontNameStr = fontName && fontName.name; - var baseFontStr = baseFont && baseFont.name; - if (fontNameStr !== baseFontStr) { - info('The FontDescriptor\'s FontName is "' + fontNameStr + - '" but should be the same as the Font\'s BaseFont "' + - baseFontStr + '"'); - // Workaround for cases where e.g. fontNameStr = 'Arial' and - // baseFontStr = 'Arial,Bold' (needed when no font file is embedded). - if (fontNameStr && baseFontStr && - baseFontStr.indexOf(fontNameStr) === 0) { - fontName = baseFont; - } - } - } - fontName = (fontName || baseFont); - - assert(isName(fontName), 'invalid font name'); - - var fontFile = descriptor.get('FontFile', 'FontFile2', 'FontFile3'); - if (fontFile) { - if (fontFile.dict) { - var subtype = fontFile.dict.get('Subtype'); - if (subtype) { - subtype = subtype.name; - } - var length1 = fontFile.dict.get('Length1'); - var length2 = fontFile.dict.get('Length2'); - var length3 = fontFile.dict.get('Length3'); - } - } - - properties = { - type: type, - name: fontName.name, - subtype: subtype, - file: fontFile, - length1: length1, - length2: length2, - length3: length3, - loadedName: baseDict.loadedName, - composite: composite, - wideChars: composite, - fixedPitch: false, - fontMatrix: (dict.getArray('FontMatrix') || FONT_IDENTITY_MATRIX), - firstChar: firstChar || 0, - lastChar: (lastChar || maxCharIndex), - bbox: descriptor.getArray('FontBBox'), - ascent: descriptor.get('Ascent'), - descent: descriptor.get('Descent'), - xHeight: descriptor.get('XHeight'), - capHeight: descriptor.get('CapHeight'), - flags: descriptor.get('Flags'), - italicAngle: descriptor.get('ItalicAngle'), - coded: false - }; - - var cMapPromise; - if (composite) { - var cidEncoding = baseDict.get('Encoding'); - if (isName(cidEncoding)) { - properties.cidEncoding = cidEncoding.name; - } - cMapPromise = CMapFactory.create(cidEncoding, cMapOptions, null).then( - function (cMap) { - properties.cMap = cMap; - properties.vertical = properties.cMap.vertical; - }); - } else { - cMapPromise = Promise.resolve(undefined); - } - - return cMapPromise.then(function () { - return this.extractDataStructures(dict, baseDict, xref, properties); - }.bind(this)).then(function (properties) { - this.extractWidths(dict, xref, descriptor, properties); - - if (type === 'Type3') { - properties.isType3Font = true; - } - - return new Font(fontName.name, fontFile, properties); - }.bind(this)); - } - }; - - return PartialEvaluator; -})(); - -var TranslatedFont = (function TranslatedFontClosure() { - function TranslatedFont(loadedName, font, dict) { - this.loadedName = loadedName; - this.font = font; - this.dict = dict; - this.type3Loaded = null; - this.sent = false; - } - TranslatedFont.prototype = { - send: function (handler) { - if (this.sent) { - return; - } - var fontData = this.font.exportData(); - handler.send('commonobj', [ - this.loadedName, - 'Font', - fontData - ]); - this.sent = true; - }, - loadType3Data: function (evaluator, resources, parentOperatorList, task) { - assert(this.font.isType3Font); - - if (this.type3Loaded) { - return this.type3Loaded; - } - - var translatedFont = this.font; - var loadCharProcsPromise = Promise.resolve(); - var charProcs = this.dict.get('CharProcs'); - var fontResources = this.dict.get('Resources') || resources; - var charProcKeys = charProcs.getKeys(); - var charProcOperatorList = Object.create(null); - for (var i = 0, n = charProcKeys.length; i < n; ++i) { - loadCharProcsPromise = loadCharProcsPromise.then(function (key) { - var glyphStream = charProcs.get(key); - var operatorList = new OperatorList(); - return evaluator.getOperatorList(glyphStream, task, fontResources, - operatorList).then(function () { - charProcOperatorList[key] = operatorList.getIR(); - - // Add the dependencies to the parent operator list so they are - // resolved before sub operator list is executed synchronously. - parentOperatorList.addDependencies(operatorList.dependencies); - }, function (reason) { - warn('Type3 font resource \"' + key + '\" is not available'); - var operatorList = new OperatorList(); - charProcOperatorList[key] = operatorList.getIR(); - }); - }.bind(this, charProcKeys[i])); - } - this.type3Loaded = loadCharProcsPromise.then(function () { - translatedFont.charProcOperatorList = charProcOperatorList; - }); - return this.type3Loaded; - } - }; - return TranslatedFont; -})(); - -var OperatorList = (function OperatorListClosure() { - var CHUNK_SIZE = 1000; - var CHUNK_SIZE_ABOUT = CHUNK_SIZE - 5; // close to chunk size - - function getTransfers(queue) { - var transfers = []; - var fnArray = queue.fnArray, argsArray = queue.argsArray; - for (var i = 0, ii = queue.length; i < ii; i++) { - switch (fnArray[i]) { - case OPS.paintInlineImageXObject: - case OPS.paintInlineImageXObjectGroup: - case OPS.paintImageMaskXObject: - var arg = argsArray[i][0]; // first param in imgData - if (!arg.cached) { - transfers.push(arg.data.buffer); - } - break; - } - } - return transfers; - } - - function OperatorList(intent, messageHandler, pageIndex) { - this.messageHandler = messageHandler; - this.fnArray = []; - this.argsArray = []; - this.dependencies = Object.create(null); - this._totalLength = 0; - this.pageIndex = pageIndex; - this.intent = intent; - } - - OperatorList.prototype = { - get length() { - return this.argsArray.length; - }, - - /** - * @returns {number} The total length of the entire operator list, - * since `this.length === 0` after flushing. - */ - get totalLength() { - return (this._totalLength + this.length); - }, - - addOp: function(fn, args) { - this.fnArray.push(fn); - this.argsArray.push(args); - if (this.messageHandler) { - if (this.fnArray.length >= CHUNK_SIZE) { - this.flush(); - } else if (this.fnArray.length >= CHUNK_SIZE_ABOUT && - (fn === OPS.restore || fn === OPS.endText)) { - // heuristic to flush on boundary of restore or endText - this.flush(); - } - } - }, - - addDependency: function(dependency) { - if (dependency in this.dependencies) { - return; - } - this.dependencies[dependency] = true; - this.addOp(OPS.dependency, [dependency]); - }, - - addDependencies: function(dependencies) { - for (var key in dependencies) { - this.addDependency(key); - } - }, - - addOpList: function(opList) { - Util.extendObj(this.dependencies, opList.dependencies); - for (var i = 0, ii = opList.length; i < ii; i++) { - this.addOp(opList.fnArray[i], opList.argsArray[i]); - } - }, - - getIR: function() { - return { - fnArray: this.fnArray, - argsArray: this.argsArray, - length: this.length - }; - }, - - flush: function(lastChunk) { - if (this.intent !== 'oplist') { - new QueueOptimizer().optimize(this); - } - var transfers = getTransfers(this); - var length = this.length; - this._totalLength += length; - - this.messageHandler.send('RenderPageChunk', { - operatorList: { - fnArray: this.fnArray, - argsArray: this.argsArray, - lastChunk: lastChunk, - length: length - }, - pageIndex: this.pageIndex, - intent: this.intent - }, transfers); - this.dependencies = Object.create(null); - this.fnArray.length = 0; - this.argsArray.length = 0; - } - }; - - return OperatorList; -})(); - -var StateManager = (function StateManagerClosure() { - function StateManager(initialState) { - this.state = initialState; - this.stateStack = []; - } - StateManager.prototype = { - save: function () { - var old = this.state; - this.stateStack.push(this.state); - this.state = old.clone(); - }, - restore: function () { - var prev = this.stateStack.pop(); - if (prev) { - this.state = prev; - } - }, - transform: function (args) { - this.state.ctm = Util.transform(this.state.ctm, args); - } - }; - return StateManager; -})(); - -var TextState = (function TextStateClosure() { - function TextState() { - this.ctm = new Float32Array(IDENTITY_MATRIX); - this.fontName = null; - this.fontSize = 0; - this.font = null; - this.fontMatrix = FONT_IDENTITY_MATRIX; - this.textMatrix = IDENTITY_MATRIX.slice(); - this.textLineMatrix = IDENTITY_MATRIX.slice(); - this.charSpacing = 0; - this.wordSpacing = 0; - this.leading = 0; - this.textHScale = 1; - this.textRise = 0; - } - - TextState.prototype = { - setTextMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) { - var m = this.textMatrix; - m[0] = a; m[1] = b; m[2] = c; m[3] = d; m[4] = e; m[5] = f; - }, - setTextLineMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) { - var m = this.textLineMatrix; - m[0] = a; m[1] = b; m[2] = c; m[3] = d; m[4] = e; m[5] = f; - }, - translateTextMatrix: function TextState_translateTextMatrix(x, y) { - var m = this.textMatrix; - m[4] = m[0] * x + m[2] * y + m[4]; - m[5] = m[1] * x + m[3] * y + m[5]; - }, - translateTextLineMatrix: function TextState_translateTextMatrix(x, y) { - var m = this.textLineMatrix; - m[4] = m[0] * x + m[2] * y + m[4]; - m[5] = m[1] * x + m[3] * y + m[5]; - }, - calcTextLineMatrixAdvance: - function TextState_calcTextLineMatrixAdvance(a, b, c, d, e, f) { - var font = this.font; - if (!font) { - return null; - } - var m = this.textLineMatrix; - if (!(a === m[0] && b === m[1] && c === m[2] && d === m[3])) { - return null; - } - var txDiff = e - m[4], tyDiff = f - m[5]; - if ((font.vertical && txDiff !== 0) || (!font.vertical && tyDiff !== 0)) { - return null; - } - var tx, ty, denominator = a * d - b * c; - if (font.vertical) { - tx = -tyDiff * c / denominator; - ty = tyDiff * a / denominator; - } else { - tx = txDiff * d / denominator; - ty = -txDiff * b / denominator; - } - return { width: tx, height: ty, value: (font.vertical ? ty : tx), }; - }, - calcRenderMatrix: function TextState_calcRendeMatrix(ctm) { - // 9.4.4 Text Space Details - var tsm = [this.fontSize * this.textHScale, 0, - 0, this.fontSize, - 0, this.textRise]; - return Util.transform(ctm, Util.transform(this.textMatrix, tsm)); - }, - carriageReturn: function TextState_carriageReturn() { - this.translateTextLineMatrix(0, -this.leading); - this.textMatrix = this.textLineMatrix.slice(); - }, - clone: function TextState_clone() { - var clone = Object.create(this); - clone.textMatrix = this.textMatrix.slice(); - clone.textLineMatrix = this.textLineMatrix.slice(); - clone.fontMatrix = this.fontMatrix.slice(); - return clone; - } - }; - return TextState; -})(); - -var EvalState = (function EvalStateClosure() { - function EvalState() { - this.ctm = new Float32Array(IDENTITY_MATRIX); - this.font = null; - this.textRenderingMode = TextRenderingMode.FILL; - this.fillColorSpace = ColorSpace.singletons.gray; - this.strokeColorSpace = ColorSpace.singletons.gray; - } - EvalState.prototype = { - clone: function CanvasExtraState_clone() { - return Object.create(this); - }, - }; - return EvalState; -})(); - -var EvaluatorPreprocessor = (function EvaluatorPreprocessorClosure() { - // Specifies properties for each command - // - // If variableArgs === true: [0, `numArgs`] expected - // If variableArgs === false: exactly `numArgs` expected - var getOPMap = getLookupTableFactory(function (t) { - // Graphic state - t['w'] = { id: OPS.setLineWidth, numArgs: 1, variableArgs: false }; - t['J'] = { id: OPS.setLineCap, numArgs: 1, variableArgs: false }; - t['j'] = { id: OPS.setLineJoin, numArgs: 1, variableArgs: false }; - t['M'] = { id: OPS.setMiterLimit, numArgs: 1, variableArgs: false }; - t['d'] = { id: OPS.setDash, numArgs: 2, variableArgs: false }; - t['ri'] = { id: OPS.setRenderingIntent, numArgs: 1, variableArgs: false }; - t['i'] = { id: OPS.setFlatness, numArgs: 1, variableArgs: false }; - t['gs'] = { id: OPS.setGState, numArgs: 1, variableArgs: false }; - t['q'] = { id: OPS.save, numArgs: 0, variableArgs: false }; - t['Q'] = { id: OPS.restore, numArgs: 0, variableArgs: false }; - t['cm'] = { id: OPS.transform, numArgs: 6, variableArgs: false }; - - // Path - t['m'] = { id: OPS.moveTo, numArgs: 2, variableArgs: false }; - t['l'] = { id: OPS.lineTo, numArgs: 2, variableArgs: false }; - t['c'] = { id: OPS.curveTo, numArgs: 6, variableArgs: false }; - t['v'] = { id: OPS.curveTo2, numArgs: 4, variableArgs: false }; - t['y'] = { id: OPS.curveTo3, numArgs: 4, variableArgs: false }; - t['h'] = { id: OPS.closePath, numArgs: 0, variableArgs: false }; - t['re'] = { id: OPS.rectangle, numArgs: 4, variableArgs: false }; - t['S'] = { id: OPS.stroke, numArgs: 0, variableArgs: false }; - t['s'] = { id: OPS.closeStroke, numArgs: 0, variableArgs: false }; - t['f'] = { id: OPS.fill, numArgs: 0, variableArgs: false }; - t['F'] = { id: OPS.fill, numArgs: 0, variableArgs: false }; - t['f*'] = { id: OPS.eoFill, numArgs: 0, variableArgs: false }; - t['B'] = { id: OPS.fillStroke, numArgs: 0, variableArgs: false }; - t['B*'] = { id: OPS.eoFillStroke, numArgs: 0, variableArgs: false }; - t['b'] = { id: OPS.closeFillStroke, numArgs: 0, variableArgs: false }; - t['b*'] = { id: OPS.closeEOFillStroke, numArgs: 0, variableArgs: false }; - t['n'] = { id: OPS.endPath, numArgs: 0, variableArgs: false }; - - // Clipping - t['W'] = { id: OPS.clip, numArgs: 0, variableArgs: false }; - t['W*'] = { id: OPS.eoClip, numArgs: 0, variableArgs: false }; - - // Text - t['BT'] = { id: OPS.beginText, numArgs: 0, variableArgs: false }; - t['ET'] = { id: OPS.endText, numArgs: 0, variableArgs: false }; - t['Tc'] = { id: OPS.setCharSpacing, numArgs: 1, variableArgs: false }; - t['Tw'] = { id: OPS.setWordSpacing, numArgs: 1, variableArgs: false }; - t['Tz'] = { id: OPS.setHScale, numArgs: 1, variableArgs: false }; - t['TL'] = { id: OPS.setLeading, numArgs: 1, variableArgs: false }; - t['Tf'] = { id: OPS.setFont, numArgs: 2, variableArgs: false }; - t['Tr'] = { id: OPS.setTextRenderingMode, numArgs: 1, variableArgs: false }; - t['Ts'] = { id: OPS.setTextRise, numArgs: 1, variableArgs: false }; - t['Td'] = { id: OPS.moveText, numArgs: 2, variableArgs: false }; - t['TD'] = { id: OPS.setLeadingMoveText, numArgs: 2, variableArgs: false }; - t['Tm'] = { id: OPS.setTextMatrix, numArgs: 6, variableArgs: false }; - t['T*'] = { id: OPS.nextLine, numArgs: 0, variableArgs: false }; - t['Tj'] = { id: OPS.showText, numArgs: 1, variableArgs: false }; - t['TJ'] = { id: OPS.showSpacedText, numArgs: 1, variableArgs: false }; - t['\''] = { id: OPS.nextLineShowText, numArgs: 1, variableArgs: false }; - t['"'] = { id: OPS.nextLineSetSpacingShowText, numArgs: 3, - variableArgs: false }; - - // Type3 fonts - t['d0'] = { id: OPS.setCharWidth, numArgs: 2, variableArgs: false }; - t['d1'] = { id: OPS.setCharWidthAndBounds, numArgs: 6, - variableArgs: false }; - - // Color - t['CS'] = { id: OPS.setStrokeColorSpace, numArgs: 1, variableArgs: false }; - t['cs'] = { id: OPS.setFillColorSpace, numArgs: 1, variableArgs: false }; - t['SC'] = { id: OPS.setStrokeColor, numArgs: 4, variableArgs: true }; - t['SCN'] = { id: OPS.setStrokeColorN, numArgs: 33, variableArgs: true }; - t['sc'] = { id: OPS.setFillColor, numArgs: 4, variableArgs: true }; - t['scn'] = { id: OPS.setFillColorN, numArgs: 33, variableArgs: true }; - t['G'] = { id: OPS.setStrokeGray, numArgs: 1, variableArgs: false }; - t['g'] = { id: OPS.setFillGray, numArgs: 1, variableArgs: false }; - t['RG'] = { id: OPS.setStrokeRGBColor, numArgs: 3, variableArgs: false }; - t['rg'] = { id: OPS.setFillRGBColor, numArgs: 3, variableArgs: false }; - t['K'] = { id: OPS.setStrokeCMYKColor, numArgs: 4, variableArgs: false }; - t['k'] = { id: OPS.setFillCMYKColor, numArgs: 4, variableArgs: false }; - - // Shading - t['sh'] = { id: OPS.shadingFill, numArgs: 1, variableArgs: false }; - - // Images - t['BI'] = { id: OPS.beginInlineImage, numArgs: 0, variableArgs: false }; - t['ID'] = { id: OPS.beginImageData, numArgs: 0, variableArgs: false }; - t['EI'] = { id: OPS.endInlineImage, numArgs: 1, variableArgs: false }; - - // XObjects - t['Do'] = { id: OPS.paintXObject, numArgs: 1, variableArgs: false }; - t['MP'] = { id: OPS.markPoint, numArgs: 1, variableArgs: false }; - t['DP'] = { id: OPS.markPointProps, numArgs: 2, variableArgs: false }; - t['BMC'] = { id: OPS.beginMarkedContent, numArgs: 1, variableArgs: false }; - t['BDC'] = { id: OPS.beginMarkedContentProps, numArgs: 2, - variableArgs: false }; - t['EMC'] = { id: OPS.endMarkedContent, numArgs: 0, variableArgs: false }; - - // Compatibility - t['BX'] = { id: OPS.beginCompat, numArgs: 0, variableArgs: false }; - t['EX'] = { id: OPS.endCompat, numArgs: 0, variableArgs: false }; - - // (reserved partial commands for the lexer) - t['BM'] = null; - t['BD'] = null; - t['true'] = null; - t['fa'] = null; - t['fal'] = null; - t['fals'] = null; - t['false'] = null; - t['nu'] = null; - t['nul'] = null; - t['null'] = null; - }); - - function EvaluatorPreprocessor(stream, xref, stateManager) { - this.opMap = getOPMap(); - // TODO(mduan): pass array of knownCommands rather than this.opMap - // dictionary - this.parser = new Parser(new Lexer(stream, this.opMap), false, xref); - this.stateManager = stateManager; - this.nonProcessedArgs = []; - } - - EvaluatorPreprocessor.prototype = { - get savedStatesDepth() { - return this.stateManager.stateStack.length; - }, - - // |operation| is an object with two fields: - // - // - |fn| is an out param. - // - // - |args| is an inout param. On entry, it should have one of two values. - // - // - An empty array. This indicates that the caller is providing the - // array in which the args will be stored in. The caller should use - // this value if it can reuse a single array for each call to read(). - // - // - |null|. This indicates that the caller needs this function to create - // the array in which any args are stored in. If there are zero args, - // this function will leave |operation.args| as |null| (thus avoiding - // allocations that would occur if we used an empty array to represent - // zero arguments). Otherwise, it will replace |null| with a new array - // containing the arguments. The caller should use this value if it - // cannot reuse an array for each call to read(). - // - // These two modes are present because this function is very hot and so - // avoiding allocations where possible is worthwhile. - // - read: function EvaluatorPreprocessor_read(operation) { - var args = operation.args; - while (true) { - var obj = this.parser.getObj(); - if (isCmd(obj)) { - var cmd = obj.cmd; - // Check that the command is valid - var opSpec = this.opMap[cmd]; - if (!opSpec) { - warn('Unknown command "' + cmd + '"'); - continue; - } - - var fn = opSpec.id; - var numArgs = opSpec.numArgs; - var argsLength = args !== null ? args.length : 0; - - if (!opSpec.variableArgs) { - // Postscript commands can be nested, e.g. /F2 /GS2 gs 5.711 Tf - if (argsLength !== numArgs) { - var nonProcessedArgs = this.nonProcessedArgs; - while (argsLength > numArgs) { - nonProcessedArgs.push(args.shift()); - argsLength--; - } - while (argsLength < numArgs && nonProcessedArgs.length !== 0) { - if (!args) { - args = []; - } - args.unshift(nonProcessedArgs.pop()); - argsLength++; - } - } - - if (argsLength < numArgs) { - // If we receive too few args, it's not possible to possible - // to execute the command, so skip the command - info('Command ' + fn + ': because expected ' + - numArgs + ' args, but received ' + argsLength + - ' args; skipping'); - args = null; - continue; - } - } else if (argsLength > numArgs) { - info('Command ' + fn + ': expected [0,' + numArgs + - '] args, but received ' + argsLength + ' args'); - } - - // TODO figure out how to type-check vararg functions - this.preprocessCommand(fn, args); - - operation.fn = fn; - operation.args = args; - return true; - } else { - if (isEOF(obj)) { - return false; // no more commands - } - // argument - if (obj !== null) { - if (!args) { - args = []; - } - args.push(obj); - assert(args.length <= 33, 'Too many arguments'); - } - } - } - }, - - preprocessCommand: - function EvaluatorPreprocessor_preprocessCommand(fn, args) { - switch (fn | 0) { - case OPS.save: - this.stateManager.save(); - break; - case OPS.restore: - this.stateManager.restore(); - break; - case OPS.transform: - this.stateManager.transform(args); - break; - } - } - }; - return EvaluatorPreprocessor; -})(); - -var QueueOptimizer = (function QueueOptimizerClosure() { - function addState(parentState, pattern, fn) { - var state = parentState; - for (var i = 0, ii = pattern.length - 1; i < ii; i++) { - var item = pattern[i]; - state = (state[item] || (state[item] = [])); - } - state[pattern[pattern.length - 1]] = fn; - } - - function handlePaintSolidColorImageMask(iFirstSave, count, fnArray, - argsArray) { - // Handles special case of mainly LaTeX documents which use image masks to - // draw lines with the current fill style. - // 'count' groups of (save, transform, paintImageMaskXObject, restore)+ - // have been found at iFirstSave. - var iFirstPIMXO = iFirstSave + 2; - for (var i = 0; i < count; i++) { - var arg = argsArray[iFirstPIMXO + 4 * i]; - var imageMask = arg.length === 1 && arg[0]; - if (imageMask && imageMask.width === 1 && imageMask.height === 1 && - (!imageMask.data.length || - (imageMask.data.length === 1 && imageMask.data[0] === 0))) { - fnArray[iFirstPIMXO + 4 * i] = OPS.paintSolidColorImageMask; - continue; - } - break; - } - return count - i; - } - - var InitialState = []; - - // This replaces (save, transform, paintInlineImageXObject, restore)+ - // sequences with one |paintInlineImageXObjectGroup| operation. - addState(InitialState, - [OPS.save, OPS.transform, OPS.paintInlineImageXObject, OPS.restore], - function foundInlineImageGroup(context) { - var MIN_IMAGES_IN_INLINE_IMAGES_BLOCK = 10; - var MAX_IMAGES_IN_INLINE_IMAGES_BLOCK = 200; - var MAX_WIDTH = 1000; - var IMAGE_PADDING = 1; - - var fnArray = context.fnArray, argsArray = context.argsArray; - var curr = context.iCurr; - var iFirstSave = curr - 3; - var iFirstTransform = curr - 2; - var iFirstPIIXO = curr - 1; - - // Look for the quartets. - var i = iFirstSave + 4; - var ii = fnArray.length; - while (i + 3 < ii) { - if (fnArray[i] !== OPS.save || - fnArray[i + 1] !== OPS.transform || - fnArray[i + 2] !== OPS.paintInlineImageXObject || - fnArray[i + 3] !== OPS.restore) { - break; // ops don't match - } - i += 4; - } - - // At this point, i is the index of the first op past the last valid - // quartet. - var count = Math.min((i - iFirstSave) / 4, - MAX_IMAGES_IN_INLINE_IMAGES_BLOCK); - if (count < MIN_IMAGES_IN_INLINE_IMAGES_BLOCK) { - return i; - } - - // assuming that heights of those image is too small (~1 pixel) - // packing as much as possible by lines - var maxX = 0; - var map = [], maxLineHeight = 0; - var currentX = IMAGE_PADDING, currentY = IMAGE_PADDING; - var q; - for (q = 0; q < count; q++) { - var transform = argsArray[iFirstTransform + (q << 2)]; - var img = argsArray[iFirstPIIXO + (q << 2)][0]; - if (currentX + img.width > MAX_WIDTH) { - // starting new line - maxX = Math.max(maxX, currentX); - currentY += maxLineHeight + 2 * IMAGE_PADDING; - currentX = 0; - maxLineHeight = 0; - } - map.push({ - transform: transform, - x: currentX, y: currentY, - w: img.width, h: img.height - }); - currentX += img.width + 2 * IMAGE_PADDING; - maxLineHeight = Math.max(maxLineHeight, img.height); - } - var imgWidth = Math.max(maxX, currentX) + IMAGE_PADDING; - var imgHeight = currentY + maxLineHeight + IMAGE_PADDING; - var imgData = new Uint8Array(imgWidth * imgHeight * 4); - var imgRowSize = imgWidth << 2; - for (q = 0; q < count; q++) { - var data = argsArray[iFirstPIIXO + (q << 2)][0].data; - // Copy image by lines and extends pixels into padding. - var rowSize = map[q].w << 2; - var dataOffset = 0; - var offset = (map[q].x + map[q].y * imgWidth) << 2; - imgData.set(data.subarray(0, rowSize), offset - imgRowSize); - for (var k = 0, kk = map[q].h; k < kk; k++) { - imgData.set(data.subarray(dataOffset, dataOffset + rowSize), offset); - dataOffset += rowSize; - offset += imgRowSize; - } - imgData.set(data.subarray(dataOffset - rowSize, dataOffset), offset); - while (offset >= 0) { - data[offset - 4] = data[offset]; - data[offset - 3] = data[offset + 1]; - data[offset - 2] = data[offset + 2]; - data[offset - 1] = data[offset + 3]; - data[offset + rowSize] = data[offset + rowSize - 4]; - data[offset + rowSize + 1] = data[offset + rowSize - 3]; - data[offset + rowSize + 2] = data[offset + rowSize - 2]; - data[offset + rowSize + 3] = data[offset + rowSize - 1]; - offset -= imgRowSize; - } - } - - // Replace queue items. - fnArray.splice(iFirstSave, count * 4, OPS.paintInlineImageXObjectGroup); - argsArray.splice(iFirstSave, count * 4, - [{ width: imgWidth, height: imgHeight, kind: ImageKind.RGBA_32BPP, - data: imgData }, map]); - - return iFirstSave + 1; - }); - - // This replaces (save, transform, paintImageMaskXObject, restore)+ - // sequences with one |paintImageMaskXObjectGroup| or one - // |paintImageMaskXObjectRepeat| operation. - addState(InitialState, - [OPS.save, OPS.transform, OPS.paintImageMaskXObject, OPS.restore], - function foundImageMaskGroup(context) { - var MIN_IMAGES_IN_MASKS_BLOCK = 10; - var MAX_IMAGES_IN_MASKS_BLOCK = 100; - var MAX_SAME_IMAGES_IN_MASKS_BLOCK = 1000; - - var fnArray = context.fnArray, argsArray = context.argsArray; - var curr = context.iCurr; - var iFirstSave = curr - 3; - var iFirstTransform = curr - 2; - var iFirstPIMXO = curr - 1; - - // Look for the quartets. - var i = iFirstSave + 4; - var ii = fnArray.length; - while (i + 3 < ii) { - if (fnArray[i] !== OPS.save || - fnArray[i + 1] !== OPS.transform || - fnArray[i + 2] !== OPS.paintImageMaskXObject || - fnArray[i + 3] !== OPS.restore) { - break; // ops don't match - } - i += 4; - } - - // At this point, i is the index of the first op past the last valid - // quartet. - var count = (i - iFirstSave) / 4; - count = handlePaintSolidColorImageMask(iFirstSave, count, fnArray, - argsArray); - if (count < MIN_IMAGES_IN_MASKS_BLOCK) { - return i; - } - - var q; - var isSameImage = false; - var iTransform, transformArgs; - var firstPIMXOArg0 = argsArray[iFirstPIMXO][0]; - if (argsArray[iFirstTransform][1] === 0 && - argsArray[iFirstTransform][2] === 0) { - isSameImage = true; - var firstTransformArg0 = argsArray[iFirstTransform][0]; - var firstTransformArg3 = argsArray[iFirstTransform][3]; - iTransform = iFirstTransform + 4; - var iPIMXO = iFirstPIMXO + 4; - for (q = 1; q < count; q++, iTransform += 4, iPIMXO += 4) { - transformArgs = argsArray[iTransform]; - if (argsArray[iPIMXO][0] !== firstPIMXOArg0 || - transformArgs[0] !== firstTransformArg0 || - transformArgs[1] !== 0 || - transformArgs[2] !== 0 || - transformArgs[3] !== firstTransformArg3) { - if (q < MIN_IMAGES_IN_MASKS_BLOCK) { - isSameImage = false; - } else { - count = q; - } - break; // different image or transform - } - } - } - - if (isSameImage) { - count = Math.min(count, MAX_SAME_IMAGES_IN_MASKS_BLOCK); - var positions = new Float32Array(count * 2); - iTransform = iFirstTransform; - for (q = 0; q < count; q++, iTransform += 4) { - transformArgs = argsArray[iTransform]; - positions[(q << 1)] = transformArgs[4]; - positions[(q << 1) + 1] = transformArgs[5]; - } - - // Replace queue items. - fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectRepeat); - argsArray.splice(iFirstSave, count * 4, - [firstPIMXOArg0, firstTransformArg0, firstTransformArg3, positions]); - } else { - count = Math.min(count, MAX_IMAGES_IN_MASKS_BLOCK); - var images = []; - for (q = 0; q < count; q++) { - transformArgs = argsArray[iFirstTransform + (q << 2)]; - var maskParams = argsArray[iFirstPIMXO + (q << 2)][0]; - images.push({ data: maskParams.data, width: maskParams.width, - height: maskParams.height, - transform: transformArgs }); - } - - // Replace queue items. - fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectGroup); - argsArray.splice(iFirstSave, count * 4, [images]); - } - - return iFirstSave + 1; - }); - - // This replaces (save, transform, paintImageXObject, restore)+ sequences - // with one paintImageXObjectRepeat operation, if the |transform| and - // |paintImageXObjectRepeat| ops are appropriate. - addState(InitialState, - [OPS.save, OPS.transform, OPS.paintImageXObject, OPS.restore], - function (context) { - var MIN_IMAGES_IN_BLOCK = 3; - var MAX_IMAGES_IN_BLOCK = 1000; - - var fnArray = context.fnArray, argsArray = context.argsArray; - var curr = context.iCurr; - var iFirstSave = curr - 3; - var iFirstTransform = curr - 2; - var iFirstPIXO = curr - 1; - var iFirstRestore = curr; - - if (argsArray[iFirstTransform][1] !== 0 || - argsArray[iFirstTransform][2] !== 0) { - return iFirstRestore + 1; // transform has the wrong form - } - - // Look for the quartets. - var firstPIXOArg0 = argsArray[iFirstPIXO][0]; - var firstTransformArg0 = argsArray[iFirstTransform][0]; - var firstTransformArg3 = argsArray[iFirstTransform][3]; - var i = iFirstSave + 4; - var ii = fnArray.length; - while (i + 3 < ii) { - if (fnArray[i] !== OPS.save || - fnArray[i + 1] !== OPS.transform || - fnArray[i + 2] !== OPS.paintImageXObject || - fnArray[i + 3] !== OPS.restore) { - break; // ops don't match - } - if (argsArray[i + 1][0] !== firstTransformArg0 || - argsArray[i + 1][1] !== 0 || - argsArray[i + 1][2] !== 0 || - argsArray[i + 1][3] !== firstTransformArg3) { - break; // transforms don't match - } - if (argsArray[i + 2][0] !== firstPIXOArg0) { - break; // images don't match - } - i += 4; - } - - // At this point, i is the index of the first op past the last valid - // quartet. - var count = Math.min((i - iFirstSave) / 4, MAX_IMAGES_IN_BLOCK); - if (count < MIN_IMAGES_IN_BLOCK) { - return i; - } - - // Extract the (x,y) positions from all of the matching transforms. - var positions = new Float32Array(count * 2); - var iTransform = iFirstTransform; - for (var q = 0; q < count; q++, iTransform += 4) { - var transformArgs = argsArray[iTransform]; - positions[(q << 1)] = transformArgs[4]; - positions[(q << 1) + 1] = transformArgs[5]; - } - - // Replace queue items. - var args = [firstPIXOArg0, firstTransformArg0, firstTransformArg3, - positions]; - fnArray.splice(iFirstSave, count * 4, OPS.paintImageXObjectRepeat); - argsArray.splice(iFirstSave, count * 4, args); - - return iFirstSave + 1; - }); - - // This replaces (beginText, setFont, setTextMatrix, showText, endText)+ - // sequences with (beginText, setFont, (setTextMatrix, showText)+, endText)+ - // sequences, if the font for each one is the same. - addState(InitialState, - [OPS.beginText, OPS.setFont, OPS.setTextMatrix, OPS.showText, OPS.endText], - function (context) { - var MIN_CHARS_IN_BLOCK = 3; - var MAX_CHARS_IN_BLOCK = 1000; - - var fnArray = context.fnArray, argsArray = context.argsArray; - var curr = context.iCurr; - var iFirstBeginText = curr - 4; - var iFirstSetFont = curr - 3; - var iFirstSetTextMatrix = curr - 2; - var iFirstShowText = curr - 1; - var iFirstEndText = curr; - - // Look for the quintets. - var firstSetFontArg0 = argsArray[iFirstSetFont][0]; - var firstSetFontArg1 = argsArray[iFirstSetFont][1]; - var i = iFirstBeginText + 5; - var ii = fnArray.length; - while (i + 4 < ii) { - if (fnArray[i] !== OPS.beginText || - fnArray[i + 1] !== OPS.setFont || - fnArray[i + 2] !== OPS.setTextMatrix || - fnArray[i + 3] !== OPS.showText || - fnArray[i + 4] !== OPS.endText) { - break; // ops don't match - } - if (argsArray[i + 1][0] !== firstSetFontArg0 || - argsArray[i + 1][1] !== firstSetFontArg1) { - break; // fonts don't match - } - i += 5; - } - - // At this point, i is the index of the first op past the last valid - // quintet. - var count = Math.min(((i - iFirstBeginText) / 5), MAX_CHARS_IN_BLOCK); - if (count < MIN_CHARS_IN_BLOCK) { - return i; - } - - // If the preceding quintet is (, setFont, setTextMatrix, - // showText, endText), include that as well. (E.g. might be - // |dependency|.) - var iFirst = iFirstBeginText; - if (iFirstBeginText >= 4 && - fnArray[iFirstBeginText - 4] === fnArray[iFirstSetFont] && - fnArray[iFirstBeginText - 3] === fnArray[iFirstSetTextMatrix] && - fnArray[iFirstBeginText - 2] === fnArray[iFirstShowText] && - fnArray[iFirstBeginText - 1] === fnArray[iFirstEndText] && - argsArray[iFirstBeginText - 4][0] === firstSetFontArg0 && - argsArray[iFirstBeginText - 4][1] === firstSetFontArg1) { - count++; - iFirst -= 5; - } - - // Remove (endText, beginText, setFont) trios. - var iEndText = iFirst + 4; - for (var q = 1; q < count; q++) { - fnArray.splice(iEndText, 3); - argsArray.splice(iEndText, 3); - iEndText += 2; - } - - return iEndText + 1; - }); - - function QueueOptimizer() {} - - QueueOptimizer.prototype = { - optimize: function QueueOptimizer_optimize(queue) { - var fnArray = queue.fnArray, argsArray = queue.argsArray; - var context = { - iCurr: 0, - fnArray: fnArray, - argsArray: argsArray - }; - var state; - var i = 0, ii = fnArray.length; - while (i < ii) { - state = (state || InitialState)[fnArray[i]]; - if (typeof state === 'function') { // we found some handler - context.iCurr = i; - // state() returns the index of the first non-matching op (if we - // didn't match) or the first op past the modified ops (if we did - // match and replace). - i = state(context); - state = undefined; // reset the state machine - ii = context.fnArray.length; - } else { - i++; - } - } - } - }; - return QueueOptimizer; -})(); - -exports.OperatorList = OperatorList; -exports.PartialEvaluator = PartialEvaluator; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreAnnotation = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreStream, root.pdfjsCoreColorSpace, - root.pdfjsCoreObj, root.pdfjsCoreEvaluator); - } -}(this, function (exports, sharedUtil, corePrimitives, coreStream, - coreColorSpace, coreObj, coreEvaluator) { - -var AnnotationBorderStyleType = sharedUtil.AnnotationBorderStyleType; -var AnnotationFieldFlag = sharedUtil.AnnotationFieldFlag; -var AnnotationFlag = sharedUtil.AnnotationFlag; -var AnnotationType = sharedUtil.AnnotationType; -var OPS = sharedUtil.OPS; -var Util = sharedUtil.Util; -var isBool = sharedUtil.isBool; -var isString = sharedUtil.isString; -var isArray = sharedUtil.isArray; -var isInt = sharedUtil.isInt; -var isValidUrl = sharedUtil.isValidUrl; -var stringToBytes = sharedUtil.stringToBytes; -var stringToPDFString = sharedUtil.stringToPDFString; -var stringToUTF8String = sharedUtil.stringToUTF8String; -var warn = sharedUtil.warn; -var Dict = corePrimitives.Dict; -var isDict = corePrimitives.isDict; -var isName = corePrimitives.isName; -var isRef = corePrimitives.isRef; -var Stream = coreStream.Stream; -var ColorSpace = coreColorSpace.ColorSpace; -var ObjectLoader = coreObj.ObjectLoader; -var FileSpec = coreObj.FileSpec; -var OperatorList = coreEvaluator.OperatorList; - -/** - * @class - * @alias AnnotationFactory - */ -function AnnotationFactory() {} -AnnotationFactory.prototype = /** @lends AnnotationFactory.prototype */ { - /** - * @param {XRef} xref - * @param {Object} ref - * @param {string} uniquePrefix - * @param {Object} idCounters - * @returns {Annotation} - */ - create: function AnnotationFactory_create(xref, ref, - uniquePrefix, idCounters) { - var dict = xref.fetchIfRef(ref); - if (!isDict(dict)) { - return; - } - var id = isRef(ref) ? ref.toString() : - 'annot_' + (uniquePrefix || '') + (++idCounters.obj); - - // Determine the annotation's subtype. - var subtype = dict.get('Subtype'); - subtype = isName(subtype) ? subtype.name : null; - - // Return the right annotation object based on the subtype and field type. - var parameters = { - xref: xref, - dict: dict, - ref: isRef(ref) ? ref : null, - subtype: subtype, - id: id, - }; - - switch (subtype) { - case 'Link': - return new LinkAnnotation(parameters); - - case 'Text': - return new TextAnnotation(parameters); - - case 'Widget': - var fieldType = Util.getInheritableProperty(dict, 'FT'); - fieldType = isName(fieldType) ? fieldType.name : null; - - switch (fieldType) { - case 'Tx': - return new TextWidgetAnnotation(parameters); - } - warn('Unimplemented widget field type "' + fieldType + '", ' + - 'falling back to base field type.'); - return new WidgetAnnotation(parameters); - - case 'Popup': - return new PopupAnnotation(parameters); - - case 'Highlight': - return new HighlightAnnotation(parameters); - - case 'Underline': - return new UnderlineAnnotation(parameters); - - case 'Squiggly': - return new SquigglyAnnotation(parameters); - - case 'StrikeOut': - return new StrikeOutAnnotation(parameters); - - case 'FileAttachment': - return new FileAttachmentAnnotation(parameters); - - default: - if (!subtype) { - warn('Annotation is missing the required /Subtype.'); - } else { - warn('Unimplemented annotation type "' + subtype + '", ' + - 'falling back to base annotation.'); - } - return new Annotation(parameters); - } - } -}; - -var Annotation = (function AnnotationClosure() { - // 12.5.5: Algorithm: Appearance streams - function getTransformMatrix(rect, bbox, matrix) { - var bounds = Util.getAxialAlignedBoundingBox(bbox, matrix); - var minX = bounds[0]; - var minY = bounds[1]; - var maxX = bounds[2]; - var maxY = bounds[3]; - - if (minX === maxX || minY === maxY) { - // From real-life file, bbox was [0, 0, 0, 0]. In this case, - // just apply the transform for rect - return [1, 0, 0, 1, rect[0], rect[1]]; - } - - var xRatio = (rect[2] - rect[0]) / (maxX - minX); - var yRatio = (rect[3] - rect[1]) / (maxY - minY); - return [ - xRatio, - 0, - 0, - yRatio, - rect[0] - minX * xRatio, - rect[1] - minY * yRatio - ]; - } - - function getDefaultAppearance(dict) { - var appearanceState = dict.get('AP'); - if (!isDict(appearanceState)) { - return; - } - - var appearance; - var appearances = appearanceState.get('N'); - if (isDict(appearances)) { - var as = dict.get('AS'); - if (as && appearances.has(as.name)) { - appearance = appearances.get(as.name); - } - } else { - appearance = appearances; - } - return appearance; - } - - function Annotation(params) { - var dict = params.dict; - - this.setFlags(dict.get('F')); - this.setRectangle(dict.getArray('Rect')); - this.setColor(dict.getArray('C')); - this.setBorderStyle(dict); - this.appearance = getDefaultAppearance(dict); - - // Expose public properties using a data object. - this.data = {}; - this.data.id = params.id; - this.data.subtype = params.subtype; - this.data.annotationFlags = this.flags; - this.data.rect = this.rectangle; - this.data.color = this.color; - this.data.borderStyle = this.borderStyle; - this.data.hasAppearance = !!this.appearance; - } - - Annotation.prototype = { - /** - * @private - */ - _hasFlag: function Annotation_hasFlag(flags, flag) { - return !!(flags & flag); - }, - - /** - * @private - */ - _isViewable: function Annotation_isViewable(flags) { - return !this._hasFlag(flags, AnnotationFlag.INVISIBLE) && - !this._hasFlag(flags, AnnotationFlag.HIDDEN) && - !this._hasFlag(flags, AnnotationFlag.NOVIEW); - }, - - /** - * @private - */ - _isPrintable: function AnnotationFlag_isPrintable(flags) { - return this._hasFlag(flags, AnnotationFlag.PRINT) && - !this._hasFlag(flags, AnnotationFlag.INVISIBLE) && - !this._hasFlag(flags, AnnotationFlag.HIDDEN); - }, - - /** - * @return {boolean} - */ - get viewable() { - if (this.flags === 0) { - return true; - } - return this._isViewable(this.flags); - }, - - /** - * @return {boolean} - */ - get printable() { - if (this.flags === 0) { - return false; - } - return this._isPrintable(this.flags); - }, - - /** - * Set the flags. - * - * @public - * @memberof Annotation - * @param {number} flags - Unsigned 32-bit integer specifying annotation - * characteristics - * @see {@link shared/util.js} - */ - setFlags: function Annotation_setFlags(flags) { - this.flags = (isInt(flags) && flags > 0) ? flags : 0; - }, - - /** - * Check if a provided flag is set. - * - * @public - * @memberof Annotation - * @param {number} flag - Hexadecimal representation for an annotation - * characteristic - * @return {boolean} - * @see {@link shared/util.js} - */ - hasFlag: function Annotation_hasFlag(flag) { - return this._hasFlag(this.flags, flag); - }, - - /** - * Set the rectangle. - * - * @public - * @memberof Annotation - * @param {Array} rectangle - The rectangle array with exactly four entries - */ - setRectangle: function Annotation_setRectangle(rectangle) { - if (isArray(rectangle) && rectangle.length === 4) { - this.rectangle = Util.normalizeRect(rectangle); - } else { - this.rectangle = [0, 0, 0, 0]; - } - }, - - /** - * Set the color and take care of color space conversion. - * - * @public - * @memberof Annotation - * @param {Array} color - The color array containing either 0 - * (transparent), 1 (grayscale), 3 (RGB) or - * 4 (CMYK) elements - */ - setColor: function Annotation_setColor(color) { - var rgbColor = new Uint8Array(3); // Black in RGB color space (default) - if (!isArray(color)) { - this.color = rgbColor; - return; - } - - switch (color.length) { - case 0: // Transparent, which we indicate with a null value - this.color = null; - break; - - case 1: // Convert grayscale to RGB - ColorSpace.singletons.gray.getRgbItem(color, 0, rgbColor, 0); - this.color = rgbColor; - break; - - case 3: // Convert RGB percentages to RGB - ColorSpace.singletons.rgb.getRgbItem(color, 0, rgbColor, 0); - this.color = rgbColor; - break; - - case 4: // Convert CMYK to RGB - ColorSpace.singletons.cmyk.getRgbItem(color, 0, rgbColor, 0); - this.color = rgbColor; - break; - - default: - this.color = rgbColor; - break; - } - }, - - /** - * Set the border style (as AnnotationBorderStyle object). - * - * @public - * @memberof Annotation - * @param {Dict} borderStyle - The border style dictionary - */ - setBorderStyle: function Annotation_setBorderStyle(borderStyle) { - this.borderStyle = new AnnotationBorderStyle(); - if (!isDict(borderStyle)) { - return; - } - if (borderStyle.has('BS')) { - var dict = borderStyle.get('BS'); - var dictType = dict.get('Type'); - - if (!dictType || isName(dictType, 'Border')) { - this.borderStyle.setWidth(dict.get('W')); - this.borderStyle.setStyle(dict.get('S')); - this.borderStyle.setDashArray(dict.getArray('D')); - } - } else if (borderStyle.has('Border')) { - var array = borderStyle.getArray('Border'); - if (isArray(array) && array.length >= 3) { - this.borderStyle.setHorizontalCornerRadius(array[0]); - this.borderStyle.setVerticalCornerRadius(array[1]); - this.borderStyle.setWidth(array[2]); - - if (array.length === 4) { // Dash array available - this.borderStyle.setDashArray(array[3]); - } - } - } else { - // There are no border entries in the dictionary. According to the - // specification, we should draw a solid border of width 1 in that - // case, but Adobe Reader did not implement that part of the - // specification and instead draws no border at all, so we do the same. - // See also https://github.com/mozilla/pdf.js/issues/6179. - this.borderStyle.setWidth(0); - } - }, - - /** - * Prepare the annotation for working with a popup in the display layer. - * - * @private - * @memberof Annotation - * @param {Dict} dict - The annotation's data dictionary - */ - _preparePopup: function Annotation_preparePopup(dict) { - if (!dict.has('C')) { - // Fall back to the default background color. - this.data.color = null; - } - - this.data.hasPopup = dict.has('Popup'); - this.data.title = stringToPDFString(dict.get('T') || ''); - this.data.contents = stringToPDFString(dict.get('Contents') || ''); - }, - - loadResources: function Annotation_loadResources(keys) { - return new Promise(function (resolve, reject) { - this.appearance.dict.getAsync('Resources').then(function (resources) { - if (!resources) { - resolve(); - return; - } - var objectLoader = new ObjectLoader(resources.map, - keys, - resources.xref); - objectLoader.load().then(function() { - resolve(resources); - }, reject); - }, reject); - }.bind(this)); - }, - - getOperatorList: function Annotation_getOperatorList(evaluator, task, - renderForms) { - if (!this.appearance) { - return Promise.resolve(new OperatorList()); - } - - var data = this.data; - var appearanceDict = this.appearance.dict; - var resourcesPromise = this.loadResources([ - 'ExtGState', - 'ColorSpace', - 'Pattern', - 'Shading', - 'XObject', - 'Font' - // ProcSet - // Properties - ]); - var bbox = appearanceDict.getArray('BBox') || [0, 0, 1, 1]; - var matrix = appearanceDict.getArray('Matrix') || [1, 0, 0, 1, 0 ,0]; - var transform = getTransformMatrix(data.rect, bbox, matrix); - var self = this; - - return resourcesPromise.then(function(resources) { - var opList = new OperatorList(); - opList.addOp(OPS.beginAnnotation, [data.rect, transform, matrix]); - return evaluator.getOperatorList(self.appearance, task, - resources, opList). - then(function () { - opList.addOp(OPS.endAnnotation, []); - self.appearance.reset(); - return opList; - }); - }); - } - }; - - Annotation.appendToOperatorList = function Annotation_appendToOperatorList( - annotations, opList, partialEvaluator, task, intent, renderForms) { - var annotationPromises = []; - for (var i = 0, n = annotations.length; i < n; ++i) { - if ((intent === 'display' && annotations[i].viewable) || - (intent === 'print' && annotations[i].printable)) { - annotationPromises.push( - annotations[i].getOperatorList(partialEvaluator, task, renderForms)); - } - } - return Promise.all(annotationPromises).then(function(operatorLists) { - opList.addOp(OPS.beginAnnotations, []); - for (var i = 0, n = operatorLists.length; i < n; ++i) { - opList.addOpList(operatorLists[i]); - } - opList.addOp(OPS.endAnnotations, []); - }); - }; - - return Annotation; -})(); - -/** - * Contains all data regarding an annotation's border style. - * - * @class - */ -var AnnotationBorderStyle = (function AnnotationBorderStyleClosure() { - /** - * @constructor - * @private - */ - function AnnotationBorderStyle() { - this.width = 1; - this.style = AnnotationBorderStyleType.SOLID; - this.dashArray = [3]; - this.horizontalCornerRadius = 0; - this.verticalCornerRadius = 0; - } - - AnnotationBorderStyle.prototype = { - /** - * Set the width. - * - * @public - * @memberof AnnotationBorderStyle - * @param {integer} width - The width - */ - setWidth: function AnnotationBorderStyle_setWidth(width) { - if (width === (width | 0)) { - this.width = width; - } - }, - - /** - * Set the style. - * - * @public - * @memberof AnnotationBorderStyle - * @param {Object} style - The style object - * @see {@link shared/util.js} - */ - setStyle: function AnnotationBorderStyle_setStyle(style) { - if (!style) { - return; - } - switch (style.name) { - case 'S': - this.style = AnnotationBorderStyleType.SOLID; - break; - - case 'D': - this.style = AnnotationBorderStyleType.DASHED; - break; - - case 'B': - this.style = AnnotationBorderStyleType.BEVELED; - break; - - case 'I': - this.style = AnnotationBorderStyleType.INSET; - break; - - case 'U': - this.style = AnnotationBorderStyleType.UNDERLINE; - break; - - default: - break; - } - }, - - /** - * Set the dash array. - * - * @public - * @memberof AnnotationBorderStyle - * @param {Array} dashArray - The dash array with at least one element - */ - setDashArray: function AnnotationBorderStyle_setDashArray(dashArray) { - // We validate the dash array, but we do not use it because CSS does not - // allow us to change spacing of dashes. For more information, visit - // http://www.w3.org/TR/css3-background/#the-border-style. - if (isArray(dashArray) && dashArray.length > 0) { - // According to the PDF specification: the elements in a dashArray - // shall be numbers that are nonnegative and not all equal to zero. - var isValid = true; - var allZeros = true; - for (var i = 0, len = dashArray.length; i < len; i++) { - var element = dashArray[i]; - var validNumber = (+element >= 0); - if (!validNumber) { - isValid = false; - break; - } else if (element > 0) { - allZeros = false; - } - } - if (isValid && !allZeros) { - this.dashArray = dashArray; - } else { - this.width = 0; // Adobe behavior when the array is invalid. - } - } else if (dashArray) { - this.width = 0; // Adobe behavior when the array is invalid. - } - }, - - /** - * Set the horizontal corner radius (from a Border dictionary). - * - * @public - * @memberof AnnotationBorderStyle - * @param {integer} radius - The horizontal corner radius - */ - setHorizontalCornerRadius: - function AnnotationBorderStyle_setHorizontalCornerRadius(radius) { - if (radius === (radius | 0)) { - this.horizontalCornerRadius = radius; - } - }, - - /** - * Set the vertical corner radius (from a Border dictionary). - * - * @public - * @memberof AnnotationBorderStyle - * @param {integer} radius - The vertical corner radius - */ - setVerticalCornerRadius: - function AnnotationBorderStyle_setVerticalCornerRadius(radius) { - if (radius === (radius | 0)) { - this.verticalCornerRadius = radius; - } - } - }; - - return AnnotationBorderStyle; -})(); - -var WidgetAnnotation = (function WidgetAnnotationClosure() { - function WidgetAnnotation(params) { - Annotation.call(this, params); - - var dict = params.dict; - var data = this.data; - - data.annotationType = AnnotationType.WIDGET; - data.fieldValue = stringToPDFString( - Util.getInheritableProperty(dict, 'V') || ''); - data.alternativeText = stringToPDFString(dict.get('TU') || ''); - data.defaultAppearance = Util.getInheritableProperty(dict, 'DA') || ''; - var fieldType = Util.getInheritableProperty(dict, 'FT'); - data.fieldType = isName(fieldType) ? fieldType.name : null; - this.fieldResources = Util.getInheritableProperty(dict, 'DR') || Dict.empty; - - data.fieldFlags = Util.getInheritableProperty(dict, 'Ff'); - if (!isInt(data.fieldFlags) || data.fieldFlags < 0) { - data.fieldFlags = 0; - } - - // Hide signatures because we cannot validate them. - if (data.fieldType === 'Sig') { - this.setFlags(AnnotationFlag.HIDDEN); - } - - // Building the full field name by collecting the field and - // its ancestors 'T' data and joining them using '.'. - var fieldName = []; - var namedItem = dict; - var ref = params.ref; - while (namedItem) { - var parent = namedItem.get('Parent'); - var parentRef = namedItem.getRaw('Parent'); - var name = namedItem.get('T'); - if (name) { - fieldName.unshift(stringToPDFString(name)); - } else if (parent && ref) { - // The field name is absent, that means more than one field - // with the same name may exist. Replacing the empty name - // with the '`' plus index in the parent's 'Kids' array. - // This is not in the PDF spec but necessary to id the - // the input controls. - var kids = parent.get('Kids'); - var j, jj; - for (j = 0, jj = kids.length; j < jj; j++) { - var kidRef = kids[j]; - if (kidRef.num === ref.num && kidRef.gen === ref.gen) { - break; - } - } - fieldName.unshift('`' + j); - } - namedItem = parent; - ref = parentRef; - } - data.fullName = fieldName.join('.'); - } - - Util.inherit(WidgetAnnotation, Annotation, { - /** - * Check if a provided field flag is set. - * - * @public - * @memberof WidgetAnnotation - * @param {number} flag - Hexadecimal representation for an annotation - * field characteristic - * @return {boolean} - * @see {@link shared/util.js} - */ - hasFieldFlag: function WidgetAnnotation_hasFieldFlag(flag) { - return !!(this.data.fieldFlags & flag); - }, - }); - - return WidgetAnnotation; -})(); - -var TextWidgetAnnotation = (function TextWidgetAnnotationClosure() { - function TextWidgetAnnotation(params) { - WidgetAnnotation.call(this, params); - - // Determine the alignment of text in the field. - var alignment = Util.getInheritableProperty(params.dict, 'Q'); - if (!isInt(alignment) || alignment < 0 || alignment > 2) { - alignment = null; - } - this.data.textAlignment = alignment; - - // Determine the maximum length of text in the field. - var maximumLength = Util.getInheritableProperty(params.dict, 'MaxLen'); - if (!isInt(maximumLength) || maximumLength < 0) { - maximumLength = null; - } - this.data.maxLen = maximumLength; - - // Process field flags for the display layer. - this.data.readOnly = this.hasFieldFlag(AnnotationFieldFlag.READONLY); - this.data.multiLine = this.hasFieldFlag(AnnotationFieldFlag.MULTILINE); - this.data.comb = this.hasFieldFlag(AnnotationFieldFlag.COMB) && - !this.hasFieldFlag(AnnotationFieldFlag.MULTILINE) && - !this.hasFieldFlag(AnnotationFieldFlag.PASSWORD) && - !this.hasFieldFlag(AnnotationFieldFlag.FILESELECT) && - this.data.maxLen !== null; - } - - Util.inherit(TextWidgetAnnotation, WidgetAnnotation, { - getOperatorList: - function TextWidgetAnnotation_getOperatorList(evaluator, task, - renderForms) { - var operatorList = new OperatorList(); - - // Do not render form elements on the canvas when interactive forms are - // enabled. The display layer is responsible for rendering them instead. - if (renderForms) { - return Promise.resolve(operatorList); - } - - if (this.appearance) { - return Annotation.prototype.getOperatorList.call(this, evaluator, task, - renderForms); - } - - // Even if there is an appearance stream, ignore it. This is the - // behaviour used by Adobe Reader. - if (!this.data.defaultAppearance) { - return Promise.resolve(operatorList); - } - - var stream = new Stream(stringToBytes(this.data.defaultAppearance)); - return evaluator.getOperatorList(stream, task, this.fieldResources, - operatorList). - then(function () { - return operatorList; - }); - } - }); - - return TextWidgetAnnotation; -})(); - -var TextAnnotation = (function TextAnnotationClosure() { - var DEFAULT_ICON_SIZE = 22; // px - - function TextAnnotation(parameters) { - Annotation.call(this, parameters); - - this.data.annotationType = AnnotationType.TEXT; - - if (this.data.hasAppearance) { - this.data.name = 'NoIcon'; - } else { - this.data.rect[1] = this.data.rect[3] - DEFAULT_ICON_SIZE; - this.data.rect[2] = this.data.rect[0] + DEFAULT_ICON_SIZE; - this.data.name = parameters.dict.has('Name') ? - parameters.dict.get('Name').name : 'Note'; - } - this._preparePopup(parameters.dict); - } - - Util.inherit(TextAnnotation, Annotation, {}); - - return TextAnnotation; -})(); - -var LinkAnnotation = (function LinkAnnotationClosure() { - function LinkAnnotation(params) { - Annotation.call(this, params); - - var dict = params.dict; - var data = this.data; - data.annotationType = AnnotationType.LINK; - - var action = dict.get('A'), url, dest; - if (action && isDict(action)) { - var linkType = action.get('S').name; - switch (linkType) { - case 'URI': - url = action.get('URI'); - if (isName(url)) { - // Some bad PDFs do not put parentheses around relative URLs. - url = '/' + url.name; - } else if (url) { - url = addDefaultProtocolToUrl(url); - } - // TODO: pdf spec mentions urls can be relative to a Base - // entry in the dictionary. - break; - - case 'GoTo': - dest = action.get('D'); - break; - - case 'GoToR': - var urlDict = action.get('F'); - if (isDict(urlDict)) { - // We assume that we found a FileSpec dictionary - // and fetch the URL without checking any further. - url = urlDict.get('F') || null; - } else if (isString(urlDict)) { - url = urlDict; - } - - // NOTE: the destination is relative to the *remote* document. - var remoteDest = action.get('D'); - if (remoteDest) { - if (isName(remoteDest)) { - remoteDest = remoteDest.name; - } - if (isString(url)) { - var baseUrl = url.split('#')[0]; - if (isString(remoteDest)) { - // In practice, a named destination may contain only a number. - // If that happens, use the '#nameddest=' form to avoid the link - // redirecting to a page, instead of the correct destination. - url = baseUrl + '#' + - (/^\d+$/.test(remoteDest) ? 'nameddest=' : '') + remoteDest; - } else if (isArray(remoteDest)) { - url = baseUrl + '#' + JSON.stringify(remoteDest); - } - } - } - // The 'NewWindow' property, equal to `LinkTarget.BLANK`. - var newWindow = action.get('NewWindow'); - if (isBool(newWindow)) { - data.newWindow = newWindow; - } - break; - - case 'Named': - data.action = action.get('N').name; - break; - - default: - warn('unrecognized link type: ' + linkType); - } - } else if (dict.has('Dest')) { // Simple destination link. - dest = dict.get('Dest'); - } - - if (url) { - if (isValidUrl(url, /* allowRelative = */ false)) { - data.url = tryConvertUrlEncoding(url); - } - } - if (dest) { - data.dest = isName(dest) ? dest.name : dest; - } - } - - // Lets URLs beginning with 'www.' default to using the 'http://' protocol. - function addDefaultProtocolToUrl(url) { - if (isString(url) && url.indexOf('www.') === 0) { - return ('http://' + url); - } - return url; - } - - function tryConvertUrlEncoding(url) { - // According to ISO 32000-1:2008, section 12.6.4.7, URIs should be encoded - // in 7-bit ASCII. Some bad PDFs use UTF-8 encoding, see Bugzilla 1122280. - try { - return stringToUTF8String(url); - } catch (e) { - return url; - } - } - - Util.inherit(LinkAnnotation, Annotation, {}); - - return LinkAnnotation; -})(); - -var PopupAnnotation = (function PopupAnnotationClosure() { - function PopupAnnotation(parameters) { - Annotation.call(this, parameters); - - this.data.annotationType = AnnotationType.POPUP; - - var dict = parameters.dict; - var parentItem = dict.get('Parent'); - if (!parentItem) { - warn('Popup annotation has a missing or invalid parent annotation.'); - return; - } - - this.data.parentId = dict.getRaw('Parent').toString(); - this.data.title = stringToPDFString(parentItem.get('T') || ''); - this.data.contents = stringToPDFString(parentItem.get('Contents') || ''); - - if (!parentItem.has('C')) { - // Fall back to the default background color. - this.data.color = null; - } else { - this.setColor(parentItem.getArray('C')); - this.data.color = this.color; - } - - // If the Popup annotation is not viewable, but the parent annotation is, - // that is most likely a bug. Fallback to inherit the flags from the parent - // annotation (this is consistent with the behaviour in Adobe Reader). - if (!this.viewable) { - var parentFlags = parentItem.get('F'); - if (this._isViewable(parentFlags)) { - this.setFlags(parentFlags); - } - } - } - - Util.inherit(PopupAnnotation, Annotation, {}); - - return PopupAnnotation; -})(); - -var HighlightAnnotation = (function HighlightAnnotationClosure() { - function HighlightAnnotation(parameters) { - Annotation.call(this, parameters); - - this.data.annotationType = AnnotationType.HIGHLIGHT; - this._preparePopup(parameters.dict); - - // PDF viewers completely ignore any border styles. - this.data.borderStyle.setWidth(0); - } - - Util.inherit(HighlightAnnotation, Annotation, {}); - - return HighlightAnnotation; -})(); - -var UnderlineAnnotation = (function UnderlineAnnotationClosure() { - function UnderlineAnnotation(parameters) { - Annotation.call(this, parameters); - - this.data.annotationType = AnnotationType.UNDERLINE; - this._preparePopup(parameters.dict); - - // PDF viewers completely ignore any border styles. - this.data.borderStyle.setWidth(0); - } - - Util.inherit(UnderlineAnnotation, Annotation, {}); - - return UnderlineAnnotation; -})(); - -var SquigglyAnnotation = (function SquigglyAnnotationClosure() { - function SquigglyAnnotation(parameters) { - Annotation.call(this, parameters); - - this.data.annotationType = AnnotationType.SQUIGGLY; - this._preparePopup(parameters.dict); - - // PDF viewers completely ignore any border styles. - this.data.borderStyle.setWidth(0); - } - - Util.inherit(SquigglyAnnotation, Annotation, {}); - - return SquigglyAnnotation; -})(); - -var StrikeOutAnnotation = (function StrikeOutAnnotationClosure() { - function StrikeOutAnnotation(parameters) { - Annotation.call(this, parameters); - - this.data.annotationType = AnnotationType.STRIKEOUT; - this._preparePopup(parameters.dict); - - // PDF viewers completely ignore any border styles. - this.data.borderStyle.setWidth(0); - } - - Util.inherit(StrikeOutAnnotation, Annotation, {}); - - return StrikeOutAnnotation; -})(); - -var FileAttachmentAnnotation = (function FileAttachmentAnnotationClosure() { - function FileAttachmentAnnotation(parameters) { - Annotation.call(this, parameters); - - var file = new FileSpec(parameters.dict.get('FS'), parameters.xref); - - this.data.annotationType = AnnotationType.FILEATTACHMENT; - this.data.file = file.serializable; - this._preparePopup(parameters.dict); - } - - Util.inherit(FileAttachmentAnnotation, Annotation, {}); - - return FileAttachmentAnnotation; -})(); - -exports.Annotation = Annotation; -exports.AnnotationBorderStyle = AnnotationBorderStyle; -exports.AnnotationFactory = AnnotationFactory; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreDocument = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCoreStream, - root.pdfjsCoreObj, root.pdfjsCoreParser, root.pdfjsCoreCrypto, - root.pdfjsCoreEvaluator, root.pdfjsCoreAnnotation); - } -}(this, function (exports, sharedUtil, corePrimitives, coreStream, coreObj, - coreParser, coreCrypto, coreEvaluator, coreAnnotation) { - -var MissingDataException = sharedUtil.MissingDataException; -var Util = sharedUtil.Util; -var assert = sharedUtil.assert; -var error = sharedUtil.error; -var info = sharedUtil.info; -var isArray = sharedUtil.isArray; -var isArrayBuffer = sharedUtil.isArrayBuffer; -var isString = sharedUtil.isString; -var shadow = sharedUtil.shadow; -var stringToBytes = sharedUtil.stringToBytes; -var stringToPDFString = sharedUtil.stringToPDFString; -var warn = sharedUtil.warn; -var isSpace = sharedUtil.isSpace; -var Dict = corePrimitives.Dict; -var isDict = corePrimitives.isDict; -var isName = corePrimitives.isName; -var isStream = corePrimitives.isStream; -var NullStream = coreStream.NullStream; -var Stream = coreStream.Stream; -var StreamsSequenceStream = coreStream.StreamsSequenceStream; -var Catalog = coreObj.Catalog; -var ObjectLoader = coreObj.ObjectLoader; -var XRef = coreObj.XRef; -var Linearization = coreParser.Linearization; -var calculateMD5 = coreCrypto.calculateMD5; -var OperatorList = coreEvaluator.OperatorList; -var PartialEvaluator = coreEvaluator.PartialEvaluator; -var Annotation = coreAnnotation.Annotation; -var AnnotationFactory = coreAnnotation.AnnotationFactory; - -var Page = (function PageClosure() { - - var LETTER_SIZE_MEDIABOX = [0, 0, 612, 792]; - - function Page(pdfManager, xref, pageIndex, pageDict, ref, fontCache) { - this.pdfManager = pdfManager; - this.pageIndex = pageIndex; - this.pageDict = pageDict; - this.xref = xref; - this.ref = ref; - this.fontCache = fontCache; - this.uniquePrefix = 'p' + this.pageIndex + '_'; - this.idCounters = { - obj: 0 - }; - this.evaluatorOptions = pdfManager.evaluatorOptions; - this.resourcesPromise = null; - } - - Page.prototype = { - getPageProp: function Page_getPageProp(key) { - return this.pageDict.get(key); - }, - - getInheritedPageProp: function Page_getInheritedPageProp(key) { - var dict = this.pageDict, valueArray = null, loopCount = 0; - var MAX_LOOP_COUNT = 100; - // Always walk up the entire parent chain, to be able to find - // e.g. \Resources placed on multiple levels of the tree. - while (dict) { - var value = dict.get(key); - if (value) { - if (!valueArray) { - valueArray = []; - } - valueArray.push(value); - } - if (++loopCount > MAX_LOOP_COUNT) { - warn('Page_getInheritedPageProp: maximum loop count exceeded.'); - break; - } - dict = dict.get('Parent'); - } - if (!valueArray) { - return Dict.empty; - } - if (valueArray.length === 1 || !isDict(valueArray[0]) || - loopCount > MAX_LOOP_COUNT) { - return valueArray[0]; - } - return Dict.merge(this.xref, valueArray); - }, - - get content() { - return this.getPageProp('Contents'); - }, - - get resources() { - // For robustness: The spec states that a \Resources entry has to be - // present, but can be empty. Some document omit it still, in this case - // we return an empty dictionary. - return shadow(this, 'resources', this.getInheritedPageProp('Resources')); - }, - - get mediaBox() { - var obj = this.getInheritedPageProp('MediaBox'); - // Reset invalid media box to letter size. - if (!isArray(obj) || obj.length !== 4) { - obj = LETTER_SIZE_MEDIABOX; - } - return shadow(this, 'mediaBox', obj); - }, - - get view() { - var mediaBox = this.mediaBox; - var cropBox = this.getInheritedPageProp('CropBox'); - if (!isArray(cropBox) || cropBox.length !== 4) { - return shadow(this, 'view', mediaBox); - } - - // From the spec, 6th ed., p.963: - // "The crop, bleed, trim, and art boxes should not ordinarily - // extend beyond the boundaries of the media box. If they do, they are - // effectively reduced to their intersection with the media box." - cropBox = Util.intersect(cropBox, mediaBox); - if (!cropBox) { - return shadow(this, 'view', mediaBox); - } - return shadow(this, 'view', cropBox); - }, - - get rotate() { - var rotate = this.getInheritedPageProp('Rotate') || 0; - // Normalize rotation so it's a multiple of 90 and between 0 and 270 - if (rotate % 90 !== 0) { - rotate = 0; - } else if (rotate >= 360) { - rotate = rotate % 360; - } else if (rotate < 0) { - // The spec doesn't cover negatives, assume its counterclockwise - // rotation. The following is the other implementation of modulo. - rotate = ((rotate % 360) + 360) % 360; - } - return shadow(this, 'rotate', rotate); - }, - - getContentStream: function Page_getContentStream() { - var content = this.content; - var stream; - if (isArray(content)) { - // fetching items - var xref = this.xref; - var i, n = content.length; - var streams = []; - for (i = 0; i < n; ++i) { - streams.push(xref.fetchIfRef(content[i])); - } - stream = new StreamsSequenceStream(streams); - } else if (isStream(content)) { - stream = content; - } else { - // replacing non-existent page content with empty one - stream = new NullStream(); - } - return stream; - }, - - loadResources: function Page_loadResources(keys) { - if (!this.resourcesPromise) { - // TODO: add async getInheritedPageProp and remove this. - this.resourcesPromise = this.pdfManager.ensure(this, 'resources'); - } - return this.resourcesPromise.then(function resourceSuccess() { - var objectLoader = new ObjectLoader(this.resources.map, - keys, - this.xref); - return objectLoader.load(); - }.bind(this)); - }, - - getOperatorList: function Page_getOperatorList(handler, task, intent, - renderInteractiveForms) { - var self = this; - - var pdfManager = this.pdfManager; - var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', - []); - var resourcesPromise = this.loadResources([ - 'ExtGState', - 'ColorSpace', - 'Pattern', - 'Shading', - 'XObject', - 'Font' - // ProcSet - // Properties - ]); - - var partialEvaluator = new PartialEvaluator(pdfManager, this.xref, - handler, this.pageIndex, - this.uniquePrefix, - this.idCounters, - this.fontCache, - this.evaluatorOptions); - - var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]); - var pageListPromise = dataPromises.then(function(data) { - var contentStream = data[0]; - var opList = new OperatorList(intent, handler, self.pageIndex); - - handler.send('StartRenderPage', { - transparency: partialEvaluator.hasBlendModes(self.resources), - pageIndex: self.pageIndex, - intent: intent - }); - return partialEvaluator.getOperatorList(contentStream, task, - self.resources, opList).then(function () { - return opList; - }); - }); - - var annotationsPromise = pdfManager.ensure(this, 'annotations'); - return Promise.all([pageListPromise, annotationsPromise]).then( - function(datas) { - var pageOpList = datas[0]; - var annotations = datas[1]; - - if (annotations.length === 0) { - pageOpList.flush(true); - return pageOpList; - } - - var annotationsReadyPromise = Annotation.appendToOperatorList( - annotations, pageOpList, partialEvaluator, task, intent, - renderInteractiveForms); - return annotationsReadyPromise.then(function () { - pageOpList.flush(true); - return pageOpList; - }); - }); - }, - - extractTextContent: function Page_extractTextContent(task, - normalizeWhitespace, - combineTextItems) { - var handler = { - on: function nullHandlerOn() {}, - send: function nullHandlerSend() {} - }; - - var self = this; - - var pdfManager = this.pdfManager; - var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', - []); - - var resourcesPromise = this.loadResources([ - 'ExtGState', - 'XObject', - 'Font' - ]); - - var dataPromises = Promise.all([contentStreamPromise, - resourcesPromise]); - return dataPromises.then(function(data) { - var contentStream = data[0]; - var partialEvaluator = new PartialEvaluator(pdfManager, self.xref, - handler, self.pageIndex, - self.uniquePrefix, - self.idCounters, - self.fontCache, - self.evaluatorOptions); - - return partialEvaluator.getTextContent(contentStream, - task, - self.resources, - /* stateManager = */ null, - normalizeWhitespace, - combineTextItems); - }); - }, - - getAnnotationsData: function Page_getAnnotationsData(intent) { - var annotations = this.annotations; - var annotationsData = []; - for (var i = 0, n = annotations.length; i < n; ++i) { - if (intent) { - if (!(intent === 'display' && annotations[i].viewable) && - !(intent === 'print' && annotations[i].printable)) { - continue; - } - } - annotationsData.push(annotations[i].data); - } - return annotationsData; - }, - - get annotations() { - var annotations = []; - var annotationRefs = this.getInheritedPageProp('Annots') || []; - var annotationFactory = new AnnotationFactory(); - for (var i = 0, n = annotationRefs.length; i < n; ++i) { - var annotationRef = annotationRefs[i]; - var annotation = annotationFactory.create(this.xref, annotationRef, - this.uniquePrefix, - this.idCounters); - if (annotation) { - annotations.push(annotation); - } - } - return shadow(this, 'annotations', annotations); - } - }; - - return Page; -})(); - -/** - * The `PDFDocument` holds all the data of the PDF file. Compared to the - * `PDFDoc`, this one doesn't have any job management code. - * Right now there exists one PDFDocument on the main thread + one object - * for each worker. If there is no worker support enabled, there are two - * `PDFDocument` objects on the main thread created. - */ -var PDFDocument = (function PDFDocumentClosure() { - var FINGERPRINT_FIRST_BYTES = 1024; - var EMPTY_FINGERPRINT = '\x00\x00\x00\x00\x00\x00\x00' + - '\x00\x00\x00\x00\x00\x00\x00\x00\x00'; - - function PDFDocument(pdfManager, arg, password) { - if (isStream(arg)) { - init.call(this, pdfManager, arg, password); - } else if (isArrayBuffer(arg)) { - init.call(this, pdfManager, new Stream(arg), password); - } else { - error('PDFDocument: Unknown argument type'); - } - } - - function init(pdfManager, stream, password) { - assert(stream.length > 0, 'stream must have data'); - this.pdfManager = pdfManager; - this.stream = stream; - var xref = new XRef(this.stream, password, pdfManager); - this.xref = xref; - } - - function find(stream, needle, limit, backwards) { - var pos = stream.pos; - var end = stream.end; - var strBuf = []; - if (pos + limit > end) { - limit = end - pos; - } - for (var n = 0; n < limit; ++n) { - strBuf.push(String.fromCharCode(stream.getByte())); - } - var str = strBuf.join(''); - stream.pos = pos; - var index = backwards ? str.lastIndexOf(needle) : str.indexOf(needle); - if (index === -1) { - return false; /* not found */ - } - stream.pos += index; - return true; /* found */ - } - - var DocumentInfoValidators = { - get entries() { - // Lazily build this since all the validation functions below are not - // defined until after this file loads. - return shadow(this, 'entries', { - Title: isString, - Author: isString, - Subject: isString, - Keywords: isString, - Creator: isString, - Producer: isString, - CreationDate: isString, - ModDate: isString, - Trapped: isName - }); - } - }; - - PDFDocument.prototype = { - parse: function PDFDocument_parse(recoveryMode) { - this.setup(recoveryMode); - var version = this.catalog.catDict.get('Version'); - if (isName(version)) { - this.pdfFormatVersion = version.name; - } - try { - // checking if AcroForm is present - this.acroForm = this.catalog.catDict.get('AcroForm'); - if (this.acroForm) { - this.xfa = this.acroForm.get('XFA'); - var fields = this.acroForm.get('Fields'); - if ((!fields || !isArray(fields) || fields.length === 0) && - !this.xfa) { - // no fields and no XFA -- not a form (?) - this.acroForm = null; - } - } - } catch (ex) { - info('Something wrong with AcroForm entry'); - this.acroForm = null; - } - }, - - get linearization() { - var linearization = null; - if (this.stream.length) { - try { - linearization = Linearization.create(this.stream); - } catch (err) { - if (err instanceof MissingDataException) { - throw err; - } - info(err); - } - } - // shadow the prototype getter with a data property - return shadow(this, 'linearization', linearization); - }, - get startXRef() { - var stream = this.stream; - var startXRef = 0; - var linearization = this.linearization; - if (linearization) { - // Find end of first obj. - stream.reset(); - if (find(stream, 'endobj', 1024)) { - startXRef = stream.pos + 6; - } - } else { - // Find startxref by jumping backward from the end of the file. - var step = 1024; - var found = false, pos = stream.end; - while (!found && pos > 0) { - pos -= step - 'startxref'.length; - if (pos < 0) { - pos = 0; - } - stream.pos = pos; - found = find(stream, 'startxref', step, true); - } - if (found) { - stream.skip(9); - var ch; - do { - ch = stream.getByte(); - } while (isSpace(ch)); - var str = ''; - while (ch >= 0x20 && ch <= 0x39) { // < '9' - str += String.fromCharCode(ch); - ch = stream.getByte(); - } - startXRef = parseInt(str, 10); - if (isNaN(startXRef)) { - startXRef = 0; - } - } - } - // shadow the prototype getter with a data property - return shadow(this, 'startXRef', startXRef); - }, - get mainXRefEntriesOffset() { - var mainXRefEntriesOffset = 0; - var linearization = this.linearization; - if (linearization) { - mainXRefEntriesOffset = linearization.mainXRefEntriesOffset; - } - // shadow the prototype getter with a data property - return shadow(this, 'mainXRefEntriesOffset', mainXRefEntriesOffset); - }, - // Find the header, remove leading garbage and setup the stream - // starting from the header. - checkHeader: function PDFDocument_checkHeader() { - var stream = this.stream; - stream.reset(); - if (find(stream, '%PDF-', 1024)) { - // Found the header, trim off any garbage before it. - stream.moveStart(); - // Reading file format version - var MAX_VERSION_LENGTH = 12; - var version = '', ch; - while ((ch = stream.getByte()) > 0x20) { // SPACE - if (version.length >= MAX_VERSION_LENGTH) { - break; - } - version += String.fromCharCode(ch); - } - if (!this.pdfFormatVersion) { - // removing "%PDF-"-prefix - this.pdfFormatVersion = version.substring(5); - } - return; - } - // May not be a PDF file, continue anyway. - }, - parseStartXRef: function PDFDocument_parseStartXRef() { - var startXRef = this.startXRef; - this.xref.setStartXRef(startXRef); - }, - setup: function PDFDocument_setup(recoveryMode) { - this.xref.parse(recoveryMode); - var self = this; - var pageFactory = { - createPage: function (pageIndex, dict, ref, fontCache) { - return new Page(self.pdfManager, self.xref, pageIndex, dict, ref, - fontCache); - } - }; - this.catalog = new Catalog(this.pdfManager, this.xref, pageFactory); - }, - get numPages() { - var linearization = this.linearization; - var num = linearization ? linearization.numPages : this.catalog.numPages; - // shadow the prototype getter - return shadow(this, 'numPages', num); - }, - get documentInfo() { - var docInfo = { - PDFFormatVersion: this.pdfFormatVersion, - IsAcroFormPresent: !!this.acroForm, - IsXFAPresent: !!this.xfa - }; - var infoDict; - try { - infoDict = this.xref.trailer.get('Info'); - } catch (err) { - info('The document information dictionary is invalid.'); - } - if (infoDict) { - var validEntries = DocumentInfoValidators.entries; - // Only fill the document info with valid entries from the spec. - for (var key in validEntries) { - if (infoDict.has(key)) { - var value = infoDict.get(key); - // Make sure the value conforms to the spec. - if (validEntries[key](value)) { - docInfo[key] = (typeof value !== 'string' ? - value : stringToPDFString(value)); - } else { - info('Bad value in document info for "' + key + '"'); - } - } - } - } - return shadow(this, 'documentInfo', docInfo); - }, - get fingerprint() { - var xref = this.xref, hash, fileID = ''; - var idArray = xref.trailer.get('ID'); - - if (idArray && isArray(idArray) && idArray[0] && isString(idArray[0]) && - idArray[0] !== EMPTY_FINGERPRINT) { - hash = stringToBytes(idArray[0]); - } else { - if (this.stream.ensureRange) { - this.stream.ensureRange(0, - Math.min(FINGERPRINT_FIRST_BYTES, this.stream.end)); - } - hash = calculateMD5(this.stream.bytes.subarray(0, - FINGERPRINT_FIRST_BYTES), 0, FINGERPRINT_FIRST_BYTES); - } - - for (var i = 0, n = hash.length; i < n; i++) { - var hex = hash[i].toString(16); - fileID += hex.length === 1 ? '0' + hex : hex; - } - - return shadow(this, 'fingerprint', fileID); - }, - - getPage: function PDFDocument_getPage(pageIndex) { - return this.catalog.getPage(pageIndex); - }, - - cleanup: function PDFDocument_cleanup() { - return this.catalog.cleanup(); - } - }; - - return PDFDocument; -})(); - -exports.Page = Page; -exports.PDFDocument = PDFDocument; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCorePdfManager = {}), root.pdfjsSharedUtil, - root.pdfjsCoreStream, root.pdfjsCoreChunkedStream, - root.pdfjsCoreDocument); - } -}(this, function (exports, sharedUtil, coreStream, coreChunkedStream, - coreDocument) { - -var NotImplementedException = sharedUtil.NotImplementedException; -var MissingDataException = sharedUtil.MissingDataException; -var createPromiseCapability = sharedUtil.createPromiseCapability; -var Util = sharedUtil.Util; -var Stream = coreStream.Stream; -var ChunkedStreamManager = coreChunkedStream.ChunkedStreamManager; -var PDFDocument = coreDocument.PDFDocument; - -var BasePdfManager = (function BasePdfManagerClosure() { - function BasePdfManager() { - throw new Error('Cannot initialize BaseManagerManager'); - } - - BasePdfManager.prototype = { - get docId() { - return this._docId; - }, - - onLoadedStream: function BasePdfManager_onLoadedStream() { - throw new NotImplementedException(); - }, - - ensureDoc: function BasePdfManager_ensureDoc(prop, args) { - return this.ensure(this.pdfDocument, prop, args); - }, - - ensureXRef: function BasePdfManager_ensureXRef(prop, args) { - return this.ensure(this.pdfDocument.xref, prop, args); - }, - - ensureCatalog: function BasePdfManager_ensureCatalog(prop, args) { - return this.ensure(this.pdfDocument.catalog, prop, args); - }, - - getPage: function BasePdfManager_getPage(pageIndex) { - return this.pdfDocument.getPage(pageIndex); - }, - - cleanup: function BasePdfManager_cleanup() { - return this.pdfDocument.cleanup(); - }, - - ensure: function BasePdfManager_ensure(obj, prop, args) { - return new NotImplementedException(); - }, - - requestRange: function BasePdfManager_requestRange(begin, end) { - return new NotImplementedException(); - }, - - requestLoadedStream: function BasePdfManager_requestLoadedStream() { - return new NotImplementedException(); - }, - - sendProgressiveData: function BasePdfManager_sendProgressiveData(chunk) { - return new NotImplementedException(); - }, - - updatePassword: function BasePdfManager_updatePassword(password) { - this.pdfDocument.xref.password = this.password = password; - if (this._passwordChangedCapability) { - this._passwordChangedCapability.resolve(); - } - }, - - passwordChanged: function BasePdfManager_passwordChanged() { - this._passwordChangedCapability = createPromiseCapability(); - return this._passwordChangedCapability.promise; - }, - - terminate: function BasePdfManager_terminate() { - return new NotImplementedException(); - } - }; - - return BasePdfManager; -})(); - -var LocalPdfManager = (function LocalPdfManagerClosure() { - function LocalPdfManager(docId, data, password, evaluatorOptions) { - this._docId = docId; - this.evaluatorOptions = evaluatorOptions; - var stream = new Stream(data); - this.pdfDocument = new PDFDocument(this, stream, password); - this._loadedStreamCapability = createPromiseCapability(); - this._loadedStreamCapability.resolve(stream); - } - - Util.inherit(LocalPdfManager, BasePdfManager, { - ensure: function LocalPdfManager_ensure(obj, prop, args) { - return new Promise(function (resolve, reject) { - try { - var value = obj[prop]; - var result; - if (typeof value === 'function') { - result = value.apply(obj, args); - } else { - result = value; - } - resolve(result); - } catch (e) { - reject(e); - } - }); - }, - - requestRange: function LocalPdfManager_requestRange(begin, end) { - return Promise.resolve(); - }, - - requestLoadedStream: function LocalPdfManager_requestLoadedStream() { - return; - }, - - onLoadedStream: function LocalPdfManager_onLoadedStream() { - return this._loadedStreamCapability.promise; - }, - - terminate: function LocalPdfManager_terminate() { - return; - } - }); - - return LocalPdfManager; -})(); - -var NetworkPdfManager = (function NetworkPdfManagerClosure() { - function NetworkPdfManager(docId, pdfNetworkStream, args, evaluatorOptions) { - this._docId = docId; - this.msgHandler = args.msgHandler; - this.evaluatorOptions = evaluatorOptions; - - var params = { - msgHandler: args.msgHandler, - url: args.url, - length: args.length, - disableAutoFetch: args.disableAutoFetch, - rangeChunkSize: args.rangeChunkSize - }; - this.streamManager = new ChunkedStreamManager(pdfNetworkStream, params); - this.pdfDocument = new PDFDocument(this, this.streamManager.getStream(), - args.password); - } - - Util.inherit(NetworkPdfManager, BasePdfManager, { - ensure: function NetworkPdfManager_ensure(obj, prop, args) { - var pdfManager = this; - - return new Promise(function (resolve, reject) { - function ensureHelper() { - try { - var result; - var value = obj[prop]; - if (typeof value === 'function') { - result = value.apply(obj, args); - } else { - result = value; - } - resolve(result); - } catch(e) { - if (!(e instanceof MissingDataException)) { - reject(e); - return; - } - pdfManager.streamManager.requestRange(e.begin, e.end). - then(ensureHelper, reject); - } - } - - ensureHelper(); - }); - }, - - requestRange: function NetworkPdfManager_requestRange(begin, end) { - return this.streamManager.requestRange(begin, end); - }, - - requestLoadedStream: function NetworkPdfManager_requestLoadedStream() { - this.streamManager.requestAllChunks(); - }, - - sendProgressiveData: - function NetworkPdfManager_sendProgressiveData(chunk) { - this.streamManager.onReceiveData({ chunk: chunk }); - }, - - onLoadedStream: function NetworkPdfManager_onLoadedStream() { - return this.streamManager.onLoadedStream(); - }, - - terminate: function NetworkPdfManager_terminate() { - this.streamManager.abort(); - } - }); - - return NetworkPdfManager; -})(); - -exports.LocalPdfManager = LocalPdfManager; -exports.NetworkPdfManager = NetworkPdfManager; -})); - - -(function (root, factory) { - { - factory((root.pdfjsCoreWorker = {}), root.pdfjsSharedUtil, - root.pdfjsCorePrimitives, root.pdfjsCorePdfManager); - } -}(this, function (exports, sharedUtil, corePrimitives, corePdfManager) { - -var UNSUPPORTED_FEATURES = sharedUtil.UNSUPPORTED_FEATURES; -var InvalidPDFException = sharedUtil.InvalidPDFException; -var MessageHandler = sharedUtil.MessageHandler; -var MissingPDFException = sharedUtil.MissingPDFException; -var UnexpectedResponseException = sharedUtil.UnexpectedResponseException; -var PasswordException = sharedUtil.PasswordException; -var PasswordResponses = sharedUtil.PasswordResponses; -var UnknownErrorException = sharedUtil.UnknownErrorException; -var XRefParseException = sharedUtil.XRefParseException; -var arrayByteLength = sharedUtil.arrayByteLength; -var arraysToBytes = sharedUtil.arraysToBytes; -var assert = sharedUtil.assert; -var createPromiseCapability = sharedUtil.createPromiseCapability; -var error = sharedUtil.error; -var info = sharedUtil.info; -var warn = sharedUtil.warn; -var setVerbosityLevel = sharedUtil.setVerbosityLevel; -var Ref = corePrimitives.Ref; -var LocalPdfManager = corePdfManager.LocalPdfManager; -var NetworkPdfManager = corePdfManager.NetworkPdfManager; -var globalScope = sharedUtil.globalScope; - -var WorkerTask = (function WorkerTaskClosure() { - function WorkerTask(name) { - this.name = name; - this.terminated = false; - this._capability = createPromiseCapability(); - } - - WorkerTask.prototype = { - get finished() { - return this._capability.promise; - }, - - finish: function () { - this._capability.resolve(); - }, - - terminate: function () { - this.terminated = true; - }, - - ensureNotTerminated: function () { - if (this.terminated) { - throw new Error('Worker task was terminated'); - } - } - }; - - return WorkerTask; -})(); - - -/** @implements {IPDFStream} */ -var PDFWorkerStream = (function PDFWorkerStreamClosure() { - function PDFWorkerStream(params, msgHandler) { - this._queuedChunks = []; - var initialData = params.initialData; - if (initialData && initialData.length > 0) { - this._queuedChunks.push(initialData); - } - this._msgHandler = msgHandler; - - this._isRangeSupported = !(params.disableRange); - this._isStreamingSupported = !(params.disableStream); - this._contentLength = params.length; - - this._fullRequestReader = null; - this._rangeReaders = []; - - msgHandler.on('OnDataRange', this._onReceiveData.bind(this)); - msgHandler.on('OnDataProgress', this._onProgress.bind(this)); - } - PDFWorkerStream.prototype = { - _onReceiveData: function PDFWorkerStream_onReceiveData(args) { - if (args.begin === undefined) { - if (this._fullRequestReader) { - this._fullRequestReader._enqueue(args.chunk); - } else { - this._queuedChunks.push(args.chunk); - } - } else { - var found = this._rangeReaders.some(function (rangeReader) { - if (rangeReader._begin !== args.begin) { - return false; - } - rangeReader._enqueue(args.chunk); - return true; - }); - assert(found); - } - }, - - _onProgress: function PDFWorkerStream_onProgress(evt) { - if (this._rangeReaders.length > 0) { - // Reporting to first range reader. - var firstReader = this._rangeReaders[0]; - if (firstReader.onProgress) { - firstReader.onProgress({loaded: evt.loaded}); - } - } - }, - - _removeRangeReader: function PDFWorkerStream_removeRangeReader(reader) { - var i = this._rangeReaders.indexOf(reader); - if (i >= 0) { - this._rangeReaders.splice(i, 1); - } - }, - - getFullReader: function PDFWorkerStream_getFullReader() { - assert(!this._fullRequestReader); - var queuedChunks = this._queuedChunks; - this._queuedChunks = null; - return new PDFWorkerStreamReader(this, queuedChunks); - }, - - getRangeReader: function PDFWorkerStream_getRangeReader(begin, end) { - var reader = new PDFWorkerStreamRangeReader(this, begin, end); - this._msgHandler.send('RequestDataRange', { begin: begin, end: end }); - this._rangeReaders.push(reader); - return reader; - }, - - cancelAllRequests: function PDFWorkerStream_cancelAllRequests(reason) { - if (this._fullRequestReader) { - this._fullRequestReader.cancel(reason); - } - var readers = this._rangeReaders.slice(0); - readers.forEach(function (rangeReader) { - rangeReader.cancel(reason); - }); - } - }; - - /** @implements {IPDFStreamReader} */ - function PDFWorkerStreamReader(stream, queuedChunks) { - this._stream = stream; - this._done = false; - this._queuedChunks = queuedChunks || []; - this._requests = []; - this._headersReady = Promise.resolve(); - stream._fullRequestReader = this; - - this.onProgress = null; // not used - } - PDFWorkerStreamReader.prototype = { - _enqueue: function PDFWorkerStreamReader_enqueue(chunk) { - if (this._done) { - return; // ignore new data - } - if (this._requests.length > 0) { - var requestCapability = this._requests.shift(); - requestCapability.resolve({value: chunk, done: false}); - return; - } - this._queuedChunks.push(chunk); - }, - - get headersReady() { - return this._headersReady; - }, - - get isRangeSupported() { - return this._stream._isRangeSupported; - }, - - get isStreamingSupported() { - return this._stream._isStreamingSupported; - }, - - get contentLength() { - return this._stream._contentLength; - }, - - read: function PDFWorkerStreamReader_read() { - if (this._queuedChunks.length > 0) { - var chunk = this._queuedChunks.shift(); - return Promise.resolve({value: chunk, done: false}); - } - if (this._done) { - return Promise.resolve({value: undefined, done: true}); - } - var requestCapability = createPromiseCapability(); - this._requests.push(requestCapability); - return requestCapability.promise; - }, - - cancel: function PDFWorkerStreamReader_cancel(reason) { - this._done = true; - this._requests.forEach(function (requestCapability) { - requestCapability.resolve({value: undefined, done: true}); - }); - this._requests = []; - } - }; - - /** @implements {IPDFStreamRangeReader} */ - function PDFWorkerStreamRangeReader(stream, begin, end) { - this._stream = stream; - this._begin = begin; - this._end = end; - this._queuedChunk = null; - this._requests = []; - this._done = false; - - this.onProgress = null; - } - PDFWorkerStreamRangeReader.prototype = { - _enqueue: function PDFWorkerStreamRangeReader_enqueue(chunk) { - if (this._done) { - return; // ignore new data - } - if (this._requests.length === 0) { - this._queuedChunk = chunk; - } else { - var requestsCapability = this._requests.shift(); - requestsCapability.resolve({value: chunk, done: false}); - this._requests.forEach(function (requestCapability) { - requestCapability.resolve({value: undefined, done: true}); - }); - this._requests = []; - } - this._done = true; - this._stream._removeRangeReader(this); - }, - - get isStreamingSupported() { - return false; - }, - - read: function PDFWorkerStreamRangeReader_read() { - if (this._queuedChunk) { - return Promise.resolve({value: this._queuedChunk, done: false}); - } - if (this._done) { - return Promise.resolve({value: undefined, done: true}); - } - var requestCapability = createPromiseCapability(); - this._requests.push(requestCapability); - return requestCapability.promise; - }, - - cancel: function PDFWorkerStreamRangeReader_cancel(reason) { - this._done = true; - this._requests.forEach(function (requestCapability) { - requestCapability.resolve({value: undefined, done: true}); - }); - this._requests = []; - this._stream._removeRangeReader(this); - } - }; - - return PDFWorkerStream; -})(); - -/** @type IPDFStream */ -var PDFNetworkStream; - -/** - * Sets PDFNetworkStream class to be used as alternative PDF data transport. - * @param {IPDFStream} cls - the PDF data transport. - */ -function setPDFNetworkStreamClass(cls) { - PDFNetworkStream = cls; -} - -var WorkerMessageHandler = { - setup: function wphSetup(handler, port) { - var testMessageProcessed = false; - handler.on('test', function wphSetupTest(data) { - if (testMessageProcessed) { - return; // we already processed 'test' message once - } - testMessageProcessed = true; - - // check if Uint8Array can be sent to worker - if (!(data instanceof Uint8Array)) { - handler.send('test', 'main', false); - return; - } - // making sure postMessage transfers are working - var supportTransfers = data[0] === 255; - handler.postMessageTransfers = supportTransfers; - // check if the response property is supported by xhr - var xhr = new XMLHttpRequest(); - var responseExists = 'response' in xhr; - // check if the property is actually implemented - try { - var dummy = xhr.responseType; - } catch (e) { - responseExists = false; - } - if (!responseExists) { - handler.send('test', false); - return; - } - handler.send('test', { - supportTypedArray: true, - supportTransfers: supportTransfers - }); - }); - - handler.on('configure', function wphConfigure(data) { - setVerbosityLevel(data.verbosity); - }); - - handler.on('GetDocRequest', function wphSetupDoc(data) { - return WorkerMessageHandler.createDocumentHandler(data, port); - }); - }, - createDocumentHandler: function wphCreateDocumentHandler(docParams, port) { - // This context is actually holds references on pdfManager and handler, - // until the latter is destroyed. - var pdfManager; - var terminated = false; - var cancelXHRs = null; - var WorkerTasks = []; - - var docId = docParams.docId; - var workerHandlerName = docParams.docId + '_worker'; - var handler = new MessageHandler(workerHandlerName, docId, port); - - // Ensure that postMessage transfers are correctly enabled/disabled, - // to prevent "DataCloneError" in older versions of IE (see issue 6957). - handler.postMessageTransfers = docParams.postMessageTransfers; - - function ensureNotTerminated() { - if (terminated) { - throw new Error('Worker was terminated'); - } - } - - function startWorkerTask(task) { - WorkerTasks.push(task); - } - - function finishWorkerTask(task) { - task.finish(); - var i = WorkerTasks.indexOf(task); - WorkerTasks.splice(i, 1); - } - - function loadDocument(recoveryMode) { - var loadDocumentCapability = createPromiseCapability(); - - var parseSuccess = function parseSuccess() { - var numPagesPromise = pdfManager.ensureDoc('numPages'); - var fingerprintPromise = pdfManager.ensureDoc('fingerprint'); - var encryptedPromise = pdfManager.ensureXRef('encrypt'); - Promise.all([numPagesPromise, fingerprintPromise, - encryptedPromise]).then(function onDocReady(results) { - var doc = { - numPages: results[0], - fingerprint: results[1], - encrypted: !!results[2], - }; - loadDocumentCapability.resolve(doc); - }, - parseFailure); - }; - - var parseFailure = function parseFailure(e) { - loadDocumentCapability.reject(e); - }; - - pdfManager.ensureDoc('checkHeader', []).then(function() { - pdfManager.ensureDoc('parseStartXRef', []).then(function() { - pdfManager.ensureDoc('parse', [recoveryMode]).then( - parseSuccess, parseFailure); - }, parseFailure); - }, parseFailure); - - return loadDocumentCapability.promise; - } - - function getPdfManager(data, evaluatorOptions) { - var pdfManagerCapability = createPromiseCapability(); - var pdfManager; - - var source = data.source; - if (source.data) { - try { - pdfManager = new LocalPdfManager(docId, source.data, source.password, - evaluatorOptions); - pdfManagerCapability.resolve(pdfManager); - } catch (ex) { - pdfManagerCapability.reject(ex); - } - return pdfManagerCapability.promise; - } - - var pdfStream; - try { - if (source.chunkedViewerLoading) { - pdfStream = new PDFWorkerStream(source, handler); - } else { - assert(PDFNetworkStream, 'pdfjs/core/network module is not loaded'); - pdfStream = new PDFNetworkStream(data); - } - } catch (ex) { - pdfManagerCapability.reject(ex); - return pdfManagerCapability.promise; - } - - var fullRequest = pdfStream.getFullReader(); - fullRequest.headersReady.then(function () { - if (!fullRequest.isStreamingSupported || - !fullRequest.isRangeSupported) { - // If stream or range are disabled, it's our only way to report - // loading progress. - fullRequest.onProgress = function (evt) { - handler.send('DocProgress', { - loaded: evt.loaded, - total: evt.total - }); - }; - } - - if (!fullRequest.isRangeSupported) { - return; - } - - // We don't need auto-fetch when streaming is enabled. - var disableAutoFetch = source.disableAutoFetch || - fullRequest.isStreamingSupported; - pdfManager = new NetworkPdfManager(docId, pdfStream, { - msgHandler: handler, - url: source.url, - password: source.password, - length: fullRequest.contentLength, - disableAutoFetch: disableAutoFetch, - rangeChunkSize: source.rangeChunkSize - }, evaluatorOptions); - pdfManagerCapability.resolve(pdfManager); - cancelXHRs = null; - }).catch(function (reason) { - pdfManagerCapability.reject(reason); - cancelXHRs = null; - }); - - var cachedChunks = [], loaded = 0; - var flushChunks = function () { - var pdfFile = arraysToBytes(cachedChunks); - if (source.length && pdfFile.length !== source.length) { - warn('reported HTTP length is different from actual'); - } - // the data is array, instantiating directly from it - try { - pdfManager = new LocalPdfManager(docId, pdfFile, source.password, - evaluatorOptions); - pdfManagerCapability.resolve(pdfManager); - } catch (ex) { - pdfManagerCapability.reject(ex); - } - cachedChunks = []; - }; - var readPromise = new Promise(function (resolve, reject) { - var readChunk = function (chunk) { - try { - ensureNotTerminated(); - if (chunk.done) { - if (!pdfManager) { - flushChunks(); - } - cancelXHRs = null; - return; - } - - var data = chunk.value; - loaded += arrayByteLength(data); - if (!fullRequest.isStreamingSupported) { - handler.send('DocProgress', { - loaded: loaded, - total: Math.max(loaded, fullRequest.contentLength || 0) - }); - } - - if (pdfManager) { - pdfManager.sendProgressiveData(data); - } else { - cachedChunks.push(data); - } - - fullRequest.read().then(readChunk, reject); - } catch (e) { - reject(e); - } - }; - fullRequest.read().then(readChunk, reject); - }); - readPromise.catch(function (e) { - pdfManagerCapability.reject(e); - cancelXHRs = null; - }); - - cancelXHRs = function () { - pdfStream.cancelAllRequests('abort'); - }; - - return pdfManagerCapability.promise; - } - - var setupDoc = function(data) { - var onSuccess = function(doc) { - ensureNotTerminated(); - handler.send('GetDoc', { pdfInfo: doc }); - }; - - var onFailure = function(e) { - if (e instanceof PasswordException) { - if (e.code === PasswordResponses.NEED_PASSWORD) { - handler.send('NeedPassword', e); - } else if (e.code === PasswordResponses.INCORRECT_PASSWORD) { - handler.send('IncorrectPassword', e); - } - } else if (e instanceof InvalidPDFException) { - handler.send('InvalidPDF', e); - } else if (e instanceof MissingPDFException) { - handler.send('MissingPDF', e); - } else if (e instanceof UnexpectedResponseException) { - handler.send('UnexpectedResponse', e); - } else { - handler.send('UnknownError', - new UnknownErrorException(e.message, e.toString())); - } - }; - - ensureNotTerminated(); - - var cMapOptions = { - url: data.cMapUrl === undefined ? null : data.cMapUrl, - packed: data.cMapPacked === true - }; - var evaluatorOptions = { - forceDataSchema: data.disableCreateObjectURL, - maxImageSize: data.maxImageSize === undefined ? -1 : data.maxImageSize, - disableFontFace: data.disableFontFace, - cMapOptions: cMapOptions - }; - - getPdfManager(data, evaluatorOptions).then(function (newPdfManager) { - if (terminated) { - // We were in a process of setting up the manager, but it got - // terminated in the middle. - newPdfManager.terminate(); - throw new Error('Worker was terminated'); - } - - pdfManager = newPdfManager; - handler.send('PDFManagerReady', null); - pdfManager.onLoadedStream().then(function(stream) { - handler.send('DataLoaded', { length: stream.bytes.byteLength }); - }); - }).then(function pdfManagerReady() { - ensureNotTerminated(); - - loadDocument(false).then(onSuccess, function loadFailure(ex) { - ensureNotTerminated(); - - // Try again with recoveryMode == true - if (!(ex instanceof XRefParseException)) { - if (ex instanceof PasswordException) { - // after password exception prepare to receive a new password - // to repeat loading - pdfManager.passwordChanged().then(pdfManagerReady); - } - - onFailure(ex); - return; - } - - pdfManager.requestLoadedStream(); - pdfManager.onLoadedStream().then(function() { - ensureNotTerminated(); - - loadDocument(true).then(onSuccess, onFailure); - }); - }, onFailure); - }, onFailure); - }; - - handler.on('GetPage', function wphSetupGetPage(data) { - return pdfManager.getPage(data.pageIndex).then(function(page) { - var rotatePromise = pdfManager.ensure(page, 'rotate'); - var refPromise = pdfManager.ensure(page, 'ref'); - var viewPromise = pdfManager.ensure(page, 'view'); - - return Promise.all([rotatePromise, refPromise, viewPromise]).then( - function(results) { - return { - rotate: results[0], - ref: results[1], - view: results[2] - }; - }); - }); - }); - - handler.on('GetPageIndex', function wphSetupGetPageIndex(data) { - var ref = new Ref(data.ref.num, data.ref.gen); - var catalog = pdfManager.pdfDocument.catalog; - return catalog.getPageIndex(ref); - }); - - handler.on('GetDestinations', - function wphSetupGetDestinations(data) { - return pdfManager.ensureCatalog('destinations'); - } - ); - - handler.on('GetDestination', - function wphSetupGetDestination(data) { - return pdfManager.ensureCatalog('getDestination', [data.id]); - } - ); - - handler.on('GetPageLabels', - function wphSetupGetPageLabels(data) { - return pdfManager.ensureCatalog('pageLabels'); - } - ); - - handler.on('GetAttachments', - function wphSetupGetAttachments(data) { - return pdfManager.ensureCatalog('attachments'); - } - ); - - handler.on('GetJavaScript', - function wphSetupGetJavaScript(data) { - return pdfManager.ensureCatalog('javaScript'); - } - ); - - handler.on('GetOutline', - function wphSetupGetOutline(data) { - return pdfManager.ensureCatalog('documentOutline'); - } - ); - - handler.on('GetMetadata', - function wphSetupGetMetadata(data) { - return Promise.all([pdfManager.ensureDoc('documentInfo'), - pdfManager.ensureCatalog('metadata')]); - } - ); - - handler.on('GetData', function wphSetupGetData(data) { - pdfManager.requestLoadedStream(); - return pdfManager.onLoadedStream().then(function(stream) { - return stream.bytes; - }); - }); - - handler.on('GetStats', - function wphSetupGetStats(data) { - return pdfManager.pdfDocument.xref.stats; - } - ); - - handler.on('UpdatePassword', function wphSetupUpdatePassword(data) { - pdfManager.updatePassword(data); - }); - - handler.on('GetAnnotations', function wphSetupGetAnnotations(data) { - return pdfManager.getPage(data.pageIndex).then(function(page) { - return pdfManager.ensure(page, 'getAnnotationsData', [data.intent]); - }); - }); - - handler.on('RenderPageRequest', function wphSetupRenderPage(data) { - var pageIndex = data.pageIndex; - pdfManager.getPage(pageIndex).then(function(page) { - var task = new WorkerTask('RenderPageRequest: page ' + pageIndex); - startWorkerTask(task); - - var pageNum = pageIndex + 1; - var start = Date.now(); - // Pre compile the pdf page and fetch the fonts/images. - page.getOperatorList(handler, task, data.intent, - data.renderInteractiveForms).then( - function(operatorList) { - finishWorkerTask(task); - - info('page=' + pageNum + ' - getOperatorList: time=' + - (Date.now() - start) + 'ms, len=' + operatorList.totalLength); - }, function(e) { - finishWorkerTask(task); - if (task.terminated) { - return; // ignoring errors from the terminated thread - } - - // For compatibility with older behavior, generating unknown - // unsupported feature notification on errors. - handler.send('UnsupportedFeature', - {featureId: UNSUPPORTED_FEATURES.unknown}); - - var minimumStackMessage = - 'worker.js: while trying to getPage() and getOperatorList()'; - - var wrappedException; - - // Turn the error into an obj that can be serialized - if (typeof e === 'string') { - wrappedException = { - message: e, - stack: minimumStackMessage - }; - } else if (typeof e === 'object') { - wrappedException = { - message: e.message || e.toString(), - stack: e.stack || minimumStackMessage - }; - } else { - wrappedException = { - message: 'Unknown exception type: ' + (typeof e), - stack: minimumStackMessage - }; - } - - handler.send('PageError', { - pageNum: pageNum, - error: wrappedException, - intent: data.intent - }); - }); - }); - }, this); - - handler.on('GetTextContent', function wphExtractText(data) { - var pageIndex = data.pageIndex; - var normalizeWhitespace = data.normalizeWhitespace; - var combineTextItems = data.combineTextItems; - return pdfManager.getPage(pageIndex).then(function(page) { - var task = new WorkerTask('GetTextContent: page ' + pageIndex); - startWorkerTask(task); - var pageNum = pageIndex + 1; - var start = Date.now(); - return page.extractTextContent(task, normalizeWhitespace, - combineTextItems).then( - function(textContent) { - finishWorkerTask(task); - info('text indexing: page=' + pageNum + ' - time=' + - (Date.now() - start) + 'ms'); - return textContent; - }, function (reason) { - finishWorkerTask(task); - if (task.terminated) { - return; // ignoring errors from the terminated thread - } - throw reason; - }); - }); - }); - - handler.on('Cleanup', function wphCleanup(data) { - return pdfManager.cleanup(); - }); - - handler.on('Terminate', function wphTerminate(data) { - terminated = true; - if (pdfManager) { - pdfManager.terminate(); - pdfManager = null; - } - if (cancelXHRs) { - cancelXHRs(); - } - - var waitOn = []; - WorkerTasks.forEach(function (task) { - waitOn.push(task.finished); - task.terminate(); - }); - - return Promise.all(waitOn).then(function () { - // Notice that even if we destroying handler, resolved response promise - // must be sent back. - handler.destroy(); - handler = null; - }); - }); - - handler.on('Ready', function wphReady(data) { - setupDoc(docParams); - docParams = null; // we don't need docParams anymore -- saving memory. - }); - return workerHandlerName; - } -}; - -function initializeWorker() { - if (!('console' in globalScope)) { - var consoleTimer = {}; - - var workerConsole = { - log: function log() { - var args = Array.prototype.slice.call(arguments); - globalScope.postMessage({ - targetName: 'main', - action: 'console_log', - data: args - }); - }, - - error: function error() { - var args = Array.prototype.slice.call(arguments); - globalScope.postMessage({ - targetName: 'main', - action: 'console_error', - data: args - }); - throw 'pdf.js execution error'; - }, - - time: function time(name) { - consoleTimer[name] = Date.now(); - }, - - timeEnd: function timeEnd(name) { - var time = consoleTimer[name]; - if (!time) { - error('Unknown timer name ' + name); - } - this.log('Timer:', name, Date.now() - time); - } - }; - - globalScope.console = workerConsole; - } - - var handler = new MessageHandler('worker', 'main', self); - WorkerMessageHandler.setup(handler, self); - handler.send('ready', null); -} - -// Worker thread (and not node.js)? -if (typeof window === 'undefined' && - !(typeof module !== 'undefined' && module.require)) { - initializeWorker(); -} - -exports.setPDFNetworkStreamClass = setPDFNetworkStreamClass; -exports.WorkerTask = WorkerTask; -exports.WorkerMessageHandler = WorkerMessageHandler; -})); - - - - -var NetworkManager = (function NetworkManagerClosure() { - - var OK_RESPONSE = 200; - var PARTIAL_CONTENT_RESPONSE = 206; - - function NetworkManager(url, args) { - this.url = url; - args = args || {}; - this.isHttp = /^https?:/i.test(url); - this.httpHeaders = (this.isHttp && args.httpHeaders) || {}; - this.withCredentials = args.withCredentials || false; - this.getXhr = args.getXhr || - function NetworkManager_getXhr() { - return new XMLHttpRequest(); - }; - - this.currXhrId = 0; - this.pendingRequests = Object.create(null); - this.loadedRequests = Object.create(null); - } - - function getArrayBuffer(xhr) { - var data = xhr.response; - if (typeof data !== 'string') { - return data; - } - var length = data.length; - var array = new Uint8Array(length); - for (var i = 0; i < length; i++) { - array[i] = data.charCodeAt(i) & 0xFF; - } - return array.buffer; - } - - var supportsMozChunked = (function supportsMozChunkedClosure() { - try { - var x = new XMLHttpRequest(); - // Firefox 37- required .open() to be called before setting responseType. - // https://bugzilla.mozilla.org/show_bug.cgi?id=707484 - // Even though the URL is not visited, .open() could fail if the URL is - // blocked, e.g. via the connect-src CSP directive or the NoScript addon. - // When this error occurs, this feature detection method will mistakenly - // report that moz-chunked-arraybuffer is not supported in Firefox 37-. - x.open('GET', 'https://example.com'); - x.responseType = 'moz-chunked-arraybuffer'; - return x.responseType === 'moz-chunked-arraybuffer'; - } catch (e) { - return false; - } - })(); - - NetworkManager.prototype = { - requestRange: function NetworkManager_requestRange(begin, end, listeners) { - var args = { - begin: begin, - end: end - }; - for (var prop in listeners) { - args[prop] = listeners[prop]; - } - return this.request(args); - }, - - requestFull: function NetworkManager_requestFull(listeners) { - return this.request(listeners); - }, - - request: function NetworkManager_request(args) { - var xhr = this.getXhr(); - var xhrId = this.currXhrId++; - var pendingRequest = this.pendingRequests[xhrId] = { - xhr: xhr - }; - - xhr.open('GET', this.url); - xhr.withCredentials = this.withCredentials; - for (var property in this.httpHeaders) { - var value = this.httpHeaders[property]; - if (typeof value === 'undefined') { - continue; - } - xhr.setRequestHeader(property, value); - } - if (this.isHttp && 'begin' in args && 'end' in args) { - var rangeStr = args.begin + '-' + (args.end - 1); - xhr.setRequestHeader('Range', 'bytes=' + rangeStr); - pendingRequest.expectedStatus = 206; - } else { - pendingRequest.expectedStatus = 200; - } - - var useMozChunkedLoading = supportsMozChunked && !!args.onProgressiveData; - if (useMozChunkedLoading) { - xhr.responseType = 'moz-chunked-arraybuffer'; - pendingRequest.onProgressiveData = args.onProgressiveData; - pendingRequest.mozChunked = true; - } else { - xhr.responseType = 'arraybuffer'; - } - - if (args.onError) { - xhr.onerror = function(evt) { - args.onError(xhr.status); - }; - } - xhr.onreadystatechange = this.onStateChange.bind(this, xhrId); - xhr.onprogress = this.onProgress.bind(this, xhrId); - - pendingRequest.onHeadersReceived = args.onHeadersReceived; - pendingRequest.onDone = args.onDone; - pendingRequest.onError = args.onError; - pendingRequest.onProgress = args.onProgress; - - xhr.send(null); - - return xhrId; - }, - - onProgress: function NetworkManager_onProgress(xhrId, evt) { - var pendingRequest = this.pendingRequests[xhrId]; - if (!pendingRequest) { - // Maybe abortRequest was called... - return; - } - - if (pendingRequest.mozChunked) { - var chunk = getArrayBuffer(pendingRequest.xhr); - pendingRequest.onProgressiveData(chunk); - } - - var onProgress = pendingRequest.onProgress; - if (onProgress) { - onProgress(evt); - } - }, - - onStateChange: function NetworkManager_onStateChange(xhrId, evt) { - var pendingRequest = this.pendingRequests[xhrId]; - if (!pendingRequest) { - // Maybe abortRequest was called... - return; - } - - var xhr = pendingRequest.xhr; - if (xhr.readyState >= 2 && pendingRequest.onHeadersReceived) { - pendingRequest.onHeadersReceived(); - delete pendingRequest.onHeadersReceived; - } - - if (xhr.readyState !== 4) { - return; - } - - if (!(xhrId in this.pendingRequests)) { - // The XHR request might have been aborted in onHeadersReceived() - // callback, in which case we should abort request - return; - } - - delete this.pendingRequests[xhrId]; - - // success status == 0 can be on ftp, file and other protocols - if (xhr.status === 0 && this.isHttp) { - if (pendingRequest.onError) { - pendingRequest.onError(xhr.status); - } - return; - } - var xhrStatus = xhr.status || OK_RESPONSE; - - // From http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.2: - // "A server MAY ignore the Range header". This means it's possible to - // get a 200 rather than a 206 response from a range request. - var ok_response_on_range_request = - xhrStatus === OK_RESPONSE && - pendingRequest.expectedStatus === PARTIAL_CONTENT_RESPONSE; - - if (!ok_response_on_range_request && - xhrStatus !== pendingRequest.expectedStatus) { - if (pendingRequest.onError) { - pendingRequest.onError(xhr.status); - } - return; - } - - this.loadedRequests[xhrId] = true; - - var chunk = getArrayBuffer(xhr); - if (xhrStatus === PARTIAL_CONTENT_RESPONSE) { - var rangeHeader = xhr.getResponseHeader('Content-Range'); - var matches = /bytes (\d+)-(\d+)\/(\d+)/.exec(rangeHeader); - var begin = parseInt(matches[1], 10); - pendingRequest.onDone({ - begin: begin, - chunk: chunk - }); - } else if (pendingRequest.onProgressiveData) { - pendingRequest.onDone(null); - } else if (chunk) { - pendingRequest.onDone({ - begin: 0, - chunk: chunk - }); - } else if (pendingRequest.onError) { - pendingRequest.onError(xhr.status); - } - }, - - hasPendingRequests: function NetworkManager_hasPendingRequests() { - for (var xhrId in this.pendingRequests) { - return true; - } - return false; - }, - - getRequestXhr: function NetworkManager_getXhr(xhrId) { - return this.pendingRequests[xhrId].xhr; - }, - - isStreamingRequest: function NetworkManager_isStreamingRequest(xhrId) { - return !!(this.pendingRequests[xhrId].onProgressiveData); - }, - - isPendingRequest: function NetworkManager_isPendingRequest(xhrId) { - return xhrId in this.pendingRequests; - }, - - isLoadedRequest: function NetworkManager_isLoadedRequest(xhrId) { - return xhrId in this.loadedRequests; - }, - - abortAllRequests: function NetworkManager_abortAllRequests() { - for (var xhrId in this.pendingRequests) { - this.abortRequest(xhrId | 0); - } - }, - - abortRequest: function NetworkManager_abortRequest(xhrId) { - var xhr = this.pendingRequests[xhrId].xhr; - delete this.pendingRequests[xhrId]; - xhr.abort(); - } - }; - - return NetworkManager; -})(); - -(function (root, factory) { - { - factory((root.pdfjsCoreNetwork = {}), root.pdfjsSharedUtil, - root.pdfjsCoreWorker); - } -}(this, function (exports, sharedUtil, coreWorker) { - - var assert = sharedUtil.assert; - var createPromiseCapability = sharedUtil.createPromiseCapability; - var isInt = sharedUtil.isInt; - var MissingPDFException = sharedUtil.MissingPDFException; - var UnexpectedResponseException = sharedUtil.UnexpectedResponseException; - - /** @implements {IPDFStream} */ - function PDFNetworkStream(options) { - this._options = options; - var source = options.source; - this._manager = new NetworkManager(source.url, { - httpHeaders: source.httpHeaders, - withCredentials: source.withCredentials - }); - this._rangeChunkSize = source.rangeChunkSize; - this._fullRequestReader = null; - this._rangeRequestReaders = []; - } - - PDFNetworkStream.prototype = { - _onRangeRequestReaderClosed: - function PDFNetworkStream_onRangeRequestReaderClosed(reader) { - var i = this._rangeRequestReaders.indexOf(reader); - if (i >= 0) { - this._rangeRequestReaders.splice(i, 1); - } - }, - - getFullReader: function PDFNetworkStream_getFullReader() { - assert(!this._fullRequestReader); - this._fullRequestReader = - new PDFNetworkStreamFullRequestReader(this._manager, this._options); - return this._fullRequestReader; - }, - - getRangeReader: function PDFNetworkStream_getRangeReader(begin, end) { - var reader = new PDFNetworkStreamRangeRequestReader(this._manager, - begin, end); - reader.onClosed = this._onRangeRequestReaderClosed.bind(this); - this._rangeRequestReaders.push(reader); - return reader; - }, - - cancelAllRequests: function PDFNetworkStream_cancelAllRequests(reason) { - if (this._fullRequestReader) { - this._fullRequestReader.cancel(reason); - } - var readers = this._rangeRequestReaders.slice(0); - readers.forEach(function (reader) { - reader.cancel(reason); - }); - } - }; - - /** @implements {IPDFStreamReader} */ - function PDFNetworkStreamFullRequestReader(manager, options) { - this._manager = manager; - - var source = options.source; - var args = { - onHeadersReceived: this._onHeadersReceived.bind(this), - onProgressiveData: source.disableStream ? null : - this._onProgressiveData.bind(this), - onDone: this._onDone.bind(this), - onError: this._onError.bind(this), - onProgress: this._onProgress.bind(this) - }; - this._url = source.url; - this._fullRequestId = manager.requestFull(args); - this._headersReceivedCapability = createPromiseCapability(); - this._disableRange = options.disableRange || false; - this._contentLength = source.length; // optional - this._rangeChunkSize = source.rangeChunkSize; - if (!this._rangeChunkSize && !this._disableRange) { - this._disableRange = true; - } - - this._isStreamingSupported = false; - this._isRangeSupported = false; - - this._cachedChunks = []; - this._requests = []; - this._done = false; - this._storedError = undefined; - - this.onProgress = null; - } - - PDFNetworkStreamFullRequestReader.prototype = { - _validateRangeRequestCapabilities: function - PDFNetworkStreamFullRequestReader_validateRangeRequestCapabilities() { - - if (this._disableRange) { - return false; - } - - var networkManager = this._manager; - var fullRequestXhrId = this._fullRequestId; - var fullRequestXhr = networkManager.getRequestXhr(fullRequestXhrId); - if (fullRequestXhr.getResponseHeader('Accept-Ranges') !== 'bytes') { - return false; - } - - var contentEncoding = - fullRequestXhr.getResponseHeader('Content-Encoding') || 'identity'; - if (contentEncoding !== 'identity') { - return false; - } - - var length = fullRequestXhr.getResponseHeader('Content-Length'); - length = parseInt(length, 10); - if (!isInt(length)) { - return false; - } - - this._contentLength = length; // setting right content length - - if (length <= 2 * this._rangeChunkSize) { - // The file size is smaller than the size of two chunks, so it does - // not make any sense to abort the request and retry with a range - // request. - return false; - } - - return true; - }, - - _onHeadersReceived: - function PDFNetworkStreamFullRequestReader_onHeadersReceived() { - - if (this._validateRangeRequestCapabilities()) { - this._isRangeSupported = true; - } - - var networkManager = this._manager; - var fullRequestXhrId = this._fullRequestId; - if (networkManager.isStreamingRequest(fullRequestXhrId)) { - // We can continue fetching when progressive loading is enabled, - // and we don't need the autoFetch feature. - this._isStreamingSupported = true; - } else if (this._isRangeSupported) { - // NOTE: by cancelling the full request, and then issuing range - // requests, there will be an issue for sites where you can only - // request the pdf once. However, if this is the case, then the - // server should not be returning that it can support range - // requests. - networkManager.abortRequest(fullRequestXhrId); - } - - this._headersReceivedCapability.resolve(); - }, - - _onProgressiveData: - function PDFNetworkStreamFullRequestReader_onProgressiveData(chunk) { - if (this._requests.length > 0) { - var requestCapability = this._requests.shift(); - requestCapability.resolve({value: chunk, done: false}); - } else { - this._cachedChunks.push(chunk); - } - }, - - _onDone: function PDFNetworkStreamFullRequestReader_onDone(args) { - if (args) { - this._onProgressiveData(args.chunk); - } - this._done = true; - if (this._cachedChunks.length > 0) { - return; - } - this._requests.forEach(function (requestCapability) { - requestCapability.resolve({value: undefined, done: true}); - }); - this._requests = []; - }, - - _onError: function PDFNetworkStreamFullRequestReader_onError(status) { - var url = this._url; - var exception; - if (status === 404 || status === 0 && /^file:/.test(url)) { - exception = new MissingPDFException('Missing PDF "' + url + '".'); - } else { - exception = new UnexpectedResponseException( - 'Unexpected server response (' + status + - ') while retrieving PDF "' + url + '".', status); - } - this._storedError = exception; - this._headersReceivedCapability.reject(exception); - this._requests.forEach(function (requestCapability) { - requestCapability.reject(exception); - }); - this._requests = []; - this._cachedChunks = []; - }, - - _onProgress: function PDFNetworkStreamFullRequestReader_onProgress(data) { - if (this.onProgress) { - this.onProgress({ - loaded: data.loaded, - total: data.lengthComputable ? data.total : this._contentLength - }); - } - }, - - get isRangeSupported() { - return this._isRangeSupported; - }, - - get isStreamingSupported() { - return this._isStreamingSupported; - }, - - get contentLength() { - return this._contentLength; - }, - - get headersReady() { - return this._headersReceivedCapability.promise; - }, - - read: function PDFNetworkStreamFullRequestReader_read() { - if (this._storedError) { - return Promise.reject(this._storedError); - } - if (this._cachedChunks.length > 0) { - var chunk = this._cachedChunks.shift(); - return Promise.resolve(chunk); - } - if (this._done) { - return Promise.resolve({value: undefined, done: true}); - } - var requestCapability = createPromiseCapability(); - this._requests.push(requestCapability); - return requestCapability.promise; - }, - - cancel: function PDFNetworkStreamFullRequestReader_cancel(reason) { - this._done = true; - this._headersReceivedCapability.reject(reason); - this._requests.forEach(function (requestCapability) { - requestCapability.resolve({value: undefined, done: true}); - }); - this._requests = []; - if (this._manager.isPendingRequest(this._fullRequestId)) { - this._manager.abortRequest(this._fullRequestId); - } - this._fullRequestReader = null; - } - }; - - /** @implements {IPDFStreamRangeReader} */ - function PDFNetworkStreamRangeRequestReader(manager, begin, end) { - this._manager = manager; - var args = { - onDone: this._onDone.bind(this), - onProgress: this._onProgress.bind(this) - }; - this._requestId = manager.requestRange(begin, end, args); - this._requests = []; - this._queuedChunk = null; - this._done = false; - - this.onProgress = null; - this.onClosed = null; - } - - PDFNetworkStreamRangeRequestReader.prototype = { - _close: function PDFNetworkStreamRangeRequestReader_close() { - if (this.onClosed) { - this.onClosed(this); - } - }, - - _onDone: function PDFNetworkStreamRangeRequestReader_onDone(data) { - var chunk = data.chunk; - if (this._requests.length > 0) { - var requestCapability = this._requests.shift(); - requestCapability.resolve({value: chunk, done: false}); - } else { - this._queuedChunk = chunk; - } - this._done = true; - this._requests.forEach(function (requestCapability) { - requestCapability.resolve({value: undefined, done: true}); - }); - this._requests = []; - this._close(); - }, - - _onProgress: function PDFNetworkStreamRangeRequestReader_onProgress(evt) { - if (!this.isStreamingSupported && this.onProgress) { - this.onProgress({ - loaded: evt.loaded - }); - } - }, - - get isStreamingSupported() { - return false; // TODO allow progressive range bytes loading - }, - - read: function PDFNetworkStreamRangeRequestReader_read() { - if (this._queuedChunk !== null) { - var chunk = this._queuedChunk; - this._queuedChunk = null; - return Promise.resolve({value: chunk, done: false}); - } - if (this._done) { - return Promise.resolve({value: undefined, done: true}); - } - var requestCapability = createPromiseCapability(); - this._requests.push(requestCapability); - return requestCapability.promise; - }, - - cancel: function PDFNetworkStreamRangeRequestReader_cancel(reason) { - this._done = true; - this._requests.forEach(function (requestCapability) { - requestCapability.resolve({value: undefined, done: true}); - }); - this._requests = []; - if (this._manager.isPendingRequest(this._requestId)) { - this._manager.abortRequest(this._requestId); - } - this._close(); - } - }; - - coreWorker.setPDFNetworkStreamClass(PDFNetworkStream); - - exports.PDFNetworkStream = PDFNetworkStream; - exports.NetworkManager = NetworkManager; -})); - }).call(pdfjsLibs); - - exports.WorkerMessageHandler = pdfjsLibs.pdfjsCoreWorker.WorkerMessageHandler; -})); -