I have been trying to read a pdf which is opened in browser. through the following selenium code.
URL pdfURL = new URL(driver.getCurrentUrl());
InputStream is = pdfURL.openStream();
BufferedInputStream fileToParse= new BufferedInputStream(is);
PDFParser pdfParser=new PDFParser(fileToParse);
pdfParser.parse(); // getting error here !!!
Getting Error:
java.io.IOException: Error: End-of-File, expected line
enter code here
How to get rid of this error?