Image
Overview
Image is a class in Aspose.Pdf FOSS for Java.
Inherits from: BaseParagraph.
Represents an image element that can be added to a PDF page’s paragraph collection.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
file | String | Read | Returns the file path of the image. |
imageStream | InputStream | Read | Returns the input stream providing the image data. |
fixWidth | double | Read | Returns the fixed display width of the image in points. |
fixHeight | double | Read | Returns the fixed display height of the image in points. |
imageType | String | Read | Returns the image type identifier (e.g., “JPEG”, “PNG”). |
title | String | Read | Returns the title (alt text) for this image. |
margin | MarginInfo | Read | Gets the margin information for this paragraph. |
horizontalAlignment | HorizontalAlignment | Read | Gets the horizontal alignment of this paragraph within its container. |
inLineParagraph | boolean | Read | Returns whether this paragraph is an inline element. |
keptWithNext | boolean | Read | Returns whether this paragraph should be kept together with the next paragraph |
| on the same page during layout. | |||
firstParagraphInColumn | boolean | Read | Returns whether this paragraph is the first in its column. |
inNewPage | boolean | Read | Returns whether this paragraph should start on a new page during layout. |
hyperlink | Hyperlink | Read | Returns the hyperlink attached to this paragraph (web, local or file |
| target), or {@code null} if the paragraph is not clickable. |
Methods
| Signature | Description |
|---|---|
Image() | Creates a new Image with default settings. |
getFile() → String | Returns the file path of the image. |
setFile(file: String) | Sets the file path of the image. |
getImageStream() → InputStream | Returns the input stream providing the image data. |
setImageStream(imageStream: InputStream) | Sets the input stream providing the image data. |
getFixWidth() → double | Returns the fixed display width of the image in points. |
setFixWidth(fixWidth: double) | Sets the fixed display width of the image in points. |
getFixHeight() → double | Returns the fixed display height of the image in points. |
setFixHeight(fixHeight: double) | Sets the fixed display height of the image in points. |
getImageType() → String | Returns the image type identifier (e.g., “JPEG”, “PNG”). |
setImageType(imageType: String) | Sets the image type identifier. |
getTitle() → String | Returns the title (alt text) for this image. |
setTitle(title: String) | Sets the title (alt text) for this image. |
getMargin() → MarginInfo | Gets the margin information for this paragraph. |
setMargin(margin: MarginInfo) | Sets the margin information for this paragraph. |
getHorizontalAlignment() → HorizontalAlignment | Gets the horizontal alignment of this paragraph within its container. |
setHorizontalAlignment(horizontalAlignment: HorizontalAlignment) | Sets the horizontal alignment of this paragraph within its container. |
isInLineParagraph() → boolean | Returns whether this paragraph is an inline element. |
setInLineParagraph(inLineParagraph: boolean) | Sets whether this paragraph should be treated as an inline element. |
isKeptWithNext() → boolean | Returns whether this paragraph should be kept together with the next paragraph |
| on the same page during layout. | |
setKeptWithNext(keptWithNext: boolean) | Sets whether this paragraph should be kept together with the next paragraph |
| on the same page during layout. | |
isFirstParagraphInColumn() → boolean | Returns whether this paragraph is the first in its column. |
setFirstParagraphInColumn(firstParagraphInColumn: boolean) | Sets whether this paragraph is the first in its column. |
isInNewPage() → boolean | Returns whether this paragraph should start on a new page during layout. |
setInNewPage(inNewPage: boolean) | Sets whether this paragraph should start on a new page during layout. |
getHyperlink() → Hyperlink | Returns the hyperlink attached to this paragraph (web, local or file |
| target), or {@code null} if the paragraph is not clickable. | |
setHyperlink(hyperlink: Hyperlink) | Attaches a hyperlink to this paragraph. |