[whatwg] [html5] window.print() undefined

Matthew Raymond mattraymond at earthlink.net
Tue Jul 19 12:20:50 PDT 2005

Jim Ley wrote:
> This is flawed though, as it requires all the content to be in the
> page, including media-specific content. CSS cannot remove content, CSS
> is optional, consider:
> This page <span id="viewed">viewed</span><span
> id="printed">printed</span> on ...
> This is a contrived example of how people want web-applications to
> have media specific content - printed media particularly, although it
> would also apply to web applications deployed over interactive voice
> systems, but it shows how relying on optional methods to change
> content is simply flawed.

   I understand what you're saying, but I don't agree that events
related to UA printing of the web document is the answer. For instance,
such events could be combined with AJAX to force people into a
pay-to-print scenario. There's just to much potential there for the web
developer to control the user, and even if you considered that a valid
thing to do, the user could simply create a Firefox fork or extension to
circumvent it. There are two far better options.

   The first option is the one Mapquest and other sites use: provide a
link to a printable version of the page. It's not ideal for all cases,
but it probably satisfies most of the use cases where CSS isn't an option.

   The second is to allow the document object to be cloned, to allow
operations to be performed on the clone, and then to allow printing from
the clone. This allows specialized printing without tampering with the
user's ability to do basic page printing.

   In my opinion, we should just have people do the former until we have
interfaces for the latter.

More information about the whatwg mailing list