0

I have an app that converts some files to PDF. When I open the file in Chrome or Edge, it loads, albeit slowly. In Abode Acrobat Reader, it loads the file but truncated.

However, the file does not load correctly in Firefox, which uses PDF.js as the base for its PDF viewer. This problem is also present in React-PDF viewer.

The errors are as follows:

PDF.js v3.4.62 (build: 9cea76483)
Message: 
Stack: putBinaryImageData@resource://pdf.js/build/pdf.js:5135:11
paintInlineImageXObject@resource://pdf.js/build/pdf.js:6703:25
paintImageXObject@resource://pdf.js/build/pdf.js:6663:10
executeOperatorList@resource://pdf.js/build/pdf.js:5475:20
_next@resource://pdf.js/build/pdf.js:2614:37
__webpack_modules__</_scheduleNext/<@resource://pdf.js/build/pdf.js:2604:14
renderView: "[Exception... "Failure"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: resource://pdf.js/build/pdf.js :: putBinaryImageData :: line 5135"  data: no]"

Is there anything I can do about this inside of PDF.js or React-PDF?

The reason Acrobat truncates the PDF is likely because of the limit of 200 inches on either side of a page. As for Firefox and PDF.js, I do not know but it could be a similar limitation.

usagibear
  • 303
  • 3
  • 12
  • 1
    Which PDF version number are the files saved with? I found some notes on maximum PDF page size at [PDF Page Size Limitations](https://www.cadzation.com/help/pdfpagesize.htm). – Andrew Morton Mar 08 '23 at 17:53
  • Thanks Andrew Morton. I am using GroupDocs and it is by default setting the type to PDF 1.5 which appears to have the 200" restriction. However, it looks like apps don't support larger than that from the comment in that link for PDF 1.6. – usagibear Mar 08 '23 at 21:23
  • The PDF specification does not impose any limits on PDF page size. Those page size limitations are technical limitations in Adobe Acrobat. Based on the stack trace the error seems to be related to displaying an image on the PDF page, probably the rendered image is too large. – iPDFdev Mar 09 '23 at 06:45
  • Thanks iPDFdev. So there is a technical limitation that is imposed to be backwards compatible causing embedded images to not display because they do not conform to the limitations used by React-PDF and Firefox. Can I do something about this? – usagibear Mar 09 '23 at 16:37

0 Answers0