Moodle form to a PDF from a block

Re: Moodle form to a PDF from a block

by lee kirkland -
Number of replies: 0

Ok, so I found the solution, I had to download a PDF generator and recreate the form as it were using the database entries and creating the layout the way I wanted it. http://www.fpdf.org/ is the product I chose to implement the PDF creation. I then put the created PDF in a directory I created in the sitedata folder so I can implement the next section. 

To email the PDF as an attachment, I use the mail_to_user implementation already shipped with the Moodle instance. Since the email requires the file to be in the sitedata directory I have to create a directory in the sitedata directory, something like block_test_EmailAttachements. The rest of the issue is simply creating the class that handles the PDF creation and a class for the email handling. I hope this helps someone else, let me know if you have any questions. 

Thank you,