1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Merge pull request #4158 from Striffly/features/browsershot-nodepaths

Add ability to use Browsershot with NODE_PATH & NPM_PATH env variables
This commit is contained in:
David Bomba 2020-10-14 09:30:58 +11:00 committed by GitHub
commit 6256b197bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 483 additions and 296 deletions

View File

@ -192,6 +192,8 @@ class SetupController extends Controller
}
Browsershot::html('PDF GENERATION WORKS! Thank you for using Invoice Ninja!')
->setNodeBinary(config('ninja.system.node_path'))
->setNpmBinary(config('ninja.system.npm_path'))
->noSandbox()
->savePdf(
public_path('test.pdf')

773
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -16,6 +16,7 @@
"@babel/plugin-proposal-class-properties": "^7.10.4",
"cypress": "^4.12.1",
"laravel-mix-purgecss": "^5.0.0",
"puppeteer": "^5.3.1",
"vue-template-compiler": "^2.6.11"
},
"dependencies": {
@ -27,7 +28,6 @@
"jsignature": "^2.1.3",
"laravel-mix": "^5.0.7",
"lodash": "^4.17.20",
"puppeteer": "^1.20.0",
"resolve-url-loader": "^3.1.0",
"sass": "^1.26.10",
"sass-loader": "^8.0.0",

View File

@ -28,6 +28,8 @@ class PdfGenerationTest extends TestCase
private function makePdf($header, $footer, $html, $pdf)
{
Browsershot::html($html)
->setNodeBinary(config('ninja.system.node_path'))
->setNpmBinary(config('ninja.system.npm_path'))
//->showBrowserHeaderAndFooter()
//->headerHtml($header)
//->footerHtml($footer)