aspose.pdf
Class ListSection
java.lang.Object
aspose.pdf.Section
aspose.pdf.ListSection
public class ListSection
- extends Section
An object to display different lists.
Typical usages are the following:
[Java]
Pdf pdf = new Pdf();
ListSection tocsec = new ListSection("Table of contents");
pdf.getSections().add(tocsec);
Text text = tocsec.getTitle();
text.getSegments().getSegment(0).getTextInfo().setFontName("Helvetica");
text.getSegments().getSegment(0).getTextInfo().setFontSize(16);
text.getMargin().setBottom(20);
tocsec.getListFormatArray().setLength(4);
tocsec.getListFormatArray().getListLevelFormat(0).setLeftMargin(0);
tocsec.getListFormatArray().getListLevelFormat(0).getTextInfo().setFontName("Helvetica");
tocsec.getListFormatArray().getListLevelFormat(0).getTextInfo().setFontSize(24);
tocsec.getListFormatArray().getListLevelFormat(1).setLeftMargin(5);
tocsec.getListFormatArray().getListLevelFormat(1).getTextInfo().setFontName("Helvetica");
tocsec.getListFormatArray().getListLevelFormat(1).getTextInfo().setFontSize(20);
tocsec.getListFormatArray().getListLevelFormat(2).setLeftMargin(10);
tocsec.getListFormatArray().getListLevelFormat(2).getTextInfo().setFontName("Helvetica");
tocsec.getListFormatArray().getListLevelFormat(2).getTextInfo().setFontSize(14);
//tocsec.getListFormatArray().getListLevelFormat(2).getTextInfo().setIsTrueTypeFontBold(true);
tocsec.getListFormatArray().getListLevelFormat(3).setLeftMargin(15);
tocsec.getListFormatArray().getListLevelFormat(3).getTextInfo().setFontName("Helvetica");
tocsec.getListFormatArray().getListLevelFormat(3).getTextInfo().setFontSize(10);
//tocsec.getListFormatArray().getListLevelFormat(3).getTextInfo().setIsTrueTypeFontBold(true);
tocsec.setListType(ListType.TableOfContents);
Section sec = pdf.getSections().add();
for(int level = 1;level!=5;level++)
{
Heading heading2 = new Heading(pdf,sec,level);
Segment seg2 = new Segment(heading2);
heading2.getSegments().add(seg2);
heading2.setIsAutoSequence(true);
seg2.setContent("this is heading of level");
heading2.setIsInList(true);
sec.getParagraphs().add(heading2);
}
Table table1 = new Table();
sec.getParagraphs().add(table1);
table1.setColumnWidths("70 2cm");
table1.setTitle("Table 1");
Row row1 = table1.getRows().add();
Cell cellRow1 = row1.getCells().add("ColumnsSpan = 2");
cellRow1.setColumnsSpan(2);
cellRow1.setBorder(new BorderInfo(BorderSide.All.getValue(),0.5f));
Row row2 = table1.getRows().add();
Cell cell1Row2 = row2.getCells().add("cell1");
cell1Row2.setBorder(new BorderInfo(BorderSide.All.getValue(),0.5f));
Cell cell2Row2 = row2.getCells().add("cell2");
cell2Row2.setBorder(new BorderInfo(BorderSide.All.getValue(),0.5f,new Color("Red")));
table1.setIsInList(true);
Image image1 = new Image();
sec.getParagraphs().add(image1);
image1.getImageInfo().setFile("C:/118528527.jpg");
image1.getImageInfo().setImageFileType(ImageFileType.Jpeg);
GraphNote note1 = new GraphNote();
note1.setContent("This is a note1");
note1.setPosX(50);
note1.setPosY(100);
image1.getImageNotes().add(note1);
image1.setIsInList(true);
Graph graph1 = new Graph(400,400);
sec.getParagraphs().add(graph1);
float[] posArr = new float[]{0,0,200,80,300,40,350,90};
Curve curve1 = new Curve(graph1,posArr);
graph1.getShapes().add(curve1);
graph1.setIsInList(true);
pdf.save(....);
[XML]
TableOfContents
ListOfTables
ListOfFigures
this is heading of level 1
this is heading of level 2
this is heading of level 3
this is heading of level 4
ColumnsSpan = 2
|
cell1
|
cell2
|
this is note1
mm picture
one curve
Methods inherited from class aspose.pdf.Section |
addParagraph, clone, completeClone, getAdditionalEvenFooter, getAdditionalEvenHeader, getAdditionalOddFooter, getAdditionalOddHeader, getBackgroundColor, getBackgroundImageFile, getBackgroundImageFixedWidth, getBackgroundImageType, getColumnInfo, getEndNoteNumberInSection, getEvenFooter, getEvenHeader, getFirstLineIndent, getFootNoteNumberInPage, getFootNoteNumberInSection, getGraphInfo, getHasColumnLine, getID, getIsAutoHyphenated, getIsBackgroundImageBlackWhite, getIsDisabled, getIsEmpty, getIsFirstParaWritten, getIsFullPage, getIsHasNextColumnFlag, getIsInitialized, getIsLandscape, getIsNewColumn, getIsNewPage, getIsPageNumberRestarted, getIsSpaced, getIsWidowOrphanControlEnabled, getObjectByID, getOddFooter, getOddHeader, getPageCount, getPageInfo, getPageRotatingAngle, getParagraphs, getPdf, getStartingPageNumber, getTextInfo, getWatermark, insertFooter, insertHeader, isSameSize, setAdditionalEvenFooter, setAdditionalEvenHeader, setAdditionalOddFooter, setAdditionalOddHeader, setBackgroundColor, setBackgroundImageFile, setBackgroundImageFixedWidth, setBackgroundImageType, setColumnInfo, setEndNoteNumberInSection, setEvenFooter, setEvenHeader, setFirstLineIndent, setFootNoteNumberInPage, setFootNoteNumberInSection, setGraphInfo, setHasColumnLine, setID, setIsAutoHyphenated, setIsBackgroundImageBlackWhite, setIsDisabled, setIsFirstParaWritten, setIsFullPage, setIsHasNextColumnFlag, setIsInitialized, setIsLandscape, setIsNewColumn, setIsNewPage, setIsPageNumberRestarted, setIsSpaced, setIsWidowOrphanControlEnabled, setOddFooter, setOddHeader, setPageCount, setPageInfo, setPageRotatingAngle, setParagraphs, setPdf, setStartingPageNumber, setTextInfo, setWatemark |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ListSection
public ListSection(java.lang.String listTitle)
- Represents a
ListSection
action
- Parameters:
listTitle
-
ListSection
public ListSection(Pdf doc)
- Set the default title of listSection.
- Parameters:
doc
-
getTitle
public Text getTitle()
- Gets the
Text
value of the title of ListSection
.
setTitle
public void setTitle(Text value)
- Sets the
Text
value of the title of ListSection
.
- Parameters:
value
-
getIsCaptionLabelNeeded
public boolean getIsCaptionLabelNeeded()
- Gets a bool value that indicates whether caption label is needed in TOC.
setIsCaptionLabelNeeded
public void setIsCaptionLabelNeeded(boolean value)
- Sets a bool value that indicates whether caption label is needed in TOC.
- Parameters:
value
-
getListFormatArray
public FormatArray getListFormatArray()
- Gets the format of the lists of all levels using the
FormatArray
.
getListFormatArray
public void getListFormatArray(FormatArray value)
- Sets the format of the lists of all levels using the
FormatArray
.
- Parameters:
value
-
getListType
public ListType getListType()
- Gets the
ListType
of the ListSection
object.
setListType
public void setListType(ListType value)
- Sets the
ListType
of the ListSection
object.
- Parameters:
value
-
getInternalIdTag
public java.lang.String getInternalIdTag()
- Get tag of the internal Id.