Several programs can capture the "look" of a website (in HTML) and save them as a static bitmap picture or PDF document. Used mainly for archiving purposes to save the information from some websites.
If you are looking for a programming way how to do this with some HTML script code, you have to check some dedicated programming websites like StackOverflow.