Class TableGenerator

信息

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

[Obsolete("The class will be deleted soon. Please use PdfManager class.")]
public static class TableGenerator

继承

objectTableGenerator

继承成员

示例

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

// Configure table options
var options = new TableOptions().InsertPageBefore(1)
   .AddTable()
        .AddRow()
            .AddCell().AddParagraph("Name")
            .AddCell().AddParagraph("Age")
        .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");
// Add input file path
options.AddInput(new FileData("path_to_input.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_output.pdf"));
// Perform the process
TableGenerator.Process(options);

方法

Process(TableOptions)

向 PDF 文档添加表格。

public static ResultContainer Process(TableOptions options)

参数

返回值

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

异常

ArgumentException

如果未设置 options。

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

 中文