PDF Embed error

I use the JW PDF embed stack and get the following error:

PDF.js v2.2.228 (build: d7afb74a)
Message: Origin http://svmi.web.ve is not allowed by Access-Control-Allow-Origin.

URL: http://svmi.web.ve/estatutos/index.php
Any help?


Looks like something else on the page is stopping the PDF from being ‘called’.

Can you create a new page with nothing on it apart from the PDF Embed stack (and whatever PDF you’re trying to show) don’t display it in navigation and then publish to see if that works. If it does, then you can try adding in the other page elements one by one until you find whatever is breaking it.

Or page @joeworkman.


Make sure that the domain of the pdf url matches the domain name in your browser. It must match EXACTLY. This is a browser security rule, not mine.

It’s because the PDF is trying to load from the URL with WWW in it over the connection without WWW. Make sure the URLs match.

If you use http://www.svmi.web.ve/estatutos/index.php, the PDF loads.

1 Like

@robbeattie: I removed one by one the other three stacks from the page. The error persists.

Domain match exactly

I can’t use the url you suggest, the document is in a warehouse folder, (wh). hence the URL http://www.svmi.web.ve/wh/documentos/ESTATUTOS-SVMI-2017.pdf
If you type this URL in the browser, the PDF is displayed

At the end I deleted www from the pdf URL and is working.
A big thanks to all you,


Yes, but if someone goes to http://www.svmi.web.ve/estatutos/index.php, it won’t work because the domains don’t match.

You need to choose which version you’re going use: with WWW or without WWW, then make sure to redirect users to whichever version you choose.

@NeilUK You are right Neil, but the user is supposed to go to that page from the site menu.
It’s still a strange issue anyway.

As I said the domain need to match exactly what is inside the browser. Google (and browsers) sees these four website address as different websites…


You need to pic one combination and redirect all others to it. Again, this is nothing to do with my PDF Embed stack. It’s just how the web needs to work going forward.

Here are some nice tips for the htaccess rules to accomplish that… https://weaver.tips/search?q=htaccess

@joeworkman Let me try to understand. The address on the RW General site is: http://www.svmi.web.ve/.
In PDF Embed the URL is: http://svmi.web.ve/wh/documentos/ESTATUTOS-SVMI-2017.pdf, because the pdf is in a warehouse (wh) folder. It appears in Preview without problems.
But when I publish the page the pdf will not display, unless I remove www from the pdf url. :thinking:

https://www.example.com can contain a totally different website then https://example.com.

So it’s being treated as a origin.

You can either change the URLs to point to the same origin or add a directive to the http header:

Access-Control-Allow-Origin: http://www.example.com

Then set the URL of the PDF to… http://www.svmi.web.ve/wh/documentos/ESTATUTOS-SVMI-2017.pdf

It was the original setting:


and the result:

So I deleted www:

And it works.

If you read my post above again. It all depends on the URL that you visit in the browser. Try all 4 links that I posted above. Only one will work. That is the one where the domain in the browser matches the domain in the PDF setting.

Exactly Joe.
In the end, work with the first one you mention, that is, without www, which is what I finally did.


problem solved.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.