How to get a caption and a description for a field in PDF with itextsharp

In a PDF document, you can use caption and description to enhance the readability and add additional metadata to interactive form fields. The description field is shown whenever you hover with a mouse over the form field. The caption is used for accessebility.


PdfDictionary widget = pdfReader.AcroFields.GetFieldItem(signature).GetWidget(0);
string description = widget.GetAsString(PdfName.TU);
PdfDictionary mk = widget.GetAsDict(PdfName.MK);
string caption = mk.GetAsString(PdfName.CA)?.ToUnicodeString();

Post a Comment

Previous Post Next Post