diff --git a/composer.json b/composer.json
index 481f121..f0dc441 100644
--- a/composer.json
+++ b/composer.json
@@ -3,7 +3,8 @@
     "description": "An integration for one time passwords according to RFC 4226 (HOTP) and the RFC 6238 (TOTP).",
     "type": "drupal-module",
     "require": {
-        "spomky-labs/otphp": "^8.3.2"
+        "spomky-labs/otphp": "^8.3.2",
+        "endroid/qr-code": "^3.8"
     },
     "authors": [
         {
diff --git a/src/Form/PasswordSetupForm.php b/src/Form/PasswordSetupForm.php
index e50fcc1..d14fa0f 100644
--- a/src/Form/PasswordSetupForm.php
+++ b/src/Form/PasswordSetupForm.php
@@ -5,6 +5,7 @@ namespace Drupal\one_time_password\Form;
 use Drupal\Core\Form\FormBase;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\user\Entity\User;
+use Endroid\QrCode\QrCode;
 
 /**
  * A form for setting up one time passwords.
@@ -35,9 +36,11 @@ class PasswordSetupForm extends FormBase {
     }
     else {
       $password = $user->one_time_password->getOneTimePassword();
+      $qr_code = new QrCode($password->getProvisioningUri());
+      $qr_code->setSize(200);
       $form['qr_code'] = [
         '#theme' => 'image',
-        '#uri' => $password->getQrCodeUri(),
+        '#uri' => $qr_code->writeDataUri(),
       ];
       $form['instructions'] = [
         '#theme' => 'one_time_password_setup_instructions',
