Generate print preview - searching right approach
Everything bellow will be considered in terms: php, js, html, css.

I'm looking good way to make my users create, preview and print invoices.

User fill form, submit it. With this user's data i have to generate invoice.
I need to make print preview, which can help user check page for mistakes, and if everything is ok, then he will print it. I want to have three print options (three html buttons, for example): from browser (by JS and CSS help), generate pdf or xls.

I select the next approach.

1. invoice template will be made in HTML with placeholders
2. after user submit form, HTML file will be read and placeholders will be changed by user's data
3. with help http://www.mpdf1.com/mpdf/ i can generate pdf from html
4. Then i will generate Image file and will send it to browser for preview

if everything ok, and user choose and click "simple" print (JS) - 
5. I can print this page(Image) from browser using JS without any request to server.

and user click print pdf - 
5. I will sent him his already generated pdf file, without any new generating.

and user click print xls - 
5. I will generate xls form pdf (I hope it's possible, i did not search yet) and sent it to client

**But** if user will find any error on preview, he will go back to form view to fix it and everything from step #2 will be repeated.

Is it rational approach ? especially so long way
HTML -> Image -> Pdf -> XLS.
Or is there any more suitable solution ?

Thanks, everyone.


Generate print preview - searching right approach
===

Everything bellow will be considered in terms: php, js, html, css.

I'm looking good way to make my users create, preview and print invoices.

User fill form, submit it. With this user's data i have to generate invoice.
I need to make print preview, which can help user check page for mistakes, and if everything is ok, then he will print it. I want to have three print options (three html buttons, for example): from browser (by JS and CSS help), generate pdf or xls.

I select the next approach.

1. invoice template will be made in HTML with placeholders
2. after user submit form, HTML file will be read and placeholders will be changed by user's data
3. with help http://www.mpdf1.com/mpdf/ i can generate pdf from html
4. Then i will generate Image file and will send it to browser for preview

if everything ok, and user choose and click "simple" print (JS) - 
5. I can print this page(Image) from browser using JS without any request to server.

and user click print pdf - 
5. I will sent him his already generated pdf file, without any new generating.

and user click print xls - 
5. I will generate xls form pdf (I hope it's possible, i did not search yet) and sent it to client

**But** if user will find any error on preview, he will go back to form view to fix it and everything from step #2 will be repeated.

Is it rational approach ? especially so long way
HTML -> Image -> Pdf -> XLS.
Or is there any more suitable solution ?

Thanks, everyone.

