Click here to Skip to main content
11,704,509 members (53,339 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: .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 Sergey Alexandrovich Kryukov 700
1 OriginalGriff 495
2 CPallini 267
3 Andy Lanng 259
4 Maciej Los 235
0 OriginalGriff 8,824
1 Sergey Alexandrovich Kryukov 8,247
2 CPallini 5,189
3 Maciej Los 4,726
4 Mika Wendelius 3,606

Advertise | Privacy | Mobile
Web02 | 2.8.150819.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