Created
June 17, 2014 02:00
-
-
Save davertay/dca6db7e2fb8b6392808 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.snowtide.pdf.OutputTarget; | |
import com.snowtide.pdf.PDFTextStream; | |
public class ExtractTextAllPages { | |
public static void main (String[] args) | |
{ | |
String pdfFilePath = args[0]; | |
PDFTextStream pdfts = new PDFTextStream(pdfFilePath); | |
StringBuilder text = new StringBuilder(1024); | |
pdfts.pipe(new OutputTarget(text)); | |
pdfts.close(); | |
System.out.printf("The text extracted from %s is:", pdfFilePath); | |
System.out.println(text); | |
} | |
} | |
// Need pdftextstream-2.7.0.jar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment