Hey Aspose Team,
first thank you for your quick and helpful replies.
There are some things and unfortunately problems I'm running into. The code snippet I have looks as follows:
Pdf pdf = new Pdf();
Section section = pdf.getSections().add();
BufferedImage bImage = ImageIO.read(new FileInputStream(source));
Image image = new Image(section);
ImageInfo imageInfo = image.getImageInfo();
imageInfo.setFile(source);
imageInfo.setImageFileType(ImageFileType.Tiff);
section.setIsLandscape(bImage.getWidth() > bImage.getHeight());
section.getParagraphs().add(image);
pdf.save(target);
Note 1: I can't replace "imageInfo.setFile(source);" with "imageInfo.setSysImageStream(bImage);" because this leads to a null pointer exception:
java.lang.NullPointerException
at aspose.pdf.figure.Acc.a(SourceFile:52)
at aspose.pdf.figure.Abg.a(SourceFile:53)
at aspose.pdf.figure.Abi.a(SourceFile:160)
at aspose.pdf.figure.Abi.a(SourceFile:182)
at aspose.pdf.figure.Aba.a(SourceFile:156)
at aspose.pdf.xml.Abi.a(SourceFile:212)
at aspose.pdf.xml.Abi.a(SourceFile:618)
at aspose.pdf.xml.Abj.a(SourceFile:578)
at aspose.pdf.xml.Acd.a(SourceFile:804)
at aspose.pdf.xml.Aar.a(SourceFile:104)
at aspose.pdf.xml.Aba.a(SourceFile:113)
at aspose.pdf.Pdf.save(SourceFile:929)
Note 2: Creating a tif image using paint in Windows (windows 7), can not be opened by Aspose, the file is attached.
java.lang.RuntimeException: Couldn't open image file: \input.tif
at aspose.pdf.figure.Acb.a(SourceFile:252)
at aspose.pdf.figure.Abi.a(SourceFile:90)
at aspose.pdf.figure.Aba.a(SourceFile:152)
at aspose.pdf.figure.Aba.a(SourceFile:99)
at aspose.pdf.xml.Abi.a(SourceFile:208)
at aspose.pdf.xml.Abi.a(SourceFile:618)
at aspose.pdf.xml.Abj.a(SourceFile:578)
at aspose.pdf.xml.Acd.a(SourceFile:804)
at aspose.pdf.xml.Aar.a(SourceFile:104)
at aspose.pdf.xml.Aba.a(SourceFile:113)
at aspose.pdf.Pdf.save(SourceFile:929)
Note 3: I have image files that do get converted (at least it looks like it), but when I open the pdf file Adobe Reader shows an error popup with "Insufficient data for an image." The pdf in the background is blank. The file is attached.
Note 4: I'm having a TIF that contains several "images" inside. Is there a way to iterate over them?
Note 5: When running those JAI jar's (clibwrapper_jiio.jar, jai_codec.jar, jai_core.jar, jai_imageio.jar, mlibwrapper_jai.jar) in an application server... those need to be endorsed with vm argument -Djava.endorsed.dirs=/lib/endorsed
Note 5: I want to mention that there are TIF's where the conversion works fine :)
I want to thank you in advance for your help.
Kind regards
Peter