0

I am trying to set tooltip (mouse over info) on Acroforms fields using itext. I have no issues with Textfields, Checkboxes and Listfields. But for some reason the tooltip is not getting shown in case of RadioCheckField. Following is the code snippet

RadioCheckField radio = new RadioCheckField(writer, new Rectangle(x, y - 4, x + 14, y - 14), name, exportValue);
            PdfFormField field = radio.getRadioField();
            field.setUserName(toolTip);
            field.setName(name);
            writer.addAnnotation(field);
            radiogroup.addKid(field);    

Invoking setUserName on PdfFormField sets the /TU flag in PDF. When I examined the generated PDF through Rups, I can see that /TU is set for RadioCheckField kids in the radioGroup. But still no tooltip is shown. For 508 (accessibility) compliance tooltip functionality is a must.

Here is a link to PDF file generated from above code http://www.docdroid.net/14son/output.pdf.html Can anybody provide some information?

  • 1
    There are several things wrong with your PDF file. I fixed the errors using Adobe Acrobat, see http://itextpdf.org/documents/radiotooltip.pdf That file is created with Acrobat (and you can create it the same way using iText), but I don't see the tooltips either in spite of the fact that the `/TU` is now added on the correct place. Maybe you're just trying to do something that isn't supported by PDF viewers yet. – Bruno Lowagie Jun 27 '15 at 10:14
  • @BrunoLowagie I was able to show tooltip for RadioCheckField by setting the /TU of radioGroup as follows. `PdfFormField radiogroup = PdfFormField.createRadioButton(this.writer, true); radiogroup.setUserName("Tooltip.");` Here is the link [link](http://www.docdroid.net/155l5/output.pdf.html). Needs to be opened in Acrobat reader to see the tooltip. – Amit Walvekar Jun 30 '15 at 15:12
  • @BrunoLowagie I think you are right about AcroForms not supporting unique individual radio button tooltip as opposed to one tooltip for entire radio group. So setting `/TU` on individual radio button was not useful. Interestingly Adobe XFA tags allows showing tooltip for individual radio buttons with following tag ` Tooltip for option 1 ` – Amit Walvekar Jun 30 '15 at 15:13

0 Answers0