Hi,
Hi Ivona,
String outFile = myDir + “ImageToPDF.pdf”;<o:p></o:p>
String inFile = myDir + “Test.tif”;<o:p></o:p>
Document doc = new Document();<o:p></o:p>
Page page = doc.getPages().add();<o:p></o:p>
java.io.FileInputStream imageStream = new java.io.FileInputStream(new java.io.File(inFile));<o:p></o:p>
//Create an image object<o:p></o:p>
com.aspose.pdf.Image image1 = new com.aspose.pdf.Image();<o:p></o:p>
//Add the image into paragraphs collection of the section<o:p></o:p>
page.getParagraphs().add(image1);<o:p></o:p>
//Set the ImageStream to a MemoryStream object<o:p></o:p>
image1.setImageStream(imageStream);<o:p></o:p>
//Set margins so image will fit, etc.<o:p></o:p>
page.getPageInfo().getMargin().setBottom(0);<o:p></o:p>
page.getPageInfo().getMargin().setTop(0);<o:p></o:p>
page.getPageInfo().getMargin().setLeft(0);<o:p></o:p>
page.getPageInfo().getMargin().setRight(0);<o:p></o:p>
doc.save(outFile);<o:p></o:p>
<o:p> </o:p>
<o:p>Please feel free to contact us for any further assistance.</o:p>
<o:p>
</o:p>
<o:p>Best Regards,</o:p>
Thanks Tilal for the feedback;
How can I handle the case of multiple pages? I would like each page (not frame) in the Tiff file to go in a distinct PDF page (total pages in Tiff = total page in PDF resulting).
Please find attached an example of a Tiff file with 9 pages, could you please provide a code snippet to achieve this?
Regards,
Hi Ivona,
Hi Ivona,
The issues you have found earlier (filed as PDFNEWJAVA-34482) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
I still have issue with this i get the PDF with same number of pages as tiff’s but everything is blank. what am i missing?
Hi Suresh,
Can you please share the input TIFF image, so that we can test the scenario in our environment. We are sorry for this inconvenience.