com.itextpdf.text.pdf
Class PdfDiv

java.lang.Object
  extended by com.itextpdf.text.pdf.PdfDiv
All Implemented Interfaces:
Spaceable, Element

public class PdfDiv
extends Object
implements Element, Spaceable

A special element to put a collection of elements at an absolute position.


Nested Class Summary
static class PdfDiv.FloatType
           
static class PdfDiv.PositionType
           
 
Field Summary
protected  float spacingAfter
          The spacing after the table.
protected  float spacingBefore
          The spacing before the table.
 
Fields inherited from interface com.itextpdf.text.Element
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CHAPTER, CHUNK, CREATIONDATE, CREATOR, DIV, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LANGUAGE, LIST, LISTITEM, MARKED, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, SECTION, SUBJECT, TITLE, WRITABLE_DIRECT, YMARK
 
Constructor Summary
PdfDiv()
           
 
Method Summary
 void addElement(Element element)
           
 float getActualHeight()
           
 float getActualWidth()
           
 BaseColor getBackgroundColor()
           
 Float getBottom()
           
 List<Chunk> getChunks()
          Gets all the chunks in this element.
 ArrayList<Element> getContent()
           
 float getContentHeight()
           
 float getContentWidth()
           
 PdfDiv.FloatType getFloatType()
           
 Float getHeight()
           
 Float getLeft()
           
 float getPaddingBottom()
           
 float getPaddingLeft()
           
 float getPaddingRight()
           
 float getPaddingTop()
           
 Float getPercentageHeight()
           
 Float getPercentageWidth()
           
 PdfDiv.PositionType getPosition()
           
 Float getRight()
           
 float getSpacingAfter()
          Gets the spacing after this table.
 float getSpacingBefore()
          Gets the spacing before this table.
 int getTextAlignment()
          Gets the alignment of this paragraph.
 Float getTop()
           
 Float getWidth()
           
 boolean isContent()
          Checks if this element is a content object.
 boolean isNestable()
          Checks if this element is nestable.
 int layout(PdfContentByte canvas, boolean useAscender, boolean simulate, float llx, float lly, float urx, float ury)
           
 boolean process(ElementListener listener)
          Processes the element by adding it (or the different parts) to an ElementListener.
 void setBackgroundColor(BaseColor backgroundColor)
           
 void setBottom(Float bottom)
           
 void setContent(ArrayList<Element> content)
           
 void setContentHeight(float contentHeight)
           
 void setContentWidth(float contentWidth)
           
 void setFloatType(PdfDiv.FloatType floatType)
           
 void setHeight(Float height)
           
 void setLeft(Float left)
           
 void setPaddingBottom(float paddingBottom)
           
 void setPaddingLeft(float paddingLeft)
           
 void setPaddingRight(float paddingRight)
           
 void setPaddingTop(float paddingTop)
           
 void setPercentageHeight(Float percentageHeight)
           
 void setPercentageWidth(Float percentageWidth)
           
 void setPosition(PdfDiv.PositionType position)
           
 void setRight(Float right)
           
 void setSpacingAfter(float spacing)
          Sets the spacing after this table.
 void setSpacingBefore(float spacing)
          Sets the spacing before this table.
 void setTextAlignment(int textAlignment)
          Sets the alignment of this paragraph.
 void setTop(Float top)
           
 void setWidth(Float width)
           
 int type()
          Gets the type of the text element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.itextpdf.text.Element
toString
 

Field Detail

spacingBefore

protected float spacingBefore
The spacing before the table.


spacingAfter

protected float spacingAfter
The spacing after the table.

Constructor Detail

PdfDiv

public PdfDiv()
Method Detail

getContentWidth

public float getContentWidth()

setContentWidth

public void setContentWidth(float contentWidth)

getContentHeight

public float getContentHeight()

setContentHeight

public void setContentHeight(float contentHeight)

getActualHeight

public float getActualHeight()

getActualWidth

public float getActualWidth()

getPercentageHeight

