Click here to Skip to main content
13,249,813 members (65,825 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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 12:21pm

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:[^]
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 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 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 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 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 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 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 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 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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.171114.1 | Last Updated 1 Feb 2013
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