Phontom not found
-
Hi I am using visual studio 2019 and trying to generate pdf.
My code:
var report = await rs.RenderAsync(new RenderRequest()
{
Template = new Template()
{
Recipe = Recipe.PhantomPdf,
Engine = Engine.None,
Content = "<style>h1{color:red}<h1>Hello World!</h1></style>"
}
});
using (var fs = File.Create(@"C:\Users*\Desktop\Demo\payslip\slip.jpg"))
{
report.Content.CopyTo(fs);
}**Error:
jsreport.Local.JsReportBinaryException
HResult=0x80131500
Message=Error rendering report: starting rendering process..rendering has finished with errors:A critical error occurred while trying to execute the render command (2). Recipe 'phantom-pdf' not found. If this is a custom recipe make sure it's properly installed from npm. (1). caused by error (2):-> stackError: at onCriticalError (D:\snapshot\jsreport\node_modules\jsreport-cli\lib\commands\render.js:302:19) at D:\snapshot\jsreport\node_modules\jsreport-cli\lib\commands\render.js:298:12caused by error (1):-> meta = {"statusCode":400,"weak":true,"logged":true}-> stackError: at D:\snapshot\jsreport\node_modules\jsreport-core\lib\util\createError.js:11:13 at Reporter.createError (D:\snapshot\jsreport\node_modules\jsreport-core\lib\reporter.js:332:12) at invokeRender (D:\snapshot\jsreport\node_modules\jsreport-core\lib\render\render.js:92:20) at async D:\snapshot\jsreport\node_modules\jsreport-core\lib\render\render.js:150:5 at async startRender (D:\snapshot\jsreport\node_modules\jsreport-cli\lib\commands\render.js:357:17) at async D:\snapshot\jsreport\node_modules\jsreport-cli\lib\commands\render.js:291:13 at async Commander.executeCommand (D:\snapshot\jsreport\node_modules\jsreport-cli\lib\commander.js:242:22)
Source=jsreport.Local
StackTrace:
at jsreport.Local.Internal.LocalUtilityReportingService.<RenderAsync>d__12.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at csv_helper.Program.<Main>d__0.MoveNext() in C:\Learning\C#\csv-helper\csv-helper\Program.cs:line 74This exception was originally thrown at this call stack:
[External Code]
csv_helper.Program.Main(string[]) in Program.cs
-
Use chrome-pdf recipe. The phantomjs is not part of the later binaries.
-
It solved the issue .....Thank you So much for the help...