dear all ,
Thanks a lot Ulm for the help you provided me with . i used pdfbox jar file and now with the below program i am able to get the full data of pdf onto my command prompt.
the next step is i need to extract/decompress only a particular
string from that . before that the data is encrypted also . so i need to decrypt it and then extract only that particular string ...
the prerequisites for this program approach is
1 . setting classpath with the pdf-0.7.3.jar file and also for fontbox-0.1.0.jar .
am not able to find the function please could you help me out with the program
=========================================
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.io.StringReader;
import java.util.Date;
import java.lang.String;
import org.pdfbox.pdfparser.PDFParser;
import org.pdfbox.pdmodel.*;
import org.pdfbox.util.PDFTextStripper;
import org.pdfbox.Decrypt;
public class boxpd {
public final String getContent(final File f) {
// setType("PDF");
Reader reader = null;
PDDocument pdfDocument = null;
FileInputStream fis = null;
String contents = null;
try {
System.out.println("Getting contents from PDF: " + f.getName());
fis = new FileInputStream(f);
PDFParser parser = new PDFParser(fis);
parser.parse();
pdfDocument = parser.getPDDocument();
PDFTextStripper stripper = new PDFTextStripper();
contents = stripper.getText(pdfDocument);
reader = new StringReader(contents);
}
catch (IOException e) {
System.out.println("Error: Can't open file: " + f.getName());
}
return contents; }
public static void main(String[] s)
{
boxpd box = new boxpd();
File f = new File("D:\\Exportbegleitdokument.PDF"); // some pdf file example
String str = box.getContent(f);
System.out.println("PDF Contents: " + str);
}
}
====================================
awaiting for earliest reply