santosh22 Posted June 19, 2013 Share Posted June 19, 2013 Hello, I have working on a PHP application which would print journals. The user will type in the content (rich editor with formatting) and select the recipients. Upon submit, my code would need to fetch the address details of the selected recipients from database & use the content typed by the user to print a separate hard copy for each of the selected recipients. Till now, I had been working on static printing using JavaScript. This is new to me. Any idea to design the code in order to get the iterative print is highly appreciated. Many Thanks Quote Link to comment Share on other sites More sharing options...
requinix Posted June 19, 2013 Share Posted June 19, 2013 So basically your question is how to take the user's input, search a database, and output a "journal" thing? What input do you get, what database do you have, and what output do you need to generate? Quote Link to comment Share on other sites More sharing options...
santosh22 Posted June 19, 2013 Author Share Posted June 19, 2013 Thanks for the response .. Below is the answer to your queries. Input I get from the user: Name of the recipients, & the content to be printed. (more than one recipients) Search in the database: Search the name of the recipients in the user table and fetch the address for each of them. Journal Output : At the top address of the user followed by the content printed by the user I use mysql database. Thanks again Quote Link to comment Share on other sites More sharing options...
Solution ginerjm Posted June 19, 2013 Solution Share Posted June 19, 2013 Not familiar with printing using JS. Have had much success using the FPDF class of php. Takes a little experimenting to get used to it but works great. Allows you complete freedom in design an output, so designing your journal output page will be easy, then you simply call your PrintPDF function with a php var containing the addressee and the journal text and you're done. Of course you will have to actually manually press File,Print at the end of your process, but that's minor. Quote Link to comment Share on other sites More sharing options...
santosh22 Posted June 19, 2013 Author Share Posted June 19, 2013 Hi Ginerjm This is an excellent reply. I will try this out Thanks.. Quote Link to comment Share on other sites More sharing options...
ginerjm Posted June 19, 2013 Share Posted June 19, 2013 HTH. If you find success, be sure to come back here and mark your question as answered. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.