09-14-2000, 10:20 PM
Hi there, I need some help with some difficult(for me, may be easy for u) formatting for printing. I have a database of employees with fields like name, age, sex, address, city etc. each record is linked to the photo of that person which is stored in a different directory. Now I have to use this data along with photo to print I-cards such that on each A4 size paper (landscape(lateral)) we are able to print 4 I-cards. please reply as fast as u can. Please see attached file and u will understand better. this is dead urgent. no jokes intended.
Printing from VB is a pain, but here are some things you could try. Everything to be printed has to be exactly positioned using the Printer.CurrentX and Printer.CurrentY properties, setting the Printer.Scalemode property allows you to use your favoured units (mm etc).
Printer.CurrentX and Printer.CurrentY however don't take into account the unprintable margins of the page, use the API call GetDeviceCaps to get these.
To print the Photo I think you will have to firstly load it into a picturebox using the loadPicture method and then print by using the Printer.PaintPicture method with the Picturebox Picture property as its first argument.
Hope this helps,