TsgcAIDocumentExtractor › Properties › RaiseOnInvalid
Raises EsgcAIDocumentExtractor when the data still does not validate after the retries.
property RaiseOnInvalid: Boolean read FRaiseOnInvalid write FRaiseOnInvalid default True;
True
When True, an extraction whose data still does not validate after ValidationRetries raises EsgcAIDocumentExtractor with the validation errors in the message. When False the method returns the data as it came, LastResult.Valid is False and LastResult.ValidationErrors lists the problems, so the document can be sent to a manual review.
oExtractor.RaiseOnInvalid := False;
vJSON := oExtractor.ExtractFile('invoice.pdf');
if not oExtractor.LastResult.Valid then
Memo1.Lines.AddStrings(oExtractor.LastResult.ValidationErrors);