---
title: "Services"
manual: "Cart Pdf"
version: "8.0"
permalink: "https://docs.typo3.org/permalink/extcode/cart-pdf:services@8.0"
source: "Administrator/Configuration/Services/Index.rst"
rendered: "2026-11-13T10:29:21+00:00"
---

# Services {#services}

The extension brings with the Services.yaml a registration of an EventListener on
`Extcode\Cart\Event\ProcessOrderCreateEvent`.

As in the documentation for
[PDF generation](https://docs.typo3.org/p/extcode/cart/7.0/en-us/AdministratorManual/Configuration/PdfConfiguration/Index.html),
the TypoScript configuration `plugin.tx_cart.autoGenerateDocuments` can be used to
define which documents should be generated.

This can also be overridden by the optional parameter `$options` with the EventListener
registration.

```
Extcode\CartPdf\EventListener\ProcessOrderCreate\DocumentRenderer:
  arguments:
    $orderItemRepository: '@Extcode\Cart\Domain\Repository\Order\ItemRepository'
    $persistenceManager: '@TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager'
    $options:
      autoGenerateDocuments:
        order: true
  tags:
    - name: event.listener
      identifier: 'cart-pdf--process-order-create--document-renderer'
      event: Extcode\Cart\Event\ProcessOrderCreateEvent
      after: 'cart--process-order-create--order-number'
      before: 'cart--process-order-create--email'

```

This makes it possible to generate different documents for different order processes.
For example, only the order confirmation (orderPdf) for prepayment but the invoice (invoicePdf) for
all completed payments with a payment provider extension like PayOne.

Currently there is only the option `autoGenerateDocuments` provides and array of the documents to be
generated is expected. Analogous to the TypoScript configuration, order is set to true here to generate
the order confirmation (orderPdf).
