Re: PCL images and mvEnterprise




<rsine@xxxxxxxxxxxxxxxxxxx> wrote
I uploaded the hex and used the mvEnterprise XTD function to convert to
decimal then CHAR to get the Ascii character. I tried outputting the
data to the printer but got a lot of garbage but nothing remotely
looking like an image. Should I print each character individually or
as a string? Any help is appreciated.

Look at what happens when that ascii character is a CHAR(255) -- that is a
pick SEGMENT MARK if memory serves me, and _bad_things_happen_.

Instead of doing
PRINTER ON
IN.PAIR = '41' ; GOSUB 1000 ;
PRINT CHAR(OUT.BYTE) :

to print the letter "A" {'A' is hex 41}, try just doing
PRINTER ON
DUMMY = OCONV('41','U3f')

Similarly, drawing a rectangular strip
5 inches wide by 30 dots (0.1 inch) tall could be done by
PRINTER ON
ESC = CHAR(27)
PRINT ESC:"*c":5*300:"a30b0P":
or by instead sending the equivalent hex pairs string
PRINTER ON
STR = '1A 2A 63 31 35 30 30 61 33 30 62 30 50' ; * esc:'*c1500a30b0P'
CONVERT " " TO "" IN STR ;* ditch the blanks
DUMMY = OCONV(STR,'U3f')
The U3F user exit isn't needed for THIS simple graphic, but is the safe way to
print when doing arbitrary picture data, since the potential nasty 'ff' byte
exists as a binary segment mark only briefly, inside the user exit U3f
module registers, where it is tolerated nicely. It never gets put into a Basic
string variable as a char(255), hence no problems with Pick getting freaked.

Also, I seem to recall pick used to send out null chars for time delays to help
old printers/terminals work properly, so disable this by doing
TERM ,,,0,0 in USER-COLDSTART before you do STARTPTR or whatever.

Start by printing this demo, and gradually replace it with more complex hunks
of your converted graphics hex stream. You'll want to find a good reference
book on the escape strings honored by laserjets.

If you need more help at this stage, remember you've wandered off-topic for
this Pick forum, so consider asking over in group comp.sys.hp.hardware or
comp.periphs.printer for the more laserjet-intensive advice.


Sorry about this long post, of negligable general interest, guys.


.



Relevant Pages

  • injection_projection code
    ... because of hex encoding. ... a row in the template. ... Sanitize string to protect against email header injection. ... void injection_protection(char *s) ...
    (freebsd-isp)
  • Re: String to byte[] -- I cant get there from here?
    ... I need to convert these to a byte array of hex values. ... Each char contains two bytes. ... high nibble of each byte. ... Repeat for each char in the String. ...
    (comp.lang.java.programmer)
  • Re: How to construct a string with bunch of hex numbers?
    ... to construct a string with those hex numbers? ... No. I'd like to have a string like "xyzabc" and each ASCII char corresponds ... to a hex number. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to convert hex to string?
    ... Private Function DecodeHex(ByVal HexString As String) As String ... it will treat that as a hex number when it parses it. ... It then gets the ASCII character ...
    (microsoft.public.dotnet.languages.vb)
  • Re: HEX char -- > its comlement
    ... the char on the right (I want to complement an hexadecimal string, ... If there is something able to map in one shot a whole string ... to its "complement" would be even better. ... Anyway, you must convert back and forth, from hex to integer to hex ...
    (microsoft.public.dotnet.languages.vb)