1

I am trying to embed a pdf file in HTML and I am getting an error. Here is my code:

<embed src="https://drive.google.com/file/d/1Ur7D9yOxCdKND-aPoY_DkVqa9_071Eaj" width="600" height="500" alt="pdf" pluginspage="http://www.adobe.com/products/acrobat/readstep2.html">

The error I am getting is : Refused to display 'https://drive.google.com/file/d/1Ur7D9yOxCdKND-aPoY_DkVqa9_071Eaj/edit' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

Update:

I have tried to use iframe and I am getting the same error

<iframe src="https://drive.google.com/file/d/1Ur7D9yOxCdKND-aPoY_DkVqa9_071Eaj"></iframe>

0

2 Answers 2

1

You need to set the X-Frame-Options to something other than sameorigin.

I am posting this answer for those that are not sourcing from GDrive and are instead sourcing from their own site.

Sign up to request clarification or add additional context in comments.

1 Comment

@TheOneWhoMade how do you do that
0

Click the Embed option in Google Drive to get an iframe-able URL:

<iframe src="https://drive.google.com/file/d/1Ur7D9yOxCdKND-aPoY_DkVqa9_071Eaj/preview" width="640" height="480"></iframe> 

Comments