Zebra Wireless Printer Model Number - zebra-printers

Is there any way to query the printer for it's model number? For example I want to distinguish between a QL420+, a QL320, and a QL320 plus. It doesn't appear that there is either a ZPL or SGD to query for this.

! U1 getvar "usb.device.product_string"

Related

How to Get some text from the variable in ZPL Command

i have created a simple zpl program. My program Using call a variable, connect with database and uploading in web, this program example:
^XA
^JMA
^PR2
^~SD20
^BY3
^LH20,10
^FO155,152^BY2^BCN,40,N,N,N^FD$USIM$^FS
^A0N,30,30^FO155,197^CI0^FH_^FDNo.SimCard:$USIM$^FS
^PQ1,0,1,Y
^XZ
And result after printing is like
*"Barcode"*
No.Simcard:123456789
My case is how to take just a few numbers in the variable at $USIM$, like a function on the LET that can take several digits from a variable, for example
LET A$="Zebra Quality Printers"
LET B$=A$(1:13)
PRINT B$
Zebra Quality
I want to be able to in my program is only take last 3 digits at $USIM$
*"BARCODE"*
No.Simcard:789
I read the Zebra documentation and it only can in ZBL command, how to convert or make it work in ZPL command ?
Please Help me,
Thank you in advance

Other options to resize barcode for zebra printer using ZPL?

I want to print a Code 128 barcode with a Zebra printer. But I just can't get exactly where I want because the barcode is either too small or too big for the label size of 40x20 mm. Is there anything else I can try besides using the ^BY (Bar Code Field Default) module width and ratio?
^XA^PQ2^LH0,0^FS
^MUM
^GB40,20,0.1,B^FS
^FO1.5,4
^BY0.2
^BCN,10,N,N
^FD*030493LEJCG002999*^FS
^FO8,15
^A0N,3,3
^FD*030493LEJCG002830*^FS
^MUD
^XZ
Above script gives me a label that looks like this:
But when I just decrease the module width to 0.1 (which is the lowest) the barcode becomes too small and may be problematic to scan with a hand scanner:
Code-128 is a fixed-ratio code, so you would appear to have the choice of two sizes. You may be able to solve the problem by using a 300dpi printer in place of a 200.
If you can change the format (and I'm intrigued by the barcode and readable being different values) then you could save a little by printing one number-sequence and one alpha-sequence, as an even count of numerics will be encoded as alphabet C so you'd save one change-alphabet element.
Do you really need the * on each end?
Otherwise, perhaps code 39 (which prints the * if you use the print-interpretation-line option) would suit your purposes better.
Another Possibility is to do on the fly code-set changes, Try something like
^XA^PQ2^LH0,0^FS
^MUM
^GB60,20,0.1,B^FS
^FO1.5,4
^BY0.2
^BCN,10,N,N
^FD>:*>5030493>6LEJCG>5002830>6*^FS
^FO8,15
^A0N,3,3
^FD*030493LEJCG002830*^FS
^MUD
^XZ
This will allow less symbols to encode your data
If you can structure content to have all the alpha chars a one end or the other.
or (Depending on your firmware) you could use auto ^BCN,10,N,N,N,A

How to create a Printer object in VB

I am facing an issue in VB 6 while creating a Printer Object.
Basically, I need to create a printer object so that I can set the correct tray on which printing needs to be performed.
I have the Printer Name with me.
All the code that I am able to find online involves looping through all the available printers and finding a match with our printer name.
Is there a way I can create the Printer object prn directly from the Printer name.
Any help would be appreciated.
You can't. The VB6 Printers collection is accessed only by index, not by name. See Visual Studio 6 Printer Object, Printers Collection.
So you have to search the collection for the printer you want. For instance:
Private Function FindPrinter(PrinterName As String) As Printer
Dim i As Integer
For i = 0 To Printers.Count - 1
If Printers(i).DeviceName = PrinterName Then
Set FindPrinter = Printers(i)
Exit For
End If
Next i
Exit Function
End Function
The above doesn't handle the situation where the printer you're looking for isn't in the collection. You'll want to add logic to cover that condition - what you'll want to do is specific to your particular tasks and requirements. This example is also a case-sensitive name search, so keep that in mind, too.

Reverse Phone Number Lookup Without Country Code

I have been using googles libphonenumber to perform validation of US phone numbers. Now I am needing international support for all countries. Is it possible to reverse lookup a phone numbers country code using libphonenumber?
Say the DB has saved UK number +448456779463. Is it possible to libphonenumber to detect if that number is UK? It appears I can only check the validity of the number provided I know its country of origin first. But what to do if you have numbers and don't know its country of origin?
Twilio's Lookup tool can likely be of some help here.
It will return a country code based upon number input alone and you can retrieve additional information about a phone via the API.
https://www.twilio.com/docs/api/lookups
[Disclosure: I work for Twilio]
You can do it using libphonenumber.
Following is example in python
import phonenumbers
number = "+44XXXXXXXX"
obj = phonenumbers.parse(number)
# get line type
phonenumbers.number_type(obj)
# validate phone
phonenumbers.is_valid_number(obj)
# validate phone for region
phonenumbers.is_valid_number_for_region(obj, "GB")
# get country name
from phonenumbers.geocoder import country_name_for_number
country_name_for_number(obj, "en")
I think following is what you looking exactly,
from phonenumbers.geocoder import region_code_for_number
phonenumbers.is_valid_for_region(obj, region_code_for_number(obj))

iphone's phone number splitting algorithm?

iPhone has a pretty good telephone number splitting function, for example:
Singapore mobile: +65 9852 4135
Singapore resident line: +65 6325 6524
China mobile: +86 135-6952-3685
China resident line: +86 10-65236528
HongKong: +886 956-238-82
USA: +1 (732) 865-3286
Notice the nice features here:
- the splitting of country code, area code, and the rest is automatic;
- the delimiter is also nicely adopted to different countries, e.g. "()", "-" and space.
Note the parsing logic is doable to me, however, I don't know where to get the knowledge of most countries' telephone number format.
where could i found such knowledge, or an open source code that implemented it?
You can get similar functionality with the libphonenumber code library.
Interestingly enough, you cannot use an NSNumberFormatter for this, but you can write your own custom class for it. Just create a new class, set properties such as countryCode, areaCode and number, and then create a method that formats the number based on the countryCode.
Here's a great example: http://the-lost-beauty.blogspot.com/2010/01/locale-sensitive-phone-number.html
As an aside: a friend told me about a gigantic regular expression he had to maintain that could pick telephone numbers out of intercepted communications from hundreds of countries around the world. It was very non-trivial.
Thankfully your problem is easier, as you can just have a table with the per-country formats:
format[usa] = "+d (ddd) ddd-dddd";
format[hk] = "+ddd ddd-ddd-dd";
format[china_mobile] = "+dd ddd-dddd-dddd";
...
Then when you're printing, you simply output one digit from the phone number string in each d spot as needed. This assumes you know the country, which is a safe enough assumption for telephone devices -- pick "default" formats for the few surrounding countries.
Since some countries have different formats with different lengths you might need to store your table with additional information:
format[germany][10] = "..."
format[germany][11] = "....."

Resources