Created
February 9, 2017 10:08
-
-
Save jurv/1aad77c50df4e9cacbbed1a285be79dc to your computer and use it in GitHub Desktop.
Use session with wkhtmltopdf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget --save-cookies cookies.txt --keep-session-cookies http://my-site.dev/app_dev.php/my/page | |
# It's possible to add option "--post-data 'user=foo&password=bar' " if you need to | |
# log in for exemple | |
# Then retrieve the session ID in cookie.txt | |
vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64 \ | |
--cookie 'sessionid' 'gfou6ks1lsguuvtk9il2v169n7' \ | |
--cookie 'PHPSESSID' 'gfou6ks1lsguuvtk9il2v169n7' \ | |
--debug-javascript \ | |
--load-error-handling ignore \ | |
--post myform[item][size] xl \ | |
--post myform[item][color] black \ | |
--post myform[item][quantity] 1 \ | |
--post myform[_token] 2O-7Y9_jY6v46dunWno9vdaXJZw5hDiBdudiOegiCa8 \ | |
http://my-site.dev/app_dev.php/my/second/page \ | |
test.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment