Adds UMD headers to core, display and shared files.
This commit is contained in:
parent
1b5940edd2
commit
6b60c8f4db
@ -3,6 +3,12 @@
|
|||||||
"browser": true,
|
"browser": true,
|
||||||
"devel": true,
|
"devel": true,
|
||||||
"worker": true,
|
"worker": true,
|
||||||
|
"predef": [
|
||||||
|
"Promise",
|
||||||
|
"require",
|
||||||
|
"define",
|
||||||
|
"exports"
|
||||||
|
],
|
||||||
|
|
||||||
// Enforcing
|
// Enforcing
|
||||||
"maxlen": 80,
|
"maxlen": 80,
|
||||||
|
@ -4,17 +4,17 @@
|
|||||||
<head>
|
<head>
|
||||||
<!-- In production, only one script (pdf.js) is necessary -->
|
<!-- In production, only one script (pdf.js) is necessary -->
|
||||||
<!-- In production, change the content of PDFJS.workerSrc below -->
|
<!-- In production, change the content of PDFJS.workerSrc below -->
|
||||||
|
<script src="../../src/shared/global.js"></script>
|
||||||
|
<script src="../../src/display/dom_utils.js"></script>
|
||||||
<script src="../../src/shared/util.js"></script>
|
<script src="../../src/shared/util.js"></script>
|
||||||
<script src="../../src/display/api.js"></script>
|
<script src="../../src/display/annotation_layer.js"></script>
|
||||||
|
<script src="../../src/display/font_loader.js"></script>
|
||||||
<script src="../../src/display/metadata.js"></script>
|
<script src="../../src/display/metadata.js"></script>
|
||||||
<script src="../../src/display/canvas.js"></script>
|
<script src="../../src/display/text_layer.js"></script>
|
||||||
<script src="../../src/display/webgl.js"></script>
|
<script src="../../src/display/webgl.js"></script>
|
||||||
<script src="../../src/display/pattern_helper.js"></script>
|
<script src="../../src/display/pattern_helper.js"></script>
|
||||||
<script src="../../src/display/font_loader.js"></script>
|
<script src="../../src/display/canvas.js"></script>
|
||||||
<script src="../../src/display/dom_utils.js"></script>
|
<script src="../../src/display/api.js"></script>
|
||||||
<script src="../../src/display/annotation_layer.js"></script>
|
|
||||||
<script src="../../src/display/text_layer.js"></script>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Specify the main script used to create a new PDF.JS web worker.
|
// Specify the main script used to create a new PDF.JS web worker.
|
||||||
// In production, change this to point to the combined `pdf.js` file.
|
// In production, change this to point to the combined `pdf.js` file.
|
||||||
|
@ -4,16 +4,17 @@
|
|||||||
<head>
|
<head>
|
||||||
<!-- In production, only one script (pdf.js) is necessary -->
|
<!-- In production, only one script (pdf.js) is necessary -->
|
||||||
<!-- In production, change the content of PDFJS.workerSrc below -->
|
<!-- In production, change the content of PDFJS.workerSrc below -->
|
||||||
|
<script src="../../src/shared/global.js"></script>
|
||||||
|
<script src="../../src/display/dom_utils.js"></script>
|
||||||
<script src="../../src/shared/util.js"></script>
|
<script src="../../src/shared/util.js"></script>
|
||||||
<script src="../../src/display/api.js"></script>
|
<script src="../../src/display/annotation_layer.js"></script>
|
||||||
|
<script src="../../src/display/font_loader.js"></script>
|
||||||
<script src="../../src/display/metadata.js"></script>
|
<script src="../../src/display/metadata.js"></script>
|
||||||
<script src="../../src/display/canvas.js"></script>
|
<script src="../../src/display/text_layer.js"></script>
|
||||||
<script src="../../src/display/webgl.js"></script>
|
<script src="../../src/display/webgl.js"></script>
|
||||||
<script src="../../src/display/pattern_helper.js"></script>
|
<script src="../../src/display/pattern_helper.js"></script>
|
||||||
<script src="../../src/display/font_loader.js"></script>
|
<script src="../../src/display/canvas.js"></script>
|
||||||
<script src="../../src/display/dom_utils.js"></script>
|
<script src="../../src/display/api.js"></script>
|
||||||
<script src="../../src/display/annotation_layer.js"></script>
|
|
||||||
<script src="../../src/display/text_layer.js"></script>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Specify the main script used to create a new PDF.JS web worker.
|
// Specify the main script used to create a new PDF.JS web worker.
|
||||||
|
@ -4,12 +4,15 @@
|
|||||||
<head>
|
<head>
|
||||||
<!-- In production, only one script (pdf.js) is necessary -->
|
<!-- In production, only one script (pdf.js) is necessary -->
|
||||||
<!-- In production, change the content of PDFJS.workerSrc below -->
|
<!-- In production, change the content of PDFJS.workerSrc below -->
|
||||||
|
<script src="../../src/shared/global.js"></script>
|
||||||
<script src="../../src/shared/util.js"></script>
|
<script src="../../src/shared/util.js"></script>
|
||||||
<script src="../../src/display/api.js"></script>
|
|
||||||
<script src="../../src/display/metadata.js"></script>
|
|
||||||
<script src="../../src/display/pattern_helper.js"></script>
|
|
||||||
<script src="../../src/display/font_loader.js"></script>
|
<script src="../../src/display/font_loader.js"></script>
|
||||||
|
<script src="../../src/display/metadata.js"></script>
|
||||||
<script src="../../src/display/svg.js"></script>
|
<script src="../../src/display/svg.js"></script>
|
||||||
|
<script src="../../src/display/webgl.js"></script>
|
||||||
|
<script src="../../src/display/pattern_helper.js"></script>
|
||||||
|
<script src="../../src/display/canvas.js"></script>
|
||||||
|
<script src="../../src/display/api.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Specify the main script used to create a new PDF.JS web worker.
|
// Specify the main script used to create a new PDF.JS web worker.
|
||||||
|
15
make.js
15
make.js
@ -520,19 +520,20 @@ target.bundle = function(args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var SHARED_SRC_FILES = [
|
var SHARED_SRC_FILES = [
|
||||||
'shared/util.js',
|
'shared/global.js',
|
||||||
|
'shared/util.js'
|
||||||
];
|
];
|
||||||
|
|
||||||
var MAIN_SRC_FILES = SHARED_SRC_FILES.concat([
|
var MAIN_SRC_FILES = SHARED_SRC_FILES.concat([
|
||||||
'display/api.js',
|
|
||||||
'display/metadata.js',
|
|
||||||
'display/canvas.js',
|
|
||||||
'display/webgl.js',
|
|
||||||
'display/pattern_helper.js',
|
|
||||||
'display/font_loader.js',
|
|
||||||
'display/dom_utils.js',
|
'display/dom_utils.js',
|
||||||
'display/annotation_layer.js',
|
'display/annotation_layer.js',
|
||||||
|
'display/font_loader.js',
|
||||||
|
'display/metadata.js',
|
||||||
'display/text_layer.js',
|
'display/text_layer.js',
|
||||||
|
'display/webgl.js',
|
||||||
|
'display/pattern_helper.js',
|
||||||
|
'display/canvas.js',
|
||||||
|
'display/api.js',
|
||||||
'display/svg.js'
|
'display/svg.js'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -12,13 +12,48 @@
|
|||||||
* 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, Util, isDict, isName, stringToPDFString, warn, Dict, Stream,
|
/* globals PDFJS */
|
||||||
stringToBytes, Promise, isArray, ObjectLoader, OperatorList,
|
|
||||||
isValidUrl, OPS, AnnotationType, stringToUTF8String,
|
|
||||||
AnnotationBorderStyleType, ColorSpace, AnnotationFlag, isInt */
|
|
||||||
|
|
||||||
'use strict';
|
'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 AnnotationFlag = sharedUtil.AnnotationFlag;
|
||||||
|
var AnnotationType = sharedUtil.AnnotationType;
|
||||||
|
var OPS = sharedUtil.OPS;
|
||||||
|
var Util = sharedUtil.Util;
|
||||||
|
var isArray = sharedUtil.isArray;
|
||||||
|
var isInt = sharedUtil.isInt;
|
||||||
|
var isValidUrl = sharedUtil.isValidUrl;
|
||||||
|
var stringToBytes = sharedUtil.stringToBytes;
|
||||||
|
var stringToPDFString = sharedUtil.stringToPDFString;
|
||||||
|
var stringToUTF8String = sharedUtil.stringToUTF8String;
|
||||||
|
var warn = sharedUtil.warn;
|
||||||
|
var Dict = corePrimitives.Dict;
|
||||||
|
var Name = corePrimitives.Name;
|
||||||
|
var isDict = corePrimitives.isDict;
|
||||||
|
var isName = corePrimitives.isName;
|
||||||
|
var Stream = coreStream.Stream;
|
||||||
|
var ColorSpace = coreColorSpace.ColorSpace;
|
||||||
|
var ObjectLoader = coreObj.ObjectLoader;
|
||||||
|
var OperatorList = coreEvaluator.OperatorList;
|
||||||
|
|
||||||
var DEFAULT_ICON_SIZE = 22; // px
|
var DEFAULT_ICON_SIZE = 22; // px
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -712,3 +747,8 @@ var LinkAnnotation = (function LinkAnnotationClosure() {
|
|||||||
|
|
||||||
return LinkAnnotation;
|
return LinkAnnotation;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.Annotation = Annotation;
|
||||||
|
exports.AnnotationBorderStyle = AnnotationBorderStyle;
|
||||||
|
exports.AnnotationFactory = AnnotationFactory;
|
||||||
|
}));
|
||||||
|
@ -15,6 +15,16 @@
|
|||||||
|
|
||||||
'use strict';
|
'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
|
||||||
@ -181,3 +191,6 @@ var ArithmeticDecoder = (function ArithmeticDecoderClosure() {
|
|||||||
|
|
||||||
return ArithmeticDecoder;
|
return ArithmeticDecoder;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.ArithmeticDecoder = ArithmeticDecoder;
|
||||||
|
}));
|
||||||
|
@ -12,10 +12,21 @@
|
|||||||
* 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 */
|
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function (root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
define('pdfjs/core/bidi', ['exports', 'pdfjs/shared/global'], factory);
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
factory(exports, require('../shared/global.js'));
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsCoreBidi = {}), root.pdfjsSharedGlobal);
|
||||||
|
}
|
||||||
|
}(this, function (exports, sharedGlobal) {
|
||||||
|
|
||||||
|
var PDFJS = sharedGlobal.PDFJS;
|
||||||
|
|
||||||
var bidi = PDFJS.bidi = (function bidiClosure() {
|
var bidi = PDFJS.bidi = (function bidiClosure() {
|
||||||
// Character types for symbols from 0000 to 00FF.
|
// Character types for symbols from 0000 to 00FF.
|
||||||
var baseTypes = [
|
var baseTypes = [
|
||||||
@ -421,3 +432,6 @@ var bidi = PDFJS.bidi = (function bidiClosure() {
|
|||||||
|
|
||||||
return bidi;
|
return bidi;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.bidi = bidi;
|
||||||
|
}));
|
||||||
|
@ -15,6 +15,16 @@
|
|||||||
|
|
||||||
'use strict';
|
'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',
|
||||||
@ -114,3 +124,8 @@ var ExpertSubsetCharset = [
|
|||||||
'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior',
|
'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior',
|
||||||
'periodinferior', 'commainferior'
|
'periodinferior', 'commainferior'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
exports.ISOAdobeCharset = ISOAdobeCharset;
|
||||||
|
exports.ExpertCharset = ExpertCharset;
|
||||||
|
exports.ExpertSubsetCharset = ExpertSubsetCharset;
|
||||||
|
}));
|
||||||
|
@ -12,11 +12,27 @@
|
|||||||
* 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 assert, MissingDataException, isInt, NetworkManager, Promise,
|
/* globals NetworkManager */
|
||||||
isEmptyObj, createPromiseCapability */
|
|
||||||
|
|
||||||
'use strict';
|
'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 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) {
|
||||||
this.bytes = new Uint8Array(length);
|
this.bytes = new Uint8Array(length);
|
||||||
@ -545,3 +561,7 @@ var ChunkedStreamManager = (function ChunkedStreamManagerClosure() {
|
|||||||
|
|
||||||
return ChunkedStreamManager;
|
return ChunkedStreamManager;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.ChunkedStream = ChunkedStream;
|
||||||
|
exports.ChunkedStreamManager = ChunkedStreamManager;
|
||||||
|
}));
|
||||||
|
@ -12,11 +12,37 @@
|
|||||||
* 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 Util, isString, isInt, warn, error, isCmd, isEOF, isName, Lexer,
|
/* globals PDFJS */
|
||||||
isStream, StringStream, PDFJS, assert */
|
|
||||||
|
|
||||||
'use strict';
|
'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 error = sharedUtil.error;
|
||||||
|
var isInt = sharedUtil.isInt;
|
||||||
|
var isString = sharedUtil.isString;
|
||||||
|
var warn = sharedUtil.warn;
|
||||||
|
var isName = corePrimitives.isName;
|
||||||
|
var isCmd = corePrimitives.isCmd;
|
||||||
|
var isStream = corePrimitives.isStream;
|
||||||
|
var StringStream = coreStream.StringStream;
|
||||||
|
var Lexer = coreParser.Lexer;
|
||||||
|
var isEOF = coreParser.isEOF;
|
||||||
|
|
||||||
var BUILT_IN_CMAPS = [
|
var BUILT_IN_CMAPS = [
|
||||||
// << Start unicode maps.
|
// << Start unicode maps.
|
||||||
'Adobe-GB1-UCS2',
|
'Adobe-GB1-UCS2',
|
||||||
@ -992,3 +1018,8 @@ var CMapFactory = (function CMapFactoryClosure() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.CMap = CMap;
|
||||||
|
exports.CMapFactory = CMapFactory;
|
||||||
|
exports.IdentityCMap = IdentityCMap;
|
||||||
|
}));
|
||||||
|
@ -12,11 +12,38 @@
|
|||||||
* 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 error, info, isArray, isDict, isName, isStream, isString,
|
|
||||||
PDFFunction, PDFImage, shadow, warn */
|
|
||||||
|
|
||||||
'use strict';
|
'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', 'pdfjs/core/stream'],
|
||||||
|
factory);
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
factory(exports, require('../shared/util.js'), require('./primitives.js'),
|
||||||
|
require('./function.js'), require('./stream.js'));
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsCoreColorSpace = {}), root.pdfjsSharedUtil,
|
||||||
|
root.pdfjsCorePrimitives, root.pdfjsCoreFunction, root.pdfjsCoreStream);
|
||||||
|
}
|
||||||
|
}(this, function (exports, sharedUtil, corePrimitives, coreFunction,
|
||||||
|
coreStream) {
|
||||||
|
|
||||||
|
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 coreImage; // see _setCoreImage below
|
||||||
|
var PDFImage; // = coreImage.PDFImage;
|
||||||
|
|
||||||
var ColorSpace = (function ColorSpaceClosure() {
|
var ColorSpace = (function ColorSpaceClosure() {
|
||||||
// Constructor should define this.numComps, this.defaultColor, this.name
|
// Constructor should define this.numComps, this.defaultColor, this.name
|
||||||
function ColorSpace() {
|
function ColorSpace() {
|
||||||
@ -1253,3 +1280,16 @@ var LabCS = (function LabCSClosure() {
|
|||||||
};
|
};
|
||||||
return LabCS;
|
return LabCS;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
// TODO refactor to remove dependency on image.js
|
||||||
|
function _setCoreImage(coreImage_) {
|
||||||
|
coreImage = coreImage_;
|
||||||
|
PDFImage = coreImage_.PDFImage;
|
||||||
|
}
|
||||||
|
exports._setCoreImage = _setCoreImage;
|
||||||
|
|
||||||
|
exports.ColorSpace = ColorSpace;
|
||||||
|
|
||||||
|
// TODO refactor to remove dependency on colorspace.js
|
||||||
|
coreStream._setCoreColorSpace(exports);
|
||||||
|
}));
|
||||||
|
@ -12,12 +12,34 @@
|
|||||||
* 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 bytesToString, DecryptStream, error, isInt, isName, Name,
|
|
||||||
PasswordException, PasswordResponses, stringToBytes, warn,
|
|
||||||
utf8StringToString */
|
|
||||||
|
|
||||||
'use strict';
|
'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 error = sharedUtil.error;
|
||||||
|
var isInt = sharedUtil.isInt;
|
||||||
|
var stringToBytes = sharedUtil.stringToBytes;
|
||||||
|
var utf8StringToString = sharedUtil.utf8StringToString;
|
||||||
|
var warn = sharedUtil.warn;
|
||||||
|
var Name = corePrimitives.Name;
|
||||||
|
var isName = corePrimitives.isName;
|
||||||
|
var DecryptStream = coreStream.DecryptStream;
|
||||||
|
|
||||||
var ARCFourCipher = (function ARCFourCipherClosure() {
|
var ARCFourCipher = (function ARCFourCipherClosure() {
|
||||||
function ARCFourCipher(key) {
|
function ARCFourCipher(key) {
|
||||||
this.a = 0;
|
this.a = 0;
|
||||||
@ -2049,3 +2071,15 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
|
|||||||
|
|
||||||
return CipherTransformFactory;
|
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;
|
||||||
|
}));
|
||||||
|
@ -12,15 +12,59 @@
|
|||||||
* 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 warn, Dict, isDict, shadow, isArray, Util, StreamsSequenceStream,
|
|
||||||
isStream, NullStream, ObjectLoader, PartialEvaluator, Promise,
|
|
||||||
OperatorList, Annotation, error, assert, XRef, isArrayBuffer, Stream,
|
|
||||||
isString, isName, info, Linearization, MissingDataException, Lexer,
|
|
||||||
Catalog, stringToPDFString, stringToBytes, calculateMD5,
|
|
||||||
AnnotationFactory */
|
|
||||||
|
|
||||||
'use strict';
|
'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 MissingDataException = sharedUtil.MissingDataException;
|
||||||
|
var Util = sharedUtil.Util;
|
||||||
|
var assert = sharedUtil.assert;
|
||||||
|
var error = sharedUtil.error;
|
||||||
|
var info = sharedUtil.info;
|
||||||
|
var isArray = sharedUtil.isArray;
|
||||||
|
var isArrayBuffer = sharedUtil.isArrayBuffer;
|
||||||
|
var isString = sharedUtil.isString;
|
||||||
|
var shadow = sharedUtil.shadow;
|
||||||
|
var stringToBytes = sharedUtil.stringToBytes;
|
||||||
|
var stringToPDFString = sharedUtil.stringToPDFString;
|
||||||
|
var warn = sharedUtil.warn;
|
||||||
|
var 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 Lexer = coreParser.Lexer;
|
||||||
|
var Linearization = coreParser.Linearization;
|
||||||
|
var calculateMD5 = coreCrypto.calculateMD5;
|
||||||
|
var OperatorList = coreEvaluator.OperatorList;
|
||||||
|
var PartialEvaluator = coreEvaluator.PartialEvaluator;
|
||||||
|
var Annotation = coreAnnotation.Annotation;
|
||||||
|
var AnnotationFactory = coreAnnotation.AnnotationFactory;
|
||||||
|
|
||||||
var Page = (function PageClosure() {
|
var Page = (function PageClosure() {
|
||||||
|
|
||||||
var LETTER_SIZE_MEDIABOX = [0, 0, 612, 792];
|
var LETTER_SIZE_MEDIABOX = [0, 0, 612, 792];
|
||||||
@ -478,7 +522,14 @@ var PDFDocument = (function PDFDocumentClosure() {
|
|||||||
},
|
},
|
||||||
setup: function PDFDocument_setup(recoveryMode) {
|
setup: function PDFDocument_setup(recoveryMode) {
|
||||||
this.xref.parse(recoveryMode);
|
this.xref.parse(recoveryMode);
|
||||||
this.catalog = new Catalog(this.pdfManager, this.xref);
|
var self = this;
|
||||||
|
var pageFactory = {
|
||||||
|
createPage: function (pageIndex, dict, ref, fontCache) {
|
||||||
|
return new Page(self.pdfManager, self.xref, pageIndex, dict, ref,
|
||||||
|
fontCache);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
this.catalog = new Catalog(this.pdfManager, this.xref, pageFactory);
|
||||||
},
|
},
|
||||||
get numPages() {
|
get numPages() {
|
||||||
var linearization = this.linearization;
|
var linearization = this.linearization;
|
||||||
@ -551,3 +602,7 @@ var PDFDocument = (function PDFDocumentClosure() {
|
|||||||
|
|
||||||
return PDFDocument;
|
return PDFDocument;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.Page = Page;
|
||||||
|
exports.PDFDocument = PDFDocument;
|
||||||
|
}));
|
@ -12,19 +12,85 @@
|
|||||||
* 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 assert, CMapFactory, ColorSpace, DecodeStream, Dict, Encodings,
|
/* globals PDFJS */
|
||||||
error, ErrorFont, Font, FONT_IDENTITY_MATRIX, fontCharsToUnicode,
|
|
||||||
FontFlags, ImageKind, info, isArray, isCmd, isDict, isEOF, isName,
|
|
||||||
isNum, isStream, isString, JpegStream, Lexer, Metrics, IdentityCMap,
|
|
||||||
MurmurHash3_64, Name, Parser, Pattern, PDFImage, PDFJS, serifFonts,
|
|
||||||
stdFontMap, symbolsFonts, getTilingPatternIR, warn, Util, Promise,
|
|
||||||
RefSetCache, isRef, TextRenderingMode, IdentityToUnicodeMap,
|
|
||||||
OPS, UNSUPPORTED_FEATURES, NormalizedUnicodes, IDENTITY_MATRIX,
|
|
||||||
reverseIfRtl, createPromiseCapability, ToUnicodeMap, getFontType,
|
|
||||||
isPDFFunction, PDFFunction */
|
|
||||||
|
|
||||||
'use strict';
|
'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'], 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'));
|
||||||
|
} 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);
|
||||||
|
}
|
||||||
|
}(this, function (exports, sharedUtil, corePrimitives, coreStream, coreParser,
|
||||||
|
coreImage, coreColorSpace, coreMurmurHash3, coreFonts,
|
||||||
|
coreFunction, corePattern, coreCMap, coreMetrics, coreBidi) {
|
||||||
|
|
||||||
|
var FONT_IDENTITY_MATRIX = sharedUtil.FONT_IDENTITY_MATRIX;
|
||||||
|
var IDENTITY_MATRIX = sharedUtil.IDENTITY_MATRIX;
|
||||||
|
var UNSUPPORTED_FEATURES = sharedUtil.UNSUPPORTED_FEATURES;
|
||||||
|
var ImageKind = sharedUtil.ImageKind;
|
||||||
|
var OPS = sharedUtil.OPS;
|
||||||
|
var TextRenderingMode = sharedUtil.TextRenderingMode;
|
||||||
|
var Util = sharedUtil.Util;
|
||||||
|
var assert = sharedUtil.assert;
|
||||||
|
var createPromiseCapability = sharedUtil.createPromiseCapability;
|
||||||
|
var error = sharedUtil.error;
|
||||||
|
var info = sharedUtil.info;
|
||||||
|
var isArray = sharedUtil.isArray;
|
||||||
|
var isNum = sharedUtil.isNum;
|
||||||
|
var isString = sharedUtil.isString;
|
||||||
|
var warn = sharedUtil.warn;
|
||||||
|
var Dict = corePrimitives.Dict;
|
||||||
|
var Name = corePrimitives.Name;
|
||||||
|
var isCmd = corePrimitives.isCmd;
|
||||||
|
var isDict = corePrimitives.isDict;
|
||||||
|
var isName = corePrimitives.isName;
|
||||||
|
var isRef = corePrimitives.isRef;
|
||||||
|
var isStream = corePrimitives.isStream;
|
||||||
|
var DecodeStream = coreStream.DecodeStream;
|
||||||
|
var JpegStream = coreStream.JpegStream;
|
||||||
|
var Lexer = coreParser.Lexer;
|
||||||
|
var Parser = coreParser.Parser;
|
||||||
|
var isEOF = coreParser.isEOF;
|
||||||
|
var PDFImage = coreImage.PDFImage;
|
||||||
|
var ColorSpace = coreColorSpace.ColorSpace;
|
||||||
|
var MurmurHash3_64 = coreMurmurHash3.MurmurHash3_64;
|
||||||
|
var Encodings = coreFonts.Encodings;
|
||||||
|
var ErrorFont = coreFonts.ErrorFont;
|
||||||
|
var FontFlags = coreFonts.FontFlags;
|
||||||
|
var Font = coreFonts.Font;
|
||||||
|
var IdentityToUnicodeMap = coreFonts.IdentityToUnicodeMap;
|
||||||
|
var NormalizedUnicodes = coreFonts.NormalizedUnicodes;
|
||||||
|
var ToUnicodeMap = coreFonts.ToUnicodeMap;
|
||||||
|
var getFontType = coreFonts.getFontType;
|
||||||
|
var reverseIfRtl = coreFonts.reverseIfRtl;
|
||||||
|
var serifFonts = coreFonts.serifFonts;
|
||||||
|
var symbolsFonts = coreFonts.symbolsFonts;
|
||||||
|
var stdFontMap = coreFonts.stdFontMap;
|
||||||
|
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 Metrics = coreMetrics.Metrics;
|
||||||
|
var bidi = coreBidi.bidi;
|
||||||
|
|
||||||
var PartialEvaluator = (function PartialEvaluatorClosure() {
|
var PartialEvaluator = (function PartialEvaluatorClosure() {
|
||||||
function PartialEvaluator(pdfManager, xref, handler, pageIndex,
|
function PartialEvaluator(pdfManager, xref, handler, pageIndex,
|
||||||
uniquePrefix, idCounters, fontCache) {
|
uniquePrefix, idCounters, fontCache) {
|
||||||
@ -2889,3 +2955,7 @@ var QueueOptimizer = (function QueueOptimizerClosure() {
|
|||||||
};
|
};
|
||||||
return QueueOptimizer;
|
return QueueOptimizer;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.OperatorList = OperatorList;
|
||||||
|
exports.PartialEvaluator = PartialEvaluator;
|
||||||
|
}));
|
||||||
|
@ -12,10 +12,30 @@
|
|||||||
* 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 error, bytesToString, Stream, GlyphsUnicode, CFFParser, Encodings,
|
|
||||||
Util */
|
|
||||||
|
|
||||||
'use strict';
|
'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'], factory);
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
factory(exports, require('../shared/util.js'), require('./stream.js'),
|
||||||
|
require('./glyphlist.js'));
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsCoreFontRenderer = {}), root.pdfjsSharedUtil,
|
||||||
|
root.pdfjsCoreStream, root.pdfjsCoreGlyphList);
|
||||||
|
}
|
||||||
|
}(this, function (exports, sharedUtil, coreStream, coreGlyphList) {
|
||||||
|
|
||||||
|
var Util = sharedUtil.Util;
|
||||||
|
var bytesToString = sharedUtil.bytesToString;
|
||||||
|
var error = sharedUtil.error;
|
||||||
|
var Stream = coreStream.Stream;
|
||||||
|
var GlyphsUnicode = coreGlyphList.GlyphsUnicode;
|
||||||
|
|
||||||
|
var coreFonts; // see _setCoreFonts below
|
||||||
|
var CFFParser; // = coreFonts.CFFParser;
|
||||||
|
var Encodings; // = coreFonts.Encodings;
|
||||||
|
|
||||||
var FontRendererFactory = (function FontRendererFactoryClosure() {
|
var FontRendererFactory = (function FontRendererFactoryClosure() {
|
||||||
function getLong(data, offset) {
|
function getLong(data, offset) {
|
||||||
@ -706,3 +726,15 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
// TODO refactor to remove cyclic dependency on fonts.js
|
||||||
|
function _setCoreFonts(coreFonts_) {
|
||||||
|
coreFonts = coreFonts_;
|
||||||
|
Encodings = coreFonts_.Encodings;
|
||||||
|
CFFParser = coreFonts_.CFFParser;
|
||||||
|
}
|
||||||
|
exports._setCoreFonts = _setCoreFonts;
|
||||||
|
|
||||||
|
exports.FontRendererFactory = FontRendererFactory;
|
||||||
|
}));
|
||||||
|
@ -12,14 +12,57 @@
|
|||||||
* 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 FONT_IDENTITY_MATRIX, FontType, warn, GlyphsUnicode, error, string32,
|
/* globals PDFJS */
|
||||||
readUint32, Stream, FontRendererFactory, shadow, stringToBytes,
|
|
||||||
bytesToString, info, assert, IdentityCMap, Name, CMapFactory, PDFJS,
|
|
||||||
isNum, Lexer, isArray, ISOAdobeCharset, ExpertCharset, isInt,
|
|
||||||
ExpertSubsetCharset, Util, DingbatsGlyphsUnicode */
|
|
||||||
|
|
||||||
'use strict';
|
'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/parser',
|
||||||
|
'pdfjs/core/cmap', 'pdfjs/core/glyphlist', 'pdfjs/core/charsets',
|
||||||
|
'pdfjs/core/font_renderer'], factory);
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
factory(exports, require('../shared/util.js'), require('./primitives.js'),
|
||||||
|
require('./stream.js'), require('./parser.js'), require('./cmap.js'),
|
||||||
|
require('./glyphlist.js'), require('./charsets.js'),
|
||||||
|
require('./font_renderer.js'));
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsCoreFonts = {}), root.pdfjsSharedUtil,
|
||||||
|
root.pdfjsCorePrimitives, root.pdfjsCoreStream, root.pdfjsCoreParser,
|
||||||
|
root.pdfjsCoreCMap, root.pdfjsCoreGlyphList, root.pdfjsCoreCharsets,
|
||||||
|
root.pdfjsCoreFontRenderer);
|
||||||
|
}
|
||||||
|
}(this, function (exports, sharedUtil, corePrimitives, coreStream, coreParser,
|
||||||
|
coreCMap, coreGlyphList, coreCharsets, coreFontRenderer) {
|
||||||
|
|
||||||
|
var FONT_IDENTITY_MATRIX = sharedUtil.FONT_IDENTITY_MATRIX;
|
||||||
|
var FontType = sharedUtil.FontType;
|
||||||
|
var Util = sharedUtil.Util;
|
||||||
|
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 stringToBytes = sharedUtil.stringToBytes;
|
||||||
|
var string32 = sharedUtil.string32;
|
||||||
|
var warn = sharedUtil.warn;
|
||||||
|
var Name = corePrimitives.Name;
|
||||||
|
var Stream = coreStream.Stream;
|
||||||
|
var Lexer = coreParser.Lexer;
|
||||||
|
var CMapFactory = coreCMap.CMapFactory;
|
||||||
|
var IdentityCMap = coreCMap.IdentityCMap;
|
||||||
|
var GlyphsUnicode = coreGlyphList.GlyphsUnicode;
|
||||||
|
var DingbatsGlyphsUnicode = coreGlyphList.DingbatsGlyphsUnicode;
|
||||||
|
var ISOAdobeCharset = coreCharsets.ISOAdobeCharset;
|
||||||
|
var ExpertCharset = coreCharsets.ExpertCharset;
|
||||||
|
var ExpertSubsetCharset = coreCharsets.ExpertSubsetCharset;
|
||||||
|
var FontRendererFactory = coreFontRenderer.FontRendererFactory;
|
||||||
|
|
||||||
// Unicode Private Use Area
|
// Unicode Private Use Area
|
||||||
var PRIVATE_USE_OFFSET_START = 0xE000;
|
var PRIVATE_USE_OFFSET_START = 0xE000;
|
||||||
var PRIVATE_USE_OFFSET_END = 0xF8FF;
|
var PRIVATE_USE_OFFSET_END = 0xF8FF;
|
||||||
@ -7354,9 +7397,13 @@ var CFFCompiler = (function CFFCompilerClosure() {
|
|||||||
return CFFCompiler;
|
return CFFCompiler;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
function _enableSeacAnalysis(enabled) {
|
||||||
|
exports.SEAC_ANALYSIS_ENABLED = SEAC_ANALYSIS_ENABLED = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
// Workaround for seac on Windows.
|
// Workaround for seac on Windows.
|
||||||
(function checkSeacSupport() {
|
(function checkSeacSupport() {
|
||||||
if (/Windows/.test(navigator.userAgent)) {
|
if (typeof navigator !== 'undefined' && /Windows/.test(navigator.userAgent)) {
|
||||||
SEAC_ANALYSIS_ENABLED = true;
|
SEAC_ANALYSIS_ENABLED = true;
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
@ -7365,7 +7412,32 @@ var CFFCompiler = (function CFFCompilerClosure() {
|
|||||||
// http://code.google.com/p/chromium/issues/detail?id=122465
|
// http://code.google.com/p/chromium/issues/detail?id=122465
|
||||||
// https://github.com/mozilla/pdf.js/issues/1689
|
// https://github.com/mozilla/pdf.js/issues/1689
|
||||||
(function checkChromeWindows() {
|
(function checkChromeWindows() {
|
||||||
if (/Windows.*Chrome/.test(navigator.userAgent)) {
|
if (typeof navigator !== 'undefined' &&
|
||||||
|
/Windows.*Chrome/.test(navigator.userAgent)) {
|
||||||
SKIP_PRIVATE_USE_RANGE_F000_TO_F01F = true;
|
SKIP_PRIVATE_USE_RANGE_F000_TO_F01F = true;
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.SEAC_ANALYSIS_ENABLED = SEAC_ANALYSIS_ENABLED;
|
||||||
|
exports.CFFCompiler = CFFCompiler;
|
||||||
|
exports.CFFIndex = CFFIndex;
|
||||||
|
exports.CFFParser = CFFParser;
|
||||||
|
exports.CFFStrings = CFFStrings;
|
||||||
|
exports.Encodings = Encodings;
|
||||||
|
exports.ErrorFont = ErrorFont;
|
||||||
|
exports.FontFlags = FontFlags;
|
||||||
|
exports.Font = Font;
|
||||||
|
exports.IdentityToUnicodeMap = IdentityToUnicodeMap;
|
||||||
|
exports.NormalizedUnicodes = NormalizedUnicodes;
|
||||||
|
exports.ToUnicodeMap = ToUnicodeMap;
|
||||||
|
exports.Type1Parser = Type1Parser;
|
||||||
|
exports.getFontType = getFontType;
|
||||||
|
exports.reverseIfRtl = reverseIfRtl;
|
||||||
|
exports.serifFonts = serifFonts;
|
||||||
|
exports.symbolsFonts = symbolsFonts;
|
||||||
|
exports.stdFontMap = stdFontMap;
|
||||||
|
exports._enableSeacAnalysis = _enableSeacAnalysis;
|
||||||
|
|
||||||
|
// TODO refactor to remove cyclic dependency on font_renderer.js
|
||||||
|
coreFontRenderer._setCoreFonts(exports);
|
||||||
|
}));
|
||||||
|
@ -12,11 +12,31 @@
|
|||||||
* 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 PostScriptLexer, PostScriptParser, error, info, isArray, isBool,
|
|
||||||
isDict, isStream */
|
|
||||||
|
|
||||||
'use strict';
|
'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;
|
||||||
|
|
||||||
var PDFFunction = (function PDFFunctionClosure() {
|
var PDFFunction = (function PDFFunctionClosure() {
|
||||||
var CONSTRUCT_SAMPLED = 0;
|
var CONSTRUCT_SAMPLED = 0;
|
||||||
var CONSTRUCT_INTERPOLATED = 2;
|
var CONSTRUCT_INTERPOLATED = 2;
|
||||||
@ -1131,3 +1151,9 @@ var PostScriptCompiler = (function PostScriptCompilerClosure() {
|
|||||||
|
|
||||||
return PostScriptCompiler;
|
return PostScriptCompiler;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.isPDFFunction = isPDFFunction;
|
||||||
|
exports.PDFFunction = PDFFunction;
|
||||||
|
exports.PostScriptEvaluator = PostScriptEvaluator;
|
||||||
|
exports.PostScriptCompiler = PostScriptCompiler;
|
||||||
|
}));
|
||||||
|
@ -15,6 +15,16 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function (root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
define('pdfjs/core/glyphlist', ['exports'], factory);
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
factory(exports);
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsCoreGlyphList = {}));
|
||||||
|
}
|
||||||
|
}(this, function (exports) {
|
||||||
|
|
||||||
var GlyphsUnicode = {
|
var GlyphsUnicode = {
|
||||||
A: 0x0041,
|
A: 0x0041,
|
||||||
AE: 0x00C6,
|
AE: 0x00C6,
|
||||||
@ -4427,3 +4437,7 @@ var DingbatsGlyphsUnicode = {
|
|||||||
a96: 0x2775, // 0xF8E4
|
a96: 0x2775, // 0xF8E4
|
||||||
'.notdef': 0x0000
|
'.notdef': 0x0000
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.GlyphsUnicode = GlyphsUnicode;
|
||||||
|
exports.DingbatsGlyphsUnicode = DingbatsGlyphsUnicode;
|
||||||
|
}));
|
||||||
|
@ -12,11 +12,40 @@
|
|||||||
* 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 assert, ColorSpace, DecodeStream, error, info, isArray, ImageKind,
|
|
||||||
isStream, JpegStream, JpxImage, Name, Promise, Stream, warn */
|
|
||||||
|
|
||||||
'use strict';
|
'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 Stream = coreStream.Stream;
|
||||||
|
var JpegStream = coreStream.JpegStream;
|
||||||
|
var JpxImage = coreJpx.JpxImage;
|
||||||
|
|
||||||
var PDFImage = (function PDFImageClosure() {
|
var PDFImage = (function PDFImageClosure() {
|
||||||
/**
|
/**
|
||||||
* Decode the image in the main thread if it supported. Resovles the promise
|
* Decode the image in the main thread if it supported. Resovles the promise
|
||||||
@ -672,3 +701,9 @@ var PDFImage = (function PDFImageClosure() {
|
|||||||
};
|
};
|
||||||
return PDFImage;
|
return PDFImage;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.PDFImage = PDFImage;
|
||||||
|
|
||||||
|
// TODO refactor to remove dependency on colorspace.js
|
||||||
|
coreColorSpace._setCoreImage(exports);
|
||||||
|
}));
|
||||||
|
@ -12,11 +12,30 @@
|
|||||||
* 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 ArithmeticDecoder, error, log2, readInt8, readUint16, readUint32,
|
|
||||||
shadow */
|
|
||||||
|
|
||||||
'use strict';
|
'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;
|
||||||
|
|
||||||
var Jbig2Image = (function Jbig2ImageClosure() {
|
var Jbig2Image = (function Jbig2ImageClosure() {
|
||||||
// Utility data structures
|
// Utility data structures
|
||||||
function ContextCache() {}
|
function ContextCache() {}
|
||||||
@ -1084,3 +1103,6 @@ var Jbig2Image = (function Jbig2ImageClosure() {
|
|||||||
|
|
||||||
return Jbig2Image;
|
return Jbig2Image;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.Jbig2Image = Jbig2Image;
|
||||||
|
}));
|
||||||
|
@ -14,6 +14,18 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
(function (root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
define('pdfjs/core/jpg', ['exports'], factory);
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
factory(exports);
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsCoreJpg = {}));
|
||||||
|
}
|
||||||
|
}(this, function (exports) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This code was forked from https://github.com/notmasteryet/jpgjs. The original
|
This code was forked from https://github.com/notmasteryet/jpgjs. The original
|
||||||
version was created by github user notmasteryet
|
version was created by github user notmasteryet
|
||||||
@ -27,8 +39,6 @@ version was created by github user notmasteryet
|
|||||||
(partners.adobe.com/public/developer/en/ps/sdk/5116.DCT_Filter.pdf)
|
(partners.adobe.com/public/developer/en/ps/sdk/5116.DCT_Filter.pdf)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var JpegImage = (function jpegImage() {
|
var JpegImage = (function jpegImage() {
|
||||||
var dctZigZag = new Uint8Array([
|
var dctZigZag = new Uint8Array([
|
||||||
0,
|
0,
|
||||||
@ -1033,3 +1043,6 @@ var JpegImage = (function jpegImage() {
|
|||||||
|
|
||||||
return constructor;
|
return constructor;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.JpegImage = JpegImage;
|
||||||
|
}));
|
||||||
|
@ -12,11 +12,29 @@
|
|||||||
* 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 ArithmeticDecoder, globalScope, log2, readUint16, readUint32,
|
|
||||||
info, warn */
|
|
||||||
|
|
||||||
'use strict';
|
'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 log2 = sharedUtil.log2;
|
||||||
|
var readUint16 = sharedUtil.readUint16;
|
||||||
|
var readUint32 = sharedUtil.readUint32;
|
||||||
|
var warn = sharedUtil.warn;
|
||||||
|
var ArithmeticDecoder = coreArithmeticDecoder.ArithmeticDecoder;
|
||||||
|
|
||||||
var JpxImage = (function JpxImageClosure() {
|
var JpxImage = (function JpxImageClosure() {
|
||||||
// Table E.1
|
// Table E.1
|
||||||
var SubbandsGainLog2 = {
|
var SubbandsGainLog2 = {
|
||||||
@ -2211,3 +2229,6 @@ var JpxImage = (function JpxImageClosure() {
|
|||||||
|
|
||||||
return JpxImage;
|
return JpxImage;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.JpxImage = JpxImage;
|
||||||
|
}));
|
||||||
|
@ -15,6 +15,16 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function (root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
define('pdfjs/core/metrics', ['exports'], factory);
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
factory(exports);
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsCoreMetrics = {}));
|
||||||
|
}
|
||||||
|
}(this, function (exports) {
|
||||||
|
|
||||||
// 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
|
||||||
// space unit corresponds to 1/1000th of text space unit.
|
// space unit corresponds to 1/1000th of text space unit.
|
||||||
@ -2956,3 +2966,6 @@ var Metrics = {
|
|||||||
'a191': 918
|
'a191': 918
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.Metrics = Metrics;
|
||||||
|
}));
|
||||||
|
@ -17,10 +17,21 @@
|
|||||||
* Based on https://code.google.com/p/smhasher/wiki/MurmurHash3.
|
* Based on https://code.google.com/p/smhasher/wiki/MurmurHash3.
|
||||||
* Hashes roughly 100 KB per millisecond on i7 3.4 GHz.
|
* Hashes roughly 100 KB per millisecond on i7 3.4 GHz.
|
||||||
*/
|
*/
|
||||||
/* globals Uint32ArrayView */
|
|
||||||
|
|
||||||
'use strict';
|
'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 Uint32ArrayView = sharedUtil.Uint32ArrayView;
|
||||||
|
|
||||||
var MurmurHash3_64 = (function MurmurHash3_64Closure (seed) {
|
var MurmurHash3_64 = (function MurmurHash3_64Closure (seed) {
|
||||||
// Workaround for missing math precison in JS.
|
// Workaround for missing math precison in JS.
|
||||||
var MASK_HIGH = 0xffff0000;
|
var MASK_HIGH = 0xffff0000;
|
||||||
@ -162,3 +173,6 @@ var MurmurHash3_64 = (function MurmurHash3_64Closure (seed) {
|
|||||||
|
|
||||||
return MurmurHash3_64;
|
return MurmurHash3_64;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.MurmurHash3_64 = MurmurHash3_64;
|
||||||
|
}));
|
||||||
|
367
src/core/obj.js
367
src/core/obj.js
@ -12,326 +12,56 @@
|
|||||||
* 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 assert, bytesToString, CipherTransformFactory, error, info,
|
|
||||||
InvalidPDFException, isArray, isCmd, isDict, isInt, isName, isRef,
|
|
||||||
isStream, Lexer, Page, Parser, Promise, shadow,
|
|
||||||
stringToPDFString, stringToUTF8String, warn, isString,
|
|
||||||
Promise, MissingDataException, XRefParseException, Stream,
|
|
||||||
ChunkedStream, createPromiseCapability */
|
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var Name = (function NameClosure() {
|
(function (root, factory) {
|
||||||
function Name(name) {
|
if (typeof define === 'function' && define.amd) {
|
||||||
this.name = name;
|
define('pdfjs/core/obj', ['exports', 'pdfjs/shared/util',
|
||||||
|
'pdfjs/core/primitives', 'pdfjs/core/crypto', 'pdfjs/core/parser',
|
||||||
|
'pdfjs/core/chunked_stream'], 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'));
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsCoreObj = {}), root.pdfjsSharedUtil,
|
||||||
|
root.pdfjsCorePrimitives, root.pdfjsCoreCrypto, root.pdfjsCoreParser,
|
||||||
|
root.pdfjsCoreChunkedStream);
|
||||||
}
|
}
|
||||||
|
}(this, function (exports, sharedUtil, corePrimitives, coreCrypto, coreParser,
|
||||||
|
coreChunkedStream) {
|
||||||
|
|
||||||
Name.prototype = {};
|
var InvalidPDFException = sharedUtil.InvalidPDFException;
|
||||||
|
var MissingDataException = sharedUtil.MissingDataException;
|
||||||
var nameCache = {};
|
var XRefParseException = sharedUtil.XRefParseException;
|
||||||
|
var assert = sharedUtil.assert;
|
||||||
Name.get = function Name_get(name) {
|
var bytesToString = sharedUtil.bytesToString;
|
||||||
var nameValue = nameCache[name];
|
var createPromiseCapability = sharedUtil.createPromiseCapability;
|
||||||
return (nameValue ? nameValue : (nameCache[name] = new Name(name)));
|
var error = sharedUtil.error;
|
||||||
};
|
var info = sharedUtil.info;
|
||||||
|
var isArray = sharedUtil.isArray;
|
||||||
return Name;
|
var isInt = sharedUtil.isInt;
|
||||||
})();
|
var isString = sharedUtil.isString;
|
||||||
|
var shadow = sharedUtil.shadow;
|
||||||
var Cmd = (function CmdClosure() {
|
var stringToPDFString = sharedUtil.stringToPDFString;
|
||||||
function Cmd(cmd) {
|
var stringToUTF8String = sharedUtil.stringToUTF8String;
|
||||||
this.cmd = cmd;
|
var warn = sharedUtil.warn;
|
||||||
}
|
var Ref = corePrimitives.Ref;
|
||||||
|
var RefSet = corePrimitives.RefSet;
|
||||||
Cmd.prototype = {};
|
var RefSetCache = corePrimitives.RefSetCache;
|
||||||
|
var isName = corePrimitives.isName;
|
||||||
var cmdCache = {};
|
var isCmd = corePrimitives.isCmd;
|
||||||
|
var isDict = corePrimitives.isDict;
|
||||||
Cmd.get = function Cmd_get(cmd) {
|
var isRef = corePrimitives.isRef;
|
||||||
var cmdValue = cmdCache[cmd];
|
var isStream = corePrimitives.isStream;
|
||||||
return (cmdValue ? cmdValue : (cmdCache[cmd] = new Cmd(cmd)));
|
var CipherTransformFactory = coreCrypto.CipherTransformFactory;
|
||||||
};
|
var Lexer = coreParser.Lexer;
|
||||||
|
var Parser = coreParser.Parser;
|
||||||
return Cmd;
|
var ChunkedStream = coreChunkedStream.ChunkedStream;
|
||||||
})();
|
|
||||||
|
|
||||||
var Dict = (function DictClosure() {
|
|
||||||
var nonSerializable = function nonSerializableClosure() {
|
|
||||||
return nonSerializable; // creating closure on some variable
|
|
||||||
};
|
|
||||||
|
|
||||||
var GETALL_DICTIONARY_TYPES_WHITELIST = {
|
|
||||||
'Background': true,
|
|
||||||
'ExtGState': true,
|
|
||||||
'Halftone': true,
|
|
||||||
'Layout': true,
|
|
||||||
'Mask': true,
|
|
||||||
'Pagination': true,
|
|
||||||
'Printing': true
|
|
||||||
};
|
|
||||||
|
|
||||||
function isRecursionAllowedFor(dict) {
|
|
||||||
if (!isName(dict.Type)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
var dictType = dict.Type.name;
|
|
||||||
return GETALL_DICTIONARY_TYPES_WHITELIST[dictType] === true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// xref is optional
|
|
||||||
function Dict(xref) {
|
|
||||||
// Map should only be used internally, use functions below to access.
|
|
||||||
this.map = Object.create(null);
|
|
||||||
this.xref = xref;
|
|
||||||
this.objId = null;
|
|
||||||
this.__nonSerializable__ = nonSerializable; // disable cloning of the Dict
|
|
||||||
}
|
|
||||||
|
|
||||||
Dict.prototype = {
|
|
||||||
assignXref: function Dict_assignXref(newXref) {
|
|
||||||
this.xref = newXref;
|
|
||||||
},
|
|
||||||
|
|
||||||
// automatically dereferences Ref objects
|
|
||||||
get: function Dict_get(key1, key2, key3) {
|
|
||||||
var value;
|
|
||||||
var xref = this.xref;
|
|
||||||
if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map ||
|
|
||||||
typeof key2 === 'undefined') {
|
|
||||||
return xref ? xref.fetchIfRef(value) : value;
|
|
||||||
}
|
|
||||||
if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map ||
|
|
||||||
typeof key3 === 'undefined') {
|
|
||||||
return xref ? xref.fetchIfRef(value) : value;
|
|
||||||
}
|
|
||||||
value = this.map[key3] || null;
|
|
||||||
return xref ? xref.fetchIfRef(value) : value;
|
|
||||||
},
|
|
||||||
|
|
||||||
// Same as get(), but returns a promise and uses fetchIfRefAsync().
|
|
||||||
getAsync: function Dict_getAsync(key1, key2, key3) {
|
|
||||||
var value;
|
|
||||||
var xref = this.xref;
|
|
||||||
if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map ||
|
|
||||||
typeof key2 === 'undefined') {
|
|
||||||
if (xref) {
|
|
||||||
return xref.fetchIfRefAsync(value);
|
|
||||||
}
|
|
||||||
return Promise.resolve(value);
|
|
||||||
}
|
|
||||||
if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map ||
|
|
||||||
typeof key3 === 'undefined') {
|
|
||||||
if (xref) {
|
|
||||||
return xref.fetchIfRefAsync(value);
|
|
||||||
}
|
|
||||||
return Promise.resolve(value);
|
|
||||||
}
|
|
||||||
value = this.map[key3] || null;
|
|
||||||
if (xref) {
|
|
||||||
return xref.fetchIfRefAsync(value);
|
|
||||||
}
|
|
||||||
return Promise.resolve(value);
|
|
||||||
},
|
|
||||||
|
|
||||||
// Same as get(), but dereferences all elements if the result is an Array.
|
|
||||||
getArray: function Dict_getArray(key1, key2, key3) {
|
|
||||||
var value = this.get(key1, key2, key3);
|
|
||||||
var xref = this.xref;
|
|
||||||
if (!isArray(value) || !xref) {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
value = value.slice(); // Ensure that we don't modify the Dict data.
|
|
||||||
for (var i = 0, ii = value.length; i < ii; i++) {
|
|
||||||
if (!isRef(value[i])) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
value[i] = xref.fetch(value[i]);
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
},
|
|
||||||
|
|
||||||
// no dereferencing
|
|
||||||
getRaw: function Dict_getRaw(key) {
|
|
||||||
return this.map[key];
|
|
||||||
},
|
|
||||||
|
|
||||||
// creates new map and dereferences all Refs
|
|
||||||
getAll: function Dict_getAll() {
|
|
||||||
var all = Object.create(null);
|
|
||||||
var queue = null;
|
|
||||||
var key, obj;
|
|
||||||
for (key in this.map) {
|
|
||||||
obj = this.get(key);
|
|
||||||
if (obj instanceof Dict) {
|
|
||||||
if (isRecursionAllowedFor(obj)) {
|
|
||||||
(queue || (queue = [])).push({target: all, key: key, obj: obj});
|
|
||||||
} else {
|
|
||||||
all[key] = this.getRaw(key);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
all[key] = obj;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!queue) {
|
|
||||||
return all;
|
|
||||||
}
|
|
||||||
|
|
||||||
// trying to take cyclic references into the account
|
|
||||||
var processed = Object.create(null);
|
|
||||||
while (queue.length > 0) {
|
|
||||||
var item = queue.shift();
|
|
||||||
var itemObj = item.obj;
|
|
||||||
var objId = itemObj.objId;
|
|
||||||
if (objId && objId in processed) {
|
|
||||||
item.target[item.key] = processed[objId];
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
var dereferenced = Object.create(null);
|
|
||||||
for (key in itemObj.map) {
|
|
||||||
obj = itemObj.get(key);
|
|
||||||
if (obj instanceof Dict) {
|
|
||||||
if (isRecursionAllowedFor(obj)) {
|
|
||||||
queue.push({target: dereferenced, key: key, obj: obj});
|
|
||||||
} else {
|
|
||||||
dereferenced[key] = itemObj.getRaw(key);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
dereferenced[key] = obj;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (objId) {
|
|
||||||
processed[objId] = dereferenced;
|
|
||||||
}
|
|
||||||
item.target[item.key] = dereferenced;
|
|
||||||
}
|
|
||||||
return all;
|
|
||||||
},
|
|
||||||
|
|
||||||
getKeys: function Dict_getKeys() {
|
|
||||||
return Object.keys(this.map);
|
|
||||||
},
|
|
||||||
|
|
||||||
set: function Dict_set(key, value) {
|
|
||||||
this.map[key] = value;
|
|
||||||
},
|
|
||||||
|
|
||||||
has: function Dict_has(key) {
|
|
||||||
return key in this.map;
|
|
||||||
},
|
|
||||||
|
|
||||||
forEach: function Dict_forEach(callback) {
|
|
||||||
for (var key in this.map) {
|
|
||||||
callback(key, this.get(key));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Dict.empty = new Dict(null);
|
|
||||||
|
|
||||||
Dict.merge = function Dict_merge(xref, dictArray) {
|
|
||||||
var mergedDict = new Dict(xref);
|
|
||||||
|
|
||||||
for (var i = 0, ii = dictArray.length; i < ii; i++) {
|
|
||||||
var dict = dictArray[i];
|
|
||||||
if (!isDict(dict)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
for (var keyName in dict.map) {
|
|
||||||
if (mergedDict.map[keyName]) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
mergedDict.map[keyName] = dict.map[keyName];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return mergedDict;
|
|
||||||
};
|
|
||||||
|
|
||||||
return Dict;
|
|
||||||
})();
|
|
||||||
|
|
||||||
var Ref = (function RefClosure() {
|
|
||||||
function Ref(num, gen) {
|
|
||||||
this.num = num;
|
|
||||||
this.gen = gen;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ref.prototype = {
|
|
||||||
toString: function Ref_toString() {
|
|
||||||
// This function is hot, so we make the string as compact as possible.
|
|
||||||
// |this.gen| is almost always zero, so we treat that case specially.
|
|
||||||
var str = this.num + 'R';
|
|
||||||
if (this.gen !== 0) {
|
|
||||||
str += this.gen;
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return Ref;
|
|
||||||
})();
|
|
||||||
|
|
||||||
// The reference is identified by number and generation.
|
|
||||||
// This structure stores only one instance of the reference.
|
|
||||||
var RefSet = (function RefSetClosure() {
|
|
||||||
function RefSet() {
|
|
||||||
this.dict = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
RefSet.prototype = {
|
|
||||||
has: function RefSet_has(ref) {
|
|
||||||
return ref.toString() in this.dict;
|
|
||||||
},
|
|
||||||
|
|
||||||
put: function RefSet_put(ref) {
|
|
||||||
this.dict[ref.toString()] = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
remove: function RefSet_remove(ref) {
|
|
||||||
delete this.dict[ref.toString()];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return RefSet;
|
|
||||||
})();
|
|
||||||
|
|
||||||
var RefSetCache = (function RefSetCacheClosure() {
|
|
||||||
function RefSetCache() {
|
|
||||||
this.dict = Object.create(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
RefSetCache.prototype = {
|
|
||||||
get: function RefSetCache_get(ref) {
|
|
||||||
return this.dict[ref.toString()];
|
|
||||||
},
|
|
||||||
|
|
||||||
has: function RefSetCache_has(ref) {
|
|
||||||
return ref.toString() in this.dict;
|
|
||||||
},
|
|
||||||
|
|
||||||
put: function RefSetCache_put(ref, obj) {
|
|
||||||
this.dict[ref.toString()] = obj;
|
|
||||||
},
|
|
||||||
|
|
||||||
putAlias: function RefSetCache_putAlias(ref, aliasRef) {
|
|
||||||
this.dict[ref.toString()] = this.get(aliasRef);
|
|
||||||
},
|
|
||||||
|
|
||||||
forEach: function RefSetCache_forEach(fn, thisArg) {
|
|
||||||
for (var i in this.dict) {
|
|
||||||
fn.call(thisArg, this.dict[i]);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
clear: function RefSetCache_clear() {
|
|
||||||
this.dict = Object.create(null);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return RefSetCache;
|
|
||||||
})();
|
|
||||||
|
|
||||||
var Catalog = (function CatalogClosure() {
|
var Catalog = (function CatalogClosure() {
|
||||||
function Catalog(pdfManager, xref) {
|
function Catalog(pdfManager, xref, pageFactory) {
|
||||||
this.pdfManager = pdfManager;
|
this.pdfManager = pdfManager;
|
||||||
this.xref = xref;
|
this.xref = xref;
|
||||||
this.catDict = xref.getCatalogObj();
|
this.catDict = xref.getCatalogObj();
|
||||||
@ -339,6 +69,8 @@ var Catalog = (function CatalogClosure() {
|
|||||||
assert(isDict(this.catDict),
|
assert(isDict(this.catDict),
|
||||||
'catalog object is not a dictionary');
|
'catalog object is not a dictionary');
|
||||||
|
|
||||||
|
// TODO refactor to move getPage() to the PDFDocument.
|
||||||
|
this.pageFactory = pageFactory;
|
||||||
this.pagePromises = [];
|
this.pagePromises = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -617,8 +349,8 @@ var Catalog = (function CatalogClosure() {
|
|||||||
function (a) {
|
function (a) {
|
||||||
var dict = a[0];
|
var dict = a[0];
|
||||||
var ref = a[1];
|
var ref = a[1];
|
||||||
return new Page(this.pdfManager, this.xref, pageIndex, dict, ref,
|
return this.pageFactory.createPage(pageIndex, dict, ref,
|
||||||
this.fontCache);
|
this.fontCache);
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -1749,3 +1481,8 @@ var ObjectLoader = (function() {
|
|||||||
|
|
||||||
return ObjectLoader;
|
return ObjectLoader;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.Catalog = Catalog;
|
||||||
|
exports.ObjectLoader = ObjectLoader;
|
||||||
|
exports.XRef = XRef;
|
||||||
|
}));
|
||||||
|
@ -12,14 +12,51 @@
|
|||||||
* 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 Ascii85Stream, AsciiHexStream, CCITTFaxStream, Cmd, Dict, error,
|
|
||||||
FlateStream, isArray, isCmd, isDict, isInt, isName, isNum, isRef,
|
|
||||||
isString, Jbig2Stream, JpegStream, JpxStream, LZWStream, Name,
|
|
||||||
NullStream, PredictorStream, Ref, RunLengthStream, warn, info,
|
|
||||||
StreamType, MissingDataException, assert */
|
|
||||||
|
|
||||||
'use strict';
|
'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 Cmd = corePrimitives.Cmd;
|
||||||
|
var Dict = corePrimitives.Dict;
|
||||||
|
var Name = corePrimitives.Name;
|
||||||
|
var Ref = corePrimitives.Ref;
|
||||||
|
var isCmd = corePrimitives.isCmd;
|
||||||
|
var isDict = corePrimitives.isDict;
|
||||||
|
var isName = corePrimitives.isName;
|
||||||
|
var Ascii85Stream = coreStream.Ascii85Stream;
|
||||||
|
var AsciiHexStream = coreStream.AsciiHexStream;
|
||||||
|
var CCITTFaxStream = coreStream.CCITTFaxStream;
|
||||||
|
var FlateStream = coreStream.FlateStream;
|
||||||
|
var Jbig2Stream = coreStream.Jbig2Stream;
|
||||||
|
var JpegStream = coreStream.JpegStream;
|
||||||
|
var JpxStream = coreStream.JpxStream;
|
||||||
|
var LZWStream = coreStream.LZWStream;
|
||||||
|
var NullStream = coreStream.NullStream;
|
||||||
|
var PredictorStream = coreStream.PredictorStream;
|
||||||
|
var RunLengthStream = coreStream.RunLengthStream;
|
||||||
|
|
||||||
var EOF = {};
|
var EOF = {};
|
||||||
|
|
||||||
function isEOF(v) {
|
function isEOF(v) {
|
||||||
@ -1074,3 +1111,13 @@ var Linearization = {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.EOF = EOF;
|
||||||
|
exports.Lexer = Lexer;
|
||||||
|
exports.Linearization = Linearization;
|
||||||
|
exports.Parser = Parser;
|
||||||
|
exports.isEOF = isEOF;
|
||||||
|
|
||||||
|
// TODO refactor to remove dependency on stream.js
|
||||||
|
coreStream._setCoreParser(exports);
|
||||||
|
}));
|
||||||
|
@ -12,11 +12,36 @@
|
|||||||
* 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 ColorSpace, PDFFunction, Util, error, warn, info, isArray, isStream,
|
|
||||||
assert, isPDFFunction, UNSUPPORTED_FEATURES, MissingDataException */
|
|
||||||
|
|
||||||
'use strict';
|
'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;
|
||||||
|
|
||||||
var ShadingType = {
|
var ShadingType = {
|
||||||
FUNCTION_BASED: 1,
|
FUNCTION_BASED: 1,
|
||||||
AXIAL: 2,
|
AXIAL: 2,
|
||||||
@ -805,3 +830,7 @@ function getTilingPatternIR(operatorList, dict, args) {
|
|||||||
paintType, tilingType
|
paintType, tilingType
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exports.Pattern = Pattern;
|
||||||
|
exports.getTilingPatternIR = getTilingPatternIR;
|
||||||
|
}));
|
||||||
|
@ -12,11 +12,33 @@
|
|||||||
* 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 NotImplementedException, MissingDataException, Promise, Stream,
|
|
||||||
PDFDocument, ChunkedStreamManager, createPromiseCapability, Util */
|
|
||||||
|
|
||||||
'use strict';
|
'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 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() {
|
||||||
throw new Error('Cannot initialize BaseManagerManager');
|
throw new Error('Cannot initialize BaseManagerManager');
|
||||||
@ -207,3 +229,7 @@ var NetworkPdfManager = (function NetworkPdfManagerClosure() {
|
|||||||
|
|
||||||
return NetworkPdfManager;
|
return NetworkPdfManager;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.LocalPdfManager = LocalPdfManager;
|
||||||
|
exports.NetworkPdfManager = NetworkPdfManager;
|
||||||
|
}));
|
||||||
|
378
src/core/primitives.js
Normal file
378
src/core/primitives.js
Normal file
@ -0,0 +1,378 @@
|
|||||||
|
/* Copyright 2012 Mozilla Foundation
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
/* 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;
|
||||||
|
|
||||||
|
var Name = (function NameClosure() {
|
||||||
|
function Name(name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
Name.prototype = {};
|
||||||
|
|
||||||
|
var nameCache = {};
|
||||||
|
|
||||||
|
Name.get = function Name_get(name) {
|
||||||
|
var nameValue = nameCache[name];
|
||||||
|
return (nameValue ? nameValue : (nameCache[name] = new Name(name)));
|
||||||
|
};
|
||||||
|
|
||||||
|
return Name;
|
||||||
|
})();
|
||||||
|
|
||||||
|
var Cmd = (function CmdClosure() {
|
||||||
|
function Cmd(cmd) {
|
||||||
|
this.cmd = cmd;
|
||||||
|
}
|
||||||
|
|
||||||
|
Cmd.prototype = {};
|
||||||
|
|
||||||
|
var cmdCache = {};
|
||||||
|
|
||||||
|
Cmd.get = function Cmd_get(cmd) {
|
||||||
|
var cmdValue = cmdCache[cmd];
|
||||||
|
return (cmdValue ? cmdValue : (cmdCache[cmd] = new Cmd(cmd)));
|
||||||
|
};
|
||||||
|
|
||||||
|
return Cmd;
|
||||||
|
})();
|
||||||
|
|
||||||
|
var Dict = (function DictClosure() {
|
||||||
|
var nonSerializable = function nonSerializableClosure() {
|
||||||
|
return nonSerializable; // creating closure on some variable
|
||||||
|
};
|
||||||
|
|
||||||
|
var GETALL_DICTIONARY_TYPES_WHITELIST = {
|
||||||
|
'Background': true,
|
||||||
|
'ExtGState': true,
|
||||||
|
'Halftone': true,
|
||||||
|
'Layout': true,
|
||||||
|
'Mask': true,
|
||||||
|
'Pagination': true,
|
||||||
|
'Printing': true
|
||||||
|
};
|
||||||
|
|
||||||
|
function isRecursionAllowedFor(dict) {
|
||||||
|
if (!isName(dict.Type)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
var dictType = dict.Type.name;
|
||||||
|
return GETALL_DICTIONARY_TYPES_WHITELIST[dictType] === true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// xref is optional
|
||||||
|
function Dict(xref) {
|
||||||
|
// Map should only be used internally, use functions below to access.
|
||||||
|
this.map = Object.create(null);
|
||||||
|
this.xref = xref;
|
||||||
|
this.objId = null;
|
||||||
|
this.__nonSerializable__ = nonSerializable; // disable cloning of the Dict
|
||||||
|
}
|
||||||
|
|
||||||
|
Dict.prototype = {
|
||||||
|
assignXref: function Dict_assignXref(newXref) {
|
||||||
|
this.xref = newXref;
|
||||||
|
},
|
||||||
|
|
||||||
|
// automatically dereferences Ref objects
|
||||||
|
get: function Dict_get(key1, key2, key3) {
|
||||||
|
var value;
|
||||||
|
var xref = this.xref;
|
||||||
|
if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map ||
|
||||||
|
typeof key2 === 'undefined') {
|
||||||
|
return xref ? xref.fetchIfRef(value) : value;
|
||||||
|
}
|
||||||
|
if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map ||
|
||||||
|
typeof key3 === 'undefined') {
|
||||||
|
return xref ? xref.fetchIfRef(value) : value;
|
||||||
|
}
|
||||||
|
value = this.map[key3] || null;
|
||||||
|
return xref ? xref.fetchIfRef(value) : value;
|
||||||
|
},
|
||||||
|
|
||||||
|
// Same as get(), but returns a promise and uses fetchIfRefAsync().
|
||||||
|
getAsync: function Dict_getAsync(key1, key2, key3) {
|
||||||
|
var value;
|
||||||
|
var xref = this.xref;
|
||||||
|
if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map ||
|
||||||
|
typeof key2 === 'undefined') {
|
||||||
|
if (xref) {
|
||||||
|
return xref.fetchIfRefAsync(value);
|
||||||
|
}
|
||||||
|
return Promise.resolve(value);
|
||||||
|
}
|
||||||
|
if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map ||
|
||||||
|
typeof key3 === 'undefined') {
|
||||||
|
if (xref) {
|
||||||
|
return xref.fetchIfRefAsync(value);
|
||||||
|
}
|
||||||
|
return Promise.resolve(value);
|
||||||
|
}
|
||||||
|
value = this.map[key3] || null;
|
||||||
|
if (xref) {
|
||||||
|
return xref.fetchIfRefAsync(value);
|
||||||
|
}
|
||||||
|
return Promise.resolve(value);
|
||||||
|
},
|
||||||
|
|
||||||
|
// Same as get(), but dereferences all elements if the result is an Array.
|
||||||
|
getArray: function Dict_getArray(key1, key2, key3) {
|
||||||
|
var value = this.get(key1, key2, key3);
|
||||||
|
var xref = this.xref;
|
||||||
|
if (!isArray(value) || !xref) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
value = value.slice(); // Ensure that we don't modify the Dict data.
|
||||||
|
for (var i = 0, ii = value.length; i < ii; i++) {
|
||||||
|
if (!isRef(value[i])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
value[i] = xref.fetch(value[i]);
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
},
|
||||||
|
|
||||||
|
// no dereferencing
|
||||||
|
getRaw: function Dict_getRaw(key) {
|
||||||
|
return this.map[key];
|
||||||
|
},
|
||||||
|
|
||||||
|
// creates new map and dereferences all Refs
|
||||||
|
getAll: function Dict_getAll() {
|
||||||
|
var all = Object.create(null);
|
||||||
|
var queue = null;
|
||||||
|
var key, obj;
|
||||||
|
for (key in this.map) {
|
||||||
|
obj = this.get(key);
|
||||||
|
if (obj instanceof Dict) {
|
||||||
|
if (isRecursionAllowedFor(obj)) {
|
||||||
|
(queue || (queue = [])).push({target: all, key: key, obj: obj});
|
||||||
|
} else {
|
||||||
|
all[key] = this.getRaw(key);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
all[key] = obj;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!queue) {
|
||||||
|
return all;
|
||||||
|
}
|
||||||
|
|
||||||
|
// trying to take cyclic references into the account
|
||||||
|
var processed = Object.create(null);
|
||||||
|
while (queue.length > 0) {
|
||||||
|
var item = queue.shift();
|
||||||
|
var itemObj = item.obj;
|
||||||
|
var objId = itemObj.objId;
|
||||||
|
if (objId && objId in processed) {
|
||||||
|
item.target[item.key] = processed[objId];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
var dereferenced = Object.create(null);
|
||||||
|
for (key in itemObj.map) {
|
||||||
|
obj = itemObj.get(key);
|
||||||
|
if (obj instanceof Dict) {
|
||||||
|
if (isRecursionAllowedFor(obj)) {
|
||||||
|
queue.push({target: dereferenced, key: key, obj: obj});
|
||||||
|
} else {
|
||||||
|
dereferenced[key] = itemObj.getRaw(key);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dereferenced[key] = obj;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (objId) {
|
||||||
|
processed[objId] = dereferenced;
|
||||||
|
}
|
||||||
|
item.target[item.key] = dereferenced;
|
||||||
|
}
|
||||||
|
return all;
|
||||||
|
},
|
||||||
|
|
||||||
|
getKeys: function Dict_getKeys() {
|
||||||
|
return Object.keys(this.map);
|
||||||
|
},
|
||||||
|
|
||||||
|
set: function Dict_set(key, value) {
|
||||||
|
this.map[key] = value;
|
||||||
|
},
|
||||||
|
|
||||||
|
has: function Dict_has(key) {
|
||||||
|
return key in this.map;
|
||||||
|
},
|
||||||
|
|
||||||
|
forEach: function Dict_forEach(callback) {
|
||||||
|
for (var key in this.map) {
|
||||||
|
callback(key, this.get(key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Dict.empty = new Dict(null);
|
||||||
|
|
||||||
|
Dict.merge = function Dict_merge(xref, dictArray) {
|
||||||
|
var mergedDict = new Dict(xref);
|
||||||
|
|
||||||
|
for (var i = 0, ii = dictArray.length; i < ii; i++) {
|
||||||
|
var dict = dictArray[i];
|
||||||
|
if (!isDict(dict)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
for (var keyName in dict.map) {
|
||||||
|
if (mergedDict.map[keyName]) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
mergedDict.map[keyName] = dict.map[keyName];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return mergedDict;
|
||||||
|
};
|
||||||
|
|
||||||
|
return Dict;
|
||||||
|
})();
|
||||||
|
|
||||||
|
var Ref = (function RefClosure() {
|
||||||
|
function Ref(num, gen) {
|
||||||
|
this.num = num;
|
||||||
|
this.gen = gen;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ref.prototype = {
|
||||||
|
toString: function Ref_toString() {
|
||||||
|
// This function is hot, so we make the string as compact as possible.
|
||||||
|
// |this.gen| is almost always zero, so we treat that case specially.
|
||||||
|
var str = this.num + 'R';
|
||||||
|
if (this.gen !== 0) {
|
||||||
|
str += this.gen;
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return Ref;
|
||||||
|
})();
|
||||||
|
|
||||||
|
// The reference is identified by number and generation.
|
||||||
|
// This structure stores only one instance of the reference.
|
||||||
|
var RefSet = (function RefSetClosure() {
|
||||||
|
function RefSet() {
|
||||||
|
this.dict = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
RefSet.prototype = {
|
||||||
|
has: function RefSet_has(ref) {
|
||||||
|
return ref.toString() in this.dict;
|
||||||
|
},
|
||||||
|
|
||||||
|
put: function RefSet_put(ref) {
|
||||||
|
this.dict[ref.toString()] = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
remove: function RefSet_remove(ref) {
|
||||||
|
delete this.dict[ref.toString()];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return RefSet;
|
||||||
|
})();
|
||||||
|
|
||||||
|
var RefSetCache = (function RefSetCacheClosure() {
|
||||||
|
function RefSetCache() {
|
||||||
|
this.dict = Object.create(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
RefSetCache.prototype = {
|
||||||
|
get: function RefSetCache_get(ref) {
|
||||||
|
return this.dict[ref.toString()];
|
||||||
|
},
|
||||||
|
|
||||||
|
has: function RefSetCache_has(ref) {
|
||||||
|
return ref.toString() in this.dict;
|
||||||
|
},
|
||||||
|
|
||||||
|
put: function RefSetCache_put(ref, obj) {
|
||||||
|
this.dict[ref.toString()] = obj;
|
||||||
|
},
|
||||||
|
|
||||||
|
putAlias: function RefSetCache_putAlias(ref, aliasRef) {
|
||||||
|
this.dict[ref.toString()] = this.get(aliasRef);
|
||||||
|
},
|
||||||
|
|
||||||
|
forEach: function RefSetCache_forEach(fn, thisArg) {
|
||||||
|
for (var i in this.dict) {
|
||||||
|
fn.call(thisArg, this.dict[i]);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
clear: function RefSetCache_clear() {
|
||||||
|
this.dict = Object.create(null);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return RefSetCache;
|
||||||
|
})();
|
||||||
|
|
||||||
|
function isName(v) {
|
||||||
|
return v instanceof Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isCmd(v, cmd) {
|
||||||
|
return v instanceof Cmd && (cmd === undefined || v.cmd === cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
function isDict(v, type) {
|
||||||
|
if (!(v instanceof Dict)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!type) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
var dictType = v.get('Type');
|
||||||
|
return isName(dictType) && dictType.name === type;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isRef(v) {
|
||||||
|
return v instanceof Ref;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isStream(v) {
|
||||||
|
return typeof v === 'object' && v !== null && v.getBytes !== undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.Cmd = Cmd;
|
||||||
|
exports.Dict = Dict;
|
||||||
|
exports.Name = Name;
|
||||||
|
exports.Ref = Ref;
|
||||||
|
exports.RefSet = RefSet;
|
||||||
|
exports.RefSetCache = RefSetCache;
|
||||||
|
exports.isCmd = isCmd;
|
||||||
|
exports.isDict = isDict;
|
||||||
|
exports.isName = isName;
|
||||||
|
exports.isRef = isRef;
|
||||||
|
exports.isStream = isStream;
|
||||||
|
}));
|
@ -12,10 +12,25 @@
|
|||||||
* 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 EOF, error, Lexer */
|
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function (root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
define('pdfjs/core/ps_parser', ['exports', 'pdfjs/shared/util',
|
||||||
|
'pdfjs/core/parser'], factory);
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
factory(exports, require('../shared/util.js'), require('./parser.js'));
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsCorePsParser = {}), root.pdfjsSharedUtil,
|
||||||
|
root.pdfjsCoreParser);
|
||||||
|
}
|
||||||
|
}(this, function (exports, sharedUtil, coreParser) {
|
||||||
|
|
||||||
|
var error = sharedUtil.error;
|
||||||
|
var EOF = coreParser.EOF;
|
||||||
|
var Lexer = coreParser.Lexer;
|
||||||
|
|
||||||
var PostScriptParser = (function PostScriptParserClosure() {
|
var PostScriptParser = (function PostScriptParserClosure() {
|
||||||
function PostScriptParser(lexer) {
|
function PostScriptParser(lexer) {
|
||||||
this.lexer = lexer;
|
this.lexer = lexer;
|
||||||
@ -218,3 +233,7 @@ var PostScriptLexer = (function PostScriptLexerClosure() {
|
|||||||
};
|
};
|
||||||
return PostScriptLexer;
|
return PostScriptLexer;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.PostScriptLexer = PostScriptLexer;
|
||||||
|
exports.PostScriptParser = PostScriptParser;
|
||||||
|
}));
|
||||||
|
@ -12,11 +12,44 @@
|
|||||||
* 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 bytesToString, ColorSpace, Dict, EOF, error, info, isArray,
|
/* globals PDFJS */
|
||||||
Jbig2Image, JpegImage, JpxImage, Lexer, PDFJS, shadow, Util, warn */
|
|
||||||
|
|
||||||
'use strict';
|
'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 isArray = sharedUtil.isArray;
|
||||||
|
var shadow = sharedUtil.shadow;
|
||||||
|
var warn = sharedUtil.warn;
|
||||||
|
var Dict = corePrimitives.Dict;
|
||||||
|
var Jbig2Image = coreJbig2.Jbig2Image;
|
||||||
|
var JpegImage = coreJpg.JpegImage;
|
||||||
|
var JpxImage = coreJpx.JpxImage;
|
||||||
|
|
||||||
|
var coreParser; // see _setCoreParser below
|
||||||
|
var EOF; // = coreParser.EOF;
|
||||||
|
var Lexer; // = coreParser.Lexer;
|
||||||
|
|
||||||
|
var coreColorSpace; // see _setCoreColorSpace below
|
||||||
|
var ColorSpace; // = coreColorSpace.ColorSpace;
|
||||||
|
|
||||||
var Stream = (function StreamClosure() {
|
var Stream = (function StreamClosure() {
|
||||||
function Stream(arrayBuffer, start, length, dict) {
|
function Stream(arrayBuffer, start, length, dict) {
|
||||||
this.bytes = (arrayBuffer instanceof Uint8Array ?
|
this.bytes = (arrayBuffer instanceof Uint8Array ?
|
||||||
@ -2464,3 +2497,36 @@ var NullStream = (function NullStreamClosure() {
|
|||||||
|
|
||||||
return NullStream;
|
return NullStream;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
// TODO refactor to remove dependency on parser.js
|
||||||
|
function _setCoreParser(coreParser_) {
|
||||||
|
coreParser = coreParser_;
|
||||||
|
EOF = coreParser_.EOF;
|
||||||
|
Lexer = coreParser_.Lexer;
|
||||||
|
}
|
||||||
|
exports._setCoreParser = _setCoreParser;
|
||||||
|
|
||||||
|
// TODO refactor to remove dependency on colorspace.js
|
||||||
|
function _setCoreColorSpace(coreColorSpace_) {
|
||||||
|
coreColorSpace = coreColorSpace_;
|
||||||
|
ColorSpace = coreColorSpace_.ColorSpace;
|
||||||
|
}
|
||||||
|
exports._setCoreColorSpace = _setCoreColorSpace;
|
||||||
|
|
||||||
|
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;
|
||||||
|
}));
|
||||||
|
@ -12,14 +12,46 @@
|
|||||||
* 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, createPromiseCapability, LocalPdfManager, NetworkPdfManager,
|
/* globals NetworkManager */
|
||||||
NetworkManager, isInt, MissingPDFException, UNSUPPORTED_FEATURES,
|
|
||||||
UnexpectedResponseException, PasswordException, Promise, warn,
|
|
||||||
PasswordResponses, InvalidPDFException, UnknownErrorException,
|
|
||||||
XRefParseException, Ref, info, globalScope, error, MessageHandler */
|
|
||||||
|
|
||||||
'use strict';
|
'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', 'pdfjs/shared/global'],
|
||||||
|
factory);
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
factory(exports, require('../shared/util.js'), require('./primitives.js'),
|
||||||
|
require('./pdf_manager.js'), require('../shared/global.js'));
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsCoreWorker = {}), root.pdfjsSharedUtil,
|
||||||
|
root.pdfjsCorePrimitives, root.pdfjsCorePdfManager,
|
||||||
|
root.pdfjsSharedGlobal);
|
||||||
|
}
|
||||||
|
}(this, function (exports, sharedUtil, corePrimitives, corePdfManager,
|
||||||
|
sharedGlobal) {
|
||||||
|
|
||||||
|
var UNSUPPORTED_FEATURES = sharedUtil.UNSUPPORTED_FEATURES;
|
||||||
|
var InvalidPDFException = sharedUtil.InvalidPDFException;
|
||||||
|
var MessageHandler = sharedUtil.MessageHandler;
|
||||||
|
var MissingPDFException = sharedUtil.MissingPDFException;
|
||||||
|
var UnexpectedResponseException = sharedUtil.UnexpectedResponseException;
|
||||||
|
var PasswordException = sharedUtil.PasswordException;
|
||||||
|
var PasswordResponses = sharedUtil.PasswordResponses;
|
||||||
|
var UnknownErrorException = sharedUtil.UnknownErrorException;
|
||||||
|
var XRefParseException = sharedUtil.XRefParseException;
|
||||||
|
var createPromiseCapability = sharedUtil.createPromiseCapability;
|
||||||
|
var error = sharedUtil.error;
|
||||||
|
var info = sharedUtil.info;
|
||||||
|
var isInt = sharedUtil.isInt;
|
||||||
|
var warn = sharedUtil.warn;
|
||||||
|
var Ref = corePrimitives.Ref;
|
||||||
|
var LocalPdfManager = corePdfManager.LocalPdfManager;
|
||||||
|
var NetworkPdfManager = corePdfManager.NetworkPdfManager;
|
||||||
|
var globalScope = sharedGlobal.globalScope;
|
||||||
|
var PDFJS = sharedGlobal.PDFJS;
|
||||||
|
|
||||||
var WorkerTask = (function WorkerTaskClosure() {
|
var WorkerTask = (function WorkerTaskClosure() {
|
||||||
function WorkerTask(name) {
|
function WorkerTask(name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@ -621,6 +653,10 @@ if (typeof window === 'undefined') {
|
|||||||
globalScope.console = workerConsole;
|
globalScope.console = workerConsole;
|
||||||
}
|
}
|
||||||
|
|
||||||
var handler = new MessageHandler('worker', 'main', this);
|
var handler = new MessageHandler('worker', 'main', self);
|
||||||
WorkerMessageHandler.setup(handler, this);
|
WorkerMessageHandler.setup(handler, self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exports.WorkerTask = WorkerTask;
|
||||||
|
exports.WorkerMessageHandler = WorkerMessageHandler;
|
||||||
|
}));
|
||||||
|
@ -12,11 +12,30 @@
|
|||||||
* 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, Util, AnnotationType, AnnotationBorderStyleType, warn,
|
/* globals PDFJS */
|
||||||
CustomStyle, isExternalLinkTargetSet, LinkTargetStringMap */
|
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function (root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
define('pdfjs/display/annotation_layer', ['exports', 'pdfjs/shared/util',
|
||||||
|
'pdfjs/display/dom_utils'], factory);
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
factory(exports, require('../shared/util.js'), require('./dom_utils.js'));
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsDisplayAnnotationLayer = {}), root.pdfjsSharedUtil,
|
||||||
|
root.pdfjsDisplayDOMUtils);
|
||||||
|
}
|
||||||
|
}(this, function (exports, sharedUtil, displayDOMUtils) {
|
||||||
|
|
||||||
|
var AnnotationBorderStyleType = sharedUtil.AnnotationBorderStyleType;
|
||||||
|
var AnnotationType = sharedUtil.AnnotationType;
|
||||||
|
var Util = sharedUtil.Util;
|
||||||
|
var isExternalLinkTargetSet = sharedUtil.Util;
|
||||||
|
var LinkTargetStringMap = sharedUtil.LinkTargetStringMap;
|
||||||
|
var warn = sharedUtil.warn;
|
||||||
|
var CustomStyle = displayDOMUtils.CustomStyle;
|
||||||
|
|
||||||
var ANNOT_MIN_SIZE = 10; // px
|
var ANNOT_MIN_SIZE = 10; // px
|
||||||
|
|
||||||
var AnnotationLayer = (function AnnotationLayerClosure() {
|
var AnnotationLayer = (function AnnotationLayerClosure() {
|
||||||
@ -354,5 +373,7 @@ var AnnotationLayer = (function AnnotationLayerClosure() {
|
|||||||
update: update
|
update: update
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
PDFJS.AnnotationLayer = AnnotationLayer;
|
PDFJS.AnnotationLayer = AnnotationLayer;
|
||||||
|
|
||||||
|
exports.AnnotationLayer = AnnotationLayer;
|
||||||
|
}));
|
||||||
|
@ -12,15 +12,50 @@
|
|||||||
* 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, isArrayBuffer, error, combineUrl, createPromiseCapability,
|
|
||||||
StatTimer, globalScope, MessageHandler, info, FontLoader, Util, warn,
|
|
||||||
Promise, PasswordResponses, PasswordException, InvalidPDFException,
|
|
||||||
MissingPDFException, UnknownErrorException, FontFaceObject,
|
|
||||||
loadJpegStream, createScratchCanvas, CanvasGraphics, stringToBytes,
|
|
||||||
UnexpectedResponseException, deprecated */
|
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function (root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
define('pdfjs/display/api', ['exports', 'pdfjs/shared/util',
|
||||||
|
'pdfjs/display/font_loader', 'pdfjs/display/canvas',
|
||||||
|
'pdfjs/shared/global'], factory);
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
factory(exports, require('../shared/util.js'), require('./font_loader.js'),
|
||||||
|
require('./canvas.js'), require('../shared/global.js'));
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsDisplayAPI = {}), root.pdfjsSharedUtil,
|
||||||
|
root.pdfjsDisplayFontLoader, root.pdfjsDisplayCanvas,
|
||||||
|
root.pdfjsSharedGlobal);
|
||||||
|
}
|
||||||
|
}(this, function (exports, sharedUtil, displayFontLoader, displayCanvas,
|
||||||
|
sharedGlobal) {
|
||||||
|
|
||||||
|
var InvalidPDFException = sharedUtil.InvalidPDFException;
|
||||||
|
var MessageHandler = sharedUtil.MessageHandler;
|
||||||
|
var MissingPDFException = sharedUtil.MissingPDFException;
|
||||||
|
var PasswordResponses = sharedUtil.PasswordResponses;
|
||||||
|
var PasswordException = sharedUtil.PasswordException;
|
||||||
|
var StatTimer = sharedUtil.StatTimer;
|
||||||
|
var UnexpectedResponseException = sharedUtil.UnexpectedResponseException;
|
||||||
|
var UnknownErrorException = sharedUtil.UnknownErrorException;
|
||||||
|
var Util = sharedUtil.Util;
|
||||||
|
var createPromiseCapability = sharedUtil.createPromiseCapability;
|
||||||
|
var combineUrl = sharedUtil.combineUrl;
|
||||||
|
var error = sharedUtil.error;
|
||||||
|
var deprecated = sharedUtil.deprecated;
|
||||||
|
var info = sharedUtil.info;
|
||||||
|
var isArrayBuffer = sharedUtil.isArrayBuffer;
|
||||||
|
var loadJpegStream = sharedUtil.loadJpegStream;
|
||||||
|
var stringToBytes = sharedUtil.stringToBytes;
|
||||||
|
var warn = sharedUtil.warn;
|
||||||
|
var FontFaceObject = displayFontLoader.FontFaceObject;
|
||||||
|
var FontLoader = displayFontLoader.FontLoader;
|
||||||
|
var CanvasGraphics = displayCanvas.CanvasGraphics;
|
||||||
|
var createScratchCanvas = displayCanvas.createScratchCanvas;
|
||||||
|
var PDFJS = sharedGlobal.PDFJS;
|
||||||
|
var globalScope = sharedGlobal.globalScope;
|
||||||
|
|
||||||
var DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536
|
var DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2036,3 +2071,9 @@ PDFJS.UnsupportedManager = (function UnsupportedManagerClosure() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.getDocument = PDFJS.getDocument;
|
||||||
|
exports.PDFDataRangeTransport = PDFDataRangeTransport;
|
||||||
|
exports.PDFDocumentProxy = PDFDocumentProxy;
|
||||||
|
exports.PDFPageProxy = PDFPageProxy;
|
||||||
|
}));
|
||||||
|
@ -12,13 +12,41 @@
|
|||||||
* 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 IDENTITY_MATRIX, FONT_IDENTITY_MATRIX, TextRenderingMode, ImageData,
|
/* globals PDFJS, ImageData */
|
||||||
ImageKind, PDFJS, Uint32ArrayView, error, WebGLUtils, OPS, warn,
|
|
||||||
shadow, isNum, Util, TilingPattern, getShadingPatternFromIR, isArray,
|
|
||||||
info, assert */
|
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function (root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
define('pdfjs/display/canvas', ['exports', 'pdfjs/shared/util',
|
||||||
|
'pdfjs/display/pattern_helper', 'pdfjs/display/webgl'], factory);
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
factory(exports, require('../shared/util.js'),
|
||||||
|
require('./pattern_helper.js'), require('./webgl.js'));
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsDisplayCanvas = {}), root.pdfjsSharedUtil,
|
||||||
|
root.pdfjsDisplayPatternHelper, root.pdfjsDisplayWebGL);
|
||||||
|
}
|
||||||
|
}(this, function (exports, sharedUtil, displayPatternHelper, displayWebGL) {
|
||||||
|
|
||||||
|
var FONT_IDENTITY_MATRIX = sharedUtil.FONT_IDENTITY_MATRIX;
|
||||||
|
var IDENTITY_MATRIX = sharedUtil.IDENTITY_MATRIX;
|
||||||
|
var ImageKind = sharedUtil.ImageKind;
|
||||||
|
var OPS = sharedUtil.OPS;
|
||||||
|
var TextRenderingMode = sharedUtil.TextRenderingMode;
|
||||||
|
var Uint32ArrayView = sharedUtil.Uint32ArrayView;
|
||||||
|
var Util = sharedUtil.Util;
|
||||||
|
var assert = sharedUtil.assert;
|
||||||
|
var info = sharedUtil.info;
|
||||||
|
var isNum = sharedUtil.isNum;
|
||||||
|
var isArray = sharedUtil.isArray;
|
||||||
|
var error = sharedUtil.error;
|
||||||
|
var shadow = sharedUtil.shadow;
|
||||||
|
var warn = sharedUtil.warn;
|
||||||
|
var TilingPattern = displayPatternHelper.TilingPattern;
|
||||||
|
var getShadingPatternFromIR = displayPatternHelper.getShadingPatternFromIR;
|
||||||
|
var WebGLUtils = displayWebGL.WebGLUtils;
|
||||||
|
|
||||||
// <canvas> contexts store most of the state we need natively.
|
// <canvas> contexts store most of the state we need natively.
|
||||||
// However, PDF needs a bit more state, which we store here.
|
// However, PDF needs a bit more state, which we store here.
|
||||||
|
|
||||||
@ -1580,8 +1608,14 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||||||
var color = IR[1];
|
var color = IR[1];
|
||||||
var baseTransform = this.baseTransform ||
|
var baseTransform = this.baseTransform ||
|
||||||
this.ctx.mozCurrentTransform.slice();
|
this.ctx.mozCurrentTransform.slice();
|
||||||
pattern = new TilingPattern(IR, color, this.ctx, this.objs,
|
var self = this;
|
||||||
this.commonObjs, baseTransform);
|
var canvasGraphicsFactory = {
|
||||||
|
createCanvasGraphics: function (ctx) {
|
||||||
|
return new CanvasGraphics(ctx, self.commonObjs, self.objs);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
pattern = new TilingPattern(IR, color, this.ctx, canvasGraphicsFactory,
|
||||||
|
baseTransform);
|
||||||
} else {
|
} else {
|
||||||
pattern = getShadingPatternFromIR(IR);
|
pattern = getShadingPatternFromIR(IR);
|
||||||
}
|
}
|
||||||
@ -2181,3 +2215,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||||||
|
|
||||||
return CanvasGraphics;
|
return CanvasGraphics;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.CanvasGraphics = CanvasGraphics;
|
||||||
|
exports.createScratchCanvas = createScratchCanvas;
|
||||||
|
}));
|
||||||
|
@ -12,10 +12,22 @@
|
|||||||
* 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 */
|
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function (root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
define('pdfjs/display/dom_utils', ['exports', 'pdfjs/shared/global'],
|
||||||
|
factory);
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
factory(exports, require('../shared/global.js'));
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsDisplayDOMUtils = {}), root.pdfjsSharedGlobal);
|
||||||
|
}
|
||||||
|
}(this, function (exports, sharedGlobal) {
|
||||||
|
|
||||||
|
var PDFJS = sharedGlobal.PDFJS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optimised CSS custom property getter/setter.
|
* Optimised CSS custom property getter/setter.
|
||||||
* @class
|
* @class
|
||||||
@ -71,3 +83,6 @@ var CustomStyle = (function CustomStyleClosure() {
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
PDFJS.CustomStyle = CustomStyle;
|
PDFJS.CustomStyle = CustomStyle;
|
||||||
|
|
||||||
|
exports.CustomStyle = CustomStyle;
|
||||||
|
}));
|
||||||
|
@ -12,11 +12,33 @@
|
|||||||
* 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, shadow, isWorker, assert, warn, bytesToString, string32,
|
/* globals FontFace */
|
||||||
globalScope, FontFace, Promise */
|
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function (root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
define('pdfjs/display/font_loader', ['exports', 'pdfjs/shared/util',
|
||||||
|
'pdfjs/shared/global'], factory);
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
factory(exports, require('../shared/util.js'),
|
||||||
|
require('../shared/global.js'));
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsDisplayFontLoader = {}), root.pdfjsSharedUtil,
|
||||||
|
root.pdfjsSharedGlobal);
|
||||||
|
}
|
||||||
|
}(this, function (exports, sharedUtil, sharedGlobal) {
|
||||||
|
|
||||||
|
var assert = sharedUtil.assert;
|
||||||
|
var bytesToString = sharedUtil.bytesToString;
|
||||||
|
var string32 = sharedUtil.string32;
|
||||||
|
var shadow = sharedUtil.shadow;
|
||||||
|
var warn = sharedUtil.warn;
|
||||||
|
|
||||||
|
var PDFJS = sharedGlobal.PDFJS;
|
||||||
|
var globalScope = sharedGlobal.globalScope;
|
||||||
|
var isWorker = sharedGlobal.isWorker;
|
||||||
|
|
||||||
function FontLoader(docId) {
|
function FontLoader(docId) {
|
||||||
this.docId = docId;
|
this.docId = docId;
|
||||||
this.styleElement = null;
|
this.styleElement = null;
|
||||||
@ -430,3 +452,7 @@ var FontFaceObject = (function FontFaceObjectClosure() {
|
|||||||
};
|
};
|
||||||
return FontFaceObject;
|
return FontFaceObject;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.FontFaceObject = FontFaceObject;
|
||||||
|
exports.FontLoader = FontLoader;
|
||||||
|
}));
|
||||||
|
@ -12,10 +12,22 @@
|
|||||||
* 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 Document, error, PDFJS */
|
/* globals PDFJS, Document */
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function (root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
define('pdfjs/display/metadata', ['exports', 'pdfjs/shared/util'], factory);
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
factory(exports, require('../shared/util.js'));
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsDisplayMetadata = {}), root.pdfjsSharedUtil);
|
||||||
|
}
|
||||||
|
}(this, function (exports, sharedUtil) {
|
||||||
|
|
||||||
|
var error = sharedUtil.error;
|
||||||
|
|
||||||
var Metadata = PDFJS.Metadata = (function MetadataClosure() {
|
var Metadata = PDFJS.Metadata = (function MetadataClosure() {
|
||||||
function fixMetadata(meta) {
|
function fixMetadata(meta) {
|
||||||
return meta.replace(/>\\376\\377([^<]+)/g, function(all, codes) {
|
return meta.replace(/>\\376\\377([^<]+)/g, function(all, codes) {
|
||||||
@ -95,3 +107,6 @@ var Metadata = PDFJS.Metadata = (function MetadataClosure() {
|
|||||||
|
|
||||||
return Metadata;
|
return Metadata;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.Metadata = Metadata;
|
||||||
|
}));
|
||||||
|
@ -12,11 +12,27 @@
|
|||||||
* 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 CanvasGraphics, CachedCanvases, ColorSpace, Util, error, info,
|
|
||||||
isArray, makeCssRgb, WebGLUtils */
|
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function (root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
define('pdfjs/display/pattern_helper', ['exports', 'pdfjs/shared/util',
|
||||||
|
'pdfjs/display/webgl'], factory);
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
factory(exports, require('../shared/util.js'), require('./webgl.js'));
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsDisplayPatternHelper = {}), root.pdfjsSharedUtil,
|
||||||
|
root.pdfjsDisplayWebGL);
|
||||||
|
}
|
||||||
|
}(this, function (exports, sharedUtil, displayWebGL) {
|
||||||
|
|
||||||
|
var Util = sharedUtil.Util;
|
||||||
|
var info = sharedUtil.info;
|
||||||
|
var isArray = sharedUtil.isArray;
|
||||||
|
var error = sharedUtil.error;
|
||||||
|
var WebGLUtils = displayWebGL.WebGLUtils;
|
||||||
|
|
||||||
var ShadingIRs = {};
|
var ShadingIRs = {};
|
||||||
|
|
||||||
ShadingIRs.RadialAxial = {
|
ShadingIRs.RadialAxial = {
|
||||||
@ -289,7 +305,7 @@ var TilingPattern = (function TilingPatternClosure() {
|
|||||||
|
|
||||||
var MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough
|
var MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough
|
||||||
|
|
||||||
function TilingPattern(IR, color, ctx, objs, commonObjs, baseTransform) {
|
function TilingPattern(IR, color, ctx, canvasGraphicsFactory, baseTransform) {
|
||||||
this.operatorList = IR[2];
|
this.operatorList = IR[2];
|
||||||
this.matrix = IR[3] || [1, 0, 0, 1, 0, 0];
|
this.matrix = IR[3] || [1, 0, 0, 1, 0, 0];
|
||||||
this.bbox = IR[4];
|
this.bbox = IR[4];
|
||||||
@ -298,8 +314,7 @@ var TilingPattern = (function TilingPatternClosure() {
|
|||||||
this.paintType = IR[7];
|
this.paintType = IR[7];
|
||||||
this.tilingType = IR[8];
|
this.tilingType = IR[8];
|
||||||
this.color = color;
|
this.color = color;
|
||||||
this.objs = objs;
|
this.canvasGraphicsFactory = canvasGraphicsFactory;
|
||||||
this.commonObjs = commonObjs;
|
|
||||||
this.baseTransform = baseTransform;
|
this.baseTransform = baseTransform;
|
||||||
this.type = 'Pattern';
|
this.type = 'Pattern';
|
||||||
this.ctx = ctx;
|
this.ctx = ctx;
|
||||||
@ -314,8 +329,7 @@ var TilingPattern = (function TilingPatternClosure() {
|
|||||||
var paintType = this.paintType;
|
var paintType = this.paintType;
|
||||||
var tilingType = this.tilingType;
|
var tilingType = this.tilingType;
|
||||||
var color = this.color;
|
var color = this.color;
|
||||||
var objs = this.objs;
|
var canvasGraphicsFactory = this.canvasGraphicsFactory;
|
||||||
var commonObjs = this.commonObjs;
|
|
||||||
|
|
||||||
info('TilingType: ' + tilingType);
|
info('TilingType: ' + tilingType);
|
||||||
|
|
||||||
@ -348,7 +362,7 @@ var TilingPattern = (function TilingPatternClosure() {
|
|||||||
var tmpCanvas = owner.cachedCanvases.getCanvas('pattern',
|
var tmpCanvas = owner.cachedCanvases.getCanvas('pattern',
|
||||||
width, height, true);
|
width, height, true);
|
||||||
var tmpCtx = tmpCanvas.context;
|
var tmpCtx = tmpCanvas.context;
|
||||||
var graphics = new CanvasGraphics(tmpCtx, commonObjs, objs);
|
var graphics = canvasGraphicsFactory.createCanvasGraphics(tmpCtx);
|
||||||
graphics.groupLevel = owner.groupLevel;
|
graphics.groupLevel = owner.groupLevel;
|
||||||
|
|
||||||
this.setFillAndStrokeStyleToContext(tmpCtx, paintType, color);
|
this.setFillAndStrokeStyleToContext(tmpCtx, paintType, color);
|
||||||
@ -423,3 +437,7 @@ var TilingPattern = (function TilingPatternClosure() {
|
|||||||
|
|
||||||
return TilingPattern;
|
return TilingPattern;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.getShadingPatternFromIR = getShadingPatternFromIR;
|
||||||
|
exports.TilingPattern = TilingPattern;
|
||||||
|
}));
|
||||||
|
@ -12,12 +12,30 @@
|
|||||||
* 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, FONT_IDENTITY_MATRIX, IDENTITY_MATRIX, isArray,
|
/* globals PDFJS */
|
||||||
isNum, OPS, Promise, Util, warn, ImageKind, PDFJS */
|
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function (root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
define('pdfjs/display/svg', ['exports', 'pdfjs/shared/util'], factory);
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
factory(exports, require('../shared/util.js'));
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsDisplaySVG = {}), root.pdfjsSharedUtil);
|
||||||
|
}
|
||||||
|
}(this, function (exports, sharedUtil) {
|
||||||
//#if (GENERIC || SINGLE_FILE)
|
//#if (GENERIC || SINGLE_FILE)
|
||||||
|
|
||||||
|
var FONT_IDENTITY_MATRIX = sharedUtil.FONT_IDENTITY_MATRIX;
|
||||||
|
var IDENTITY_MATRIX = sharedUtil.IDENTITY_MATRIX;
|
||||||
|
var ImageKind = sharedUtil.ImageKind;
|
||||||
|
var OPS = sharedUtil.OPS;
|
||||||
|
var Util = sharedUtil.Util;
|
||||||
|
var isNum = sharedUtil.isNum;
|
||||||
|
var isArray = sharedUtil.isArray;
|
||||||
|
var warn = sharedUtil.warn;
|
||||||
|
|
||||||
var SVG_DEFAULTS = {
|
var SVG_DEFAULTS = {
|
||||||
fontStyle: 'normal',
|
fontStyle: 'normal',
|
||||||
fontWeight: 'normal',
|
fontWeight: 'normal',
|
||||||
@ -1189,4 +1207,7 @@ var SVGGraphics = (function SVGGraphicsClosure() {
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
PDFJS.SVGGraphics = SVGGraphics;
|
PDFJS.SVGGraphics = SVGGraphics;
|
||||||
|
|
||||||
|
exports.SVGGraphics = SVGGraphics;
|
||||||
//#endif
|
//#endif
|
||||||
|
}));
|
||||||
|
@ -12,10 +12,23 @@
|
|||||||
* 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, createPromiseCapability */
|
/* globals PDFJS */
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function (root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
define('pdfjs/display/text_layer', ['exports', 'pdfjs/shared/util'],
|
||||||
|
factory);
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
factory(exports, require('../shared/util.js'));
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsDisplayTextLayer = {}), root.pdfjsSharedUtil);
|
||||||
|
}
|
||||||
|
}(this, function (exports, sharedUtil) {
|
||||||
|
|
||||||
|
var createPromiseCapability = sharedUtil.createPromiseCapability;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Text layer render parameters.
|
* Text layer render parameters.
|
||||||
*
|
*
|
||||||
@ -235,3 +248,6 @@ var renderTextLayer = (function renderTextLayerClosure() {
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
PDFJS.renderTextLayer = renderTextLayer;
|
PDFJS.renderTextLayer = renderTextLayer;
|
||||||
|
|
||||||
|
exports.renderTextLayer = renderTextLayer;
|
||||||
|
}));
|
||||||
|
@ -12,11 +12,23 @@
|
|||||||
* 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, shadow */
|
/* globals PDFJS */
|
||||||
/* jshint -W043 */
|
/* jshint -W043 */
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function (root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
define('pdfjs/display/webgl', ['exports', 'pdfjs/shared/util'], factory);
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
factory(exports, require('../shared/util.js'));
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsDisplayWebGL = {}), root.pdfjsSharedUtil);
|
||||||
|
}
|
||||||
|
}(this, function (exports, sharedUtil) {
|
||||||
|
|
||||||
|
var shadow = sharedUtil.shadow;
|
||||||
|
|
||||||
var WebGLUtils = (function WebGLUtilsClosure() {
|
var WebGLUtils = (function WebGLUtilsClosure() {
|
||||||
function loadShader(gl, code, shaderType) {
|
function loadShader(gl, code, shaderType) {
|
||||||
var shader = gl.createShader(shaderType);
|
var shader = gl.createShader(shaderType);
|
||||||
@ -433,3 +445,6 @@ var WebGLUtils = (function WebGLUtilsClosure() {
|
|||||||
clear: cleanup
|
clear: cleanup
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
exports.WebGLUtils = WebGLUtils;
|
||||||
|
}));
|
||||||
|
35
src/expose_to_global.js
Normal file
35
src/expose_to_global.js
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/* Copyright 2015 Mozilla Foundation
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
NOTE: This file is created as a helper to expose all loaded internal exported
|
||||||
|
members to global scope.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
(function (root) {
|
||||||
|
for (var i in root) {
|
||||||
|
if (/^pdfjs(Shared|Core|Display)/.test(i)) {
|
||||||
|
var obj = root[i];
|
||||||
|
for (var j in obj) {
|
||||||
|
if (Object.getOwnPropertyDescriptor(root, j)) {
|
||||||
|
continue; // ignoring if already set
|
||||||
|
}
|
||||||
|
root[j] = obj[j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})(window);
|
47
src/shared/global.js
Normal file
47
src/shared/global.js
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
/* Copyright 2015 Mozilla Foundation
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
/* globals PDFJS, global */
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
(function (root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
define('pdfjs/shared/global', ['exports'], factory);
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
factory(exports);
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsSharedGlobal = {}));
|
||||||
|
}
|
||||||
|
}(this, function (exports) {
|
||||||
|
|
||||||
|
var globalScope = (typeof window !== 'undefined') ? window :
|
||||||
|
(typeof global !== 'undefined') ? global :
|
||||||
|
(typeof self !== 'undefined') ? self : this;
|
||||||
|
|
||||||
|
var isWorker = (typeof window === 'undefined');
|
||||||
|
|
||||||
|
// The global PDFJS object exposes the API
|
||||||
|
// In production, it will be declared outside a global wrapper
|
||||||
|
// In development, it will be declared here
|
||||||
|
if (!globalScope.PDFJS) {
|
||||||
|
globalScope.PDFJS = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
globalScope.PDFJS.pdfBug = false;
|
||||||
|
|
||||||
|
exports.globalScope = globalScope;
|
||||||
|
exports.isWorker = isWorker;
|
||||||
|
exports.PDFJS = globalScope.PDFJS;
|
||||||
|
}));
|
@ -12,14 +12,22 @@
|
|||||||
* 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 Cmd, ColorSpace, Dict, MozBlobBuilder, Name, PDFJS, Ref, URL,
|
/* globals MozBlobBuilder, URL */
|
||||||
Promise */
|
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var globalScope = (typeof window === 'undefined') ? this : window;
|
(function (root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
define('pdfjs/shared/util', ['exports', 'pdfjs/shared/global'], factory);
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
factory(exports, require('./global.js'));
|
||||||
|
} else {
|
||||||
|
factory((root.pdfjsSharedUtil = {}), root.pdfjsSharedGlobal);
|
||||||
|
}
|
||||||
|
}(this, function (exports, sharedGlobal) {
|
||||||
|
|
||||||
var isWorker = (typeof window === 'undefined');
|
var PDFJS = sharedGlobal.PDFJS;
|
||||||
|
var globalScope = sharedGlobal.globalScope;
|
||||||
|
|
||||||
var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];
|
var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];
|
||||||
|
|
||||||
@ -119,15 +127,6 @@ var FontType = {
|
|||||||
MMTYPE1: 10
|
MMTYPE1: 10
|
||||||
};
|
};
|
||||||
|
|
||||||
// The global PDFJS object exposes the API
|
|
||||||
// In production, it will be declared outside a global wrapper
|
|
||||||
// In development, it will be declared here
|
|
||||||
if (!globalScope.PDFJS) {
|
|
||||||
globalScope.PDFJS = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
globalScope.PDFJS.pdfBug = false;
|
|
||||||
|
|
||||||
PDFJS.VERBOSITY_LEVELS = {
|
PDFJS.VERBOSITY_LEVELS = {
|
||||||
errors: 0,
|
errors: 0,
|
||||||
warnings: 1,
|
warnings: 1,
|
||||||
@ -1046,41 +1045,14 @@ function isString(v) {
|
|||||||
return typeof v === 'string';
|
return typeof v === 'string';
|
||||||
}
|
}
|
||||||
|
|
||||||
function isName(v) {
|
|
||||||
return v instanceof Name;
|
|
||||||
}
|
|
||||||
|
|
||||||
function isCmd(v, cmd) {
|
|
||||||
return v instanceof Cmd && (cmd === undefined || v.cmd === cmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
function isDict(v, type) {
|
|
||||||
if (!(v instanceof Dict)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!type) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
var dictType = v.get('Type');
|
|
||||||
return isName(dictType) && dictType.name === type;
|
|
||||||
}
|
|
||||||
|
|
||||||
function isArray(v) {
|
function isArray(v) {
|
||||||
return v instanceof Array;
|
return v instanceof Array;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isStream(v) {
|
|
||||||
return typeof v === 'object' && v !== null && v.getBytes !== undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
function isArrayBuffer(v) {
|
function isArrayBuffer(v) {
|
||||||
return typeof v === 'object' && v !== null && v.byteLength !== undefined;
|
return typeof v === 'object' && v !== null && v.byteLength !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isRef(v) {
|
|
||||||
return v instanceof Ref;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Promise Capability object.
|
* Promise Capability object.
|
||||||
*
|
*
|
||||||
@ -1669,3 +1641,59 @@ function loadJpegStream(id, imageUrl, objs) {
|
|||||||
});
|
});
|
||||||
img.src = imageUrl;
|
img.src = imageUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exports.FONT_IDENTITY_MATRIX = FONT_IDENTITY_MATRIX;
|
||||||
|
exports.IDENTITY_MATRIX = IDENTITY_MATRIX;
|
||||||
|
exports.OPS = OPS;
|
||||||
|
exports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES;
|
||||||
|
exports.AnnotationBorderStyleType = AnnotationBorderStyleType;
|
||||||
|
exports.AnnotationFlag = AnnotationFlag;
|
||||||
|
exports.AnnotationType = AnnotationType;
|
||||||
|
exports.FontType = FontType;
|
||||||
|
exports.ImageKind = ImageKind;
|
||||||
|
exports.InvalidPDFException = InvalidPDFException;
|
||||||
|
exports.LinkTarget = LinkTarget;
|
||||||
|
exports.LinkTargetStringMap = LinkTargetStringMap;
|
||||||
|
exports.MessageHandler = MessageHandler;
|
||||||
|
exports.MissingDataException = MissingDataException;
|
||||||
|
exports.MissingPDFException = MissingPDFException;
|
||||||
|
exports.NotImplementedException = NotImplementedException;
|
||||||
|
exports.PasswordException = PasswordException;
|
||||||
|
exports.PasswordResponses = PasswordResponses;
|
||||||
|
exports.StatTimer = StatTimer;
|
||||||
|
exports.StreamType = StreamType;
|
||||||
|
exports.TextRenderingMode = TextRenderingMode;
|
||||||
|
exports.Uint32ArrayView = Uint32ArrayView;
|
||||||
|
exports.UnexpectedResponseException = UnexpectedResponseException;
|
||||||
|
exports.UnknownErrorException = UnknownErrorException;
|
||||||
|
exports.Util = Util;
|
||||||
|
exports.XRefParseException = XRefParseException;
|
||||||
|
exports.assert = assert;
|
||||||
|
exports.bytesToString = bytesToString;
|
||||||
|
exports.combineUrl = combineUrl;
|
||||||
|
exports.createPromiseCapability = createPromiseCapability;
|
||||||
|
exports.deprecated = deprecated;
|
||||||
|
exports.error = error;
|
||||||
|
exports.info = info;
|
||||||
|
exports.isArray = isArray;
|
||||||
|
exports.isArrayBuffer = isArrayBuffer;
|
||||||
|
exports.isBool = isBool;
|
||||||
|
exports.isEmptyObj = isEmptyObj;
|
||||||
|
exports.isExternalLinkTargetSet = isExternalLinkTargetSet;
|
||||||
|
exports.isInt = isInt;
|
||||||
|
exports.isNum = isNum;
|
||||||
|
exports.isString = isString;
|
||||||
|
exports.isValidUrl = isValidUrl;
|
||||||
|
exports.loadJpegStream = loadJpegStream;
|
||||||
|
exports.log2 = log2;
|
||||||
|
exports.readInt8 = readInt8;
|
||||||
|
exports.readUint16 = readUint16;
|
||||||
|
exports.readUint32 = readUint32;
|
||||||
|
exports.shadow = shadow;
|
||||||
|
exports.string32 = string32;
|
||||||
|
exports.stringToBytes = stringToBytes;
|
||||||
|
exports.stringToPDFString = stringToPDFString;
|
||||||
|
exports.stringToUTF8String = stringToUTF8String;
|
||||||
|
exports.utf8StringToString = utf8StringToString;
|
||||||
|
exports.warn = warn;
|
||||||
|
}));
|
||||||
|
@ -18,39 +18,41 @@
|
|||||||
|
|
||||||
// List of shared files to include;
|
// List of shared files to include;
|
||||||
var sharedFiles = [
|
var sharedFiles = [
|
||||||
|
'shared/global.js',
|
||||||
'shared/util.js'
|
'shared/util.js'
|
||||||
];
|
];
|
||||||
|
|
||||||
// List of other files to include;
|
// List of other files to include;
|
||||||
var otherFiles = [
|
var otherFiles = [
|
||||||
'core/network.js',
|
'core/network.js',
|
||||||
'core/chunked_stream.js',
|
'core/arithmetic_decoder.js',
|
||||||
'core/pdf_manager.js',
|
|
||||||
'core/core.js',
|
|
||||||
'core/obj.js',
|
|
||||||
'core/charsets.js',
|
'core/charsets.js',
|
||||||
'core/annotation.js',
|
'core/glyphlist.js',
|
||||||
|
'core/jpg.js',
|
||||||
|
'core/metrics.js',
|
||||||
|
'core/bidi.js',
|
||||||
|
'core/chunked_stream.js',
|
||||||
|
'core/jbig2.js',
|
||||||
|
'core/jpx.js',
|
||||||
|
'core/murmurhash3.js',
|
||||||
|
'core/primitives.js',
|
||||||
|
'core/stream.js',
|
||||||
|
'core/crypto.js',
|
||||||
|
'core/font_renderer.js',
|
||||||
|
'core/parser.js',
|
||||||
|
'core/cmap.js',
|
||||||
|
'core/obj.js',
|
||||||
|
'core/ps_parser.js',
|
||||||
|
'core/fonts.js',
|
||||||
'core/function.js',
|
'core/function.js',
|
||||||
'core/colorspace.js',
|
'core/colorspace.js',
|
||||||
'core/crypto.js',
|
'core/image.js',
|
||||||
'core/pattern.js',
|
'core/pattern.js',
|
||||||
'core/evaluator.js',
|
'core/evaluator.js',
|
||||||
'core/cmap.js',
|
'core/annotation.js',
|
||||||
'core/fonts.js',
|
'core/document.js',
|
||||||
'core/font_renderer.js',
|
'core/pdf_manager.js',
|
||||||
'core/glyphlist.js',
|
'core/worker.js'
|
||||||
'core/image.js',
|
|
||||||
'core/metrics.js',
|
|
||||||
'core/parser.js',
|
|
||||||
'core/ps_parser.js',
|
|
||||||
'core/stream.js',
|
|
||||||
'core/worker.js',
|
|
||||||
'core/arithmetic_decoder.js',
|
|
||||||
'core/jpg.js',
|
|
||||||
'core/jpx.js',
|
|
||||||
'core/jbig2.js',
|
|
||||||
'core/bidi.js',
|
|
||||||
'core/murmurhash3.js'
|
|
||||||
];
|
];
|
||||||
|
|
||||||
function loadInOrder(index, path, files) {
|
function loadInOrder(index, path, files) {
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
* 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, combineUrl, StatTimer, Promise */
|
/* globals PDFJS, pdfjsSharedUtil */
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
@ -196,7 +196,8 @@ var Driver = (function DriverClosure() {
|
|||||||
|
|
||||||
this._log('Loading file "' + task.file + '"\n');
|
this._log('Loading file "' + task.file + '"\n');
|
||||||
|
|
||||||
var absoluteUrl = combineUrl(window.location.href, task.file);
|
var absoluteUrl = pdfjsSharedUtil.combineUrl(window.location.href,
|
||||||
|
task.file);
|
||||||
|
|
||||||
PDFJS.disableRange = task.disableRange;
|
PDFJS.disableRange = task.disableRange;
|
||||||
PDFJS.disableAutoFetch = !task.enableAutoFetch;
|
PDFJS.disableAutoFetch = !task.enableAutoFetch;
|
||||||
@ -360,7 +361,7 @@ var Driver = (function DriverClosure() {
|
|||||||
}
|
}
|
||||||
page.cleanup();
|
page.cleanup();
|
||||||
task.stats = page.stats;
|
task.stats = page.stats;
|
||||||
page.stats = new StatTimer();
|
page.stats = new pdfjsSharedUtil.StatTimer();
|
||||||
self._snapshot(task, error);
|
self._snapshot(task, error);
|
||||||
});
|
});
|
||||||
initPromise.then(function () {
|
initPromise.then(function () {
|
||||||
|
@ -13,35 +13,46 @@
|
|||||||
|
|
||||||
<!-- include source files here... -->
|
<!-- include source files here... -->
|
||||||
<script src="../../src/core/network.js"></script>
|
<script src="../../src/core/network.js"></script>
|
||||||
<script src="../../src/core/chunked_stream.js"></script>
|
<script src="../../src/core/arithmetic_decoder.js"></script>
|
||||||
<script src="../../src/core/pdf_manager.js"></script>
|
|
||||||
<script src="../../src/core/core.js"></script>
|
|
||||||
<script src="../../src/shared/util.js"></script>
|
|
||||||
<script src="../../src/display/api.js"></script>
|
|
||||||
<script src="../../src/display/canvas.js"></script>
|
|
||||||
<script src="../../src/display/webgl.js"></script>
|
|
||||||
<script src="../../src/core/obj.js"></script>
|
|
||||||
<script src="../../src/core/annotation.js"></script>
|
|
||||||
<script src="../../src/core/function.js"></script>
|
|
||||||
<script src="../../src/core/charsets.js"></script>
|
<script src="../../src/core/charsets.js"></script>
|
||||||
<script src="../../src/core/colorspace.js"></script>
|
<script src="../../src/core/glyphlist.js"></script>
|
||||||
|
<script src="../../src/core/jpg.js"></script>
|
||||||
|
<script src="../../src/core/metrics.js"></script>
|
||||||
|
<script src="../../src/shared/global.js"></script>
|
||||||
|
<script src="../../src/core/bidi.js"></script>
|
||||||
|
<script src="../../src/display/dom_utils.js"></script>
|
||||||
|
<script src="../../src/shared/util.js"></script>
|
||||||
|
<script src="../../src/core/chunked_stream.js"></script>
|
||||||
|
<script src="../../src/core/jbig2.js"></script>
|
||||||
|
<script src="../../src/core/jpx.js"></script>
|
||||||
|
<script src="../../src/core/murmurhash3.js"></script>
|
||||||
|
<script src="../../src/core/primitives.js"></script>
|
||||||
|
<script src="../../src/display/annotation_layer.js"></script>
|
||||||
|
<script src="../../src/display/font_loader.js"></script>
|
||||||
|
<script src="../../src/display/metadata.js"></script>
|
||||||
|
<script src="../../src/display/text_layer.js"></script>
|
||||||
|
<script src="../../src/display/webgl.js"></script>
|
||||||
|
<script src="../../src/core/stream.js"></script>
|
||||||
|
<script src="../../src/display/pattern_helper.js"></script>
|
||||||
<script src="../../src/core/crypto.js"></script>
|
<script src="../../src/core/crypto.js"></script>
|
||||||
|
<script src="../../src/core/font_renderer.js"></script>
|
||||||
|
<script src="../../src/core/parser.js"></script>
|
||||||
|
<script src="../../src/display/canvas.js"></script>
|
||||||
|
<script src="../../src/core/cmap.js"></script>
|
||||||
|
<script src="../../src/core/obj.js"></script>
|
||||||
|
<script src="../../src/core/ps_parser.js"></script>
|
||||||
|
<script src="../../src/display/api.js"></script>
|
||||||
|
<script src="../../src/core/fonts.js"></script>
|
||||||
|
<script src="../../src/core/function.js"></script>
|
||||||
|
<script src="../../src/core/colorspace.js"></script>
|
||||||
|
<script src="../../src/core/image.js"></script>
|
||||||
<script src="../../src/core/pattern.js"></script>
|
<script src="../../src/core/pattern.js"></script>
|
||||||
<script src="../../src/core/evaluator.js"></script>
|
<script src="../../src/core/evaluator.js"></script>
|
||||||
<script src="../../src/core/cmap.js"></script>
|
<script src="../../src/core/annotation.js"></script>
|
||||||
<script src="../../src/core/fonts.js"></script>
|
<script src="../../src/core/document.js"></script>
|
||||||
<script src="../../src/core/glyphlist.js"></script>
|
<script src="../../src/core/pdf_manager.js"></script>
|
||||||
<script src="../../src/core/image.js"></script>
|
|
||||||
<script src="../../src/core/metrics.js"></script>
|
|
||||||
<script src="../../src/core/parser.js"></script>
|
|
||||||
<script src="../../src/core/ps_parser.js"></script>
|
|
||||||
<script src="../../src/display/pattern_helper.js"></script>
|
|
||||||
<script src="../../src/display/annotation_layer.js"></script>
|
|
||||||
<script src="../../src/display/text_layer.js"></script>
|
|
||||||
<script src="../../src/core/stream.js"></script>
|
|
||||||
<script src="../../src/core/worker.js"></script>
|
<script src="../../src/core/worker.js"></script>
|
||||||
<script src="../../src/display/metadata.js"></script>
|
<script src="../../src/expose_to_global.js"></script>
|
||||||
<script src="../../src/core/jpg.js"></script>
|
|
||||||
<script>PDFJS.workerSrc = '../../src/worker_loader.js';</script>
|
<script>PDFJS.workerSrc = '../../src/worker_loader.js';</script>
|
||||||
|
|
||||||
<!-- include spec files here... -->
|
<!-- include spec files here... -->
|
||||||
|
@ -18,16 +18,17 @@ 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="../src/shared/global.js"></script>
|
||||||
|
<script src="../src/display/dom_utils.js"></script>
|
||||||
<script src="../src/shared/util.js"></script>
|
<script src="../src/shared/util.js"></script>
|
||||||
<script src="../src/display/api.js"></script>
|
<script src="../src/display/annotation_layer.js"></script>
|
||||||
|
<script src="../src/display/font_loader.js"></script>
|
||||||
<script src="../src/display/metadata.js"></script>
|
<script src="../src/display/metadata.js"></script>
|
||||||
<script src="../src/display/canvas.js"></script>
|
<script src="../src/display/text_layer.js"></script>
|
||||||
<script src="../src/display/webgl.js"></script>
|
<script src="../src/display/webgl.js"></script>
|
||||||
<script src="../src/display/pattern_helper.js"></script>
|
<script src="../src/display/pattern_helper.js"></script>
|
||||||
<script src="../src/display/font_loader.js"></script>
|
<script src="../src/display/canvas.js"></script>
|
||||||
<script src="../src/display/dom_utils.js"></script>
|
<script src="../src/display/api.js"></script>
|
||||||
<script src="../src/display/annotation_layer.js"></script>
|
|
||||||
<script src="../src/display/text_layer.js"></script>
|
|
||||||
<script src="driver.js"></script>
|
<script src="driver.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -109,7 +109,7 @@ describe('font', function() {
|
|||||||
it('parses a CharString endchar with 4 args w/seac enabled', function() {
|
it('parses a CharString endchar with 4 args w/seac enabled', function() {
|
||||||
var seacAnalysisState = SEAC_ANALYSIS_ENABLED;
|
var seacAnalysisState = SEAC_ANALYSIS_ENABLED;
|
||||||
try {
|
try {
|
||||||
SEAC_ANALYSIS_ENABLED = true;
|
window.pdfjsCoreFonts._enableSeacAnalysis(true);
|
||||||
var bytes = new Uint8Array([0, 1, // count
|
var bytes = new Uint8Array([0, 1, // count
|
||||||
1, // offsetSize
|
1, // offsetSize
|
||||||
0, // offset[0]
|
0, // offset[0]
|
||||||
@ -125,14 +125,14 @@ describe('font', function() {
|
|||||||
expect(result.seacs[0][2]).toEqual(65);
|
expect(result.seacs[0][2]).toEqual(65);
|
||||||
expect(result.seacs[0][3]).toEqual(194);
|
expect(result.seacs[0][3]).toEqual(194);
|
||||||
} finally {
|
} finally {
|
||||||
SEAC_ANALYSIS_ENABLED = seacAnalysisState;
|
window.pdfjsCoreFonts._enableSeacAnalysis(seacAnalysisState);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('parses a CharString endchar with 4 args w/seac disabled', function() {
|
it('parses a CharString endchar with 4 args w/seac disabled', function() {
|
||||||
var seacAnalysisState = SEAC_ANALYSIS_ENABLED;
|
var seacAnalysisState = SEAC_ANALYSIS_ENABLED;
|
||||||
try {
|
try {
|
||||||
SEAC_ANALYSIS_ENABLED = false;
|
window.pdfjsCoreFonts._enableSeacAnalysis(false);
|
||||||
var bytes = new Uint8Array([0, 1, // count
|
var bytes = new Uint8Array([0, 1, // count
|
||||||
1, // offsetSize
|
1, // offsetSize
|
||||||
0, // offset[0]
|
0, // offset[0]
|
||||||
@ -143,7 +143,7 @@ describe('font', function() {
|
|||||||
expect(result.charStrings.get(0).length).toEqual(9);
|
expect(result.charStrings.get(0).length).toEqual(9);
|
||||||
expect(result.seacs.length).toEqual(0);
|
expect(result.seacs.length).toEqual(0);
|
||||||
} finally {
|
} finally {
|
||||||
SEAC_ANALYSIS_ENABLED = seacAnalysisState;
|
window.pdfjsCoreFonts._enableSeacAnalysis(seacAnalysisState);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
describe('obj', function() {
|
describe('primitives', function() {
|
||||||
|
|
||||||
describe('Name', function() {
|
describe('Name', function() {
|
||||||
it('should retain the given name', function() {
|
it('should retain the given name', function() {
|
@ -12,42 +12,51 @@
|
|||||||
|
|
||||||
<!-- include source files here... -->
|
<!-- include source files here... -->
|
||||||
<script src="../../src/core/network.js"></script>
|
<script src="../../src/core/network.js"></script>
|
||||||
<script src="../../src/core/chunked_stream.js"></script>
|
<script src="../../src/core/arithmetic_decoder.js"></script>
|
||||||
<script src="../../src/core/pdf_manager.js"></script>
|
|
||||||
<script src="../../src/core/core.js"></script>
|
|
||||||
<script src="../../src/shared/util.js"></script>
|
|
||||||
<script src="../../src/display/api.js"></script>
|
|
||||||
<script src="../../src/display/canvas.js"></script>
|
|
||||||
<script src="../../src/display/webgl.js"></script>
|
|
||||||
<script src="../../src/core/obj.js"></script>
|
|
||||||
<script src="../../src/core/annotation.js"></script>
|
|
||||||
<script src="../../src/core/function.js"></script>
|
|
||||||
<script src="../../src/core/charsets.js"></script>
|
<script src="../../src/core/charsets.js"></script>
|
||||||
<script src="../../src/core/colorspace.js"></script>
|
<script src="../../src/core/glyphlist.js"></script>
|
||||||
|
<script src="../../src/core/jpg.js"></script>
|
||||||
|
<script src="../../src/core/metrics.js"></script>
|
||||||
|
<script src="../../src/shared/global.js"></script>
|
||||||
|
<script src="../../src/core/bidi.js"></script>
|
||||||
|
<script src="../../src/display/dom_utils.js"></script>
|
||||||
|
<script src="../../src/shared/util.js"></script>
|
||||||
|
<script src="../../src/core/chunked_stream.js"></script>
|
||||||
|
<script src="../../src/core/jbig2.js"></script>
|
||||||
|
<script src="../../src/core/jpx.js"></script>
|
||||||
|
<script src="../../src/core/murmurhash3.js"></script>
|
||||||
|
<script src="../../src/core/primitives.js"></script>
|
||||||
|
<script src="../../src/display/annotation_layer.js"></script>
|
||||||
|
<script src="../../src/display/font_loader.js"></script>
|
||||||
|
<script src="../../src/display/metadata.js"></script>
|
||||||
|
<script src="../../src/display/text_layer.js"></script>
|
||||||
|
<script src="../../src/display/webgl.js"></script>
|
||||||
|
<script src="../../src/core/stream.js"></script>
|
||||||
|
<script src="../../src/display/pattern_helper.js"></script>
|
||||||
<script src="../../src/core/crypto.js"></script>
|
<script src="../../src/core/crypto.js"></script>
|
||||||
|
<script src="../../src/core/font_renderer.js"></script>
|
||||||
|
<script src="../../src/core/parser.js"></script>
|
||||||
|
<script src="../../src/display/canvas.js"></script>
|
||||||
|
<script src="../../src/core/cmap.js"></script>
|
||||||
|
<script src="../../src/core/obj.js"></script>
|
||||||
|
<script src="../../src/core/ps_parser.js"></script>
|
||||||
|
<script src="../../src/display/api.js"></script>
|
||||||
|
<script src="../../src/core/fonts.js"></script>
|
||||||
|
<script src="../../src/core/function.js"></script>
|
||||||
|
<script src="../../src/core/colorspace.js"></script>
|
||||||
|
<script src="../../src/core/image.js"></script>
|
||||||
<script src="../../src/core/pattern.js"></script>
|
<script src="../../src/core/pattern.js"></script>
|
||||||
<script src="../../src/core/evaluator.js"></script>
|
<script src="../../src/core/evaluator.js"></script>
|
||||||
<script src="../../src/core/cmap.js"></script>
|
<script src="../../src/core/annotation.js"></script>
|
||||||
<script src="../../src/core/fonts.js"></script>
|
<script src="../../src/core/document.js"></script>
|
||||||
<script src="../../src/core/glyphlist.js"></script>
|
<script src="../../src/core/pdf_manager.js"></script>
|
||||||
<script src="../../src/core/image.js"></script>
|
|
||||||
<script src="../../src/core/metrics.js"></script>
|
|
||||||
<script src="../../src/core/parser.js"></script>
|
|
||||||
<script src="../../src/core/ps_parser.js"></script>
|
|
||||||
<script src="../../src/display/pattern_helper.js"></script>
|
|
||||||
<script src="../../src/display/font_loader.js"></script>
|
|
||||||
<script src="../../src/display/dom_utils.js"></script>
|
|
||||||
<script src="../../src/display/annotation_layer.js"></script>
|
|
||||||
<script src="../../src/display/text_layer.js"></script>
|
|
||||||
<script src="../../src/core/stream.js"></script>
|
|
||||||
<script src="../../src/core/worker.js"></script>
|
<script src="../../src/core/worker.js"></script>
|
||||||
<script src="../../src/display/metadata.js"></script>
|
<script src="../../src/expose_to_global.js"></script>
|
||||||
<script src="../../src/core/jpg.js"></script>
|
|
||||||
<script src="../../web/ui_utils.js"></script>
|
<script src="../../web/ui_utils.js"></script>
|
||||||
<script>PDFJS.workerSrc = '../../src/worker_loader.js';</script>
|
<script>PDFJS.workerSrc = '../../src/worker_loader.js';</script>
|
||||||
|
|
||||||
<!-- include spec files here... -->
|
<!-- include spec files here... -->
|
||||||
<script src="obj_spec.js"></script>
|
<script src="primitives_spec.js"></script>
|
||||||
<script src="font_spec.js"></script>
|
<script src="font_spec.js"></script>
|
||||||
<script src="function_spec.js"></script>
|
<script src="function_spec.js"></script>
|
||||||
<script src="crypto_spec.js"></script>
|
<script src="crypto_spec.js"></script>
|
||||||
|
@ -53,16 +53,17 @@ See https://github.com/adobe-type-tools/cmap-resources
|
|||||||
<!--#endif-->
|
<!--#endif-->
|
||||||
|
|
||||||
<!--#if !PRODUCTION-->
|
<!--#if !PRODUCTION-->
|
||||||
|
<script src="../src/shared/global.js"></script>
|
||||||
|
<script src="../src/display/dom_utils.js"></script>
|
||||||
<script src="../src/shared/util.js"></script>
|
<script src="../src/shared/util.js"></script>
|
||||||
<script src="../src/display/api.js"></script>
|
<script src="../src/display/annotation_layer.js"></script>
|
||||||
|
<script src="../src/display/font_loader.js"></script>
|
||||||
<script src="../src/display/metadata.js"></script>
|
<script src="../src/display/metadata.js"></script>
|
||||||
<script src="../src/display/canvas.js"></script>
|
<script src="../src/display/text_layer.js"></script>
|
||||||
<script src="../src/display/webgl.js"></script>
|
<script src="../src/display/webgl.js"></script>
|
||||||
<script src="../src/display/pattern_helper.js"></script>
|
<script src="../src/display/pattern_helper.js"></script>
|
||||||
<script src="../src/display/font_loader.js"></script>
|
<script src="../src/display/canvas.js"></script>
|
||||||
<script src="../src/display/dom_utils.js"></script>
|
<script src="../src/display/api.js"></script>
|
||||||
<script src="../src/display/annotation_layer.js"></script>
|
|
||||||
<script src="../src/display/text_layer.js"></script>
|
|
||||||
<script>PDFJS.workerSrc = '../src/worker_loader.js';</script>
|
<script>PDFJS.workerSrc = '../src/worker_loader.js';</script>
|
||||||
<!--#endif-->
|
<!--#endif-->
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user