I am using TextFragment to iterate over page content to remove the text from page.
Hi Deependra,
Hi Tilal,
Hi Deependra,
Please use Rotation
property in TextState
of TextFragment
.
Please consider the following code:
//open document
Document pdfDocument = new Document(inputDocument);
//create TextAbsorber object to find all the phrases matching the regular expression
TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber(@"[\S]+");//like 1999-2000
//set text search option to specify regular expression usage
TextSearchOptions textSearchOptions = new TextSearchOptions(true);
textFragmentAbsorber.TextSearchOptions = textSearchOptions;
//accept the absorber for all the pages
pdfDocument.Pages.Accept(textFragmentAbsorber);
//get the extracted text fragments
TextFragmentCollection textFragmentCollection = textFragmentAbsorber.TextFragments;
//loop through the fragments
foreach (TextFragment textFragment in textFragmentCollection)
{
Console.WriteLine("Text : {0} ", textFragment.Text);
Console.WriteLine("Rotation : {0} ", textFragment.TextState.Rotation);
}
Please try this code with latest version of the Aspose.PDF for .NET and in case of any further assistance, please feel free to let us know.