ryanmckeever
New Member
Hope you are well...
I'm trying to develop some code which reads in a PRN file (generated by printing to a file in Bartender)
I have some replacement variable in here e.g. %pallet%
I replace these and write to a intermediate file
This works fine...
The problem is...
I have pretty much exactly the same PRN as before except I now have an image which has been encoded in the PRN file
When I run the code (see below) now it seems that the encoded image has been converted to straightforward text.
Anyone any ideas how to handle mixed text and binary type data?
OUTPUT STREAM ubi-501 TO VALUE(param08.matrix-nt_port).
INPUT STREAM file_input FROM VALUE(param08.label-spooler).
REPEAT:
IMPORT STREAM file_input UNFORMATTED cLine.
IF cline MATCHES "*%Factory%*"
THEN
cLine = REPLACE(cLine,"%Factory%",param08.label-prog).
IF cline MATCHES "*%Pallet%*"
THEN
cLine = REPLACE(cLine,"%Pallet%",STRING(pallet.unique_pallet,'9999999999')).
IF cline MATCHES "*%Date%*"
THEN
cLine = REPLACE(cLine,"%Date%",STRING(pallet.scan_date)).
IF cline MATCHES "*%PalletBar%*"
THEN
cLine = REPLACE(cLine,"%PalletBar%",STRING(s-co,'999') + STRING(pallet.unique_pallet,'9999999999')).
PUT STREAM ubi-501 UNFORMATTED cLine SKIP.
END.
INPUT STREAM file_input CLOSE.
OUTPUT STREAM ubi-501 CLOSE.
I'm trying to develop some code which reads in a PRN file (generated by printing to a file in Bartender)
I have some replacement variable in here e.g. %pallet%
I replace these and write to a intermediate file
This works fine...
The problem is...
I have pretty much exactly the same PRN as before except I now have an image which has been encoded in the PRN file
When I run the code (see below) now it seems that the encoded image has been converted to straightforward text.
Anyone any ideas how to handle mixed text and binary type data?
OUTPUT STREAM ubi-501 TO VALUE(param08.matrix-nt_port).
INPUT STREAM file_input FROM VALUE(param08.label-spooler).
REPEAT:
IMPORT STREAM file_input UNFORMATTED cLine.
IF cline MATCHES "*%Factory%*"
THEN
cLine = REPLACE(cLine,"%Factory%",param08.label-prog).
IF cline MATCHES "*%Pallet%*"
THEN
cLine = REPLACE(cLine,"%Pallet%",STRING(pallet.unique_pallet,'9999999999')).
IF cline MATCHES "*%Date%*"
THEN
cLine = REPLACE(cLine,"%Date%",STRING(pallet.scan_date)).
IF cline MATCHES "*%PalletBar%*"
THEN
cLine = REPLACE(cLine,"%PalletBar%",STRING(s-co,'999') + STRING(pallet.unique_pallet,'9999999999')).
PUT STREAM ubi-501 UNFORMATTED cLine SKIP.
END.
INPUT STREAM file_input CLOSE.
OUTPUT STREAM ubi-501 CLOSE.