Can Rails be used for printing an order in a store application that has arrived? -- Posted via http://www.ruby-forum.com/.
Hi, yes - why shouldn''t this be possible? You might print out an html view or, if this doesn''t give you enough control about the printing output, use something like the PDF:Writer to construct an order.pdf. Cheers, Jan On 8/4/06, N/a N/a <cain_152@yahoo.com> wrote:> > Can Rails be used for printing an order in a store application that has > arrived? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060804/7cea3ecc/attachment-0001.html
and you may want to use railscron to constantly check for new orders, generate a pdf if there is a new order, then send to printer(lp), or fax(efax), or email (activemailer) , or call (asterisk). On 8/4/06, Jan Prill <jan.prill@gmail.com> wrote:> > Hi, > > yes - why shouldn''t this be possible? You might print out an html view or, > if this doesn''t give you enough control about the printing output, use > something like the PDF:Writer to construct an order.pdf. > > Cheers, > Jan > > > On 8/4/06, N/a N/a <cain_152@yahoo.com> wrote: > > > > Can Rails be used for printing an order in a store application that has > > arrived? > > > > -- > > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- Never be afraid to try something new. Remember, amateurs built the ark; professionals built the Titanic! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060804/c8489b13/attachment.html
Jan Prill wrote:> Hi, > > yes - why shouldn''t this be possible? You might print out an html view > or, > if this doesn''t give you enough control about the printing output, use > something like the PDF:Writer to construct an order.pdf. > > Cheers, > JanI searched the API of the Rails for PDF:Writer. I can''t find it, is it a foreign plugin for the Rails Framkework? -- Posted via http://www.ruby-forum.com/.
Leon Leslie wrote:> and you may want to use railscron to constantly check for new orders, > generate a pdf if there is a new order, then send to printer(lp), or > fax(efax), or email (activemailer) , or call (asterisk).Nah, all I want is to print some standard orders for a BookStore, like the ones that they put it in the book once the book is lended to you. -- Posted via http://www.ruby-forum.com/.
http://www.artima.com/rubycs/articles/pdf_writer.html http://wiki.rubyonrails.com/rails/pages/HowtoGeneratePDFs Cheers, Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060804/5437e624/attachment.html
Jan Prill wrote:> http://www.artima.com/rubycs/articles/pdf_writer.html > > http://wiki.rubyonrails.com/rails/pages/HowtoGeneratePDFs > > Cheers, > JanThanks, I found those to, I was hoping though that the user might not print from acrobat reader, but from a web-page just pressing a print button. But I guess Rails is not that low-level. -- Posted via http://www.ruby-forum.com/.
Hey, of course this is possible too as I wrote earlier. You might for example put together a print.rhtml view which puts out a simple layout optimized for printing and put <body onload="window.print()"> There''s no magic in printing webpages... Rails is as low or high level as you want it to be... Cheers, Jan On 8/4/06, N/a N/a <cain_152@yahoo.com> wrote:> > Jan Prill wrote: > > http://www.artima.com/rubycs/articles/pdf_writer.html > > > > http://wiki.rubyonrails.com/rails/pages/HowtoGeneratePDFs > > > > Cheers, > > Jan > > Thanks, I found those to, I was hoping though that the user might not > print from acrobat reader, but from a web-page just pressing a print > button. But I guess Rails is not that low-level. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060804/8fd3a8bb/attachment.html
Jan Prill wrote:> Hey, of course this is possible too as I wrote earlier. > > You might for example put together a print.rhtml view which puts out a > simple layout optimized for printing and put > > <body onload="window.print()"> > > There''s no magic in printing webpages... Rails is as low or high level > as you want it to be... > > Cheers, > JanAnd it sends the optimized webpage right to the printer? Well, I need the secretary to complete a form, and just press the print button so the webpage or pdf prints. Problem is how do I choose a printer? If that works, hey, no comment to Rails! -- Posted via http://www.ruby-forum.com/.
N/a N/a wrote:> Jan Prill wrote: >> Hey, of course this is possible too as I wrote earlier. >> >> You might for example put together a print.rhtml view which puts out a >> simple layout optimized for printing and put >> >> <body onload="window.print()"> >> >> There''s no magic in printing webpages... Rails is as low or high level >> as you want it to be... >> >> Cheers, >> Jan > > And it sends the optimized webpage right to the printer? Well, I need > the secretary to complete a form, and just press the print button so the > webpage or pdf prints. Problem is how do I choose a printer? If that > works, hey, no comment to Rails!That''s got nothing to do with Rails. If you want to print on the client machine, find a browser that can print without displaying a dialog, if you want to print on the server, use a print spooler shell command like lpr. -- Posted via http://www.ruby-forum.com/.
Andreas Schwarz wrote:> N/a N/a wrote: >> Jan Prill wrote: >>> Hey, of course this is possible too as I wrote earlier. >>> >>> You might for example put together a print.rhtml view which puts out a >>> simple layout optimized for printing and put >>> >>> <body onload="window.print()"> >>> >>> There''s no magic in printing webpages... Rails is as low or high level >>> as you want it to be... >>> >>> Cheers, >>> Jan >> >> And it sends the optimized webpage right to the printer? Well, I need >> the secretary to complete a form, and just press the print button so the >> webpage or pdf prints. Problem is how do I choose a printer? If that >> works, hey, no comment to Rails! > > That''s got nothing to do with Rails. If you want to print on the client > machine, find a browser that can print without displaying a dialog, if > you want to print on the server, use a print spooler shell command like > lpr.Yeah browsers simply do not let webpages do that. It would be bad if you went to a webpage and your printer started freaking out and you cant do anything about it. Your best bet is javascript as defined above, possible in a popup window. Or you could do <body onload="window.print(); window.close();"> in a javascript popup window. Or rather than a popup load it in an invisible iframe. At the end of the day, rails just generates text with headers. If this functionality doesn;t do what you want, the blame is with the HTTP spec and browser security, not rails. -- Posted via http://www.ruby-forum.com/.
On 8/4/06, N/a N/a <cain_152@yahoo.com> wrote:> Jan Prill wrote: > > http://www.artima.com/rubycs/articles/pdf_writer.html > > > > http://wiki.rubyonrails.com/rails/pages/HowtoGeneratePDFs > > > > Cheers, > > Jan > > Thanks, I found those to, I was hoping though that the user might not > print from acrobat reader, but from a web-page just pressing a print > button. But I guess Rails is not that low-level.Rails has absolutely NOTHING to do with printing pages from a web browser. The combination of javascript and html that''s sent to the web browser is what allows that behavior. Joe
On 8/4/06, Joe Van Dyk <joevandyk@gmail.com> wrote:> On 8/4/06, N/a N/a <cain_152@yahoo.com> wrote: > > Jan Prill wrote: > > > http://www.artima.com/rubycs/articles/pdf_writer.html > > > > > > http://wiki.rubyonrails.com/rails/pages/HowtoGeneratePDFs > > > > > > Cheers, > > > Jan > > > > Thanks, I found those to, I was hoping though that the user might not > > print from acrobat reader, but from a web-page just pressing a print > > button. But I guess Rails is not that low-level. > > Rails has absolutely NOTHING to do with printing pages from a web > browser. The combination of javascript and html that''s sent to the > web browser is what allows that behavior.And to clarify, you can send any html and javascript you want with Rails (and any other technology). So, of course this is possible using Rails. Joe
Joe Van Dyk wrote:> On 8/4/06, Joe Van Dyk <joevandyk@gmail.com> wrote: >> > print from acrobat reader, but from a web-page just pressing a print >> > button. But I guess Rails is not that low-level. >> >> Rails has absolutely NOTHING to do with printing pages from a web >> browser. The combination of javascript and html that''s sent to the >> web browser is what allows that behavior. > > And to clarify, you can send any html and javascript you want with > Rails (and any other technology). So, of course this is possible using > Rails. > > JoeThanks for the many responses, I am still grasping the principles of rails and your response was highly appriaciated. I''ll generate some quick appz tomrrow and see if I can get this functionality working. -- Posted via http://www.ruby-forum.com/.
If you are using CSS to layout and style your pages, you could create an alternative CSS file for "print" which creates the optimized layout as mentioned below. That way, you don''t need to generate multiple versions of your page - the browser will automatically generate the print optimized version... I haven''t used this much, but are there issues with browser support? Cheers Mohit. Jan Prill wrote:> Hey, of course this is possible too as I wrote earlier. > > You might for example put together a print.rhtml view which puts out a > simple layout optimized for printing and put > <body > onload="window.print()"> > > There''s no magic in printing webpages... Rails is as low or high level as you want it to be... > > Cheers, > > Jan > > > On 8/4/06, *N/a N/a* <cain_152@yahoo.com <mailto:cain_152@yahoo.com>> > wrote: > > Jan Prill wrote: > > http://www.artima.com/rubycs/articles/pdf_writer.html > > > > http://wiki.rubyonrails.com/rails/pages/HowtoGeneratePDFs > > > > Cheers, > > Jan > > Thanks, I found those to, I was hoping though that the user might not > print from acrobat reader, but from a web-page just pressing a print > button. But I guess Rails is not that low-level. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org <mailto:Rails@lists.rubyonrails.org> > http://lists.rubyonrails.org/mailman/listinfo/rails > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >