Jacob Collins Jacob is a Java developer and the product manager of JPedal

How to extract embedded files from a PDF in Java (Tutorial)

43 sec read

extract embedded files

PDF files sometimes reference external resources such as images or other documents. To increase portability and ease archival of such PDF files, these resources can be embedded within the PDF itself. These are known as attachments or embedded files.
 
If you wish to extract these embedded files from a PDF using Java, you will need to use a third-party library since Java does not have built-in support for processing PDF files.
 
This tutorial uses JPedal.
 

How to extract embedded files from a PDF file programmatically

  1. Add JPedal to your class or module path (download the trial jar)
  2. Run the following Java code:

 

How to extract embedded files from a PDF file using the commandline

  1. Add JPedal to your class or module path (download the trial jar)
  2. Run the following command:

  3.  
    You can expand your understanding of the PDF format by reading our other articles. Similarly, if there is a specific term for PDF you would like to know more about, our PDF Glossary has an extensive list of common terms.



    Our software libraries allow you to

    Convert PDF to HTML in Java
    Convert PDF Forms to HTML5 in Java
    Convert PDF Documents to an image in Java
    Work with PDF Documents in Java
    Read and Write AVIF, HEIC, WEBP and other image formats
Jacob Collins Jacob is a Java developer and the product manager of JPedal

Creating a WordPress Plugin Part 3: Adding Shortcodes

Recently, I’ve been working on a proof of concept project which integrates our JPDF2HTML5 web service with the popular blogging platform WordPress. This series of...
Simon Lissack
1 min read

Creating a WordPress Plugin Part 1: Adding the Admin…

WordPress is one of the most popular content management systems on the internet. Created using PHP it can handle all things blogging to commercial websites. In...
Simon Lissack
2 min read