Skip to main content
Known Participant
March 29, 2010
Question

Print or PDF Search Results

  • March 29, 2010
  • 1 reply
  • 1713 views

I have a search and results page that I have made and I want to allow the user to Print or PDF the current page or results or all the results.  The results page displays 25 or 50 results per page.  Is there a way to do this?

This topic has been closed for replies.

1 reply

Fernis
Inspiring
March 29, 2010

Cascading style sheets' @media rule allows you to reformat the page for printing.

http://www.w3.org/TR/CSS2/media.html#at-media-rule

Javascript's window.print() allows you to pop up the print dialog on the client computer.

ColdFusion also has server side printing functionality, which is easy to use.

Creating a PDF is also easy. Use the CFDOCUMENT tag. You may want to render a different search result page for the PDF to be generated, perhaps. CFSAVECONTENT tag may also help you reduce the amount of code, when you want to output the rendered content either to a PDF or to a web page.

The general idea is to wrap the content inside <cfdocument></cfdocument>, save the file, and serve it possibly with a CFCONTENT tag from a dedicated template.

Hope these very generic pointers get you started.

--

-Fernis - fernis.net - ColdFusion Developer For Hire