pdf.image_decoders.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* Copyright 2018 Mozilla Foundation
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. import { getVerbosityLevel, setVerbosityLevel } from "./shared/util.js";
  16. import { Jbig2Image } from "./core/jbig2.js";
  17. import { JpegImage } from "./core/jpg.js";
  18. import { JpxImage } from "./core/jpx.js";
  19. // To ensure that the standalone PDF.js image decoders have the same
  20. // browser/environment compatibility as the regular PDF.js library,
  21. // the standard set of polyfills are thus included in this build as well.
  22. //
  23. // Given that the (current) image decoders don't use all of the features
  24. // of the complete PDF.js library, e.g. they are completely synchronous,
  25. // some of the larger polyfills are thus unnecessary.
  26. //
  27. // In an attempt to reduce the size of the standalone PDF.js image decoders,
  28. // the following polyfills are currently being excluded:
  29. // - ReadableStream
  30. // - Promise
  31. // - URL
  32. // eslint-disable-next-line no-unused-vars
  33. const pdfjsVersion = PDFJSDev.eval("BUNDLE_VERSION");
  34. // eslint-disable-next-line no-unused-vars
  35. const pdfjsBuild = PDFJSDev.eval("BUNDLE_BUILD");
  36. export {
  37. getVerbosityLevel,
  38. Jbig2Image,
  39. JpegImage,
  40. JpxImage,
  41. setVerbosityLevel,
  42. };