aspose.pdf
Class ImageInfo

java.lang.Object
  extended by aspose.pdf.ImageInfo

public class ImageInfo
extends java.lang.Object

Encapsulates info for an Image paragraph.

Typical usages are the following:

[Java] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.getSections().add(); aspose.pdf.Image image1 = new aspose.pdf.Image(sec1); sec1.getParagraphs().add(image1); image1.getImageInfo().setFile("C:/Images/Apple.jpg"); image1.getImageInfo().setImageFileType(ImageFileType.Jpeg); image1.getImageInfo().setTitle("JPEG image"); aspose.pdf.Image image2 = new aspose.pdf.Image(sec1); sec1.getParagraphs().add(image2); image2.getImageInfo().setFile("C:/Images/Flower.fax"); image2.getImageInfo().setImageFileType(ImageFileType.Ccitt); image2.getImageInfo().setCcittSubFormat(CcittSubFormat.Group31D); image2.getImageInfo().setTitle("CCITT fax image"); image2.setImageWidth(350); image2.setImageHeight(400); aspose.pdf.Image image3 = new aspose.pdf.Image(sec1); sec1.getParagraphs().add(image3); image3.getImageInfo().setFile("http://localhost/Images/SeaFood.jpg"); image3.getImageInfo().setImageFileType(ImageFileType.Jpeg); image3.getImageInfo().setOpenType(ImageOpenType.Url); image3.getImageInfo().setTitle("jpeg image with url"); image3.setImageWidth(154); image3.setImageHeight(112); image3.getImageInfo().setBitsPerComponent(8); image3.getImageInfo().setComponentNumber(3); pdf1.Save("d:\\temp\\test.pdf"); [XML] <?xml version="1.0" encoding="utf-8" ?> <Pdf xmlns="Aspose.Pdf"> <Section> <Image File="C:/Images/Apple.jpg" Type="jpeg"> <Title>JPEG image</Title> </Image> <Image File="C:/Images/Flower.fax" Type="ccitt" CcittSubFormat="Group31D" Width="350" Height="400"> <Title>CCITT fax image</Title> </Image> <Image File="http://localhost/Images/SeaFood.jpg" OpenType="url" Type="jpeg" Width="154" Height="112" BitsPerComponent="8" ComponentNumber="3"> </Image> </Section> </Pdf>


Constructor Summary
ImageInfo()
          Constructor - initializes a new instance of the ImageInfo class.
 
Method Summary
 AlignmentType getAlignment()
          Gets a AlignmentType object that indicates the image alignment type.
 int getBitsPerComponent()
          Deprecated. This function is now obsolete. Web image can be supported by setting the URL in Image.ImageInfo.File. You need not set this property any more.
 float getCcittImageHeight()
          Gets a float value that indicates the CCITT image height.
 float getCcittImageWidth()
          Gets a float value that indicates the CCITT image width.
 CcittSubFormat getCcittSubFormat()
          Gets the CcittSubFormat.
 int getComponentNumber()
          Deprecated. This property is now obsolete. Web image can be supported by setting the URL in Image.ImageInfo.File.You need not set this property any more.
 java.lang.String getDefaultFile()
          Gets a String that indicates the default image file name.
 java.lang.String getFile()
          Gets a String that indicates the image file name and its path or url of a web image.
 float getFixHeight()
          Gets a float value that indicates the fixed height of the image.
 float getFixWidth()
          Gets or sets a float value that indicates the fixed width of the image.
 BorderInfo getImageBorder()
          Gets a BorderInfo object that indicates the border information of the image.
 ImageFileType getImageFileType()
          Gets a ImageFileType object that indicates the image type.
 BinaryFileStream getImageStream()
          Gets a stream that indicates the image stream.
 boolean getIsFixImgHeightSettedInXML()
          Gets a boolean value that indicates the fixed height of the image is specified in xml file.
 byte[] getMemoryData()
          Deprecated. This function is now obsolete. Please use ImageStream instead.
 ImageOpenType getOpenType()
          Deprecated. This function is now obsolete. URL is supported in Image.ImageInfo.File. Memory image can be supported by Image.ImageInfo.ImageStream. You need not set OpenType any more.
 java.awt.image.BufferedImage getSysImageStream()
          Gets a BufferedImage object.
 aspose.pdf.figure.Image getSystemImage()
          Gets a Image object which is used to create a Aspose Aspose.Pdf.Image object.
 TextInfo getTextInfo()
          Gets a TextInfo object that indicates the text info of the image Title.
 int getTiffFrame()
          Gets an int value that indicates the valid frame of the TIFF image.
 java.lang.String getTitle()
          Gets a String value that indicates the title of the image.
 boolean isAllFramesInNewPage()
          Gets a boolean value that indicates whether all frames in TIFF images should be rendered in new page.
 boolean isBlack1()
          Gets a boolean value that indicates whether black is considered as 1 in an image.
 boolean isBlackWhite()
          Gets a boolean value that indicates whether the image is forced to be black-and-white.
 boolean isFixImgWidthSettedInXML()
          Gets a boolean value that indicates the fixed width of the image is set in xml file.
 boolean isImageNotFoundErrorIgnored()
          Gets a boolean value that indicates whether the "image not found" error be ignored or not.
 void setAlignment(AlignmentType paraAlignment)
          Sets a AlignmentType object that indicates the image alignment type.
 void setBitsPerComponent(int bitsPerCom)
          Sets an int value that indicates the color bits per component of the image.
 void setCcittImageHeight(float ccittImgHeight)
          Sets a float value that indicates the CCITT image height.
 void setCcittImageWidth(float ccittImgWidth)
          Sets a float value that indicates the CCITT image width.
 void setCcittSubFormat(CcittSubFormat ccittSubFormat)
          Sets the CcittSubFormat.
 void setComponentNumber(int components)
          Deprecated. This property is now obsolete. Web image can be supported by setting the URL in Image.ImageInfo.File. You need not set this property any more.
 void setDefaultFile(java.lang.String defaultImgFile)
          Sets a String that indicates the default image file name.
 void setFile(java.lang.String value)
          Sets a String that indicates the image file name and its path or url of a web image.
 void setFixHeight(float fixImgHeight)
          Sets a float value that indicates the fixed height of the image.
 void setFixWidth(float fixImgWidth)
          Sets a float value that indicates the fixed width of the image.
 void setImageBorder(BorderInfo imageBorder)
          Sets a BorderInfo object that indicates the border information of the image.
 void setImageFileType(ImageFileType imgType)
          Sets a ImageFileType object that indicates the image type.
 void setImageStream(BinaryFileStream imageStream)
          Sets a stream that indicates the image stream.
 void setImageStream(java.io.FileInputStream fs)
          Sets a stream that indicates the image stream.
 void setIsAllFramesInNewPage(boolean allFramesInNewPage)
          Sets a boolean value that indicates whether all frames in TIFF images should be rendered in new page.
 void setIsBlack1(boolean black1)
          Sets a boolean value that indicates whether black is considered as 1 in an image.
 void setIsBlackWhite(boolean forceBlackWhite)
          Sets a boolean value that indicates whether the image is forced to be black-and-white.
 void setIsFixImgHeightSettedInXML(boolean isFixImgHeightSettedInXML)
          Sets a boolean value that indicates the fixed height of the image is set in xml file.
 void setIsFixImgWidthSettedInXML(boolean isFixImgWidthSettedInXML)
          Sets a boolean value that indicates the fixed width of the image is set in xml file.
 void setIsImageNotFoundErrorIgnored(boolean isImgNotFoundIgnored)
          Sets a boolean value that indicates whether the "image not found" error be ignored or not.
 void setMemoryData(byte[] memData)
          Deprecated. This function is now obsolete. Please use ImageStream instead.
 void setOpenType(ImageOpenType imgOpenType)
          Deprecated. This function is now obsolete. URL is supported in Image.ImageInfo.File. Memory image can is supported by Image.ImageInfo.ImageStream. You need not set OpenType any more.
 void setSysImageStream(java.awt.image.BufferedImage insysimage)
          Sets a BufferedImage object which is used to create a Aspose Aspose.Pdf.Image object.
 void setSystemImage(java.awt.image.BufferedImage sysImage)
          Sets a BufferedImage object which is used to create a Aspose Aspose.Pdf.Image object.
 void setSystemImage(aspose.pdf.figure.Image sysImage)
          Sets a Image object which is used to create a Aspose Aspose.Pdf.Image object.
 void setSystemImage(java.awt.Image sysImage)
          Sets a Image object which is used to create a Aspose Aspose.Pdf.Image object.
 void setTextInfo(TextInfo imageTitleInfo)
          Sets a TextInfo object that indicates the text info of the image Title.
 void setTiffFrame(int tiffFrameNumber)
          Sets an int value that indicates the valid frame of the TIFF image.
 void setTitle(java.lang.String imageTitle)
          Sets a String value that indicates the title of the image.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageInfo

public ImageInfo()
Constructor - initializes a new instance of the ImageInfo class.

Method Detail

getAlignment

public AlignmentType getAlignment()
Gets a AlignmentType object that indicates the image alignment type.

Returns:
An AlignmentType object.

setAlignment

public void setAlignment(AlignmentType paraAlignment)
Sets a AlignmentType object that indicates the image alignment type.

Parameters:
paraAlignment - An AlignmentType object.

getTitle

public java.lang.String getTitle()
Gets a String value that indicates the title of the image.

Returns:
Image title name.

setTitle

public void setTitle(java.lang.String imageTitle)
Sets a String value that indicates the title of the image.

Parameters:
imageTitle - Image title name.

getTextInfo

public TextInfo getTextInfo()
Gets a TextInfo object that indicates the text info of the image Title.

Returns:
An TextInfo object.

setTextInfo

public void setTextInfo(TextInfo imageTitleInfo)
Sets a TextInfo object that indicates the text info of the image Title.

Parameters:
imageTitleInfo - A TextInfo object.

getOpenType

public ImageOpenType getOpenType()
Deprecated. This function is now obsolete. URL is supported in Image.ImageInfo.File. Memory image can be supported by Image.ImageInfo.ImageStream. You need not set OpenType any more.

Gets a ImageOpenType that indicates the image open type.

Returns:
An ImageOpenType object.

setOpenType

public void setOpenType(ImageOpenType imgOpenType)
Deprecated. This function is now obsolete. URL is supported in Image.ImageInfo.File. Memory image can is supported by Image.ImageInfo.ImageStream. You need not set OpenType any more.

Sets a ImageOpenType that indicates the image open type.

Parameters:
imgOpenType - An ImageOpenType object.

getImageFileType

public ImageFileType getImageFileType()
Gets a ImageFileType object that indicates the image type. If this property is not set, the image type will be get from the file name.

Returns:
An ImageFileType object.

setImageFileType

public void setImageFileType(ImageFileType imgType)
Sets a ImageFileType object that indicates the image type. If this property is not set, the image type will be get from the file name.

Parameters:
imgType - An ImageFileType object.

getImageBorder

public BorderInfo getImageBorder()
Gets a BorderInfo object that indicates the border information of the image.

Returns:
A BorderInfo object.

setImageBorder

public void setImageBorder(BorderInfo imageBorder)
Sets a BorderInfo object that indicates the border information of the image.

Parameters:
imageBorder - An BorderInfo object.

getFile

public java.lang.String getFile()
Gets a String that indicates the image file name and its path or url of a web image.

Returns:
A String value.

setFile

public void setFile(java.lang.String value)
Sets a String that indicates the image file name and its path or url of a web image.

Parameters:
value - A String value.

getImageStream

public BinaryFileStream getImageStream()
Gets a stream that indicates the image stream.

Returns:
A BinaryFileStream object.

setImageStream

public void setImageStream(BinaryFileStream imageStream)
Sets a stream that indicates the image stream.

Parameters:
imageStream - A BinaryFileStream object.

setImageStream

public void setImageStream(java.io.FileInputStream fs)
Sets a stream that indicates the image stream.

Parameters:
fs - A FileInputStream object.

getSystemImage

public aspose.pdf.figure.Image getSystemImage()
Gets a Image object which is used to create a Aspose Aspose.Pdf.Image object.

Returns:
A Image object.

setSystemImage

public void setSystemImage(aspose.pdf.figure.Image sysImage)
Sets a Image object which is used to create a Aspose Aspose.Pdf.Image object.

Parameters:
sysImage - A Image object.

setSystemImage

public void setSystemImage(java.awt.Image sysImage)
Sets a Image object which is used to create a Aspose Aspose.Pdf.Image object.

Parameters:
sysImage - A Image object.

setSystemImage

public void setSystemImage(java.awt.image.BufferedImage sysImage)
Sets a BufferedImage object which is used to create a Aspose Aspose.Pdf.Image object.

Parameters:
sysImage - A BufferedImage object.

getSysImageStream

public java.awt.image.BufferedImage getSysImageStream()
Gets a BufferedImage object.

Returns:
A BufferedImage object.

setSysImageStream

public void setSysImageStream(java.awt.image.BufferedImage insysimage)
Sets a BufferedImage object which is used to create a Aspose Aspose.Pdf.Image object.

Parameters:
insysimage - A BufferedImage object.

getDefaultFile

public java.lang.String getDefaultFile()
Gets a String that indicates the default image file name. If this name is not null, Aspose.Pdf will use this image file when the image specified in File is not found.

Returns:
A String value.

setDefaultFile

public void setDefaultFile(java.lang.String defaultImgFile)
Sets a String that indicates the default image file name. If this name is not null, Aspose.Pdf will use this image file when the image specified in File is not found.

Parameters:
defaultImgFile - A String value.

isImageNotFoundErrorIgnored

public boolean isImageNotFoundErrorIgnored()
Gets a boolean value that indicates whether the "image not found" error be ignored or not.

Returns:
A boolean value.

setIsImageNotFoundErrorIgnored

public void setIsImageNotFoundErrorIgnored(boolean isImgNotFoundIgnored)
Sets a boolean value that indicates whether the "image not found" error be ignored or not.

Parameters:
isImgNotFoundIgnored - A boolean value.

getMemoryData

public byte[] getMemoryData()
Deprecated. This function is now obsolete. Please use ImageStream instead.

Gets a byte array that indicates the image data in memory.

Returns:
A byte[] object.

setMemoryData

public void setMemoryData(byte[] memData)
Deprecated. This function is now obsolete. Please use ImageStream instead.

Sets a byte array that indicates the image data in memory.


isBlack1

public boolean isBlack1()
Gets a boolean value that indicates whether black is considered as 1 in an image.

Returns:
A boolean value.

setIsBlack1

public void setIsBlack1(boolean black1)
Sets a boolean value that indicates whether black is considered as 1 in an image.

Parameters:
black1 - A boolean value.

getComponentNumber

public int getComponentNumber()
Deprecated. This property is now obsolete. Web image can be supported by setting the URL in Image.ImageInfo.File.You need not set this property any more.

Gets an int value that indicates the color component number of the image. This property is need only when using web image.

Returns:
An int value.

setComponentNumber

public void setComponentNumber(int components)
Deprecated. This property is now obsolete. Web image can be supported by setting the URL in Image.ImageInfo.File. You need not set this property any more.

Sets an int value that indicates the color component number of the image. This function is need only when using web image.

Parameters:
components - An int value.

getBitsPerComponent

public int getBitsPerComponent()
Deprecated. This function is now obsolete. Web image can be supported by setting the URL in Image.ImageInfo.File. You need not set this property any more.

Gets an int value that indicates the color bits per component of the image. This property is need only when using web image.

Returns:
An int value.

setBitsPerComponent

public void setBitsPerComponent(int bitsPerCom)
Sets an int value that indicates the color bits per component of the image. This property is need only when using web image.


getCcittSubFormat

public CcittSubFormat getCcittSubFormat()
Gets the CcittSubFormat. Used for CCITT image type only.

Returns:
A CcittSubFormat object.

setCcittSubFormat

public void setCcittSubFormat(CcittSubFormat ccittSubFormat)
Sets the CcittSubFormat. Used for CCITT image type only.

Parameters:
ccittSubFormat - A CcittSubFormat object.

getTiffFrame

public int getTiffFrame()
Gets an int value that indicates the valid frame of the TIFF image.

Returns:
An int value.

setTiffFrame

public void setTiffFrame(int tiffFrameNumber)
Sets an int value that indicates the valid frame of the TIFF image. The default value is 0. Used for TIFF image only. If this property is set to -1, all frames of the tiff images will be added into the PDF document.


getFixWidth

public float getFixWidth()
Gets or sets a float value that indicates the fixed width of the image.

Returns:
A float value.

setFixWidth

public void setFixWidth(float fixImgWidth)
Sets a float value that indicates the fixed width of the image. If this property is set, the image will be scaled to the fixed width.

Parameters:
fixImgWidth - A float value.

isFixImgWidthSettedInXML

public boolean isFixImgWidthSettedInXML()
Gets a boolean value that indicates the fixed width of the image is set in xml file.

Returns:
A boolean value.

setIsFixImgWidthSettedInXML

public void setIsFixImgWidthSettedInXML(boolean isFixImgWidthSettedInXML)
Sets a boolean value that indicates the fixed width of the image is set in xml file.

Parameters:
isFixImgWidthSettedInXML - A boolean value.

getFixHeight

public float getFixHeight()
Gets a float value that indicates the fixed height of the image.

Returns:
A float value.

setFixHeight

public void setFixHeight(float fixImgHeight)
Sets a float value that indicates the fixed height of the image. If this property is set, the image will be scaled to the fixed height.

Parameters:
fixImgHeight - A float value.

getIsFixImgHeightSettedInXML

public boolean getIsFixImgHeightSettedInXML()
Gets a boolean value that indicates the fixed height of the image is specified in xml file.

Returns:
A boolean value.

setIsFixImgHeightSettedInXML

public void setIsFixImgHeightSettedInXML(boolean isFixImgHeightSettedInXML)
Sets a boolean value that indicates the fixed height of the image is set in xml file.

Parameters:
isFixImgHeightSettedInXML - A boolean value.

isBlackWhite

public boolean isBlackWhite()
Gets a boolean value that indicates whether the image is forced to be black-and-white.

Returns:
A boolean value.

setIsBlackWhite

public void setIsBlackWhite(boolean forceBlackWhite)
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:
forceBlackWhite - A boolean value.

getCcittImageWidth

public float getCcittImageWidth()
Gets a float value that indicates the CCITT image width.

Returns:
A float value.

setCcittImageWidth

public void setCcittImageWidth(float ccittImgWidth)
Sets a float value that indicates the CCITT image width. CCITT image does not contain size information so the width and height must be set by user.

Parameters:
ccittImgWidth - A float value.

getCcittImageHeight

public float getCcittImageHeight()
Gets a float value that indicates the CCITT image height. CCITT image does not contain size information so the width and height must be set by user.

Returns:
A float value.

setCcittImageHeight

public void setCcittImageHeight(float ccittImgHeight)
Sets a float value that indicates the CCITT image height. CCITT image does not contain size information so the width and height must be set by user.

Parameters:
ccittImgHeight - A float value.

isAllFramesInNewPage

public boolean isAllFramesInNewPage()
Gets a boolean value that indicates whether all frames in TIFF images should be rendered in new page.

Returns:
A boolean value.

setIsAllFramesInNewPage

public void setIsAllFramesInNewPage(boolean allFramesInNewPage)
Sets a boolean value that indicates whether all frames in TIFF images should be rendered in new page.

Parameters:
allFramesInNewPage - A boolean value.