We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Adding image from URL

Is there anyway of getting a stream from a URL image to then save into the PDF rather than a local file ?

3 Replies

SL Sowmiya Loganathan Syncfusion Team September 12, 2019 12:44 PM UTC

Hi Martin, 

Thank you for contacting Syncfusion support.  

We can get a stream from image URL and insert them into PDF document in ASP.NET Core. Please refer the below code snippet for your reference, 

WebClient myWebClient = new WebClient(); 
Stream imageStream = new MemoryStream(bytes); 
//Load the image from the stream 
PdfBitmap image = new PdfBitmap(imageStream); 

Please find the sample for the same, which can be downloaded from the below link, 

Please try the above sample in your end and let us know if it satisfies your requirement.  

Sowmiya L 

MA Martin September 14, 2019 09:18 AM UTC

Many thanks works well.

SL Sowmiya Loganathan Syncfusion Team September 16, 2019 05:39 AM UTC

Hi Martin, 

Thank you for the update. We glad to know that your requirement is achieved.  
Sowmiya L 

Live Chat Icon For mobile
Up arrow icon