tuespetre / TuesPechkin

A .NET wrapper for the wkhtmltopdf library with an object-oriented API.
326 stars 116 forks source link

Parallel Run #150

Open mramirezfalcon opened 7 years ago

mramirezfalcon commented 7 years ago

Hello, we have an App deployed on IIS, and we need to generate many reports to PDF. TuesPechkin is performing well and I'm using as suggested :

public static readonly IConverter _pdfConverter = new ThreadSafeConverter( new RemotingToolset<PdfToolset>( new Win64EmbeddedDeployment( new TempFolderDeployment()))); But the conversions gets queued for a long PDF reports of many rows. So if I have a lot of concurrency in the app the generated reports must wait the long running conversion to finish, ans that's not a desired behavior. So I'm asking if this is a designed behavior and if there is another option. We have a lot of concurrency and big reports, some times thousands of html rows.

ThankYou!

kemmis commented 6 years ago

+1

tloy1966 commented 6 years ago

Guess can use List to manage your own thread?

kemmis commented 6 years ago

I was able to solve this problem by creating a dedicated console app that generated my pdf using TuesPenchkin. I just called it using Process.Start() from the web app and passed params containing the destination file path where the pdf should be saved. Once pdf was generated, my web app could then get the file from that path. It works pretty well.