Commit fe6dbd5d authored by 9731013's avatar 9731013

Add printing pdf and the pdf file

parent 6c3c82ea
Pipeline #317 canceled with stages
import com.itextpdf.text.pdf.PdfReader;
import com.itextpdf.text.pdf.parser.PdfTextExtractor;
public class a{
public static void main(String args[]){
try{
PdfReader pdfReader = new PdfReader("a.pdf");
System.out.println(pdfReader.getNumberOfPages());
int cnt =pdfReader.getNumberOfPages();
for(int i=1 ; i<=cnt ; i++){
String str = PdfTextExtractor.getTextFromPage(pdfReader, i);
System.out.println(str);
}
} catch (Exception e){
System.out.println(e.getMessage());
......
File added
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