Method to disable PDF Viewer Form Field highlight?

Hi All, 

I have pre-created the pdf with form fields in the foxit pdf editor. In foxit, there is an option for me to disable the highlight of the form field, so as it will not "blocked" the text behind when user is filling the form. 

e.g.  Bef/After


May I check if the syncfusion pdf viewer provides a method to disable the form field highlight, as currently the formfield highlight is blocking the text behind, if I render it on the pdf viewer component. 

e.g. (Unable to see the Y/N)



Thank you for your help. 



5 Replies

SK Shamini Kiruba Sobers Syncfusion Team November 1, 2021 12:14 PM UTC

Hi Lee, 

Thank you for contacting Syncfusion support. 

You can set the isreadonlydOnly property of the form field to true which disables the form field highlight. Please refer to the following code snippet and the sample in which the dob field’s highlight is disabled. 

Code snippet: 

var formfields = this.viewer.retrieveFormFields(); 
this.viewer.formDesigner.updateFormField(formfields[0].id, { 
  isReadOnly: true, 
}); 



Kindly try this and let us know if this suits your requirement. If not, please share more details about your requirement. This will be helpful to assist you better. 

Regards, 
Shamini 



LE Lee replied to Shamini Kiruba Sobers November 2, 2021 01:35 AM UTC

Hi Shamini


Thanks for your reply. I need it to be fillable, but not needed to highlight the field. As you can see from the 1st image, in the other pdf editor, the field is still accessible even after I disabled the highlight in that editor.

Is there such method to disable the highlight in the syncfusion api?


Thanks for your help!

Lee




SK Shamini Kiruba Sobers Syncfusion Team November 2, 2021 01:45 PM UTC

Hi Lee, 

You can set the background color of the form field to white using the below code snippet and the field will be fillable. 

Code snippet: 

var formfields = this.viewer.retrieveFormFields(); 
this.viewer.formDesigner.updateFormField(formfields[0].id, { 
  backgroundColor: '#fff', 
}); 


But still, it will block the text behind it. Hence we suggested using the isreadonlydOnly property. And there is no other API that satisfies both of your requirements. 

Regards, 
Shamini 



LE Lee replied to Shamini Kiruba Sobers November 3, 2021 02:33 AM UTC

Hi Shamini


Thanks, Able to set to transparent using 

#FFFFFF00


SK Shamini Kiruba Sobers Syncfusion Team November 3, 2021 06:31 AM UTC

Hi Lee, 

Thanks for the update. We are glad that you are satisfied with the solution. 

Regards, 
Shamini 


Loader.
Up arrow icon