pruiz / WkHtmlToXSharp

C# wrapper wrapper (using P/Invoke) for the excelent Html to PDF conversion library wkhtmltopdf library.
239 stars 84 forks source link

Observed difference in output between MultiplexerConverter and WkHtmlToPdfConverter #46

Closed JulianMay closed 6 years ago

JulianMay commented 6 years ago

Both screenshots is output from the same html report. The only difference in the calling code is which class is new'ed up as the responsible IHtmlToPdfConverter Seems to me like a bug in WkHtmlToPdfConverter? I'm using MultiplexerConverter so no trouble for my, just wanted to report it since I saw it. withwkhtmltopodfconverter withmultiplexingconverter

Thanks for making this!

pruiz commented 6 years ago

Can you paste some code for each case? I guess you are probably using (and disposing before second use) an WkHtmlToPdfConverter instance. Something which should not be done.

WkHtmlToPdfConverter is the raw adaptation of wkhtmltox engine, if you instantiate it twice (or instantiate, dispose, instantiate a new instance), within a single process, stuff goes out of the window.. :)

That's why MultipexingConverter exists. It takes care of just initializing wkhtmltox once.. and (partially) dispose it when not in use..

JulianMay commented 6 years ago

Ok, I'll just keep off WkHtmlToPdfConverter altogether and only use MultipexingConverter. Yes, it was wrapped in a using scope (because i noticed the implementation of IDisposable). I'll show myself out.