IWarningCallback doesn't work

final Presentation pres = new Presentation(srcPath);
PdfOptions pdfOptions = new PdfOptions();
pdfOptions.setDefaultRegularFont(FileConvertConstant.DEFAULT_FONT);
pdfOptions.setWarningCallback(new HandleFontsWarnings());

    final IFontsManager fontsManager = pres.getFontsManager();
    // 获取ppt里面所有的字体
    IFontData[] embeddedFonts = fontsManager.getFonts();
    FontsLoader.loadExternalFonts(new String[]{FileConvertConstant.FONT_PATH});
    if(embeddedFonts.length > 0){
        for (IFontData embeddedFont : embeddedFonts) {
            final String fontName = embeddedFont.getFontName();

            log.warn("font :{} not find",fontName);
            // 最后指定默认的
            fontsManager.replaceFont(embeddedFont, new FontData(FileConvertConstant.DEFAULT_FONT));
        }
    }

    pres.save(savePath, SaveFormat.Pdf,pdfOptions);
    log.info(">>>解析成功>>>"+savePath);
    return savePath;
}

private class HandleFontsWarnings implements IWarningCallback
{
    public int warning(IWarningInfo warning)
    {
        log.info(JSON.toJSONString(warning));
        return ReturnAction.Continue;
    }
}

2021-05-13 13:41:12.698 INFO 38937 — [ main] c.t.i.f.c.c.o.Ppt2PdfConversionImpl : >>>>开始解析ppt>>>/Users/zyx/Downloads/立白天猫超级品类日方案 (1).ppt
2021-05-13 13:41:47.709 WARN 38937 — [ main] c.t.i.f.c.c.o.Ppt2PdfConversionImpl : font :Arial not find
2021-05-13 13:41:47.758 WARN 38937 — [ main] c.t.i.f.c.c.o.Ppt2PdfConversionImpl : font :微软雅黑 not find
2021-05-13 13:41:47.759 WARN 38937 — [ main] c.t.i.f.c.c.o.Ppt2PdfConversionImpl : font :Helvetica Light not find
2021-05-13 13:41:47.760 WARN 38937 — [ main] c.t.i.f.c.c.o.Ppt2PdfConversionImpl : font :Helvetica not find
2021-05-13 13:41:47.760 WARN 38937 — [ main] c.t.i.f.c.c.o.Ppt2PdfConversionImpl : font :方正兰亭中黑_GBK not find
2021-05-13 13:41:47.761 WARN 38937 — [ main] c.t.i.f.c.c.o.Ppt2PdfConversionImpl : font :Wingdings not find
2021-05-13 13:41:47.762 WARN 38937 — [ main] c.t.i.f.c.c.o.Ppt2PdfConversionImpl : font :等线 Light not find
2021-05-13 13:41:47.763 WARN 38937 — [ main] c.t.i.f.c.c.o.Ppt2PdfConversionImpl : font :等线 not find
2021-05-13 13:41:47.763 WARN 38937 — [ main] c.t.i.f.c.c.o.Ppt2PdfConversionImpl : font :Times New Roman not find
2021-05-13 13:41:47.764 WARN 38937 — [ main] c.t.i.f.c.c.o.Ppt2PdfConversionImpl : font :Helvetica Neue not find
2021-05-13 13:41:47.764 WARN 38937 — [ main] c.t.i.f.c.c.o.Ppt2PdfConversionImpl : font :DIN Condensed not find
2021-05-13 13:41:47.765 WARN 38937 — [ main] c.t.i.f.c.c.o.Ppt2PdfConversionImpl : font :Calibri not find
2021-05-13 13:41:47.765 WARN 38937 — [ main] c.t.i.f.c.c.o.Ppt2PdfConversionImpl : font :Calibri Light not find
2021-05-13 13:42:10.001 INFO 38937 — [ main] c.t.i.f.c.c.o.Ppt2PdfConversionImpl : >>>解析成功>>>/Users/zyx/Desktop/字体修正后-2.pdf

@zyx,
Thank you for your query. Unfortunately, I don’t understand the issue. You are checking embedded fonts, and when the fonts exist, you are logging the fonts are not found. Could you describe more details about the problem, please?

I want IWarningCallback to work, but he doesn’t seem to print anything, but in fact he should print out some fonts and can’t find it

@zyx,
Thank you for the additional information. To investigate this case, please share and specify the following:

  • The input presentation file
  • Your output PDF file
  • The version of Aspose.Slides you used
  • The version of the operating system on which the problem occurs

But first, please check the issue with the latest version of Aspose.Slides.