Home  Products  Purchase  Downloads  Demos  Forums  Blogs  Ticket  Wiki  API  Corporate

com.aspose.pdf.elements
Class Image

java.lang.Object
  extended bycom.aspose.pdf.elements.PdfElementBase
      extended bycom.aspose.pdf.elements.Paragraph
          extended bycom.aspose.pdf.elements.Image
All Implemented Interfaces:
java.lang.Cloneable

public class Image
extends Paragraph

Represents an image Paragraph in a Pdf document.


Constructor Summary
Image(Section section)
          Initialize a new instance of the Image class.
 
Method Summary
 java.lang.Object clone()
          Clone an object.
 org.w3c.dom.Element getDOMElement()
          Gets a DOM representation of the pdf element.
 java.lang.String getFile()
          Gets a string that indicates the image file name and its path.
 float getFixWidth()
          Getsa float value that indicates the fixed width of the image.
 HyperLink getHyperLink()
          Gets a Hyperlink object that indicates the hyper link info of the image.
 int getImageAlignment()
          Gets an Alignment Type that indicates the image alignment type.
 float getImageHeight()
          Gets a float value that indicates the image height.This property
is not used to control the image height but used to spefity the image width
when there is no height info in image,e.g., image on the web.
 float getImageWidth()
          Gets a float value that indicates the image width.
 void setFile(java.lang.String file)
          Sets a string that indicates the image file name and its path.
 void setFixWidth(float width)
          Sets a float value that indicates the fixed width of the image.
 void setHyperLink(HyperLink link)
          Sets a Hyperlink object that indicates the hyper link info of the image.
 void setImageAlignment(int alignment)
          Sets an Alignment Type that indicates the image alignment type.
 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 spefity the image width
when there is no height info in image,e.g., image on the web.
 void setImageWidth(float width)
          Sets a float value that indicates the image width.
 
Methods inherited from class com.aspose.pdf.elements.Paragraph
getMargin, isDisabled, isFirstParagraph, isKeptTogether, isOnOddPage, setDisabled, setFirstParagraph, setKeptTogether, setMargin, setOnOddPage
 
Methods inherited from class com.aspose.pdf.elements.PdfElementBase
getElementFactory, getID, getNameIndex, setID
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Image

public Image(Section section)
Initialize a new instance of the Image class.

 [SampleCode]
 Pdf pdf = new Pdf();
 Section sec1 = pdf.getSections().add();
 Image img = new Image(sec1);
 img.setFile("http://www.aspose.com/images/banner-top-mid.gif");
 sec1.getParagraphs().add(img);
 

Parameters:
section - The section that owns the Iamge paragraph.
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from class: PdfElementBase
Clone an object.

Overrides:
clone in class Paragraph
Throws:
java.lang.CloneNotSupportedException
See Also:
java.lang.Object#clone()

getFile

public java.lang.String getFile()
Gets a string that indicates the image file name and its path.


setFile

public void setFile(java.lang.String file)
Sets a string that indicates the image file name and its path.

Parameters:
file - The file name to set.

getFixWidth

public float getFixWidth()
Getsa float value that indicates the fixed width of the image.
If this property is set, the image will be scaled to the fixed width.


setFixWidth

public void setFixWidth(float width)
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:
width - The fix Width to set.

getImageAlignment

public int getImageAlignment()
Gets an Alignment Type that indicates the image alignment type.

See Also:
AlignmentType

setImageAlignment

public void setImageAlignment(int alignment)
Sets an Alignment Type that indicates the image alignment type.

See Also:
AlignmentType

getHyperLink

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


setHyperLink

public void setHyperLink(HyperLink link)
                  throws java.lang.CloneNotSupportedException
Sets a Hyperlink object that indicates the hyper link info of the image.

Throws:
java.lang.CloneNotSupportedException
See Also:
HyperLink

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 spefity the image width
when there is no height info in image,e.g., image on the web.


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 spefity the image width
when there is no height info in image,e.g., image on the web.

Parameters:
height - The height to set.

getImageWidth

public float getImageWidth()
Gets a float value that indicates the image width. This property
is not used to control the image width but used to spefity the image width
when there is no width info in image,e.g.,image on the web.


setImageWidth

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

Parameters:
width - The width to set.

getDOMElement

public org.w3c.dom.Element getDOMElement()
                                  throws AsposeBaseException
Description copied from class: PdfElementBase
Gets a DOM representation of the pdf element.

Overrides:
getDOMElement in class Paragraph
Throws:
AsposeBaseException
See Also:
PdfElementBase.getDOMElement()