I've been trying to develop a php program that can convert an html file to pdf. I Googled the issue and found out this software wkHTMLtoPDF software which can be used for this purpose. I downloaded it for the windows and i successfully created what i wanted to using these lines:
$wkcommand = "\"C:\\Program Files\\wkhtmltopdf\\bin\\wkhtmltopdf\" --page-width 300 --page-height 225 \"$url\" $dir\\$tempName.pdf &";
exec($wkcommand, $output, $error);
As these lines run in command line and works perfectly, now i want to make my website online but i can't understand how i will use this service online because i'm going to use a free web hosting service like: www.base.pk for this purpose. How can i use this tool for conversion there?
Usually shared hosting providers forbid to run ssh commands. It means that you can't run exec(). And also it means that you need the SERVER (virtual or dedicated) so you would be able to configure that there.
来源:https://stackoverflow.com/questions/27459607/html-to-pdf-conversion-in-php-online