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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to read a pcl file 2

Status
Not open for further replies.

BitZero

Programmer
Mar 11, 2008
100
0
0
US
I have a pcl file created by a purchase order application. I opened it using notepad expecting to see readable ascii characters. Instead, it looks like "garbage" or something I would see if I was opening a zip file using notepad. However, I have a pcl reader utility program, and it is able to read and display the file just fine. It's nothing fancy - just a standard PO with a few boxes.

I need to modify the text on one line of this PO, in my test environment, in order to test a fax utility. I don't have access to the source of the purchase order print program. How can directly change the plc file? Is there a utility program I can use? Or is there a way to "unscramble" the file?

Thanks
 
You haven't stated what level of PCL your file is using. But consider that, depending on the printer driver in play, your PCL page could be entirely a bitmap, rendering it uneditible.

Getting back to your question, I would recommend the text editor "vim" in binary mode for surgery on PCL files.

Is this a windows application?

If so, then editing the PCL file may be problematic in that contemporary drivers tend to remap the symbols so where there is a letter 'A' on the printout, it may actually be represented by a 'C' or some other character in the file. ASCII text may be unrecognizable as such.

The gibberish you are seeing may be remapped ascii, a soft font, or image data.


Jim Asman
 
You need a hexadecimal editor (or something similar) to make changes to a PCL print file, because some (and perhaps many) of the bytes in the file will have values outside of the normal 'printable ASCII' range.

But first you'd need to parse the print stream to work out what you need to change, so you need some sort of PCL analysis utility - I don't know if there are any free ones.

Even after analysis, you may find that the page (or parts of the page) is/are rendered as encapsulated raster graphics images - so identifying a bit of text becomes very difficult.

I have an analyser , so if you send a copy of your file (and what text you want to change) to me(D_a_n_s_D_a_d_@_b_t_i_n_t_e_r_n_e_t_._c_o_m after removing the underscore characters) I can at least tell you the answers to some of the above.
 
Thanks for your replies. I don't know what level of PCL this file is. I'm working with some fax software that inputs pcl files and outputs either a fax or an email. I'm researching what would be needed to send the PO as an email instead of a fax. The POs are created on a mainframe, and those programs are supported by another group. I can just wait until a developer is available to test the email option.

DansDadUK - thanks for your kind offer to analyze the file. However, because it contains sensitive financial info, I won't be able to send it.
 
PCL6 is compiled PCL so it might very well appear as 'garbage'. PCL5 and below except for raster graphics can be read once you know the codes. However, the driver may turn the original code into one big raster graphic for the page making it harder to interpret. (for example if you print to a file and are using the printer driver).
 
Buff1 - thanks for the info - I didn't know that. My file must be PCL6. I worked with PCL a long time ago in a previous job, and it was all text and could be read with notepad.
Thanks again.
 
You can determine (quite easily) if the generated print stream is PCL5 or PCL6 (or something else entirely) if you open the captured file using NotePad (or similar), and examine the first few hundred bytes of the file.

If the stream is PCL6, there will be (at least) one PJL command near the beginning of the file, and this will be of the format:

@PJL ENTER LANGUAGE=PCLXL

If the stream is PCL5, there may be an equivalent command:

@PJL ENTER LANGUAGE=PCL

but (as PCL5 doesn't need to be entered from PJL) this may not be present.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top