Spaceable
, Element
, IAccessibleElement
public class PdfDiv extends java.lang.Object implements Element, Spaceable, IAccessibleElement
Modifier and Type | Class | Description |
---|---|---|
static class |
PdfDiv.BorderTopStyle |
|
static class |
PdfDiv.DisplayType |
|
static class |
PdfDiv.FloatType |
|
static class |
PdfDiv.PositionType |
Modifier and Type | Field | Description |
---|---|---|
protected java.util.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 | Description |
---|---|
PdfDiv() |
Modifier and Type | Method | Description |
---|---|---|
void |
addElement(Element element) |
|
PdfObject |
getAccessibleAttribute(PdfName key) |
Get the attribute of accessible element (everything in
A dictionary + Lang , Alt , ActualText , E ). |
java.util.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() |
|
java.lang.Float |
getBottom() |
|
java.util.List<Chunk> |
getChunks() |
Gets all the chunks in this element.
|
java.util.ArrayList<Element> |
getContent() |
|
float |
getContentHeight() |
|
float |
getContentWidth() |
|
PdfDiv.DisplayType |
getDisplay() |
|
PdfDiv.FloatType |
getFloatType() |
|
java.lang.Float |
getHeight() |
|
AccessibleElementId |
getId() |
|
boolean |
getKeepTogether() |
|
java.lang.Float |
getLeft() |
|
float |
getPaddingBottom() |
|
float |
getPaddingLeft() |
|
float |
getPaddingRight() |
|
float |
getPaddingTop() |
|
java.lang.Float |
getPercentageHeight() |
|
java.lang.Float |
getPercentageWidth() |
|
PdfDiv.PositionType |
getPosition() |
|
java.lang.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.
|
java.lang.Float |
getTop() |
|
java.lang.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(java.lang.Float bottom) |
|
void |
setContent(java.util.ArrayList<Element> content) |
|
void |
setContentHeight(float contentHeight) |
|
void |
setContentWidth(float contentWidth) |
|
void |
setDisplay(PdfDiv.DisplayType display) |
|
void |
setFloatType(PdfDiv.FloatType floatType) |
|
void |
setHeight(java.lang.Float height) |
|
void |
setId(AccessibleElementId id) |
|
void |
setKeepTogether(boolean keepTogether) |
|
void |
setLeft(java.lang.Float left) |
|
void |
setPaddingBottom(float paddingBottom) |
|
void |
setPaddingLeft(float paddingLeft) |
|
void |
setPaddingRight(float paddingRight) |
|
void |
setPaddingTop(float paddingTop) |
|
void |
setPercentageHeight(java.lang.Float percentageHeight) |
|
void |
setPercentageWidth(java.lang.Float percentageWidth) |
|
void |
setPosition(PdfDiv.PositionType position) |
|
void |
setRight(java.lang.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(java.lang.Float top) |
|
void |
setWidth(java.lang.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 java.lang.Float getPercentageHeight()
public void setPercentageHeight(java.lang.Float percentageHeight)
public java.lang.Float getPercentageWidth()
public void setPercentageWidth(java.lang.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 java.util.List<Chunk> getChunks()
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 spacingpublic void setSpacingAfter(float spacing)
setSpacingAfter
in interface Spaceable
spacing
- the new spacingpublic float getSpacingBefore()
getSpacingBefore
in interface Spaceable
public float getSpacingAfter()
getSpacingAfter
in interface Spaceable
public int getTextAlignment()
public void setTextAlignment(int textAlignment)
textAlignment
- the new alignmentpublic void addElement(Element element)
public java.lang.Float getLeft()
public void setLeft(java.lang.Float left)
public java.lang.Float getRight()
public void setRight(java.lang.Float right)
public java.lang.Float getTop()
public void setTop(java.lang.Float top)
public java.lang.Float getBottom()
public void setBottom(java.lang.Float bottom)
public java.lang.Float getWidth()
public void setWidth(java.lang.Float width)
public java.lang.Float getHeight()
public void setHeight(java.lang.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 java.util.ArrayList<Element> getContent()
public void setContent(java.util.ArrayList<Element> content)
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 java.util.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–2018. All rights reserved.