Top Description Fields Constructors Methods
org.apache.pdfbox.examples.pdmodel

public final Class ExtractTTFFonts

extends Object
Class Inheritance
Imports
java.io.File, .FileOutputStream, .IOException, .InputStream, .OutputStream, java.util.HashSet, .Map, .Set, org.apache.pdfbox.Loader, org.apache.pdfbox.cos.COSDictionary, .COSName, org.apache.pdfbox.io.IOUtils, org.apache.pdfbox.pdmodel.PDDocument, .PDPage, .PDPageTree, .PDResources, org.apache.pdfbox.pdmodel.common.PDStream, org.apache.pdfbox.pdmodel.font.PDCIDFont, .PDCIDFontType2, .PDFont, .PDFontDescriptor, .PDTrueTypeFont, .PDType0Font, org.apache.pdfbox.pdmodel.graphics.PDXObject, org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject, .PDTransparencyGroup, org.apache.pdfbox.pdmodel.graphics.pattern.PDAbstractPattern, .PDTilingPattern, org.apache.pdfbox.pdmodel.graphics.state.PDExtendedGraphicsState, .PDSoftMask, org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation, .PDAppearanceDictionary, .PDAppearanceEntry, .PDAppearanceStream, org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm

This will extract all true type-fonts of a pdf.

Field Summary

Modifier and TypeField and Description
private static final String
private int
private int
private final Set<COSDictionary>
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
private String
public static void
main(String[]
The command-line arguments.
args
)

This is the entry point for the application.

private void
processNestedResources(PDResources resources, String prefix, boolean addKey)

private void
processResources(PDResources resources, String prefix, boolean addKey)

private void
processResourcesFonts(PDResources resources, boolean addKey, String prefix)

private static void
usage()

This will print the usage requirements and exit.

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ADDKEYback to summary
private static final String ADDKEY
currentPageback to summary
private int currentPage
fontCounterback to summary
private int fontCounter
fontSetback to summary
private final Set<COSDictionary> fontSet
PASSWORDback to summary
private static final String PASSWORD
Annotations
@SuppressWarnings:squid:S2068
PREFIXback to summary
private static final String PREFIX

Constructor Detail

ExtractTTFFontsback to summary
private ExtractTTFFonts()

Method Detail

extractFontsback to summary
private void extractFonts(String[] args) throws IOException
getUniqueFileNameback to summary
private String getUniqueFileName(String prefix, String suffix)
mainback to summary
public static void main(String[] args) throws IOException

This is the entry point for the application.

Parameters
args:String[]

The command-line arguments.

Exceptions
IOException:
If there is an error decrypting the document.
processNestedResourcesback to summary
private void processNestedResources(PDResources resources, String prefix, boolean addKey) throws IOException
processResourcesback to summary
private void processResources(PDResources resources, String prefix, boolean addKey) throws IOException
processResourcesFontsback to summary
private void processResourcesFonts(PDResources resources, boolean addKey, String prefix) throws IOException
usageback to summary
private static void usage()

This will print the usage requirements and exit.

writeFontback to summary
private void writeFont(PDFontDescriptor fd, String name) throws IOException