简体   繁体   English

使用PDFClown(.net版本)列出嵌入字体

[英]List embedded fonts using PDFClown (.net version)

Is there a way to get the list of embedded fonts in a PDF file using the PDFClown library? 有没有一种使用PDFClown库获取PDF文件中嵌入字体的列表的方法? The aim is to check whether it is a scanned PDF of not, assuming it is a scanned document if it doesn't have embedded fonts. 目的是检查它是否为非PDF扫描文件,并假设它是否为嵌入字体的扫描文档。

Thanks in advance 提前致谢

UPDATE 更新

I've just found out how to list embedded PDF fonts, even though it didn't help much with my problem. 我刚刚发现了如何列出嵌入式PDF字体,即使它对我的问题没有太大帮助。 Here's a sample code. 这是示例代码。

    string pdffile = @"path\to\your\PDF\document.pdf";
    using (File pdf = new File(pdffile))
    {

        Document doc = pdf.Document;
        foreach (Page page in doc.Pages)
        {
            foreach (var a in page.Resources.Fonts.Keys)
            {
                Console.WriteLine(page.Resources.Fonts[a].Name);
            }

        }
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM