-
Notifications
You must be signed in to change notification settings - Fork 3
What about the use of Resources files ? #2
Comments
I didn't try. It is a question support of qresource vfs inside of WebKit. If no then WebKit just can open such files. You can just give a try to know this. |
Ok, I tried I am able to load pdf from resource files but not from file system. The causes is about webengineview. When you set qrc:/viewer.html, the web engine keeps the qrc:/ as the root of the protocol. Is there a way to amend your communicator to allows setting pdf data ? It is mostly javascript. |
I guess so. You can make adjustments to communicator to send bytes of pdf document to js |
Another way - you may try to prepend with "file://" |
Yeah, I've tried already but it does not support different url scheme at the same time. I modify the communicator to manage data. But on javascript side I can't find the right thing to do to load the data as data and not string/path. |
Hi. The solution for this is adding "qrc:" to HOSTED_VIEWER_ORIGINS in the app.js file before minifying. This makes pdf.js think it's hosted, so it can open files from any location |
I'm seeing those lines in your code:
Have you tried to use embedded resources from Qt. Instead of file beside your application it will be inside. Easier to make it movable.
Do you think is it possible (or you did not try for some reason) ?
The text was updated successfully, but these errors were encountered: