Covert HTML to PDF

Hello Everyone,

I am working on a website where I am required to convert an HTML view
into a PDF document. I have found some gems and plug-ins like
PDF::Writer, but none of these are good for converting HTML and CSS to
PDF file.

I found a gem called “Princely” which works with “PrinceXML”. But
PrinceXML library is not free and we don’t have money to pay for it as
we are non-profit.

Anyone who knows of a gem or plug-in that will best fit my scenario?

Thanks a lot!

hi
look to wkhtml2pdf

Ivan N.
[email protected]

I was also going to suggest wkthml2pdf… but in the easy to use form of
a
plugin called wicked_pdf…

See this tutorial…
http://snikt.net/index.php/2010/03/03/generating-pdfs-from-ruby-on-rails

On Thu, Jun 17, 2010 at 11:09 AM, Ivan N. [email protected]
wrote:

PrinceXML library is not free and we don’t have money to pay for it as
“Ruby on Rails: Talk” group.
“Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected][email protected]
.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


Joshua S. Martin

CONFIDENTIALITY NOTE: This e-mail message, including any attachment(s),
contains information that may be confidential, protected by the attorney
client or other legal privileges, and or proprietary non public
information.
If you are not an intended recipient of this message or an authorized
assistant to an intended recipient, please notify the sender by replying
to
this message and then delete it from your system. Use, dissemination,
distribution, or reproduction of this message and or any of its
attachments
(if any) by unintended recipients is not authorized and may be unlawful.

its easy use pdf-kit )

Ivan N.
[email protected]

On 17 Jun 2010, at 17:04, Rails L. wrote:

I am working on a website where I am required to convert an HTML view
into a PDF document. I have found some gems and plug-ins like
PDF::Writer, but none of these are good for converting HTML and CSS to
PDF file.

I found a gem called “Princely” which works with “PrinceXML”. But
PrinceXML library is not free and we don’t have money to pay for it as
we are non-profit.

Anyone who knows of a gem or plug-in that will best fit my scenario?

You could also just try and e-mail the guys at Prince and present them
with your case and ask if they would be interested in sponsoring your
non-profit project (in exchange for some kind of promotional banner or
mentioning Prince perhaps).

Best regards

Peter De Berdt

Hi Everybody,

I am using wicked_pdf plugin and having a hard time to get it working.
On windows XP, I get the error “fork() function is unimplemented on this
machine”
and on Mac OSX Snow Leopard, I get “Broken pipe” error.

Any help is much appreciated!

Thanks!

Thanks Everyone for your suggestions.
Appreciate your time and reply!

Did you first install the wkhtmltopdf utility? it’s not installed
automatically as part of the plugin because it’s platform-specific…

http://code.google.com/p/wkhtmltopdf/

On Fri, Jun 18, 2010 at 11:19 AM, Rails L.
[email protected]wrote:

For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


Joshua S. Martin

CONFIDENTIALITY NOTE: This e-mail message, including any attachment(s),
contains information that may be confidential, protected by the attorney
client or other legal privileges, and or proprietary non public
information.
If you are not an intended recipient of this message or an authorized
assistant to an intended recipient, please notify the sender by replying
to
this message and then delete it from your system. Use, dissemination,
distribution, or reproduction of this message and or any of its
attachments
(if any) by unintended recipients is not authorized and may be unlawful.

Hi Joshua ,

I did install wkhtmltopdf.

I have given pdfkit a try which is working very well if I give it an
address like “http://google.com”.
Just don’t know how to specify the address of a page from within my app.
Giving address like “http://localhost:3000/test” is not working.

Here is the code for pdfkit:
format.pdf do
kit = PDFKit.new(“http://google.com”)
send_data(kit.to_pdf, :filename => “New.pdf”, :type =>
‘application/pdf’)
end

Thanks!

If you are a non profit organization, you have a chance to obtain a nice
html to pdf converting library - PD4ML for
Ruby for free from http://pd4ml.com/. Just contact them.

http://thinkrelevance.com/blog/2010/06/15/rethinking-pdf-creation-in-ruby.html