Please upgrade to Aspose.PDF for Java 18.9.1 and try to use below code snippet in your environment, then share your kind feedback with us.
// Instantiate Document Object
Document doc = new Document();
// Add a page to pages collection of document
Page page = doc.getPages().add();
page.getPageInfo().setLandscape(true);
// Load the source image file to Stream object
java.io.FileInputStream fs = new java.io.FileInputStream("D:\\Tiff to pdf\\input\\gr1.tif");
// Set margins so image will fit, etc.
page.getPageInfo().getMargin().setBottom(0);
page.getPageInfo().getMargin().setTop(0);
page.getPageInfo().getMargin().setLeft(0);
page.getPageInfo().getMargin().setRight(0);
// Create an image object
com.aspose.pdf.Image image1 = new com.aspose.pdf.Image();
// Add the image into paragraphs collection of the section
page.getParagraphs().add(image1);
// Set the image file stream
image1.setImageStream(fs);
// Save resultant PDF file
doc.save(dataDir + "TIFF2PDF_DOM.pdf");
We have attached generated PDF file for your kind reference TIFF2PDF_DOM.pdf. We hope this will be helpful. Please feel free to contact us if you need any further assistance.