How to view Google drive pdf link in iframe

2020-02-09 05:03发布

问题:

I need to view pdf file embed with google drive link and view link in iframe.

I have tried following code:

<iframe src="https://drive.google.com/viewerng/viewer?url=https://library.osu.edu/assets/Documents/SEL/QuickConvertWordPDF.pdf" width="400px" height="300px"  />

Advance thanks..

回答1:

Try this..

<iframe src="https://drive.google.com/viewerng/viewer?
url=https://library.osu.edu/assets/Documents/SEL/QuickConvertWordPDF.pdf?
pid=explorer&efh=false&a=v&chrome=false&embedded=true" width="400px" height="300px"  />


回答2:

This works:

<iframe src="https://drive.google.com/file/d/(your file id)/preview?usp=embed_googleplus" style="border: 0; top: 0; left: 0; width: 640; height: 700; position: absolute;" allowfullscreen></iframe>