A fix to take care of broken PDFs that have whitespaces after "stream" before the LF.

git-svn-id: svn://svn.code.sf.net/p/itextsharp/code/trunk@14 820d3149-562b-4f88-9aa4-a8e61a3485cf
master
psoares33 2008-10-07 22:05:32 +00:00
parent f971851d24
commit 688cd64b13
1 changed files with 5 additions and 1 deletions

View File

@ -1521,7 +1521,11 @@ namespace iTextSharp.text.pdf {
int pos = tokens.FilePointer;
// be careful in the trailer. May not be a "next" token.
if (tokens.NextToken() && tokens.StringValue.Equals("stream")) {
int ch = tokens.Read();
//skip whitespaces
int ch;
do {
ch = tokens.Read();
} while (ch == 32 || ch == 9 || ch == 0 || ch == 12);
if (ch != '\n')
ch = tokens.Read();
if (ch != '\n')