We are generating PDFs from HTML using your converter component. While the conversion works most of the time, we've gotten the following exception:
Message: Thread was being aborted.
Stack Trace: at g.a(Object A_0) at g.a() at b.f() at ceTe.DynamicPDF.Conversion.Converter.Convert(String sourceFilePath, String outputFilePath, ConversionOptions conversionOptions) at ceTe.DynamicPDF.Conversion.Converter.Convert(String inputFilePath, ConversionOptions options, Byte[] appendToPdf) at ceTe.DynamicPDF.Conversion.Converter.ConvertHtmlString(String htmlString, HtmlConversionOptions options, Byte[] appendToPdf) at ceTe.DynamicPDF.Conversion.Converter.ConvertHtmlString(String htmlString) at
The converter component is being called from an aspx web service. The service is hosted on a Windows 2003 server system. The html string varies a bit based upon user input. We used the same input that resulted in a failure initially and the conversion succeeded.
Thread Abort
Re: Thread Abort
Support · Apr 19, 2011Hello,
Since you are calling the Converter from a web service, one possible reason why you might receive this exception would be if for some reason the web service restarts causing all the running threads to abort. Please check to see why the web service might have gotten restarted, one such reason would be that if the web.config of the web service was modified and saved it or there is an error in some other part of the web service causing the service to restart.
Thanks,
ceTe Software Support Team.
Re: Thread Abort
Forum member · Apr 12, 2023I have C# application where main thread will spin a thread for each print job
for each job
Thread t = new Thread(new ParameterizedThreadStart(PrintingTimeoutThreadProc));
PrintingParams p = new PrintingParams(job.printerName, job.htmlBody)
.Start(p);
private void PrintingTimeoutThreadProc(object data)
{
PrintingParams printingParams = data as PrintingParams;
...
byte[] fileData = Converter.Convert(data .htmlBody, conversionOptions);
...
// send byte array to printer
}
My question is the Converter.Convert(data .htmlBody, conversionOptions) call thread safe?
Re: Thread Abort
Support · Apr 13, 2023Hi,
The latest version of DynamicPDF Converter supports Asynchronous conversions, and it is thread safe. You can refer to the documentation on Asynchronous conversions here
.
Thanks,
ceTe Software Support