print out using php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vjayis
    New Member
    • Mar 2008
    • 134

    print out using php

    hi everybody.,

    i need to get a print out of a page automatically when a button is clicked using php...

    any ideas??

    regards
    vijay
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Use javascript.

    window.print()

    Comment

    • nathj
      Recognized Expert Contributor
      • May 2007
      • 937

      #3
      I've never been a fan of presenting the user with options that replace default functionality; it's confusing and breaks the users expectations.

      If you want a page to print, then the normal print functions - CTRL+P, or File->Print would be used by the user.

      If you wish to ensure it prints a certain way then use a dedicated style sheet with the media type set to 'Print'

      Cheers
      nathj

      Comment

      • vjayis
        New Member
        • Mar 2008
        • 134

        #4
        ya i knw tht., but for making a printout similar to an bill book.,

        i,e printout is taken as the bill., so odynamic contents should be printed.,

        any help??

        Comment

        • nathj
          Recognized Expert Contributor
          • May 2007
          • 937

          #5
          I'm not sure I follow you now. You can use CSS to restrict what is printed and the layout of the print. So if there is something you don't want printed in the print style sheet set the display to none.

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #6
            or the other way round, if you want something printed, but not displayed set the screen display to none and the print display to inline|block (or whatever is suited).

            regards

            Comment

            • vjayis
              New Member
              • Mar 2008
              • 134

              #7
              hi again.,

              i need to take a print of all my datas which are displayed in an webpage using php.,

              so i used window.print() function as suggested. but while taking printout the title and the address also gets printed in the paper..

              i just need to take a print of my result without the title and address bar.,

              any help??

              regards
              vijay

              Comment

              • nathj
                Recognized Expert Contributor
                • May 2007
                • 937

                #8
                I'm still not sure I am with you on this one. Is there any reason why you are not using a print style sheet? Then you can control more of what is/isn't printed.

                Comment

                • vjayis
                  New Member
                  • Mar 2008
                  • 134

                  #9
                  i removed it through page set-up.,

                  and while displaying datas how can we predict the page length.,

                  i m displaying all user details as a table with the user names as title.,

                  so if the details continues to the next page., the upcoming users details should be printed in the new paper..

                  any help

                  Comment

                  • pbmods
                    Recognized Expert Expert
                    • Apr 2007
                    • 5821

                    #10
                    Heya, vijay.

                    For the level of control that you want over your output, you should consider generating PDF files instead.

                    Comment

                    Working...