Unwanted footer phrase text in the imported image from Excel sheet in Java - Sheet to image rendering

Last July, I purchased Aspose Cells for Java and I am using it very often.

However, recently I faced one problem.

If you look at the image below, there is “NO. 1” in the imported image from Excel.

I don’t know why it is added on the image, so could you help me removing it from the exported image?
Excel_toImage_pageIndex.png (3.4 KB)

Best Regards,

@chertsey,
Please share your sample file and code snippet with us for our testing. We will reproduce the problem and provide our feedback after analysis.

Dear Ahsan,

Thank you for interest. Please refer to the attached Excel sample file and code snippet.

worksheet.getPageSetup().setPrintArea(startArea + “:” + endArea);
worksheet.getPageSetup().setLeftMargin(0);
worksheet.getPageSetup().setRightMargin(0);
worksheet.getPageSetup().setTopMargin(0);
worksheet.getPageSetup().setBottomMargin(0);

ImageOrPrintOptions options = new ImageOrPrintOptions();

options.setPrintingPage(PrintingPageType.DEFAULT);
options.setOnePagePerSheet(true);
options.setHorizontalResolution(200);
options.setVerticalResolution(200);
options.setImageType(ImageType.PNG);

String outputDir = uploadFilePath;
String pngName = getUuid() + “.png”;

String excelImgFilePath = outputDir + File.separator + pngName;

SheetRender sr = new SheetRender(worksheet, options);

sr.toImage(0, excelImgFilePath);

Best Regards,

@chertsey,
Looks like you could not upload the files successfully. If they are big in size then you can share it via drop box, Google drive etc.

@chertsey,
We have investigated it a bit. It seems that the unwanted text “No. 1” is a footer.
Please try using the code to remove it:

worksheet.getPageSetup().clearHeaderFooter(); 

Let us know your feedback.

Dear Ahsan,

Thank you so much for your advice. That’s exactly what I needed.
It works perfectly!

Thank you again,

@chertsey,

It is nice to know that your issue is sorted out by the suggested line of code. In the event of further queries or issue, feel free to contact us any time, we will be happy to assist you soon.