Print an envelope from a web page

Is there a way to specify the type / size of media that will be used when a user prints a web page? In addition, can I put the text so that it is printed in certain positions?

For example, Id like to display the address on a web page, which the user can then print on a letter-size envelope.

Thanks!

EDIT

By media type, I meant the type of print media such as letter size, formal size, envelope # 10, etc.

+4
source share
2 answers

I think the bottom line is best to use PDF. Unfortunately, browsers really suck at printing. A.

Is there a way to specify the type / size of media that will be used when a user prints a web page?

You can specify a CSS stylesheet to apply only to printing using media="print" . Regarding page size, there is no reliable way to indicate this. You will need to rely on the user to do this for you.

In addition, you will have to rely on the user to remove the header and footer that most browsers add to the printed result.

In addition, can I put the text so that it is printed in certain positions?

In theory, yes. You can use the physical units of cm or in to place elements on the page. I'm not sure if they work with 100% reliability, because the specific fields of the printer can change the result - you have to test.

+6
source

You might want to try using CSS for different media types, although I don’t know if this will give you the exact control you are asking for.

0
source

All Articles