Aspose.pdf - Get a list of fonts in pdf

by sunil ravulapalli /18. January 2018 05:29 / /Comments (0)
public List GetFonts(string fileName)
{
	var fontNames = new List();
	var pdfDocument = new Document(fileName);
	for (var i = 1; i <= pdfDocument.Pages.Count; i++)
	{
		foreach (Aspose.Pdf.Text.Font font in pdfDocument.Pages[i].Resources.Fonts)
		{
			if (!fontNames.Exists(x => x.Contains(font.FontName)))
				fontNames.Add(font.FontName);
		}
	}

	return fontNames;
}
blog comments powered by Disqus