Sorry for replying to my own post but the problem was *not* base64 
encoding.  The issue was that for some reason the array passed into 
getInstance() was zero bytes in length.  I added a quick:

    if( imgb.length == 0 )
                return null;

and things work fine for me at least.  I'm not sure if I understand why 
this is occurring but it works for now.




Scott Dunbar wrote:
> I've run across an issue using mergeXfaData and images.  The images in 
> my file are base64 encoded which I believe is standard and I end up getting:
>
> java.io.IOException: The byte array is not a recognized imageformat.
>         at com.lowagie.text.Image.getInstance(Unknown Source)
>         at com.lowagie.text.pdf.AcroFields.setField(Unknown Source)
>         at com.lowagie.text.pdf.AcroFields.setField(Unknown Source)
>         at com.lowagie.text.pdf.AcroFields.mergeXfaData(Unknown Source)
>
> In looking at the code for Image.getInstance() it looks like it is 
> trying to do something conceptually similar to the Unix "file" command 
> but doesn't handle base64.  Is this something I'm doing wrong or should 
> I just update the code to handle base64 encoded images (and presumably 
> call the method again with the decode byte array)?
>
> Thanks for any help.
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> Buy the iText book: http://itext.ugent.be/itext-in-action/
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to