Support #11276

unable to embed PDF with PDF Embedder

Added by scott voth about 3 years ago. Updated about 3 years ago.

Priority name:
Category name:
WordPress Plugins
Target version:
Start date:
Due date:
% Done:


Estimated time:


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.

pdf msg.png (41.2 KB) pdf msg.png scott voth, 2019-03-27 01:08 PM
pdf in media library.png (161 KB) pdf in media library.png scott voth, 2019-03-27 01:11 PM


#1 Updated by scott voth about 3 years ago

Forgot to give you the site -

#2 Updated by Boone Gorges about 3 years ago

  • Status changed from New to Reporter Feedback

My guess is that you've used the /resources/ URL (the WP URL) instead of the actual file URL (eg Can you try that, or barring that, can you please share the Dashboard URL of a post where you've attempted to perform the embed so that I can look myself?

#3 Updated by scott voth about 3 years ago

Hi Boone - I asked to become an admin of the site and created a page where this happens:

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.

#4 Updated by Boone Gorges about 3 years ago

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 = '' + anchors[i].href;
+                // Exception for pdf-embedder links.
+                if ( -1 !== anchors[i].className.indexOf('pdfemb-viewer') ) {
+                        continue;
+                }
+     anchors[i].href = '' + anchors[i].href;

#5 Updated by scott voth about 3 years ago

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.

#6 Updated by Boone Gorges about 3 years ago

Hi Scott - Any feedback from the user about this?

#7 Updated by scott voth about 3 years ago

  • 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