Hi
Our document have this text
image.png (2.0 KB)
When we search this, fragments return different order but we need original typed text.
How can suppress changing order ?
//"[ENV-W١٠: {{WSFP: ١٥٠x٥٠}}/]";
var asposePDFDoc = new Document(@"C:\Storage\LangAr.pdf");
string pattern = @"\[ENV-W[\u0661-\u0669]\u0660:[^/]*";
///
/// 1
var tfAbsorber = new TextFragmentAbsorber(pattern)
{
TextSearchOptions = new TextSearchOptions(true)
};
asposePDFDoc.Pages.Accept(tfAbsorber);
// "{{١٥٠x٥٠ :WSFP}} :ENV-W١٠]"
string resultText = tfAbsorber.TextFragments[1].Text;
///
/// 2
var rGex = new System.Text.RegularExpressions.Regex(pattern,
System.Text.RegularExpressions.RegexOptions.IgnoreCase |
System.Text.RegularExpressions.RegexOptions.CultureInvariant |
System.Text.RegularExpressions.RegexOptions.RightToLeft);
var tfAbsorber2 = new TextFragmentAbsorber(rGex)
{
TextSearchOptions = new TextSearchOptions(true)
//ExtractionOptions = new TextExtractionOptions(TextExtractionOptions.TextFormattingMode.Raw)
//TextReplaceOptions = new TextReplaceOptions(TextReplaceOptions.ReplaceAdjustment.None)
};
tfAbsorber2.TextEditOptions.AllowLanguageTransformation = false;
asposePDFDoc.Pages.Accept(tfAbsorber2);
// "{{١٥٠x٥٠ :WSFP}} :ENV-W١٠]"
string resultText2 = tfAbsorber2.TextFragments[1].Text;
LangAr.pdf (132.0 KB)