public class PdfDiv extends Object implements Element, Spaceable, IAccessibleElement
Modifier and Type | Class and Description |
---|---|
static class |
PdfDiv.BorderTopStyle |
static class |
PdfDiv.DisplayType |
static class |
PdfDiv.FloatType |
static class |
PdfDiv.PositionType |
Modifier and Type | Field and Description |
---|---|
protected HashMap<PdfName,PdfObject> |
accessibleAttributes |
protected AccessibleElementId |
id |
protected PdfName |
role |
protected int |
runDirection |
protected float |
spacingAfter
The spacing after the table.
|
protected float |
spacingBefore
The spacing before the table.
|
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, BODY, 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 and Description |
---|
PdfDiv() |
Modifier and Type | Method and Description |
---|---|
void |
addElement(Element element) |
PdfObject |
getAccessibleAttribute(PdfName key)
Get the attribute of accessible element (everything in A dictionary + Lang , Alt , ActualText , E ).
|
HashMap<PdfName,PdfObject> |
getAccessibleAttributes()
Gets all the properties of accessible element.
|
float |
getActualHeight()
IMPROTANT NOTE: be careful with this method because it would return correct result only in case if layout(PdfContentByte, boolean, boolean, float, float, float, float) was already called.
|
float |
getActualWidth()
IMPROTANT NOTE: be careful with this method because it would return correct result only in case if layout(PdfContentByte, boolean, boolean, float, float, float, float) was already called.
|
BaseColor |
getBackgroundColor() |
PdfDiv.BorderTopStyle |
getBorderTopStyle() |
Float |
getBottom() |
List<Chunk> |
getChunks()
Gets all the chunks in this element.
|
ArrayList<Element> |
getContent() |
float |
getContentHeight() |
float |
getContentWidth() |
PdfDiv.DisplayType |
getDisplay() |
PdfDiv.FloatType |
getFloatType() |
Float |
getHeight() |
AccessibleElementId |
getId() |
boolean |
getKeepTogether() |
Float |
getLeft() |
float |
getPaddingBottom() |
float |
getPaddingLeft() |
float |
getPaddingRight() |
float |
getPaddingTop() |
Float |
getPercentageHeight() |
Float |
getPercentageWidth() |
PdfDiv.PositionType |
getPosition() |
Float |
getRight() |
PdfName |
getRole()
Gets the role of the accessible element.
|
int |
getRunDirection() |
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() |
float |
getYLine() |
boolean |
isContent()
Checks if this element is a content object.
|
boolean |
isInline() |
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 |
setAccessibleAttribute(PdfName key, PdfObject value)
Set the attribute of accessible element (everything in A dictionary + Lang , Alt , ActualText , E ).
|
void |
setBackgroundColor(BaseColor backgroundColor) |
void |
setBackgroundImage(Image image)
Image will be scaled to fit in the div occupied area.
|
void |
setBackgroundImage(Image image, float width, float height)
Image will be scaled to fit in the div occupied area.
|
void |
setBorderTopStyle(PdfDiv.BorderTopStyle borderTopStyle) |
void |
setBottom(Float bottom) |
void |
setContent(ArrayList<Element> content) |
void |
setContentHeight(float contentHeight) |
void |
setContentWidth(float contentWidth) |
void |
setDisplay(PdfDiv.DisplayType display) |
void |
setFloatType(PdfDiv.FloatType floatType) |
void |
setHeight(Float height) |
void |
setId(AccessibleElementId id) |
void |
setKeepTogether(boolean keepTogether) |
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 |
setRole(PdfName role)
Sets the role of the accessiblee element.
|
void |
setRunDirection(int runDirection) |
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.
|
protected int runDirection
protected PdfName role
protected AccessibleElementId id
protected float spacingBefore
protected float spacingAfter
public float getContentWidth()
public void setContentWidth(float contentWidth)
public float getContentHeight()
public void setContentHeight(float contentHeight)
public float getActualHeight()
layout(PdfContentByte, boolean, boolean, float, float, float, float)
was already called.
public float getActualWidth()
layout(PdfContentByte, boolean, boolean, float, float, float, float)
was already called.
public Float getPercentageHeight()
public void setPercentageHeight(Float percentageHeight)
public Float getPercentageWidth()
public void setPercentageWidth(Float percentageWidth)
public PdfDiv.DisplayType getDisplay()
public void setDisplay(PdfDiv.DisplayType display)
public BaseColor getBackgroundColor()
public void setBackgroundColor(BaseColor backgroundColor)
public void setBackgroundImage(Image image)
public void setBackgroundImage(Image image, float width, float height)
public float getYLine()
public int getRunDirection()
public void setRunDirection(int runDirection)
public boolean getKeepTogether()
public void setKeepTogether(boolean keepTogether)
public int type()
public boolean isContent()
Element
isContent
in interface Element
Element.isContent()
public boolean isNestable()
Element
isNestable
in interface Element
Element.isNestable()
public boolean process(ElementListener listener)
ElementListener
.
public void setSpacingBefore(float spacing)
setSpacingBefore
in interface Spaceable
spacing
- the new spacing
public void setSpacingAfter(float spacing)
setSpacingAfter
in interface Spaceable
spacing
- the new spacing
public float getSpacingBefore()
getSpacingBefore
in interface Spaceable
public float getSpacingAfter()
getSpacingAfter
in interface Spaceable
public int getTextAlignment()
public void setTextAlignment(int textAlignment)
textAlignment
- the new alignment
public void addElement(Element element)
public Float getLeft()
public void setLeft(Float left)
public Float getRight()
public void setRight(Float right)
public Float getTop()
public void setTop(Float top)
public Float getBottom()
public void setBottom(Float bottom)
public Float getWidth()
public void setWidth(Float width)
public Float getHeight()
public void setHeight(Float height)
public float getPaddingLeft()
public void setPaddingLeft(float paddingLeft)
public float getPaddingRight()
public void setPaddingRight(float paddingRight)
public float getPaddingTop()
getPaddingTop
in interface Spaceable
public void setPaddingTop(float paddingTop)
setPaddingTop
in interface Spaceable
public float getPaddingBottom()
public void setPaddingBottom(float paddingBottom)
public PdfDiv.FloatType getFloatType()
public void setFloatType(PdfDiv.FloatType floatType)
public PdfDiv.PositionType getPosition()
public void setPosition(PdfDiv.PositionType position)
public PdfDiv.BorderTopStyle getBorderTopStyle()
public void setBorderTopStyle(PdfDiv.BorderTopStyle borderTopStyle)
public int layout(PdfContentByte canvas, boolean useAscender, boolean simulate, float llx, float lly, float urx, float ury) throws DocumentException
DocumentException
public PdfObject getAccessibleAttribute(PdfName key)
IAccessibleElement
A
dictionary + Lang
, Alt
, ActualText
, E
).
getAccessibleAttribute
in interface IAccessibleElement
public void setAccessibleAttribute(PdfName key, PdfObject value)
IAccessibleElement
A
dictionary + Lang
, Alt
, ActualText
, E
).
setAccessibleAttribute
in interface IAccessibleElement
public HashMap<PdfName,PdfObject> getAccessibleAttributes()
IAccessibleElement
getAccessibleAttributes
in interface IAccessibleElement
public PdfName getRole()
IAccessibleElement
getRole
in interface IAccessibleElement
public void setRole(PdfName role)
IAccessibleElement
null
if you don't want to tag this element. Note that all child elements won't also be tagged.
setRole
in interface IAccessibleElement
public AccessibleElementId getId()
getId
in interface IAccessibleElement
public void setId(AccessibleElementId id)
setId
in interface IAccessibleElement
public boolean isInline()
isInline
in interface IAccessibleElement
Copyright © 1998–2019. All rights reserved.