itext - iTextSharp add image from route -


i'm trying retrieve image in itextsharp. image retrieved calling: local.myapp.com/file/filedownload/102737. images in database , filedownload actionresult method gets image according id provided.

i'm trying call above url c# class (not controller) this

itextsharp.text.image.getinstance(httpcontext.current.server.mappath($"{imgname}")); 

however i'm not able make work. wrong path beginning with: c:\windows\system32\inetsrv\

as discussed in comments question, image

has retrieved through http.

thus, instead of using image.getinstance overload string argument (which assumes argument file name in local file system), use overload uri argument:

    /// <summary>     /// gets instance of image.     /// </summary>     /// <param name="url">an url</param>     /// <returns>an object of type gif, jpeg or png</returns>     public static image getinstance(uri url) 

Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -