mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
Merge pull request #4576 from beganovich/v5-snappdf-integration-with-windows-and-mac
(v5) Add support for custom Chromium path (ie. support for Windows & Mac)
This commit is contained in:
commit
d570cd7474
@ -221,9 +221,13 @@ class SetupController extends Controller
|
||||
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!')
|
||||
->generate();
|
||||
|
||||
|
@ -29,6 +29,10 @@ trait PdfMaker
|
||||
{
|
||||
$pdf = new Snappdf();
|
||||
|
||||
if (config('ninja.snappdf_chromium_path')) {
|
||||
$pdf->setChromiumPath(config('ninja.snappdf_chromium_path'));
|
||||
}
|
||||
|
||||
return $pdf
|
||||
->setHtml($html)
|
||||
->generate();
|
||||
|
@ -137,4 +137,5 @@ return [
|
||||
],
|
||||
'log_pdf_html' => env('LOG_PDF_HTML', false),
|
||||
'expanded_logging' => env('EXPANDED_LOGGING', false),
|
||||
'snappdf_chromium_path' => env('SNAPPDF_CHROMIUM_PATH', false),
|
||||
];
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
@ -8,6 +9,7 @@
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
|
||||
namespace Tests\Pdf;
|
||||
|
||||
use Beganovich\Snappdf\Snappdf;
|
||||
@ -26,9 +28,13 @@ class PdfGenerationTest extends TestCase
|
||||
|
||||
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>')
|
||||
->generate();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user