.NET PDF转word 如何判断字体缺失

有一个pdf文件,调用save方法后,转出来的word文件发现部分文字缺失,请问如何判断pdf文件里的字体系统没有安装?我试了如下的代码,均判断不到字体缺失:
public static bool CheckPageFont(Page p, ref string font_name)
{
// ensure all fonts declared on page resources are embedded
// note that if fonts are declared on form resources they are not accessible from page resources
if (p.Resources == null)
{
return true;
}
foreach (var font in p.Resources.Fonts)
{

            if (!font.IsAccessible)
            {
                font_name = font.FontName;
                return false;
            } 
            if (!font.IsEmbedded)
            {
                font.IsEmbedded = true;
            }
        }

        return true;
    }

public static bool CheckDocFont(Document doc, ref string font_name)
{
// ensure all fonts declared on page resources are embedded
// note that if fonts are declared on form resources they are not accessible from page resources
Font[] fonts = doc.FontUtilities.GetAllFonts();
foreach (var font in fonts)
{
if (!font.IsAccessible)
{
font_name = font.FontName;
return false;
}
if (!font.IsEmbedded)
{
font.IsEmbedded = true;
}
}

        return true;
    }

@linxiaoping

感谢您与支持人员联系。

您能否分享您的源文件,以便我们可以尝试在我们的环境中重现和调查它。

感谢回复!其实我想知道font.IsAccessible这个属性可以判断字体是否缺失吗?如果不可以,请告诉我判断字体缺失的接口

@linxiaoping

IsAccessible属性指示字体是否存在(安装)在系统中。 您还可以在上面的API reference链接中找到示例代码。