aspose.pdf
Class Image

java.lang.Object
  extended by aspose.pdf.Paragraph
      extended by aspose.pdf.Image

public class Image
extends Paragraph

Represents an image in a Pdf document.

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); GraphNote note1 = new GraphNote(sec1); note1.setContent("this is note1"); note1.setPosX(50); note1.setPosY(100); image1.getImageNotes().add(note1); 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().setCcittImageWidth(350); image2.getImageInfo().setCcittImageHeight(400); pdf1.save(...); [XML] <?xml version="1.0" encoding="utf-8" ?> <Pdf xmlns="Aspose.Pdf"> <Section> <Image File="C:/Images/Flower.jpg" Type="jpeg"> <Note Position="50 100">this is note1</Note> </Image> <Image File="C:/Images/Flower.fax" Type="ccitt" CcittImageWidth="350" CcittImageHeight="400" CcittSubFormat="Group31D"> </Image> </Section> </Pdf>


Nested Class Summary
 
Nested classes/interfaces inherited from class aspose.pdf.Paragraph
Paragraph.VerticalPositionInfo
 
Field Summary
 int ImageSlot
          Storage OpenImageFile () return value.
 boolean IsSizeProcessed
          Have access to the image height and width of the
 
Fields inherited from class aspose.pdf.Paragraph
_realPageNumber, INNER_INDENT, isNeedAddToPage, isPositionProcessed, VerticalPosInfo
 
Constructor Summary
Image()
          Constructor - initializes a new instance of the Image class.
Image(HeaderFooter hf)
          Constructor - initializes a new instance of the Image class.
Image(Section section)
          Constructor - initializes a new instance of the Image class.
 
Method Summary
 java.lang.Object completeClone()
          Clones a new Image object.
 float getAdditionalHeightForRotating()
          Gets addition height caused by image rotation.
 GraphicState getGraphicState()
          Gets a GraphicState object that indicates the graphic state for the image.
 Hyperlink getHyperlink()
          Gets a Hyperlink object that indicates the hyper link info of the image.
 float getImageHeight()
          Gets a float value that indicates the image height.
 float getImageHeightScale()
          Gets a float value that indicates the scale rate of the image height when placed into pdf file.
 ImageInfo getImageInfo()
          Gets a ImageInfo object that indicates the common image info.
 GraphNotes getImageNotes()
          Gets a GraphNotes collection that indicates all notes in the image.
 float getImageScale()
          Gets a float value that indicates the scale rate of the image when placed into pdf file.
 float getImageWidth()
          Gets a float value that indicates the image width.
 float getImageWidthScale()
          Gets a float value that indicates the scale rate of the image width when placed into pdf file.
 boolean getIsScaled()
          Gets a boolean value indicates whether image has been scled.
 boolean getIsSizeProcessed()
          Gets a boolean value that indicates whether the image size has been processed.
 float getOpacity()
          Gets a float value between 0.0 and 1.0 that indicates the opacity of the image.
 float getRealHeight()
          Gets a float value that indicates the image real height.
 float getRealWidth()
          Gets a float value that indicates the image real width.
 float getRotatingAngle()
          Gets a float value between -90 and 90 that indicates the number of degrees by which the image should be rotated anticlockwise when displayed or printed.
 int getZIndex()
          Gets an int value that indicates the Z-order of the image.
 boolean isImageFitToRowHeight()
          Gets a boolean value that indicates whether the image fit to the size of cell which has the only image paragraph.
 boolean isNeedRepeating()
          Gets a boolean value that indicates whether the paragraph need to be repeated on next page.
 void setGraphicState(GraphicState gState)
          Sets a GraphicState object that indicates the graphic state for the image.
 void setHyperlink(Hyperlink hyperlinkInfo)
          Sets a Hyperlink object that indicates the hyper link info of the image.
 void setImageHeight(float height)
          Sets a float value that indicates the image height.
 void setImageHeightScale(float hscale)
          Sets a float value that indicates the scale rate of the image height when placed into pdf file.
 void setImageInfo(ImageInfo imageInfo)
          Sets a ImageInfo object that indicates the common image info.
 void setImageNotes(GraphNotes notes)
          Sets a GraphNotes collection that indicates all notes in the image.
 void setImageScale(float scale)
          Sets a float value that indicates the scale rate of the image when placed into pdf file.
 void setImageWidth(float width)
          Deprecated. This function is now obsolete. Web image can be supported by setting the URL in Image.getImageInfo().setFile(). You need not set this function any more. For CCITT image, please use ImageInfo.setCcittImageWidth() instead.
 void setImageWidthScale(float wscale)
          Sets or sets a float value that indicates the scale rate of the image width when placed into pdf file.
 void setIsImageFitToRowHeight(boolean isImageFitToRowHeight)
          Sets a boolean value that indicates whether the image fit to the size of cell which has the only image paragraph.
 void setIsNeedRepeating(boolean isNeedRepeating)
          Sets a boolean value that indicates whether the paragraph need to be repeated on next page.
 void setIsScaled(boolean imgScaled)
          Sets a boolean value indicates whether image has been scled.
 void setIsSizeProcessed(boolean IsSizeProcessed)
          Sets a boolean value that indicates whether the image size has been processed.
 void setOpacity(float opacity)
          Sets a float value between 0.0 and 1.0 that indicates the opacity of the image.
 void setRealHeight(float RealHeight)
          Sets a float value that indicates the image real height.
 void setRealWidth(float realWidth)
          Sets a float value that indicates the image real width.
 void setRotatingAngle(float rotatingAngle)
          Sets a float value between -90 and 90 that indicates the number of degrees by which the image should be rotated anticlockwise when displayed or printed.
 void setZIndex(int z_index)
          Sets an int value that indicates the Z-order of the image.
 
