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

public final Class ExtractEmbeddedFiles

extends Object
Class Inheritance
Imports
java.io.File, .FileOutputStream, .IOException, java.nio.file.FileSystems, java.util.List, .Map, .Map.Entry, org.apache.pdfbox.Loader, org.apache.pdfbox.pdmodel.PDDocument, .PDDocumentNameDictionary, .PDEmbeddedFilesNameTreeNode, .PDPage, org.apache.pdfbox.pdmodel.common.PDNameTreeNode, org.apache.pdfbox.pdmodel.common.filespecification.PDComplexFileSpecification, .PDEmbeddedFile, .PDFileSpecification, org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation, .PDAnnotationFileAttachment

This is an example on how to extract all embedded files from a PDF document.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
extractFile(String filePath, String filename, PDEmbeddedFile embeddedFile)

private static void
private static void
private static void
private static PDEmbeddedFile
public static void
main(String[]
The command line arguments.
args
)

This is the main method.

private static void
usage()

This will print the usage for this program.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ExtractEmbeddedFilesback to summary
private ExtractEmbeddedFiles()

Method Detail

extractFileback to summary
private static void extractFile(String filePath, String filename, PDEmbeddedFile embeddedFile) throws IOException
extractFilesback to summary
private static void extractFiles(Map<String, PDComplexFileSpecification> names, String filePath) throws IOException
extractFilesFromEFTreeback to summary
private static void extractFilesFromEFTree(PDNameTreeNode<PDComplexFileSpecification> efTree, String filePath) throws IOException
extractFilesFromPageback to summary
private static void extractFilesFromPage(PDPage page, String filePath) throws IOException
getEmbeddedFileback to summary
private static PDEmbeddedFile getEmbeddedFile(PDComplexFileSpecification fileSpec)
mainback to summary
public static void main(String[] args) throws IOException

This is the main method.

Parameters
args:String[]

The command line arguments.

Exceptions
IOException:
If there is an error parsing the document.
usageback to summary
private static void usage()

This will print the usage for this program.