See https://bugzilla.mozilla.org/show_bug.cgi?id=1735738 for reference.
const { SimpleLinkService } = pdfjsViewer;
const WAITING_TIME = 100; 
const CMAP_URL = "/build/generic/web/cmaps/";
const CMAP_PACKED = true;
const STANDARD_FONT_DATA_URL = "/build/generic/web/standard_fonts/";
const IMAGE_RESOURCES_PATH = "/web/images/";
const WORKER_SRC = "../build/generic/build/pdf.worker.js";
const RENDER_TASK_ON_CONTINUE_DELAY = 5; 
const SVG_NS = "http://www.w3.org/2000/svg";
function loadStyles(styles) {
  styles = Object.values(styles);
  if (styles.every(style => style.promise)) {
    return Promise.all(styles.map(style => style.promise));
  }
  for (const style of styles) {
    style.promise = new Promise(function (resolve, reject) {
      const xhr = new XMLHttpRequest();
      xhr.open("GET", style.file);
      xhr.onload = function () {
        resolve(xhr.responseText);
      };
      xhr.onerror = function (e) {
        reject(new Error(`Error fetching style (${style.file}): ${e}`));
      };
      xhr.send(null);
    });
  }
  return Promise.all(styles.map(style => style.promise));
}
function writeSVG(svgElement, ctx, resolve, reject) {