0

I have an online ticket booking system, the customer can print the tickets directly from the webpage using print command of browser.

However I am facing a problem that the background shades/images using css backround does not appear on the hard copy of tickets, though it's displaying perfectly on the web page. Ok I can use tags but what about the backround shades and watermark images?

Thanks! in advance...

Dipendra Gurung
  • 5,720
  • 11
  • 39
  • 62

2 Answers2

1

This is often an issue with the browser itself. Some browsers such as IE 8 will not print backgrounds by default, and must have the option turned on.

See How to print webpage with background image? for more information.

There are some workarounds, such as actually using images instead of backgrounds, but generally they are not pretty.

Community
  • 1
  • 1
korylprince
  • 2,969
  • 1
  • 18
  • 27
  • Yup — if you want to maximise control over the printed output (which, with tickets, I assume you would), then you’d probably be better off providing the whole ticket as an image, or preferably in a more print-oriented document format like PDF. – Paul D. Waite Sep 28 '12 at 07:50
  • Thanks! I must better convert the page in pdf first. :) – Dipendra Gurung Sep 28 '12 at 10:32
0

You can either try to define rules in a print.css file (which would have media set to "print", not "screen" like your regular css fule). Or, you can use a tool for converting the page to pdf and then print it. If you go in that direction, I suggest looking into wkhtmltopdf. It's pretty straight-forward to implement.

Lazar Vuckovic
  • 798
  • 9
  • 22