How To Fetch Printer Properties from the Selected Printer

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

How To Fetch Printer Properties from the Selected Printer

Post by swapan »

Dear All,

In my print routine I want to use the following command:

lSuccess:=.t.
SELECT PRINTER DIALOG TO lSuccess PREVIEW

The command is working perfectly - opening the Printer Dialog box. Where I can change the default settings of the printer and go for printing.

Now I want to detect in my routine what properties the user selected. Like Paper Orientation (landscape/Potrait), PaperSize. How to accomplish this?

If I can get these values, I'm sure we can RE-SET this values also. Any internal global constants being used or what's the way to obtain this?

With regards,

Swapan
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
salamandra
Posts: 311
Joined: Thu Jul 31, 2008 8:33 pm
DBs Used: DBF, MySQL, SQL
Location: Brazil

Re: How To Fetch Printer Properties from the Selected Printer

Post by salamandra »

;) Hi swapan,
swapan wrote:Dear All,

In my print routine I want to use the following command:

lSuccess:=.t.
SELECT PRINTER DIALOG TO lSuccess PREVIEW

The command is working perfectly - opening the Printer Dialog box. Where I can change the default settings of the printer and go for printing.

Now I want to detect in my routine what properties the user selected. Like Paper Orientation (landscape/Potrait), PaperSize. How to accomplish this?

If I can get these values, I'm sure we can RE-SET this values also. Any internal global constants being used or what's the way to obtain this?

With regards,

Swapan
Do you really need to fetch ALL PRINTER PROPERTIES ???
HMG has a lot of features....
Why don't you write your own Printer Manager ???

Take a look at the attached sample, may be what you need...



Best regards.

[]'s Salamandra
Attachments
swapan.rar
(533.17 KiB) Downloaded 450 times
There is one time in which is crucial awakening. That time is now. ( Buddha )
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: How To Fetch Printer Properties from the Selected Printer

Post by sudip »

Hi Salamandra,

Thanks a lot! Excellent! :-)

Regards.

Sudip
With best regards,
Sudip
User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: How To Fetch Printer Properties from the Selected Printer

Post by swapan »

salamandra wrote:;) Hi swapan,

Do you really need to fetch ALL PRINTER PROPERTIES ???
HMG has a lot of features....
Why don't you write your own Printer Manager ???

Take a look at the attached sample, may be what you need...



Best regards.

[]'s Salamandra
That's simply great Salamandra! Thanks a lot for such a clean, concise and simple project to give an idea of how to build one's own Print Manager. This is going to help me and many others like me who intend to build a Print Manager to have a full command.

But I'm still looking for any solution like API call, low-level windows commands to fetch atleast the basic printer properties with the help of windows.

Regards,

Swapan
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: How To Fetch Printer Properties from the Selected Printer

Post by swapan »

Can anything be derived with the help of _HMG_SYSDATA?
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
salamandra
Posts: 311
Joined: Thu Jul 31, 2008 8:33 pm
DBs Used: DBF, MySQL, SQL
Location: Brazil

Re: How To Fetch Printer Properties from the Selected Printer

Post by salamandra »

:) Hi Sudip & Swapan,

Thanks for your nice words.
This is a really very single sample based on my own print manager.
The basic idea behind it, it is : Give to users not all that they want,
but all that what they really need
.
As I use only a half dozen of paper sizes, and both Portrait and Landscape
orientation for reports, so it is easier to control and predefine user options.

Regarding Windows API and low-level windows functions, please take a look at
http://www.codeproject.com/KB/system/Pr ... indow.aspx

May be this article help you, because shows the method how to show a popup
window for printer properties.

Best Regards,


[]'s Salamandra
There is one time in which is crucial awakening. That time is now. ( Buddha )
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: How To Fetch Printer Properties from the Selected Printer

Post by sudip »

Hi Salamandra,
salamandra wrote::) Hi Sudip & Swapan,
...
...
The basic idea behind it, it is : Give to users not all that they want,
but all that what they really need
.
Thank you very much.

I agree with you 100% :D

I went thru the url you specified. Very good :)

I like YOUR code and saved it in my computer :)

Regards.

Sudip
With best regards,
Sudip
User avatar
Vanguarda
Posts: 543
Joined: Wed Feb 11, 2009 10:56 am
Location: Americana - SP
Contact:

Re: How To Fetch Printer Properties from the Selected Printer

Post by Vanguarda »

Hi my frieds,

Salamandra,
thank you for this code... it will very usefull for me. And, once again, thank you for have posted URL link for API WIN. Great Post




best Regards,
--
Paulo Sérgio Durço (Vanguarda)


http://hmglights.wordpress.com/
User avatar
salamandra
Posts: 311
Joined: Thu Jul 31, 2008 8:33 pm
DBs Used: DBF, MySQL, SQL
Location: Brazil

Re: How To Fetch Printer Properties from the Selected Printer

Post by salamandra »

:) Hi,

Thanks to all for your nice words and I am feeling very honored that you want
to keep my single code :oops:
I am searching for some additional information, and may be in a few days I'll get
post here a complete (or almost complete) set of commands to retrieve, restore and
define printers properties. ;)

[]'s Salamandra
There is one time in which is crucial awakening. That time is now. ( Buddha )
User avatar
Vanguarda
Posts: 543
Joined: Wed Feb 11, 2009 10:56 am
Location: Americana - SP
Contact:

Re: How To Fetch Printer Properties from the Selected Printer

Post by Vanguarda »

Hi salamandra,

It will be very nice. Great idea.

PS: Your code is "simple", but is very useful... I like it very much.


Regards,
--
Paulo Sérgio Durço (Vanguarda)


http://hmglights.wordpress.com/
Post Reply