Solved webpage printing

Posted on 2014-09-29
Last Modified: 2014-11-03

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

Question by:R8VI
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 53

Accepted Solution

COBOLdinosaur earned 500 total points
ID: 40350622
You just set up separate styles for the print with an @media rule see:  for the syntax and options.


Author Comment

ID: 40351156
Hi COBOLdinosaur
thanks for this so that may answer point 1 but what about point 2 sorry
LVL 53

Expert Comment

ID: 40352359
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.


Author Comment

ID: 40352644

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
LVL 53

Expert Comment

ID: 40352680
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.


Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question