Class ExtractTTFFonts
- java.lang.Object
-
- org.apache.pdfbox.examples.pdmodel.ExtractTTFFonts
-
public final class ExtractTTFFonts extends java.lang.ObjectThis will extract all true type-fonts of a pdf.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringADDKEYprivate intcurrentPageprivate intfontCounterprivate java.util.Set<COSDictionary>fontSetprivate static java.lang.StringPASSWORDprivate static java.lang.StringPREFIX
-
Constructor Summary
Constructors Modifier Constructor Description privateExtractTTFFonts()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidextractFonts(java.lang.String[] args)private java.lang.StringgetUniqueFileName(java.lang.String prefix, java.lang.String suffix)static voidmain(java.lang.String[] args)This is the entry point for the application.private voidprocessNestedResources(PDResources resources, java.lang.String prefix, boolean addKey)private voidprocessResources(PDResources resources, java.lang.String prefix, boolean addKey)private voidprocessResourcesFonts(PDResources resources, boolean addKey, java.lang.String prefix)private static voidusage()This will print the usage requirements and exit.private voidwriteFont(PDFontDescriptor fd, java.lang.String name)
-
-
-
Field Detail
-
fontCounter
private int fontCounter
-
fontSet
private final java.util.Set<COSDictionary> fontSet
-
currentPage
private int currentPage
-
PASSWORD
private static final java.lang.String PASSWORD
- See Also:
- Constant Field Values
-
PREFIX
private static final java.lang.String PREFIX
- See Also:
- Constant Field Values
-
ADDKEY
private static final java.lang.String ADDKEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.io.IOExceptionThis is the entry point for the application.- Parameters:
args- The command-line arguments.- Throws:
java.io.IOException- If there is an error decrypting the document.
-
extractFonts
private void extractFonts(java.lang.String[] args) throws java.io.IOException- Throws:
java.io.IOException
-
processResources
private void processResources(PDResources resources, java.lang.String prefix, boolean addKey) throws java.io.IOException
- Throws:
java.io.IOException
-
processResourcesFonts
private void processResourcesFonts(PDResources resources, boolean addKey, java.lang.String prefix) throws java.io.IOException
- Throws:
java.io.IOException
-
processNestedResources
private void processNestedResources(PDResources resources, java.lang.String prefix, boolean addKey) throws java.io.IOException
- Throws:
java.io.IOException
-
writeFont
private void writeFont(PDFontDescriptor fd, java.lang.String name) throws java.io.IOException
- Throws:
java.io.IOException
-
getUniqueFileName
private java.lang.String getUniqueFileName(java.lang.String prefix, java.lang.String suffix)
-
usage
private static void usage()
This will print the usage requirements and exit.
-
-