PngDevice

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

public final class PngDevice extends ImageDevice

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

Constructors

Constructor Description
PngDevice() Initializes a new instance of the PngDevice class with default resolution.
PngDevice(Resolution resolution) Initializes a new instance of the PngDevice class.
PngDevice(int width, int height, Resolution resolution) Initializes a new instance of the PngDevice class with provided image dimensions and resolution.
PngDevice(PageSize pageSize, Resolution resolution) Initializes a new instance of the PngDevice class with provided page size and resolution.
PngDevice(int width, int height) Initializes a new instance of the PngDevice class with provided image dimensions, default resolution (=150).
PngDevice(PageSize pageSize) Initializes a new instance of the PngDevice class with provided page size, default resolution (=150).

Methods

Method Description
equals(Object arg0)
getClass()
getCoordinateType() Gets the page coordinate type (Media/Crop boxes).
getCropRectangle() Get rectangle that defines the area that will be converted into a picture.
getFormPresentationMode() Gets form presentation mode.
getHeight() Gets image output height.
getRenderingOptions() Gets rendering options.
getResolution() Gets image resolution.
getWidth() Gets image output width.
hashCode()
isShadingPerformanceHigh() Is the performance of shading processes High.
isTransparentBackground() Gets or sets if image has transparent background.
notify()
notifyAll()
process(Page page, System.Drawing.Graphics gr) Renders page on the graphics
process(Page page, OutputStream output) Converts the page into png and saves it in the output stream.
process(Page page, String outputFileName) Performs some operation on the given page and saves results into the file.
processInternal(Page page, System.IO.Stream output) Converts the page into png and saves it in the output stream.
processToBufferedImage(Page page) Converts the page into BufferedImage.
processToBufferedImageBinarized(Page page, double threshold) Converts the page into BufferedImage with Bradley binarization.
setCoordinateType(int value) Sets the page coordinate type (Media/Crop boxes).
setCropRectangle(Rectangle cropRectangle) Set rectangle that defines the area that will be converted into a picture.
setFormPresentationMode(int value) Sets form presentation mode.
setRenderingOptions(RenderingOptions value) Sets rendering options.
setShadingPerformanceHigh(boolean value) Sets the the performance of shading processes High or not.
setTransparentBackground(boolean value) Gets or sets if image has transparent background.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

PngDevice()

public PngDevice()

Initializes a new instance of the PngDevice class with default resolution.

PngDevice(Resolution resolution)

public PngDevice(Resolution resolution)

Initializes a new instance of the PngDevice class.

Parameters:

Parameter Type Description
resolution Resolution Resolution for the result image file, see Resolution class.

PngDevice(int width, int height, Resolution resolution)

public PngDevice(int width, int height, Resolution resolution)

Initializes a new instance of the PngDevice class with provided image dimensions and resolution.

Parameters:

Parameter Type Description
width int Image output width.
height int Image output height.
resolution Resolution Resolution for the result image file, see Resolution class.

PngDevice(PageSize pageSize, Resolution resolution)

public PngDevice(PageSize pageSize, Resolution resolution)

Initializes a new instance of the PngDevice class with provided page size and resolution.

Parameters:

Parameter Type Description
pageSize PageSize Page size of the output image.
resolution Resolution Resolution for the result image file, see Resolution class.

PngDevice(int width, int height)

public PngDevice(int width, int height)

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

Parameters:

Parameter Type Description
width int Image output width.
height int Image output height.

PngDevice(PageSize pageSize)

public PngDevice(PageSize pageSize)

Initializes a new instance of the PngDevice class with provided page size, default resolution (=150).

Parameters:

Parameter Type Description
pageSize PageSize Page size of the output image.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

Parameter Type Description
arg0 java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getCoordinateType()

public int getCoordinateType()

Gets the page coordinate type (Media/Crop boxes). CropBox value is used by default.

Returns: int - PageCoordinateType element

getCropRectangle()

public Rectangle getCropRectangle()

