Joining And Appending in Ruby

Aspose.Words - Joining And Appending

For joining and appending using Aspose.Words Java APIs in Ruby, simply use appendDocument method.

Ruby Code

## Load the documents to join.

dst_doc = Rjb::import("com.aspose.words.Document").new(@data_dir + "TestFile.Destination.doc")
src_doc = Rjb::import("com.aspose.words.Document").new(@data_dir + "TestFile.Source.doc")
\# Append the source document to the destination document using no extra options.
import_format_mode = Rjb::import("com.aspose.words.ImportFormatMode")
dst_doc.appendDocument(src_doc, import_format_mode.KEEP_SOURCE_FORMATTING)
\# Save the document.
dst_doc.save(@data_dir + "TestFile.SimpleAppendDocument Out.docx")

Download Running Code

Download Joining And Appending (Aspose.Words) from any of the below mentioned social coding sites: