BarcodeURL
This function generates a barcode image URL using the specified arguments.
Arguments
BarcodeURL(1,2,3,4,5,6,7,8,9)
Ordinal | Type | Required | Description |
---|---|---|---|
1 | String | True | Value to convert into a barcode |
2 | String | True |
Type of barcode to generate. Valid barcode symbology values include:
|
3 | Number | True | Barcode image width in pixels |
4 | Number | True | Barcode image height in pixels |
5 | String | False | Checksum value for barcode |
6 | Boolean | False | Display value from Ordinal 1 under barcode |
7 | String | False | Alternate text to display under the barcode if Ordinal 6 is false
|
8 | Number | False | Orientation of barcode in degrees. Valid values are 0 , 90 , 180 and 270
|
9 | Boolean | False | Use a transparent background color |
NOTE:
Codabar
requires anA
prefix and aB
suffix.NOTE:
Mat25
,OneCode
,PlainText
,Planet
,Postnet
andTelepen
symbologies do not render properly in the current release of Salesforce Marketing Cloud. This should be resolved in a future release.
Example
%%[
var @Codabar
var @Code11
var @Code128A
var @Code128Auto
var @Code128B
var @Code128C
var @Code39
var @Code39Ext
var @Code93
var @Code93Ext
var @DataMatrix
var @Ean13
var @Ean8
var @Industr25
var @Interl25
var @Mat25
var @MSI
var @OneCode
var @PDF417
var @PlainText
var @Planet
var @Postnet
var @Telepen
var @UPCa
var @UPCe
var @val_generic
var @val_codabar
var @val_ean13
var @val_ean8
var @val_mat25
var @val_onecode
var @val_planet
var @val_postnet
var @val_telepen
set @val_generic = "12345678901"
set @val_codabar = "A2030405060B"
set @val_ean13 = "1234567890123"
set @val_ean8 = "12345678"
set @val_mat25 = "0123456785678"
set @val_onecode = "0123456709498765432101234567891"
set @val_plaintext = "12345678901"
set @val_planet = "55555-1234"
set @val_postnet = "55555-1234"
set @val_telepen = "ABC123"
set @Codabar = BarcodeURL(@val_codabar, "Codabar", 100, 50)
set @Code11 = BarcodeURL(@val_generic, "Code11", 100, 50)
set @Code128A = BarcodeURL(@val_generic, "Code128A", 100, 50)
set @Code128Auto = BarcodeURL(@val_generic, "Code128Auto", 100, 50)
set @Code128B = BarcodeURL(@val_generic, "Code128B", 100, 50)
set @Code128C = BarcodeURL(@val_generic, "Code128C", 100, 50)
set @Code39 = BarcodeURL(@val_generic, "Code39", 100, 50)
set @Code39Ext = BarcodeURL(@val_generic, "Code39Ext", 100, 50)
set @Code93 = BarcodeURL(@val_generic, "Code93", 100, 50)
set @Code93Ext = BarcodeURL(@val_generic, "Code93Ext", 100, 50)
set @DataMatrix = BarcodeURL(@val_generic, "DataMatrix", 100, 100)
set @Ean13 = BarcodeURL(@val_ean13, "Ean13", 100, 50)
set @Ean8 = BarcodeURL(@val_ean8, "Ean8", 100, 50)
set @Industr25 = BarcodeURL(@val_generic, "Industr25", 100, 50)
set @Interl25 = BarcodeURL(@val_generic, "Interl25", 100, 50)
set @Mat25 = BarcodeURL(@val_mat25, "Mat25", 100, 50)
set @MSI = BarcodeURL(@val_generic, "MSI", 100, 50)
set @OneCode = BarcodeURL(@val_onecode, "OneCode", 100, 50)
set @PDF417 = BarcodeURL(@val_generic, "PDF417", 100, 50)
set @PlainText = BarcodeURL(@val_generic, "PlainText", 100, 50)
set @Planet = BarcodeURL(@val_planet, "Planet", 100, 50)
set @Postnet = BarcodeURL(@val_postnet, "Postnet", 100, 50)
set @Telepen = BarcodeURL(@val_telepen, "Telepen", 100, 50)
set @UPCa = BarcodeURL(@val_generic, "UPCa", 100, 50)
set @UPCe = BarcodeURL(@val_generic, "UPCe", 100, 50)
]%%
<table border="1" cellpadding="3" cellspacing="0" style="font: 11px sans-serif; ">
<tr><th>Symbology</th><th>Sample</th><th>Output</th></tr>
<tr><td>Codabar</td><td>%%=v(@val_codabar)=%%</td><td><img src="%%=v(@Codabar)=%%"></td></tr>
<tr><td>Code11</td><td>%%=v(@val_generic)=%%</td><td><img src="%%=v(@Code11)=%%"></td>
<tr><td>Code128A</td><td>%%=v(@val_generic)=%%</td><td><img src="%%=v(@Code128A)=%%"></td></tr>
<tr><td>Code128Auto</td><td>%%=v(@val_generic)=%%</td><td><img src="%%=v(@Code128Auto)=%%"></td></tr>
<tr><td>Code128B</td><td>%%=v(@val_generic)=%%</td><td><img src="%%=v(@Code128B)=%%"></td></tr>
<tr><td>Code128C</td><td>%%=v(@val_generic)=%%</td><td><img src="%%=v(@Code128C)=%%"></td></tr>
<tr><td>Code39</td><td>%%=v(@val_generic)=%%</td><td><img src="%%=v(@Code39)=%%"></td></tr>
<tr><td>Code39Ext</td><td>%%=v(@val_generic)=%%</td><td><img src="%%=v(@Code39Ext)=%%"></td></tr>
<tr><td>Code93</td><td>%%=v(@val_generic)=%%</td><td><img src="%%=v(@Code93)=%%"></td></tr>
<tr><td>Code93Ext</td><td>%%=v(@val_generic)=%%</td><td><img src="%%=v(@Code93Ext)=%%"></td></tr>
<tr><td>DataMatrix</td><td>%%=v(@val_generic)=%%</td><td><img src="%%=v(@DataMatrix)=%%"></td></tr>
<tr><td>Ean13</td><td>%%=v(@val_ean13)=%%</td><td><img src="%%=v(@Ean13)=%%"></td></tr>
<tr><td>Ean8</td><td>%%=v(@val_ean8)=%%</td><td><img src="%%=v(@Ean8)=%%"></td></tr>
<tr><td>Industr25</td><td>%%=v(@val_generic)=%%</td><td><img src="%%=v(@Industr25)=%%"></td></tr>
<tr><td>Interl25</td><td>%%=v(@val_generic)=%%</td><td><img src="%%=v(@Interl25)=%%"></td></tr>
<tr><td>Mat25</td><td>%%=v(@val_mat25)=%%</td><td><img src="%%=v(@Mat25)=%%"></td></tr>
<tr><td>MSI</td><td>%%=v(@val_generic)=%%</td><td><img src="%%=v(@MSI)=%%"></td></tr>
<tr><td>OneCode</td><td>%%=v(@val_onecode)=%%</td><td><img src="%%=v(@OneCode)=%%"></td></tr>
<tr><td>PDF417</td><td>%%=v(@val_generic)=%%</td><td><img src="%%=v(@PDF417)=%%"></td></tr>
<tr><td>PlainText</td><td>%%=v(@val_generic)=%%</td><td><img src="%%=v(@PlainText)=%%"></td></tr>
<tr><td>Planet</td><td>%%=v(@val_planet)=%%</td><td><img src="%%=v(@Planet)=%%"></td></tr>
<tr><td>Postnet</td><td>%%=v(@val_postnet)=%%</td><td><img src="%%=v(@Postnet)=%%"></td></tr>
<tr><td>Telepen</td><td>%%=v(@val_telepen)=%%</td><td><img src="%%=v(@Telepen)=%%"></td></tr>
<tr><td>UPCa</td><td>%%=v(@val_generic)=%%</td><td><img src="%%=v(@UPCa)=%%"></td></tr>
<tr><td>UPCe</td><td>%%=v(@val_generic)=%%</td><td><img src="%%=v(@UPCe)=%%"></td></tr>
</table>
Output
Symbology | Sample | Output |
---|---|---|
Codabar | A2030405060B | |
Code11 | 12345678901 | |
Code128A | 12345678901 | |
Code128Auto | 12345678901 | |
Code128B | 12345678901 | |
Code128C | 12345678901 | |
Code39 | 12345678901 | |
Code39Ext | 12345678901 | |
Code93 | 12345678901 | |
Code93Ext | 12345678901 | |
DataMatrix | 12345678901 | |
Ean13 | 1234567890123 | |
Ean8 | 12345678 | |
Industr25 | 12345678901 | |
Interl25 | 12345678901 | |
Mat25 | 123456785678 | |
MSI | 12345678901 | |
OneCode | 0123456709498765432101234567891 | |
PDF417 | 12345678901 | |
PlainText | 12345678901 | |
Planet | 55555-1234 | |
Postnet | 55555-1234 | |
Telepen | ABC123 | |
UPCa | 12345678901 | |
UPCe | 12345678901 |