The SAS Output Delivery System and reporting techniques

ods text preimage height width

Reply
Regular Contributor
Posts: 196

ods text preimage height width

Is there a way to change the height and width of apple.png (eg height=170 width=170)?

ods text = '' < a href = '' '' www. sas . com '' '' target=_blank >
~ S = {preimage = ''''
C:/apple.png''''} '';
SAS Super FREQ
Posts: 8,743

Re: ods text preimage height width

Hi:
In my experience, it's always better to have your image file (in this case, apple.png) sized close to what you want it to be. When you use ODS TEXT= with ODS HTML, for example, if you have THIS ODS TEXT= option:
[pre]
ods text="~S={preimage='kermit.jpg'} Kermit The Frog";
[/pre]

Then, the generated HTML is this:
[pre]
<div class="l UserText"><img alt="" src="kermit.jpg"><span> Kermit The Frog</span></div>
[/pre]

As you can see, the PREIMAGE attribute only is used for the IMG tag's SRC= attribute -- there is no HEIGHT= or WIDTH= style attribute available to be changed. The reason why can be found in the W3C spec for the IMG tag.

The recommendation from the W3C http://www.w3schools.com/tags/att_img_width.asp is that:

quote
Tip: Do not rescale images with the height and width attributes! Downsizing a large image with the height and width attributes forces a user to download the large image (even if it looks small on the page). The correct method is to rescale the image with a program, before using it on a page.
endquote


cynthia
Regular Contributor
Posts: 196

Re: ods text preimage height width

OK.
Thank you.
Ask a Question
Discussion stats
  • 2 replies
  • 562 views
  • 0 likes
  • 2 in conversation