Convert PDF to JPEG in Java using Aspsoe.PDF - fonts are not properly rendered

PDF convert to jpg text unrecognized
aspose.pdf 19.4
Mac OS 10.14.4
java version “1.8.0_181”
Java™ SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot™ 64-Bit Server VM (build 25.181-b13, mixed mode)

报关资料__BFC1190110008.pdf (502.0 KB)
test_page.jpg (523.0 KB)

Code
Resolution resolution = new Resolution(300);
JpegDevice jpegDevice = new JpegDevice(resolution, 100);
jpegDevice.process(pdfDocument.getPages().get_Item(page), fileOutputStream);

@JamesGuo

Would you please make sure that necessary fonts (minimum all Microsoft Essential Fonts) are installed on the system you are working. In case issue still persists, please let us know. We will further proceed to assist you accordingly.

报关资料__BFC1190110008的副本.pdf (47.4 KB)
test_page.jpg (850.6 KB)
it has nothing to do with fonts , keep only the first page,convert success
don’t know why

@JamesGuo

We were able to replicate the issue in our environment and logged it as PDFJAVA-38596 in our issue tracking system. We will further look into details of the issue and keep you posted with the status of its resolution. Please be patient and spare us little time.

We are sorry for the inconvenience.

how to subscribe bug fixes

@JamesGuo

You may keep an eye over release notes section which will include this ticket ID once resolved. Moreover, we will also notify you here as soon as it will be resolved.

@JamesGuo

We have completed the investigation of the earlier logged ticket.

The 报关资料__BFC1190110008的副本.pdf is converted fine cause all used fonts are embedded inside the document. In 报关资料__BFC1190110008 (1).pdf most of the fonts are not embedded and when they are not installed in OS then the default font is used. The default font has not all glyphs for Chinese.

There are two ways for correct rendering:

1- Install absent fonts: “STSong-Light, STSong-Light-Bold-UniGB-UCS2-H” or set path to the fonts by the code FontRepository.addLocalFontPath(PATH_TO_FONTS);
2- Substitute absent fonts with some other compatible font by the code below (tested with STSong.ttf font that has been installed before the conversion).

FontRepository.getSubstitutions().add(new FontSubstitute());
Document pdfDocument = new Document(dataDir + "报关资料__BFC1190110008 (1).pdf");
...

 public class FontSubstitute extends CustomFontSubstitutionBase {
    public boolean trySubstitute(OriginalFontSpecification originalFontSpecification,  com.aspose.pdf.Font[] substitutionFont) {
        System.out.println(originalFontSpecification.getOriginalFontName());

        if (originalFontSpecification.getOriginalFontName().contains("Song")) {
           substitutionFont[0] = FontRepository.findFont("STSong");
           System.out.println("was changed on "  + substitutionFont[0].getFontName());
           return true;
        }

        return false;
     }  
}