Link
Skip to main content

Extract embedded files from a PDF

JPedal provides several methods to allow easy extraction of embedded files from a PDF. The original file is left untouched by this process.

Extract embedded files from a PDF with the Command-Line or another language

java -cp jpedal.jar org.jpedal.examples.acroform.ExtractEmbeddedFiles inputFile outputFolder

Extract embedded files from a PDF in Java

Static Convenience Methods

ExtractEmbeddedFiles.extractAllFilesFromPdf("inputFile.pdf", "outputFolder");

API Access Methods

ExtractEmbeddedFiles extract = new ExtractEmbeddedFiles("inputFile.pdf");
//extract.setPassword("password");
if (extract.openPDFFile()) {
    if (extract.containsEmbeddedFiles()) {
        extract.extractEmbeddedFiles("outputFolder");
    }
    if (extract.containsFilesAttachments()) {
        extract.extractFileAttachments("outputFolder");
    }
}
extract.closePDFfile();

Get started with JPedal in 3 steps

  1. Fill in the form to download the trial jar →
  2. Copy the code snippets as instructed on the next page
  3. Build your solution using our docs

Learn more about JPedal

Start Your Free Trial


Customer Downloads

Select Download