How it works…

A File object was created representing the PDFFile.pdf. The PDDocument class's static load method created an instance of PDDocument that holds the contents of the file. The close method was used to close the PDDocument once we were through with it:

File file = new File("PDFFile.pdf");
PDDocument pdDocument = PDDocument.load(file);

The PDFTextStripper class extracted the text from the document. The text was then displayed:

PDFTextStripper pdfTextStripper = new PDFTextStripper();
String documentText = pdfTextStripper.getText(pdDocument);
System.out.println(documentText);
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.104.97