Browse Source

Merge pull request #8284 from Snuffleupagus/es6-modules-src

Convert the files in the `/src/core` folder to ES6 modules
Jonas Jenwald 8 years ago committed by GitHub
parent
commit
e51718711b
  1. 12
      gulpfile.js
  2. 60
      src/core/annotation.js
  3. 17
      src/core/arithmetic_decoder.js
  4. 726
      src/core/bidi.js
  5. 58
      src/core/cff_parser.js
  6. 21
      src/core/charsets.js
  7. 31
      src/core/chunked_stream.js
  8. 46
      src/core/cmap.js
  9. 34
      src/core/colorspace.js
  10. 57
      src/core/crypto.js
  11. 71
      src/core/document.js
  12. 549
      src/core/encodings.js
  13. 135
      src/core/evaluator.js
  14. 35
      src/core/font_renderer.js
  15. 117
      src/core/fonts.js
  16. 37
      src/core/function.js
  17. 14
      src/core/glyphlist.js
  18. 41
      src/core/image.js
  19. 31
      src/core/jbig2.js
  20. 20
      src/core/jpg.js
  21. 31
      src/core/jpx.js
  22. 18
      src/core/metrics.js
  23. 17
      src/core/murmurhash3.js
  24. 1030
      src/core/network.js
  25. 77
      src/core/obj.js
  26. 65
      src/core/parser.js
  27. 41
      src/core/pattern.js
  28. 42
      src/core/pdf_manager.js
  29. 45
      src/core/primitives.js
  30. 26
      src/core/ps_parser.js
  31. 696
      src/core/standard_fonts.js
  32. 74
      src/core/stream.js
  33. 27
      src/core/type1_parser.js
  34. 3210
      src/core/unicode.js
  35. 54
      src/core/worker.js
  36. 1
      src/main_loader.js
  37. 1
      src/pdf.js
  38. 8
      test/driver.js
  39. 24
      test/test_slave.html
  40. 2
      test/unit/jasmine-boot.js

12
gulpfile.js

@ -1055,22 +1055,22 @@ gulp.task('publish', ['generic'], function (done) {
}); });
}); });
gulp.task('test', function () { gulp.task('test', ['generic'], function () {
return streamqueue({ objectMode: true }, return streamqueue({ objectMode: true },
createTestSource('unit'), createTestSource('browser')); createTestSource('unit'), createTestSource('browser'));
}); });
gulp.task('bottest', function () { gulp.task('bottest', ['generic'], function () {
return streamqueue({ objectMode: true }, return streamqueue({ objectMode: true },
createTestSource('unit'), createTestSource('font'), createTestSource('unit'), createTestSource('font'),
createTestSource('browser (no reftest)')); createTestSource('browser (no reftest)'));
}); });
gulp.task('browsertest', function () { gulp.task('browsertest', ['generic'], function () {
return createTestSource('browser'); return createTestSource('browser');
}); });
gulp.task('unittest', function () { gulp.task('unittest', ['generic'], function () {
return createTestSource('unit'); return createTestSource('unit');
}); });
@ -1078,11 +1078,11 @@ gulp.task('fonttest', function () {
return createTestSource('font'); return createTestSource('font');
}); });
gulp.task('makeref', function (done) { gulp.task('makeref', ['generic'], function (done) {
makeRef(done); makeRef(done);
}); });
gulp.task('botmakeref', function (done) { gulp.task('botmakeref', ['generic'], function (done) {
makeRef(done, true); makeRef(done, true);
}); });

60
src/core/annotation.js

@ -13,47 +13,16 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import {
AnnotationBorderStyleType, AnnotationFieldFlag, AnnotationFlag,
(function (root, factory) { AnnotationType, isArray, isInt, OPS, stringToBytes, stringToPDFString, Util,
if (typeof define === 'function' && define.amd) { warn
define('pdfjs/core/annotation', ['exports', 'pdfjs/shared/util', } from '../shared/util';
'pdfjs/core/primitives', 'pdfjs/core/stream', 'pdfjs/core/colorspace', import { Catalog, FileSpec, ObjectLoader } from './obj';
'pdfjs/core/obj', 'pdfjs/core/evaluator'], factory); import { Dict, isDict, isName, isRef, isStream } from './primitives';
} else if (typeof exports !== 'undefined') { import { ColorSpace } from './colorspace';
factory(exports, require('../shared/util.js'), require('./primitives.js'), import { OperatorList } from './evaluator';
require('./stream.js'), require('./colorspace.js'), require('./obj.js'), import { Stream } from './stream';
require('./evaluator.js'));
} else {
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 isArray = sharedUtil.isArray;
var isInt = sharedUtil.isInt;
var stringToBytes = sharedUtil.stringToBytes;
var stringToPDFString = sharedUtil.stringToPDFString;
var warn = sharedUtil.warn;
var Dict = corePrimitives.Dict;
var isDict = corePrimitives.isDict;
var isName = corePrimitives.isName;
var isRef = corePrimitives.isRef;
var isStream = corePrimitives.isStream;
var Stream = coreStream.Stream;
var ColorSpace = coreColorSpace.ColorSpace;
var Catalog = coreObj.Catalog;
var ObjectLoader = coreObj.ObjectLoader;
var FileSpec = coreObj.FileSpec;
var OperatorList = coreEvaluator.OperatorList;
/** /**
* @class * @class
@ -1074,7 +1043,8 @@ var FileAttachmentAnnotation = (function FileAttachmentAnnotationClosure() {
return FileAttachmentAnnotation; return FileAttachmentAnnotation;
})(); })();
exports.Annotation = Annotation; export {
exports.AnnotationBorderStyle = AnnotationBorderStyle; Annotation,
exports.AnnotationFactory = AnnotationFactory; AnnotationBorderStyle,
})); AnnotationFactory,
};

17
src/core/arithmetic_decoder.js

@ -13,18 +13,6 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs/core/arithmetic_decoder', ['exports'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports);
} else {
factory((root.pdfjsCoreArithmeticDecoder = {}));
}
}(this, function (exports) {
/* This class implements the QM Coder decoding as defined in /* This class implements the QM Coder decoding as defined in
* JPEG 2000 Part I Final Committee Draft Version 1.0 * JPEG 2000 Part I Final Committee Draft Version 1.0
* Annex C.3 Arithmetic decoding procedure * Annex C.3 Arithmetic decoding procedure
@ -192,5 +180,6 @@ var ArithmeticDecoder = (function ArithmeticDecoderClosure() {
return ArithmeticDecoder; return ArithmeticDecoder;
})(); })();
exports.ArithmeticDecoder = ArithmeticDecoder; export {
})); ArithmeticDecoder,
};

726
src/core/bidi.js

@ -13,430 +13,420 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import { warn } from '../shared/util';
(function (root, factory) { // Character types for symbols from 0000 to 00FF.
if (typeof define === 'function' && define.amd) { // Source: ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt
define('pdfjs/core/bidi', ['exports', 'pdfjs/shared/util'], factory); var baseTypes = [
} else if (typeof exports !== 'undefined') { 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'S', 'B', 'S',
factory(exports, require('../shared/util.js')); 'WS', 'B', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN',
} else { 'BN', 'BN', 'BN', 'BN', 'B', 'B', 'B', 'S', 'WS', 'ON', 'ON', 'ET',
factory((root.pdfjsCoreBidi = {}), root.pdfjsSharedUtil); 'ET', 'ET', 'ON', 'ON', 'ON', 'ON', 'ON', 'ES', 'CS', 'ES', 'CS', 'CS',
'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'CS', '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', 'BN', '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.
// Source: ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt
// Note that 061D does not exist in the Unicode standard (see
// http://unicode.org/charts/PDF/U0600.pdf), so we replace it with an
// empty string and issue a warning if we encounter this character. The
// empty string is required to properly index the items after it.
var arabicTypes = [
'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'ON', 'ON', 'AL', 'ET', 'ET', 'AL',
'CS', 'AL', 'ON', 'ON', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', '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', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM',
'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM',
'NSM', 'NSM', 'NSM', 'NSM', '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', 'AN',
'ON', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'AL', 'AL', 'NSM', 'NSM',
'ON', 'NSM', 'NSM', 'NSM', 'NSM', 'AL', 'AL', 'EN', 'EN', 'EN', 'EN',
'EN', 'EN', 'EN', 'EN', 'EN', 'EN', '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;
}
} }
}(this, function (exports, sharedUtil) { return j;
var warn = sharedUtil.warn; }
// Character types for symbols from 0000 to 00FF. function setValues(arr, start, end, value) {
// Source: ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt for (var j = start; j < end; ++j) {
var baseTypes = [ arr[j] = value;
'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', 'ES', 'CS', 'ES', 'CS', 'CS',
'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'CS', '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', 'BN', '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.
// Source: ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt
// Note that 061D does not exist in the Unicode standard (see
// http://unicode.org/charts/PDF/U0600.pdf), so we replace it with an
// empty string and issue a warning if we encounter this character. The
// empty string is required to properly index the items after it.
var arabicTypes = [
'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'ON', 'ON', 'AL', 'ET', 'ET', 'AL',
'CS', 'AL', 'ON', 'ON', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', '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', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM',
'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM',
'NSM', 'NSM', 'NSM', 'NSM', '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', 'AN',
'ON', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'AL', 'AL', 'NSM', 'NSM',
'ON', 'NSM', 'NSM', 'NSM', 'NSM', 'AL', 'AL', 'EN', 'EN', 'EN', 'EN',
'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL'
];
function isOdd(i) {
return (i & 1) !== 0;
} }
}
function isEven(i) { function reverseValues(arr, start, end) {
return (i & 1) === 0; 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,
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);
} }
function findUnequal(arr, start, value) { // Get types and fill arrays
for (var j = start, jj = arr.length; j < jj; ++j) { chars.length = strLength;
if (arr[j] !== value) { types.length = strLength;
return j; 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];
if (!charType) {
warn('Bidi: invalid Unicode character ' + charCode.toString(16));
} }
} else if (0x0700 <= charCode && charCode <= 0x08AC) {
charType = 'AL';
}
if (charType === 'R' || charType === 'AL' || charType === 'AN') {
numBidi++;
} }
return j; types[i] = charType;
} }
function setValues(arr, start, end, value) { // Detect the bidi method
for (var j = start; j < end; ++j) { // - If there are no rtl characters then no bidi needed
arr[j] = value; // - 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);
} }
function reverseValues(arr, start, end) { if (startLevel === -1) {
for (var i = start, j = end - 1; i < j; ++i, --j) { if ((numBidi / strLength) < 0.3) {
var temp = arr[i]; isLTR = true;
arr[i] = arr[j]; startLevel = 0;
arr[j] = temp; } else {
isLTR = false;
startLevel = 1;
} }
} }
function createBidiText(str, isLTR, vertical) { var levels = [];
return { for (i = 0; i < strLength; ++i) {
str, levels[i] = startLevel;
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. X1-X10: skip most of this, since we are NOT doing the embeddings.
var chars = []; */
var types = []; 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];
}
}
function bidi(str, startLevel, vertical) { /*
var isLTR = true; W2. Search backwards from each instance of a European number until the
var strLength = str.length; first strong type (R, L, AL, or sor) is found. If an AL is found, change
if (strLength === 0 || vertical) { the type of the European number to Arabic number.
return createBidiText(str, isLTR, vertical); */
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;
} }
}
// Get types and fill arrays /*
chars.length = strLength; W3. Change all ALs to R.
types.length = strLength; */
var numBidi = 0; for (i = 0; i < strLength; ++i) {
t = types[i];
var i, ii; if (t === 'AL') {
for (i = 0; i < strLength; ++i) { types[i] = 'R';
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];
if (!charType) {
warn('Bidi: invalid Unicode character ' + charCode.toString(16));
}
} 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 W4. A single European separator between two European numbers changes to a
// - If less than 30% chars are rtl then string is primarily ltr European number. A single common separator between two numbers of the same
// - If more than 30% chars are rtl then string is primarily rtl type changes to that type:
if (numBidi === 0) { */
isLTR = true; for (i = 1; i < strLength - 1; ++i) {
return createBidiText(str, isLTR); 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];
}
}
if (startLevel === -1) { /*
if ((numBidi / strLength) < 0.3) { W5. A sequence of European terminators adjacent to European numbers changes
isLTR = true; to all European numbers:
startLevel = 0; */
} else { for (i = 0; i < strLength; ++i) {
isLTR = false; if (types[i] === 'EN') {
startLevel = 1; // 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';
} }
} }
}
var levels = []; /*
for (i = 0; i < strLength; ++i) { W6. Otherwise, separators and terminators change to Other Neutral:
levels[i] = startLevel; */
for (i = 0; i < strLength; ++i) {
t = types[i];
if (t === 'WS' || t === 'ES' || t === 'ET' || t === 'CS') {
types[i] = 'ON';
} }
}
/* /*
X1-X10: skip most of this, since we are NOT doing the embeddings. 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
var e = (isOdd(startLevel) ? 'R' : 'L'); the type of the European number to L.
var sor = e; */
var eor = sor; lastType = sor;
for (i = 0; i < strLength; ++i) {
/* t = types[i];
W1. Examine each non-spacing mark (NSM) in the level run, and change the if (t === 'EN') {
type of the NSM to the type of the previous character. If the NSM is at the types[i] = ((lastType === 'L') ? 'L' : 'EN');
start of the level run, it will get the type of sor. } else if (t === 'R' || t === 'L') {
*/ lastType = t;
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 N1. A sequence of neutrals takes the direction of the surrounding strong
first strong type (R, L, AL, or sor) is found. If an AL is found, change text if the text on both sides has the same direction. European and Arabic
the type of the European number to Arabic number. 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.
lastType = sor; */
var t; for (i = 0; i < strLength; ++i) {
for (i = 0; i < strLength; ++i) { if (types[i] === 'ON') {
t = types[i]; var end = findUnequal(types, i + 1, 'ON');
if (t === 'EN') { var before = sor;
types[i] = (lastType === 'AL') ? 'AN' : 'EN'; if (i > 0) {
} else if (t === 'R' || t === 'L' || t === 'AL') { before = types[i - 1];
lastType = t;
} }
}
/* var after = eor;
W3. Change all ALs to R. if (end + 1 < strLength) {
*/ after = types[end + 1];
for (i = 0; i < strLength; ++i) {
t = types[i];
if (t === 'AL') {
types[i] = 'R';
} }
} if (before !== 'L') {
before = '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' && if (after !== 'L') {
(types[i - 1] === 'EN' || types[i - 1] === 'AN') && after = 'R';
types[i + 1] === types[i - 1]) {
types[i] = types[i - 1];
} }
} if (before === after) {
setValues(types, i, end, before);
/*
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';
}
} }
i = end - 1; // reset to end (-1 so next iteration is ok)
} }
}
/* /*
W6. Otherwise, separators and terminators change to Other Neutral: N2. Any remaining neutrals take the embedding direction.
*/ */
for (i = 0; i < strLength; ++i) { for (i = 0; i < strLength; ++i) {
t = types[i]; if (types[i] === 'ON') {
if (t === 'WS' || t === 'ES' || t === 'ET' || t === 'CS') { types[i] = e;
types[i] = 'ON';
}
} }
}
/* /*
W7. Search backwards from each instance of a European number until the I1. For all characters with an even (left-to-right) embedding direction,
first strong type (R, L, or sor) is found. If an L is found, then change those of type R go up one level and those of type AN or EN go up two
the type of the European number to L. levels.
*/ I2. For all characters with an odd (right-to-left) embedding direction,
lastType = sor; those of type L, EN or AN go up one level.
for (i = 0; i < strLength; ++i) { */
t = types[i]; for (i = 0; i < strLength; ++i) {
if (t === 'EN') { t = types[i];
types[i] = ((lastType === 'L') ? 'L' : 'EN'); if (isEven(levels[i])) {
} else if (t === 'R' || t === 'L') { if (t === 'R') {
lastType = t; levels[i] += 1;
} else if (t === 'AN' || t === 'EN') {
levels[i] += 2;
} }
} } else { // isOdd
if (t === 'L' || t === 'AN' || t === 'EN') {
/* levels[i] += 1;
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. L1. On each line, reset the embedding level of the following characters to
*/ the paragraph embedding level:
for (i = 0; i < strLength; ++i) {
if (types[i] === 'ON') { segment separators,
types[i] = e; 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;
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;
}
}
} }
}
/* // now reverse between those limits
L1. On each line, reset the embedding level of the following characters to for (level = highestLevel; level >= lowestOddLevel; --level) {
the paragraph embedding level: // find segments to reverse
var start = -1;
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) { for (i = 0, ii = levels.length; i < ii; ++i) {
level = levels[i]; if (levels[i] < level) {
if (highestLevel < level) { if (start >= 0) {
highestLevel = level; reverseValues(chars, start, i);
} start = -1;
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;
} }
} } else if (start < 0) {
if (start >= 0) { start = i;
reverseValues(chars, start, levels.length);
} }
} }
if (start >= 0) {
reverseValues(chars, start, levels.length);
}
}
/* /*
L3. Combining marks applied to a right-to-left base character will at this 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 point precede their base character. If the rendering engine expects them to
follow the base characters in the final display process, then the ordering follow the base characters in the final display process, then the ordering
of the marks and the base character must be reversed. of the marks and the base character must be reversed.
*/ */
// don't bother for now // don't bother for now
/* /*
L4. A character that possesses the mirrored property as specified by 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 Section 4.7, Mirrored, must be depicted by a mirrored glyph if the resolved
directionality of that character is R. directionality of that character is R.
*/ */
// don't mirror as characters are already mirrored in the pdf // don't mirror as characters are already mirrored in the pdf
// Finally, return string // Finally, return string
for (i = 0, ii = chars.length; i < ii; ++i) { for (i = 0, ii = chars.length; i < ii; ++i) {
var ch = chars[i]; var ch = chars[i];
if (ch === '<' || ch === '>') { if (ch === '<' || ch === '>') {
chars[i] = ''; chars[i] = '';
}
} }
return createBidiText(chars.join(''), isLTR);
} }
return createBidiText(chars.join(''), isLTR);
}
exports.bidi = bidi; export {
})); bidi,
};

