Support #11276
closed
unable to embed PDF with PDF Embedder
Added by scott voth about 6 years ago.
Updated almost 6 years ago.
Category name:
WordPress Plugins
Description
Stefania Porcelli is trying to embed a PDF in a page using PDF Embedder.She is getting message "PDF must be on exactly the same domain as current webpage" (see attached screenshot).
For some reason, I noticed that the media is getting uploaded to a subfolder called /resources/ (see second attached screenshot).
Stefania tried to upload it again and it went into that subfolder again.
Files
- Status changed from New to Reporter Feedback
Hi Boone - I asked to become an admin of the site and created a page where this happens: https://divinecomedy19.commons.gc.cuny.edu/test-pdf/
I don't see that /resources/ subfolder that I saw on her screenshot - it seems to be going to the actual file URL in my example. And the PDF does download from there.
Thanks, Scott. It looks like this is an incompatibility between PDF Embedder and the Hypothesis plugin. Hypothesis greedily tries to hijack each PDF link on the page, pointing the links toward the Hypothesis mirror. This is why it's setting off the cross-domain browser warnings.
I've just put a hotfix in place to test a compatibility fix. Because I'm not very familiar with the way that Hypothesis PDF linking is supposed to work, I wonder if you, Scott, might test around the Commons to see if that feature of Hypothesis is working elsewhere as expected?
Posting the diff below for my info (wp-content/mu-plugins/js/cac-via-pdf.js)
for ( i=0; i<anchors.length; i++ ) {
var href = anchors[i].href;
if ( href.match(hypRe) )
- anchors[i].href = 'https://via.hypothes.is/' + anchors[i].href;
+ // Exception for pdf-embedder links.
+ if ( -1 !== anchors[i].className.indexOf('pdfemb-viewer') ) {
+ continue;
+ }
+
+ anchors[i].href = 'https://via.hypothes.is/' + anchors[i].href;
}
Thanks Boone! I will investigate Hypothesis PDFs on my test site. I also asked Stefania to report if she sees any odd behavior with Hypothesis.
Hi Scott - Any feedback from the user about this?
- Status changed from Reporter Feedback to Resolved
Everything is fine now with this issue. I haven't heard of any problems.
Also available in: Atom
PDF