Thank you!
This triggered the solution.
I had already controlled the bytearray and found that it had the
correct amount of bytes.
It was identical to the original photo.
So as you suggested I now streamed to a file and found that the file
was corrupted.
Further investegation found that all resources were corrupted.
The culprit was actually the maven-resources-plugin.
Correcting that error did the trick.
Thank you for your help, and I apologize for using this list for what
turned out to be a non-itext errer. :-)
Regards,
Tore
tore.lo...@trygvesta.no wrote:
> <</Type/Page/Contents[4 0 R 7 0 R]/Parent 8 0
> R/Resources<</XObject<</Xi0 1 0 R/Xi1 2 0 R>>/ProcSet [/PDF /Text
> /ImageB /ImageC /ImageI]/Font<</F1 5 0 R/F2 6 0 R>>>>/MediaBox[0 0 595
> 842]>>
> and
> <</Type/Page/Contents[3 0 R 11 0 R]/Parent 8 0
> R/Resources<</XObject<</Xi2 1 0 R/Xi3 2 0 R>>/ProcSet [/PDF /Text
> /ImageB /ImageC /ImageI]/Font<</F1 5 0 R/F2 6 0 R>>>>/MediaBox[0 0 595
> 842]>>
/Xi0, /Xi1, /Xi2 and /Xi3 are XObjects.
Normally they also have a /Resources dictionary.
If the images are added to the XObject instead of to the page
(which is the case if you use getContentUnder()) you'll have
to look for references to the image in the XObject.
> The filesize on disk is different though, the locally created file is
> larger..
If the difference roughly corresponds with the image size, then we could
assume that the image data isn't added. To be sure, we'd need to compare
both files (internally).
> I have even tried to make the webserver create a local file, with the
> same results.
> I did this because the first difference is that when calling the pdf
> creation method locally I send in a FileOutputStream and the webserver
> sends the response outputstream.
That's a good test. It eliminates the possibility of an "ASCII vs Binary
file" problem (in some cases the application server ignores the fact
that PDF is a binary file format).
Can you try this:
read the image into a byte[] and create the iText Image object using
that byte[]. (Also: write the byte[] to a file from the web server, and
check if all the image bytes are copied. I know you've already checked
that the server has sufficient permissions to read the image, but maybe
the image is corrupted somewhere in the process. Or maybe the image
bytes are a 404 HTML message.)
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions:
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/