Class ExtractEmbeddedFiles
- java.lang.Object
-
- org.apache.pdfbox.examples.pdmodel.ExtractEmbeddedFiles
-
public final class ExtractEmbeddedFiles extends java.lang.ObjectThis is an example on how to extract all embedded files from a PDF document.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateExtractEmbeddedFiles()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static voidextractFile(java.lang.String filename, PDEmbeddedFile embeddedFile, java.lang.String directoryPath)private static voidextractFiles(java.util.Map<java.lang.String,PDComplexFileSpecification> names, java.lang.String directoryPath)private static voidextractFilesFromEFTree(PDNameTreeNode<PDComplexFileSpecification> efTree, java.lang.String directoryPath)private static voidextractFilesFromPage(PDPage page, java.lang.String directoryPath)private static PDEmbeddedFilegetEmbeddedFile(PDComplexFileSpecification fileSpec)static voidmain(java.lang.String[] args)This is the main method.private static voidusage()This will print the usage for this program.
-
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.io.IOExceptionThis is the main method.- Parameters:
args- The command line arguments.- Throws:
java.io.IOException- If there is an error parsing the document.
-
extractFilesFromPage
private static void extractFilesFromPage(PDPage page, java.lang.String directoryPath) throws java.io.IOException
- Throws:
java.io.IOException
-
extractFilesFromEFTree
private static void extractFilesFromEFTree(PDNameTreeNode<PDComplexFileSpecification> efTree, java.lang.String directoryPath) throws java.io.IOException
- Throws:
java.io.IOException
-
extractFiles
private static void extractFiles(java.util.Map<java.lang.String,PDComplexFileSpecification> names, java.lang.String directoryPath) throws java.io.IOException
- Throws:
java.io.IOException
-
extractFile
private static void extractFile(java.lang.String filename, PDEmbeddedFile embeddedFile, java.lang.String directoryPath) throws java.io.IOException- Throws:
java.io.IOException
-
getEmbeddedFile
private static PDEmbeddedFile getEmbeddedFile(PDComplexFileSpecification fileSpec)
-
usage
private static void usage()
This will print the usage for this program.
-
-