The SAS Output Delivery System and reporting techniques

changing margins in pdf output

Accepted Solution Solved
Reply
Super Contributor
Posts: 266
Accepted Solution

changing margins in pdf output

I want to change the left and right margins in the pdf files I am outputting.  Actually, the real problem is that each obs requires more than one line, so I thought I would start with the orientation and margin width.  I would welcome suggestions for any other options that would allow me to output one record per line.

partial code:

%macro elemREP (num=);

ods pdf body="G:\Departments\Research\Misc\EVAAS\1415\School Rosters\&num._Verify_Roster_EVAAS.pdf";

options orientation=landscape nodate pageno=1 leftmargin=.1 rightmargin=.1;

proc print data=joinelem4 noobs


Accepted Solutions
Solution
‎04-24-2015 12:41 PM
SAS Super FREQ
Posts: 8,740

Re: changing margins in pdf output

HI:

  I have a few suggestions. One is to flip your statements and list the margin options BEFORE the ODS PDF statement. This will ensure that ODS will get the NEW options when it starts up. The other option is to specify an exact unit of measure with ODS PDF -- otherwise, you are forcing PDF to translate from the default unit of measure.

options orientation=landscape nodate pageno=1 leftmargin=.1 rightmargin=.1;

ods pdf body="G:\Departments\Research\Misc\EVAAS\1415\School Rosters\&num._Verify_Roster_EVAAS.pdf";

  For example, consider the difference in output length and width for just 30 obs in SASHELP.CARS.

cynthia

options orientation=landscape nodate pageno=1 leftmargin=.25in rightmargin=.25in;

ods pdf file='c:\temp\carss.pdf';

proc report data=sashelp.cars(obs=30) nowd;

title '1) take all defaults';

run;

proc report data=sashelp.cars(obs=30) nowd

  style(report)={cellpadding=2px font_size=8pt}

  style(header)={font_size=9pt}

  style(column)={font_size=8pt};

title '2) change some style options';

run;

ods pdf close;

View solution in original post


All Replies
Super User
Posts: 17,750

Re: changing margins in pdf output

I think you'll need to post some sample data for more help.

Other methods include modifying the template to reduce cell size and padding.

Here's a link to a common style I've used (borrowed from a former colleague). You can modify the cell spacing, padding and font size as needed.

Hope it's helpful.

SAS - RTF Style for tables

Solution
‎04-24-2015 12:41 PM
SAS Super FREQ
Posts: 8,740

Re: changing margins in pdf output

HI:

  I have a few suggestions. One is to flip your statements and list the margin options BEFORE the ODS PDF statement. This will ensure that ODS will get the NEW options when it starts up. The other option is to specify an exact unit of measure with ODS PDF -- otherwise, you are forcing PDF to translate from the default unit of measure.

options orientation=landscape nodate pageno=1 leftmargin=.1 rightmargin=.1;

ods pdf body="G:\Departments\Research\Misc\EVAAS\1415\School Rosters\&num._Verify_Roster_EVAAS.pdf";

  For example, consider the difference in output length and width for just 30 obs in SASHELP.CARS.

cynthia

options orientation=landscape nodate pageno=1 leftmargin=.25in rightmargin=.25in;

ods pdf file='c:\temp\carss.pdf';

proc report data=sashelp.cars(obs=30) nowd;

title '1) take all defaults';

run;

proc report data=sashelp.cars(obs=30) nowd

  style(report)={cellpadding=2px font_size=8pt}

  style(header)={font_size=9pt}

  style(column)={font_size=8pt};

title '2) change some style options';

run;

ods pdf close;

Super Contributor
Posts: 266

Re: changing margins in pdf output

Thanks for your help.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 2056 views
  • 0 likes
  • 3 in conversation