1
I have around 200 HTML files that I need to convert to PDFs. The tricky bit is that I need to convert it to a custom paper size (in this case, 5.4" x 7.2"). Acrobat 9 won't let me batch convert to a custom size. Is there any way I can do this without going in and manually printing each individual file to PDF?
I primarily use Windows 7, but I'm not averse to a (Debian) Linux solution.
2Another
htmldoc
user here. A couple things: it has the--size pagesize
option, you probably want--size 5.4x7.2in
. To avoid dedicated title pages and TOCs, use--webpage
.--fontsize size
lets you pick a size.--bodyfont serif
will use the serif font — this is needed because, somehow, the default fonthtmldoc
uses causes issues when rendering links (the underline is simply placed in the wrong place). Also, note that htmldoc expects iso8859-1, so if the documents have incompatible encodings (i.e. something other than iso8859-1 or ASCII), use, e.g.,iconv
. – njsg – 2012-03-24T10:23:21.963Also, with
htmldoc
, the emphasis is on generating a printed, for reading, copy of the document (I usually even set wider margins and remove some stuff from the code (like tables)), so the result is not focused on faithfulness. Aswkhtmltopdf
actually uses a rendering engine, that should be something to look at if your goal is a "1:1" copy of what's on the screen. – njsg – 2012-03-24T10:27:48.6971Thanks! my commmand line looked something like the following:
for html in *.html; do htmldoc --size 5.4x7.2in --top 0.1in --bottom 0.15in --left 0.15in --right 0.15in --bodyfont serif --footer ... --webpage -f "$html".pdf "$html"; done
– nc4pk – 2012-03-24T14:04:21.487