Extract font information from a Word document
Extracting font metadata from Word documents helps you audit typography usage, detect missing fonts, and validate document compatibility across environments.
Use this workflow when you need to:
- Inventory fonts used in DOCX files
- Detect missing fonts before conversion or distribution
- Support compliance or brand checks in document pipelines
Prepare the project
Register the SDK license before running document analysis. For setup details, refer to the getting started with .NET SDK guide.
using GdPicture14;
LicenseManager licence = new LicenseManager();licence.RegisterKEY("");Create the document converter
Use GdPictureDocumentConverter for document inspection:
using GdPictureDocumentConverter converter = new GdPictureDocumentConverter();Load the Word document
Load the input DOCX file:
converter.LoadFromFile(@"input.docx");Extract font information
Export font metadata to XML:
converter.SaveDocumentFontsInfo(@"output_fountInformations.xml", false);SaveDocumentFontsInfo parameters:
- Output path —
output_fontInformation.xml onlyIfFontsAreMissing:true— Generate output only when at least one font is missingfalse— Always generate output
Handle errors
LoadFromFile and SaveDocumentFontsInfo return GdPictureStatus values you can use for error handling and diagnostics. For patterns and status handling, refer to the handling errors with .NET SDK guide.
Conclusion
This guide demonstrates how to extract structured font metadata from Word documents and write it to XML for downstream checks, reporting, or automation.