Closed fabs-rodriguez closed 5 years ago
Hi @fabs-rodriguez, this is wkhtmltopdf project, not DinkToPdf.
Thanks for the reply Tomsgu. Yes, this happened on DinkToPdf. But DinkToPdf uses wkhtmltopdf, and according to https://github.com/rdvojmoc/DinkToPdf/issues/22 the bug is in wkhtmltopdf?
Can you please then post an example of the CLi command that creates the issue? Not a wrapper code.
wkhtmltopdf version(s) affected: 0.12.4.0
OS information Windows 10 Home version 1809, 64 bit.
Description On DinkToPdf, when setting PagesCount = false in ObjectSettings in an ASP .Net Core 2.1 Web API, and the Convert() method is called, I get the following exception:
System.DivideByZeroException: Attempted to divide by zero.
Stack Trace:
_at DinkToPdf.WkHtmlToXBindings.wkhtmltopdf_convert(IntPtr converter) at DinkToPdf.PdfTools.DoConversion(IntPtr converter) in C:\Users\admin\Documents\DinkToPdf\src\DinkToPdf\PdfTools.cs:line 116 at DinkToPdf.BasicConverter.Convert(IDocument document) in C:\Users\admin\Documents\DinkToPdf\src\DinkToPdf\BasicConverter.cs:line 53 at DinkToPdf.SynchronizedConverter.<>n0(IDocument document) at DinkToPdf.SynchronizedConverter.<>cDisplayClass5_0.b_0() in C:\Users\admin\Documents\DinkToPdf\src\DinkToPdf\SynchronizedConverter.cs:line 27
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
According to DinkToPdf it's a bug in wkhtmltopdf: https://github.com/rdvojmoc/DinkToPdf/issues/22
How to reproduce Set PagesCount = false in ObjectSettings, and call Convert() method:
Expected behavior It should generate the PDF without the page count at the top.