Reading PDF contents is not a functionality which is natively supported by WebDriver. However, PDFBox API can be used read the content of a PDF file. The only thing to remember is, you have to shift the focus of browser window to the opened PDF. Post this, you can parse the contents of your PDF and then search for any text string.
Sample code for using PDFBox API within Selenium is below. It worked for me. You can download the JAR from here: https://pdfbox.apache.org/index.html
public void ReadPDF() throws Exception
{
//For defining the URL of PDF
URL TestURL = new URL("http://www.axmag.com/download/pdfurl-guide.pdf");
// For converting content inside PDF to text & using PDFBox API with java input stream for parsing
BufferedInputStream TestFile = new BufferedInputStream(TestURL.openStream());
PDFParser TestPDF = new PDFParser(TestFile);
TestPDF.parse();
String TestText = new PDFTextStripper().getText(TestPDF.getPDDocument());
// Use TestNG assertion for checking if your text is present in content
Assert.assertTrue(TestText.contains("Open the setting.xml, you can see it is like this"));
}