I use NReco HtmlToPdfConverter and usually it works correctly. But sometimes I face with the following error:
Cannot generate PDF: The specified executable is not a valid application for this OS platform.
The code is quite simple, it is a singletone class:
public class Converter : IConverter
{
private readonly object lockObject = new object();
public Converter()
{
HtmlToPdf = new HtmlToPdfConverter();
}
private HtmlToPdfConverter HtmlToPdf { get; }
public byte[] GeneratePdf(string htmlContent)
{
lock (lockObject)
{
return HtmlToPdf.GeneratePdf(htmlContent);
}
}
}
Does anybody know what can be a reason for such kind of error?