How can I create a PDF after receiving multiple error messages?