We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Need help! PdfToImage Font loss

Dear Aspose team,
When we use PDF to convert pictures, the Chinese font is lost, and the generated pictures display all the Chinese random code. Please tell us how to write code to solve this problem.

source pdf:
1.png (90.5 KB)

image :
2.png (10.3 KB)

Thanks for you !!!


Thank you for contacting support.

You are facing this problem because of missing fonts in your environment. This could be fixed by installing the font being used in the PDF document.

Please install the font in default font directory or set a path to the font using the FontRepository.addLocalFontPath() or below function with Aspose.PDF for Java 19.2.

String path = "path/to/my/folder";
List<String> fontPaths = FontRepository.getLocalFontPaths();

If you are working with Aspose.PDF for .NET API, then use below method:

// connect custom font directory
FolderFontSource fs = new FolderFontSource(@"path\to\my\folder");

In case of any further assistance, please share respective data along with narrowed down code snippet.