qpdf icon indicating copy to clipboard operation
qpdf copied to clipboard

FATAL:ipc_mojo_bootstrap.cc(729)] Check failed: message->data_num_bytes() <= Channel::kMaximumMessageSize

Open WMmono opened this issue 2 years ago • 11 comments

when open some big pdf,the program crash.

WMmono avatar Aug 09 '21 18:08 WMmono

Use loadFile instead of loadData, see readme for details.

Archie3d avatar Aug 09 '21 21:08 Archie3d

oh,I see.Thank you for your attention.

WMmono avatar Aug 10 '21 11:08 WMmono

After set #define QPDF_WIDGET_USE_CORS:URL scheme must be "http" or "https" for CORS request.

WMmono avatar Aug 10 '21 12:08 WMmono

Qt version:Qt5.15\Qt5.14 I don't how to fix it.

WMmono avatar Aug 10 '21 13:08 WMmono

Have you disabled web security as described in readme?

Archie3d avatar Aug 10 '21 13:08 Archie3d

I just Uncomment the #define QPDF_WIDGET_USE_CORS in qpdfwidget.h,it will achieve the same effect,I think. but still not work.

WMmono avatar Aug 10 '21 13:08 WMmono

here is the message in console: qrc:/pdfview/pdf.js Fetch API cannot load file:///XXX.pdf. URL scheme must be "http" or "https" for CORS request.

and where the error be thrown var PDFFetchStreamReader = function () { …… fetch(url, createFetchOptions(this._headers, this._withCredentials, this._abortController)).then(function (response) { ……

WMmono avatar Aug 10 '21 14:08 WMmono

You have to inject the --disable-web-security argument into your application as explained in readme.

Archie3d avatar Aug 10 '21 14:08 Archie3d

You have to inject the --disable-web-security argument into your application as explained in readme.

I uncomment the //#define QPDF_WIDGET_USE_CORS in qpdfwidget.h, and it can inject the --disable-web-security argument into my application cloned form your project.

Support for PDF File Viewing was added in Qt 5.13.0. Maybe it's about Qt version.

WMmono avatar Aug 10 '21 15:08 WMmono

I don’t know what the problem is. I've tried Qt5.9.8,but it failed.

WMmono avatar Aug 10 '21 18:08 WMmono

You may attach your pdf and I'll take a look. But mind that this project was created before Qt had a native QPdfDocument implementation. If you are on a newer Qt, you'd rather use pdf renderer that comes with Qt instead of my implementation, see https://doc.qt.io/qt-5/qtpdf-pdfviewer-example.html

Archie3d avatar Aug 10 '21 18:08 Archie3d