Fortunately learning how to put a picture on Google Docs is a fairly straightforward process.Īdding an image to a document, spreadsheet, or Web page is a convenient way to provide additional information to your audience. And also, please enable Drive API at Advanced Google services.While many of the documents that you create will only have text, and maybe some lists or tables, occasionally you might need an image or two. Retrieve the blob from the modified link.īefore you run the script, please set the variables of width, outputFilename and url.When =s220 is changed, the size of thumbnail is also changed.Modify the width of the created image file by modifying thumbnailLink.Retrieve the file metadata from the created file.Create the downloaded image as a file to Google Drive.The flow of this workaround is as follows. Unfortunately, in the current stage, there are no methods for resizing directly the image in Google Apps Script. If my understanding is correct, how about this answer? Please think of this as just one of several possible answers. You want to resize a downloaded image using Google Apps Script.Var result = folder.createFile(fileBlob2) Var blobImage = DocumentApp.openById(docfile).insertImage(0, fileBlob) var response = UrlFetchApp.fetch(fileURL) But I have got a problem : the image is scaled down but not at the size I specify. How can I do that?įor your information, a post that can help but finally didn't really help me:(explains how to resize an image, not how to resize an image in a blob) What I want is to resize the image contained in this fileBlob. Var result = folder.createFile(fileBlob) Var folder = DriveApp.getFolderById('THjgj698979XXXXXXXX') I have a blob containing an image that is remotely loaded and created in Google Drive: var response = UrlFetchApp.fetch(fileURL)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |