Class TableGenerator
Thông tin
Đại diện cho plugin Documentize.TableGenerator. Sử dụng để thêm bảng vào tài liệu PDF.
[Obsolete("Please use PdfManager class. The class will be deleted soon.")]
public static class TableGeneratorKế thừa
Các thành viên kế thừa
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
Ví dụ
Ví dụ minh họa cách thêm bảng vào tệp PDF.
// Cấu hình các 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
TableGenerator.Process(options);Phương thức
Process(TableOptions)
Thêm bảng vào tài liệu PDF.
public static ResultContainer Process(TableOptions options)Tham số
optionsTableOptions: Một đối tượng tùy chọn chứa hướng dẫn cho thao tác.
Trả về
ResultContainer : Một đối tượng chứa kết quả của thao tác.
Ngoại lệ
Nếu các tùy chọn không được thiết lập.
Namespace: Documentize Assembly: Documentize.dll