Class FormFlattener
Thông tin
Đại diện cho plugin Documentize.FormFlattener. Được dùng để làm phẳng các trường trong tài liệu PDF.
[Obsolete("The class will be deleted soon. Please use PdfForm class.")]
public static class FormFlattenerInheritance
Inherited Members
- 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 làm phẳng các trường trong tệp PDF.
// Create FormFlattenerOptions object to set instructions
var options = new FormFlattenerOptions();
// Add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
// Perform the process
FormFlattener.Process(options);Ví dụ minh họa cách làm phẳng các trường trong tệp PDF và bỏ qua trường đầu tiên.
// Get Fields Names
var fieldNames = FormFlattener.GetFieldNames("path_to_your_pdf_file.pdf");
// Create FormFlattenerOptions object to set instructions
var options = new FormFlattenerOptions();
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
// Skip 1 field.
options.SkipFields.Add(fieldNames[0]);
// Perform the process
FormFlattener.Process(options);Ví dụ minh họa cách lấy tên các trường từ tệp PDF.
// Get Fields Names
var fieldNames = FormFlattener.GetFieldNames("path_to_your_pdf_file.pdf");Phương thức
GetFieldNames(string)
Lấy tên các trường trong tài liệu PDF.
public static List<string> GetFieldNames(string path)Tham số
pathstring: Đường dẫn tới tài liệu PDF.
Trả về
Danh sách các tên trong tài liệu PDF.
GetFieldNames(Stream) : Lấy tên các trường trong tài liệu PDF.
public static List<string> GetFieldNames(Stream stream)Tham số
streamStream: Luồng chứa tài liệu PDF.
Trả về
Danh sách các tên trong tài liệu PDF.
Process(FlattenFieldsOptions) : Làm phẳng các trường biểu mẫu trong tài liệu PDF.
public static ResultContainer Process(FlattenFieldsOptions options)Tham số
optionsFlattenFieldsOptions: Đối tượng tùy chọn chứa các chỉ dẫn cho quá trình thực thi.
Trả về
ResultContainer : Đối tượng chứa kết quả của thao tác.
Ngoại lệ
Nếu tùy chọn không được thiết lập.
Namespace: Documentize Assembly: Documentize.dll