Closed lmartins closed 8 years ago
I don't know why the pdf.js script is using Mozilla as a CDN rather than being included in this plugin, other than that its a big script which would be unwieldy to package here and keep up to date.
The issue you're seeing seems to be one with your dev server not sending proper CORS headers along with the PDF. Are you able to modify those headers? The PDF file itself needs to have "Access-Control-Allow-Origin" headers which allow your site to access it.
I don't know why the pdf.js script is using Mozilla as a CDN rather than being included in this plugin, other than that its a big script which would be unwieldy to package here and keep up to date.
When I created the shortcode originally, I spent about an hour trying to get pdf.js
to work in its own right, and then realized it would be easier to just pass the file to the Github reader.
IIRC, the actual JavaScript for rendering a PDF is trivial to use. However, the basic script simply dumps a plan representation of the PDF on the page. Using mozilla.github.io provides all of the PDF reading UI (zoom in and out, etc.)
I see. I'll look into the headers thing. Not sure about the Github as a "CDN" hopefully they won't block later on.
Hi,
Im having a few issues with the PDF shortcode and while investing it i've noticed that the JS assets related to this shortcode are beying loaded from mozilla.github.io
The issue I was having btw is the following:
XMLHttpRequest cannot load http://gravity.webipack.dev/wp-content/uploads/sites/8/2016/01/finalizadores_e_preparadores-gel.pdf. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://mozilla.github.io' is therefore not allowed access.