---
title: "QrImage – API-Referenz · Quittio"
description: "Renders QR codes as SVG data URIs for templates (no further dependency besides mpdf/qrcode)."
canonical_url: "https://quittio.dev/docs/api/Quittio/Core/Pdf/Qr/QrImage"
locale: de
meta:
  "og:description": "Renders QR codes as SVG data URIs for templates (no further dependency besides mpdf/qrcode)."
  "og:image": "https://quittio.dev/og/quittio-de.jpg"
  "og:image:alt": "Quittio: E-Rechnungen für PHP und Laravel. Rechtssicher, validiert, archiviert, mit geprüfter Beispielrechnung."
  "og:image:height": "630"
  "og:image:type": image/jpeg
  "og:image:width": "1200"
  "og:title": "QrImage – API-Referenz · Quittio"
  "twitter:image": "https://quittio.dev/og/quittio-de.jpg"
  "twitter:image:alt": "Quittio: E-Rechnungen für PHP und Laravel. Rechtssicher, validiert, archiviert, mit geprüfter Beispielrechnung."
---

> Index of every page on this site: [llms.txt](https://quittio.dev/llms.txt)

[API reference](https://quittio.dev/docs/api) / [Quittio](https://quittio.dev/docs/api/Quittio) \\ [Core](https://quittio.dev/docs/api/Quittio/Core) \\ [Pdf](https://quittio.dev/docs/api/Quittio/Core/Pdf) \\ [Qr](https://quittio.dev/docs/api/Quittio/Core/Pdf/Qr)

# QrImage

final class in quittio/core

`Quittio\Core\Pdf\Qr\QrImage` · [Source](https://github.com/Quittio/quittio/blob/v0.7.1/packages/core/src/Pdf/Qr/QrImage.php#L14)

Renders QR codes as SVG data URIs for templates (no further dependency besides mpdf/qrcode).

## Methods \#

| Method | Description |
| --- | --- |
| `::dataUri()` | Data URI for templates. PNG is preferred: mPDF turns SVG into form XObjects without resource dictionary, which violates PDF/A (clause 6.2.2). |
| `::png()` | |
| `::svg()` | |

### `dataUri()`#

```
public static function dataUri(
    string $payload,
    int $size = 400,
    'L'|'M'|'Q'|'H' $errorCorrection = 'M',
    bool $border = true,
): string
```

static

Data URI for templates. PNG is preferred: mPDF turns SVG into form XObjects without resource dictionary, which violates PDF/A (clause 6.2.2).

| Parameter | Type | Description |
| --- | --- | --- |
| `$payload` | `string` | |
| `$size` | `int` = `400` | |
| `$errorCorrection` | `'Quittio\Core\Pdf\Qr\L'\|'Quittio\Core\Pdf\Qr\M'\|'Quittio\Core\Pdf\Qr\Q'\|'Quittio\Core\Pdf\Qr\H'` = `'M'` | |
| `$border` | `bool` = `true` | with the quiet zone of four modules |

<dl><dt>Returns</dt>
<dd><code>string</code></dd>
</dl>

### `png()`#

```
public static function png(
    string $payload,
    int $size = 400,
    'L'|'M'|'Q'|'H' $errorCorrection = 'M',
    bool $border = true,
): string
```

static

| Parameter | Type | Description |
| --- | --- | --- |
| `$payload` | `string` | |
| `$size` | `int` = `400` | |
| `$errorCorrection` | `'Quittio\Core\Pdf\Qr\L'\|'Quittio\Core\Pdf\Qr\M'\|'Quittio\Core\Pdf\Qr\Q'\|'Quittio\Core\Pdf\Qr\H'` = `'M'` | |
| `$border` | `bool` = `true` | with the quiet zone of four modules |

<dl><dt>Returns</dt>
<dd><code>string</code></dd>
</dl>

### `svg()`#

```
public static function svg(
    string $payload,
    int $size = 200,
    'L'|'M'|'Q'|'H' $errorCorrection = 'M',
    bool $border = true,
): string
```

static

| Parameter | Type | Description |
| --- | --- | --- |
| `$payload` | `string` | |
| `$size` | `int` = `200` | |
| `$errorCorrection` | `'Quittio\Core\Pdf\Qr\L'\|'Quittio\Core\Pdf\Qr\M'\|'Quittio\Core\Pdf\Qr\Q'\|'Quittio\Core\Pdf\Qr\H'` = `'M'` | |
| `$border` | `bool` = `true` | with the quiet zone of four modules; without it the image is the code alone, e.g. for a code printed at a fixed size such as the 46 mm of the Swiss QR bill |

<dl><dt>Returns</dt>
<dd><code>string</code></dd>
</dl>

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://quittio.dev/#website","@type":"WebSite","description":"E-Rechnungen für PHP und Laravel: ZUGFeRD, XRechnung und Peppol erstellen, prüfen, lesen und archivieren.","inLanguage":"de-DE","name":"Quittio","url":"https://quittio.dev/","publisher":{"@id":"https://quittio.dev/#identity"},"workTranslation":{"@id":"https://quittio.dev/en#website"}},{"@id":"https://quittio.dev/docs/api/Quittio/Core/Pdf/Qr/QrImage#webpage","@type":"WebPage","description":"Renders QR codes as SVG data URIs for templates (no further dependency besides mpdf/qrcode).","name":"QrImage – API-Referenz","url":"https://quittio.dev/docs/api/Quittio/Core/Pdf/Qr/QrImage","isPartOf":{"@id":"https://quittio.dev/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://quittio.dev/docs/api/Quittio/Core/Pdf/Qr/QrImage"]}],"primaryImageOfPage":{"@id":"https://quittio.dev/#logo"}},{"@id":"https://quittio.dev/#identity","@type":"Organization","description":"Open-Source-Bibliothek für E-Rechnungen in PHP und Laravel (ZUGFeRD, XRechnung, Peppol) und Quittio Managed.","email":"kontakt@niklasforst.de","legalName":"Niklas Forst – Softwareentwicklung","name":"Quittio","url":"https://quittio.dev","founder":{"@type":"Person","name":"Niklas Forst","url":"https://quittio.dev/ueber"},"logo":{"@id":"https://quittio.dev/#logo"},"sameAs":["https://github.com/Quittio/quittio","https://packagist.org/packages/quittio/quittio"]},{"@id":"https://quittio.dev/#logo","@type":"ImageObject","caption":"Quittio","contentUrl":"https://quittio.dev/logo.png","inLanguage":"de-DE","url":"https://quittio.dev/logo.png"}]}
```