Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing on non default printer in Windows.

Status
Not open for further replies.

zbych2002

Programmer
May 6, 2003
4
PL
Hi,

I’m writing a short program in Delphi 6.0 under Windows 2000.
I’ve to print only one page but not on a default printer.

I know only the name of this printer in Windows.

I wrote:

uses ......, printers;
:
:
Printer.PrinterIndex := 1 //Index of printer which isn’t default
Printer.Title := ‘Printer test’
Printer.BeginDoc;
:
:
Printer.Canvas.TextOut(100,100,’Printer test’);
:
:
Printer.EndDoc;

After run program, spool manager changed to new printer, but whole settings for example of page height are from default printer.

Thanks for any help,
 
You have to change all the properties I would guess...

Printer.PageHeight :=
Printer.PageWidth :=

...

andrew
 

I think that it have to be made in another way.

When I use TdialogPrinter everything is OK After run Execute method I change the printer and all properities of new printer are automatycally available.

I want to change printer in code without opening DialogPrinter.

Zbych,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top