Hello,
Thank you for your feedback.
Based on the information you provided, I have checked and found that the Calibri font is not installed in your Linux environment. Starting from Spire.Doc for Java 12.1.0, we have enhanced font detection, which may have caused the issue you mentioned.
In Spire.Doc, when converting Word to PDF, you can specify the font file path. To resolve this issue without installing the font in the testing environment, please place the Calibri font file used in your Word document into the "Fonts" folder and use the following code for testing:
- Code: Select all
// Create a new Document object
Document document = new Document();
// Load the document from the specified file, automatically detecting the file format
document.loadFromFile("hebrew.docx", FileFormat.Auto);
// Set the custom fonts folder path
document.setCustomFontsFolders("Fonts");
// Save the document to a PDF file at the specified path using the PDF format
document.saveToFile("output/result-12.1.16.pdf", FileFormat.PDF);
This way, you won't need to install the font in the testing environment.
Sincerely,
Annika
E-iceblue support team