Skip to content

Instantly share code, notes, and snippets.

@sbosell
Created January 11, 2017 19:45
Show Gist options
  • Save sbosell/631e7385000621bbd4c0bd9f464488b2 to your computer and use it in GitHub Desktop.
Save sbosell/631e7385000621bbd4c0bd9f464488b2 to your computer and use it in GitHub Desktop.
TextAbsorber Example
TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber("Speaker.FullName");
textFragmentAbsorber.TextSearchOptions.IsRegularExpressionUsed = false;
//accept the absorber for all the pages
file.Document.Pages.Accept(textFragmentAbsorber);
//get the extracted text fragments
TextFragmentCollection textFragmentCollection = textFragmentAbsorber.TextFragments;
//loop through the fragments
foreach (TextFragment textFragment in textFragmentCollection)
{
//update text and other properties
textFragment.Text = "The Speaker" ;
}
file.Document.Flatten();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment