tuespetre / TuesPechkin

A .NET wrapper for the wkhtmltopdf library with an object-oriented API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Qt: Could not initialize OLE (error 80010106)

Lej opened this issue · comments

I made a minimal .NET Framework 4.6.1 console app with TurePechkin v2.1.1 and TuesPechkin.Wkhtmltox.AnyCPU 0.12.4.1:

        static void Main(string[] args)
        {
            var converter =
                new StandardConverter(
                    new PdfToolset(
                        new WinAnyCPUEmbeddedDeployment(
                            new TempFolderDeployment())));

            converter.Convert(new HtmlToPdfDocument
            {
                Objects =
                {
                    new ObjectSettings
                    {
                        HtmlText = "<h1>Hello World!</h1>",
                    }
                }
            });

            Console.ReadKey();
        }

When I run it I the following gets printed:

image

How do I prevent this error?

i'm too

For those who might find this issue in the future, I've hit the same problem and resolved using a single threaded apartment

[STAThread]
static void Main(string[] args)
{
   ...code here...
}