Solved

Send ASCII Characters "higher" that 255 to printer

Posted on 2014-03-04
38
847 Views
Last Modified: 2014-03-07
I have a customer for whom I am creating a prescription "report" to a thermal printer. The programming language is proprietary and not widely known. Most programmers in a certain version of this programming language have difficulty controlling PCL5 output from the application to the print manager. This manager is a "black hole" that listens on a particular port on the local machine or a remote machine and captures the output and handles communication with the Windows print spooler. There is no documentation nor information coming from the vendor except "not supported". Some of us have had limited success with putting the software in "passthru" mode and sending some PCL5 commands through the manager and have received expected results in the output.

The problem; there is a character in at least one font on the local windows machine called Lucinda Sans Unicode or something close to that where at decimal 8478 and I have also seen it referred to as (Hex?) 211E exists a symbol I would like to use. I can ask the language to "Decode" an ASCII value (1 to 255) and the resultant character will be sent. The character of interest is well above that value and the decode function does not appear to accepted values above 255 as in it seems to ignore them. Interestingly windows' chracter map application does not mention how to key this in via an ALT+nnnn code. So a PCL5 escape sequence might work but what? PCL5 seems to deal more with controlling the printer and it's features rather than dealing with the actually data sent to it. I would like to have a PCL5 escape sequence to send this character maybe manage its size and attributes such as bolding etc. but I am just not well versed in PCL5 commands and I have not idea how to send a character that does not exist on a keyboard (sort of as I mentioned I can go 1-255 which includes some "non printable" characters and others.)

Thanks for any assistance.
0
Comment
Question by:mike1142
  • 17
  • 16
  • 5
38 Comments
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 39903344
There are no ASCII characters above 255. ASCII uses 1 byte per character so that is all you get.

What you are seeing are unicode characters. The printer may not support them at all. Look in your documentation for how to send unicode characters and hope for the best.
0
 

Author Comment

by:mike1142
ID: 39903354
I understand what you are saying, I did misspeak when I said ASCII and I meant unicode. So, you mean there is no way to send commands to the printer to create a character? So if I send an "A" to the printer it only sees A and nothing else?
0
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 39903420
It depends greatly on the printer. Does the printer support a limited set of fonts, or whatever you send at it? Does it print black and white images or just text?

If it can print images, than it surely would support unicode since it would just interpret it as an image.

If it only prints characters in a limited set of fonts (or only one font) then you are almost surely limited to the ASCII character set.
0
 

Author Comment

by:mike1142
ID: 39903465
The printer itself is very flexible, raster graphics etc. I have no problem sending it data I just don't know what "data" represents this character to the printer. Putting it in raster mode might be an option and I have the Esc commands to initialize, enter quit and send data but what data?

I mention PCL5 because this is the HP Laserjet standard and this is what is support:

Example for this printer:
//Enter raster mode
ESC*rA
//Intialize raster mode
ESC*rR
//Transfer raster data
b n1 n2 d1...dk

I believe the ... above represents the data that is sent so the command might look like
b n1 n2 d1"Mary has a little lamb"dk

This may not be appropriate for raster graphics (not a printer guru) but I would like to send "Mary has a little lamb" as "<whatever unicode 8478 looks like>"

Make sense?
0
 
LVL 16

Expert Comment

by:DansDadUK
ID: 39903530
As TommySzalapski has already stated, you are in the realm of Unicode characters (characters which usually require 16 or more bits to represent them) with your character:

decimal 8478 = hexadecimal 211E = Unicode U+211E which is the Prescription Take symbol (the glyph is shaped like an upper-case R with a stroke through the angled leg).

And (as he says) "it depends greatly on the printer", but also (it would seem to me) on the capabilities of your "(black-hole) printer manager software"; if this doesn't support multi-byte characters (whether from plain text, or by interpreting embedded PCL escape sequences), then nothing you do is likely to work.
0
 
LVL 16

Expert Comment

