Results 1 to 5 of 5

Thread: Print Style Sheet

  1. #1
    Join Date
    Jan 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Print Style Sheet

    Hi all,

    Currently I'm developing the printable version of the stylesheet for a project, There it has a Optical Character Recognition(OCR) module and I'm currently researching on developing the print CSS file that can directly output the required form to the printer which users can input the data, and make it read by the OCR module and update the system.

    At the current moment I'm experiencing some difficulty in placing background image to div element which is an essential thing in placing four black boxes as shown in the attached image herewith. I have a problem in handling element with Internet Explorer because it's not parsing the CSS which I have used, along with this I'll send images taken with IE and Firefox. I would be grateful if someone can guide me on this.

    Thank you in advance.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    We would need to see the code:

    Please post a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jan 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Re :Print Style Sheet

    Hi all,

    Thanks jscheuer1 for your immediate response, The project I'm involve in can be accessed from here. Currently I'm working with a local copy where the necessary modification for the printable version is working, and here with I have attached the modified print.css file for your reference. There I have given the background: url(img/ocr_bg.jpg); to div element having the id="container" but it's not showing the image and when I place a background image with input[type=text] element it is displaying the image with FF but not with IE.

    I would be grate if you could guide me a way to place a background image to a div element, which is a must I need to achieve.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Well, this is nonsense:

    Code:
    @media print { * { background-image: white !important; color: #000; } }
    and could even be causing problems. If it is already a print stylesheet, the media declaration should have already been made in the stylesheet link on the page using it. The background-image selector takes only an image as its value, not a color. So, assuming that this is already a print stylesheet as declared in its on page link:

    HTML Code:
    <link rel="stylesheet" href="print.css" media="print" type="text/css">
    it should be:

    Code:
    * { background-color: white!important; color: #000; }
    or even:

    Code:
    * { background-color: white; color: #000; }
    as !important is only for overriding other styles (in this case only other print styles, the sheet itself will override the media="screen" sheet).

    Somewhat the same with this:

    Code:
    background-image: #fff url(img/ocr_bg.jpg) 0 0 repeat-y fixed;
    It should be:

    Code:
    background: #fff url(img/ocr_bg.jpg) 0 0 repeat-y fixed;
    Now, the problem with a background image for printing is that some browsers will automatically remove background images for printing, using !important may help with that:

    Code:
    background: #fff url(img/ocr_bg.jpg) 0 0 repeat-y fixed!important;
    If it is a solid black color, consider using a background-color instead. In any case, large black areas are to be avoided in printing, unless you own stock in a company that sells ink.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jan 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    thanks for the guidance.

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
  •