public class TextWriter extends DocumentWriter
Encapsulates method and Properties to write text to Pdf document.
Modifier and Type | Field and Description |
---|---|
boolean |
IsCoreFontUsed |
boolean |
isFontNotFoundExceptionThrown |
boolean |
IsUnderlineWritten
���ڴ��������ڵ�underline�����������Ϊfalse����ǰ��underline�ݲ�����������洦���
���������Ϊtrue��������л����underline�������Underline���档
|
boolean |
LastRequestedFontWasNonTruetypeItalicButWasSubtitutedWithTrueTypeNonItalic
True means font is set to be italic but there is no italic font
installed in the system.
|
boolean |
MustUseFontMapFile |
float |
textRotatingAngle |
clipObjects, ClippingArea, HasUnicodeInBookmark, IsUnicodeWithWordSpacing, JavaScripts, XmpMetadata, XmpMetadataID
LastObjIdOfEveryPage
Constructor and Description |
---|
TextWriter() |
TextWriter(IFontUriResolver fontPathResolver)
default constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
doReverse()
Gets or sets a bool value that indicates whether the chars in string
be reversed.
|
void |
doReverse(boolean value) |
int |
findOrLoadFont(String fontName,
String encoding,
boolean mustEmbed,
boolean isBold,
boolean isItalic,
String truetypeFileName,
boolean isUnicode)
Finds font in font library and get font info.
|
int |
findOrLoadRelevantFont(TextInfo textInfo)
Finds font in font library and get font info for specified PDF text
info
|
float |
getFontDescender(int fontID)
Gets font ascender info for the font identified by the ID.
|
com.aspose.ms.System.Collections.Hashtable |
getFontStreams() |
float |
getLeading()
Represents a float value that indicates the distance between lines.
|
float |
getLengthOfBiggestWordLoadFontIfNecessary(String subjectText,
TextInfo fontStyle)
�����ı�����������ַ����ij���
|
float |
getStringWidth(String text1,
int font,
float size)
Calculates the widgth of text with given font.
|
float |
getTextRise()
Represents a float value that indicates the distance between text and
the baseline.
|
String |
getTtFontFileName(String fontName) |
boolean |
isFontWarning()
Sets a bool value that represents whether the system throw exception
when encounters font problem.
|
void |
isFontWarning(boolean value) |
boolean |
isNeedInitRes() |
void |
isNeedInitRes(boolean value) |
boolean |
isOverline()
Represents a bool value that represents whether the text to be output
is overline.
|
void |
isOverline(boolean value) |
boolean |
isStrikeout()
Represents a string that represents whether the text to be output is
strikeout.
|
void |
isStrikeout(boolean value) |
boolean |
isUnderline()
Represents a bool value that represents whether the text to be output
is underline.
|
void |
isUnderline(boolean value) |
void |
loadSuitableCustomFontIfAbsentYet(TextInfo thisTextInfo) |
float |
loadSuitableFontIfNotYetAndGetStringWidth(String text,
TextInfo textInfo) |
static String |
reverseStringAndReturnEmptyStringIfNull(String str) |
void |
setCharSpacing(float value) |
void |
setCurrentFont(int font,
float fontsize,
boolean isWriteMode)
Sets current text font according to the given font ID and size..
|
void |
setCustomFonts(CustomFonts value) |
void |
setDefaultFontName(String value) |
void |
setFont(int fontSlot,
float fontsize)
Sets current text font according to the given font ID and size..
|
void |
setFontStreams(com.aspose.ms.System.Collections.Hashtable _fontStreams) |
void |
setFontStretch(int fontSlot,
String fontStretch) |
void |
setFontWeight(int fontSlot,
String fontWeight) |
void |
setHorizScaling(float value) |
void |
setLeading(float value) |
void |
setOverlineOffset(float value) |
void |
setSegmentDefaultFontName(String value) |
void |
setTextRenderingMode(int value) |
void |
setTextRise(float value) |
void |
setUnderlineOffset(float value) |
void |
setWordSpacing(float value)
a float value that indicates the space between words in text.
|
aspose.pdf.pdftext.BoxShowInfo |
showBoxedText(String text,
float left,
float bottom,
float width,
float height,
String horAlignModeAsString,
boolean blind,
float headBlank,
int tailBlank,
float leftHangingWidth)
Shows text in a given box with given alignment mode.
|
void |
showOnPosition(TextInfo textInfo,
String text,
float x,
float y,
int verticalTextRotationAngle)
Shows text on a specified position.
|
adjustBuffer, adjustBuffer1, beginContentsSection, beginDict, beginObj, beginPage, beginPath, beginStream, close, closePath, compress, endContentSection, endDict, endObj, endPage, endPath, endStream, endText, getBuffer, isIdentityMatrix, lineTo, moveTo, newXobject, open, open, putToStream, putToStream, restoreState, restoreToState, saveState, setClippingArea, setDash, setFileName, setLineCap, setLineWidth, stroke, writeEnquotedSting
allocID, checkScope, getCommon, getCompatibility, getCompressionLevel, getConformance, getCurrentMCID, getDocInfo, getDocObject, getDocResource, getEncryptionInfo, getHyperTextInfo, getLinearized, getPageInfo, getPageLayoutInfo, getState, isBuffered, isBuffered, setCompressionLevel, setConformance, setCurrentMCID, setCurrentStructElement, setLinearized
public boolean IsCoreFontUsed
public boolean isFontNotFoundExceptionThrown
public float textRotatingAngle
public boolean LastRequestedFontWasNonTruetypeItalicButWasSubtitutedWithTrueTypeNonItalic
True means font is set to be italic but there is no italic font installed in the system.
public boolean MustUseFontMapFile
public boolean IsUnderlineWritten
���ڴ��������ڵ�underline�����������Ϊfalse����ǰ��underline�ݲ�����������洦��� ���������Ϊtrue��������л����underline�������Underline���档
public TextWriter(IFontUriResolver fontPathResolver)
default constructor
public TextWriter()
public boolean isFontWarning()
Sets a bool value that represents whether the system throw exception when encounters font problem.
public void isFontWarning(boolean value)
public boolean isNeedInitRes()
public void isNeedInitRes(boolean value)
public float getFontDescender(int fontID)
Gets font ascender info for the font identified by the ID.
fontID
- ID of the font.public boolean isUnderline()
Represents a bool value that represents whether the text to be output is underline.
Value: The property Underline accesses the value of the underline field.public void isUnderline(boolean value)
public void setUnderlineOffset(float value)
public void setOverlineOffset(float value)
public float getLeading()
Represents a float value that indicates the distance between lines.
public void setLeading(float value)
public float getTextRise()
Represents a float value that indicates the distance between text and the baseline.
public void setTextRise(float value)
public void setTextRenderingMode(int value)
public void setHorizScaling(float value)
public void setCharSpacing(float value)
public void setWordSpacing(float value)
a float value that indicates the space between words in text. Represents
public boolean isOverline()
Represents a bool value that represents whether the text to be output is overline.
Value: The property Overline accesses the value of the overline field.public void isOverline(boolean value)
public boolean isStrikeout()
Represents a string that represents whether the text to be output is strikeout.
Value: The property Underline accesses the value of the strikeout field.public void isStrikeout(boolean value)
public boolean doReverse()
Gets or sets a bool value that indicates whether the chars in string be reversed. This property is used for right-to-left aligned language such as Arabic and Hebrew.
public void doReverse(boolean value)
public void setFont(int fontSlot, float fontsize)
Sets current text font according to the given font ID and size..
font
- An int number which indicates the font ID.fontsize
- An float number which indicates the font size.public void setFontWeight(int fontSlot, String fontWeight)
public void setFontStretch(int fontSlot, String fontStretch)
public void setCurrentFont(int font, float fontsize, boolean isWriteMode)
Sets current text font according to the given font ID and size..
font
- An int number which indicates the font ID.fontsize
- An float number which indicates the font size.isWriteMode
- public int findOrLoadRelevantFont(TextInfo textInfo)
Finds font in font library and get font info for specified PDF text info
public int findOrLoadFont(String fontName, String encoding, boolean mustEmbed, boolean isBold, boolean isItalic, String truetypeFileName, boolean isUnicode)
Finds font in font library and get font info.
fontName
- the name of the font to be found.encoding
- the encoding type of the font.embed
- whether the font is embededisBold
- isItalic
- truetypeFileName
- public com.aspose.ms.System.Collections.Hashtable getFontStreams()
public void setFontStreams(com.aspose.ms.System.Collections.Hashtable _fontStreams)
public void showOnPosition(TextInfo textInfo, String text, float x, float y, int verticalTextRotationAngle)
Shows text on a specified position.
text
- The text to be put to Pdf document.x
- The x-coordinate of the position.y
- The y-coordinate of the position.public void setCustomFonts(CustomFonts value)
public void setDefaultFontName(String value)
public void setSegmentDefaultFontName(String value)
public void loadSuitableCustomFontIfAbsentYet(TextInfo thisTextInfo)
public float getLengthOfBiggestWordLoadFontIfNecessary(String subjectText, TextInfo fontStyle)
�����ı�����������ַ����ij���
textWriter
- subjectText
- fontStyle
- public float loadSuitableFontIfNotYetAndGetStringWidth(String text, TextInfo textInfo)
public float getStringWidth(String text1, int font, float size)
Calculates the widgth of text with given font.
textWriter
- The TextWriter type object used to generate text in
PDF.text1
- the text to be calculate.font
- text font number.size
- font size nubmer.public aspose.pdf.pdftext.BoxShowInfo showBoxedText(String text, float left, float bottom, float width, float height, String horAlignModeAsString, boolean blind, float headBlank, int tailBlank, float leftHangingWidth)
Shows text in a given box with given alignment mode.
text
- The text to be show.left
- The left position of the box.bottom
- The bottom position of the box.width
- The width of the box.height
- The height of the box.horAlignMode
- The alignment mode, it can be
AlignmentType.Left,AlignmentType.Right,AlignmentType.Center,"justify" or
"fulljustify".blind
- If true,all calculations are performed but no text outputis
actually generated.headBlank
- The width of the blank before text.tailBlank
- The number of blank chars after text.leftHangingWidth
- The width of the left hanging part.Copyright © 2016 Aspose. All Rights Reserved.