Printing file with printer dialog

M

Marco Bonifazi

Hello!

I have a file (in my situation it is a Postscript file or a Pdf file,
but it isn't important).

I must send this file to a printer, using Python, and I need to select
the printer to which I want send this file.
Then I would use a Dialog Window.

I use PyGtk on Windows (but if I can open a dialog without PyGtk is
also good), I would know all methods to do it.

Thanks also if you don't answer!

Marco Bonifazi

http://www.bonifazi.eu
 
D

Dennis Lee Bieber

Hello!

I have a file (in my situation it is a Postscript file or a Pdf file,
but it isn't important).
Au contraire (pardon the slaughtered French)

On Windows, most files need to be printed by an application that can
render the file contents as bitmap pages. You might be able to send a
raw Postscript file to a Postscript aware printer, but unless the
printer also understands PDF syntax, you will probably have to invoke
Acrobat Reader to print it -- or some other program that can read and
render PDF.
import subprocess
x = subprocess.Popen([r"c:\Program Files\Adobe\Acrobat 7.0\Reader\acrord32.exe", .... "/p", "aprs101.pdf"])

Is sufficient (on my machine) to have Acrobat Reader's print dialog
appear -- though one must then physically select the printer (if the
default is not desired) and activate the actual "print". It also has the
drawback of leaving a minimized Reader in the task bar.
I must send this file to a printer, using Python, and I need to select
the printer to which I want send this file.
Then I would use a Dialog Window.

I use PyGtk on Windows (but if I can open a dialog without PyGtk is
also good), I would know all methods to do it.

In general though, I suspect you'll need to study the win32print
module in the Windows extensions -- and by the time you've gone that
far, you might find some way to activate the win32 common dialogs
without needing PyGtk.
.... print p
....
(8388608, 'ScanSoft PDF Create!,ScanSoft PDF Create!,', 'ScanSoft PDF
Create!', '')
(8388608, 'Procomm Plus 32 Fax,Procomm Plus Fax Driver,', 'Procomm Plus
32 Fax', '')
(8388608, 'Intuit Internal Printer,Amyuni PDF Converter 2.07,Virtual',
'Intuit Internal Printer', 'Print to File!')
(8388608, 'hp deskjet 6122 series,hp deskjet 6122 series,', 'hp deskjet
6122 series', '')
(8388608, 'Fax,Microsoft Shared Fax Driver,', 'Fax', '')
(8388608, 'ESP 960 Color Managed,EPSON Stylus Photo 960,', 'ESP 960
Color Managed', '')
(8388608, 'EPSON Stylus Photo 960,EPSON Stylus Photo 960,Back of Rack',
'EPSON Stylus Photo 960', 'Look at all the pretty pictures')--
Wulfraed Dennis Lee Bieber KD6MOG
(e-mail address removed) (e-mail address removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (e-mail address removed))
HTTP://www.bestiaria.com/
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top