Ragheb AlKilany
Ragheb AlKilany

Reputation: 933

How to use "wkhtmltopdf"?

Wkhtmltopdf is a command line tool to convert html files to pdf. I downloaded the package and ran the command on cmd line, but it didn't work. It is supposed to simply enter the path of file you want to convert then the path of the destination file to be created. I'm not so good with the cmd prompt, but here is what I did:

cd C:\Program Files\wkhtmltopdf

wkhtmltopdf> C:\Users\Ragheb\Desktop\test.html C:\Users\Ragheb\Desktop\new.pdf

What did I do wrong? Or what am I missing?

NOTE: I also tried to simply write a website url in the first link like (http://google.com) but it didn't work neither

Upvotes: 6

Views: 26465

Answers (2)

user18432
user18432

Reputation: 53

You can also just add C:\Program Files\wkhtmltopdf\bin\ to your environmental variables (and reboot) to not have to be in the folder

Upvotes: 2

Ragheb AlKilany
Ragheb AlKilany

Reputation: 933

Solved at last, I thought the directory was wkhtmltopdf, but I should go to bin (binaries)... Maybe they should mention this in the guide.

cd C:\Program Files\wkhtmltopdf\bin Then the command (wkhtmltopdf> C:\Users\Ragheb\Desktop\test.html C:\Users\Ragheb\Desktop\new.pdf)

Upvotes: 10

Related Questions