aspose.pdf - Underline text in PDF on Mouse Text Selection in Asp.net -
can guide me how can achieve in web application ? using aspose.pdf third party dll in order achieve this.i want select text in pdf using mouse , want underline selected text.
once have selected string on pdf file, may selected string , parse selected string aspose.pdf .net api , have tried updating formatting underlined text. please take on following code snippet underline searched string.
// open document document pdfdocument = new document("c:/pdftest/table_abc.pdf"); // create textabsorber object find instances of input search phrase textfragmentabsorber textfragmentabsorber = new textfragmentabsorber("employee_name"); // accept absorber pages pdfdocument.pages.accept(textfragmentabsorber); // extracted text fragments textfragmentcollection textfragmentcollection = textfragmentabsorber.textfragments; // loop through fragments foreach (textfragment textfragment in textfragmentcollection) { // underline selected string textfragment.textstate.underline = true; } // save resulting pdf document. pdfdocument.save("c:/pdftest/textunderlined.pdf");
my name nayyer , developer evangelist @ aspose.
Comments
Post a Comment