Created
January 11, 2017 19:45
-
-
Save sbosell/631e7385000621bbd4c0bd9f464488b2 to your computer and use it in GitHub Desktop.
TextAbsorber Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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