Session issue in wkhtmltopdf

心已入冬 提交于 2019-12-06 11:58:17

Because it's how sessions works, wkhtmltopdf.exe creates another session, another connection to your script, and it's normal that you won't get values from another session.

You can pass variables as get parameters via GET or, you can store them in some permanent location, like file or database.

Though answered is already accepted and its little late, I am still adding the answer to help other just for reference. Using session id we can create the pdf from html.

Command is

 wkhtmltopdf --cookie 'sessionid' 'typpotvp1ha1mdssvnfg548yhkwo5j4q' 127.0.0.1:8000/posts/report ./report.pdf
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!