I'm trying to generate a PDF using WKHTMLTOPDF that requires me to first log in. There's some on this on the internet already but I can't seem to get mine working. I'm in Terminal - nothing fancy.
I've tried (among a whole lot of other stuff):
/usr/bin/wkhtmltopdf --post username=myusername --post password=mypassword "URL to Generate" test.pdf
/usr/bin/wkhtmltopdf --username myusername --password mypassword "URL to Generate" test.pdf
/usr/bin/wkhtmltopdf --cookie-jar my.jar --post username=myusername --post password=mypassword "URL to Generate Cookie For"
username and password are both the id
and the name
of the input fields on the form. I am getting the my.jar file to show up, but nothing is written to it.
Specific questions:
- Should I be specifying the login page and/or form action anywhere?
- the --cookie-jar parameter has been mentioned in various places (both as being needed and otherwise). Should that be necessary, how does it work? I've created the my.jar file but how do I use it again? Referencing:
http://code.google.com/p/wkhtmltopdf/issues/detail?id=356
EDIT:
Surely someone has done this successfully? A good way to showcase an example might if someone is willing to get it to work on some popular website that requires login credentials to eliminate a potential variable.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…