How to Convert OTG to PDF in Java

This brief tutorial explains the basics of how to convert OTG to PDF in Java. It will enable you to export OTG to PDF in Java by using a few lines of code on any operating system like MS Windows, Linux, or macOS. Many of the options and compliance settings can be configured in the output PDF file before conversion from the OTG.

Steps to Convert OTG to PDF in Java

  1. Install Aspose.Imaging from the Maven Repository in your project to convert OTG to PDF
  2. Load the input OTG file into the Image class object
  3. Initialize the PdfOptions class object to set properties for the output PDF
  4. Set compliance setting for output PDF with PdfComplianceVersion enum
  5. Set the output PDF file resolution and metadata information
  6. Save the output PDF file converted from the input OTG file

In the above steps, we have loaded the source OTG file and initialized the PdfOptions class instance for setting the properties of the output PDF file. In this process to change OTG to PDF in Java we have set a few properties including the horizontal and vertical resolution and metadata of the output file however many other properties can also be set.

Code to Export OTG to PDF in Java

In this code sample, the horizontal and vertical resolution and the metadata information of the output PDF file is configured before exporting OTG to PDF in Java. You can change the values of resolution, compliance, and metadata as per your requirements.

Furthermore, you can visit how to convert BMP to PNG in Java to check different features for working with images.

 English