How to convert Pdf file to doc file in java swing?
Question
how to convert pdf file into doc file and display this doc file on jeditor pane. please any one help me thanks
Solution
You can read PDF contect by using itext. Examples are there in below link
http://itextpdf.com/book/toc.php
But if the requirement is just to display PDF content than I believe you can use PDFRenderer to display PDF document.
http://www.javaworld.com/javaworld/jw-06-2008/jw-06-opensourcejava-pdf-renderer.html?page=1
OTHER TIPS
I am assuming what you want to do is read a PDF, and display its contents as text in a JTextArea. Probably the easiest way to do this would be using Apache's PDFBox. The PDFTextStripper
class should help you accomplish this:
PDDocument doc = PDDocument.load(new File("/path/to/file.pdf"));
String text = new PDFTextStripper().getText(doc);
// display in some JTextArea
You can find several other examples in the tutorials. If formatting is important, you can also try converting it to an image, or use a library like JMagick.