Hi, I am generating some pdf through a for loop. now i want to print those pdf file through program. Any help/suggestion will be appreciated. Thanks in advance. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 06 Aug 2010, at 10:19, sumanta wrote:> I am generating some pdf through a for loop. now i want to print > those pdf file through program. Any help/suggestion will be > appreciated.1. Buy a network enabled printer that supports PDF printing with some kind of upload support (e.g. FTP server) 2. Buy an application that enables you to upload the file to it and thus add it to a queue and then send it to the printer, look around, there has to be such an application somewhere 3. If you have no control over the enduser''s environment and since you''re dealing with a web application, it''s up to the user to either download the file or view it in the browser via a plugin and print it themselves. You can''t force the user''s browser to print the file. 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 6 August 2010 09:19, sumanta <sumantacaptain-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > I am generating some pdf through a for loop. now i want to print > those pdf file through program. Any help/suggestion will be > appreciated.Where are you trying to print it? On the server or on the users PC? It is not possible, I think, to force a print on the users PC from a web app, the user must do that himself. Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
On Fri, Aug 6, 2010 at 4:59 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 6 August 2010 09:19, sumanta <sumantacaptain-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Hi, >> I am generating some pdf through a for loop. now i want to print >> those pdf file through program. Any help/suggestion will be >> appreciated. > > Where are you trying to print it? On the server or on the users PC? > It is not possible, I think, to force a print on the users PC from a > web app, the user must do that himself.On the user''s PC you can use javascript to trigger the printing (window.print) but, as Colin correctly notes, that will present the user with a printer dialog box, not automatically print the contents of the page. At any rate, that''s not relevant until you get the pdf into the user''s browser. To do that you''ll probably use send_file which, iirc, will trigger a dialog that asks the user whether they want to save or print the file. HTH, Bill -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Bill Walton wrote: [...]> At any rate, that''s not relevant until you get the pdf > into the user''s browser. To do that you''ll probably use send_file > which, iirc, will trigger a dialog that asks the user whether they > want to save or print the file.I think that would be browser-specific. Wouldn''t send_file just make the browser act the same way it would when it received a static PDF file?> > HTH, > BillBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Fri, Aug 6, 2010 at 9:09 AM, Marnen Laibow-Koser <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Bill Walton wrote: > [...] >> At any rate, that''s not relevant until you get the pdf >> into the user''s browser. To do that you''ll probably use send_file >> which, iirc, will trigger a dialog that asks the user whether they >> want to save or print the file. > > I think that would be browser-specific. Wouldn''t send_file just make > the browser act the same way it would when it received a static PDF > file?Yes it would. And 1) you''re right - the options probably are browser-specific, and 2) the options I was thinking of are save or open, not save or print. And further, the javascript option wouldn''t work either since the pdf would either replace what was in the window, open a new one, or open the file in Reader. My bad. Responding before caffeine kicks in is dangerous ;-( Best regards, Bill -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Bill Walton wrote:> On Fri, Aug 6, 2010 at 9:09 AM, Marnen Laibow-Koser > <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> Bill Walton wrote: >> [...] >>> At any rate, that''s not relevant until you get the pdf >>> into the user''s browser. �To do that you''ll probably use send_file >>> which, iirc, will trigger a dialog that asks the user whether they >>> want to save or print the file. >> >> I think that would be browser-specific. �Wouldn''t send_file just make >> the browser act the same way it would when it received a static PDF >> file? > > Yes it would. And 1) you''re right - the options probably are > browser-specific, and 2) the options I was thinking of are save or > open, not save or print. And further, the javascript option wouldn''t > work either since the pdf would either replace what was in the window, > open a new one, or open the file in Reader. My bad. Responding > before caffeine kicks in is dangerous ;-(Understood. Next time wait till before the caffeine kicks in before posting to the list. :)> > Best regards, > BillBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.