Skip to content

Instantly share code, notes, and snippets.

@blog-aspose-cloud
Last active May 2, 2022 07:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blog-aspose-cloud/9f7b90756fedfc49ea9ebde28825cc7d to your computer and use it in GitHub Desktop.
Save blog-aspose-cloud/9f7b90756fedfc49ea9ebde28825cc7d to your computer and use it in GitHub Desktop.
This Gist explains the details on for converting Word to TIFF document using Aspose.Words Cloud SDK for Java

Develop Word to TIFF Converter using Java


The Gist shares details on how to convert Word to TIFF Document using Aspose.Words Cloud SDK for Java.

We are going to discuss two options for conversion i.e. load Word file form cloud storage and convert to TIFF Document and in second attempt, load the Word file from local drive, convert to TIFF image and save the resultant file in Cloud storage. For complete details, please visit Word to TIFF Document Conversion using Java | DOC to TIFF.

Online Word to TIFF Converter in Java

Important Links

Home | Product Page | Docs | API Reference | Cloud Dashboard | Code Samples | Source Code | Blog | Free Support | Free Trial

// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
// Get client credentials from https://dashboard.aspose.cloud/
try {
// create an instance of ApiClient while providing client credentials as arguments
ApiClient apiClient = new ApiClient("bbf94a2c-6d7e-4020-b4d2-b9809741374e", "1c9379bb7d701c26cc87e741a29987bb", null);
// initialize WordsApi object using ApiClient object as an argument
WordsApi wordsApi = new WordsApi(apiClient);
// create an object of TiffSaveOptionsData
TiffSaveOptionsData requestSaveOptions = new TiffSaveOptionsData();
// specify the name of output TIFF image to be stored in Cloud storage
requestSaveOptions.setFileName("Resultant.tiff");
// index and count of pages in word document to be converted
int pageCount =1;
int pageIndex = 1;
// binarization effect values
String tiffBinarizationMethod = "FloydSteinbergDithering";
String dmlEffectsRenderingMode = "Simplified";
// Create SaveAsTiff object where we define source Word file to be loaded from cloud storage
// number of pages to be converted and start index of pages
SaveAsTiffRequest saveRequest = new SaveAsTiffRequest(
"test_multi_pages.docx",
requestSaveOptions,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
pageCount,
pageIndex,
null,
null,
null,
null,
null,
null,
dmlEffectsRenderingMode,
tiffBinarizationMethod,
null,
null);
// call the API to initialize the conversion operation
wordsApi.saveAsTiff(saveRequest);
System.out.println("Word to TIFF Document conversion has been successful");
}catch (Exception ex)
{
System.out.println(ex.getStackTrace());
}
This Gist explains the details on for converting Word to TIFF document using Aspose.Words Cloud SDK for Java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment