9.4.  Extract Attachments

The utility ExtractEmbeddedFiles creates a separate file for every attachment which is embedded in the PDF document.

The attachments are exported byte for byte, so all file formats are supported.

Program Start

::
:: Extract embedded files from a PDF document. Each in a separate output file.
::

@echo off
setlocal
set CLASSPATH=./lib/pdfunit-2015.10/*;%CLASSPATH%
set CLASSPATH=./lib/itext-5.5.1/*;%CLASSPATH%
set CLASSPATH=./lib/bouncycastle-jdk15on-150/*;%CLASSPATH%

set TOOL=com.pdfunit.tools.ExtractEmbeddedFiles
set OUT_DIR=./tmp
set IN_FILE=umsatzsteuervoranmeldung-2010.pdf
set PASSWD=

java  %TOOL%  %IN_FILE%  %OUT_DIR%  %PASSWD%
endlocal

Input

The PDF document umsatzsteuervoranmeldung-2010.pdf contains the file PrePress-Qualität.joboptions.

Output

The name of the generated file contains both the name of the PDF document and the name of the embedded file: _embedded-file_umsatzsteuervoranmeldung-2010_PrePress-Qualität.joboptions.out.