|
-
Jun 1st, 2011, 10:32 PM
#1
Thread Starter
Fanatic Member
iTextSharp image.getinstance issue
Can anyone tell me why the first instance errors while the second doesn't?
SITUATION 1:
imgItem = Image.GetInstance(New Uri("https://www.domain1.com/index_im.cfm?ItemNumberP=AA0220-YE&BM=Y"))
ERROR RETURNED:
System.IO.IOException: https://www.domain1.com/index_im.cfm...AA0220-YE&BM=Y is not a recognized imageformat.
at iTextSharp.text.Image.GetInstance(Uri url) at asf_view_cart.btnCreatePDF_Click(Object sender, EventArgs e)
SITUATION 2:
imgItem = Image.GetInstance(New Uri("http://www.domain1.com/images/item-image.jpg"))
RETURNS WITH NO ERRORS
Any thoughts on how to get the first url to work?
I believe I am using iTextSharp 5.1 (or whatever the latest is)
-
Jun 6th, 2011, 03:41 PM
#2
Re: iTextSharp image.getinstance issue
Hello,
There are a couple things that could be going on here.
First up, the first link uses SSL, notice the https, which could be causing problems.
Secondly, the first link doesn't actually link to an image, but rather some form of "handler" for an image. The second links directly to a file, i.e. .jpg. It might be the case that you have to first read the bytes from the URL, and then pass them into iTextSharp.
Gary
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|