A PDF document is created using a document template with empty fields as place holders for text, e.g. the address of a customer in an advertising letter. At runtime the fields are filled with text.
@Test public void noTextOverflow_AllFields() throws Exception { String filename = "documentUnderTest.pdf"; AssertThat.document(filename) .hasFields() .allWithoutTextOverflow() ; }
A similar test can be done with one field:
@Test public void noTextOverflow_OneField() throws Exception { String filename = "documentUnderTest.pdf"; String fieldname = "Textfield, text inside, align left:"; AssertThat.document(filename) .hasField(fieldname) .withoutTextOverflow() ; }
Chapter 3.14: “Form Fields - Text Overflow” describes this subject in detail.