i am reading pdf through java but problem is like that i am reading 500 pages at that time they can read only 496 pages plz tell me what can i do my code is bellow
public class pdf1 { public static void main(String[] args) throws SQLException, ClassNotFoundException { try { PdfReader reader = new PdfReader("me1.pdf"); // int n = reader.getNumberOfPages(); File outFile = new File("b.csv"); int n=500; int count=0; BufferedWriter writer = new BufferedWriter(new FileWriter(outFile)); for(int i=1;i<=n;i++) { String str=PdfTextExtractor.getTextFromPage(reader, i); System.out.println(str); writer.write(str); count++; } System.out.println(count); } catch (IOException e) { e.printStackTrace(); } } }
getNumberOfPages
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)