BookmarkSubscribeRSS Feed
AmitKB
Fluorite | Level 6
Hi,
I want my title page to have portrait orientation, but I want landscape orientation for the next page.

Thanks for the help in advance,

Amit
10 REPLIES 10
Bill
Quartz | Level 8
Amit;

Changing the options orientation= from portrait to landscape midstream does not work. You might be able to set up two ODS templates where one is "sized" to look like it's landscape and then use it for the first page while reverting back to another template for the portrait pages. I don't know if the ODS templates can be manipulated to do that. Something for you to explore. Please be sure to post your findings.

Something like:

options orientation=portrait;

ods pdf file='c:\temp\test.pdf' style=statistical;
*where the statistical template is a landscape template;

proc print data=sashelp.class;
run;

*options orientation=landscape;*this does not work;

ods pdf style=brick;

proc print data=sashelp.class;
run;

ods pdf close;

Bill
Cynthia_sas
SAS Super FREQ
Hi:
Only the RTF destination allows you to switch orientations in mid-stream. ODS PDF does not allow that.

There is nothing in the style template that would fool PDF into creating one page that was portrait and the next page/report that was landscape. So although you had a good idea, it is not really going to work the way you envisioned.

To switch orientations in midstream with ODS RTF, you have to do this:
[pre]
options orientation=portrait;

ods rtf file='twoway.rtf';

** first procedure;

options orientation=landscape;
ods rtf;

** second procedure;

ods rtf close;
[/pre]

Note that after you switch orientations, you must get ODS RTF to "refresh" the options by issuing an ODS RTF; statement without any other options on the statement. However, this technique does NOT work for ODS PDF.

cynthia
FrankE
Fluorite | Level 6
Hi Cynthia, I was also interesting in doing this in PDF. Are there any plans to add this in a future release?
Cynthia_sas
SAS Super FREQ
Hi, Frank:
I have no idea whether this is even possible. PDF files are in a proprietary form and my understanding of how ODS PDF works (conceptually) is that your output is formatted in some buffer area as though it was going to a physical printer and then that internal copy of the printer version of the file is sent to PDF proprietary format. So I don't know whether the Adobe proprietary format that ODS creates has that capability to switch orientations in midstream. My assumption is that if it were possible, the developers would have implemented the capability for PDF at the same time, or shortly after, they implemented it for RTF.

If you send a mail to ods@sas.com, you could ask the ODS developers whether it's a possibility or not.

cynthia
FrankE
Fluorite | Level 6
Excellent, thanks so much for your response. The only other thing I can think of is creating seperate PDF's, change the system orientation option in between, then somehow merging the two documents.. but I don't see that merge happening in SAS... Message was edited by: FrankE
Cynthia_sas
SAS Super FREQ
You're right, I expect you'd use some Adobe product or 3rd party PDF maker in order to put 2 separate PDF files together. It is a long-standing fact that you can ONLY append outputs using ODS HTML -- you can't append to ODS RTF or ODS PDF files using SAS. That's because the RTF spec and the PDF spec both have VERY rigid rules for what type of file/begin and file/end code is allowed in the output file.

cynthia
ScottH_SAS
SAS Employee
Good news!!! I have the orientation switch working in ODS PDF and it will be available in the next major release of SAS!!!
Andre
Obsidian | Level 7
Scott,

Does this means 9.3? next year?

Andre
FrankE
Fluorite | Level 6
great news! I'm also curious on the time frame for this release...
ScottH_SAS
SAS Employee
We are currently shooting for availability right around SAS Global Forum

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 10 replies
  • 4037 views
  • 1 like
  • 6 in conversation