Class TableGenerator

Thông tin

Đại diện cho plugin Documentize.TableGenerator. Sử dụng để thêm một bảng vào tài liệu PDF.

public sealed class TableGenerator

Kế thừa

objectTableGenerator

Các thành viên kế thừa

Ví dụ

Ví dụ này minh họa cách thêm bảng vào tệp PDF.

// Khởi tạo TableGenerator
var plugin = new TableGenerator();
// Cấu hình tùy chọn bảng
var options = new TableOptions().InsertPageBefore(1)
   .AddTable()
        .AddRow()
            .AddCell().AddParagraph("Tên")
            .AddCell().AddParagraph("Tuổi")
        .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");
// Thêm đường dẫn tệp đầu vào
options.AddInput(new FileDataSource("path_to_input.pdf"));
// Đặt đường dẫn tệp đầu ra
options.AddOutput(new FileDataSource("path_to_output.pdf"));
// Thực hiện quá trình
plugin.Process(options);

Constructors

TableGenerator()

public TableGenerator()

Phương thức

Process(TableOptions)

Thêm bảng vào tài liệu PDF.

public ResultContainer Process(TableOptions options)

Tham số

  • options TableOptions: Một đối tượng tùy chọn chứa các hướng dẫn cho hoạt động.

Trả về

ResultContainer : Một đối tượng chứa kết quả của hoạt động.

Ngoại lệ

ArgumentException

Nếu tùy chọn không được thiết lập.

Namespace: Documentize Assembly: Documentize.dll

 Tiếng Việt