Hi Jerry, Hi Bas
I think I can help with this, with your permission.
IMAGE indeed can fit or resize but cannot control the source. I understand Bas's question because I have designed some inventory integrated systems.
Steps:
Design (parameters, patterns, symbology spectrum, choose code) -
Generate code locally (add in) or remotely (IMAGE for transport) -
Transfer solution (monitor display, printer, label printer, ink jet, laser) -
Scan and report (mobile app scan in Excel directly)
Based on transfer solution it is mandatory to control densities, resolutions, units, dimensions, formats of the code by its inception process. Margin of errors 0 (zero errors allowed)
The technicality of barcodes is tremendous, and any project gets extremely specific solutions adapted to extremely specific requirements. In real life. A solution for any code in existence is not taken into consideration.
Golden Rule:
The pattern returned when you scan a code should be identical with the pattern that generated that code.
Professional site for all this:
TEC-IT Software for Barcodes/QR/2D Codes, Mobile Scanning, Labels
I do not have access now to my old project files, so I rewrote a very simple function that was designed when IMAGE function emerged, to be user friendly and versatile enough for simple scenarios.
The function deals only with 3 of the 2D codes:
QR Code - best symbology spectrum
Data Matrix - good for small labels, good data density (jewelry)
Aztec - still readable if code damaged in some proportion, harsh environments
regex symbology spectrum:
Aztec : [ !"#$%&'()*+,-.\/0-9:;<=>?@A-Z\[\\\]^_`a-z{|}~]+
DataMatrix: ^[ !\"#$%&'()*+,-.\\/0-9:;<=>?@A-Z\\[\\\\\\]^_`a-z{|}~]{1,2335}$
QR: ^.{1,65535}$
The function:
QR((x,[ty],[oz])([wu],[w],[dpi],[f])
x: sample or array of patterns to be coded
[ty] : code type: -1, toggle btw showing results and list table of argument values ; 0 or omitted QR,1 DataMatrix, 2 Aztec
[oz] : original size : if omitted or 0 fit cell ; 1 orig size (like in image fction argument sizing)
code inception parameters at the source embedded in the URL string:
[wu] :module width unit : 0 or omitted fit ; 1 min ; 2 mm ; 3 mils ; 4 pixels
[w] : module width : if wu fit or min, any value is ignored otherwise numeric value (list show minimal values examples for dif. units)
[dpi] : dots per inch, if omitted 96 (values btwn 96-600)
[f] : image format : 0 or omitted gif ; 1 jpg ; 2 png ; 3 svg
Excel Formula:
=LAMBDA(x, [ty], [oz],
LAMBDA([wu], [w], [dpi], [f],
LET(
v, {
"( , | type|", "|orig.size )", "( mod.unt|", "|mod.wdth|", "|DPI |", "|img.frm )";
"-1 legend", "0-fit cell", "0-fit", "-", "96 (df)", "0-gif";
"0-QR", "1-orig.size", "1-min", "-", "600(max)", "1-jpg";
"1-DtMtrx", "", "2-mm", "0.257 -", "", "2-png";
"3-Aztec", "", "3-mils", "10.102-", "", "3-svg";
"", "", "4-pix", "1 -", "", ""
},
IF(
ty = -1,
v,
LET(
z, SWITCH(ty, 0, "QRCode", 1, "DataMatrix", 2, "Aztec"),
a, SWITCH(wu, 0, "fit", 1, "min", 2, "mm", 3, "mils", 4, "px"),
b, IF(dpi, dpi, 96),
c, SWITCH(f, 0, "gif", 1, "jpg", 2, "png", 3, "svg"),
IMAGE("https://barcode.tec-it.com/barcode.ashx?data=" & x & "&code=" & z & "&unit=" & a & "&dpi=" & b & "&imagetype=" & c & "&rotation=0&eclevel=L&modulewidth=" & w, , IF(oz, 2, 0))
)
)
)
)
)
Notes: numeric arguments corresponding to text arguments reduces input errors and keeps precision of the URL string values
Sometimes it is "uncomfortable" to remember all arguments options when we call a function, especially for a composed lambda that does not even show the second group of arguments of second lambda. IntelliSense shows only the first group of arguments.
For this I have created toggle value -1 of
ty type argument to toggle btw the results and the entire table of arguments options.
Meanwhile
ty arg stays -1 you have the table of argument options in sight, choose all the arg you need and when you are done change ty to one of the other 3 posib and enjoy the result. Can not be handier than this.
Book1 |
---|
|
---|
| A | B | C | D | E | F | G | H | I | J |
---|
1 | | | | | | | | | | |
---|
2 | | data sample to be coded | | | | | | |
---|
3 | | 649735478|doihhvoidoi-240890098/kjhgfghj-rxdtcfvygubhij | | |
---|
4 | | 98767890|rtyuCTYVUBIN-9876578/FGHjkkjhg-ijuhygtfgyhujUYHGTFDFGHJ | | |
---|
5 | | | | | | | | | | |
---|
6 | | choose the arg values that you need with the table of arg options in sight, as long as ty=-1 |
---|
7 | | when you finish your choice, change ty value to see the results of your selection ( see next page ) |
---|
8 | | (0's corespond to the values if arg is omitted) | | | | | |
---|
9 | | =QR(B3:B4,-1)(2,1.53,100,1) | | | | | | |
---|
10 | | ( , | type| | |orig.size ) | ( mod.unt| | |mod.wdth| | |DPI | | |img.frm ) | | | |
---|
11 | | -1 legend | 0-fit cell | 0-fit | - | 96 (df) | 0-gif | | | |
---|
12 | | 0-QR | 1-orig.size | 1-min | - | 600(max) | 1-jpg | | | |
---|
13 | | 1-DtMtrx | | 2-mm | 0.257 - | | 2-png | | | |
---|
14 | | 3-Aztec | | 3-mils | 10.102- | | 3-svg | | | |
---|
15 | | | | 4-pix | 1 - | | | | | |
---|
16 | | | | | | | | | | |
---|
17 | | or show arg. table only before filling other arguments values | | | |
---|
18 | | =QR(,-1)() | | | | | | | |
---|
19 | | ( , | type| | |orig.size ) | ( mod.unt| | |mod.wdth| | |DPI | | |img.frm ) | | | |
---|
20 | | -1 legend | 0-fit cell | 0-fit | - | 96 (df) | 0-gif | | | |
---|
21 | | 0-QR | 1-orig.size | 1-min | - | 600(max) | 1-jpg | | | |
---|
22 | | 1-DtMtrx | | 2-mm | 0.257 - | | 2-png | | | |
---|
23 | | 3-Aztec | | 3-mils | 10.102- | | 3-svg | | | |
---|
24 | | | | 4-pix | 1 - | | | | | |
---|
25 | | | | | | | | | | |
---|
|
---|
images do not show on mini-sheet , see the screen capture
Book1 |
---|
|
---|
| A | B | C | D | E | F |
---|
1 | | | | | | |
---|
2 | | 649735478|doihhvoidoi-240890098/kjhgfghj-rxdtcfvygubhij | | |
---|
3 | | 98767890|rtyuCTYVUBIN-9876578/FGHjkkjhg-ijuhygtfgyhujUYHGTFDFGHJ | | |
---|
4 | | | | | | |
---|
5 | | with arguments that control widh units, width size, resolution, pic format | | |
---|
6 | | =QR(B2:B3,2,1)(2,1.53,100,1) | | | | |
---|
7 | | | | | | |
---|
8 | | | | | | |
---|
9 | | | | | | |
---|
10 | | all arguments ignored | | (isolate them like this to be easy to scan if you want to check them with your scanner) |
---|
11 | | =QR(B2:B3)() | | | | |
---|
12 | | | | | | |
---|
13 | | | | | | |
---|
14 | | | | | | |
---|
|
---|
I really hope that helps. It's the most basic stuff I can imagine, in real life I always recommend profesional assistance since things can really go ugly and nobody wants to be held responsible.