by:DansDadUK
ID: 39903545
>> ...  may not be appropriate for raster graphics ...

A raster-graphics image of your character would be just that - an (encoded) bitmap image, so nothing to do with text.
Your application would have to "display" the text you want, in the typeface you want, and convert that to a bitmap image, then encode that as an encapsulated PCL raster-image - but I very much doubt that your printer-manager or the target printer would support this.
0
 
LVL 16

Expert Comment

by:DansDadUK
ID: 39903604
A bit of background on character sets:

(US) ASCII is the original 7-bit character code, which includes control-code characters in the (hexadecimal) range 0x00-0x1f and 0x7f, and graphic characters in the range 0x20-0x7e.
There are many 8-bit character codes, but the most common (in the Western world) is the ISO-8859/1 Latin 1 set, which is a superset of 7-bit ASCII, where the range 0x80-0x9f defines the (very-rarely used) C1 control-code characters, and the range 0xa0-0xff defines a set of alphanumeric characters, and a few symbols, in common use in Western Europe.
Unicode is a character set which was originally defined by a 32-bit code-space, but is now restricted to a 21-bit code-space; ISO-8859/1 is a strict subset of Unicode.
0
 

Author Comment

by:mike1142
ID: 39903611
The capabilities of the "black hole" are unknown. The application seems to be able to display anything that can be reproduced on an HP Laserjet.

So I can tell the application to use Lucinda Sans Unicode and also bold it. That is one set of commands. The I tell it the data which can be "ABC" or decode 65 concat decode 66 concat decode 67 and all will reproduce ABC on the output in bold Lucinda Sans Unicode font.

You all are saying if I cannot find a way to represent this character through the application even accessing these "symbol sets" on the printer itself. Nothing can be done. Right?
0
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 39903657
I don't think we are at the "nothing can be done" point yet.
If you can print graphics, then at the worst case, you could convert your whole text block to a graphic and print that.

Also, if it supports lots of fonts, it may very well support unicode. You just have to figure out how to specify it.

You could try something like decode \u211E
The \u is a common way to escape a unicode character.

According to the following link, PCL5 supports the ISO unicode symbol sets.
http://support.necam.com/printers/pclcodes/pcl5hp.htm
Look under "Font Selection"
0
 
LVL 16

Expert Comment

by:DansDadUK
ID: 39903683
Most modern LaserJet (and clone) printers which support PCL (this hence excludes the cheap 'host-based' devices) include a set of printer-resident fonts:

These fonts are scalable and based on TrueType technology (albeit PCL-encapsulated), except for a few bitmap fonts (now limited to the LinePrinter typeface).
TrueType fonts internally use Unicode indexing to map character codes to the glyphs (characters shapes) supported by the font.
These fonts are unbound, as they are not bound to any particular 8-bit character set.
But plain text, including that within the majority of PCL print jobs, uses 8-bit character codes, so printers use symbol sets to bind (map) individual 8-bit character sets to various different sets of characters within the Unicode range.
Which symbol sets are available is defined within the firmware of the printer; and which sets are available for a particular font is defined within the resident fonts.
Within a PCL print job, a symbol set might be selected explicitly, or the job may rely on (assuming) the default symbol set which the printer has been configured to use,
0
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 39903694
I have not been able to find a PCL character set that includes the Rx (Prescription Take) symbol. You may be stuck with the graphic solution.
0
 

Author Comment

by:mike1142
ID: 39903736
TommySzalapski - I looked here and looked through a bunch and am coming up empty as well but this would be the right track. From your description we would have to be fairly certain the firmware would support whatever symbol set needed and perhaps even the same character mapping. I would hope it would be standardized but...

I can setup a bitmap file (jpg I know for sure) and it will print it. I would hate to for several reasons. The paper that this is to be printed on is mandated and "secure". I feel anything other than a character would violate this, BUT if it was JUST the character and it did not blot out the background OR it can be built "raster" which I think are kind of like putting together pixels. Then it may pass. The raster would be preferable because it would be independent of a particular file and alleviate maintaining the file on a share etc.

