Introduction to Ruby

[![][1].

Aspose Cloud Ruby SDK

[![Aspose Cloud APIs][2] as per Aspose Cloud 1.1.7.1. With this new release it is possible to create, read, manipulate and export features are greatly improved. You can extract sections, paragraphs, runs, page setup and fonts and update page setup and font in a Word document. read more

New Aspose.Words Methods

As per the latest version of Aspose Cloud 1.1.7.1, we’ve implemented the following functions to the Aspose Cloud Ruby SDK:

  • [Save Word documents as other formats][3] – This feature allows you to save Word documents as DOC, DOCX, DOCM, DOT, DOTX, DOTM, OOXML, HTML, HTMLFixed, WordML, MHTML, ODT, PDF, XPS, TIFF, EPUB, image and several other formats. Now this feature also supports export to XAML_FIXED format. You can use [saveAs][4] “Aspose.Cells Cloud”) resource and send a POST request (specifying save options in the request body) to convert to any supported format.
  • [Split Word documents][5] – This feature allows you to split all or specific pages of a Word document to many formats. This feature was already supported but now it supports split to XAML_FIXED format. You can use [splitDocument][6] resource and send a POST request to split to any supported format.
  • [Get all sections][7] – This feature allows you to get a list of all sections present in a Word document. You can use [sections][8] resource and send a GET request to get this list.
  • [Get a specific section][9] – This feature allows you to get any section from a Word document. You can use [section][10] resource and send a GET request to get a section.
  • [Get all paragraphs][11] – This feature allows you to get a list of all paragraphs present in a Word document. You can use [paragraphs][12] resource and send a GET request to get this list.
  • [Get a specific paragraph][13] – This feature allows you to get any paragraph from a Word document. You can use [paragraph][14] resource and send a GET request to get a paragraph.
  • [Get a specific run][15] – This feature allows you to get any run of any paragraph from a Word document. You can use [run][16] resource and send a GET request to get a run.
  • [Get font information][17] – This feature allows you to get font information from any run of a paragraph. You can use [font][18] resource and send a GET request for this purpose.
  • [Update a run’s font][19] – This feature allows you to update font of any run in a Word document. You can use [font][20] resource and send a POST request (specifying font options in the request body) to update font.
  • [Get page setup information][21] – This feature allows you to get page setup information from any section of a Word document. You can use [pageSetup][22] resource and send a GET request for this purpose.
  • [Update page setup][23] – This feature allows you to update page setup of any section in a Word document. You can use [pageSetup][24] resource and send a POST request (specifying page setup options in the request body) to update page setup.
  • [Get mustache field names][25] – This feature allows you to get mail merge and mustache field names. You can use [mailMergeFieldNames][26] resource and send a GET request (passing useNonMergeFields parameter in the request URI) to get all merge fields including mustache fields.

Code Snippets

Sample Code Aspose.Words - Get MailMerge Fields

require 'asposecloud'

Aspose::Cloud::Common::AsposeApp.app_key = '****'
Aspose::Cloud::Common::AsposeApp.app_sid = '****'

# Create object of folder class
folder = Aspose::Cloud::AsposeStorage::Folder.new
response = folder.upload_file './Data/test_multi_pages.docx'

extractor = Aspose::Cloud::Words::Extractor.new('test_multi_pages.docx')
fields = extractor.get_mail_merge_fields 

Sample Code Aspose.Words - Get Paragraphs

require 'asposecloud'

Aspose::Cloud::Common::AsposeApp.app_key = '****'
Aspose::Cloud::Common::AsposeApp.app_sid = '****'

# Create object of folder class
folder = Aspose::Cloud::AsposeStorage::Folder.new
response = folder.upload_file './Data/test_multi_pages.docx'

extractor = Aspose::Cloud::Words::Extractor.new('test_multi_pages.docx')
paras = extractor.get_paragraphs 

Download

Start a Free Trial Today

Start a free trial today - all you need is to [sign up][27] with Aspose Cloud service. Once you have signed up, you are ready to try powerful file processing features offered by Aspose Cloud.

[1]: https://blogs.asposeptyltd.com/cloudsite/wp-content/uploads/sites/15/2014/05/ruby-logo-300x100.jpg “ruby-logo”)](https://www.ruby-lang.org)A dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write. Since its public release in 1995, Ruby has drawn devoted coders worldwide. In 2006, Ruby achieved mass acceptance. With active user groups formed in the world’s major cities and Ruby-related conferences filled to capacity. [Read more about Ruby](https://www.ruby-lang.org “Ruby Language” [2]: https://blogs.asposeptyltd.com/cloudsite/wp-content/uploads/sites/15/2013/12/asposeCloudAPIs.png “Aspose Cloud APIs”)](https://blogs.asposeptyltd.com/cloudsite/wp-content/uploads/sites/15/2013/12/asposeCloudAPIs.png)We are pleased to announce the release of [Aspose Cloud Ruby SDK](https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_Ruby “Aspose Cloud Ruby SDK” [3]: https://www.aspose.com/docs/display/wordscloud/Convert+Word+Documents+to+any+Format+with+Additional+Settings [4]: https://www.aspose.com/docs/display/wordscloud/saveAs+(Controller+resource [5]: https://www.aspose.com/docs/display/wordscloud/Working+with+Split+Resource [6]: https://www.aspose.com/docs/display/wordscloud/splitDocument+%28Controller+Resource%29 “Aspose.Cells Cloud” [7]: https://www.aspose.com/docs/display/wordscloud/Get+a+List+of+Sections+from+a+Word+Document [8]: https://www.aspose.com/docs/display/wordscloud/sections “Aspose.Cells Cloud” [9]: https://www.aspose.com/docs/display/wordscloud/Get+a+specific+Section+from+a+Word+Document [10]: https://www.aspose.com/docs/display/wordscloud/section “Aspose.Cells Cloud” [11]: https://www.aspose.com/docs/display/wordscloud/Get+a+List+of+Paragraphs+from+a+Word+Document [12]: https://www.aspose.com/docs/display/wordscloud/paragraphs “Aspose.Cells Cloud” [13]: https://www.aspose.com/docs/display/wordscloud/Get+a+Paragraph+from+a+Word+Document [14]: https://www.aspose.com/docs/display/wordscloud/paragraph “Aspose.Cells Cloud” [15]: https://www.aspose.com/docs/display/wordscloud/Get+a+specific+Run+of+a+Paragraph+from+a+Word+Document [16]: https://www.aspose.com/docs/display/wordscloud/run “Aspose.Cells Cloud” [17]: https://www.aspose.com/docs/display/wordscloud/Get+Font+Information+of+a+Run+from+a+Word+Document [18]: https://www.aspose.com/docs/display/wordscloud/font “Aspose.Cells Cloud” [19]: https://www.aspose.com/docs/display/wordscloud/Update+Font+of+a+Run+in+a+Word+Document [20]: https://www.aspose.com/docs/display/wordscloud/font “Aspose.Cells Cloud” [21]: https://www.aspose.com/docs/display/wordscloud/Extract+Page+Setup+Information+from+a+Word+Document [22]: https://www.aspose.com/docs/display/wordscloud/pageSetup “Aspose.Cells Cloud” [23]: https://www.aspose.com/docs/display/wordscloud/Update+Page+Setup+of+a+Section+in+a+Word+Document [24]: https://www.aspose.com/docs/display/wordscloud/pageSetup “Aspose.Cells Cloud” [25]: https://www.aspose.com/docs/display/wordscloud/Get+All+Merge+Field+Names+from+a+Word+Document [26]: https://www.aspose.com/docs/display/wordscloud/mailMergeFieldNames “Aspose.Cells Cloud” [27]: https://cloud.aspose.com/SignUp