Introduzione
La console 8.4 3 e successive tra le varie funzioni, offre la possibilità di generare un'immagine per un codice a barre e di associarla a un campo della console. Questa funzione è utile quando in una newsletter si vuole inserire un codice a barre ad esempio per uno sconto o una promozione legata a un prodotto.
La pagina frontend di sui parleremo sotto (barcode.aspx), andrà ad eseguire il render e a stampare l'immagine del codice a barre, a partire da una sequenza numerica /alfa numerica recuperata dinamicamente su "IdOptin" e argomenti "hash", passati alla pagina.
Questa pagina, per stampare correttamente il codice a barre, richiede la sequenza numerica, precedentemente salvata in uno dei campi di informazioni personali della console . Questo requisito è stato introdotto al fine di impedire l'utilizzo fraudolento delle URL e dei relativi codici a barre generati.
Barcode.aspx risiede nella "frontend" root di ogni console 8.3 o versione successiva e non memorizzao salva nessuna delle immagini barcode sullo spazio fisico della "console". Questo al fine di evitare il sovraccarico del serveserver.
This frontend page will render and print out a barcode image, starting from a numeric/alpha numeric sequence dynamically retrieved upon "IdOptin" and "Hash" arguments passed to the page.
This page requires the numeric sequence to be previously stored in one of the personal information fields in order to run.
This requirement was introduced in order to prevent fraud URL usage or any kind of exploitation of the service.
Barcode.aspx resides in the "frontend" root of each 8.3 console or later version and does not store or save any of the rendered barcode images on the "console" storage disk so that the server burden will be kept at its lowest.
Notes : when viewed from your console's rad editor, the barcode will be displayed with a default value.
URL
It can be referenced straight away from the "src" property of a HTML IMG tag using a pattern:
Base URL
Note |
---|
Dall'editor della console, il codice a barre sarà visualizzato con il suo valore di default. |
Come generale l'URL
Può essere riferita direttamente dal "src" di un HTML tag usando :
Url di base
http://<consoleurl>/frontend/Barcode.aspx
Complete Url With completa con Params
<img src=http://<ConsoleHost>/frontend/Barcode.aspx?idoptin=[_idoptin]&hash=[_hash]&BarcodeHeight=60&SymbologyId=14&NarrowBarWidth=2&bearerbarsmode=0&BitmapTargetFormat=1&Ratio=0&TargetDynField=[LatestShippedOrderID]&FontHeight=0,2 /> Note : the above sample requests a i2of5 formatted barcode
Note |
---|
L'esempio sopra, richiede un codice a barre i2of5 formattato ( SymbologyId = 14 ), |
...
REQUEST PARAMETERS ( Table 1)
...
Name
...
Mandatory?
...
Description
...
IdOptIn
...
y
...
Recipient User Id
...
Hash
...
y
...
Recipient hash unique value
...
BarcodeHeight
...
y
...
Barcode image height in pixels
...
SymbologyId
...
y
...
l'impostazione di 60px di altezza e un font di 0.2. Ciascuna simbologia ha il suo settaggio specifico (dalla lunghezza della sequenza numerica, partirà la sua costruzione) |
Note |
---|
Non dimenticare di sostituire <consolehost> con l'URL reale della tua console MailUp e di riempire il campo destinatario LatestShippedOrderID con un vero codice a barre numerico. Il campo symbology 14 lo puoi riempire con una lunghezza qualsiasi. |
Esempio di Output di un codice a barre
Qi sotto un esempo di Interleaved 2 of 5 realizzato da una sequenza a 14 digits
Parametri richiesti ( Tabella 1)
Nome | Obbligatorio? | Descrizione |
---|---|---|
IdOptIn | y | User Id destinatario |
Hash | y | Hash destinatario |
BarcodeHeight | y | Altezza (in px) dell'immagine codice a barre |
SymbologyId | y | Id rappresentante il formato codice a barre ( 14 = ITF ) |
TargetDynField | yThe dynamic field containing the numeric barcode sequence | Il campo dinamico contenente la sequenza numerica barcode |
NarrowBarWidth | n | Width Larghezza (in pixel of the ) della narrow bar |
BearerBarsmode | n | It sets what bearers bars the barcode will display Imposta quali le barre di tolleranza il codice a barre utilizza ( 0 = NoneNessuno, 1 = HorizontalOrizzontale, 2 = Full Intera ) |
BearerBarsSize | n | Width in pixels of the bearers bars ( applies only if Larghezza (in pizel) della barre di tolleranza ( si applica solo se BearerBarsmode > 0 ) |
Ratio | n | The times the wide bar will be displayed for each Il numero di volte la wide bar sarà visualizzata per ciascun narrow bar |
ChecksumAdd | nThis | Boolean defines if the numeric sequence needs to be completed with a computed check digit ( default is QuestoBoolean definisce se la sequenza numerica deve essere completata con una cifra di controllo calcolata ( default è false ) |
IsNumberVisible | nIf true, it displays the input numeric sequence underneath | the barcodeSe true, visualizza la sequenza numerica di ingresso sotto il codice a barre |
FontHeight | nFont | height Altezza font in points, use comma as decimal markpunti, usare il punto come separatore |
Symbology format Id reference (
...
Tabella 2 )
SymbologyId | Symbology name |
---|---|
1 | Codabar |
2 | Code11 |
3 | Code128 |
4 | Code39 |
5 | Code39Ext |
6 | Code93 |
7 | Code93Ext |
8 | Deutsche Post Ident Code |
9 | Deutsche Post Leit Code |
10 | Ean218 |
11 | Ean13 |
12 | Ean14 |
13 | Ean8 |
14 | Interleaved 2 of 5 |
15 | ITF14 |
16 | Msi |
17 | Numly |
18 | Opc |
19 | Planet |
20 | Postnet |
21 | Pzn |
22 | Royal Mail 4 state |
23 | Royal Tnt Post Kix |
24 | Industrial 2 of 5 |
25 | Singapore post 4 State |
26 | SSCC18 |
27 | Swiss Post Parcel |
28 | UPCA |
29 | UPCE |
30 | USP Sack label |
31 | USP Tray label |
...
- Now it's time to fill the Image tag "src "property with the actual barcode module path : barcode image path must always display an absolute path : <img src="PASTE HERE YOUR BARCODE URL PREVIOUSLY COPIED FROM NOTEPAD" />
- Click on Save. Now you should be seeing the barcode rendered in the preview window as below
...