Not able to add line spacing value in decimal between 0.0 to 1.0 in TextFragment Aspose.pdf

m trying to set the line spacing of a TextFragment object using Aspose.pdf in C#, but I’m unable to set the value between 0.0 to 1.0

I also want to set the line spacing to a value less than 1, such as 0.82, but it seems to be getting rounded up to 1. I’ve verified that the font file exists at the specified path,

var fontPath = _dataDir + "astmensh.otf";
var document = new Aspose.Pdf.Document();
var page = document.Pages.Add();

TextBuilder builder = new TextBuilder(page);
TextParagraph paragraph = new TextParagraph();

paragraph.Rectangle = new BoundingBox(pageHeight).getBoxPosition(70.136f, 148.652f, 425.665f, 549.093f);
paragraph.VerticalAlignment = VerticalAlignment.Top;
paragraph.HorizontalAlignment = HorizontalAlignment.Left;
paragraph.FormattingOptions.WrapMode = TextFormattingOptions.WordWrapMode.ByWords;
paragraph.FormattingOptions.LineSpacing = TextFormattingOptions.LineSpacingMode.FontSize;

var textFragment = new Aspose.Pdf.Text.TextFragment(@"Greetings Ms. test999,
    I wanted to let you know I am thinking of you.");

textFragment.TextState.Font = FontRepository.OpenFont(fontPath);
textFragment.TextState.ForegroundColor = Color.Parse("#211d70");
textFragment.TextState.FontSize = 28;
textFragment.TextState.LineSpacing = 0.82f;

paragraph.AppendLine(textFragment);
builder.AppendParagraph(paragraph);
document.Save(_dataDir + "manual-output.pdf");

@Jitesh.jain,

I am wondering what version of the API are you using?

LineSpacing is an enum. It is nto expecting a float number.

I am using Nuget Aspose.pdf latest stable 23.3.0
LineSpacing property present in two class.
one is an enum unsder paragraph.FormattingOptions.LineSpacing that you suggest.

I am using LineSpacing a float type in
textFragment.TextState.LineSpacing = 0.82f; but not working with decimal value.

@Jitesh.jain,

You are right. I am doing some extra testing. My bad for confusing which LineSpacing you were talking about. If I do not manage to make any changes to it, I will be creating a bug for the Dev team.

@Jitesh.jain,

After playing around with functionality I went to Acrobar PDF and manually try to make the LineSpacing lower than one and I got this message.

Acrobat Pdf does not support LineSpacing lower than one and greater than 5.