How to print files with wxPython? I am making an application that save data
into MySQL then I want to make a data's printout. I am still confused about
using wxPrintout, wxPrinter, wxPrintDialog, wxPrintData, etc.
Please give some example scripts for printing.
Thanks,
Mico Siahaan
···
--------------------------
mico@intermatik.co.id
Mobile ph. 08179997828
How to print files with wxPython? I am making an application that save data
into MySQL then I want to make a data's printout. I am still confused about
using wxPrintout, wxPrinter, wxPrintDialog, wxPrintData, etc.
When printing you essentially need to just draw your data to a DC, just like you would when drawing it in a window for display on the desktop. So work on doing that first and then you can easily move it over to the print framework.
Alternativly if you can transform your data to HTML then you can print it using the wxHtmlEasyPrinting class.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
So let me give more details:
My client ask me to make a simple application to create, preview and print a
barcode.
My idea is simple: I call gnu barcode from my python script to create a
barcode.
Gnu barcode created postscript files, and I don't know how to preview and
print it. So the files I need to print are postscript files.
Thanks. But I will try your suggestion first.
Mico Siahaan
···
--------------------------
mico@intermatik.co.id
Mobile ph. 08179997828
When printing you essentially need to just draw your data to a DC, just
like you would when drawing it in a window for display on the desktop.
So work on doing that first and then you can easily move it over to the
print framework.
Alternativly if you can transform your data to HTML then you can print
it using the wxHtmlEasyPrinting class.
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Maybe you want to look into reportlab (reportlab.com).
If you dig around on the webpage there is some addon code producing barcodes.
I use that quite successfully for large print jobs.
Reportlab is fairly easy to handle once you get the concept.
You'd still have to figure a way to print. Usually it generates PDF's, but I
think it can do PS as well (although I never tried).
I just print the resulting PDF's via a specially set up printer filter - if
you're on Windows you might have a problem - but I have some code someone
else on this list recently handed me, that does some printing via
ghostscript. I think I also have a DDE thing involving acrobat reader
somewhere.
···
On Thursday 26 June 2003 03:50 pm, Mico Siahaan wrote:
So let me give more details:
My client ask me to make a simple application to create, preview and print
a barcode.
My idea is simple: I call gnu barcode from my python script to create a
barcode.
Gnu barcode created postscript files, and I don't know how to preview and
print it. So the files I need to print are postscript files.
Thanks. But I will try your suggestion first.
Mico Siahaan
--------------------------
mico@intermatik.co.id
Mobile ph. 08179997828
-------Original Message-------
From: wxPython-users@lists.wxwindows.org
Date: Friday, June 27, 2003 3:31:53 AM
To: wxPython-users@lists.wxwindows.org
Subject: Re: [wxPython-users] How to print files with wxPython?
When printing you essentially need to just draw your data to a DC, just
like you would when drawing it in a window for display on the desktop.
So work on doing that first and then you can easily move it over to the
print framework.
Alternativly if you can transform your data to HTML then you can print
it using the wxHtmlEasyPrinting class.
--
UC
--
Open Source Solutions 4U, LLC 2570 Fleetwood Drive
Phone: +1 650 872 2425 San Bruno, CA 94066
Cell: +1 650 302 2405 United States
Fax: +1 650 872 2417