-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PDF generation reaches up to 100% and prints after 4~5 minutes #36
Comments
I had a similar problem a while ago. You're not using the the converter you added as singleton in Startup.cs. You're creating a new SynchronizedConverter and PdfTools every time your class instantiates. I think this causes issues because you're ending up creating multiple instances of PdfTools without disposing them. (PdfTools implements IDisposable). I would change your constructor to retrieve the converter from the services by dependency injection instead. Perhaps something like this:
|
I did what you said. |
Interestingly, it works on IIS. |
As erwindamsma said, I put as Singleton and works fine. |
It seems to be a problem with https://github.com/wkhtmltopdf/wkhtmltopdf , because it ocours in other librarys that use wkhtmltopdf. |
My Problem is, the first time it works perfectly. If I start the second document to convert, it will never end. Any Solutions? dotnet core version: 2.1.3 |
@psychos4 |
Hi, @lkolodziey |
We changed to a java API with jasper. |
Well, it seems to be problem with the DinkToPdf... I guess that is something about making a singleton instance receive a IDisposable class (PdfTools) I just made this code and worked like a charm:
|
ASP.NET core version: 1.1.2.
On other machines this code works normally.
I've restarted and tried various configurations without success.
I also printed an empty document, with no header and footer.
Startup.cs
Class that generates the report
Console output
The text was updated successfully, but these errors were encountered: