Hello,
Thanks for your inquiry.
I suggest you copy the font file under /usr/share/fonts, then install it and try again.
Besides, our Spire.Doc supports using uninstalled font when converting Doc to PDF, as shown below, please also try it on your side. Looking forward to your further feedback.
- Code: Select all
String inputFile="data/convertedTemplate.docx";
String fontFile="data/Calibri.ttf";
String outputFile="output/embedNoninstalledFonts.pdf";
Document document = new Document();
document.loadFromFile(inputFile);
//embed the non-installed fonts.
ToPdfParameterList parms = new ToPdfParameterList();
List<PrivateFontPath> fonts = new ArrayList<PrivateFontPath>();
fonts.add(new PrivateFontPath("Calibri", fontFile));
parms.setPrivateFontPaths(fonts);
//save the document to a PDF file.
document.saveToFile(outputFile, parms);
Sincerely,
Rachel
E-iceblue support team