At a glance
- Input
- A Drive, Docs, Sheets or Slides link, from the Share button or the address bar
- Output
- A rewritten link, shown in The link that goes in the code
- Modes
- Preview, Download, Open
- Error correction
- Level M
Links it recognises
It looks for /document/, /spreadsheets/, /presentation/ or a drive.google.com address, and then for the file id. Anything else gets: That does not look like a Google Drive, Docs, Sheets or Slides link.
Modes and the links they make
All examples start from the same Doc link copied from the editor, .../document/d/<id>/edit?usp=sharing.
| File | Mode | Link in the code |
|---|---|---|
| Google Doc | Preview, read only | https://docs.google.com/document/d/1AbCdEfGhIjKlMnOpQrStUv/preview |
| Google Doc | Download as a file | https://docs.google.com/document/d/1AbCdEfGhIjKlMnOpQrStUv/export?format=pdf (PDF) |
| Google Doc | Open as normal | https://docs.google.com/document/d/1AbCdEfGhIjKlMnOpQrStUv/edit |
| Google Sheet | Download as a file | https://docs.google.com/spreadsheets/d/1AbCdEfGhIjKlMnOpQrStUv/export?format=xlsx (Excel) |
| Google Slides | Download as a file | https://docs.google.com/presentation/d/1AbCdEfGhIjKlMnOpQrStUv/export?format=pdf (PDF) |
| Drive file | Preview in Drive | https://drive.google.com/file/d/1AbCdEfGhIjKlMnOpQrStUv/view |
| Drive file | Download the file | https://drive.google.com/uc?export=download&id=1AbCdEfGhIjKlMnOpQrStUv |
For a Drive file, Open in Drive makes the same /view link as Preview. The usp=sharing part of the original link is dropped in every mode.
Sharing settings
Set sharing firstOnce it recognises a link, the tool reminds you: set sharing to Anyone with the link, Viewer. Without that, people who scan the code are asked to request access.
Test the code in a private browser window, where you are signed out, before printing. Our Google Drive guide walks through it.
What it does not do
- It cannot change sharing settings for you, or see whether they are right.
- It does not open the file, so it cannot tell whether the link works.