Open kierenj opened 6 years ago
I have this problem too!
The PdfTools and Converter need to behave as singletons in your AppDomain.
Yes, it certainly seems so. But I'd have hoped that there would be an exception, rather than randomly-corrupted PDF output. If this is indeed a design restriction, could I suggest a static flag somewhere, such that subsequent calls to the constructors throw a helpful error message?
Yeah I'm not a fan of opinionated service lifetimes. I haven't dug into the code here to find out why this limitation exists, but rather I've just discovered this is the case via my own usage.
Sadly, when trying to use singleton instances of a converter, and subsequent calls to Convert, DinkToPdf hangs: #62
Same problem for me even with singleton. Is there any solution or update? Thank you.
Same for me in october 2022
Hi! I'm trying to write some automated tests.
If I:
..then everything works fine.
However, if I:
The "stuff" being done is a randomly-named temp folder being set up, a HTML file and CSS file being copied in and the HTML being converted. I've put breakpoints and verified that for each conversion, the HTML and CSS are all valid. It's the PDF conversion bit which has the issue, for some reason!
..then only the first PDF is correct. Strangely, all of the subsequent PDFs simply have text in the source document dumped out.
The tests don't run in parallel, it seems that using a second (or rather, non-first)
PdfTools
instance is the issue.Anything I can do to help diagnose?