• Post Reply Bookmark Topic Watch Topic
  • New Topic

Providing site wide printable version for pages.  RSS feed

 
Kripal Singh
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure if this the correct place but since i am developing in servlets i am posting it here.
I have seen certain sites having printable version link on every page of the site, which enables the user to format page for printing. How can i provide similar feature. Is it possible to do it with single template (for printable version) or i have to write one for every page. I am using xml + xsl transformation in servlets to build the page dynamically. Any other method doing it without xml is also welcome.
Thanks
[ October 11, 2002: Message edited by: Kripal Singh ]
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use an XSL style sheet for all your pages, then the link would be something like this:

http://www.foo.com/myapp/mypage?style=printable

And your servlet would always check for style attribute. If none present, use the default one. But if 'printable' then substitute your XSL stylesheet that turns off all the fancy font coloring etc, etc.

If there are other parts of the page like banners and sidebars, then the code that includes those would also check this style attribute. If not present, assume the defult, but if it says 'printable', then don't include all the navigation elements, etc.
 
Kripal Singh
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks mike that will work !!!
 
Garrett Smith
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's much easier with simple css. Use
<link rel='stylesheet' href='/css/style.css' media='Print'/>
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!