Thread Abort

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Converter for .NET (v1)  /  Re: Thread Abort

DynamicPDF Converter for .NET (v1) Forum

 Apr 19 2011 1:40 PM
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.
 Apr 19 2011 2:36 PM
Posted by a ceTe Software moderator
Hello,

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.
 Apr 12 2023 3:28 PM
I 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?
 Apr 13 2023 9:51 AM
Posted by a ceTe Software moderator
Hi,

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

All times are US Eastern Standard time. The time now is 8:05 PM.