// Prepare HTML code and save it to a file String code = "Hello, World!!"; try (java.io.FileWriter fileWriter = new java.io.FileWriter("tiff.html")) { fileWriter.write(code); } // Initialize an HTML document from the file HTMLDocument document = new HTMLDocument("tiff.html"); // Initialize ImageSaveOptions ImageSaveOptions options = new ImageSaveOptions(ImageFormat.Tiff); // Convert HTML to TIFF Converter.convertHTML(document, options, "tiff-output.bmp");