We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How we can list all fonts used in any MS office document using Aspose.Total for Java

Hi,

I want to read/list the fonts used in any doc(x), ppt(x), xls(x) document. Using Aspose it is possible to read all fonts used in any document.

Kindly revert

@poojard,

We have separate API for each file format. So in order to get list of fonts used in MS Excel file, you need to try using Aspose.Cells for Java. Please try following the instructions specified over Get List of Fonts used in Excel worksheet.

In order to get the list of fonts used in MS Word document, please try using FontInfoCollection from Aspose.Words for Java. For more information, please visit FontInfoCollection.

In order to get the list of fonts used in PowerPoint presentations, you need to try using Aspose.Slides for Java. Please note that Aspose.Slides has a class named FontsManger which is inside Presentation class which has an access to Embedded or general fonts used in presentation.

  • Presentation.FontsManager.GetFonts()
  • Presentation.FontsManager.GetEmbeddedFonts()

For more information, please visit getFonts(…) and getEmbeddedFonts(…).

Thanks for the response.

I tired this and it worked. But one concern that I have is extraction of font is taking much time than conversion of document from one format to another.

Is there any particular solution to this problem

@poojard,

The time taken by API to manipulate the document depends upon the structure and complexity of input file. However in order to extract the required information from individual file format, each API has its own implementation and concerning to Aspose.Words, while extracting font information, it does not iterate through text segments. If you unzip DOCX file for example, then you will find that the collection of font definitions is loaded as is from the document’s fontTable.xml. Please note that fonts info extracted from this document does not necessarily mean that the fonts themselves are used in the document. If a font is present but not used then most likely they were referenced at some time and then removed from the Document.

Concerning to Aspose.Cells, we store all fonts’ related details of the cells in a pool in APIs, so we directly return all fonts in the pool when calling Workbook.getFonts() method. Aspose.Cells stores all fonts details of the cells in a pool at the time of reading the file.

Similarly for Aspose.Slides, it does not iterate all text segments and it filters internal font information caches.

Nevertheless, we request you to please share the input files causing this problem, so that we can test the scenarios in our environment. We are sorry for this inconvenience.

No specific file is having this problem. In general all the files are taking longer time for font extraction process.

@poojard,

In order for us to figure out the reasons behind this delay, we need to first test the scenario in our environment. If possible, please share some sample documents, which can help us to identify this problem in our environment.