Layout analysis of documents structured with printed lines or input boxes, e.g. business forms or tables