• Resolved gottfrieds

    (@gottfrieds)


    I downloaded the plugin and tried it. In the backend: The plugin loads the file, displays it very shortly and then appeears a black background and the following error message:

    PDF.js Version 1.9.426 (build: 2558a58d)
    Nachricht: file origin does not match viewer’s

    I tried several PDFs. Allways the same. What might be the reaseon?

    • This topic was modified 5 years, 8 months ago by gottfrieds.
Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Kevin Bazira

    (@kevinbazira)

    Hi @gottfrieds,

    Thanks for your interest in the Algori PDF Viewer plugin.

    Please clarify whether you’re using the “Insert from URL” option to upload your PDF to the viewer.

    The error you’re getting suggests that the problem is Cross-Origin Resource Sharing (CORS)

    Kindly try to use the “Media Library” option to upload your PDF to the viewer.

    Please let us know whether this helps.

    Thanks

    Thread Starter gottfrieds

    (@gottfrieds)

    Sorry, but it makes no difference whether I use an URL or upload or mediathek, It is always the same behauvior. Short display of the document and then the error message.

    Plugin Author Kevin Bazira

    (@kevinbazira)

    Hi @gottfrieds,

    Could you please try to use other browsers like Chrome or Firefox and see whether this behavior prevails. Follow the steps below;

    STEP 1:
    Go to your WordPress Media Library, click “add new” then upload your PDF.

    STEP 2:
    Using Chrome: open a new post, add the PDF viewer block, use the “Media Library” option to add your PDF to the viewer then save and preview.

    STEP 3:
    Perform STEP 2 using Firefox.

    PS: Run all these steps from the same website.

    Kindly let us know how this goes.

    Thanks

    Thread Starter gottfrieds

    (@gottfrieds)

    I followed your advice. The images show the result.

    Chrome Browser

    Firefox Browser

    I used two different PDFs working fine with Adobe reader.

    • This reply was modified 5 years, 7 months ago by gottfrieds.
    Plugin Author Kevin Bazira

    (@kevinbazira)

    The screenshots you shared show results from only the Chrome browser but that is fine. Please try the steps below;

    STEP 1:
    As shown in the screenshot below, click “More Options” then on the pop-up menu click “Edit as HTML”
    algori pdf viewer

    STEP 2:
    Please clarify whether the first part of “URL of the viewer”, matches the “URL of the PDF”, as well as the “URL of your website”.
    algori pdf viewer

    STEP 3:
    Kindly let us know whether these URLs match and if possible share a screenshot as well.

    Thanks

    Thread Starter gottfrieds

    (@gottfrieds)

    This is the result of the HTML research:

    <div class="wp-block-cgb-block-algori-pdf-viewer">
       <iframe class="wp-block-cgb-block-algori-pdf-viewer-iframe" src="https://huppenbroich.de/simwae/wp-content/plugins/algori-pdf-viewer/dist/web/viewer.html?file=http%3A%2F%2Fswimages.huppenbroich.de%2F%2F2019%2F03%2FSPD_Europaprogramm_2019.pdf" style="width:600px;height:300px">
    </iframe>
    </div>
    Thread Starter gottfrieds

    (@gottfrieds)

    This is the error message found in tne Console of Opera:

    network.js:71 The provided value ‘moz-chunked-arraybuffer’ is not a valid enum value of type XMLHttpRequestResponseType.
    supportsMozChunkedClosure @ network.js:71
    (anonymous) @ network.js:61
    __w_pdfjs_require__ @ bootstrap b5fe8ab6eb949fc98816:19
    (anonymous) @ pdf.js:34
    __w_pdfjs_require__ @ bootstrap b5fe8ab6eb949fc98816:19
    (anonymous) @ bootstrap b5fe8ab6eb949fc98816:65
    (anonymous) @ bootstrap b5fe8ab6eb949fc98816:65
    webpackUniversalModuleDefinition @ universalModuleDefinition:9
    (anonymous) @ universalModuleDefinition:10
    app.js:1429

    Uncaught (in promise) Error: file origin does not match viewer’s
    at validateFileURL (app.js:1429)
    at webViewerInitialized (app.js:1471)
    validateFileURL @ app.js:1429
    webViewerInitialized @ app.js:1471
    Promise.then (async)
    run @ app.js:430
    webViewerLoad @ viewer.js:187

    • This reply was modified 5 years, 7 months ago by gottfrieds.
    Plugin Author Kevin Bazira

    (@kevinbazira)

    Thanks for sharing the code snippet @gottfrieds

    Based on the code analysis, we have found out that the PDF viewer is installed on this domain: https://huppenbroich.de/

    And your PDF is being served from this sub-domain: https://swimages.huppenbroich.de/

    As explained in the previous comments, for the PDF viewer to work – both the viewer and PDF have to be on the same domain to avoid Cross-Origin Resource Sharing (CORS) issues.

    We are proposing the 2 solutions below;

    1. Either upload your PDF to the domain https://huppenbroich.de/ and use the PDF viewer from this same domain.

    2. Or use a plugin like this one to adjust your HTTP Headers and give this domain: https://huppenbroich.de/ permission to access resources from this sub-domain: https://swimages.huppenbroich.de/

    The solutions above should be able to help.

    Thanks

    Thread Starter gottfrieds

    (@gottfrieds)

    Yes, now it is solved. My wp media data reside on this subdomain. I moved the pdf files to another directory where the wp files are – and it is successfull noe.

    Thanks a lot!

    Plugin Author Kevin Bazira

    (@kevinbazira)

    You are welcome. I am glad I was able to assist you today.

    If you don’t mind rating and writing a quick review on Algori PDF Viewer here, that would be awesome.

    It will help prospective users to feel more confident in choosing our PDF viewer.

    Thank you @gottfrieds

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘File not displayed’ is closed to new replies.