I am writing an application that prints
labels which contain both text and a barcode. I understand the basic
process of using wx.Printout, but I have myself thoroughly confused
when it comes to print resolution. The problem, in a nutshell, is to
get the barcode to print at the proper size.
I am generating the barcode as a
bitmap, so it can be scaled as necessary, but it needs to retain its
quality to be readable.
wxPython 2.8 with GTK returns a generic
wxDC which is set to 72 dpi, which is far too coarse for a barcode.
The label printer’s native resolution is 300 dpi. Since text is
scalable, it comes out fine, but my barcode is a bitmap, so it
retains its resolution. My problem is to either change the dpi of the
generic wxDC or find a way to make the bitmap scale during the
printing process.
Help me wrap my head around printing in
wx. I have read and experimented with Robin’s Chapter 17 example and
spent days with Google, but I still don’t understand how to control
the print resolution.
Can’t help on the above, also I am interested in the answer too.
An alternative might be PythonReports or even go directly to
Reportlab.
Werner
···
Hi,
On 23/04/2013 17:00, qbee42 wrote:
Ubuntu 12.04
wx 2.8.12.1
I am writing an application that
prints
labels which contain both text and a barcode. I understand the
basic
process of using wx.Printout, but I have myself thoroughly
confused
when it comes to print resolution. The problem, in a nutshell,
is to
get the barcode to print at the proper size.
I am generating the barcode as a
bitmap, so it can be scaled as necessary, but it needs to retain
its
quality to be readable.
wxPython 2.8 with GTK returns a
generic
wxDC which is set to 72 dpi, which is far too coarse for a
barcode.
The label printer’s native resolution is 300 dpi. Since text is
scalable, it comes out fine, but my barcode is a bitmap, so it
retains its resolution. My problem is to either change the dpi
of the
generic wxDC or find a way to make the bitmap scale during the
printing process.
Help me wrap my head around printing
in
wx. I have read and experimented with Robin’s Chapter 17 example
and
spent days with Google, but I still don’t understand how to
control
the print resolution.
I am writing an application that prints labels which contain both text
and a barcode. I understand the basic process of using wx.Printout, but
I have myself thoroughly confused when it comes to print resolution. The
problem, in a nutshell, is to get the barcode to print at the proper size.
I am generating the barcode as a bitmap, so it can be scaled as
necessary, but it needs to retain its quality to be readable.
wxPython 2.8 with GTK returns a generic wxDC which is set to 72 dpi,
which is far too coarse for a barcode. The label printer's native
resolution is 300 dpi. Since text is scalable, it comes out fine, but my
barcode is a bitmap, so it retains its resolution. My problem is to
either change the dpi of the generic wxDC or find a way to make the
bitmap scale during the printing process.
Help me wrap my head around printing in wx. I have read and experimented
with Robin's Chapter 17 example and spent days with Google, but I still
don't understand how to control the print resolution.
I'm not sure I know anything helpful in this area either... Try asking on wx-users about it.
Just for curiosity's sake have you tried printing some text and one of your barcodes using HtmlEasyPrinting? Does it do the right thing? If so it would be worth digging in to the C++ code to see how that class is drawing the image.