Image

Inheritance: java.lang.Object, com.aspose.pdf.BaseParagraph

public final class Image extends BaseParagraph

Represents image.

Constructors

ConstructorDescription
Image()default constructor

Methods

MethodDescription
getFile()Gets the image file.
setFile(String value)Sets the image file.
getFixWidth()Gets the image width.
setFixWidth(double value)Sets the image width.
getFixHeight()Gets the image height.
setFixHeight(double value)Sets the image height.
getFileType()Gets the image file type.
setFileType(int value)Sets the image file type.
getImageScale()Gets the image scale.
setImageScale(double value)Sets the image scale.
getImageStream()Gets the image stream.
setImageStream(InputStream value)Sets the image stream.
isApplyResolution()Gets or sets a boolean value that indicates whether the image use resolution during generation
setApplyResolution(boolean value)Gets or sets a boolean value that indicates whether the image use resolution during generation
isBlackWhite()Gets a boolean value that indicates whether the image is forced to be black-and-white.
setBlackWhite(boolean value)Sets a boolean value that indicates whether the image is forced to be black-and-white.
getTitle()Gets a string value that indicates the title of the image.
setTitle(TextFragment value)Sets a string value that indicates the title of the image.
getMimeType(System.Drawing.Image i)Returns mime type for image.
convertToJpeg(InputStream value)Try to convert to stream with bmp/png/gif/tiff image to stream with JPG format image.
deepClone()Clone the image.
setBufferedImage(BufferedImage value)Sets the java awt image.
getBufferedImage()Gets the java awt image.
setBlackWhiteForGrayScale(boolean blackWhiteForGrayScale)Try to detect and use 1bpp encoding for grayscale images.
isBlackWhiteForGrayScale()Try to detect and use 1bpp encoding for grayscale images Default value == FALSE

Image()

public Image()

default constructor

getFile()

public String getFile()

Gets the image file.

Returns: java.lang.String - String value

setFile(String value)

public void setFile(String value)

Sets the image file.

Parameters:

ParameterTypeDescription
valuejava.lang.StringString value

getFixWidth()

public double getFixWidth()

Gets the image width.

Returns: double - double value

setFixWidth(double value)

public void setFixWidth(double value)

Sets the image width.

Parameters:

ParameterTypeDescription
valuedoubledouble value

getFixHeight()

public double getFixHeight()

Gets the image height.

Returns: double - double value

setFixHeight(double value)

public void setFixHeight(double value)

Sets the image height.

Parameters:

ParameterTypeDescription
valuedoubledouble value

getFileType()

public int getFileType()

Gets the image file type.

Returns: int - int value

setFileType(int value)

public void setFileType(int value)

Sets the image file type.

Parameters:

ParameterTypeDescription
valueintint value

getImageScale()

public double getImageScale()

Gets the image scale.

Returns: double - double value

setImageScale(double value)

public void setImageScale(double value)

Sets the image scale.

Parameters:

ParameterTypeDescription
valuedoubledouble value

getImageStream()

public InputStream getImageStream()

Gets the image stream.

Returns: java.io.InputStream - InputStream object

setImageStream(InputStream value)

public void setImageStream(InputStream value)

Sets the image stream.

Parameters:

ParameterTypeDescription
valuejava.io.InputStreamInputStream value

isApplyResolution()

public boolean isApplyResolution()

Gets or sets a boolean value that indicates whether the image use resolution during generation

Returns: boolean - boolean value

setApplyResolution(boolean value)

public void setApplyResolution(boolean value)

Gets or sets a boolean value that indicates whether the image use resolution during generation

Parameters:

ParameterTypeDescription
valuebooleanboolean value

isBlackWhite()

public boolean isBlackWhite()

Gets a boolean value that indicates whether the image is forced to be black-and-white. If TIFF image of CCITT subformat is used, this property must be set to true.

Returns: boolean - boolean value

setBlackWhite(boolean value)

public void setBlackWhite(boolean value)

Sets a boolean value that indicates whether the image is forced to be black-and-white. If TIFF image of CCITT subformat is used, this property must be set to true.

Parameters:

ParameterTypeDescription
valuebooleanboolean value

getTitle()

public TextFragment getTitle()

Gets a string value that indicates the title of the image.

Returns: TextFragment - TextFragment value

setTitle(TextFragment value)

public void setTitle(TextFragment value)

Sets a string value that indicates the title of the image.

Parameters:

ParameterTypeDescription
valueTextFragmentTextFragment value

getMimeType(System.Drawing.Image i)

public static String getMimeType(System.Drawing.Image i)

Returns mime type for image.

Parameters:

ParameterTypeDescription
icom.aspose.ms.System.Drawing.ImageImage object.

Returns: java.lang.String - Mime type as string if found; otherwise, “image/unknown” value.

convertToJpeg(InputStream value)

public static InputStream convertToJpeg(InputStream value)

Try to convert to stream with bmp/png/gif/tiff image to stream with JPG format image.

Parameters:

ParameterTypeDescription
valuejava.io.InputStreamInputStream instance

Returns: java.io.InputStream - InputStream instance

deepClone()

public Object deepClone()

Clone the image.

Returns: java.lang.Object - The cloned object

setBufferedImage(BufferedImage value)

public void setBufferedImage(BufferedImage value)

Sets the java awt image.

Parameters:

ParameterTypeDescription
valuejava.awt.image.BufferedImageBufferedImage object

getBufferedImage()

public BufferedImage getBufferedImage()

Gets the java awt image.

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

setBlackWhiteForGrayScale(boolean blackWhiteForGrayScale)

public void setBlackWhiteForGrayScale(boolean blackWhiteForGrayScale)

Try to detect and use 1bpp encoding for grayscale images. Default value == FALSE

Parameters:

ParameterTypeDescription
blackWhiteForGrayScalebooleanboolean value

isBlackWhiteForGrayScale()

public boolean isBlackWhiteForGrayScale()

Try to detect and use 1bpp encoding for grayscale images Default value == FALSE

Returns: boolean - boolean value