[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnumed-devel] printing on Windows

From: Sebastian Hilbert
Subject: [Gnumed-devel] printing on Windows
Date: Fri, 29 Apr 2011 11:11:48 +0200
User-agent: KMail/1.13.6 (Linux/; KDE/4.6.0; i686; ; )

More bits on printing on Windows.

Most documents in GNUmed seem to be avaiable as pdf before they are being 

I believe we cannot rely on Adobe Reader being installed so we need to find 
another way. 

Here is a bit of code we might want to look at.

#!/usr/bin/env python

import sys

from PyQt4.QtCore import *
from PyQt4.QtGui import *

doc=QTextDocument("Hello" )
dialog = QPrintDialog(printer)
dialog.setWindowTitle("Print Document" )

# dialog.addEnabledOption(QAbstractPrintDialog.PrintSelection)

if dialog.exec_() == True:

What does it currently do ? It opens the printing dialog (tested on Linux) and 
prints out the text "Hello" on paper. I still have to test it on Windows.

1.) It is done in PyQT. That is because I am not aware wxpython is capable of 
handling it the same way (yet). Let me know if that is not true.

2.) The PyQT program could be converted to a standalone binary executable 
which means there needs to be no QT installation on the Windows PC

3.) I might need to be extended to accept command line arguments for e.g. 
printing to the default printer , printing to a pre-defined printer

4.) It could be used to return sane error codes so GNUmed will have useful 

5.) It will be called from gm-print_doc.bat so there is no need to change the 

6.) it needs code to support other input then text. This essentially means I 
need to look at how to pipe the pdf to it instead of text.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]