I'm in the process of building a new pledge management system for one of my clients, a charity foundation. I have already built one for them (it was done using Delphi), but its feature-set is a little limited.
Now, I have decided to move to PHP and use the Laravel framework to manage the database for the new system - its Eloquent ORM allows me to easily implement new features that are needed at present. This is good and well – I know everything that I need to do there. However, I am not sure which direction to take for when it comes to creating, saving, and printing documents that will be hand-delivered to donors.
At the moment, it used Word to process documents - i.e. creating invoices, letters of appreciation, and any other templates that may be selected during a pledge submission. The thing is, I am not extremely happy with the implementation, and don’t believe this is the best route to take. There have been times where the documents did not print correctly, or multiple documents where printed (where only one was needed).
Nonetheless, I could stick to Word, provided that PHP can handle it properly and show me progress as it goes along (i.e. Opening Word -> Opening Invoice Template (companies) -> Replacing Variables -> Saving -> Printing -> Closing -> Opening Food Project Mission Statement -> Replacing Variables - > Saving -> Printing -> Closing … etc.). I guess that progress notifications are not necessary, but I would like to have them there - just in case it freezes, the user would be able to see whatever it may be struggling with.
I would assume that I could do this using a jQuery script (with AJAX) that interfaces with a PHP script, but I honestly have no idea how to do it. (Note: I’d have to use AJAX as Laravel uses buffered output.)
I also know that I could pass the information about a pledge to an EXE which would handle the printing on its own, but I don’t think I want to use this implementation as I have plans to make the system cross-platform.
Question 1: Is there a package for PHP that allows me to create documents, save them, and then print them? If not, is there a suitable package that handles Word without difficulty, and with a large array of features?
If it is the latter, I would need to be able to access the full COM API so that I can prevent dialogs from popping up in the background and pausing the procedure.
Question 2: Is there a package (jQuery, AJAX) available that would allow me to track the progress of the document-creation procedure?
EDIT
Having reconsidered everything, and weighed the pro's and con's, I would like to put emphasis on printing here. When the user submits a pledge to the database, I need the document to print immediately. I do not necessarily want to focus on a document creation tool only. The reason I asked my question as I did is because I would, ideally, like to find something that can do both the creation and printing of each document. In addition, I do not want to make it too difficult for myself. This is why I originally chose Word - and, it was a lot easier to manage from a Delphi application.
Because of this, I will be leaving the question open (just in case something very interesting is proposed), but will be asking a new question that is a little more specific to the problem that this question originated from.
(To those who have answered so far, thank you for your help and showing me the various options.)