BookmarkSubscribeRSS Feed
renatasas
Calcite | Level 5

Dear SAS community,

Is there a way to automate re-sizing of images using ods layout?

Image urls are stored in a variable image_url in a sas data set, and contain links to images on the web. I am reading in image_url the following way: obj.image(file: strip(image_url),  and would like the image to be scaled down.

Here is the code:

data _null_; 

set r end=eof; 

if _n_=1 then

do;

   dcl odsout obj(); 

   obj.layout_gridded(columns: 2 ,

                      overrides: "just=left");

end;

obj.region(width: "2in", height:"1in");

obj.format_text(data: '^{style [color=dagr fontsize=4  just=right]Available on} '||

'^{style [color=cx1b3564  fontsize=4 textdecoration=underline font_weight=bold just=right url="www.site.com"]Site Name}', 

          overrides: "just=left width=100pct background=white fontsize=5 color=dagr "); 

obj.image(file: strip(image_url), 

          overrides: "just=left ");

if eof ne 1 then 

   obj.format_text(data: " ");

else 

   obj.layout_end();

run;

Regards,

renatasas

1 REPLY 1
blackimage
Calcite | Level 5

auto- image reszing and image scaling with c# is quite familiar to me, dos layout is not, thank for sharing.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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