Select printer before printing image with TgdViewer

Discussions about document viewing.
Post Reply
wallas
Posts: 10
Joined: Thu Jun 21, 2007 11:55 am

Select printer before printing image with TgdViewer

Post by wallas » Thu Jun 21, 2007 12:07 pm

Hi,

I'm not sure if this is a waisted a question...

I'm trying to print an image, but before i do that, i want to select a printer different to my default one by using a TPrintDialog. Because the TgdViewer uses my default printer.

Is it possible to do this with TgdViewer and if it isnt, is there a work around?

Thanking you in advance!

Jo

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Post by Loïc » Thu Jun 21, 2007 7:05 pm

Hi,

First, you can enumerate all your printers like that:

Code: Select all

For nCpt = 1 to oGdPicture.PrintGetPrintersCount()
    MsgBox oGdPicture.PrintGetPrinterName(nCpt)
Next nCpt

Second, you can select one of the enumerated printer like that :

Code: Select all

oGdPicture.PrintSetActivePrinter(2)
This line set as active printer the second listed printer into the For .. next statement.


Best regards,

Loïc Carrère

wallas
Posts: 10
Joined: Thu Jun 21, 2007 11:55 am

Thanks for the answer!

Post by wallas » Tue Jun 26, 2007 1:56 pm

Its exactly what i needed!

Also, thanks for a great product!

Regards,

Johann

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Post by Loïc » Tue Jun 26, 2007 2:58 pm

Thank you for your feedback Wallas :D


Regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests