Class ExtractTTFFonts
java.lang.Object
org.apache.pdfbox.examples.pdmodel.ExtractTTFFonts
This will extract all true type-fonts of a pdf.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate intprivate intprivate final Set<COSDictionary> private static final Stringprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidextractFonts(String[] args) private StringgetUniqueFileName(String prefix, String suffix) static voidThis is the entry point for the application.private voidprocessNestedResources(PDResources resources, String prefix, boolean addKey) private voidprocessResources(PDResources resources, String prefix, boolean addKey) private voidprocessResourcesFonts(PDResources resources, boolean addKey, String prefix) private static voidusage()This will print the usage requirements and exit.private voidwriteFont(PDFontDescriptor fd, String name)
-
Field Details
-
fontCounter
private int fontCounter -
fontSet
-
currentPage
private int currentPage -
PASSWORD
- See Also:
-
PREFIX
- See Also:
-
ADDKEY
- See Also:
-
-
Constructor Details
-
ExtractTTFFonts
private ExtractTTFFonts()
-
-
Method Details
-
main
This is the entry point for the application.- Parameters:
args- The command-line arguments.- Throws:
IOException- If there is an error decrypting the document.
-
extractFonts
- Throws:
IOException
-
processResources
private void processResources(PDResources resources, String prefix, boolean addKey) throws IOException - Throws:
IOException
-
processResourcesFonts
private void processResourcesFonts(PDResources resources, boolean addKey, String prefix) throws IOException - Throws:
IOException
-
processNestedResources
private void processNestedResources(PDResources resources, String prefix, boolean addKey) throws IOException - Throws:
IOException
-
writeFont
- Throws:
IOException
-
getUniqueFileName
-
usage
private static void usage()This will print the usage requirements and exit.
-