# QREncodeParams Class

> Used to control how the QR code is created.

- Product: Adobe PDF Library 21
- Language: Modern C++
- Version: 21.4.0
- HTML page: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/QREncodeParams
- Version index: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/llms.txt

```cpp
class QREncodeParams
```

**Namespace:** `datalogics_interface`

## Description

Used to control how the QR code is created.

**Uses types:** [`QRColor`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/QRColor.md), [`QRErrorCorrectionLevel`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/enum/QRErrorCorrectionLevel.md)

## Constructors

### QREncodeParams

```cpp
datalogics_interface::QREncodeParams::QREncodeParams(const std::string &text, double x, double y, double width, double height, QRErrorCorrectionLevel error_level, unsigned int quiet_zone_size, const QRColor &code_color, const QRColor &background_color)
```

*constructor*

**Parameters**

- `text` (`const std::string &`): The text string to encode in the QR code.
- `x` (`double`): The X coordinate of the lower-left corner of the QR code on the page, in user space units.
- `y` (`double`): The Y coordinate of the lower-left corner of the QR code on the page, in user space units.
- `width` (`double`): The width of the QR code, in user space units.
- `height` (`double`): The height of the QR code, in user space units.
- `error_level` ([`QRErrorCorrectionLevel`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/enum/QRErrorCorrectionLevel.md)): The error correction level for the QR code.
- `quiet_zone_size` (`unsigned int`): The size of the quiet zone (margin) around the QR code, in modules.
- `code_color` ([`const QRColor &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/QRColor.md)): The color of the QR code modules (the dark elements).
- `background_color` ([`const QRColor &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/QRColor.md)): The color of the background behind the QR code modules.

Create a new QREncodeParams object using the specified values.

### QREncodeParams

```cpp
datalogics_interface::QREncodeParams::QREncodeParams(QREncodeParams &&) noexcept
```

*constructor*

**Parameters**

- (unnamed) ([`QREncodeParams &&`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/QREncodeParams.md))

### ~QREncodeParams

```cpp
datalogics_interface::QREncodeParams::~QREncodeParams()
```

*destructor*

## Methods

### get_background_color

```cpp
QRColor datalogics_interface::QREncodeParams::get_background_color() const
```

**Returns:** [`QRColor`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/QRColor.md)

Get the color of the background behind the QR code modules.

### get_code_color

```cpp
QRColor datalogics_interface::QREncodeParams::get_code_color() const
```

**Returns:** [`QRColor`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/QRColor.md)

Get the color of the QR code modules (the dark elements).

### get_error_correction_level

```cpp
QRErrorCorrectionLevel datalogics_interface::QREncodeParams::get_error_correction_level() const
```

**Returns:** [`QRErrorCorrectionLevel`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/enum/QRErrorCorrectionLevel.md)

Get the error correction level of the QR code.

### get_height

```cpp
double datalogics_interface::QREncodeParams::get_height() const
```

**Returns:** `double`

Get the height of the QR code, in user space units.

### get_quiet_zone_size

```cpp
unsigned int datalogics_interface::QREncodeParams::get_quiet_zone_size() const
```

**Returns:** `unsigned int`

Get the quiet zone size (margin around the QR code), in modules.

### get_text

```cpp
std::string datalogics_interface::QREncodeParams::get_text() const
```

**Returns:** `std::string`

Get the text string to be encoded in the QR code.

### get_width

```cpp
double datalogics_interface::QREncodeParams::get_width() const
```

**Returns:** `double`

Get the width of the QR code, in user space units.

### get_x

```cpp
double datalogics_interface::QREncodeParams::get_x() const
```

**Returns:** `double`

Get the X coordinate of the lower-left corner of the QR code on the page, in user space units.

### get_y

```cpp
double datalogics_interface::QREncodeParams::get_y() const
```

**Returns:** `double`

Get the Y coordinate of the lower-left corner of the QR code on the page, in user space units.

### operator=

```cpp
QREncodeParams & datalogics_interface::QREncodeParams::operator=(QREncodeParams &&) noexcept
```

**Parameters**

- (unnamed) ([`QREncodeParams &&`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/QREncodeParams.md))

**Returns:** [`QREncodeParams &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/QREncodeParams.md)

### set_background_color

```cpp
void datalogics_interface::QREncodeParams::set_background_color(const QRColor &color)
```

**Parameters**

- `color` ([`const QRColor &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/QRColor.md)): the color of the background behind the QR code modules

**Returns:** `void`

Set the color of the background behind the QR code modules.

### set_code_color

```cpp
void datalogics_interface::QREncodeParams::set_code_color(const QRColor &color)
```

**Parameters**

- `color` ([`const QRColor &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/QRColor.md)): the color of the QR code modules (the dark elements)

**Returns:** `void`

Set the color of the QR code modules (the dark elements).

### set_error_correction_level

```cpp
void datalogics_interface::QREncodeParams::set_error_correction_level(QRErrorCorrectionLevel level)
```

**Parameters**

- `level` ([`QRErrorCorrectionLevel`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/enum/QRErrorCorrectionLevel.md)): the error correction level of the QR code

**Returns:** `void`

Set the error correction level of the QR code.

### set_height

```cpp
void datalogics_interface::QREncodeParams::set_height(double height)
```

**Parameters**

- `height` (`double`): the height of the QR code, in user space units

**Returns:** `void`

Set the height of the QR code, in user space units.

### set_quiet_zone_size

```cpp
void datalogics_interface::QREncodeParams::set_quiet_zone_size(unsigned int size)
```

**Parameters**

- `size` (`unsigned int`): the quiet zone size (margin around the QR code), in modules

**Returns:** `void`

Set the quiet zone size (margin around the QR code), in modules.

### set_text

```cpp
void datalogics_interface::QREncodeParams::set_text(const std::string &text)
```

**Parameters**

- `text` (`const std::string &`): the text string to be encoded in the QR code

**Returns:** `void`

Set the text string to be encoded in the QR code.

### set_width

```cpp
void datalogics_interface::QREncodeParams::set_width(double width)
```

**Parameters**

- `width` (`double`): the width of the QR code, in user space units

**Returns:** `void`

Set the width of the QR code, in user space units.

### set_x

```cpp
void datalogics_interface::QREncodeParams::set_x(double x)
```

**Parameters**

- `x` (`double`): the X coordinate of the lower-left corner of the QR code on the page, in user space units

**Returns:** `void`

Set the X coordinate of the lower-left corner of the QR code on the page, in user space units.

### set_y

```cpp
void datalogics_interface::QREncodeParams::set_y(double y)
```

**Parameters**

- `y` (`double`): the Y coordinate of the lower-left corner of the QR code on the page, in user space units

**Returns:** `void`

Set the Y coordinate of the lower-left corner of the QR code on the page, in user space units.
