public final class PngDevice extends ImageDevice
Represents image device that helps to save pdf document pages into png.
Constructor and Description |
---|
PngDevice()
Initializes a new instance of the
PngDevice class with default resolution. |
PngDevice(int width,
int height)
Initializes a new instance of the
PngDevice class with provided image dimensions,
default resolution (=150). |
PngDevice(int width,
int height,
Resolution resolution)
Initializes a new instance of the
PngDevice class with provided image dimensions and
resolution. |
PngDevice(PageSize pageSize)
Initializes a new instance of the
PngDevice class with provided page size, default
resolution (=150). |
PngDevice(PageSize pageSize,
Resolution resolution)
Initializes a new instance of the
PngDevice class with provided page size and
resolution. |
PngDevice(Resolution resolution)
Initializes a new instance of the
PngDevice class. |
Modifier and Type | Method and Description |
---|---|
boolean |
isTransparentBackground()
Gets or sets if image has transparent background.
|
void |
process(Page page,
OutputStream output)
Converts the page into png and saves it in the output stream.
|
void |
processInternal(Page page,
com.aspose.ms.System.IO.Stream output)
Converts the page into png and saves it in the output stream.
|
BufferedImage |
processToBufferedImage(Page page)
Converts the page into BufferedImage.
|
BufferedImage |
processToBufferedImageBinarized(Page page,
double threshold)
Converts the page into BufferedImage with Bradley binarization.
|
void |
setTransparentBackground(boolean value)
Gets or sets if image has transparent background.
|
getCoordinateType, getCropRectangle, getFormPresentationMode, getHeight, getRenderingOptions, getResolution, getWidth, isShadingPerformanceHigh, setCoordinateType, setCropRectangle, setFormPresentationMode, setRenderingOptions, setShadingPerformanceHigh
process, process
public PngDevice()
Initializes a new instance of the PngDevice
class with default resolution.
public PngDevice(Resolution resolution)
Initializes a new instance of the PngDevice
class.
resolution
- Resolution for the result image file, see Resolution
class.public PngDevice(int width, int height, Resolution resolution)
Initializes a new instance of the PngDevice
class with provided image dimensions and
resolution.
width
- Image output width.height
- Image output height.resolution
- Resolution for the result image file, see Resolution
class.public PngDevice(PageSize pageSize, Resolution resolution)
Initializes a new instance of the PngDevice
class with provided page size and
resolution.
pageSize
- Page size of the output image.resolution
- Resolution for the result image file, see Resolution
class.public PngDevice(int width, int height)
Initializes a new instance of the PngDevice
class with provided image dimensions,
default resolution (=150).
width
- Image output width.height
- Image output height.public PngDevice(PageSize pageSize)
Initializes a new instance of the PngDevice
class with provided page size, default
resolution (=150).
pageSize
- Page size of the output image.public final boolean isTransparentBackground()
Gets or sets if image has transparent background.
public final void setTransparentBackground(boolean value)
Gets or sets if image has transparent background.
value
- boolean valuepublic void processInternal(Page page, com.aspose.ms.System.IO.Stream output)
Converts the page into png and saves it in the output stream.
processInternal
in class PageDevice
page
- The page to convert.output
- Output stream with png image.public void process(Page page, OutputStream output)
Converts the page into png and saves it in the output stream.
process
in class PageDevice
page
- The page to convert.output
- Output stream with png image.public BufferedImage processToBufferedImage(Page page)
Converts the page into BufferedImage.
page
- The page to convert.public BufferedImage processToBufferedImageBinarized(Page page, double threshold)
Converts the page into BufferedImage with Bradley binarization.
page
- The page to convert.threshold
- The threshold value between 0.0 and 1.0.Copyright © 2024 Aspose. All Rights Reserved.