General discussion

Locked

How to set print margins via web page?

By Eggy ·
Is it possible to manipulate printer margin settings via controls/code within a web page?
I have a web-based app which requires users to print web pages frequently. In order to print the full content on an 8.5x11 page requires use of 0.25" margins on the left & right side. Most web browsers don't use 0.25" as their default, so I'd like to override the default and use the desired (0.25") setting.

Please give your advice & direction on how I could approach this problem.

Thanks,
Pete

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

How to set print margins via web page?

by MadestroITSolutions In reply to How to set print margins ...

Its not the print margins you have to set. The pages need to be designed to fit on a regular page. You cannot access the printer properties programmatically. If the pages were designed by you, make sure they fit in a regular screen. Its not going tobe easy (specially if all the pages are designed already)
There is a workaround for this kind of thing, but it only works with Internet Explorer, no other browser. Internet Explorer allows you to define a different page to be printed than the one the user is looking at. It sounds crazy, but it is a wonderfull thing. You include a tag in the <HEAD> section that will redirect the printer to a different page. So for example if you are looking at page01.html and you hit print, or print preview, the browser will show you page02.html instead. Its a pretty kewl trick. Here is the code:

<link rel="alternate" media="print" href="PrintPage.asp">

* Where PrintPage.asp is the page you want printed when the user hits print or print preview

* Remember this goes on the <head> section and it only works for IE.

Good Luck!

Collapse -

How to set print margins via web page?

by Eggy In reply to How to set print margins ...

Thanks. I'll check it out.

Pete

Collapse -

How to set print margins via web page?

by Eggy In reply to How to set print margins ...

This question was closed by the author

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums