how can I put PDF documents on my website using the google drive api

Asked

Viewed 934 times

0

I am wanting to put Pdfs documents on display on my site in which the administrator would register the link that is in your Google drive and after that the document would be available for normal users to see searching I arrived at the following HTML code:

<iframe src="https://drive.google.com/open?id=1bMIyRuEDg_nsg8uSBu5GBF7CP7sj6wIs" width="600" height="780" style="border: none;"></iframe>

however when I put on the host only appears a blank page with my header and footer without showing the documents

1 answer

0

Use the view option in the document instead of sharing.

<iframe src="https://drive.google.com/file/d/1bMIyRuEDg_nsg8uSBu5GBF7CP7sj6wIs/preview" width="600" height="780" style="border: none;">
    </iframe>
<iframe src="https://drive.google.com/file/d/0BxrMaW3xINrsR3h2cWx0OUlwRms/preview" width="600" height="780" style="border: none;">
    </iframe>
<iframe src="https://drive.google.com/file/d/0B50I05L0hWhcdmw5ck9QRFhMLTQ/preview" width="600" height="780" style="border: none;">
    </iframe>

  • I just don’t understand how you got the preview link because gdrive only shows the share

  • In the case of your document I took the identified from the file '1bMIyRuDg_nsg8uSBu5GBF7CP7sj6wIs' and added /preview. In the other documents as they are on my google drive did. Right click and preview.

  • do not forget to make the file/document visible

Browser other questions tagged

You are not signed in. Login or sign up in order to post.