Commit 96b3fa13 authored by 9731050's avatar 9731050

second change

parent 41f9a28c
Pipeline #316 canceled with stages
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
import com.itextpdf.text.pdf.PdfReader;
import com.itextpdf.text.pdf.parser.PdfTextExtractor;
public class Main {
public static void main(String[] args) {
try {
PdfReader pdfReader = new PdfReader("test.pdf");
System.out.println(""+pdfReader.getNumberOfPages());
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);
}
} 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