1

I've got a HTML document generated using by PHP (can't use the COM object due to Office not being supported on the server!) that for the most part prints fine, especially in Firefox... the problem is IE6 defaults to margins of '20' which pushes the content onto the second page - there's a simple workaround of changing the margin to '10' which works perfectly but isn't ideal as a long term solution.

Any solutions would be very much appreciated, thank you :)

Nick
  • 1,233
  • 13
  • 26
  • 37
  • this kind of issue in IE6 sounds like the browser might be going into quirksmode. have you included a `DOCTYPE` in your page? – Spudley May 17 '11 at 14:34

1 Answers1

1

You could try creating a separate style sheet just for printing. Add this to your head element:

<link rel="stylesheet" type="text/css" href="print.css" media="print" />
whoabackoff
  • 1,603
  • 4
  • 17
  • 32
  • Thanks, I'm actually using this right now anyway (media="print, screen") since it's going to be used exclusively for printing documents - problem is I can't change the page margins! Cheers. – Nick May 17 '11 at 15:14
  • 1
    Hmm... That seems like a browser specific problem. What if you used a tool that converts the page to pdf before printing? (Example PDFCreator) – whoabackoff May 17 '11 at 15:37
  • Not a bad solution thanks - may try and find something that works directly from PHP too. – Nick May 18 '11 at 06:40
  • Looks like this question has been asked before: http://stackoverflow.com/questions/1960939/disabling-browser-print-options-headers-footers-margins-from-page – whoabackoff May 19 '11 at 13:35