Bug Vb Script With Printer Code Modifiers With Dpl Raster Image Follow

0
Avatar
Legacy Poster

I first noticed this issue a year ago with Datamax printers (doesn't happen with Zebra). However, I dropped it when I found a way to do what I needed using only Action List.   

Now, I'm back with the same issue and I have to use the VBscript option.  Here's the bug:

 

When sending a job for a Datamax H-class printer, with rasterized fonts and images, the PCM.ReadLine and PCM.WriteLIne loop will strip out space characters that are part of the rasterized image data.  The printer then 'hangs' because the image is corrupted.  Only recourse is to reboot printer before printing anything else.  But I can never get a printjob with rasterized images to get past the PCM VBscript issue.

 

I've attached file output. One file prints fine without the VBScript operating, while the other hangs the printer.  Note the missing white spaces in the 2nd file.  Note also that the remaining white space characters in the 2nd file are actually tab characters.  The issue seems to be with ASCII 30 being either ignored during the PCM.ReadLine command or stripped before the PCM.WriteLine command.

 

Thanks for whatever help you can offer.

 

 

3 comments

0
Avatar
Legacy Poster
Comment actions Permalink

Sorry, space character (ASCII 32) - ASCII 30.

0
Avatar
Ian Cummings
Moderator
Comment actions Permalink

It seems to be the NUL value 0x00 that's getting dropped.

 

In any case, the ReadLine/WriteLine PCM methods can not be used on binary data because they work with strings and not bytes.  To do simple read and write of bytes the following should get you started:
 
Option Explicit

Dim byteBuf()
Dim codeSize, numRead, numWritten

codeSize = PCM.InputFileSize
numRead    = 0
numWritten = 0

ReDim byteBuf(codeSize)
numRead = PCM.ReadBytes(byteBuf, codeSize)
numWritten = PCM.WriteBytes(byteBuf, numRead)

 

You will need to write code to spin through the byte buffer and replace (or write out) the bytes desired.
0
Avatar
Legacy Poster
Comment actions Permalink

Thanks Ian,

 

I appreciate the info regarding PCM.ReadLine/WriteLine and binary data.  Because everything I do will include some level of binary data, it appears that I will never be able to use the PCM.WriteLine method.  

 

Thanks also for this code snippet staring point.  I think there's a need for more example code sets on the PCM help section of Bartender.  I'll see what I can accomplish from your starting point, and post a more generic solution.

 

Thanks again,

Please sign in to leave a comment.