Get rectangle that defines the area that will be converted into a picture. The default is null, in which case the whole page is converted to an image.

Returns: Rectangle - Rectangle object

getFormPresentationMode()

public int getFormPresentationMode()

Gets form presentation mode.

Returns: int - FormPresentationMode element

getHeight()

public int getHeight()

Gets image output height.

Returns: int - int value

getRenderingOptions()

public RenderingOptions getRenderingOptions()

Gets rendering options.

Returns: RenderingOptions - RenderingOptions element

getResolution()

public Resolution getResolution()

Gets image resolution.

Returns: Resolution - Resolution element

getWidth()

public int getWidth()

Gets image output width.

Returns: int - int value

hashCode()

public native int hashCode()

Returns: int

isShadingPerformanceHigh()

public static boolean isShadingPerformanceHigh()

Is the performance of shading processes High. By default it true.

Returns: boolean - boolean value

isTransparentBackground()

public final boolean isTransparentBackground()

Gets or sets if image has transparent background.

Returns: boolean - boolean value

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

process(Page page, System.Drawing.Graphics gr)

public void process(Page page, System.Drawing.Graphics gr)

Renders page on the graphics

Parameters:

Parameter Type Description
page Page Page object
gr com.aspose.ms.System.Drawing.Graphics internal object

process(Page page, OutputStream output)

public void process(Page page, OutputStream output)

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

Parameters:

Parameter Type Description
page Page The page to convert.
output java.io.OutputStream Output stream with png image.

process(Page page, String outputFileName)

public void process(Page page, String outputFileName)

Performs some operation on the given page and saves results into the file.

Parameters:

Parameter Type Description
page Page The page to process.
outputFileName java.lang.String This file contains the results of processing.

processInternal(Page page, System.IO.Stream output)

public void processInternal(Page page, System.IO.Stream output)

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

Parameters:

Parameter Type Description
page Page The page to convert.
output com.aspose.ms.System.IO.Stream Output stream with png image.

processToBufferedImage(Page page)

public BufferedImage processToBufferedImage(Page page)

Converts the page into BufferedImage.

Parameters:

Parameter Type Description
page Page The page to convert.

Returns: java.awt.image.BufferedImage - BufferedImage Output BufferedImage image.

processToBufferedImageBinarized(Page page, double threshold)

public BufferedImage processToBufferedImageBinarized(Page page, double threshold)

Converts the page into BufferedImage with Bradley binarization.

Parameters:

Parameter Type Description
page Page The page to convert.
threshold double The threshold value between 0.0 and 1.0.

Returns: java.awt.image.BufferedImage - BufferedImage Output BufferedImage image.

setCoordinateType(int value)

public void setCoordinateType(int value)

Sets the page coordinate type (Media/Crop boxes). CropBox value is used by default.

Parameters:

Parameter Type Description
value int PageCoordinateType element

setCropRectangle(Rectangle cropRectangle)

public void setCropRectangle(Rectangle cropRectangle)

Set rectangle that defines the area that will be converted into a picture. The default is null, in which case the whole page is converted to an image.

Parameters:

Parameter Type Description
cropRectangle Rectangle Rectangle object

setFormPresentationMode(int value)

public void setFormPresentationMode(int value)

Sets form presentation mode.

Parameters:

Parameter Type Description
value int FormPresentationMode element

setRenderingOptions(RenderingOptions value)

public void setRenderingOptions(RenderingOptions value)

Sets rendering options.

Parameters:

Parameter Type Description
value RenderingOptions RenderingOptions element

setShadingPerformanceHigh(boolean value)

public static void setShadingPerformanceHigh(boolean value)

Sets the the performance of shading processes High or not.

Parameters:

Parameter Type Description
value boolean boolean value

setTransparentBackground(boolean value)

public final void setTransparentBackground(boolean value)

Gets or sets if image has transparent background.

Parameters:

Parameter Type Description
value boolean boolean value

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

Parameter Type Description
arg0 long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

Parameter Type Description
arg0 long
arg1 int