Hello,
 I am trying to do the PDF to Text conversion in the Websphere Environment 
using RAD7.

Please see below for the code snippet.

I keep on getting the below error with the empty output file.

Jan 20, 2010 3:18:45 PM org.apache.pdfbox.util.PDFStreamEngine 
processOperator
INFO: unsupported/disabled operation: BDC
Jan 20, 2010 3:18:45 PM org.apache.pdfbox.util.PDFStreamEngine 
processOperator
INFO: unsupported/disabled operation: g




                        int ITERATIONS = 10;

                        try
                        {
 
                                StringWriter sw = new StringWriter();
                        PDDocument doc = null;
                        BufferedWriter writer = null;
                                File dir1 = new File("c:\\temp");
                                dir1 = new File(dir1, "reports-test");
                                File fileName = new File(dir1, 
"pdf_reference_1-7.pdf");
                                System.out.println("FIle in" + 
fileName.getName());
 
                                File output = new 
File(fileName.getParent(), "pdf-reference_1-7.txt");
                                System.out.println("FIle out" + 
output.getName());
 
                                long start = 0;
                                long elapsed = 0;
 
                        try {
                            doc = PDDocument.load(fileName);
                            System.out.println(doc.getNumberOfPages());
                            System.out.println(doc.isEncrypted());

 
                            PDFTextStripper stripper = new 
PDFTextStripper(); 
 
 
                            for (int i = 0; i < ITERATIONS; i++) {
                                                writer = new 
BufferedWriter(new OutputStreamWriter(new FileOutputStream(output), 
"UTF-8"));
                                                start = System.nanoTime();
                                                stripper.writeText(doc, 
writer);
                                                elapsed += System.nanoTime
() - start;
                                                writer.close();
                                        }

 
                        } finally {
                             if (doc != null) {
                                 doc.close();
                             }
                        }
 
                        }
                        catch(Exception e)
                        {
                        }


Thanks,
_____________________________________________
Varma Padmaraju

U.S. BANCORP made the following annotations
---------------------------------------------------------------------
Electronic Privacy Notice. This e-mail, and any attachments, contains 
information that is, or may be, covered by electronic communications privacy 
laws, and is also confidential and proprietary in nature. If you are not the 
intended recipient, please be advised that you are legally prohibited from 
retaining, using, copying, distributing, or otherwise disclosing this 
information in any manner. Instead, please reply to the sender that you have 
received this communication in error, and then immediately delete it. Thank you 
in advance for your cooperation.



---------------------------------------------------------------------

Reply via email to