HTML to PDF conversion in php online

送分小仙女□ 提交于 2019-12-08 03:22:34

问题


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:


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!