Highlight all fields on the document OCC only displays the current field on a document. Sometimes it is helpful to see all extracted fields at once on the document. That way a user can easily verify whether all required fields have been found on the right spots. The image on the left shows an example. (Note the for invoices this view is not particularly helpful though.) The All” view can be achieved by (miss-)using a lookup list field. A lookup list field highlights all “Show its subfields on the document. The approach we take is this: Create a lookup list field with enough subfields, i.e. as many as there are other fields and subfields in the document. The lookup list needs a database file, a dummy file with no data and one column will suffice. You can map all sub fields of the lookup list to the very same column. You should make all subfields invisible. You call in the Data Extraction scripting point: “ShowAllFields“ ScriptingUtilities.ShowAllFields(data, "ShowAll"); The parameter (“ShowAll”) is the name of the mentioned lookup list field. The function will copy all zone from all fields to the lookup list. Some fields will have subfields, in the sample profile is an US_InvoiceTotals field. Each of its seven subfields will show up in the lookup list field if it is not empty This is optional. In Validation -> Document loaded you can set the lookup list to state. That way the user will stop right there. Actually you need to set a subfield in the lookup list to state error. In the sample profile the first lookup list sub field was named “Document”. helper.SetError( doc.Fields["ShowAll"].Fields["Document"], "Verify all fields"); This is optional too. It may be nice, if the error on the field disappears as soon as the user leaves the field. You achieve this by the below script in Validation -> Field deactivated. if (field.Name == "Document") field.State = DataState.Ok; Resources Profile ShowAllFields.zip Sample document Invoice.pdf DLLs used ScriptingUtilities.DLL (Additional DLL) Other DummyLookupList.txt Conditional compilation None
Highlight all fields on the document OCC only displays the current field on a document. Sometimes it is helpful to see all extracted fields at once on the document. That way a user can easily verify whether all required fields have been found on the right spots. The image on the left shows an example. (Note the for invoices this view is not particularly helpful though.) The “Show All” view can be achieved by (miss-)using a lookup list field. A lookup list field highlights all its subfields on the document. The approach we take is this: Create a lookup list field with enough subfields, i.e. as many as there are other fields and subfields in the document. The lookup list needs a database file, a dummy file with no data and one column will suffice. You can map all sub fields of the lookup list to the very same column. You should make all subfields invisible. You call “ShowAllFields“ in the Data Extraction scripting point: ScriptingUtilities.ShowAllFields(data, "ShowAll"); The parameter (“ShowAll”) is the name of the mentioned lookup list field. The function will copy all zone from all fields to the lookup list. Some fields will have subfields, in the sample profile is an US_InvoiceTotals field. Each of its seven subfields will show up in the lookup list field if it is not empty This is optional. In Validation -> Document loaded you can set the lookup list to state. That way the user will stop right there. Actually you need to set a subfield in the lookup list to state error. In the sample profile the first lookup list sub field was named “Document”. helper.SetError( doc.Fields["ShowAll"].Fields["Document"], "Verify all fields"); This is optional too. It may be nice, if the error on the field disappears as soon as the user leaves the field. You achieve this by the below script in Validation -> Field deactivated. if (field.Name == "Document") field.State = DataState.Ok; Resources Profile ShowAllFields.zip Sample document Invoice.pdf DLLs used ScriptingUtilities.DLL (Additional DLL) Other DummyLookupList.txt Conditional compilation None
Scripting%20Utilities%20-%20Documentation.docx