Change Text and font size

I am writing code to loop through an existing PDF and update certain text with new values. I sometimes also need to change the existing text’s font size. Using the code below works but the resulting font size is much larger than the value I set it to. I assume the size I set it to needs to be transformed. How should I do that?

Dim str As GemBox.Pdf.Objects.PdfString = GemBox.Pdf.Objects.PdfString.Create(newValue)

If es.fontSize <> 0 Then
     es.textElement.Format.Text.SetFont(es.textElement.Format.Text.GetFont(0), es.fontSize)
End If

Dim ft2 As GemBox.Pdf.Content.Text.PdfEncodedContentString = GemBox.Pdf.Content.Text.PdfEncodedContentString.Create(str)

es.textElement.EncodedText = ft2

Regards,
Simon

Hi Simon,

Please create a small Visual Studio project that reproduces your issue so we can investigate it.

Regards,
Mario