An XPS file contains XML based structure, content, layout, and appearance of a document. A single XPS file can have a single page or multiple pages. On the other hand, TIFF or TIF (Tagged Image File Format) is a standard file format representing raster images intended for use on various devices supporting it. In this article, we will learn how to convert XPS to TIFF in Java.
The following topics shall be covered in this article:
Java XPS to TIFF Converter API – Free Download
The API provides the XpsDocument class that represents XPS documents. It provides the save(Device, SaveOptions) method for saving the XPS document using the Device instance. The ImageDevice class encapsulates the rendering of the document to the image. The TiffSaveOptions class of the API contains the options necessary for managing the TIFF-saving process.
Please either download the JAR of the API or add the following pom.xml configuration in a Maven-based Java application.
<name>Aspose Java API</name>
How to Convert XPS to TIFF
We can easily convert an XPS file to TIFF format by following the steps given below:
- Load an XPS file.
- Specify TIFF save options.
- Save XPS as a TIFF.
The following section describes how to transform these steps into Java code and convert an XPS file to TIFF format.
Convert XPS to TIFF Image using Java
We can convert XPS files to TIFF images by following the steps given below:
- Firstly, load an XPS document using the XpsDocument class.
- Next, initialize the TiffSaveOptions class object.
- Then, specify save options such as SmoothingMode, Resolution, PageNumbers, etc.
- Meanwhile, create an instance of the ImageDevice class.
- After that, call the save() method to save the image in the ImageDevice object.
- Finally, use the ImageDevice to save the image as a TIFF file.
The following code example shows how to convert an XPS file to TIFF images using Java.
Free API License
You can get a free temporary license to try the library without evaluation limitations.
Please try the following free online XPS to TIFF conversion tool, which is developed using the above API. It is a great tool for those who need to convert their XPS files to TIFF format.
In this article, we have learned how to convert XPS to TIFF in Java. We have also seen how to specify various TIFF save options programmatically. Besides, you can learn more about Aspose.Page for Java API using documentation. In case of any ambiguity, please feel free to contact us on our free support forum.