We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Setting JPG in footer giving issues


I have issues setting a jpg file in the footer using aspose cells JAVA. It works fine with a gif image. can you please let me know if there is some issue with my code? Please reply with any changes in JAVA.Thanks.

URL url = new URL(sLogo);

InputStream openStream = url.openStream();

int contentLength = openStream.available();

picData = new byte[contentLength];


worksheet.getPageSetup().setFooterPicture(2, picData);


com.aspose.cells.CellsException: Unknown image format:-1

at com.aspose.cells.aC.a(Unknown Source)

at com.aspose.cells.eM.a(Unknown Source)

at com.aspose.cells.eK.a(Unknown Source)

at com.aspose.cells.ShapeCollection.a(Unknown Source)

at com.aspose.cells.PageSetup.a(Unknown Source)

at com.aspose.cells.PageSetup.setFooterPicture(Unknown Source)


Thanks for your posting and using Aspose.Cells for Java.

Your code looks ok to me. Please make sure the JPG file you are using is actually intact and not corrupt file and also it’s format is in jpg.

If the problem still occurs, then please provide me your complete sample runnable code to look into this issue.

Please download and use the latest version:
for Java v7.1.1.3