Class TableGenerator

Information

Représente le plugin Documentize.TableGenerator. Utilisé pour ajouter une table à un document PDF.

public sealed class TableGenerator

Héritage

objectTableGenerator

Membres hérités

Exemples

L’exemple montre comment ajouter une table à un fichier PDF.

// Initialiser le TableGenerator
var plugin = new TableGenerator();
// Configurer les options de la table
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"));
// Exécuter le processus
plugin.Process(options);

Constructeurs

TableGenerator()

public TableGenerator()

Méthodes

Process(TableOptions)

Ajouter une table au document PDF.

public ResultContainer Process(TableOptions options)

Paramètres

  • options TableOptions: Un objet d’options contenant des instructions pour l’opération.

Retourne

ResultContainer : Un objet contenant le résultat de l’opération.

Exceptions

ArgumentException

Si les options ne sont pas définies.

Namespace: Documentize Assembly: Documentize.dll

 Français