1,588 questions
0
votes
1
answer
57
views
Can't delete text from Google Doc
I’m trying to amend cells in a Google doc using their api. But I can’t seem to delete text from the tableCell.
I always get the invalid deletion range error. There is this duplicate question.
But the ...
1
vote
0
answers
140
views
Google Docs API - 403 - googleapiclient.errors.HttpError: 403
Problem:
I am facing this error-
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://docs.googleapis.com/v1/documents?alt=json returned "The caller does not have ...
0
votes
0
answers
39
views
Adding text to gdoc using Google API sets random paragraph style
I have the following method that adds formatted text to a data structure for it to be used in a batchUpdate request:
def add_text(
self,
text,
bold=None,
color=None,
...
0
votes
0
answers
97
views
How can I extract a Google Docs Heading2 numbering prefix?
I am trying to build a Script App for Google Docs.
The doc contains titles of style Heading2 as a numbered list, to which a prefix "Chapter " was added.
Therefore I have titles that look ...
2
votes
1
answer
294
views
Lists with mixed bullets & numbers
This is what I'm trying to achieve with Google Docs via the API (as markdown):
### Numbered List with Bullet Points ###
1. Item One
2. Item Two
- Sub-item A
- Sub-item B
3. Item Three
### ...
1
vote
1
answer
103
views
Google Docs API: Text from insertText appears all in the first cell of table — how to correctly insert text into each cell? Using React
I'm working with the Google Docs API to insert a table and then populate each cell with text. The table gets inserted correctly, but when I insert text into the cells, all the content appears squished ...
0
votes
0
answers
54
views
Updating Image Metadata within Google Docs programmatically
I'm looking to programmatically update images within Google Docs, Sheets, and Presentations. I know I can replace images via batchUp using a ReplaceImageRequest, but I have been unable to modify the ...
-2
votes
1
answer
178
views
Is there a way to detect what 'page number' text in a google docs document is on?
I'm trying to find a way to detect what 'page number' text in a google docs document is on. I want to know this so I can determine page breaks accordingly if text would flow over onto the next page ...
0
votes
2
answers
106
views
Moving Value from Google Sheets Cell to Google Doc
I have a Google Sheet that has long blocks of text in each cell of column H (it is input from a long-form response box in a Google Form). I want to take each response and move it onto a new page of a ...
3
votes
1
answer
351
views
How to create google doc tabs with the python sdk
I’m trying to create a Tab in a google doc via the python SDK (as in the new(ish) side navigation/organizational tabs, not a tab character). I see how to read and update existing tabs, but don't see ...
0
votes
0
answers
208
views
Google Drive API: files.get_media()
I have been trying for weeks to just get a docx file from Google Drive using their API. I understand the way to do this would be to use the get_media method, which has worked and I am able to get the ...
0
votes
0
answers
79
views
Why doesn’t @date appear in the JSON response from the Google Docs API?
I’m working with the Google Docs API to retrieve the contents of a document.
Used documents.get with the correct documentId and retrieved the document body.
The JSON response does not include the @...
0
votes
1
answer
60
views
Is there a way to parse Google Docs API into a tree based off headers
In Google Docs, the sidebar will show you a structured tree based off your headings:
However, from what I can see from the Google Docs API, the content seems to be returned as a flat list. Is there ...
0
votes
4
answers
561
views
File exists but I get a 404 error when reading it in Google Docs
I am trying to read the contents of a Google Docs file by using the JavaScript googleapis API. The file exists and I can send the request, but I get a 404 error when reading the contents.
To reproduce:...
0
votes
0
answers
52
views
I am creating a table in Google Docs via API; is it possible to rotate only the table landscape and keep other content as it is?
I am dynamically generating a table in Google Docs using the Google Docs API, with the table data provided in JSON format from an API. I need to rotate the table landscape. I have text paragraph also ...
0
votes
0
answers
127
views
Is it possible to start page numbering from the third page using the Google Docs API?
Currently, the page numbers in our document begin from the Table of Contents page (2). However, we want the page numbering to start from the "Third Page"(3) section instead. How can this be ...
0
votes
0
answers
82
views
Creating a table in Google Docs via API; if it splits across pages then add headers using Java
I am dynamically generating a table in Google Docs using the Google Docs API, with the table data provided in JSON format from an API. I need to check if the table rows across multiple pages. If it ...
1
vote
0
answers
209
views
Specifying tab when exporting Google Doc as PDF via Google Drive API?
I'm wondering if it's possible to specify the tab (recently added to Google Docs) when exporting as PDF via the Google Drive API? (https://www.googleapis.com/drive/v3/files/{fileId}/export)
I can't ...
1
vote
2
answers
6k
views
How to read a public Google Doc using the Google Doc API?
I am attempting to read a Google doc using the Google docs API. However, for public Google docs files I don't have access to the Document ID, and cannot acquire said ID from the author. In particular ...
0
votes
0
answers
48
views
How to Export the Content of a Specific Tab in Google Docs as a Blob or PDF using Google Apps Script? [duplicate]
I’m working on a project where I need to extract the content of a specific tab within a Google Docs document and export it as a Blob or a PDF file using Google Apps Script.
Currently, I can retrieve ...
1
vote
1
answer
88
views
Error 'Action Not Allowed' When Copying Content with a Vertical Line in Google Docs
I have a Google Docs file (link: Google Docs) that contains images and list items. One of the images is a vertical line.
When I try to copy the content of this Google Doc into a new document, I ...
1
vote
2
answers
1k
views
How do you get a document ID from a published Google Doc?
I have been trying to use the Google Docs API to retrieve the contents of a published document, however I realised that the ID in the URL is not a document ID. So does anyone have a clue as to how I ...
0
votes
1
answer
132
views
How do I replace an image with Docs API in Google Apps Script?
Seems like all the documentation I can find for using the Docs API with Apps Script is deprecated. I've tried many variations on the below code, but I keep getting a 404 error from the last line. I ...
0
votes
0
answers
746
views
Unsafe attempt to initiate navigation for frame with origin 'https://accounts.google.com' from frame with URL 'about:srcdoc'
I am trying to work with Google Doc Api integration. In localhost, I successfully fetched the data from google doc. Then I just put the whole code inside an iframe. Now I am getting Access blocked: ...
0
votes
1
answer
298
views
Google Docs Apps Script Extension Add-ons - Greyed Out after Installation
I have retrieved necessary permissions from my admin to publish my Apps Script Extension to the internal Google Martketplace. (You can imagine it to be something similar to the tutorial here)
When ...
-1
votes
2
answers
14k
views
How to get a table from google docs using a URL in python
I've got this google doc URL that I need to extract the contents from, specifically the contents in the table.
https://docs.google.com/document/d/e/2PACX-...
0
votes
0
answers
34
views
I changed the embedded object, but the document was not saved
I am changing the Embedded Object from the Google Docs Api, but the document itself is not saved.
Why?
$doc = $this->service->documents->get($this->iddoc);
$inlineObjects = $doc->...
0
votes
0
answers
131
views
Google Doc API - Access Denied when using a Service Account with Domain Wide Delegation and Scope
I am a super admin of my company's Google Workspace.
And I have written a python script (using the Google Python Client Library) that performs two tasks:
Downloads or exports a file depending on mime ...
3
votes
1
answer
6k
views
Parse Table data from a public google doc using Python
I have a URL to a public google doc which is published (It says published using Google Docs at the top). It has a URL in the form of
https://docs.google.com/document/d/e/<Some long random string, I ...
0
votes
1
answer
106
views
updateTableRowStyle: Unallowed field: tableHeader - Error using Google Docs API
I was trying to "copy" several tables from a GDocs template to another document. Everything was working fine until I tried to "copy" some tables with table headers.
Initially, I ...
2
votes
0
answers
213
views
Cannot access public google docs using the google doc API and its url
I am able to successfully access google docs within my own google drive. The problem is that when I publish the document and try to access it through the published domain, I get the error:
HttpError ...
1
vote
1
answer
160
views
Connection refused after OAuth2 consent in Google Docs API
I am using the quickstart Go script from this page. I have followed all the steps there and I've got my credentials.json. When I'm in the Google login page to give the OAuth consent and I click "...
0
votes
0
answers
87
views
Updating table with google docs api using a placeholder as in identifier
I want to update a table in google docs where my number of columns are fixed to 3, a table with 2 rows and 3 columns is already present in the doc, the code has to identify a placeholder {{asas}} to ...
0
votes
0
answers
94
views
Contextual chunking of PDF's content ,having a problem to replicate logic to nest headings and subheadings while parsing PDFs
def format(json_data):
"""
Extracts document title, headings, subheadings (if present), and content in a specific JSON format.
Args:
json_data: A dictionary ...
0
votes
0
answers
80
views
Writing a list of several mixed types of nested elements in a Google document (Python)
Prerequisites:
Assume that I've created a Google service account, and I've a Google document ID doc_ID.
Problem:
When I've only 2 types of elements (nested list and normal text), subsequent to the ...
2
votes
1
answer
230
views
How to write a list of mixed type of nested elements in Google document using Google Docs API (Python)?
My first post here. My apologies in advance if I inadvertently break any rules.
Prerequisites:
Assume that I've created a Google service account, and obtained the credentials (JSON) file.
I created a ...
0
votes
0
answers
31
views
Google Docs Api Using Create Google Document And Add The Multiple Images
I am create the Google Document and Insert the Multiple Image but Can not Set the Positions how to fix it laravel using Google Docs API
I am Expecting the add the InsertInlineImage Set Position that ...
0
votes
0
answers
64
views
How to retrieve Google Doc first few page Only via API
I'm currently working on a proof of concept (POC) where I need to retrieve only the first 5 pages of a document. Retrieving all pages would exceed Salesforce's heap size limit. While all content is ...
0
votes
1
answer
141
views
Why do I get webpack errors when I add `@googleapis/docs` to my project?
When I add the following...
import {docs} from "@googleapis/docs";
"@googleapis/docs": "^3.0.2",
I get the following
Module not found: Error: Can't resolve 'buffer' in '/...
0
votes
0
answers
61
views
Google Docs API Authorisation - Error 400: redirect_uri_mismatch
I am making an app which will extract text from an image and write that text in a new Google Document.
I have downloaded and set up the 'credentials.json' file. But I am getting an error when the API ...
0
votes
0
answers
65
views
Google Apps Script not inserting image into Google Doc from Drive
I am trying to automate document creation using Google Apps Script by making copies of a template and replacing placeholders with actual data, including an image from Google Drive. However, the image ...
0
votes
0
answers
37
views
Rename a version of a document in Google Docs programmatically
I have a document on Google Docs, for example: https://docs.google.com/document/d/1U_Be02ViQp0UKPYNQo184ks4Vv-ey8mNoawJtTyC1R8
I want to rename a specific version of the document to some name like &...
0
votes
0
answers
44
views
Convert PDF to Google Doc [duplicate]
I'm trying to convert several PDF files to Google Doc with OCR so that I can read the data in the files. The examples on stackoverflow use.
Drive.Files.insert()
But I keep getting an error. Here is ...
1
vote
1
answer
130
views
How to fix error in get doc from Google API?
from google.oauth2.service_account import Credentials
from googleapiclient.discovery import build
import random
import msvcrt
import json
credentials_doc = 'service_account.json'
...
1
vote
1
answer
62
views
google docs boldText until semicolon line by line app script error
function boldTextInLines() {
var doc = DocumentApp.getActiveDocument();
var body = doc.getBody();
var text = body.getText();
var lines = text.split("\n");
for (var i = 0; i < ...
0
votes
0
answers
329
views
Keeping image and text together on one page in Google Docs using Google Apps Script
I am adding data from a Google Forms form to a Google doc.
Part of the form are a couple of images. I am successfully adding them to a Google doc and want to add a text label to describe the image. I ...
0
votes
1
answer
73
views
error while send batchRequests for batchUpdate in google docs with google app script
I am trying to create a copy of Google doc file and replace the text in it using the methods batchRequest, batchUpdate, replaceAllText
As a library, I use the library tanaike batchRequests from ...
0
votes
1
answer
566
views
Remove placeholder text from cell and merge in google docs document using MergeTableCellsRequest
I have a document with multiple tables. Content in the tables is being populated from data from a spreadsheet, with placeholder text being replaced with the text or image in the corresponding ...
0
votes
0
answers
141
views
Google Site: Is there a way to automatically add to a section in Google Site whenever I receive an email containing certain text
Problem: I created a google site. I would like this site to have a running section and what is populated in this section are certain emails that I would like to upload there, either text or PDF. ...
0
votes
1
answer
59
views
Unexpected Blank Line Appearing in Google Doc Created with Apps Script
I'm working on a Google Apps Script that generates a word file based on data from a Google Spreadsheet. The script creates a Google Doc, formats it, and inserts various pieces of information. However, ...