global.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 _util = require('../shared/util');
  28. var _dom_utils = require('./dom_utils');
  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 _worker_options = require('./worker_options');
  34. var _metadata = require('./metadata');
  35. var _text_layer = require('./text_layer');
  36. var _svg = require('./svg');
  37. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  38. if (!_global_scope2.default.PDFJS) {
  39. _global_scope2.default.PDFJS = {};
  40. }
  41. var PDFJS = _global_scope2.default.PDFJS;
  42. PDFJS.pdfBug = false;
  43. PDFJS.OPS = _util.OPS;
  44. PDFJS.UNSUPPORTED_FEATURES = _util.UNSUPPORTED_FEATURES;
  45. PDFJS.shadow = _util.shadow;
  46. PDFJS.createBlob = _util.createBlob;
  47. PDFJS.createObjectURL = function PDFJS_createObjectURL(data, contentType) {
  48. return (0, _util.createObjectURL)(data, contentType, PDFJS.disableCreateObjectURL);
  49. };
  50. Object.defineProperty(PDFJS, 'isLittleEndian', {
  51. configurable: true,
  52. get: function PDFJS_isLittleEndian() {
  53. return (0, _util.shadow)(PDFJS, 'isLittleEndian', (0, _util.isLittleEndian)());
  54. }
  55. });
  56. PDFJS.removeNullCharacters = _util.removeNullCharacters;
  57. PDFJS.PasswordResponses = _util.PasswordResponses;
  58. PDFJS.PasswordException = _util.PasswordException;
  59. PDFJS.UnknownErrorException = _util.UnknownErrorException;
  60. PDFJS.InvalidPDFException = _util.InvalidPDFException;
  61. PDFJS.MissingPDFException = _util.MissingPDFException;
  62. PDFJS.UnexpectedResponseException = _util.UnexpectedResponseException;
  63. PDFJS.Util = _util.Util;
  64. PDFJS.PageViewport = _util.PageViewport;
  65. PDFJS.createPromiseCapability = _util.createPromiseCapability;
  66. PDFJS.maxImageSize = PDFJS.maxImageSize === undefined ? -1 : PDFJS.maxImageSize;
  67. PDFJS.cMapUrl = PDFJS.cMapUrl === undefined ? null : PDFJS.cMapUrl;
  68. PDFJS.cMapPacked = PDFJS.cMapPacked === undefined ? false : PDFJS.cMapPacked;
  69. PDFJS.disableFontFace = PDFJS.disableFontFace === undefined ? false : PDFJS.disableFontFace;
  70. PDFJS.disableRange = PDFJS.disableRange === undefined ? false : PDFJS.disableRange;
  71. PDFJS.disableStream = PDFJS.disableStream === undefined ? false : PDFJS.disableStream;
  72. PDFJS.disableAutoFetch = PDFJS.disableAutoFetch === undefined ? false : PDFJS.disableAutoFetch;
  73. PDFJS.pdfBug = PDFJS.pdfBug === undefined ? false : PDFJS.pdfBug;
  74. PDFJS.disableCreateObjectURL = PDFJS.disableCreateObjectURL === undefined ? false : PDFJS.disableCreateObjectURL;
  75. PDFJS.externalLinkTarget = PDFJS.externalLinkTarget === undefined ? _dom_utils.LinkTarget.NONE : PDFJS.externalLinkTarget;
  76. PDFJS.externalLinkRel = PDFJS.externalLinkRel === undefined ? _dom_utils.DEFAULT_LINK_REL : PDFJS.externalLinkRel;
  77. PDFJS.isEvalSupported = PDFJS.isEvalSupported === undefined ? true : PDFJS.isEvalSupported;
  78. PDFJS.getDocument = _api.getDocument;
  79. PDFJS.LoopbackPort = _api.LoopbackPort;
  80. PDFJS.PDFDataRangeTransport = _api.PDFDataRangeTransport;
  81. PDFJS.PDFWorker = _api.PDFWorker;
  82. PDFJS.GlobalWorkerOptions = _worker_options.GlobalWorkerOptions;
  83. PDFJS.getFilenameFromUrl = _dom_utils.getFilenameFromUrl;
  84. PDFJS.AnnotationLayer = _annotation_layer.AnnotationLayer;
  85. PDFJS.renderTextLayer = _text_layer.renderTextLayer;
  86. PDFJS.Metadata = _metadata.Metadata;
  87. PDFJS.SVGGraphics = _svg.SVGGraphics;
  88. exports.globalScope = _global_scope2.default;
  89. exports.PDFJS = PDFJS;