Module: Asposewordsjavaforruby::AppendDoc

Defined in:
lib/asposewordsjavaforruby/appenddoc.rb

Instance Method Summary collapse

Instance Method Details

#append_documentsObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/asposewordsjavaforruby/appenddoc.rb', line 8

def append_documents()
    data_dir = File.dirname(File.dirname(File.dirname(__FILE__))) + '/data/quickstart/'
    
    # Load the destination and source documents from disk.
    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")

    importformatmode = Rjb::import('com.aspose.words.ImportFormatMode')
    source_formating = importformatmode.KEEP_SOURCE_FORMATTING

    # Append the source document to the destination document while keeping the original formatting of the source document.
    dst_doc.appendDocument(src_doc, source_formating)
    dst_doc.save(data_dir + "TestFile Out.docx")
end

#initializeObject



3
4
5
6
# File 'lib/asposewordsjavaforruby/appenddoc.rb', line 3

def initialize()
    # Append document.
    append_documents()
end