mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 01:58:06 +02:00
Convert the files in the /src/core
folder to ES6 modules
Please note that the `glyphlist.js` and `unicode.js` files are converted to CommonJS modules instead, since Babel cannot handle files that large and they are thus excluded from transpilation.
This commit is contained in:
parent
b66b705ed7
commit
982b6aa65b
34 changed files with 3504 additions and 4203 deletions
|
@ -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() {
|
|||
return PDFDocument;
|
||||
})();
|
||||
|
||||
exports.Page = Page;
|
||||
exports.PDFDocument = PDFDocument;
|
||||
}));
|
||||
export {
|
||||
Page,
|
||||
PDFDocument,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue