Say you have spent an hour with Gemini polishing the store description for an app, and the draft finally reads the way you want. Before it goes to a client, you would like to keep "the version as of today." You open Share & export under the answer and find Docs, a Gmail draft, Sheets for tables, Colab and Replit for code. No PDF.
A Zenn article comparing how ChatGPT, Claude, and Gemini let you turn a conversation into a document, based on each vendor's help pages, made the same observation: PDF is the one option missing from all three. Anyone who drafts submission material with an AI as an indie developer is likely to run into the same spot.
So I reread the official help and reference pages and put together a small way to freeze a PDF through Docs. One thing up front: the Apps Script part has been checked as logic against a mock of the Apps Script services, not run on a real Google account. I describe that boundary at the end.
What the official pages say (checked 2026-10-15)
The Gemini Apps Help has two relevant passages.
The "Export responses" page lists Docs, a Gmail draft, Sheets for responses that contain a table, and Colab or Replit for code, all under Share & export. Exporting to Docs "saves a new doc in Google Drive."
The "Use Gemini Apps" page has a section on generating files from a chat. You ask for a response in a supported file type, and the list of supported formats includes .pdf alongside Docs, Sheets, .docx, .xlsx, and .csv.
So a missing menu entry and an inability to make PDFs are two different things. The Zenn article is right about the Share & export path; asking Gemini to produce a PDF is a second route on top of it.
Decide why you want the PDF first
Before choosing a tool, it helps to say in one line what the PDF is for. I see three reasons:
- To freeze the content at the moment you hand it over. A Docs link always shows the latest version, so later edits reach the other person too.
- To be able to go back to "the draft from that day." With the date in the file name, opening the folder tells you the order.
- To separate the sharing scope from the original document. A PDF is its own file, so you can pass it on without widening the original's sharing settings.
If none of these applies, leaving it as a Doc is the least effort.
Three routes side by side
| Route | Effort | Good for | Watch out for |
|---|---|---|---|
| Ask Gemini to produce a PDF | One extra phrase in the prompt | A one-off where you do not mind how it looks | You rename and file the result yourself |
| Export to Docs, then File → Download → PDF | A few clicks | When you want to edit after exporting | The file lands in your Downloads folder, away from the source |
| Export to Docs, then freeze with Apps Script | About five minutes of setup | A repeated task where you want a history | It needs Drive authorization |
For a single use, the first two are enough. The third pays off if you repeat the same cycle every week: draft a proposal with Gemini, then keep the version you actually sent.
Export to Docs, then freeze with a date
Export the answer to Docs from Share & export, open that document, and choose Extensions → Apps Script. Paste the code below and save, and a "PDF で固定" (Freeze as PDF) menu appears in Docs.
The code solves two problems: gathering PDFs next to the source document, and putting a timestamp in the name so versions are not overwritten or mixed up.
/**
* Turns a Doc exported from Gemini into a dated PDF and places it
* in a "PDF" folder next to the source (run from the Docs menu).
*/
const PDF_FOLDER_NAME = 'PDF';
function onOpen() {
DocumentApp.getUi()
.createMenu('Freeze as PDF')
.addItem('Create dated PDF', 'exportDocAsDatedPdf')
.addToUi();
}
function exportDocAsDatedPdf() {
const doc = DocumentApp.getActiveDocument();
const file = DriveApp.getFileById(doc.getId());
const stamp = Utilities.formatDate(new Date(), Session.getScriptTimeZone(), 'yyyy-MM-dd_HHmm');
// Ignore the name getAs() assigns; decide the final name ourselves
const blob = file.getAs(MimeType.PDF).setName(buildPdfName(doc.getName(), stamp));
const folder = getOrCreateFolder_(file, PDF_FOLDER_NAME);
const pdf = folder.createFile(blob);
const ui = DocumentApp.getUi();
ui.alert('PDF created', folder.getName() + ' / ' + pdf.getName(), ui.ButtonSet.OK);
}
function buildPdfName(docTitle, stamp) {
const base = String(docTitle).replace(/[\\/:*?"<>|]/g, '_').trim() || 'untitled';
return base + '_' + stamp + '.pdf';
}
function getOrCreateFolder_(file, name) {
const parents = file.getParents();
const parent = parents.hasNext() ? parents.next() : DriveApp.getRootFolder();
const found = parent.getFoldersByName(name);
return found.hasNext() ? found.next() : parent.createFolder(name);
}Here is why it is written this way.
The timestamp format yyyy-MM-dd_HHmm sorts chronologically as plain text. Minutes are included because you may freeze several drafts in a day. Running it twice in the same minute produces two files with the same name; Drive allows that, so nothing fails.
The trailing underscore on getOrCreateFolder_ is the Apps Script convention for a private helper that does not appear in the menu or the run list. It creates the PDF folder once and reuses it afterwards.
buildPdfName swaps characters that are not safe in file names for _ and falls back to untitled if the title is empty.
The naming trap
The obvious first version passes the Blob from getAs(MimeType.PDF) straight to createFile. The official reference for getAs contains a sentence worth reading twice:
It assumes that the part of the filename that follows the last period (if any) is an existing extension that should be replaced. Consequently, "ShoppingList.12.25.2014" becomes "ShoppingList.12.25.pdf".
If you like dates written with periods, a document titled "2026.10.15 Minutes" would, by that rule, come out as "2026.10.pdf". The day and the title both vanish, and the name can collide with another document from the same month.
There are two defenses. Separate dates with - or _. And call setName after getAs, as the code does, so the final name is yours regardless of periods in the title. Either one alone helps; together they leave nothing to chance.
Before you run it
The first run shows an authorization screen. The script reads a Drive file and writes into a folder, and the reference lists https://www.googleapis.com/auth/drive for these calls. A read-only scope is not enough for createFile.
If it is your own script on your own document, you decide what to accept. If you share or copy a document that contains the script, though, the next person is asked for the same approval. For ways to keep scopes narrow, see Keeping Apps Script × Gemini Automation Permissions Minimal.
Also note that the PDF folder is created under the same parent as the source document. If that parent is shared with other people, sharing in Drive extends to what is inside it. If the frozen PDFs are meant to be pre-send drafts, look at the parent folder's sharing first. A related angle, how far Gemini itself can read into Drive, is covered in Before Unsharing Drive from Gemini, Try This Setting.
What was checked, and what was not
Checked: two pages of the official help (exporting responses, generating files) and the Apps Script reference for File.getAs and Folder.createFile. I also ran the code in Node.js against stand-ins for the Apps Script services and confirmed that exactly one folder is created, that PDFs accumulate in it, and that titles with special characters or an empty title produce the expected names.
Not checked: a run on a real Google account. The wording of the consent screen, the title of the exported Doc, and how tables or images look in the PDF are things to see for yourself. Try it first on a document you do not mind losing.
My rule of thumb
What I send to someone else is a separate, dated file, not a Docs link. A link is convenient, but from the moment I hand it over, the other person's screen follows my edits. A PDF is less convenient exactly because it stops moving.
To get started, press the menu once on an exported Doc and look at what appears in the PDF folder. Adjust the naming format to your own filing afterwards.
If you also track Gemini usage from Sheets, Working Out a Monthly Gemini Bill from Sheets Across a Year-End Price Change describes a ledger approach in Apps Script.