Baseline property doesn't work for vertical alignment

Hi,

I was trying to emulate subscript with the baseline property while the tag doesn’t work.
But I quickly found out that setting this property hadn’t the slightest effect on my text.
I the tried to use the code from the documentation : same result.

The code I used is stricly the same as the one from the documentation


//Instantiate Pdf object by calling its empty constructor
Pdf pdf1 = new Pdf();

//Create a section in the Pdf object
Section sec1 = pdf1.Sections.Add();

//Create a new text paragraph with an initial text segment “Aspose”
Text text1 = new Text(sec1, “Aspose”);

//Add the text paragraph to the section
sec1.Paragraphs.Add(text1);

//Create a new text segment into the text paragraph
Segment seg2 = text1.Segments.Add(“TM”);

//Set the vertical alignment of text segment “seg2” to Topline by setting
//IsBaseline property ot seg2.TextInfo to true
seg2.TextInfo.IsBaseline = false;


The output is simply “AsposeTM”. I also attached the output pdf.

Now I’m kinda stuck with chemical formulas…
Hope you’ll be able to find a solution !
Thanks,

Erwan

Hello Erwan,

I have tested the issue and I’m able to reproduce the same problem. I have logged it in our issue tracking system as PDFNET-9865. We will investigate this issue in detail and will keep you updated on the status of a correction. We apologize for your inconvenience.

Hi Erwan,

Thank you for considering Aspose.

I checked this issue and found there is problem in the example code. The font size should be set to be smaller for the text “TM”.

seg2.TextInfo.IsBaseline = false;
seg2.TextInfo.FontSize = 6;

We will modify the example code and avoid such problems later. Sorry for the inconvenience.