pdf - How to create a threadsafe c# exe wrapper -


i attempting convert html pdf.

i have checked out pdfsharp , itextsharp both don't complicated, there executable out there wkhtmltopdf seems far have best reviews.

i use wkhtmltopdf console application library.

i can imagine situation has occurred in different formats can't find solutions specific enough use.

there existing c# wkhtmltopdf wrapper library, has problems in deploying , application hanging.

there 1 call need pass .exe file like:

wkhtmltopdf.exe "www.adsf.com" convertedpdfofasdf.pdf 

i create library spins off thread that:

  1. copies instance of wkhtmltopdf.exe temp location
  2. calls wkhtmltopdf.exe via reflection
  3. deletes temp location containing copies wkhtmltopdf.exe

i haven't attempted before not sure if best way of solving problem, surely there reproducable solution out there.

ps. solution must thread safe. running web application.

it sounds you're headed towards dll hell. while proposed solution provide separation between instances, can force situation you're having deal unable cast x x exceptions.

i'd recommend locking access underlying library, , forcing application wait, or operating in multiple appdomains executing same code linearly.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -