You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Donald Henri AZOKLI-ASSOGBA <he...@hotmail.com> on 2012/02/23 01:35:19 UTC
how read a pdf document
Can you explain me how will i do to read in my application any pdf document?? thks
Re: how read a pdf document
Posted by Dirk Högemann <di...@googlemail.com>.
...
import java.io.File;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.util.PDFTextStripper;
...
try
{
PDDocument pddDocument = PDDocument.load(new
File("C:/spaces.pdf"));
PDFTextStripper textStripper=new PDFTextStripper();
pddDocument.close();
String sStripped = textStripper.getText(pddDocument);
}
catch(Exception ex)
{
ex.printStackTrace();
}
Best
Dirk
2012/2/23 Donald Henri AZOKLI-ASSOGBA <he...@hotmail.com>
> Can you explain me how will i do to read in my application any pdf
> document?? thks