Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET4 MVC3
Hi,
 
I need to print to a LPT1 port using asp.net web application.
I am using .net4.0 .Can anyone give some pointers to achieve this?
 
Thanks in Advance,
 
Achus
Posted 11-Oct-12 16:47pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

A Web application has no access to hardware, by apparent reasons. So, there is no difference is a printer is connected to LPT1 or in some other way — this is a matter of client's OS, drivers, etc. So, you can only print using a printer formally installed in your system: network, local USB, LPT, whatever; for a Web application, they are nothing but just printer.
 
Most applications simply rely on the browser functionality and the user's decision to send a page to printer. This non-intrusive way is the best. Your only concern should be providing printer-friendly content: fluid, contrast enough, free from active controls for user input, and so on. You can generate a special printer-friendly page (the user clicks on the printer icon), but it would be much better to do it through CSS discriminating different media and providing different media-sensitive styles. Please see:
http://webdesign.about.com/cs/css/a/aa042103a.htm[^],
http://www.w3.org/TR/css-print/[^].
 
For more advanced stuff, please see this article:
http://www.dotnetcurry.com/ShowArticle.aspx?ID=92[^].
 
I still recommend the first approach. Your customer knows better when to print and what to print; your application should respect customer's decision and assist non-intrusively.
 
—SA
  Permalink  
v2
Comments
Marcus Kramer at 11-Oct-12 23:07pm
   
+5.
Sergey Alexandrovich Kryukov at 11-Oct-12 23:36pm
   
Thank you, Marcus.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 350
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 Sergey Alexandrovich Kryukov 130
4 DamithSL 95
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,310


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 11 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100