@mrajgopal.22,
I think your issue may not be with Aspose.Cells API. I separated the scenario/case regarding Aspose.Cells part to try to trace the issue. I tested using the following sample code with your template Excel file. The output XLSX, PDF and image files (attached) are fine tuned.
e.g.
Sample code:
Workbook workbook = new Workbook("f:\\files\\Untitled Report - 2022-12-27T175125.754.xlsx");
Worksheet worksheet = workbook.getWorksheets().get(0);
worksheet.autoFitColumns();
worksheet.setGridlinesVisible(false);
worksheet.getPageSetup()
.setPrintArea(worksheet.getCells().get(4, 0).getName() + ":"
+ worksheet.getCells().get(50, 9).getName());
worksheet.getPageSetup()
.setPrintArea(worksheet.getCells().get(4, 0).getName() + ":"
+ worksheet.getCells().get(25 + 1, 9).getName());
workbook.getWorksheets().setOleSize(0, 25,0, 9);
workbook.save("f:\\files\\out1.xlsx", com.aspose.cells.SaveFormat.XLSX);
workbook.save("f:\\files\\out1.pdf", SaveFormat.PDF);
ImageOrPrintOptions imageOptions = new ImageOrPrintOptions();
imageOptions.setImageType(ImageType.EMF);
imageOptions.setOnlyArea(true);
imageOptions.setOnePagePerSheet(true);
SheetRender sheetRender = new SheetRender(worksheet, imageOptions);
sheetRender.toImage(0, "f:\\files\\out1.emf");
I am using latest version/fix: Aspose.Cells for Java v22.12 (Releases | Maven). Please try it for your scenario/case if it makes any difference. Also, add relevant lines of code (as I did it above) to generate output Excel, PDF and image files to file path. Check the output files generated by Aspose.Cells for Java if you find any issue with any of the files? Also, share the output files with us. We will check it further.
files1.zip (98.6 KB)
PS. please note, auto-fit rows and columns operations require relevant fonts to installed on the machine, so you should make sure if the underlying fonts (e.g., “Arial”, etc.) are installed on your environment.