Printing with ruby under windows

M

Marc Heiler

Anyone knows if there is an easy, straight-forward way to print a i.e.

foobar.pdf

file on windows?
 
P

Phlip

Marc said:
Anyone knows if there is an easy, straight-forward way to print a i.e.

foobar.pdf

file on windows?

No joke:

system "cmd /c start #{mypdf.to_s.inspect}"

If your users ask not to have to click the little print button, write code
that locates AcroRd32.exe (thru the Registry, in the file association for
pdf), then call:

system "#{path_to_AcroRd32} /p #{mypdf.to_s.inspect}"

There might also be a way to drive Adobe thru its ActiveX Automation. Don't
go that route until you have tried the simpler ways!!
 
A

Axel Etzold

-------- Original-Nachricht --------
Datum: Sat, 21 Jun 2008 21:36:02 +0900
Von: Marc Heiler <[email protected]>
An: (e-mail address removed)
Betreff: Printing with ruby under windows
Anyone knows if there is an easy, straight-forward way to print a i.e.

foobar.pdf

file on windows?

Dear Marc,

I managed to print something in Vista Ultimate with the following command:

system("C:/Program Files/Adobe/Reader 8.0/Reader/AcroRd32.exe /p gpcard.pdf").

(Still had to press the Ok button in the printer dialog....)

You'll maybe have to give the full path of both Acroread and of the file you want to print.
And I also had to change the file separators to forward slashes...
Here's an old post that describes this and other options :


http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/32861


Best regards,

Axel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,666
Latest member
selsetu

Latest Threads

Top