Found at last the problem. Part of the template was copied from another template. On the row there was a condition for visibility set. The problem was that the entity used could not be found because that entity belonged to another entity (not the one that holds the data).
In my opinion the modeller should generate an error when this entity can not be reached from the dataview in a template.
Caused by: java.lang.IllegalArgumentException: The given member name 'TypeInschaling' has no corresponding member in this object of type 'Basis.Arbeidsvoorwaarden'
Is Arbeidsvoorwaarden an enumeration field? Have you changed the values in this enumeration recently? It may be that you have an old value in your database which now no longer exists for this enumeration. The solution is to edit the database directly to remove these old values (or add the 0old values back to the enumeration, clean up the data in Mendix, then remove the old values)
Comment here because of the space...
Yes, it is a enumaration field. But as far as I can tell there have been no changes. We have the entity arbeidsvoorwaarden and a shadow entity arbeidsvoorwaarden temp. In the temp we have this entity and not in the other one. In the pdf I show the old value arbeidsvoorwaarden and the changed (temp) one. In the temp I show this entity. But the pdf crashes on the arbeidsvoorwaarden part (where this entity is not showing) and not on the part temp where this entity is shown.
Removing arbeidsvoorwaarden from the template solves the problem. But this part has nothing to do with TypeInschaling. That part is coming out fine in the next section.