SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist venkat6134's Avatar
    Join Date
    Jul 2010
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Print with specific dimensions of a page?

    Hi all,
    How to write a function to call a print dialog, and that allows only the specific part(means specific width and height) of the page......

    This function is called by clicking on the custom print button on the web page..

    How to write this in php?

    Can any one help me regarding this...

  2. #2
    Web Professional
    Join Date
    Oct 2008
    Location
    London
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't write it in PHP. PHP is executed on the server side. Printing happens in the browser client side.

    JavaScript is executed on the client side and you can open the Print dialog using JS but as far as I know it doesn't allow any customisation.

  3. #3
    SitePoint Evangelist venkat6134's Avatar
    Join Date
    Jul 2010
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    then how can i solve this problem?

    Actually, i want to print some portion of the page.

  4. #4
    Web Professional
    Join Date
    Oct 2008
    Location
    London
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use CSS to hide portions of the page you don't want printed:

    For example:

    Code:
    @media print {
        #header, #footer { display: none }
    }


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •