Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate preview of documents saved in google drive?

I am trying trying to create a preview of a document saved in google drive using google viewer with -

https://docs.google.com/viewer?authuser=0&srcid={some document id}&pid=explorer&a=v&chrome=false&embedded=true

Unfortunately it only works for pdf files. The other important point is that I want to do it without making the uploaded document public.

like image 742
Niranja Avatar asked Dec 13 '25 15:12

Niranja


2 Answers

For get PDF file preview you can use below link :

https://lh3.google.com/u/0/d/]{FILEID}=w200-h150-p-k-nu-iv1

for example : https://lh3.google.com/u/0/d/0BwVBMmQvtcsJUkNSVFllbjRLMzZab0haTEtLajE1M2haekZj=w200-h150-p-k-nu-iv1

like image 54
user7176550 Avatar answered Dec 15 '25 06:12

user7176550


Try using this URL for PDF: http://docs.google.com/viewer?url=https%3A%2F%2Fdocs.google.com%2Fuc%3Fexport%3Ddownload%26id%3D{fileID}&embedded=true

and this URL for other files: https://docs.google.com/viewer?url=https%3A%2F%2Fdocs.google.com%2Fdocument%2Fd%2F{fileID}%2Fexport%3Fformat=pdf&embedded=true

Keep in mind that files should be public.

like image 33
niutech Avatar answered Dec 15 '25 08:12

niutech



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!