Skip to content

xlsx to pdf datetime conversion error #48

@j75

Description

@j75

marian3.xlsx

Converting the attached file on a French computer produces incorrect PDF:

  • simply running my program (java -jar <my fat jar>) all data rows are displayed in the PDF as ######
  • however, if I run my program with the -Duser.language=fr_FR option the dates are displayed, but in English way (month/day/year) - what I want is to display them French style: day/month/year - as they are displayed by Microsoft Excel or Libre Office.

My Java code is basically this one:

Workbook workbook = new Workbook("marian3.xlsx");
int sheetCount = workbook.getWorksheets().getCount();
for (int s = 0; s < sheetCount; s++) {
            Worksheet sheet = workbook.getWorksheets().get(s);
            PageSetup pageSetup = sheet.getPageSetup();
            pageSetup.setLeftMargin(MARGIN_CM);  // private static final double MARGIN_CM = 0.4;
            pageSetup.setRightMargin(MARGIN_CM);
            pageSetup.setTopMargin(MARGIN_CM);
            pageSetup.setBottomMargin(MARGIN_CM);
            pageSetup.clearHeaderFooter();
}
PdfSaveOptions options = new PdfSaveOptions();
options.setOnePagePerSheet(true);
options.setCompliance(PdfCompliance.PDF_A_1_B); // NONE, PDF_A_1_A, PDF_A_1_B
options.setCustomPropertiesExport(PdfCustomPropertiesExport.STANDARD);
workbook.save("out.pdf", options);

Did I miss any option/parameter/... ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions