Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Tue Feb 20, 2024 8:19 am

I'm having a problem trying to convert a docx to pdf which has a multilevel lists. The bullets in the first list and at least in multiple inner list are rendered as white squares instead of the actual bullets. I've tried using multiple different versions of spire office and the issue persists on all of them. Here is the relevant part of my code which should be pretty standard. I've attached the test document I'm using with screencaps of what it should look like and what I'm getting from the conversion.

Code: Select all
        document.setEmbedFontsInFile(true);
        var toPdfParameterList = new ToPdfParameterList();
        toPdfParameterList.setCreateWordBookmarks(true);
        toPdfParameterList.setUsePSCoversion(true);
        document.saveToStream(outputStream, toPdfParameterList);

spiidyee
 
Posts: 3
Joined: Tue Feb 20, 2024 7:54 am

Tue Feb 20, 2024 9:01 am

Hello,

Thank you for your inquiry.
I have conducted testing on the Word document you provided but was unable to replicate the issue you mentioned. Upon reviewing the screenshots you shared, it appears that the appearance of white boxes is likely due to your system not having the "Symbol" and "Wingdings" fonts installed. Please be aware that our Spire.Doc retrieves fonts from the system font library during conversion operations. If the fonts used in the Word document are not installed on the system, it may result in issues such as garbled text or white boxes in the output file.
Please check if both fonts are installed on your system and test again.
I've attached a PDF of my test results and a screenshot of the fonts used for the bullets in your Word document.
Should you have any further questions or require additional assistance, please do not hesitate to reach out.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1651
Joined: Wed Apr 07, 2021 2:50 am

Tue Feb 20, 2024 9:55 am

Symbol wasn't installed and I've installed it so both fonts are present and I've also tried adding them as PrivateFontPath to the ToPdfParameterList, but the problem isn't fixed. I'm using a mac for testing locally.

spiidyee
 
Posts: 3
Joined: Tue Feb 20, 2024 7:54 am

Wed Feb 21, 2024 6:42 am

Hello,

Thanks for your feedback.
Based on your situation, it seems like the font could not be found. Please try to set the directory path where your font is located as follows and test again. We look forward to your further test results and feedback.
Code: Select all
        //Fonts path
        Document.setGlobalCustomFontsFolders("/Library/Fonts");
        .....
        document.setEmbedFontsInFile(true);
        var toPdfParameterList = new ToPdfParameterList();
        toPdfParameterList.setCreateWordBookmarks(true);
        toPdfParameterList.setUsePSCoversion(true);
        document.saveToStream(outputStream, toPdfParameterList);

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Wed Feb 21, 2024 9:54 am

This solution fixed the problem, thank you!

spiidyee
 
Posts: 3
Joined: Tue Feb 20, 2024 7:54 am

Wed Feb 21, 2024 9:58 am

Hello,

Glad to hear that, if there is anything else we can do for you in the future, just feel free to contact us!

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.Doc