BookmarkSubscribeRSS Feed
🔒 This topic is locked. We are no longer accepting replies to this topic. Need further help? Please sign in and ask a new question.
SAS_Tipster
Moderator

A little-known HTML trick is that you can embed images in an HTML file using a Base 64 representation of an image. For example, a folder open image can be generated using the following text in an HTML page:


<img src="data:image/png;base64,R0lGODlhEAAQAKL/AP//////AMDAwMDAwICAgICAAAAAAAAAACH5BAEAAAIALAAAAAAQABAAAANFKEpMpjAKAkYYTkJqu2sbII6kSCzApXbqM1VrPLiUWpYGFwBF7/+51ID3KwaHReNrlwS+iM0CTRTtTavSjWHL7W41YE0CADs=" border="0" width="4">

 

which will display as: OpenFolder.PNG

 

The width parameter can be used to size the image as desired. Note that the image becomes fuzzy if you use a width that is wider than the original image that you encoded.

 

There are a number of web-sites that will convert images to the Base 64 representation. This Google search provides a sampling.

 

To see the above img tag as an actual image and for a discussion of a parameter/macro driven approach see my blog post The getImage macro: embedded images using text strings

 


Thanks to Don Henderson for sharing this tip on sasCommunity.org.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Visit a random SAS tip This SAS Tips board is not open for replies or comments, but we welcome your feedback and questions. Have a question or comment about this tip? Start a new topic in one of our discussion boards, and reference this tip topic.
Discussion stats
  • 0 replies
  • 1109 views
  • 1 like
  • 1 in conversation