 In this program we are going to see how we can find a text from the PDF Okay, let's get started here. We are having The previous program so I have cleared a little bit and here's a game plan. So first of all we are going to create Object of the text executor class, then we are going to load the document Then we are going to turn on the word matching mode We're going to edit to all the pages We will see if we can find a text if we can we will edit To find all of the text and we are going to display the result which is contained in the search result element So let's get started. So I am going to add sample program here, which I already have in the desktop and Let me show you how we are So this is a PDF and we are going to search for the word if some we can see we are having the three words Two in the first page and the one in the second page. I'm going to copy it and Paste it here. Oh Didn't copy. Let me try again right-click copy and Paste I'm also going to include in the output directory copy always and We're all set. So this way. Let me create the Instance I'm going to pass a registration name and key in the constructor itself Okay, next step load document extractor load document from file sample program to dot PDF Okay third step is like Enable word matching mode. So let's see We are having the one property word matching mode and We are having the three nms like none exit match and smart match Exit match will exactly match the word If if we set it to none then it will also search for the partially keyword Like there is one main keyword and It is containing in another keyword like here We are having the load document from file But if we only search for the document then it will search it like substring and for the smart match It will search for the various combination just like we can search in the adobeclobat itself For this demo, we are going to have the exit match I'm going to iterate from all the pages. So Getting the all the page counts extractor dot get page count and I'm going to iterate it Now we are going to enable the search like if extractor dot find text if we can find it and I'm going to pass a page index which is index. It's zero base page index The word I'm going to set is if some and it's case sensitive. No if we if we can find it it then we are going to hear the next step would be Displaying all the results like We're getting like search result element Let me have it in the for loop For each search result element Element in extractor dot found text dot elements and We are going to get all the properties like let's see what we can find out Basically, we are going to console it writing down in the console In the page number it's zero base. So we are incremented it Let's see what we have in this element we are having the color is it bold is italic font size height index left Stop, okay, I guess we get Most of the useful properties here When we respect top left We will see what is the height of it and also the Way top left Let's also write about the whether it is bold element or Is font is bold that's his italics element or font is italic Let's get the font name font name and Also the font size Let's also get the color and also make sure We are holding the console So that we can read it and Let's start Okay, it is we are getting the two results one in the page one one in the page two But if you remember like in the program itself, we are going we have found the three results Two in the page one and one in the page two. So let's see what went wrong. Oh Yeah, once we found it like we need to continuously it rated like till it Next so let us try again And here it is so two in the page one and one in the page two the page two it's Slightly colored font size is smaller It's also italics. It's bold like we see here In the page where it's its font size is smaller So let's see Yes, it's one size is small eight and the first one it's one size is bigger and It's bold. So I guess it's working correctly So that's all guys so this way we can find the text from the byte scout pdfxl SDK using it and We also have the fine-grained control like about the found results We can get the each most of the specific details about the found text here