Click here to Skip to main content
13,048,406 members (122,866 online)
Rate this:
Please Sign up or sign in to vote.
See more:

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 11-Oct-12 23:07pm
Sergey Alexandrovich Kryukov 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 11 Oct 2012
Copyright © CodeProject, 1999-2017
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