Methods inherited from class aspose.pdf.Paragraph
copyTo, getHeight, getID, getIsNeedAddToPage, getIsPositionGot, getIsPositionProcessed, getLeft, getMargin, getMayNeedReprocess, getNeedReprocess, getNextParagraphInHeading, getPageNumber, getParentCell, getPositioningType, getPosX, getPosY, getRealPageNumber, getReferenceParagraphID, getRefPara, getSection, getTop, getVerticalPosInfo, getWidth, isDisabled, isEndNote, isFirstParagraph, isFirstParagraphInColumn, isFootNote, isFootNoteProcessed, isInHeaderFooter, isInList, isKeptTogether, isKeptWithNext, isOnOddPage, setEndNote, setFootNoteProcessed, setHeight, setID, setIsDisabled, setIsFirstParagraph, setIsFirstParagraphInColumn, setIsFootNote, setIsInHeaderFooter, setIsInList, setIsKeptTogether, setIsKeptWithNext, setIsNeedAddToPage, setIsOnOddPage, setIsPositionGot, setIsPositionProcessed, setLeft, setMargin, setMayNeedReprocess, setNeedReprocess, setNextParagraphInHeading, setPageNumber, setParentCell, setParentIsTable, setPositioningType, setPosX, setPosY, setRealPageNumber, setReferenceParagraphID, setRefPara, setSection, setTop, setVerticalPosInfo, setWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IsSizeProcessed

public boolean IsSizeProcessed
Have access to the image height and width of the


ImageSlot

public int ImageSlot
Storage OpenImageFile () return value. So that output can be directly PlaceImage (), to increase efficiency

Constructor Detail

Image

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


Image

public Image(Section section)
Constructor - initializes a new instance of the Image class. This constructor can inherit common property values from the specified Section object.

Parameters:
section - The section object.

Image

public Image(HeaderFooter hf)
Constructor - initializes a new instance of the Image class. The HeaderFooter object. This constructor can inherit common property values from the specified HeaderFooter object.

Parameters:
hf - A HeaderFooter object.
Method Detail

getImageInfo

public ImageInfo getImageInfo()
Gets a ImageInfo object that indicates the common image info.


setImageInfo

public void setImageInfo(ImageInfo imageInfo)
Sets a ImageInfo object that indicates the common image info.


isNeedRepeating

public boolean isNeedRepeating()
Gets a boolean value that indicates whether the paragraph need to be repeated on next page.

Returns:
A boolean value.

setIsNeedRepeating

public void setIsNeedRepeating(boolean isNeedRepeating)
Sets a boolean value that indicates whether the paragraph need to be repeated on next page. Default value is false.The attribute is only valid when the paragraph itself and the object its ReferenceParagraphID referred to both are included in RepeatingRows.

Parameters:
isNeedRepeating - A boolean value.

getImageNotes

public GraphNotes getImageNotes()
Gets a GraphNotes collection that indicates all notes in the image.

Returns:
A GraphNotes object.

setImageNotes

public void setImageNotes(GraphNotes notes)
Sets a GraphNotes collection that indicates all notes in the image.

Parameters:
notes - A GraphNotes object.

getImageWidth

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

Returns:
A float value.

setImageWidth

public void setImageWidth(float width)
Deprecated. This function is now obsolete. Web image can be supported by setting the URL in Image.getImageInfo().setFile(). You need not set this function any more. For CCITT image, please use ImageInfo.setCcittImageWidth() instead.

Sets a float value that indicates the image width. This property is not used to control the image width but used to specify the image width when there is no width info in image,e.g., CCITT fax image or image on the web.

Parameters:
width - A float value.

getImageWidthScale

public float getImageWidthScale()
Gets a float value that indicates the scale rate of the image width when placed into pdf file.

Returns:
A float value.

setImageWidthScale

public void setImageWidthScale(float wscale)
Sets or sets a float value that indicates the scale rate of the image width when placed into pdf file.

Parameters:
wscale - A float value.

getImageHeight

