I recently ran pdf.js via node against our bug tracker corpus files described by Peter Wyatt [here](https://de7.pdfa.org/a-new-stressful-pdf-corpus/) and [here](https://www.pdfa.org/stressful-pdf-corpus-grows/).

The full corpus is available [here](https://corpora.tika.apache.org/base/docs/bug_trackers/), and a prepackaged subset of PDFs is available [here](https://corpora.tika.apache.org/base/packaged/pdfs/pdfs_202011/).

I'm running a slight modification of your `getinfo.js` example: [code](https://github.com/tballison/file-observatory/blob/pdfspelunker/tika-containers/tika-pdfjs/js/my-getinfo.js) with the latest release: pdf.js-2.11.338. The environment is specified via [Docker](https://github.com/tballison/file-observatory/blob/pdfspelunker/tika-containers/tika-pdfjs/Dockerfile).

I should open separate tickets, but I don't want to spam your issue tracker.  

Please let me know how I can help.  Many thanks for pdf.js!

Some of these files are HUGE and some are corrupt (fuzzed).

**ExitValue=1**
~~https://corpora.tika.apache.org/base/docs/bug_trackers/poppler/poppler-91414-0.zip-2.gz-53.pdf~~ ***Fixed by #14312*** 
~~https://corpora.tika.apache.org/base/docs/bug_trackers/poppler/poppler-91414-0.zip-2.gz-54.pdf~~ ***Fixed by #14312*** 
~~https://corpora.tika.apache.org/base/docs/bug_trackers/poppler/poppler-91414-1.zip-2.gz-53.pdf~~ ***Identical to `poppler-91414-0.zip-2.gz-53.pdf`***
~~https://corpora.tika.apache.org/base/docs/bug_trackers/poppler/poppler-91414-1.zip-2.gz-54.pdf~~ ***Identical to `poppler-91414-0.zip-2.gz-54.pdf`***

**ExitValue=134**
~~https://corpora.tika.apache.org/base/docs/bug_trackers/poppler/poppler-67295-0.pdf~~ ***Fixed by #14311***
~~https://corpora.tika.apache.org/base/docs/bug_trackers/poppler/poppler-85140-0.pdf~~ ***Fixed by #14311***
~~https://corpora.tika.apache.org/base/docs/bug_trackers/poppler-gitlab/poppler-878-0.gz-0.pdf~~ ***Tracked in [bug 1611202](https://bugzilla.mozilla.org/show_bug.cgi?id=1611202)***

**ExitValue=137**
~~https://corpora.tika.apache.org/base/docs/bug_trackers/poppler-gitlab/poppler-878-1.gz-0.pdf~~ ***Duplicate of `poppler-878-0.gz-0.pdf`***

**Timeouts at 2 minutes** (sorted via size ascending...the small ones are likely very problematic)
~~https://corpora.tika.apache.org/base/docs/bug_trackers/REDHAT/1525652-1549079/REDHAT-1531897-0.pdf (871b)~~ ***Fixed by #14310***
~~https://corpora.tika.apache.org/base/docs/bug_trackers/PDFBOX/PDFBOX-4352-0.pdf (1k)~~ ***Fixed by #14304***

These should be ignored...they are just enormous...
~~https://corpora.tika.apache.org/base/docs/bug_trackers/GHOSTSCRIPT/694748-703060/GHOSTSCRIPT-700953-0.pdf (10MB)~~ ***WFM, when using the viewer[2]***
~~https://corpora.tika.apache.org/base/docs/bug_trackers/LIBRE_OFFICE/58331-70624/LIBRE_OFFICE-59360-1.bz2-0.pdf (19MB)~~ ***WFM, when using the viewer[1]***
~~https://corpora.tika.apache.org/base/docs/bug_trackers/GHOSTSCRIPT/226943-694743/GHOSTSCRIPT-693101-0.zip-0.pdf (19MB)~~ ***WFM, although the initialization takes a little time, when using the viewer[2]***
~~https://corpora.tika.apache.org/base/docs/bug_trackers/GHOSTSCRIPT/226943-694743/GHOSTSCRIPT-688926-0.bz2-0.pdf (22MB)~~ ***WFM, although the initialization takes a little time, when using the viewer[2]***
~~https://corpora.tika.apache.org/base/docs/bug_trackers/pdf.js/pdf.js-LINK-5586-1.pdf (30MB)~~ ***WFM, when using the viewer[1]***
~~https://corpora.tika.apache.org/base/docs/bug_trackers/PDFBOX/PDFBOX-4319-0.zip-0.pdf (36MB)~~ ***WFM, although the initialization takes a little time, when using the viewer[2]***
~~https://corpora.tika.apache.org/base/docs/bug_trackers/pdf.js/pdf.js-LINK-5890-0.pdf (39MB)~~ ***WFM, when using the viewer[1]***
~~https://corpora.tika.apache.org/base/docs/bug_trackers/sumatrapdf/sumatrapdf-LINK-150-0.pdf (39MB)~~ ***Identical to `pdf.js-LINK-5890-0.pdf`***
~~https://corpora.tika.apache.org/base/docs/bug_trackers/poppler-gitlab/poppler-878-2.gz-0.pdf (100MB)~~ ***Duplicate of `poppler-878-0.gz-0.pdf`***
https://corpora.tika.apache.org/base/docs/bug_trackers/PDFBOX/PDFBOX-1226-0.7z-0.pdf (400MB)
https://corpora.tika.apache.org/base/docs/bug_trackers/poppler/poppler-44085-1.xz-0.pdf (6GB)

---
[1] The file size, the number of pages, and the lack of Worker-support in Node.js means that 2 minutes (most likely) just isn't enough time to parse all of the pages in the document.

[2] Tested using PDF.js 3.7.95 [cbc4b20b1] in Firefox Nightly 115.0a1 on Windows 11. Given the large number of pages, the viewer forces page-scrolling to prevent issues with too many DOM-elements.
const buffer = [];
  let start = 0;
  for (let i = 0, ii = str.length; i < ii; i++) {
    const char = str.codePointAt(i);
    if (0x20 <= char && char <= 0x7e) {
      
      const entity = XMLEntities[char];
      if (entity) {
        if (start < i) {
          buffer.push(str.substring(start, i));
        }
        buffer.push(entity);
        start = i + 1;
      }
    } else {
      if (start < i) {
        buffer.push(str.substring(start, i));
      }
      buffer.push(`&#x${char.toString(16).toUpperCase()};`);
      if (char > 0xd7ff && (char < 0xe000 || char > 0xfffd)) {
        
        i++;
      }
      start = i + 1;
    }
  }
  if (buffer.length === 0) {
    return str;
  }
  if (start < str.length) {