Class TextExtractor
Class TextExtractor
Namespace: Aspose.Pdf.Plugins
Assembly: Aspose.PDF.dll
Đại diện cho plugin TextExtractor.
public class TextExtractor : PdfExtractor, IPlugin, IDisposable
Kế thừa
object ← PdfExtractor ← TextExtractor
Triển khai
Các thành viên kế thừa
PdfExtractor.Process(IPluginOptions), PdfExtractor.Dispose(), object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Ví dụ
Ví dụ này minh họa cách trích xuất nội dung văn bản của tài liệu PDF.
// tạo đối tượng TextExtractor để trích xuất văn bản trong nội dung PDF
using (TextExtractor extractor = new TextExtractor())
{
// tạo TextExtractorOptions
textExtractorOptions = new TextExtractorOptions();
// thêm đường dẫn tệp đầu vào vào các nguồn dữ liệu
textExtractorOptions.AddDataSource(new FileDataSource(inputPath));
// thực hiện quá trình trích xuất
ResultContainer resultContainer = extractor.Process(textExtractorOptions);
// lấy văn bản đã trích xuất từ đối tượng ResultContainer
string textExtracted = resultContainer.ResultCollection[0].ToString();
}
Nhận xét
Đối tượng Aspose.Pdf.Plugins.TextExtractor được sử dụng để trích xuất văn bản trong các tài liệu PDF.
Các hàm khởi tạo
TextExtractor()
public TextExtractor()