Merge pull request #6215 from CloudMyIT/PR-snappdfarguments

Added ability to set arguments for Snappdf
This commit is contained in:
David Bomba 2021-07-07 12:35:39 +10:00 committed by GitHub
commit 5bf45bc4c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 0 deletions

View File

@ -241,6 +241,11 @@ class SetupController extends Controller
$pdf->setChromiumPath(config('ninja.snappdf_chromium_path'));
}
if (config('ninja.snappdf_chromium_arguments')) {
$pdf->clearChromiumArguments();
$pdf->addChromiumArguments(config('ninja.snappdf_chromium_arguments'));
}
$pdf = $pdf
->setHtml('GENERATING PDFs WORKS! Thank you for using Invoice Ninja!')
->generate();

View File

@ -34,6 +34,11 @@ trait PdfMaker
$pdf->setChromiumPath(config('ninja.snappdf_chromium_path'));
}
if (config('ninja.snappdf_chromium_arguments')) {
$pdf->clearChromiumArguments();
$pdf->addChromiumArguments(config('ninja.snappdf_chromium_arguments'));
}
$generated = $pdf
->setHtml($html)
->generate();

View File

@ -142,6 +142,7 @@ return [
'log_pdf_html' => env('LOG_PDF_HTML', false),
'expanded_logging' => env('EXPANDED_LOGGING', false),
'snappdf_chromium_path' => env('SNAPPDF_CHROMIUM_PATH', false),
'snappdf_chromium_arguments' => env('SNAPPDF_CHROMIUM_ARGUMENTS', false),
'v4_migration_version' => '4.5.35',
'flutter_renderer' => env('FLUTTER_RENDERER', 'selfhosted-html'),
'webcron_secret' => env('WEBCRON_SECRET', false),

View File

@ -34,6 +34,11 @@ class PdfGenerationTest extends TestCase
$pdf->setChromiumPath(config('ninja.snappdf_chromium_path'));
}
if (config('ninja.snappdf_chromium_arguments')) {
$pdf->clearChromiumArguments();
$pdf->addChromiumArguments(config('ninja.snappdf_chromium_arguments'));
}
$pdf = $pdf
->setHtml('<h1>Invoice Ninja</h1>')
->generate();