-
Notifications
You must be signed in to change notification settings - Fork 33
QPainter::begin(): Returned false Exit with code 1, due to unknown error. .net 5 docker linux #14
Comments
I'm having the same issue, mine worked find in 3.1, any progress on the issue @rajeshmuraleedharan ? |
The odd thing is that i can bash into the container and run the same exact commands then it will output the pdf to the console output. But running through dotnet processstartinfo it fails in .net 5. Makes me feel like its some kind of change in processes standard output etc |
The error exists in the proc code. It seems that something has changed in .net 5 or in the docker images used by .net 5. The standard in/out is throwing the error. private static byte[] Convert(IWkhtmltopdfPathProvider pathProvider, string switches, string html)
|
Yeah im using this same code, i changed to storing a temp file and it works. So it has something to do with the standardoutput code using var ms = new MemoryStream();
using (var sOut = proc.StandardOutput.BaseStream)
{
byte[] buffer = new byte[4096];
int read;
while ((read = sOut.Read(buffer, 0, buffer.Length)) > 0)
{
ms.Write(buffer, 0, read);
}
} |
I'm having the same issue. Has anyone tried if it makes a difference if you run it on linux (not in a docker container)? |
I have my web site in centos7 and I'm getting the same issue. |
Same Issue here, CentOS 7, no docker, netcore 5 |
How did you get this output to a temp file? Nothing works for me. |
Facing the same issue. will appreciate an hint for a solution.= |
Hello, I found a fix that works well, in short: i let wkhtmltopdf write directly to a file (in case of Linux) Change has to be done WkhtmlDriver.cs (see attachment) |
Really hope this will work. |
Tried this and getting issues with the path of the pdf /app/generatedPdf not found. Assume the pdf is going somewhere else. What linux image are you using? |
Finally i use a combination of Rotativa.AspNetCore and Wkhtmltopdf.NetCore. |
Hi guys, i dont know if you have been following this issue fpanaccia/Wkhtmltopdf.NetCore-deprecated#46, but i just pushed a dirty and above all temporary solution https://www.nuget.org/packages/Wkhtmltopdf.NetCore/5.0.2-preview, as i said in the issue, i would recommend that only implement this version if you really really really need it, writing files in containers is not very optimal. When net 5.0.4 i will push a final fix for this + some new features |
Getting "QPainter::begin(): Returned false Exit with code 1, due to unknown error." when I use .Net 5 Linux docker container.
Working fine with Aspnet Core 3.1 version. Please help me to resolve this issue
This is the error
Docker File
The text was updated successfully, but these errors were encountered: