How to Convert Word to TIFF File Format using Ruby

How to Convert Word to TIFF File Format using Ruby

TIFF or Tagged Image File Format is one of the most popular format to store raster images and graphics. TIFF or Tagged Image File Format are lossless image files and these do not need to compress or lose any image quality or information. TIFF supports multiple pages and a multipage TIFF file can have more than one images in the form of pages. This feature makes TIFF a suitable option to convert to word documents. To perform this conversion programmatically, this article covers how to convert word to TIFF file format using Ruby.

The following topics shall be covered in this article:

Word to TIFF Conversion API - Installation

In order to convert DOCX or DOC documents to TIFF format, we will be using the Ruby SDK of GroupDocs.Conversion Cloud API. It is a powerful Ruby library to create and manipulate Word documents seamlessly. Moreover, it provides a high fidelity conversion of Word files to more than 50 popular document and image formats. You can install the Ruby library using the following command.

gem install groupdocs_conversion_cloud

You also need to create a free account by visiting Aspose.Cloud dashboard, so that you can manage documents in cloud storage. Before you proceed, quickly get your Client ID and Client Secret from the dashboard. Now add below code in your application:

Convert Word to TIFF File Format in Ruby

You can convert word document to TIFF file programmatically by following the steps given below:

  • Create an instance of the ConvertApi
  • Next, create an instance of the ConvertSettings
  • Set the storage name and word file path
  • Provide “tiff” as output file format
  • Create an instance of the DocxLoadOptions
  • Set the protected docx file password and load_options
  • Create an instance of the TiffConvertOptions
  • Define from_page, pages_count, rotate_angle, grayscale and use_pdf
  • Set convertOptions to settings object
  • Now, provide the output file path
  • After that, create ConvertDocumentRequest with ConvertSettings as argument
  • Finally, call the ConvertApi.convert_document() method with ConvertDocumentRequest to save the converted file

The following code sample shows how to convert word to TIFF file using REST API in Ruby:

How to Convert Specific Pages of WORD to TIFF

You can also convert collection of word pages to TIFF programmatically by following the steps given below:

  • Create an instance of the ConvertApi
  • Next, create an instance of the ConvertSettings
  • Set the storage name and word file path
  • Provide “tiff” as output file format
  • Create an instance of the DocxLoadOptions
  • Set the protected docx file password and load_options
  • Create an instance of the TiffConvertOptions
  • Define pages collection, rotate_angle, grayscale and use_pdf
  • Set convertOptions to settings object
  • Now, provide the output file path
  • After that, create ConvertDocumentRequest with ConvertSettings as argument
  • Finally, call the ConvertApi.convert_document() method with ConvertDocumentRequest to save the converted file

The following code sample shows how to convert specific pages of word to TIFF file using REST API in Ruby:

Online DOCX(Word) to TIFF Converter

How to convert DOCX to TIFF online? Please try the following free online word to tiff conversion tool, which is developed using the above API.

Summing up

In this article, we have learned:

  • how to convert word document to tiff file in ruby;
  • how to convert specific pages of docx file to tiff format;

You may learn more about GroupDocs.Conversion Cloud API from the documentation. We also have an API Reference section that lets you visualize and communicate with our APIs directly through the browser.

Ask a question

If you have any questions about DOCX to TIFF converter, please feel free to ask us on the Free Support Forum.

The following articles are highly recommended to learn about: