public class PDFImageWriter extends PDFStreamEngine
Constructor and Description |
---|
PDFImageWriter()
Instantiate a new PDFImageWriter object.
|
PDFImageWriter(Properties props)
Instantiate a new PDFImageWriter object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
writeImage(PDDocument document,
String imageFormat,
String password,
int startPage,
int endPage,
String outputPrefix)
Converts a given page range of a PDF document to bitmap images by calling
writeImage(PDDocument document, String imageFormat, String password, int startPage, int endPage,
String outputPrefix, int imageType, int resolution) with imageType BufferedImage .TYPE_INT_RGB
and screen resolution, or 96dpi if screen resolution is unavailable. |
boolean |
writeImage(PDDocument document,
String imageFormat,
String password,
int startPage,
int endPage,
String outputPrefix,
int imageType,
int resolution)
Converts a given page range of a PDF document to bitmap images.
|
getColorSpaces, getCurrentPage, getFonts, getGraphicsStack, getGraphicsState, getGraphicsStates, getResources, getTextLineMatrix, getTextMatrix, getTotalCharCnt, getValidCharCnt, getXObjects, inspectFontEncoding, isForceParsing, processEncodedText, processOperator, processOperator, processStream, processSubStream, processTextPosition, registerOperatorProcessor, resetEngine, setColorSpaces, setFonts, setForceParsing, setGraphicsStack, setGraphicsState, setGraphicsStates, setTextLineMatrix, setTextMatrix
public PDFImageWriter()
public PDFImageWriter(Properties props) throws IOException
props
- The properties containing the mapping of operators to PDFOperator classes.IOException
- If there is an error reading the properties.public boolean writeImage(PDDocument document, String imageFormat, String password, int startPage, int endPage, String outputPrefix) throws IOException
writeImage(PDDocument document, String imageFormat, String password, int startPage, int endPage,
String outputPrefix, int imageType, int resolution)
with imageType BufferedImage
.TYPE_INT_RGB
and screen resolution, or 96dpi if screen resolution is unavailable.document
- the PDF documentimageFormat
- the target format (ex. "png")password
- the password (needed if the PDF is encrypted)startPage
- the start page (1 is the first page)endPage
- the end page (set to Integer.MAX_VALUE for all pages)outputPrefix
- used to construct the filename for the individual imagesIOException
- if an I/O error occurspublic boolean writeImage(PDDocument document, String imageFormat, String password, int startPage, int endPage, String outputPrefix, int imageType, int resolution) throws IOException
document
- the PDF documentimageFormat
- the target format (ex. "png")password
- the password (needed if the PDF is encrypted)startPage
- the start page (1 is the first page)endPage
- the end page (set to Integer.MAX_VALUE for all pages)outputPrefix
- used to construct the filename for the individual imagesimageType
- the image type (see BufferedImage
.TYPE_*)resolution
- the resolution in dpi (dots per inch)IOException
- if an I/O error occursCopyright © 2002-2015 The Apache Software Foundation. All Rights Reserved.