Hello List,
I am attempting to extract the plain text from a pdf using PdfReader and
PdfTextExtractor in pretty much the exact way it is described in iText in
Action, Listing 15.27. When I run the code on my document, I end up with
the exception "StringIndexOutOfBoundsException: String index out of range:
0". The document is from a client and confidential, so I cannot include it
here.
I've followed the exception to LocationTextExtractionStrategy.java, line
121. In my document, chunk.text ends up as an empty String (""), causing
the first call to charAt() to throw the Array out of Bounds.
The simple solution seems to be just to continue the loop if
chunk.text.equals(""), leaving lastChunk alone. Building iText and trying
it out myself lead to a swathe of font problems I don't really want to fix
if I don't have to, so I'm not sure if this introduces other problems.
Anyhow, I suppose the question is whether this is a bug or is there a way
for me to work around this?
Thanks for any help you can provide.
Mit freundlichen Grüßen - Yours sincerely
Adam Read
Consultant Analyst
Telekommunikation
Steria Mummert Consulting AG
Friedrichstraße 148
D-10117 Berlin
Germany
Tel: +49 30 206188 5425
Fax: +49 30 206188 1425
Mobil: +49 151 4062 5425
adam.r...@steria-mummert.de
www.steria-mummert.de
Steria Mummert Consulting AG
Vorsitzender des Aufsichtsrates: Jürgen Sponnagel - Vorstand: Oliver Nazet
(Vors.), Dr. Reinhard Liedl, Dr. Fritz Moser
Gesellschaftssitz: Hamburg - HR B 61 116 Amtsgericht Hamburg - USt-ID-Nr.:
DE118671351
Bitte denken Sie an Ihre Verantwortung gegenüber der Umwelt: Jede ausgedruckte
E-Mail verursacht ca. 0,3 Gramm CO2 pro Seite.
Diese Nachricht kann vertrauliche Informationen enthalten und ist allein für
den Adressaten bestimmt. Wenn Sie nicht der rechtmäßige Empfänger sind, sind
der Zugriff, die Weiterleitung, das Kopieren, die Veröffentlichung oder
anderweitige Verwendung des Inhalts untersagt. In diesem Fall bitten wir Sie,
den Absender unverzüglich zu informieren und diese E-Mail sowie sämtliche
Kopien dieser E-Mail zu löschen. Der Inhalt von E-Mails innerhalb des Netzwerks
kann überprüft werden, um die Übereinstimmung mit den geltenden
Firmenrichtlinien und Vorgehensweisen zu gewährleisten. E-Mails können auf dem
Transportweg von Dritten verändert werden, so dass deren Vollständigkeit und
Echtheit nicht garantiert werden können.
This e-mail communication may contain confidential information and is intended
only for the recipient. If you are not the intended recipient you are not
allowed to read, copy, distribute, publicize or use the content of this e-mail
in any way. Please notify the sender and delete the e-mail and any copies of
it. The content of e-mails within our network may be monitored to ensure
compliance with company policies and procedures. E-mails can be alterated by
third parties in transit. Therefore any e-mail is susceptible to alteration and
its integrity cannot be assured.
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
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