BookmarkSubscribeRSS Feed
JeffMeyers
Barite | Level 11

Hello, I'm trying to make a report in ODS PDF with a lot of images where I want to set the PAPERSIZE to best fit the image.  I've done this before in ODS EXCEL, but can't seem to make it work in ODS PDF.  I get stuck when trying to do an ODS LAYOUT in the new PAPERSIZE and it won't work because the height is taller than the first page's PAGESIZE.  Here's what I'm trying:

 

title;
option papersize = (14in 13in) orientation=landscape leftmargin=0.1in rightmargin=0.1in;
ods pdf file='early_onset_figures.pdf' notoc bookmarkgen=no;
**First graph code here;

option papersize = (9in 14in);
ods pdf;
title 'Figure 3';
ods layout start  rows=2 width=7in height=13in;
ods region;
**plot stuff here;
ods region;
**more plot stuff here;
ods layout close;
ods pdf close;

I tried changing the PAPERSIZE option prior to doing another ODS PDF statement and again without the ODS PDF statement with the same results.  I get a warning when I try to do the ODS LAYOUT statement that "WARNING: HEIGHT exceeds available space for PDF destination. This option will be ignored."  If I have the second PAPERSIZE option and I try changing the height to be anything and still get this warning for some reason.  If I set my PAPERSIZE to the second figure and don't try to change it I don't get this warning. Is this possible to change or does the PAPERSIZE when ODS PDF starts set for the rest of the document?

1 REPLY 1
Norman21
Lapis Lazuli | Level 10

I think the option statement can only be used while ods pdf is closed.

 

Using the following code on SAS EG produces two PDF documents which can then be combined:

title;
option papersize = (14in 13in) orientation=landscape leftmargin=0.1in rightmargin=0.1in;
ods pdf file="C:\My SAS\_examples_/early_onset_figures.pdf" notoc bookmarkgen=no;
**First graph code here;
title 'Figure 1';
ods layout start  rows=2 width=7in height=12in;
ods region;
**plot stuff here;
ods region;
**more plot stuff here;
ods layout end ;
ods pdf close;

option papersize = (9in 14in);
ods pdf file="C:\My SAS\_examples_/early_onset_fig2.pdf";
title 'Figure 2';
ods layout start  rows=2 width=7in height=13in;
ods region;
**plot stuff here;
ods region;
**more plot stuff here;
ods layout end ;
ods pdf close;

By the way, the layout wrapper is "start" and "end" (not "close").

Norman.
SAS 9.4 (TS1M6) X64_10PRO WIN 10.0.17763 Workstation

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 629 views
  • 0 likes
  • 2 in conversation