0
votes

I have one PDF file. I want to replace few paragraphs of this PDF file by some other text from files like(.doc/ .docx/ .xls). how to scan and edit text paragraph wise or sentence wise in the same PDF document.

Thanks alot in advance..

1
Try apache pdfbox or itext library.Nailgun
You seem to be assuming that if you modify text in a PDF it will somehow be seamlessly integrated into the document. The PDF is like a printed page that has already been laid out. Decisions about page layout (where a text box is, for instance) were made by the program that originally wrote the PDF. While you can make small changes using PDFBox or iText, don't expect the page format and text flow to magically adjust to the new text. A PDF is like a printed page. You could apply some white-out or cut/paste some paper corrections, but the layout won't adjust.Jim Garrison

1 Answers

0
votes

You can use PDFBox library (http://pdfbox.apache.org/) to extract the text from PDF and use hssf library to extract the data from word or excel file. Then you can do all your manipulations and finally create new PDF doc with the updated text data.