Click here to Skip to main content
11,706,455 members (37,614 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: VB.NET
Hi as simple as the subject state, I need to read a prn file that is tryied to be printed from a legacy application, also I can do the print to XPS or print to PDF, mut I need then to "understand" the file in order to populate a data grid. any codes? thanks in advance!
Posted 1-Feb-13 11:21am

1 solution

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

Solution 1

The short answer is it depends on the formating. Here are some links that should help:[^]

...if its a PostScript file you can use this:[^]
Sergey Alexandrovich Kryukov at 1-Feb-13 20:00pm
That's correct, a 5.
Generally, it's not designed for "reading". This is what is sent to a printer on a low level, and therefore is totally hardware-dependent.
topogigio1979 at 1-Feb-13 20:23pm
may be I misexplain the issue... I need to get a PRN file and READ it on VB and place the data into ms data grid or I need something that can open the file read it parse it and place the information on the txts, got it? thanks anyway for the information provided
BC @ CV at 4-Feb-13 9:08am
As SA explained above its totally hardware dependent. So the best you can do is to Google the name of your printer & PRN. If you need this to work for all printers you are looking at a near impossible feat, you might consider if there is a more reasonable way to accomplish whatever it is you are trying to accomplish. BTW what is the reason for your needing to read a PRN file in a form?
topogigio1979 at 4-Feb-13 10:04am
HI thanks a lot for the reply, I need to capture the information from a legacy system, so I can print as XPS, print as PDF or print to file ( PRN ) whatever is the file output, the issue is that I need to read the file ( like an Excel spreadsheet) got the idea? hope you can help
BC @ CV at 4-Feb-13 12:11pm
If possible, I would try to get the data from the legacy system before it goes to the printer and then create a PDF by either using RDLCs or some third party library like itextsharp.
topogigio1979 at 4-Feb-13 12:38pm
no, the legacy system has no output than printer, so I was thinking to print to PDF or print ro XPS and then read and parse the information ( that is the code help I'm looking) is there any chance to read a PDF file from vb? or an XPS file?
BC @ CV at 4-Feb-13 12:50pm
So you are trying to read the data from the legacy system by converting what it sends to the printer to a PDF and then reading the PDF? That sounds ridiculous, What is the legacy system? Even screen scraping sounds like a better idea.
topogigio1979 at 4-Feb-13 12:53pm
yep you got it... the system is custom SW for a dental applications. so there is no other way to get the data... what are your suggestions? and why do you think I cannot get the information from the PDF? do you know ir have some code to do that?
BC @ CV at 4-Feb-13 12:56pm
Its not that you can't get data via PDF its just going to be a very brittle solution and give you many headaches down the road especially whenever the document/data gets modified. I would investigate iText
topogigio1979 at 4-Feb-13 12:58pm
ok, what is itext?

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

  Print Answers RSS
0 OriginalGriff 197
1 Sergey Alexandrovich Kryukov 141
2 chainerlt 110
3 Mika Wendelius 80
4 ppolymorphe 71
0 OriginalGriff 9,070
1 Sergey Alexandrovich Kryukov 8,413
2 CPallini 5,189
3 Maciej Los 4,746
4 Mika Wendelius 3,676

Advertise | Privacy | Mobile
Web04 | 2.8.150819.1 | Last Updated 1 Feb 2013
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