有没有办法在 wojtekmaj React-PDF 和 Firefox 中支持大于 200 英寸的 PDF?

问题描述 投票:0回答:0

我有一个应用程序可以将一些文件转换为 PDF。当我在 Chrome 或 Edge 中打开文件时,它会加载,尽管速度很慢。在 Abode Acrobat Reader 中,它加载文件但被截断。

但是,该文件无法在 Firefox 中正确加载,Firefox 使用 PDF.js 作为其 PDF 查看器的基础。 React-PDF 查看器中也存在此问题。

报错如下:

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]"

我可以在 PDF.js 或 React-PDF 中做些什么吗?

Acrobat 截断 PDF 的原因可能是因为页面两边 200 英寸的限制。至于 Firefox 和 PDF.js,我不知道,但可能是类似的限制。

reactjs pdf pdf.js react-pdf
© www.soinside.com 2019 - 2024. All rights reserved.