|
com.aspose.pdf.elements
Class TextInfo
java.lang.Object
com.aspose.pdf.elements.TextInfo
- All Implemented Interfaces:
- java.lang.Cloneable
public class TextInfo - extends java.lang.Object
- implements java.lang.Cloneable
Encapsulates info for a Text paragraph.
|
Constructor Summary |
TextInfo()
Initializes a new instance of the TextInfo class. |
| Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextInfo
public TextInfo()
- Initializes a new instance of the TextInfo class.
[SampleCode]
Section sec1 = pdf.getSections().add();
Text text1 = new Text(sec1);
sec1.getParagraphs().add(text1);
text1.getTextInfo().setTextColor(Color.Red);
Segment seg1 = new Segment(text1,"seg1 ");
text1.getSegments().add(seg1);
Segment seg2 = new Segment(text1,"seg2 ");
seg2.getTextInfo().setTextColor(Color.Green);
text1.getSegments().add(seg2);
getBaseLineOffset
public float getBaseLineOffset()
- Gets the text offset relative to the baseline.
setBaseLineOffset
public TextInfo setBaseLineOffset(float offset)
- Sets the text offset relative to the baseline.
Positive values rise the text, negative values lower the text.
Correspond to TextInfo.IsBaseLine in .net version
- Parameters:
offset - the offset you want to set
clone
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
- Overrides:
clone in class java.lang.Object
- Throws:
java.lang.CloneNotSupportedException- See Also:
Object.clone()
getAlignmentType
public AlignmentType getAlignmentType()
- Gets an alignment type that indicates the text alignment mode when showed in box.
setAlignmentType
public TextInfo setAlignmentType(AlignmentType alignmentType)
- Sets a alignment type that indicates the text alignment mode when showed in box.
getFontSize
public float getFontSize()
- Gets a float number that indicates the size of font. Unit is point. Default is 12.
- Returns:
- Returns the FontSize.
setFontSize
public TextInfo setFontSize(float fontSize)
- Sets a float number that indicates the size of font. Unit is point. Default is 12.
- Parameters:
fontSize - The FontSize to set.
getBackGroundColor
public Color getBackGroundColor()
- Gets the background color of the text paragraph.
setBackGroundColor
public TextInfo setBackGroundColor(Color groundColor)
- Sets the background color of the text paragraph.
- Throws:
AsposeBaseException
getTextColor
public Color getTextColor()
- Gets a Color object that indicates the color of the text.
setTextColor
public TextInfo setTextColor(Color color)
- Sets a Color object that indicates the color of the text.
isTrueTypeBold
public boolean isTrueTypeBold()
- Gets a bool value that indicates whether the TrueType font is bold.
setTrueTypeBold
public TextInfo setTrueTypeBold(boolean bold)
- Sets a bool value that indicates whether the TrueType font is bold.
- Parameters:
bold - boolean, true to set text bold and false not
isTrueTypeItalic
public boolean isTrueTypeItalic()
- Gets a bool value that indicates whether the TrueType font is italic.
setTrueTypeItalic
public TextInfo setTrueTypeItalic(boolean italic)
- Sets a bool value that indicates whether the TrueType font is italic.
- Parameters:
italic - boolean, true to set text italic and false not
isStrikeOut
public boolean isStrikeOut()
- Gets a bool value that indicates whether the text is with strikeout.
setStrikeOut
public TextInfo setStrikeOut(boolean strikeOut)
- Sets a bool value that indicates whether the text is with strikeout.
Limitations: you can only use one of overline, underline, strikeout.
isUnderLine
public boolean isUnderLine()
- Gets a bool value that indicates whether the text is with underline.
Limitations: you can only use one of overline, underline, strikeout.
setUnderLine
public TextInfo setUnderLine(boolean underLine)
- Sets a bool value that indicates whether the text is with underline.
isUnicode
public boolean isUnicode()
- Gets a bool value that indicates whether unicode is used.
- Returns:
- Returns the IsUnicode.
setIsUnicode
public TextInfo setIsUnicode(boolean isUnicode)
- Sets a bool value that indicates whether unicode is used.
- Parameters:
isUnicode - The IsUnicode to set.
getLineSpacing
public float getLineSpacing()
- Gets float value that indicates the spacing between two text lines.
The unit is point.
setLineSpacing
public TextInfo setLineSpacing(float spacing)
- Sets a float value that indicates the spacing between two text lines.
The unit is point.
getCharSpacing
public float getCharSpacing()
- Gets a float value that indicates space between charcters.The unit is point.
setCharSpacing
public TextInfo setCharSpacing(float spacing)
- Sets a float value that indicates space between charcters.The unit is point.
equals
public boolean equals(java.lang.Object arg0)
- Overrides:
equals in class java.lang.Object
- See Also:
Object.equals(java.lang.Object)
getWordSpacing
public float getWordSpacing()
- Gets a float value that indicates space between words.The unit is point.
setWordSpacing
public TextInfo setWordSpacing(float spacing)
- Sets a float value that indicates space between words.The unit is point.
getFontAfmFile
public java.lang.String getFontAfmFile()
- Gets a string that indicates the name of custom AFM font file.
- Returns:
- Returns the FontAfmFile.
setFontAfmFile
public TextInfo setFontAfmFile(java.lang.String afmFile)
- Sets a string that indicates the name of custom AFM font file.
- Parameters:
afmFile - The FontAfmFile to set.
getFontEncoding
public java.lang.String getFontEncoding()
- Gets a string that indicates the font encoding name. For 8-bit fonts,
encoding should be "builtin"(Original encoding used by non-text or non-Latin text fonts) ,
or "winansi"(Windows code page 1252), or the name of an external encoding("cp1251" for example).
The default value is "winansi".
- Returns:
- Returns the m_fontEncoding.
setFontEncoding
public TextInfo setFontEncoding(java.lang.String encoding)
- Sets a string that indicates the font encoding name. For 8-bit fonts,
encoding should be "builtin"(Original encoding used by non-text or non-Latin text fonts) ,
or "winansi"(Windows code page 1252), or the name of an external encoding("cp1251" for example).
The default value is "winansi".
- Parameters:
encoding - The FontEncoding to set.
getFontEncodingFile
public java.lang.String getFontEncodingFile()
- Gets a string that indicates the name of font encoding file. Font encoding files are
available at http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/ and
http://www.unicode.org/Public/MAPPINGS/ISO8859/.The font encoding name is same as the
encoding file name. For example, the encoding file is 'cp1250.txt' and the encoding name is 'cp1250';
the encoding file is '8859-1.TXT' and the encoding name is '8859-1'.
- Returns:
- Returns the FontEncodingFile.
setFontEncodingFile
public TextInfo setFontEncodingFile(java.lang.String encodingFile)
- Sets a string that indicates the name of font encoding
|