DATA Step, Macro, Functions and more

resize external image in ods layout

Reply
N/A
Posts: 1

resize external image in ods layout

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

N/A
Posts: 1

Re: resize external image in ods layout

Posted in reply to renatasas

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

Ask a Question
Discussion stats
  • 1 reply
  • 382 views
  • 0 likes
  • 2 in conversation