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. 18
      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. 29
      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. 38
      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. 30
      src/core/standard_fonts.js
  32. 74
      src/core/stream.js
  33. 27
      src/core/type1_parser.js
  34. 14
      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. 12
      test/test_slave.html
  40. 2
      test/unit/jasmine-boot.js

12
gulpfile.js

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

60
src/core/annotation.js

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

17
src/core/arithmetic_decoder.js

@ -13,18 +13,6 @@ @@ -13,18 +13,6 @@
* 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
* JPEG 2000 Part I Final Committee Draft Version 1.0
* Annex C.3 Arithmetic decoding procedure
@ -192,5 +180,6 @@ var ArithmeticDecoder = (function ArithmeticDecoderClosure() { @@ -192,5 +180,6 @@ var ArithmeticDecoder = (function ArithmeticDecoderClosure() {
return ArithmeticDecoder;
})();
exports.ArithmeticDecoder = ArithmeticDecoder;
}));
export {
ArithmeticDecoder,
};

18
src/core/bidi.js

@ -13,18 +13,7 @@ @@ -13,18 +13,7 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs/core/bidi', ['exports', 'pdfjs/shared/util'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'));
} else {
factory((root.pdfjsCoreBidi = {}), root.pdfjsSharedUtil);
}
}(this, function (exports, sharedUtil) {
var warn = sharedUtil.warn;
import { warn } from '../shared/util';
// Character types for symbols from 0000 to 00FF.
// Source: ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt
@ -438,5 +427,6 @@ @@ -438,5 +427,6 @@
return createBidiText(chars.join(''), isLTR);
}
exports.bidi = bidi;
}));
export {
bidi,
};

58
src/core/cff_parser.js

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

21
src/core/charsets.js

@ -13,18 +13,6 @@ @@ -13,18 +13,6 @@
* 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 = [
'.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar',
'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright',
@ -125,7 +113,8 @@ var ExpertSubsetCharset = [ @@ -125,7 +113,8 @@ var ExpertSubsetCharset = [
'periodinferior', 'commainferior'
];
exports.ISOAdobeCharset = ISOAdobeCharset;
exports.ExpertCharset = ExpertCharset;
exports.ExpertSubsetCharset = ExpertSubsetCharset;
}));
export {
ISOAdobeCharset,
ExpertCharset,
ExpertSubsetCharset,
};

31
src/core/chunked_stream.js

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

46
src/core/cmap.js

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

34
src/core/colorspace.js

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

57
src/core/crypto.js

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

71
src/core/document.js

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

29
src/core/encodings.js

@ -13,18 +13,6 @@ @@ -13,18 +13,6 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs/core/encodings', ['exports'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports);
} else {
factory((root.pdfjsCoreEncodings = {}));
}
}(this, function (exports) {
var ExpertEncoding = [
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
@ -294,11 +282,12 @@ @@ -294,11 +282,12 @@
}
}
exports.WinAnsiEncoding = WinAnsiEncoding;
exports.StandardEncoding = StandardEncoding;
exports.MacRomanEncoding = MacRomanEncoding;
exports.SymbolSetEncoding = SymbolSetEncoding;
exports.ZapfDingbatsEncoding = ZapfDingbatsEncoding;
exports.ExpertEncoding = ExpertEncoding;
exports.getEncoding = getEncoding;
}));
export {
WinAnsiEncoding,
StandardEncoding,
MacRomanEncoding,
SymbolSetEncoding,
ZapfDingbatsEncoding,
ExpertEncoding,
getEncoding,
};

135
src/core/evaluator.js

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

35
src/core/font_renderer.js

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

117
src/core/fonts.js

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

37
src/core/function.js

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

14
src/core/glyphlist.js

