Hi,
I am using Aspose.Cells for Java (aspose-cells-19.7.jar) with the total license.
I am trying to convert csv file to pdf and have a few issues:
- There are redundant headlines (C, D, etc.) although there is not any text beneath these headlines.
- Text is cut - the last 2 words are missing - “country (Morocco)”.
- I can’t find a way to set a fixed font size and to use a line break when the text reach the end of the line.
Here are my files: files.zip (33.2 KB)
Here is my code:
try {
String filepath = Paths.get(“test.csv”).toAbsolutePath().toString();
final LoadOptions loadOptions = new LoadOptions(LoadFormat.CSV);
final Workbook csvFile = new Workbook(filepath, loadOptions);
final Worksheet worksheet = csvFile.getWorksheets().get(0);
worksheet.autoFitColumns();
final PageSetup pagesetup = worksheet.getPageSetup();
pagesetup.setFitToPagesTall(0);
pagesetup.setPaperSize(PaperSizeType.PAPER_A_4);
pagesetup.setPrintQuality(1200);
pagesetup.setPrintGridlines(true);
pagesetup.setPrintHeadings(true);
pagesetup.setPrintComments(PrintCommentsType.PRINT_IN_PLACE);
pagesetup.setPrintDraft(true);
pagesetup.setPrintErrors(PrintErrorsType.PRINT_ERRORS_NA);
pagesetup.setOrder(PrintOrderType.OVER_THEN_DOWN);
final String pdfFilePath = Paths.get(filepath.replace(".csv", "").concat(".pdf")).toAbsolutePath().toString();
PdfSaveOptions pso = new PdfSaveOptions();
pso.setGridlineType(GridlineType.HAIR);
csvFile.save(pdfFilePath, pso);
}
catch(Exception e){
e.printStackTrace();
}
Would you like to help me please with these issues?
Thanks.