pdf.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /**
  2. * @licstart The following is the entire license notice for the
  3. * Javascript code in this page
  4. *
  5. * Copyright 2020 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.4.456';
  24. var pdfjsBuild = '228a591c';
  25. var pdfjsSharedUtil = require("./shared/util.js");
  26. var pdfjsDisplayAPI = require("./display/api.js");
  27. var pdfjsDisplayTextLayer = require("./display/text_layer.js");
  28. var pdfjsDisplayAnnotationLayer = require("./display/annotation_layer.js");
  29. var pdfjsDisplayDisplayUtils = require("./display/display_utils.js");
  30. var pdfjsDisplaySVG = require("./display/svg.js");
  31. const pdfjsDisplayWorkerOptions = require("./display/worker_options.js");
  32. const pdfjsDisplayAPICompatibility = require("./display/api_compatibility.js");
  33. {
  34. const {
  35. isNodeJS
  36. } = require("./shared/is_node.js");
  37. if (isNodeJS) {
  38. const PDFNodeStream = require("./display/node_stream.js").PDFNodeStream;
  39. pdfjsDisplayAPI.setPDFNetworkStreamFactory(params => {
  40. return new PDFNodeStream(params);
  41. });
  42. } else {
  43. const PDFNetworkStream = require("./display/network.js").PDFNetworkStream;
  44. let PDFFetchStream;
  45. if (pdfjsDisplayDisplayUtils.isFetchSupported()) {
  46. PDFFetchStream = require("./display/fetch_stream.js").PDFFetchStream;
  47. }
  48. pdfjsDisplayAPI.setPDFNetworkStreamFactory(params => {
  49. if (PDFFetchStream && pdfjsDisplayDisplayUtils.isValidFetchUrl(params.url)) {
  50. return new PDFFetchStream(params);
  51. }
  52. return new PDFNetworkStream(params);
  53. });
  54. }
  55. }
  56. exports.build = pdfjsDisplayAPI.build;
  57. exports.version = pdfjsDisplayAPI.version;
  58. exports.getDocument = pdfjsDisplayAPI.getDocument;
  59. exports.LoopbackPort = pdfjsDisplayAPI.LoopbackPort;
  60. exports.PDFDataRangeTransport = pdfjsDisplayAPI.PDFDataRangeTransport;
  61. exports.PDFWorker = pdfjsDisplayAPI.PDFWorker;
  62. exports.renderTextLayer = pdfjsDisplayTextLayer.renderTextLayer;
  63. exports.AnnotationLayer = pdfjsDisplayAnnotationLayer.AnnotationLayer;
  64. exports.createPromiseCapability = pdfjsSharedUtil.createPromiseCapability;
  65. exports.PasswordResponses = pdfjsSharedUtil.PasswordResponses;
  66. exports.InvalidPDFException = pdfjsSharedUtil.InvalidPDFException;
  67. exports.MissingPDFException = pdfjsSharedUtil.MissingPDFException;
  68. exports.SVGGraphics = pdfjsDisplaySVG.SVGGraphics;
  69. exports.NativeImageDecoding = pdfjsSharedUtil.NativeImageDecoding;
  70. exports.CMapCompressionType = pdfjsSharedUtil.CMapCompressionType;
  71. exports.PermissionFlag = pdfjsSharedUtil.PermissionFlag;
  72. exports.UnexpectedResponseException = pdfjsSharedUtil.UnexpectedResponseException;
  73. exports.OPS = pdfjsSharedUtil.OPS;
  74. exports.VerbosityLevel = pdfjsSharedUtil.VerbosityLevel;
  75. exports.UNSUPPORTED_FEATURES = pdfjsSharedUtil.UNSUPPORTED_FEATURES;
  76. exports.createValidAbsoluteUrl = pdfjsSharedUtil.createValidAbsoluteUrl;
  77. exports.createObjectURL = pdfjsSharedUtil.createObjectURL;
  78. exports.removeNullCharacters = pdfjsSharedUtil.removeNullCharacters;
  79. exports.shadow = pdfjsSharedUtil.shadow;
  80. exports.Util = pdfjsSharedUtil.Util;
  81. exports.RenderingCancelledException = pdfjsDisplayDisplayUtils.RenderingCancelledException;
  82. exports.getFilenameFromUrl = pdfjsDisplayDisplayUtils.getFilenameFromUrl;
  83. exports.LinkTarget = pdfjsDisplayDisplayUtils.LinkTarget;
  84. exports.addLinkAttributes = pdfjsDisplayDisplayUtils.addLinkAttributes;
  85. exports.loadScript = pdfjsDisplayDisplayUtils.loadScript;
  86. exports.PDFDateString = pdfjsDisplayDisplayUtils.PDFDateString;
  87. exports.GlobalWorkerOptions = pdfjsDisplayWorkerOptions.GlobalWorkerOptions;
  88. exports.apiCompatibilityParams = pdfjsDisplayAPICompatibility.apiCompatibilityParams;