Board index » delphi » choosing printer in app and printing labels

choosing printer in app and printing labels


2003-10-07 08:36:51 PM
delphi36
Hi there,
I am using the printers class to print labels. With printers.enddoc the
labels are always printed on the standard printer. Is there a possibility to
choose internally from the list of available printers? Maybe by their name??
I need to print out a random number of labels. These labels should be
printed on endless paper where in each row you have four labels. Till now I
am printing two lines on each label by telling the dots for each textline,
which is - I know - stupid. Is there a way to do that in a loop or
something?
Thanks,
Pascal
 
 

Re:choosing printer in app and printing labels

Quote
I am using the printers class to print labels. With printers.enddoc
the labels are always printed on the standard printer. Is there a
possibility to choose internally from the list of available printers?
Maybe by their name??
You could show the default printer-setup dialog. If the user accepts,
the globale printer variable is set to the selected printer (with the
selected options).
I'd look in the source of the Printer-Setup dialog to get the
information you want.
Quote
I need to print out a random number of labels. These labels should be
printed on endless paper where in each row you have four labels. Till
now I am printing two lines on each label by telling the dots for
each textline, which is - I know - stupid. Is there a way to do that
in a loop or something?
You could obtain the information of the size of one page in dots from
the printer. The information on the size's is provided with the labels.
With all this information you could calculate the necessary
distances/offsets and sizes and print them in a loop.
The height of textlines could also be obtained by the printers canvas.