Xls/xlsx to pdf Convertion issue

Dear Team,
I have Issue in xls/xlsx to pdf Convertion, pdf file is generated but not working properly.

Screen Shot,
image.png (5.4 KB)
image.png (4.5 KB)

Sample
Desktop.zip (81.5 KB)

Code
private static void xlsxconversion(String dataDir)
{
License.xlsxlicense();
try
{
Workbook wb = new Workbook(dataDir);
wb.getWorksheets().get(0).autoFitRows(true);
PdfSaveOptions saveOption = new PdfSaveOptions();
saveOption.setCompliance(PdfCompliance.PDF_A_1_B);
saveOption.setAllColumnsInOnePagePerSheet(true);
String fileNameWithExt=dataDir;
String fileNameWithOutExt = FilenameUtils.removeExtension(fileNameWithExt);
wb.save(fileNameWithOutExt + “.pdf”, saveOption);
outputPath =fileNameWithOutExt+“.pdf”;
logger.info(“xls/xlsx file converted to PDF successfully!!!”);
}
catch(Exception e)
{
e.printStackTrace();
}
}

Regards,
Rajamanickam S

@rjnick,

Thanks for providing us sample code, screenshots and documents.

Please try our latest version/fix: Aspose.Cells for Java v19.7.3:
aspose-cells-19.7.3.zip (6.6 MB)

I have tested your scenario/ case using the following sample code with your template file using v19.7.3, it works fine and the output file (attached) is ok.
e.g
Sample code:

Workbook wb = new Workbook("f:\\files\\Aspose input.xlsx");
		wb.getWorksheets().get(0).autoFitRows(true);
		PdfSaveOptions saveOption = new PdfSaveOptions();
		saveOption.setCompliance(PdfCompliance.PDF_A_1_B);
		saveOption.setAllColumnsInOnePagePerSheet(true);
		wb.save("f:\\files\\out1.pdf", saveOption);

Let us know if you still find any issue with v19.7.3.
out1.pdf (81.7 KB)

1 Like

Dear @Amjad_Sahi,
Thank you for your Quick Response,

It Works Fine to me

@rjnick,

Good to know that your issue is sorted out by the new fix/version. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

1 Like

Dear @Amjad_Sahi,
Where I found the new Version of Aspose Jar

The latest fix/version shared in the previous post is a bug fix (interim version), it includes all the functionality and fixes/enhancements of the official version (Aspose.Cells for Java v19.7) plus some fixes and other enhancements. The interim fixes are posted in the forums, so the users do not have to wait for the official release (which are published once in a month). In short, you may use that fix without any issue or problem, it will behave like an official release, it is fully tested and we perform QA on it.

1 Like

Thank you @Amjad_Sahi

@rjnick,

You are welcome.

1 Like