in one of my apps i am currently using redcloth to use textile formatting on my content. i am wanting to add reporting to the system, but the content that prints out doesn''t have the formatting obviously that i can have with html. what''s a good solution for some kind of formatting where i can use it on both web and print? i''m using pdf/writer right now and i think it''s great. but if there are better solutions out there, please let me know. thanks -- Posted via http://www.ruby-forum.com/.
On Mon, Jun 19, 2006 at 10:18:58PM +0200, Josh Kieschnick wrote:> in one of my apps i am currently using redcloth to use textile > formatting on my content. > > i am wanting to add reporting to the system, but the content that prints > out doesn''t have the formatting obviously that i can have with html. > > what''s a good solution for some kind of formatting where i can use it on > both web and print? i''m using pdf/writer right now and i think it''s > great. but if there are better solutions out there, please let me know.It''s kind of off-topic here, but I''m doing something for generating what should be HTML reports and bundling them into PDF format for sending off to management and the like in a cronjob. If you''re on unix, a similar approach might be useful for you... Steps involved: - Generate HTML output - run html2ps on .html file (passing in paths to images in webroot) to convert to .ps format - run ps2pdf on .ps file to convert to .pdf format - (optionally) mail off to distribution list At the time, it was a nice "quick" way to get the pretty HTML formatting from a 3rd party reporting tool into a format that didn''t require a network connection, and could still be read by everyone in the same way. It also means all changes to the exist HTML layout are automatically reflected in the PDF version (a nice way to apply DRY in an attempt to get this tangentially back on-topic). -- Michael A. Gurski (opt. [first].)[last]@pobox.com http://www.pobox.com/~[last] 1024R/39B5BADD PGP: 34 93 A9 94 B1 59 48 B7 17 57 1E 4E 62 56 45 70 1024D/1166213E GPG: 628F 37A4 62AF 1475 45DB AD81 ADC9 E606 1166 213E 4096R/C0B4F04B GPG: 5B3E 75D7 43CF CF34 4042 7788 1DCE B5EE C0B4 F04B Views expressed by the host do not reflect the staff, management or sponsors. "The State is that great fiction by which everyone tries to live at the expense of everyone else." --Frederic Bastiat (1801 - 1850), French statesman and author. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://wrath.rubyonrails.org/pipermail/rails/attachments/20060619/233e8ed0/attachment.bin
On Mon, 2006-06-19 at 16:28 -0400, Michael Gurski wrote:> On Mon, Jun 19, 2006 at 10:18:58PM +0200, Josh Kieschnick wrote: > > in one of my apps i am currently using redcloth to use textile > > formatting on my content. > > > > i am wanting to add reporting to the system, but the content that prints > > out doesn''t have the formatting obviously that i can have with html. > > > > what''s a good solution for some kind of formatting where i can use it on > > both web and print? i''m using pdf/writer right now and i think it''s > > great. but if there are better solutions out there, please let me know. > > It''s kind of off-topic here, but I''m doing something for generating > what should be HTML reports and bundling them into PDF format for > sending off to management and the like in a cronjob. If you''re on > unix, a similar approach might be useful for you... > > Steps involved: > - Generate HTML output > - run html2ps on .html file (passing in paths to images in webroot) to > convert to .ps format > - run ps2pdf on .ps file to convert to .pdf format > - (optionally) mail off to distribution list > > At the time, it was a nice "quick" way to get the pretty HTML > formatting from a 3rd party reporting tool into a format that didn''t > require a network connection, and could still be read by everyone in > the same way. It also means all changes to the exist HTML layout are > automatically reflected in the PDF version (a nice way to apply DRY in > an attempt to get this tangentially back on-topic).---- I punted on this several months ago and would love to know of a methodology to do this without inventing my own wheel...if you blog it, you must post. ;-) Thanks Craig
On Mon, Jun 19, 2006 at 01:34:56PM -0700, Craig White wrote:> On Mon, 2006-06-19 at 16:28 -0400, Michael Gurski wrote: > > Steps involved: > > - Generate HTML output > > - run html2ps on .html file (passing in paths to images in webroot) to > > convert to .ps format > > - run ps2pdf on .ps file to convert to .pdf format > > - (optionally) mail off to distribution list > > > > At the time, it was a nice "quick" way to get the pretty HTML > > formatting from a 3rd party reporting tool into a format that didn''t > > require a network connection, and could still be read by everyone in > > the same way. It also means all changes to the exist HTML layout are > > automatically reflected in the PDF version (a nice way to apply DRY in > > an attempt to get this tangentially back on-topic). > ---- > I punted on this several months ago and would love to know of a > methodology to do this without inventing my own wheel...if you blog it, > you must post. ;-)I doubt I''ll be making any major changes to my process anytime soon, as it''s technically on a production system that now is under change control, and I don''t like the paperwork I''d need to fill out... :-) Incidentally, the mentioned programs (on my systems at least) are in the html2ps and gs-common packages, respectively. -- Michael A. Gurski (opt. [first].)[last]@pobox.com http://www.pobox.com/~[last] 1024R/39B5BADD PGP: 34 93 A9 94 B1 59 48 B7 17 57 1E 4E 62 56 45 70 1024D/1166213E GPG: 628F 37A4 62AF 1475 45DB AD81 ADC9 E606 1166 213E 4096R/C0B4F04B GPG: 5B3E 75D7 43CF CF34 4042 7788 1DCE B5EE C0B4 F04B Views expressed by the host do not reflect the staff, management or sponsors. "Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech or the press; or the right of the people to peacably assemble and to petition the Government for a redress of grievances." --The First Amendment to the Constitution of the United States of America, declared in force December 15, 1791 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://wrath.rubyonrails.org/pipermail/rails/attachments/20060619/d510d5a3/attachment.bin
I use htmldoc. Here''s an example action: def report @person = Person.find(params[:id]) add_variables_to_assigns generator = IO.popen(''htmldoc -t pdf14 --webpage -'', ''w+'') generator.puts @template.render(''/person/report'') generator.close_write send_data generator.read, :filename => "Person report for #{@person.name}.pdf", :type => ''application/pdf'', :disposition => ''inline'' end -Jonathan. On 6/20/06, Michael Gurski <rails@gurski.org> wrote:> On Mon, Jun 19, 2006 at 01:34:56PM -0700, Craig White wrote: > > On Mon, 2006-06-19 at 16:28 -0400, Michael Gurski wrote: > > > Steps involved: > > > - Generate HTML output > > > - run html2ps on .html file (passing in paths to images in webroot) to > > > convert to .ps format > > > - run ps2pdf on .ps file to convert to .pdf format > > > - (optionally) mail off to distribution list > > > > > > At the time, it was a nice "quick" way to get the pretty HTML > > > formatting from a 3rd party reporting tool into a format that didn''t > > > require a network connection, and could still be read by everyone in > > > the same way. It also means all changes to the exist HTML layout are > > > automatically reflected in the PDF version (a nice way to apply DRY in > > > an attempt to get this tangentially back on-topic). > > ---- > > I punted on this several months ago and would love to know of a > > methodology to do this without inventing my own wheel...if you blog it, > > you must post. ;-) > > I doubt I''ll be making any major changes to my process anytime soon, > as it''s technically on a production system that now is under change > control, and I don''t like the paperwork I''d need to fill out... :-) > > Incidentally, the mentioned programs (on my systems at least) are in > the html2ps and gs-common packages, respectively. > > -- > Michael A. Gurski (opt. [first].)[last]@pobox.com http://www.pobox.com/~[last] > 1024R/39B5BADD PGP: 34 93 A9 94 B1 59 48 B7 17 57 1E 4E 62 56 45 70 > 1024D/1166213E GPG: 628F 37A4 62AF 1475 45DB AD81 ADC9 E606 1166 213E > 4096R/C0B4F04B GPG: 5B3E 75D7 43CF CF34 4042 7788 1DCE B5EE C0B4 F04B > Views expressed by the host do not reflect the staff, management or sponsors. > > "Congress shall make no law respecting an establishment of religion, > or prohibiting the free exercise thereof; or abridging the freedom of > speech or the press; or the right of the people to peacably assemble > and to petition the Government for a redress of grievances." --The > First Amendment to the Constitution of the United States of America, > declared in force December 15, 1791 > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (GNU/Linux) > > iD8DBQFElw48SfEA4VjuFKURAr/nAKCMDlWXNWsxH6EDGawM3qcdpbrxDwCguSKQ > aM93LJ+apbAaPMfhW9CcsgI> =6FDu > -----END PGP SIGNATURE----- > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
HTMLdoc doesn''t have decent CSS support (yet). The latest stable version has no css support whatsoever, the latest development build has, but you need to take a lot of quirky stuff into account (absolute url to the css file, no dashes or underscores in class and id names, ?). On 20 Jun 2006, at 01:45, Jonathan Viney wrote:> I use htmldoc. Here''s an example action: > > def report > @person = Person.find(params[:id]) > add_variables_to_assigns > > generator = IO.popen(''htmldoc -t pdf14 --webpage -'', ''w+'') > generator.puts @template.render(''/person/report'') > generator.close_write > > send_data generator.read, :filename => "Person report for > #{@person.name}.pdf", :type => ''application/pdf'', :disposition => > ''inline'' > endBest regards Peter De Berdt -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060620/59c14d3a/attachment.html
Good point. I should have mentioned that! -Jonathan. On 6/20/06, Peter De Berdt <peter.de.berdt@pandora.be> wrote:> > HTMLdoc doesn''t have decent CSS support (yet). The latest stable version has > no css support whatsoever, the latest development build has, but you need to > take a lot of quirky stuff into account (absolute url to the css file, no > dashes or underscores in class and id names, ?). > > > Best regards > > > > > Peter De Berdt > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
Peter De Berdt wrote:> HTMLdoc doesn''t have decent CSS support (yet). The latest stable > version has no css support whatsoever, the latest development build > has, but you need to take a lot of quirky stuff into account > (absolute url to the css file, no dashes or underscores in class and > id names, �?�). > > > On 20 Jun 2006, at 01:45, Jonathan Viney wrote: > >> send_data generator.read, :filename => "Person report for >> #{@person.name}.pdf", :type => ''application/pdf'', :disposition => >> ''inline'' >> end > > > > Best regards > > Peter De BerdtI am tryin to run Prince which seems to give excellent results and use CSS http://sublog.subimage.com/articles/2007/05/29/html-css-to-pdf-using-ruby-on-rails http://www.nullislove.com/2007/05/30/easy-pdfs-from-rails/#comment-506 kad -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Josh Kieschnick wrote:> in one of my apps i am currently using redcloth to use textile > formatting on my content. > > i am wanting to add reporting to the system, but the content that prints > out doesn''t have the formatting obviously that i can have with html. > > what''s a good solution for some kind of formatting where i can use it on > both web and print? i''m using pdf/writer right now and i think it''s > great. but if there are better solutions out there, please let me know. > > thanksI just finished testing Prince ... lok at http://sublog.subimage.com/articles/2007/05/29/html-css-to-pdf-using-ruby-on-rails output pdf quality from html is !!!! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Glad you guys are finding the article helpful ;) On 8/29/07, Kad Kerforn <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Josh Kieschnick wrote: > > in one of my apps i am currently using redcloth to use textile > > formatting on my content. > > > > i am wanting to add reporting to the system, but the content that prints > > out doesn''t have the formatting obviously that i can have with html. > > > > what''s a good solution for some kind of formatting where i can use it on > > both web and print? i''m using pdf/writer right now and i think it''s > > great. but if there are better solutions out there, please let me know. > > > > thanks > > I just finished testing Prince ... > > lok at > > http://sublog.subimage.com/articles/2007/05/29/html-css-to-pdf-using-ruby-on-rails > > output pdf quality from html is !!!! > -- > Posted via http://www.ruby-forum.com/. > > > >-- -------------------- seth at subimage interactive ----- http://sublog.subimage.com ----- Cashboard - Estimates, invoices, and time tracking software - for free! http://www.getcashboard.com ----- Substruct - Open source RoR e-commerce software. http://dev.subimage.com/projects/substruct --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 29 Aug 2007, at 16:37, Kad Kerforn wrote:> I am tryin to run Prince which seems to give excellent results and use > CSS > http://sublog.subimage.com/articles/2007/05/29/html-css-to-pdf- > using-ruby-on-rails > http://www.nullislove.com/2007/05/30/easy-pdfs-from-rails/#comment-506Sure, but it costs a fortune, especially if you''re staging one application to several servers (e.g. each customer runs their own internal server). Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Well I''m sure you could try to create a web service to only have to install prince on one machine that way. On Aug 30, 12:24 am, Peter De Berdt <peter.de.be...-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:> On 29 Aug 2007, at 16:37, Kad Kerforn wrote: > > > I am tryin to run Prince which seems to give excellent results and use > > CSS > >http://sublog.subimage.com/articles/2007/05/29/html-css-to-pdf- > > using-ruby-on-rails > >http://www.nullislove.com/2007/05/30/easy-pdfs-from-rails/#comment-506 > > Sure, but it costs a fortune, especially if you''re staging one > application to several servers (e.g. each customer runs their own > internal server). > > Best regards > > Peter De Berdt--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---