user59725
0
Q:

convert pdf to word in java

for (int i = 1; i <= reader.getNumberOfPages(); i++) {    TextExtractionStrategy strategy =      parser.processContent(i, new SimpleTextExtractionStrategy());    String text = strategy.getResultantText();    XWPFParagraph p = doc.createParagraph();    XWPFRun run = p.createRun();    run.setText(text);    run.addBreak(BreakType.PAGE);}FileOutputStream out = new FileOutputStream("src/output/pdf.docx");doc.write(out);// Close all open files
0
XWPFDocument doc = new XWPFDocument();String pdf = filename;PdfReader reader = new PdfReader(pdf);PdfReaderContentParser parser = new PdfReaderContentParser(reader);
0

New to Communities?

Join the community