Hi,
We are using this snippet to convert TIF to PDF
Document doc = new Document();
Page page = doc.getPages().add();
Image image = new Image();
InputStream isImage = new FileInputStream(“sample.tif”);
image.setImageStream(isImage);
page.getPageInfo().getMargin().setBottom(0);
page.getPageInfo().getMargin().setTop(0);
page.getPageInfo().getMargin().setLeft(0);
page.getPageInfo().getMargin().setRight(0);
int width=0;
int height=0;
page.setCropBox(new com.aspose.pdf.Rectangle(0, 0, width, height));
page.getParagraphs().add(image);
doc.save(“sample.pdf”,com.aspose.pdf.SaveFormat.Pdf);
However we are not able to find out TIF’s width and height to substitute from standard JDK libraries.
page.setCropBox(new com.aspose.pdf.Rectangle(0, 0, width, height));
what we need is if we dont call
page.setCropBox(new com.aspose.pdf.Rectangle(0, 0, width, height)); then we want aspose.pdf to set the TIF’s width and height to the generated pdf.