Forum How do I...?

Command line for conbining 500 htmls into one PDF

nnq2603
I see the example:
prince doc1.html doc2.html -o out.pdf
Combine doc1.html and doc2.html into a single PDF file, out.pdf.

But I couldn't find the parameter or similar stuffs to combine many html file.
I've download a large amount of seperated *.html file (each of them is a chapter of a story) but there're >500 of them. What exactly does the command look like?

sth like...
prince (doc1.html - doc512.html) -o out.pdf
?
mikeday
You can add them all the command-line and make a really big command-line, or you can use the --input-list=FILE argument and put them in a file, one document per line, eg.
doc1.html
doc2.html
doc3.html
...
nnq2603
Thanks. The input-list=list.txt works well. And I can manage to find way generate the correct list and it's easier way to work with those files than make a really big command-line with all the file name in it.

But I notice if I simplify the list to
--------------
doc1
doc2
...
doc512
-------------
then it wouldn't work. Seem it requires extentions *.html to work.

Also I was wondering why there isn't any parameter to let the program know that I need the file "from xx numer to yy number" (with yy>xx) with the ordered file-name (other than generate the file list each time I need to combine a large amount of files).

I ask this because I find generating files list (in order) for the tool to work correctly sometimes take more time than the converting/combining process itself.

Thanks again for quick answer.

Edited by nnq2603

mikeday
The easiest way is to make sure the numbers have leading zeroes, eg. doc001.html, doc002.html, then just make the shell do the work:
prince *.html -o out.pdf

or if you want to be absolutely sure:
prince `ls *.html | sort` -o out.pdf

In future it might be possible to do this with JavaScript from within Prince.
Hi, I would like to edit my list.txt as follows:
./Text/*.html

But I can't.
When I have list.txt like this:
./Text/text_01.html
./Text/text_02.html
./Text/text_03.html

Everything is fine.

Am I doing something wrong?
Did I misunderstand?
Can I use *.html only in the command line?

Thank you
mikeday
Yes, wildcard patterns like *.html are evaluated by the shell on the command-line, not by Prince.
Okay, any other ideas on how to do this?
mikeday
Can you use "ls Text/*.html > list.txt"?