pnj Posted August 8, 2007 Share Posted August 8, 2007 I'm setting up a web application to print labels to a specialized label printer. The challenge is that Internet Explorer (among other browsers) wants to set top and bottom margins to 0.6", which is not so ideal when the label is only 2" wide to begin with. This is a browser setting that CSS can't affect, so I'm expecting to tell the user to change his Page Setup to minimal margins for printing. The problem is IE doesn't seem to save Page Setup. Even between Page Setup and Print, it seems to forget the changes you made - the only way to have it print is to go Print Preview, then Page Setup from the Preview screen, and THEN print from the preview screen. Looks like a browser bug, but I can't find any information on this online. Any ideas on how to make IE use a different default margin setting for printing? Unfortunately I have to use IE6 because that is what the client is using. Maybe the bug is already fixed in IE7... I realize its not really a "phpfreaks" question, but maybe you can direct me to an active IE forum where someone is likely to know? Cheers -pnj Quote Link to comment https://forums.phpfreaks.com/topic/63963-change-default-ie-page-margins-for-printing/ Share on other sites More sharing options...
php_tom Posted August 10, 2007 Share Posted August 10, 2007 The following gets the text all the way into the upper-left-hand-corner for me on both FF and IE: <html> <body style='margin:0px;padding:0px;'> <h3 style='margin:-4px 0px;padding:0px;vertical-align:top;'>Some Text...</h3> </body> </html> Hope that helps. Quote Link to comment https://forums.phpfreaks.com/topic/63963-change-default-ie-page-margins-for-printing/#findComment-319919 Share on other sites More sharing options...
pnj Posted August 10, 2007 Author Share Posted August 10, 2007 The negative margin is certainly a promising idea... no such luck though. Looks good on screen, but the print margin just cuts off the text. See attached... -pnj [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/63963-change-default-ie-page-margins-for-printing/#findComment-319939 Share on other sites More sharing options...
php_tom Posted August 10, 2007 Share Posted August 10, 2007 My only other suggestion is to write your text into a PDF using ezPDF (which I think lets you set your own page margins) in PHP and then print the PDF. But that's kind of a lot of work... Quote Link to comment https://forums.phpfreaks.com/topic/63963-change-default-ie-page-margins-for-printing/#findComment-319942 Share on other sites More sharing options...
pnj Posted August 10, 2007 Author Share Posted August 10, 2007 Fair enough. I guess its either that or force the user to paste the label content into a word processor template with the margins set correctly. Thanks -pnj Quote Link to comment https://forums.phpfreaks.com/topic/63963-change-default-ie-page-margins-for-printing/#findComment-319943 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.