1

I have quite large number of URLs in form of some/web/address/[0-9]+ and want to convert all of them to PDF, How can I do that?

I've Googled and searched over stackoverflow for it but if it is a duplicate give me a link to a good question and I would delete this.

Masked Man
  • 2,176
  • 2
  • 22
  • 41

1 Answers1

1

Finally found what I was looking for:

I needed something like wkhtmltopdf as it can change HTML files to PDF.
there's also a good command-line browser cURL that can catch web pages and has a rich feature set. So I can pipe these two and get my desired result:

for i in `seq 1 n`; do
    curl "some/web/address/$i" "prefix-$i.html";
    wkhtmltopdf "prefix-$i.html" "prefix-$i.pdf"
done;

Happy coding :)

Masked Man
  • 2,176
  • 2
  • 22
  • 41