code: @Override
     public boolean continueOnDataCollectionMessages(DataCollectionMessages messages, com.itextpdf.text.Document document) throws VectorPrintException {
        if (!messages.getMessages(DataCollectionMessages.Level.ERROR).isEmpty()) {
           try {
              createAndAddElement(messages.getMessages(DataCollectionMessages.Level.ERROR), Phrase.class, "");
           } catch (InstantiationException | IllegalAccessException | DocumentException ex) {
              throw new VectorPrintException(ex);
           }
           return false;
        } else {
           for (DataCollectionMessages.Level l : DataCollectionMessages.Level.values()) {
              for (Object m : messages.getMessages(l)) {
                 log.warning(String.format("message of level %s during data collection: %s", l.name(), String.valueOf(m)));
              }
           }
        }
        return true;
     }
docs: When messages of level {@link Level error} are present, put these in the document and return false. Otherwise log
  messages and return true.
  
  @param messages
  @param document
  @return
  @throws VectorPrintException