Project

General

Profile

Support #13201

PDF embedder

Added by Marilyn Weber over 1 year ago. Updated about 1 year ago.

Status:
Rejected
Priority name:
Low
Assignee:
-
Category name:
-
Target version:
-
Start date:
2020-08-15
Due date:
% Done:

0%

Estimated time:

Description

Apologies if we discussed this before. Is it impossible to use the PDF embedder plugin in the block editor? Someone on Zendesk couldn't find it there but sees it easily in classic. That person't problem is solved, so there's no rush on this "problem" (which may be a Marilyn error and not a problem at all).

History

#1 Updated by Boone Gorges over 1 year ago

What PDF embedding solution did we offer in the past? Scott, do you have info about this?

#2 Updated by Raymond Hoh over 1 year ago

#3 Updated by scott voth over 1 year ago

I notice that if I have hypothesis installed, I get a network error using the block editor.

"Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://via.hypothes.is/https://byline.commons.gc.cuny.edu/files/2018/07/CUNY-Academic-Commons-Annual-Report-2017-2018.pdf. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)."

When I uninstall hypothesis it works in the block editor.

When I use the classic editor I also get a network error. Seems that hypothesis url is getting appended to the front of the PDF url.

But in general, I think PDF embedder works fine with block editor. And as Ray suggests, there is another plugin that does the same thing.

#4 Updated by Boone Gorges over 1 year ago

  • Status changed from New to Reporter Feedback

Scott, could you provide more details on how you're inserting the URL? You say that hypothes.is is prepending the URL, but how are you getting the URL there in the first place?

In the case of the specific URL you're testing with https://byline.commons.gc.cuny.edu/files/2018/07/CUNY-Academic-Commons-Annual-Report-2017-2018.pdf, it appears that this file is not publicly accessible (because the site is not publicly accessible). As such, Hypothesis will not be able to embed it: not because of the CORS headers, but because of WP permissions. See https://redmine.gc.cuny.edu/issues/8944#note-5. See also #11276, where we seem to have experienced a similar mismatch between a particular PDF embedding plugin "PDF Embedder" and Hypothesis.

#5 Updated by scott voth over 1 year ago

Hi Boone - I went to the media library to get the PDF's URL. In the Classic editor, I just pasted in the url on a new line and PDF Embeddeer created a short code ([pdf-embedder url="https://byline.commons.gc.cuny.edu/files/2020/04/Munoz_Disidentifications.pdf"]). In the block editor, I just clicked the plus sign to add a block, picked PDF Embedder block, and pasted the url into the text field.

Also, I temporarily made my test site public, and still got the network error in both the classic and block pages.

#6 Updated by Boone Gorges over 1 year ago

Thanks, Scott. It took me a while to wrap my head around this. (Again. It's mostly the same issue as #11276.) I've made some adjustments to ensure that Hypothesis doesn't wrap its 'via' prefix around pdf-embedder links. I've deployed this to production, where I needed to test the HTTPS issues. Can you have another look?

For the record, I'm still not 100% sure that this is the exact problem being raised by Marilyn in the original post. Marilyn, maybe you have some more context?

#7 Updated by scott voth over 1 year ago

Hi Boone - Your change seems to have done the trick! It is now working with hypothesis installed.

I agree that the issue that Marilyn reported was probably not related to this. I think her issue was the member did not find the PDF Embedder block for some reason. But it is good to have this conflict resolved. :)

#8 Updated by Boone Gorges over 1 year ago

Thanks for confirming, Scott!

#9 Updated by Boone Gorges about 1 year ago

Marilyn, any more word on this?

#10 Updated by Marilyn Weber about 1 year ago

None, you can close it

#11 Updated by Boone Gorges about 1 year ago

  • Status changed from Reporter Feedback to Rejected

Thanks!

Also available in: Atom PDF