public Float getPercentageHeight()

setPercentageHeight

public void setPercentageHeight(Float percentageHeight)

getPercentageWidth

public Float getPercentageWidth()

setPercentageWidth

public void setPercentageWidth(Float percentageWidth)

getBackgroundColor

public BaseColor getBackgroundColor()

setBackgroundColor

public void setBackgroundColor(BaseColor backgroundColor)

getChunks

public List<Chunk> getChunks()
Gets all the chunks in this element.

Specified by:
getChunks in interface Element
Returns:
an ArrayList

type

public int type()
Gets the type of the text element.

Specified by:
type in interface Element
Returns:
a type

isContent

public boolean isContent()
Description copied from interface: Element
Checks if this element is a content object. If not, it's a metadata object.

Specified by:
isContent in interface Element
Returns:
true if this is a 'content' element; false if this is a 'metadata' element
Since:
iText 2.0.8
See Also:
Element.isContent()

isNestable

public boolean isNestable()
Description copied from interface: Element
Checks if this element is nestable.

Specified by:
isNestable in interface Element
Returns:
true if this element can be nested inside other elements.
Since:
iText 2.0.8
See Also:
Element.isNestable()

process

public boolean process(ElementListener listener)
Processes the element by adding it (or the different parts) to an ElementListener.

Specified by:
process in interface Element
Parameters:
listener - an ElementListener
Returns:
true if the element was processed successfully

setSpacingBefore

public void setSpacingBefore(float spacing)
Sets the spacing before this table.

Specified by:
setSpacingBefore in interface Spaceable
Parameters:
spacing - the new spacing

setSpacingAfter

public void setSpacingAfter(float spacing)
Sets the spacing after this table.

Specified by:
setSpacingAfter in interface Spaceable
Parameters:
spacing - the new spacing

getSpacingBefore

public float getSpacingBefore()
Gets the spacing before this table.

Specified by:
getSpacingBefore in interface Spaceable
Returns:
the spacing

getSpacingAfter

public float getSpacingAfter()
Gets the spacing after this table.

Specified by:
getSpacingAfter in interface Spaceable
Returns:
the spacing

getTextAlignment

public int getTextAlignment()
Gets the alignment of this paragraph.

Returns:
textAlignment

setTextAlignment

public void setTextAlignment(int textAlignment)
Sets the alignment of this paragraph.

Parameters:
textAlignment - the new alignment

addElement

public void addElement(Element element)

getLeft

public Float getLeft()

setLeft

public void setLeft(Float left)

getRight

public Float getRight()

setRight

public void setRight(Float right)

getTop

public Float getTop()

setTop

public void setTop(Float top)

getBottom

public Float getBottom()

setBottom

public void setBottom(Float bottom)

getWidth

public Float getWidth()

setWidth

public void setWidth(Float width)

getHeight

public Float getHeight()

setHeight

public void setHeight(Float height)

getPaddingLeft

public float getPaddingLeft()

setPaddingLeft

public void setPaddingLeft(float paddingLeft)

getPaddingRight

public float getPaddingRight()

setPaddingRight

public void setPaddingRight(float paddingRight)

getPaddingTop

public float getPaddingTop()

setPaddingTop

public void setPaddingTop(float paddingTop)

getPaddingBottom

public float getPaddingBottom()

setPaddingBottom

public void setPaddingBottom(float paddingBottom)

getFloatType

public PdfDiv.FloatType getFloatType()

setFloatType

public void setFloatType(PdfDiv.FloatType floatType)

getPosition

public PdfDiv.PositionType getPosition()

setPosition

public void setPosition(PdfDiv.PositionType position)

getContent

public ArrayList<Element> getContent()

setContent

public void setContent(ArrayList<Element> content)

layout

public int layout(PdfContentByte canvas,
                  boolean useAscender,
                  boolean simulate,
                  float llx,
                  float lly,
                  float urx,
                  float ury)
           throws DocumentException
Throws:
DocumentException


Copyright © 2012. All Rights Reserved.