Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i list all fonts from a powerpoint document using with Open XML SDK 2.0. I have got all fonts from word(docx) and excel(xlsx), thats available in fonttable but i dont know where can be found for powerpoint(pptx) documents. Please help me
Posted
Comments
[no name] 1-Sep-17 4:21am    
For XLSX it's easy, you just need to read "styles.xml" part and check the "styleSheet" -> "fonts" element.

For DOCX it's not that easy.
First the document does not have to have "fontTable.xml" part.
Second the "fontTable.xml" can have less or even more fonts then what is actually used in the "document.xml".
So to get the correct information you would need to check all "rPr" -> "rFonts" elements in "document.xml" part, but also in all headers, footers, etc.

For PPTX there is no centralized part which contains the font information. It is scattered everywhere, it can be in "presentation.xml", in master slides, layout slides, regular slides, etc...
Which is why I would recommend you to use an alternative approach, for example check this PPTX example in C# and VB.NET, it shows how you can work with that format and how you can obtain strongly typed slides in C# and VB.NET. What you would need to do is iterate through presentations whole content and search for TextCharacterFormat.Font.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900