Padocia / Laravel-Nova-Pdf

MIT License
21 stars 9 forks source link

Error output #10

Closed Pamposgsk closed 3 years ago

Pamposgsk commented 3 years ago

Hi, I’ve just installed your package which seems that is great but I am having the following issue: When running the action to download pdf I am getting the error ……Error output== == ‘node’ is not recognized as an internal or external command!operable program or batch file I’ve already set the variable path for node.js in my windows 7 control panel Why is that happening and it would be appreciated if you guide me how to fix this Thanks

Padocia commented 3 years ago

Hi, You need to customize the Browsershot instance and set the nodejs binary file path. To do this you'll need to override the handleBrowsershotOptions method in your action class

protected function handleBrowsershotOptions()
{

    $this->browsershot = $this->browsershot->format("A4")->setNodeBinary("C:\Programs\\nodejs\\node.exe");

    return $this;
}

NOTE: change C:\Programs\\nodejs\\node.exe with the correct path in your windows machine

Pamposgsk commented 3 years ago

Thanks a lot for the answer !!I followed your instructions but now iam getting a new error which says unknown error.Anyway it seems that is hard to make it work thanks a lot