Earlier today I put out a plea:
WANT: to get Chrome/Firefox/Safari to save a web page to PDF without invoking dialogue box / 3rd-party service. One-click or shellscript.
— Alec Muffett (@AlecMuffett) October 23, 2012
…which (long story short) led to a bunch of suggestions none of which quite worked for me.
A more succinct problem statement would be: I have a list of about 50 wiki pages, want to create PDF versions of each one, and don’t care too much about links/inclusions because they are text heavy.
Fighting frustration I passed through a barrier:
Am currently going with “fuck it, i’ll compile lynx” as a strategy.Have moved further forward in 15 minutes than 90mins of Google+GUI
— Alec Muffett (@AlecMuffett) October 23, 2012
…then someone mentioned convert on OSX which sparked a memory from long ago, leading to some Googling and the recognition that this was essentially cupsfilter in disguise (good tip, bad slideshow with broken and flaky script examples) which led me to a solution along the lines of:
while read foo
do
curl http://server/$foo/ > $foo.html
cupsfilter -f $foo.html -a media=A4 -a scaling=75 > $foo.pdf
done
…and that worked. Got what I wanted anyway. Not sure what would happen if I passed entire HTML directories into it.
Leave a Reply