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

NameTypeAccessDescription
fileStringReadReturns the file path of the image.
imageStreamInputStreamReadReturns the input stream providing the image data.
fixWidthdoubleReadReturns the fixed display width of the image in points.
fixHeightdoubleReadReturns the fixed display height of the image in points.
imageTypeStringReadReturns the image type identifier (e.g., “JPEG”, “PNG”).
titleStringReadReturns the title (alt text) for this image.
marginMarginInfoReadGets the margin information for this paragraph.
horizontalAlignmentHorizontalAlignmentReadGets the horizontal alignment of this paragraph within its container.
inLineParagraphbooleanReadReturns whether this paragraph is an inline element.
keptWithNextbooleanReadReturns whether this paragraph should be kept together with the next paragraph
on the same page during layout.
firstParagraphInColumnbooleanReadReturns whether this paragraph is the first in its column.
inNewPagebooleanReadReturns whether this paragraph should start on a new page during layout.
hyperlinkHyperlinkReadReturns the hyperlink attached to this paragraph (web, local or file
target), or {@code null} if the paragraph is not clickable.

Methods

SignatureDescription
Image()Creates a new Image with default settings.
getFile()StringReturns the file path of the image.
setFile(file: String)Sets the file path of the image.
getImageStream()InputStreamReturns the input stream providing the image data.
setImageStream(imageStream: InputStream)Sets the input stream providing the image data.
getFixWidth()doubleReturns the fixed display width of the image in points.
setFixWidth(fixWidth: double)Sets the fixed display width of the image in points.
getFixHeight()doubleReturns the fixed display height of the image in points.
setFixHeight(fixHeight: double)Sets the fixed display height of the image in points.
getImageType()StringReturns the image type identifier (e.g., “JPEG”, “PNG”).
setImageType(imageType: String)Sets the image type identifier.
getTitle()StringReturns the title (alt text) for this image.
setTitle(title: String)Sets the title (alt text) for this image.
getMargin()MarginInfoGets the margin information for this paragraph.
setMargin(margin: MarginInfo)Sets the margin information for this paragraph.
getHorizontalAlignment()HorizontalAlignmentGets the horizontal alignment of this paragraph within its container.
setHorizontalAlignment(horizontalAlignment: HorizontalAlignment)Sets the horizontal alignment of this paragraph within its container.
isInLineParagraph()booleanReturns whether this paragraph is an inline element.
setInLineParagraph(inLineParagraph: boolean)Sets whether this paragraph should be treated as an inline element.
isKeptWithNext()booleanReturns 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()booleanReturns whether this paragraph is the first in its column.
setFirstParagraphInColumn(firstParagraphInColumn: boolean)Sets whether this paragraph is the first in its column.
isInNewPage()booleanReturns 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()HyperlinkReturns 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.

See Also