Class TableGenerator
Information
Représente le plugin Documentize.TableGenerator. Utilisé pour ajouter un tableau à un document PDF.
[Obsolete("Veuillez utiliser la classe PdfManager. La classe sera bientôt supprimée.")]
public static class TableGeneratorHéritage
Membres hérités
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
Exemples
L’exemple démontre comment ajouter un tableau à un fichier PDF.
// Configurer les options du tableau
var options = new TableOptions().InsertPageBefore(1)
.AddTable()
.AddRow()
.AddCell().AddParagraph("Nom")
.AddCell().AddParagraph("Âge")
.AddRow()
.AddCell().AddParagraph("Bob")
.AddCell().AddParagraph("12")
.AddRow()
.AddCell().AddParagraph("Sam")
.AddCell().AddParagraph("20")
.AddRow()
.AddCell().AddParagraph("Sandy")
.AddCell().AddParagraph("26")
.AddRow()
.AddCell().AddParagraph("Tom")
.AddCell().AddParagraph("12")
.AddRow()
.AddCell().AddParagraph("Jim")
.AddCell().AddParagraph("27");
// Ajouter le chemin du fichier d'entrée
options.AddInput(new FileDataSource("path_to_input.pdf"));
// Définir le chemin du fichier de sortie
options.AddOutput(new FileDataSource("path_to_output.pdf"));
// Effectuer le processus
TableGenerator.Process(options);Méthodes
Process(TableOptions)
Ajouter un tableau au document PDF.
public static ResultContainer Process(TableOptions options)Paramètres
optionsTableOptions: Un objet options contenant des instructions pour l’opération.
Retours
ResultContainer : Un objet contenant le résultat de l’opération.
Exceptions
Si les options ne sont pas définies.
Espace de noms : Documentize Assembly : Documentize.dll