qpdf
qpdf copied to clipboard
FATAL:ipc_mojo_bootstrap.cc(729)] Check failed: message->data_num_bytes() <= Channel::kMaximumMessageSize
when open some big pdf,the program crash.
Use loadFile
instead of loadData
, see readme for details.
oh,I see.Thank you for your attention.
After set #define QPDF_WIDGET_USE_CORS:URL scheme must be "http" or "https" for CORS request.
Qt version:Qt5.15\Qt5.14 I don't how to fix it.
Have you disabled web security as described in readme?
I just Uncomment the #define QPDF_WIDGET_USE_CORS in qpdfwidget.h,it will achieve the same effect,I think. but still not work.
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) { ……
You have to inject the --disable-web-security argument into your application as explained in readme.
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.
I don’t know what the problem is. I've tried Qt5.9.8,but it failed.
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