com.aspose.pdf.elements
Class Heading

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

public class Heading
extends Paragraph

Represents a heading in Pdf document.

 [SampleCode]
 Heading heading1 = new Heading(sec1,1,null,"this level1 heading");
 Heading heading2 = new Heading(sec1,2,null,"this level2 heading");
 Heading heading3 = new Heading(sec1,3,null,"this level3 heading");
 sec1.getParagraphs().add(heading1);
 sec1.getParagraphs().add(heading2);
 sec1.getParagraphs().add(heading3);
 


Constructor Summary
Heading(Pdf pdf, Section section, int level)
          Initializes an object of Heading class.
 
Method Summary
 Segment getContent()
          Gets the body of the head.
 org.w3c.dom.Element getDOMElement()
          Gets a DOM representation of the pdf element.
 int getHeadingLevel()
          Gets an int value that indicates the level of the heading.
 int getHeadingType()
          Gets the HeadingType of this heading.
 float getLabelWidth()
          Gets a float value that indicates the width of the label of the heading.
 int getStartNumber()
          Gets a int number that indicates the start number of this heading when using auto numbering.
 Segment getUserLabel()
          Gets a string that indicates the caption label.
 boolean isAutoSequence()
          Gets a bool value that indicates whether the number
of the heading is in an automatical sequence.
 boolean isPrefixed()
          Gets a bool value that indicates if the prefix of the number
is shown when using auto sequence.
 Heading setContent(Segment content)
          Sets the body of the head.
 Heading setHeadingLevel(int level)
          Sets an int value that indicates the level of the heading.
 Heading setHeadingType(int type)
          Sets the HeadingType of this heading.
 Heading setIsAutoSequence(boolean autoSequence)
          Sets a bool value that indicates whether the number
of the heading is in an automatical sequence.
 Heading setIsPrefixed(boolean prefixed)
          Sets a bool value that indicates if the prefix of the number
is shown when using auto sequence.
 Heading setLabelWidth(float width)
          Sets a float value that indicates the width of the label of the heading.
 Heading setStartNumber(int number)
          Sets a int number that indicates the start number of this heading when using auto numbering.
 Heading setUserLabel(Segment label)
          Gets a string that indicates the caption label.
 
Methods inherited from class com.aspose.pdf.elements.Paragraph
clone, getLeft, getMargin, getTop, isDisabled, isFirstParagraph, isKeptTogether, isOnOddPage, setDisabled, setFirstParagraph, setKeptTogether, setLeft, setMargin, setOnOddPage, setTop
 
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

Heading

public Heading(Pdf pdf,
               Section section,
               int level)
        throws AsposeBaseException
Initializes an object of Heading class.

Parameters:
pdf - The pdf that owns the Section.
section - The section that the Heading will inherits the text info.
level - The level of the heading.
Throws:
AsposeBaseException
Method Detail

getHeadingType

public int getHeadingType()
Gets the HeadingType of this heading. The default is HeadingType.Arab.

Returns:
Returns the heading type.
See Also:
HeadingType

setHeadingType

public Heading setHeadingType(int type)
Sets the HeadingType of this heading.

Parameters:
type - The heading type to set.

isAutoSequence

public boolean isAutoSequence()
Gets a bool value that indicates whether the number
of the heading is in an automatical sequence. The default value is true.


setIsAutoSequence

public Heading setIsAutoSequence(boolean autoSequence)
Sets a bool value that indicates whether the number
of the heading is in an automatical sequence.


isPrefixed

public boolean isPrefixed()
Gets a bool value that indicates if the prefix of the number
is shown when using auto sequence. For example,for a label "1.2.5",
if this property is set to false, the label will be "5". The default value is true.


setIsPrefixed

public Heading setIsPrefixed(boolean prefixed)
Sets a bool value that indicates if the prefix of the number
is shown when using auto sequence. For example,for a label "1.2.5",
if this property is set to false, the label will be "5".


getHeadingLevel

public int getHeadingLevel()
Gets an int value that indicates the level of the heading.

Returns:
Returns the level.

setHeadingLevel

public Heading setHeadingLevel(int level)
Sets an int value that indicates the level of the heading.


getStartNumber

public int getStartNumber()
Gets a int number that indicates the start number of this heading when using auto numbering.

Returns:
Returns the Start number.

setStartNumber

public Heading setStartNumber(int number)
Sets a int number that indicates the start number of this heading when using auto numbering.

Parameters:
number - The start number to set.

getUserLabel

public Segment getUserLabel()
Gets a string that indicates the caption label. For example, UserLabel="1.3.5". Set this property to 'bullet1','bullet2'...'bullet7' to use system-defined bullet. To use user defined lebel, Set the BulletFontName to "Symbol" and "ZapfDingbats" and set this property to the char value of the bullt symbol. For example, UserLable="44" and BulletFontName="ZapfDingbats".

Returns:
Returns the UserLabel.

setUserLabel

public Heading setUserLabel(Segment label)
Gets a string that indicates the caption label. For example, UserLabel="1.3.5". Set this property to 'bullet1','bullet2'...'bullet7' to use system-defined bullet. To use user defined lebel, Set the BulletFontName to "Symbol" and "ZapfDingbats" and set this property to the char value of the bullt symbol. For example, UserLable="44" and BulletFontName="ZapfDingbats".

Parameters:
label - The UserLabel to set.

getLabelWidth

public float getLabelWidth()
Gets a float value that indicates the width of the label of the heading.

Returns:
Returns the LabelWidth.

setLabelWidth

public Heading setLabelWidth(float width)
Sets a float value that indicates the width of the label of the heading.

Parameters:
width - The LabelWidth to set.

getContent

public Segment getContent()
Gets the body of the head.


setContent

public Heading setContent(Segment content)
Sets the body of the head.


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()