Anything easy? I think unless there is a gem or golden nugget the cost benefit ration is rapidly declining.
0
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 39903767
My suggestion would be to just print Rx and see if that's good enough. (Explain the complexity and be sure to include how much money it would cost them to maintain the more complicated version (round up)).
0
 

Author Comment

by:mike1142
ID: 39903797
That is where I started, I guess fitting I ended there as well. It would have been nice to find a way and then abstract it for my colleagues. I am also working on some reverse engineering of some libraries whose functions I can expose programatically but what do they do is another question. They have attempted to obfuscate these but maybe not really well.

I will leave this open until later today.

Thanks
0
 
LVL 16

Expert Comment

by:DansDadUK
ID: 39903868
Having said all that I said about different characters sets, and the mechanism used on (LaserJet) printers to map character sets/codes to Unicode code-points, there is a PCL mechanism which allows:

Direct selection of the Unicode symbol set (18N).
Setting the printer text parsing mode to a special multi-byte mode (not documented in the PCL5 Technical Reference manual), rather than single byte mode.

I think (can't remember) that this then involves sending 16-bit character codes using UTF-8 encoding.

I'm sure I've got a PCL sample file demonstrating this somewhere; if I get time in the next day or so, I'll try to find it and attach it to another reply.

... and of course it will only work if the selected font include the glyph (character shape) you are interested in; very few (if any) printer fonts contain anything but a small subset of the Unicode range.
0
 

Author Comment

by:mike1142
ID: 39903909
DansDadUK,

Thank you I would appreciate this. In my line of work I should be much more versed in this type of thing so I appreciate everyone's effort at education as well as answer. For the most part I extract and manipulate the data, presentation has not been as much of an issue and going outside what the programming language supports has not been high on the list. Now this vendor as well as third parties like us are increasingly being asked to support more of the nitty gritty clinical side of the house and in this realm a picture is worth many thousands of words.
0
 
LVL 16

Expert Comment

by:DansDadUK
ID: 39904104
Attached is file x01.prn (disguised with an extra .txt extension to allow it to be attached here),

It is a very simple PCL job, illustrating use of UTF-8 encoded data in the print stream.

But it will only work with printers which support these sequences; I've sent the contents of the file to two local printers:

LaserJet Pro 400 MFP M475dn; supports these sequences, and prints just a single character (the Prescription Take character) using the printer-resident Arial font.
LaserJet 1320n; does not support these sequences, and prints the character as a lower-case a with tilde accent character; I think this character was printed because the UTF-8 sequence representing U+211E is 0xE2849E, and only the first of these (0xE2) matches a character in the default 8-bit symbol set (0N = ISO-8859/1) configured on this printer.

The content of the file (character and hexadecimal) is as follows:
Offset       Hexadecimal                                       Text            
-----------  ------------------------------------------------  ----------------

0000000000   1b 45 1b 26 75 36 30 30 44 1b 26 6c 32 36 61 30   .E.&u600D.&l26a0
0000000016   6f 30 73 31 6c 30 45 1b 26 61 30 4c 1b 28 31 38   o0s1l0E.&a0L.(18
0000000032   4e 1b 28 73 31 70 31 35 76 30 73 30 62 31 36 36   N.(s1p15v0s0b166
0000000048   30 32 54 1b 26 74 38 33 50 1b 2a 70 36 30 30 78   02T.&t83P.*p600x
0000000064   36 30 30 59 e2 84 9e 1b 45                        600Y....E

Open in new window


... and an intepretation of the PCL is as follows:
Offset         Type                   Sequence          Description
-------------  ---------------------  ----------------  ----------------------------------------------------

0000000000     PCL Simple             <Esc>E            Printer Reset
0000000002     PCL Parameterised      <Esc>&u600D       Unit-of-Measure (600 PCL units per inch)
0000000009     PCL Parameterised      <Esc>&l26a        Page Size: A4
0000000015                                   0o         Orientation: Portrait
0000000017                                   0s         Simplex/Duplex: Simplex
0000000019                                   1l         Perforation Skip: Enable
0000000021                                   0E         Top Margin (0 lines)
0000000023     PCL Parameterised      <Esc>&a0L         Left Margin (column 0)
0000000028     PCL Parameterised      <Esc>(18N         Primary Font: Symbol Set (18N = Unicode)
0000000033     PCL Parameterised      <Esc>(s1p         Primary Font: Spacing: Proportional
0000000038                                   15v        Primary Font: Height (15 points)
0000000041                                   0s         Primary Font: Style (Upright, solid)
0000000043                                   0b         Primary Font: Stroke Weight: Medium
0000000045                                   16602T     Primary Font: Typeface (16602 = Arial)
0000000051     PCL Parameterised      <Esc>&t83P        Text Parsing Method: UTF-8
0000000057     PCL Parameterised      <Esc>*p600x       Cursor Position Horizontal (600 PCL units)
0000000064                                   600Y       Cursor Position Vertical   (600 PCL units)
0000000068     UTF-8 data                               [U+211e]
0000000071     PCL Simple             <Esc>E            Printer Reset

Open in new window

x01.prn.txt
0
 
LVL 16

Expert Comment

by:DansDadUK
ID: 39904160
One other point to note is that Lucinda Sans Unicode is not a standard printer-resident font on LaserJet printers, so if told to use that particular font, printer drivers will do one of three things:

Select a printer-resident font which the driver thinks may be a close-match substitute - of course, it may be nothing like!
Dynamically generate and download a PCL encapsulated soft font equivalent of (the used subset of) the selected workstation (TrueType) font; the font (and the subsequent text characters) are likely to be 'obfuscated' to make it more difficult to 'steal' the font (fonts, like other software, are licensed).
Convert the text into a bitmap image, and download this as a PCL format raster- image.
0
 

Author Comment

by:mike1142
ID: 39904208
Thank you very much!

I think this is was I was after the whole time e2 84 9e at offset 68,69 and 70 == decimal 226,132,158

I'll test and let you know.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:mike1142
ID: 39904285
If you can direct me a little more. I might be able to get this on my own but... The usual procedure for this kind of thing is to "push" the cursor send the commands and the "pop" the cursor.

I think of stacks, but this is not a concept that is prevalent in this language like others.
0
 
LVL 16

Expert Comment

by:DansDadUK
ID: 39904593
Not sure what you're uncertain of, or why the reference to stacks.

PCL5 is not a stack-based language (unlike PostScript, which is stack-based, and PCL XL, which uses some of the concepts).

Having said that, PCL5 does maintain stacks for some objects, like cursor position, patterns, etc., although these are rarely used.

For cursor position, there are two sequences, one to Push (store) the current cursor position, the other to Pop (recall) the previously stored value.

Attached is file x02.prn (disguised with an extra .txt extension to allow it to be attached here), which is a modification of the previous file,

The difference is that:
Some ordinary text is printed at a particular cursor position.
The current cursor position is then stored.
The text parsing mode is changed, and the UTF-8 character printed at a completely different cursor position.
The previous cursor position is recalled.
Some additional ordinary text is printed (and will be concatenated with the original text because of the cursor restore).
Note that this additional text is actually parsed as UTF-8 (because I've neglected to change the text parsing mode back to single-byte), but it makes no difference in this case, because ASCII characters have the same 1-byte value in the UTF-8 representation.

An analysis of the file interprets it thus:
Offset         Type                   Sequence          Description
-------------  ---------------------  ----------------  ----------------------------------------------------

0000000000     PCL Simple             <Esc>E            Printer Reset
0000000002     PCL Parameterised      <Esc>&u600D       Unit-of-Measure (600 PCL units per inch)
0000000009     PCL Parameterised      <Esc>&l26a        Page Size: A4
0000000015                                   0o         Orientation: Portrait
0000000017                                   0s         Simplex/Duplex: Simplex
0000000019                                   1l         Perforation Skip: Enable
0000000021                                   0E         Top Margin (0 lines)
0000000023     PCL Parameterised      <Esc>&a0L         Left Margin (column 0)
0000000028     PCL Parameterised      <Esc>(18N         Primary Font: Symbol Set (18N = Unicode)
0000000033     PCL Parameterised      <Esc>(s1p         Primary Font: Spacing: Proportional
0000000038                                   15v        Primary Font: Height (15 points)
0000000041                                   0s         Primary Font: Style (Upright, solid)
0000000043                                   0b         Primary Font: Stroke Weight: Medium
0000000045                                   16602T     Primary Font: Typeface (16602 = Arial)
0000000051     PCL Parameterised      <Esc>*p600x       Cursor Position Horizontal (600 PCL units)
0000000058                                   600Y       Cursor Position Vertical   (600 PCL units)
0000000062     Data                                     text part1
0000000072     PCL Parameterised      <Esc>&f0S         Cursor Position Stack: Push (Store)
0000000077     PCL Parameterised      <Esc>&t83P        Text Parsing Method: UTF-8
0000000083     PCL Parameterised      <Esc>*p600x       Cursor Position Horizontal (600 PCL units)
0000000090                                   1800Y      Cursor Position Vertical   (1800 PCL units)
0000000095     UTF-8 data                               [U+211e]
0000000098     PCL Parameterised      <Esc>&f1S         Cursor Position Stack: Pop (Recall) 
0000000103     UTF-8 data                               ...text part2
0000000116     PCL Simple             <Esc>E            Printer Reset

Open in new window

x02-.prn.txt
0
 

Author Comment

by:mike1142
ID: 39904852
Sorry. I was looking for the information you just gave about the cursor position. I'll have to play with it more because the print manager in "normal" mode essentially ignores the printer commands and when in "passthru" mode I get reams of paper with different characters.

It's going to be trial and error so I appreciate your time.
0
 

Author Comment

by:mike1142
ID: 39905473
OK, well in the end I simply have to have a way to represent the character as decimal 1-255 and there does not appear to be a code/character set/page to do it.

A custom font is an option as is a bitmap but no "nirvana" for me.
0
 
LVL 16

Expert Comment

by:DansDadUK
ID: 39905846
>> ... I simply have to have a way to represent the character as decimal 1-255 ...

I take it from this comment that the Unicode/UTF-8 mechanism does not appear to be supported by your printer manager and/or target printer?


>> ... and there does not appear to be a code/character set/page to do it ...

You could create a user-defined symbol set which includes your required character at an otherwise unused code-point (use the Symbol Set Generate tool in the PCL Paraphernalia application (available via http://www.pclparaphernalia.eu ) to do this), then include that definition in the PCL sent to your printer, together with a sequence to select that symbol set prior to the (8-bit) code which represents the target character in that symbol set.

As before, this will only work if your printer manager and printer support the sequences involved in this mechanism.  


>> ... A custom font is an option as is a bitmap ...

If your printer manager and printer support it, you can use the Soft Font Generate tool in the PCL Paraphernalia application to generate a soft font (in PCL Encapsulated TrueType Outline format); you'd need to first generate a custom symbol set (as per above) to use with the tool (so that the generated font included the required character(s)), but you wouldn't need to download the symbol set definition to the printer, only the font.

As before, this this will only work if your printer manager and printer support the sequences involved in the mechanism of downloading and selecting a PCLETTO soft font.
0
 
LVL 16

Expert Comment

by:DansDadUK
ID: 39906621
>> ... the print manager in "normal" mode essentially ignores the printer commands
>>     and when in "passthru" mode I get reams of paper with different characters ...

The "passthru" mode results seem to imply that whatever you've passed through has corrupted the print stream, and the printer (or perhaps the printer manager, about which we know very little) has "lost its way".
0
 

Author Comment

by:mike1142
ID: 39907620
OK. I do not mean to keep you hanging but I need to do more testing and just not getting to it today.

Does it make sense that after sending the commands to change the text parsing that when I send what I think are the codes to print the Rx symbol that instead it prints what I imagine are the actual values of decimal 226,132,158 and not a combination of these? When I send these to the output after sending the sequence you mentioned I get an accented "a" two ",," only bigger and something else I do not remember?

I think I am back to the original question. From your files x01.prn The key piece I was looking for was the sequence of values sent after the last command which ended 600Y and the end EscE reset. These values were e2 84 9e which I converted to decimal and sent that way.

I am trying to do step-wise refinement like I learned on programming 101 is there a way to pare down the command sequences to strictly what I need to send to get the results I am looking for? The font sequence definitely works as it changes the font for the rest of the output. The cursor positioning at least partially works where I can change the X axis but it does not appear to change the Y axis.

Something is working, I am not sure exactly what. The object code created adds its own printer commands and I can try an insert the code at a point where it is the least likely to have "helped" before it executes.

Does that make sense?
0
 
LVL 16

Expert Comment

by:DansDadUK
ID: 39909081
... Does it make sense that after sending the commands to change the text parsing that when I send what I think are the codes to print the Rx symbol that instead it prints what I imagine are the actual values of decimal 226,132,158 and not a combination of these? When I send these to the output after sending the sequence you mentioned I get an accented "a" two ",," only bigger and something else I do not remember? ...

This implies one of three things:

You have sent the correct sequences to select the Unicode symbol set, and the UTF-8 parsing mode, but your print manager and/or printer do not support this mechanism.
You have not sent the correct sequences prior to the UTF-8 encoded data bytes.
You have sent the correct sequences, but the application and/or printer-manager have modified one or more of the bytes, effectively corrupting the print stream.
0
 
LVL 16

Expert Comment

by:DansDadUK
ID: 39909113
is there a way to pare down the command sequences to strictly what I need to send to get the results I am looking for?

For the original Unicode / UTF-8 mechanism, the minimum you'd need to send, in terms of ASCII characters, is:
.(18N.(s1p15v0s0b16602T.&t83P.*p600x600Y...

Open in new window

where the "."s represent characters which are not ASCII graphic characters.
You may want to change the X and/or Y cursor positions.
You may want to change the font selection sequence (the above selects 15-point Arial Regular).


In hexadecimal terms, this is:
1b 28 31 38 4e 1b 28 73 31 70 31 35 76 30 73 30 62 31 36 36 30 32 54 1b 26 74 38 33 50 1b 2a 70 36 30 30 78 36 30 30 59 e2 84 9e

Open in new window



I'll leave you to do the conversion to decimal (rather than hexadecimal) codes, if that's all your application supports.
0
 

Author Comment

by:mike1142
ID: 39910001
where the "."s represent characters which are not ASCII graphic characters.

That's really what the question was the whole time. What do I send instead of the "."'s? It appears as though the application is only able to send ASCII characters or the "decode" of an integer that represents an ASCII character. Last night I came across some additional documentation and the decode function is used mainly to send non-printable characters to the output device "This capability is most useful for representing sequences of non-printing characters that cannot be represented as literals or constants (such as the bell character)". One of the top uses of this function is to send ASCII 10 and 13 as CRLF. 0 and 127 are used frequently which denote the beginning and end of a RAF.

When I saw in your output the last "command" (600Y hex 59) I assumed what came after was the sequence that would represent the RX symbol "e2 84 9e" which I converted to decimal to suit my capabilities.

Are there any utilities to capture the print stream at various points? Ideally I know the prt that the print manager listens on and can use a packet sniffer to see what is sent application to print manger from there I would like to compare that to what is sent to the print spooler.

At any rate I will try the above and move the code execution to and see if I can cause "it" to print at an XY coordinate first and then the rest of the print stream would hopefully print around it.
0
 
LVL 16

Expert Comment

by:DansDadUK
ID: 39910067
My previous post showed the hexadecimal equivalent of the ASCII text.

In this, the first byte is hexadecimal 1B (which is the non-graphic "Escape" control-code character; hex 1B = decimal 27.

The three bytes after the "Y" are indeed the UTF-8 representation of the character you want, but do not have this meaning unless preceded by the escape sequences I've shown in the example.

All you have to do is convert each of the hexadecimal values to decimal, and output those using your application.

I've no idea whether or not you can capture the output at any point: that would depend on the features offered by your application and printer manager software.
0
 

Author Comment

by:mike1142
ID: 39910838
I've no idea whether or not you can capture the output at any point: that would depend on the features offered by your application and printer manager software.

OK maybe to make this clearer. The application sends output the the print manager. I am not sure and you would of course not know how to intercept this data stream. The print manager is then used to communicate with the windows print manger. It would be nice to know what the windows print manager is seeing before it converts it to EMF. This would apply to any application that communicates with the windows printing system but I am not sure if there is any practical implementation of this. I am just trying to follow the print chain.
0
 
LVL 16

Expert Comment

by:DansDadUK
ID: 39910907
Why would your stream be converted to EMF?

I would have thought (especially as you are potentially inserting printer-specific control sequences into the stream) that it should be treated as RAW printer data, and just passed direct to the printer; i.e. the Windows spooler is only involved in ROUTING the stream, but not in FORMATTING it.

But then (as you say) I have no real knowledge of either your print manager, or your printer, so perhaps you ARE sending the stream (including inserted sequences) through a Windows driver? If so, then this could possibly be corrupting the inserted sequences, which it would not normally expect to encounter.
0
 

Author Comment

by:mike1142
ID: 39911012
I just want to say first that you have been great and a fountain of information. You are a credit to this forum I do appreciate your help.

I would have thought (especially as you are potentially inserting printer-specific control sequences into the stream) that it should be treated as RAW printer data, and just passed direct to the printer; i.e. the Windows spooler is only involved in ROUTING the stream, but not in FORMATTING it.

So that is the part of the knowledge gap. I did some more looking and found a slide show entitled "why our customers are so aggravated with the printing process and what to do about it" - tongue firmly in cheek. One slide in particular shows the chain to the printer which shows the application print manger passing off data to the Windows print manger and then through the driver form there. I suspect the real purpose of the print manger is to provide a mechanism for viewing the output. Printing can be managed from the viewer as well.

I know this information is a bit late to the party which is why a started this entry off the way I did.
0
 
LVL 16

Expert Comment

by:DansDadUK
ID: 39911153
Does this print manager software have a name?
0
 

Author Comment

by:mike1142
ID: 39911185
It does but I am hesitant to mention the vendor's name as the executables and all of the associated libraries are proprietary and are not open to the public or in use by a large number of customers.
0
 
LVL 16

Accepted Solution

by:
DansDadUK earned 500 total points
ID: 39912186
If your final output is actually going via a Windows printer instance, then you may be able to capture the output; do one or the other of:

Change the port associated with the printer instance to FILE:
Set up a new printer instance, using the same driver as the original one, but specifying port = FILE:, then change your printer manager application to point to this new instance.

On the system running the spooler & driver, when a print request is received, there should be a pop-up via which the target capture (.prn) file can be identified.

Once a print job has been captured to such a file, it can be analysed using the PRN File Analyse tool in the PCL Paraphernalia application, available via http://www.pclparaphernalia.eu
0
 

Author Comment

by:mike1142
ID: 39914031
DansDadUK

Thank you for your help I did learn a lot.
0
 

Author Closing Comment

by:mike1142
ID: 39914032
Above and beyond
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now