How to achieve multi-line text with ShrinkTextOnOverflow in visual signatures?

Hi team,

When signing a file with a visual signature and ShrinkTextOnOverflow = true, I populate only the Name and Date fields. I would like the signer’s name to be added on a new line between the NameLabel and DateLabel fields.

Currently, when they are on the same line and the field width is smaller, the signer’s name becomes very difficult to read.

As a workaround, I tried adding “\n” to the NameLabel. Surprisingly, it works sometimes, but quite often it breaks. Instead of wrapping to a second line, the text stays on a single line, and the newline character is replaced by a “square box” symbol (unrecognized glyph). I have also tried using Environment.NewLine, but the result is the same—just a square box.

Do you have any recommendations or ideas on how to achieve this reliably? The goal is to keep the text auto-scaled/fitted to the field width, while ensuring the signer’s name always wraps to a new line cleanly.

Here is a code snippet for context:

// …

var signatureField = document.Form.Fields.AddSignature(document.Pages[0], 300, 500, 250, 100);
var signatureAppearance = signatureField.Appearance;
signatureAppearance.ShrinkTextOnOverflow = true;
signatureAppearance.NameLabel = signatureAppearance.NameLabel + “\n”;
signatureAppearance.DateFormat = “dd.MM.yyyy HH:mm:ss zzz”;

// …

Best regards

Hi,

Can you send us the input PDF file that reproduces this issue?
It seems there is a font-related issue here, and we’ll need to investigate.

Regards,
Mario

Hi Mario,

Thank you for the update. Unfortunately, I am unable to provide the original PDF file at this time, as we are working with live documents containing highly confidential data. As soon as I manage to replicate the behavior in a dummy test file without any sensitive information, I will send it over for your investigation.

In the meantime, I managed to find a workaround for this issue by clearing the existing elements of the SignatureLayer and redrawing the text lines manually based on the field bounds.

Best regards