The information you're giving is not where near enough for anyone to solve your problem.
What I do get is that you have a problem with the ps/pdf generation, but what and where we cannot guess! So no we cannot find a solution for you since we do not know what your problem could be... Read this page on How To Ask a question.
Also why are you using this library - html2ps/html2pdf
? It is ancient already.
I could propose some other solutions that are contemporary:
DomPdf
Mpdf
Tcpdf
pdftk
wkhtmltopdf
I personally recommend wkhtmltopdf
. It uses the WebKit engine and then generates PDF files. If you use it, you should also not have to change much of your app since this
two is a executable file that you'll have to call whit exec() (if on Linux/Unix) or COM Objects if on (Windows).