Hi all,
I want to use the PDF module to save a user profile to a file (a PDF file of course).
class models.User -> firstname, lastname, avatar
avatar is a blob (a JPEG file)
I render avatar with URL like :
http://localhost:9000/user/{userid}/avatar.jpgand Play! renderBinary method.
I use the HTML template for the PDF rendering, with a CSS dedicated to "print mode".
But the avatar is never displayed with PDF. (like if it doesn't exist)
I tried with relative URL, or with absolute one. It's the same.
If I put the avatar file to /public/images directory, and change URL for this staticDir -> it's OK
I found some topics about that, and tried a lot of lines of codes, but without success.
In debug mode, I have see :
ITextUserAgent.getImageResource(String) line: 66
-> generate exception :
java.io.IOException: The byte array is not a recognized imageformat.
-> and go to :
ITextUserAgent.getImageResource(String) line: 70
the stack trace :
Thread [play-thread-1] (Suspended)
ITextUserAgent.getImageResource(String) line: 66
ExtendedITextReplacedElementFactory(ITextReplacedElementFactory).createReplacedElement(LayoutContext, BlockBox, UserAgentCallback, int, int) line: 57
ExtendedITextReplacedElementFactory.createReplacedElement(LayoutContext, BlockBox, UserAgentCallback, int, int) line: 72
BlockBox.calcDimensions(LayoutContext, int) line: 677
BlockBox.calcDimensions(LayoutContext) line: 631
BlockBox.layout(LayoutContext, int) line: 768
BlockBox.layout(LayoutContext) line: 735
Someone can help me ?
Thanks