pdf.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. var pdfjsVersion = '2.0.374';
  24. var pdfjsBuild = '538dda10';
  25. var pdfjsSharedUtil = require('./shared/util.js');
  26. var pdfjsDisplayGlobal = require('./display/global.js');
  27. var pdfjsDisplayAPI = require('./display/api.js');
  28. var pdfjsDisplayTextLayer = require('./display/text_layer.js');
  29. var pdfjsDisplayAnnotationLayer = require('./display/annotation_layer.js');
  30. var pdfjsDisplayDOMUtils = require('./display/dom_utils.js');
  31. var pdfjsDisplaySVG = require('./display/svg.js');
  32. {
  33. var isNodeJS = require('./shared/is_node.js');
  34. if (isNodeJS()) {
  35. var PDFNodeStream = require('./display/node_stream.js').PDFNodeStream;
  36. pdfjsDisplayAPI.setPDFNetworkStreamFactory(function (params) {
  37. return new PDFNodeStream(params);
  38. });
  39. } else if (typeof Response !== 'undefined' && 'body' in Response.prototype && typeof ReadableStream !== 'undefined') {
  40. var PDFFetchStream = require('./display/fetch_stream.js').PDFFetchStream;
  41. pdfjsDisplayAPI.setPDFNetworkStreamFactory(function (params) {
  42. return new PDFFetchStream(params);
  43. });
  44. } else {
  45. var PDFNetworkStream = require('./display/network.js').PDFNetworkStream;
  46. pdfjsDisplayAPI.setPDFNetworkStreamFactory(function (params) {
  47. return new PDFNetworkStream(params);
  48. });
  49. }
  50. }
  51. exports.PDFJS = pdfjsDisplayGlobal.PDFJS;
  52. exports.build = pdfjsDisplayAPI.build;
  53. exports.version = pdfjsDisplayAPI.version;
  54. exports.getDocument = pdfjsDisplayAPI.getDocument;
  55. exports.LoopbackPort = pdfjsDisplayAPI.LoopbackPort;
  56. exports.PDFDataRangeTransport = pdfjsDisplayAPI.PDFDataRangeTransport;
  57. exports.PDFWorker = pdfjsDisplayAPI.PDFWorker;
  58. exports.renderTextLayer = pdfjsDisplayTextLayer.renderTextLayer;
  59. exports.AnnotationLayer = pdfjsDisplayAnnotationLayer.AnnotationLayer;
  60. exports.createPromiseCapability = pdfjsSharedUtil.createPromiseCapability;
  61. exports.PasswordResponses = pdfjsSharedUtil.PasswordResponses;
  62. exports.InvalidPDFException = pdfjsSharedUtil.InvalidPDFException;
  63. exports.MissingPDFException = pdfjsSharedUtil.MissingPDFException;
  64. exports.SVGGraphics = pdfjsDisplaySVG.SVGGraphics;
  65. exports.NativeImageDecoding = pdfjsSharedUtil.NativeImageDecoding;
  66. exports.UnexpectedResponseException = pdfjsSharedUtil.UnexpectedResponseException;
  67. exports.OPS = pdfjsSharedUtil.OPS;
  68. exports.UNSUPPORTED_FEATURES = pdfjsSharedUtil.UNSUPPORTED_FEATURES;
  69. exports.createValidAbsoluteUrl = pdfjsSharedUtil.createValidAbsoluteUrl;
  70. exports.createObjectURL = pdfjsSharedUtil.createObjectURL;
  71. exports.removeNullCharacters = pdfjsSharedUtil.removeNullCharacters;
  72. exports.shadow = pdfjsSharedUtil.shadow;
  73. exports.createBlob = pdfjsSharedUtil.createBlob;
  74. exports.RenderingCancelledException = pdfjsDisplayDOMUtils.RenderingCancelledException;
  75. exports.getFilenameFromUrl = pdfjsDisplayDOMUtils.getFilenameFromUrl;
  76. exports.LinkTarget = pdfjsDisplayDOMUtils.LinkTarget;
  77. exports.addLinkAttributes = pdfjsDisplayDOMUtils.addLinkAttributes;