public class Paragraph extends Phrase
Paragraph is a series of Chunks and/or Phrases.
A Paragraph has the same qualities of a Phrase, but also
some additional layout-parameters:
Paragraph p = new Paragraph("This is a paragraph",
FontFactory.getFont(FontFactory.HELVETICA, 18, Font.BOLDITALIC, new Color(0, 0, 255)));
Element,
Phrase,
ListItem,
Serialized FormmodCountALIGN_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, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LIST, LISTITEM, MARKED, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE, YMARK| Constructor and Description |
|---|
Paragraph()
Constructs a
Paragraph. |
Paragraph(Chunk chunk)
Constructs a
Paragraph with a certain Chunk. |
Paragraph(Phrase phrase)
Constructs a
Paragraph with a certain Phrase. |
Paragraph(String string)
Constructs a
Paragraph with a certain String. |
Paragraph(String string,
Font font)
Constructs a
Paragraph with a certain String
and a certain Font. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Object o)
Adds an
Object to the Paragraph. |
int |
getAlignment()
Gets the alignment of this paragraph.
|
float |
getExtraParagraphSpace()
Getter for property extraParagraphSpace.
|
float |
getFirstLineIndent()
Getter for property firstLineIndent.
|
float |
getIndentationLeft()
Gets the indentation of this paragraph on the left side.
|
float |
getIndentationRight()
Gets the indentation of this paragraph on the right side.
|
boolean |
getKeepTogether()
Checks if this paragraph has to be kept together on one page.
|
float |
getMultipliedLeading()
Gets the variable leading
|
float |
getSpacingAfter()
Gets the spacing after this paragraph.
|
float |
getSpacingBefore()
Gets the spacing before this paragraph.
|
float |
getTotalLeading()
Gets the total leading.
|
void |
setAlignment(int alignment)
Sets the alignment of this paragraph.
|
void |
setAlignment(String alignment)
Sets the alignment of this paragraph.
|
void |
setExtraParagraphSpace(float extraParagraphSpace)
Setter for property extraParagraphSpace.
|
void |
setFirstLineIndent(float firstLineIndent)
Setter for property firstLineIndent.
|
void |
setIndentationLeft(float indentation)
Sets the indentation of this paragraph on the left side.
|
void |
setIndentationRight(float indentation)
Sets the indentation of this paragraph on the right side.
|
void |
setKeepTogether(boolean keeptogether)
Indicates that the paragraph has to be kept together on one page.
|
void |
setLeading(float fixedLeading)
Sets the leading of this phrase.
|
void |
setMultipliedLeading(float multipliedLeading)
Sets the variable leading.
|
void |
setSpacingAfter(float spacing)
Sets the spacing after this paragraph.
|
void |
setSpacingBefore(float spacing)
Sets the spacing before this paragraph.
|
int |
type()
Gets the type of the text element.
|
add, addAll, addSpecial, getChunks, getContent, getFont, getHyphenation, getLeading, isContent, isEmpty, isNestable, process, setFont, setHyphenationaddAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeequals, hashCodecontainsAll, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcontainsAll, equals, hashCodeparallelStream, streampublic Paragraph()
Paragraph.public Paragraph(Chunk chunk)
Paragraph with a certain Chunk.chunk - a Chunkpublic Paragraph(String string)
Paragraph with a certain String.string - a Stringpublic Paragraph(String string, Font font)
Paragraph with a certain String
and a certain Font.string - a Stringfont - a Fontpublic Paragraph(Phrase phrase)
Paragraph with a certain Phrase.phrase - a Phrasepublic int type()
public boolean add(Object o)
Object to the Paragraph.add in interface TextElementArrayadd in interface Collectionadd in interface Listadd in class Phraseo - object the object to add.public void setAlignment(int alignment)
alignment - the new alignmentpublic void setAlignment(String alignment)
alignment - the new alignment as a Stringpublic void setLeading(float fixedLeading)
PhrasesetLeading in class PhrasefixedLeading - the new leadingPhrase.setLeading(float)public void setMultipliedLeading(float multipliedLeading)
multipliedLeading - the variable leadingpublic void setIndentationLeft(float indentation)
indentation - the new indentationpublic void setIndentationRight(float indentation)
indentation - the new indentationpublic void setFirstLineIndent(float firstLineIndent)
firstLineIndent - New value of property firstLineIndent.public void setSpacingBefore(float spacing)
spacing - the new spacingpublic void setSpacingAfter(float spacing)
spacing - the new spacingpublic void setKeepTogether(boolean keeptogether)
keeptogether - true of the paragraph may not be split over 2 pagespublic boolean getKeepTogether()
public int getAlignment()
public float getMultipliedLeading()
public float getTotalLeading()
public float getIndentationLeft()
public float getIndentationRight()
public float getFirstLineIndent()
public float getSpacingBefore()
public float getSpacingAfter()
public float getExtraParagraphSpace()
public void setExtraParagraphSpace(float extraParagraphSpace)
extraParagraphSpace - New value of property extraParagraphSpace.Copyright © 2021. All rights reserved.