Print natively on Windows

I would like to be able to print a simple report (text, some lines and
boxes) from a ruby application natively to a printer on a Windows
platform. Can anyone give me guidance on how to do that?

To do that I used to output html pages and launch the default internet browser with the launchy library.

For more complex presentation, I used to output pdf code.

Works both with Windows or Linux.

···

Le 27/12/2013 22:24, Varro a écrit :

I would like to be able to print a simple report (text, some lines and
boxes) from a ruby application natively to a printer on a Windows
platform. Can anyone give me guidance on how to do that?

Varro wrote in post #1131706:

Can anyone give me guidance on how to do that?

Hello,
I used to write my 'report' in a HTML file, with an onload handler wich
call print.
Then call system 'start', 'report.html'

···

--
Posted via http://www.ruby-forum.com/\.

One option is to use a gem to write a PDF file, then use acrobat
reader's command line print option with the default printer.

···

--
Posted via http://www.ruby-forum.com/.

That's more of a flaw of Adobe in lacking an "invisible" option. Any
chance of adding a command-line PDF printer?

···

--
Posted via http://www.ruby-forum.com/.

I was thinking small, portable, command-line only or a gem. Still, I
haven't done any proper research on it, just an idea.

···

--
Posted via http://www.ruby-forum.com/.

Oh, my I just saw one yesterday, let me see if I can find it again. It
looks like it produces output that looks rather like MySQL's tty output in
boxes.

···

On Sat, Dec 28, 2013 at 4:11 PM, Joel Pearson <lists@ruby-forum.com> wrote:

I was thinking small, portable, command-line only or a gem. Still, I
haven't done any proper research on it, just an idea.

Okay, my apologies, what I saw was this
https://github.com/cldwalker/hirbwhich a formatter for IRB. Perhaps
you could glean something from it,
though.

···

On Sat, Dec 28, 2013 at 6:24 PM, tamouse pontiki <tamouse.lists@gmail.com>wrote:

On Sat, Dec 28, 2013 at 4:11 PM, Joel Pearson <lists@ruby-forum.com>wrote:

I was thinking small, portable, command-line only or a gem. Still, I
haven't done any proper research on it, just an idea.

Oh, my I just saw one yesterday, let me see if I can find it again. It
looks like it produces output that looks rather like MySQL's tty output in
boxes.

Joel Pearson wrote:

One option is to use a gem to write a PDF file, then use acrobat
reader's command line print option with the default printer.

That's what I'm doing now, but it means that when I request a print
job, a copy of acrobat pops up to do the actual printing. This looks
unprofessional, hence my seeking a way to print natively, rather than
relying on another application to do the actual printing.

(Other responders mentioned outputting HTML and relying on the browser
to print, but that has the same objection, and is even worse, since
one doesn't have the exact control of the output than one has with
outputting a PDF file.)

···

--
Will

Joel Pearson wrote:

That's more of a flaw of Adobe in lacking an "invisible" option. Any
chance of adding a command-line PDF printer?

I wouldn't know how to write one myself, and I don't want my users to
have to install a third-party application to use my software.