Martha Morrigan wrote:
>
> Using python, wxpython and sqlite in a windows system, Im trying to
> print some certificates/diplomas/cards with a image at background with
> the name of person/text over it.
>
> I know the basic steps to print the text using win32print from Pywin32
> but...:
>
> 1) I dont know how to add an image and set it to background.

There's really no concept of foreground and background in a printed
page.  The stuff you print last goes over the top of the stuff you print
first.  So, after you do StartDoc, you'd need to draw your image with
DC.BitBlt.  That's skipping over the details of how you get a bitmap
object from an image file...


> This printer-code is inside a while loop calling each people name from
> a sqlite database per check condition.
> 2) All the names of database was printed at same page... how i command
> the printer to spit out 1 page per name from the database?

If you really had that code inside a loop, you should see one print job
per person, with one page per job.  I assume you'd rather have one print
job (one "document") with multiple pages.  You ought to be able to
figure that out.  Everything up through StartDoc is creating the
"document", and should be done once.  Everything between StartPage and
EndPage is creating a page.  You'd want that inside your loop.


> 3) Any more simple approach or module to deals with printers (paper
> and/or pdf) will be welcome.

Printing is surprisingly hard, especially when working directly with the
Win32 API as you are.  I use the ReportLab package for creating PDFs,
but it seems like your task is simple enough that you ought to be able
to make this work.

-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to