Get List of the Fonts from the PDF File

Skip to end of metadata
Go to start of metadata
Get List of the Fonts from the PDF File

PdfExtractor class provides a method named get Fonts to get a list of all the fonts from the PDF file. The get Fonts method returns a Set which can be iterated to get the fonts from the list.

This example shows you how to get list of the fonts from the PDF file.

[Java]
//create PdfExtractor object
PdfExtractor pdfExtractor = new PdfExtractor();
//bind input PDF file
pdfExtractor.bindPdf("easya.pdf");
//get fonts list
Set resSet = pdfExtractor.getFonts();

//iterating over the elements in the set
Iterator it = resSet.iterator();
while (it.hasNext()) {
    //get and display element
    Object element = it.next();
    System.out.println(element);
}
 
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.