Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42722

VS 2010 image handler to itextshart.text.image

$
0
0
Using iTextSharp, I can get a normal image (http://www.domain.com/name.jpg) added fine but if I create a generic handler to re-size a image and add a watermark it doesn't seem to work. Here is what I am doing:
Code:

Dim sFullImgUrl As String = "http://www.domain.com/ThumbnailHandler.ashx?id=1234&thumb=yes"
 Dim imgItem As iTextSharp.text.Image = iTextSharp.text.Image.GetInstance(New Uri(sFullImgUrl))

This returns 'IOException was unhandled' and says the url is 'not a recognized imageformat'.

Then I tried:

Code:

Dim sFullImgUrl As String = "http://www.domain.com/ThumbnailHandler.ashx?id=1234&thumb=yes"
 Using wc As New Net.WebClient
            Dim img As System.Drawing.Image = System.Drawing.Image.FromStream(wc.OpenRead(sFullImgUrl))
 End Using

This returns 'ArgumentException was unhandled' and says 'Parameter is not valid'.

Any other thoughts on how to use my handler to use with iTextSharp?

Viewing all articles
Browse latest Browse all 42722

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>