global.js 5.2 KB

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