Hi,
1. how can I convert an image file to a PDF with the PDF size the same as the original image file? Right now I can see only some sample to add an image into a standard A4 page size.
2. how can I convert a multipage TIFF into PDF? with the code below I get a strange exception:
Pdf pdf1 = new Pdf();
//Create a new section in the Pdf object
Section sec1 = pdf1.getSections().add();
//Create an image object in the section
aspose.pdf.Image image = new aspose.pdf.Image(sec1);
//Add image object into the Paragraphs collection of the section
sec1.getParagraphs().add(image);
//Set the ImageStream information
image.getImageInfo().setSystemImage(ImageIO.read(imageFile));
// set the value that all frames of tiff image need be added into PDF document
image.getImageInfo().setTiffFrame(-1);
//Save the pdf document
pdf1.save(pdfFile.getAbsolutePath());
java.lang.IllegalArgumentException: input object was not set
at com.aspose.ms.imagecodecs.tiff.b.do(Unknown Source)
at com.aspose.ms.imagecodecs.tiff.b.read(Unknown Source)
at javax.imageio.ImageIO.read(ImageIO.java:1422)
at javax.imageio.ImageIO.read(ImageIO.java:1282)
Thanks in advance for any help.
Mariusz