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-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

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
  • 1644 views
  • 1 like
  • 1 in conversation