I want to generate and print a PDF report from my program without any manual intervention. I am using the following program:
sysprint = “\\printserver\printername”
filename prt printer;
ods listing close;
file = prt
proc report …
ods pdf close;
The duplex option seems to be ignored and the report is printed single sided.
I reported this to Tech Support and was told that duplex does not work with ODS PDF but it is not documented. This seems to be at odds with Usage Note 23416 where duplex is listed as an option that affects ODS printer destinations.
Could you please verify that the duplex option will not work with ODS PDF? Is there a work-around to use to get duplex output?
ODS PRINTER destination is a different destination than ODS PDF. Does DUPLEX work if you change the ODS PDF to ODS PRINTER????
The way I read note 23416 is that it says: The following SAS system options affect ODS PRINTER code.
It does not say ODS PRINTER family code -- ODS PDF is a Printer FAMILY destination, but the way I read the note, I would expect DUPLEX to work ONLY with ODS PRINTER....not ODS PDF. It was my understanding that the ODS PRINTER destination was the one that "spoke" to a specific printer. See the documentation on the use of the ODS PRINTER statement: http://support.sas.com/documentation/cdl/en/odsug/61723/HTML/default/a002217095.htm
(If you remember, back in the "old" days of SAS 8.0, there was no way to "directly" use ODS PDF -- originally, you had to create a PS file and then manually distill to PDF form. Then, you were eventually able to do this:
ODS PRINTER PDF FILE=...;
ODS PRINTER PS FILE=...;
ODS PRINTER PRINTER=...;
and, finally, we got the ODS PDF destination directly.
So much for the walk down memory lane... When I use this code, I do get DUPLEX output on my duplex printer:
ods printer printer='HP LaserJet 2300 Series PCL 5e';
So, I think that trying your code with ODS PRINTER instead of ODS PDF should get you the duplex print. I have found the printer name to be quite finicky -- for example, if I had the name of the printer spelled wrong or didn't have spaces in the right place, I might see this error message:
ERROR: Unable to set printer path per request. This is usually because the requested printer (HP LaserJet2300Series PCL 5e) is unknown.
and the output goes to my default printer -- which might not be a DUPLEX printer.
I see now that a lot of my problems were caused my confusing the printer destination with the printer family terminology. Having both ODS PRINTER and ODS PDF available is really quite helpful since I can use PRINTER to print the report and PDF to write an archive copy.
I tried your small sample program and got it to work except that I could not get the printer= option to work. I am able to use the sysprint system option to point to my printer.
Here is a paraphrase of the program that works:
binding = longedge
sysprint = "\\PPWPRN01\PTCENA114"