Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PCL File to ASCII text file

Status
Not open for further replies.

KenReay

Programmer
Aug 15, 2002
5,424
GB
Hi

I have encountered a legacy application at my current client site which does not seem able to output data in text format. It is possible to ouput reports to a file, but what you get is (I think) a Hewlett Packard PCL format file, complete with printer control commands etc etc. Given how common HP printers are it occurs to methere may well be a bit of free or shareware out there which can convert this to plain ASCII text. I have done the Google search but cannot find anything. Have any of you come across such software?

Thanks


Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Assuming it is a standard PCL file and further that it uses
fonts other than 10CPI FIXED font, it's going to be tough to
convert it to a "plain" ascii text file.

That being said, there are programs to convert pcl to other
formats such as perhaps RTF, and PDF. These are not, however, plain text files either of course.

If you just need to know what is going on, you might consider learning PCL. It's really not that difficult
for most things. You would probably need a reference
available.

Just as a note. The Escape character (ascii 27 decimal) looks like a small left arrow when imbeded in a file and
viewed in the dos editor.



 
If it is a standard PCL file (ver 5 or below), you could
write a simple basic program to look for CHR$(27) then
look for the next CAPITAL letter which would mark the
end of the sequence. Removing these would give you text
(assuming raster graphics are not in the file) but would
not position it in the text document. As a result you might
get text from the bottom of the document right next to text
at the top of the document since you can do this with PCL.
There is a logical reason for doing it this way. Printing
text of all the same font size before changing to another
font size.

Oh, 1 other exception to the removing of escape sequences.
If you have a symbol set with it's own characters, for example the Tax Line Draw (there are many others), then you
might get what looks like meaningless letters and punctuation as part of the text that in pcl would be translated to a different 1 character image when printed.

Example: In the tax line draw set, the comma (",") represents approxamately the chr$(196) or dash in the box
drawing characters.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top