Export a doc to a file
export_docDownload a Google Doc as a local file in PDF, DOCX, or other formats. Specify a folder and format to receive a server-rendered copy with original layout.
Instructions
Export a Google Doc to a real file on disk — pdf (default), docx, odt, rtf, txt, html, epub, or md. Google renders it server-side (File > Download in the UI), so page setup, pagination and layout match the editor. Returns the local path and byte size. Note: Drive refuses to export files larger than 10 MB.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dir | Yes | absolute local folder to save the export into (created if missing) | |
| format | No | default pdf | |
| account | No | Google account email to use. Defaults to GDOCS_DEFAULT_ACCOUNT, or the sole account. | |
| filename | No | override the filename (default: the doc’s title + extension) | |
| documentId | Yes |