GithubHelp home page GithubHelp logo

Comments (11)

Archie3d avatar Archie3d commented on July 28, 2024

Use loadFile instead of loadData, see readme for details.

from qpdf.

WMmono avatar WMmono commented on July 28, 2024

oh,I see.Thank you for your attention.

from qpdf.

WMmono avatar WMmono commented on July 28, 2024

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

from qpdf.

WMmono avatar WMmono commented on July 28, 2024

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

from qpdf.

Archie3d avatar Archie3d commented on July 28, 2024

Have you disabled web security as described in readme?

from qpdf.

WMmono avatar WMmono commented on July 28, 2024

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

from qpdf.

WMmono avatar WMmono commented on July 28, 2024

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

from qpdf.

Archie3d avatar Archie3d commented on July 28, 2024

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

from qpdf.

WMmono avatar WMmono commented on July 28, 2024

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.

from qpdf.

WMmono avatar WMmono commented on July 28, 2024

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

from qpdf.

Archie3d avatar Archie3d commented on July 28, 2024

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

from qpdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.