google-docs

Google Apps Script getWidth() for document table cell width returns null

杀马特。学长 韩版系。学妹 提交于 2020-08-26 07:43:29
问题 I'd like to insert image in the Google document by using Google Apps Script, and to spread it (the image) to the width of the page - margins or to insert it in the table cell and spread it to the width of the cell. The code goes like this: var image = DriveApp.getFileById(fileId).getBlob(); var insertPlace = body.findText(searchText).getElement(); insertPlace.asText().setText(""); var insertedImage = insertPlace.getParent().asParagraph().insertInlineImage(0, image); var h = insertedImage

How to get the table width

眉间皱痕 提交于 2020-08-26 07:24:10
问题 I want to get the width of a table in Google Documents. The following screenshot shows a demo document. It has only a table having one row which has only one cell. The table was added by clicking on Insert > Table and then on the option to insert a table with a single row and single cell. The table was not manipulated after being inserted. In the Class Table from the Google Apps Script Class Table it hasn't a method to get the width, the Class Row either, but the Class Cell has getWidth() ,

Google Docs API - Update linked tables

99封情书 提交于 2020-08-26 03:38:36
问题 I am trying to update tables in Google Documents with the new API. Tables are linked from a Google Sheet. I tried the API explorer in google cloud. I am able to extract the document in json format and then filter out the tables. But within the table json structure, I do not find anything that I can update, I do not find anything that links the table to a spreadsheet. It is plain text (from the cells in the spreadsheet). Here I am sharing one table from the json, with 2 rows and 1 column with