public class Segment extends Object implements IHyperlinkCarrier
Represents a segment in a Text
paragraph.
[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>
Modifier and Type | Class and Description |
---|---|
static class |
Segment.VerticalSegInfo
for Text MarginInfo
|
Modifier and Type | Field and Description |
---|---|
int |
_TabLeaderType |
float |
Descender |
boolean |
IsEmptySegInHeading |
boolean |
IsEndNoteNumber |
boolean |
IsFootNumber |
boolean |
IsNbSegment |
boolean |
IsNbsSymbol |
boolean |
IsNlSymbol |
boolean |
IsPositionGot |
boolean |
IsRefPageNumSymbol |
boolean |
IsSectionPageNumSymbol |
boolean |
IsSplitedFromLargeSeg |
boolean |
IsSymbol |
boolean |
IsTabSymbol |
boolean |
IsTotalPageNumSymbol |
boolean |
IsTotalSectionNextPageNumSymbol |
boolean |
IsTotalSectionPageNumSymbol |
int |
NextSegmentsUnderline
��segment�����뱾segment��fontsize��ͬ��������underline��segment�ĸ���
|
int |
PageNumber |
String |
TargetID |
Text |
Text |
int |
TogetherSegNumbers |
Segment.VerticalSegInfo |
VerticalSegPosInfo |
Constructor and Description |
---|
Segment() |
Segment(String content)
Initializes a new instance of the
Segment class. |
Segment(String content,
TextInfo info)
Initializes a new instance of the
Segment class. |
Segment(Text text)
Initializes a new instance of the
Segment class. |
Modifier and Type | Method and Description |
---|---|
Object |
completeClone()
Clones a new
Segment object. |
String |
getContent()
Gets or sets a string that indicates the content of the text segment.
|
String |
getDateFormat()
Gets or sets a string that indicates the date format of the
replaceable date symbol($D).
|
String |
getDefaultFontName()
The default font supports segment.Content.
|
EndNote |
getEndNote()
get or set the EndNote object that indicates the endnote of the
current segment.
|
LineBlock |
getFirstLineBlock() |
FootNote |
getFootNote()
get or set the FootNote object that indicates the footnote of the
current segment.
|
boolean |
getHaveFootNoteNumberInfo() |
float |
getHeight()
Gets or sets a float value that indicates the height of the segment.
|
Hyperlink |
getHostedHyperlink() |
Hyperlink |
getHyperlink()
Gets or sets a
Hyperlink object that indicates the hyper link
info of the segment. |
String |
getID()
Gets or sets a string that indicates the ID of the segment.
|
Paragraph |
getInlineParagraph()
Gets or sets a
Paragraph object that indicates the inline
paragraph. |
float |
getPosX()
Gets or sets a float value that indicates the x-coordinate of the
segment beginning position.
|
float |
getPosY()
Gets or sets a float value that indicates the y-coordinate of the
segment beginning position.
|
TextInfo |
getTextInfo()
Gets or sets a
TextInfo object that indicates the text info
of the segment. |
float |
getWidth()
Gets or sets a float value that indicates the width of the segment.
|
boolean |
hasRTLChar()
Get a value that indicates whether the segment has Arabic or Hebrew
character
|
boolean |
isAutoHyphenated()
Gets or sets a bool value that indicates whehter the text is
hyphenated automatically.
|
void |
isAutoHyphenated(boolean value) |
boolean |
isHyphenatable()
Gets or sets a bool value that indicates whehter the segment is can
be hyphenated.If the hyphenchar can not be inserted when hyphenating this
word,it is false.
|
void |
isHyphenatable(boolean value) |
boolean |
isNumeric()
Whether the segment is numeric
|
boolean |
isPageNumSymbol() |
void |
isPageNumSymbol(boolean value) |
boolean |
isSymbolReplaceable()
Whether replace symbols like $p or not.
|
void |
isSymbolReplaceable(boolean value) |
String |
isTogetherWithInlineImage()
Indicates whether the segment combine with Inline Image
|
void |
setContent(String value) |
void |
setDateFormat(String value) |
void |
setDefaultFontName(String value) |
void |
setEndNote(EndNote value) |
void |
setFirstLineBlock(LineBlock value) |
void |
setFootNote(FootNote value) |
void |
setHaveFootNoteNumberInfo(boolean value) |
void |
setHeight(float value) |
void |
setHyperlink(Hyperlink value) |
void |
setID(String value) |
void |
setInlineParagraph(Paragraph value) |
void |
setLanguageSort(String value) |
void |
setPosX(float value) |
void |
setPosY(float value) |
void |
setTextInfo(TextInfo value) |
void |
setWidth(float value) |
public boolean IsFootNumber
public boolean IsEndNoteNumber
public float Descender
public int NextSegmentsUnderline
��segment�����뱾segment��fontsize��ͬ��������underline��segment�ĸ���
public int PageNumber
public boolean IsEmptySegInHeading
public boolean IsSymbol
public boolean IsRefPageNumSymbol
public boolean IsSectionPageNumSymbol
public boolean IsTotalPageNumSymbol
public boolean IsTotalSectionPageNumSymbol
public boolean IsTotalSectionNextPageNumSymbol
public boolean IsNbsSymbol
public boolean IsNlSymbol
public boolean IsTabSymbol
public boolean IsNbSegment
public int _TabLeaderType
public boolean IsSplitedFromLargeSeg
public int TogetherSegNumbers
public boolean IsPositionGot
public String TargetID
public Segment.VerticalSegInfo VerticalSegPosInfo
public Text Text
public Segment()
public Segment(String content)
Initializes a new instance of the Segment
class.
content
- The content of the segment.public Segment(String content, TextInfo info)
Initializes a new instance of the Segment
class.
content
- The content of the segment.info
- The text format info of the segment.public Segment(Text text)
Initializes a new instance of the Segment
class.
text
- Text
object. public boolean getHaveFootNoteNumberInfo()
public void setHaveFootNoteNumberInfo(boolean value)
public boolean isAutoHyphenated()
Gets or sets a bool value that indicates whehter the text is hyphenated automatically.
public void isAutoHyphenated(boolean value)
public boolean isHyphenatable()
Gets or sets a bool value that indicates whehter the segment is can be hyphenated.If the hyphenchar can not be inserted when hyphenating this word,it is false.
public void isHyphenatable(boolean value)
public TextInfo getTextInfo()
Gets or sets a TextInfo
object that indicates the text info
of the segment.
public void setTextInfo(TextInfo value)
public FootNote getFootNote()
get or set the FootNote object that indicates the footnote of the current segment.
public void setFootNote(FootNote value)
public EndNote getEndNote()
get or set the EndNote object that indicates the endnote of the current segment.
public void setEndNote(EndNote value)
public String getContent()
Gets or sets a string that indicates the content of the text segment.
public void setContent(String value)
public String getDateFormat()
Gets or sets a string that indicates the date format of the replaceable date symbol($D). It's value can be "d", "D", "f", "F","g", "G","m","r","s","t", "T","u", "U","y","dddd, MMMM dd yyyy","ddd, MMM d \"'\"yy","dddd, MMMM dd","M/yy","dd-MM-yy". The default value is "d". Please refer to example of DateTime.ToString() in MSDN.
public void setDateFormat(String value)
public float getHeight()
Gets or sets a float value that indicates the height of the segment.
public void setHeight(float value)
public float getPosY()
Gets or sets a float value that indicates the y-coordinate of the segment beginning position.
public void setPosY(float value)
public boolean isSymbolReplaceable()
Whether replace symbols like $p or not.
Gets or sets a bool value that indicates whether a symbol like $p is replaceable or not. Default is true.
public void isSymbolReplaceable(boolean value)
public String getID()
Gets or sets a string that indicates the ID of the segment.
public void setID(String value)
public LineBlock getFirstLineBlock()
public void setFirstLineBlock(LineBlock value)
public Hyperlink getHyperlink()
Gets or sets a Hyperlink
object that indicates the hyper link
info of the segment.
public void setHyperlink(Hyperlink value)
public Object completeClone()
Clones a new Segment
object. All members are cloned.
Segment
object.public Paragraph getInlineParagraph()
Gets or sets a Paragraph
object that indicates the inline
paragraph. If this property is set, the segment become the inline
paragraph of Text and the Content
is disabled.
Image
, Graph
, FormField
and Attachment
can be used as inline paragraph.
[C#] Pdf p = new Pdf(); Section sec1 = p.Sections.Add(); Text text1 = new Text(); sec1.Paragraphs.Add(text1); text1.Segments.Add("This is a test for inline"); Segment seg2 = text1.Segments.Add(); Image img1 = new Image(); img1.ImageInfo.File = "c:/images/logo.gif"; seg2.InlineParagraph = img1; p.Save("d:/test/test.pdf"); [VB.NET] Dim p As Pdf = New Pdf() Dim sec1 As Section = p.Sections.Add() Dim text1 As Text = New Text() sec1.Paragraphs.Add(text1) text1.Segments.Add("This is a test for inline") Dim seg2 As Segment = text1.Segments.Add() Dim img1 As Image = New Image() img1.ImageInfo.File = "c:/images/logo.gif" seg2.InlineParagraph = img1 p.Save("d:/test/test.pdf") [XML] <Pdf xmlns="Aspose.Pdf"> <Section> <Text> <Segment FontSize="16">This is a inline image: </Segment> <Segment> <Image File="c:\images\logo.gif" /> </Segment> </Text> </Section> </Pdf>
public void setInlineParagraph(Paragraph value)
public String isTogetherWithInlineImage()
Indicates whether the segment combine with Inline Image
Gets or sets a string that indicates whether the segment combine with Inline Image
public boolean isPageNumSymbol()
public void isPageNumSymbol(boolean value)
public boolean isNumeric()
Whether the segment is numeric
public float getWidth()
Gets or sets a float value that indicates the width of the segment.
public void setWidth(float value)
public float getPosX()
Gets or sets a float value that indicates the x-coordinate of the segment beginning position.
public void setPosX(float value)
public boolean hasRTLChar()
Get a value that indicates whether the segment has Arabic or Hebrew character
public String getDefaultFontName()
The default font supports segment.Content.
Gets or sets a string that indicates the default font supports segment.Content.
public void setDefaultFontName(String value)
public void setLanguageSort(String value)
public Hyperlink getHostedHyperlink()
getHostedHyperlink
in interface IHyperlinkCarrier
Copyright © 2016 Aspose. All Rights Reserved.