[wxPython-users] Print without PrintDialog
António Barbosa (GN/dpi)
ab at globalnoticias.pt
Tue Nov 7 08:35:16 PST 2006
Hi,
Problem solved!
It was necessary to iniatialize the wx.PrintDialogData:
=
=
=
#------------------------------------------------------------------------
def OnPrintClick(self, event):
pdata =3D wx.PrintData()
pdata.SetPaperId(wx.PAPER_A4)
pdata.SetOrientation(wx.PORTRAIT)
pdata.SetQuality(600)
pdata.SetPrinterName('HP LaserJet 4200 PS')
data =3D wx.PrintDialogData(pdata)
data.SetToPage(1)
data.SetFromPage(1)
data.SetMaxPage(1)
data.SetMinPage(1)
printer =3D wx.Printer(data)
printout =3D MyPrintout()
if printer.Print(self, printout, False):
data =3D printer.GetPrintDialogData()
pdata =3D wx.PrintData(data.GetPrintDat=
a())
printout.Destroy()
#------------------------------------------------------------------------
Thanks anyway.
Antonio Barbosa
=
________________________________
From: Ant=F3nio Barbosa (GN/dpi) [mailto:ab at globalnoticias.pt] =
Sent: segunda-feira, 6 de Novembro de 2006 21:32
To: wxpython-users at lists.wxwidgets.org
Subject: [wxPython-users] Print without PrintDialog
=
Hi,
=
I'm trying to print WITHOUT setup dialog (using system defaults) but withou=
t sucess.
=
I am playing with the example from chapter 17 of THE BOOK (wxpython in acti=
on):
- If I use useSetupDialog =3D True, everything works ok.
- If I use useSetupDialog =3D False, I get no errors but also NO OUTPUT.
=
Here wx 2.6 AND 2.7 on Windows.
=
TIA
Antonio Barbosa
=
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200611=
07/eab8084a/attachment.htm
More information about the wxpython-users
mailing list