Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
2.14/5 (4 votes)
See more:
Hi,

I have one mainframe application through which we can send command for document printing. As this application is LAN based and it directly connected to printer on LAN, even though i changed default printer as 'PDFCreater' print command goes to printer on LAN. I want to create one application through which i can read data from printer port and save it into soft copy (pdf or excel) as required.
can anyone help me with this??

Thanks & Regards,
Harshala
Posted
Comments
E.F. Nijboer 20-Jul-10 14:54pm    
You can't read back the data from the printer port while printing. It's like trying to eat while throwing up.
You mention it is a LAN printer. Wouldn't it be more simple to create a print service that is used by all client applications and handles the printing? This way this network service on some server could make sure the soft copy is created and printing is done. This service would also make sure the soft copy is stored in a safe place where users can't just throw it away. If needed they could simply have reading rights.

Good luck!
Member 11457847 4-May-16 18:20pm    
you mean create service that in every client print(from every app,like text file , paint app,msword,ie,...) that send to printer , create a soft copy? how ? can you explain more or give sample for that?
GPUToaster™ 21-Jul-10 1:26am    
Reason for my vote of 4
Nice Idea!!
GPUToaster™ 21-Jul-10 1:27am    
Comment by "E.F. Nijboer" should have been the Answer!!

Well after a long time someone asked a trick question... +5 for that :)

I don't know whether I know the answer or not, but this is the first thing comes my mind...

according to this [^], the printer port for mainframe is 515, so try to capture the data from that port using following article A Network Sniffer in C#[^], if you want to parse the data from the port, then here is the protocol description[^]

Good luck...
 
Share this answer
 
Comments
Member 11157098 20-Jan-15 3:24am    
How did you do it? :( Can you capture data text PDF file/ images?
Hi Harshala,
Did you find out any solution for Capturing data from LPT port.

Please let me know any update..Waiting for response.

Thanks in Advance,
Rajkumar
 
Share this answer
 
Hi Harshala,

Did you solved the problem for Capturing data from printer port.

thnks,
George Garvasis
 
Share this answer
 
Hi,

This can be done very easily. While printing we can capture the data by just changing the port number.
Contact me for further details.
 
Share this answer
 
Comments
Member 12302111 21-Sep-16 1:58am    
hello sir,
how can we take the data while reading ?
because i am working on it.

regards,
dinesh.p
nari.guptha 4-Jan-17 1:42am    
Hi Dinesh,

Did you get the solution to read data from a printer port.
Member 14064777 9-Jan-19 2:37am    
Hi Sreedhar

I've read your article carefully and felt the pleasure that knew you.
Now I develop c# project which capture print data using LPT port.
How do you solve this functions

Hope to meet in a chat.
I'll wait your reply.
Best regards.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900