Best command line tool to convert a webpage to a pdf file?

Richard Kimber richardkimber at politicsresources.net
Mon Feb 12 13:03:06 UTC 2018


On Mon, 12 Feb 2018 11:04:35 +0100
Oliver Grawert <ogra at ubuntu.com> wrote:

> yes, libreoffice can do that easily ...
> 
> libreoffice.writer --headless --norestore --writer \
>   --convert-to pdf $URL
> 
> but note that there is no way to define the output filename, it will
> use the name of the input file, so if your URL ends in / you end up
> with a file just called ".html" (you probably want to wrap a script
> around the line above to give the file a proper name)

I'm using Version: 5.1.6.2 on 16.04.3 and for that, at least, it needs
to be:

libreoffice --headless --norestore --writer  --convert-to pdf $URL

- Richard
-- 
Richard Kimber





More information about the ubuntu-users mailing list