SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    CSS Printing Page Orintation problem

    Hello!

    i need to fill the salaries of each employee in to company payslips using php.
    the format of the payslip has been attached.
    slp.jpg
    The payslips are printed in continues sheets having the width of 11 x 5.5 inches.
    We have Epson LQ-2180 for printing.

    i have the following css

    Code:
    <style type="text/css">
    @page { 
        size:11in 5.5in;
        margin: 0.5cm;
    }
    </style>
    now in google chrome and in IE, the print preview shows the page size and shape correctly as like in the slip (see the chrome print preview attachments ).preview.jpg preview2.jpg

    but when i feed the slips and prints, the values are printed in horizontal fashion.

    i tried sizeortrait and size:landscape, no effect
    Code:
    @page { 
        size:11in 5.5in;
        margin: 0.5cm;
        size:landscape; //tried portrait also. no effect.
    }
    i also tried the built printer properties 'Landscape' orintation, nop no use.

  2. #2
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,892
    Mentioned
    123 Post(s)
    Tagged
    1 Thread(s)
    Support for printing CSS is pretty poor across the board. There are a few things you could try, off the top of my head, but I can't promise that any of them will work!

    • combine the two lines into one: size: {11in 5.5in landscape;}
    • Go into the printer settings and change it to landscape in there
    • Print the pages to PDF rather than paper, and then print the PDFs

  3. #3
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stevie D View Post
    Support for printing CSS is pretty poor across the board. There are a few things you could try, off the top of my head, but I can't promise that any of them will work!

    • combine the two lines into one: size: {11in 5.5in landscape;}
    • Go into the printer settings and change it to landscape in there
    • Print the pages to PDF rather than paper, and then print the PDFs
    Print to pdf seems giving me a new life in this project.
    time to leave office morning ill try this and defensively come back with the feedback.
    Thanks steve!

  4. #4
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stevie D View Post
    Support for printing CSS is pretty poor across the board. There are a few things you could try, off the top of my head, but I can't promise that any of them will work!

    • combine the two lines into one: size: {11in 5.5in landscape;}
    • Go into the printer settings and change it to landscape in there
    • Print the pages to PDF rather than paper, and then print the PDFs
    Nop
    there is nothing much in the pdf print dialog it self. same problem remains.
    i manage to get the orientation problem solved by choosing the "system print dialog' and define a custom paper that matches the size of our payslip and works charm. the problem now remaining is, after printing one page, then the paper keeps rolling to another 3 or 4 slips then prints the second page (if have).
    dont no how to stop this printer paper rolling

  5. #5
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thank you, This problem now solved.
    when printing a custom size page, we need to define the custom page size in the system print dialog box and should select this paper under "Paper quolity' > 'advance' settings in the print dialog it self.


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
  •