Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
WMmono opened this issue Aug 9, 2021 · 11 comments

Comments

@WMmono
Copy link

WMmono commented Aug 9, 2021

when open some big pdf,the program crash.

@Archie3d
Copy link
Owner

Archie3d commented Aug 9, 2021

Use loadFile instead of loadData, see readme for details.

@WMmono
Copy link
Author

WMmono commented Aug 10, 2021

oh,I see.Thank you for your attention.

@WMmono WMmono closed this as completed Aug 10, 2021
@WMmono WMmono reopened this Aug 10, 2021
@WMmono
Copy link
Author

WMmono commented Aug 10, 2021

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

@WMmono
Copy link
Author

WMmono commented Aug 10, 2021

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

@Archie3d
Copy link
Owner

Have you disabled web security as described in readme?

@WMmono
Copy link
Author

WMmono commented Aug 10, 2021

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
Copy link
Author

WMmono commented Aug 10, 2021

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) {
……

@Archie3d
Copy link
Owner

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

@WMmono
Copy link
Author

WMmono commented Aug 10, 2021

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
Copy link
Author

WMmono commented Aug 10, 2021

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

@Archie3d
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants