documentViewer issues with PF-Ext 11

Community Driven Extensions Project
Post Reply
ybendek
Posts: 102
Joined: 05 Aug 2011, 17:52

06 Oct 2022, 05:04

Hello

I'm trying to use the component pe:documentViewer with PF11.0.0 and primefaces-extensions. The URL for the file I'm trying to view in the component is from a external URL.

However everytime I'm try to use it, the component is render with only the header but no a file is displayed. Instead of the file the following message is displayed in the screen and in the console:

PDF.js v2.11.338 (build: dedff3c98)
Message: file origin does not match viewer's

I try this same code with different versions of primefaces-extensions (11.0.0, 11.0.3, 11.0.5, 11.0.6) but nothing, all of them has the same results

Melloware
Posts: 3716
Joined: 22 Apr 2013, 15:48

06 Oct 2022, 14:02

Yep if you are trying to load a URL that is not the same as your URL of your app that is a CORS issue: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

I would download the file in your Java code from the external site and then make that the value coming from your controller to render the PDF.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests