2

I've been using this tool for about a week, and now, today, it just stopped working. I've reverted the rest of my code back to the previous state and I keep getting the same error.

All that I'm getting from the Exception that is thrown is:

An exception of type 'System.Exception' occurred in NReco.PdfGenerator.dll but was not handled in user code

Additional information: Cannot generate PDF: (exit code: -1073740791)

From the Windows Event Log:

Faulting application name: wkhtmltopdf.exe, version: 0.12.2.1, time stamp: 0x54bd0265

Faulting module name: MSVCR120.dll, version: 12.0.21005.1, time stamp: 0x524f7ce6

Exception code: 0xc0000409

Fault offset: 0x000a7666

Faulting process id: 0xc8c

Faulting application start time: 0x01d0deb1a8d73b2f

Faulting application path: C:*****\bin\wkhtmltopdf.exe

Faulting module path: C:\Windows\SYSTEM32\MSVCR120.dll

Report Id: e8c8bcf0-4aa4-11e5-826d-acb57d145db6

Faulting package full name:

Faulting package-relative application ID:

Any ideas what could be causing this?

Community
  • 1
  • 1
Matt James
  • 109
  • 2
  • 8

1 Answers1

3

The reason of this error is not in your code: it seems something changed in your environment and wkhtmltopdf.exe stops working because of missed VC++ 2013 runtime libraries (required for latest v.0.12.2.1).

You can download and install them from Windows Downloads: Visual C++ Redistributable Packages for Visual Studio 2013

PdfGenerator embeds x86 build of wkhtmltopdf and you may install only x86-version of redistributable package ( vcredist_x86.exe ).

--- update ---

For latest wkhtmltopdf 0.12.4 VC++ 2015 runtime libs are needed.

Vitaliy Fedorchenko
  • 8,447
  • 3
  • 37
  • 34
  • In my case Visual C++ Redistributable Packages for Visual Studio 2013 was installed but the code was compiled with VS 2015 after Installing Visual C++ Redistributable Packages for Visual Studio 2015 problem solved. Thanks a lot. – Hamed Mahdizadeh Oct 31 '17 at 11:01
  • 1
    You're right latest wkhtmltopdf 0.12.4 is compiled for VC++ 2015 runtime libs (I've updated an answer). – Vitaliy Fedorchenko Nov 01 '17 at 12:46
  • Thanks a lot for this answer. In my case the exit code was slightly different ((exit code: -1073741515)) but the solution was also to install the Visual C++ Redistributable Package for Visual Studio 2015, which you find here: https://www.microsoft.com/en-us/download/details.aspx?id=48145 – Stefan de Groot Feb 18 '18 at 07:35
  • I have already installed vc runtimes but the issue is still appearing. – Zeeshanef Apr 05 '21 at 10:15
  • @Zeeshanef what wkhtmltopdf version do you use? The latest 0.12.6 may require newer VC++ runtime libs. – Vitaliy Fedorchenko Apr 07 '21 at 08:56
  • @VitaliyFedorchenko It is 1.1.15.0. But my issue resolved after restarting my system. Thanks – Zeeshanef Apr 07 '21 at 10:28