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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Add margin/ space for images in paragraph

Thread ID:

Created:

Updated:

Platform:

Replies:

143558 Mar 26,2019 06:04 PM UTC Mar 28,2019 04:28 PM UTC Xamarin.Forms 1
loading
Tags: DocIO
Hershi
Asked On March 26, 2019 06:04 PM UTC

Hi,

I am adding multiple images to a single paragraph as I need the pictures to be on the same line, but I couldn't find a way of adding margin/ space between each image.

IWParagraph firstParagraph = table[1, 0].AddParagraph();

            foreach (var pic in item.Pictures)
            {              
                IWPicture picture = firstParagraph.AppendPicture(pic);

                picture.Width = 125;
                picture.Height = 125;    
            }

Attachment: Sample_(2)_e3dd7517.zip

Dilli Babu Nandha Gopal [Syncfusion]
Replied On March 28, 2019 04:28 PM UTC

Hi Hershi, 
 
Thank you for contacting Syncfusion support. 
 
To meet your requirement, we suggest you append space between pictures and set character spacing using CharacterSpacing API to preserve pictures with defined space in same line. Please refer the below modified code example:  
 
foreach (var pic in item.Pictures)  
{  
    IWPicture picture = firstParagraph.AppendPicture(pic);  
  
    picture.Width = 125;  
    picture.Height = 125;  
  
    //Append text in paragraph.  
    IWTextRange textRange = paragraph.AppendText(" ");  
    //Set character spacing.  
    textRange.CharacterFormat.CharacterSpacing = 2;  
}  
 
Regards, 
Dilli babu. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;