public function invoicepdf(HTTPRequest $request)
    {
        /**
         * Load custom CSS for PDF explicitly (as pass)
         */
        $loader = ModuleResourceLoader::singleton();
        $style = file_get_contents($loader->resolvePath('silvercommerce/orders-admin: client/dist/css/pdf.css'));
        Requirements::clear();
        Requirements::customCSS(<<<CSS
        $style
CSS
        );
        $result = $this->invoice($request);
        $html = $result->getValue();
        $html = str_replace('src="'.BASE_URL, 'src="'.BASE_PATH, $html);

        $pdf = $this->gernerate_pdf($html);

        $this->extend("updateInvoicePDF", $pdf);

        $pdf->render();
        $pdf->stream("{$this->object->FullRef}.pdf");
        exit();
    }
public function invoicepdf(HTTPRequest $request)
    {
        /**
         * Load custom CSS for PDF explicitly (as pass)
         */
        $loader = ModuleResourceLoader::singleton();
        $style = file_get_contents($loader->resolvePath('silvercommerce/orders-admin: client/dist/css/pdf.css'));
        Requirements::clear();
        Requirements::customCSS(<<<CSS
        $style
CSS
        );
        $result = $this->invoice($request);
        $html = $result->getValue();
        $html = str_replace('src="'.BASE_URL, 'src="'.BASE_PATH, $html);

        $pdf = $this->gernerate_pdf($html);

        $this->extend("updateInvoicePDF", $pdf);

        $pdf->render();
        $pdf->stream("{$this->object->FullRef}.pdf");
        exit();
    }
public function invoicepdf ( HTTPRequest $ request ) { /**
         * Load custom CSS for PDF explicitly (as pass)
         */ $ loader = ModuleResourceLoader :: singleton ( ) ; $ style = file_get_contents ( $ loader -> resolvePath ( 'silvercommerce/orders-admin: client/dist/css/pdf.css' ) ) ; Requirements :: clear ( ) ; Requirements :: customCSS ( <<<CSS
        $style
CSS ) ; $ result = $ this -> invoice ( $ request ) ; $ html = $ result -> getValue ( ) ; $ html = str_replace ( 'src="' . BASE_URL , 'src="' . BASE_PATH , $ html ) ; $ pdf = $ this -> gernerate_pdf ( $ html ) ; $ this -> extend ( "updateInvoicePDF" , $ pdf ) ; $ pdf -> render ( ) ; $ pdf -> stream ( "{$this->object->FullRef}.pdf" ) ; exit ( ) ; }
Generate a PDF based on the invoice html output.

@todo At the moment this exits all execution after generating
and streaming PDF. Ideally this should tap into
@link http://api.silverstripe.org/4/SilverStripe/Control/HTTPStreamResponse.html

@param HTTPRequest $request
@return void
Generate a PDF based on the invoice html output .