Click here to Skip to main content
11,803,019 members (77,679 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: .NET .NET4 MVC3

I need to print to a LPT1 port using web application.
I am using .net4.0 .Can anyone give some pointers to achieve this?

Thanks in Advance,

Posted 11-Oct-12 15:47pm

1 solution

Rate this: bad
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:[^],[^].

For more advanced stuff, please see this article:[^].

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.

Marcus Kramer at 11-Oct-12 23:07pm
Sergey Alexandrovich Kryukov at 11-Oct-12 23:36pm
Thank you, Marcus.

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

  Print Answers RSS
0 KrunalRohit 356
1 OriginalGriff 335
2 CPallini 270
3 F-ES Sitecore 270
4 Sergey Alexandrovich Kryukov 234
0 OriginalGriff 2,950
1 Maciej Los 1,910
2 KrunalRohit 1,862
3 CPallini 1,735
4 Richard MacCutchan 1,157

Advertise | Privacy | Mobile
Web03 | 2.8.151002.1 | Last Updated 11 Oct 2012
Copyright © CodeProject, 1999-2015
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