PngDevice

Inheritance: java.lang.Object, com.aspose.pdf.devices.Device com.aspose.pdf.devices.PageDevice com.aspose.pdf.devices.ImageDevice com.aspose.pdf.devices.PngDevice, com.aspose.pdf.devices.Device, com.aspose.pdf.devices.PageDevice com.aspose.pdf.devices.ImageDevice com.aspose.pdf.devices.PngDevice, com.aspose.pdf.devices.PageDevice, com.aspose.pdf.devices.ImageDevice com.aspose.pdf.devices.PngDevice, com.aspose.pdf.devices.ImageDevice, com.aspose.pdf.devices.PngDevice

public final class PngDevice extends ImageDevice

Represents image device that helps to save pdf document pages into png.

Constructors

ConstructorDescription
PngDeviceInitializes a new instance of the {@code PngDevice} class with default resolution.
PngDeviceInitializes a new instance of the {@code PngDevice} class with provided image dimensions, default resolution (=150).
PngDeviceInitializes a new instance of the {@code PngDevice} class with default resolution.
PngDeviceInitializes a new instance of the {@code PngDevice} class with default resolution.
PngDeviceInitializes a new instance of the {@code PngDevice} class with default resolution.
PngDeviceInitializes a new instance of the {@code PngDevice} class with default resolution.

Methods

MethodDescription
isTransparentBackgroundGets or sets if image has transparent background.
processConverts the page into png and saves it in the output stream.
processInternalConverts the page into png and saves it in the output stream.
processToBufferedImageConverts the page into BufferedImage.
processToBufferedImageBinarizedConverts the page into BufferedImage with Bradley binarization.
setTransparentBackgroundGets or sets if image has transparent background.

PngDevice

public PngDevice()

Initializes a new instance of the {@code PngDevice} class with default resolution.

PngDevice

public PngDevice(int width, int height)

Initializes a new instance of the {@code PngDevice} class with provided image dimensions, default resolution (=150).

Parameters:

ParameterTypeDescription
widthImage output width.
heightImage output height.

PngDevice

Initializes a new instance of the {@code PngDevice} class with default resolution.

PngDevice

Initializes a new instance of the {@code PngDevice} class with default resolution.

PngDevice

Initializes a new instance of the {@code PngDevice} class with default resolution.

PngDevice

Initializes a new instance of the {@code PngDevice} class with default resolution.

isTransparentBackground

public final boolean isTransparentBackground()

Gets or sets if image has transparent background.

Returns: boolean value

process

Converts the page into png and saves it in the output stream.

processInternal

Converts the page into png and saves it in the output stream.

processToBufferedImage

Converts the page into BufferedImage.

processToBufferedImageBinarized

Converts the page into BufferedImage with Bradley binarization.

setTransparentBackground

public final void setTransparentBackground(boolean value)

Gets or sets if image has transparent background.

Parameters:

ParameterTypeDescription
valueboolean value