Generating Custom Bar Codes in Advanced Templates

You can edit the HTML markup source of your advanced template to add a custom bar code or QR code for any custom transaction you require. For example, you can create a custom bar code on a warehouse picking ticket. With a bar code scanner, a warehouse employee can retrieve relevant inventory information needed to complete the order.

In the Advanced Template Editor, edit the HTML markup source and use the BFO tag <barcode /> to create a custom bar code. For more information about editing the source code, see Source Code Editing in the Template Editor.

Warning:

Do not modify markup source directly unless you have sufficient CSS and HTML knowledge. NetSuite does not provide support or training in CSS or HTML.

Be aware that the template editor may not function properly if you switch back to WYSIWYG mode after you have made edits in markup source mode. Some template content may not be represented correctly, may not be accessible for editing, or may not be displayed at all.

If these issues occur, you can preserve template content by not saving the template in WYSIWYG mode and switching back to markup source mode.

To add a custom bar code to an advanced template:

  1. Open the advanced template in the template editor and click the Source Code toggle.

  2. Scroll down to the portion of the HTML markup source where you want to create a bar code. Add the following code to the template and specify the codetype, showtext, and value parameters as required.

                  <barcode codetype="qrcode" showtext="false" height="150" width="150" value="http://www.example.com/" /> 
    
                
Note:

Your custom bar code will not be visible in the Advanced Template Editor. You must generate a report using your template to see the bar code.

Parameter

Type

Required/Optional

Description

codetype

string

required

Specify the bar code algorithm used to generate the bar code. For a list of supported bar code algorithms, see the following table.

showtext

boolean

true | false

required

If set to true, a readable version of the value is printed below the bar code.

If set to false, no readable information is displayed.

Note: The following bar code types do not display the printed values below the bar code: aztec, deutchepostmatrix, intelligentmail, maxicode, pdf417, postnet, qrcode, and rm4scc.

value

string

required

Specify the information you want to encode using the bar code algorithm. Use the following table to determine which bar code type meets your requirements. Each bar code type requires specific content length and supports specific characters.

For example, you can encode a URL in an aztec , maxicode, or qrcode by setting the value to "http://www.example.com". Alternatively, you can encode a serial number in a upca, postnet , or code25 bar code by setting the value to "0123456789".

Note: If value contains characters that are not supported by the bar code algorithm, your template can generate an error. Confirm that the bar code algorithm supports the requirements of the value string.

height

number

optional

Specify the height of the bar code in pixels. The height parameter can be ignored by some bar code algorithms.

Note: The height parameter is required for the qrcode.

width

number

optional

Specify the width of the bar code in pixels. The width parameter can be ignored by some bar code algorithms.

Note: The width parameter is required for the qrcode.

The following bar code algorithms are supported by advanced templates and the BFO report generator. For more information about each bar code type, see http://bfo.com/products/report/docs/userguide.pdf.

codetype

Type

Supported Characters

Length

Example (with showtext = true)

aztec

2D matrix

  • Full ASCII

  • FNC1 and ESI control codes

12 — 3832

Sample aztec barcode

codabar

Linear

  • Numbers 0–9

  • Symbols : — . $ / +

Variable

Note: Requires a Start and Stop character

Use one of the following characters for the Start and Stop character: A, B, C, D, E, *, N, T

Sample codabar barcode

code25

Linear

  • Numbers 0–9

Variable

Sample code25 barcode

code25checksum/code25deutschenpost

Linear

  • Numbers 0–9

Variable

Sample code25checksum barcode

code39

Linear

  • Uppercase letters A-Z

  • Number 0–9

  • Symbols — . $ / + % Space

Variable

Sample code39 barcode

code39checksum

Linear

  • Uppercase letters A-Z

  • Number 0–9

  • Symbols — . $ / + % Space

Variable

Sample code39checksum barcode

code128

Linear

  • Full ASCII

  • Control Codes

Variable

Sample code128 barcode

databar

Linear

  • Number 0–9

14 Maximum

Sample databar barcode

datamatrix

2D matrix

  • Full ASCII

2335 Maximum

Sample datamatrix barcode

deutchepostmatrix

2D matrix

  • Full ASCII

2335 Maximum

Sample deutchepostmatrix barcode

ean8

Linear

  • Numbers 0–9

7 + checkdigit

Sample ean8 barcode

ean13/upca

Linear

  • Numbers 0–9

13+ checkdigit

Sample ean13/upca barcode

intelligentmail

2D height

  • Numbers 0–9

20, 25, 29, or 31 digits

Sample intelligentmail barcode

maxicode

2D matrix

  • Full ASCII

Maximum 92 ASCII characters

Sample maxicode barcode

pdf417

2D stacked

  • Full ASCII

Maximum 1850 ASCII characters or 2725 numeric characters

Sample pdf417 barcode

postnet

Linear

  • Numbers 0–9

5, 9, or 11 + check digits

Sample postnet barcode

qrcode

2D matrix

  • Full ASCII

Maximum 1520 ASCII characters or 2509 numeric characters

Sample qrcode barcode

rm4scc

2D height

  • Uppercase letters A-Z

  • Number 0–9

Variable

Sample rm4scc barcode

Related Topics

Source Code Editing in the Template Editor
Source Code Editing to Customize Advanced Templates
Syntax for Advanced Template Fields
Setting a Template to Use a Font Unavailable in NetSuite
Languages for Printed Forms that Use Advanced Templates
Adding Striping to Line Items in Advanced Templates
Adding Page Breaks to Tables
Printing Subsidiary Logo on Advanced Templates
Adding Apply Sublist to Check Templates
Using FreeMarker to Work with Hidden Fields Used in Advanced Templates
Adding Bar Codes in Advanced Templates

General Notices