1 Reply Latest reply on Mar 29, 2010 2:32 PM by Fernis

    Print or PDF Search Results

    TheScarecrow Level 1

      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?

        • 1. Re: Print or PDF Search Results
          Fernis Level 3

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



          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