aspose.pdf
Class Segment

java.lang.Object
  extended by aspose.pdf.Segment

public class Segment
extends java.lang.Object

Represents a collection of Segment objects.

Typical usages are the following:

[Java] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.getSections().add(); Text text1 = new Text("seg1 "); sec1.getParagraphs().add(text1); Segment seg2 = text1.getSegments().add("seg2"); seg2.getTextInfo().setColor(new Color("Red")); seg2.getTextInfo().setFontSize(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>


Nested Class Summary
 class Segment.VerticalSegInfo
          for Text MarginInfo
 
Field Summary
 boolean isEmptySegInHeading
          A boolean value indicates whether heading is empty.
 boolean IsEndNoteNumber
          Indicates whether it is end note number.
 boolean IsFootNumber
          A boolean value indicates whether it is foot number.
 boolean isNBSegment
          A boolean value indicates whether it is a NB segment.
 boolean isPositionGot
          A boolean value indicates whether the position has been gotten .
 boolean isTABSymbol
          A boolean value indicates whether it is a TAB symbol.
 java.lang.String TargetID
          The ID of target .
 Segment.VerticalSegInfo VerticalSegPosInfo
          The vertical segment position information .
 
Constructor Summary
Segment()
          Initializes a new instance of the Segment class.
Segment(java.lang.String content)
          Initializes a new instance of the Segment class.
Segment(java.lang.String content, TextInfo info)
          Initializes a new instance of the Segment class.
Segment(Text text)
          Initializes a new instance of the Segment class.
 
Method Summary
 java.lang.Object completeClone()
          Clones a new Segment object.
 java.lang.String getContent()
          Gets a string that indicates the content of the text segment.
 java.lang.String getDateFormat()
          Gets or sets a String that indicates the date format of the replaceable date symbol($D).
 java.lang.String getDefaultFontName()
          Gets or sets a String that indicates the default font supports segment.Content.
 float getDescender()
          Get the descender object of the segment.
 EndNote getEndNote()
          get or set the EndNote object that indicates the end note of the current segment.
 aspose.pdf.pdftext.LineBlock getFirstLineBlock()
          Get the first line block object.
 FootNote getFootNote()
          get or set the FootNote object that indicates the footnote of the current segment.
 boolean getHasRTLChar()
          Get a value that indicates whether the segment has Arabic or Hebrew character
 boolean getHaveFootNoteNumberInfo()
          Gets a boolean value that indicates whether the text have footnote number information.
 float getHeight()
          Gets a float value that indicates the height of the segment.
 Hyperlink getHyperlink()
          Gets a Hyperlink object that indicates the hyper link info of the segment.
 java.lang.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.
 boolean getIsAutoHyphenated()
          Gets a boolean value that indicates whether the text is hyphenated automatically.
 boolean getIsFootNumber()
          Get the IsFootNumber object indicates whether it is foot number.
 boolean getIsHyphenatable()
          Gets a boolean value that indicates whether the segment is can be hyphenated.If the hyphenchar can not be inserted when hyphenating this word,it is false.
 boolean getIsNBSSymbol()
          Get a boolean value indicates whether it is a NBS symbol.
 boolean getIsNLSymbol()
          Get a boolean value indicates whether it is a NL symbol.
 boolean getIsPageNumSymbol()
          Get a boolean value indicates whether it is a page number symbol.
 boolean getIsRefPageNumSymbol()
          Get a boolean value indicates whether it is a page reference number symbol.
 boolean getIsSectionPageNumSymbol()
          Get a boolean value indicates whether it is a section page number symbol.
 boolean getIsSplitedFromLargeSeg()
          Get a boolean value indicates whether it is splited from a large segment.
 boolean getIsSymbol()
          Get a boolean value indicates whether it is symbol.
 boolean getIsSymbolReplaceable()
          Gets or sets a boolean value that indicates whether a symbol like $p is replaceable or not.
 java.lang.String getIsTogetherWithInlineImage()
          Gets or sets a String that indicates whether the segment combine with Inline Image
 boolean getIsTotalPageNumSymbol()
          Get a boolean value indicates whether it is a total page number symbol.
 boolean getIsTotalSectionNextPageNumSymbol()
          Get a boolean value indicates whether it is a total section next page number symbol.
 boolean getIsTotalSectionPageNumSymbol()
          Get a boolean value indicates whether it is a total section page number symbol.
 int getNextSegmentsUnderline()
          Get the next segments underline object .
 int getPageNumber()
          Get the pageNumber object .
 float getPosX()
          Gets or sets a float value that indicates the x-coordinate of the segment beginning position.
 float getPosY()
          Gets a float value that indicates the y-coordinate of the segment beginning position.
 TabLeaderType getTabLeaderType()
          Get the tabLeaderType object
 TextInfo getTextInfo()
          Gets a TextInfo object that indicates the text info of the segment.
 int getTogetherSegNumbers()
          Get a int value indicates the numbers of together segments
 float getWidth()
          Gets or sets a float value that indicates the width of the segment.
 boolean IsNumeric()
          Whether the segment is numeric
 void setContent(java.lang.String value)
          Sets a string that indicates the content of the text segment.
 void setDateFormat(java.lang.String value)
          Gets or sets a String that indicates the date format of the replaceable date symbol($D).
 void setDefaultFontName(java.lang.String value)
          Gets or sets a String that indicates the default font supports segment.Content.
 void setDescender(float descender)
          Set the descender object of the segment.
 void setEndNote(EndNote value)
          get or set the EndNote object that indicates the end note of the current segment.
 void setFirstLineBlock(aspose.pdf.pdftext.LineBlock value)
          Set the first line block object.
 void setFootNote(FootNote value)
          get or set the FootNote object that indicates the footnote of the current segment.
 void setHaveFootNoteNumberInfo(boolean value)
          sets a boolean value that indicates whether the text have footnote number information.
 void setHeight(float value)
          Sets a float value that indicates the height of the segment.
 void setHyperlink(Hyperlink value)
          Sets a Hyperlink object that indicates the hyper link info of the segment.
 void setID(java.lang.String value)
          Gets or sets a String that indicates the ID of the segment.
 void setInlineParagraph(Paragraph value)
          Gets or sets a Paragraph object that indicates the inline paragraph.
 void setIsAutoHyphenated(boolean value)
          sets a boolean value that indicates whether the text is hyphenated automatically.
 void setIsFootNumber(boolean isFootNumber)
          Set the IsFootNumber object indicates whether it is foot number.
 void setIsHyphenatable(boolean value)
          sets a boolean value that indicates whether the segment is can be hyphenated.If the hyphenchar can not be inserted when hyphenating this word,it is false.
 void setIsNBSSymbol(boolean isNBSSymbol)
          Set a boolean value indicates whether it is a NBS symbol.
 void setIsNLSymbol(boolean isNLSymbol)
          Set a boolean value indicates whether it is a NL symbol.
 void setIsPageNumSymbol(boolean value)
          Set a boolean value indicates whether it is a page number symbol.
 void setIsRefPageNumSymbol(boolean isRefPageNumSymbol)
          Set a boolean value indicates whether it is a page reference number symbol.
 void setIsSectionPageNumSymbol(boolean isSectionPageNumSymbol)
          Set a boolean value indicates whether it is a section page number symbol.
 void setIsSplitedFromLargeSeg(boolean isSplitedFromLargeSeg)
          Set a boolean value indicates whether it is splited from a large segment.
 void setIsSymbol(boolean isSymbol)
          Set a boolean value indicates whether it is symbol.
 void setIsSymbolReplaceable(boolean value)
          Gets or sets a boolean value that indicates whether a symbol like $p is replaceable or not.
 void setIsTotalPageNumSymbol(boolean isTotalPageNumSymbol)
          Set a boolean value indicates whether it is a total page number symbol.
 void setIsTotalSectionNextPageNumSymbol(boolean IsTotalSectionNextPageNumSymbol)
          Set a boolean value indicates whether it is a total section next page number symbol.
 void setIsTotalSectionPageNumSymbol(boolean isTotalSectionPageNumSymbol)
          Set a boolean value indicates whether it is a total section page number symbol.
 void setLanguageSort(java.lang.String value)
          set a String that indicates the sort of the language.
 void setNextSegmentsUnderline(int NextSegmentsUnderline)
          Set the next segments underline object .
 void setPageNumber(int pageNumber)
          Set the pageNumber object .
 void setPosX(float value)
          Gets or sets a float value that indicates the x-coordinate of the segment beginning position.
 void setPosY(float value)
          Sets a float value that indicates the y-coordinate of the segment beginning position.
 void setTabLeaderType(TabLeaderType tabLeaderType)
          Set the tabLeaderType object
 void setTextInfo(TextInfo value)
          Sets a TextInfo object that indicates the text info of the segment.
 void setTogetherSegNumber(int togetherNum)
          Set a int value indicates the numbers of together segments
 void setWidth(float value)
          Gets or sets a float value that indicates the width of the segment.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IsFootNumber

public boolean IsFootNumber
A boolean value indicates whether it is foot number.


IsEndNoteNumber

public boolean IsEndNoteNumber
Indicates whether it is end note number.


isEmptySegInHeading

public boolean isEmptySegInHeading
A boolean value indicates whether heading is empty.


isTABSymbol

public boolean isTABSymbol
A boolean value indicates whether it is a TAB symbol.


isNBSegment

public boolean isNBSegment
A boolean value indicates whether it is a NB segment.


isPositionGot

public boolean isPositionGot
A boolean value indicates whether the position has been gotten .


TargetID

public java.lang.String TargetID
The ID of target .


VerticalSegPosInfo

public Segment.VerticalSegInfo VerticalSegPosInfo
The vertical segment position information .

Constructor Detail

Segment

public Segment()
Initializes a new instance of the Segment class.


Segment

public Segment(java.lang.String content)
Initializes a new instance of the Segment class.

Parameters:
content - The content of the segment.

Segment

public Segment(java.lang.String content,
               TextInfo info)
Initializes a new instance of the Segment class.

Parameters:
content - The content of the segment.
info - The text format info of the segment.

Segment

public Segment(Text text)
Initializes a new instance of the Segment class.

Parameters:
text -

Remarks:This constructor can inherit common property values from the specified Text object.

Method Detail

getHaveFootNoteNumberInfo

public boolean getHaveFootNoteNumberInfo()
Gets a boolean value that indicates whether the text have footnote number information.


setHaveFootNoteNumberInfo

public void setHaveFootNoteNumberInfo(boolean value)
sets a boolean value that indicates whether the text have footnote number information.


getIsAutoHyphenated

public boolean getIsAutoHyphenated()
Gets a boolean value that indicates whether the text is hyphenated automatically.


setIsAutoHyphenated

public void setIsAutoHyphenated(boolean value)
sets a boolean value that indicates whether the text is hyphenated automatically.


getIsHyphenatable

public boolean getIsHyphenatable()
Gets a boolean value that indicates whether the segment is can be hyphenated.If the hyphenchar can not be inserted when hyphenating this word,it is false.


setIsHyphenatable

public void setIsHyphenatable(boolean value)
sets a boolean value that indicates whether the segment is can be hyphenated.If the hyphenchar can not be inserted when hyphenating this word,it is false.


getTextInfo

public TextInfo getTextInfo()
Gets a TextInfo object that indicates the text info of the segment.


setTextInfo

public void setTextInfo(TextInfo value)
Sets a TextInfo object that indicates the text info of the segment.


getFootNote

public FootNote getFootNote()
get or set the FootNote object that indicates the footnote of the current segment.


setFootNote

public void setFootNote(FootNote value)
get or set the FootNote object that indicates the footnote of the current segment.


getEndNote

public EndNote getEndNote()
get or set the EndNote object that indicates the end note of the current segment.


setEndNote

public void setEndNote(EndNote value)
get or set the EndNote object that indicates the end note of the current segment.


getIsFootNumber

public boolean getIsFootNumber()
Get the IsFootNumber object indicates whether it is foot number.


setIsFootNumber

public void setIsFootNumber(boolean isFootNumber)
Set the IsFootNumber object indicates whether it is foot number.


getContent

public java.lang.String getContent()
Gets a string that indicates the content of the text segment.


setContent

public void setContent(java.lang.String value)
Sets a string that indicates the content of the text segment.

Parameters:
value -

getDateFormat

public java.lang.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.


setDateFormat

public void setDateFormat(java.lang.String value)
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.


getHeight

public float getHeight()
Gets a float value that indicates the height of the segment.


setHeight

public void setHeight(float value)
Sets a float value that indicates the height of the segment.

Parameters:
value -

getPosY

public float getPosY()
Gets a float value that indicates the y-coordinate of the segment beginning position.


setPosY

public void setPosY(float value)
Sets a float value that indicates the y-coordinate of the segment beginning position.

Parameters:
value -

getIsSymbolReplaceable

public boolean getIsSymbolReplaceable()
Gets or sets a boolean value that indicates whether a symbol like $p is replaceable or not. Default is true.


setIsSymbolReplaceable

public void setIsSymbolReplaceable(boolean value)
Gets or sets a boolean value that indicates whether a symbol like $p is replaceable or not. Default is true.


getID

public java.lang.String getID()
Gets or sets a String that indicates the ID of the segment.


setID

public void setID(java.lang.String value)
Gets or sets a String that indicates the ID of the segment.


getFirstLineBlock

public aspose.pdf.pdftext.LineBlock getFirstLineBlock()
Get the first line block object.


setFirstLineBlock

public void setFirstLineBlock(aspose.pdf.pdftext.LineBlock value)
Set the first line block object.


getHyperlink

public Hyperlink getHyperlink()
Gets a Hyperlink object that indicates the hyper link info of the segment.


setHyperlink

public void setHyperlink(Hyperlink value)
Sets a Hyperlink object that indicates the hyper link info of the segment.

Parameters:
value -

completeClone

public java.lang.Object completeClone()
Clones a new Segment object. All members are cloned.

Returns:
The new Segment object.

getInlineParagraph

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.

Returns:

Typical usages are the following:

[Java] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.getSections().add(); Text text1 = new Text(); sec1.getParagraphs().add(text1); text1.getSegments().add("This is a test for inline."); Segment segment2 = text1.getSegments().add(); Image image1 = new Image(); image1.getImageInfo().setFile("c:/images/logo.gif"); segment2.setInlineParagraph(image1); pdf1.save(..);

setInlineParagraph

public void setInlineParagraph(Paragraph value)
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.

Typical usages are the following:

[Java] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.getSections().add(); Text text1 = new Text(); sec1.getParagraphs().add(text1); text1.getSegments().add("This is a test for inline."); Segment segment2 = text1.getSegments().add(); Image image1 = new Image(); image1.getImageInfo().setFile("c:/images/logo.gif"); segment2.setInlineParagraph(image1); pdf1.save(..);


getDescender

public float getDescender()
Get the descender object of the segment.


setDescender

public void setDescender(float descender)
Set the descender object of the segment.


getNextSegmentsUnderline

public int getNextSegmentsUnderline()
Get the next segments underline object .


setNextSegmentsUnderline

public void setNextSegmentsUnderline(int NextSegmentsUnderline)
Set the next segments underline object .


getPageNumber

public int getPageNumber()
Get the pageNumber object .


setPageNumber

public void setPageNumber(int pageNumber)
Set the pageNumber object .


getIsTogetherWithInlineImage

public java.lang.String getIsTogetherWithInlineImage()
Gets or sets a String that indicates whether the segment combine with Inline Image


getIsSymbol

public boolean getIsSymbol()
Get a boolean value indicates whether it is symbol.


setIsSymbol

public void setIsSymbol(boolean isSymbol)
Set a boolean value indicates whether it is symbol.


getIsPageNumSymbol

public boolean getIsPageNumSymbol()
Get a boolean value indicates whether it is a page number symbol.


setIsPageNumSymbol

public void setIsPageNumSymbol(boolean value)
Set a boolean value indicates whether it is a page number symbol.


getIsRefPageNumSymbol

public boolean getIsRefPageNumSymbol()
Get a boolean value indicates whether it is a page reference number symbol.


setIsRefPageNumSymbol

public void setIsRefPageNumSymbol(boolean isRefPageNumSymbol)
Set a boolean value indicates whether it is a page reference number symbol.


getIsSectionPageNumSymbol

public boolean getIsSectionPageNumSymbol()
Get a boolean value indicates whether it is a section page number symbol.


setIsSectionPageNumSymbol

public void setIsSectionPageNumSymbol(boolean isSectionPageNumSymbol)
Set a boolean value indicates whether it is a section page number symbol.


getIsTotalPageNumSymbol

public boolean getIsTotalPageNumSymbol()
Get a boolean value indicates whether it is a total page number symbol.


setIsTotalPageNumSymbol

public void setIsTotalPageNumSymbol(boolean isTotalPageNumSymbol)
Set a boolean value indicates whether it is a total page number symbol.


getIsTotalSectionPageNumSymbol

public boolean getIsTotalSectionPageNumSymbol()
Get a boolean value indicates whether it is a total section page number symbol.


setIsTotalSectionPageNumSymbol

public void setIsTotalSectionPageNumSymbol(boolean isTotalSectionPageNumSymbol)
Set a boolean value indicates whether it is a total section page number symbol.


getIsTotalSectionNextPageNumSymbol

public boolean getIsTotalSectionNextPageNumSymbol()
Get a boolean value indicates whether it is a total section next page number symbol.


setIsTotalSectionNextPageNumSymbol

public void setIsTotalSectionNextPageNumSymbol(boolean IsTotalSectionNextPageNumSymbol)
Set a boolean value indicates whether it is a total section next page number symbol.


getIsNBSSymbol

public boolean getIsNBSSymbol()
Get a boolean value indicates whether it is a NBS symbol.


setIsNBSSymbol

public void setIsNBSSymbol(boolean isNBSSymbol)
Set a boolean value indicates whether it is a NBS symbol.


getIsNLSymbol

public boolean getIsNLSymbol()
Get a boolean value indicates whether it is a NL symbol.


setIsNLSymbol

public void setIsNLSymbol(boolean isNLSymbol)
Set a boolean value indicates whether it is a NL symbol.


IsNumeric

public boolean IsNumeric()
Whether the segment is numeric


getWidth

public float getWidth()
Gets or sets a float value that indicates the width of the segment.


setWidth

public void setWidth(float value)
Gets or sets a float value that indicates the width of the segment.


getPosX

public float getPosX()
Gets or sets a float value that indicates the x-coordinate of the segment beginning position.


setPosX

public void setPosX(float value)
Gets or sets a float value that indicates the x-coordinate of the segment beginning position.


getTabLeaderType

public TabLeaderType getTabLeaderType()
Get the tabLeaderType object


setTabLeaderType

public void setTabLeaderType(TabLeaderType tabLeaderType)
Set the tabLeaderType object


getIsSplitedFromLargeSeg

public boolean getIsSplitedFromLargeSeg()
Get a boolean value indicates whether it is splited from a large segment.


setIsSplitedFromLargeSeg

public void setIsSplitedFromLargeSeg(boolean isSplitedFromLargeSeg)
Set a boolean value indicates whether it is splited from a large segment.


getTogetherSegNumbers

public int getTogetherSegNumbers()
Get a int value indicates the numbers of together segments


setTogetherSegNumber

public void setTogetherSegNumber(int togetherNum)
Set a int value indicates the numbers of together segments


getHasRTLChar

public boolean getHasRTLChar()
Get a value that indicates whether the segment has Arabic or Hebrew character


getDefaultFontName

public java.lang.String getDefaultFontName()
Gets or sets a String that indicates the default font supports segment.Content.


setDefaultFontName

public void setDefaultFontName(java.lang.String value)
Gets or sets a String that indicates the default font supports segment.Content.


setLanguageSort

public void setLanguageSort(java.lang.String value)
set a String that indicates the sort of the language.