hello, i used jar in android. and try to extract simply pdf data.but i got
the following exception. so any one has idea what is wrong with ?
the following is exception and code snippt.
*Exception:*
E/AndroidRuntime( 650): Uncaught handler: thread main exiting due to
uncaught e
xception
E/AndroidRuntime( 650): java.lang.VerifyError:
com.itextpdf.text.pdf.PdfReader
E/AndroidRuntime( 650): at
org.anddev.android.filebrowser.AndroidFileBro
wser.parsePdf(AndroidFileBrowser.java:77)
E/AndroidRuntime( 650): at
org.anddev.android.filebrowser.AndroidFileBro
wser$1.onClick(AndroidFileBrowser.java:107)
E/AndroidRuntime( 650): at
com.android.internal.app.AlertController$Butt
onHandler.handleMessage(AlertController.java:158)
E/AndroidRuntime( 650): at
android.os.Handler.dispatchMessage(Handler.ja
va:99)
E/AndroidRuntime( 650): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 650): at
android.app.ActivityThread.main(ActivityThrea
d.java:4203)
E/AndroidRuntime( 650): at
java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime( 650): at
java.lang.reflect.Method.invoke(Method.java:5
21)
E/AndroidRuntime( 650): at
com.android.internal.os.ZygoteInit$MethodAndA
rgsCaller.run(ZygoteInit.java:791)
E/AndroidRuntime( 650): at
com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:549)
E/AndroidRuntime( 650): at dalvik.system.NativeStart.main(Native
Method)*
code :*
public void parsePdf(String pdf, String txt) throws IOException {
Log.e("path", pdf);
PdfReader reader = new PdfReader(pdf);
PdfReaderContentParser parser = new PdfReaderContentParser(reader);
TextExtractionStrategy strategy;
for (int i = 1; i <= reader.getNumberOfPages(); i++) {
strategy = parser.processContent(i, new
SimpleTextExtractionStrategy());
System.out.println("data:"+strategy.getResultantText());
}
}
hope to hear soon.
--
Kartik Trivedi
(What you expect from other you must provide so be honest if you expect
honesty from other)
(Sun Certified Java Developer)
(Forum Nokia Champion)
------------------------------------------------------------------------------
This SF Dev2Dev email is sponsored by:
WikiLeaks The End of the Free Internet
http://p.sf.net/sfu/therealnews-com
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php