@ -14,18 +14,7 @@ @@ -14,18 +14,7 @@
*/
/* no-babel-preset */
'use strict';
(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 getLookupTableFactory = require('../shared/util').getLookupTableFactory;
var getGlyphsUnicode = getLookupTableFactory(function (t) {
t['A'] = 0x0041;
@ -4561,4 +4550,3 @@ var getDingbatsGlyphsUnicode = getLookupTableFactory(function (t) { @@ -4561,4 +4550,3 @@ var getDingbatsGlyphsUnicode = getLookupTableFactory(function (t) {
exports.getGlyphsUnicode = getGlyphsUnicode;
exports.getDingbatsGlyphsUnicode = getDingbatsGlyphsUnicode;
}));

41
src/core/image.js

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

31
src/core/jbig2.js

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

20
src/core/jpg.js

@ -14,20 +14,7 @@ @@ -14,20 +14,7 @@
*/
/* eslint-disable no-multi-spaces */
'use strict';
(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;
import { error, warn } from '../shared/util';
/**
* This code was forked from https://github.com/notmasteryet/jpgjs.
@ -1138,5 +1125,6 @@ var JpegImage = (function JpegImageClosure() { @@ -1138,5 +1125,6 @@ var JpegImage = (function JpegImageClosure() {
return JpegImage;
})();
exports.JpegImage = JpegImage;
}));
export {
JpegImage,
};

31
src/core/jpx.js

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

18
src/core/metrics.js

@ -13,18 +13,7 @@ @@ -13,18 +13,7 @@
* limitations under the License.
*/
'use strict';
(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;
import { getLookupTableFactory } from '../shared/util';
// The Metrics object contains glyph widths (in glyph space units).
// As per PDF spec, for most fonts (Type 3 being an exception) a glyph
@ -2968,5 +2957,6 @@ var getMetrics = getLookupTableFactory(function (t) { @@ -2968,5 +2957,6 @@ var getMetrics = getLookupTableFactory(function (t) {
});
});
exports.getMetrics = getMetrics;
}));
export {
getMetrics,
};

17
src/core/murmurhash3.js

@ -17,18 +17,6 @@ @@ -17,18 +17,6 @@
* 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) {
// Workaround for missing math precision in JS.
var MASK_HIGH = 0xffff0000;
@ -152,5 +140,6 @@ var MurmurHash3_64 = (function MurmurHash3_64Closure(seed) { @@ -152,5 +140,6 @@ var MurmurHash3_64 = (function MurmurHash3_64Closure(seed) {
return MurmurHash3_64;
})();
exports.MurmurHash3_64 = MurmurHash3_64;
}));
export {
MurmurHash3_64,
};

38
src/core/network.js

@ -13,26 +13,17 @@ @@ -13,26 +13,17 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs/core/network', ['exports', 'pdfjs/shared/util',
'pdfjs/core/worker'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'), require('./worker.js'));
} else {
factory((root.pdfjsCoreNetwork = {}), root.pdfjsSharedUtil,
root.pdfjsCoreWorker);
}
}(this, function (exports, sharedUtil, coreWorker) {
import {
assert, createPromiseCapability, globalScope, isInt, MissingPDFException,
UnexpectedResponseException
} from '../shared/util';
import { setPDFNetworkStreamClass } from './worker';
if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('FIREFOX || MOZCENTRAL')) {
throw new Error('Module "pdfjs/core/network" shall not ' +
throw new Error('Module "./network" shall not ' +
'be used with FIREFOX or MOZCENTRAL build.');
}
var globalScope = sharedUtil.globalScope;
var OK_RESPONSE = 200;
var PARTIAL_CONTENT_RESPONSE = 206;
@ -277,12 +268,6 @@ if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('FIREFOX || MOZCENTRAL')) { @@ -277,12 +268,6 @@ if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('FIREFOX || MOZCENTRAL')) {
}
};
var assert = sharedUtil.assert;
var createPromiseCapability = sharedUtil.createPromiseCapability;
var isInt = sharedUtil.isInt;
var MissingPDFException = sharedUtil.MissingPDFException;
var UnexpectedResponseException = sharedUtil.UnexpectedResponseException;
/** @implements {IPDFStream} */
function PDFNetworkStream(options) {
this._options = options;
@ -608,8 +593,9 @@ if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('FIREFOX || MOZCENTRAL')) { @@ -608,8 +593,9 @@ if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('FIREFOX || MOZCENTRAL')) {
}
};
coreWorker.setPDFNetworkStreamClass(PDFNetworkStream);
setPDFNetworkStreamClass(PDFNetworkStream);
exports.PDFNetworkStream = PDFNetworkStream;
exports.NetworkManager = NetworkManager;
}));
export {
PDFNetworkStream,
NetworkManager,
};

77
src/core/obj.js

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

65
src/core/parser.js

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

41
src/core/pattern.js

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

42
src/core/pdf_manager.js

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

45
src/core/primitives.js

@ -14,19 +14,7 @@ @@ -14,19 +14,7 @@
*/
/* uses XRef */
'use strict';
(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;
import { isArray } from '../shared/util';
var EOF = {};
@ -299,18 +287,19 @@ function isStream(v) { @@ -299,18 +287,19 @@ function isStream(v) {
return typeof v === 'object' && v !== null && v.getBytes !== undefined;
}
exports.EOF = EOF;
exports.Cmd = Cmd;
exports.Dict = Dict;
exports.Name = Name;
exports.Ref = Ref;
exports.RefSet = RefSet;
exports.RefSetCache = RefSetCache;
exports.isEOF = isEOF;
exports.isCmd = isCmd;
exports.isDict = isDict;
exports.isName = isName;
exports.isRef = isRef;
exports.isRefsEqual = isRefsEqual;
exports.isStream = isStream;
}));
export {
EOF,
Cmd,
Dict,
Name,
Ref,
RefSet,
RefSetCache,
isEOF,
isCmd,
isDict,
isName,
isRef,
isRefsEqual,
isStream,
};

26
src/core/ps_parser.js

@ -13,23 +13,8 @@ @@ -13,23 +13,8 @@
* limitations under the License.
*/
'use strict';
(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;
import { error, isSpace } from '../shared/util';
import { EOF } from './primitives';
var PostScriptParser = (function PostScriptParserClosure() {
function PostScriptParser(lexer) {
@ -234,6 +219,7 @@ var PostScriptLexer = (function PostScriptLexerClosure() { @@ -234,6 +219,7 @@ var PostScriptLexer = (function PostScriptLexerClosure() {
return PostScriptLexer;
})();
exports.PostScriptLexer = PostScriptLexer;
exports.PostScriptParser = PostScriptParser;
}));
export {
PostScriptLexer,
PostScriptParser,
};

30
src/core/standard_fonts.js

@ -13,19 +13,7 @@ @@ -13,19 +13,7 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs/core/standard_fonts', ['exports', 'pdfjs/shared/util'],
factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'));
} else {
factory((root.pdfjsCoreStandardFonts = {}), root.pdfjsSharedUtil);
}
}(this, function (exports, sharedUtil) {
var getLookupTableFactory = sharedUtil.getLookupTableFactory;
import { getLookupTableFactory } from '../shared/util';
/**
* Hold a map of decoded fonts and of the standard fourteen Type1
@ -366,11 +354,11 @@ @@ -366,11 +354,11 @@
t[227] = 322; t[264] = 261; t[291] = 346;
});
exports.getStdFontMap = getStdFontMap;
exports.getNonStdFontMap = getNonStdFontMap;
exports.getSerifFonts = getSerifFonts;
exports.getSymbolsFonts = getSymbolsFonts;
exports.getGlyphMapForStandardFonts = getGlyphMapForStandardFonts;
exports.getSupplementalGlyphMapForArialBlack =
getSupplementalGlyphMapForArialBlack;
}));
export {
getStdFontMap,
getNonStdFontMap,
getSerifFonts,
getSymbolsFonts,
getGlyphMapForStandardFonts,
getSupplementalGlyphMapForArialBlack,
};

74
src/core/stream.js

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

27
src/core/type1_parser.js

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

14
src/core/unicode.js

@ -14,18 +14,7 @@ @@ -14,18 +14,7 @@
*/
/* no-babel-preset */
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs/core/unicode', ['exports', 'pdfjs/shared/util'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'));
} else {
factory((root.pdfjsCoreUnicode = {}), root.pdfjsSharedUtil);
}
}(this, function (exports, sharedUtil) {
var getLookupTableFactory = sharedUtil.getLookupTableFactory;
var getLookupTableFactory = require('../shared/util').getLookupTableFactory;
// Some characters, e.g. copyrightserif, are mapped to the private use area
// and might not be displayed using standard fonts. Mapping/hacking well-known
@ -1644,4 +1633,3 @@ @@ -1644,4 +1633,3 @@
exports.getUnicodeRangeFor = getUnicodeRangeFor;
exports.getNormalizedUnicodes = getNormalizedUnicodes;
exports.getUnicodeForGlyph = getUnicodeForGlyph;
}));

54
src/core/worker.js

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

1
src/main_loader.js

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

1
src/pdf.js

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

8
test/driver.js

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

12
test/test_slave.html

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

2
test/unit/jasmine-boot.js

@ -60,7 +60,7 @@ function initializePDFJS(callback) { @@ -60,7 +60,7 @@ function initializePDFJS(callback) {
var displayGlobal = modules[0];
// 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.
displayGlobal.PDFJS.pdfjsNext = true;

Loading…
Cancel
Save