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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1 reply
  • 1063 views
  • 0 likes
  • 2 in conversation