A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

Web Development

Printing a web page

Good post? Please, share it...
Pin It

A client has asked for a button/icon within each page, that will allow a screen-shot of the page, to be printed by the site visitor.

I have thought and thought about him wanting to give the visitors the capability of getting a printout of a web page, as if it were a screen-shot. I wondered why I couldn’t find any useful information on the subject, in spite of a lot of research.

Then it came to me that the request, itself, is 1) technically non-feasible 2) not really useful to the visitors. That’s why no-one has considered the possibility.

Let me explain:

A website consists of a ‘design’ and ‘content’, each of which (in the modern web world) is not essential to the other.

A design, with its layout, style etc. – i.e. template – can be used with any content.

Similarly,  site ‘content’ can appear in any template, so styled differently. To understand this best you could visit CSS Zen Garden. There, they show the same content, but using different styles for each menu option. Click around to see what it does. Amazingly beautiful web-sites designs, but all with the same content.

Now, the site, itself, has no idea how it will appear in the browser. In fact, since CMS sites are dynamic, by definition, and the browser could be any software that reads HTML, on any platform, with any settings, all the site knows about is ‘content’ of the pages and the instructions sent for display purposes (the template).

The browser may interpret these instructions in various ways, but are only intended for display in a browser. A printer cannot interpret HTML, CSS or use javascript. I have had a considerable job just to get the site to display roughly equally, in all 5 of the major browsers.

In any case, all the visitor usually needs of a web-site is the content – maybe formatted in a pretty way, for a printer. Therefore, Joomla! templates have a printer-friendly version built in  to them, that renders the content for a printer, not a browser. N.B. This can also be manually re-programmed for special purposes, but doesn’t normally (& shouldn’t) include the web template elements.

If a screenshot is really needed, then the user must do this, themselves, in their browser, using a plug-in (or an external program). Then, the browser does its normal job of rendering the site, according to the instructions from the webserver (template) and grabs the view, as an image to send to the printer.

This is not the same as printing the content, which is text that, may be accompanied by those images, referenced within the content.

I checked into the possibility of turning the site into a pdf file, so that that may printed out. Even though Joomla! itself has stopped giving this as an option, it is still available through some 3rd-party plug-ins. However, when they make a pdf, they also have no concern for the web appearance. They only take the content and format it in a pretty pdf way.

So, ultimately, this is not feasible or even useful and you will find no web-site that gives this ability.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>




This site uses Akismet to reduce spam. Learn how your comment data is processed.