The SAS Output Delivery System and reporting techniques

Duplex printing with ODS PDF

Reply
Occasional Contributor
Posts: 7

Duplex printing with ODS PDF

I want to generate and print a PDF report from my program without any manual intervention. I am using the following program:
[pre]
options
duplex
sysprint = “\\printserver\printername”
;

filename prt printer;

ods listing close;
ods pdf
file = prt
;

proc report …

ods pdf close;
ods listing;
[/pre]
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?

Paul
SAS Super FREQ
Posts: 8,743

Re: Duplex printing with ODS PDF

Paul:
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:
[pre]
ODS PRINTER PDF FILE=...;
OR
ODS PRINTER PS FILE=...;
OR
ODS PRINTER PRINTER=...;
[/pre]

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:
[pre]
options duplex;
ods printer printer='HP LaserJet 2300 Series PCL 5e';

proc print data=sashelp.shoes(obs=100);
run;

ods printer close;
[/pre]

There are other ways to invoke the ODS PRINTER destination, as described here:
http://support.sas.com/kb/23/414.html

...so, when I used PRINTER=, it overrode whatever I have for the SYSPRINT option. But this note also shows how to use the FILENAME option for different operating systems:
http://support.sas.com/kb/24/185.html
...and these notes describe a bit more about the destination:
http://support.sas.com/kb/23/413.html
http://support.sas.com/kb/4/800.html
http://support.sas.com/kb/3/183.html
http://support.sas.com/kb/15/541.html

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:
[pre]
ERROR: Unable to set printer path per request. This is usually because the requested printer (HP LaserJet2300Series PCL 5e) is unknown.
[/pre]

and the output goes to my default printer -- which might not be a DUPLEX printer.

Hope this helps,

cynthia
N/A
Posts: 0

Re: Duplex printing with ODS PDF

Thank you Cynthia,

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:
[pre]
options
duplex
binding = longedge
sysprint = "\\PPWPRN01\PTCENA114"
;
run;

ods listing close;

ods printer
style = listing
columns = 2
uniform
;

ods pdf
style = listing
columns = 2
uniform
file = " ;

proc report

run;

ods pdf close;
ods printer close;
ods listing;

(I cannot get the closing pre tag to work??)

I am able to toggle between duplex and noduplex and get the expected two and one sided printout.

Thanks again,
Paul
Ask a Question
Discussion stats
  • 2 replies
  • 815 views
  • 0 likes
  • 3 in conversation