4

Is there a way to export / serve a document as a PDF via the API in google app script?

I know there exists a download as pdf option, but I am not looking for that. I am looking to create a PDF document in google drive via the app script API.

2 Answers 2

4

Yes. Try the File.getAs() method

Sign up to request clarification or add additional context in comments.

Comments

3

I use this:

oOutputFile.saveAndClose();
DocsList.createFile(oOutputFile.getAs('application/pdf')).rename(cOutputName+".pdf");

where oOutputFile is my Doc, and cOutputName is the name I want to give to the file.

Chris

1 Comment

This answer is obsolete. DocsList was retired.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.