public function orderPdfAction(Request $request, $id)
    {
        $locale = $request->getLocale();

        $this->get('translator')->setLocale($locale);

        $orderApiEntity = $this->getOrderManager()->findByIdAndLocale($id, $locale, false);
        $order = $orderApiEntity->getEntity();

        // Get pdf file from manager. Function parameter fallbacks are sufficient.
        $pdf = $this->getOrderPdfManager()->createOrderPdfDynamically($orderApiEntity);

        // Get the filename with parameter: isSubmitted = false since this is the unsubmitted case.
        $pdfName = $this->getOrderPdfManager()->getPdfName($order, false);

        // Get the response type defined in the parameters.yml.
        $responseType = $this->container->getParameter('sulu_sales_order.pdf_response_type');

        return new Response(
            $pdf,
            200,
            [
                'Content-Type' => 'application/pdf',
                'Content-Disposition' => sprintf('%s; filename="%s"', $responseType, $pdfName),
            ]
        );
    }