Click here to Skip to main content
Rate this: bad
good
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 12:21pm

1 solution

Rate this: bad
good
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:
 
http://www.frogmorecs.com/arts/what-is-a-prn-file[^]
 
...if its a PostScript file you can use this:
http://pages.cs.wisc.edu/~ghost/gsview/[^]
  Permalink  
v2
Comments
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.
—SA
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 txtboxes.so 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 365
1 Sergey Alexandrovich Kryukov 319
2 CPallini 275
3 DamithSL 214
4 Maciej Los 185
0 OriginalGriff 5,455
1 DamithSL 4,457
2 Maciej Los 3,885
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,115


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 1 Feb 2013
Copyright © CodeProject, 1999-2014
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