Document Options- Search & Replace for Markem x60
I have a layout file for a Markem X60 coder and I need to use a date format, which the BarTender driver does not support directly. So, I try to use a Search & Replace on the whole document, before it is sent to the printer.
The old format string I find in the PRN file is %j[0,0,3,0] and I want to replace it with @d[1,0,5,0], but the replace fails completely.
On closer inspection of the direct, unchanged, output file I find that the encoding of the file changes halfway through from UTF-8 (plain ASCII) to UTF-16, which a clever editor like Notepad++ compensates for but looking in hex-mode becomes apparent:
Note that starting with the <Envelope> element the encoding is suddenly 2 bytes per character.
And I cannot for the life of me work out how to make a "simple" replacement like this work:
All suggestions are welcome!
-
Peter Thane
★ BarTender Hero ★
When and how are you trying to apply the Search and Replace (ie from which screen are you accessing this)?
0 -
Harald Rauch
★ BarTender Hero ★
Hi Peter Thane
I am using the BarTender Document Options to catch the print file before it is sent to the print spooler.
Is there another possibility?
0 -
Peter Thane
★ BarTender Hero ★
I do not think that Action works that way and I believe that only triggers when you are exporting the code/layout as Printer Code Template and not printing directly from BarTender. Looking at the Help it suggests you maybe able to achieve this via VB instead when printing but not a clue how or the script required, sorry
0 -
Harald Rauch
★ BarTender Hero ★
Hi Peter Thane,
the action does fire for normal printing, but I cannot get the desired result. In one case I find the string with the binary zeros in between and replace it with my content, but that is then normal ASCII code. If I remove all the binary zeros first, then do the replacement, the printer does not accept the content anymore.
It really would be nice to be able to specify a printer specific date format string. If only I could get my head round the Printer Code Template fields, that might offer a solution.
0
Please sign in to leave a comment.
Comments
4 comments