Re: How Can I Merge two Google Doc documents direct... - Google ...
Dear All,
I am looking for a solution to merge two Google Doc documents. I have created two documents using the Google Doc Create Document API. Java is the programming language I have used. My goal is to merge the documents with all text and styling possibilities, including images, tables, and lists.
We can read the Structural Elements of Document-1 and prepare text, styling, and other requests to write in Document-2. However, this approach is lengthy and not ideal as writing every possible styling is very complex, difficult, and time-consuming for developers who are new to using the Google Doc API.
%20(1).png)
Why doesn't Google provide a merge API?
It would be beneficial to have an API that accepts document IDs in a request and provides a merged document ID.
@kalpen, I'm personally hoping Google's Gemini side panel can do this sooner rather than later by asking it to merge documents with the @ reference.

Thanks for your response. I believe the Google Doc API has the capability to do this. Currently, it is possible by reading Structural Element and preparing requests based on the data present in the Structural Element, but it is very complex to implement code for each style.
If Google Gemini can accomplish this, it would be a great solution for users to merge two Google Doc documents without writing extensive code. I am confident that Gemini will provide an API to integrate with applications.

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 Document Merge for Google Docs.
Thanks @KAM for this extension details. Can you please guide me on how I can use this extension programmatically? I mean, how can I use this extension with Java Doc API to merge two documents using Java code only? Does this extension also provide API-based 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.