Forum: Ruby html 2 pdf

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3b593e0746a5694a1d3f3cc533954645?d=identicon&s=25 David Southwell (Guest)
on 2007-07-18 16:57
(Received via mailing list)
Hi

IIs there a gem for converting html to pdf?

I need to build a routine to step through a website and create a pdf
from the
downloaded pages.

Thanks in advance

david Southwell
3bb23e7770680ea44a2d79e6d10daaed?d=identicon&s=25 M. Edward (Ed) Borasky (Guest)
on 2007-07-18 17:18
(Received via mailing list)
David Southwell wrote:
>
>
>

If not, you could probably just shell out to the open source htmldoc
http://www.easysw.com/htmldoc/. There's a Perl interface you can learn
from, HTML-HTMLDoc
(http://search.cpan.org/~mkfrankl/HTML-HTMLDoc-0.10/). Or you could
build something out of "hpricot" and "pdf-writer".
31e038e4e9330f6c75ccfd1fca8010ee?d=identicon&s=25 Gregory Brown (Guest)
on 2007-07-18 19:10
(Received via mailing list)
On 7/18/07, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:

> If not, you could probably just shell out to the open source htmldoc
> http://www.easysw.com/htmldoc/. There's a Perl interface you can learn
> from, HTML-HTMLDoc

This would probably work pretty good. I've done it before.  A ruby
wrapper for this would be most appreciated, if anyone is looking for a
project!

> (http://search.cpan.org/~mkfrankl/HTML-HTMLDoc-0.10/). Or you could
> build something out of "hpricot" and "pdf-writer".

If you do this, I suggest using Ruport instead of PDF::Writer for your
PDF stuff.  Of course, Ruport just wraps PDF::Writer, but it fixes
some bugs (thanks to Austin Ziegler) and adds some higher level
features and helps wrap the formatting code.

Some relevant docs if that's feasible for you:

http://rubyreports.org/cheatsheets/formatting.html
http://ruportbook.com/printable_documents.html
http://ruportbook.com/integration.html#pdf_writer_proxy
http://ruportbook.com/renderer_logic.html
1c0cd550766a3ee3e4a9c495926e4603?d=identicon&s=25 John Joyce (Guest)
on 2007-07-20 18:19
(Received via mailing list)
On Jul 18, 2007, at 10:17 AM, M. Edward (Ed) Borasky wrote:

>>
>
>
No Good.
It doesn't even fully support HTML 4 !
And no support for stylesheets...?
There must be other alternatives.
OS X has built-in print to PDF (has had for many years) so there must
be GNU tool to do it.
A777f1a2049d78a12ead38efb8f75f97?d=identicon&s=25 Tanner Burson (Guest)
on 2007-07-20 18:32
(Received via mailing list)
On 7/20/07, John Joyce <dangerwillrobinsondanger@gmail.com> wrote:
> >> pdf from the
> > http://www.easysw.com/htmldoc/. There's a Perl interface you can learn
> be GNU tool to do it.
Sure, but nothing I'm aware of that doesn't require a full browser
renderer
to work.  The print to PDF feature as I understand it uses a modified
print
"driver" that converts the post script output into a PDF doc instead of
sending it to a printer.  This is a far cry from just taking an
aribtrary
html file and making it a PDF.
5a837592409354297424994e8d62f722?d=identicon&s=25 Ryan Davis (Guest)
on 2007-07-20 23:01
(Received via mailing list)
On Jul 18, 2007, at 07:56 , David Southwell wrote:

> IIs there a gem for converting html to pdf?
>
> I need to build a routine to step through a website and create a
> pdf from the
> downloaded pages.

I have one that only works on OSX, but it works well. Lemme know if
you want it and I'll try to dig it up.
59c55f53575234e95454c243f7f35fee?d=identicon&s=25 Tiffany Sonny (Guest)
on 2007-07-20 23:03
(Received via mailing list)
I want it:)
This topic is locked and can not be replied to.