Free Support Forum -

XLSX to PDF: Wrong text format and font

I have some problem when print a excel file to pdf using aspose.cell :

  1. Text style in a cell is wrong alignment, spacing between words, line spacing.
  2. Font problem: font is too strong than source in MS-excel, can’t print multi font.
    i use font “Times New Roman” for nomal text, “Wingdings” for checkbox

p/s: sorry about my english skill, hope you understand and help me. Thank all !!!
aspose cell version 21.5:

excel.png (5.1 KB)
pdf.png (10.5 KB)

Please share your sample file and code snippet with us for our testing. We will reproduce the problem and provide our feedback after analysis.

This is my code:

Workbook workbook = new Workbook("src/main/resources/templates/excel.xlsx");
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();, pdfSaveOptions);
writeBinaryFile("src/main/resources/templates/pdf.pdf", outputStream.toByteArray());

public static void writeBinaryFile(String filepath, byte[] data) {
    try (FileOutputStream fos = new FileOutputStream(filepath)) {
    } catch (Exception e) {
        log.error("", e);

and sample file, hope receive your support soon ! (29.4 KB)


It seems your issue is due to missing fonts on your end. Please make sure that TimesNewRoman, Arial and Wingdings fonts (.ttf or .ttc) are installed on your system and fonts folder is accessible seamlessly, so Aspose.Cells for Java could use it for rendering to PDF feature. See the attached output PDF that is generated on my pc.
out1.pdf (62.8 KB)

PS. I am using latest fix, so please try it: (7.3 MB)

1 Like

Thank you so much, it works !!!


Good to know that your issue is resolved now. 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.