mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-11 13:42:49 +01:00
9e9cd37b87
* Working on Quotes * Naming refactor for Quotes * Quote Actions * Quote Pdfs * Quote PDFs * Refunds in Stripe * Fixes tests * Company Ledger work
33 lines
781 B
PHP
33 lines
781 B
PHP
<?php
|
|
|
|
|
|
namespace App\Utils\Traits\Pdf;
|
|
|
|
use Spatie\Browsershot\Browsershot;
|
|
|
|
trait PdfMaker
|
|
{
|
|
|
|
/**
|
|
* Returns a PDF stream
|
|
*
|
|
* @param string $header Header to be included in PDF
|
|
* @param string $footer Footer to be included in PDF
|
|
* @param string $html The HTML object to be converted into PDF
|
|
*
|
|
* @return string The PDF string
|
|
*/
|
|
public function makePdf($header, $footer, $html) {
|
|
return Browsershot::html($html)
|
|
//->showBrowserHeaderAndFooter()
|
|
//->headerHtml($header)
|
|
//->footerHtml($footer)
|
|
->deviceScaleFactor(1)
|
|
->showBackground()
|
|
->waitUntilNetworkIdle(true) ->pdf();
|
|
//->margins(10,10,10,10)
|
|
//->savePdf('test.pdf');
|
|
}
|
|
|
|
}
|