Highlighted
Absent Member.
Absent Member.
504 views

Printer Tunables

I have my printer_redirection value = true in my app.config file under Tunables.  Is there an option that I can set in this same place that will open up the windows printer dialog.  Right now, my file is going straight to the printer without allowing me to change options such as printing landscape or whatever is available for my printer dialog.

0 Likes
5 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Printer Tunables

If you use PC_PRINTER_REDIRECTION_PROC you can set an entry point that will be called when the printer is opened. That will allow you to change printing options, though I don't think that there is an option to display the print dialog.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Printer Tunables

You can display a print dialog to select the printer name and set its properties by using PC_PRINTER_SET_DEFAULT but you have to do this prior to the OPEN on your printer. By using default-option=2 it will display a printer browse dialog and allow you to select a printer and set its properties. You can then use default-option=1 and call PC_PRINTER_SET_DEFAULT again and the selected printer will be the new default.

Then when you open your printer using the OPEN statement it should open the selected printer using the options that you selected.

An alternative is to print your file to disk first using a name and then use PC_PRINT_FILE to send it to the printer as PC_PRINT_FILE also allows you to use a print dialog.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Printer Tunables

Can this be set in the app.config file under tunables..
<add key="printer_defaults" value="2" /> or some other way?
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Printer Tunables

I just tested my last suggestion and although the changed properties are used in the printing when run under native code, they do not appear to be in effect when run under managed code when using PC_PRINTER_SET_DEFAULT. The selected printer is used but the changed properties are being ignored.

PC_PRINT_FILE should still work for both though.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Printer Tunables

Is there a good example somewhere on using printer properties and the call statements associated with them?
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.