C# .NET Core wrapper for wkhtmltopdf library that uses Webkit engine to convert HTML pages to PDF.
GNU Lesser General Public License v3.0
366
stars
66
forks
source link
将HTML字符串转换为PDF文件,抛出异常System.ExecutionEngineException(重复,需要删除) #131
Closed
wtujvk closed 3 months ago
业务调用代码:
var result = PdfConverter.Convert(htmlToPdfDocument);
多次调用代码,批量导出PDF文件,目前的文件约20个。
异常发生的代码 (内部)
public bool Convert(IntPtr converter) { return wkhtmltopdf_convert(converter); }
converter值为 0x00000189098f64b0
堆栈信息:
WkHtmlToPdfDotNet.dll!WkHtmlToPdfDotNet.WkHtmlModule.Convert(System.IntPtr converter) 行 94 C# WkHtmlToPdfDotNet.dll!WkHtmlToPdfDotNet.PdfTools.DoConversion(System.IntPtr converter) 行 130 C# WkHtmlToPdfDotNet.dll!WkHtmlToPdfDotNet.BasicConverter.Convert(WkHtmlToPdfDotNet.Contracts.IDocument document) 行 50 C# WkHtmlToPdfDotNet.dll!WkHtmlToPdfDotNet.SynchronizedConverter.Convert.AnonymousMethod__0() 行 37 C# System.Private.CoreLib.dll!System.Threading.Tasks.Task<byte[]>.InnerInvoke() 未知 System.Private.CoreLib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) 未知 System.Private.CoreLib.dll!System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref System.Threading.Tasks.Task currentTaskSlot, System.Threading.Thread threadPoolThread) 未知 System.Private.CoreLib.dll!System.Threading.Tasks.ThreadPoolTaskScheduler.TryExecuteTaskInline(System.Threading.Tasks.Task task, bool taskWasPreviouslyQueued) 未知 System.Private.CoreLib.dll!System.Threading.Tasks.TaskScheduler.TryRunInline(System.Threading.Tasks.Task task, bool taskWasPreviouslyQueued) 未知 System.Private.CoreLib.dll!System.Threading.Tasks.Task.InternalRunSynchronously(System.Threading.Tasks.TaskScheduler scheduler, bool waitForCompletion) 未知 WkHtmlToPdfDotNet.dll!WkHtmlToPdfDotNet.SynchronizedConverter..ctor.AnonymousMethod__3_0() 行 32 C# System.Private.CoreLib.dll!System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread threadPoolThread, System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) 未知 System.Private.CoreLib.dll!System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref System.Threading.Tasks.Task currentTaskSlot, System.Threading.Thread threadPoolThread) 未知 System.Private.CoreLib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch() 未知 System.Private.CoreLib.dll!System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() 未知 System.Private.CoreLib.dll!System.Threading.Thread.StartCallback() 未知