import java.io.File;
import com.aspose.imaging.Image;
import com.aspose.imaging.imageoptions.*;
import com.aspose.imaging.fileformats.tiff.enums.TiffExpectedFormat;

//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-Java/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
public class Main {
  public static void main(String[] args) {
    // get path of the input data
    String templatesFolder = System.getenv("DATA_PATH");
    // get output path
    String outputFolder = System.getenv("OUT_PATH");

    if (templatesFolder == null)
       templatesFolder = "data";

    if (outputFolder == null)
      outputFolder = "out";

    // Load the tiff file in an instance of Image
    try (Image image = Image.load(templatesFolder + File.separator + "template.tiff")) {
      // Create an instance of EmfOptions
      EmfOptions exportOptions = new EmfOptions();
      // Save tiff to emf
      image.save(outputFolder + File.separator + "tiff-to-emf-output.emf", exportOptions);
    }
  }
}