2
0

global.js 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /* Copyright 2017 Mozilla Foundation
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. 'use strict';
  16. Object.defineProperty(exports, "__esModule", {
  17. value: true
  18. });
  19. exports.PDFJS = exports.globalScope = undefined;
  20. var _dom_utils = require('./dom_utils');
  21. var _util = require('../shared/util');
  22. var _api = require('./api');
  23. var _annotation_layer = require('./annotation_layer');
  24. var _global_scope = require('../shared/global_scope');
  25. var _global_scope2 = _interopRequireDefault(_global_scope);
  26. var _metadata = require('./metadata');
  27. var _text_layer = require('./text_layer');
  28. var _svg = require('./svg');
  29. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30. if (!_global_scope2.default.PDFJS) {
  31. _global_scope2.default.PDFJS = {};
  32. }
  33. var PDFJS = _global_scope2.default.PDFJS;
  34. {
  35. PDFJS.version = '2.0.118';
  36. PDFJS.build = 'f9a05154';
  37. }
  38. PDFJS.pdfBug = false;
  39. if (PDFJS.verbosity !== undefined) {
  40. (0, _util.setVerbosityLevel)(PDFJS.verbosity);
  41. }
  42. delete PDFJS.verbosity;
  43. Object.defineProperty(PDFJS, 'verbosity', {
  44. get: function get() {
  45. return (0, _util.getVerbosityLevel)();
  46. },
  47. set: function set(level) {
  48. (0, _util.setVerbosityLevel)(level);
  49. },
  50. enumerable: true,
  51. configurable: true
  52. });
  53. PDFJS.VERBOSITY_LEVELS = _util.VERBOSITY_LEVELS;
  54. PDFJS.OPS = _util.OPS;
  55. PDFJS.UNSUPPORTED_FEATURES = _util.UNSUPPORTED_FEATURES;
  56. PDFJS.isValidUrl = _dom_utils.isValidUrl;
  57. PDFJS.shadow = _util.shadow;
  58. PDFJS.createBlob = _util.createBlob;
  59. PDFJS.createObjectURL = function PDFJS_createObjectURL(data, contentType) {
  60. return (0, _util.createObjectURL)(data, contentType, PDFJS.disableCreateObjectURL);
  61. };
  62. Object.defineProperty(PDFJS, 'isLittleEndian', {
  63. configurable: true,
  64. get: function PDFJS_isLittleEndian() {
  65. return (0, _util.shadow)(PDFJS, 'isLittleEndian', (0, _util.isLittleEndian)());
  66. }
  67. });
  68. PDFJS.removeNullCharacters = _util.removeNullCharacters;
  69. PDFJS.PasswordResponses = _util.PasswordResponses;
  70. PDFJS.PasswordException = _util.PasswordException;
  71. PDFJS.UnknownErrorException = _util.UnknownErrorException;
  72. PDFJS.InvalidPDFException = _util.InvalidPDFException;
  73. PDFJS.MissingPDFException = _util.MissingPDFException;
  74. PDFJS.UnexpectedResponseException = _util.UnexpectedResponseException;
  75. PDFJS.Util = _util.Util;
  76. PDFJS.PageViewport = _util.PageViewport;
  77. PDFJS.createPromiseCapability = _util.createPromiseCapability;
  78. PDFJS.maxImageSize = PDFJS.maxImageSize === undefined ? -1 : PDFJS.maxImageSize;
  79. PDFJS.cMapUrl = PDFJS.cMapUrl === undefined ? null : PDFJS.cMapUrl;
  80. PDFJS.cMapPacked = PDFJS.cMapPacked === undefined ? false : PDFJS.cMapPacked;
  81. PDFJS.disableFontFace = PDFJS.disableFontFace === undefined ? false : PDFJS.disableFontFace;
  82. PDFJS.imageResourcesPath = PDFJS.imageResourcesPath === undefined ? '' : PDFJS.imageResourcesPath;
  83. PDFJS.disableWorker = PDFJS.disableWorker === undefined ? false : PDFJS.disableWorker;
  84. PDFJS.workerSrc = PDFJS.workerSrc === undefined ? null : PDFJS.workerSrc;
  85. PDFJS.workerPort = PDFJS.workerPort === undefined ? null : PDFJS.workerPort;
  86. PDFJS.disableRange = PDFJS.disableRange === undefined ? false : PDFJS.disableRange;
  87. PDFJS.disableStream = PDFJS.disableStream === undefined ? false : PDFJS.disableStream;
  88. PDFJS.disableAutoFetch = PDFJS.disableAutoFetch === undefined ? false : PDFJS.disableAutoFetch;
  89. PDFJS.pdfBug = PDFJS.pdfBug === undefined ? false : PDFJS.pdfBug;
  90. PDFJS.postMessageTransfers = PDFJS.postMessageTransfers === undefined ? true : PDFJS.postMessageTransfers;
  91. PDFJS.disableCreateObjectURL = PDFJS.disableCreateObjectURL === undefined ? false : PDFJS.disableCreateObjectURL;
  92. PDFJS.disableWebGL = PDFJS.disableWebGL === undefined ? true : PDFJS.disableWebGL;
  93. PDFJS.externalLinkTarget = PDFJS.externalLinkTarget === undefined ? _dom_utils.LinkTarget.NONE : PDFJS.externalLinkTarget;
  94. PDFJS.externalLinkRel = PDFJS.externalLinkRel === undefined ? _dom_utils.DEFAULT_LINK_REL : PDFJS.externalLinkRel;
  95. PDFJS.isEvalSupported = PDFJS.isEvalSupported === undefined ? true : PDFJS.isEvalSupported;
  96. PDFJS.getDocument = _api.getDocument;
  97. PDFJS.LoopbackPort = _api.LoopbackPort;
  98. PDFJS.PDFDataRangeTransport = _api.PDFDataRangeTransport;
  99. PDFJS.PDFWorker = _api.PDFWorker;
  100. PDFJS.CustomStyle = _dom_utils.CustomStyle;
  101. PDFJS.LinkTarget = _dom_utils.LinkTarget;
  102. PDFJS.addLinkAttributes = _dom_utils.addLinkAttributes;
  103. PDFJS.getFilenameFromUrl = _dom_utils.getFilenameFromUrl;
  104. PDFJS.isExternalLinkTargetSet = _dom_utils.isExternalLinkTargetSet;
  105. PDFJS.AnnotationLayer = _annotation_layer.AnnotationLayer;
  106. PDFJS.renderTextLayer = _text_layer.renderTextLayer;
  107. PDFJS.Metadata = _metadata.Metadata;
  108. PDFJS.SVGGraphics = _svg.SVGGraphics;
  109. exports.globalScope = _global_scope2.default;
  110. exports.PDFJS = PDFJS;