public float getImageHeight()
Gets a float value that indicates the image height. This property is not used to control the image height but used to specify the image width when there is no height info in image,e.g., CCITT fax image or image on the web.

Returns:
A float value.

setImageHeight

public void setImageHeight(float height)
Sets a float value that indicates the image height. This property is not used to control the image height but used to specify the image width when there is no height info in image,e.g., CCITT fax image or image on the web.

Parameters:
height - A float value.

getImageScale

public float getImageScale()
Gets a float value that indicates the scale rate of the image when placed into pdf file.


setImageScale

public void setImageScale(float scale)
Sets a float value that indicates the scale rate of the image when placed into pdf file.

Parameters:
scale - A float value.

isImageFitToRowHeight

public boolean isImageFitToRowHeight()
Gets a boolean value that indicates whether the image fit to the size of cell which has the only image paragraph.

Returns:
A boolean value.

setIsImageFitToRowHeight

public void setIsImageFitToRowHeight(boolean isImageFitToRowHeight)
Sets a boolean value that indicates whether the image fit to the size of cell which has the only image paragraph.

Parameters:
isImageFitToRowHeight - A boolean value.

getImageHeightScale

public float getImageHeightScale()
Gets a float value that indicates the scale rate of the image height when placed into pdf file.

Returns:
A float value.

setImageHeightScale

public void setImageHeightScale(float hscale)
Sets a float value that indicates the scale rate of the image height when placed into pdf file.

Parameters:
hscale - A float value.

getGraphicState

public GraphicState getGraphicState()
Gets a GraphicState object that indicates the graphic state for the image.

Returns:
A GraphicState object.

setGraphicState

public void setGraphicState(GraphicState gState)
Sets a GraphicState object that indicates the graphic state for the image.

Parameters:
gState - A GraphicState object.

setOpacity

public void setOpacity(float opacity)
Sets a float value between 0.0 and 1.0 that indicates the opacity of the image. The default value is 1.0.

Parameters:
opacity - A float value.

getOpacity

public float getOpacity()
Gets a float value between 0.0 and 1.0 that indicates the opacity of the image. The default value is 1.0.

Returns:
A float value.

getIsScaled

public boolean getIsScaled()
Gets a boolean value indicates whether image has been scled.

Returns:
A boolean value.

setIsScaled

public void setIsScaled(boolean imgScaled)
Sets a boolean value indicates whether image has been scled.

Parameters:
imgScaled - A boolean value.

completeClone

public java.lang.Object completeClone()
Clones a new Image object.

Specified by:
completeClone in class Paragraph
Returns:
A new Image object.

getHyperlink

public Hyperlink getHyperlink()
Gets a Hyperlink object that indicates the hyper link info of the image.

Returns:
A Hyperlink object.

setHyperlink

public void setHyperlink(Hyperlink hyperlinkInfo)
Sets a Hyperlink object that indicates the hyper link info of the image.

Parameters:
hyperlinkInfo - Hyperlink object.

getRealWidth

public float getRealWidth()
Gets a float value that indicates the image real width.

Returns:
A float value.

setRealWidth

public void setRealWidth(float realWidth)
Sets a float value that indicates the image real width.

Parameters:
realWidth - A float value.

getRealHeight

public float getRealHeight()
Gets a float value that indicates the image real height.

Returns:
A float value.

setRealHeight

public void setRealHeight(float RealHeight)
Sets a float value that indicates the image real height.

Parameters:
RealHeight - A float value.

getIsSizeProcessed

public boolean getIsSizeProcessed()
Gets a boolean value that indicates whether the image size has been processed.

Returns:
A float value.

setIsSizeProcessed

public void setIsSizeProcessed(boolean IsSizeProcessed)
Sets a boolean value that indicates whether the image size has been processed.

Parameters:
IsSizeProcessed - A float value.

getZIndex

public int getZIndex()
Gets an int value that indicates the Z-order of the image. A image with larger ZIndex will be placed over the image with smaller ZIndex. ZIndex can be negative. Image with negative ZIndex will be placed behind the text in the page.

Returns:
An int value.

setZIndex

public void setZIndex(int z_index)
Sets an int value that indicates the Z-order of the image. A image with larger ZIndex will be placed over the image with smaller ZIndex. ZIndex can be negative. Image with negative ZIndex will be placed behind the text in the page.

Parameters:
z_index - An int value.

getRotatingAngle

public float getRotatingAngle()
Gets a float value between -90 and 90 that indicates the number of degrees by which the image should be rotated anticlockwise when displayed or printed. Default value is 0.

Returns:
A float value.

setRotatingAngle

public void setRotatingAngle(float rotatingAngle)
Sets a float value between -90 and 90 that indicates the number of degrees by which the image should be rotated anticlockwise when displayed or printed. Default value is 0.

Parameters:
rotatingAngle - A float value.

getAdditionalHeightForRotating

public float getAdditionalHeightForRotating()
Gets addition height caused by image rotation.

Returns:
A float value.