This project has moved and is read-only. For the latest updates, please go here.

Image problem

Jan 14, 2011 at 3:58 PM

Hi,

I've got problem with conversion, when in html I've got images that are linked from SHarepoint Library: <img src="/SiteCollection/Images/image.jpg">

Even when I change path to full url, converter is not able to process it.

Is it possible to do?

Best Regards
B.Rz.

Coordinator
Jan 14, 2011 at 4:20 PM

In SharePoint, all the images stored in /_layouts/images are accessible in anonymous mode.

But all these stored inside document library require an authentication.

 

In the documentation, follow the tutorial with Image Processing. Register to ProvisionImage, provide your own System.Net.WebClient with the adequate credentials.

 

Hope this helps!

Feb 17, 2011 at 2:29 AM

you  can change the method getDataFromNet(Uri uri).if Exception occurs,HtmlConverter.userName, HtmlConverter.passWord,                                       HtmlConverter.domainName should be initialed.

 public static byte[] getDataFromNet(Uri uri)

 {          

 System.Net.WebClient webClient = new System.Net.WebClient();            

          try          

          {                return webClient.DownloadData(uri);            }            

          catch          

          {                

                           try              

                               {                    webClient.Credentials = new System.Net.NetworkCredential(HtmlConverter.userName, HtmlConverter.passWord,                                                            HtmlConverter.domainName); 

                                                    return webClient.DownloadData(uri);              

                              }                

                              catch                {                    return null;                }            }
        }

Coordinator
Feb 19, 2011 at 2:40 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.