Texte formaté
Vue d’ensemble
FormattedText est une classe dans Aspose.PDF FOSS pour .NET.
Représente le texte formaté utilisé dans les opérations de tamponnage et de réparation.
Cette classe fournit 26 méthodes pour travailler avec des objets FormattedText dans les programmes .NET.
Les méthodes disponibles incluent : AddNewLineText, FormattedText, IsCjk, SetCjkFontStyle.
Tous les membres publics sont accessibles à toute application .NET après l’installation du package Aspose.PDF FOSS for .NET.
Propriétés : BackgroundColor, CustomFontFile, FontName, FontSize, ForegroundColor, IsEmbedded, et 3 de plus.
Propriétés
| Nom | Type | Accès | Description |
|---|---|---|---|
Text | string | Read | Le contenu texte de la première ligne. |
FontSize | double | Read/Write | Taille de police en points. |
FontName | string | Read/Write | Nom de police (nom de police de base PDF). |
ForegroundColor | Color | Read/Write | Couleur de premier plan (texte). |
BackgroundColor | Color | Read/Write | Couleur d’arrière-plan. |
IsEmbedded | bool | Read/Write | Indique si le texte est incorporé (pour les polices non standard). |
CustomFontFile | string? | Read/Write | Chemin du fichier de police personnalisé (pour l’incorporation de police TrueType). |
TextWidth | float | Read | Largeur de la ligne la plus longue avec la police/taille configurée. |
TextHeight | float | Read | Hauteur totale du bloc de texte formaté (somme des hauteurs de ligne). |
Méthodes
| Signature | Description |
|---|---|
FormattedText() | Créer un nouveau FormattedText avec un texte vide. |
FormattedText(text: string) | Créer un nouveau FormattedText avec le texte spécifié. |
FormattedText(text: string, foregroundColor: Color, backgroundColor: Color) | Créer un FormattedText avec du texte et des couleurs de premier plan/arrière-plan. |
FormattedText(text: string, foregroundColor: FontColor) | Créer un FormattedText avec du texte et FontColor en premier plan/arrière-plan. |
FormattedText(text: string, foregroundColor: FontColor, backgroundColor: FontColor) | Créer un FormattedText avec du texte et FontColor en premier plan/arrière-plan. |
FormattedText(text: string, fontColor: FontColor, fontStyle: FontStyle, encodingType: EncodingType, embedded: bool, textSize: float) | Créer un FormattedText avec un format complet en utilisant FontColor. |
FormattedText(text: string, textColor: FontColor, backColor: FontColor, textFont: FontStyle, textEncoding: EncodingType, embedded: bool, textSize: float) | Créer un FormattedText avec un format complet en utilisant FontColor avec premier plan et arrière-plan. |
FormattedText(text: string, fontColor: FontColor, textFont: FontStyle, textEncoding: EncodingType, embedded: bool, textSize: float, lineSpacing: float) | Créer un FormattedText avec un format complet en utilisant FontColor, avec interligne. |
FormattedText(text: string, textColor: Color, backColor: Color, fontName: string, textEncoding: EncodingType, embedded: bool, fontSize: float) | Créer un FormattedText avec System.Drawing.Color en premier plan/arrière-plan et les paramètres de police. |
FormattedText(text: string, textColor: Color, backColor: Color, textFont: FontStyle, encoding: EncodingType, embedded: bool, textSize: float) | Créer un FormattedText avec System.Drawing.Color en premier plan/arrière-plan et FontStyle. |
FormattedText(text: string, textColor: Color, backColor: Color, textFont: FontStyle, textEncoding: EncodingType, embedded: bool, textSize: float, lineSpacing: float) | Appelle FormattedText sur cette instance de FormattedText. |
FormattedText(text: string, textColor: System.Drawing.Color, backColor: System.Drawing.Color, textFont: FontStyle, textEncoding: EncodingType, embedded: bool, textSize: float, lineSpacing: float) | |
FormattedText(text: string, textColor: FontColor, backColor: FontColor, textFont: FontStyle, textEncoding: EncodingType, embedded: bool, textSize: float, lineSpacing: float) | |
FormattedText(text: string, textColor: System.Drawing.Color, backColor: System.Drawing.Color) | System.Drawing.Color premier plan + paire premier plan/arrière-plan. |
FormattedText(text: string, color: System.Drawing.Color, textFont: FontStyle, textEncoding: EncodingType, embedded: bool, textSize: float) | System.Drawing.Color premier plan + FontStyle + EncodingType, sans interligne. |
FormattedText(text: string, textColor: System.Drawing.Color, textFont: FontStyle, textEncoding: EncodingType, embedded: bool, textSize: float, lineSpacing: float) | System.Drawing.Color premier plan + FontStyle + EncodingType + interligne. |
FormattedText(text: string, textColor: System.Drawing.Color, backColor: System.Drawing.Color, textFont: FontStyle, encoding: EncodingType, embedded: bool, textSize: float) | System.Drawing.Color premier plan/arrière-plan + FontStyle. |
FormattedText(text: string, textColor: System.Drawing.Color, backColor: System.Drawing.Color, fontName: string, textEncoding: EncodingType, embedded: bool, fontSize: float) | System.Drawing.Color premier plan/arrière-plan + chaîne de nom de police. |
FormattedText(text: string, textColor: System.Drawing.Color, fontName: string, textEncoding: EncodingType, embedded: bool, fontSize: float) | Créer un FormattedText avec System.Drawing.Color en premier plan et un nom de police ou un fichier de police TrueType. |
FormattedText(text: string, textColor: Color, fontName: string, textEncoding: EncodingType, embedded: bool, fontSize: float) | Créer un FormattedText avec Aspose.Pdf.Color en premier plan et un nom de police ou un fichier de police TrueType. |
FormattedText(text: string, color: Color, textFont: FontStyle, textEncoding: EncodingType, embedded: bool, textSize: float) | Créer un FormattedText avec FontStyle (enum) et System.Drawing.Color. |
FormattedText(text: string, textColor: Color, textFont: FontStyle, textEncoding: EncodingType, embedded: bool, textSize: float, lineSpacing: float) | Créer un FormattedText avec Aspose.Pdf.Color en premier plan/arrière-plan et un interligne. |
AddNewLineText(newLineText: string) | Ajouter une nouvelle ligne de texte. |
AddNewLineText(newLineText: string, lineSpacing: float) | Ajouter une nouvelle ligne de texte avec un interligne personnalisé. |
IsCjk() | Vérifier si le texte contient des caractères CJK. |
SetCjkFontStyle() | Définir la police sur une police compatible CJK (équivalent de MS Gothic). |