Default values not showing in fill and sign mode

WebViewer Version: 11.7.1

Do you have an issue with a specific file(s)? no
Can you reproduce using one of our samples or online demos? yes
Are you using the WebViewer server? no
Does the issue only happen on certain browsers? no
Is your issue related to a front-end framework? no
Is your issue related to annotations? maybe?

Please give a brief summary of your issue:
When a default value is set for a field, users expect it to be visible in that field

Please describe your issue and provide steps to reproduce it:
load a PDF
create a text field
add a default value
go to fill and sign mode
observe no default value displayed in the field

It looks like the default value is saved on the field, because when I edit the document again, it is there in the field settings, its just not displayed in the field in a way that users can see. I wonder if this is a configuration thing or something?

Please provide a link to a minimal sample where the issue is reproducible:

Hello, I’m AiRon, an automated tech support bot :robot:
While you wait for one of our customer support representatives, I can help you with your question.


It seems like you’re experiencing an issue where default values set in text fields are not displayed in fill and sign mode in Apryse’s WebViewer. This can happen if the fill and sign functionality does not render the default values as expected.

Some things you can try:

  • Ensure that the default value is correctly set in the PDF document’s form field properties before switching to fill and sign mode.

  • Check if the fill and sign mode has any settings or configurations that might prevent the display of default values.

  • Use the FieldManager API to programmatically set and verify the default value of a field when initializing the document in WebViewer.

  • Consider using the updateField method to explicitly set the value of a field when loading the document in fill and sign mode.



Here are some resources that might help you:


Hopefully, this helps you solve your problem while you wait for a human to get back to you.

Hello Patrick,

Thank you for contacting Apryse Forums.

This is considered the expected behavior. We made a fix in 11.3 where the default value would show up immediately. Now, you have to reset the field before you can see the default value. Unfortunately we don’t have a dedicated API to reset form fields. To reset the form fields, you can create a button that executes AcroFormJS that then resets all field values.

Fixed an issue where setting the default value in the form field panel would immediately update the field value instead of taking effect only after a reset.

Best Regards,
Darian

1 Like

Does a reset happen when the document is loaded? because if so, this is still a regression because that does not show the default value.

If default values never show (because I don’t see a way a user can reset by themselves) Can I just programmatically set the field value to the default, if there is nothing in the field, when the editor goes from forms mode to fill and sign? IMO that would be the behaviour I would expect.

1 Like

Hello Patrick,

Apologies for missing that, you can use the ResetForm action to do this.

It sounds like you want a placeholder on your form fields. You can programmatically set this with the following code:

const originalCreateInnerElement = Annotations.TextWidgetAnnotation.prototype.createInnerElement;

Annotations.TextWidgetAnnotation.prototype.createInnerElement = function() {
  const inputElement = originalCreateInnerElement.apply(this);
  inputElement.placeholder = 'Enter text here'; 

  return inputElement;
};

We can’t do this in the UI right now, but I can create a feature request for this if you would like.

Best Regards,
Darian

1 Like

yeah that sounds good, I also think that that’s what the users want. Please do create a feature request.

1 Like