Commit 40f0fa4e authored by m.m.vahedi's avatar m.m.vahedi

somethings added

parents
Pipeline #334 canceled with stages
public class Main {
public static void main(String[] args) {
// write your code here
}
}
package PDFFReaderTest;
import com.itextpdf.text.pdf.*;
import com.itextpdf.text.pdf.parser.PdfTextExtractor;
import java.io.IOException;
public class PDFReaderTest {
public static void main(String arf[]) throws IOException {
PdfReader pdfReader = null;
try {
pdfReader = new PdfReader("test.pdf");
} catch (Exception e) {
e.printStackTrace();
}
int pages = pdfReader.getNumberOfPages();
for( int i = 1 ; i <= pages ; i++ ){
String pageContent = PdfTextExtractor.getTextFromPage(pdfReader,i);
System.out.println("Content on page "+ i + ": "+ pageContent);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment