How to highlight form fields and set form field highlight color?
The interface is provided to set whether to enable highlighting the form fields in PDF form files. By default, the form fields will be highlighted. If you do not want to highlight form fields, you should change the source code of the UI Extensions Component, please refer to PDF SDK for iOS Developer Guide to add the “uiextensions” project found in the “libs/uiextensions_src” folder to your project. Then, find the onDocOpened function in “UIExtensions/Form/FormAnnotHandler.m“, and set the parameter of FSFormFiller::highlightFormFields to “false” as follows:
- (void)onDocOpened: (FSPDFDoc* )document error: (int)error { ... ... [_formFiller highlightFormFields:false]; }
The FSFormFiller::setHighlightColor interface is used to set the highlight color. Please make sure you have not disabled highlighting form fields. Following is a sample for calling this API:
- (void)onDocOpened: (FSPDFDoc* )document error: (int)error { ... ... [_formFiller highlightFormFields:ture]; [_formFiller setHighlightColor:0x4b00ff00]; }
Updated on August 29, 2018