Merge Open Document files

About ODP File Format

ODT files are type of documents created with word processing applications that are based on OpenDocument Text File format. These are created with word processor applications such as free OpenOffice Writer and can hold content such as text, images, objects and styles. The ODT file is to Writer word processor what the DOCX is to Microsoft Word. Several applications including Google Docs and Google’s web-based word processor included with Google Drive can open the ODT files for editing. Microsoft Word can also open ODT files and save it in to other formats such as DOC and DOCX.

About ODT File Format

ODT files are type of documents created with word processing applications that are based on OpenDocument Text File format. These are created with word processor applications such as free OpenOffice Writer and can hold content such as text, images, objects and styles. The ODT file is to Writer word processor what the DOCX is to Microsoft Word. Several applications including Google Docs and Google’s web-based word processor included with Google Drive can open the ODT files for editing. Microsoft Word can also open ODT files and save it in to other formats such as DOC and DOCX.

About ODS File Format

Files with ODS extension stand for OpenDocument Spreadsheet Document format that is editable by the user. Data is stored inside the ODF file into rows and columns. It is an XML-based format and is one of the several subtypes in the Open Document Formats (ODF) family. The format is specified as part of the ODF 1.2 specifications published and maintained by OASIS.

How to merge ODT files

GroupDocs.Merger allows developers to merge ODT files when it’s needed to organize multiple ODT files into single document or send fewer attachments etc. And you can do this without any third-party software or manual work involved. With GroupDocs.Merger it is possible to combine ODT documents of any size and structure - all text, images, tables, graphs, forms and other content will be preserved.

The following example demonstrates how to merge ODT files with several lines of Java code:

  • Create an instance of Merger class and pass source ODT file path as a constructor parameter. You may specify absolute or relative file path as per your requirements.
  • Add another ODT file to merge with join method. Repeat this step for other ODT documents you want to merge.
  • Call Merger class save method and specify the filename for the merged ODT file as parameter.
// Load the source ODT file
Merger merger = new Merger("c:\sample1.odt")
	
// Add another ODT file to merge
merger.join("c:\sample2.odt");
// Merge ODT files and save result
merger.save("c:\merged.odt");

NOTE: You may merge other Open Document formats like ODP, OTP and ODS in the same way as shown above. For this provide files by specifying their names with extension.

Code Examples

Please find more use-cases and complete Java sources of our backend and frontend examples and try them for free!

Merge ODT Live Demo

GroupDocs.Merger for Java provides an online ODT Merger App, which allows you to try it for free and check its quality and accuracy.