Commit 9172ffde authored by 9731114's avatar 9731114

pdf

parent 5b60d955
Pipeline #333 failed 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;
import java.io.IOException;
public class Pdf {
public static void main(String[] args) throws IOException {
PdfReader pdfReader = new PdfReader("test.pdf");
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);
System.out.println("SALAM<!!");
}
}
}
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