How to generate submission PDF automatically?