asposewordsjavaforruby 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. data/Gempackage +3 -0
  2. data/LICENSE +21 -0
  3. data/README.md +2 -0
  4. data/Rakefile +2 -0
  5. data/asposewordsjavaforruby.gemspec +27 -0
  6. data/config/aspose.yml +5 -0
  7. data/data/Field.RemoveField.doc +0 -0
  8. data/data/LoadTxt.txt +15 -0
  9. data/data/Template.doc +0 -0
  10. data/data/Test.Styles.doc +0 -0
  11. data/data/TestAutofittables.doc +0 -0
  12. data/data/TestComments.doc +0 -0
  13. data/data/TestCompressImages.docx +0 -0
  14. data/data/TestFile.doc +0 -0
  15. data/data/TestWatermark.doc +0 -0
  16. data/data/bookmarks/Template.doc +0 -0
  17. data/data/bookmarks/TestDefect1352.doc +0 -0
  18. data/data/document/TestFile.doc +0 -0
  19. data/data/document/TestRemoveBreaks.doc +0 -0
  20. data/data/joiningandappending/TestFile.Destination.doc +0 -0
  21. data/data/joiningandappending/TestFile.DestinationList.doc +0 -0
  22. data/data/joiningandappending/TestFile.Source.doc +0 -0
  23. data/data/joiningandappending/TestFile.SourceList.doc +0 -0
  24. data/data/joiningandappending/TestFile.SourcePageSetup.doc +0 -0
  25. data/data/mailmerge/Template.doc +0 -0
  26. data/data/mailmerge/TestFile.doc +0 -0
  27. data/data/quickstart/Document.doc +0 -0
  28. data/data/quickstart/HelloWorld.docx +0 -0
  29. data/data/quickstart/MailMerge.doc +0 -0
  30. data/data/quickstart/ReplaceSimple.doc +0 -0
  31. data/data/quickstart/TestFile.Destination.doc +0 -0
  32. data/data/quickstart/TestFile.Source.doc +0 -0
  33. data/jars/aspose-words-15.4.0.jar +0 -0
  34. data/lib/asposewordsjavaforruby.rb +71 -0
  35. data/lib/asposewordsjavaforruby/addwatermark.rb +84 -0
  36. data/lib/asposewordsjavaforruby/appenddoc.rb +24 -0
  37. data/lib/asposewordsjavaforruby/appenddocument.rb +229 -0
  38. data/lib/asposewordsjavaforruby/applylicense.rb +16 -0
  39. data/lib/asposewordsjavaforruby/asposewordsjava.rb +24 -0
  40. data/lib/asposewordsjavaforruby/autofittables.rb +123 -0
  41. data/lib/asposewordsjavaforruby/bookmarks.rb +132 -0
  42. data/lib/asposewordsjavaforruby/checkformat.rb +70 -0
  43. data/lib/asposewordsjavaforruby/compressimages.rb +53 -0
  44. data/lib/asposewordsjavaforruby/doc2pdf.rb +15 -0
  45. data/lib/asposewordsjavaforruby/doctohtml.rb +26 -0
  46. data/lib/asposewordsjavaforruby/extractcontent.rb +395 -0
  47. data/lib/asposewordsjavaforruby/findandreplace.rb +29 -0
  48. data/lib/asposewordsjavaforruby/helloworld.rb +26 -0
  49. data/lib/asposewordsjavaforruby/imagetopdf.rb +71 -0
  50. data/lib/asposewordsjavaforruby/insertnestedfields.rb +39 -0
  51. data/lib/asposewordsjavaforruby/loadandsavetodisk.rb +20 -0
  52. data/lib/asposewordsjavaforruby/loadandsavetostream.rb +32 -0
  53. data/lib/asposewordsjavaforruby/loadtxt.rb +14 -0
  54. data/lib/asposewordsjavaforruby/mergefield.rb +45 -0
  55. data/lib/asposewordsjavaforruby/nodes.rb +29 -0
  56. data/lib/asposewordsjavaforruby/processcomments.rb +72 -0
  57. data/lib/asposewordsjavaforruby/removebreaks.rb +65 -0
  58. data/lib/asposewordsjavaforruby/removefield.rb +23 -0
  59. data/lib/asposewordsjavaforruby/saveasmultipagetiff.rb +26 -0
  60. data/lib/asposewordsjavaforruby/simplemailmerge.rb +23 -0
  61. data/lib/asposewordsjavaforruby/styles.rb +77 -0
  62. data/lib/asposewordsjavaforruby/updatefields.rb +62 -0
  63. data/lib/asposewordsjavaforruby/version.rb +3 -0
  64. metadata +65 -2
