I am trying to add an image to PDF document. If I use images which came with source code, they are coming up fine. But if I load any other valid images I am getting exception.
Image img1 = new Image(sec1);
img1.getImageInfo().setFile("D:/aspose/samples/resources/graphics/asposeBanner.gif");//this is working fine.
img1.getImageInfo().setFile("D:/barcode.gif"); // this is not working and image size is 18KB
java.lang.IllegalArgumentException: Invalid image handle in GetImageWidth method:
What am I doing wrong here?