Hello,
After saving a docx document as pdf, in the resulting PDF the font is displayed incorrectly, even though I set a directory with fonts. Below you can find the code used:
package com.test;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import com.aspose.words.FontSettings;
import com.aspose.words.License;
public class AsposeDocxToPdfConversion
{
public static void main(String[] args) throws Exception
{
try(InputStream inputWord = Files.newInputStream(Paths.get("C:/test/test.docx"));
OutputStream outputPdf = Files.newOutputStream(Paths.get("C:/test/test.pdf")))
{
FontSettings.getDefaultInstance().setFontsFolder("C:/test/fonts", false);
com.aspose.words.Document asposeDoc = new com.aspose.words.Document(inputWord);
asposeDoc.save(outputPdf, com.aspose.words.SaveFormat.PDF);
}
}
}
I also attach the source docx file (test.docx), the pdf file created by Aspose (test.pdf incorrect), the pdf file created by Word2016 (test-word.pdf correct), zip file with fonts from C:/test/fonts directory.
Is it a bug in the Aspose.Words for Java (I have checked also the newest version) or something in the code should be done differently?test.zip (631.3 KB)