My web application loads a pdf in the browser. I have figured out how to check that the pdf has loaded correctly using:
verifyAttribute xpath=//embed/@src {URL of P
You cannot do this using WebDriver natively. However, PDFBox API can be used here to read content of PDF file. You will have to first of all shift a focus to browser window where PDF file is opened. You can then parse all the content of PDF file and search for the desired text string.
Here is a code to use PDFBox API to search within PDF document.