public class Segments
extends com.aspose.ms.System.Collections.CollectionBase
Represents a collection of Segment
objects.
[C#] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.Sections.Add(); Text text1 = new Text(sec1,"seg1 "); sec1.Paragraphs.Add(text1); Segment seg2 = text1.Segments.Add("seg2"); seg2.TextInfo.Color = new Aspose.Pdf.Generator.Color("Red"); seg2.TextInfo.FontSize = 16; pdf1.Save(...); [Visual Basic] Dim pdf1 As Pdf = New Pdf() Dim sec1 As Section = pdf1.Sections.Add() Dim text1 As Text = New Text(sec1,"seg1 ") sec1.Paragraphs.Add(text1) Dim seg2 As Segment = text1.Segments.Add("seg2") seg2.TextInfo.Color = New Aspose.Pdf.Generator.Color("Red") seg2.TextInfo.FontSize = 16 pdf1.Save(...) [XML] <?xml version="1.0" encoding="utf-8" ?> <Pdf xmlns="Aspose.Pdf"> <Section> <Text> <Segment>seg1 </Segment> <Segment Color="Red" FontSize="16">seg2 </Segment> </Text> </Section> </Pdf>
Constructor and Description |
---|
Segments()
Initializes a new instance of the
Segments class. |
Modifier and Type | Method and Description |
---|---|
Segment |
add()
Initializes a new instance of the
Segment class and add it to the Segments collection |
void |
add(Segment segment)
Adds a new
Segment object into the collection. |
Segment |
add(String segmentString)
Initializes a new instance of the
Segment class and add it to the Segments collection |
void |
copyTo(Segment[] segmentArray,
int index)
Copies the elements to a
Segment object array, starting at a specified array index. |
Segment |
get_Item(int index)
Gets or sets a
Segment object from the collection according to Segment index. |
Segment |
get_Item(String segmentID)
Gets or sets a
Segment object from the collection according to Segment ID. |
int |
indexOf(Segment segment)
Gets the index of a specified
Segment object in the collection. |
void |
insert(int index,
Segment segment)
Inserts a new
Segment object into the collection at specified position. |
void |
insert(Segment segmentToInsertAfter,
Segment newSegment)
Inserts a new
Segment object into the collection after specified Segment object. |
void |
moveAfter(Segment segToMoveAfter,
Segments newSegments) |
void |
moveAt(int index,
Segments newSegments) |
void |
remove(Segment segmentToRemove)
Removes a
Segment object from the collection. |
void |
set_Item(int index,
Segment value) |
void |
set_Item(String segmentID,
Segment value) |
void |
setText(Text value) |
public void add(Segment segment)
Adds a new Segment
object into the collection.
segment
- The Segment
object to be added.public Segment add(String segmentString)
Initializes a new instance of the Segment
class and add it to the Segments collection
segmentString
- The string content of the segment.Segment
object.public Segment add()
Initializes a new instance of the Segment
class and add it to the Segments collection
Segment
object.public void setText(Text value)
public void insert(int index, Segment segment)
Inserts a new Segment
object into the collection at specified position.
index
- The zero-based index at which the Segment
object should be inserted.segment
- The Segment
object to be inserted.public void insert(Segment segmentToInsertAfter, Segment newSegment)
Inserts a new Segment
object into the collection after specified Segment object.
segmentToInsertAfter
- The Segment
object to insert after.newSegment
- The Segment
object to be inserted.public void remove(Segment segmentToRemove)
Removes a Segment
object from the collection.
segmentToRemove
- The Segment
object to be romoved.public void moveAt(int index, Segments newSegments)
public int indexOf(Segment segment)
Gets the index of a specified Segment
object in the collection.
segment
- The specified Segment
object.public void copyTo(Segment[] segmentArray, int index)
Copies the elements to a Segment
object array, starting at a specified array index.
segmentArray
- The Segment
object array.index
- The start index.public Segment get_Item(int index)
Gets or sets a Segment
object from the collection according to Segment index.
get_Item
in interface com.aspose.ms.System.Collections.IList
get_Item
in class com.aspose.ms.System.Collections.CollectionBase
public void set_Item(int index, Segment value)
public Segment get_Item(String segmentID)
Gets or sets a Segment
object from the collection according to Segment ID.
Copyright © 2016 Aspose. All Rights Reserved.