Sha256: 16484e2f6373d4fb72e769b3fdce4cb75ca6cf84620dec183a58acab358ebf61

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

module Asposewordsjavaforruby
  module DocToHTML
    def initialize()
        # The path to the documents directory.
        data_dir = File.dirname(File.dirname(File.dirname(__FILE__))) + '/data/'

        # Open the document.
        doc = Rjb::import('com.aspose.words.Document').new(data_dir + "TestFile.doc")

        #HtmlSaveOptions options = new HtmlSaveOptions();
        options = Rjb::import('com.aspose.words.HtmlSaveOptions').new

        # HtmlSaveOptions.ExportRoundtripInformation property specifies
        # whether to write the roundtrip information when saving to HTML, MHTML or EPUB.
        # Default value is true for HTML and false for MHTML and EPUB.
        options.setExportRoundtripInformation(true)
        doc.save(data_dir + "ExportRoundtripInformation Out.html", options)

        doc = Rjb::import('com.aspose.words.Document').new(data_dir + "ExportRoundtripInformation Out.html")

        # Save the document Docx file format
        save_format = Rjb::import('com.aspose.words.SaveFormat')
        doc.save(data_dir + "Out.docx", save_format.DOCX)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
asposewordsjavaforruby-0.0.5 lib/asposewordsjavaforruby/doctohtml.rb