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.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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