Class TableGenerator

信息

表示 Documentize.TableGenerator 插件。用于向 PDF 文档添加表格。

[Obsolete("请使用 PdfManager 类。该类将很快被删除。")]
public static class TableGenerator

继承

objectTableGenerator

继承的成员

示例

该示例演示如何向 PDF 文件添加表格。

// 配置表格选项
var options = new TableOptions().InsertPageBefore(1)
   .AddTable()
        .AddRow()
            .AddCell().AddParagraph("姓名")
            .AddCell().AddParagraph("年龄")
        .AddRow()
            .AddCell().AddParagraph("鲍勃")
            .AddCell().AddParagraph("12")
        .AddRow()
            .AddCell().AddParagraph("山姆")
            .AddCell().AddParagraph("20")
        .AddRow()
            .AddCell().AddParagraph("桑迪")
            .AddCell().AddParagraph("26")
        .AddRow()
            .AddCell().AddParagraph("汤姆")
            .AddCell().AddParagraph("12")
        .AddRow()
            .AddCell().AddParagraph("吉姆")
            .AddCell().AddParagraph("27");
// 添加输入文件路径
options.AddInput(new FileDataSource("path_to_input.pdf"));
// 设置输出文件路径
options.AddOutput(new FileDataSource("path_to_output.pdf"));
// 执行处理
TableGenerator.Process(options);

方法

Process(TableOptions)

向 PDF 文档添加表格。

public static ResultContainer Process(TableOptions options)

参数

  • options TableOptions: 一个包含操作指令的选项对象。

返回

ResultContainer : 一个包含操作结果的对象。

异常

ArgumentException

如果未设置选项。

命名空间: Documentize 程序集: Documentize.dll

 中文