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

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Peng Yu
Hi, I have tried wkhtmltopdf. But it can not always guarantee to
generate the pdf correctly. Does anybody know a tool that can generate
a pdf from a URL reliably?

--
Regards,
Peng

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

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

Michael Welle
Hello,

Peng Yu <[hidden email]> writes:

> Hi, I have tried wkhtmltopdf. But it can not always guarantee to
> generate the pdf correctly. Does anybody know a tool that can generate
> a pdf from a URL reliably?

currently I'm experimenting with changing my slide producing process
from Org -> PDF -> HTML to Org -> HTML -> PDF. For the last step
https://github.com/astefanutti/decktape looks promising. I use the
pre-prepared docker container.

Regards
hmw

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

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

Peter Flynn
On 10/02/18 07:15, Michael Welle wrote:

> Hello,
>
> Peng Yu <[hidden email]> writes:
>
>> Hi, I have tried wkhtmltopdf. But it can not always guarantee to
>> generate the pdf correctly. Does anybody know a tool that can generate
>> a pdf from a URL reliably?
>
> currently I'm experimenting with changing my slide producing process
> from Org -> PDF -> HTML to Org -> HTML -> PDF. For the last step
> https://github.com/astefanutti/decktape looks promising. I use the
> pre-prepared docker container.

Install the Vivaldi browser. It has a neat capture facility designed for
screenshotting which creates a JPG or PNG from the *whole* page (ie tall
and narrow)...but then it's easy to cut it up and make a PDF.

It won't of course be a real typeset PDF...for that you would indeed
have to use a renderer like *htmltopdf but the problem is that they are
really not enabled for modern HTML5 pages: the markup is simply too sloppy.

///Peter


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

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

NoOp
On 02/10/2018 12:45 PM, Peter Flynn wrote:

> On 10/02/18 07:15, Michael Welle wrote:
>> Hello,
>>
>> Peng Yu <[hidden email]> writes:
>>
>>> Hi, I have tried wkhtmltopdf. But it can not always guarantee to
>>> generate the pdf correctly. Does anybody know a tool that can generate
>>> a pdf from a URL reliably?
>>
>> currently I'm experimenting with changing my slide producing process
>> from Org -> PDF -> HTML to Org -> HTML -> PDF. For the last step
>> https://github.com/astefanutti/decktape looks promising. I use the
>> pre-prepared docker container.
>
> Install the Vivaldi browser. It has a neat capture facility designed for
> screenshotting which creates a JPG or PNG from the *whole* page (ie tall
> and narrow)...but then it's easy to cut it up and make a PDF.
>
> It won't of course be a real typeset PDF...for that you would indeed
> have to use a renderer like *htmltopdf but the problem is that they are
> really not enabled for modern HTML5 pages: the markup is simply too sloppy.
>
> ///Peter
>
>

Also not CLI, but:

Opera Browser
Version information
Version: 51.0.2830.26 - Opera is up to date
Update stream: Stable
System: Ubuntu 16.04.3 LTS (x86_64; GNOME-Flashback:Unity)

Page|Save as PDF

Does a nice job of saving to a single page PDF.

opera-stable:
  Installed: 51.0.2830.26
  Candidate: 51.0.2830.26
  Version table:
 *** 51.0.2830.26 500
        500 https://deb.opera.com/opera-stable stable/non-free amd64
Packages
        100 /var/lib/dpkg/status

Opera comes in a pre-packaged deb: https://www.opera.com/ and will
automatically set up the deb.opera.com repository for updates upon install.



--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

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

Bret Busby-2
On 12/02/2018, NoOp <[hidden email]> wrote:

> On 02/10/2018 12:45 PM, Peter Flynn wrote:
>> On 10/02/18 07:15, Michael Welle wrote:
>>> Hello,
>>>
>>> Peng Yu <[hidden email]> writes:
>>>
>>>> Hi, I have tried wkhtmltopdf. But it can not always guarantee to
>>>> generate the pdf correctly. Does anybody know a tool that can generate
>>>> a pdf from a URL reliably?
>>>
>>> currently I'm experimenting with changing my slide producing process
>>> from Org -> PDF -> HTML to Org -> HTML -> PDF. For the last step
>>> https://github.com/astefanutti/decktape looks promising. I use the
>>> pre-prepared docker container.
>>
>> Install the Vivaldi browser. It has a neat capture facility designed for
>> screenshotting which creates a JPG or PNG from the *whole* page (ie tall
>> and narrow)...but then it's easy to cut it up and make a PDF.
>>
>> It won't of course be a real typeset PDF...for that you would indeed
>> have to use a renderer like *htmltopdf but the problem is that they are
>> really not enabled for modern HTML5 pages: the markup is simply too
>> sloppy.
>>
>> ///Peter
>>
>>
>
> Also not CLI, but:
>
> Opera Browser
> Version information
> Version: 51.0.2830.26 - Opera is up to date
> Update stream: Stable
> System: Ubuntu 16.04.3 LTS (x86_64; GNOME-Flashback:Unity)
>
> Page|Save as PDF
>
> Does a nice job of saving to a single page PDF.
>
> opera-stable:
>   Installed: 51.0.2830.26
>   Candidate: 51.0.2830.26
>   Version table:
>  *** 51.0.2830.26 500
>         500 https://deb.opera.com/opera-stable stable/non-free amd64
> Packages
>         100 /var/lib/dpkg/status
>
> Opera comes in a pre-packaged deb: https://www.opera.com/ and will
> automatically set up the deb.opera.com repository for updates upon install.
>

I wrote off Opera when the norsemen sold it to the chinese government
so they could use it for their nefarious purposes.

Up until then, it was reputed to be the most secure GUI web browser.

--

Bret Busby
Armadale
West Australia

..............

"So once you do know what the question actually is,
 you'll know what the answer means."
- Deep Thought,
 Chapter 28 of Book 1 of
 "The Hitchhiker's Guide to the Galaxy:
 A Trilogy In Four Parts",
 written by Douglas Adams,
 published by Pan Books, 1992

....................................................

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

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

Oliver Grawert
In reply to this post by Peng Yu
hi,
Am Freitag, den 09.02.2018, 20:49 -0600 schrieb Peng Yu:
> Hi, I have tried wkhtmltopdf. But it can not always guarantee to
> generate the pdf correctly. Does anybody know a tool that can
> generate
> a pdf from a URL reliably?
>

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)

ciao
        oli
--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Richard Kimber
On Mon, 12 Feb 2018 11:04:35 +0100
Oliver Grawert <[hidden email]> 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


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users