Class TextExtractorOptions
محتويات
[
يخفي
]TextExtractorOptions class
يمثل خيارات استخراج النص لملحق TextExtractor.
public sealed class TextExtractorOptions : PdfExtractorOptions
Constructors
Name | Description |
---|---|
TextExtractorOptions() | يقوم بتهيئة مثيل جديد من كائن TextExtractorOptions مع وضع تنسيق النص ‘Raw’ (افتراضي). |
TextExtractorOptions(TextFormattingMode) | يقوم بتهيئة مثيل جديد من كائن TextExtractorOptions لوضع تنسيق النص المحدد. |
Properties
Name | Description |
---|---|
FormattingMode { get; } | يحصل على وضع التنسيق. |
Inputs { get; } | يعيد مجموعة بيانات ملحق PdfExtractor. |
override OperationName { get; } | يعيد اسم العملية. |
Methods
Name | Description |
---|---|
AddInput(IDataSource) | يضيف مصدر بيانات جديد إلى مجموعة بيانات ملحق PdfExtractor. |
Other Members
Name | Description |
---|---|
enum TextFormattingMode | يحدد أوضاع مختلفة يمكن استخدامها أثناء تحويل مستند PDF إلى نص. انظر كلاس TextExtractorOptions . |
Remarks
يستخدم كائن TextExtractorOptions
لتعيين TextFormattingMode
وخيارات أخرى لعملية استخراج النص. كما أنه يرث وظائف لإضافة بيانات (ملفات، تدفقات) تمثل مستندات PDF المدخلة.
Examples
المثال يوضح كيفية استخراج محتوى النص من مستند PDF.
// create TextExtractor object to extract PDF contents
using (TextExtractor extractor = new TextExtractor())
{
// create TextExtractorOptions object to set TextFormattingMode (Pure, or Raw - default)
extractorOptions = new TextExtractorOptions(TextExtractorOptions.TextFormattingMode.Pure);
// add input file path to data sources
extractorOptions.AddInput(new FileDataSource(inputPath));
// perform extraction process
ResultContainer resultContainer = extractor.Process(extractorOptions);
// get the extracted text from the ResultContainer object
string textExtracted = resultContainer.ResultCollection[0].ToString();
}
See Also
- class PdfExtractorOptions
- namespace Aspose.Pdf.Plugins
- assembly Aspose.PDF