public class PdfToImageRenderer extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
PdfToImageRenderer.BufferedImageReadyListener
The event listener which is called when a page has been rendered to a BufferedImage .
|
static interface |
PdfToImageRenderer.ImageFileReadyListener
The event listener which is called when a page has been rendered to an image.
|
Modifier and Type | Method and Description |
---|---|
static void |
renderPdf(File pdfFile, File outImagesDirectory)
Renders a PDF stored in a file with the provided path to images.
|
static void |
renderPdf(File pdfFile, File outImagesDirectory, RenderingProperties properties)
Renders a PDF stored in a file with the provided path to images.
|
static void |
renderPdf(File pdfFile, com.itextpdf.kernel.utils.PageRange range, PdfToImageRenderer.BufferedImageReadyListener bufferedImageReadyListener)
Renders a PDF stored in a file with the provided PdfToImageRenderer.BufferedImageReadyListener to BufferedImage .
|
static void |
renderPdf(File pdfFile, PdfToImageRenderer.BufferedImageReadyListener bufferedImageReadyListener)
Renders a PDF stored in a file with the provided PdfToImageRenderer.BufferedImageReadyListener to BufferedImage .
|
static void |
renderPdf(File pdfFile, RenderingProperties properties, com.itextpdf.kernel.utils.PageRange range, PdfToImageRenderer.BufferedImageReadyListener bufferedImageReadyListener)
Renders a PDF stored in a file with the provided PdfToImageRenderer.BufferedImageReadyListener to BufferedImage .
|
static void |
renderPdf(File pdfFile, RenderingProperties properties, PdfToImageRenderer.BufferedImageReadyListener bufferedImageReadyListener)
Renders a PDF stored in a file with the provided PdfToImageRenderer.BufferedImageReadyListener to BufferedImage .
|
static void |
renderPdf(File pdfFile, String outImageFilePattern)
Renders a PDF stored in a file with the provided path to images.
|
static void |
renderPdf(File pdfFile, String outImageFilePattern, com.itextpdf.kernel.utils.PageRange range)
Renders a PDF stored in a file with the provided path to images.
|
static void |
renderPdf(File pdfFile, String outImageFilePattern, RenderingProperties properties)
Renders a PDF stored in a file with the provided path to images.
|
static void |
renderPdf(File pdfFile, String outImageFilePattern, RenderingProperties properties, com.itextpdf.kernel.utils.PageRange range)
Renders a PDF stored in a file with the provided path to images.
|
static void |
renderPdf(File pdfFile, String outImageFilePattern, RenderingProperties properties, com.itextpdf.kernel.utils.PageRange range, PdfToImageRenderer.ImageFileReadyListener imageReadyListener)
Renders a PDF stored in a file with the provided path to images.
|
static void |
renderPdf(InputStream pdfStream, File outImagesDirectory)
Renders a PDF stored in a file with the provided path to images.
|
static void |
renderPdf(InputStream pdfStream, File outImagesDirectory, RenderingProperties properties)
Renders a PDF stored in a file with the provided path to images.
|
static void |
renderPdf(InputStream pdfStream, com.itextpdf.kernel.utils.PageRange range, PdfToImageRenderer.BufferedImageReadyListener bufferedImageReadyListener)
Renders a PDF stored in the provided bytes with the provided PdfToImageRenderer.BufferedImageReadyListener to BufferedImage .
|
static void |
renderPdf(InputStream pdfStream, PdfToImageRenderer.BufferedImageReadyListener bufferedImageReadyListener)
Renders a PDF stored in the provided bytes with the provided PdfToImageRenderer.BufferedImageReadyListener to BufferedImage .
|
static void |
renderPdf(InputStream pdfStream, RenderingProperties properties, com.itextpdf.kernel.utils.PageRange range, PdfToImageRenderer.BufferedImageReadyListener bufferedImageReadyListener)
Renders a PDF stored in the provided bytes with the provided PdfToImageRenderer.BufferedImageReadyListener to BufferedImage .
|
static void |
renderPdf(InputStream pdfStream, RenderingProperties properties, PdfToImageRenderer.BufferedImageReadyListener bufferedImageReadyListener)
Renders a PDF stored in the provided bytes with the provided PdfToImageRenderer.BufferedImageReadyListener to BufferedImage .
|
static void |
renderPdf(InputStream pdfStream, String outImageFilePattern)
Renders a PDF stored in the provided bytes to images.
|
static void |
renderPdf(InputStream pdfStream, String outImageFilePattern, com.itextpdf.kernel.utils.PageRange range)
Renders a PDF stored in the provided bytes to images.
|
static void |
renderPdf(InputStream pdfStream, String outImageFilePattern, RenderingProperties properties)
Renders a PDF stored in the provided bytes to images.
|
static void |
renderPdf(InputStream pdfStream, String outImageFilePattern, RenderingProperties properties, com.itextpdf.kernel.utils.PageRange range)
Renders a PDF stored in the provided bytes to images.
|
static void |
renderPdf(InputStream pdfStream, String outImageFilePattern, RenderingProperties properties, com.itextpdf.kernel.utils.PageRange range, PdfToImageRenderer.ImageFileReadyListener imageReadyListener)
Renders a PDF stored in the provided bytes to images.
|
public static void renderPdf(File pdfFile, File outImagesDirectory) throws RenderingException, IOException
pdfFile
- the PDF file to be rendered
outImagesDirectory
- the directory, in which pdfRender will place the rendered images. Their names will respect the following format: "image%d" and %d will be replaced with the number of the page. PdfRenderImageType.JPEG
, which will be the extension of the images, will be added automatically
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input or output file could not be accessed
public static void renderPdf(File pdfFile, File outImagesDirectory, RenderingProperties properties) throws RenderingException, IOException
pdfFile
- the PDF file to be rendered
outImagesDirectory
- the directory, in which pdfRender will place the rendered images. Their names will respect the following format: "image%d" and %d will be replaced with the number of the page. The image extension is added automatically based on the PdfRenderImageType
provided with RenderingProperties
. By default it is PdfRenderImageType.JPEG
properties
- the properties which will define rendering process
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input or output file could not be accessed
public static void renderPdf(InputStream pdfStream, File outImagesDirectory) throws RenderingException, IOException
pdfStream
- the stream of the PDF to be rendered
outImagesDirectory
- the directory, in which pdfRender will place the rendered images. Their names will respect the following format: "image%d" and %d will be replaced with the number of the page. PdfRenderImageType.JPEG
, which will be the extension of the images, will be added to the names automatically
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input or output file could not be accessed
public static void renderPdf(InputStream pdfStream, File outImagesDirectory, RenderingProperties properties) throws RenderingException, IOException
pdfStream
- the stream of the PDF to be rendered
outImagesDirectory
- the directory, in which pdfRender will place the rendered images. Their names will respect the following format: "image%d" and %d will be replaced with the number of the page. The image extension is added automatically based on the PdfRenderImageType
provided with RenderingProperties
. By default it is PdfRenderImageType.JPEG
properties
- the properties which will define rendering process
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input or output file could not be accessed
public static void renderPdf(File pdfFile, String outImageFilePattern) throws RenderingException, IOException
pdfFile
- the PDF file to be rendered
outImageFilePattern
- the string which defines the path and the format of the resultant images. The format specifier is of a form similar to the C printf format. In the most simple case just place a template '%d' in the filename which pdfRender will replace with the page number. PdfRenderImageType.JPEG
, which will be the extension of the images, will be added to the filename automatically
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input or output file could not be accessed
public static void renderPdf(File pdfFile, String outImageFilePattern, com.itextpdf.kernel.utils.PageRange range) throws RenderingException, IOException
Only pages, specified in the provided range, will be rendered.
pdfFile
- the PDF file to be rendered
outImageFilePattern
- the string which defines the path and the format of the resultant images. The format specifier is of a form similar to the C printf format. In the most simple case just place a template '%d' in the filename which pdfRender will replace with the page number. PdfRenderImageType.JPEG
, which will be the extension of the images, will be added to the filename automatically
range
- the range of pages which will be rendered
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input or output file could not be accessed
public static void renderPdf(InputStream pdfStream, String outImageFilePattern) throws RenderingException, IOException
pdfStream
- the stream of the PDF to be rendered
outImageFilePattern
- the string which defines the path and the format of the resultant images. The format specifier is of a form similar to the C printf format. In the most simple case just place a template '%d' in the filename which pdfRender will replace with the page number. PdfRenderImageType.JPEG
, which will be the extension of the images, will be added to the filename automatically
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input or output file could not be accessed
public static void renderPdf(InputStream pdfStream, String outImageFilePattern, com.itextpdf.kernel.utils.PageRange range) throws RenderingException, IOException
Only pages specified in the provided range will be rendered.
pdfStream
- the stream of the PDF to be rendered
outImageFilePattern
- the string which defines the path and the format of the resultant images. The format specifier is of a form similar to the C printf format. In the most simple case just place a template '%d' in the filename which pdfRender will replace with the page number. PdfRenderImageType.JPEG
, which will be the extension of the images, will be added to the filename automatically
range
- the range of pages which will be rendered
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input or output file could not be accessed
public static void renderPdf(InputStream pdfStream, String outImageFilePattern, RenderingProperties properties) throws RenderingException, IOException
pdfStream
- the stream of the PDF to be rendered
outImageFilePattern
- the string which defines the path and the format of the resultant images. The format specifier is of a form similar to the C printf format. In the most simple case just place a template '%d' in the filename which pdfRender will replace with the page number. The image extension is added automatically based on the PdfRenderImageType
provided with RenderingProperties
. By default it is PdfRenderImageType.JPEG
properties
- the properties which will define rendering process
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input or output file could not be accessed
public static void renderPdf(InputStream pdfStream, String outImageFilePattern, RenderingProperties properties, com.itextpdf.kernel.utils.PageRange range) throws RenderingException, IOException
Only pages specified in the provided range will be rendered.
pdfStream
- the stream of the PDF to be rendered
outImageFilePattern
- the string which defines the path and the format of the resultant images. The format specifier is of a form similar to the C printf format. In the most simple case just place a template '%d' in the filename which pdfRender will replace with the page number. The image extension is added automatically based on the PdfRenderImageType
provided with RenderingProperties
. By default it is PdfRenderImageType.JPEG
properties
- the properties which will define rendering process
range
- the range of pages which will be rendered
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input or output file could not be accessed
public static void renderPdf(InputStream pdfStream, String outImageFilePattern, RenderingProperties properties, com.itextpdf.kernel.utils.PageRange range, PdfToImageRenderer.ImageFileReadyListener imageReadyListener) throws RenderingException, IOException
Only pages specified in the provided range will be rendered.
pdfStream
- the stream of the PDF to be rendered
outImageFilePattern
- the string which defines the path and the format of the resultant images. The format specifier is of a form similar to the C printf format. In the most simple case just place a template '%d' in the filename which pdfRender will replace with the page number. The image extension is added automatically based on the PdfRenderImageType
provided with RenderingProperties
. By default it is PdfRenderImageType.JPEG
properties
- the properties which will define rendering process
range
- the range of pages which will be rendered
imageReadyListener
- the event listener which is called when the image is ready.
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input or output file could not be accessed
public static void renderPdf(File pdfFile, String outImageFilePattern, RenderingProperties properties) throws RenderingException, IOException
pdfFile
- the PDF file to be rendered
outImageFilePattern
- the string which defines the path and the format of the resultant images. The format specifier is of a form similar to the C printf format. In the most simple case just place a template '%d' in the filename which pdfRender will replace with the page number. The image extension is added automatically based on the PdfRenderImageType
provided with RenderingProperties
. By default it is PdfRenderImageType.JPEG
properties
- the properties which will define rendering process
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input or output file could not be accessed
public static void renderPdf(File pdfFile, String outImageFilePattern, RenderingProperties properties, com.itextpdf.kernel.utils.PageRange range) throws RenderingException, IOException
Only pages specified in the provided range will be rendered.
pdfFile
- the PDF file to be rendered
outImageFilePattern
- the string which defines the path and the format of the resultant images. The format specifier is of a form similar to the C printf format. In the most simple case just place a template '%d' in the filename which pdfRender will replace with the page number. The image extension is added automatically based on the PdfRenderImageType
provided with RenderingProperties
. By default it is PdfRenderImageType.JPEG
properties
- the properties which will define rendering process
range
- the range of pages which will be rendered
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input or output file could not be accessed
public static void renderPdf(File pdfFile, String outImageFilePattern, RenderingProperties properties, com.itextpdf.kernel.utils.PageRange range, PdfToImageRenderer.ImageFileReadyListener imageReadyListener) throws RenderingException, IOException
Only pages specified in the provided range will be rendered.
pdfFile
- the PDF file to be rendered
outImageFilePattern
- the string which defines the path and the format of the resultant images. The format specifier is of a form similar to the C printf format. In the most simple case just place a template '%d' in the filename which pdfRender will replace with the page number. The image extension is added automatically based on the PdfRenderImageType
provided with RenderingProperties
. By default it is PdfRenderImageType.JPEG
properties
- the properties which will define rendering process
range
- the range of pages which will be rendered
imageReadyListener
- the event listener which is called when the image is ready.
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input or output file could not be accessed
public static void renderPdf(File pdfFile, PdfToImageRenderer.BufferedImageReadyListener bufferedImageReadyListener) throws RenderingException, IOException
PdfToImageRenderer.BufferedImageReadyListener
to BufferedImage
.
pdfFile
- the PDF file to be rendered
bufferedImageReadyListener
- the event listener which is called when the image is rendered to BufferedImage
.
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input file could not be accessed
public static void renderPdf(File pdfFile, com.itextpdf.kernel.utils.PageRange range, PdfToImageRenderer.BufferedImageReadyListener bufferedImageReadyListener) throws RenderingException, IOException
PdfToImageRenderer.BufferedImageReadyListener
to BufferedImage
.
Only pages specified in the provided range will be rendered.
pdfFile
- the PDF file to be rendered
range
- the range of pages which will be rendered
bufferedImageReadyListener
- the event listener which is called when the image is rendered to BufferedImage
.
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input file could not be accessed
public static void renderPdf(File pdfFile, RenderingProperties properties, PdfToImageRenderer.BufferedImageReadyListener bufferedImageReadyListener) throws RenderingException, IOException
PdfToImageRenderer.BufferedImageReadyListener
to BufferedImage
.
pdfFile
- the PDF file to be rendered
properties
- the properties which will define rendering process. Note that imageType
property will not be taken into account.
bufferedImageReadyListener
- the event listener which is called when the image is rendered to BufferedImage
.
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input file could not be accessed
public static void renderPdf(File pdfFile, RenderingProperties properties, com.itextpdf.kernel.utils.PageRange range, PdfToImageRenderer.BufferedImageReadyListener bufferedImageReadyListener) throws RenderingException, IOException
PdfToImageRenderer.BufferedImageReadyListener
to BufferedImage
.
Only pages specified in the provided range will be rendered.
pdfFile
- the PDF file to be rendered
properties
- the properties which will define rendering process. Note that imageType
property will not be taken into account.
range
- the range of pages which will be rendered
bufferedImageReadyListener
- the event listener which is called when the image is rendered to BufferedImage
.
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input file could not be accessed
public static void renderPdf(InputStream pdfStream, PdfToImageRenderer.BufferedImageReadyListener bufferedImageReadyListener) throws RenderingException, IOException
PdfToImageRenderer.BufferedImageReadyListener
to BufferedImage
.
pdfStream
- the stream of the PDF to be rendered
bufferedImageReadyListener
- the event listener which is called when the image is rendered to BufferedImage
.
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input file could not be accessed
public static void renderPdf(InputStream pdfStream, RenderingProperties properties, PdfToImageRenderer.BufferedImageReadyListener bufferedImageReadyListener) throws RenderingException, IOException
PdfToImageRenderer.BufferedImageReadyListener
to BufferedImage
.
pdfStream
- the stream of the PDF to be rendered
properties
- the properties which will define rendering process. Note that imageType
property will not be taken into account.
bufferedImageReadyListener
- the event listener which is called when the image is rendered to BufferedImage
.
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input file could not be accessed
public static void renderPdf(InputStream pdfStream, com.itextpdf.kernel.utils.PageRange range, PdfToImageRenderer.BufferedImageReadyListener bufferedImageReadyListener) throws RenderingException, IOException
PdfToImageRenderer.BufferedImageReadyListener
to BufferedImage
.
Only pages specified in the provided range will be rendered.
pdfStream
- the stream of the PDF to be rendered
range
- the range of pages which will be rendered
bufferedImageReadyListener
- the event listener which is called when the image is rendered to BufferedImage
.
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input file could not be accessed
public static void renderPdf(InputStream pdfStream, RenderingProperties properties, com.itextpdf.kernel.utils.PageRange range, PdfToImageRenderer.BufferedImageReadyListener bufferedImageReadyListener) throws RenderingException, IOException
PdfToImageRenderer.BufferedImageReadyListener
to BufferedImage
.
Only pages specified in the provided range will be rendered.
pdfStream
- the stream of the PDF to be rendered
properties
- the properties which will define rendering process. Note that imageType
property will not be taken into account.
range
- the range of pages which will be rendered
bufferedImageReadyListener
- the event listener which is called when the image is rendered to BufferedImage
.
RenderingException
- an error occurred while rendering the PDF. It could be caused by different reasons: for example, when the PDF contains unsupported features (XFA) or some arguments are invalid (for example, too big page scaling is passed).
IOException
- input file could not be accessed
Copyright © 1998–2022 iText Group NV. All rights reserved.