second part copied

parent 0ab95daf
...@@ -5,13 +5,14 @@ public class PDFReadderTest { ...@@ -5,13 +5,14 @@ public class PDFReadderTest {
public static void main(String[] args) { public static void main(String[] args) {
try { try {
PdfReader pdfReader = new PdfReader("test.pdf"); PdfReader pdfReader = new PdfReader("test.pdf");
} catch (Exception e) {
e.printStackTrace();
}
int pages = pdfReader.getNumberOfPages(); int pages = pdfReader.getNumberOfPages();
for (int i = 1; i <= pages; i++) { for (int i = 1; i <= pages; i++) {
String pageContent = PdfTextExtractor.getTextFromPage(pdfReader, i); String pageContent = PdfTextExtractor.getTextFromPage(pdfReader, i);
System.out.println("Content on Page " + i + ": " + pageContent); System.out.println("Content on Page " + i + ": " + pageContent);
} }
} catch (Exception e) {
e.printStackTrace();
}
} }
} }
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