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