Text box field label in form view

Hi
I would like to add a label on text box field or signature field that describe the meaning of the field

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hi tamir.we

WebViewer doesn’t support labels for text form field widgets and signature widgets “out of the box” but there are some workarounds for this that you might be able to use:

Annotations.setCustomCreateInnerElementHandler(Annotations.TextWidgetAnnotation, function(annotationManager, { annotation, originalCreateInnerElement }) {
    const field = this;
    const el = originalCreateInnerElement();
  
    const label = document.createElement('label');
    const text = document.createTextNode(annotation.fieldName);
    label.appendChild(text);

    // Wrapper div
    const wrapper = document.createElement('div');
    wrapper.appendChild(el);
    wrapper.appendChild(label);

    return wrapper;
  });

(Note: using this would mean the styling used for TextWidgetAnnotations may not work correctly so you might also need to add custom CSS to make the text fields appear how you want them.)

As an alternative, you could also set tooltipName for your form fields to add a description when hovering the fields.

Best Regards,

Carlo Mendoza
Software Developer
PDFTron Systems, Inc.
www.pdftron.com