I am trying to allow for as many image types as possible to be allowed in my form for addition to a pdf. Right now I can do jpg and tif, but really also need png and bmp, and any other you may know.

Here is the code I have so far that works:
                PDXObjectImage yimage = null;
                if (logo.toLowerCase().endsWith(".jpg")) {
                    yimage = new PDJpeg(doc, new FileInputStream(logo));
} else if (logo.toLowerCase().endsWith(".tif") || logo.toLowerCase().endsWith(".tiff")) { yimage = new PDCcitt(doc, new RandomAccessFile(new File(logo), "r"));
                } else {
throw new IOException("Image type not supported:" + logo);
                }

Any help adding at least bmp and png to this 'if else'?

Thanks,
Bryancan

Reply via email to