I used this function to download the PDF version of HTML template, but it didn\'t work, here is the function: