I found a post on here that gives a block of code to export a PDF and I have implemented it into my app, however when I run the code below all I output is an empty PDF file?