How Can I Merge two Google Doc documents directly by providing only DocIds (docId1 & docId2)?

Dear All,

I am looking for Solution to merge two google doc Documents.
I have created Two Document using Google Doc Create Document API. I have used Java as a programming language. I want to merge document with all text as well as all styling possibilities including images, tables and lists. 

We can able to read Structural Elements of Document-1 and prepare text, styling and other requests to write in Document-2. But it is a lengthy and not a good approach to do as writing every possible styling is very complex, Difficult and time consuming for such developer like very new to use google Doc API.

why google not providing merge API which accept document ids in request and provided merged document Id?

0 5 273
5 REPLIES 5

@kalpen I'm personally hoping Google's Gemini side panel can do this sooner than later by asking it to merge documents with the @ reference. -KAM

@KAM Thanks for your response.
I think google doc API having this capability to do it. As currently it possible by reading Structural Element and Prepare Requests based on data present in Structural Element it is a very complex to implement code for each style. 

If Google Gemini can able to do it than it would be a good solution for users to merge two google doc documents without writing much code. I am sure we Gemini will provide API to integrate with application. 

@kalpen I wonder if you could export to PDF and combine them more readily...  There are also add-ons for Google Docs for Merging such as https://workspace.google.com/marketplace/app/document_merge_for_google_docs/971999817107 -KAM

Thanks @KAM  for this extension details. Can you please guide me like how can i use this extension programmatically?  I mean how can i use this extension, As I am using google Doc API to read and write in document. So now let say if i want to merge two document using java code only, than how can i use it with java doc API. is this extension also provide API base communication?

@kalpen You would have to reach out to the extension authors and investigate if there is any way to do that but I would not expect such a feature directly. -KAM

Top Solution Authors