General printable bitmap and / or vector images

I am looking for some API for printing. In the meantime, there is no need to know about it. ”

Basically I want to print a set of pixels (a monochrome bitmap that I kept in memory) into a common paper size (A4, A5..c).

I think this is the minimal API:

  • printer device list
  • a printer buffer where I could send my memory stick in memory (e.g. to winXP printer task folder)
  • some API that converts SI sizes to printer resolution or according to the previous memory pattern (eg 450x250) on paper at the appropriate resolution.

What I was looking at is postScript, but I have some old LPT laser that probably doesn't support * PS.

I am currently trying to find something interesting in Qt - QGraphicsView.

http://doc.trolltech.com/4.2/qgraphicsview.html

+2


source to share


3 answers


Good thing you're close, have a look at Printing in Qt . There is a QPrinter class that implements some of what you are looking for. It matters QPaintDevice

. This means that any widget that can be displayed on the screen can be printed. This also means you don't need to display the bitmap for printing, you can use Qt widgets or paint functions to print



Note the version number of the Qt documentation, the latest version of Qt is 4.5, 4.6 is in beta.

0


source


You may want to look into wx python for printing . Studying the structure can be a little overhead for you, though! I have had success in the past on both windows and linux.



I've also used reportlab to generate PDFs that print fairly easily with minimal OS interaction.

0


source


I would use PIL to create a BMP file and then just use standard OS services to print that file. PIL will accept data in raster or vector form.

0


source







All Articles