Google Docs export to PDF without copying document

When using the Google Docs plugin, the current workflow for exporting to PDF is quite painful. You have to File → Make a Copy, choose a name for the copy, then File → Download. And then presumably delete the copy, because it's basically useless to keep around.

Is it possible to have a "download unlinked" option that combines the above process into one function that produces the final PDF?

I'm somewhat familiar with AppsScript, and I wonder if we could either automate this whole process. One possible angle is to have a button that removes the field codes (NamedRanges?), produces a PDF using `getAs()` (https://developers.google.com/apps-script/reference/document/document#getascontenttype), and then restores the field codes.
  • It's a clever idea, but I highly doubt we'd do this — it seems way too dangerous to perform any operation that unlinks citations in your primary copy of the document. If anything went wrong, which isn't exactly uncommon on Google Docs, you'd potentially lose all your active citations (even if you still had version history, if you knew where to look).
  • Hmm if you wouldn't be comfortable with that approach then it might be a bit tricky. You can duplicate a file using the Drive API, then edit and export it using the Docs API, but I'm not sure if a plugin can use both simultaneously.
  • Yeah, maybe we could pull this off, but the amount of work required to do this would be substantial and that effort is better put elsewhere.
Sign In or Register to comment.