<p>I am using iText to generate PDF invoices for a J2EE web application and included on the page is an image read from a URL constructed from the request URL. In the development and test environments this works fine, but in production I get a java.io.IOException:  is not a recognized imageformat.</p>

<p>If I paste the url into my browser then the correct image is returned, however the request is redirected from http to https. In my code if I hard code the redirect URL then the image is displayed correctly. </p>

<p>So it seems that when retrieving the image using com.lowagie.text.Image.getInstance(URL), the redirects on the URL are not being followed. How can I output an image from a redirected URL using iText?</p>

Is there a reason you have to get this using the URL??  Do you have to match the image that the url is pointing to?  What if it changes or gets removed?
I am not sure of your requirement, but it may be easier to save the image from the url and place it somewhere within your project.  Then you can add it to your pdf with:
```
```
Image.getInstance("yourimage.gif");
```
```