google-slides-api

Save Google Slide as PDF using Google Apps Script

♀尐吖头ヾ 提交于 2020-06-26 05:03:13
问题 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,

Control Google Docs embedded viewer with JavaScript

穿精又带淫゛_ 提交于 2020-05-25 06:56:29
问题 I need to control the embedded Google Docs viewer in my site. More specifically I need to be able to enable/disable the controls for Google Slides view and to be able to start/stop the presentation with JavaScript. I was not able to find any JavaScript API for that, nor I have been able to add my host so my JavaScript to be able to communicate with the iframe content. Anyone did something like this? 回答1: Google Docs doesn't work like that at all. Here are the steps you will need to take. 1:

Getting title of slide in Google Apps Script

核能气质少年 提交于 2020-04-10 04:46:37
问题 I'm attempting to write a google apps script that takes the slide titles of every slide (as they are in the master slides) and put them in a nicely formatted table of contents on slide 2. It doesn't necessarily have to be done with apps script, but this is the best way I could think of. function readPageElementIds(presentationId, pageId) { var response = Slides.Presentations.get( presentationId); Logger.log(response.slides) for (var i = 0; i < response.slides.length; i++) { var slide =

Is it possible to add local image to Slide using Google Slides API and Python?

旧时模样 提交于 2020-04-07 07:54:55
问题 I want to create a new slides out of the local images using Python. Unfortunately, I do not see an example to upload a local image, only an image URL via the official documentation. That's why I'm wondering is it possible to do that at all? If it is I would appreciate any kind of help. Thank you very much 回答1: From the official documentation: https://developers.google.com/slides/how-tos/add-image If you want to add private or local images to a slide, you'll first need to make them available

The method presentations.batchUpdate throws “Internal error encountered”

流过昼夜 提交于 2020-03-25 13:44:43
问题 I'm working on generation of Google Presentation and sometimes batchUpdate throws the error: { "error": { "code": 500, "message": "Internal error encountered.", "status": "INTERNAL" } } Here's the example of the request body 回答1: Issue: Your request body is huge. You are requesting many updates in the presentation with a single call. Since you are getting a 500 error, the server is most likely having problems while processing this huge amount of requests. It's certainly not a question of

The method presentations.batchUpdate throws “Internal error encountered”

时光毁灭记忆、已成空白 提交于 2020-03-25 13:44:07
问题 I'm working on generation of Google Presentation and sometimes batchUpdate throws the error: { "error": { "code": 500, "message": "Internal error encountered.", "status": "INTERNAL" } } Here's the example of the request body 回答1: Issue: Your request body is huge. You are requesting many updates in the presentation with a single call. Since you are getting a 500 error, the server is most likely having problems while processing this huge amount of requests. It's certainly not a question of

Copying Multiple Slides from a Master Slide Desk using Google Apps Script

坚强是说给别人听的谎言 提交于 2020-03-25 06:04:39
问题 I have created a code which replaces placeholders on google slides. The starting point of this project is a google form. Once the google form has been submitted - then the relevant data from google form is entered on the google slides template. See below code. I am looking to create a question on the form where people will be able to select multiple slides to be included (2 Credential slides for example out of 10) function PoD() { SpreadsheetApp.getActiveSpreadsheet().getSheetByName("A-PoD")

Copying Multiple Slides from a Master Slide Desk using Google Apps Script

你说的曾经没有我的故事 提交于 2020-03-25 06:02:38
问题 I have created a code which replaces placeholders on google slides. The starting point of this project is a google form. Once the google form has been submitted - then the relevant data from google form is entered on the google slides template. See below code. I am looking to create a question on the form where people will be able to select multiple slides to be included (2 Credential slides for example out of 10) function PoD() { SpreadsheetApp.getActiveSpreadsheet().getSheetByName("A-PoD")

Using Google appscript to refresh tables pasted in from Google sheets into Google slides

旧街凉风 提交于 2020-03-23 07:27:44
问题 This question here has as succinct solution for updating Google Sheets charts linked to Google slides. function onOpen() { var ui = SlidesApp.getUi(); ui.createMenu('Custom Menu') .addItem('Batch Update Charts', 'batchUpdate') .addToUi(); } function batchUpdate(){ var gotSlides = SlidesApp.getActivePresentation().getSlides(); for (var i = 0; i < gotSlides.length; i++) { var slide = gotSlides[i]; var sheetsCharts = slide.getSheetsCharts(); for (var k = 0; k < sheetsCharts.length; k++) { var

Google script replaceAllShapesWithImage with image from drive doesn"t work any more

扶醉桌前 提交于 2020-03-10 04:37:35
问题 Since yesterday one of my google script doesn't work anymore. The script take an image on the drive copie a slide replace a shape with an image But I got this error: "The provided image is in an unsupported format." -> I give all access to the image: it doesn't change anything -> The script work if I take an url outside the drive Any idea function test_image(){ var imageUrls = DriveApp.getFilesByName("DSC_3632.png"); var file = "undefined"; while ( imageUrls.hasNext()) { var file = imageUrls