@@ -0,0 +1,16 @@
1
+ module Asposewordsjavaforruby
2
+ module ApplyLicense
3
+ def initialize()
4
+ apply_license()
5
+ end
6
+
7
+ def apply_license()
8
+ # This line attempts to set a license from several locations relative to the executable and Aspose.Words.dll.
9
+ # You can also use the additional overload to load a license from a stream, this is useful for instance when the
10
+ # license is stored as an embedded resource
11
+ license = Rjb::import('com.aspose.words.License').new()
12
+ license.setLicense('Aspose.Words.lic')
13
+ end
14
+
15
+ end
16
+ end
@@ -0,0 +1,24 @@
1
+ require_relative 'helloworld'
2
+ require_relative 'appenddoc'
3
+ require_relative 'applylicense'
4
+ require_relative 'findandreplace'
5
+ require_relative 'loadandsavetodisk'
6
+ require_relative 'loadandsavetostream'
7
+ require_relative 'simplemailmerge'
8
+ require_relative 'updatefields'
9
+ require_relative 'nodes'
10
+ require_relative 'processcomments'
11
+ require_relative 'addwatermark'
12
+ require_relative 'autofittables'
13
+ require_relative 'bookmarks'
14
+ require_relative 'compressimages'
15
+ require_relative 'insertnestedfields'
16
+ require_relative 'appenddocument'
17
+ require_relative 'styles'
18
+ require_relative 'removebreaks'
19
+ require_relative 'extractcontent'
20
+ require_relative 'checkformat'
21
+ require_relative 'loadtxt'
22
+ require_relative 'saveasmultipagetiff'
23
+ require_relative 'mergefield'
24
+ require_relative 'doctohtml'
@@ -0,0 +1,123 @@
1
+ module Asposewordsjavaforruby
2
+ module AutoFitTables
3
+ def initialize()
4
+ # The path to the documents directory.
5
+ @data_dir = File.dirname(File.dirname(File.dirname(__FILE__))) + '/data/'
6
+
7
+ # Demonstrate autofitting a table to the window.
8
+ autofit_table_to_window()
9
+
10
+ # Demonstrate autofitting a table to its contents.
11
+ autofit_table_to_contents()
12
+
13
+ # Demonstrate autofitting a table to fixed column widths.
14
+ autofit_table_to_fixed_column_widths()
15
+ end
16
+
17
+ =begin
18
+ ExStart
19
+ ExFor:Table.AutoFit
20
+ ExFor:AutoFitBehavior
21
+ ExId:FitTableToPageWidth
22
+ ExSummary:Autofits a table to fit the page width.
23
+ =end
24
+ def autofit_table_to_window()
25
+ #data_dir = File.dirname(File.dirname(File.dirname(__FILE__))) + '/data/'
26
+ # Open the document
27
+ doc = Rjb::import('com.aspose.words.Document').new(@data_dir + "TestFile.doc")
28
+
29
+ node_type = Rjb::import('com.aspose.words.NodeType')
30
+ table = doc.getChild(node_type.TABLE, 0, true)
31
+
32
+ # Autofit the first table to the page width.
33
+ autofit_behavior = Rjb::import("com.aspose.words.AutoFitBehavior")
34
+ table.autoFit(autofit_behavior.AUTO_FIT_TO_WINDOW)
35
+
36
+ # Save the document to disk.
37
+ doc.save(@data_dir + "TestFile.AutoFitToWindow Out.doc")
38
+ # ExEnd
39
+ preferred_width_type = Rjb::import("com.aspose.words.PreferredWidthType")
40
+
41
+ if (doc.getFirstSection().getBody().getTables().get(0).getPreferredWidth().getType() == preferred_width_type.PERCENT) then
42
+ puts "PreferredWidth type is not percent."
43
+ end
44
+
45
+ if (doc.getFirstSection().getBody().getTables().get(0).getPreferredWidth().getValue() == 100) then
46
+ puts "PreferredWidth value is different than 100."
47
+ end
48
+ end
49
+
50
+ =begin
51
+ ExStart
52
+ ExFor:Table.AutoFit
53
+ ExFor:AutoFitBehavior
54
+ ExId:FitTableToContents
55
+ ExSummary:Autofits a table in the document to its contents.
56
+ =end
57
+ def autofit_table_to_contents()
58
+ # Open the document
59
+ doc = Rjb::import('com.aspose.words.Document').new(@data_dir + "TestFile.doc")
60
+
61
+ node_type = Rjb::import('com.aspose.words.NodeType')
62
+ table = doc.getChild(node_type.TABLE, 0, true)
63
+
64
+ # Autofit the table to the cell contents
65
+ autofit_behavior = Rjb::import("com.aspose.words.AutoFitBehavior")
66
+ table.autoFit(autofit_behavior.AUTO_FIT_TO_CONTENTS)
67
+
68
+ # Save the document to disk.
69
+ doc.save(@data_dir + "TestFile.AutoFitToContents Out.doc")
70
+ # ExEnd
71
+ preferred_width_type = Rjb::import("com.aspose.words.PreferredWidthType")
72
+
73
+ if (doc.getFirstSection().getBody().getTables().get(0).getPreferredWidth().getType() == preferred_width_type.AUTO) then
74
+ puts "PreferredWidth type is not auto."
75
+ end
76
+
77
+ if (doc.getFirstSection().getBody().getTables().get(0).getFirstRow().getFirstCell().getCellFormat().getPreferredWidth().getType() == preferred_width_type.AUTO) then
78
+ puts "PrefferedWidth on cell is not auto."
79
+ end
80
+
81
+ if(doc.getFirstSection().getBody().getTables().get(0).getFirstRow().getFirstCell().getCellFormat().getPreferredWidth().getValue() == 0) then
82
+ puts "PreferredWidth value is not 0."
83
+ end
84
+ end
85
+
86
+ =begin
87
+ ExStart
88
+ ExFor:Table.AutoFit
89
+ ExFor:AutoFitBehavior
90
+ ExId:DisableAutoFitAndUseFixedWidths
91
+ ExSummary:Disables autofitting and enables fixed widths for the specified table.
92
+ =end
93
+ def autofit_table_to_fixed_column_widths()
94
+ # Open the document
95
+ doc = Rjb::import('com.aspose.words.Document').new(@data_dir + "TestFile.doc")
96
+
97
+ node_type = Rjb::import('com.aspose.words.NodeType')
98
+ table = doc.getChild(node_type.TABLE, 0, true)
99
+
100
+ # Disable autofitting on this table.
101
+ autofit_behavior = Rjb::import("com.aspose.words.AutoFitBehavior")
102
+ table.autoFit(autofit_behavior.AUTO_FIT_TO_CONTENTS)
103
+
104
+ # Save the document to disk.
105
+ doc.save(@data_dir + "TestFile.FixedWidth Out.doc")
106
+ # ExEnd
107
+ preferred_width_type = Rjb::import("com.aspose.words.PreferredWidthType")
108
+
109
+ if (doc.getFirstSection().getBody().getTables().get(0).getPreferredWidth().getType() == preferred_width_type.AUTO) then
110
+ puts "PreferredWidth type is not auto."
111
+ end
112
+
113
+ if (doc.getFirstSection().getBody().getTables().get(0).getPreferredWidth().getValue() == 0) then
114
+ puts "PreferredWidth value is not 0."
115
+ end
116
+
117
+ if (doc.getFirstSection().getBody().getTables().get(0).getFirstRow().getFirstCell().getCellFormat().getWidth() == 0) then
118
+ puts "Cell width is not correct."
119
+ end
120
+ end
121
+
122
+ end
123
+ end
@@ -0,0 +1,132 @@
1
+ module Asposewordsjavaforruby
2
+ module Bookmarks
3
+ def initialize()
4
+ # The path to the documents directory.
5
+ @data_dir = File.dirname(File.dirname(File.dirname(__FILE__))) + '/data/bookmarks/'
6
+
7
+ # Open the document.
8
+ doc = Rjb::import('com.aspose.words.Document').new(@data_dir + 'TestDefect1352.doc')
9
+
10
+ append_bookmark_text()
11
+
12
+ # This perform the custom task of putting the row bookmark ends into the same row with the bookmark starts.
13
+ untangle_row_bookmark(doc)
14
+
15
+ # Now we can easily delete rows by a bookmark without damaging any other row's bookmarks.
16
+ delete_row_by_bookmark(doc, 'ROW2')
17
+ end
18
+
19
+ def append_bookmark_text()
20
+ data_dir = File.dirname(File.dirname(File.dirname(__FILE__))) + '/data/bookmarks/'
21
+
22
+ # Load the source document.
23
+ src_doc = Rjb::import('com.aspose.words.Document').new(data_dir + "Template.doc")
24
+
25
+ # This is the bookmark whose content we want to copy.
26
+ src_bookmark = src_doc.getRange().getBookmarks().get("ntf010145060")
27
+
28
+ # We will be adding to this document.
29
+ dst_doc = Rjb::import('com.aspose.words.Document').new()
30
+
31
+ # Let's say we will be appending to the end of the body of the last section.
32
+ #node_type = Rjb::import('com.aspose.words.NodeType')
33
+ dst_node = dst_doc.getLastSection().getBody()
34
+
35
+ # It is a good idea to use this import context object because multiple nodes are being imported.
36
+ # If you import multiple times without a single context, it will result in many styles created.
37
+ import_format_mode = Rjb::import('com.aspose.words.ImportFormatMode')
38
+ importer = Rjb::import("com.aspose.words.NodeImporter").new(src_doc, dst_doc, import_format_mode.KEEP_SOURCE_FORMATTING)
39
+
40
+ # This is the paragraph that contains the beginning of the bookmark.
41
+ start_para = src_bookmark.getBookmarkStart().getParentNode()
42
+
43
+ # This is the paragraph that contains the end of the bookmark.
44
+ end_para = src_bookmark.getBookmarkEnd().getParentNode()
45
+
46
+ if (start_para == "" || end_para == "") then
47
+ raise "Parent of the bookmark start or end is not a paragraph, cannot handle this scenario yet."
48
+ end
49
+
50
+ util = Rjb::import("java.io.InputStream")
51
+ # Limit ourselves to a reasonably simple scenario.
52
+ spara = (start_para.getParentNode()).to_string
53
+ epara = (end_para.getParentNode()).to_string
54
+ #p spara.strip
55
+ #abort('spara')
56
+
57
+
58
+ if spara.strip != epara.strip then
59
+ #if (start_para.getParentNode() != end_para.getParentNode()) then
60
+ raise "Start and end paragraphs have different parents, cannot handle this scenario yet."
61
+ end
62
+
63
+ # We want to copy all paragraphs from the start paragraph up to (and including) the end paragraph,
64
+ # therefore the node at which we stop is one after the end paragraph.
65
+ endNode = end_para.getNextSibling()
66
+
67
+ # This is the loop to go through all paragraph-level nodes in the bookmark.
68
+ curNode = start_para
69
+ cNode = curNode
70
+ eNode = endNode
71
+
72
+ while (cNode != eNode) do
73
+ # This creates a copy of the current node and imports it (makes it valid) in the context
74
+ # of the destination document. Importing means adjusting styles and list identifiers correctly.
75
+ newNode = importer.importNode(curNode, true)
76
+ curNode = curNode.getNextSibling()
77
+ cNode = curNode
78
+ dst_node.appendChild(newNode)
79
+ end
80
+
81
+ # Save the finished document.
82
+ dst_doc.save(data_dir + "Template Out.doc");
83
+ end
84
+
85
+ def untangle_row_bookmark(doc)
86
+ bookmarks = doc.getRange().getBookmarks()
87
+ bookmarks_count = bookmarks.getCount()
88
+
89
+ i = 0
90
+ while i < bookmarks_count do
91
+ bookmark = bookmarks.get(i)
92
+ row1 = bookmark.getBookmarkStart().getAncestor(Rjb::import("com.aspose.words.Row"))
93
+ row2 = bookmark.getBookmarkEnd().getAncestor(Rjb::import("com.aspose.words.Row"))
94
+
95
+ # If both rows are found okay and the bookmark start and end are contained
96
+ # in adjacent rows, then just move the bookmark end node to the end
97
+ # of the last paragraph in the last cell of the top row.
98
+ if ((row1 != "") && (row2 != "") && (row1.getNextSibling() == row2)) then
99
+ row1.getLastCell().getLastParagraph().appendChild(bookmark.getBookmarkEnd())
100
+ end
101
+ $i +=1
102
+ end
103
+
104
+ # Save the document.
105
+ doc.save(@data_dir + "TestDefect1352 Out.doc")
106
+ end
107
+
108
+ def delete_row_by_bookmark(doc, bookmark_name)
109
+ raise 'bookmark_name not specified.' if bookmark_name.empty?
110
+
111
+ bookmark = doc.getRange().getBookmarks().get(bookmark_name)
112
+
113
+ if bookmark.nil? then
114
+ return
115
+ end
116
+
117
+ # Get the parent row of the bookmark. Exit if the bookmark is not in a row.
118
+ row = bookmark.getBookmarkStart().getAncestor(Rjb::import('com.aspose.words.Row'))
119
+
120
+ if row.nil? then
121
+ return
122
+ end
123
+
124
+ # Remove the row.
125
+ row.remove()
126
+
127
+ # Save the document.
128
+ doc.save(@data_dir + "TestDefect1352 Out.doc")
129
+ end
130
+
131
+ end
132
+ end
@@ -0,0 +1,70 @@
1
+ require 'fileutils'
2
+ module Asposewordsjavaforruby
3
+ module CheckFormat
4
+ def initialize()
5
+ # The path to the documents directory.
6
+ data_dir = File.dirname(File.dirname(File.dirname(__FILE__))) + '/data/'
7
+
8
+ @supported_dir = data_dir + 'OutSupported/'
9
+ file = Rjb::import("java.io.File").new(data_dir + 'joiningandappending/')
10
+
11
+ check_fromat(file)
12
+ end
13
+
14
+ def check_fromat(file)
15
+ files_list = file.listFiles()
16
+ load_format = Rjb::import('com.aspose.words.LoadFormat')
17
+
18
+ files_list.each do |file|
19
+ if(file.isDirectory()) then
20
+ next
21
+ end
22
+
23
+ name_only = file.getName()
24
+ puts name_only
25
+ file_name = file.getPath()
26
+ puts file_name
27
+
28
+ info_obj = Rjb::import('com.aspose.words.FileFormatUtil')
29
+ info = info_obj.detectFileFormat(file_name)
30
+ case info.getLoadFormat()
31
+ when load_format.DOC
32
+ puts "Microsoft Word 97-2003 document."
33
+ when load_format.DOT
34
+ puts "Microsoft Word 97-2003 template."
35
+ when load_format.DOCX
36
+ puts "Office Open XML WordprocessingML Macro-Free Document."
37
+ when load_format.DOCM
38
+ puts "Office Open XML WordprocessingML Macro-Enabled Document."
39
+ when load_format.DOTX
40
+ puts "Office Open XML WordprocessingML Macro-Free Template."
41
+ when load_format.DOTM
42
+ puts "Office Open XML WordprocessingML Macro-Enabled Template."
43
+ when load_format.FLAT_OPC
44
+ puts "Flat OPC document."
45
+ when load_format.RTF
46
+ puts "RTF format."
47
+ when load_format.WORD_ML
48
+ puts "Microsoft Word 2003 WordprocessingML format."
49
+ when load_format.HTML
50
+ puts "HTML format."
51
+ when load_format.MHTML
52
+ puts "MHTML (Web archive) format."
53
+ when load_format.ODT
54
+ puts "OpenDocument Text."
55
+ when load_format.OTT
56
+ puts "OpenDocument Text Template."
57
+ when load_format.DOC_PRE_WORD_97
58
+ puts "MS Word 6 or Word 95 format."
59
+ else load_format.UNKNOWN
60
+ puts "Unknown format."
61
+ end
62
+
63
+ dest_file_obj = Rjb::import("java.io.File").new(@supported_dir + name_only)
64
+ dest_File = dest_file_obj.getPath()
65
+ FileUtils.cp(file_name, dest_File)
66
+ end
67
+ end
68
+
69
+ end
70
+ end
@@ -0,0 +1,53 @@
1
+ module Asposewordsjavaforruby
2
+ module CompressImages
3
+ def initialize()
4
+ # The path to the documents directory.
5
+ @data_dir = File.dirname(File.dirname(File.dirname(__FILE__))) + '/data/'
6
+ srcFileName = @data_dir + "TestCompressImages.docx"
7
+
8
+ doc = Rjb::import('com.aspose.words.Document').new(@data_dir + "TestCompressImages.docx")
9
+
10
+ # Demonstrate autofitting a table to the window.
11
+ compress_images(doc, srcFileName)
12
+ end
13
+
14
+ def compress_images(doc, srcFileName)
15
+ messageFormat = Rjb::import("java.text.MessageFormat")
16
+ file_size = get_file_size(srcFileName)
17
+
18
+ # 220ppi Print - said to be excellent on most printers and screens.
19
+ # 150ppi Screen - said to be good for web pages and projectors.
20
+ # 96ppi Email - said to be good for minimal document size and sharing.
21
+ desiredPpi = 150
22
+ # In Java this seems to be a good compression / quality setting.
23
+ jpegQuality = 90
24
+
25
+ # Resample images to desired ppi and save.
26
+ resampler = Rjb::import("com.aspose.words.Resampler").new
27
+ count = resampler.resample(doc, desiredPpi, jpegQuality)
28
+ puts MessageFormat.format("Resampled {0} images.", count)
29
+ if (count != 1) then
30
+ puts "We expected to have only 1 image resampled in this test document!"
31
+ end
32
+ dstFileName = @data_dir + "TestCompressImages Out.docx"
33
+ doc.save(dstFileName)
34
+ puts messageFormat.format("Saving {0}. Size {1}.", dstFileName, get_file_size(dstFileName))
35
+
36
+ # Verify that the first image was compressed by checking the new Ppi.
37
+ dst_doc = Rjb::import("com.aspose.words.Document").new(dstFileName)
38
+ nodeType = Rjb::import("com.aspose.words.NodeType")
39
+ shape = dst_doc.getChild(nodeType.DRAWING_ML, 0, true)
40
+ convertUtil = Rjb::import("com.aspose.words.ConvertUtil")
41
+ imagePpi = shape.getImageData().getImageSize().getWidthPixels() / convertUtil.pointToInch(shape.getSize().getX())
42
+ if (imagePpi < 150) then
43
+ puts "Image was not resampled successfully."
44
+ end
45
+ end
46
+
47
+ def get_file_size(file_name)
48
+ file = Rjb::import("java.io.File").new(file_name)
49
+ return file.length()
50
+ end
51
+
52
+ end
53
+ end
@@ -0,0 +1,15 @@
1
+ module Asposewordsjavaforruby
2
+ module Doc2Pdf
3
+
4
+ def doc_to_pdf()
5
+ data_dir = File.dirname(File.dirname(File.dirname(__FILE__))) + '/data/'
6
+
7
+ # Open document.
8
+ document = Rjb::import('com.aspose.words.Document').new(data_dir + "Template.doc")
9
+
10
+ # Save the document in PDF format.
11
+ document.save(data_dir + "Doc2PdfSave Out.pdf")
12
+ end
13
+
14
+ end
15
+ end
@@ -0,0 +1,26 @@
1
+ module Asposewordsjavaforruby
2
+ module DocToHTML
3
+ def initialize()
4
+ # The path to the documents directory.
5
+ data_dir = File.dirname(File.dirname(File.dirname(__FILE__))) + '/data/'
6
+
7
+ # Open the document.
8
+ doc = Rjb::import('com.aspose.words.Document').new(data_dir + "TestFile.doc")
9
+
10
+ #HtmlSaveOptions options = new HtmlSaveOptions();
11
+ options = Rjb::import('com.aspose.words.HtmlSaveOptions').new
12
+
13
+ # HtmlSaveOptions.ExportRoundtripInformation property specifies
14
+ # whether to write the roundtrip information when saving to HTML, MHTML or EPUB.
15
+ # Default value is true for HTML and false for MHTML and EPUB.
16
+ options.setExportRoundtripInformation(true)
17
+ doc.save(data_dir + "ExportRoundtripInformation Out.html", options)
18
+
19
+ doc = Rjb::import('com.aspose.words.Document').new(data_dir + "ExportRoundtripInformation Out.html")
20
+
21
+ # Save the document Docx file format
22
+ save_format = Rjb::import('com.aspose.words.SaveFormat')
23
+ doc.save(data_dir + "Out.docx", save_format.DOCX)
24
+ end
25
+ end
26
+ end