public final class ExtractImages
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private class |
ExtractImages.ImageGraphicsEngine |
Modifier and Type | Field and Description |
---|---|
private boolean |
directJPEG |
private static java.lang.String |
DIRECTJPEG |
private int |
imageCounter |
private static java.util.List<java.lang.String> |
JPEG |
private static java.lang.String |
PASSWORD |
private java.lang.String |
prefix |
private static java.lang.String |
PREFIX |
private java.util.Set<COSStream> |
seen |
Modifier | Constructor and Description |
---|---|
private |
ExtractImages() |
Modifier and Type | Method and Description |
---|---|
private void |
extract(java.lang.String pdfFile,
java.lang.String password) |
private boolean |
hasMasks(PDImage pdImage) |
static void |
main(java.lang.String[] args)
Entry point for the application.
|
private void |
run(java.lang.String[] args) |
private static void |
usage()
Print the usage requirements and exit.
|
private void |
write2file(PDImage pdImage,
java.lang.String prefix,
boolean directJPEG)
Writes the image to a file with the filename prefix + an appropriate suffix, like "Image.jpg".
|
private static final java.lang.String PASSWORD
private static final java.lang.String PREFIX
private static final java.lang.String DIRECTJPEG
private static final java.util.List<java.lang.String> JPEG
private boolean directJPEG
private java.lang.String prefix
private final java.util.Set<COSStream> seen
private int imageCounter
public static void main(java.lang.String[] args) throws java.io.IOException
args
- The command-line arguments.java.io.IOException
- if there is an error reading the file or extracting the images.private void run(java.lang.String[] args) throws java.io.IOException
java.io.IOException
private static void usage()
private void extract(java.lang.String pdfFile, java.lang.String password) throws java.io.IOException
java.io.IOException
private boolean hasMasks(PDImage pdImage) throws java.io.IOException
java.io.IOException
private void write2file(PDImage pdImage, java.lang.String prefix, boolean directJPEG) throws java.io.IOException
pdImage
- the image.prefix
- the filename prefix.directJPEG
- if true, force saving JPEG/JPX streams as they are in the PDF file.java.io.IOException
- When something is wrong with the corresponding file.