---
title: "Breaking: #35 - Extract writing document to FileWriterService"
manual: "Cart Pdf"
version: "main"
permalink: "https://docs.typo3.org/permalink/extcode/cart-pdf:breaking-35-extract-writing-document-to-filewriterservice@main"
source: "Changelog/8.0/Breaking-35-ExtractWritingDocumentToFileWriterService.rst"
rendered: "2026-11-17T08:19:26+00:00"
---

# Breaking: #35 - Extract writing document to FileWriterService {#breaking-35-extract-writing-document-to-filewriterservice}

See [Issue 135](https://github.com/extcode/cart_products/issues/135)

## Description {#description}

To enable the PDF content to be written using a separate file name, writing
the rendered content should be moved to a separate service.

Your own service can then be integrated via dependency injection.

## Affected Installations {#affected-installations}

All installations which overwrite
`\Extcode\CartPdf\Service\PdfService::createPdf` and
`\Extcode\CartPdf\Service\PdfService::renderPdf`
are affected.
These methods were removed. The functionality was
moved to `\Extcode\CartPdf\Service\PdfService::renderDocument`
and return the pdf content as string. Saving the file was
handed over to the new
`\Extcode\CartPdf\Service\FileWriterService::writeContentToFile`.

## Migration {#migration}

Move the logic to an own implementation of the
`\Extcode\CartPdf\Service\FileWriterServiceInterface` and
inject this own service to the
`\Extcode\CartPdf\EventListener\Order\Finish\DocumentRenderer`.
