Open c0deflow opened 6 years ago
which version of .Net Core you are using
Hi saineshwar! I am using .Net Core 2.0.
hi @c0deflow !
Can you try this sample by downloading it. https://www.dropbox.com/s/owuix133ni4el0o/DemoRotativa.rar?dl=0
Wow! I saw your article already @saineshwar the link was looking very familiar! I followed your tutorial but since 1 week I stared crying to create a pdf from core because nothing worked for me right now or the product costs over 700 dollar.
Your example is also not working for me, sadly. I get a new exception. Permission denied! Well, I used this tool right here: https://www.macupdate.com/app/mac/31741/permissions-reset
In this project, I ran Demo/DemoViewAsPDF
and gave the highest permission that I can (read, write, executable). But now I get this exception here:
An unhandled exception occurred while processing the request. Exception: Rotativa.AspNetCore.WkhtmlDriver.Convert(string wkhtmlPath, string switches, string html, string wkhtmlExe)
System.Exception at Rotativa.AspNetCore.WkhtmlDriver.Convert(String wkhtmlPath, String switches, String html, String wkhtmlExe) at Rotativa.AspNetCore.WkhtmltopdfDriver.ConvertHtml(String wkhtmltopdfPath, String switches, String html) at Rotativa.AspNetCore.ViewAsPdf.<CallTheDriver>d__19.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter
1.GetResult()
at Rotativa.AspNetCore.AsResultBase.
can u provide me you source code sample such that i can try it.
Have you download latest code from github of Rotativa.AspNetCore , do not use Nuget it has issue.
I downloaded the dropbox project from your link. I got this Exceptions also in this project. But I can upload the same project to dropbox if you like. here is the link: Download Link
By the way, I am using macOS Sierra v 10.12.6 My .Net Core Version 2.1.4 (dotnet --version in terminal) but in the Project itself I am using 2.0. I hope I didn't provide you the wrong version previously,
ohh it might be issue because it works fine on windows machine .
@saineshwar no hope for mac? :-( Because there are one or more ddl which can be used but yeah I saw also .exe ...
@c0deflow there's still an issue with wkhtmltopdf filename that needs fixing. Dirty fix is to change name adding ".exe" suffix. it should work then, I now at least one guy that made it work.
@webgio how do U mean? Is it correct how it looks like in my attached image:
@c0deflow your source works fine on windows , @webgio is there any issue on running this product on mac.
I had confirmation that it works. I'll ping the guy to ask him. Let you know
@saineshwar @webgio thank you guys for your help. Hope it would work on mac/linux.
@webgio Did U get any updates ?
@c0deflow Hello! Did you resolve this issue ? I have an identical error on linux
Hi @Meyram . Nope. I was waiting for an answer from webgio, but didn't get an answer. So I changed to "DinkToPdf". This worked for me.
Hi,
I had same problem: System.Exception at Rotativa.NetCore.WkhtmlDriver.Convert(String wkhtmlPath, String switches, String html, String wkhtmlExe) in /Users/codeflow/Downloads/Rotativa.NetCore- ...
If your problem is that Rotative does not find the wkhtmltopdf.exe path, you could try to change it throught the WkhtmlPath property in ViewAsPdf object:
// Try this minimal example var test = new ViewAsPdf(model); test.WkhtmlPath = "c:\path_of_wkhtmltopdf\"; return test;
This worked for me.
@neobarcino did you try the last package version? it should fix problems when running on Mac or Linux. If you need to define the directory where wkhtmltopdf is then use
RotativaConfiguration.Setup(env, "path/relative/to/root")
Great! Thanks webgio! I'm using Rotative 2.2.0 on Core 2.0
I came across this open issue with the same error. I ended up just updating the files with a newer version than what we were using. Not sure why this error happened in the first place, but that was the fix for us.
If try to run the Sample, and click on "Test Pdf Generation", I get following exception:
System.Exception at Rotativa.NetCore.WkhtmlDriver.Convert(String wkhtmlPath, String switches, String html, String wkhtmlExe) in /Users/codeflow/Downloads/Rotativa.NetCore-master/Rotativa.NetCore/WkhtmlDriver.cs:line 78 at Rotativa.NetCore.WkhtmltopdfDriver.Convert(String wkhtmltopdfPath, String switches) in /Users/codeflow/Downloads/Rotativa.NetCore-master/Rotativa.NetCore/WkhtmltopdfDriver.cs:line 27 at Rotativa.NetCore.AsPdfResultBase.WkhtmlConvert(String switches) in /Users/codeflow/Downloads/Rotativa.NetCore-master/Rotativa.NetCore/AsPdfResultBase.cs:line 79 at Rotativa.NetCore.AsResultBase.CallTheDriver(ActionContext context) in /Users/codeflow/Downloads/Rotativa.NetCore-master/Rotativa.NetCore/AsResultBase.cs:line 185 at Rotativa.NetCore.AsResultBase.BuildFile(ActionContext context) in /Users/codeflow/Downloads/Rotativa.NetCore-master/Rotativa.NetCore/AsResultBase.cs:line 205 at Rotativa.NetCore.AsResultBase.ExecuteResult(ActionContext context) in /Users/codeflow/Downloads/Rotativa.NetCore-master/Rotativa.NetCore/AsResultBase.cs:line 217 at Microsoft.AspNetCore.Mvc.ActionResult.ExecuteResultAsync(ActionContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeResultAsync>d__30.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextResultFilterAsync>d__28.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ResultExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextResourceFilter>d__22.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ResourceExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeAsync>d__20.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.<Invoke>d__7.MoveNext()
Is there a workaround? Inside the bin/debug/myapp/rotativa I've the required files/ddl's (wkhtmltoimage.exe, wkhtmltopdf.exe, wkhtmltox.dll).