Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...thank you for the wonderful resource that you have enabled here. It is clear, concise, well maintained and most importantly, helpful..."

Geography

Where in the world do Tek-Tips members come from?

Extracting PCL Commands, problem with Transfer Raster Data CommandHelpful Member! 

templarrush (Programmer)
27 Feb 12 4:49
Hi,

I'm writing a program to view all the PCL Commands of a pcl file.
It works good so far except when it encounters the following

example:
<ESC>*b0M
<ESC>*b0WSystem.Byte[]
<ESC>*b2M
<ESC>*b6WSystem.Byte[]
�   ��  
<ESC>*b2M    

When a compression method is set (<ESC>*b#M). It starts to fail.
I always read # number of bytes after the command. Afer <ESC>*b6W, I read 6 bytes for the data. It looks like the compression changes the number of bytes.

Is it possible to know the exact amount of data bytes?
Helpful Member!  DansDadUK (Programmer)
27 Feb 12 6:54
>> It looks like the compression changes the number of bytes

No it doesn't; if the sequence starts <esc>*b6W then you should expect 6 bytes of binary data to complete the sequence.

The values, and interpretation, of those binary bytes will, of course, depend on the current compression method.

Use the 'PRN File Analyse' tool in the 'PCL Paraphernalia' application (available via http://www.pclparaphernalia.eu ) to check your analysis.
templarrush (Programmer)
27 Feb 12 8:55
Thanks,

The problem is that i'm not using the correct reader to read the file in c#.

I used a StreamReader's BaseStream to read the bytes. Now changing my application to use a BinaryReader smile
DansDadUK (Programmer)
27 Feb 12 9:17
That makes sense, since the binary data can include ANY byte value, including 0x00 (<NUL>), 0x7f (<DEL>) and other C0 control codes which may upset a text (rather than binary) reader.
templarrush (Programmer)
27 Feb 12 10:46
It works perfect with a BinaryReader. I got all PJL, PCL and HPGL/2 commands now.

Now I will try to execute the commands to render the page. Any suggestions?  
DansDadUK (Programmer)
27 Feb 12 13:00
>> ... execute the commands to render the page. Any suggestions?

Not really; it seems that you are trying to emulate what products such as:

SwiftView - http://www.swiftview.com/sview1.htm

PCLWorks - http://www.pclworks.com/

Lincoln PCL Viewer - http://www.lincolnco.com/support/faq_ldvpcl.htm

It is NOT a trivial process.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close