Date: Thu, 28 Sep 2000 23:11:26 -0500
Reply-To: Rob Rohrbough <Rob@ROHRBOUGH-SYSTEMS.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Rob Rohrbough <Rob@ROHRBOUGH-SYSTEMS.COM>
Subject: Re: Acrobat PDFWriter Question
Content-Type: text/plain; charset="iso-8859-1"
Rush,
Here is a macro (which runs in both V6 and V8) I developed based on
information that Bill Droogendyk posted on this issue:
%macro setPDF(pPrinter, pFile);
%if &pPrinter= %then %do;
proc printto; %* end PDF file redirection;
run;
filename pdf;
%end; %else %do;
%if %substr(&sysver,1,1) >= 7 %then %do;
options sysprint="&pPrinter" "&pFile";
%end; %else %do;
options sysprint="&pFile" "&pPrinter";;
%end; %* if V8;
filename pdf printer;
proc printto print=pdf;
run;
%end;
%mend setPDF;
With your code the call would be:
%setPDF(Acrobat PDFWriter, c:\sas_cimco\adobetest.pdf);
> data _null_;
/* WITHOUT THIS ====> file pdf print notitles; ****/
/* NOT SURE HOW TO HANDLE THE NOTITTLES */
> array red{30} $ red1-red30;
> do j=1 to 30;
> do i=1 to 30;
> red{i}=i;
> end;
> put @1 red1 @7 red2 @13 red3 @19 red4 @25 red5 @31 red6 @37 red7;
> end;
> run;
%setPDF;
Notice that there is a PROC PRINTTO preceding any use of a procedure or
datastep. Without the macro your code would work with these changes:
> options sysprint='c:\sas_cimco\adobetest.pdf' 'Acrobat PDFWriter';
> filename pdf printer;
PROC PRINTTO PRINTER=PDF;
> data _null_;
/* WITHOUT THIS ====> file pdf print notitles; ****/
/* NOT SURE HOW TO HANDLE THE NOTITTLES */
> array red{30} $ red1-red30;
> do j=1 to 30;
> do i=1 to 30;
> red{i}=i;
> end;
> put @1 red1 @7 red2 @13 red3 @19 red4 @25 red5 @31 red6 @37 red7;
> end;
> run;
PROC PRINTTO; RUN;
Not sure about printing directly to the PDF fileref or about Bill's most
recent post. But you might give it a try. (BTW, thanks again, Bill, for the
tips.)
HTH,
Rob
> -----Original Message-----
> From: Rush Daugette [mailto:rush_d@TECASSOCIATES.COM]
> Sent: Thursday, September 28, 2000 10:47 AM
> Subject: Acrobat PDFWriter Question
>
>
> Thank you for the recent discussion on using this Acrobat printer
> to create
> PDF output. My one problem is that I haven't been able to get rid of the
> dialogue box that pops up for the file name. Someone was able to
> get rid of
> this but I haven't been able to. I'm trying to use the following data
> _null_ approach rather that proc printto. Thanks for any insight.
>
> options sysprint='c:\sas_cimco\adobetest.pdf' 'Acrobat PDFWriter';
> filename pdf printer;
> data _null_;
> file pdf print notitles;
> array red{30} $ red1-red30;
> do j=1 to 30;
> do i=1 to 30;
> red{i}=i;
> end;
> put @1 red1 @7 red2 @13 red3 @19 red4 @25 red5 @31 red6 @37 red7;
> end;
> run;
>
> Rush Daugette
> TEC Associates
> Indianapolis, IN
>