How can developers edit a Google Doc programmatically? Is there a Docs API?

前端 未结 6 1210
不思量自难忘°
不思量自难忘° 2020-12-13 21:25

There doesn\'t seem to be (to my knowledge) an API to edit Google Docs (not spreadsheets, their HTML based documents). Has anyone done something like the? Maybe by downloadi

6条回答
  •  爱一瞬间的悲伤
    2020-12-13 22:09

    The Document List API has been deprecated since September 2012 and looks like it could be retired after April 2015.

    Updating the HTML version using the Drive API, as the question suggests, looks to be the only other way. I have been trying this and I have experienced a few of issues.

    1. Comments are converted into citations and added to end of document.
    2. If someone else is editing the doc via the browser any changes made by them between the API read and update time are lost.
    3. Updates to a doc can break the formatting. For example I updated a doc several times and the vertical spacing between some elements (h1's, h2's etc) kept widening each time and ruined the doc.
    4. When an API update occurs the cursor of anyone in the doc is moved to the top of the page.

    There may be more issues. These are just the ones I have found in the last few days.

提交回复
热议问题