问题
Is there a way to save a Google Slides as PDF file by using Google Apps Script?
I could only find solutions for saving Google Docs and Sheets.
回答1:
How about this sample script? When Google Docs (Spreadsheet, Document and Slide) is saved and/or downloaded using DriveApp.createFile()
, the file format automatically becomes PDF. So we can use the following script.
Sample script :
var blob = DriveApp.getFileById("### Slide file ID ###").getBlob();
DriveApp.createFile(blob);
Note :
In this case, the filename of created PDF file is the same to the slide.
Edit :
If you want to copy the slide file, please use a following script.
var file = DriveApp.getFileById("### Slide file ID ###");
file.makeCopy(DriveApp.getFolderById("### Destination folder ID ###"));
来源:https://stackoverflow.com/questions/46819079/save-google-slide-as-pdf-using-google-apps-script