> For the complete documentation index, see [llms.txt](https://docs.yansalabs.com/barcode-and-qr-code-generator/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yansalabs.com/barcode-and-qr-code-generator/technical-docs/building-a-barcode-label/barcode-parts.md).

# Barcode Parts

**Barcode Parts** are the individual components that comprise a barcode label - they are child records of your [**Barcode Generator**](/barcode-and-qr-code-generator/technical-docs/building-a-barcode-label/barcode-generator.md). Depending on your use-case, a barcode label may be a single barcode element, or it may be a combination of barcodes, HTML, text, and images.

{% hint style="info" %}
When building a barcode label to use within our [PDF Generator integration](/barcode-and-qr-code-generator/technical-docs/printing-pages-w-multiple-labels.md), we recommend creating a **Barcode Generator** with a single **Barcode Part** that is the barcode or QR code component, and then using PDF Generator to add any additional content.
{% endhint %}

In most cases, you will create new **Barcode Part** records from the Related List on the **Barcode Generator** form. This ensures they are properly linked to the parent Barcode Generator.

<figure><img src="/files/1lvKAUBW6LyDJRIuaNX3" alt=""><figcaption><p>Barcode Parts Related List</p></figcaption></figure>

Depending on the type of **Barcode Part** you create, you will find different options on the form.

<div><figure><img src="/files/SDsob6oPfvDYlST4gRYu" alt=""><figcaption><p>QR/Barcode</p></figcaption></figure> <figure><img src="/files/xJzpfemgY5Nx5rPmFGJG" alt=""><figcaption><p>HTML</p></figcaption></figure> <figure><img src="/files/Y7SHjgf4in6ziTzl5Dsu" alt=""><figcaption><p>Text/Spacer</p></figcaption></figure></div>

### QR/Barcode

**Basic**

* **Format**: Select the barcode type you wish to generate. Most popular barcode formats are included, but Yansa Labs can add any additional format you require. If you don't see the format you need, contact us at [Yansa Labs Support](mailto:support@yansalabs.com).
* **Height (in)**: Height of the generated barcode, in inches
* **Alignment**: Where to position the barcode within its container
* **Value**: The value to encode. Many barcode formats are constrained in what data they can encode. The app will highlight under the **Format** field what type of data is valid for the format you select. See hint below for information on dynamic/programmatic content.

**Advanced**

* **Show value**: Whether or not to show the unencoded value beneath the barcode. ***Note**: You can improve performance of barcode generation by leaving this unchecked and instead displaying the barcode value using an HTML or Text/Spacer type of Barcode Part instead.*
* **Hide if error**: Whether or not to hide the barcode element if an error occurs during barcode generation. If unselected, an error message will be shown. It can be useful to disable this during testing to help identify any barcode format/type data mismatches.
* **Color**: Hex RGB notation color for the barcode (#000000)
* **Include check digit**: Generate a check digit for a barcode, where applicable
* **Error correction level**: Level of redundancy to include in the QR code
* **Inkspread**: Amount by which to reduce bar module size to compensate for printer ink spread. This will effectively reduce bar size and increase white space between bars
* **Width (scale)**: Width scale of the barcode. Useful for increasing or decreasing barcode width while maintaining readability.
* **Server width multiplier (scale)**: When rendering server-side to PDF, barcode scale often doesn't match client-side scaling. This option allows you to enter a multipler to your specific server-rendered barcode part to achieve a closer match. Multiplier is applied after width scaling.
* **Additional options**: A JSON string including any additional options (or option overrides) compatible with BWIPP (for barcodes) or QRCode-SVG (for QR Codes).

### HTML

* **Alignment**: Where to position the barcode within its container
* **HTML**: HTML content to display. See hint below for information on dynamic/programmatic content.

### Text/Spacer

* **Size**: Size in pt to make the text or spacer
* **Alignment**: Where to position the barcode within its container
* **Value**: Text value to display (leave blank for spacer). See hint below for information on dynamic/programmatic content.

{% hint style="info" %}

### Content for Barcode Parts

For all types of Barcode Parts, the **Value** or **HTML** field can include static, dynamic, and programmatic content.

* **Static**: Simple text, images, etc
* **Dynamic**: Data pulled from the record that the **Barcode Generator** references. Use {handlebar} brackets to insert data by field name into your Value. For example, on the Asset table:
  * To display the asset tag number, use *{asset\_tag}*
  * To display the Assigned to person's location, use *{assigned\_to.location}*
* **Programmatic**: Run-time generated value from server-side Javascript. Use a value in {handlebar} brackets starting with 'javascript:' to insert these into your value. For example:
  * To display the current date/time, use *{javascript:new GlideDateTime().getDisplayValue();}*
    {% endhint %}

Use the **Order** field on each **Barcode Part** to determine the order in which the parts are displayed on your barcode label. They will be displayed in ascending order, either top-to-bottom or left-to-right, depending on whether your **Barcode Generator** orientation is 'Vertical' or 'Horizontal'.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.yansalabs.com/barcode-and-qr-code-generator/technical-docs/building-a-barcode-label/barcode-parts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
