Ruby on Rails Saturday, April 7, 2018

It's not really a Rails question, but what you need to add to your page is a JavaScript that calls to window.print(); Just that bit, in a script tag, before the closing /body of the page. But that's only going to work in an HTML page, not in the PDF. I don't know / believe you can / get a PDF to "auto-print" like you can a Web page.

Walter

> On Apr 7, 2018, at 12:12 AM, Ralph Shnelvar <ralphs@dos32.com> wrote:
>
> Rubyonrails-talk,
>
> I have a file on my server I want a client machine to print.
>
>
> I have searched and searched ... and have found:
>
> How to convert HTML to PDF
> How to display a PDF in a new window.
> How to print a window via javascript ...
>
> but not how to print to a physical printer (via the standard system dialogs) an invoice or ticket the way many websites do.
>
> Ralph Shnelvar
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/710468395.20180406221238%40dos32.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/B7AE5D9B-C2B9-4CD2-B798-0DEE8C4E9FF2%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment