convert files into PDFs of a driveApp folder

function createPdf(){
  const id = "your_folder_id";
  const folder = DriveApp.getFolderById(id);
  const files = folder.getFiles();
  const folderDes = DriveApp.createFolder("NEW PDF FOLDER")
  while(files.hasNext()){
    const file = files.next();
    const blobFile = file.getAs("application/pdf");
    blobFile.setName('PDF' + file.getName()+ ".pdf");
    const newFile = folderDes.createFile(blobFile);
    Logger.log(newFile.getUrl())
  }
}
0 0 97
0 REPLIES 0
Top Labels in this Space
Top Solution Authors