How To Fetch Printer Properties from the Selected Printer
Moderator: Rathinagiri
How To Fetch Printer Properties from the Selected Printer
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
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
- 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

Do you really need to fetch ALL PRINTER PROPERTIES ???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
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 )
Re: How To Fetch Printer Properties from the Selected Printer
Hi Salamandra,
Thanks a lot! Excellent!
Regards.
Sudip
Thanks a lot! Excellent!

Regards.
Sudip
With best regards,
Sudip
Sudip
Re: How To Fetch Printer Properties from the Selected Printer
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.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
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
Re: How To Fetch Printer Properties from the Selected Printer
Can anything be derived with the help of _HMG_SYSDATA?
- 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

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 )
Re: How To Fetch Printer Properties from the Selected Printer
Hi Salamandra,
I agree with you 100%
I went thru the url you specified. Very good
I like YOUR code and saved it in my computer
Regards.
Sudip
Thank you very much.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.
I agree with you 100%

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
Sudip
Re: How To Fetch Printer Properties from the Selected Printer
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,
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,
- 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

Thanks to all for your nice words and I am feeling very honored that you want
to keep my single code

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 )
Re: How To Fetch Printer Properties from the Selected Printer
Hi salamandra,
It will be very nice. Great idea.
PS: Your code is "simple", but is very useful... I like it very much.
Regards,
It will be very nice. Great idea.
PS: Your code is "simple", but is very useful... I like it very much.
Regards,