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

NameTypeAccessDescription
firstLineStringReadReturns the first line of text, or an empty string if no text has been set.
textStringReadReturns all lines of text joined by newline characters.
textColorColorReadReturns the foreground (text) color.
backColorColorReadReturns the background color.
fontNameStringReadReturns the font name.
fontSizefloatReadReturns the font size in points.
embeddedbooleanReadReturns whether the font should be embedded in the PDF.
fontStyleFontStyleReadReturns the predefined font style.
encodingEncodingTypeReadReturns the encoding type.
lineSpacingfloatReadReturns the line spacing in points.

méthodes

SignatureDescription
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()StringReturns the first line of text, or an empty string if no text has been set.
getText()StringReturns all lines of text joined by newline characters.
getTextColor()ColorReturns the foreground (text) color.
getBackColor()ColorReturns the background color.
getFontName()StringReturns the font name.
getFontSize()floatReturns the font size in points.
isEmbedded()booleanReturns whether the font should be embedded in the PDF.
getFontStyle()FontStyleReturns the predefined font style.
getEncoding()EncodingTypeReturns the encoding type.
getLineSpacing()floatReturns the line spacing in points.
toString()String

Voir aussi

  • Aspose.PDF pour Java — API d’entreprise
 Français