简体   繁体   中英

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? 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.

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. 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);
            }

        }
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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