Using python, wxpython and sqlite in a windows system. I'm trying to print some certificates/diplomas/cards with an image in the background and the name of person/text over it.
I know the basic steps to print the text using win32print from Pywin32 but:
I dont know how to add an image and set it to background.
while ..... ..... # Query sqlite rows and collumn name and set the self.text for each certificate ..... # Now send to printer DC = win32ui.CreateDC() DC.CreatePrinterDC(win32print.GetDefaultPrinter()) DC.SetMapMode(win32con.MM_TWIPS) DC.StartDoc("Certificates Job") DC.StartPage() ux = 1000 uy = -1000 lx = 5500 ly = -55000 DC.DrawText(self.text, (ux, uy, lx, ly),win32con.DT_LEFT) DC.EndPage() DC.EndDoc()
This printer-code is inside a while loop calling each people name from a sqlite database per check condition.
All the names of database was printed at same page. How do I command the printer to spit out 1 page per name from the database?
A simpler approach or module to deal with printers (paper and/or pdf) will be welcome.