webpage printing


I have a webpage that is set on Javascript to window.print which is fine once I but a Receipt printer.

but what I need to know is 2 things
1) How can I set up a template width so that it only prints certain width - either set as HTML or CSS
2) What must i call to cut the receipt

Any help is much appreciated

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You just set up separate styles for the print with an @media rule see:  for the syntax and options.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
R8VIAuthor Commented:
Hi COBOLdinosaur
thanks for this so that may answer point 1 but what about point 2 sorry
I don't understand what you are asking in point 2.  I assumed it had something to do with the styling of the receipt which would be covered by specifying the media type.

R8VIAuthor Commented:

No like the printers will need to be told when to cut because not always will it be a set style

I want to implement on a receipt printer
Well if the receipt printer has to receive a code to tell it when to cut, then you will probably need some kind of ActiveX embedded in the page to send the code.  However most browsers (other than IE) do not support ActiveX and even Microsoft is now discouraging the use because of the security risks.

Browsers are not designed to control external devices, so you might want to contact the printer manufacturer to see if they have software that allows you to do what you want to do.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.