shenmegui wrote:i have been useing this jar
,Manifest-Version: 1.0
Extension-Name: spire.doc
Implementation-Title: spire.doc for java
Implementation-Version: 4.3.6
my company has buy a licenses.
there is issue i faced.Cannot find table 'loca' in the font file.it worked fine on winodws,but when i published to linux centos system.it give me this error.it that my linux system should install some font to make it work??? what should I do?
I try to install windows font to linux and not work
this iusse is when i call this method doc.saveToFile(pdfPath, FileFormat.PDF); form doc to pdf.
please help me ,i 'm despired for solution
Hello,
Thank you for your inquiry.
You can install the corresponding fonts in Linux, or you can specify the fonts using the following code. Additionally, since the version of Spire.Doc you are using is quite old, we recommend using the latest version of
Spire.Doc for Java (Version 11.7.0).
- Code: Select all
Document document = new Document();
Paragraph paragraph = document.addSection().addParagraph();
//Specify a private font path
PrivateFontPath fontPath = new PrivateFontPath("font name","C:\\Windows\\Fonts\\STXINGKA.TTF");
TextRange tr = paragraph.appendText("Spire.Doc for Java");
//apply font
tr.getCharacterFormat().setFontName("font name");
ToPdfParameterList toPdfParameterList = new ToPdfParameterList();
List pathList = new LinkedList<>();
pathList.add(fontPath);
toPdfParameterList.setPrivateFontPaths(pathList);
document.saveToFile("F:\\Zhang\\Mission\\7\\7.14\\Output\\EmbedFont1.pdf",toPdfParameterList);
If you continue to experience issues during testing, please provide your Linux system information, such as Ubuntu-20.04.3, for our reference.
Sincerely,
Wenly
E-iceblue support team