public function createPaymentSlip(PaymentSlip $paymentSlip)
    {
        $this->paymentSlip = $paymentSlip;

        // Place background image
        if ($paymentSlip->getDisplayBackground()) {
            $this->displayImage($paymentSlip->getSlipBackground());
        }

        $elements = $paymentSlip->getAllElements();

        // Go through all elements, write each line
        foreach ($elements as $elementName => $element) {
            $this->writePaymentSlipLines($elementName, $element);
        }

        $this->paymentSlip = null;

        return $this;
    }