Raster data in PCL
-
Could someone explain how the raster data in PCL is converted into what is printed on paper. I have a project where I am capturing the printer data from a Vtech laptop. It is a toy laptop, but it has printer drivers for several printers, 27. I wrote a the characters zug in a file, and "printed" it. The laptop parallel port is connected to my desktop parallel port, and I wrote qbasic program to capture data and write to a file. I printed zug file 3 times with each different printer driver (9 drivers of the 27 possible) to compare if data was droppped/corrupted. I got all of my data which was in dec, and I converted to ascii to read it. I found several documents on "Printer Command Language" to decipher the captured data. Looking at the data everything makes sense except the raster data in the Transfer raster data lines. ESC * b 2 W ? ? ESC * b 8 W ? ? ? ? ? ? ? ? Transfer raster data. The number between b and W is number of bytes. These bytes are the "raster data". I have read a little about RIP (raster image processing) but I'm getting lost. Should I expect that each printer will interpret the raster data at a level I cannot follow just by looking at the value? Does the value simply correspond to a shade? How does the raster data correspond to printing on the paper? Is the answer to that in the compression mode, in this case TIFF? Below is a sample of data captured and converted with my notation in ()'s I left the raster data in dec. The printer driver was for HP DeskJet Generic. zug will print out in super basic font, no formating or style. ESC E (Reset printer) ESC & l 2 6 A (Paper size A4) ESC & l 0 o 1 L (Left margin) ESC * t 1 5 0 R (Raster resolution 150dpi) ESC * p 1 N ( ? Couldn't find any doc on ESC*p#N) ESC * p 0 Y (Vertical Cursor Position Units-of-measure) ESC * b 2 M (Set compression mode 2=TIFF) ESC * r 1 U (Simple color 1=black&white palette) ESC * p 1 2 0 X (Horizontal Cursor Position Units-of-measure) ESC * r 1 A (Start raster graphics) ESC * b 2 W 250 0 (Transfer raster data, 2 bytes) ESC * b 2 W 250 0 ESC * b 2 W 250 0 ESC * b 2 W 250 0 ESC * b 2 W 250 0 ESC * b 2 W 250 0 ESC * b 8 W 6 255 254 56 3 129 255 224 (Transfer raster data, 8 bytes) ESC * b 8 W 6 255 254 56 3 129 255 224 ESC * b 8 W 6 255 254 56 3 129 255 224 ESC * b 8 W 6 0 112 56 3 142 0 224 ESC * b 8 W 6 0 112 56 3 142 0 224 ESC * b 8 W 6 0 112 56 3 142 0 224 ESC * b 8 W 6 3 128 56 3 129 255 254 ESC * b 8 W 6 3 128 56 3 129 255 254 ESC * b 8 W 6 3 128 56 3 129 255 254 ESC * b 8 W 6 28 0 56 31 128 0 224 ESC * b 8 W 6 28 0 56 31 128 0 224 ESC * b 8 W 6 28 0 56 31 128 0 224 ESC * b 8 W 6 255 254 7 227 129 255 0 ESC * b 8 W 6 255 254 7 227 129 255 0 ESC * b 8 W 6 255 254 7 227 129 255 0 ESC * b 2 W 250 0 ESC * b 2 W 250 0 ESC * b 2 W 250 0 ESC * r C (End raster graphics) ESC * p + 1 8 Y ( ? similar to ESC*p#Y above but makes no sense here) ESC E (Reset printer) Thank you for any help.
-
Answer:
If you are not familiar with the "binary" system, you should read about it -- I suspect wikipedia has a good article. Consider each byte in an ESC * b x W line in order. I'm not sure what the next number signifies--ignore it. The rest of the bytes carry the information for one row of the image, with the first byte appearing on the left. Then consider the 8 bits in each byte. The highest bit (128) corresponds to the leftmost pixel of that byte, and the lowest bit (1) corresponds to the rightmost pixel of that byte. If you carefully (or using a computer program) decode the interesting part of the image (the lines with 8 bytes of data, not 2 bytes of data), you will see your letters. I've put a Python program as well as the output it produces here: http://pastebin.ca/330519
sailormouth at Ask.Metafilter.Com Visit the source
Other answers
Youl should look at HP documents like http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13205/bpl13205.pdf. More can be found http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=bpl04568.
MonkeySaltedNuts
Thank you Jepler that program illustrated it wonderfully. MSN Thank you also. Your first link is the doc I found most useful when deciphering the commands. I will take a look at the other docs they have on the second link.
sailormouth
Related Q & A:
- Where To Get Online Data Mining Work?Best solution by online.njit.edu
- How would you transfer data between your data structures and databases?Best solution by Programmers
- How to store data in php and get data from php?Best solution by Stack Overflow
- What are some phones for Verizon Wireless without a data plan or with a cheap data plan?Best solution by Yahoo! Answers
- What's the difference between a static data member and a regular data member?Best solution by eHow old
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.