Textstamp merging 2 of these because each contains its own font size and font

Is there a way to have 2 different styls of textstamp on one line? We have tried a number of things but can’t get there. It seems that margin doesn’t work here. We adding both with different stamps and argb(0,255,255,255) these add to same line but couldn’t find a good way to place one before the other.
We want to concatinate “5” with “this is the title” where 5 would be size 11 and title size 15.
Is there a clean way to do this?
Adding Html doesn’t work because it blows out the TOC.
We haven’t tried adding it by table yet, but assume toc will will also be corrupted.

@nightcoder

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input PDF.
  • Please attach the output PDF file that shows the undesired behavior.
  • Please attach the expected output PDF file that shows the desired behavior.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

I don’t have a sample project to share. But wouldn’t it be simple to demo this by creating some text stamps and applying them to a pdf?

A better question would be. Is there a good way to figure out the pixel length of the text stamp written to pdf?

@nightcoder

We cannot add text stamp with two different fonts formats. You need two different text stamps with two different fonts. Please read the following article.
Add Text stamps in PDF C#

I’ll work on a sample app today. Have some time.
We can add one text stamp. but not 2 on the same line.
you can try and see.TestStampe2.zip (3.3 KB)

@nightcoder

You can add two text stamps on same line but you need to set their XIndent and YIndent properties accordingly so that they would appear like one sentence. Instead of using default alignment properties, please try setting above mentioned values and let us know in case you still are unable to achieve your desired results.

how do you know the x value when the strings are of variable length?

@nightcoder

You can specify the Width property of TextStamp itself while adding it. Can you please share the code snippet that you have tried so far along with expected output PDF? We will further proceed to assist you accordingly.

we cannot right? the only way I see fixing this is to get the length in pixels of the textstamp.
If you find the length for the first one, then you know where to place the second one for instance.
But I don’t know how to get the length (width) of the stamp.
I gave a sample project above. If you have a solution, please upload.

@nightcoder

We are checking it and will get back to you shortly.