Remote Images & Layout

I'm generating a PDF and hoping to use images I have stored in Azure Blob storage setting the image source as a URL (the blob URL). 

Is this possible?

What is the recommended way to layout a document? I plan to have text top left and an image top right. Below that 3 images in a row, text below that and 2 further images below that.

I have the text top left OK by adding +20 to my Y coordinate, but is there a better way particularly when you don't know the bounds of the elements that will be on the PDF?


Thank you! 


2 Replies

GK Gowthamraj Kumar Syncfusion Team February 2, 2022 01:58 PM UTC

Hi Raymond, 
 
Currently, we are analysing and creating a sample to achieve your requirement on our end and we will update the further details on February 4th 2022.

Regards,
 
Gowthamraj K 



GK Gowthamraj Kumar Syncfusion Team February 4, 2022 03:42 PM UTC

 Hi Raymond,  
 
I'm generating a PDF and hoping to use images I have stored in Azure Blob storage setting the image source as a URL (the blob URL).  
Is this possible? 
 
We can get a stream from image URL and insert them into PDF document using WebClient from system library. 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);  
 
What is the recommended way to layout a document? I plan to have text top left and an image top right. Below that 3 images in a row, text below that and 2 further images below that. 
I have the text top left OK by adding +20 to my Y coordinate, but is there a better way particularly when you don't know the bounds of the elements that will be on the PDF? 
 
At present, we do not have support for getting the layout result bounds from drawing a image on PDF document. As a workaround, we can maintain the calculate the bounds based on the image size and Y bounds to draw the next elements. We have attached the workaround sample to achieve your requirement and please try the sample on your end and let us know the result.

Sample:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/GettingStarted1521988453 
 
Please let us know if you have any concerns on this.   
 
 
Regards,  
Gowthamraj K 


Loader.
Up arrow icon