Printer setup

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

Printer setup

Postby simonlec » Mon Dec 01, 2008 10:53 pm

I every. Is it possible to set the «page per sheet» for a printer device with vpe?
My Printer is HP Color LaserJet 2600n.
Thank! :)
simonlec
 
Posts: 32
Joined: Wed Jul 30, 2008 6:50 pm

Postby IDEAL Software Support » Tue Dec 02, 2008 9:23 am

Please explain in more detail, what you do mean by "page per sheet".
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

Postby simonlec » Tue Dec 02, 2008 2:30 pm

In the printer dialog, there is the preference button. When I click it, I have a new window with many printing option. In the option «Finishing», i can choose how many pages fit in one sheet printed by the printer device. Is it possible to set this option with Vpe4?
Thank a lot
simonlec
 
Posts: 32
Joined: Wed Jul 30, 2008 6:50 pm

Postby IDEAL Software Support » Tue Dec 02, 2008 5:21 pm

Such printer specific options are not routed through the Windows API, therefore VPE can neither provide direct access to them.

But by using the method SetupPrinter() and storing the result into a PRS (Printer Setup) file, VPE is capable of copying the private data (and therefore the private options) of the printer driver permanently to file.

So, do the following:
Call VPE.SetupPrinter("personal settings.prs", PRINTDLG_ONFAIL) once. The printer setup dialog will be presented to you and you can make your settings. After pressing ok in the dialog, the settings will be permanently stored to the file "personal settings.prs".

Afterwards, each time after calling OpenDoc(), call VPE.SetupPrinter("personal settings.prs", PRINTDLG_ONFAIL) again.

Since the file "personal settings.prs" already exists, VPE will silently load the settings and no printer-setup dialog will be shown.

This way you can make use of any printer specific options.

If you wish to provide your users the capability to change the options later at any point in time, just make a special menu entry in your application's menu and call VPE.SetupPrinter("personal settings.prs", PRINTDLG_ALWAYS), which will force VPE to display the printer setup dialog always and to write the settings each time to file.

Hope, this helped.
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

Postby simonlec » Tue Dec 02, 2008 6:06 pm

Thank a lot, I try your code and the VPE.SetupPrinter("personal settings.prs", PRINTDLG_ONFAIL) return the error number 3. My printer in on the network. Could it be a problem?
simonlec
 
Posts: 32
Joined: Wed Jul 30, 2008 6:50 pm

Postby IDEAL Software Support » Wed Dec 03, 2008 11:01 am

This can only be a problem, if the printer is not available or not connected. Please check the settings of your default printer and if this printer is accessible.
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 15 guests

cron