58
src/core/cff_parser.js

@ -13,34 +13,13 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import {
assert, bytesToString, error, info, isArray, stringToBytes, Util, warn
(function (root, factory) { } from '../shared/util';
if (typeof define === 'function' && define.amd) { import {
define('pdfjs/core/cff_parser', ['exports', 'pdfjs/shared/util', ExpertCharset, ExpertSubsetCharset, ISOAdobeCharset
'pdfjs/core/charsets', 'pdfjs/core/encodings'], factory); } from './charsets';
} else if (typeof exports !== 'undefined') { import { ExpertEncoding, StandardEncoding } from './encodings';
factory(exports, require('../shared/util.js'), require('./charsets.js'),
require('./encodings.js'));
} else {
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. // Maximum subroutine call depth of type 2 chartrings. Matches OTS.
var MAX_SUBR_NESTING = 10; var MAX_SUBR_NESTING = 10;
@ -1651,14 +1630,15 @@ var CFFCompiler = (function CFFCompilerClosure() {
return CFFCompiler; return CFFCompiler;
})(); })();
exports.CFFStandardStrings = CFFStandardStrings; export {
exports.CFFParser = CFFParser; CFFStandardStrings,
exports.CFF = CFF; CFFParser,
exports.CFFHeader = CFFHeader; CFF,
exports.CFFStrings = CFFStrings; CFFHeader,
exports.CFFIndex = CFFIndex; CFFStrings,
exports.CFFCharset = CFFCharset; CFFIndex,
exports.CFFTopDict = CFFTopDict; CFFCharset,
exports.CFFPrivateDict = CFFPrivateDict; CFFTopDict,
exports.CFFCompiler = CFFCompiler; CFFPrivateDict,
})); CFFCompiler,
};

21
src/core/charsets.js

@ -13,18 +13,6 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs/core/charsets', ['exports'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports);
} else {
factory((root.pdfjsCoreCharsets = {}));
}
}(this, function (exports) {
var ISOAdobeCharset = [ var ISOAdobeCharset = [
'.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', '.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar',
'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright', 'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright',
@ -125,7 +113,8 @@ var ExpertSubsetCharset = [
'periodinferior', 'commainferior' 'periodinferior', 'commainferior'
]; ];
exports.ISOAdobeCharset = ISOAdobeCharset; export {
exports.ExpertCharset = ExpertCharset; ISOAdobeCharset,
exports.ExpertSubsetCharset = ExpertSubsetCharset; ExpertCharset,
})); ExpertSubsetCharset,
};

31
src/core/chunked_stream.js

@ -13,26 +13,10 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import {
arrayByteLength, arraysToBytes, assert, createPromiseCapability, isEmptyObj,
(function (root, factory) { isInt, MissingDataException
if (typeof define === 'function' && define.amd) { } from '../shared/util';
define('pdfjs/core/chunked_stream', ['exports', 'pdfjs/shared/util'],
factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'));
} else {
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() { var ChunkedStream = (function ChunkedStreamClosure() {
function ChunkedStream(length, chunkSize, manager) { function ChunkedStream(length, chunkSize, manager) {
@ -578,6 +562,7 @@ var ChunkedStreamManager = (function ChunkedStreamManagerClosure() {
return ChunkedStreamManager; return ChunkedStreamManager;
})(); })();
exports.ChunkedStream = ChunkedStream; export {
exports.ChunkedStreamManager = ChunkedStreamManager; ChunkedStream,
})); ChunkedStreamManager,
};

46
src/core/cmap.js

@ -13,36 +13,13 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import {
assert, CMapCompressionType, error, isInt, isString, MissingDataException,
(function (root, factory) { Util, warn
if (typeof define === 'function' && define.amd) { } from '../shared/util';
define('pdfjs/core/cmap', ['exports', 'pdfjs/shared/util', import { isCmd, isEOF, isName, isStream } from './primitives';
'pdfjs/core/primitives', 'pdfjs/core/stream', 'pdfjs/core/parser'], import { Lexer } from './parser';
factory); import { Stream } from './stream';
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'), require('./primitives.js'),
require('./stream.js'), require('./parser.js'));
} else {
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 CMapCompressionType = sharedUtil.CMapCompressionType;
var isEOF = corePrimitives.isEOF;
var isName = corePrimitives.isName;
var isCmd = corePrimitives.isCmd;
var isStream = corePrimitives.isStream;
var Stream = coreStream.Stream;
var Lexer = coreParser.Lexer;
var BUILT_IN_CMAPS = [ var BUILT_IN_CMAPS = [
// << Start unicode maps. // << Start unicode maps.
@ -1010,7 +987,8 @@ var CMapFactory = (function CMapFactoryClosure() {
}; };
})(); })();
exports.CMap = CMap; export {
exports.CMapFactory = CMapFactory; CMap,
exports.IdentityCMap = IdentityCMap; IdentityCMap,
})); CMapFactory,
};

34
src/core/colorspace.js

@ -13,32 +13,9 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import { error, info, isArray, isString, shadow, warn } from '../shared/util';
import { isDict, isName, isStream } from './primitives';
(function (root, factory) { import { PDFFunction } from './function';
if (typeof define === 'function' && define.amd) {
define('pdfjs/core/colorspace', ['exports', 'pdfjs/shared/util',
'pdfjs/core/primitives', 'pdfjs/core/function'],
factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'), require('./primitives.js'),
require('./function.js'));
} else {
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() { var ColorSpace = (function ColorSpaceClosure() {
/** /**
@ -1309,5 +1286,6 @@ var LabCS = (function LabCSClosure() {
return LabCS; return LabCS;
})(); })();
exports.ColorSpace = ColorSpace; export {
})); ColorSpace,
};

57
src/core/crypto.js

@ -13,34 +13,12 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import {
assert, bytesToString, error, isInt, PasswordException, PasswordResponses,
(function (root, factory) { stringToBytes, utf8StringToString, warn
if (typeof define === 'function' && define.amd) { } from '../shared/util';
define('pdfjs/core/crypto', ['exports', 'pdfjs/shared/util', import { isDict, isName, Name } from './primitives';
'pdfjs/core/primitives', 'pdfjs/core/stream'], factory); import { DecryptStream } from './stream';
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'), require('./primitives.js'),
require('./stream.js'));
} else {
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 warn = sharedUtil.warn;
var error = sharedUtil.error;
var assert = sharedUtil.assert;
var isInt = sharedUtil.isInt;
var stringToBytes = sharedUtil.stringToBytes;
var utf8StringToString = sharedUtil.utf8StringToString;
var Name = corePrimitives.Name;
var isName = corePrimitives.isName;
var isDict = corePrimitives.isDict;
var DecryptStream = coreStream.DecryptStream;
var ARCFourCipher = (function ARCFourCipherClosure() { var ARCFourCipher = (function ARCFourCipherClosure() {
function ARCFourCipher(key) { function ARCFourCipher(key) {
@ -2070,14 +2048,15 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
return CipherTransformFactory; return CipherTransformFactory;
})(); })();
exports.AES128Cipher = AES128Cipher; export {
exports.AES256Cipher = AES256Cipher; AES128Cipher,
exports.ARCFourCipher = ARCFourCipher; AES256Cipher,
exports.CipherTransformFactory = CipherTransformFactory; ARCFourCipher,
exports.PDF17 = PDF17; CipherTransformFactory,
exports.PDF20 = PDF20; PDF17,
exports.calculateMD5 = calculateMD5; PDF20,
exports.calculateSHA256 = calculateSHA256; calculateMD5,
exports.calculateSHA384 = calculateSHA384; calculateSHA256,
exports.calculateSHA512 = calculateSHA512; calculateSHA384,
})); calculateSHA512,
};

71
src/core/document.js

@ -13,58 +13,18 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import {
assert, error, info, isArray, isArrayBuffer, isNum, isSpace, isString,
(function (root, factory) { MissingDataException, OPS, shadow, stringToBytes, stringToPDFString, Util,
if (typeof define === 'function' && define.amd) { warn
define('pdfjs/core/document', ['exports', 'pdfjs/shared/util', } from '../shared/util';
'pdfjs/core/primitives', 'pdfjs/core/stream', 'pdfjs/core/obj', import { Catalog, ObjectLoader, XRef } from './obj';
'pdfjs/core/parser', 'pdfjs/core/crypto', 'pdfjs/core/evaluator', import { Dict, isDict, isName, isStream } from './primitives';
'pdfjs/core/annotation'], factory); import { NullStream, Stream, StreamsSequenceStream } from './stream';
} else if (typeof exports !== 'undefined') { import { OperatorList, PartialEvaluator } from './evaluator';
factory(exports, require('../shared/util.js'), require('./primitives.js'), import { AnnotationFactory } from './annotation';
require('./stream.js'), require('./obj.js'), require('./parser.js'), import { calculateMD5 } from './crypto';
require('./crypto.js'), require('./evaluator.js'), import { Linearization } from './parser';
require('./annotation.js'));
} else {
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 OPS = sharedUtil.OPS;
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 isNum = sharedUtil.isNum;
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 AnnotationFactory = coreAnnotation.AnnotationFactory;
var Page = (function PageClosure() { var Page = (function PageClosure() {
@ -648,6 +608,7 @@ var PDFDocument = (function PDFDocumentClosure() {
return PDFDocument; return PDFDocument;
})(); })();
exports.Page = Page; export {
exports.PDFDocument = PDFDocument; Page,
})); PDFDocument,
};

549
src/core/encodings.js

@ -13,292 +13,281 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; 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'];
(function (root, factory) { var MacExpertEncoding = [
if (typeof define === 'function' && define.amd) { '', '', '', '', '', '', '', '', '', '', '', '', '', '',
define('pdfjs/core/encodings', ['exports'], factory); '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
} else if (typeof exports !== 'undefined') { 'space', 'exclamsmall', 'Hungarumlautsmall', 'centoldstyle',
factory(exports); 'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', 'Acutesmall',
} else { 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader',
factory((root.pdfjsCoreEncodings = {})); 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', 'zerooldstyle',
} 'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle',
}(this, function (exports) { 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle',
'nineoldstyle', 'colon', 'semicolon', '', 'threequartersemdash', '',
var ExpertEncoding = [ 'questionsmall', '', '', '', '', 'Ethsmall', '', '', 'onequarter',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'onehalf', 'threequarters', 'oneeighth', 'threeeighths', 'fiveeighths',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'seveneighths', 'onethird', 'twothirds', '', '', '', '', '', '', 'ff',
'space', 'exclamsmall', 'Hungarumlautsmall', '', 'dollaroldstyle', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', '', 'parenrightinferior',
'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior', 'Circumflexsmall', 'hypheninferior', 'Gravesmall', 'Asmall', 'Bsmall',
'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall',
'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall',
'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall',
'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'colon', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah',
'semicolon', 'commasuperior', 'threequartersemdash', 'periodsuperior', 'Tildesmall', '', '', 'asuperior', 'centsuperior', '', '', '', '',
'questionsmall', '', 'asuperior', 'bsuperior', 'centsuperior', 'dsuperior', 'Aacutesmall', 'Agravesmall', 'Acircumflexsmall', 'Adieresissmall',
'esuperior', '', '', 'isuperior', '', '', 'lsuperior', 'msuperior', 'Atildesmall', 'Aringsmall', 'Ccedillasmall', 'Eacutesmall', 'Egravesmall',
'nsuperior', 'osuperior', '', '', 'rsuperior', 'ssuperior', 'tsuperior', 'Ecircumflexsmall', 'Edieresissmall', 'Iacutesmall', 'Igravesmall',
'', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', '', 'Icircumflexsmall', 'Idieresissmall', 'Ntildesmall', 'Oacutesmall',
'parenrightinferior', 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', 'Ogravesmall', 'Ocircumflexsmall', 'Odieresissmall', 'Otildesmall',
'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Uacutesmall', 'Ugravesmall', 'Ucircumflexsmall', 'Udieresissmall', '',
'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'eightsuperior', 'fourinferior', 'threeinferior', 'sixinferior',
'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'eightinferior', 'seveninferior', 'Scaronsmall', '', 'centinferior',
'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'twoinferior', '', 'Dieresissmall', '', 'Caronsmall', 'osuperior',
'onefitted', 'rupiah', 'Tildesmall', '', '', '', '', '', '', '', '', '', 'fiveinferior', '', 'commainferior', 'periodinferior', 'Yacutesmall', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'dollarinferior', '', 'Thornsmall', '', 'nineinferior', 'zeroinferior',
'', '', '', '', '', '', 'exclamdownsmall', 'centoldstyle', 'Lslashsmall', 'Zcaronsmall', 'AEsmall', 'Oslashsmall', 'questiondownsmall',
'', '', 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', 'Brevesmall', 'oneinferior', 'Lslashsmall', '', '', '', '', '', '', 'Cedillasmall', '',
'Caronsmall', '', 'Dotaccentsmall', '', '', 'Macronsmall', '', '', '', '', '', '', 'OEsmall', 'figuredash', 'hyphensuperior', '', '', '', '',
'figuredash', 'hypheninferior', '', '', 'Ogoneksmall', 'Ringsmall', 'exclamdownsmall', '', 'Ydieresissmall', '', 'onesuperior', 'twosuperior',
'Cedillasmall', '', '', '', 'onequarter', 'onehalf', 'threequarters', 'threesuperior', 'foursuperior', 'fivesuperior', 'sixsuperior',
'questiondownsmall', 'oneeighth', 'threeeighths', 'fiveeighths', 'sevensuperior', 'ninesuperior', 'zerosuperior', '', 'esuperior',
'seveneighths', 'onethird', 'twothirds', '', '', 'zerosuperior', 'rsuperior', 'tsuperior', '', '', 'isuperior', 'ssuperior', 'dsuperior',
'onesuperior', 'twosuperior', 'threesuperior', 'foursuperior', '', '', '', '', '', 'lsuperior', 'Ogoneksmall', 'Brevesmall',
'fivesuperior', 'sixsuperior', 'sevensuperior', 'eightsuperior', 'Macronsmall', 'bsuperior', 'nsuperior', 'msuperior', 'commasuperior',
'ninesuperior', 'zeroinferior', 'oneinferior', 'twoinferior', 'periodsuperior', 'Dotaccentsmall', 'Ringsmall'];
'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 = [ var MacRomanEncoding = [
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent',
'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus', 'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus',
'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three',
'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon',
'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', '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', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U',
'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright',
'asciicircum', 'underscore', 'grave', 'a', 'b', 'c', 'd', 'e', 'f', 'g', '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', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', '', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', '',
'Adieresis', 'Aring', 'Ccedilla', 'Eacute', 'Ntilde', 'Odieresis', 'Adieresis', 'Aring', 'Ccedilla', 'Eacute', 'Ntilde', 'Odieresis',
'Udieresis', 'aacute', 'agrave', 'acircumflex', 'adieresis', 'atilde', 'Udieresis', 'aacute', 'agrave', 'acircumflex', 'adieresis', 'atilde',
'aring', 'ccedilla', 'eacute', 'egrave', 'ecircumflex', 'edieresis', 'aring', 'ccedilla', 'eacute', 'egrave', 'ecircumflex', 'edieresis',
'iacute', 'igrave', 'icircumflex', 'idieresis', 'ntilde', 'oacute', 'iacute', 'igrave', 'icircumflex', 'idieresis', 'ntilde', 'oacute',
'ograve', 'ocircumflex', 'odieresis', 'otilde', 'uacute', 'ugrave', 'ograve', 'ocircumflex', 'odieresis', 'otilde', 'uacute', 'ugrave',
'ucircumflex', 'udieresis', 'dagger', 'degree', 'cent', 'sterling', 'ucircumflex', 'udieresis', 'dagger', 'degree', 'cent', 'sterling',
'section', 'bullet', 'paragraph', 'germandbls', 'registered', 'copyright', 'section', 'bullet', 'paragraph', 'germandbls', 'registered', 'copyright',
'trademark', 'acute', 'dieresis', 'notequal', 'AE', 'Oslash', 'infinity', 'trademark', 'acute', 'dieresis', 'notequal', 'AE', 'Oslash', 'infinity',
'plusminus', 'lessequal', 'greaterequal', 'yen', 'mu', 'partialdiff', 'plusminus', 'lessequal', 'greaterequal', 'yen', 'mu', 'partialdiff',
'summation', 'product', 'pi', 'integral', 'ordfeminine', 'ordmasculine', 'summation', 'product', 'pi', 'integral', 'ordfeminine', 'ordmasculine',
'Omega', 'ae', 'oslash', 'questiondown', 'exclamdown', 'logicalnot', 'Omega', 'ae', 'oslash', 'questiondown', 'exclamdown', 'logicalnot',
'radical', 'florin', 'approxequal', 'Delta', 'guillemotleft', 'radical', 'florin', 'approxequal', 'Delta', 'guillemotleft',
'guillemotright', 'ellipsis', 'space', 'Agrave', 'Atilde', 'Otilde', 'OE', 'guillemotright', 'ellipsis', 'space', 'Agrave', 'Atilde', 'Otilde', 'OE',
'oe', 'endash', 'emdash', 'quotedblleft', 'quotedblright', 'quoteleft', 'oe', 'endash', 'emdash', 'quotedblleft', 'quotedblright', 'quoteleft',
'quoteright', 'divide', 'lozenge', 'ydieresis', 'Ydieresis', 'fraction', 'quoteright', 'divide', 'lozenge', 'ydieresis', 'Ydieresis', 'fraction',
'currency', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'daggerdbl', 'currency', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'daggerdbl',
'periodcentered', 'quotesinglbase', 'quotedblbase', 'perthousand', 'periodcentered', 'quotesinglbase', 'quotedblbase', 'perthousand',
'Acircumflex', 'Ecircumflex', 'Aacute', 'Edieresis', 'Egrave', 'Iacute', 'Acircumflex', 'Ecircumflex', 'Aacute', 'Edieresis', 'Egrave', 'Iacute',
'Icircumflex', 'Idieresis', 'Igrave', 'Oacute', 'Ocircumflex', 'apple', 'Icircumflex', 'Idieresis', 'Igrave', 'Oacute', 'Ocircumflex', 'apple',
'Ograve', 'Uacute', 'Ucircumflex', 'Ugrave', 'dotlessi', 'circumflex', 'Ograve', 'Uacute', 'Ucircumflex', 'Ugrave', 'dotlessi', 'circumflex',
'tilde', 'macron', 'breve', 'dotaccent', 'ring', 'cedilla', 'hungarumlaut', 'tilde', 'macron', 'breve', 'dotaccent', 'ring', 'cedilla', 'hungarumlaut',
'ogonek', 'caron']; 'ogonek', 'caron'];
var StandardEncoding = [ var StandardEncoding = [
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent',
'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus', 'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus',
'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three',
'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon',
'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', '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', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U',
'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright',
'asciicircum', 'underscore', 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f', 'asciicircum', 'underscore', 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u',
'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'exclamdown', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'exclamdown',
'cent', 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', 'cent', 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency',
'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft',
'guilsinglright', 'fi', 'fl', '', 'endash', 'dagger', 'daggerdbl', 'guilsinglright', 'fi', 'fl', '', 'endash', 'dagger', 'daggerdbl',
'periodcentered', '', 'paragraph', 'bullet', 'quotesinglbase', 'periodcentered', '', 'paragraph', 'bullet', 'quotesinglbase',
'quotedblbase', 'quotedblright', 'guillemotright', 'ellipsis', 'quotedblbase', 'quotedblright', 'guillemotright', 'ellipsis',
'perthousand', '', 'questiondown', '', 'grave', 'acute', 'circumflex', 'perthousand', '', 'questiondown', '', 'grave', 'acute', 'circumflex',
'tilde', 'macron', 'breve', 'dotaccent', 'dieresis', '', 'ring', 'cedilla', 'tilde', 'macron', 'breve', 'dotaccent', 'dieresis', '', 'ring', 'cedilla',
'', 'hungarumlaut', 'ogonek', 'caron', 'emdash', '', '', '', '', '', '', '', 'hungarumlaut', 'ogonek', 'caron', 'emdash', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', 'AE', '', 'ordfeminine', '', '', '', '', '', '', '', '', '', '', '', '', 'AE', '', 'ordfeminine', '', '',
'', '', 'Lslash', 'Oslash', 'OE', 'ordmasculine', '', '', '', '', '', 'ae', '', '', 'Lslash', 'Oslash', 'OE', 'ordmasculine', '', '', '', '', '', 'ae',
'', '', '', 'dotlessi', '', '', 'lslash', 'oslash', 'oe', 'germandbls']; '', '', '', 'dotlessi', '', '', 'lslash', 'oslash', 'oe', 'germandbls'];
var WinAnsiEncoding = [ var WinAnsiEncoding = [
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent',
'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus', 'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus',
'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three',
'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon',
'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', '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', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U',
'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright',
'asciicircum', 'underscore', 'grave', 'a', 'b', 'c', 'd', 'e', 'f', 'g', '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', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde',
'bullet', 'Euro', 'bullet', 'quotesinglbase', 'florin', 'quotedblbase', 'bullet', 'Euro', 'bullet', 'quotesinglbase', 'florin', 'quotedblbase',
'ellipsis', 'dagger', 'daggerdbl', 'circumflex', 'perthousand', 'Scaron', 'ellipsis', 'dagger', 'daggerdbl', 'circumflex', 'perthousand', 'Scaron',
'guilsinglleft', 'OE', 'bullet', 'Zcaron', 'bullet', 'bullet', 'quoteleft', 'guilsinglleft', 'OE', 'bullet', 'Zcaron', 'bullet', 'bullet', 'quoteleft',
'quoteright', 'quotedblleft', 'quotedblright', 'bullet', 'endash', 'quoteright', 'quotedblleft', 'quotedblright', 'bullet', 'endash',
'emdash', 'tilde', 'trademark', 'scaron', 'guilsinglright', 'oe', 'bullet', 'emdash', 'tilde', 'trademark', 'scaron', 'guilsinglright', 'oe', 'bullet',
'zcaron', 'Ydieresis', 'space', 'exclamdown', 'cent', 'sterling', 'zcaron', 'Ydieresis', 'space', 'exclamdown', 'cent', 'sterling',
'currency', 'yen', 'brokenbar', 'section', 'dieresis', 'copyright', 'currency', 'yen', 'brokenbar', 'section', 'dieresis', 'copyright',
'ordfeminine', 'guillemotleft', 'logicalnot', 'hyphen', 'registered', 'ordfeminine', 'guillemotleft', 'logicalnot', 'hyphen', 'registered',
'macron', 'degree', 'plusminus', 'twosuperior', 'threesuperior', 'acute', 'macron', 'degree', 'plusminus', 'twosuperior', 'threesuperior', 'acute',
'mu', 'paragraph', 'periodcentered', 'cedilla', 'onesuperior', 'mu', 'paragraph', 'periodcentered', 'cedilla', 'onesuperior',
'ordmasculine', 'guillemotright', 'onequarter', 'onehalf', 'threequarters', 'ordmasculine', 'guillemotright', 'onequarter', 'onehalf', 'threequarters',
'questiondown', 'Agrave', 'Aacute', 'Acircumflex', 'Atilde', 'Adieresis', 'questiondown', 'Agrave', 'Aacute', 'Acircumflex', 'Atilde', 'Adieresis',
'Aring', 'AE', 'Ccedilla', 'Egrave', 'Eacute', 'Ecircumflex', 'Edieresis', 'Aring', 'AE', 'Ccedilla', 'Egrave', 'Eacute', 'Ecircumflex', 'Edieresis',
'Igrave', 'Iacute', 'Icircumflex', 'Idieresis', 'Eth', 'Ntilde', 'Ograve', 'Igrave', 'Iacute', 'Icircumflex', 'Idieresis', 'Eth', 'Ntilde', 'Ograve',
'Oacute', 'Ocircumflex', 'Otilde', 'Odieresis', 'multiply', 'Oslash', 'Oacute', 'Ocircumflex', 'Otilde', 'Odieresis', 'multiply', 'Oslash',
'Ugrave', 'Uacute', 'Ucircumflex', 'Udieresis', 'Yacute', 'Thorn', 'Ugrave', 'Uacute', 'Ucircumflex', 'Udieresis', 'Yacute', 'Thorn',
'germandbls', 'agrave', 'aacute', 'acircumflex', 'atilde', 'adieresis', 'germandbls', 'agrave', 'aacute', 'acircumflex', 'atilde', 'adieresis',
'aring', 'ae', 'ccedilla', 'egrave', 'eacute', 'ecircumflex', 'edieresis', 'aring', 'ae', 'ccedilla', 'egrave', 'eacute', 'ecircumflex', 'edieresis',
'igrave', 'iacute', 'icircumflex', 'idieresis', 'eth', 'ntilde', 'ograve', 'igrave', 'iacute', 'icircumflex', 'idieresis', 'eth', 'ntilde', 'ograve',
'oacute', 'ocircumflex', 'otilde', 'odieresis', 'divide', 'oslash', 'oacute', 'ocircumflex', 'otilde', 'odieresis', 'divide', 'oslash',
'ugrave', 'uacute', 'ucircumflex', 'udieresis', 'yacute', 'thorn', 'ugrave', 'uacute', 'ucircumflex', 'udieresis', 'yacute', 'thorn',
'ydieresis']; 'ydieresis'];
var SymbolSetEncoding = [ var SymbolSetEncoding = [
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'space', 'exclam', 'universal', 'numbersign', 'existential', 'percent', 'space', 'exclam', 'universal', 'numbersign', 'existential', 'percent',
'ampersand', 'suchthat', 'parenleft', 'parenright', 'asteriskmath', 'plus', 'ampersand', 'suchthat', 'parenleft', 'parenright', 'asteriskmath', 'plus',
'comma', 'minus', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', 'comma', 'minus', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four',
'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less',
'equal', 'greater', 'question', 'congruent', 'Alpha', 'Beta', 'Chi', 'equal', 'greater', 'question', 'congruent', 'Alpha', 'Beta', 'Chi',
'Delta', 'Epsilon', 'Phi', 'Gamma', 'Eta', 'Iota', 'theta1', 'Kappa', 'Delta', 'Epsilon', 'Phi', 'Gamma', 'Eta', 'Iota', 'theta1', 'Kappa',
'Lambda', 'Mu', 'Nu', 'Omicron', 'Pi', 'Theta', 'Rho', 'Sigma', 'Tau', 'Lambda', 'Mu', 'Nu', 'Omicron', 'Pi', 'Theta', 'Rho', 'Sigma', 'Tau',
'Upsilon', 'sigma1', 'Omega', 'Xi', 'Psi', 'Zeta', 'bracketleft', 'Upsilon', 'sigma1', 'Omega', 'Xi', 'Psi', 'Zeta', 'bracketleft',
'therefore', 'bracketright', 'perpendicular', 'underscore', 'radicalex', 'therefore', 'bracketright', 'perpendicular', 'underscore', 'radicalex',
'alpha', 'beta', 'chi', 'delta', 'epsilon', 'phi', 'gamma', 'eta', 'iota', 'alpha', 'beta', 'chi', 'delta', 'epsilon', 'phi', 'gamma', 'eta', 'iota',
'phi1', 'kappa', 'lambda', 'mu', 'nu', 'omicron', 'pi', 'theta', 'rho', 'phi1', 'kappa', 'lambda', 'mu', 'nu', 'omicron', 'pi', 'theta', 'rho',
'sigma', 'tau', 'upsilon', 'omega1', 'omega', 'xi', 'psi', 'zeta', 'sigma', 'tau', 'upsilon', 'omega1', 'omega', 'xi', 'psi', 'zeta',
'braceleft', 'bar', 'braceright', 'similar', '', '', '', '', '', '', '', 'braceleft', 'bar', 'braceright', 'similar', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', 'Euro', 'Upsilon1', 'minute', 'lessequal', '', '', '', '', '', '', '', 'Euro', 'Upsilon1', 'minute', 'lessequal',
'fraction', 'infinity', 'florin', 'club', 'diamond', 'heart', 'spade', 'fraction', 'infinity', 'florin', 'club', 'diamond', 'heart', 'spade',
'arrowboth', 'arrowleft', 'arrowup', 'arrowright', 'arrowdown', 'degree', 'arrowboth', 'arrowleft', 'arrowup', 'arrowright', 'arrowdown', 'degree',
'plusminus', 'second', 'greaterequal', 'multiply', 'proportional', 'plusminus', 'second', 'greaterequal', 'multiply', 'proportional',
'partialdiff', 'bullet', 'divide', 'notequal', 'equivalence', 'partialdiff', 'bullet', 'divide', 'notequal', 'equivalence',
'approxequal', 'ellipsis', 'arrowvertex', 'arrowhorizex', 'carriagereturn', 'approxequal', 'ellipsis', 'arrowvertex', 'arrowhorizex', 'carriagereturn',
'aleph', 'Ifraktur', 'Rfraktur', 'weierstrass', 'circlemultiply', 'aleph', 'Ifraktur', 'Rfraktur', 'weierstrass', 'circlemultiply',
'circleplus', 'emptyset', 'intersection', 'union', 'propersuperset', 'circleplus', 'emptyset', 'intersection', 'union', 'propersuperset',
'reflexsuperset', 'notsubset', 'propersubset', 'reflexsubset', 'element', 'reflexsuperset', 'notsubset', 'propersubset', 'reflexsubset', 'element',
'notelement', 'angle', 'gradient', 'registerserif', 'copyrightserif', 'notelement', 'angle', 'gradient', 'registerserif', 'copyrightserif',
'trademarkserif', 'product', 'radical', 'dotmath', 'logicalnot', 'trademarkserif', 'product', 'radical', 'dotmath', 'logicalnot',
'logicaland', 'logicalor', 'arrowdblboth', 'arrowdblleft', 'arrowdblup', 'logicaland', 'logicalor', 'arrowdblboth', 'arrowdblleft', 'arrowdblup',
'arrowdblright', 'arrowdbldown', 'lozenge', 'angleleft', 'registersans', 'arrowdblright', 'arrowdbldown', 'lozenge', 'angleleft', 'registersans',
'copyrightsans', 'trademarksans', 'summation', 'parenlefttp', 'copyrightsans', 'trademarksans', 'summation', 'parenlefttp',
'parenleftex', 'parenleftbt', 'bracketlefttp', 'bracketleftex', 'parenleftex', 'parenleftbt', 'bracketlefttp', 'bracketleftex',
'bracketleftbt', 'bracelefttp', 'braceleftmid', 'braceleftbt', 'braceex', 'bracketleftbt', 'bracelefttp', 'braceleftmid', 'braceleftbt', 'braceex',
'', 'angleright', 'integral', 'integraltp', 'integralex', 'integralbt', '', 'angleright', 'integral', 'integraltp', 'integralex', 'integralbt',
'parenrighttp', 'parenrightex', 'parenrightbt', 'bracketrighttp', 'parenrighttp', 'parenrightex', 'parenrightbt', 'bracketrighttp',
'bracketrightex', 'bracketrightbt', 'bracerighttp', 'bracerightmid', 'bracketrightex', 'bracketrightbt', 'bracerighttp', 'bracerightmid',
'bracerightbt']; 'bracerightbt'];
var ZapfDingbatsEncoding = [ var ZapfDingbatsEncoding = [
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'space', 'a1', 'a2', 'a202', 'a3', 'a4', 'a5', 'a119', 'a118', 'a117', 'space', 'a1', 'a2', 'a202', 'a3', 'a4', 'a5', 'a119', 'a118', 'a117',
'a11', 'a12', 'a13', 'a14', 'a15', 'a16', 'a105', 'a17', 'a18', 'a19', 'a11', 'a12', 'a13', 'a14', 'a15', 'a16', 'a105', 'a17', 'a18', 'a19',
'a20', 'a21', 'a22', 'a23', 'a24', 'a25', 'a26', 'a27', 'a28', 'a6', 'a7', 'a20', 'a21', 'a22', 'a23', 'a24', 'a25', 'a26', 'a27', 'a28', 'a6', 'a7',
'a8', 'a9', 'a10', 'a29', 'a30', 'a31', 'a32', 'a33', 'a34', 'a35', 'a36', 'a8', 'a9', 'a10', 'a29', 'a30', 'a31', 'a32', 'a33', 'a34', 'a35', 'a36',
'a37', 'a38', 'a39', 'a40', 'a41', 'a42', 'a43', 'a44', 'a45', 'a46', 'a37', 'a38', 'a39', 'a40', 'a41', 'a42', 'a43', 'a44', 'a45', 'a46',
'a47', 'a48', 'a49', 'a50', 'a51', 'a52', 'a53', 'a54', 'a55', 'a56', 'a47', 'a48', 'a49', 'a50', 'a51', 'a52', 'a53', 'a54', 'a55', 'a56',
'a57', 'a58', 'a59', 'a60', 'a61', 'a62', 'a63', 'a64', 'a65', 'a66', 'a57', 'a58', 'a59', 'a60', 'a61', 'a62', 'a63', 'a64', 'a65', 'a66',
'a67', 'a68', 'a69', 'a70', 'a71', 'a72', 'a73', 'a74', 'a203', 'a75', 'a67', 'a68', 'a69', 'a70', 'a71', 'a72', 'a73', 'a74', 'a203', 'a75',
'a204', 'a76', 'a77', 'a78', 'a79', 'a81', 'a82', 'a83', 'a84', 'a97', 'a204', 'a76', 'a77', 'a78', 'a79', 'a81', 'a82', 'a83', 'a84', 'a97',
'a98', 'a99', 'a100', '', 'a89', 'a90', 'a93', 'a94', 'a91', 'a92', 'a205', 'a98', 'a99', 'a100', '', 'a89', 'a90', 'a93', 'a94', 'a91', 'a92', 'a205',
'a85', 'a206', 'a86', 'a87', 'a88', 'a95', 'a96', '', '', '', '', '', '', 'a85', 'a206', 'a86', 'a87', 'a88', 'a95', 'a96', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', 'a101', 'a102', 'a103', '', '', '', '', '', '', '', '', '', '', '', '', '', 'a101', 'a102', 'a103',
'a104', 'a106', 'a107', 'a108', 'a112', 'a111', 'a110', 'a109', 'a120', 'a104', 'a106', 'a107', 'a108', 'a112', 'a111', 'a110', 'a109', 'a120',
'a121', 'a122', 'a123', 'a124', 'a125', 'a126', 'a127', 'a128', 'a129', 'a121', 'a122', 'a123', 'a124', 'a125', 'a126', 'a127', 'a128', 'a129',
'a130', 'a131', 'a132', 'a133', 'a134', 'a135', 'a136', 'a137', 'a138', 'a130', 'a131', 'a132', 'a133', 'a134', 'a135', 'a136', 'a137', 'a138',
'a139', 'a140', 'a141', 'a142', 'a143', 'a144', 'a145', 'a146', 'a147', 'a139', 'a140', 'a141', 'a142', 'a143', 'a144', 'a145', 'a146', 'a147',
'a148', 'a149', 'a150', 'a151', 'a152', 'a153', 'a154', 'a155', 'a156', 'a148', 'a149', 'a150', 'a151', 'a152', 'a153', 'a154', 'a155', 'a156',
'a157', 'a158', 'a159', 'a160', 'a161', 'a163', 'a164', 'a196', 'a165', 'a157', 'a158', 'a159', 'a160', 'a161', 'a163', 'a164', 'a196', 'a165',
'a192', 'a166', 'a167', 'a168', 'a169', 'a170', 'a171', 'a172', 'a173', 'a192', 'a166', 'a167', 'a168', 'a169', 'a170', 'a171', 'a172', 'a173',
'a162', 'a174', 'a175', 'a176', 'a177', 'a178', 'a179', 'a193', 'a180', 'a162', 'a174', 'a175', 'a176', 'a177', 'a178', 'a179', 'a193', 'a180',
'a199', 'a181', 'a200', 'a182', '', 'a201', 'a183', 'a184', 'a197', 'a185', 'a199', 'a181', 'a200', 'a182', '', 'a201', 'a183', 'a184', 'a197', 'a185',
'a194', 'a198', 'a186', 'a195', 'a187', 'a188', 'a189', 'a190', 'a191']; 'a194', 'a198', 'a186', 'a195', 'a187', 'a188', 'a189', 'a190', 'a191'];
function getEncoding(encodingName) { function getEncoding(encodingName) {
switch (encodingName) { switch (encodingName) {
case 'WinAnsiEncoding': case 'WinAnsiEncoding':
return WinAnsiEncoding; return WinAnsiEncoding;
case 'StandardEncoding': case 'StandardEncoding':
return StandardEncoding; return StandardEncoding;
case 'MacRomanEncoding': case 'MacRomanEncoding':
return MacRomanEncoding; return MacRomanEncoding;
case 'SymbolSetEncoding': case 'SymbolSetEncoding':
return SymbolSetEncoding; return SymbolSetEncoding;
case 'ZapfDingbatsEncoding': case 'ZapfDingbatsEncoding':
return ZapfDingbatsEncoding; return ZapfDingbatsEncoding;
case 'ExpertEncoding': case 'ExpertEncoding':
return ExpertEncoding; return ExpertEncoding;
case 'MacExpertEncoding': case 'MacExpertEncoding':
return MacExpertEncoding; return MacExpertEncoding;
default: default:
return null; return null;
}
} }
}
exports.WinAnsiEncoding = WinAnsiEncoding; export {
exports.StandardEncoding = StandardEncoding; WinAnsiEncoding,
exports.MacRomanEncoding = MacRomanEncoding; StandardEncoding,
exports.SymbolSetEncoding = SymbolSetEncoding; MacRomanEncoding,
exports.ZapfDingbatsEncoding = ZapfDingbatsEncoding; SymbolSetEncoding,
exports.ExpertEncoding = ExpertEncoding; ZapfDingbatsEncoding,
exports.getEncoding = getEncoding; ExpertEncoding,
})); getEncoding,
};

135
src/core/evaluator.js

@ -13,101 +13,39 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import {
assert, CMapCompressionType, createPromiseCapability, error,
(function (root, factory) { FONT_IDENTITY_MATRIX, getLookupTableFactory, IDENTITY_MATRIX, ImageKind, info,
if (typeof define === 'function' && define.amd) { isArray, isNum, isString, NativeImageDecoding, OPS, TextRenderingMode,
define('pdfjs/core/evaluator', ['exports', 'pdfjs/shared/util', UNSUPPORTED_FEATURES, Util, warn
'pdfjs/core/primitives', 'pdfjs/core/stream', 'pdfjs/core/parser', } from '../shared/util';
'pdfjs/core/image', 'pdfjs/core/colorspace', 'pdfjs/core/murmurhash3', import { CMapFactory, IdentityCMap } from './cmap';
'pdfjs/core/fonts', 'pdfjs/core/function', 'pdfjs/core/pattern', import { DecodeStream, JpegStream, Stream } from './stream';
'pdfjs/core/cmap', 'pdfjs/core/metrics', 'pdfjs/core/bidi', import {
'pdfjs/core/encodings', 'pdfjs/core/standard_fonts', Dict, isCmd, isDict, isEOF, isName, isRef, isStream, Name
'pdfjs/core/unicode', 'pdfjs/core/glyphlist'], factory); } from './primitives';
} else if (typeof exports !== 'undefined') { import {
factory(exports, require('../shared/util.js'), require('./primitives.js'), ErrorFont, Font, FontFlags, getFontType, IdentityToUnicodeMap, ToUnicodeMap
require('./stream.js'), require('./parser.js'), require('./image.js'), } from './fonts';
require('./colorspace.js'), require('./murmurhash3.js'), import {
require('./fonts.js'), require('./function.js'), require('./pattern.js'), getEncoding, MacRomanEncoding, StandardEncoding, SymbolSetEncoding,
require('./cmap.js'), require('./metrics.js'), require('./bidi.js'), WinAnsiEncoding, ZapfDingbatsEncoding
require('./encodings.js'), require('./standard_fonts.js'), } from './encodings';
require('./unicode.js'), require('./glyphlist.js')); import {
} else { getNormalizedUnicodes, getUnicodeForGlyph, reverseIfRtl
factory((root.pdfjsCoreEvaluator = {}), root.pdfjsSharedUtil, } from './unicode';
root.pdfjsCorePrimitives, root.pdfjsCoreStream, root.pdfjsCoreParser, import {
root.pdfjsCoreImage, root.pdfjsCoreColorSpace, root.pdfjsCoreMurmurHash3, getSerifFonts, getStdFontMap, getSymbolsFonts
root.pdfjsCoreFonts, root.pdfjsCoreFunction, root.pdfjsCorePattern, } from './standard_fonts';
root.pdfjsCoreCMap, root.pdfjsCoreMetrics, root.pdfjsCoreBidi, import { getTilingPatternIR, Pattern } from './pattern';
root.pdfjsCoreEncodings, root.pdfjsCoreStandardFonts, import { isPDFFunction, PDFFunction } from './function';
root.pdfjsCoreUnicode, root.pdfjsCoreGlyphList); import { Lexer, Parser } from './parser';
} import { bidi } from './bidi';
}(this, function (exports, sharedUtil, corePrimitives, coreStream, coreParser, import { ColorSpace } from './colorspace';
coreImage, coreColorSpace, coreMurmurHash3, coreFonts, import { getGlyphsUnicode } from './glyphlist';
coreFunction, corePattern, coreCMap, coreMetrics, coreBidi, import { getMetrics } from './metrics';
coreEncodings, coreStandardFonts, coreUnicode, import { MurmurHash3_64 } from './murmurhash3';
coreGlyphList) { import { PDFImage } from './image';
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 NativeImageDecoding = sharedUtil.NativeImageDecoding;
var TextRenderingMode = sharedUtil.TextRenderingMode;
var CMapCompressionType = sharedUtil.CMapCompressionType;
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 isEOF = corePrimitives.isEOF;
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 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 PartialEvaluator = (function PartialEvaluatorClosure() {
const DefaultPartialEvaluatorOptions = { const DefaultPartialEvaluatorOptions = {
@ -3439,6 +3377,7 @@ var QueueOptimizer = (function QueueOptimizerClosure() {
return QueueOptimizer; return QueueOptimizer;
})(); })();
exports.OperatorList = OperatorList; export {
exports.PartialEvaluator = PartialEvaluator; OperatorList,
})); PartialEvaluator,
};

35
src/core/font_renderer.js

@ -13,31 +13,11 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import { bytesToString, error, Util } from '../shared/util';
(function (root, factory) { import { CFFParser } from './cff_parser';
if (typeof define === 'function' && define.amd) { import { getGlyphsUnicode } from './glyphlist';
define('pdfjs/core/font_renderer', ['exports', 'pdfjs/shared/util', import { StandardEncoding } from './encodings';
'pdfjs/core/stream', 'pdfjs/core/glyphlist', 'pdfjs/core/encodings', import { Stream } from './stream';
'pdfjs/core/cff_parser'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'), require('./stream.js'),
require('./glyphlist.js'), require('./encodings.js'),
require('./cff_parser.js'));
} else {
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() { var FontRendererFactory = (function FontRendererFactoryClosure() {
function getLong(data, offset) { function getLong(data, offset) {
@ -735,5 +715,6 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
}; };
})(); })();
exports.FontRendererFactory = FontRendererFactory; export {
})); FontRendererFactory,
};

117
src/core/fonts.js

@ -13,76 +13,30 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import {
assert, bytesToString, error, FONT_IDENTITY_MATRIX, FontType, info, isArray,
(function (root, factory) { isInt, isNum, isSpace, MissingDataException, readUint32, shadow, string32,
if (typeof define === 'function' && define.amd) { warn
define('pdfjs/core/fonts', ['exports', 'pdfjs/shared/util', } from '../shared/util';
'pdfjs/core/primitives', 'pdfjs/core/stream', 'pdfjs/core/glyphlist', import {
'pdfjs/core/font_renderer', 'pdfjs/core/encodings', CFF, CFFCharset, CFFCompiler, CFFHeader, CFFIndex, CFFParser, CFFPrivateDict,
'pdfjs/core/standard_fonts', 'pdfjs/core/unicode', CFFStandardStrings, CFFStrings, CFFTopDict
'pdfjs/core/type1_parser', 'pdfjs/core/cff_parser'], factory); } from './cff_parser';
} else if (typeof exports !== 'undefined') { import { getDingbatsGlyphsUnicode, getGlyphsUnicode } from './glyphlist';
factory(exports, require('../shared/util.js'), require('./primitives.js'), import {
require('./stream.js'), require('./glyphlist.js'), getEncoding, MacRomanEncoding, StandardEncoding, SymbolSetEncoding,
require('./font_renderer.js'), require('./encodings.js'), ZapfDingbatsEncoding
require('./standard_fonts.js'), require('./unicode.js'), } from './encodings';
require('./type1_parser.js'), require('./cff_parser.js')); import {
} else { getGlyphMapForStandardFonts, getNonStdFontMap, getStdFontMap,
factory((root.pdfjsCoreFonts = {}), root.pdfjsSharedUtil, getSupplementalGlyphMapForArialBlack
root.pdfjsCorePrimitives, root.pdfjsCoreStream, root.pdfjsCoreGlyphList, } from './standard_fonts';
root.pdfjsCoreFontRenderer, root.pdfjsCoreEncodings, import {
root.pdfjsCoreStandardFonts, root.pdfjsCoreUnicode, getUnicodeForGlyph, getUnicodeRangeFor, mapSpecialUnicodeValues
root.pdfjsCoreType1Parser, root.pdfjsCoreCFFParser); } from './unicode';
} import { FontRendererFactory } from './font_renderer';
}(this, function (exports, sharedUtil, corePrimitives, coreStream, import { Stream } from './stream';
coreGlyphList, coreFontRenderer, coreEncodings, import { Type1Parser } from './type1_parser';
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 // Unicode Private Use Area
var PRIVATE_USE_OFFSET_START = 0xE000; var PRIVATE_USE_OFFSET_START = 0xE000;
@ -3376,14 +3330,15 @@ var CFFFont = (function CFFFontClosure() {
} }
})(); })();
exports.SEAC_ANALYSIS_ENABLED = SEAC_ANALYSIS_ENABLED; export {
exports.PRIVATE_USE_OFFSET_START = PRIVATE_USE_OFFSET_START; SEAC_ANALYSIS_ENABLED,
exports.PRIVATE_USE_OFFSET_END = PRIVATE_USE_OFFSET_END; PRIVATE_USE_OFFSET_START,
exports.ErrorFont = ErrorFont; PRIVATE_USE_OFFSET_END,
exports.Font = Font; ErrorFont,
exports.FontFlags = FontFlags; Font,
exports.IdentityToUnicodeMap = IdentityToUnicodeMap; FontFlags,
exports.ProblematicCharRanges = ProblematicCharRanges; ToUnicodeMap,
exports.ToUnicodeMap = ToUnicodeMap; IdentityToUnicodeMap,
exports.getFontType = getFontType; ProblematicCharRanges,
})); getFontType,
};

37
src/core/function.js

@ -13,29 +13,9 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import { error, info, isArray, isBool } from '../shared/util';
import { isDict, isStream } from './primitives';
(function (root, factory) { import { PostScriptLexer, PostScriptParser } from './ps_parser';
if (typeof define === 'function' && define.amd) {
define('pdfjs/core/function', ['exports', 'pdfjs/shared/util',
'pdfjs/core/primitives', 'pdfjs/core/ps_parser'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'), require('./primitives.js'),
require('./ps_parser.js'));
} else {
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 PDFFunction = (function PDFFunctionClosure() {
var CONSTRUCT_SAMPLED = 0; var CONSTRUCT_SAMPLED = 0;
@ -1152,8 +1132,9 @@ var PostScriptCompiler = (function PostScriptCompilerClosure() {
return PostScriptCompiler; return PostScriptCompiler;
})(); })();
exports.isPDFFunction = isPDFFunction; export {
exports.PDFFunction = PDFFunction; isPDFFunction,
exports.PostScriptEvaluator = PostScriptEvaluator; PDFFunction,
exports.PostScriptCompiler = PostScriptCompiler; PostScriptEvaluator,
})); PostScriptCompiler,
};

14
src/core/glyphlist.js

@ -14,18 +14,7 @@
*/ */
/* no-babel-preset */ /* no-babel-preset */
'use strict'; var getLookupTableFactory = require('../shared/util').getLookupTableFactory;
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs/core/glyphlist', ['exports', 'pdfjs/shared/util'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'));
} else {
factory((root.pdfjsCoreGlyphList = {}), root.pdfjsSharedUtil);
}
}(this, function (exports, sharedUtil) {
var getLookupTableFactory = sharedUtil.getLookupTableFactory;
var getGlyphsUnicode = getLookupTableFactory(function (t) { var getGlyphsUnicode = getLookupTableFactory(function (t) {
t['A'] = 0x0041; t['A'] = 0x0041;
@ -4561,4 +4550,3 @@ var getDingbatsGlyphsUnicode = getLookupTableFactory(function (t) {
exports.getGlyphsUnicode = getGlyphsUnicode; exports.getGlyphsUnicode = getGlyphsUnicode;
exports.getDingbatsGlyphsUnicode = getDingbatsGlyphsUnicode; exports.getDingbatsGlyphsUnicode = getDingbatsGlyphsUnicode;
}));

41
src/core/image.js

@ -13,37 +13,11 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import { assert, error, ImageKind, info, isArray, warn } from '../shared/util';
import { DecodeStream, JpegStream } from './stream';
(function (root, factory) { import { isStream, Name } from './primitives';
if (typeof define === 'function' && define.amd) { import { ColorSpace } from './colorspace';
define('pdfjs/core/image', ['exports', 'pdfjs/shared/util', import { JpxImage } from './jpx';
'pdfjs/core/primitives', 'pdfjs/core/colorspace', 'pdfjs/core/stream',
'pdfjs/core/jpx'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'), require('./primitives.js'),
require('./colorspace.js'), require('./stream.js'),
require('./jpx.js'));
} else {
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() { var PDFImage = (function PDFImageClosure() {
/** /**
@ -664,5 +638,6 @@ var PDFImage = (function PDFImageClosure() {
return PDFImage; return PDFImage;
})(); })();
exports.PDFImage = PDFImage; export {
})); PDFImage,
};

31
src/core/jbig2.js

@ -13,28 +13,10 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import {
error, log2, readInt8, readUint16, readUint32, shadow
(function (root, factory) { } from '../shared/util';
if (typeof define === 'function' && define.amd) { import { ArithmeticDecoder } from './arithmetic_decoder';
define('pdfjs/core/jbig2', ['exports', 'pdfjs/shared/util',
'pdfjs/core/arithmetic_decoder'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'),
require('./arithmetic_decoder.js'));
} else {
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() { var Jbig2Image = (function Jbig2ImageClosure() {
// Utility data structures // Utility data structures
@ -1102,5 +1084,6 @@ var Jbig2Image = (function Jbig2ImageClosure() {
return Jbig2Image; return Jbig2Image;
})(); })();
exports.Jbig2Image = Jbig2Image; export {
})); Jbig2Image,
};

20
src/core/jpg.js

@ -14,20 +14,7 @@
*/ */
/* eslint-disable no-multi-spaces */ /* eslint-disable no-multi-spaces */
'use strict'; import { error, warn } from '../shared/util';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs/core/jpg', ['exports', 'pdfjs/shared/util'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'));
} else {
factory((root.pdfjsCoreJpg = {}), root.pdfjsSharedUtil);
}
}(this, function (exports, sharedUtil) {
var warn = sharedUtil.warn;
var error = sharedUtil.error;
/** /**
* This code was forked from https://github.com/notmasteryet/jpgjs. * This code was forked from https://github.com/notmasteryet/jpgjs.
@ -1138,5 +1125,6 @@ var JpegImage = (function JpegImageClosure() {
return JpegImage; return JpegImage;
})(); })();
exports.JpegImage = JpegImage; export {
})); JpegImage,
};

31
src/core/jpx.js

@ -13,28 +13,10 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import {
error, info, log2, readUint16, readUint32, warn
(function (root, factory) { } from '../shared/util';
if (typeof define === 'function' && define.amd) { import { ArithmeticDecoder } from './arithmetic_decoder';
define('pdfjs/core/jpx', ['exports', 'pdfjs/shared/util',
'pdfjs/core/arithmetic_decoder'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'),
require('./arithmetic_decoder.js'));
} else {
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() { var JpxImage = (function JpxImageClosure() {
// Table E.1 // Table E.1
@ -2227,5 +2209,6 @@ var JpxImage = (function JpxImageClosure() {
return JpxImage; return JpxImage;
})(); })();
exports.JpxImage = JpxImage; export {
})); JpxImage,
};

18
src/core/metrics.js

@ -13,18 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import { getLookupTableFactory } from '../shared/util';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs/core/metrics', ['exports', 'pdfjs/shared/util'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'));
} else {
factory((root.pdfjsCoreMetrics = {}), root.pdfjsSharedUtil);
}
}(this, function (exports, sharedUtil) {
var getLookupTableFactory = sharedUtil.getLookupTableFactory;
// The Metrics object contains glyph widths (in glyph space units). // The Metrics object contains glyph widths (in glyph space units).
// As per PDF spec, for most fonts (Type 3 being an exception) a glyph // As per PDF spec, for most fonts (Type 3 being an exception) a glyph
@ -2968,5 +2957,6 @@ var getMetrics = getLookupTableFactory(function (t) {
}); });
}); });
exports.getMetrics = getMetrics; export {
})); getMetrics,
};

17
src/core/murmurhash3.js

@ -17,18 +17,6 @@
* Hashes roughly 100 KB per millisecond on i7 3.4 GHz. * Hashes roughly 100 KB per millisecond on i7 3.4 GHz.
*/ */
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs/core/murmurhash3', ['exports', 'pdfjs/shared/util'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'));
} else {
factory((root.pdfjsCoreMurmurHash3 = {}), root.pdfjsSharedUtil);
}
}(this, function (exports, sharedUtil) {
var MurmurHash3_64 = (function MurmurHash3_64Closure(seed) { var MurmurHash3_64 = (function MurmurHash3_64Closure(seed) {
// Workaround for missing math precision in JS. // Workaround for missing math precision in JS.
var MASK_HIGH = 0xffff0000; var MASK_HIGH = 0xffff0000;
@ -152,5 +140,6 @@ var MurmurHash3_64 = (function MurmurHash3_64Closure(seed) {
return MurmurHash3_64; return MurmurHash3_64;
})(); })();
exports.MurmurHash3_64 = MurmurHash3_64; export {
})); MurmurHash3_64,
};

1030
src/core/network.js

File diff suppressed because it is too large Load Diff

77
src/core/obj.js

@ -13,58 +13,20 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import {
assert, bytesToString, createPromiseCapability, createValidAbsoluteUrl, error,
(function (root, factory) { info, InvalidPDFException, isArray, isBool, isInt, isString,
if (typeof define === 'function' && define.amd) { MissingDataException, shadow, stringToPDFString, stringToUTF8String, Util,
define('pdfjs/core/obj', ['exports', 'pdfjs/shared/util', warn, XRefParseException
'pdfjs/core/primitives', 'pdfjs/core/crypto', 'pdfjs/core/parser', } from '../shared/util';
'pdfjs/core/chunked_stream', 'pdfjs/core/colorspace'], factory); import {
} else if (typeof exports !== 'undefined') { Dict, isCmd, isDict, isName, isRef, isRefsEqual, isStream, Ref, RefSet,
factory(exports, require('../shared/util.js'), require('./primitives.js'), RefSetCache
require('./crypto.js'), require('./parser.js'), } from './primitives';
require('./chunked_stream.js'), require('./colorspace.js')); import { Lexer, Parser } from './parser';
} else { import { ChunkedStream } from './chunked_stream';
factory((root.pdfjsCoreObj = {}), root.pdfjsSharedUtil, import { CipherTransformFactory } from './crypto';
root.pdfjsCorePrimitives, root.pdfjsCoreCrypto, root.pdfjsCoreParser, import { ColorSpace } from './colorspace';
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 isBool = sharedUtil.isBool;
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 createValidAbsoluteUrl = sharedUtil.createValidAbsoluteUrl;
var Util = sharedUtil.Util;
var Dict = corePrimitives.Dict;
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() { var Catalog = (function CatalogClosure() {
function Catalog(pdfManager, xref, pageFactory) { function Catalog(pdfManager, xref, pageFactory) {
@ -1788,8 +1750,9 @@ var ObjectLoader = (function() {
return ObjectLoader; return ObjectLoader;
})(); })();
exports.Catalog = Catalog; export {
exports.ObjectLoader = ObjectLoader; Catalog,
exports.XRef = XRef; ObjectLoader,
exports.FileSpec = FileSpec; XRef,
})); FileSpec,
};

65
src/core/parser.js

@ -13,51 +13,17 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import {
Ascii85Stream, AsciiHexStream, CCITTFaxStream, FlateStream, Jbig2Stream,
(function (root, factory) { JpegStream, JpxStream, LZWStream, NullStream, PredictorStream, RunLengthStream
if (typeof define === 'function' && define.amd) { } from './stream';
define('pdfjs/core/parser', ['exports', 'pdfjs/shared/util', import {
'pdfjs/core/primitives', 'pdfjs/core/stream'], factory); assert, error, info, isArray, isInt, isNum, isString, MissingDataException,
} else if (typeof exports !== 'undefined') { StreamType, warn
factory(exports, require('../shared/util.js'), require('./primitives.js'), } from '../shared/util';
require('./stream.js')); import {
} else { Cmd, Dict, EOF, isCmd, isDict, isEOF, isName, Name, Ref
factory((root.pdfjsCoreParser = {}), root.pdfjsSharedUtil, } from './primitives';
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 EOF = corePrimitives.EOF;
var Cmd = corePrimitives.Cmd;
var Dict = corePrimitives.Dict;
var Name = corePrimitives.Name;
var Ref = corePrimitives.Ref;
var isEOF = corePrimitives.isEOF;
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 MAX_LENGTH_TO_CACHE = 1000; var MAX_LENGTH_TO_CACHE = 1000;
@ -1125,7 +1091,8 @@ var Linearization = {
} }
}; };
exports.Lexer = Lexer; export {
exports.Linearization = Linearization; Lexer,
exports.Parser = Parser; Linearization,
})); Parser,
};

41
src/core/pattern.js

@ -14,34 +14,12 @@
*/ */
/* eslint-disable no-multi-spaces */ /* eslint-disable no-multi-spaces */
'use strict'; import {
assert, error, info, MissingDataException, UNSUPPORTED_FEATURES, Util, warn
(function (root, factory) { } from '../shared/util';
if (typeof define === 'function' && define.amd) { import { ColorSpace } from './colorspace';
define('pdfjs/core/pattern', ['exports', 'pdfjs/shared/util', import { isStream } from './primitives';
'pdfjs/core/primitives', 'pdfjs/core/function', import { PDFFunction } from './function';
'pdfjs/core/colorspace'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'), require('./primitives.js'),
require('./function.js'), require('./colorspace.js'));
} else {
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 = { var ShadingType = {
FUNCTION_BASED: 1, FUNCTION_BASED: 1,
@ -830,6 +808,7 @@ function getTilingPatternIR(operatorList, dict, args) {
]; ];
} }
exports.Pattern = Pattern; export {
exports.getTilingPatternIR = getTilingPatternIR; Pattern,
})); getTilingPatternIR,
};

42
src/core/pdf_manager.js

@ -13,34 +13,13 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import {
createPromiseCapability, createValidAbsoluteUrl, MissingDataException,
(function (root, factory) { NotImplementedException, shadow, Util, warn
if (typeof define === 'function' && define.amd) { } from '../shared/util';
define('pdfjs/core/pdf_manager', ['exports', 'pdfjs/shared/util', import { ChunkedStreamManager } from './chunked_stream';
'pdfjs/core/stream', 'pdfjs/core/chunked_stream', 'pdfjs/core/document'], import { PDFDocument } from './document';
factory); import { Stream } from './stream';
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'), require('./stream.js'),
require('./chunked_stream.js'), require('./document.js'));
} else {
factory((root.pdfjsCorePdfManager = {}), root.pdfjsSharedUtil,
root.pdfjsCoreStream, root.pdfjsCoreChunkedStream,
root.pdfjsCoreDocument);
}
}(this, function (exports, sharedUtil, coreStream, coreChunkedStream,
coreDocument) {
var warn = sharedUtil.warn;
var createValidAbsoluteUrl = sharedUtil.createValidAbsoluteUrl;
var shadow = sharedUtil.shadow;
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() { var BasePdfManager = (function BasePdfManagerClosure() {
function BasePdfManager() { function BasePdfManager() {
@ -246,6 +225,7 @@ var NetworkPdfManager = (function NetworkPdfManagerClosure() {
return NetworkPdfManager; return NetworkPdfManager;
})(); })();
exports.LocalPdfManager = LocalPdfManager; export {
exports.NetworkPdfManager = NetworkPdfManager; LocalPdfManager,
})); NetworkPdfManager,
};

45
src/core/primitives.js

@ -14,19 +14,7 @@
*/ */
/* uses XRef */ /* uses XRef */
'use strict'; import { isArray } from '../shared/util';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs/core/primitives', ['exports', 'pdfjs/shared/util'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'));
} else {
factory((root.pdfjsCorePrimitives = {}), root.pdfjsSharedUtil);
}
}(this, function (exports, sharedUtil) {
var isArray = sharedUtil.isArray;
var EOF = {}; var EOF = {};
@ -299,18 +287,19 @@ function isStream(v) {
return typeof v === 'object' && v !== null && v.getBytes !== undefined; return typeof v === 'object' && v !== null && v.getBytes !== undefined;
} }
exports.EOF = EOF; export {
exports.Cmd = Cmd; EOF,
exports.Dict = Dict; Cmd,
exports.Name = Name; Dict,
exports.Ref = Ref; Name,
exports.RefSet = RefSet; Ref,
exports.RefSetCache = RefSetCache; RefSet,
exports.isEOF = isEOF; RefSetCache,
exports.isCmd = isCmd; isEOF,
exports.isDict = isDict; isCmd,
exports.isName = isName; isDict,
exports.isRef = isRef; isName,
exports.isRefsEqual = isRefsEqual; isRef,
exports.isStream = isStream; isRefsEqual,
})); isStream,
};

26
src/core/ps_parser.js

@ -13,23 +13,8 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import { error, isSpace } from '../shared/util';
import { EOF } from './primitives';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs/core/ps_parser', ['exports', 'pdfjs/shared/util',
'pdfjs/core/primitives'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'), require('./primitives.js'));
} else {
factory((root.pdfjsCorePsParser = {}), root.pdfjsSharedUtil,
root.pdfjsCorePrimitives);
}
}(this, function (exports, sharedUtil, corePrimitives) {
var error = sharedUtil.error;
var isSpace = sharedUtil.isSpace;
var EOF = corePrimitives.EOF;
var PostScriptParser = (function PostScriptParserClosure() { var PostScriptParser = (function PostScriptParserClosure() {
function PostScriptParser(lexer) { function PostScriptParser(lexer) {
@ -234,6 +219,7 @@ var PostScriptLexer = (function PostScriptLexerClosure() {
return PostScriptLexer; return PostScriptLexer;
})(); })();
exports.PostScriptLexer = PostScriptLexer; export {
exports.PostScriptParser = PostScriptParser; PostScriptLexer,
})); PostScriptParser,
};

696
src/core/standard_fonts.js

@ -13,364 +13,352 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import { getLookupTableFactory } from '../shared/util';
(function (root, factory) { /**
if (typeof define === 'function' && define.amd) { * Hold a map of decoded fonts and of the standard fourteen Type1
define('pdfjs/core/standard_fonts', ['exports', 'pdfjs/shared/util'], * fonts and their acronyms.
factory); */
} else if (typeof exports !== 'undefined') { var getStdFontMap = getLookupTableFactory(function (t) {
factory(exports, require('../shared/util.js')); t['ArialNarrow'] = 'Helvetica';
} else { t['ArialNarrow-Bold'] = 'Helvetica-Bold';
factory((root.pdfjsCoreStandardFonts = {}), root.pdfjsSharedUtil); t['ArialNarrow-BoldItalic'] = 'Helvetica-BoldOblique';
} t['ArialNarrow-Italic'] = 'Helvetica-Oblique';
}(this, function (exports, sharedUtil) { t['ArialBlack'] = 'Helvetica';
var getLookupTableFactory = sharedUtil.getLookupTableFactory; t['ArialBlack-Bold'] = 'Helvetica-Bold';
t['ArialBlack-BoldItalic'] = 'Helvetica-BoldOblique';
/** t['ArialBlack-Italic'] = 'Helvetica-Oblique';
* Hold a map of decoded fonts and of the standard fourteen Type1 t['Arial-Black'] = 'Helvetica';
* fonts and their acronyms. t['Arial-Black-Bold'] = 'Helvetica-Bold';
*/ t['Arial-Black-BoldItalic'] = 'Helvetica-BoldOblique';
var getStdFontMap = getLookupTableFactory(function (t) { t['Arial-Black-Italic'] = 'Helvetica-Oblique';
t['ArialNarrow'] = 'Helvetica'; t['Arial'] = 'Helvetica';
t['ArialNarrow-Bold'] = 'Helvetica-Bold'; t['Arial-Bold'] = 'Helvetica-Bold';
t['ArialNarrow-BoldItalic'] = 'Helvetica-BoldOblique'; t['Arial-BoldItalic'] = 'Helvetica-BoldOblique';
t['ArialNarrow-Italic'] = 'Helvetica-Oblique'; t['Arial-Italic'] = 'Helvetica-Oblique';
t['ArialBlack'] = 'Helvetica'; t['Arial-BoldItalicMT'] = 'Helvetica-BoldOblique';
t['ArialBlack-Bold'] = 'Helvetica-Bold'; t['Arial-BoldMT'] = 'Helvetica-Bold';
t['ArialBlack-BoldItalic'] = 'Helvetica-BoldOblique'; t['Arial-ItalicMT'] = 'Helvetica-Oblique';
t['ArialBlack-Italic'] = 'Helvetica-Oblique'; t['ArialMT'] = 'Helvetica';
t['Arial-Black'] = 'Helvetica'; t['Courier-Bold'] = 'Courier-Bold';
t['Arial-Black-Bold'] = 'Helvetica-Bold'; t['Courier-BoldItalic'] = 'Courier-BoldOblique';
t['Arial-Black-BoldItalic'] = 'Helvetica-BoldOblique'; t['Courier-Italic'] = 'Courier-Oblique';
t['Arial-Black-Italic'] = 'Helvetica-Oblique'; t['CourierNew'] = 'Courier';
t['Arial'] = 'Helvetica'; t['CourierNew-Bold'] = 'Courier-Bold';
t['Arial-Bold'] = 'Helvetica-Bold'; t['CourierNew-BoldItalic'] = 'Courier-BoldOblique';
t['Arial-BoldItalic'] = 'Helvetica-BoldOblique'; t['CourierNew-Italic'] = 'Courier-Oblique';
t['Arial-Italic'] = 'Helvetica-Oblique'; t['CourierNewPS-BoldItalicMT'] = 'Courier-BoldOblique';
t['Arial-BoldItalicMT'] = 'Helvetica-BoldOblique'; t['CourierNewPS-BoldMT'] = 'Courier-Bold';
t['Arial-BoldMT'] = 'Helvetica-Bold'; t['CourierNewPS-ItalicMT'] = 'Courier-Oblique';
t['Arial-ItalicMT'] = 'Helvetica-Oblique'; t['CourierNewPSMT'] = 'Courier';
t['ArialMT'] = 'Helvetica'; t['Helvetica'] = 'Helvetica';
t['Courier-Bold'] = 'Courier-Bold'; t['Helvetica-Bold'] = 'Helvetica-Bold';
t['Courier-BoldItalic'] = 'Courier-BoldOblique'; t['Helvetica-BoldItalic'] = 'Helvetica-BoldOblique';
t['Courier-Italic'] = 'Courier-Oblique'; t['Helvetica-BoldOblique'] = 'Helvetica-BoldOblique';
t['CourierNew'] = 'Courier'; t['Helvetica-Italic'] = 'Helvetica-Oblique';
t['CourierNew-Bold'] = 'Courier-Bold'; t['Helvetica-Oblique'] = 'Helvetica-Oblique';
t['CourierNew-BoldItalic'] = 'Courier-BoldOblique'; t['Symbol-Bold'] = 'Symbol';
t['CourierNew-Italic'] = 'Courier-Oblique'; t['Symbol-BoldItalic'] = 'Symbol';
t['CourierNewPS-BoldItalicMT'] = 'Courier-BoldOblique'; t['Symbol-Italic'] = 'Symbol';
t['CourierNewPS-BoldMT'] = 'Courier-Bold'; t['TimesNewRoman'] = 'Times-Roman';
t['CourierNewPS-ItalicMT'] = 'Courier-Oblique'; t['TimesNewRoman-Bold'] = 'Times-Bold';
t['CourierNewPSMT'] = 'Courier'; t['TimesNewRoman-BoldItalic'] = 'Times-BoldItalic';
t['Helvetica'] = 'Helvetica'; t['TimesNewRoman-Italic'] = 'Times-Italic';
t['Helvetica-Bold'] = 'Helvetica-Bold'; t['TimesNewRomanPS'] = 'Times-Roman';
t['Helvetica-BoldItalic'] = 'Helvetica-BoldOblique'; t['TimesNewRomanPS-Bold'] = 'Times-Bold';
t['Helvetica-BoldOblique'] = 'Helvetica-BoldOblique'; t['TimesNewRomanPS-BoldItalic'] = 'Times-BoldItalic';
t['Helvetica-Italic'] = 'Helvetica-Oblique'; t['TimesNewRomanPS-BoldItalicMT'] = 'Times-BoldItalic';
t['Helvetica-Oblique'] = 'Helvetica-Oblique'; t['TimesNewRomanPS-BoldMT'] = 'Times-Bold';
t['Symbol-Bold'] = 'Symbol'; t['TimesNewRomanPS-Italic'] = 'Times-Italic';
t['Symbol-BoldItalic'] = 'Symbol'; t['TimesNewRomanPS-ItalicMT'] = 'Times-Italic';
t['Symbol-Italic'] = 'Symbol'; t['TimesNewRomanPSMT'] = 'Times-Roman';
t['TimesNewRoman'] = 'Times-Roman'; t['TimesNewRomanPSMT-Bold'] = 'Times-Bold';
t['TimesNewRoman-Bold'] = 'Times-Bold'; t['TimesNewRomanPSMT-BoldItalic'] = 'Times-BoldItalic';
t['TimesNewRoman-BoldItalic'] = 'Times-BoldItalic'; t['TimesNewRomanPSMT-Italic'] = 'Times-Italic';
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 * Holds the map of the non-standard fonts that might be included as
* a standard fonts without glyph data. * a standard fonts without glyph data.
*/ */
var getNonStdFontMap = getLookupTableFactory(function (t) { var getNonStdFontMap = getLookupTableFactory(function (t) {
t['CenturyGothic'] = 'Helvetica'; t['CenturyGothic'] = 'Helvetica';
t['CenturyGothic-Bold'] = 'Helvetica-Bold'; t['CenturyGothic-Bold'] = 'Helvetica-Bold';
t['CenturyGothic-BoldItalic'] = 'Helvetica-BoldOblique'; t['CenturyGothic-BoldItalic'] = 'Helvetica-BoldOblique';
t['CenturyGothic-Italic'] = 'Helvetica-Oblique'; t['CenturyGothic-Italic'] = 'Helvetica-Oblique';
t['ComicSansMS'] = 'Comic Sans MS'; t['ComicSansMS'] = 'Comic Sans MS';
t['ComicSansMS-Bold'] = 'Comic Sans MS-Bold'; t['ComicSansMS-Bold'] = 'Comic Sans MS-Bold';
t['ComicSansMS-BoldItalic'] = 'Comic Sans MS-BoldItalic'; t['ComicSansMS-BoldItalic'] = 'Comic Sans MS-BoldItalic';
t['ComicSansMS-Italic'] = 'Comic Sans MS-Italic'; t['ComicSansMS-Italic'] = 'Comic Sans MS-Italic';
t['LucidaConsole'] = 'Courier'; t['LucidaConsole'] = 'Courier';
t['LucidaConsole-Bold'] = 'Courier-Bold'; t['LucidaConsole-Bold'] = 'Courier-Bold';
t['LucidaConsole-BoldItalic'] = 'Courier-BoldOblique'; t['LucidaConsole-BoldItalic'] = 'Courier-BoldOblique';
t['LucidaConsole-Italic'] = 'Courier-Oblique'; t['LucidaConsole-Italic'] = 'Courier-Oblique';
t['MS-Gothic'] = 'MS Gothic'; t['MS-Gothic'] = 'MS Gothic';
t['MS-Gothic-Bold'] = 'MS Gothic-Bold'; t['MS-Gothic-Bold'] = 'MS Gothic-Bold';
t['MS-Gothic-BoldItalic'] = 'MS Gothic-BoldItalic'; t['MS-Gothic-BoldItalic'] = 'MS Gothic-BoldItalic';
t['MS-Gothic-Italic'] = 'MS Gothic-Italic'; t['MS-Gothic-Italic'] = 'MS Gothic-Italic';
t['MS-Mincho'] = 'MS Mincho'; t['MS-Mincho'] = 'MS Mincho';
t['MS-Mincho-Bold'] = 'MS Mincho-Bold'; t['MS-Mincho-Bold'] = 'MS Mincho-Bold';
t['MS-Mincho-BoldItalic'] = 'MS Mincho-BoldItalic'; t['MS-Mincho-BoldItalic'] = 'MS Mincho-BoldItalic';
t['MS-Mincho-Italic'] = 'MS Mincho-Italic'; t['MS-Mincho-Italic'] = 'MS Mincho-Italic';
t['MS-PGothic'] = 'MS PGothic'; t['MS-PGothic'] = 'MS PGothic';
t['MS-PGothic-Bold'] = 'MS PGothic-Bold'; t['MS-PGothic-Bold'] = 'MS PGothic-Bold';
t['MS-PGothic-BoldItalic'] = 'MS PGothic-BoldItalic'; t['MS-PGothic-BoldItalic'] = 'MS PGothic-BoldItalic';
t['MS-PGothic-Italic'] = 'MS PGothic-Italic'; t['MS-PGothic-Italic'] = 'MS PGothic-Italic';
t['MS-PMincho'] = 'MS PMincho'; t['MS-PMincho'] = 'MS PMincho';
t['MS-PMincho-Bold'] = 'MS PMincho-Bold'; t['MS-PMincho-Bold'] = 'MS PMincho-Bold';
t['MS-PMincho-BoldItalic'] = 'MS PMincho-BoldItalic'; t['MS-PMincho-BoldItalic'] = 'MS PMincho-BoldItalic';
t['MS-PMincho-Italic'] = 'MS PMincho-Italic'; t['MS-PMincho-Italic'] = 'MS PMincho-Italic';
t['NuptialScript'] = 'Times-Italic'; t['NuptialScript'] = 'Times-Italic';
t['Wingdings'] = 'ZapfDingbats'; t['Wingdings'] = 'ZapfDingbats';
}); });
var getSerifFonts = getLookupTableFactory(function (t) { var getSerifFonts = getLookupTableFactory(function (t) {
t['Adobe Jenson'] = true; t['Adobe Jenson'] = true;
t['Adobe Text'] = true; t['Adobe Text'] = true;
t['Albertus'] = true; t['Albertus'] = true;
t['Aldus'] = true; t['Aldus'] = true;
t['Alexandria'] = true; t['Alexandria'] = true;
t['Algerian'] = true; t['Algerian'] = true;
t['American Typewriter'] = true; t['American Typewriter'] = true;
t['Antiqua'] = true; t['Antiqua'] = true;
t['Apex'] = true; t['Apex'] = true;
t['Arno'] = true; t['Arno'] = true;
t['Aster'] = true; t['Aster'] = true;
t['Aurora'] = true; t['Aurora'] = true;
t['Baskerville'] = true; t['Baskerville'] = true;
t['Bell'] = true; t['Bell'] = true;
t['Bembo'] = true; t['Bembo'] = true;
t['Bembo Schoolbook'] = true; t['Bembo Schoolbook'] = true;
t['Benguiat'] = true; t['Benguiat'] = true;
t['Berkeley Old Style'] = true; t['Berkeley Old Style'] = true;
t['Bernhard Modern'] = true; t['Bernhard Modern'] = true;
t['Berthold City'] = true; t['Berthold City'] = true;
t['Bodoni'] = true; t['Bodoni'] = true;
t['Bauer Bodoni'] = true; t['Bauer Bodoni'] = true;
t['Book Antiqua'] = true; t['Book Antiqua'] = true;
t['Bookman'] = true; t['Bookman'] = true;
t['Bordeaux Roman'] = true; t['Bordeaux Roman'] = true;
t['Californian FB'] = true; t['Californian FB'] = true;
t['Calisto'] = true; t['Calisto'] = true;
t['Calvert'] = true; t['Calvert'] = true;
t['Capitals'] = true; t['Capitals'] = true;
t['Cambria'] = true; t['Cambria'] = true;
t['Cartier'] = true; t['Cartier'] = true;
t['Caslon'] = true; t['Caslon'] = true;
t['Catull'] = true; t['Catull'] = true;
t['Centaur'] = true; t['Centaur'] = true;
t['Century Old Style'] = true; t['Century Old Style'] = true;
t['Century Schoolbook'] = true; t['Century Schoolbook'] = true;
t['Chaparral'] = true; t['Chaparral'] = true;
t['Charis SIL'] = true; t['Charis SIL'] = true;
t['Cheltenham'] = true; t['Cheltenham'] = true;
t['Cholla Slab'] = true; t['Cholla Slab'] = true;
t['Clarendon'] = true; t['Clarendon'] = true;
t['Clearface'] = true; t['Clearface'] = true;
t['Cochin'] = true; t['Cochin'] = true;
t['Colonna'] = true; t['Colonna'] = true;
t['Computer Modern'] = true; t['Computer Modern'] = true;
t['Concrete Roman'] = true; t['Concrete Roman'] = true;
t['Constantia'] = true; t['Constantia'] = true;
t['Cooper Black'] = true; t['Cooper Black'] = true;
t['Corona'] = true; t['Corona'] = true;
t['Ecotype'] = true; t['Ecotype'] = true;
t['Egyptienne'] = true; t['Egyptienne'] = true;
t['Elephant'] = true; t['Elephant'] = true;
t['Excelsior'] = true; t['Excelsior'] = true;
t['Fairfield'] = true; t['Fairfield'] = true;
t['FF Scala'] = true; t['FF Scala'] = true;
t['Folkard'] = true; t['Folkard'] = true;
t['Footlight'] = true; t['Footlight'] = true;
t['FreeSerif'] = true; t['FreeSerif'] = true;
t['Friz Quadrata'] = true; t['Friz Quadrata'] = true;
t['Garamond'] = true; t['Garamond'] = true;
t['Gentium'] = true; t['Gentium'] = true;
t['Georgia'] = true; t['Georgia'] = true;
t['Gloucester'] = true; t['Gloucester'] = true;
t['Goudy Old Style'] = true; t['Goudy Old Style'] = true;
t['Goudy Schoolbook'] = true; t['Goudy Schoolbook'] = true;
t['Goudy Pro Font'] = true; t['Goudy Pro Font'] = true;
t['Granjon'] = true; t['Granjon'] = true;
t['Guardian Egyptian'] = true; t['Guardian Egyptian'] = true;
t['Heather'] = true; t['Heather'] = true;
t['Hercules'] = true; t['Hercules'] = true;
t['High Tower Text'] = true; t['High Tower Text'] = true;
t['Hiroshige'] = true; t['Hiroshige'] = true;
t['Hoefler Text'] = true; t['Hoefler Text'] = true;
t['Humana Serif'] = true; t['Humana Serif'] = true;
t['Imprint'] = true; t['Imprint'] = true;
t['Ionic No. 5'] = true; t['Ionic No. 5'] = true;
t['Janson'] = true; t['Janson'] = true;
t['Joanna'] = true; t['Joanna'] = true;
t['Korinna'] = true; t['Korinna'] = true;
t['Lexicon'] = true; t['Lexicon'] = true;
t['Liberation Serif'] = true; t['Liberation Serif'] = true;
t['Linux Libertine'] = true; t['Linux Libertine'] = true;
t['Literaturnaya'] = true; t['Literaturnaya'] = true;
t['Lucida'] = true; t['Lucida'] = true;
t['Lucida Bright'] = true; t['Lucida Bright'] = true;
t['Melior'] = true; t['Melior'] = true;
t['Memphis'] = true; t['Memphis'] = true;
t['Miller'] = true; t['Miller'] = true;
t['Minion'] = true; t['Minion'] = true;
t['Modern'] = true; t['Modern'] = true;
t['Mona Lisa'] = true; t['Mona Lisa'] = true;
t['Mrs Eaves'] = true; t['Mrs Eaves'] = true;
t['MS Serif'] = true; t['MS Serif'] = true;
t['Museo Slab'] = true; t['Museo Slab'] = true;
t['New York'] = true; t['New York'] = true;
t['Nimbus Roman'] = true; t['Nimbus Roman'] = true;
t['NPS Rawlinson Roadway'] = true; t['NPS Rawlinson Roadway'] = true;
t['NuptialScript'] = true; t['NuptialScript'] = true;
t['Palatino'] = true; t['Palatino'] = true;
t['Perpetua'] = true; t['Perpetua'] = true;
t['Plantin'] = true; t['Plantin'] = true;
t['Plantin Schoolbook'] = true; t['Plantin Schoolbook'] = true;
t['Playbill'] = true; t['Playbill'] = true;
t['Poor Richard'] = true; t['Poor Richard'] = true;
t['Rawlinson Roadway'] = true; t['Rawlinson Roadway'] = true;
t['Renault'] = true; t['Renault'] = true;
t['Requiem'] = true; t['Requiem'] = true;
t['Rockwell'] = true; t['Rockwell'] = true;
t['Roman'] = true; t['Roman'] = true;
t['Rotis Serif'] = true; t['Rotis Serif'] = true;
t['Sabon'] = true; t['Sabon'] = true;
t['Scala'] = true; t['Scala'] = true;
t['Seagull'] = true; t['Seagull'] = true;
t['Sistina'] = true; t['Sistina'] = true;
t['Souvenir'] = true; t['Souvenir'] = true;
t['STIX'] = true; t['STIX'] = true;
t['Stone Informal'] = true; t['Stone Informal'] = true;
t['Stone Serif'] = true; t['Stone Serif'] = true;
t['Sylfaen'] = true; t['Sylfaen'] = true;
t['Times'] = true; t['Times'] = true;
t['Trajan'] = true; t['Trajan'] = true;
t['Trinité'] = true; t['Trinité'] = true;
t['Trump Mediaeval'] = true; t['Trump Mediaeval'] = true;
t['Utopia'] = true; t['Utopia'] = true;
t['Vale Type'] = true; t['Vale Type'] = true;
t['Bitstream Vera'] = true; t['Bitstream Vera'] = true;
t['Vera Serif'] = true; t['Vera Serif'] = true;
t['Versailles'] = true; t['Versailles'] = true;
t['Wanted'] = true; t['Wanted'] = true;
t['Weiss'] = true; t['Weiss'] = true;
t['Wide Latin'] = true; t['Wide Latin'] = true;
t['Windsor'] = true; t['Windsor'] = true;
t['XITS'] = true; t['XITS'] = true;
}); });
var getSymbolsFonts = getLookupTableFactory(function (t) { var getSymbolsFonts = getLookupTableFactory(function (t) {
t['Dingbats'] = true; t['Dingbats'] = true;
t['Symbol'] = true; t['Symbol'] = true;
t['ZapfDingbats'] = true; t['ZapfDingbats'] = true;
}); });
// Glyph map for well-known standard fonts. Sometimes Ghostscript uses CID // 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 // 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. // for all glyphs, but common for some set of the standard fonts.
var getGlyphMapForStandardFonts = getLookupTableFactory(function (t) { 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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[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[795] = 803; t[797] = 64336; t[798] = 64337; t[799] = 64342;
t[800] = 64343; t[801] = 64344; t[802] = 64345; t[803] = 64362; 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[804] = 64363; t[805] = 64364; t[2424] = 7821; t[2425] = 7822;
t[2426] = 7823; t[2427] = 7824; t[2428] = 7825; t[2429] = 7826; 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[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[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[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[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[2906] = 7460; t[2908] = 7462; t[2909] = 7463; t[2910] = 7464;
t[2912] = 7466; t[2913] = 7467; t[2914] = 7468; t[2916] = 7470; 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[2917] = 7471; t[2918] = 7472; t[2920] = 7474; t[2921] = 7475;
t[2922] = 7476; t[2924] = 7478; t[2925] = 7479; t[2926] = 7480; 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[2928] = 7482; t[2929] = 7483; t[2930] = 7484; t[2932] = 7486;
t[2933] = 7487; t[2934] = 7488; t[2936] = 7490; t[2937] = 7491; 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[2938] = 7492; t[2940] = 7494; t[2941] = 7495; t[2942] = 7496;
t[2944] = 7498; t[2946] = 7500; t[2948] = 7502; t[2950] = 7504; 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[2951] = 7505; t[2952] = 7506; t[2954] = 7508; t[2955] = 7509;
t[2956] = 7510; t[2958] = 7512; t[2959] = 7513; t[2960] = 7514; 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[2962] = 7516; t[2963] = 7517; t[2964] = 7518; t[2966] = 7520;
t[2967] = 7521; t[2968] = 7522; t[2970] = 7524; t[2971] = 7525; 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[2972] = 7526; t[2974] = 7528; t[2975] = 7529; t[2976] = 7530;
t[2978] = 1537; t[2979] = 1538; t[2980] = 1539; t[2982] = 1549; 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[2983] = 1551; t[2984] = 1552; t[2986] = 1554; t[2987] = 1555;
t[2988] = 1556; t[2990] = 1623; t[2991] = 1624; t[2995] = 1775; 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[2999] = 1791; t[3002] = 64290; t[3003] = 64291; t[3004] = 64292;
t[3006] = 64294; t[3007] = 64295; t[3008] = 64296; t[3011] = 1900; 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[3014] = 8223; t[3015] = 8244; t[3017] = 7532; t[3018] = 7533;
t[3019] = 7534; t[3075] = 7590; t[3076] = 7591; t[3079] = 7594; 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[3080] = 7595; t[3083] = 7598; t[3084] = 7599; t[3087] = 7602;
t[3088] = 7603; t[3091] = 7606; t[3092] = 7607; t[3095] = 7610; 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[3096] = 7611; t[3099] = 7614; t[3100] = 7615; t[3103] = 7618;
t[3104] = 7619; t[3107] = 8337; t[3108] = 8338; t[3116] = 1884; 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[3119] = 1885; t[3120] = 1885; t[3123] = 1886; t[3124] = 1886;
t[3127] = 1887; t[3128] = 1887; t[3131] = 1888; t[3132] = 1888; 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[3135] = 1889; t[3136] = 1889; t[3139] = 1890; t[3140] = 1890;
t[3143] = 1891; t[3144] = 1891; t[3147] = 1892; t[3148] = 1892; 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[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[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[3173] = 1278; t[3174] = 1279; t[3181] = 7622; t[3182] = 7623;
t[3282] = 11799; t[3316] = 578; t[3379] = 42785; t[3393] = 1159; t[3282] = 11799; t[3316] = 578; t[3379] = 42785; t[3393] = 1159;
t[3416] = 8377; t[3416] = 8377;
}); });
// The glyph map for ArialBlack differs slightly from the glyph map used for // 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 // other well-known standard fonts. Hence we use this (incomplete) CID to GID
// mapping to adjust the glyph map for non-embedded ArialBlack fonts. // mapping to adjust the glyph map for non-embedded ArialBlack fonts.
var getSupplementalGlyphMapForArialBlack = var getSupplementalGlyphMapForArialBlack =
getLookupTableFactory(function (t) { getLookupTableFactory(function (t) {
t[227] = 322; t[264] = 261; t[291] = 346; t[227] = 322; t[264] = 261; t[291] = 346;
}); });
exports.getStdFontMap = getStdFontMap; export {
exports.getNonStdFontMap = getNonStdFontMap; getStdFontMap,
exports.getSerifFonts = getSerifFonts; getNonStdFontMap,
exports.getSymbolsFonts = getSymbolsFonts; getSerifFonts,
exports.getGlyphMapForStandardFonts = getGlyphMapForStandardFonts; getSymbolsFonts,
exports.getSupplementalGlyphMapForArialBlack = getGlyphMapForStandardFonts,
getSupplementalGlyphMapForArialBlack; getSupplementalGlyphMapForArialBlack,
})); };

74
src/core/stream.js

@ -13,38 +13,13 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import {
createObjectURL, error, info, isArray, isInt, isSpace, shadow, Util
(function (root, factory) { } from '../shared/util';
if (typeof define === 'function' && define.amd) { import { Dict, isDict, isStream } from './primitives';
define('pdfjs/core/stream', ['exports', 'pdfjs/shared/util', import { Jbig2Image } from './jbig2';
'pdfjs/core/primitives', 'pdfjs/core/jbig2', 'pdfjs/core/jpg', import { JpegImage } from './jpg';
'pdfjs/core/jpx'], factory); import { JpxImage } from './jpx';
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'), require('./primitives.js'),
require('./jbig2.js'), require('./jpg.js'), require('./jpx.js'));
} else {
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 isSpace = sharedUtil.isSpace;
var Dict = corePrimitives.Dict;
var isDict = corePrimitives.isDict;
var isStream = corePrimitives.isStream;
var Jbig2Image = coreJbig2.Jbig2Image;
var JpegImage = coreJpg.JpegImage;
var JpxImage = coreJpx.JpxImage;
var Stream = (function StreamClosure() { var Stream = (function StreamClosure() {
function Stream(arrayBuffer, start, length, dict) { function Stream(arrayBuffer, start, length, dict) {
@ -2476,20 +2451,21 @@ var NullStream = (function NullStreamClosure() {
return NullStream; return NullStream;
})(); })();
exports.Ascii85Stream = Ascii85Stream; export {
exports.AsciiHexStream = AsciiHexStream; Ascii85Stream,
exports.CCITTFaxStream = CCITTFaxStream; AsciiHexStream,
exports.DecryptStream = DecryptStream; CCITTFaxStream,
exports.DecodeStream = DecodeStream; DecryptStream,
exports.FlateStream = FlateStream; DecodeStream,
exports.Jbig2Stream = Jbig2Stream; FlateStream,
exports.JpegStream = JpegStream; Jbig2Stream,
exports.JpxStream = JpxStream; JpegStream,
exports.NullStream = NullStream; JpxStream,
exports.PredictorStream = PredictorStream; NullStream,
exports.RunLengthStream = RunLengthStream; PredictorStream,
exports.Stream = Stream; RunLengthStream,
exports.StreamsSequenceStream = StreamsSequenceStream; Stream,
exports.StringStream = StringStream; StreamsSequenceStream,
exports.LZWStream = LZWStream; StringStream,
})); LZWStream,
};

27
src/core/type1_parser.js

@ -13,25 +13,9 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import { isSpace, warn } from '../shared/util';
import { getEncoding } from './encodings';
(function (root, factory) { import { Stream } from './stream';
if (typeof define === 'function' && define.amd) {
define('pdfjs/core/type1_parser', ['exports', 'pdfjs/shared/util',
'pdfjs/core/stream', 'pdfjs/core/encodings'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'), require('./stream.js'),
require('./encodings.js'));
} else {
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 // Hinting is currently disabled due to unknown problems on windows
// in tracemonkey and various other pdfs with type1 fonts. // in tracemonkey and various other pdfs with type1 fonts.
@ -717,5 +701,6 @@ var Type1Parser = (function Type1ParserClosure() {
return Type1Parser; return Type1Parser;
})(); })();
exports.Type1Parser = Type1Parser; export {
})); Type1Parser,
};

3210
src/core/unicode.js

File diff suppressed because it is too large Load Diff

54
src/core/worker.js

@ -13,41 +13,14 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; import {
arrayByteLength, arraysToBytes, assert, createPromiseCapability, info,
(function (root, factory) { InvalidPDFException, isNodeJS, MessageHandler, MissingPDFException,
if (typeof define === 'function' && define.amd) { PasswordException, setVerbosityLevel, UnexpectedResponseException,
define('pdfjs/core/worker', ['exports', 'pdfjs/shared/util', UnknownErrorException, UNSUPPORTED_FEATURES, warn, XRefParseException
'pdfjs/core/primitives', 'pdfjs/core/pdf_manager'], } from '../shared/util';
factory); import { LocalPdfManager, NetworkPdfManager } from './pdf_manager';
} else if (typeof exports !== 'undefined') { import { Ref } from './primitives';
factory(exports, require('../shared/util.js'), require('./primitives.js'),
require('./pdf_manager.js'));
} else {
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 UnknownErrorException = sharedUtil.UnknownErrorException;
var XRefParseException = sharedUtil.XRefParseException;
var arrayByteLength = sharedUtil.arrayByteLength;
var arraysToBytes = sharedUtil.arraysToBytes;
var assert = sharedUtil.assert;
var createPromiseCapability = sharedUtil.createPromiseCapability;
var info = sharedUtil.info;
var warn = sharedUtil.warn;
var setVerbosityLevel = sharedUtil.setVerbosityLevel;
var isNodeJS = sharedUtil.isNodeJS;
var Ref = corePrimitives.Ref;
var LocalPdfManager = corePdfManager.LocalPdfManager;
var NetworkPdfManager = corePdfManager.NetworkPdfManager;
var WorkerTask = (function WorkerTaskClosure() { var WorkerTask = (function WorkerTaskClosure() {
function WorkerTask(name) { function WorkerTask(name) {
@ -568,7 +541,7 @@ var WorkerMessageHandler = {
if (source.chunkedViewerLoading) { if (source.chunkedViewerLoading) {
pdfStream = new PDFWorkerStream(source, handler); pdfStream = new PDFWorkerStream(source, handler);
} else { } else {
assert(PDFNetworkStream, 'pdfjs/core/network module is not loaded'); assert(PDFNetworkStream, './network module is not loaded');
pdfStream = new PDFNetworkStream(data); pdfStream = new PDFNetworkStream(data);
} }
} catch (ex) { } catch (ex) {
@ -982,7 +955,8 @@ if (typeof window === 'undefined' && !isNodeJS() &&
WorkerMessageHandler.initializeFromPort(self); WorkerMessageHandler.initializeFromPort(self);
} }
exports.setPDFNetworkStreamClass = setPDFNetworkStreamClass; export {
exports.WorkerTask = WorkerTask; setPDFNetworkStreamClass,
exports.WorkerMessageHandler = WorkerMessageHandler; WorkerTask,
})); WorkerMessageHandler,
};

1
src/main_loader.js

@ -68,4 +68,5 @@
displayDOMUtils.RenderingCancelledException; displayDOMUtils.RenderingCancelledException;
exports.getFilenameFromUrl = displayDOMUtils.getFilenameFromUrl; exports.getFilenameFromUrl = displayDOMUtils.getFilenameFromUrl;
exports.addLinkAttributes = displayDOMUtils.addLinkAttributes; exports.addLinkAttributes = displayDOMUtils.addLinkAttributes;
exports.StatTimer = sharedUtil.StatTimer;
})); }));

1
src/pdf.js

@ -57,3 +57,4 @@ exports.RenderingCancelledException =
pdfjsDisplayDOMUtils.RenderingCancelledException; pdfjsDisplayDOMUtils.RenderingCancelledException;
exports.getFilenameFromUrl = pdfjsDisplayDOMUtils.getFilenameFromUrl; exports.getFilenameFromUrl = pdfjsDisplayDOMUtils.getFilenameFromUrl;
exports.addLinkAttributes = pdfjsDisplayDOMUtils.addLinkAttributes; exports.addLinkAttributes = pdfjsDisplayDOMUtils.addLinkAttributes;
exports.StatTimer = pdfjsSharedUtil.StatTimer;

8
test/driver.js

@ -12,13 +12,15 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals PDFJS, pdfjsSharedUtil */ /* globals PDFJS, pdfjsDistBuildPdf */
'use strict'; 'use strict';
var WAITING_TIME = 100; // ms var WAITING_TIME = 100; // ms
var PDF_TO_CSS_UNITS = 96.0 / 72.0; var PDF_TO_CSS_UNITS = 96.0 / 72.0;
var StatTimer = pdfjsDistBuildPdf.StatTimer;
/** /**
* @class * @class
*/ */
@ -258,7 +260,7 @@ var Driver = (function DriverClosure() { // eslint-disable-line no-unused-vars
*/ */
function Driver(options) { function Driver(options) {
// Configure the global PDFJS object // Configure the global PDFJS object
PDFJS.workerSrc = '../src/worker_loader.js'; PDFJS.workerSrc = '../build/generic/build/pdf.worker.js';
PDFJS.cMapPacked = true; PDFJS.cMapPacked = true;
PDFJS.cMapUrl = '../external/bcmaps/'; PDFJS.cMapUrl = '../external/bcmaps/';
PDFJS.enableStats = true; PDFJS.enableStats = true;
@ -547,7 +549,7 @@ var Driver = (function DriverClosure() { // eslint-disable-line no-unused-vars
} }
page.cleanup(); page.cleanup();
task.stats = page.stats; task.stats = page.stats;
page.stats = new pdfjsSharedUtil.StatTimer(); page.stats = new StatTimer();
self._snapshot(task, error); self._snapshot(task, error);
}); });
initPromise.then(function () { initPromise.then(function () {

24
test/test_slave.html

@ -18,8 +18,7 @@ limitations under the License.
<head> <head>
<title>PDF.js test slave</title> <title>PDF.js test slave</title>
<meta charset="utf-8"> <meta charset="utf-8">
<script src="../node_modules/systemjs/dist/system.js"></script> <script src="../build/generic/build/pdf.js"></script>
<script src="../systemjs.config.js"></script>
<script src="driver.js"></script> <script src="driver.js"></script>
</head> </head>
<body> <body>
@ -32,21 +31,12 @@ limitations under the License.
<div id="end"></div> <div id="end"></div>
</body> </body>
<script> <script>
Promise.all([SystemJS.import('pdfjs/display/api'), var driver = new Driver({
SystemJS.import('pdfjs/display/text_layer'), disableScrolling: document.getElementById('disableScrolling'),
SystemJS.import('pdfjs/display/annotation_layer'), inflight: document.getElementById('inflight'),
SystemJS.import('pdfjs/display/global'), output: document.getElementById('output'),
SystemJS.import('pdfjs/shared/util')]) end: document.getElementById('end')
.then(function (modules) {
window.pdfjsSharedUtil = modules[4];
var driver = new Driver({
disableScrolling: document.getElementById('disableScrolling'),
inflight: document.getElementById('inflight'),
output: document.getElementById('output'),
end: document.getElementById('end')
});
driver.run();
}); });
driver.run();
</script> </script>
</html> </html>

2
test/unit/jasmine-boot.js

@ -60,7 +60,7 @@ function initializePDFJS(callback) {
var displayGlobal = modules[0]; var displayGlobal = modules[0];
// Configure the worker. // Configure the worker.
displayGlobal.PDFJS.workerSrc = '../../src/worker_loader.js'; displayGlobal.PDFJS.workerSrc = '../../build/generic/build/pdf.worker.js';
// Opt-in to using the latest API. // Opt-in to using the latest API.
displayGlobal.PDFJS.pdfjsNext = true; displayGlobal.PDFJS.pdfjsNext = true;

Loading…
Cancel
Save