mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 02:14:33 -04:00
Add support for custom Chromium path (ie. support for Windows & Mac)
This commit is contained in:
parent
2963824924
commit
9f58ccb028
@ -221,9 +221,13 @@ class SetupController extends Controller
|
|||||||
return $this->testPhantom();
|
return $this->testPhantom();
|
||||||
}
|
}
|
||||||
|
|
||||||
$snappdf = new Snappdf();
|
$pdf = new Snappdf();
|
||||||
|
|
||||||
$pdf = $snappdf
|
if (config('ninja.snappdf_chromium_path')) {
|
||||||
|
$pdf->setChromiumPath(config('ninja.snappdf_chromium_path'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdf = $pdf
|
||||||
->setHtml('GENERATING PDFs WORKS! Thank you for using Invoice Ninja!')
|
->setHtml('GENERATING PDFs WORKS! Thank you for using Invoice Ninja!')
|
||||||
->generate();
|
->generate();
|
||||||
|
|
||||||
|
@ -29,6 +29,10 @@ trait PdfMaker
|
|||||||
{
|
{
|
||||||
$pdf = new Snappdf();
|
$pdf = new Snappdf();
|
||||||
|
|
||||||
|
if (config('ninja.snappdf_chromium_path')) {
|
||||||
|
$pdf->setChromiumPath(config('ninja.snappdf_chromium_path'));
|
||||||
|
}
|
||||||
|
|
||||||
return $pdf
|
return $pdf
|
||||||
->setHtml($html)
|
->setHtml($html)
|
||||||
->generate();
|
->generate();
|
||||||
|
@ -137,4 +137,5 @@ return [
|
|||||||
],
|
],
|
||||||
'log_pdf_html' => env('LOG_PDF_HTML', false),
|
'log_pdf_html' => env('LOG_PDF_HTML', false),
|
||||||
'expanded_logging' => env('EXPANDED_LOGGING', false),
|
'expanded_logging' => env('EXPANDED_LOGGING', false),
|
||||||
|
'snappdf_chromium_path' => env('SNAPPDF_CHROMIUM_PATH', false),
|
||||||
];
|
];
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoice Ninja (https://invoiceninja.com).
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
*
|
*
|
||||||
@ -8,6 +9,7 @@
|
|||||||
*
|
*
|
||||||
* @license https://opensource.org/licenses/AAL
|
* @license https://opensource.org/licenses/AAL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Tests\Pdf;
|
namespace Tests\Pdf;
|
||||||
|
|
||||||
use Beganovich\Snappdf\Snappdf;
|
use Beganovich\Snappdf\Snappdf;
|
||||||
@ -19,16 +21,20 @@ use Tests\TestCase;
|
|||||||
*/
|
*/
|
||||||
class PdfGenerationTest extends TestCase
|
class PdfGenerationTest extends TestCase
|
||||||
{
|
{
|
||||||
public function setUp() :void
|
public function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testPdfGeneration()
|
public function testPdfGeneration()
|
||||||
{
|
{
|
||||||
$snappdf = new Snappdf();
|
$pdf = new Snappdf();
|
||||||
|
|
||||||
$pdf = $snappdf
|
if (config('ninja.snappdf_chromium_path')) {
|
||||||
|
$pdf->setChromiumPath(config('ninja.snappdf_chromium_path'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdf = $pdf
|
||||||
->setHtml('<h1>Invoice Ninja</h1>')
|
->setHtml('<h1>Invoice Ninja</h1>')
|
||||||
->generate();
|
->generate();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user