flyingsaucerproject/flyingsaucer — pull request #56 by micw (2014-08-26 09:32:21+00:00)
Title: Detect "PDF-Images" using the first few bytes of stream

Hi,

I had some problems with background-pdf-images from classpath after packaging as jar. The problem is that ITextRenderer tries to detect if an image is a PDF using "path" from the URI which points to the jar, not to the PDF.

So I created a stream wrapper that reads a few bytes (and then resets the stream) to detect the stream's content on a reliable way and changed both ITextRenderer implementations.