FormattedText
Vue de l’ensemble
‘Format’ est une classe dans Aspose.PDF FOSS pour Java.
Il représente le texte formaté avec des caractères de phon, couleur et codage, utilisés principalement pour les étiquettes dans les facades API.
Cette classe fournit 22 méthodes pour travailler avec les objets de formaté dans des programmes Java. Les méthodologies disponibles comprennent: ‘FormattedText’, ‘addNewLineTeXT’, getBackColor', ‘getEncoding’, 'getFirstLin', ’getName', ‚getSize', ''getPontStyle',‘getLinesSpacing',getTeTeX, ‘ghetTexColore’,‘‘isEmbedded’ et 1 méthode supplémentaire. Tous les membres publics sont accessibles à toute application Java après l’installation du package Java Aspose.PDF FOSS. Propriétés: backColors', ‘’embeddes’, encodant’, ‘first’Lins, `fonts’, 4+.
Propriétés
| Name | Type | Access | Description |
|---|---|---|---|
firstLine | String | Read | Returns the first line of text, or an empty string if no text has been set. |
text | String | Read | Returns all lines of text joined by newline characters. |
textColor | Color | Read | Returns the foreground (text) color. |
backColor | Color | Read | Returns the background color. |
fontName | String | Read | Returns the font name. |
fontSize | float | Read | Returns the font size in points. |
embedded | boolean | Read | Returns whether the font should be embedded in the PDF. |
fontStyle | FontStyle | Read | Returns the predefined font style. |
encoding | EncodingType | Read | Returns the encoding type. |
lineSpacing | float | Read | Returns the line spacing in points. |
méthodes
| Signature | Description |
|---|---|
FormattedText() | Creates an empty {@code FormattedText} instance. |
FormattedText(text: String) | Creates a {@code FormattedText} with the given text. |
FormattedText(text: String, foregroundColor: Color, backgroundColor: Color) | Creates a {@code FormattedText} with foreground and background colors. |
FormattedText(text: String, color: Color, fontStyle: FontStyle, encoding: EncodingType, embedded: boolean, fontSize: float) | Creates a {@code FormattedText} with color, font style, encoding, and size. |
FormattedText(text: String, color: Color, fontName: String, encoding: EncodingType, embedded: boolean, fontSize: float) | Creates a {@code FormattedText} with color, font name, encoding, and size. |
FormattedText(text: String, foregroundColor: Color, backgroundColor: Color, fontStyle: FontStyle, encoding: EncodingType, embedded: boolean, fontSize: float) | Creates a {@code FormattedText} with foreground/background colors, font style, encoding, and size. |
FormattedText(text: String, foregroundColor: Color, backgroundColor: Color, fontName: String, encoding: EncodingType, embedded: boolean, fontSize: float) | Creates a {@code FormattedText} with foreground/background colors, font name, encoding, and size. |
FormattedText(text: String, color: Color, fontStyle: FontStyle, encoding: EncodingType, embedded: boolean, fontSize: float, lineSpacing: float) | Creates a {@code FormattedText} with color, font style, encoding, size, and line spacing. |
FormattedText(text: String, foregroundColor: Color, backgroundColor: Color, fontStyle: FontStyle, encoding: EncodingType, embedded: boolean, fontSize: float, lineSpacing: float) | Creates a {@code FormattedText} with foreground/background colors, font style, encoding, size, and line spacing. |
addNewLineText(text: String) | Adds a new line of text. |
addNewLineText(text: String, lineSpacing: float) | Adds a new line of text with custom line spacing. |
getFirstLine() → String | Returns the first line of text, or an empty string if no text has been set. |
getText() → String | Returns all lines of text joined by newline characters. |
getTextColor() → Color | Returns the foreground (text) color. |
getBackColor() → Color | Returns the background color. |
getFontName() → String | Returns the font name. |
getFontSize() → float | Returns the font size in points. |
isEmbedded() → boolean | Returns whether the font should be embedded in the PDF. |
getFontStyle() → FontStyle | Returns the predefined font style. |
getEncoding() → EncodingType | Returns the encoding type. |
getLineSpacing() → float | Returns the line spacing in points. |
toString() → String |
Voir aussi
- Aspose.PDF pour Java — API d’entreprise