Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a folder with this structure:


with many sub folder and only html files... i want to convert all them to pdf using only one command or a simple script that doesn't require all file names.

Do you know one

share|improve this question
up vote 14 down vote accepted

I would suggest installing the WKHtmlToPDF tool from

You can then change to the root folder and use find and xargs to convert them:

cd /main-folder
find . -name \*.html | sed 's/.html$//g' | xargs -n 1 --replace=X wkhtmltopdf X.html X.pdf

This will then build a PDF with each HTML file.

share|improve this answer
+1, good suggestion, what I had in mind – Sabacon Dec 15 '11 at 19:08
i solved with alist of files and a bash for but this is a lot better! – Matteo Pagliazzi Dec 15 '11 at 19:17

The following command should do the job for one link:

gnome-web-print ubuntu.pdf

For multiple links, it shouldn't be difficult to write a loop that handles each link one by one.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.