2
0

pdf.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /**
  2. * @licstart The following is the entire license notice for the
  3. * Javascript code in this page
  4. *
  5. * Copyright 2019 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.2.228';
  24. var pdfjsBuild = 'd7afb74a';
  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. var pdfjsDisplayWorkerOptions = require('./display/worker_options.js');
  32. var pdfjsDisplayAPICompatibility = require('./display/api_compatibility.js');
  33. {
  34. var isNodeJS = require('./shared/is_node.js');
  35. if (isNodeJS()) {
  36. var PDFNodeStream = require('./display/node_stream.js').PDFNodeStream;
  37. pdfjsDisplayAPI.setPDFNetworkStreamFactory(function (params) {
  38. return new PDFNodeStream(params);
  39. });
  40. } else {
  41. var PDFNetworkStream = require('./display/network.js').PDFNetworkStream;
  42. var PDFFetchStream;
  43. if (pdfjsDisplayDisplayUtils.isFetchSupported()) {
  44. PDFFetchStream = require('./display/fetch_stream.js').PDFFetchStream;
  45. }
  46. pdfjsDisplayAPI.setPDFNetworkStreamFactory(function (params) {
  47. if (PDFFetchStream && pdfjsDisplayDisplayUtils.isValidFetchUrl(params.url)) {
  48. return new PDFFetchStream(params);
  49. }
  50. return new PDFNetworkStream(params);
  51. });
  52. }
  53. }
  54. exports.build = pdfjsDisplayAPI.build;
  55. exports.version = pdfjsDisplayAPI.version;
  56. exports.getDocument = pdfjsDisplayAPI.getDocument;
  57. exports.LoopbackPort = pdfjsDisplayAPI.LoopbackPort;
  58. exports.PDFDataRangeTransport = pdfjsDisplayAPI.PDFDataRangeTransport;
  59. exports.PDFWorker = pdfjsDisplayAPI.PDFWorker;
  60. exports.renderTextLayer = pdfjsDisplayTextLayer.renderTextLayer;
  61. exports.AnnotationLayer = pdfjsDisplayAnnotationLayer.AnnotationLayer;
  62. exports.createPromiseCapability = pdfjsSharedUtil.createPromiseCapability;
  63. exports.PasswordResponses = pdfjsSharedUtil.PasswordResponses;
  64. exports.InvalidPDFException = pdfjsSharedUtil.InvalidPDFException;
  65. exports.MissingPDFException = pdfjsSharedUtil.MissingPDFException;
  66. exports.SVGGraphics = pdfjsDisplaySVG.SVGGraphics;
  67. exports.NativeImageDecoding = pdfjsSharedUtil.NativeImageDecoding;
  68. exports.CMapCompressionType = pdfjsSharedUtil.CMapCompressionType;
  69. exports.PermissionFlag = pdfjsSharedUtil.PermissionFlag;
  70. exports.UnexpectedResponseException = pdfjsSharedUtil.UnexpectedResponseException;
  71. exports.OPS = pdfjsSharedUtil.OPS;
  72. exports.VerbosityLevel = pdfjsSharedUtil.VerbosityLevel;
  73. exports.UNSUPPORTED_FEATURES = pdfjsSharedUtil.UNSUPPORTED_FEATURES;
  74. exports.createValidAbsoluteUrl = pdfjsSharedUtil.createValidAbsoluteUrl;
  75. exports.createObjectURL = pdfjsSharedUtil.createObjectURL;
  76. exports.removeNullCharacters = pdfjsSharedUtil.removeNullCharacters;
  77. exports.shadow = pdfjsSharedUtil.shadow;
  78. exports.Util = pdfjsSharedUtil.Util;
  79. exports.ReadableStream = pdfjsSharedUtil.ReadableStream;
  80. exports.URL = pdfjsSharedUtil.URL;
  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;