Image
Inheritance: java.lang.Object, com.aspose.pdf.BaseParagraph
public final class Image extends BaseParagraph
Represents image.
Constructors
Constructor | Description |
---|---|
Image() | default constructor |
Methods
Method | Description |
---|---|
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:
Parameter | Type | Description |
---|---|---|
value | java.lang.String | String 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:
Parameter | Type | Description |
---|---|---|
value | double | double 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:
Parameter | Type | Description |
---|---|---|
value | double | double 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:
Parameter | Type | Description |
---|---|---|
value | int | int 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:
Parameter | Type | Description |
---|---|---|
value | double | double 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:
Parameter | Type | Description |
---|---|---|
value | java.io.InputStream | InputStream 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:
Parameter | Type | Description |
---|---|---|
value | boolean | boolean 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:
Parameter | Type | Description |
---|---|---|
value | boolean | boolean 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:
Parameter | Type | Description |
---|---|---|
value | TextFragment | TextFragment value |
getMimeType(System.Drawing.Image i)
public static String getMimeType(System.Drawing.Image i)
Returns mime type for image.
Parameters:
Parameter | Type | Description |
---|---|---|
i | com.aspose.ms.System.Drawing.Image | Image 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:
Parameter | Type | Description |
---|---|---|
value | java.io.InputStream | InputStream 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:
Parameter | Type | Description |
---|---|---|
value | java.awt.image.BufferedImage | BufferedImage 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:
Parameter | Type | Description |
---|---|---|
blackWhiteForGrayScale | boolean | boolean value |
isBlackWhiteForGrayScale()
public boolean isBlackWhiteForGrayScale()
Try to detect and use 1bpp encoding for grayscale images Default value == FALSE
Returns: boolean - boolean value