Add whitespace tolerance when searching for inline image EI operand

This commit is contained in:
Adrian-George Bostan 2020-02-10 20:08:47 +02:00
parent e2b3c6e6ba
commit e9d2f1de3c

View File

@ -411,6 +411,12 @@ func (csp *ContentStreamParser) ParseInlineImage() (*ContentStreamInlineImage, e
skipBytes = []byte{}
skipBytes = append(skipBytes, c)
state = 1
} else if c == 'E' {
// Allow cases where EI is not preceded by whitespace.
// The extra parsing after EI<ws> should be sufficient
// in order to decide if the image stream ended.
skipBytes = append(skipBytes, c)
state = 2
} else {
im.stream = append(im.stream, c)
}