public class ListLevelFormat extends Object
An object to define the format of the list of some level.
[C#] // Create a Pdf object Pdf pdf = new Pdf(); //Create a list section ListSection tocSection = new ListSection("Table Of Contents"); //Set its list type as table of of contents tocSection.ListType = ListType.TableOfContents; //Define the format of the four levels list by setting the left margins and //text format settings of each level tocSection.ListFormatArray.Length = 4; // specify the left margin information for list element at level 0 tocSection.ListFormatArray[0].LeftMargin = 0; tocSection.ListFormatArray[0].TextInfo.IsTrueTypeFontBold = true; tocSection.ListFormatArray[0].TextInfo.IsTrueTypeFontItalic = true; tocSection.ListFormatArray[0].TextInfo.Color = new Aspose.Pdf.Generator.Color("Navy"); tocSection.ListFormatArray[1].LeftMargin = 10; tocSection.ListFormatArray[1].TextInfo.IsUnderline = true; tocSection.ListFormatArray[1].TextInfo.FontSize = 10; tocSection.ListFormatArray[2].LeftMargin = 20; tocSection.ListFormatArray[2].TextInfo.IsTrueTypeFontBold = true; tocSection.ListFormatArray[3].LeftMargin = 30; tocSection.ListFormatArray[3].TextInfo.IsTrueTypeFontBold = true; //Add the list section to the sections collection of the Pdf document pdf.Sections.Add(tocSection); //Create a section in the Pdf document Aspose.Pdf.Generator.Section sec1 = pdf.Sections.Add(); //Add four headings in the section for (int Level = 1; Level != 5; Level++) { // create heading object and add set its level Heading heading2 = new Heading(pdf, sec1, Level); // create a segment object and Segment segment2 = new Segment(heading2); // add the segment object to segments collection of Heading heading2.Segments.Add(segment2); // Set the property so that number of the heading is in an automatical sequence. heading2.IsAutoSequence = true; // Specify the content of Heading segment2.Content = "this is heading of level "; segment2.Content += Level.ToString(); //Add the heading into Table Of Contents. heading2.IsInList = true; // add the heading to paragraphs collection of PDF section sec1.Paragraphs.Add(heading2); } // save the PDF document pdf.Save(
Constructor and Description |
---|
ListLevelFormat() |
Modifier and Type | Method and Description |
---|---|
float |
getLeftMargin()
Gets or sets a float value that indicates the left margin of the list
of current level.
|
MarginInfo |
getMargin()
Gets or sets a
MarginInfo object that indicates the margin of
the list item. |
int |
getSubsequentLinesIndent()
Gets or sets a int value that indicates how many chars are indented
for the subsequent lines in the list item.
|
int |
getTabLeaderType()
Gets or sets a
TabLeaderType object that indicates the tab
leader type for the list. |
TextInfo |
getTextInfo()
Get or set the
TextInfo object of the list of current level. |
void |
setLeftMargin(float value) |
void |
setMargin(MarginInfo value) |
void |
setSubsequentLinesIndent(int value) |
void |
setTabLeaderType(int value) |
void |
setTextInfo(TextInfo value) |
public TextInfo getTextInfo()
Get or set the TextInfo
object of the list of current level.
public void setTextInfo(TextInfo value)
public float getLeftMargin()
Gets or sets a float value that indicates the left margin of the list
of current level. The unit is point. In XML,the default unit is point,but
cm and inch are also supported. For example,"10cm" or "5inch". <BLOCKQUOTE class="dtBlock">
<Font color="red">NOTE: This property is now obsolete.</Font></BLOCKQUOTE>
<BLOCKQUOTE class="dtBlock">
Please use Margin property instead.
It will be removed 12 months later since release 3.3.1.0 in January 2007. Aspose apologizes for
any inconvenience you may have experienced.</BLOCKQUOTE>
public void setLeftMargin(float value)
public MarginInfo getMargin()
Gets or sets a MarginInfo
object that indicates the margin of
the list item.
public void setMargin(MarginInfo value)
public int getTabLeaderType()
Gets or sets a TabLeaderType
object that indicates the tab
leader type for the list. The default value is "Dot".
public void setTabLeaderType(int value)
public int getSubsequentLinesIndent()
Gets or sets a int value that indicates how many chars are indented for the subsequent lines in the list item. The default value is 6.
public void setSubsequentLinesIndent(int value)
Copyright © 2016 Aspose. All Rights Reserved.