Download pdfbox-2.0.3.jar, fontbox-2.0.3.jar, preflight-2.0.3.jar, 
xmpbox-2.0.3.jar, pdfbox-tools-2.0.3.jar and pdfbox-debugger-2.0.3.jar
from http://pdfbox.apache.org/

Then:

 import java.io.InputStream;
 import java.io.IOException;
 import org.apache.pdfbox.pdmodel.PDDocument;
 import org.apache.pdfbox.tools.PDFText2HTML;

    // .....
    try {
        InputStream is = // ..... Read PDF file
        PDDocument pdd = PDDocument.load(is); //This is the in-memory 
representation of the PDF document.
        PDFText2HTML converter = new PDFText2HTML(); // the converter
        String html = converter.getText(pdd); // That's it!
        pdd.close();
        is.close();
    } catch (IOException ioe) {
        // ......
    }


Please note: Images do not get pushed to the HTML output.


Best Regards,
Sergio Muriel



________________________________
From: Raj Bahadur <[email protected]>
Sent: Monday, November 21, 2016 8:21 AM
To: [email protected]; [email protected]; [email protected]
Subject: Need a sample application to convert PDF File to HTML File in 2.0

Hello Dev Team,

I have a requirement to convert the PDF File to HTML File, I have searched
in google but not getting any response.

Can you, please share any sample to so that I can implement in our project.

Appreciate your help, as we are running out of time.

Regards,
Rah

Reply via email to