Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Asp.net webpage printing

Posted on 2014-09-29
7
Medium Priority
?
152 Views
Last Modified: 2014-11-03
Hi,

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

Thanks
R8VI
0
Comment
Question by:R8VI
[X]
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
7 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 2000 total points
ID: 40350622
You just set up separate styles for the print with an @media rule see: http://www.w3schools.com/css/css_mediatypes.asp  for the syntax and options.

Cd&
0
 

Author Comment

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

Expert Comment

by:COBOLdinosaur
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.

Cd&
0
 

Author Comment

by:R8VI
ID: 40352644
Hi,

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

Expert Comment

by:COBOLdinosaur
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.

Cd&
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

722 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