how to read pdf file line by line through java code...
link of PDF_READER is
https://drive.google.com/open?id=1-yT....
and code of ReadPdf.java file is
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.text.PDFTextStripper;
import org.apache.pdfbox.text.PDFTextStripperByArea;
import java.util.*;
import java.io.*;
import java.io.File;
import java.io.IOException;
public class ReadPdf
{
public static void main(String args[]) throws IOException
{
try
{
PDDocument document = PDDocument.load(new File("file1.pdf"));// here file1.pdf is the name of pdf file which we want to read....
document.getClass();
if (!document.isEncrypted())
{
PDFTextStripperByArea stripper = new PDFTextStripperByArea();
stripper.setSortByPosition(true);
PDFTextStripper Tstripper = new PDFTextStripper();
String str = Tstripper.getText(document);
Scanner scn = null;
scn = new Scanner(str);
String line="";
while (scn.hasNextLine())
{
line = scn.nextLine();
System.out.println("\n"+line);
}
}
document.close();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
Auf dieser Seite können Sie das Online-Video read pdf file through java code mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer satyendra singh yadav 04 April 2018 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 8,973 Mal angesehen und es wurde von 48 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!