Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IIS wkhtmltox.dll_unload error #179

Open
jackiemanzzz opened this issue Apr 25, 2019 · 2 comments
Open

IIS wkhtmltox.dll_unload error #179

jackiemanzzz opened this issue Apr 25, 2019 · 2 comments

Comments

@jackiemanzzz
Copy link

I got this error both local machine and IIS server when HtmlToPdfDocument's objectSettings include urls for header, footer and also body.
If i used just one htmlUrl for pdf, i didn't get this error. Unfortunately, I have to use a link either footer or header cause i have many dynamic data to put there.

My code like that

var document = new HtmlToPdfDocument
        {
            GlobalSettings = {
                ProduceOutline = true,
                DocumentTitle = title,
                Orientation = orientation,
                PaperSize = PaperKind.A4,
                Margins =
                {
                    Left = 1.375,
                    Right = 1.375,
                    Top = top,
                    Bottom = bottom,
                    Unit = TuesPechkin.Unit.Centimeters

                }
            },
            Objects = {
                new ObjectSettings {
                    PageUrl = link,
                    HeaderSettings = new HeaderSettings{HtmlUrl = headerPath, ContentSpacing = 2 },
                    FooterSettings = new FooterSettings{HtmlUrl = footerPath,}
                }
            }
        };
        var tempFolderDeployment = new TempFolderDeployment();
        var win32EmbeddedDeployment = new Win32EmbeddedDeployment(tempFolderDeployment);
        var remotingToolset = new RemotingToolset<PdfToolset>(win32EmbeddedDeployment);

        var converter = new ThreadSafeConverter(remotingToolset);

        byte[] result = converter.Convert(document);
        remotingToolset.Unload();

Windows event viewer error likes that
Faulting application name: iisexpress.exe, version: 10.0.17763.1, time stamp: 0xc5191a01
Faulting module name: wkhtmltox.dll_unloaded, version: 0.12.2.1, time stamp: 0x54bd024e
Exception code: 0xc00001a5
Fault offset: 0x00fe4ab1
Faulting process id: 0x5470
Faulting application start time: 0x01d4fb68100115f7
Faulting application path: C:\Program Files (x86)\IIS Express\iisexpress.exe
Faulting module path: wkhtmltox.dll
Report Id: 87e9a0cf-b084-480a-a673-da1bd5d87976
Faulting package full name:
Faulting package-relative application ID:

Notes:
1)I dont get this error every time.
2)my html url is not local url.
3)if i wait thread 1000 ms before remotingToolset.Unload(), frequency of the error decreases.

@jackiemanzzz
Copy link
Author

Is there anyone to suggest something?

@zkshbz
Copy link

zkshbz commented Sep 30, 2022

Just use static object for
TempFolderDeployment(); Win32EmbeddedDeployment(tempFolderDeployment);
RemotingToolset(win32EmbeddedDeployment);

Its written in readMe file. I also changed tempFolder to staticFolder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants