HTML to PDF conversion in php online

2019-06-01 11:23发布

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?

1条回答
不美不萌又怎样
2楼-- · 2019-06-01 11:47

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.

查看更多
登录 后发表回答