public static void main(String[] args) throws Exception, IOException
File file = new File("File.pdf");
PDDocument document = PDDocument.load(file);
PDFTextStripper pdfStripper = new PDFTextStripper();
pdfStripper.setStartPage(1);
pdfStripper.setEndPage(1);
//load all lines into a string
String pages = pdfStripper.getText(document);
//split by detecting newline
String[] lines = pages.split("\r\n|\r|\n");
int count=1; //Just to indicate line number