The answer to your question (which actually *is* a good question - but I did
answer it in my original response!) is that you have a non-conformant PDF
that specifies several number in part of it's content stream using two
negative signs instead of just one.  That is clearly not right - can you
imagine writing code like this:

int x = --5;

and expecting it to work (well, outside of the semantecs of
auto-decrement...  I guess that's a bad example, eh?).

Anyway, yes - this can (and will) be tweaked in the content parser so if it
sees a negative sign, it just ignores all other negative signs until it hits
a numeral.  But really, someone needs to go back to whoever created this PDF
and tell them they bought a bad PDF generation library.  You would be
absolutely astounded at the junk that gets into PDFs...

<rant: on>
I think that the general lesson learned by the entire development community
over the past 15 years (based on the fiasco that was Internet Explorer's
permissive - and often incorrect - handling of HTML) is that it's better to
fail fast and force the developer to fix their mistake.  Otherwise, we wind
up with a juggernaut of bad syntax out in the world that takes a massive,
massive effort to fix.

Long and short, Adobe may decide at some point in the future to stop being
so permissive, at which point all of those PDFs will suddenly be
non-readable.  The users will all blame Adobe, but really the only mistake
that Adobe made was allowing bad syntax for so long.
</rant>

Cheerio,

- K


RIchard Hammond wrote
> 
> I am not embarking on an Itext, PDF or Adobe bashing exercise here, I was
> just curious as to why Itext wouldn't/didn't convert the 'PDF' file I was
> originally working on ... Regards Richard
> 


--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/PDFTextExtractor-returns-an-exception-Input-string-was-not-in-a-correct-format-when-parsing-this-file-tp4357472p4360359.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
iText-questions mailing list
[email protected]
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

Reply via email to