I am trying to use Zebra Printer for printing in French.
The problem which I face is as below.
I want to print in French using Zebra MZ220.
The characters will be dynamic
Zebra's programming manual mentions below
COUNTRY USA
TEXT 4 0 0 8 COUNTRY IS USA
TEXT 4 0 0 15 #$#[]^‘{|}~
will print
COUNTRY IS USA
#$#[]^‘{|}~
When I have to print in French, I have to use the command as below.
COUNTRY FRANCE
TEXT 4 0 0 28 COUNTRY IS FRANCE
TEXT 4 0 0 35 #$#[]^‘{|}~
which will print as
COUNTRY IS FRANCE
//corresponding french characters//
Now, how can I directly send the French characters instead of sending replacement characters?
I have banged my head all around to get an answer with no luck.
Please help.
I'd use some sort of mapping function to perform the translation. You'd call it with what you want to print and it would return what you need to send to get that output, or tell you if that's not possible.
The details depend on the programming language.
Related
I have a thermal printer "MPT-II" from an unknown Chinese brand, that has both USB and Bluetooth. I can successfully print text using:
Loyverse app on Android
JavaScript
Raw HEX or decimal
However, only using the Loyverse app am I able to input special characters, and by special characters I mean the Danish characters æøå/ÆØÅ.
If I open up any BLE tool on Windows (Bluetooth LE Lab for example), I can select the correct characteristic and send something like 104 101 108 108 111 13 10 which would print "hello" on the printer. I've read a bit about the ESC R and ESC t commands, but how exactly do I set those modes? I've tried prepending it to each command, such as 27 82 1 104 101 108 108 111 13 10 where the 27 82 1 corresponds to ESC R 4 and the 4 corresponds to Denmark I.
According to the printer's manual, it states the following:
GB18030 character set, ASCII characters, user defined characters, bar codes CODE39, EAN13, EAN8, CODABAR, CODE93, ITF, bitmaps.
According to that list, the Danish character set is not supported. I'm not sure how the Loyverse app is doing it correctly, but the text is the same using raw commands and Loyverse, so I don't think Loyverse is converting to a bitmap and sending that data.
So my real question is: How do I send the correct character set for my printer? Maybe the character set is already correct, but the ASCII character for æøå/ÆØÅ are wrong?
EDIT: I have confirmed that something works with the ESC XXXX commands. If I do 27 97 2 followed by my "hello" sequence, the text is printed to the right (right aligned). So that definitely works.. I have tried probably all character sets thus far using ESC R and ESC t but none of them work :(
EDIT 2: I have now tested every single combination of ESC R and ESC t. I went through the entire list printing some Chinese characters, and every single line of 150+ I tried all returned the same Chinese character. So ESC R or ESC t is definitely not the command I should be using to change the charset.
I have RTF Template and I need to show words of total amount in Arabic
for example :
Total Amount : 136,369.58
English Format : ONE HUNDRED THIRTY-SIX THOUSAND THREE HUNDRED SIXTY-NINE AND FIFTY-EIGHT
Arabic Format : مائة وستة وثلاثون ألفًا وثلاثمائة وتسعة وستون ريال وثمانية وخمسون هلله
I used xdoxslt:toCheckNumber($_XDOLOCALE, sum(COLUMN_NAME), ‘EUR’, ‘CASE_UPPER’, ‘DECIMAL_STYLE_WORDS’) to get English Format and it worked fine for English but does not work for Arabic.
I tried many google links to get Arabic Format but I got nothing.
This working fine , I guess. Good Luck
Remove the space between the first < and ?
< ?xdoxslt:toCheckNumber('AR-SAR', FINAL_AMOUNT, 2)?>
Working on printing and encoding RFID labels with the Zebra ZD500R Printer.
Here is my ZPL: The field data is F1001001, which i can encode and print on the label. However the EPC returned is F10010010000000000000000. How can i do one of 2 things. Either get the ZPL to 4 Bytes with no 0's or encode random hexadecimals at the front and my field data at the end?
My other question is how do make my field data increment and have both the RFID encoded tag and label match?
`^XA
^BCN,100,N,N
^FO30,50^FDF1001001^FS
^FO30,160^ADN,18,15^FDF1001001^FS
^FO30,220^ADN,10,20^^FD12/1/2024^FS
^FO30,260^ADN,10,20^^FDUYT 098^FS
^RFW,H^FDF1001001^FS
^RFR,H^FN11^FS
^FH^HV11,,EPC:[,]_0D_0A,L
^XZ`
I know I'm a bit late to the party but it might be useful if someone else stumbles over this post...
Try:
^RS8
^RFW,H,,,A^FD12345678^FS
When read with a RFID reader this will return the EPC code 12345678 without the trailing zeros (or encode random hexadecimals). For reference this was written to a tag using a Zebra ZQ511.
https://www.zebra.com/content/dam/zebra_new_ia/en-us/manuals/printers/common/programming/rfid3-pg-en.pdf
If you want to encode fixed EPC length, use the ^RF command with a length paramter :
Example 3: This example encodes 4 bytes of hexadecimal formatted data, starting in block 3
of Gen 2 EPC bank 1. (The ^RS command can be omitted for printers that use Gen 2 tag types
only.)
^XA
^RS8
^RFW,H,3,4,1^FD11112222^FS
^XZ
For incrementation, I suppose Zebra has a builtin variable management but I don't know how it works... But you are better calling the Zebra printer through an external program...
I am using the following page as a helper:
http://www.tharo.com/documents/tech582.htm
On that page the EPC is broken down into the bits that need to be passed to the printer in ZPL.
Based off that I have used the following ZPL and sent it to the printer:
^XA
^RB96,8,3,3,20,24,38^FS
^RFW,E^FD48,3,5,0614141,100041,1^FS
^XZ
Unfortunately I do not get the same EPC written to the tag as outlined in the document.
Update: I am using the Zebra iOS SDK to encode the tags. In their documentation the ZPL is all in one line.
I would look to the authoritative standards for this one. See the TDS Standard from GS1 (p92 and p132) for details on the format, and the ZPL programming manual for the printer.
To summarize, the data you are encoding is:
Header: SGTIN-968 bits, decimal 48
Filter: 33 bits, decimal 3
Partition: 24 bit company / 20 bit item3 bits, decimal 5
Company: 061414124 bits, decimal 0614141
Item: 10004120 bits, decimal 100041
Serial: 138 bits, decimal 1
So the ZPL should be:
^XA
^RB96,8,3,3,24,20,38
^RFW,E^FD48,3,5,0614141,100041,1^FS
^XZ
Note that there is no ^FS between ^RB and ^RF, and that partition 5 mandates 24,20. 20,24 would be partition 6. The ^RB is a comma separated list of the field widths, the ^FD is a comma separated list of the decimal field data. I will also note that filter 3 is "Reserved". I would imagine the filter you need to be 1.
I want to extract valid(on the basis of format) mobile numbers from a text.
e.g. I/O some text (987) 456 7890, (987)-456-7890 again some text
O/P 9874567890 9874567890
problem is, there are many valid mobile formats in all over world like.
text = "Denmark 11 11 11 11, 1111 1111 "
// + "Germany 03333 123456, +49 (3333) 123456 "
// + "Netherlands + 31 44 12345678 Russia +7(555)123-123 "
// + "spain 12-123-12-12 switzerland +41 11 222 22 22 "
// + "Uk (01222) 333333 India +91-12345-12345 "
// + "Austrailia (04) 1231 1231 USA (011) 154-123-4567 "
// + "China 1234 5678 France 01-23-45-67-89 "
// + "Poland (12) 345 67 89 Singapore 123 4567 "
// + "Thailand (01) 234-5678, (012) 34-5678 "
// + "United Kingdom 0123 456 7890, 01234 567890 "
// + "United States (987) 456 7890, (987)-456-7890+ etc."
How to cover all mobile formats?
min and max length of the mobile numbers(with or without country code)?
how to recognize that mobile number has country code or not?
You might want to check if this fits your needs: A comprehensive regex for phone number validation
By experience I know how this works in my phone OS. It looks at a long enough sequences of digits, separated by a set of allowed chars.
In principle something like:
[\+]?([0-9]|[\(\).- ]){min,max}
This regex is suboptimal since it also looks for long sequences of separator chars. You will probably need to filter those results out as well.
A very simple method with some false positives, but false positives are IMPO better than misses.
You shouldn't use the list of samples you got as a guide to actual mobile phone numbers.
For example the number sequence shown for the Netherlands is incorrect, in that it doesn't cover just mobile numbers but ALL regular phone numbers (it doesn't cover such things as 0800 and 0900 numbers for which different rules apply) and is missing an element even for that.
I can only assume the list is similarly incorrect for other countries (and of course it's far from complete in that it doesn't cover all countries, but maybe you posted only a fragment).
To parse a phone number you'd have to first remove all white space and other formatting characters from what could be a phone number, then check whether it has the correct length to be one, then try to deduce whether it includes a country code or not.
If it includes a country code but doesn't start with either 00 or + (both are used to indicate an international number) it might not be a phone number after all.
Does it include an area code? If so, is the area code one associated with mobile phones (for example in the Netherlands all mobile phone numbers have area code 06, BUT in the past this wasn't always the case so if you have an old document a 06 area code may not be a mobile number anyway.
After you've deduced that (and AFAIK mobile numbers always include an area code) you have to check if the remaining numbers make up something that could be an actual phone number without area code based on the length of the number (hint: area code + numer together have to be 10 long here, and I think everywhere).
And all that while taking into consideration that the rules may well be different for different countries or even different networks within some countries.
And of course if you find a number that looks like a valid phone number it still may not be.
It could be some other number that just looks like a phone number but isn't.
Simple search of all matching string formats in this case is not right way. The optimal way is using Regular Expressions to find all matches of phone numbers, but Blackberry java don't have built-in capabilities to process Regular Expressions.
But you can use 3-rd party library for J2ME implementing RegEx processing, smth. like this.
// Regex - Check Singapore valid mobile numbers
public static boolean isSingaporeMobileNo(String str) {
Pattern mobNO = Pattern.compile("^(((0|((\\+)?65([- ])?))|((\\((\\+)?65\\)([- ])?)))?[8-9]\\d{7})?$");
Matcher matcher = mobNO.matcher(str);
if (matcher.find()) {
return true;
} else {
return false;
}
}