Hi, I have a need to convert excel files to pdf (content isn’t known and may be user inputted but some may have date values). The format of the date seems to be different from the source to the pdf result.
I’ve read that it has something to do with the locale? However, please see below code snippet and it doesn’t seem to be working. Can help advise on this issue please? Thanks!
Aspose version:
cells: 23.10
pdf: 23.10
Sample Code:
Workbook workbook = new Workbook(sourceFilePath);
// workbook.getSettings().setLocale(null);
workbook.getSettings().setLocale(Locale.getDefault());
workbook.getSettings().setRegion(CountryCode.DEFAULT);
Worksheet worksheet = workbook.getWorksheets().get(0);
worksheet.autoFitRows(true);
PdfSaveOptions pdfOptions = new PdfSaveOptions();
pdfOptions.setExportDocumentStructure(true);
workbook.save(finalSourcePath, pdfOptions);
Input:
image.png (18.8 KB)
Output:
image.png (25.6 KB)
testPdfConverted.pdf (468.7 KB)
Test_DateFormat.zip (131.1 KB)