How to get the width and height of textstamp?

Hi, Support:
I want to get the size of text stamp using textstamp.width and textstamp.height by Pdf.dll v23.4 Based on Vb.net, however , the result is allways 0. Would you please tell me how to get the ringht ones? of fix the api.

Thanks for your help and pay attention to this bug

@ducaisoft
I wrote you an explanation for the same reason in this post.

If this remains unclear, please write.

According to your this guidance, I try using TextStamp.zoomx=1 and textStamp.zoomy=1 before TextStamp.put(Pdf.Pages(PageNumber)), however, the value of TextStamp.width and TextStamp.height is still 0 before put into page.
Please check your api and fix.

@ducaisoft
Please tell us more about the scenario you are using - what you are doing, what you want to achieve.

I want to add text to pdf page at accurate (x,y) position by setting the xIndex and yIndex,therefore, the width and height of textStamp mustt be gotten when calculating the (x,y) position, whereas using the size of Label.width and lable.height under the same fontsize, the width and height of Label is always greater than that of the textstamp, therefore it is not accurate (x,y) position by using the size of label as that of the textstamp.
If the xIndex and yIndex are not be calculated and specified, the text must be added at a unexpected wrong position .

@ducaisoft
You want to add a TextStamp with the positioning set to the desired location, but it doesn’t work?

Yes! That’s what my expectation!

@ducaisoft
I will look into this matter and write to you on Monday.

Thanks for your attention.
And else, I strongly suggest your Pdf.dll to set the (x,y) of start position (0,0) at the Left-Top conner of the pdf page not at the Left-Bottom conner, and hope this update to be taken into consideration for the future version.

@ducaisoft

For this used XIndent and YIndent of TextStamp

using var doc = new Document();
Page page = doc.Pages.Add();            
for (short i = 1; i < 9; i++)
{
    var textStamp = new TextStamp("TextStamp №" + i);                
    textStamp.XIndent = 40*i;
    textStamp.YIndent = 100*i;
    textStamp.TextState.FontSize = 10 + i;
    textStamp.TextState.FontStyle = FontStyles.Bold;

    page.AddStamp(textStamp);
    doc.Save(dataDir + "TextStamps.pdf");
}

The default coordinate system used is defined by the specification and we cannot deviate from it, not to mention that it will break the code for most users of the library.

Thank for your suggestion. However, what you suggested is not my desired. I know using xIndex and yIndex to set the position or textstamp, but the accurate position cannot be set because of not knowing the width and height of the textstamp.

@ducaisoft

using var doc = new Document();
Page page = doc.Pages.Add();
for (short i = 1; i < 8; i++)
{
    var textStamp = new TextStamp("TextStamp №" + i);
    textStamp.XIndent = 20;
    textStamp.YIndent = 100 * i;

    textStamp.Width  = 50 * i;
    textStamp.Height = 20 * i;

    textStamp.AutoAdjustFontSizeToFitStampRectangle = true;

    page.AddStamp(textStamp);
    doc.Save(dataDir + "TextStamps.pdf");
}

Thanks for your suggestion.
The following codes will work for this purpose:

TextStamp.scale=true
’ it is equal to textStamp.AutoAdjustFontSizeToFitStampRectangle = true
TextStamp.Width=NewWidth
TextStamp.Height=NewHeight

This will reset the width and height of the textstamp as what show for a Label with same font size.

However, there found a big bug is that:
if TextStamp.xIndex is set to 0, the real x position of textstamp printed in the page may be 160pixel not 0.
Therefore ,your pdf.dll can not accurately set the (x,y) position for textstamp and Imagestamp as what in Image.drawm(SrcImage,x,y), Please check and fix it.

@ducaisoft
TextStamp does not have an xIndex property.
Please write the code fragment you are using, attach the source document, and indicate the expected result and the result you are getting.
Please try not to write in capital letters, but to state your request clearly and understandably.